mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-09-21 07:01:57 +00:00
tegra2: Clean up board code a little
This removes clock_init() and pinmux_init() which are names better suited to those respective modules. By moving board_init_f() to the bottom of the file we can remove the need for so many functions in the board.h header file. The only clock/pinmux/gpio init we need to do prior to relocation is for the UART. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Tom Warren <twarren@nvidia.com>
This commit is contained in:
parent
03c609f69b
commit
3e00dbdf24
2 changed files with 20 additions and 48 deletions
|
@ -43,24 +43,6 @@ const struct tegra2_sysinfo sysinfo = {
|
||||||
CONFIG_TEGRA2_BOARD_STRING
|
CONFIG_TEGRA2_BOARD_STRING
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_BOARD_EARLY_INIT_F
|
|
||||||
int board_early_init_f(void)
|
|
||||||
{
|
|
||||||
/* Initialize periph clocks */
|
|
||||||
clock_init();
|
|
||||||
|
|
||||||
/* Initialize periph pinmuxes */
|
|
||||||
pinmux_init();
|
|
||||||
|
|
||||||
/* Initialize periph GPIOs */
|
|
||||||
gpio_init();
|
|
||||||
|
|
||||||
/* Init UART, scratch regs, and start CPU */
|
|
||||||
tegra2_start();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* EARLY_INIT */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Routine: timer_init
|
* Routine: timer_init
|
||||||
* Description: init the timestamp and lastinc value
|
* Description: init the timestamp and lastinc value
|
||||||
|
@ -155,6 +137,7 @@ static void pin_mux_uart(void)
|
||||||
#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
|
#endif /* CONFIG_TEGRA2_ENABLE_UARTD */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_TEGRA2_MMC
|
||||||
/*
|
/*
|
||||||
* Routine: clock_init_mmc
|
* Routine: clock_init_mmc
|
||||||
* Description: init the PLL and clocks for the SDMMC controllers
|
* Description: init the PLL and clocks for the SDMMC controllers
|
||||||
|
@ -235,33 +218,7 @@ static void pin_mux_mmc(void)
|
||||||
pinmux_tristate_disable(PIN_SDD);
|
pinmux_tristate_disable(PIN_SDD);
|
||||||
pinmux_tristate_disable(PIN_SDB);
|
pinmux_tristate_disable(PIN_SDB);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/*
|
|
||||||
* Routine: clock_init
|
|
||||||
* Description: Do individual peripheral clock reset/enables
|
|
||||||
*/
|
|
||||||
void clock_init(void)
|
|
||||||
{
|
|
||||||
clock_init_uart();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Routine: pinmux_init
|
|
||||||
* Description: Do individual peripheral pinmux configs
|
|
||||||
*/
|
|
||||||
void pinmux_init(void)
|
|
||||||
{
|
|
||||||
pin_mux_uart();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Routine: gpio_init
|
|
||||||
* Description: Do individual peripheral GPIO configs
|
|
||||||
*/
|
|
||||||
void gpio_init(void)
|
|
||||||
{
|
|
||||||
gpio_config_uart();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Routine: board_init
|
* Routine: board_init
|
||||||
|
@ -307,3 +264,21 @@ int board_mmc_getcd(u8 *cd, struct mmc *mmc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_BOARD_EARLY_INIT_F
|
||||||
|
int board_early_init_f(void)
|
||||||
|
{
|
||||||
|
/* Initialize UART clocks */
|
||||||
|
clock_init_uart();
|
||||||
|
|
||||||
|
/* Initialize periph pinmuxes */
|
||||||
|
pin_mux_uart();
|
||||||
|
|
||||||
|
/* Initialize periph GPIOs */
|
||||||
|
gpio_config_uart();
|
||||||
|
|
||||||
|
/* Init UART, scratch regs, and start CPU */
|
||||||
|
tegra2_start();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* EARLY_INIT */
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#define _BOARD_H_
|
#define _BOARD_H_
|
||||||
|
|
||||||
void tegra2_start(void);
|
void tegra2_start(void);
|
||||||
void clock_init(void);
|
|
||||||
void pinmux_init(void);
|
|
||||||
void gpio_init(void);
|
|
||||||
void gpio_config_uart(void);
|
void gpio_config_uart(void);
|
||||||
int tegra2_mmc_init(int dev_index, int bus_width);
|
int tegra2_mmc_init(int dev_index, int bus_width);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue