From patchwork Fri Nov 23 00:31:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 13083 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 BA74123FC1 for ; Fri, 23 Nov 2012 00:35:13 +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 658E2A18BC7 for ; Fri, 23 Nov 2012 00:35:13 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1215221ieb.11 for ; Thu, 22 Nov 2012 16:35:13 -0800 (PST) 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=FEat3WzGkVZ32VlAKrbDi4+A/oO8ZoMiDurmr2TLEiA=; b=jY8NIloQ79Cjr8PpRbo8NGWT0GAZAedpaBTvVZ2E1ZjSJAguvZoW+Pb9JF93zS8RNI CBiN+960YsrsTONZ+qA8bYOaqv+wQtkLshkCRF6Uz13jEksjdJMNcFr8+Bov+zMgdRxa bRyoPDalAHZdcitUzM4j1YpwX0l8HVQXZT95LCiTqy7TZYIFWFSgDb1vFYkDAzEdJdeY w0T2hQJeEjc2Orgp75rTAtgeIrhsY6jXoq/KhYCO0jTSxfCbahW8B6rKWy7QbNd5FT6v fG1kh66GpuyBBtUsvrizBLuS8bO+TRUKoGSYoNJjqGP6qWUtERw5POxKdwSEAuv90pFp Lfkg== Received: by 10.43.46.2 with SMTP id um2mr1840540icb.18.1353630913185; Thu, 22 Nov 2012 16:35:13 -0800 (PST) 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.67.148 with SMTP id n20csp280999igt; Thu, 22 Nov 2012 16:35:12 -0800 (PST) Received: by 10.182.38.65 with SMTP id e1mr1654713obk.3.1353630912451; Thu, 22 Nov 2012 16:35:12 -0800 (PST) Received: from mail-oa0-f49.google.com (mail-oa0-f49.google.com [209.85.219.49]) by mx.google.com with ESMTPS id r3si4273895oef.46.2012.11.22.16.35.12 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 16:35:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.219.49 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.219.49; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.219.49 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-oa0-f49.google.com with SMTP id l10so8313533oag.36 for ; Thu, 22 Nov 2012 16:35:12 -0800 (PST) Received: by 10.182.18.196 with SMTP id y4mr1636808obd.52.1353630912176; Thu, 22 Nov 2012 16:35:12 -0800 (PST) Received: from localhost (ip-64-134-239-153.public.wayport.net. [64.134.239.153]) by mx.google.com with ESMTPS id 10sm3496263oeg.11.2012.11.22.16.35.10 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 16:35:11 -0800 (PST) From: Anton Vorontsov To: Andrew Morton Cc: Jason Wessel , John Stultz , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com, kgdb-bugreport@lists.sourceforge.net Subject: [PATCH 4/4] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Date: Thu, 22 Nov 2012 16:31:39 -0800 Message-Id: <1353630699-2866-4-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.8.0 In-Reply-To: <20121123002957.GA31679@lizard.mcd25758.sjc.wayport.net> References: <20121123002957.GA31679@lizard.mcd25758.sjc.wayport.net> X-Gm-Message-State: ALoCoQlq7+VNi+VCxm12fNH1hy+Aw3xifEmtcHr6tQl6gpGcM3vasWX5SVwnnEmDtptm6LHEKfZc 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 0bfa6cf..a94d9c5 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -337,6 +337,7 @@ config ARCH_VERSATILE select PLAT_VERSATILE_CLCD select PLAT_VERSATILE_CLOCK select PLAT_VERSATILE_FPGA_IRQ + 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);