]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - board/ti/dra7xx/evm.c
Merge branch 'master' of git://git.denx.de/u-boot-arm
[karo-tx-uboot.git] / board / ti / dra7xx / evm.c
index bed828584bf73bbd656c39e0eacc0556e5ddca09..073d15127cf8d94189afdc4f1a715399e188e3bf 100644 (file)
@@ -16,6 +16,7 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/sata.h>
+#include <environment.h>
 
 #include "mux_data.h"
 
@@ -124,6 +125,24 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_OS_BOOT)
+int spl_start_uboot(void)
+{
+       /* break into full u-boot on 'c' */
+       if (serial_tstc() && serial_getc() == 'c')
+               return 1;
+
+#ifdef CONFIG_SPL_ENV_SUPPORT
+       env_init();
+       env_relocate_spec();
+       if (getenv_yesno("boot_os") != 1)
+               return 1;
+#endif
+
+       return 0;
+}
+#endif
+
 #ifdef CONFIG_DRIVER_TI_CPSW
 
 /* Delay value to add to calibrated value */
@@ -149,12 +168,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,
        },
 };
 
@@ -216,6 +235,21 @@ int board_eth_init(bd_t *bis)
                if (is_valid_ether_addr(mac_addr))
                        eth_setenv_enetaddr("ethaddr", mac_addr);
        }
+
+       mac_lo = readl((*ctrl)->control_core_mac_id_1_lo);
+       mac_hi = readl((*ctrl)->control_core_mac_id_1_hi);
+       mac_addr[0] = (mac_hi & 0xFF0000) >> 16;
+       mac_addr[1] = (mac_hi & 0xFF00) >> 8;
+       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 & 0xFF;
+
+       if (!getenv("eth1addr")) {
+               if (is_valid_ether_addr(mac_addr))
+                       eth_setenv_enetaddr("eth1addr", mac_addr);
+       }
+
        ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33);
        ctrl_val |= 0x22;
        writel(ctrl_val, (*ctrl)->control_core_control_io1);