drivers: net: cpsw: add support to have phy address from cpsw platform data
[oweals/u-boot.git] / board / ti / dra7xx / evm.c
index 9a114e2a75d21c9c05167a5c67aff68cbdc496c7..7990e7990d41ef8d4b631bff61ec93ad6ba4f32a 100644 (file)
  */
 #include <common.h>
 #include <palmas.h>
+#include <sata.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
+#include <asm/arch/sata.h>
 
 #include "mux_data.h"
 
-#ifdef CONFIG_USB_EHCI
-#include <usb.h>
-#include <asm/arch/ehci.h>
-#include <asm/ehci-omap.h>
-#endif
-
 #ifdef CONFIG_DRIVER_TI_CPSW
 #include <cpsw.h>
 #endif
@@ -83,6 +79,12 @@ int board_init(void)
        return 0;
 }
 
+int board_late_init(void)
+{
+       init_sata(0);
+       return 0;
+}
+
 /**
  * @brief misc_init_r - Configure EVM board specific configurations
  * such as power configurations, ethernet initialization as phase2 of
@@ -147,12 +149,12 @@ static struct cpsw_slave_data cpsw_slaves[] = {
        {
                .slave_reg_ofs  = 0x208,
                .sliver_reg_ofs = 0xd80,
-               .phy_id         = 0,
+               .phy_addr       = 2,
        },
        {
                .slave_reg_ofs  = 0x308,
                .sliver_reg_ofs = 0xdc0,
-               .phy_id         = 1,
+               .phy_addr       = 3,
        },
 };
 
@@ -201,12 +203,12 @@ int board_eth_init(bd_t *bis)
        /* try reading mac address from efuse */
        mac_lo = readl((*ctrl)->control_core_mac_id_0_lo);
        mac_hi = readl((*ctrl)->control_core_mac_id_0_hi);
-       mac_addr[0] = mac_hi & 0xFF;
+       mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
        mac_addr[1] = (mac_hi & 0xFF00) >> 8;
-       mac_addr[2] = (mac_hi & 0xFF0000) >> 16;
-       mac_addr[3] = mac_lo & 0xFF;
+       mac_addr[2] = mac_hi & 0xFF;
+       mac_addr[3] = (mac_lo & 0xFF0000) >> 16;
        mac_addr[4] = (mac_lo & 0xFF00) >> 8;
-       mac_addr[5] = (mac_lo & 0xFF0000) >> 16;
+       mac_addr[5] = mac_lo & 0xFF;
 
        if (!getenv("ethaddr")) {
                printf("<ethaddr> not set. Validating first E-fuse MAC\n");