drivers: net: ls1088ardb: Fix EC1 and EC2 RCW offset
[oweals/u-boot.git] / drivers / net / macb.c
index c9ee22279ae121b9347659930bb1eb34d28b4604..182331f61d15a9ae38755a5ecc803c0e182249ad 100644 (file)
@@ -143,7 +143,7 @@ struct macb_device {
 
 static int macb_is_gem(struct macb_device *macb)
 {
-       return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) == 0x2;
+       return MACB_BFEXT(IDNUM, macb_readl(macb, MID)) >= 0x2;
 }
 
 #ifndef cpu_is_sama5d2
@@ -1061,14 +1061,13 @@ static int macb_enable_clk(struct udevice *dev)
                return -EINVAL;
 
        /*
-        * Zynq clock driver didn't support for enable or disable
-        * clock. Hence, clk_enable() didn't apply for Zynq
+        * If clock driver didn't support enable or disable then
+        * we get -ENOSYS from clk_enable(). To handle this, we
+        * don't fail for ret == -ENOSYS.
         */
-#ifndef CONFIG_MACB_ZYNQ
        ret = clk_enable(&clk);
-       if (ret)
+       if (ret && ret != -ENOSYS)
                return ret;
-#endif
 
        clk_rate = clk_get_rate(&clk);
        if (!clk_rate)