From patchwork Tue Sep 11 09:35:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 11302 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3471A23EFE for ; Tue, 11 Sep 2012 09:38:33 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id DA143A18F41 for ; Tue, 11 Sep 2012 09:38:32 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so513911iea.11 for ; Tue, 11 Sep 2012 02:38:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=IZfkx2IAA1v6NbGGo2Zp1hhwguTNVOH6OvsZ8irrdZQ=; b=QmZd5zCBeOkdAjFMhpNEksU/DEideVFpkpWw8fd52tm82lHvluRjqaWFibcQerle1v B1XJszvN0ILBsZA75e0baswp6dyGNtsblGiLSU4AQ5XbX1k7j7exdEslnucZhnRsv8+0 7kNOH+JTeBtIDzAWjQKnZ0vXvicaOClMnJUOCt7viqtmJ5BlhKJoKCF7bQ61a31t8qhF La1xjRkBQV7X4lNstChuptGnKb5YxCzscovyF/c8ZihCoLeBk6HB74GpgOq0fGM4SGpy gWotMEv5k5NSPp2UULaJ4Pn9TXMYudeMsh7RjWcbD3OBk+VF9Fbao1Kdaff67r8WTufR E58A== Received: by 10.50.242.3 with SMTP id wm3mr15216771igc.0.1347356312650; Tue, 11 Sep 2012 02:38:32 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp4793igc; Tue, 11 Sep 2012 02:38:32 -0700 (PDT) Received: by 10.68.240.7 with SMTP id vw7mr10544146pbc.152.1347356311975; Tue, 11 Sep 2012 02:38:31 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id pf8si8383073pbc.349.2012.09.11.02.38.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 02:38:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by mail-pz0-f50.google.com with SMTP id e7so253265dad.37 for ; Tue, 11 Sep 2012 02:38:31 -0700 (PDT) Received: by 10.68.135.67 with SMTP id pq3mr10709766pbb.49.1347356311753; Tue, 11 Sep 2012 02:38:31 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id ox5sm3321915pbc.75.2012.09.11.02.38.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 02:38:31 -0700 (PDT) From: Anton Vorontsov To: Andrew Morton , Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Cc: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Colin Cross , Brian Swetland , John Stultz , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com, kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Subject: [PATCH 12/12] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Date: Tue, 11 Sep 2012 02:35:06 -0700 Message-Id: <1347356106-25368-12-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <20120911093042.GA12471@lizard> References: <20120911093042.GA12471@lizard> X-Gm-Message-State: ALoCoQmg2gFvlNpDjZDUEqwH8unt5Su8pWFn7lWFJUuaZklXQZN4KYIHw51udqXixwXXlgrCzNW+ If enabled, kernel will able to enter KGDB upon serial line activity on UART ports. Note that even with this patch and CONFIG_KGDB_FIQ is enabled, you still need to pass kgdb_fiq.enable=1 kernel command line option, otherwise UART will behave in a normal way. By default UART0 is used, but this can be changed via kgdb_fiq.uart_num kernel command line option. Signed-off-by: Anton Vorontsov --- arch/arm/Kconfig | 1 + arch/arm/mach-versatile/Makefile | 1 + arch/arm/mach-versatile/kgdb_fiq.c | 31 +++++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 arch/arm/mach-versatile/kgdb_fiq.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index c978c74..1a9881a 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -336,6 +336,7 @@ config ARCH_VERSATILE select PLAT_VERSATILE_CLCD select PLAT_VERSATILE_FPGA_IRQ select ARM_TIMER_SP804 + select ARCH_MIGHT_HAVE_KGDB_FIQ help This enables support for ARM Ltd Versatile board. diff --git a/arch/arm/mach-versatile/Makefile b/arch/arm/mach-versatile/Makefile index 81fa3fe..bfd761f 100644 --- a/arch/arm/mach-versatile/Makefile +++ b/arch/arm/mach-versatile/Makefile @@ -7,3 +7,4 @@ obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o obj-$(CONFIG_MACH_VERSATILE_DT) += versatile_dt.o obj-$(CONFIG_PCI) += pci.o +obj-$(CONFIG_KGDB_FIQ) += kgdb_fiq.o diff --git a/arch/arm/mach-versatile/kgdb_fiq.c b/arch/arm/mach-versatile/kgdb_fiq.c new file mode 100644 index 0000000..3cdf71d --- /dev/null +++ b/arch/arm/mach-versatile/kgdb_fiq.c @@ -0,0 +1,31 @@ +/* + * KGDB FIQ board support + * + * Copyright 2012 Linaro Ltd. + * Anton Vorontsov + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published + * by the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include + +static int kgdb_fiq; +module_param_named(uart_num, kgdb_fiq, int, 0600); +MODULE_PARM_DESC(uart_num, "UART port to use for KGDB FIQ"); + +static int __init kgdb_fiq_init(void) +{ + WARN_ON(kgdb_fiq > INT_UARTINT2 - INT_UARTINT0); + + return kgdb_register_fiq(INT_UARTINT0 + kgdb_fiq, + vic_fiq_select, + vic_is_fiq_rised); +} +console_initcall(kgdb_fiq_init);