From patchwork Mon Sep 10 04:14:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 11280 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 B1A1523F26 for ; Mon, 10 Sep 2012 04:17:22 +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 6092BA1831C for ; Mon, 10 Sep 2012 04:17:22 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id k11so2310032iea.11 for ; Sun, 09 Sep 2012 21:17:22 -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:date:from :to:cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:x-gm-message-state; bh=D2xjkFAgBKzdGsjmfm8MpVKfvC4sSyaSNG8IKDDUVJk=; b=jblw/WDotm2P8zp/qjpLxNqSmtrK1N9HV1FjZaVB6sqd8H2QMb3yYL7IFk8NlZOFAI Y6CkOWIG1xj5dnUn8rGJdixYefmzYQuEZAbakSeHSzzj7L5y1PbKP57pKujVR7EQwDaX +mE9hzRDt7p25q5PIqre8/z+daR8MJZJYewL4RtmlvyRc04O7I2B8DINv8fjMmbRpq65 DxsQJgRsxdxDGOZ9nRGBMFxN5CFGO6lMnqsdd80iSiVm2Xsouiwpzy+xC3IgFNYFMzRD jIePKdhL2gDOgS9Wt8fAol1WCV4mUVZe6LBw2FShiDvck/yP4NoetuM2pjH5NXhUqH/+ ALuQ== Received: by 10.50.207.106 with SMTP id lv10mr9259663igc.0.1347250642164; Sun, 09 Sep 2012 21:17:22 -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 ex8csp73003igc; Sun, 9 Sep 2012 21:17:21 -0700 (PDT) Received: by 10.68.217.69 with SMTP id ow5mr3848701pbc.35.1347250641474; Sun, 09 Sep 2012 21:17:21 -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 gh6si18550741pbc.177.2012.09.09.21.17.21 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 21:17:21 -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 md12so2061704pbc.37 for ; Sun, 09 Sep 2012 21:17:21 -0700 (PDT) Received: by 10.68.218.72 with SMTP id pe8mr3936435pbc.33.1347250641158; Sun, 09 Sep 2012 21:17:21 -0700 (PDT) Received: from localhost (ip-64-134-230-8.public.wayport.net. [64.134.230.8]) by mx.google.com with ESMTPS id jz10sm7442134pbc.8.2012.09.09.21.17.19 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 21:17:20 -0700 (PDT) Date: Sun, 9 Sep 2012 21:14:42 -0700 From: Anton Vorontsov To: Andrew Morton , Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Cc: Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , 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 14/14] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Message-ID: <20120910041442.GN29537@lizard> References: <20120910040802.GA1261@lizard> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120910040802.GA1261@lizard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQmg77tMD7tesnRmqYThLOa4+CBEo+3599uWzjA+fyf57oTRPBxhh/mZgV6d84++fpEf2yNw 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 66f4f81..5972886 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);