mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 10:26:10 +01:00 
			
		
		
		
	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 <dev@lynxeye.de> Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Warren <twarren@nvidia.com>
This commit is contained in:
		| @@ -22,4 +22,4 @@ | |||||||
|  */ |  */ | ||||||
|  |  | ||||||
| void board_init_uart_f(void); | void board_init_uart_f(void); | ||||||
| void gpio_config_uart(void); | void gpio_early_init_uart(void); | ||||||
|   | |||||||
| @@ -63,11 +63,7 @@ void board_init_f(ulong dummy) | |||||||
| 	board_init_uart_f(); | 	board_init_uart_f(); | ||||||
|  |  | ||||||
| 	/* Initialize periph GPIOs */ | 	/* Initialize periph GPIOs */ | ||||||
| #ifdef CONFIG_SPI_UART_SWITCH |  | ||||||
| 	gpio_early_init_uart(); | 	gpio_early_init_uart(); | ||||||
| #else |  | ||||||
| 	gpio_config_uart(); |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| 	/* | 	/* | ||||||
| 	 * We call relocate_code() with relocation target same as the | 	 * We call relocate_code() with relocation target same as the | ||||||
|   | |||||||
| @@ -40,13 +40,6 @@ | |||||||
| #include <mmc.h> | #include <mmc.h> | ||||||
| #endif | #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 | #ifdef CONFIG_BOARD_EARLY_INIT_F | ||||||
| void gpio_early_init(void) | void gpio_early_init(void) | ||||||
|   | |||||||
| @@ -24,13 +24,6 @@ | |||||||
| #include <mmc.h> | #include <mmc.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Routine: gpio_config_uart |  | ||||||
|  * Description: Does nothing on Paz00 - no conflict w/SPI. |  | ||||||
|  */ |  | ||||||
| void gpio_config_uart(void) |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| #ifdef CONFIG_TEGRA_MMC | #ifdef CONFIG_TEGRA_MMC | ||||||
| /* | /* | ||||||
|   | |||||||
| @@ -34,13 +34,6 @@ | |||||||
| #include <mmc.h> | #include <mmc.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Routine: gpio_config_uart |  | ||||||
|  * Description: Does nothing on TrimSlice - no UART-related GPIOs. |  | ||||||
|  */ |  | ||||||
| void gpio_config_uart(void) |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| void pin_mux_spi(void) | void pin_mux_spi(void) | ||||||
| { | { | ||||||
|   | |||||||
| @@ -71,6 +71,13 @@ void __pin_mux_spi(void) | |||||||
|  |  | ||||||
| void pin_mux_spi(void) __attribute__((weak, alias("__pin_mux_spi"))); | 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 |  * Routine: power_det_init | ||||||
|  * Description: turn off power detects |  * Description: turn off power detects | ||||||
| @@ -155,11 +162,8 @@ int board_early_init_f(void) | |||||||
|  |  | ||||||
| 	/* Initialize periph GPIOs */ | 	/* Initialize periph GPIOs */ | ||||||
| 	gpio_early_init(); | 	gpio_early_init(); | ||||||
| #ifdef CONFIG_SPI_UART_SWITCH |  | ||||||
| 	gpio_early_init_uart(); | 	gpio_early_init_uart(); | ||||||
| #else |  | ||||||
| 	gpio_config_uart(); |  | ||||||
| #endif |  | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| #endif	/* EARLY_INIT */ | #endif	/* EARLY_INIT */ | ||||||
|   | |||||||
| @@ -33,13 +33,6 @@ | |||||||
| #include <mmc.h> | #include <mmc.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Routine: gpio_config_uart |  | ||||||
|  * Description: Does nothing on Harmony - no conflict w/SPI. |  | ||||||
|  */ |  | ||||||
| void gpio_config_uart(void) |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| #ifdef CONFIG_TEGRA_MMC | #ifdef CONFIG_TEGRA_MMC | ||||||
| /* | /* | ||||||
|   | |||||||
| @@ -46,7 +46,7 @@ static void gpio_config_uart_seaboard(void) | |||||||
| 	gpio_direction_output(GPIO_PI3, 0); | 	gpio_direction_output(GPIO_PI3, 0); | ||||||
| } | } | ||||||
|  |  | ||||||
| void gpio_config_uart(void) | void gpio_early_init_uart(void) | ||||||
| { | { | ||||||
| 	if (machine_is_ventana()) | 	if (machine_is_ventana()) | ||||||
| 		return; | 		return; | ||||||
|   | |||||||
| @@ -34,13 +34,6 @@ | |||||||
| #include <mmc.h> | #include <mmc.h> | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* |  | ||||||
|  * Routine: gpio_config_uart |  | ||||||
|  * Description: Does nothing on Whistler - no UART-related GPIOs. |  | ||||||
|  */ |  | ||||||
| void gpio_config_uart(void) |  | ||||||
| { |  | ||||||
| } |  | ||||||
|  |  | ||||||
| /* | /* | ||||||
|  * Routine: pin_mux_mmc |  * Routine: pin_mux_mmc | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user