[PATCH 06/12] ARM: versatile: Use smc91c111 from device tree

Sascha Hauer s.hauer at pengutronix.de
Tue May 2 04:41:03 PDT 2023


On Tue, May 02, 2023 at 11:17:43AM +0200, Ahmad Fatoum wrote:
> On 02.05.23 11:14, Sascha Hauer wrote:
> > Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
> > ---
> >  arch/arm/boards/versatile/versatilepb.c |  7 -------
> >  drivers/net/smc91111.c                  | 16 +++++++++++-----
> >  include/platform_data/eth-smc91111.h    |  1 -
> >  3 files changed, 11 insertions(+), 13 deletions(-)
> > 
> > diff --git a/arch/arm/boards/versatile/versatilepb.c b/arch/arm/boards/versatile/versatilepb.c
> > index 0ea397d3cb..8079ade9a5 100644
> > --- a/arch/arm/boards/versatile/versatilepb.c
> > +++ b/arch/arm/boards/versatile/versatilepb.c
> > @@ -39,15 +39,8 @@ static int vpb_console_init(void)
> >  }
> >  console_initcall(vpb_console_init);
> >  
> > -static struct smc91c111_pdata net_pdata = {
> > -	.qemu_fixup = 1,
> > -};
> > -
> >  static int vpb_devices_init(void)
> >  {
> > -	add_generic_device("smc91c111", DEVICE_ID_DYNAMIC, NULL, VERSATILE_ETH_BASE,
> > -			64 * 1024, IORESOURCE_MEM, &net_pdata);
> > -
> >  	armlinux_set_architecture(MACH_TYPE_VERSATILE_PB);
> >  
> >  	return 0;
> > diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c
> > index 89195fc826..46faf385f9 100644
> > --- a/drivers/net/smc91111.c
> > +++ b/drivers/net/smc91111.c
> > @@ -440,7 +440,6 @@ struct smc91c111_priv {
> >  	struct mii_bus miibus;
> >  	struct accessors a;
> >  	void __iomem *base;
> > -	int qemu_fixup;
> >  	unsigned shift;
> >  	int version;
> >  	int revision;
> > @@ -1048,7 +1047,8 @@ static int smc91c111_eth_open(struct eth_device *edev)
> >  	if (ret)
> >  		return ret;
> >  
> > -	if (priv->qemu_fixup && edev->phydev->phy_id == 0x00000000) {
> > +	if (of_machine_is_compatible("arm,versatile-pb") ||
> > +	    of_machine_is_compatible("arm,versatile-ab")) {
> >  		struct phy_device *dev = edev->phydev;
> >  
> >  		dev->speed = SPEED_100;
> > @@ -1451,7 +1451,6 @@ static int smc91c111_probe(struct device *dev)
> >  	if (dev->platform_data) {
> >  		struct smc91c111_pdata *pdata = dev->platform_data;
> >  
> > -		priv->qemu_fixup = pdata->qemu_fixup;
> >  		priv->shift = pdata->addr_shift;
> >  		if (pdata->bus_width == 16)
> >  			priv->a = access_via_16bit;
> > @@ -1489,8 +1488,15 @@ static int smc91c111_probe(struct device *dev)
> >  	return 0;
> >  }
> >  
> > +static __maybe_unused struct of_device_id imx_fec_dt_ids[] = {
> 
> smc91c111_dt_ids

Fixed, thanks

Sascha

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list