From 91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1 Mon Sep 17 00:00:00 2001 From: Ansuel Smith Date: Fri, 23 Jul 2021 20:19:43 +0200 Subject: 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 --- ...84-ath10k-Try-to-get-mac-address-from-dts.patch | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch (limited to 'package/kernel/mac80211/patches/ath10k') diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch new file mode 100644 index 0000000000..5f427f6b8f --- /dev/null +++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch @@ -0,0 +1,42 @@ +From 22fb5991a44c78ff18ec0082dc90c809356eb893 Mon Sep 17 00:00:00 2001 +From: Ansuel Smith +Date: Sun, 27 Sep 2020 19:23:35 +0200 +Subject: [PATCH 1/2] ath10k: Try to get mac-address from dts + +Most of embedded device that have the ath10k wifi integrated store the +mac-address in nvmem partitions. Try to fetch the mac-address using the +standard 'of_get_mac_address' than in all the check also try to fetch the +address using the nvmem api searching for a defined 'mac-address' cell. +Mac-address defined in the dts have priority than any other address found. + +Tested-on: QCA9984 hw1.0 PCI 10.4 + +Signed-off-by: Ansuel Smith +--- + drivers/net/wireless/ath/ath10k/core.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c +index 5f4e12196..9ed7b9883 100644 +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -3062,6 +3068,8 @@ static int ath10k_core_probe_fw(struct ath10k *ar) + + device_get_mac_address(ar->dev, ar->mac_addr, sizeof(ar->mac_addr)); + ++ of_get_mac_address(ar->dev->of_node, ar->mac_addr); ++ + ret = ath10k_core_init_firmware_features(ar); + if (ret) { + ath10k_err(ar, "fatal problem with firmware features: %d\n", +-- +2.27.0 + -- cgit v1.2.3