diff --git a/board/nm/hw25/board.c b/board/nm/hw25/board.c index 464bff651e..f91823ad4d 100644 --- a/board/nm/hw25/board.c +++ b/board/nm/hw25/board.c @@ -247,30 +247,6 @@ static inline int __maybe_unused read_eeprom(void) return _bd_init(); } -/* - * Selects console for SPL. - * U-Boot console is selected in set_console() - */ -struct serial_device *default_serial_console(void) -{ - /* - * Mux pins for selected UART properly. - * Note: UART indexes start at 0 while eserial indexes start at 1. - * - * Provide console on internal UART0 regardless of boot mode. - * This only has a side effect when using X-Modem boot - */ - if (spl_boot_device() == BOOT_DEVICE_UART) { - /* Continue booting from UART in case of serial (xmodem) boot */ - enable_uart0_pin_mux(); - return &eserial1_device; - } else { - /* Regular and JTAG boot use internal UART0 */ - enable_uart0_pin_mux(); - return &eserial2_device; - } -} - #ifndef CONFIG_SKIP_LOWLEVEL_INIT static const struct ddr_data ddr3_data = { @@ -928,9 +904,13 @@ static struct cpsw_slave_data cpsw_slaves[] = { { .slave_reg_ofs = 0x208, .sliver_reg_ofs = 0xd80, - .phy_if = PHY_INTERFACE_MODE_RMII, .phy_addr = 0 - } + }, + { + .slave_reg_ofs = 0x308, + .sliver_reg_ofs = 0xdc0, + .phy_addr = 1, + }, }; static struct cpsw_platform_data cpsw_data = { @@ -984,25 +964,34 @@ static void set_mac_address(int index, uchar mac[6]) */ int board_eth_init(bd_t *bis) { - int n = 0; - __maybe_unused uint8_t mac_addr0[6] = {02,00,00,00,00,01}; + int rv, n = 0; + uint8_t mac_addr0[6] = {02,00,00,00,00,01}; + uint8_t mac_addr1[6] = {02,00,00,00,00,02}; + __maybe_unused struct ti_am_eeprom *header; + #if !defined(CONFIG_SPL_BUILD) #ifdef CONFIG_DRIVER_TI_CPSW + cpsw_data.mdio_div = 0x3E; bd_get_mac(0, mac_addr0, sizeof(mac_addr0)); set_mac_address(0, mac_addr0); + bd_get_mac(1, mac_addr1, sizeof(mac_addr1)); + set_mac_address(1, mac_addr1); + writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel); + cpsw_slaves[0].phy_if = PHY_INTERFACE_MODE_RMII; + cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_RMII; + cpsw_slaves[0].phy_addr = 0; + cpsw_slaves[1].phy_addr = 1; + rv = cpsw_register(&cpsw_data); + if (rv < 0) { - int rv = cpsw_register(&cpsw_data); - if (rv < 0) - { - printf("Error %d registering CPSW switch\n", rv); - } else { - n += rv; - } + printf("Error %d registering CPSW switch\n", rv); + } else { + n += rv; } #endif #endif @@ -1014,7 +1003,7 @@ int board_eth_init(bd_t *bis) } { - int rv = usb_eth_initialize(bis); + rv = usb_eth_initialize(bis); if (rv < 0) { printf("Error %d registering USB_ETHER\n", rv); diff --git a/board/nm/hw25/board.h b/board/nm/hw25/board.h index ba3a2feca3..ce56e3e8c5 100644 --- a/board/nm/hw25/board.h +++ b/board/nm/hw25/board.h @@ -18,8 +18,6 @@ * is required on the board. */ void enable_uart0_pin_mux(void); -void disable_uart0_pin_mux(void); -void enable_uart1_pin_mux(void); void enable_board_pin_mux(void);