Permalink
Browse files

sunxi-gmac: Disable mac address based on md5(chip_id)

The chip_id is always 0 and thus the md5 sum for all Pine64 is the same
resulting in the same mac address. U-Boot has the chip_id so it is there
but the Kernel reads just zeros from the memory area used. We do not
care and simply disable this and just generate a random MAC address on
boot when none is set.
  • Loading branch information...
1 parent 03e6878 commit 58636d53c21e1ee31e98bb971ebf95ebf44d6f2a @longsleep committed Aug 20, 2016
Showing with 4 additions and 2 deletions.
  1. +4 −2 drivers/net/ethernet/allwinner/sunxi-gmac.c
@@ -778,9 +778,11 @@ static void geth_check_addr(struct net_device *ndev, unsigned char *mac)
for (i=0; i<ETH_ALEN; i++, p++)
ndev->dev_addr[i] = simple_strtoul(p, &p, 16);
+#if 0
if (!is_valid_ether_addr(ndev->dev_addr)) {
geth_chip_hwaddr(ndev->dev_addr);
}
+#endif
if (!is_valid_ether_addr(ndev->dev_addr)) {
random_ether_addr(ndev->dev_addr);
@@ -1583,8 +1585,8 @@ static int geth_script_parse(struct platform_device *pdev)
}
#endif
priv->phy_interface = of_get_phy_mode(np);
- if (priv->phy_interface != PHY_INTERFACE_MODE_MII
- && priv->phy_interface != PHY_INTERFACE_MODE_RGMII
+ if (priv->phy_interface != PHY_INTERFACE_MODE_MII
+ && priv->phy_interface != PHY_INTERFACE_MODE_RGMII
&& priv->phy_interface != PHY_INTERFACE_MODE_RMII) {
dev_err(&pdev->dev, "Not support phy type!\n");
priv->phy_interface = PHY_INTERFACE_MODE_MII;

0 comments on commit 58636d5

Please sign in to comment.