aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch
diff options
context:
space:
mode:
authorYangbo Lu <yangbo.lu@nxp.com>2020-04-10 10:47:05 +0800
committerPetr Štetiar <ynezz@true.cz>2020-05-07 12:53:06 +0200
commitcddd4591404fb4c53dc0b3c0b15b942cdbed4356 (patch)
tree392c1179de46b0f804e3789edca19069b64e6b44 /target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch
parentd1d2c0b5579ea4f69a42246c9318539d61ba1999 (diff)
downloadupstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.tar.gz
upstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.tar.bz2
upstream-cddd4591404fb4c53dc0b3c0b15b942cdbed4356.zip
layerscape: add patches-5.4
Add patches for linux-5.4. The patches are from NXP LSDK-20.04 release which was tagged LSDK-20.04-V5.4. https://source.codeaurora.org/external/qoriq/qoriq-components/linux/ For boards LS1021A-IOT, and Traverse-LS1043 which are not involved in LSDK, port the dts patches from 4.14. The patches are sorted into the following categories: 301-arch-xxxx 302-dts-xxxx 303-core-xxxx 701-net-xxxx 801-audio-xxxx 802-can-xxxx 803-clock-xxxx 804-crypto-xxxx 805-display-xxxx 806-dma-xxxx 807-gpio-xxxx 808-i2c-xxxx 809-jailhouse-xxxx 810-keys-xxxx 811-kvm-xxxx 812-pcie-xxxx 813-pm-xxxx 814-qe-xxxx 815-sata-xxxx 816-sdhc-xxxx 817-spi-xxxx 818-thermal-xxxx 819-uart-xxxx 820-usb-xxxx 821-vfio-xxxx Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Diffstat (limited to 'target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch')
-rw-r--r--target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch110
1 files changed, 110 insertions, 0 deletions
diff --git a/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch b/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch
new file mode 100644
index 0000000000..298c34a5e8
--- /dev/null
+++ b/target/linux/layerscape/patches-5.4/701-net-0307-staging-fsl_ppfe-eth-add-fixed-link-support.patch
@@ -0,0 +1,110 @@
+From 04373c37df836557ae7ebb769383baa1b57c5ffa Mon Sep 17 00:00:00 2001
+From: Calvin Johnson <calvin.johnson@nxp.com>
+Date: Thu, 4 Oct 2018 09:38:17 +0530
+Subject: [PATCH] staging: fsl_ppfe/eth: add fixed-link support
+
+In cases where MAC is not connected to a normal MDIO-managed PHY
+device, and instead to a switch, it is configured as a "fixed-link".
+Code to handle this scenario is added here.
+
+phy_node in the dtb is checked to identify a fixed-link.
+On identification of a fixed-link, it is registered and connected.
+
+Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
+---
+ drivers/staging/fsl_ppfe/pfe_eth.c | 21 ++++++++++++++++++++-
+ drivers/staging/fsl_ppfe/pfe_eth.h | 2 ++
+ drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c | 4 ++++
+ 3 files changed, 26 insertions(+), 1 deletion(-)
+
+--- a/drivers/staging/fsl_ppfe/pfe_eth.c
++++ b/drivers/staging/fsl_ppfe/pfe_eth.c
+@@ -39,6 +39,9 @@
+ #include <net/ip.h>
+ #include <net/sock.h>
+
++#include <linux/of.h>
++#include <linux/of_mdio.h>
++
+ #include <linux/io.h>
+ #include <asm/irq.h>
+ #include <linux/delay.h>
+@@ -1263,6 +1266,8 @@ static int pfe_phy_init(struct net_devic
+ char phy_id[MII_BUS_ID_SIZE + 3];
+ char bus_id[MII_BUS_ID_SIZE];
+ phy_interface_t interface;
++ struct device_node *phy_node;
++ int rc;
+
+ priv->oldlink = 0;
+ priv->oldspeed = 0;
+@@ -1293,7 +1298,20 @@ static int pfe_phy_init(struct net_devic
+ priv->oldspeed = 0;
+ priv->oldduplex = -1;
+ pr_info("%s interface %x\n", __func__, interface);
+- phydev = phy_connect(ndev, phy_id, &pfe_eth_adjust_link, interface);
++
++ if (of_phy_is_fixed_link(priv->phy_node)) {
++ rc = of_phy_register_fixed_link(priv->phy_node);
++ if (rc)
++ return rc;
++ phy_node = of_node_get(priv->phy_node);
++ phydev = of_phy_connect(ndev, phy_node, pfe_eth_adjust_link, 0,
++ priv->einfo->mii_config);
++ of_node_put(phy_node);
++
++ } else {
++ phydev = phy_connect(ndev, phy_id,
++ &pfe_eth_adjust_link, interface);
++ }
+
+ if (IS_ERR(phydev)) {
+ netdev_err(ndev, "phy_connect() failed\n");
+@@ -2371,6 +2389,7 @@ static int pfe_eth_init_one(struct pfe *
+ priv->ndev = ndev;
+ priv->id = einfo[id].gem_id;
+ priv->pfe = pfe;
++ priv->phy_node = einfo[id].phy_node;
+
+ SET_NETDEV_DEV(priv->ndev, priv->pfe->dev);
+
+--- a/drivers/staging/fsl_ppfe/pfe_eth.h
++++ b/drivers/staging/fsl_ppfe/pfe_eth.h
+@@ -61,6 +61,7 @@ struct ls1012a_eth_platform_data {
+ u32 phy_id;
+ u32 mdio_muxval;
+ u8 mac_addr[ETH_ALEN];
++ struct device_node *phy_node;
+ };
+
+ struct ls1012a_mdio_platform_data {
+@@ -144,6 +145,7 @@ struct pfe_eth_priv_s {
+ int oldspeed;
+ int oldduplex;
+ int oldlink;
++ struct device_node *phy_node;
+ /* mdio info */
+ int mdc_div;
+ struct mii_bus *mii_bus;
+--- a/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
++++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
+@@ -18,8 +18,10 @@
+
+ #include <linux/module.h>
+ #include <linux/device.h>
++#include <linux/of.h>
+ #include <linux/of_net.h>
+ #include <linux/of_address.h>
++#include <linux/of_mdio.h>
+ #include <linux/platform_device.h>
+ #include <linux/slab.h>
+ #include <linux/clk.h>
+@@ -124,6 +126,8 @@ static int pfe_get_gemac_if_proprties(st
+ pdata->ls1012a_mdio_pdata[port].irq[0] = PHY_POLL;
+
+ done:
++ if (of_phy_is_fixed_link(gem))
++ pdata->ls1012a_eth_pdata[port].phy_node = of_node_get(gem);
+
+ return 0;
+