[U-Boot] [PATCH 2/6] net: macb: add support for faster clk rates
Anup Patel
Anup.Patel at wdc.com
Wed Jul 3 03:35:15 UTC 2019
> -----Original Message-----
> From: U-Boot <u-boot-bounces at lists.denx.de> On Behalf Of Ramon Fried
> Sent: Tuesday, June 11, 2019 8:49 PM
> To: u-boot at lists.denx.de
> Cc: Joe Hershberger <joe.hershberger at ni.com>
> Subject: [U-Boot] [PATCH 2/6] net: macb: add support for faster clk rates
>
> add support for clock rates higher than 2.4Mhz
>
> Signed-off-by: Ramon Fried <rfried.dev at gmail.com>
> ---
>
> 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
> 5858004858..6885da9c38 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -901,8 +901,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.21.0
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot
Reviewed-by: Anup Patel <anup.patel at wdc.com>
Tested-by: Anup Patel <anup.patel at wdc.com>
Regards,
Anup
More information about the U-Boot
mailing list