diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2021-07-23 20:19:43 +0200 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-08-05 01:46:26 +0200 |
commit | 91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1 (patch) | |
tree | f28017e5a42615c51b599d6de96c9fb91d27d476 /target/linux/bcm4908 | |
parent | edb6bc199049769be76bb3966debcc2b31511e4b (diff) | |
download | upstream-91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1.tar.gz upstream-91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1.tar.bz2 upstream-91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1.zip |
treewide: backport support for nvmem on non platform devices
In the current state, nvmem cells are only detected on platform device.
To quickly fix the problem, we register the affected problematic driver
with the of_platform but that is more an hack than a real solution.
Backport from net-next the required patch so that nvmem can work also
with non-platform devices and rework our current patch.
Drop the mediatek and dsa workaround and rework the ath10k patches.
Rework every driver that use the of_get_mac_address api.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Diffstat (limited to 'target/linux/bcm4908')
-rw-r--r-- | target/linux/bcm4908/patches-5.4/074-v5.13-0001-net-broadcom-bcm4908_enet-read-MAC-from-OF.patch | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/target/linux/bcm4908/patches-5.4/074-v5.13-0001-net-broadcom-bcm4908_enet-read-MAC-from-OF.patch b/target/linux/bcm4908/patches-5.4/074-v5.13-0001-net-broadcom-bcm4908_enet-read-MAC-from-OF.patch index 4b8e1f83b8..df004c0480 100644 --- a/target/linux/bcm4908/patches-5.4/074-v5.13-0001-net-broadcom-bcm4908_enet-read-MAC-from-OF.patch +++ b/target/linux/bcm4908/patches-5.4/074-v5.13-0001-net-broadcom-bcm4908_enet-read-MAC-from-OF.patch @@ -25,23 +25,13 @@ Signed-off-by: David S. Miller <davem@davemloft.net> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/string.h> -@@ -620,6 +621,7 @@ static int bcm4908_enet_probe(struct pla - struct device *dev = &pdev->dev; - struct net_device *netdev; - struct bcm4908_enet *enet; -+ const u8 *mac; - int err; - - netdev = devm_alloc_etherdev(dev, sizeof(*enet)); -@@ -647,7 +649,11 @@ static int bcm4908_enet_probe(struct pla +@@ -647,7 +649,9 @@ static int bcm4908_enet_probe(struct pla return err; SET_NETDEV_DEV(netdev, &pdev->dev); - eth_hw_addr_random(netdev); -+ mac = of_get_mac_address(dev->of_node); -+ if (!IS_ERR(mac)) -+ ether_addr_copy(netdev->dev_addr, mac); -+ else ++ of_get_mac_address(dev->of_node, netdev->dev_addr); ++ if (!is_valid_ether_addr(netdev->dev_addr)) + eth_hw_addr_random(netdev); netdev->netdev_ops = &bcm4908_enet_netdev_ops; netdev->min_mtu = ETH_ZLEN; |