From patchwork Mon Sep 24 21:28:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 11694 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 6478223E41 for ; Mon, 24 Sep 2012 21:33:53 +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 16C21A18023 for ; Mon, 24 Sep 2012 21:33:52 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so11249367iej.11 for ; Mon, 24 Sep 2012 14:33:52 -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=gliw0APSPv+AxKpXLbgy1WN0riLYqwbCYlI4CPGFmOw=; b=WGAivGBbV8hyNf/0dIXasRh8mAj/iWbvOMF82Zwqr/NWVlGJf77QjBuQ9haIc6L3VG 1MXo5n+xMZZPiB+PeP+wcDfvj8MjrQJ/0DRJluS09kimpOysfqTMEG1cFhOtoYBzvlnL y2VDqe//BCtpbacH6fXjP4g9Xv10R4uAsQqkNNi6rU+DCMC+MYAxIY/EfRcMM5GuPhGc WfA5uAS2+Lt/k6qEP3I6YRIGBrW2jwnVOS4QOy8oNbJ2a9RjUK1A6a/UyBV93PLvprPb njtZV595BRwB44avQ1bLrmGKcwHRw9WimSRtPrUhH6a2cZjZZf/JLgj0uoL34UeBBDg2 qGag== Received: by 10.50.195.134 with SMTP id ie6mr6502419igc.28.1348522432883; Mon, 24 Sep 2012 14:33:52 -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 ex8csp263685igc; Mon, 24 Sep 2012 14:33:52 -0700 (PDT) Received: by 10.66.79.166 with SMTP id k6mr35622931pax.44.1348522431889; Mon, 24 Sep 2012 14:33:51 -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 ts2si20850902pbc.86.2012.09.24.14.33.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 14:33:51 -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 md12so13997645pbc.37 for ; Mon, 24 Sep 2012 14:33:51 -0700 (PDT) Received: by 10.66.79.38 with SMTP id g6mr35668843pax.40.1348522431652; Mon, 24 Sep 2012 14:33:51 -0700 (PDT) Received: from localhost (ip-64-134-232-154.public.wayport.net. [64.134.232.154]) by mx.google.com with ESMTPS id gt2sm10172201pbc.62.2012.09.24.14.33.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 14:33:50 -0700 (PDT) From: Anton Vorontsov To: Greg Kroah-Hartman , Russell King Cc: Alan Cox , Jason Wessel , =?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 11/11] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Date: Mon, 24 Sep 2012 14:28:00 -0700 Message-Id: <1348522080-32629-11-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.12 In-Reply-To: <20120924212648.GA27605@lizard> References: <20120924212648.GA27605@lizard> X-Gm-Message-State: ALoCoQlgOaJVzhPP6dqys8xPGCF6mvtcGOuwLyx2G4W0jFfhUrnwkjBILMcrO4v7PDjnau3Cz7h0 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);