X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=blobdiff_plain;f=board%2Fst%2Fstv0991%2Fstv0991.c;h=f465699b55beb8d9df77e49865a225c6cec8012f;hp=bdeb53c1a70d12f9311d9ad1dbe20c2ee30c0c08;hb=39e4795a797663d08cd2216975430b2819e3173c;hpb=9fa32b12370236a39090d4e42b013910d123db61 diff --git a/board/st/stv0991/stv0991.c b/board/st/stv0991/stv0991.c index bdeb53c1a7..f465699b55 100644 --- a/board/st/stv0991/stv0991.c +++ b/board/st/stv0991/stv0991.c @@ -9,9 +9,29 @@ #include #include #include +#include +#include +#include +#include +#include +#include DECLARE_GLOBAL_DATA_PTR; +struct gpio_regs *const gpioa_regs = + (struct gpio_regs *) GPIOA_BASE_ADDR; + +static const struct pl01x_serial_platdata serial_platdata = { + .base = 0x80406000, + .type = TYPE_PL011, + .clock = 2700 * 1000, +}; + +U_BOOT_DEVICE(stv09911_serials) = { + .name = "serial_pl01x", + .platdata = &serial_platdata, +}; + #ifdef CONFIG_SHOW_BOOT_PROGRESS void show_boot_progress(int progress) { @@ -19,11 +39,26 @@ void show_boot_progress(int progress) } #endif +void enable_eth_phy(void) +{ + /* Set GPIOA_06 pad HIGH (Appli board)*/ + writel(readl(&gpioa_regs->dir) | 0x40, &gpioa_regs->dir); + writel(readl(&gpioa_regs->data) | 0x40, &gpioa_regs->data); +} +int board_eth_enable(void) +{ + stv0991_pinmux_config(ETH_GPIOB_10_31_C_0_4); + clock_setup(ETH_CLOCK_CFG); + enable_eth_phy(); + return 0; +} + /* * Miscellaneous platform dependent initialisations */ int board_init(void) { + board_eth_enable(); return 0; } @@ -33,6 +68,7 @@ int board_uart_init(void) clock_setup(UART_CLOCK_CFG); return 0; } + #ifdef CONFIG_BOARD_EARLY_INIT_F int board_early_init_f(void) { @@ -52,3 +88,17 @@ void dram_init_banksize(void) gd->bd->bi_dram[0].start = PHYS_SDRAM_1; gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; } + +#ifdef CONFIG_CMD_NET +int board_eth_init(bd_t *bis) +{ + int ret = 0; + +#if defined(CONFIG_DESIGNWARE_ETH) + u32 interface = PHY_INTERFACE_MODE_MII; + if (designware_initialize(GMAC_BASE_ADDR, interface) >= 0) + ret++; +#endif + return ret; +} +#endif