From cddd4591404fb4c53dc0b3c0b15b942cdbed4356 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Fri, 10 Apr 2020 10:47:05 +0800 Subject: 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 --- ...ng-fsl-dpaa2-mac-connect-to-the-fixed-phy.patch | 92 ++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 target/linux/layerscape/patches-5.4/701-net-0175-staging-fsl-dpaa2-mac-connect-to-the-fixed-phy.patch (limited to 'target/linux/layerscape/patches-5.4/701-net-0175-staging-fsl-dpaa2-mac-connect-to-the-fixed-phy.patch') diff --git a/target/linux/layerscape/patches-5.4/701-net-0175-staging-fsl-dpaa2-mac-connect-to-the-fixed-phy.patch b/target/linux/layerscape/patches-5.4/701-net-0175-staging-fsl-dpaa2-mac-connect-to-the-fixed-phy.patch new file mode 100644 index 0000000000..8d0e122b12 --- /dev/null +++ b/target/linux/layerscape/patches-5.4/701-net-0175-staging-fsl-dpaa2-mac-connect-to-the-fixed-phy.patch @@ -0,0 +1,92 @@ +From 69e35d8266713d36ad31b04d9b7cb32913d243c0 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 27 Nov 2018 15:23:47 +0200 +Subject: [PATCH] staging: fsl-dpaa2/mac: connect to the fixed phy + +This patch is formed from 2 parts: + - first it moves the code that determines the if_mode to the + beginning so that it's used for both fixed link and phy mode. + - secondly, when in fixed link mode, call the phy_connect_phy + function as needed. + +Signed-off-by: Ioana Ciornei +--- + drivers/staging/fsl-dpaa2/mac/mac.c | 39 ++++++++++++++++++++++++------------- + 1 file changed, 25 insertions(+), 14 deletions(-) + +--- a/drivers/staging/fsl-dpaa2/mac/mac.c ++++ b/drivers/staging/fsl-dpaa2/mac/mac.c +@@ -642,21 +642,12 @@ static int dpaa2_mac_probe(struct fsl_mc + } + #endif /* CONFIG_FSL_DPAA2_MAC_NETDEVS */ + +- /* probe the PHY as fixed-link if the DPMAC attribute indicates so */ +- if (priv->attr.link_type == DPMAC_LINK_TYPE_FIXED) +- goto probe_fixed_link; +- +- /* or if there's no phy-handle defined in the device tree */ +- phy_node = of_parse_phandle(dpmac_node, "phy-handle", 0); +- if (!phy_node) { +- goto probe_fixed_link; +- } +- ++ /* get the interface mode from the dpmac of node or from the MC attributes */ + if_mode = of_get_phy_mode(dpmac_node); + if (if_mode >= 0) { + dev_dbg(dev, "\tusing if mode %s for eth_if %d\n", + phy_modes(if_mode), priv->attr.eth_if); +- goto phy_connect; ++ goto link_type; + } + + if (priv->attr.eth_if < ARRAY_SIZE(dpaa2_mac_iface_mode)) { +@@ -664,12 +655,23 @@ static int dpaa2_mac_probe(struct fsl_mc + dev_dbg(dev, "\tusing if mode %s for eth_if %d\n", + phy_modes(if_mode), priv->attr.eth_if); + } else { +- dev_warn(dev, "Unexpected interface mode %d, will probe as fixed link\n", +- priv->attr.eth_if); ++ dev_err(dev, "Unexpected interface mode %d\n", ++ priv->attr.eth_if); ++ err = -EINVAL; ++ goto err_no_if_mode; ++ } ++ ++link_type: ++ /* probe the PHY as fixed-link if the DPMAC attribute indicates so */ ++ if (priv->attr.link_type == DPMAC_LINK_TYPE_FIXED) ++ goto probe_fixed_link; ++ ++ /* or if there's no phy-handle defined in the device tree */ ++ phy_node = of_parse_phandle(dpmac_node, "phy-handle", 0); ++ if (!phy_node) { + goto probe_fixed_link; + } + +-phy_connect: + /* try to connect to the PHY */ + netdev->phydev = of_phy_connect(netdev, phy_node, + &dpaa2_mac_link_changed, 0, if_mode); +@@ -702,6 +704,14 @@ probe_fixed_link: + err = -EFAULT; + goto err_no_phy; + } ++ ++ err = phy_connect_direct(netdev, netdev->phydev, ++ &dpaa2_mac_link_changed, if_mode); ++ if (err) { ++ dev_err(dev, "error trying to connect to PHY\n"); ++ goto err_no_phy; ++ } ++ + dev_info(dev, "Registered fixed PHY.\n"); + } + +@@ -709,6 +719,7 @@ probe_fixed_link: + + return 0; + ++err_no_if_mode: + err_defer: + err_no_phy: + #ifdef CONFIG_FSL_DPAA2_MAC_NETDEVS -- cgit v1.2.3