1
0
Fork 0
forked from mirror/openwrt

layerscape: kernel: 6.12: refresh patches

Patches 400,701,702 were taken from 6.12 nxp tree.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19152
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Pawel Dembicki 2025-06-08 12:52:10 +02:00 committed by Hauke Mehrtens
parent f2a0b275c2
commit 5ca632e016
4 changed files with 131 additions and 64 deletions

View file

@ -1,6 +1,6 @@
From bd3fa0b0ed51dd6a6564c01d37b36ff475f87ed4 Mon Sep 17 00:00:00 2001
From fa47ee1700323a0c3163c18941659692e5c22cff Mon Sep 17 00:00:00 2001
From: Han Xu <han.xu@nxp.com>
Date: Tue, 14 Apr 2020 11:58:44 -0500
Date: Tue, 23 Jan 2024 20:51:49 -0600
Subject: [PATCH] LF-20-3 mtd: spi-nor: Use 1 bit mode of spansion(s25fs512s)
flash
@ -15,13 +15,14 @@ Signed-off-by: Kuldeep Singh <kuldeep.singh@nxp.com>
--- a/drivers/mtd/spi-nor/spansion.c
+++ b/drivers/mtd/spi-nor/spansion.c
@@ -799,8 +799,8 @@ static const struct flash_info spansion_
MFR_FLAGS(USE_CLSR)
},
{ "s25fs512s", INFO6(0x010220, 0x4d0081, 256 * 1024, 256)
- NO_SFDP_FLAGS(SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
MFR_FLAGS(USE_CLSR)
+ FIXUP_FLAGS(SPI_NOR_4B_OPCODES)
.fixups = &s25fs_s_nor_fixups, },
{ "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64) },
{ "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256) },
@@ -828,9 +828,9 @@ static const struct flash_info spansion_
.name = "s25fs512s",
.size = SZ_64M,
.sector_size = SZ_256K,
- .no_sfdp_flags = SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ,
.mfr_flags = USE_CLSR,
.fixups = &s25fs_s_nor_fixups,
+ .fixup_flags = SPI_NOR_4B_OPCODES,
}, {
.id = SNOR_ID(0x01, 0x20, 0x18, 0x03, 0x00),
.name = "s25sl12800",

View file

@ -1,4 +1,4 @@
From 9ee016f90af0bbcac576af881f1760ee9d9e38e0 Mon Sep 17 00:00:00 2001
From 81f5150aba929b222783a60a408b9a20a23bd171 Mon Sep 17 00:00:00 2001
From: Calvin Johnson <calvin.johnson@nxp.com>
Date: Sat, 16 Sep 2017 07:05:49 +0530
Subject: [PATCH] staging: add fsl_ppfe driver
@ -6,8 +6,8 @@ MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This is squash of all commits with ppfe driver taken from NXP 6.6 tree:
https://github.com/nxp-qoriq/linux/tree/lf-6.6.y
This is squash of all commits with ppfe driver taken from NXP 6.12 tree:
https://github.com/nxp-qoriq/linux/tree/lf-6.12.y
net: fsl_ppfe: dts binding for ppfe
@ -606,6 +606,60 @@ together as no users anymore.
Fixes: 9d95b13bd084 ("staging: fsl_ppfe: Remove C45 check and related code in driver")
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
LF-13827-2 net: pfe: fix Wmissing-prototypes build warnings
drivers/staging/fsl_ppfe/pfe_firmware.c:128:5: warning: no previous prototype for pfe_load_elf [-Wmissing-prototypes]
128 | int pfe_load_elf(int pe_mask, const u8 *fw, struct pfe *pfe)
| ^~~~~~~~~~~~
drivers/staging/fsl_ppfe/pfe_firmware.c:185:5: warning: no previous prototype for get_firmware_in_fdt [-Wmissing-prototypes]
185 | int get_firmware_in_fdt(const u8 **pe_fw, const char *name)
| ^~~~~~~~~~~~~~~~~~~
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
LF-13827-3 net/pfe: use $(src) instead of $(srctree)/$(src)
Cope with upstream change
b1992c3772e6 ("kbuild: use $(src) instead of $(srctree)/$(src) for source directory")
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
LF-13827-6 net: ppfe: update the usage of eventfd_signal
Cope with the API change since the commit
1808acc4fab2 ("eventfd: simplify eventfd_signal()")
Otherwise will meet the following build error:
drivers/staging/fsl_ppfe/pfe_cdev.c: In function hif_us_isr:
drivers/staging/fsl_ppfe/pfe_cdev.c:112:17: error: too many arguments to function eventfd_signal
112 | eventfd_signal(trigger, 1);
| ^~~~~~~~~~~~~~
Reviewed-by: Wei Fang <wei.fang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
LF-13827-7 net: pfe: Replace strlcpy() with strscpy() for many drivers
Cope with upstream change:
commit d26270061ae6 ("string: Remove strlcpy()")
e.g.
../drivers/i2c/busses/i2c-flexio.c: In function imx_flexio_i2c_master_probe:
../drivers/i2c/busses/i2c-flexio.c:683:9: error: implicit declaration of function strlcpy; did you mean strncpy? [-Werror=implicit-function-declaration]
683 | strlcpy(i2c_dev->adapter.name, dev_name(i2c_dev->dev),
| ^~~~~~~
| strncpy
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
drivers: make all local platform_driver::remove() return void
0edb555a65d1 ("platform: Make platform_driver::remove() return void")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
.../devicetree/bindings/net/fsl_ppfe/pfe.txt | 199 ++
@ -642,13 +696,13 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
drivers/staging/fsl_ppfe/pfe_hif_lib.h | 229 ++
drivers/staging/fsl_ppfe/pfe_hw.c | 164 ++
drivers/staging/fsl_ppfe/pfe_hw.h | 15 +
.../staging/fsl_ppfe/pfe_ls1012a_platform.c | 383 +++
.../staging/fsl_ppfe/pfe_ls1012a_platform.c | 381 +++
drivers/staging/fsl_ppfe/pfe_mod.c | 158 +
drivers/staging/fsl_ppfe/pfe_mod.h | 103 +
drivers/staging/fsl_ppfe/pfe_perfmon.h | 26 +
drivers/staging/fsl_ppfe/pfe_sysfs.c | 840 ++++++
drivers/staging/fsl_ppfe/pfe_sysfs.h | 17 +
40 files changed, 10977 insertions(+)
40 files changed, 10975 insertions(+)
create mode 100644 Documentation/devicetree/bindings/net/fsl_ppfe/pfe.txt
create mode 100644 drivers/staging/fsl_ppfe/Kconfig
create mode 100644 drivers/staging/fsl_ppfe/Makefile
@ -891,7 +945,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+};
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8360,6 +8360,14 @@ F: drivers/ptp/ptp_qoriq.c
@@ -9107,6 +9107,14 @@ F: drivers/ptp/ptp_qoriq.c
F: drivers/ptp/ptp_qoriq_debugfs.c
F: include/linux/fsl/ptp_qoriq.h
@ -908,7 +962,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
L: linux-spi@vger.kernel.org
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -78,4 +78,6 @@ source "drivers/staging/qlge/Kconfig"
@@ -64,4 +64,6 @@ source "drivers/staging/fieldbus/Kconfig
source "drivers/staging/vme_user/Kconfig"
@ -917,10 +971,10 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
endif # STAGING
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -28,3 +28,4 @@ obj-$(CONFIG_PI433) += pi433/
@@ -21,3 +21,4 @@ obj-$(CONFIG_GREYBUS) += greybus/
obj-$(CONFIG_BCM2835_VCHIQ) += vc04_services/
obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/
obj-$(CONFIG_FIELDBUS_DEV) += fieldbus/
obj-$(CONFIG_QLGE) += qlge/
+obj-$(CONFIG_FSL_PPFE) += fsl_ppfe/
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/Kconfig
@ -953,7 +1007,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+# Makefile for Freesecale PPFE driver
+#
+
+ccflags-y += -I $(srctree)/$(src)/include -I $(srctree)/$(src)
+ccflags-y += -I $(src)/include -I $(src)
+
+obj-$(CONFIG_FSL_PPFE) += pfe.o
+
@ -2619,7 +2673,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+ */
+ writel_relaxed(int_enable_mask, HIF_INT_ENABLE);
+
+ eventfd_signal(trigger, 1);
+ eventfd_signal(trigger);
+ }
+
+ return IRQ_HANDLED;
@ -3652,7 +3706,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+/* pfe_eth_sysfs_exit
+ *
+ */
+void pfe_eth_sysfs_exit(struct net_device *ndev)
+static void pfe_eth_sysfs_exit(struct net_device *ndev)
+{
+#ifdef PFE_ETH_TX_STATS
+ device_remove_file(&ndev->dev, &dev_attr_tx_stats);
@ -3853,10 +3907,10 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+static void pfe_eth_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo
+ *drvinfo)
+{
+ strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
+ strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version));
+ strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
+ strlcpy(drvinfo->bus_info, "N/A", sizeof(drvinfo->bus_info));
+ strscpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
+ strscpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version));
+ strscpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
+ strscpy(drvinfo->bus_info, "N/A", sizeof(drvinfo->bus_info));
+}
+
+/*
@ -4724,7 +4778,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+/*
+ * pfe_eth_shutdown
+ */
+int pfe_eth_shutdown(struct net_device *ndev, int wake)
+static int pfe_eth_shutdown(struct net_device *ndev, int wake)
+{
+ struct pfe_eth_priv_s *priv = netdev_priv(ndev);
+ int i, qstatus, id;
@ -5054,7 +5108,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+ }
+}
+
+void pfe_tx_get_req_desc(struct sk_buff *skb, unsigned int *n_desc, unsigned int
+static void pfe_tx_get_req_desc(struct sk_buff *skb, unsigned int *n_desc, unsigned int
+ *n_segs)
+{
+ struct skb_shared_info *sh = skb_shinfo(skb);
@ -5168,8 +5222,8 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+
+/* pfe_eth_enet_addr_byte_mac
+ */
+int pfe_eth_enet_addr_byte_mac(u8 *enet_byte_addr,
+ struct pfe_mac_addr *enet_addr)
+static int pfe_eth_enet_addr_byte_mac(u8 *enet_byte_addr,
+ struct pfe_mac_addr *enet_addr)
+{
+ if (!enet_byte_addr || !enet_addr) {
+ return -1;
@ -6121,7 +6175,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+ * @return 0 on success, a negative value on error
+ *
+ */
+int pfe_load_elf(int pe_mask, const u8 *fw, struct pfe *pfe)
+static int pfe_load_elf(int pe_mask, const u8 *fw, struct pfe *pfe)
+{
+ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw;
+ Elf32_Half sections = be16_to_cpu(elf_hdr->e_shnum);
@ -6178,7 +6232,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+ return rc;
+}
+
+int get_firmware_in_fdt(const u8 **pe_fw, const char *name)
+static int get_firmware_in_fdt(const u8 **pe_fw, const char *name)
+{
+ struct device_node *np;
+ const unsigned int *len;
@ -6541,8 +6595,8 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+ * aligned)
+ * @param[in] len Number of bytes to copy
+ */
+void pe_mem_memcpy_to32(int id, u32 mem_access_addr, const void *src, unsigned
+int len)
+static void pe_mem_memcpy_to32(int id, u32 mem_access_addr, const void *src,
+ unsigned int len)
+{
+ u32 offset = 0, val, addr;
+ unsigned int len32 = len >> 2;
@ -7470,7 +7524,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+/* GEMAC enable pause tx function.
+ * @param[in] base GEMAC base address
+ */
+void gemac_enable_pause_tx(void *base)
+static void __maybe_unused gemac_enable_pause_tx(void *base)
+{
+ writel(EMAC_RX_SECTION_EMPTY_V, base + EMAC_RX_SECTION_EMPTY);
+}
@ -7478,7 +7532,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+/* GEMAC disable pause tx function.
+ * @param[in] base GEMAC base address
+ */
+void gemac_disable_pause_tx(void *base)
+static void __maybe_unused gemac_disable_pause_tx(void *base)
+{
+ writel(0x0, base + EMAC_RX_SECTION_EMPTY);
+}
@ -8124,7 +8178,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+ hif->descr_baseaddr_v, hif->descr_baseaddr_p);
+}
+
+void pfe_hif_desc_dump(struct pfe_hif *hif)
+static void __maybe_unused pfe_hif_desc_dump(struct pfe_hif *hif)
+{
+ struct hif_desc *desc;
+ unsigned long desc_p;
@ -10254,7 +10308,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+#endif /* _PFE_HW_H_ */
--- /dev/null
+++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c
@@ -0,0 +1,380 @@
@@ -0,0 +1,381 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2015-2016 Freescale Semiconductor, Inc.
@ -10519,10 +10573,11 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+static void pfe_platform_remove(struct platform_device *pdev)
+{
+ struct pfe *pfe = platform_get_drvdata(pdev);
+ int rc;
+
+ pr_info("%s\n", __func__);
+
+ pfe_remove(pfe);
+ rc = pfe_remove(pfe);
+
+ iounmap(pfe->cbus_baseaddr);
+
@ -10535,7 +10590,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+
+#ifdef CONFIG_PM
+#ifdef CONFIG_PM_SLEEP
+int pfe_platform_suspend(struct device *dev)
+static int pfe_platform_suspend(struct device *dev)
+{
+ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev));
+ struct net_device *netdev;
@ -10621,7 +10676,7 @@ Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
+
+static struct platform_driver pfe_platform_driver = {
+ .probe = pfe_platform_probe,
+ .remove_new = pfe_platform_remove,
+ .remove = pfe_platform_remove,
+ .driver = {
+ .name = "pfe",
+ .of_match_table = pfe_match,

View file

@ -1,4 +1,4 @@
From 3823e4e1078a95e26b9a69e88c9bf862b0267e1c Mon Sep 17 00:00:00 2001
From 5677c6ef5f4096f3149a4e8cfd1438bc9eb2e8a4 Mon Sep 17 00:00:00 2001
From: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
Date: Wed, 29 Nov 2017 15:27:57 +0530
Subject: [PATCH] phy: Add 2.5G SGMII interface mode
@ -8,11 +8,22 @@ in existing phy_interface list
Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
---
drivers/net/phy/phy-core.c | 1 +
drivers/net/phy/phylink.c | 2 ++
include/linux/phy.h | 3 +++
3 files changed, 6 insertions(+)
Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
drivers/net/phy/phy-core.c | 1 +
drivers/net/phy/phylink.c | 2 ++
include/linux/phy.h | 3 +++
4 files changed, 7 insertions(+)
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -65,6 +65,7 @@ properties:
- mii
- gmii
- sgmii
+ - sgmii-2500
- psgmii
- qsgmii
- qusgmii
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -138,6 +138,7 @@ int phy_interface_num_ports(phy_interfac
@ -25,15 +36,15 @@ Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
case PHY_INTERFACE_MODE_QUSGMII:
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -231,6 +231,7 @@ static int phylink_interface_max_speed(p
@@ -230,6 +230,7 @@ static int phylink_interface_max_speed(p
case PHY_INTERFACE_MODE_GMII:
return SPEED_1000;
case PHY_INTERFACE_MODE_2500BASEX:
+ case PHY_INTERFACE_MODE_2500SGMII:
case PHY_INTERFACE_MODE_2500BASEX:
case PHY_INTERFACE_MODE_10G_QXGMII:
return SPEED_2500;
case PHY_INTERFACE_MODE_5GBASER:
@@ -539,6 +540,7 @@ unsigned long phylink_get_capabilities(p
@@ -544,6 +545,7 @@ static unsigned long phylink_get_capabil
break;
case PHY_INTERFACE_MODE_2500BASEX:
@ -43,20 +54,20 @@ Signed-off-by: Bhaskar Upadhaya <Bhaskar.Upadhaya@nxp.com>
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -165,6 +165,7 @@ typedef enum {
PHY_INTERFACE_MODE_10GKR,
@@ -170,6 +170,7 @@ typedef enum {
PHY_INTERFACE_MODE_QUSGMII,
PHY_INTERFACE_MODE_1000BASEKX,
PHY_INTERFACE_MODE_10G_QXGMII,
+ PHY_INTERFACE_MODE_2500SGMII,
PHY_INTERFACE_MODE_MAX,
} phy_interface_t;
@@ -286,6 +287,8 @@ static inline const char *phy_modes(phy_
return "100base-x";
case PHY_INTERFACE_MODE_QUSGMII:
return "qusgmii";
@@ -235,6 +236,8 @@ static inline const char *phy_modes(phy_
return "gmii";
case PHY_INTERFACE_MODE_SGMII:
return "sgmii";
+ case PHY_INTERFACE_MODE_2500SGMII:
+ return "sgmii-2500";
default:
return "unknown";
}
case PHY_INTERFACE_MODE_TBI:
return "tbi";
case PHY_INTERFACE_MODE_REVMII:

View file

@ -194,7 +194,7 @@ Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
return;
@@ -186,16 +186,16 @@ static void pfe_hif_free_descr(struct pf
void pfe_hif_desc_dump(struct pfe_hif *hif)
static void __maybe_unused pfe_hif_desc_dump(struct pfe_hif *hif)
{
struct hif_desc *desc;
- unsigned long desc_p;
@ -213,7 +213,7 @@ Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
for (ii = 0; ii < hif->rx_ring_size; ii++) {
pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n",
readl(&desc->status), readl(&desc->ctrl),
@@ -204,10 +204,10 @@ void pfe_hif_desc_dump(struct pfe_hif *h
@@ -204,10 +204,10 @@ static void __maybe_unused pfe_hif_desc_
}
desc = hif->tx_base;