layerscape: kernel: 6.12: refresh patches
authorPawel Dembicki <[email protected]>
Sun, 8 Jun 2025 10:52:10 +0000 (12:52 +0200)
committerHauke Mehrtens <[email protected]>
Sun, 17 Aug 2025 17:00:58 +0000 (19:00 +0200)
Patches 400,701,702 were taken from 6.12 nxp tree.

Signed-off-by: Pawel Dembicki <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19152
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/layerscape/patches-6.12/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch
target/linux/layerscape/patches-6.12/701-staging-add-fsl_ppfe-driver.patch
target/linux/layerscape/patches-6.12/702-phy-Add-2.5G-SGMII-interface-mode.patch
target/linux/layerscape/patches-6.12/703-layerscape-6.1-fix-compilation-warning-for-fsl-ppfe-.patch [deleted file]
target/linux/layerscape/patches-6.12/703-layerscape-6.12-fix-compilation-warning-for-fsl-ppfe-.patch [new file with mode: 0644]

index 008a146cc97e8ba64a7b8969ed251f912891e5ed..71dc41569aac649bd8f119b102e5314bfdadc63c 100644 (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 <[email protected]>
-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 <[email protected]>
 
 --- 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",
index 964b452f7d69d20820269850797dad5f17f8299f..04efc152702217724b1bdd6b277fd99d80ab4d53 100644 (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 <[email protected]>
 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 <[email protected]>
+Signed-off-by: Dong Aisheng <[email protected]>
+
+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 <[email protected]>
+Signed-off-by: Dong Aisheng <[email protected]>
+
+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 <[email protected]>
+Signed-off-by: Dong Aisheng <[email protected]>
+
+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 <[email protected]>
+Signed-off-by: Dong Aisheng <[email protected]>
+
+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 <[email protected]>
+
+drivers: make all local platform_driver::remove() return void
+
+0edb555a65d1 ("platform: Make platform_driver::remove() return void")
+
 Signed-off-by: Dong Aisheng <[email protected]>
 ---
  .../devicetree/bindings/net/fsl_ppfe/pfe.txt  |  199 ++
@@ -642,13 +696,13 @@ Signed-off-by: Dong Aisheng <[email protected]>
  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 <[email protected]>
 +};
 --- 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 <[email protected]>
  L:    [email protected]
 --- 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 <[email protected]>
  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 <[email protected]>
 +# 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 <[email protected]>
 +               */
 +              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 <[email protected]>
 +/* 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 <[email protected]>
 +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 <[email protected]>
 +/*
 + *  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 <[email protected]>
 +      }
 +}
 +
-+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 <[email protected]>
 +
 +/* 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 <[email protected]>
 + * @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 <[email protected]>
 +      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 <[email protected]>
 + * 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 <[email protected]>
 +/* 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 <[email protected]>
 +/* 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 <[email protected]>
 +                        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 <[email protected]>
 +#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 <[email protected]>
 +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 <[email protected]>
 +
 +#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 <[email protected]>
 +
 +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,
index b4e527214e85d9a8e968192212307d6d6b3224d1..92e71276bf84a8bda4146adc5bc7d7981dcb3743 100644 (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 <[email protected]>
 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 <[email protected]>
 ---
- 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 <[email protected]>
        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 <[email protected]>
  
 --- 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:
diff --git a/target/linux/layerscape/patches-6.12/703-layerscape-6.1-fix-compilation-warning-for-fsl-ppfe-.patch b/target/linux/layerscape/patches-6.12/703-layerscape-6.1-fix-compilation-warning-for-fsl-ppfe-.patch
deleted file mode 100644 (file)
index d49488a..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-From 1dc3a2e216d99adc2df022ab37eab32f61d80e0e Mon Sep 17 00:00:00 2001
-From: Christian Marangi <[email protected]>
-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 | }
-
-Signed-off-by: Christian Marangi <[email protected]>
-Signed-off-by: Pawel Dembicki <[email protected]>
----
- 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;
- }
diff --git a/target/linux/layerscape/patches-6.12/703-layerscape-6.12-fix-compilation-warning-for-fsl-ppfe-.patch b/target/linux/layerscape/patches-6.12/703-layerscape-6.12-fix-compilation-warning-for-fsl-ppfe-.patch
new file mode 100644 (file)
index 0000000..2d724bb
--- /dev/null
@@ -0,0 +1,239 @@
+From 1dc3a2e216d99adc2df022ab37eab32f61d80e0e Mon Sep 17 00:00:00 2001
+From: Christian Marangi <[email protected]>
+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 | }
+
+Signed-off-by: Christian Marangi <[email protected]>
+Signed-off-by: Pawel Dembicki <[email protected]>
+---
+ 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;
+ }