[U-Boot] [PATCH v2 5/5] tegra: Implement board_pre_console_panic() for Seaboard

Simon Glass sjg at chromium.org
Tue Mar 20 05:59:18 CET 2012


We enable this feature on UARTD for Seaboard. This ensures that a
message is printed if CONFIG_OF_CONTROL is in use and a valid device tree
is not available (provided the Seaboard variant uses UARTD for console).

Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v2:
- Correctly use only selected UARTs in tegra_pre_console_panic()
- Only use UARTD for Seaboard

 board/nvidia/seaboard/seaboard.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 94efb1e..1862162 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -24,6 +24,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/tegra2.h>
+#include <asm/arch/board.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/funcmux.h>
 #include <asm/arch/pinmux.h>
@@ -96,3 +97,20 @@ void pin_mux_usb(void)
 	/* For USB's GPIO PD0. For now, since we have no pinmux in fdt */
 	pinmux_tristate_disable(PINGRP_SLXK);
 }
+
+/*
+ * This is called when we have no console. About the only reason that this
+ * happen is if we don't have a valid fdt. So we don't know what kind of
+ * Tegra board we are. We blindly try to print a message every which way we
+ * know.
+ */
+void board_pre_console_panic(const char *str)
+{
+	/* Seaboard has a UART switch on PI3 */
+#ifdef CONFIG_SPI_UART_SWITCH
+	gpio_direction_output(GPIO_PI3, 0);
+#endif
+
+	tegra_pre_console_panic(TEGRA_UARTD, CONFIG_DEFAULT_NS16550_CLK,
+				CONFIG_DEFAULT_NS16550_MULT, str);
+}
-- 
1.7.7.3



More information about the U-Boot mailing list