arm:omap:am33xx: CPSW fix for using macid from efuse
authorChandan Nath <chandan.nath@ti.com>
Mon, 3 Oct 2011 05:25:57 +0000 (10:55 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:26 +0000 (00:44 +0530)
This patch is added to use proper mac id from efuse and use it
for getting ip address from dhcp server. If mac id from efuse is
not used, cpsw will generate some random mac id and used for
getting new ip address in every  boot.

Signed-off-by: Chandan Nath <chandan.nath@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
arch/arm/mach-omap2/devices.c
drivers/net/ethernet/ti/cpsw.c

index d9457105d66ee3bd7985d487d6d557405b9a552b..f5ef613b3b4e264ae339ffaf8535e110ed1a9bf4 100644 (file)
@@ -1276,6 +1276,8 @@ void am33xx_cpsw_init(void)
                        am33xx_cpsw_slaves[1].mac_addr[i] = am33xx_macid1[i];
        }
 
                        am33xx_cpsw_slaves[1].mac_addr[i] = am33xx_macid1[i];
        }
 
+       memcpy(am33xx_cpsw_pdata.mac_addr,
+                       am33xx_cpsw_slaves[0].mac_addr, ETH_ALEN);
        platform_device_register(&am33xx_cpsw_mdiodevice);
        platform_device_register(&am33xx_cpsw_device);
        clk_add_alias(NULL, dev_name(&am33xx_cpsw_mdiodevice.dev),
        platform_device_register(&am33xx_cpsw_mdiodevice);
        platform_device_register(&am33xx_cpsw_device);
        clk_add_alias(NULL, dev_name(&am33xx_cpsw_mdiodevice.dev),
index 6872de5a1b02809bed54ecf7bea78ea7d5c027d4..cff7495c8c957345811cbd2c244bdf176be593b6 100644 (file)
@@ -916,7 +916,7 @@ static int __devinit cpsw_probe(struct platform_device *pdev)
                        priv->mac_addr[4], priv->mac_addr[5]);
        } else {
                random_ether_addr(priv->mac_addr);
                        priv->mac_addr[4], priv->mac_addr[5]);
        } else {
                random_ether_addr(priv->mac_addr);
-               printk(KERN_INFO"Detected MACID=%x:%x:%x:%x:%x:%x\n",
+               printk(KERN_INFO"Random MACID=%x:%x:%x:%x:%x:%x\n",
                        priv->mac_addr[0], priv->mac_addr[1],
                        priv->mac_addr[2], priv->mac_addr[3],
                        priv->mac_addr[4], priv->mac_addr[5]);
                        priv->mac_addr[0], priv->mac_addr[1],
                        priv->mac_addr[2], priv->mac_addr[3],
                        priv->mac_addr[4], priv->mac_addr[5]);