mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-11 05:32:13 -04:00
net: macb: Set MDIO clock divisor for pclk higher than 160MHz
Currently macb sets clock divisor for pclk up to 160 MHz. Function gem_mdc_clk_div was updated to enable divisor for higher values of pclk. Signed-off-by: Bartosz Wawrzyniak <bwawrzyn@cisco.com> Reviewed-by: Michal Kubiak <michal.kubiak@intel.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
df28e8690e
commit
b31587feaa
@@ -692,6 +692,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_C22_SOF 1
|
||||
|
||||
@@ -2640,8 +2640,12 @@ static u32 gem_mdc_clk_div(struct macb *bp)
|
||||
config = GEM_BF(CLK, GEM_CLK_DIV48);
|
||||
else if (pclk_hz <= 160000000)
|
||||
config = GEM_BF(CLK, GEM_CLK_DIV64);
|
||||
else
|
||||
else if (pclk_hz <= 240000000)
|
||||
config = GEM_BF(CLK, GEM_CLK_DIV96);
|
||||
else if (pclk_hz <= 320000000)
|
||||
config = GEM_BF(CLK, GEM_CLK_DIV128);
|
||||
else
|
||||
config = GEM_BF(CLK, GEM_CLK_DIV224);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user