From patchwork Mon Mar 19 20:27:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,5/5] tegra: Implement board_pre_console_panic() for Seaboard Date: Mon, 19 Mar 2012 10:27:04 -0000 From: Simon Glass X-Patchwork-Id: 147618 Message-Id: <1332188824-5447-5-git-send-email-sjg@chromium.org> To: U-Boot Mailing List Cc: Stephen Warren , Tom Warren We enable this feature on all UARTs for Seaboard. This ensures that a message is printed if CONFIG_OF_CONTROL is in use and a value device tree is not available. Signed-off-by: Simon Glass --- 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..3f69dfc 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -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_UART_ALL, CONFIG_DEFAULT_NS16550_CLK, + CONFIG_DEFAULT_NS16550_MULT, str); +}