From patchwork Wed Sep 19 23:42:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 11521 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 015F023E41 for ; Wed, 19 Sep 2012 23:49:42 +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 3A63AA19152 for ; Wed, 19 Sep 2012 23:49:41 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so2023684iej.11 for ; Wed, 19 Sep 2012 16:49:41 -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=VmkSUB7TL/P7vVHUVKbw0cDQdJ8ouZsltwHmryjsA8Q=; b=G5OsHC+ryALh5DjBPtBRPA67b5f6+3JL4inNeQwQfH3Sjy22CdPYWUGJ28+43QeWX8 EXLVPptzpzVUpzWS3sCjHRncQtvQbNX8akKfWL9Eth8gpydAQL2sd4nrvLdZtI783f42 xb5QqApbGpQ4BRKuhuEPCQ1brsLhERmqAFbywbYtHIF+igpyIRYtRjZV5aBU538NdBB4 DkFnY8jqhm3yq1ZG0LInI7jITYVNFr5PIr+RD57ibACw7Hj56e5OuCPArGOeJn9HYHsZ DBfJj1FPK/rOlO7Y0Mm187EGOpyFSpxyKi6gdzIH5ZDN6+fxHwCiiH+OkpxxOa7b3yfB Pmbg== Received: by 10.50.237.41 with SMTP id uz9mr94066igc.43.1348098581016; Wed, 19 Sep 2012 16:49:41 -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 ex8csp49807igc; Wed, 19 Sep 2012 16:49:40 -0700 (PDT) Received: by 10.66.88.3 with SMTP id bc3mr935025pab.51.1348098580101; Wed, 19 Sep 2012 16:49:40 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id b10si2181336pav.329.2012.09.19.16.49.39 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Sep 2012 16:49:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.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-pb0-f50.google.com with SMTP id md12so3894116pbc.37 for ; Wed, 19 Sep 2012 16:49:39 -0700 (PDT) Received: by 10.68.237.38 with SMTP id uz6mr2146911pbc.23.1348098579888; Wed, 19 Sep 2012 16:49:39 -0700 (PDT) Received: from localhost (ip-64-134-220-225.public.wayport.net. [64.134.220.225]) by mx.google.com with ESMTPS id jz10sm2553537pbc.8.2012.09.19.16.49.36 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 19 Sep 2012 16:49:39 -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 , Thomas Gleixner , 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 11/11] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Date: Wed, 19 Sep 2012 16:42:02 -0700 Message-Id: <1348098122-11041-11-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <20120919234003.GA24143@lizard> References: <20120919234003.GA24143@lizard> X-Gm-Message-State: ALoCoQkuvt3JiAFj+ti0BSWzdPP20FHQMiL16F6OD1wf7vaLA22J6f4wUZpre8Hbm6uEQ5lAISgl 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 fa10a2d..2bf83c6 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);