Re: [RFC PATCH net-next v3 13/20] net: dsa: qca8k: make rgmii delay configurable

Vladimir Oltean
2021-05-07T08:51:22Z

On Thu, May 06, 2021 at 11:53:36PM +0200, Ansuel Smith wrote:
> On Thu, May 06, 2021 at 02:10:33PM +0300, Vladimir Oltean wrote:
> > On Wed, May 05, 2021 at 12:29:07AM +0200, Ansuel Smith wrote:
> > > The legacy qsdk code used a different delay instead of the max value.
> > > Qsdk use 1 ps for rx and 2 ps for tx. Make these values configurable
> > > using the standard rx/tx-internal-delay-ps ethernet binding and apply
> > > qsdk values by default. The connected gmac doesn't add any delay so no
> > > additional delay is added to tx/rx.
> > >
> > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > > ---
> > > drivers/net/dsa/qca8k.c | 51 +++++++++++++++++++++++++++++++++++++++--
> > > drivers/net/dsa/qca8k.h | 11 +++++----
> > > 2 files changed, 55 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
> > > index 22334d416f53..cb9b44769e92 100644
> > > --- a/drivers/net/dsa/qca8k.c
> > > +++ b/drivers/net/dsa/qca8k.c
> > > @@ -779,6 +779,47 @@ qca8k_setup_mdio_bus(struct qca8k_priv *priv)
> > > return 0;
> > > }
> > >
> > > +static int
> > > +qca8k_setup_of_rgmii_delay(struct qca8k_priv *priv)
> > > +{
> > > + struct device_node *ports, *port;
> > > + u32 val;
> > > +
> > > + ports = of_get_child_by_name(priv->dev->of_node, "ports");
> >
> > Consider falling back to searching for the "ethernet-ports" name too,
> > DSA should now support both.
> >
>
> The function qca8k_setup_mdio_bus also checks for ports node. Should I
> also there the fallback correct?

Yes, ideally the entire driver should work fine with "ethernet-ports"
and not just pieces of it.