net: macb: add support for faster clk rates
authorRamon Fried <rfried.dev@gmail.com>
Tue, 16 Jul 2019 19:04:32 +0000 (22:04 +0300)
committerJoe Hershberger <joe.hershberger@ni.com>
Thu, 25 Jul 2019 18:13:30 +0000 (13:13 -0500)
add support for clock rates higher than 2.4Mhz

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Tested-by: Anup Patel <anup.patel@wdc.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/macb.c
drivers/net/macb.h

index 0032d4e0002d266ae86b3a50dc8c0230e074e972..0fed43bbe2ac377bdd7e8d087530667b915b0e48 100644 (file)
@@ -903,8 +903,12 @@ static u32 gem_mdc_clk_div(int id, struct macb_device *macb)
                config = GEM_BF(CLK, GEM_CLK_DIV48);
        else if (macb_hz < 160000000)
                config = GEM_BF(CLK, GEM_CLK_DIV64);
-       else
+       else if (macb_hz < 240000000)
                config = GEM_BF(CLK, GEM_CLK_DIV96);
+       else if (macb_hz < 320000000)
+               config = GEM_BF(CLK, GEM_CLK_DIV128);
+       else
+               config = GEM_BF(CLK, GEM_CLK_DIV224);
 
        return config;
 }
index 8966c793a7355dddf96d6ee77cb21d3ea4fc4860..9b16383eba469f56cd4a973677e29634f2d11d50 100644 (file)
 #define GEM_CLK_DIV48                          3
 #define GEM_CLK_DIV64                          4
 #define GEM_CLK_DIV96                          5
+#define GEM_CLK_DIV128                         6
+#define GEM_CLK_DIV224                         7
 
 /* Constants for MAN register */
 #define MACB_MAN_SOF                           1