All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wenyou Yang <wenyou.yang@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 4/8] board: sama5d4_xplained: enable early debug UART
Date: Fri, 28 Oct 2016 15:16:45 +0800	[thread overview]
Message-ID: <1477639009-10675-5-git-send-email-wenyou.yang@atmel.com> (raw)
In-Reply-To: <1477639009-10675-1-git-send-email-wenyou.yang@atmel.com>

Enable early debug UART to debug problems when an ICE or other
debug mechanism is not available.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

Changes in v2: None

 board/atmel/sama5d4_xplained/sama5d4_xplained.c | 15 ++++++++++++++-
 configs/sama5d4_xplained_mmc_defconfig          |  6 ++++++
 configs/sama5d4_xplained_nandflash_defconfig    |  6 ++++++
 configs/sama5d4_xplained_spiflash_defconfig     |  6 ++++++
 include/configs/sama5d4_xplained.h              |  2 ++
 5 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/board/atmel/sama5d4_xplained/sama5d4_xplained.c b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
index 2b51e4c..c46a7a4 100644
--- a/board/atmel/sama5d4_xplained/sama5d4_xplained.c
+++ b/board/atmel/sama5d4_xplained/sama5d4_xplained.c
@@ -16,6 +16,7 @@
 #include <asm/arch/sama5d3_smc.h>
 #include <asm/arch/sama5d4.h>
 #include <atmel_hlcdc.h>
+#include <debug_uart.h>
 #include <lcd.h>
 #include <net.h>
 #include <netdev.h>
@@ -197,12 +198,24 @@ static void sama5d4_xplained_serial3_hw_init(void)
 	at91_periph_clk_enable(ATMEL_ID_USART3);
 }
 
-int board_early_init_f(void)
+#ifdef CONFIG_DEBUG_UART_BOARD_INIT
+void board_debug_uart_init(void)
 {
 	sama5d4_xplained_serial3_hw_init();
+}
+#endif
 
+#ifdef CONFIG_BOARD_EARLY_INIT_F
+int board_early_init_f(void)
+{
+#ifdef CONFIG_DEBUG_UART
+	debug_uart_init();
+#else
+	sama5d4_xplained_serial3_hw_init();
+#endif
 	return 0;
 }
+#endif
 
 int board_init(void)
 {
diff --git a/configs/sama5d4_xplained_mmc_defconfig b/configs/sama5d4_xplained_mmc_defconfig
index e25b26a..e7518e8 100644
--- a/configs/sama5d4_xplained_mmc_defconfig
+++ b/configs/sama5d4_xplained_mmc_defconfig
@@ -46,6 +46,12 @@ CONFIG_SPI_FLASH_ATMEL=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=0xfc00c000
+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/sama5d4_xplained_nandflash_defconfig b/configs/sama5d4_xplained_nandflash_defconfig
index 53dfdd6..790d7d1 100644
--- a/configs/sama5d4_xplained_nandflash_defconfig
+++ b/configs/sama5d4_xplained_nandflash_defconfig
@@ -45,6 +45,12 @@ CONFIG_SPI_FLASH_ATMEL=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=0xfc00c000
+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/sama5d4_xplained_spiflash_defconfig b/configs/sama5d4_xplained_spiflash_defconfig
index 17fd9a2..af6263f 100644
--- a/configs/sama5d4_xplained_spiflash_defconfig
+++ b/configs/sama5d4_xplained_spiflash_defconfig
@@ -45,6 +45,12 @@ CONFIG_SPI_FLASH_ATMEL=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=0xfc00c000
+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/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
index 1173583..8032164 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -15,6 +15,8 @@
 
 #include "at91-sama5_common.h"
 
+#define CONFIG_BOARD_EARLY_INIT_F
+
 /* SDRAM */
 #define CONFIG_NR_DRAM_BANKS		1
 #define CONFIG_SYS_SDRAM_BASE           ATMEL_BASE_DDRCS
-- 
2.7.4

  parent reply	other threads:[~2016-10-28  7:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  7:16 [U-Boot] [PATCH v2 0/8] board: sama5d4: convert boards to support DM/DT Wenyou Yang
2016-10-28  7:16 ` [U-Boot] [PATCH v2 1/8] configs: at91-sama5_common: fix for CONFIG_AT91_GPIO Wenyou Yang
2017-02-04 22:11   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-10-28  7:16 ` [U-Boot] [PATCH v2 2/8] board: sama5d4_xplained: move config options to defconfig Wenyou Yang
2017-02-04 22:20   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2017-02-04 22:33   ` Andreas Bießmann
2017-02-04 22:44   ` Andreas Bießmann
2016-10-28  7:16 ` [U-Boot] [PATCH v2 3/8] board: sama5d4_xplained: clean up code Wenyou Yang
2017-02-04 22:47   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-10-28  7:16 ` Wenyou Yang [this message]
2017-02-04 22:49   ` [U-Boot] [U-Boot, v2, 4/8] board: sama5d4_xplained: enable early debug UART Andreas Bießmann
2016-10-28  7:16 ` [U-Boot] [PATCH v2 5/8] board: sama5d4ek: move config options to defconfig Wenyou Yang
2017-02-04 22:56   ` [U-Boot] [U-Boot, v2, " Andreas Bießmann
2016-10-28  7:16 ` [U-Boot] [PATCH v2 6/8] board: sama5d4ek: clean up code Wenyou Yang
2017-02-06  9:11   ` Andreas Bießmann
2016-10-28  7:16 ` [U-Boot] [PATCH v2 7/8] board: sama5d4ek: enable early debug UART Wenyou Yang
2017-02-06  9:11   ` Andreas Bießmann
2016-10-28  7:16 ` [U-Boot] [PATCH v2 8/8] configs: sama5d4: move CONFIG_SYS_NO_FLASH to *defconfig Wenyou Yang
2017-02-06  9:12   ` Andreas Bießmann
2017-02-06 19:52 ` [U-Boot] [PATCH v2 0/8] board: sama5d4: convert boards to support DM/DT Andreas Bießmann
2017-02-07  6:15   ` Wenyou.Yang at microchip.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1477639009-10675-5-git-send-email-wenyou.yang@atmel.com \
    --to=wenyou.yang@atmel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.