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/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch | |
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/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch')
-rw-r--r-- | target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch b/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch index 29b52d2238..215569e406 100644 --- a/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch +++ b/target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch @@ -10514,7 +10514,7 @@ Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com> +module_exit(dpa_ptp_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c -@@ -0,0 +1,909 @@ +@@ -0,0 +1,907 @@ +/* Copyright 2008-2012 Freescale Semiconductor, Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -11582,7 +11582,6 @@ Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com> + struct mac_device *mac_dev; + struct platform_device *of_dev; + struct resource res; -+ const uint8_t *mac_addr; + const char *char_prop; + int nph; + u32 cell_index; @@ -11701,14 +11700,13 @@ Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com> + mac_dev->cell_index -= 8; + + /* Get the MAC address */ -+ mac_addr = of_get_mac_address(mac_node); -+ if (unlikely(mac_addr == NULL)) { ++ of_get_mac_address(mac_node, mac_dev->addr); ++ if (unlikely(!is_valid_ether_addr(mac_dev->addr))) { + dev_err(dev, "of_get_mac_address(%s) failed\n", + mac_node->full_name); + _errno = -EINVAL; + goto _return_dev_set_drvdata; + } -+ memcpy(mac_dev->addr, mac_addr, sizeof(mac_dev->addr)); + + /* Verify the number of port handles */ + nph = of_count_phandle_with_args(mac_node, "fsl,fman-ports", NULL); |