[PATCH net-next v5 3/4] net: ftgmac100: Add RGMII delay support for AST2600

Jacky Chou jacky_chou at aspeedtech.com
Wed Dec 17 19:35:58 AEDT 2025


Hi Rob,

> On Sat, Dec 06, 2025 at 07:30:30PM +0100, Andrew Lunn wrote:
> > > @@ -1907,6 +2179,10 @@ static int ftgmac100_probe(struct
> platform_device *pdev)
> > >  		priv->rxdes0_edorr_mask = BIT(30);
> > >  		priv->txdes0_edotr_mask = BIT(30);
> > >  		priv->is_aspeed = true;
> > > +		/* Configure RGMII delay if there are the corresponding
> compatibles */
> > > +		err = ftgmac100_set_internal_delay(priv, &phy_intf);
> > > +		if (err)
> > > +			goto err_phy_connect;
> >
> > Thinking forward to when you add 2700 support, i really think you need
> > to break the probe up into helpers for 2500 and before, 2600 and in
> > the future 2700. You currently have a couple of tests on the
> > compatible which you can reduce to one.
> >
> > In fact, this driver has 10 calls to of_device_is_compatible(). I
> > think you should first refactor the code to list each compatible in
> > ftgmac100_of_match[], and add a data structure which contains an enum
> > of the MAC type. You can then transfer this to priv, and replace all
> > the of_device_is_compatible() tests to just look at the enum value.
> 
> Better yet, define a structure which defines the different settings directly. Such
> as:
> 
> priv->rxdes0_edorr_mask
> priv->txdes0_edotr_mask
> priv->is_aspeed
> 
> And anything else needed...
> 

Thanks for the feedback.
We'll take your suggestions into account and adjust the structure accordingly if needed

Thanks,
Jacky



More information about the Linux-aspeed mailing list