From patchwork Mon Sep 1 02:06:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 384613 X-Patchwork-Delegate: albert.aribaud@free.fr Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id C9F96140093 for ; Mon, 1 Sep 2014 12:07:55 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2BBAA74E5; Mon, 1 Sep 2014 04:07:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QJMxrnWu-XwV; Mon, 1 Sep 2014 04:07:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EC331A7528; Mon, 1 Sep 2014 04:07:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A9295A73FF for ; Mon, 1 Sep 2014 04:07:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bYxTORUzCNXy for ; Mon, 1 Sep 2014 04:07:20 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 10F70A7463 for ; Mon, 1 Sep 2014 04:07:13 +0200 (CEST) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile13) with ESMTP id s8126oM2002857; Mon, 1 Sep 2014 11:06:50 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili17) with ESMTP id s8126oA11332; Mon, 1 Sep 2014 11:06:50 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id s8126oBo018027; Mon, 1 Sep 2014 11:06:50 +0900 Received: from poodle by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s8126nBZ017980; Mon, 1 Sep 2014 11:06:49 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id 9A6902740043; Mon, 1 Sep 2014 11:06:49 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 1 Sep 2014 11:06:34 +0900 Message-Id: <1409537195-2726-6-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409537195-2726-1-git-send-email-yamada.m@jp.panasonic.com> References: <1409537195-2726-1-git-send-email-yamada.m@jp.panasonic.com> Cc: Stephen Warren , Przemyslaw Marczak , Darwin Rambo , Stefan Roese Subject: [U-Boot] [PATCH v3 5/6] arm: debug: add Kconfig entries for lowlevel debug X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de We have not had a good method to debug the early boot stage such as lowlevel_init function. I guess developers generally use dedicated debuggers for that, but it is difficult in some cases. (For example, my debugger cannot connect to the ARM processor when it is in the secure state. It sometimes happens when I need to debug the early boot stage on ARM SoCs with secure extension.) The low level debug feature in Linux would be also helpful for U-boot when we are stucking in nasty problems where the console is not available yet. You have to enable CONFIG_DEBUG_LL to use this feature. For now, only 8250-compatible UART devices are supported. You can add a header file under arch/arm/include/debug/ directory to support your UART device if necessary. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None arch/arm/Kconfig | 2 ++ arch/arm/Kconfig.debug | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/lib/Makefile | 2 ++ 3 files changed, 68 insertions(+) create mode 100644 arch/arm/Kconfig.debug diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e6bcec5..9cdd5f0 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -681,4 +681,6 @@ source "board/woodburn/Kconfig" source "board/xaeniax/Kconfig" source "board/zipitz2/Kconfig" +source "arch/arm/Kconfig.debug" + endmenu diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug new file mode 100644 index 0000000..624bcf4 --- /dev/null +++ b/arch/arm/Kconfig.debug @@ -0,0 +1,64 @@ +menu "ARM debug" + +config DEBUG_LL + bool "Low-level debugging functions" + depends on !ARM64 + help + Say Y here to include definitions of printascii, printch, printhex + in U-Boot. This is helpful if you are debugging code that + executes before the console is initialized. + +choice + prompt "Low-level debugging port" + depends on DEBUG_LL + + config DEBUG_LL_UART_8250 + bool "Low-level debugging via 8250 UART" + help + Say Y here if you wish the debug print routes to direct + their output to an 8250 UART. You can use this option + to provide the parameters for the 8250 UART rather than + selecting one of the platform specific options above if + you know the parameters for the port. + + This option is preferred over the platform specific + options; the platform specific options are deprecated + and will be soon removed. + +endchoice + +config DEBUG_LL_INCLUDE + string + depends on DEBUG_LL + default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250 + default "mach/debug-macro.S" + +# Compatibility options for 8250 +config DEBUG_UART_8250 + bool + +config DEBUG_UART_PHYS + hex "Physical base address of debug UART" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 + +# This is not used in U-Boot +config DEBUG_UART_VIRT + hex + default DEBUG_UART_PHYS + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 + +config DEBUG_UART_8250_SHIFT + int "Register offset shift for the 8250 debug UART" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 + default 2 + +config DEBUG_UART_8250_WORD + bool "Use 32-bit accesses for 8250 UART" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 + depends on DEBUG_UART_8250_SHIFT >= 2 + +config DEBUG_UART_8250_FLOW_CONTROL + bool "Enable flow control for 8250 UART" + depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 + +endmenu diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 1ef2400..d74e4b8 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -48,6 +48,8 @@ ifndef CONFIG_ARM64 obj-y += cache-cp15.o endif +obj-$(CONFIG_DEBUG_LL) += debug.o + # For EABI conformant tool chains, provide eabi_compat() ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS))) extra-y += eabi_compat.o