net: macb: add support for faster clk rates

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>
This commit is contained in:
Ramon Fried 2019-07-16 22:04:32 +03:00 committed by Joe Hershberger
parent 6c636514d4
commit 9e65f80ec9
2 changed files with 7 additions and 1 deletions

View File

@ -903,8 +903,12 @@ static u32 gem_mdc_clk_div(int id, struct macb_device *macb)
config = GEM_BF(CLK, GEM_CLK_DIV48); config = GEM_BF(CLK, GEM_CLK_DIV48);
else if (macb_hz < 160000000) else if (macb_hz < 160000000)
config = GEM_BF(CLK, GEM_CLK_DIV64); config = GEM_BF(CLK, GEM_CLK_DIV64);
else else if (macb_hz < 240000000)
config = GEM_BF(CLK, GEM_CLK_DIV96); 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; return config;
} }

View File

@ -613,6 +613,8 @@
#define GEM_CLK_DIV48 3 #define GEM_CLK_DIV48 3
#define GEM_CLK_DIV64 4 #define GEM_CLK_DIV64 4
#define GEM_CLK_DIV96 5 #define GEM_CLK_DIV96 5
#define GEM_CLK_DIV128 6
#define GEM_CLK_DIV224 7
/* Constants for MAN register */ /* Constants for MAN register */
#define MACB_MAN_SOF 1 #define MACB_MAN_SOF 1