public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 2/6] net: macb: add support for faster clk rates
@ 2019-07-16 19:04 Ramon Fried
  2019-07-16 19:04 ` [U-Boot] [PATCH v2 3/6] net: macb: use bit access macro from header file Ramon Fried
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Ramon Fried @ 2019-07-16 19:04 UTC (permalink / raw)
  To: u-boot

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>
---
v2: nothing.
 drivers/net/macb.c | 6 +++++-
 drivers/net/macb.h | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

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
-- 
2.22.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-07-25 18:42 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-16 19:04 [U-Boot] [PATCH v2 2/6] net: macb: add support for faster clk rates Ramon Fried
2019-07-16 19:04 ` [U-Boot] [PATCH v2 3/6] net: macb: use bit access macro from header file Ramon Fried
2019-07-25 18:41   ` [U-Boot] " Joe Hershberger
2019-07-16 19:04 ` [U-Boot] [PATCH v2 4/6] net: macb: add support for SGMII phy interface Ramon Fried
2019-07-25 18:42   ` [U-Boot] " Joe Hershberger
2019-07-16 19:04 ` [U-Boot] [PATCH v2 5/6] net: macb: add dma_burst_length config Ramon Fried
2019-07-25 18:42   ` [U-Boot] " Joe Hershberger
2019-07-16 19:04 ` [U-Boot] [PATCH v2 6/6] net: macb: apply sane DMA configuration Ramon Fried
2019-07-25 18:42   ` [U-Boot] " Joe Hershberger
2019-07-25 18:41 ` [U-Boot] net: macb: add support for faster clk rates Joe Hershberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox