ð0 {
compatible = "qca,ar9340-eth", "syscon";
+ reg = <0x19000000 0x200>,
+ <0x18070000 0x20>;
+ reg-names = "mac", "interface";
pll-data = <0x16000000 0x00000101 0x00001616>;
pll-reg = <0x4 0x2c 17>;
include/linux/platform_device.h | 3 +++
3 files changed, 24 insertions(+)
-diff --git a/Documentation/driver-api/driver-model/devres.rst b/Documentation/driver-api/driver-model/devres.rst
-index 480b78ca3871..4ab193319d8c 100644
--- a/Documentation/driver-api/driver-model/devres.rst
+++ b/Documentation/driver-api/driver-model/devres.rst
-@@ -319,6 +319,7 @@ IOMAP
- devm_ioremap_resource_wc()
- devm_platform_ioremap_resource() : calls devm_ioremap_resource() for platform device
- devm_platform_ioremap_resource_wc()
+@@ -316,6 +316,7 @@ IOMAP
+ devm_ioremap_nocache()
+ devm_ioremap_wc()
+ devm_ioremap_resource() : checks resource, requests memory region, ioremaps
+ devm_platform_ioremap_resource_byname()
devm_iounmap()
pcim_iomap()
pcim_iomap_regions() : do request_region() and iomap() on multiple BARs
-diff --git a/drivers/base/platform.c b/drivers/base/platform.c
-index 28eb71967f17..1b8a20466eef 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
-@@ -95,6 +95,26 @@ void __iomem *devm_platform_ioremap_resource_wc(struct platform_device *pdev,
- res = platform_get_resource(pdev, IORESOURCE_MEM, index);
- return devm_ioremap_resource_wc(&pdev->dev, res);
+@@ -79,6 +79,26 @@ void __iomem *devm_platform_ioremap_reso
+ return devm_ioremap_resource(&pdev->dev, res);
}
+ EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource);
+
+/**
+ * devm_platform_ioremap_resource_byname - call devm_ioremap_resource for
+EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname);
#endif /* CONFIG_HAS_IOMEM */
- /**
-diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
-index 91fcdbbae89d..276a03c24691 100644
+ static int __platform_get_irq(struct platform_device *dev, unsigned int num)
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
-@@ -60,6 +60,9 @@ devm_platform_ioremap_resource(struct platform_device *pdev,
+@@ -57,6 +57,9 @@ platform_find_device_by_driver(struct de
extern void __iomem *
- devm_platform_ioremap_resource_wc(struct platform_device *pdev,
- unsigned int index);
+ devm_platform_ioremap_resource(struct platform_device *pdev,
+ unsigned int index);
+extern void __iomem *
+devm_platform_ioremap_resource_byname(struct platform_device *pdev,
+ const char *name);
extern int platform_get_irq(struct platform_device *, unsigned int);
extern int platform_get_irq_optional(struct platform_device *, unsigned int);
extern int platform_irq_count(struct platform_device *);
---
-2.20.1
-
-From 8ac0ad0bfb778c6a115b5a75039a5dfc5213d08e Mon Sep 17 00:00:00 2001
+From 9317467fc8ad56b17035dddce324192c9668ce02 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 1 Mar 2020 14:54:24 +0100
Subject: ag71xx: Remove mac_idx and rename mii bus
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
- drivers/net/ethernet/atheros/ag71xx.c | 17 +----------------
- 1 file changed, 1 insertion(+), 16 deletions(-)
+ drivers/net/ethernet/atheros/ag71xx.c | 19 ++-----------------
+ 1 file changed, 2 insertions(+), 17 deletions(-)
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
mii_bus->priv = ag;
mii_bus->parent = dev;
- snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s.%d", np->name, ag->mac_idx);
-+ snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(priv->dev));
++ snprintf(mii_bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(dev));
if (!IS_ERR(ag->mdio_reset)) {
reset_control_assert(ag->mdio_reset);
static int ag71xx_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
+@@ -1690,7 +1685,7 @@ static int ag71xx_probe(struct platform_
+ struct net_device *ndev;
+ struct resource *res;
+ const void *mac_addr;
+- int tx_size, err, i;
++ int tx_size, err;
+ struct ag71xx *ag;
+
+ if (!np)
@@ -1709,16 +1704,6 @@ static int ag71xx_probe(struct platform_
return -EINVAL;
-From bb9aa90e6781dbd4f08394d9b18f44340a07d92c Mon Sep 17 00:00:00 2001
+From 4df15abe3635dc8692031e18be8e4f02f6895e74 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 1 Mar 2020 15:02:07 +0100
Subject: ag71xx: Use devm_platform_ioremap_resource()
struct net_device *ndev;
- struct resource *res;
const void *mac_addr;
- int tx_size, err, i;
+ int tx_size, err;
struct ag71xx *ag;
@@ -1695,16 +1694,16 @@ static int ag71xx_probe(struct platform_
if (!ndev)
-From ef197f2773a96a135d25bf259ca3bebbee48c506 Mon Sep 17 00:00:00 2001
+From cc92615d86ccedf5fe43cb4c7c74e6a237c856e1 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 1 Mar 2020 15:08:23 +0100
Subject: ag71xx: Do not free netdev in error handling
-From a65ebed329a6cd641510f54ffac32324d511c68a Mon Sep 17 00:00:00 2001
+From 6aca67c4d0d277a2d1e45cf61eafd5d3360ccca0 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 1 Mar 2020 13:59:26 +0100
Subject: ag71xx: Add support for RMII and RGMII
-From 8c2ee23c3eedae403098c5b8d0ba60cef7f4171e Mon Sep 17 00:00:00 2001
+From 77858d8ef04e47db1b2edf294a2afc842e67b34e Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sun, 1 Mar 2020 18:02:22 +0100
Subject: ag71xx: Configure Ethernet interface
+{
+ u32 val;
+
-+ if (!ag71xx_is(ag, AR9330) || ag71xx_is(ag, AR9340))
++ if (!ag71xx_is(ag, AR9330) && !ag71xx_is(ag, AR9340))
+ return;
+
+ val = ag71xx_inf_rr(ag, AG71XX_GMAC_REG_ETH_CFG);
+ val |= ETH_CFG_RGMII_GE0;
+ break;
+ default:
-+ dev_err(ds->dev,
++ netif_err(ag, link, ag->ndev,
+ "Unsupported interface: %d\n",
+ state->interface);
+ return;
+ /* The interface resource is optional */
+ ag->inf_base = devm_platform_ioremap_resource_byname(pdev, "interface");
-+ if (IS_ERR(ag->inf_base) && IS_ERR(ag->inf_base) != -ENOENT)
++ if (IS_ERR(ag->inf_base) && PTR_ERR(ag->inf_base) != -ENOENT)
+ return PTR_ERR(ag->inf_base);
+
ag->clk_eth = devm_clk_get(&pdev->dev, "eth");