From patchwork Tue Feb 7 09:11:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenyou Yang X-Patchwork-Id: 725052 X-Patchwork-Delegate: andreas.biessmann@googlemail.com 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 3vHdyR0rDqz9s2s for ; Tue, 7 Feb 2017 20:17:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 638EAA77FA; Tue, 7 Feb 2017 10:16:56 +0100 (CET) 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 qVOWJ6KllJyg; Tue, 7 Feb 2017 10:16:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2BAC1A77FE; Tue, 7 Feb 2017 10:16:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DE677A77F0 for ; Tue, 7 Feb 2017 10:16:51 +0100 (CET) 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 qdou3fRlRPSB for ; Tue, 7 Feb 2017 10:16:51 +0100 (CET) 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 eusmtp01.atmel.com (eusmtp01.atmel.com [212.144.249.242]) by theia.denx.de (Postfix) with ESMTPS id 82E2DB3873 for ; Tue, 7 Feb 2017 10:16:50 +0100 (CET) Received: from apsmtp01.atmel.com (10.168.254.31) by eusmtp01.atmel.com (10.145.145.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 7 Feb 2017 10:16:47 +0100 Received: from shaarm01.corp.atmel.com (10.168.254.13) by apsmtp01.atmel.com (10.168.254.31) with Microsoft SMTP Server id 14.3.235.1; Tue, 7 Feb 2017 17:21:27 +0800 From: Wenyou Yang To: U-Boot Mailing List Date: Tue, 7 Feb 2017 17:11:34 +0800 Message-ID: <20170207091135.23008-4-wenyou.yang@atmel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170207091135.23008-1-wenyou.yang@atmel.com> References: <20170207091135.23008-1-wenyou.yang@atmel.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 3/4] board: at91sam9x5ek: enable early debug UART X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Enable early debug UART to debug problems when an ICE or other debug mechanism is not available. Signed-off-by: Wenyou Yang Reviewed-by: Simon Glass --- Changes in v2: None board/atmel/at91sam9x5ek/at91sam9x5ek.c | 14 ++++++++++++++ configs/at91sam9x5ek_dataflash_defconfig | 6 ++++++ configs/at91sam9x5ek_mmc_defconfig | 6 ++++++ configs/at91sam9x5ek_nandflash_defconfig | 6 ++++++ configs/at91sam9x5ek_spiflash_defconfig | 6 ++++++ 5 files changed, 38 insertions(+) diff --git a/board/atmel/at91sam9x5ek/at91sam9x5ek.c b/board/atmel/at91sam9x5ek/at91sam9x5ek.c index 9bd5eaf363..77714db3e7 100644 --- a/board/atmel/at91sam9x5ek/at91sam9x5ek.c +++ b/board/atmel/at91sam9x5ek/at91sam9x5ek.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -192,11 +193,24 @@ int board_mmc_init(bd_t *bd) } #endif +#ifdef CONFIG_DEBUG_UART_BOARD_INIT +void board_debug_uart_init(void) +{ + at91_seriald_hw_init(); +} +#endif + +#ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); +#else at91_seriald_hw_init(); +#endif return 0; } +#endif int board_init(void) { diff --git a/configs/at91sam9x5ek_dataflash_defconfig b/configs/at91sam9x5ek_dataflash_defconfig index c3feca28bc..d7408e8b29 100644 --- a/configs/at91sam9x5ek_dataflash_defconfig +++ b/configs/at91sam9x5ek_dataflash_defconfig @@ -37,6 +37,12 @@ CONFIG_MACB=y CONFIG_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfffff200 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y diff --git a/configs/at91sam9x5ek_mmc_defconfig b/configs/at91sam9x5ek_mmc_defconfig index f4b0edd4ca..07f62fc38b 100644 --- a/configs/at91sam9x5ek_mmc_defconfig +++ b/configs/at91sam9x5ek_mmc_defconfig @@ -37,6 +37,12 @@ CONFIG_MACB=y CONFIG_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfffff200 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y diff --git a/configs/at91sam9x5ek_nandflash_defconfig b/configs/at91sam9x5ek_nandflash_defconfig index 5c3463260e..15ac465abd 100644 --- a/configs/at91sam9x5ek_nandflash_defconfig +++ b/configs/at91sam9x5ek_nandflash_defconfig @@ -44,6 +44,12 @@ CONFIG_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y CONFIG_ATMEL_USART=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfffff200 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y CONFIG_USB=y diff --git a/configs/at91sam9x5ek_spiflash_defconfig b/configs/at91sam9x5ek_spiflash_defconfig index 939a6bbd4a..d44d851848 100644 --- a/configs/at91sam9x5ek_spiflash_defconfig +++ b/configs/at91sam9x5ek_spiflash_defconfig @@ -37,6 +37,12 @@ CONFIG_MACB=y CONFIG_PINCTRL=y CONFIG_PINCTRL_AT91=y CONFIG_DM_SERIAL=y +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ATMEL=y +CONFIG_DEBUG_UART_BASE=0xfffff200 +CONFIG_DEBUG_UART_CLOCK=0 +CONFIG_DEBUG_UART_BOARD_INIT=y +CONFIG_DEBUG_UART_ANNOUNCE=y CONFIG_ATMEL_USART=y CONFIG_DM_SPI=y CONFIG_ATMEL_SPI=y