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

Sascha Hauer s.hauer at pengutronix.de
Tue May 2 02:14:13 PDT 2023


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[] = {
+	{
+		.compatible = "smsc,lan91c111",
+	},
+};
+
 static struct driver smc91c111_driver = {
-        .name  = "smc91c111",
-        .probe = smc91c111_probe,
+	.of_compatible = DRV_OF_COMPAT(imx_fec_dt_ids),
+	.name  = "smc91c111",
+	.probe = smc91c111_probe,
 };
 device_platform_driver(smc91c111_driver);
diff --git a/include/platform_data/eth-smc91111.h b/include/platform_data/eth-smc91111.h
index 72193bf972..ddc28438e3 100644
--- a/include/platform_data/eth-smc91111.h
+++ b/include/platform_data/eth-smc91111.h
@@ -8,7 +8,6 @@
 #define __SMC91111_H__
 
 struct smc91c111_pdata {
-	int qemu_fixup;
 	int addr_shift;
 	int bus_width;
 	bool word_aligned_short_writes;
-- 
2.39.2




More information about the barebox mailing list