tegra20: rework UART GPIO handling
Subsystems (2)
PATCH 1/1 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
--- arch/arm/cpu/arm720t/tegra20/board.h | 2 +- arch/arm/cpu/arm720t/tegra20/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 | 10 ++++++---- board/nvidia/harmony/harmony.c | 7 ------- board/nvidia/seaboard/seaboard.c | 2 +- board/nvidia/whistler/whistler.c | 7 -------
9 Dateien ge?ndert, 8 Zeilen hinzugef?gt(+), 45 Zeilen entfernt(-)
arch/arm/cpu/arm720t/tegra20/board.h +1 -1
@@ -22,4 +22,4 @@*/ void board_init_uart_f (void ); -void gpio_config_uart (void ); +void gpio_early_init_uart (void );
arch/arm/cpu/arm720t/tegra20/spl.c +0 -4
@@ -65,11 +65,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
board/avionic-design/common/tamonten.c +0 -7
@@ -41,13 +41,6 @@#include <mmc.h> #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 )
board/compal/paz00/paz00.c +0 -7
@@ -24,13 +24,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Paz00 - no conflict w/SPI. -*/ -void gpio_config_uart (void ) -{ -}#ifdef CONFIG_TEGRA_MMC /*
board/compulab/trimslice/trimslice.c +0 -7
@@ -34,13 +34,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on TrimSlice - no UART-related GPIOs. -*/ -void gpio_config_uart (void ) -{ -}void pin_mux_spi (void ) {
board/nvidia/common/board.c +6 -4
@@ -72,6 +72,11 @@ 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
@@ -156,11 +161,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 */
board/nvidia/harmony/harmony.c +0 -7
@@ -33,13 +33,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Harmony - no conflict w/SPI. -*/ -void gpio_config_uart (void ) -{ -}#ifdef CONFIG_TEGRA_MMC /*
board/nvidia/seaboard/seaboard.c +1 -1
@@ -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 ;
board/nvidia/whistler/whistler.c +0 -7
@@ -34,13 +34,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Whistler - no UART-related GPIOs. -*/ -void gpio_config_uart (void ) -{ -}/* * Routine: pin_mux_mmc
Signature · 1 line
1.7.11.4
PATCH 1/1 tegra20: rework UART GPIO handling
Quoted 10 lines · Lucas Stach
Rename board provided
gpio_config_uart()togpio_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 withCONFIG_UART_SWITCHdefined.Also provide a weak symbol for this function, to avoid the need to provide this function for boards that don't need any fixup.
Quoted 5 lines
This patch supersedes the earlier posted
"tegra: convertgpio_config_uartto weak symbol".
Build tested with MAKEALL -s tegra20Signed-off-by Lucas Stach <[email protected]>
I think this seems reasonable. However, a couple others should comment, so I'm CCing them and quoting the whole patch.
Simon Glass should comment because he created the UART switch code. Allen Martin should comment, since it looks like both SPL and non-SPL end up calling gpio_early_init_uart(); is that duplication correct or problematic?
Quoted 171 lines
--- arch/arm/cpu/arm720t/tegra20/board.h | 2 +- arch/arm/cpu/arm720t/tegra20/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 | 10 ++++++---- board/nvidia/harmony/harmony.c | 7 ------- board/nvidia/seaboard/seaboard.c | 2 +- board/nvidia/whistler/whistler.c | 7 -------9 Dateien ge?ndert, 8 Zeilen hinzugef?gt(+), 45 Zeilen entfernt(-)
arch/arm/cpu/arm720t/tegra20/board.h +1
-1@@ -22,4 +22,4 @@*/ void board_init_uart_f (void ); -void gpio_config_uart (void ); +void gpio_early_init_uart (void );arch/arm/cpu/arm720t/tegra20/spl.c +0
-4@@ -65,11 +65,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 board/avionic-design/common/tamonten.c +0
-7@@ -41,13 +41,6 @@#include <mmc.h> #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 )board/compal/paz00/paz00.c +0
-7@@ -24,13 +24,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Paz00 - no conflict w/SPI. -*/ -void gpio_config_uart (void ) -{ -}#ifdef CONFIG_TEGRA_MMC /* board/compulab/trimslice/trimslice.c +0
-7@@ -34,13 +34,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on TrimSlice - no UART-related GPIOs. -*/ -void gpio_config_uart (void ) -{ -}void pin_mux_spi (void ) {board/nvidia/common/board.c +6
-4@@ -72,6 +72,11 @@ 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 @@ -156,11 +161,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 */ board/nvidia/harmony/harmony.c +0
-7@@ -33,13 +33,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Harmony - no conflict w/SPI. -*/ -void gpio_config_uart (void ) -{ -}#ifdef CONFIG_TEGRA_MMC /* board/nvidia/seaboard/seaboard.c +1
-1@@ -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 ;board/nvidia/whistler/whistler.c +0
-7@@ -34,13 +34,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Whistler - no UART-related GPIOs. -*/ -void gpio_config_uart (void ) -{ -}/* * Routine: pin_mux_mmc
PATCH 1/1 tegra20: rework UART GPIO handling
Quoted 11 lines · Stephen Warren
Quoted 10 lines · Lucas Stach
Rename board provided
gpio_config_uart()togpio_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 withCONFIG_UART_SWITCHdefined.Also provide a weak symbol for this function, to avoid the need to provide this function for boards that don't need any fixup.
Quoted 5 lines
Quoted 5 lines
This patch supersedes the earlier posted
"tegra: convertgpio_config_uartto weak symbol".
Build tested with MAKEALL -s tegra20Signed-off-by Lucas Stach <[email protected]>
Quoted 5 lines
I think this seems reasonable. However, a couple others should comment, so I'm CCing them and quoting the whole patch.
Simon Glass should comment because he created the UART switch code.
This change seems reasonable to me.
Quoted 3 lines
Allen Martin should comment, since it looks like both SPL and non-SPL end up calling
gpio_early_init_uart(); is that duplication correct or problematic?
OK so far as seaboard goes, but could perhaps do with a tidy up at some point.
Regards,
Simon
Quoted 173 lines
Quoted 172 lines
--- arch/arm/cpu/arm720t/tegra20/board.h | 2 +- arch/arm/cpu/arm720t/tegra20/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 | 10 ++++++---- board/nvidia/harmony/harmony.c | 7 ------- board/nvidia/seaboard/seaboard.c | 2 +- board/nvidia/whistler/whistler.c | 7 -------9 Dateien ge?ndert, 8 Zeilen hinzugef?gt(+), 45 Zeilen entfernt(-)
arch/arm/cpu/arm720t/tegra20/board.h +1
-1@@ -22,4 +22,4 @@*/ void board_init_uart_f (void ); -void gpio_config_uart (void ); +void gpio_early_init_uart (void );arch/arm/cpu/arm720t/tegra20/spl.c +0
-4@@ -65,11 +65,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 board/avionic-design/common/tamonten.c +0
-7@@ -41,13 +41,6 @@#include <mmc.h> #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 )board/compal/paz00/paz00.c +0
-7@@ -24,13 +24,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Paz00 - no conflict w/SPI. -*/ -void gpio_config_uart (void ) -{ -}#ifdef CONFIG_TEGRA_MMC /* board/compulab/trimslice/trimslice.c +0
-7@@ -34,13 +34,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on TrimSlice - no UART-related GPIOs. -*/ -void gpio_config_uart (void ) -{ -}void pin_mux_spi (void ) {board/nvidia/common/board.c +6
-4@@ -72,6 +72,11 @@ 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 @@ -156,11 +161,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 */ board/nvidia/harmony/harmony.c +0
-7@@ -33,13 +33,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Harmony - no conflict w/SPI. -*/ -void gpio_config_uart (void ) -{ -}#ifdef CONFIG_TEGRA_MMC /* board/nvidia/seaboard/seaboard.c +1
-1@@ -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 ;board/nvidia/whistler/whistler.c +0
-7@@ -34,13 +34,6 @@#include <mmc.h> #endif -/* -* Routine: gpio_config_uart -* Description: Does nothing on Whistler - no UART-related GPIOs. -*/ -void gpio_config_uart (void ) -{ -}/* * Routine: pin_mux_mmc