hw25: updated board and mux - ready for review

This commit is contained in:
Nicolas Gugger 2020-09-10 15:49:58 +02:00
parent 14cbc05115
commit 29a9c27aa3
2 changed files with 25 additions and 38 deletions

View File

@ -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,26 +964,35 @@ 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);
writel(RMII_MODE_ENABLE | RMII_CHIPCKL_ENABLE, &cdev->miisel);
bd_get_mac(1, mac_addr1, sizeof(mac_addr1));
set_mac_address(1, mac_addr1);
{
int rv = cpsw_register(&cpsw_data);
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)
{
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);

View File

@ -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);