From patchwork Fri Nov 23 00:42:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1793191 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id F05BBDF24C for ; Fri, 23 Nov 2012 00:51:15 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbhRx-0004sY-Qy; Fri, 23 Nov 2012 00:48:57 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TbhRK-0004lq-P3 for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2012 00:48:20 +0000 Received: by mail-ob0-f177.google.com with SMTP id eh20so8359993obb.36 for ; Thu, 22 Nov 2012 16:48:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=FEat3WzGkVZ32VlAKrbDi4+A/oO8ZoMiDurmr2TLEiA=; b=OxO72bgzbRxB+QmAxpYf86H2kSCwjO3J8hztC4RaA3SuvCGdcW3YjrkiYBDm3iHKwX iuau8dvw9EWpw4Kffp+Eu/BfB0NPnM8dc9ywqd4YY8sQBJ6giwzeJGSQVzPy43OuEW2X Twu/PNHcIKCgUeX7WS+N3WkLZYP0Gq6FXjQPchyyS7mnYXWJfEGWwYaxdUxgNc73uviM bKQ/tTftcVVKQwAQQ+uRnechtANRAbQaUKKyC5b0RT2QaSn5LRh9Rxp2e4fxgMLGslXx OeWVUWWXoUwIhaJc19EJ/cly3xCAtH0rq9jMG9cZUuH4hqvX7il7uvDpeXznd6ccawp6 vVYA== Received: by 10.60.171.138 with SMTP id au10mr1657798oec.34.1353631698513; Thu, 22 Nov 2012 16:48:18 -0800 (PST) Received: from localhost (ip-64-134-239-153.public.wayport.net. [64.134.239.153]) by mx.google.com with ESMTPS id k9sm3526570oeg.6.2012.11.22.16.48.16 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 16:48:17 -0800 (PST) From: Anton Vorontsov To: Andrew Morton Subject: [PATCH 4/4] ARM: versatile: Make able to use UART ports for KGDB FIQ debugger Date: Thu, 22 Nov 2012 16:42:47 -0800 Message-Id: <1353631367-4107-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: ALoCoQmt/TAUcCQcsE5laIWhtBsB2H1KfAqIIvRDwMh6Sp91s0q4QWIXw6nFxEGIgjBWs8kixC+T X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121122_194818_958966_42BA6D62 X-CRM114-Status: GOOD ( 15.28 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linaro-kernel@lists.linaro.org, Russell King , patches@linaro.org, linux-kernel@vger.kernel.org, John Stultz , Jason Wessel , kernel-team@android.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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);