aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape
diff options
context:
space:
mode:
authorAnsuel Smith <ansuelsmth@gmail.com>2021-07-23 20:19:43 +0200
committerDavid Bauer <mail@david-bauer.net>2021-08-05 01:46:26 +0200
commit91a52f22a13d768f5b16a2fd0e1d74ffe36f9cb1 (patch)
treef28017e5a42615c51b599d6de96c9fb91d27d476 /target/linux/layerscape
parentedb6bc199049769be76bb3966debcc2b31511e4b (diff)
downloadupstream-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')
-rw-r--r--target/linux/layerscape/patches-5.4/701-net-0009-dpa-SDK-DPAA-1.x-Ethernet-driver.patch8
-rw-r--r--target/linux/layerscape/patches-5.4/701-net-0286-staging-fsl_ppfe-eth-introduce-pfe-driver.patch10
-rw-r--r--target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch10
-rw-r--r--target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch6
4 files changed, 7 insertions, 27 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);
diff --git a/target/linux/layerscape/patches-5.4/701-net-0286-staging-fsl_ppfe-eth-introduce-pfe-driver.patch b/target/linux/layerscape/patches-5.4/701-net-0286-staging-fsl_ppfe-eth-introduce-pfe-driver.patch
index 230238f9a0..13fd4f90d1 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0286-staging-fsl_ppfe-eth-introduce-pfe-driver.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0286-staging-fsl_ppfe-eth-introduce-pfe-driver.patch
@@ -6638,7 +6638,7 @@ Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
+}
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
-@@ -0,0 +1,394 @@
+@@ -0,0 +1,388 @@
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
@@ -6680,7 +6680,6 @@ Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
+ int size;
+ int ii = 0, phy_id = 0;
+ const u32 *addr;
-+ const void *mac_addr;
+
+ for (ii = 0; ii < if_cnt; ii++) {
+ gem = of_get_next_child(parent, gem);
@@ -6699,12 +6698,7 @@ Signed-off-by: Anjaneyulu Jagarlmudi <anji.jagarlmudi@nxp.com>
+
+ pdata->ls1012a_eth_pdata[port].gem_id = port;
+
-+ mac_addr = of_get_mac_address(gem);
-+
-+ if (mac_addr) {
-+ memcpy(pdata->ls1012a_eth_pdata[port].mac_addr, mac_addr,
-+ ETH_ALEN);
-+ }
++ of_get_mac_address(gem, pdata->ls1012a_eth_pdata[port].mac_addr);
+
+ pdata->ls1012a_eth_pdata[port].mii_config = of_get_phy_mode(gem);
+
diff --git a/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch b/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch
index 7e4c6ae6aa..7d59676781 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0313-staging-fsl_ppfe-eth-reorganize-platform-phy-paramet.patch
@@ -33,15 +33,9 @@ Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
int size;
int ii = 0, phy_id = 0;
const u32 *addr;
-@@ -49,18 +49,11 @@ static int pfe_get_gemac_if_proprties(st
- pdata->ls1012a_eth_pdata[port].gem_id = port;
+@@ -49,12 +49,6 @@ static int pfe_get_gemac_if_proprties(st
- mac_addr = of_get_mac_address(gem);
--
- if (mac_addr) {
- memcpy(pdata->ls1012a_eth_pdata[port].mac_addr, mac_addr,
- ETH_ALEN);
- }
+ of_get_mac_address(gem, pdata->ls1012a_eth_pdata[port].mac_addr);
- pdata->ls1012a_eth_pdata[port].mii_config = of_get_phy_mode(gem);
-
diff --git a/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch b/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch
index a42e9aa354..2613628d02 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0399-staging-fsl_ppfe-eth-Enhance-error-checking-in-platf.patch
@@ -30,9 +30,3 @@ Signed-off-by: Anji Jagarlmudi <anji.jagarlmudi@nxp.com>
pdata->ls1012a_eth_pdata[port].gem_id = port;
- mac_addr = of_get_mac_address(gem);
-- if (mac_addr) {
-+ if (!IS_ERR_OR_NULL(mac_addr)) {
- memcpy(pdata->ls1012a_eth_pdata[port].mac_addr, mac_addr,
- ETH_ALEN);
- }