From: Ramon Fried Date: Tue, 16 Jul 2019 19:04:32 +0000 (+0300) Subject: net: macb: add support for faster clk rates X-Git-Tag: v2019.10-rc1~11^2~19 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9e65f80ec9943790891a533dc8996d9d97a18cc6;p=oweals%2Fu-boot.git net: macb: add support for faster clk rates add support for clock rates higher than 2.4Mhz Signed-off-by: Ramon Fried Reviewed-by: Anup Patel Tested-by: Anup Patel Acked-by: Joe Hershberger --- diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 0032d4e000..0fed43bbe2 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -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; } diff --git a/drivers/net/macb.h b/drivers/net/macb.h index 8966c793a7..9b16383eba 100644 --- a/drivers/net/macb.h +++ b/drivers/net/macb.h @@ -613,6 +613,8 @@ #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