From 0cd10c7abf3d210c921a0e5c86c2abdbf98c68c5 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Tue, 25 Sep 2012 20:21:14 +0000 Subject: [PATCH] tegra20: rework UART GPIO handling Rename board provided gpio_config_uart() to gpio_early_init_uart() as it does the same thing as the equally called function provided by the uart-switch code. This allows to simply call this function in early board init whether or not we are building with CONFIG_UART_SWITCH defined. Also provide a weak symbol for this function, to avoid the need to provide this function for boards that don't need any fixup. This patch supersedes the earlier posted "tegra: convert gpio_config_uart to weak symbol". Build tested with MAKEALL -s tegra20 Signed-off-by: Lucas Stach Acked-by: Simon Glass Signed-off-by: Tom Warren --- arch/arm/cpu/arm720t/tegra-common/board.h | 2 +- arch/arm/cpu/arm720t/tegra-common/spl.c | 4 ---- board/avionic-design/common/tamonten.c | 7 ------- board/compal/paz00/paz00.c | 7 ------- board/compulab/trimslice/trimslice.c | 7 ------- board/nvidia/common/board.c | 12 ++++++++---- board/nvidia/harmony/harmony.c | 7 ------- board/nvidia/seaboard/seaboard.c | 2 +- board/nvidia/whistler/whistler.c | 7 ------- 9 files changed, 10 insertions(+), 45 deletions(-) diff --git a/arch/arm/cpu/arm720t/tegra-common/board.h b/arch/arm/cpu/arm720t/tegra-common/board.h index 61b91c005f..260767d543 100644 --- a/arch/arm/cpu/arm720t/tegra-common/board.h +++ b/arch/arm/cpu/arm720t/tegra-common/board.h @@ -22,4 +22,4 @@ */ void board_init_uart_f(void); -void gpio_config_uart(void); +void gpio_early_init_uart(void); diff --git a/arch/arm/cpu/arm720t/tegra-common/spl.c b/arch/arm/cpu/arm720t/tegra-common/spl.c index 3139c65128..dfe36b9a4b 100644 --- a/arch/arm/cpu/arm720t/tegra-common/spl.c +++ b/arch/arm/cpu/arm720t/tegra-common/spl.c @@ -63,11 +63,7 @@ void board_init_f(ulong dummy) board_init_uart_f(); /* Initialize periph GPIOs */ -#ifdef CONFIG_SPI_UART_SWITCH gpio_early_init_uart(); -#else - gpio_config_uart(); -#endif /* * We call relocate_code() with relocation target same as the diff --git a/board/avionic-design/common/tamonten.c b/board/avionic-design/common/tamonten.c index 7c05d492f4..e6a932ec3c 100644 --- a/board/avionic-design/common/tamonten.c +++ b/board/avionic-design/common/tamonten.c @@ -40,13 +40,6 @@ #include #endif -/* - * Routine: gpio_config_uart - * Description: Does nothing on Tamonten - no conflict w/SPI. - */ -void gpio_config_uart(void) -{ -} #ifdef CONFIG_BOARD_EARLY_INIT_F void gpio_early_init(void) diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c index c73ac5f0f4..0725989de0 100644 --- a/board/compal/paz00/paz00.c +++ b/board/compal/paz00/paz00.c @@ -24,13 +24,6 @@ #include #endif -/* - * Routine: gpio_config_uart - * Description: Does nothing on Paz00 - no conflict w/SPI. - */ -void gpio_config_uart(void) -{ -} #ifdef CONFIG_TEGRA_MMC /* diff --git a/board/compulab/trimslice/trimslice.c b/board/compulab/trimslice/trimslice.c index 7b22a87c46..9ef66fd865 100644 --- a/board/compulab/trimslice/trimslice.c +++ b/board/compulab/trimslice/trimslice.c @@ -34,13 +34,6 @@ #include #endif -/* - * Routine: gpio_config_uart - * Description: Does nothing on TrimSlice - no UART-related GPIOs. - */ -void gpio_config_uart(void) -{ -} void pin_mux_spi(void) { diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index 8821fdfeba..bd194bc966 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -71,6 +71,13 @@ void __pin_mux_spi(void) void pin_mux_spi(void) __attribute__((weak, alias("__pin_mux_spi"))); +void __gpio_early_init_uart(void) +{ +} + +void gpio_early_init_uart(void) +__attribute__((weak, alias("__gpio_early_init_uart"))); + /* * Routine: power_det_init * Description: turn off power detects @@ -155,11 +162,8 @@ int board_early_init_f(void) /* Initialize periph GPIOs */ gpio_early_init(); -#ifdef CONFIG_SPI_UART_SWITCH gpio_early_init_uart(); -#else - gpio_config_uart(); -#endif + return 0; } #endif /* EARLY_INIT */ diff --git a/board/nvidia/harmony/harmony.c b/board/nvidia/harmony/harmony.c index c23a87ddad..32ed9bb7d1 100644 --- a/board/nvidia/harmony/harmony.c +++ b/board/nvidia/harmony/harmony.c @@ -33,13 +33,6 @@ #include #endif -/* - * Routine: gpio_config_uart - * Description: Does nothing on Harmony - no conflict w/SPI. - */ -void gpio_config_uart(void) -{ -} #ifdef CONFIG_TEGRA_MMC /* diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c index ab90a5d574..4e8a183b8b 100644 --- a/board/nvidia/seaboard/seaboard.c +++ b/board/nvidia/seaboard/seaboard.c @@ -46,7 +46,7 @@ static void gpio_config_uart_seaboard(void) gpio_direction_output(GPIO_PI3, 0); } -void gpio_config_uart(void) +void gpio_early_init_uart(void) { if (machine_is_ventana()) return; diff --git a/board/nvidia/whistler/whistler.c b/board/nvidia/whistler/whistler.c index af918c4f36..592cd6b496 100644 --- a/board/nvidia/whistler/whistler.c +++ b/board/nvidia/whistler/whistler.c @@ -34,13 +34,6 @@ #include #endif -/* - * Routine: gpio_config_uart - * Description: Does nothing on Whistler - no UART-related GPIOs. - */ -void gpio_config_uart(void) -{ -} /* * Routine: pin_mux_mmc -- 2.30.2