[PATCH v5 01/10] net: stmmac: dwmac-socfpga: don't set has_gmac

Steffen Trumtrar posted 10 patches 3 months, 2 weeks ago
[PATCH v5 01/10] net: stmmac: dwmac-socfpga: don't set has_gmac
Posted by Steffen Trumtrar 3 months, 2 weeks ago
Instead of setting the has_gmac or has_xgmac fields, let
stmmac_probe_config_dt()) fill these fields according to the more
generic compatibles.

Without setting the has_xgmac/has_gmac field correctly, even basic
functions will fail, because the register offsets are different.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
index 354f01184e6cc..7ed125dcc73ea 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
@@ -497,7 +497,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
 	plat_dat->pcs_init = socfpga_dwmac_pcs_init;
 	plat_dat->pcs_exit = socfpga_dwmac_pcs_exit;
 	plat_dat->select_pcs = socfpga_dwmac_select_pcs;
-	plat_dat->has_gmac = true;
 
 	plat_dat->riwt_off = 1;
 

-- 
2.51.0
Re: [PATCH v5 01/10] net: stmmac: dwmac-socfpga: don't set has_gmac
Posted by Russell King (Oracle) 3 months, 2 weeks ago
On Fri, Oct 24, 2025 at 01:49:53PM +0200, Steffen Trumtrar wrote:
> Instead of setting the has_gmac or has_xgmac fields, let
> stmmac_probe_config_dt()) fill these fields according to the more
> generic compatibles.
> 
> Without setting the has_xgmac/has_gmac field correctly, even basic
> functions will fail, because the register offsets are different.

net-next no longer has these has_xgmac/has_gmac fields. This changed
on 22nd October. Please ensure you test your patches against the
latest tree to which you wish them to be applied.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> index 354f01184e6cc..7ed125dcc73ea 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> @@ -497,7 +497,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
>  	plat_dat->pcs_init = socfpga_dwmac_pcs_init;
>  	plat_dat->pcs_exit = socfpga_dwmac_pcs_exit;
>  	plat_dat->select_pcs = socfpga_dwmac_select_pcs;
> -	plat_dat->has_gmac = true;
>  
>  	plat_dat->riwt_off = 1;

In net-next, this code currently looks like:

        plat_dat->pcs_init = socfpga_dwmac_pcs_init;
        plat_dat->pcs_exit = socfpga_dwmac_pcs_exit;
        plat_dat->select_pcs = socfpga_dwmac_select_pcs;
        plat_dat->core_type = DWMAC_CORE_GMAC;

        plat_dat->riwt_off = 1;

Thus, this patch will not apply to net-next.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Re: [PATCH v5 01/10] net: stmmac: dwmac-socfpga: don't set has_gmac
Posted by Maxime Chevallier 3 months, 2 weeks ago
Hi Steffen

On 24/10/2025 13:49, Steffen Trumtrar wrote:
> Instead of setting the has_gmac or has_xgmac fields, let
> stmmac_probe_config_dt()) fill these fields according to the more
> generic compatibles.
> 
> Without setting the has_xgmac/has_gmac field correctly, even basic
> functions will fail, because the register offsets are different.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> index 354f01184e6cc..7ed125dcc73ea 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> @@ -497,7 +497,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
>  	plat_dat->pcs_init = socfpga_dwmac_pcs_init;
>  	plat_dat->pcs_exit = socfpga_dwmac_pcs_exit;
>  	plat_dat->select_pcs = socfpga_dwmac_select_pcs;
> -	plat_dat->has_gmac = true;

Note that this field is now gone as per :

  26ab9830beab ("net: stmmac: replace has_xxxx with core_type")

You'll need to rebase the series :)

Maxime


>  
>  	plat_dat->riwt_off = 1;
>  
>
Re: [PATCH v5 01/10] net: stmmac: dwmac-socfpga: don't set has_gmac
Posted by Steffen Trumtrar 3 months, 2 weeks ago
Hi Maxime,

On 2025-10-24 at 14:11 +02, Maxime Chevallier <maxime.chevallier@bootlin.com> wrote:

> Hi Steffen
> 
> On 24/10/2025 13:49, Steffen Trumtrar wrote:
> > Instead of setting the has_gmac or has_xgmac fields, let
> > stmmac_probe_config_dt()) fill these fields according to the more
> > generic compatibles.
> > 
> > Without setting the has_xgmac/has_gmac field correctly, even basic
> > functions will fail, because the register offsets are different.
> > 
> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> > index 354f01184e6cc..7ed125dcc73ea 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
> > @@ -497,7 +497,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev)
> >  	plat_dat->pcs_init = socfpga_dwmac_pcs_init;
> >  	plat_dat->pcs_exit = socfpga_dwmac_pcs_exit;
> >  	plat_dat->select_pcs = socfpga_dwmac_select_pcs;
> > -	plat_dat->has_gmac = true;
> 
> Note that this field is now gone as per :
> 
>   26ab9830beab ("net: stmmac: replace has_xxxx with core_type")
> 
> You'll need to rebase the series :)
>

I see, bad timing, but luckily an easy patch :)


Best regards,
Steffen

-- 
Pengutronix e.K.                | Dipl.-Inform. Steffen Trumtrar |
Steuerwalder Str. 21            | https://www.pengutronix.de/    |
31137 Hildesheim, Germany       | Phone: +49-5121-206917-0       |
Amtsgericht Hildesheim, HRA 2686| Fax:   +49-5121-206917-5555    |
Re: [PATCH v5 01/10] net: stmmac: dwmac-socfpga: don't set has_gmac
Posted by G Thomas, Rohan 3 months, 1 week ago
Hi Steffen,

On 10/24/2025 6:00 PM, Steffen Trumtrar wrote:
> 
> Hi Maxime,
> 
> On 2025-10-24 at 14:11 +02, Maxime Chevallier 
> <maxime.chevallier@bootlin.com> wrote:
> 
>> Hi Steffen
>>
>> On 24/10/2025 13:49, Steffen Trumtrar wrote:
>> > Instead of setting the has_gmac or has_xgmac fields, let
>> > stmmac_probe_config_dt()) fill these fields according to the more
>> > generic compatibles.
>> > > Without setting the has_xgmac/has_gmac field correctly, even basic
>> > functions will fail, because the register offsets are different.
>> > > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
>> > ---
>> >  drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 1 -
>> >  1 file changed, 1 deletion(-)
>> > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c 
>> b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
>> > index 354f01184e6cc..7ed125dcc73ea 100644
>> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
>> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
>> > @@ -497,7 +497,6 @@ static int socfpga_dwmac_probe(struct 
>> platform_device *pdev)
>> >      plat_dat->pcs_init = socfpga_dwmac_pcs_init;
>> >      plat_dat->pcs_exit = socfpga_dwmac_pcs_exit;
>> >      plat_dat->select_pcs = socfpga_dwmac_select_pcs;
>> > -    plat_dat->has_gmac = true;

I was preparing a patch-set to enable additional features in Agilex5.
Since Agilex5 HPS EMAC has different configurations from the previous
platforms adding a separate platform setup callback for Agilex5 and
other platforms. Here is the link to this patch-set:
https://lore.kernel.org/all/20251029-agilex5_ext-v1-0-1931132d77d6@altera.com/

Could you please confirm if this patch set aligns with your commit?

>>
>> Note that this field is now gone as per :
>>
>>   26ab9830beab ("net: stmmac: replace has_xxxx with core_type")
>>
>> You'll need to rebase the series :)
>>
> 
> I see, bad timing, but luckily an easy patch :)
> 
> 
> Best regards,
> Steffen
> 
Best Regards,
Rohan