-From bd3fa0b0ed51dd6a6564c01d37b36ff475f87ed4 Mon Sep 17 00:00:00 2001
+From fa47ee1700323a0c3163c18941659692e5c22cff Mon Sep 17 00:00:00 2001
-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
--- 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",
-From 9ee016f90af0bbcac576af881f1760ee9d9e38e0 Mon Sep 17 00:00:00 2001
+From 81f5150aba929b222783a60a408b9a20a23bd171 Mon Sep 17 00:00:00 2001
Date: Sat, 16 Sep 2017 07:05:49 +0530
Subject: [PATCH] staging: add fsl_ppfe driver
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
Fixes: 9d95b13bd084 ("staging: fsl_ppfe: Remove C45 check and related code in driver")
+
+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)
+ | ^~~~~~~~~~~~~~~~~~~
+
+
+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")
+
+
+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);
+ | ^~~~~~~~~~~~~~
+
+
+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
+
+
+drivers: make all local platform_driver::remove() return void
+
+0edb555a65d1 ("platform: Make platform_driver::remove() return void")
+
---
.../devicetree/bindings/net/fsl_ppfe/pfe.txt | 199 ++
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
+};
--- 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
--- 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"
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
+# 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
+
+ */
+ writel_relaxed(int_enable_mask, HIF_INT_ENABLE);
+
-+ eventfd_signal(trigger, 1);
++ eventfd_signal(trigger);
+ }
+
+ return IRQ_HANDLED;
+/* 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);
+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));
+}
+
+/*
+/*
+ * 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;
+ }
+}
+
-+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);
+
+/* 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;
+ * @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);
+ 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;
+ * 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;
+/* 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);
+}
+/* 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);
+}
+ 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;
+#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.
+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);
+
+
+#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;
+
+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,
-From 3823e4e1078a95e26b9a69e88c9bf862b0267e1c Mon Sep 17 00:00:00 2001
+From 5677c6ef5f4096f3149a4e8cfd1438bc9eb2e8a4 Mon Sep 17 00:00:00 2001
Date: Wed, 29 Nov 2017 15:27:57 +0530
Subject: [PATCH] phy: Add 2.5G SGMII interface mode
---
- 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
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:
--- 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:
+++ /dev/null
-From 1dc3a2e216d99adc2df022ab37eab32f61d80e0e Mon Sep 17 00:00:00 2001
-Date: Mon, 8 May 2023 19:26:48 +0200
-Subject: [PATCH] layerscape: 6.1: fix compilation warning for fsl ppfe driver
-
-Rework some desc dump and dummy pkt function to fix compilation warning.
-Fix compilation warning:
-drivers/staging/fsl_ppfe/pfe_hif.c: In function 'send_dummy_pkt_to_hif':
-drivers/staging/fsl_ppfe/pfe_hif.c:118:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
- 118 | ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
- | ^
-drivers/staging/fsl_ppfe/pfe_hif.c:122:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
- 122 | lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
- | ^
-drivers/staging/fsl_ppfe/pfe_hif.c: In function 'pfe_hif_desc_dump':
-drivers/staging/fsl_ppfe/pfe_hif.c:195:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
- 195 | desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
- | ^
-drivers/staging/fsl_ppfe/pfe_hif.c:195:36: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
- 195 | desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
- | ^
-drivers/staging/fsl_ppfe/pfe_hif.c:207:19: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
- 207 | desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
- | ^
-drivers/staging/fsl_ppfe/pfe_hif.c:207:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
- 207 | desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
- | ^
-cc1: all warnings being treated as errors
-
-In file included from ./include/linux/kernel.h:19,
- from ./include/linux/list.h:9,
- from ./include/linux/wait.h:7,
- from ./include/linux/eventfd.h:13,
- from drivers/staging/fsl_ppfe/pfe_cdev.c:11:
-drivers/staging/fsl_ppfe/pfe_cdev.c: In function 'pfe_cdev_read':
-./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Werror=format=]
- 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
- | ^~~~~~
-./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
- 422 | _p_func(_fmt, ##__VA_ARGS__); \
- | ^~~~
-./include/linux/printk.h:132:17: note: in expansion of macro 'printk'
- 132 | printk(fmt, ##__VA_ARGS__); \
- | ^~~~~~
-./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk'
- 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
- | ^~~~~~~~~
-./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH'
- 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
- | ^~~~~~~~
-./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG'
- 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
- | ^~~~~~~~~~
-drivers/staging/fsl_ppfe/pfe_cdev.c:42:17: note: in expansion of macro 'pr_debug'
- 42 | pr_debug("%u %lu", link_states[ret].phy_id,
- | ^~~~~~~~
-./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
- 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
- | ^~~~~~
-./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
- 422 | _p_func(_fmt, ##__VA_ARGS__); \
- | ^~~~
-./include/linux/printk.h:493:9: note: in expansion of macro 'printk'
- 493 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
- | ^~~~~~
-./include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
- 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
- | ^~~~~~~~
-./include/linux/printk.h:493:16: note: in expansion of macro 'KERN_ERR'
- 493 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
- | ^~~~~~~~
-drivers/staging/fsl_ppfe/pfe_cdev.c:50:17: note: in expansion of macro 'pr_err'
- 50 | pr_err("Failed to send (%d)bytes of (%lu) requested.\n",
- | ^~~~~~
-./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'unsigned int' [-Werror=format=]
- 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
- | ^~~~~~
-./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
- 422 | _p_func(_fmt, ##__VA_ARGS__); \
- | ^~~~
-./include/linux/printk.h:132:17: note: in expansion of macro 'printk'
- 132 | printk(fmt, ##__VA_ARGS__); \
- | ^~~~~~
-./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk'
- 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
- | ^~~~~~~~~
-./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH'
- 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
- | ^~~~~~~~
-./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG'
- 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
- | ^~~~~~~~~~
-drivers/staging/fsl_ppfe/pfe_cdev.c:57:9: note: in expansion of macro 'pr_debug'
- 57 | pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states));
- | ^~~~~~~~
-cc1: all warnings being treated as errors
-
-In file included from ./include/uapi/linux/posix_types.h:5,
- from ./include/uapi/linux/types.h:14,
- from ./include/linux/types.h:6,
- from ./include/linux/list.h:5,
- from ./include/linux/module.h:12,
- from drivers/staging/fsl_ppfe/pfe_sysfs.c:7:
-drivers/staging/fsl_ppfe/pfe_sysfs.c: In function 'pfe_set_util':
-./include/linux/stddef.h:8:14: error: passing argument 2 of 'kstrtoul' makes integer from pointer without a cast [-Werror=int-conversion]
- 8 | #define NULL ((void *)0)
- | ^~~~~~~~~~~
- | |
- | void *
-drivers/staging/fsl_ppfe/pfe_sysfs.c:538:39: note: in expansion of macro 'NULL'
- 538 | util_do_clear = kstrtoul(buf, NULL, 0);
- | ^~~~
-In file included from ./include/linux/kernel.h:13,
- from ./include/linux/list.h:9:
-./include/linux/kstrtox.h:30:69: note: expected 'unsigned int' but argument is of type 'void *'
- 30 | static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
- | ~~~~~~~~~~~~~^~~~
-cc1: all warnings being treated as errors
-
-With UTIL compiled on, fix compilation warning:
-drivers/staging/fsl_ppfe/pfe_hal.c: In function 'pe_load_ddr_section':
-drivers/staging/fsl_ppfe/pfe_hal.c:617:19: error: 'else' without a previous 'if'
- 617 | } else {
- | ^~~~
-drivers/staging/fsl_ppfe/pfe_hal.c:622:17: error: break statement not within loop or switch
- 622 | break;
- | ^~~~~
-drivers/staging/fsl_ppfe/pfe_hal.c:624:9: error: case label not within a switch statement
- 624 | case SHT_NOBITS:
- | ^~~~
-drivers/staging/fsl_ppfe/pfe_hal.c:627:17: error: break statement not within loop or switch
- 627 | break;
- | ^~~~~
-drivers/staging/fsl_ppfe/pfe_hal.c:629:9: error: 'default' label not within a switch statement
- 629 | default:
- | ^~~~~~~
-drivers/staging/fsl_ppfe/pfe_hal.c: At top level:
-drivers/staging/fsl_ppfe/pfe_hal.c:635:9: error: expected identifier or '(' before 'return'
- 635 | return 0;
- | ^~~~~~
-drivers/staging/fsl_ppfe/pfe_hal.c:636:1: error: expected identifier or '(' before '}' token
- 636 | }
-
----
- drivers/staging/fsl_ppfe/pfe_cdev.c | 6 +++---
- drivers/staging/fsl_ppfe/pfe_hif.c | 14 +++++++-------
- drivers/staging/fsl_ppfe/pfe_sysfs.c | 2 +-
- 3 files changed, 11 insertions(+), 11 deletions(-)
-
---- a/drivers/staging/fsl_ppfe/pfe_cdev.c
-+++ b/drivers/staging/fsl_ppfe/pfe_cdev.c
-@@ -34,7 +34,7 @@ static ssize_t pfe_cdev_read(struct file
- {
- int ret = 0;
-
-- pr_info("PFE CDEV attempt copying (%lu) size of user.\n",
-+ pr_info("PFE CDEV attempt copying (%zu) size of user.\n",
- sizeof(link_states));
-
- pr_debug("Dump link_state on screen before copy_to_user\n");
-@@ -47,14 +47,14 @@ static ssize_t pfe_cdev_read(struct file
- /* Copy to user the value in buffer sized len */
- ret = copy_to_user(buf, &link_states, sizeof(link_states));
- if (ret != 0) {
-- pr_err("Failed to send (%d)bytes of (%lu) requested.\n",
-+ pr_err("Failed to send (%d)bytes of (%zu) requested.\n",
- ret, len);
- return -EFAULT;
- }
-
- /* offset set back to 0 as there is contextual reading offset */
- *off = 0;
-- pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states));
-+ pr_debug("Read of (%zu) bytes performed.\n", sizeof(link_states));
-
- return sizeof(link_states);
- }
---- a/drivers/staging/fsl_ppfe/pfe_hif.c
-+++ b/drivers/staging/fsl_ppfe/pfe_hif.c
-@@ -115,11 +115,11 @@ static void send_dummy_pkt_to_hif(void)
- 0x33221100, 0xa8c05544, 0x00000301, 0x00000000,
- 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f };
-
-- ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
-+ ddr_ptr = (void *)((uintptr_t)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
- if (!ddr_ptr)
- return;
-
-- lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
-+ lmem_ptr = (void *)((uintptr_t)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
- if (!lmem_ptr)
- return;
-
-@@ -186,16 +186,16 @@ static void pfe_hif_free_descr(struct pf
- void pfe_hif_desc_dump(struct pfe_hif *hif)
- {
- struct hif_desc *desc;
-- unsigned long desc_p;
-+ u64 desc_p;
- int ii = 0;
-
- pr_info("%s\n", __func__);
-
- desc = hif->rx_base;
-- desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
-+ desc_p = ((void *)desc - hif->descr_baseaddr_v +
- hif->descr_baseaddr_p);
-
-- pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p);
-+ pr_info("HIF Rx desc base %p physical %llx\n", desc, desc_p);
- 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
- }
-
- desc = hif->tx_base;
-- desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
-+ desc_p = ((void *)desc - hif->descr_baseaddr_v +
- hif->descr_baseaddr_p);
-
-- pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p);
-+ pr_info("HIF Tx desc base %p physical %llx\n", desc, desc_p);
- for (ii = 0; ii < hif->tx_ring_size; ii++) {
- pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n",
- readl(&desc->status), readl(&desc->ctrl),
---- a/drivers/staging/fsl_ppfe/pfe_sysfs.c
-+++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c
-@@ -535,7 +535,7 @@ static ssize_t pfe_show_tmu3_queues(stru
- static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr,
- const char *buf, size_t count)
- {
-- util_do_clear = kstrtoul(buf, NULL, 0);
-+ util_do_clear = kstrtoul(buf, 0, 0);
- return count;
- }
-
--- /dev/null
+From 1dc3a2e216d99adc2df022ab37eab32f61d80e0e Mon Sep 17 00:00:00 2001
+Date: Mon, 8 May 2023 19:26:48 +0200
+Subject: [PATCH] layerscape: 6.1: fix compilation warning for fsl ppfe driver
+
+Rework some desc dump and dummy pkt function to fix compilation warning.
+Fix compilation warning:
+drivers/staging/fsl_ppfe/pfe_hif.c: In function 'send_dummy_pkt_to_hif':
+drivers/staging/fsl_ppfe/pfe_hif.c:118:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
+ 118 | ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
+ | ^
+drivers/staging/fsl_ppfe/pfe_hif.c:122:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
+ 122 | lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
+ | ^
+drivers/staging/fsl_ppfe/pfe_hif.c: In function 'pfe_hif_desc_dump':
+drivers/staging/fsl_ppfe/pfe_hif.c:195:24: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
+ 195 | desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
+ | ^
+drivers/staging/fsl_ppfe/pfe_hif.c:195:36: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
+ 195 | desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
+ | ^
+drivers/staging/fsl_ppfe/pfe_hif.c:207:19: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
+ 207 | desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
+ | ^
+drivers/staging/fsl_ppfe/pfe_hif.c:207:31: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
+ 207 | desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
+ | ^
+cc1: all warnings being treated as errors
+
+In file included from ./include/linux/kernel.h:19,
+ from ./include/linux/list.h:9,
+ from ./include/linux/wait.h:7,
+ from ./include/linux/eventfd.h:13,
+ from drivers/staging/fsl_ppfe/pfe_cdev.c:11:
+drivers/staging/fsl_ppfe/pfe_cdev.c: In function 'pfe_cdev_read':
+./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Werror=format=]
+ 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
+ | ^~~~~~
+./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
+ 422 | _p_func(_fmt, ##__VA_ARGS__); \
+ | ^~~~
+./include/linux/printk.h:132:17: note: in expansion of macro 'printk'
+ 132 | printk(fmt, ##__VA_ARGS__); \
+ | ^~~~~~
+./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk'
+ 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+ | ^~~~~~~~~
+./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH'
+ 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
+ | ^~~~~~~~
+./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG'
+ 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+ | ^~~~~~~~~~
+drivers/staging/fsl_ppfe/pfe_cdev.c:42:17: note: in expansion of macro 'pr_debug'
+ 42 | pr_debug("%u %lu", link_states[ret].phy_id,
+ | ^~~~~~~~
+./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Werror=format=]
+ 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
+ | ^~~~~~
+./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
+ 422 | _p_func(_fmt, ##__VA_ARGS__); \
+ | ^~~~
+./include/linux/printk.h:493:9: note: in expansion of macro 'printk'
+ 493 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+ | ^~~~~~
+./include/linux/kern_levels.h:11:25: note: in expansion of macro 'KERN_SOH'
+ 11 | #define KERN_ERR KERN_SOH "3" /* error conditions */
+ | ^~~~~~~~
+./include/linux/printk.h:493:16: note: in expansion of macro 'KERN_ERR'
+ 493 | printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
+ | ^~~~~~~~
+drivers/staging/fsl_ppfe/pfe_cdev.c:50:17: note: in expansion of macro 'pr_err'
+ 50 | pr_err("Failed to send (%d)bytes of (%lu) requested.\n",
+ | ^~~~~~
+./include/linux/kern_levels.h:5:25: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'unsigned int' [-Werror=format=]
+ 5 | #define KERN_SOH "\001" /* ASCII Start Of Header */
+ | ^~~~~~
+./include/linux/printk.h:422:25: note: in definition of macro 'printk_index_wrap'
+ 422 | _p_func(_fmt, ##__VA_ARGS__); \
+ | ^~~~
+./include/linux/printk.h:132:17: note: in expansion of macro 'printk'
+ 132 | printk(fmt, ##__VA_ARGS__); \
+ | ^~~~~~
+./include/linux/printk.h:580:9: note: in expansion of macro 'no_printk'
+ 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+ | ^~~~~~~~~
+./include/linux/kern_levels.h:15:25: note: in expansion of macro 'KERN_SOH'
+ 15 | #define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
+ | ^~~~~~~~
+./include/linux/printk.h:580:19: note: in expansion of macro 'KERN_DEBUG'
+ 580 | no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+ | ^~~~~~~~~~
+drivers/staging/fsl_ppfe/pfe_cdev.c:57:9: note: in expansion of macro 'pr_debug'
+ 57 | pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states));
+ | ^~~~~~~~
+cc1: all warnings being treated as errors
+
+In file included from ./include/uapi/linux/posix_types.h:5,
+ from ./include/uapi/linux/types.h:14,
+ from ./include/linux/types.h:6,
+ from ./include/linux/list.h:5,
+ from ./include/linux/module.h:12,
+ from drivers/staging/fsl_ppfe/pfe_sysfs.c:7:
+drivers/staging/fsl_ppfe/pfe_sysfs.c: In function 'pfe_set_util':
+./include/linux/stddef.h:8:14: error: passing argument 2 of 'kstrtoul' makes integer from pointer without a cast [-Werror=int-conversion]
+ 8 | #define NULL ((void *)0)
+ | ^~~~~~~~~~~
+ | |
+ | void *
+drivers/staging/fsl_ppfe/pfe_sysfs.c:538:39: note: in expansion of macro 'NULL'
+ 538 | util_do_clear = kstrtoul(buf, NULL, 0);
+ | ^~~~
+In file included from ./include/linux/kernel.h:13,
+ from ./include/linux/list.h:9:
+./include/linux/kstrtox.h:30:69: note: expected 'unsigned int' but argument is of type 'void *'
+ 30 | static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
+ | ~~~~~~~~~~~~~^~~~
+cc1: all warnings being treated as errors
+
+With UTIL compiled on, fix compilation warning:
+drivers/staging/fsl_ppfe/pfe_hal.c: In function 'pe_load_ddr_section':
+drivers/staging/fsl_ppfe/pfe_hal.c:617:19: error: 'else' without a previous 'if'
+ 617 | } else {
+ | ^~~~
+drivers/staging/fsl_ppfe/pfe_hal.c:622:17: error: break statement not within loop or switch
+ 622 | break;
+ | ^~~~~
+drivers/staging/fsl_ppfe/pfe_hal.c:624:9: error: case label not within a switch statement
+ 624 | case SHT_NOBITS:
+ | ^~~~
+drivers/staging/fsl_ppfe/pfe_hal.c:627:17: error: break statement not within loop or switch
+ 627 | break;
+ | ^~~~~
+drivers/staging/fsl_ppfe/pfe_hal.c:629:9: error: 'default' label not within a switch statement
+ 629 | default:
+ | ^~~~~~~
+drivers/staging/fsl_ppfe/pfe_hal.c: At top level:
+drivers/staging/fsl_ppfe/pfe_hal.c:635:9: error: expected identifier or '(' before 'return'
+ 635 | return 0;
+ | ^~~~~~
+drivers/staging/fsl_ppfe/pfe_hal.c:636:1: error: expected identifier or '(' before '}' token
+ 636 | }
+
+---
+ drivers/staging/fsl_ppfe/pfe_cdev.c | 6 +++---
+ drivers/staging/fsl_ppfe/pfe_hif.c | 14 +++++++-------
+ drivers/staging/fsl_ppfe/pfe_sysfs.c | 2 +-
+ 3 files changed, 11 insertions(+), 11 deletions(-)
+
+--- a/drivers/staging/fsl_ppfe/pfe_cdev.c
++++ b/drivers/staging/fsl_ppfe/pfe_cdev.c
+@@ -34,7 +34,7 @@ static ssize_t pfe_cdev_read(struct file
+ {
+ int ret = 0;
+
+- pr_info("PFE CDEV attempt copying (%lu) size of user.\n",
++ pr_info("PFE CDEV attempt copying (%zu) size of user.\n",
+ sizeof(link_states));
+
+ pr_debug("Dump link_state on screen before copy_to_user\n");
+@@ -47,14 +47,14 @@ static ssize_t pfe_cdev_read(struct file
+ /* Copy to user the value in buffer sized len */
+ ret = copy_to_user(buf, &link_states, sizeof(link_states));
+ if (ret != 0) {
+- pr_err("Failed to send (%d)bytes of (%lu) requested.\n",
++ pr_err("Failed to send (%d)bytes of (%zu) requested.\n",
+ ret, len);
+ return -EFAULT;
+ }
+
+ /* offset set back to 0 as there is contextual reading offset */
+ *off = 0;
+- pr_debug("Read of (%lu) bytes performed.\n", sizeof(link_states));
++ pr_debug("Read of (%zu) bytes performed.\n", sizeof(link_states));
+
+ return sizeof(link_states);
+ }
+--- a/drivers/staging/fsl_ppfe/pfe_hif.c
++++ b/drivers/staging/fsl_ppfe/pfe_hif.c
+@@ -115,11 +115,11 @@ static void send_dummy_pkt_to_hif(void)
+ 0x33221100, 0xa8c05544, 0x00000301, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f };
+
+- ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
++ ddr_ptr = (void *)((uintptr_t)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL));
+ if (!ddr_ptr)
+ return;
+
+- lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
++ lmem_ptr = (void *)((uintptr_t)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL));
+ if (!lmem_ptr)
+ return;
+
+@@ -186,16 +186,16 @@ static void pfe_hif_free_descr(struct pf
+ static void __maybe_unused pfe_hif_desc_dump(struct pfe_hif *hif)
+ {
+ struct hif_desc *desc;
+- unsigned long desc_p;
++ u64 desc_p;
+ int ii = 0;
+
+ pr_info("%s\n", __func__);
+
+ desc = hif->rx_base;
+- desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v +
++ desc_p = ((void *)desc - hif->descr_baseaddr_v +
+ hif->descr_baseaddr_p);
+
+- pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p);
++ pr_info("HIF Rx desc base %p physical %llx\n", desc, desc_p);
+ 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 @@ static void __maybe_unused pfe_hif_desc_
+ }
+
+ desc = hif->tx_base;
+- desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v +
++ desc_p = ((void *)desc - hif->descr_baseaddr_v +
+ hif->descr_baseaddr_p);
+
+- pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p);
++ pr_info("HIF Tx desc base %p physical %llx\n", desc, desc_p);
+ for (ii = 0; ii < hif->tx_ring_size; ii++) {
+ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n",
+ readl(&desc->status), readl(&desc->ctrl),
+--- a/drivers/staging/fsl_ppfe/pfe_sysfs.c
++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c
+@@ -535,7 +535,7 @@ static ssize_t pfe_show_tmu3_queues(stru
+ static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+- util_do_clear = kstrtoul(buf, NULL, 0);
++ util_do_clear = kstrtoul(buf, 0, 0);
+ return count;
+ }
+