nmhw21: broadr configuration
add configure_broad_phys remove uboot env variable for broadr
This commit is contained in:
parent
a0bd4715b0
commit
beb0d6dfd0
|
|
@ -35,6 +35,7 @@
|
|||
#include <environment.h>
|
||||
#include <watchdog.h>
|
||||
#include <libfdt.h>
|
||||
#include <miiphy.h>
|
||||
|
||||
#include "../common/bdparser.h"
|
||||
#include "../common/board_descriptor.h"
|
||||
|
|
@ -131,7 +132,6 @@ DECLARE_GLOBAL_DATA_PTR;
|
|||
#define IOEXT_LEDS_ALL_MASK (0x03C0)
|
||||
|
||||
|
||||
|
||||
#define DDR3_CLOCK_FREQUENCY (400)
|
||||
|
||||
|
||||
|
|
@ -524,6 +524,28 @@ static void configure_ethernet_switch(void)
|
|||
spi_release_bus(spi);
|
||||
}
|
||||
|
||||
static void configure_broadr_phys(void)
|
||||
{
|
||||
unsigned char phy;
|
||||
const char *devname;
|
||||
int err;
|
||||
|
||||
/* Get current device */
|
||||
devname = miiphy_get_current_dev();
|
||||
/* configure BroadR PHY TJA1100 as slave and restart FSM*/
|
||||
for (phy=6; phy<=7; phy++) {
|
||||
err=miiphy_write (devname, phy, 0x11, 0x0004); /*Extended control register : bit 15 ->link control disabled*/
|
||||
err=miiphy_write (devname, phy, 0x12, 0x0910); /*Configuration register 1 : bit 15 -> PHY configured as Slave*/
|
||||
err=miiphy_write (devname, phy, 0x11, 0x9A04); /*Extended control register : link control enable and training restart*/
|
||||
}
|
||||
if (err != 0) {
|
||||
puts("BroadR not ready, ");
|
||||
}
|
||||
else {
|
||||
puts("BroadR ready, ");
|
||||
}
|
||||
}
|
||||
|
||||
static void init_usb_hub(void)
|
||||
{
|
||||
REQUEST_AND_CLEAR_GPIO(GPIO_RST_USB_HUB_N);
|
||||
|
|
@ -906,6 +928,7 @@ int board_late_init(void)
|
|||
mdelay(10);
|
||||
gpio_set_value(GPIO_RST_ETH_N, 1);
|
||||
configure_ethernet_switch();
|
||||
|
||||
}
|
||||
else {
|
||||
/* TODO: Verify operation */
|
||||
|
|
@ -931,6 +954,7 @@ int board_late_init(void)
|
|||
set_status_led(0, 1); /* Green */
|
||||
ui_set_top_led(0, 1);
|
||||
|
||||
|
||||
/*
|
||||
check_fct();
|
||||
*/
|
||||
|
|
@ -1015,7 +1039,6 @@ int board_eth_init(bd_t *bis)
|
|||
int rv, n = 0;
|
||||
uint8_t mac_addr0[6] = {02,00,00,00,00,01};
|
||||
__maybe_unused struct ti_am_eeprom *header;
|
||||
|
||||
#if !defined(CONFIG_SPL_BUILD)
|
||||
#ifdef CONFIG_DRIVER_TI_CPSW
|
||||
cpsw_data.mdio_div = 0x3E;
|
||||
|
|
@ -1044,6 +1067,8 @@ int board_eth_init(bd_t *bis)
|
|||
else
|
||||
n += rv;
|
||||
#endif
|
||||
/* Enable BroadR PHYs, set to slave mode */
|
||||
configure_broadr_phys();
|
||||
return n;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1104,7 +1129,15 @@ int ft_board_setup(void *blob, bd_t *bd)
|
|||
ft_hw_version(blob);
|
||||
ft_led(blob);
|
||||
|
||||
/* Enable BroadR PHYs, set to slave mode */
|
||||
configure_broadr_phys();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------- */
|
||||
|
||||
|
|
|
|||
|
|
@ -93,12 +93,6 @@
|
|||
"tftptimeoutcountmax=5\0" \
|
||||
"bootpretryperiod=5000\0" \
|
||||
"autoload=false\0" \
|
||||
"broadr_init_master=mii write 6 11h 0004 && mii write 6 12h 9910 && mii write 6 11h 9A04 && mii write 7 11h 0004 && mii write 7 12h 9910 && mii write 7 11h 9A04\0" \
|
||||
"broadr_init_master_6=mii write 6 11h 0004 && mii write 6 12h 9910 && mii write 6 11h 9A04\0" \
|
||||
"broadr_init_master_7=mii write 7 11h 0004 && mii write 7 12h 9910 && mii write 7 11h 9A04\0" \
|
||||
"broadr_init_slave=mii write 6 11h 0004 && mii write 6 12h 0910 && mii write 6 11h 9A04 && mii write 7 11h 0004 && mii write 7 12h 0910 && mii write 7 11h 9A04\0" \
|
||||
"broadr_init_slave_6=mii write 6 11h 0004 && mii write 6 12h 0910 && mii write 6 11h 9A04\0" \
|
||||
"broadr_init_slave_7=mii write 7 11h 0004 && mii write 7 12h 0910 && mii write 7 11h 9A04\0" \
|
||||
"tftp_recovery=tftpboot $kernel_addr recovery-image; tftpboot $fdt_addr recovery-dtb; " \
|
||||
"setenv bootargs rdinit=/etc/preinit console=$defaultconsole,115200 " \
|
||||
"debug ti_cpsw.rx_packet_max=1526; " \
|
||||
|
|
|
|||
Loading…
Reference in New Issue