Re: [PATCH v2 8/8] drivers: net: macb: add fu740 support

2021-03-17 Thread Green Wan
On Wed, Mar 17, 2021 at 9:53 PM David Abdurachmanov <
david.abdurachma...@gmail.com> wrote:

> On Tue, Mar 16, 2021 at 6:35 PM Green Wan  wrote:
> >
> > From: David Abdurachmanov 
> >
> > Add fu740 support to macb ethernet driver
> >
> > Signed-off-by: David Abdurachmanov 
> > Signed-off-by: Green Wan 
> > Reviewed-by: Ramon Fried 
> > ---
> >  drivers/net/macb.c | 8 +++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> > index 57ea45e..df65d82 100644
> > --- a/drivers/net/macb.c
> > +++ b/drivers/net/macb.c
> > @@ -592,7 +592,11 @@ static int macb_sifive_clk_init(struct udevice
> *dev, ulong rate)
> >  * and output clock on GMII output signal GTX_CLK
> >  * 1 = MII mode. Use MII input signal TX_CLK in TX logic
> >  */
> > -   writel(rate != 12500, gemgxl_regs);
> > +   if (device_is_compatible(dev, "sifive,fu540-c000-gem"))
> > +   writel(rate != 12500, gemgxl_regs);
>
> Could you add a comment here why we need this? (i.e. about the HW quirk)
> Note that 125.125 is actually outside of specification for VSC8541XMV-02.
>
> Thanks, David. I'll add the comment for it.


> > +   else if (device_is_compatible(dev, "sifive,fu740-c000-gem"))
> > +   writel(rate != 125125000, gemgxl_regs);
> > +
> > return 0;
> >  }
> >
> > @@ -1507,6 +1511,8 @@ static const struct udevice_id macb_eth_ids[] = {
> > { .compatible = "cdns,zynq-gem" },
> > { .compatible = "sifive,fu540-c000-gem",
> >   .data = (ulong)&sifive_config },
> > +   { .compatible = "sifive,fu740-c000-gem",
> > + .data = (ulong)&sifive_config },
> > { .compatible = "microchip,mpfs-mss-gem",
> >   .data = (ulong)µchip_config },
> > { }
> > --
> > 2.7.4
> >
>


Re: [PATCH v2 8/8] drivers: net: macb: add fu740 support

2021-03-17 Thread David Abdurachmanov
On Tue, Mar 16, 2021 at 6:35 PM Green Wan  wrote:
>
> From: David Abdurachmanov 
>
> Add fu740 support to macb ethernet driver
>
> Signed-off-by: David Abdurachmanov 
> Signed-off-by: Green Wan 
> Reviewed-by: Ramon Fried 
> ---
>  drivers/net/macb.c | 8 +++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 57ea45e..df65d82 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -592,7 +592,11 @@ static int macb_sifive_clk_init(struct udevice *dev, 
> ulong rate)
>  * and output clock on GMII output signal GTX_CLK
>  * 1 = MII mode. Use MII input signal TX_CLK in TX logic
>  */
> -   writel(rate != 12500, gemgxl_regs);
> +   if (device_is_compatible(dev, "sifive,fu540-c000-gem"))
> +   writel(rate != 12500, gemgxl_regs);

Could you add a comment here why we need this? (i.e. about the HW quirk)
Note that 125.125 is actually outside of specification for VSC8541XMV-02.

> +   else if (device_is_compatible(dev, "sifive,fu740-c000-gem"))
> +   writel(rate != 125125000, gemgxl_regs);
> +
> return 0;
>  }
>
> @@ -1507,6 +1511,8 @@ static const struct udevice_id macb_eth_ids[] = {
> { .compatible = "cdns,zynq-gem" },
> { .compatible = "sifive,fu540-c000-gem",
>   .data = (ulong)&sifive_config },
> +   { .compatible = "sifive,fu740-c000-gem",
> + .data = (ulong)&sifive_config },
> { .compatible = "microchip,mpfs-mss-gem",
>   .data = (ulong)µchip_config },
> { }
> --
> 2.7.4
>