layerscape: update kernel patches
authorYangbo Lu <yangbo.lu@nxp.com>
Mon, 16 Oct 2017 10:48:11 +0000 (18:48 +0800)
committerJohn Crispin <john@phrozen.org>
Fri, 10 Nov 2017 22:00:49 +0000 (23:00 +0100)
Updated kernel patches to align layerscape kernel
with latest LSDK linux (LSDK-17.09-update-103017-V4.9 tag).

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
13 files changed:
target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch
target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch
target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch
target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch
target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch
target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch
target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch
target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch [new file with mode: 0644]
target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch
target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch
target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch
target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch
target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch

index 939880f..4b4fd73 100644 (file)
@@ -1,4 +1,4 @@
-From 11edf9c88acea13d1a02901289060263b4027a77 Mon Sep 17 00:00:00 2001
+From 7992b4384d94c5e1bad998ca3a9a5781caac8e62 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 09:52:26 +0800
 Subject: [PATCH] config: support layerscape
@@ -30,11 +30,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  drivers/soc/fsl/layerscape/Kconfig      |  10 +++
  drivers/soc/fsl/layerscape/Makefile     |   1 +
  drivers/soc/fsl/rcpm.c                  | 154 ++++++++++++++++++++++++++++++++
- drivers/staging/Kconfig                 |   +
- drivers/staging/Makefile                |   2 +
+ drivers/staging/Kconfig                 |   6 ++
+ drivers/staging/Makefile                |   3 +
  drivers/staging/fsl-dpaa2/Kconfig       |  41 +++++++++
  drivers/staging/fsl-dpaa2/Makefile      |   9 ++
- 18 files changed, 309 insertions(+), 4 deletions(-)
+ 18 files changed, 312 insertions(+), 4 deletions(-)
  create mode 100644 drivers/soc/fsl/Kconfig
  create mode 100644 drivers/soc/fsl/Kconfig.arm
  create mode 100644 drivers/soc/fsl/layerscape/Kconfig
@@ -43,6 +43,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  create mode 100644 drivers/staging/fsl-dpaa2/Kconfig
  create mode 100644 drivers/staging/fsl-dpaa2/Makefile
 
+diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
+index e1c0e2e0..4211a7fd 100644
 --- a/drivers/base/Kconfig
 +++ b/drivers/base/Kconfig
 @@ -237,6 +237,7 @@ config GENERIC_CPU_AUTOPROBE
@@ -53,9 +55,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  source "drivers/base/regmap/Kconfig"
  
+diff --git a/drivers/crypto/Makefile b/drivers/crypto/Makefile
+index ad7250fa..6d788fd7 100644
 --- a/drivers/crypto/Makefile
 +++ b/drivers/crypto/Makefile
-@@ -3,7 +3,7 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += at
+@@ -3,7 +3,7 @@ obj-$(CONFIG_CRYPTO_DEV_ATMEL_SHA) += atmel-sha.o
  obj-$(CONFIG_CRYPTO_DEV_ATMEL_TDES) += atmel-tdes.o
  obj-$(CONFIG_CRYPTO_DEV_BFIN_CRC) += bfin_crc.o
  obj-$(CONFIG_CRYPTO_DEV_CCP) += ccp/
@@ -64,6 +68,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
  obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
  obj-$(CONFIG_CRYPTO_DEV_IMGTEC_HASH) += img-hash.o
+diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
+index d1ca45fb..74a2864e 100644
 --- a/drivers/net/ethernet/freescale/Kconfig
 +++ b/drivers/net/ethernet/freescale/Kconfig
 @@ -5,7 +5,7 @@
@@ -82,6 +88,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +source "drivers/net/ethernet/freescale/sdk_fman/Kconfig"
 +source "drivers/net/ethernet/freescale/sdk_dpaa/Kconfig"
  endif # NET_VENDOR_FREESCALE
+diff --git a/drivers/net/ethernet/freescale/Makefile b/drivers/net/ethernet/freescale/Makefile
+index cbe21dc7..a5d4405f 100644
 --- a/drivers/net/ethernet/freescale/Makefile
 +++ b/drivers/net/ethernet/freescale/Makefile
 @@ -21,4 +21,6 @@ gianfar_driver-objs := gianfar.o \
@@ -91,6 +99,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-$(if $(CONFIG_FSL_SDK_FMAN),y) += sdk_fman/
 +obj-$(if $(CONFIG_FSL_SDK_DPAA_ETH),y) += sdk_dpaa/
  obj-$(CONFIG_FSL_FMAN) += fman/
+diff --git a/drivers/ptp/Kconfig b/drivers/ptp/Kconfig
+index ee3de342..4c45beda 100644
 --- a/drivers/ptp/Kconfig
 +++ b/drivers/ptp/Kconfig
 @@ -39,6 +39,35 @@ config PTP_1588_CLOCK_GIANFAR
@@ -129,6 +139,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  config PTP_1588_CLOCK_IXP46X
        tristate "Intel IXP46x as PTP clock"
        depends on IXP4XX_ETH
+diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
+index 0723c97e..df610dcd 100644
 --- a/drivers/rtc/Kconfig
 +++ b/drivers/rtc/Kconfig
 @@ -414,6 +414,14 @@ config RTC_DRV_PCF85063
@@ -146,9 +158,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  config RTC_DRV_PCF8563
        tristate "Philips PCF8563/Epson RTC8564"
        help
+diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
+index 1ac694a3..7675b8a7 100644
 --- a/drivers/rtc/Makefile
 +++ b/drivers/rtc/Makefile
-@@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_PCF2127)      += rtc-pcf
+@@ -111,6 +111,7 @@ obj-$(CONFIG_RTC_DRV_PCF2127)      += rtc-pcf2127.o
  obj-$(CONFIG_RTC_DRV_PCF50633)        += rtc-pcf50633.o
  obj-$(CONFIG_RTC_DRV_PCF85063)        += rtc-pcf85063.o
  obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o
@@ -156,6 +170,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  obj-$(CONFIG_RTC_DRV_PCF8563) += rtc-pcf8563.o
  obj-$(CONFIG_RTC_DRV_PCF8583) += rtc-pcf8583.o
  obj-$(CONFIG_RTC_DRV_PIC32)   += rtc-pic32.o
+diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig
+index e6e90e80..f31bceb6 100644
 --- a/drivers/soc/Kconfig
 +++ b/drivers/soc/Kconfig
 @@ -1,8 +1,7 @@
@@ -168,6 +184,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  source "drivers/soc/mediatek/Kconfig"
  source "drivers/soc/qcom/Kconfig"
  source "drivers/soc/rockchip/Kconfig"
+diff --git a/drivers/soc/fsl/Kconfig b/drivers/soc/fsl/Kconfig
+new file mode 100644
+index 00000000..d4cd25f1
 --- /dev/null
 +++ b/drivers/soc/fsl/Kconfig
 @@ -0,0 +1,22 @@
@@ -193,6 +212,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +if ARM || ARM64
 +source "drivers/soc/fsl/Kconfig.arm"
 +endif
+diff --git a/drivers/soc/fsl/Kconfig.arm b/drivers/soc/fsl/Kconfig.arm
+new file mode 100644
+index 00000000..106c9b98
 --- /dev/null
 +++ b/drivers/soc/fsl/Kconfig.arm
 @@ -0,0 +1,16 @@
@@ -212,6 +234,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +if LS_SOC_DRIVERS
 +      source "drivers/soc/fsl/layerscape/Kconfig"
 +endif
+diff --git a/drivers/soc/fsl/Makefile b/drivers/soc/fsl/Makefile
+index 75e1f533..b8708569 100644
 --- a/drivers/soc/fsl/Makefile
 +++ b/drivers/soc/fsl/Makefile
 @@ -5,3 +5,7 @@
@@ -222,6 +246,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-$(CONFIG_FSL_LS2_CONSOLE)         += ls2-console/
 +obj-$(CONFIG_SUSPEND)                 += rcpm.o
 +obj-$(CONFIG_LS_SOC_DRIVERS)          += layerscape/
+diff --git a/drivers/soc/fsl/layerscape/Kconfig b/drivers/soc/fsl/layerscape/Kconfig
+new file mode 100644
+index 00000000..e1373aa1
 --- /dev/null
 +++ b/drivers/soc/fsl/layerscape/Kconfig
 @@ -0,0 +1,10 @@
@@ -235,10 +262,16 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      Say y here to enable FTM alarm support.  The FTM alarm provides
 +      alarm functions for wakeup system from deep sleep.  There is only
 +      one FTM can be used in ALARM(FTM 0).
+diff --git a/drivers/soc/fsl/layerscape/Makefile b/drivers/soc/fsl/layerscape/Makefile
+new file mode 100644
+index 00000000..6299aa1d
 --- /dev/null
 +++ b/drivers/soc/fsl/layerscape/Makefile
 @@ -0,0 +1 @@
 +obj-$(CONFIG_FTM_ALARM) += ftm_alarm.o
+diff --git a/drivers/soc/fsl/rcpm.c b/drivers/soc/fsl/rcpm.c
+new file mode 100644
+index 00000000..a6a31c87
 --- /dev/null
 +++ b/drivers/soc/fsl/rcpm.c
 @@ -0,0 +1,154 @@
@@ -396,6 +429,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +
 +subsys_initcall(layerscape_rcpm_init);
+diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
+index 58a7b350..6c69e3bd 100644
 --- a/drivers/staging/Kconfig
 +++ b/drivers/staging/Kconfig
 @@ -94,6 +94,8 @@ source "drivers/staging/fbtft/Kconfig"
@@ -407,16 +442,20 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  source "drivers/staging/wilc1000/Kconfig"
  
  source "drivers/staging/most/Kconfig"
-@@ -106,4 +108,6 @@ source "drivers/staging/greybus/Kconfig"
+@@ -106,4 +108,8 @@ source "drivers/staging/greybus/Kconfig"
  
  source "drivers/staging/vc04_services/Kconfig"
  
 +source "drivers/staging/fsl_qbman/Kconfig"
++
++source "drivers/staging/fsl_ppfe/Kconfig"
 +
  endif # STAGING
+diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
+index 2fa9745d..ee817a5e 100644
 --- a/drivers/staging/Makefile
 +++ b/drivers/staging/Makefile
-@@ -36,9 +36,11 @@ obj-$(CONFIG_UNISYSSPAR)    += unisys/
+@@ -36,9 +36,12 @@ obj-$(CONFIG_UNISYSSPAR)    += unisys/
  obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/
  obj-$(CONFIG_FB_TFT)          += fbtft/
  obj-$(CONFIG_FSL_MC_BUS)      += fsl-mc/
@@ -428,6 +467,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  obj-$(CONFIG_GREYBUS)         += greybus/
  obj-$(CONFIG_BCM2708_VCHIQ)   += vc04_services/
 +obj-$(CONFIG_FSL_SDK_DPA)     += fsl_qbman/
++obj-$(CONFIG_FSL_PPFE)                += fsl_ppfe/
+diff --git a/drivers/staging/fsl-dpaa2/Kconfig b/drivers/staging/fsl-dpaa2/Kconfig
+new file mode 100644
+index 00000000..8042d9cc
 --- /dev/null
 +++ b/drivers/staging/fsl-dpaa2/Kconfig
 @@ -0,0 +1,41 @@
@@ -472,6 +515,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +source "drivers/staging/fsl-dpaa2/mac/Kconfig"
 +source "drivers/staging/fsl-dpaa2/evb/Kconfig"
 +source "drivers/staging/fsl-dpaa2/ethsw/Kconfig"
+diff --git a/drivers/staging/fsl-dpaa2/Makefile b/drivers/staging/fsl-dpaa2/Makefile
+new file mode 100644
+index 00000000..cbaa8c20
 --- /dev/null
 +++ b/drivers/staging/fsl-dpaa2/Makefile
 @@ -0,0 +1,9 @@
@@ -484,3 +530,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-$(CONFIG_FSL_DPAA2_EVB)   += evb/
 +obj-$(CONFIG_FSL_DPAA2_ETHSW) += ethsw/
 +obj-$(CONFIG_PTP_1588_CLOCK_DPAA2) += rtc/
+-- 
+2.14.1
+
index 3a2e9c6..1eca91a 100644 (file)
@@ -1,4 +1,4 @@
-From 7edaf7ed8fbd5fb50950a4fc8067a9c14557d010 Mon Sep 17 00:00:00 2001
+From 739029f49bd9181b821298f9d27b29ce2d292967 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 10:03:52 +0800
 Subject: [PATCH] arch: support layerscape
@@ -34,9 +34,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  arch/arm64/include/asm/pgtable-prot.h |  1 +
  arch/arm64/include/asm/pgtable.h      |  5 +++
  arch/arm64/kernel/pci.c               | 62 +++++++++++++++++++++++++++++++++++
- arch/arm64/mm/dma-mapping.c           |  6 ++++
- 15 files changed, 197 insertions(+), 3 deletions(-)
+ arch/arm64/mm/dma-mapping.c           | 23 ++++++++++---
+ 15 files changed, 209 insertions(+), 8 deletions(-)
 
+diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
+index b1ce037e..1445b0ca 100644
 --- a/arch/arm/include/asm/delay.h
 +++ b/arch/arm/include/asm/delay.h
 @@ -57,6 +57,22 @@ extern void __bad_udelay(void);
@@ -62,9 +64,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /* Loop-based definitions for assembly code. */
  extern void __loop_delay(unsigned long loops);
  extern void __loop_udelay(unsigned long usecs);
+diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
+index 021692c6..172a4f2e 100644
 --- a/arch/arm/include/asm/io.h
 +++ b/arch/arm/include/asm/io.h
-@@ -129,6 +129,7 @@ static inline u32 __raw_readl(const vola
+@@ -129,6 +129,7 @@ static inline u32 __raw_readl(const volatile void __iomem *addr)
  #define MT_DEVICE_NONSHARED   1
  #define MT_DEVICE_CACHED      2
  #define MT_DEVICE_WC          3
@@ -72,7 +76,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /*
   * types 4 onwards can be found in asm/mach/map.h and are undefined
   * for ioremap
-@@ -220,6 +221,34 @@ extern int pci_ioremap_io(unsigned int o
+@@ -220,6 +221,34 @@ extern int pci_ioremap_io(unsigned int offset, phys_addr_t phys_addr);
  #endif
  #endif
  
@@ -107,7 +111,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /*
   *  IO port access primitives
   *  -------------------------
-@@ -408,6 +437,8 @@ void __iomem *ioremap_wc(resource_size_t
+@@ -408,6 +437,8 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size);
  #define ioremap_wc ioremap_wc
  #define ioremap_wt ioremap_wc
  
@@ -116,6 +120,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  void iounmap(volatile void __iomem *iomem_cookie);
  #define iounmap iounmap
  
+diff --git a/arch/arm/include/asm/mach/map.h b/arch/arm/include/asm/mach/map.h
+index 9b7c328f..27f3df7d 100644
 --- a/arch/arm/include/asm/mach/map.h
 +++ b/arch/arm/include/asm/mach/map.h
 @@ -21,9 +21,9 @@ struct map_desc {
@@ -130,6 +136,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        MT_CACHECLEAN,
        MT_MINICLEAN,
        MT_LOW_VECTORS,
+diff --git a/arch/arm/include/asm/pgtable.h b/arch/arm/include/asm/pgtable.h
+index a8d656d9..4ab57b37 100644
 --- a/arch/arm/include/asm/pgtable.h
 +++ b/arch/arm/include/asm/pgtable.h
 @@ -118,6 +118,13 @@ extern pgprot_t           pgprot_s2_device;
@@ -146,6 +154,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  #define pgprot_writecombine(prot) \
        __pgprot_modify(prot, L_PTE_MT_MASK, L_PTE_MT_BUFFERABLE)
  
+diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
+index 2f0e0773..d2f4869a 100644
 --- a/arch/arm/kernel/bios32.c
 +++ b/arch/arm/kernel/bios32.c
 @@ -11,6 +11,8 @@
@@ -157,10 +167,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  #include <asm/mach-types.h>
  #include <asm/mach/map.h>
-@@ -64,6 +66,47 @@ void pcibios_report_status(u_int status_
+@@ -63,6 +65,47 @@ void pcibios_report_status(u_int status_mask, int warn)
+               pcibios_bus_report_status(bus, status_mask, warn);
  }
  
- /*
++/*
 + * Check device tree if the service interrupts are there
 + */
 +int pcibios_check_service_irqs(struct pci_dev *dev, int *irqs, int mask)
@@ -201,13 +212,14 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return count;
 +}
 +
-+/*
+ /*
   * We don't use this to fix the device, but initialisation of it.
   * It's not the correct use for this, but it works.
-  * Note that the arbiter/ISA bridge appears to be buggy, specifically in
+diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
+index ab771000..9b5f4465 100644
 --- a/arch/arm/mm/dma-mapping.c
 +++ b/arch/arm/mm/dma-mapping.c
-@@ -2392,6 +2392,7 @@ void arch_setup_dma_ops(struct device *d
+@@ -2392,6 +2392,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
  
        set_dma_ops(dev, dma_ops);
  }
@@ -215,9 +227,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  void arch_teardown_dma_ops(struct device *dev)
  {
+diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
+index ff0eed23..2f2f4269 100644
 --- a/arch/arm/mm/ioremap.c
 +++ b/arch/arm/mm/ioremap.c
-@@ -398,6 +398,13 @@ void __iomem *ioremap_wc(resource_size_t
+@@ -398,6 +398,13 @@ void __iomem *ioremap_wc(resource_size_t res_cookie, size_t size)
  }
  EXPORT_SYMBOL(ioremap_wc);
  
@@ -231,9 +245,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /*
   * Remap an arbitrary physical address space into the kernel virtual
   * address space as memory. Needed when the kernel wants to execute
+diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
+index f7c74135..4a2fb704 100644
 --- a/arch/arm/mm/mmu.c
 +++ b/arch/arm/mm/mmu.c
-@@ -313,6 +313,13 @@ static struct mem_type mem_types[] __ro_
+@@ -313,6 +313,13 @@ static struct mem_type mem_types[] __ro_after_init = {
                .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
                .domain    = DOMAIN_KERNEL,
        },
@@ -247,7 +263,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        [MT_ROM] = {
                .prot_sect = PMD_TYPE_SECT,
                .domain    = DOMAIN_KERNEL,
-@@ -644,6 +651,7 @@ static void __init build_mem_type_table(
+@@ -644,6 +651,7 @@ static void __init build_mem_type_table(void)
        }
        kern_pgprot |= PTE_EXT_AF;
        vecs_pgprot |= PTE_EXT_AF;
@@ -255,7 +271,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /*
         * Set PXN for user mappings
-@@ -672,6 +680,7 @@ static void __init build_mem_type_table(
+@@ -672,6 +680,7 @@ static void __init build_mem_type_table(void)
        mem_types[MT_MEMORY_RWX].prot_pte |= kern_pgprot;
        mem_types[MT_MEMORY_RW].prot_sect |= ecc_mask | cp->pmd;
        mem_types[MT_MEMORY_RW].prot_pte |= kern_pgprot;
@@ -263,6 +279,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        mem_types[MT_MEMORY_DMA_READY].prot_pte |= kern_pgprot;
        mem_types[MT_MEMORY_RWX_NONCACHED].prot_sect |= ecc_mask;
        mem_types[MT_ROM].prot_sect |= cp->pmd;
+diff --git a/arch/arm64/include/asm/cache.h b/arch/arm64/include/asm/cache.h
+index 5082b30b..bde44993 100644
 --- a/arch/arm64/include/asm/cache.h
 +++ b/arch/arm64/include/asm/cache.h
 @@ -18,7 +18,7 @@
@@ -274,9 +292,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  #define L1_CACHE_BYTES                (1 << L1_CACHE_SHIFT)
  
  /*
+diff --git a/arch/arm64/include/asm/io.h b/arch/arm64/include/asm/io.h
+index 0bba427b..36c1fbf3 100644
 --- a/arch/arm64/include/asm/io.h
 +++ b/arch/arm64/include/asm/io.h
-@@ -171,6 +171,8 @@ extern void __iomem *ioremap_cache(phys_
+@@ -171,6 +171,8 @@ extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size);
  #define ioremap_nocache(addr, size)   __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
  #define ioremap_wc(addr, size)                __ioremap((addr), (size), __pgprot(PROT_NORMAL_NC))
  #define ioremap_wt(addr, size)                __ioremap((addr), (size), __pgprot(PROT_DEVICE_nGnRE))
@@ -285,9 +305,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  #define iounmap                               __iounmap
  
  /*
+diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
+index b9a7ba9c..8a189159 100644
 --- a/arch/arm64/include/asm/pci.h
 +++ b/arch/arm64/include/asm/pci.h
-@@ -31,6 +31,10 @@ static inline int pci_get_legacy_ide_irq
+@@ -31,6 +31,10 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
        return -ENODEV;
  }
  
@@ -298,6 +320,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  static inline int pci_proc_domain(struct pci_bus *bus)
  {
        return 1;
+diff --git a/arch/arm64/include/asm/pgtable-prot.h b/arch/arm64/include/asm/pgtable-prot.h
+index 2142c772..cdf8b25d 100644
 --- a/arch/arm64/include/asm/pgtable-prot.h
 +++ b/arch/arm64/include/asm/pgtable-prot.h
 @@ -42,6 +42,7 @@
@@ -308,9 +332,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  #define PROT_SECT_DEVICE_nGnRE        (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_DEVICE_nGnRE))
  #define PROT_SECT_NORMAL      (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL))
+diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h
+index 61e21401..b8c876fb 100644
 --- a/arch/arm64/include/asm/pgtable.h
 +++ b/arch/arm64/include/asm/pgtable.h
-@@ -356,6 +356,11 @@ static inline int pmd_protnone(pmd_t pmd
+@@ -356,6 +356,11 @@ static inline int pmd_protnone(pmd_t pmd)
        __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN)
  #define pgprot_writecombine(prot) \
        __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN)
@@ -322,6 +348,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  #define pgprot_device(prot) \
        __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN)
  #define __HAVE_PHYS_MEM_ACCESS_PROT
+diff --git a/arch/arm64/kernel/pci.c b/arch/arm64/kernel/pci.c
+index 409abc45..0568ec3a 100644
 --- a/arch/arm64/kernel/pci.c
 +++ b/arch/arm64/kernel/pci.c
 @@ -17,6 +17,8 @@
@@ -333,11 +361,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  #include <linux/pci.h>
  #include <linux/pci-acpi.h>
  #include <linux/pci-ecam.h>
-@@ -53,6 +55,66 @@ int pcibios_alloc_irq(struct pci_dev *de
+@@ -54,6 +56,66 @@ int pcibios_alloc_irq(struct pci_dev *dev)
        return 0;
  }
-+
 +/*
 + * Check device tree if the service interrupts are there
 + */
@@ -397,9 +424,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      return 0;
 +}
++
  /*
   * raw_pci_read/write - Platform-specific PCI config space access.
+  */
+diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
+index b5bf46ce..5a010bcc 100644
 --- a/arch/arm64/mm/dma-mapping.c
 +++ b/arch/arm64/mm/dma-mapping.c
 @@ -30,6 +30,7 @@
@@ -410,19 +440,49 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  static int swiotlb __ro_after_init;
  
-@@ -918,6 +919,10 @@ static int __init __iommu_dma_init(void)
+@@ -836,14 +837,21 @@ static bool do_iommu_attach(struct device *dev, const struct iommu_ops *ops,
+        * then the IOMMU core will have already configured a group for this
+        * device, and allocated the default domain for that group.
+        */
+-      if (!domain || iommu_dma_init_domain(domain, dma_base, size, dev)) {
+-              pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
+-                      dev_name(dev));
+-              return false;
++      if (!domain)
++              goto out_err;
++
++      if (domain->type == IOMMU_DOMAIN_DMA) {
++              if (iommu_dma_init_domain(domain, dma_base, size, dev))
++                      goto out_err;
++
++              dev->archdata.dma_ops = &iommu_dma_ops;
+       }
+-      dev->archdata.dma_ops = &iommu_dma_ops;
+       return true;
++out_err:
++      pr_warn("Failed to set up IOMMU for device %s; retaining platform DMA ops\n",
++               dev_name(dev));
++      return false;
+ }
+ static void queue_iommu_attach(struct device *dev, const struct iommu_ops *ops,
+@@ -917,6 +925,10 @@ static int __init __iommu_dma_init(void)
+ #ifdef CONFIG_PCI
        if (!ret)
                ret = register_iommu_dma_ops_notifier(&pci_bus_type);
- #endif
++#endif
 +#ifdef CONFIG_FSL_MC_BUS
 +      if (!ret)
 +              ret = register_iommu_dma_ops_notifier(&fsl_mc_bus_type);
-+#endif
+ #endif
        return ret;
  }
- arch_initcall(__iommu_dma_init);
-@@ -971,3 +976,4 @@ void arch_setup_dma_ops(struct device *d
+@@ -971,3 +983,4 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
        dev->archdata.dma_coherent = coherent;
        __iommu_setup_dma_ops(dev, dma_base, size, iommu);
  }
 +EXPORT_SYMBOL(arch_setup_dma_ops);
+-- 
+2.14.1
+
index a7a3a48..daca614 100644 (file)
@@ -1,4 +1,4 @@
-From 2b2e3b9a0d2abf276b40843f75d97b623e4ee109 Mon Sep 17 00:00:00 2001
+From bfa4a794f91162cfeccfa4d59121cde9a84e32a3 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 10:02:10 +0800
 Subject: [PATCH] dts: support layercape
@@ -45,10 +45,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  arch/arm/boot/dts/sun8i-a23-a33.dtsi               |   2 +-
  arch/arm/boot/dts/sun9i-a80.dtsi                   |   2 +-
  arch/arm64/boot/dts/freescale/Makefile             |  16 +
- arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 134 +++
- arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts  | 155 ++++
- arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts  |  91 +++
- arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi     | 517 ++++++++++++
+ arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 177 ++++
+ arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts  | 198 +++++
+ arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts  | 134 +++
+ arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi     | 594 ++++++++++++++
  arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi |  45 +
  .../boot/dts/freescale/fsl-ls1043a-qds-sdk.dts     |  69 ++
  arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts  | 171 +++-
@@ -65,7 +65,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi     | 793 ++++++++++++++++++
  arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts  | 173 ++++
  arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts  | 236 ++++++
- arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi     | 816 ++++++++++++++++++
+ arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi     | 818 ++++++++++++++++++
  arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts  | 191 ++---
  arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts  | 169 ++--
  arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts |   9 +-
@@ -76,7 +76,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi     | 195 +++++
  arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi | 198 +++++
  arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi | 161 ++++
- arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi     | 910 +++++++++++++++++++++
+ arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi     | 912 +++++++++++++++++++++
  .../boot/dts/freescale/qoriq-bman1-portals.dtsi    |  81 ++
  arch/arm64/boot/dts/freescale/qoriq-dpaa-eth.dtsi  |  66 ++
  .../boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi    |  43 +
@@ -93,7 +93,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi |  10 +
  arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi |   4 +-
  arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi |   4 +-
- 66 files changed, 7778 insertions(+), 1021 deletions(-)
+ 66 files changed, 7988 insertions(+), 1021 deletions(-)
  create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
  create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts
  create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
@@ -133,6 +133,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  create mode 100644 arch/arm64/boot/dts/freescale/qoriq-fman3-0.dtsi
  create mode 100644 arch/arm64/boot/dts/freescale/qoriq-qman1-portals.dtsi
 
+diff --git a/arch/arm/boot/dts/alpine.dtsi b/arch/arm/boot/dts/alpine.dtsi
+index db8752fc..d0eefc3b 100644
 --- a/arch/arm/boot/dts/alpine.dtsi
 +++ b/arch/arm/boot/dts/alpine.dtsi
 @@ -93,7 +93,7 @@
@@ -144,6 +146,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0x0 0xfb006000 0x0 0x2000>;
                        interrupts =
                                <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+diff --git a/arch/arm/boot/dts/axm55xx.dtsi b/arch/arm/boot/dts/axm55xx.dtsi
+index a9d6d593..47799f59 100644
 --- a/arch/arm/boot/dts/axm55xx.dtsi
 +++ b/arch/arm/boot/dts/axm55xx.dtsi
 @@ -62,7 +62,7 @@
@@ -155,6 +159,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                      <0x20 0x01004000 0 0x2000>,
                      <0x20 0x01006000 0 0x2000>;
                interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) |
+diff --git a/arch/arm/boot/dts/ecx-2000.dts b/arch/arm/boot/dts/ecx-2000.dts
+index 2ccbb57f..c15e7e0c 100644
 --- a/arch/arm/boot/dts/ecx-2000.dts
 +++ b/arch/arm/boot/dts/ecx-2000.dts
 @@ -99,7 +99,7 @@
@@ -166,6 +172,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0xfff14000 0x2000>,
                              <0xfff16000 0x2000>;
                };
+diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi
+index c5c05fdc..c1396873 100644
 --- a/arch/arm/boot/dts/imx6ul.dtsi
 +++ b/arch/arm/boot/dts/imx6ul.dtsi
 @@ -89,11 +89,11 @@
@@ -182,6 +190,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                      <0x00a04000 0x2000>,
                      <0x00a06000 0x2000>;
        };
+diff --git a/arch/arm/boot/dts/keystone.dtsi b/arch/arm/boot/dts/keystone.dtsi
+index 02708ba2..e30c83fc 100644
 --- a/arch/arm/boot/dts/keystone.dtsi
 +++ b/arch/arm/boot/dts/keystone.dtsi
 @@ -30,12 +30,12 @@
@@ -199,6 +209,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                      <0x0 0x02566000 0x0 0x2000>;
                interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) |
                                IRQ_TYPE_LEVEL_HIGH)>;
+diff --git a/arch/arm/boot/dts/ls1021a-qds.dts b/arch/arm/boot/dts/ls1021a-qds.dts
+index 94087531..5611a9c9 100644
 --- a/arch/arm/boot/dts/ls1021a-qds.dts
 +++ b/arch/arm/boot/dts/ls1021a-qds.dts
 @@ -124,6 +124,19 @@
@@ -221,6 +233,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  &enet0 {
        tbi-handle = <&tbi0>;
        phy-handle = <&sgmii_phy1c>;
+diff --git a/arch/arm/boot/dts/ls1021a-twr.dts b/arch/arm/boot/dts/ls1021a-twr.dts
+index a8b148ad..907e5392 100644
 --- a/arch/arm/boot/dts/ls1021a-twr.dts
 +++ b/arch/arm/boot/dts/ls1021a-twr.dts
 @@ -142,6 +142,19 @@
@@ -243,6 +257,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  &enet0 {
        tbi-handle = <&tbi1>;
        phy-handle = <&sgmii_phy2>;
+diff --git a/arch/arm/boot/dts/ls1021a.dtsi b/arch/arm/boot/dts/ls1021a.dtsi
+index 368e2193..9d8d1fee 100644
 --- a/arch/arm/boot/dts/ls1021a.dtsi
 +++ b/arch/arm/boot/dts/ls1021a.dtsi
 @@ -74,17 +74,24 @@
@@ -484,7 +500,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                };
  
 +              ftm0: ftm0@29d0000 {
-+                      compatible = "fsl,ftm-alarm";
++                      compatible = "fsl,ls1021a-ftm";
 +                      reg = <0x0 0x29d0000 0x0 0x10000>,
 +                            <0x0 0x1ee2140 0x0 0x4>;
 +                      reg-names = "ftm", "FlexTimer1";
@@ -609,6 +625,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                        #interrupt-cells = <1>;
                        interrupt-map-mask = <0 0 0 7>;
                        interrupt-map = <0000 0 0 1 &gic GIC_SPI 92  IRQ_TYPE_LEVEL_HIGH>,
+diff --git a/arch/arm/boot/dts/mt6580.dtsi b/arch/arm/boot/dts/mt6580.dtsi
+index 06fdf6c2..a349dba5 100644
 --- a/arch/arm/boot/dts/mt6580.dtsi
 +++ b/arch/arm/boot/dts/mt6580.dtsi
 @@ -91,7 +91,7 @@
@@ -620,6 +638,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                      <0x10214000 0x2000>,
                      <0x10216000 0x2000>;
        };
+diff --git a/arch/arm/boot/dts/mt6589.dtsi b/arch/arm/boot/dts/mt6589.dtsi
+index 88b3cb12..0d6f60af 100644
 --- a/arch/arm/boot/dts/mt6589.dtsi
 +++ b/arch/arm/boot/dts/mt6589.dtsi
 @@ -102,7 +102,7 @@
@@ -631,6 +651,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0x10214000 0x2000>,
                              <0x10216000 0x2000>;
                };
+diff --git a/arch/arm/boot/dts/mt8127.dtsi b/arch/arm/boot/dts/mt8127.dtsi
+index 52086c80..916c095d 100644
 --- a/arch/arm/boot/dts/mt8127.dtsi
 +++ b/arch/arm/boot/dts/mt8127.dtsi
 @@ -129,7 +129,7 @@
@@ -642,6 +664,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0 0x10214000 0 0x2000>,
                              <0 0x10216000 0 0x2000>;
                };
+diff --git a/arch/arm/boot/dts/mt8135.dtsi b/arch/arm/boot/dts/mt8135.dtsi
+index 1d7f92bd..a97b4ee4 100644
 --- a/arch/arm/boot/dts/mt8135.dtsi
 +++ b/arch/arm/boot/dts/mt8135.dtsi
 @@ -221,7 +221,7 @@
@@ -653,6 +677,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0 0x10214000 0 0x2000>,
                              <0 0x10216000 0 0x2000>;
                };
+diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi
+index 17ec2e2d..559fc549 100644
 --- a/arch/arm/boot/dts/rk3288.dtsi
 +++ b/arch/arm/boot/dts/rk3288.dtsi
 @@ -1109,7 +1109,7 @@
@@ -664,6 +690,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                      <0xffc04000 0x2000>,
                      <0xffc06000 0x2000>;
                interrupts = <GIC_PPI 9 0xf04>;
+diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
+index ce196045..97f28399 100644
 --- a/arch/arm/boot/dts/sun6i-a31.dtsi
 +++ b/arch/arm/boot/dts/sun6i-a31.dtsi
 @@ -791,7 +791,7 @@
@@ -675,6 +703,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0x01c84000 0x2000>,
                              <0x01c86000 0x2000>;
                        interrupt-controller;
+diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi
+index 94cf5a1c..81e5a44c 100644
 --- a/arch/arm/boot/dts/sun7i-a20.dtsi
 +++ b/arch/arm/boot/dts/sun7i-a20.dtsi
 @@ -1685,9 +1685,9 @@
@@ -689,6 +719,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0x01c84000 0x2000>,
                              <0x01c86000 0x2000>;
                        interrupt-controller;
+diff --git a/arch/arm/boot/dts/sun8i-a23-a33.dtsi b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
+index 300a1bd5..cdff5888 100644
 --- a/arch/arm/boot/dts/sun8i-a23-a33.dtsi
 +++ b/arch/arm/boot/dts/sun8i-a23-a33.dtsi
 @@ -488,7 +488,7 @@
@@ -700,6 +732,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0x01c84000 0x2000>,
                              <0x01c86000 0x2000>;
                        interrupt-controller;
+diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
+index 3c5214cb..ba7e7c71 100644
 --- a/arch/arm/boot/dts/sun9i-a80.dtsi
 +++ b/arch/arm/boot/dts/sun9i-a80.dtsi
 @@ -613,7 +613,7 @@
@@ -711,6 +745,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                              <0x01c44000 0x2000>,
                              <0x01c46000 0x2000>;
                        interrupt-controller;
+diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
+index 1b7783db..2d7986a1 100644
 --- a/arch/arm64/boot/dts/freescale/Makefile
 +++ b/arch/arm64/boot/dts/freescale/Makefile
 @@ -1,8 +1,24 @@
@@ -738,9 +774,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   
  always                := $(dtb-y)
  subdir-y      := $(dts-dirs)
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
+new file mode 100644
+index 00000000..de8ee499
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
-@@ -0,0 +1,134 @@
+@@ -0,0 +1,177 @@
 +/*
 + * Device Tree file for Freescale LS1012A Freedom Board.
 + *
@@ -792,6 +831,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      model = "LS1012A Freedom Board";
 +      compatible = "fsl,ls1012a-frdm", "fsl,ls1012a";
 +
++      aliases {
++              ethernet0 = &pfe_mac0;
++              ethernet1 = &pfe_mac1;
++      };
++
 +      sys_mclk: clock-mclk {
 +              compatible = "fixed-clock";
 +              #clock-cells = <0>;
@@ -868,6 +912,44 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      };
 +};
 +
++&pfe {
++      status = "okay";
++      #address-cells = <1>;
++      #size-cells = <0>;
++
++      ethernet@0 {
++              compatible = "fsl,pfe-gemac-port";
++              #address-cells = <1>;
++              #size-cells = <0>;
++              reg = <0x0>;    /* GEM_ID */
++              fsl,gemac-bus-id = <0x0>;       /* BUS_ID */
++              fsl,gemac-phy-id = <0x2>;       /* PHY_ID */
++              fsl,mdio-mux-val = <0x0>;
++              phy-mode = "sgmii";
++              fsl,pfe-phy-if-flags = <0x0>;
++
++              mdio@0 {
++                      reg = <0x1>; /* enabled/disabled */
++              };
++      };
++
++      ethernet@1 {
++              compatible = "fsl,pfe-gemac-port";
++              #address-cells = <1>;
++              #size-cells = <0>;
++              reg = <0x1>;    /* GEM_ID */
++              fsl,gemac-bus-id = <0x1>;       /* BUS_ID */
++              fsl,gemac-phy-id = <0x1>;       /* PHY_ID */
++              fsl,mdio-mux-val = <0x0>;
++              phy-mode = "sgmii";
++              fsl,pfe-phy-if-flags = <0x0>;
++
++              mdio@0 {
++                      reg = <0x0>; /* enabled/disabled */
++              };
++      };
++};
++
 +&sai2 {
 +      status = "okay";
 +};
@@ -875,9 +957,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&sata {
 +      status = "okay";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts
+new file mode 100644
+index 00000000..edd87676
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts
-@@ -0,0 +1,155 @@
+@@ -0,0 +1,198 @@
 +/*
 + * Device Tree file for Freescale LS1012A QDS Board.
 + *
@@ -929,6 +1014,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      model = "LS1012A QDS Board";
 +      compatible = "fsl,ls1012a-qds", "fsl,ls1012a";
 +
++      aliases {
++              ethernet0 = &pfe_mac0;
++              ethernet1 = &pfe_mac1;
++      };
++
 +      sys_mclk: clock-mclk {
 +              compatible = "fixed-clock";
 +              #clock-cells = <0>;
@@ -1018,6 +1108,44 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      };
 +};
 +
++&pfe {
++      status = "okay";
++      #address-cells = <1>;
++      #size-cells = <0>;
++
++      ethernet@0 {
++              compatible = "fsl,pfe-gemac-port";
++              #address-cells = <1>;
++              #size-cells = <0>;
++              reg = <0x0>;    /* GEM_ID */
++              fsl,gemac-bus-id = <0x0>;       /* BUS_ID */
++              fsl,gemac-phy-id = <0x1>;       /* PHY_ID */
++              fsl,mdio-mux-val = <0x2>;
++              phy-mode = "sgmii-2500";
++              fsl,pfe-phy-if-flags = <0x0>;
++
++              mdio@0 {
++                      reg = <0x1>; /* enabled/disabled */
++              };
++      };
++
++      ethernet@1 {
++              compatible = "fsl,pfe-gemac-port";
++              #address-cells = <1>;
++              #size-cells = <0>;
++              reg = <0x1>;    /* GEM_ID */
++              fsl,gemac-bus-id = <0x1>;       /* BUS_ID */
++              fsl,gemac-phy-id = <0x2>;       /* PHY_ID */
++              fsl,mdio-mux-val = <0x3>;
++              phy-mode = "sgmii-2500";
++              fsl,pfe-phy-if-flags = <0x0>;
++
++              mdio@0 {
++                      reg = <0x0>; /* enabled/disabled */
++              };
++      };
++};
++
 +&sai2 {
 +      status = "okay";
 +};
@@ -1033,9 +1161,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&esdhc1 {
 +      status = "okay";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
+new file mode 100644
+index 00000000..88684eac
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
-@@ -0,0 +1,91 @@
+@@ -0,0 +1,134 @@
 +/*
 + * Device Tree file for Freescale LS1012A RDB Board.
 + *
@@ -1086,6 +1217,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +/ {
 +      model = "LS1012A RDB Board";
 +      compatible = "fsl,ls1012a-rdb", "fsl,ls1012a";
++
++      aliases {
++              ethernet0 = &pfe_mac0;
++              ethernet1 = &pfe_mac1;
++      };
 +};
 +
 +&duart0 {
@@ -1127,9 +1263,50 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      mmc-hs200-1_8v;
 +      status = "okay";
 +};
++
++&pfe {
++      status = "okay";
++      #address-cells = <1>;
++      #size-cells = <0>;
++
++      ethernet@0 {
++              compatible = "fsl,pfe-gemac-port";
++              #address-cells = <1>;
++              #size-cells = <0>;
++              reg = <0x0>;    /* GEM_ID */
++              fsl,gemac-bus-id = <0x0>;       /* BUS_ID */
++              fsl,gemac-phy-id = <0x2>;       /* PHY_ID */
++              fsl,mdio-mux-val = <0x0>;
++              phy-mode = "sgmii";
++              fsl,pfe-phy-if-flags = <0x0>;
++
++              mdio@0 {
++                      reg = <0x1>; /* enabled/disabled */
++              };
++      };
++
++      ethernet@1 {
++              compatible = "fsl,pfe-gemac-port";
++              #address-cells = <1>;
++              #size-cells = <0>;
++              reg = <0x1>;    /* GEM_ID */
++              fsl,gemac-bus-id = < 0x1 >;     /* BUS_ID */
++              fsl,gemac-phy-id = < 0x1 >;     /* PHY_ID */
++              fsl,mdio-mux-val = <0x0>;
++              phy-mode = "rgmii-txid";
++              fsl,pfe-phy-if-flags = <0x0>;
++
++              mdio@0 {
++                      reg = <0x0>; /* enabled/disabled */
++              };
++      };
++};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
+new file mode 100644
+index 00000000..0b11ece1
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi
-@@ -0,0 +1,517 @@
+@@ -0,0 +1,594 @@
 +/*
 + * Device Tree Include file for Freescale Layerscape-1012A family SoC.
 + *
@@ -1322,6 +1499,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                              interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
 +                      };
 +
++                      caam-dma {
++                              compatible = "fsl,sec-v5.4-dma",
++                                           "fsl,sec-v5.0-dma",
++                                           "fsl,sec-v4.0-dma";
++                      };
++
 +                      rtic@60000 {
 +                              compatible = "fsl,sec-v5.4-rtic",
 +                                           "fsl,sec-v5.0-rtic",
@@ -1485,8 +1668,14 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                      status = "disabled";
 +              };
 +
++              rcpm: rcpm@1ee2000 {
++                      compatible = "fsl,ls1012a-rcpm", "fsl,qoriq-rcpm-2.1";
++                      reg = <0x0 0x1ee2000 0x0 0x1000>;
++                      fsl,#rcpm-wakeup-cells = <1>;
++              };
++
 +              ftm0: ftm0@29d0000 {
-+                      compatible = "fsl,ftm-alarm";
++                      compatible = "fsl,ls1012a-ftm";
 +                      reg = <0x0 0x29d0000 0x0 0x10000>,
 +                            <0x0 0x1ee2140 0x0 0x4>;
 +                      reg-names = "ftm", "FlexTimer1";
@@ -1645,8 +1834,76 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                      dma-coherent;
 +                      status = "disabled";
 +              };
++
++              msi: msi-controller1@1572000 {
++                      compatible = "fsl,ls1012a-msi";
++                      reg = <0x0 0x1572000 0x0 0x8>;
++                      msi-controller;
++                      interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>;
++              };
++
++              pcie@3400000 {
++                      compatible = "fsl,ls1012a-pcie", "snps,dw-pcie";
++                      reg = <0x00 0x03400000 0x0 0x00100000   /* controller registers */
++                             0x40 0x00000000 0x0 0x00002000>; /* configuration space */
++                      reg-names = "regs", "config";
++                      interrupts = <0 118 0x4>, /* AER interrupt */
++                                   <0 117 0x4>; /* PME interrupt */
++                      interrupt-names = "aer", "pme";
++                      #address-cells = <3>;
++                      #size-cells = <2>;
++                      device_type = "pci";
++                      num-lanes = <4>;
++                      bus-range = <0x0 0xff>;
++                      ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000   /* downstream I/O */
++                                0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
++                      msi-parent = <&msi>;
++                      #interrupt-cells = <1>;
++                      interrupt-map-mask = <0 0 0 7>;
++                      interrupt-map = <0000 0 0 1 &gic 0 110 IRQ_TYPE_LEVEL_HIGH>,
++                                      <0000 0 0 2 &gic 0 111 IRQ_TYPE_LEVEL_HIGH>,
++                                      <0000 0 0 3 &gic 0 112 IRQ_TYPE_LEVEL_HIGH>,
++                                      <0000 0 0 4 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>;
++              };
++      };
++
++      reserved-memory {
++              #address-cells = <2>;
++              #size-cells = <2>;
++              ranges;
++
++              pfe_reserved: packetbuffer@83400000 {
++                      reg = <0 0x83400000 0 0xc00000>;
++              };
++      };
++
++      pfe: pfe@04000000 {
++              compatible = "fsl,pfe";
++              reg =   <0x0 0x04000000 0x0 0xc00000>,  /* AXI 16M */
++                      <0x0 0x83400000 0x0 0xc00000>;  /* PFE DDR 12M */
++              reg-names = "pfe", "pfe-ddr";
++              fsl,pfe-num-interfaces = <0x2>;
++              interrupts = <0 172 0x4>,    /* HIF interrupt */
++                           <0 173 0x4>,    /*HIF_NOCPY interrupt */
++                           <0 174 0x4>;    /* WoL interrupt */
++              interrupt-names = "pfe_hif", "pfe_hif_nocpy", "pfe_wol";
++              memory-region = <&pfe_reserved>;
++              fsl,pfe-scfg = <&scfg 0>;
++              fsl,rcpm-wakeup = <&rcpm 0xf0000020>;
++              clocks = <&clockgen 4 0>;
++              clock-names = "pfe";
++
++              status = "okay";
++              pfe_mac0: ethernet@0 {
++              };
++
++              pfe_mac1: ethernet@1 {
++              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi
+new file mode 100644
+index 00000000..169e1714
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi
 @@ -0,0 +1,45 @@
@@ -1695,6 +1952,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      enet6: ethernet@f0000 {
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds-sdk.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds-sdk.dts
+new file mode 100644
+index 00000000..6c13b416
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds-sdk.dts
 @@ -0,0 +1,69 @@
@@ -1767,6 +2027,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&fman0 {
 +      compatible = "fsl,fman", "simple-bus";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
+index dd9e9194..08abff73 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
 @@ -1,7 +1,7 @@
@@ -1973,6 +2235,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk.dts
+new file mode 100644
+index 00000000..ac4b9a41
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk.dts
 @@ -0,0 +1,69 @@
@@ -2045,6 +2310,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&fman0 {
 +      compatible = "fsl,fman", "simple-bus";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb-usdpaa.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb-usdpaa.dts
+new file mode 100644
+index 00000000..4e46a0a5
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb-usdpaa.dts
 @@ -0,0 +1,117 @@
@@ -2165,6 +2433,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              reg = <0x83000 0x1000>;
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
+index d2313e05..f92ae325 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a-rdb.dts
 @@ -1,7 +1,7 @@
@@ -2312,6 +2582,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
+index 97d331ec..ef7c0a24 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1043a.dtsi
 @@ -1,7 +1,7 @@
@@ -2646,7 +2918,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                };
  
 +              ftm0: ftm0@29d0000 {
-+                      compatible = "fsl,ftm-alarm";
++                      compatible = "fsl,ls1043a-ftm";
 +                      reg = <0x0 0x29d0000 0x0 0x10000>,
 +                            <0x0 0x1ee2140 0x0 0x4>;
 +                      reg-names = "ftm", "FlexTimer1";
@@ -2807,6 +3079,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#include "qoriq-qman1-portals.dtsi"
 +#include "qoriq-bman1-portals.dtsi"
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi
+new file mode 100644
+index 00000000..f5017dba
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi
 @@ -0,0 +1,48 @@
@@ -2858,6 +3133,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      enet7: ethernet@f2000 {
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds-sdk.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds-sdk.dts
+new file mode 100644
+index 00000000..c375af47
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds-sdk.dts
 @@ -0,0 +1,109 @@
@@ -2970,6 +3248,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              spi-max-frequency = <10000000>;
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts
+new file mode 100644
+index 00000000..3b8e9b7e
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts
 @@ -0,0 +1,363 @@
@@ -3336,6 +3617,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk.dts
+new file mode 100644
+index 00000000..bfe2f36c
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk.dts
 @@ -0,0 +1,76 @@
@@ -3415,6 +3699,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&fman0 {
 +      compatible = "fsl,fman", "simple-bus";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb-usdpaa.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb-usdpaa.dts
+new file mode 100644
+index 00000000..54336aa6
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb-usdpaa.dts
 @@ -0,0 +1,110 @@
@@ -3528,6 +3815,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              reg = <0x83000 0x1000>;
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts
+new file mode 100644
+index 00000000..be9b62ca
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a-rdb.dts
 @@ -0,0 +1,218 @@
@@ -3749,6 +4039,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
+new file mode 100644
+index 00000000..f7fe73c4
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi
 @@ -0,0 +1,793 @@
@@ -4326,7 +4619,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +
 +              ftm0: ftm0@29d0000 {
-+                      compatible = "fsl,ftm-alarm";
++                      compatible = "fsl,ls1046a-ftm";
 +                      reg = <0x0 0x29d0000 0x0 0x10000>,
 +                            <0x0 0x1ee2140 0x0 0x4>;
 +                      reg-names = "ftm", "FlexTimer1";
@@ -4545,6 +4838,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#include "qoriq-qman1-portals.dtsi"
 +#include "qoriq-bman1-portals.dtsi"
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts
+new file mode 100644
+index 00000000..f61ec261
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts
 @@ -0,0 +1,173 @@
@@ -4721,6 +5017,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&sata {
 +      status = "okay";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts
+new file mode 100644
+index 00000000..a4cbc2d5
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts
 @@ -0,0 +1,236 @@
@@ -4960,9 +5259,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&dpmac10 {
 +      phy-handle = <&mdio1_phy4>;
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
+new file mode 100644
+index 00000000..fd5f1e84
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi
-@@ -0,0 +1,816 @@
+@@ -0,0 +1,818 @@
 +/*
 + * Device Tree Include file for NXP Layerscape-1088A family SoC.
 + *
@@ -5475,9 +5777,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +
 +              ftm0: ftm0@2800000 {
-+                      compatible = "fsl,ftm-alarm";
-+                      reg = <0x0 0x2800000 0x0 0x10000>;
++                      compatible = "fsl,ls1088a-ftm";
++                      reg = <0x0 0x2800000 0x0 0x10000>,
++                            <0x0 0x1e34050 0x0 0x4>;
 +                      interrupts = <0 44 4>;
++                      reg-names = "ftm", "FlexTimer1";
 +              };
 +
 +              i2c0: i2c@2000000 {
@@ -5779,6 +6083,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      };
 +
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
+index b0dd0109..ba1a79dd 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts
 @@ -1,8 +1,10 @@
@@ -6010,6 +6316,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&dpmac12 {
 +      phy-handle = <&mdio0_phy15>;
  };
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
+index ad0ebb8a..025f0f54 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts
 @@ -1,8 +1,10 @@
@@ -6065,17 +6373,29 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -              reg = <0x0 0x0 0x8000000>;
 -              bank-width = <2>;
 -              device-width = <1>;
--      };
++&emdio1 {
++      status = "disabled";
++      /* CS4340 PHYs */
++      mdio1_phy1: emdio1_phy@1 {
++              reg = <0x10>;
++              phy-connection-type = "xfi";
+       };
 -
 -      nand@2,0 {
 -           compatible = "fsl,ifc-nand";
 -           reg = <0x2 0x0 0x10000>;
--      };
++      mdio1_phy2: emdio1_phy@2 {
++              reg = <0x11>;
++              phy-connection-type = "xfi";
+       };
 -
 -      cpld@3,0 {
 -           reg = <0x3 0x0 0x10000>;
 -           compatible = "fsl,ls2080aqds-fpga", "fsl,fpga-qixis";
--      };
++      mdio1_phy3: emdio1_phy@3 {
++              reg = <0x12>;
++              phy-connection-type = "xfi";
+       };
 -
 -};
 -
@@ -6107,9 +6427,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                              reg = <0x4c>;
 -                      };
 -              };
--      };
--};
--
++      mdio1_phy4: emdio1_phy@4 {
++              reg = <0x13>;
++              phy-connection-type = "xfi";
+       };
+ };
 -&i2c1 {
 -      status = "disabled";
 -};
@@ -6119,27 +6442,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -};
 -
 -&i2c3 {
-+&emdio1 {
-       status = "disabled";
-+      /* CS4340 PHYs */
-+      mdio1_phy1: emdio1_phy@1 {
-+              reg = <0x10>;
-+              phy-connection-type = "xfi";
-+      };
-+      mdio1_phy2: emdio1_phy@2 {
-+              reg = <0x11>;
-+              phy-connection-type = "xfi";
-+      };
-+      mdio1_phy3: emdio1_phy@3 {
-+              reg = <0x12>;
-+              phy-connection-type = "xfi";
-+      };
-+      mdio1_phy4: emdio1_phy@4 {
-+              reg = <0x13>;
-+              phy-connection-type = "xfi";
-+      };
- };
+-      status = "disabled";
+-};
+-
 -&dspi {
 -      status = "okay";
 -      dflash0: n25q512a {
@@ -6220,6 +6525,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&dpmac8 {
 +      phy-handle = <&mdio2_phy4>;
  };
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts b/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
+index 505d0380..fbbb73e5 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts
 @@ -1,7 +1,7 @@
@@ -6250,6 +6557,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        ethernet@2210000 {
                compatible = "smsc,lan91c111";
                reg = <0x0 0x2210000 0x0 0x100>;
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
+index 7f0dc13b..71f15fab 100644
 --- a/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2080a.dtsi
 @@ -1,8 +1,9 @@
@@ -6272,7 +6581,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      interrupt-parent = <&gic>;
 -      #address-cells = <2>;
 -      #size-cells = <2>;
--
++#include "fsl-ls208xa.dtsi"
 -      cpus {
 -              #address-cells = <1>;
 -              #size-cells = <0>;
@@ -6364,21 +6674,42 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -              cluster3_l2: l2-cache3 {
 -                      compatible = "cache";
 -              };
--      };
--
++&cpu {
++      cpu0: cpu@0 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x0>;
++              clocks = <&clockgen 1 0>;
++              next-level-cache = <&cluster0_l2>;
++              #cooling-cells = <2>;
+       };
 -      memory@80000000 {
 -              device_type = "memory";
 -              reg = <0x00000000 0x80000000 0 0x80000000>;
 -                    /* DRAM space - 1, size : 2 GB DRAM */
--      };
--
++      cpu1: cpu@1 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x1>;
++              clocks = <&clockgen 1 0>;
++              next-level-cache = <&cluster0_l2>;
+       };
 -      sysclk: sysclk {
 -              compatible = "fixed-clock";
 -              #clock-cells = <0>;
 -              clock-frequency = <100000000>;
 -              clock-output-names = "sysclk";
--      };
--
++      cpu2: cpu@100 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x100>;
++              clocks = <&clockgen 1 1>;
++              next-level-cache = <&cluster1_l2>;
++              #cooling-cells = <2>;
+       };
 -      gic: interrupt-controller@6000000 {
 -              compatible = "arm,gic-v3";
 -              reg = <0x0 0x06000000 0 0x10000>, /* GIC Dist */
@@ -6398,20 +6729,39 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      msi-controller;
 -                      reg = <0x0 0x6020000 0 0x20000>;
 -              };
--      };
--
++      cpu3: cpu@101 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x101>;
++              clocks = <&clockgen 1 1>;
++              next-level-cache = <&cluster1_l2>;
+       };
 -      rstcr: syscon@1e60000 {
 -              compatible = "fsl,ls2080a-rstcr", "syscon";
 -              reg = <0x0 0x1e60000 0x0 0x4>;
--      };
--
++      cpu4: cpu@200 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x200>;
++              clocks = <&clockgen 1 2>;
++              next-level-cache = <&cluster2_l2>;
++              #cooling-cells = <2>;
+       };
 -      reboot {
 -              compatible ="syscon-reboot";
 -              regmap = <&rstcr>;
 -              offset = <0x0>;
 -              mask = <0x2>;
--      };
--
++      cpu5: cpu@201 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x201>;
++              clocks = <&clockgen 1 2>;
++              next-level-cache = <&cluster2_l2>;
+       };
 -      timer {
 -              compatible = "arm,armv8-timer";
 -              interrupts = <1 13 4>, /* Physical Secure PPI, active-low */
@@ -6419,13 +6769,26 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                           <1 11 4>, /* Virtual PPI, active-low */
 -                           <1 10 4>; /* Hypervisor PPI, active-low */
 -              fsl,erratum-a008585;
--      };
--
++      cpu6: cpu@300 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x300>;
++              clocks = <&clockgen 1 3>;
++              next-level-cache = <&cluster3_l2>;
++              #cooling-cells = <2>;
+       };
 -      pmu {
 -              compatible = "arm,armv8-pmuv3";
 -              interrupts = <1 7 0x8>; /* PMU PPI, Level low type */
--      };
--
++      cpu7: cpu@301 {
++              device_type = "cpu";
++              compatible = "arm,cortex-a57";
++              reg = <0x301>;
++              clocks = <&clockgen 1 3>;
++              next-level-cache = <&cluster3_l2>;
+       };
 -      soc {
 -              compatible = "simple-bus";
 -              #address-cells = <2>;
@@ -6782,12 +7145,18 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      little-endian;
 -                      #address-cells = <2>;
 -                      #size-cells = <1>;
--
++      cluster0_l2: l2-cache0 {
++              compatible = "cache";
++      };
 -                      ranges = <0 0 0x5 0x80000000 0x08000000
 -                                2 0 0x5 0x30000000 0x00010000
 -                                3 0 0x5 0x20000000 0x00010000>;
 -              };
--
++      cluster1_l2: l2-cache1 {
++              compatible = "cache";
++      };
 -              qspi: quadspi@20c0000 {
 -                      status = "disabled";
 -                      compatible = "fsl,ls2080a-qspi", "fsl,ls1021a-qspi";
@@ -6800,7 +7169,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      clocks = <&clockgen 4 3>, <&clockgen 4 3>;
 -                      clock-names = "qspi_en", "qspi";
 -              };
--
++      cluster2_l2: l2-cache2 {
++              compatible = "cache";
++      };
 -              pcie@3400000 {
 -                      compatible = "fsl,ls2080a-pcie", "fsl,ls2085a-pcie",
 -                                   "snps,dw-pcie";
@@ -6825,7 +7197,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                                      <0000 0 0 3 &gic 0 0 0 111 4>,
 -                                      <0000 0 0 4 &gic 0 0 0 112 4>;
 -              };
--
++      cluster3_l2: l2-cache3 {
++              compatible = "cache";
++      };
++};
 -              pcie@3500000 {
 -                      compatible = "fsl,ls2080a-pcie", "fsl,ls2085a-pcie",
 -                                   "snps,dw-pcie";
@@ -6850,7 +7226,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                                      <0000 0 0 3 &gic 0 0 0 116 4>,
 -                                      <0000 0 0 4 &gic 0 0 0 117 4>;
 -              };
--
++&usb0 {
++      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
++      snps,dma-snooping;
++};
 -              pcie@3600000 {
 -                      compatible = "fsl,ls2080a-pcie", "fsl,ls2085a-pcie",
 -                                   "snps,dw-pcie";
@@ -6875,7 +7255,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                                      <0000 0 0 3 &gic 0 0 0 121 4>,
 -                                      <0000 0 0 4 &gic 0 0 0 122 4>;
 -              };
--
++&usb1 {
++      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
++      snps,dma-snooping;
++};
 -              pcie@3700000 {
 -                      compatible = "fsl,ls2080a-pcie", "fsl,ls2085a-pcie",
 -                                   "snps,dw-pcie";
@@ -6900,7 +7284,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                                      <0000 0 0 3 &gic 0 0 0 126 4>,
 -                                      <0000 0 0 4 &gic 0 0 0 127 4>;
 -              };
--
++&pcie1 {
++      reg = <0x00 0x03400000 0x0 0x00100000   /* controller registers */
++             0x10 0x00000000 0x0 0x00002000>; /* configuration space */
 -              sata0: sata@3200000 {
 -                      status = "disabled";
 -                      compatible = "fsl,ls2080a-ahci";
@@ -6909,7 +7296,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      clocks = <&clockgen 4 3>;
 -                      dma-coherent;
 -              };
--
++      ranges = <0x81000000 0x0 0x00000000 0x10 0x00010000 0x0 0x00010000   /* downstream I/O */
++                0x82000000 0x0 0x40000000 0x10 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
++};
 -              sata1: sata@3210000 {
 -                      status = "disabled";
 -                      compatible = "fsl,ls2080a-ahci";
@@ -6918,7 +7308,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      clocks = <&clockgen 4 3>;
 -                      dma-coherent;
 -              };
--
++&pcie2 {
++      reg = <0x00 0x03500000 0x0 0x00100000   /* controller registers */
++             0x12 0x00000000 0x0 0x00002000>; /* configuration space */
 -              usb0: usb3@3100000 {
 -                      status = "disabled";
 -                      compatible = "snps,dwc3";
@@ -6928,7 +7321,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      snps,quirk-frame-length-adjustment = <0x20>;
 -                      snps,dis_rxdet_inp3_quirk;
 -              };
--
++      ranges = <0x81000000 0x0 0x00000000 0x12 0x00010000 0x0 0x00010000   /* downstream I/O */
++                0x82000000 0x0 0x40000000 0x12 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
++};
 -              usb1: usb3@3110000 {
 -                      status = "disabled";
 -                      compatible = "snps,dwc3";
@@ -6938,155 +7334,42 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -                      snps,quirk-frame-length-adjustment = <0x20>;
 -                      snps,dis_rxdet_inp3_quirk;
 -              };
--
++&pcie3 {
++      reg = <0x00 0x03600000 0x0 0x00100000   /* controller registers */
++             0x14 0x00000000 0x0 0x00002000>; /* configuration space */
 -              ccn@4000000 {
 -                      compatible = "arm,ccn-504";
 -                      reg = <0x0 0x04000000 0x0 0x01000000>;
 -                      interrupts = <0 12 4>;
 -              };
 -      };
--
++      ranges = <0x81000000 0x0 0x00000000 0x14 0x00010000 0x0 0x00010000   /* downstream I/O */
++                0x82000000 0x0 0x40000000 0x14 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
++};
 -      ddr1: memory-controller@1080000 {
 -              compatible = "fsl,qoriq-memory-controller";
 -              reg = <0x0 0x1080000 0x0 0x1000>;
 -              interrupts = <0 17 0x4>;
 -              little-endian;
 -      };
--
++&pcie4 {
++      reg = <0x00 0x03700000 0x0 0x00100000   /* controller registers */
++             0x16 0x00000000 0x0 0x00002000>; /* configuration space */
 -      ddr2: memory-controller@1090000 {
 -              compatible = "fsl,qoriq-memory-controller";
 -              reg = <0x0 0x1090000 0x0 0x1000>;
 -              interrupts = <0 18 0x4>;
 -              little-endian;
-+#include "fsl-ls208xa.dtsi"
-+
-+&cpu {
-+      cpu0: cpu@0 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x0>;
-+              clocks = <&clockgen 1 0>;
-+              next-level-cache = <&cluster0_l2>;
-+              #cooling-cells = <2>;
-+      };
-+
-+      cpu1: cpu@1 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x1>;
-+              clocks = <&clockgen 1 0>;
-+              next-level-cache = <&cluster0_l2>;
-+      };
-+
-+      cpu2: cpu@100 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x100>;
-+              clocks = <&clockgen 1 1>;
-+              next-level-cache = <&cluster1_l2>;
-+              #cooling-cells = <2>;
-+      };
-+
-+      cpu3: cpu@101 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x101>;
-+              clocks = <&clockgen 1 1>;
-+              next-level-cache = <&cluster1_l2>;
-+      };
-+
-+      cpu4: cpu@200 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x200>;
-+              clocks = <&clockgen 1 2>;
-+              next-level-cache = <&cluster2_l2>;
-+              #cooling-cells = <2>;
-+      };
-+
-+      cpu5: cpu@201 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x201>;
-+              clocks = <&clockgen 1 2>;
-+              next-level-cache = <&cluster2_l2>;
-+      };
-+
-+      cpu6: cpu@300 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x300>;
-+              clocks = <&clockgen 1 3>;
-+              next-level-cache = <&cluster3_l2>;
-+              #cooling-cells = <2>;
-+      };
-+
-+      cpu7: cpu@301 {
-+              device_type = "cpu";
-+              compatible = "arm,cortex-a57";
-+              reg = <0x301>;
-+              clocks = <&clockgen 1 3>;
-+              next-level-cache = <&cluster3_l2>;
-       };
-+
-+      cluster0_l2: l2-cache0 {
-+              compatible = "cache";
-+      };
-+
-+      cluster1_l2: l2-cache1 {
-+              compatible = "cache";
-+      };
-+
-+      cluster2_l2: l2-cache2 {
-+              compatible = "cache";
-+      };
-+
-+      cluster3_l2: l2-cache3 {
-+              compatible = "cache";
-+      };
-+};
-+
-+&usb0 {
-+      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
-+      snps,dma-snooping;
-+};
-+
-+&usb1 {
-+      snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
-+      snps,dma-snooping;
-+};
-+
-+&pcie1 {
-+      reg = <0x00 0x03400000 0x0 0x00100000   /* controller registers */
-+             0x10 0x00000000 0x0 0x00002000>; /* configuration space */
-+
-+      ranges = <0x81000000 0x0 0x00000000 0x10 0x00010000 0x0 0x00010000   /* downstream I/O */
-+                0x82000000 0x0 0x40000000 0x10 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
-+};
-+
-+&pcie2 {
-+      reg = <0x00 0x03500000 0x0 0x00100000   /* controller registers */
-+             0x12 0x00000000 0x0 0x00002000>; /* configuration space */
-+
-+      ranges = <0x81000000 0x0 0x00000000 0x12 0x00010000 0x0 0x00010000   /* downstream I/O */
-+                0x82000000 0x0 0x40000000 0x12 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
-+};
-+
-+&pcie3 {
-+      reg = <0x00 0x03600000 0x0 0x00100000   /* controller registers */
-+             0x14 0x00000000 0x0 0x00002000>; /* configuration space */
-+
-+      ranges = <0x81000000 0x0 0x00000000 0x14 0x00010000 0x0 0x00010000   /* downstream I/O */
-+                0x82000000 0x0 0x40000000 0x14 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
-+};
-+
-+&pcie4 {
-+      reg = <0x00 0x03700000 0x0 0x00100000   /* controller registers */
-+             0x16 0x00000000 0x0 0x00002000>; /* configuration space */
-+
+-      };
 +      ranges = <0x81000000 0x0 0x00000000 0x16 0x00010000 0x0 0x00010000   /* downstream I/O */
 +                0x82000000 0x0 0x40000000 0x16 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */
  };
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2081a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls2081a-rdb.dts
+new file mode 100644
+index 00000000..c3375bf7
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2081a-rdb.dts
 @@ -0,0 +1,161 @@
@@ -7251,6 +7534,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&usb1 {
 +      status = "okay";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2088a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls2088a-qds.dts
+new file mode 100644
+index 00000000..1dbc7aa8
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a-qds.dts
 @@ -0,0 +1,162 @@
@@ -7416,6 +7702,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&dpmac12 {
 +      phy-handle = <&mdio0_phy15>;
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2088a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls2088a-rdb.dts
+new file mode 100644
+index 00000000..9300119b
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a-rdb.dts
 @@ -0,0 +1,140 @@
@@ -7559,6 +7848,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&dpmac8 {
 +      phy-handle = <&mdio2_phy4>;
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
+new file mode 100644
+index 00000000..833699ea
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi
 @@ -0,0 +1,195 @@
@@ -7757,6 +8049,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      ranges = <0x81000000 0x0 0x00000000 0x38 0x00010000 0x0 0x00010000
 +                0x82000000 0x0 0x40000000 0x38 0x40000000 0x0 0x40000000>;
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi
+new file mode 100644
+index 00000000..b2374469
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi
 @@ -0,0 +1,198 @@
@@ -7958,6 +8253,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&usb1 {
 +      status = "okay";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi
+new file mode 100644
+index 00000000..8e919dc8
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi
 @@ -0,0 +1,161 @@
@@ -8122,9 +8420,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +&usb1 {
 +      status = "okay";
 +};
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
+new file mode 100644
+index 00000000..dbc3a3d0
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
-@@ -0,0 +1,910 @@
+@@ -0,0 +1,912 @@
 +/*
 + * Device Tree Include file for Freescale Layerscape-2080A family SoC.
 + *
@@ -9015,9 +9316,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +
 +              ftm0: ftm0@2800000 {
-+                      compatible = "fsl,ftm-alarm";
-+                      reg = <0x0 0x2800000 0x0 0x10000>;
++                      compatible = "fsl,ls208xa-ftm";
++                      reg = <0x0 0x2800000 0x0 0x10000>,
++                            <0x0 0x1e34050 0x0 0x4>;
 +                      interrupts = <0 44 4>;
++                      reg-names = "ftm", "FlexTimer1";
 +              };
 +      };
 +
@@ -9035,6 +9338,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              little-endian;
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-bman1-portals.dtsi b/arch/arm64/boot/dts/freescale/qoriq-bman1-portals.dtsi
+new file mode 100644
+index 00000000..14680adb
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-bman1-portals.dtsi
 @@ -0,0 +1,81 @@
@@ -9119,6 +9425,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              fsl,bpid-range = <32 32>;
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-dpaa-eth.dtsi b/arch/arm64/boot/dts/freescale/qoriq-dpaa-eth.dtsi
+new file mode 100644
+index 00000000..eb5af912
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-dpaa-eth.dtsi
 @@ -0,0 +1,66 @@
@@ -9188,6 +9497,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      };
 +};
 +
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi
+new file mode 100644
+index 00000000..474bff5e
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi
 @@ -0,0 +1,43 @@
@@ -9234,6 +9546,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi
+new file mode 100644
+index 00000000..d4326f85
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-10g-1.dtsi
 @@ -0,0 +1,43 @@
@@ -9280,6 +9595,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi
+new file mode 100644
+index 00000000..7170cab9
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-0.dtsi
 @@ -0,0 +1,42 @@
@@ -9325,6 +9643,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi
+new file mode 100644
+index 00000000..c7eb8b6e
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-1.dtsi
 @@ -0,0 +1,42 @@
@@ -9370,6 +9691,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi
+new file mode 100644
+index 00000000..56f9f0dd
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-2.dtsi
 @@ -0,0 +1,42 @@
@@ -9415,6 +9739,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi
+new file mode 100644
+index 00000000..bbe7dbaf
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-3.dtsi
 @@ -0,0 +1,42 @@
@@ -9460,6 +9787,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi
+new file mode 100644
+index 00000000..ead4f062
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-4.dtsi
 @@ -0,0 +1,42 @@
@@ -9505,6 +9835,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi
+new file mode 100644
+index 00000000..389eadaf
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-1g-5.dtsi
 @@ -0,0 +1,42 @@
@@ -9550,6 +9883,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              };
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0-6oh.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-6oh.dtsi
+new file mode 100644
+index 00000000..2d0df20d
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0-6oh.dtsi
 @@ -0,0 +1,47 @@
@@ -9600,6 +9936,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      };
 +
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-fman3-0.dtsi b/arch/arm64/boot/dts/freescale/qoriq-fman3-0.dtsi
+new file mode 100644
+index 00000000..8e089f0c
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-fman3-0.dtsi
 @@ -0,0 +1,130 @@
@@ -9733,6 +10072,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              reg = <0xfe000 0x1000>;
 +      };
 +};
+diff --git a/arch/arm64/boot/dts/freescale/qoriq-qman1-portals.dtsi b/arch/arm64/boot/dts/freescale/qoriq-qman1-portals.dtsi
+new file mode 100644
+index 00000000..4f7edf48
 --- /dev/null
 +++ b/arch/arm64/boot/dts/freescale/qoriq-qman1-portals.dtsi
 @@ -0,0 +1,104 @@
@@ -9840,6 +10182,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              fsl,ceetm-channel-range = <0 32>;
 +      };
 +};
+diff --git a/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi
+index 5022432e..65701ada 100644
 --- a/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi
 +++ b/arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi
 @@ -38,51 +38,61 @@
@@ -9904,6 +10248,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                compatible = "fsl,bman-portal";
                reg = <0x24000 0x4000>, <0x109000 0x1000>;
                interrupts = <123 2 0 0>;
+diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
+index c288f3c6..dd200e28 100644
 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
 +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi
 @@ -35,14 +35,14 @@
@@ -9923,6 +10269,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                reg = <0xb0000 0x1000>;
                fsl,fman-10g-port;
        };
+diff --git a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
+index 94a76982..365770c9 100644
 --- a/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
 +++ b/arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi
 @@ -35,14 +35,14 @@
@@ -9942,3 +10290,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                reg = <0xb1000 0x1000>;
                fsl,fman-10g-port;
        };
+-- 
+2.14.1
+
index 445a6fa..6dbd984 100644 (file)
@@ -1,4 +1,4 @@
-From 120fa458ffe2250ea58578ccfc85e674005463dc Mon Sep 17 00:00:00 2001
+From a3757157751a8a5302ee5e11faf828dc5db02018 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 10:53:50 +0800
 Subject: [PATCH] mtd: spi-nor: support layerscape
@@ -18,14 +18,16 @@ Signed-off-by: Ash Benz <ash.benz@bk.ru>
 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 ---
  drivers/mtd/mtdchar.c             |   2 +-
- drivers/mtd/spi-nor/fsl-quadspi.c | 356 +++++++++++++++++++++++++++++++-------
- drivers/mtd/spi-nor/spi-nor.c     | 136 +++++++++++++--
+ drivers/mtd/spi-nor/fsl-quadspi.c | 327 +++++++++++++++++++++++++++++++-------
+ drivers/mtd/spi-nor/spi-nor.c     | 136 ++++++++++++++--
  include/linux/mtd/spi-nor.h       |  14 +-
- 4 files changed, 432 insertions(+), 76 deletions(-)
+ 4 files changed, 409 insertions(+), 70 deletions(-)
 
+diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
+index 2a47a3f0..4f21401d 100644
 --- a/drivers/mtd/mtdchar.c
 +++ b/drivers/mtd/mtdchar.c
-@@ -451,7 +451,7 @@ static int mtdchar_readoob(struct file *
+@@ -451,7 +451,7 @@ static int mtdchar_readoob(struct file *file, struct mtd_info *mtd,
         * data. For our userspace tools it is important to dump areas
         * with ECC errors!
         * For kernel internal usage it also might return -EUCLEAN
@@ -34,6 +36,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
         * been corrected by the ECC algorithm.
         *
         * Note: currently the standard NAND function, nand_read_oob_std,
+diff --git a/drivers/mtd/spi-nor/fsl-quadspi.c b/drivers/mtd/spi-nor/fsl-quadspi.c
+index 5c82e4ef..33ecc27a 100644
 --- a/drivers/mtd/spi-nor/fsl-quadspi.c
 +++ b/drivers/mtd/spi-nor/fsl-quadspi.c
 @@ -41,6 +41,8 @@
@@ -86,7 +90,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        .devtype = FSL_QUADSPI_VYBRID,
        .rxfifo = 128,
        .txfifo = 64,
-@@ -232,7 +241,7 @@ static struct fsl_qspi_devtype_data vybr
+@@ -232,7 +241,7 @@ static struct fsl_qspi_devtype_data vybrid_data = {
        .driver_data = QUADSPI_QUIRK_SWAP_ENDIAN,
  };
  
@@ -95,7 +99,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        .devtype = FSL_QUADSPI_IMX6SX,
        .rxfifo = 128,
        .txfifo = 512,
-@@ -241,7 +250,7 @@ static struct fsl_qspi_devtype_data imx6
+@@ -241,7 +250,7 @@ static struct fsl_qspi_devtype_data imx6sx_data = {
                       | QUADSPI_QUIRK_TKT245618,
  };
  
@@ -104,7 +108,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        .devtype = FSL_QUADSPI_IMX7D,
        .rxfifo = 512,
        .txfifo = 512,
-@@ -250,7 +259,7 @@ static struct fsl_qspi_devtype_data imx7
+@@ -250,7 +259,7 @@ static struct fsl_qspi_devtype_data imx7d_data = {
                       | QUADSPI_QUIRK_4X_INT_CLK,
  };
  
@@ -113,7 +117,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        .devtype = FSL_QUADSPI_IMX6UL,
        .rxfifo = 128,
        .txfifo = 512,
-@@ -267,6 +276,14 @@ static struct fsl_qspi_devtype_data ls10
+@@ -267,6 +276,14 @@ static struct fsl_qspi_devtype_data ls1021a_data = {
        .driver_data = 0,
  };
  
@@ -136,7 +140,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        unsigned int chip_base_addr; /* We may support two chips. */
        bool has_second_chip;
        bool big_endian;
-@@ -309,6 +327,23 @@ static inline int needs_wakeup_wait_mode
+@@ -309,6 +327,23 @@ static inline int needs_wakeup_wait_mode(struct fsl_qspi *q)
        return q->devtype_data->driver_data & QUADSPI_QUIRK_TKT245618;
  }
  
@@ -160,7 +164,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /*
   * R/W functions for big- or little-endian registers:
   * The qSPI controller's endian is independent of the CPU core's endian.
-@@ -331,6 +366,31 @@ static u32 qspi_readl(struct fsl_qspi *q
+@@ -331,6 +366,31 @@ static u32 qspi_readl(struct fsl_qspi *q, void __iomem *addr)
                return ioread32(addr);
  }
  
@@ -192,7 +196,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /*
   * An IC bug makes us to re-arrange the 32-bit data.
   * The following chips, such as IMX6SLX, have fixed this bug.
-@@ -373,8 +433,15 @@ static void fsl_qspi_init_lut(struct fsl
+@@ -373,8 +433,15 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
        void __iomem *base = q->iobase;
        int rxfifo = q->devtype_data->rxfifo;
        u32 lut_base;
@@ -209,7 +213,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        fsl_qspi_unlock_lut(q);
  
-@@ -382,25 +449,51 @@ static void fsl_qspi_init_lut(struct fsl
+@@ -382,25 +449,51 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
        for (i = 0; i < QUADSPI_LUT_NUM; i++)
                qspi_writel(q, 0, base + QUADSPI_LUT_BASE + i * 4);
  
@@ -226,10 +230,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -              addrlen = ADDR32BIT;
 -              dummy = 8;
 -      }
+-
+-      qspi_writel(q, LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
 +      /* Read */
 +      lut_base = SEQID_READ * 4;
--      qspi_writel(q, LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen),
++
 +      if (nor->flash_read == SPI_NOR_FAST) {
 +              qspi_writel(q, LUT0(CMD, PAD1, read_op) |
 +                          LUT1(ADDR, PAD1, addrlen),
@@ -276,7 +281,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        /* Write enable */
        lut_base = SEQID_WREN * 4;
        qspi_writel(q, LUT0(CMD, PAD1, SPINOR_OP_WREN),
-@@ -409,16 +502,8 @@ static void fsl_qspi_init_lut(struct fsl
+@@ -409,16 +502,8 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
        /* Page Program */
        lut_base = SEQID_PP * 4;
  
@@ -295,7 +300,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                        base + QUADSPI_LUT(lut_base));
        qspi_writel(q, LUT0(FSL_WRITE, PAD1, 0),
                        base + QUADSPI_LUT(lut_base + 1));
-@@ -432,10 +517,8 @@ static void fsl_qspi_init_lut(struct fsl
+@@ -432,10 +517,8 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
        /* Erase a sector */
        lut_base = SEQID_SE * 4;
  
@@ -308,7 +313,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                        base + QUADSPI_LUT(lut_base));
  
        /* Erase the whole chip */
-@@ -476,6 +559,44 @@ static void fsl_qspi_init_lut(struct fsl
+@@ -476,6 +559,44 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
        qspi_writel(q, LUT0(CMD, PAD1, SPINOR_OP_BRWR),
                        base + QUADSPI_LUT(lut_base));
  
@@ -353,7 +358,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        fsl_qspi_lock_lut(q);
  }
  
-@@ -483,8 +604,24 @@ static void fsl_qspi_init_lut(struct fsl
+@@ -483,8 +604,24 @@ static void fsl_qspi_init_lut(struct fsl_qspi *q)
  static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
  {
        switch (cmd) {
@@ -379,7 +384,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        case SPINOR_OP_WREN:
                return SEQID_WREN;
        case SPINOR_OP_WRDI:
-@@ -496,6 +633,7 @@ static int fsl_qspi_get_seqid(struct fsl
+@@ -496,6 +633,7 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
        case SPINOR_OP_CHIP_ERASE:
                return SEQID_CHIP_ERASE;
        case SPINOR_OP_PP:
@@ -387,7 +392,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                return SEQID_PP;
        case SPINOR_OP_RDID:
                return SEQID_RDID;
-@@ -507,6 +645,8 @@ static int fsl_qspi_get_seqid(struct fsl
+@@ -507,6 +645,8 @@ static int fsl_qspi_get_seqid(struct fsl_qspi *q, u8 cmd)
                return SEQID_EN4B;
        case SPINOR_OP_BRWR:
                return SEQID_BRWR;
@@ -396,7 +401,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        default:
                if (cmd == q->nor[0].erase_opcode)
                        return SEQID_SE;
-@@ -531,8 +671,11 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 c
+@@ -531,8 +671,11 @@ fsl_qspi_runcmd(struct fsl_qspi *q, u8 cmd, unsigned int addr, int len)
        /* save the reg */
        reg = qspi_readl(q, base + QUADSPI_MCR);
  
@@ -410,7 +415,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        qspi_writel(q, QUADSPI_RBCT_WMRK_MASK | QUADSPI_RBCT_RXBRD_USEIPS,
                        base + QUADSPI_RBCT);
        qspi_writel(q, reg | QUADSPI_MCR_CLR_RXF_MASK, base + QUADSPI_MCR);
-@@ -582,10 +725,10 @@ static void fsl_qspi_read_data(struct fs
+@@ -582,10 +725,10 @@ static void fsl_qspi_read_data(struct fsl_qspi *q, int len, u8 *rxbuf)
                                q->chip_base_addr, tmp);
  
                if (len >= 4) {
@@ -423,7 +428,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                        break;
                }
  
-@@ -619,11 +762,12 @@ static inline void fsl_qspi_invalid(stru
+@@ -619,11 +762,12 @@ static inline void fsl_qspi_invalid(struct fsl_qspi *q)
  }
  
  static ssize_t fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
@@ -437,7 +442,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        dev_dbg(q->dev, "to 0x%.8x:0x%.8x, len : %d\n",
                q->chip_base_addr, to, count);
-@@ -633,10 +777,13 @@ static ssize_t fsl_qspi_nor_write(struct
+@@ -633,10 +777,13 @@ static ssize_t fsl_qspi_nor_write(struct fsl_qspi *q, struct spi_nor *nor,
        qspi_writel(q, tmp | QUADSPI_MCR_CLR_TXF_MASK, q->iobase + QUADSPI_MCR);
  
        /* fill the TX data to the FIFO */
@@ -453,7 +458,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        }
  
        /* fill the TXFIFO upto 16 bytes for i.MX7d */
-@@ -657,11 +804,43 @@ static void fsl_qspi_set_map_addr(struct
+@@ -657,11 +804,43 @@ static void fsl_qspi_set_map_addr(struct fsl_qspi *q)
  {
        int nor_size = q->nor_size;
        void __iomem *base = q->iobase;
@@ -501,50 +506,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  }
  
  /*
-@@ -681,19 +860,36 @@ static void fsl_qspi_init_abh_read(struc
- {
-       void __iomem *base = q->iobase;
-       int seqid;
-+      const struct fsl_qspi_devtype_data *devtype_data = q->devtype_data;
-       /* AHB configuration for access buffer 0/1/2 .*/
-       qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF0CR);
-       qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF1CR);
-       qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF2CR);
-+
-       /*
--       * Set ADATSZ with the maximum AHB buffer size to improve the
--       * read performance.
-+       * Errata: A-009282: QuadSPI data prefetch may result in incorrect data
-+       * Workaround: Keep the read data size to 64 bits (8 bytes).
-+       * This disables the prefetch on the AHB buffer and
-+       * prevents this issue from occurring.
-        */
--      qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK |
--                      ((q->devtype_data->ahb_buf_size / 8)
--                      << QUADSPI_BUF3CR_ADATSZ_SHIFT),
--                      base + QUADSPI_BUF3CR);
-+      if (devtype_data->devtype == FSL_QUADSPI_LS2080A ||
-+          devtype_data->devtype == FSL_QUADSPI_LS1021A) {
-+
-+              qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK |
-+                              (1 << QUADSPI_BUF3CR_ADATSZ_SHIFT),
-+                              base + QUADSPI_BUF3CR);
-+
-+      } else {
-+              /*
-+               * Set ADATSZ with the maximum AHB buffer size to improve the
-+               * read performance.
-+              */
-+              qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK |
-+                              ((q->devtype_data->ahb_buf_size / 8)
-+                              << QUADSPI_BUF3CR_ADATSZ_SHIFT),
-+                              base + QUADSPI_BUF3CR);
-+      }
-       /* We only use the buffer3 */
-       qspi_writel(q, 0, base + QUADSPI_BUF0IND);
-@@ -704,6 +900,11 @@ static void fsl_qspi_init_abh_read(struc
+@@ -704,6 +883,11 @@ static void fsl_qspi_init_abh_read(struct fsl_qspi *q)
        seqid = fsl_qspi_get_seqid(q, q->nor[0].read_opcode);
        qspi_writel(q, seqid << QUADSPI_BFGENCR_SEQID_SHIFT,
                q->iobase + QUADSPI_BFGENCR);
@@ -556,7 +518,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  }
  
  /* This function was used to prepare and enable QSPI clock */
-@@ -822,6 +1023,7 @@ static const struct of_device_id fsl_qsp
+@@ -822,6 +1006,7 @@ static const struct of_device_id fsl_qspi_dt_ids[] = {
        { .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, },
        { .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, },
        { .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, },
@@ -564,21 +526,21 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        { /* sentinel */ }
  };
  MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids);
-@@ -835,8 +1037,12 @@ static int fsl_qspi_read_reg(struct spi_
+@@ -835,8 +1020,12 @@ static int fsl_qspi_read_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
  {
        int ret;
        struct fsl_qspi *q = nor->priv;
 +      u32 to = 0;
-+
-+      if (opcode == SPINOR_OP_SPANSION_RDAR)
-+              u8tou32(&to, nor->cmd_buf, 4);
  
 -      ret = fsl_qspi_runcmd(q, opcode, 0, len);
++      if (opcode == SPINOR_OP_SPANSION_RDAR)
++              u8tou32(&to, nor->cmd_buf, 4);
++
 +      ret = fsl_qspi_runcmd(q, opcode, to, len);
        if (ret)
                return ret;
  
-@@ -848,9 +1054,13 @@ static int fsl_qspi_write_reg(struct spi
+@@ -848,9 +1037,13 @@ static int fsl_qspi_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
  {
        struct fsl_qspi *q = nor->priv;
        int ret;
@@ -593,7 +555,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                if (ret)
                        return ret;
  
-@@ -859,7 +1069,7 @@ static int fsl_qspi_write_reg(struct spi
+@@ -859,7 +1052,7 @@ static int fsl_qspi_write_reg(struct spi_nor *nor, u8 opcode, u8 *buf, int len)
  
        } else if (len > 0) {
                ret = fsl_qspi_nor_write(q, nor, opcode, 0,
@@ -602,7 +564,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                if (ret > 0)
                        return 0;
        } else {
-@@ -875,7 +1085,7 @@ static ssize_t fsl_qspi_write(struct spi
+@@ -875,7 +1068,7 @@ static ssize_t fsl_qspi_write(struct spi_nor *nor, loff_t to,
  {
        struct fsl_qspi *q = nor->priv;
        ssize_t ret = fsl_qspi_nor_write(q, nor, nor->program_opcode, to,
@@ -611,7 +573,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /* invalid the data in the AHB buffer. */
        fsl_qspi_invalid(q);
-@@ -922,7 +1132,7 @@ static ssize_t fsl_qspi_read(struct spi_
+@@ -922,7 +1115,7 @@ static ssize_t fsl_qspi_read(struct spi_nor *nor, loff_t from,
                len);
  
        /* Read out the data directly from the AHB buffer.*/
@@ -620,7 +582,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                len);
  
        return len;
-@@ -980,6 +1190,8 @@ static int fsl_qspi_probe(struct platfor
+@@ -980,6 +1173,8 @@ static int fsl_qspi_probe(struct platform_device *pdev)
        struct spi_nor *nor;
        struct mtd_info *mtd;
        int ret, i = 0;
@@ -629,7 +591,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL);
        if (!q)
-@@ -1027,6 +1239,12 @@ static int fsl_qspi_probe(struct platfor
+@@ -1027,6 +1222,12 @@ static int fsl_qspi_probe(struct platform_device *pdev)
                goto clk_failed;
        }
  
@@ -642,7 +604,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        /* find the irq */
        ret = platform_get_irq(pdev, 0);
        if (ret < 0) {
-@@ -1050,6 +1268,7 @@ static int fsl_qspi_probe(struct platfor
+@@ -1050,6 +1251,7 @@ static int fsl_qspi_probe(struct platform_device *pdev)
  
        mutex_init(&q->lock);
  
@@ -650,7 +612,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        /* iterate the subnodes. */
        for_each_available_child_of_node(dev->of_node, np) {
                /* skip the holes */
-@@ -1076,18 +1295,25 @@ static int fsl_qspi_probe(struct platfor
+@@ -1076,18 +1278,25 @@ static int fsl_qspi_probe(struct platform_device *pdev)
                ret = of_property_read_u32(np, "spi-max-frequency",
                                &q->clk_rate);
                if (ret < 0)
@@ -680,7 +642,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
                /* Set the correct NOR size now. */
                if (q->nor_size == 0) {
-@@ -1110,8 +1336,12 @@ static int fsl_qspi_probe(struct platfor
+@@ -1110,8 +1319,12 @@ static int fsl_qspi_probe(struct platform_device *pdev)
                        nor->page_size = q->devtype_data->txfifo;
  
                i++;
@@ -693,6 +655,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        /* finish the rest init. */
        ret = fsl_qspi_nor_setup_last(q);
        if (ret)
+diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
+index 793d321d..190e0e45 100644
 --- a/drivers/mtd/spi-nor/spi-nor.c
 +++ b/drivers/mtd/spi-nor/spi-nor.c
 @@ -40,6 +40,13 @@
@@ -740,7 +704,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  static int read_cr(struct spi_nor *nor)
  {
-@@ -160,6 +170,8 @@ static inline int spi_nor_read_dummy_cyc
+@@ -160,6 +170,8 @@ static inline int spi_nor_read_dummy_cycles(struct spi_nor *nor)
        case SPI_NOR_DUAL:
        case SPI_NOR_QUAD:
                return 8;
@@ -749,7 +713,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        case SPI_NOR_NORMAL:
                return 0;
        }
-@@ -961,6 +973,8 @@ static const struct flash_info spi_nor_i
+@@ -961,6 +973,8 @@ static const struct flash_info spi_nor_ids[] = {
  
        /* ESMT */
        { "f25l32pa", INFO(0x8c2016, 0, 64 * 1024, 64, SECT_4K | SPI_NOR_HAS_LOCK) },
@@ -758,7 +722,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /* Everspin */
        { "mr25h256", CAT25_INFO( 32 * 1024, 1, 256, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) },
-@@ -1014,12 +1028,15 @@ static const struct flash_info spi_nor_i
+@@ -1014,12 +1028,15 @@ static const struct flash_info spi_nor_ids[] = {
        { "mx25l3205d",  INFO(0xc22016, 0, 64 * 1024,  64, SECT_4K) },
        { "mx25l3255e",  INFO(0xc29e16, 0, 64 * 1024,  64, SECT_4K) },
        { "mx25l6405d",  INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) },
@@ -775,7 +739,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) },
        { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_QUAD_READ) },
        { "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) },
-@@ -1033,10 +1050,11 @@ static const struct flash_info spi_nor_i
+@@ -1033,10 +1050,11 @@ static const struct flash_info spi_nor_ids[] = {
        { "n25q128a11",  INFO(0x20bb18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
        { "n25q128a13",  INFO(0x20ba18, 0, 64 * 1024,  256, SECT_4K | SPI_NOR_QUAD_READ) },
        { "n25q256a",    INFO(0x20ba19, 0, 64 * 1024,  512, SECT_4K | SPI_NOR_QUAD_READ) },
@@ -789,7 +753,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /* PMC */
        { "pm25lv512",   INFO(0,        0, 32 * 1024,    2, SECT_4K_PMC) },
-@@ -1054,8 +1072,11 @@ static const struct flash_info spi_nor_i
+@@ -1054,8 +1072,11 @@ static const struct flash_info spi_nor_ids[] = {
        { "s70fl01gs",  INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) },
        { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024,  64, 0) },
        { "s25sl12801", INFO(0x012018, 0x0301,  64 * 1024, 256, 0) },
@@ -802,7 +766,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        { "s25fl129p1", INFO(0x012018, 0x4d01,  64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
        { "s25sl004a",  INFO(0x010212,      0,  64 * 1024,   8, 0) },
        { "s25sl008a",  INFO(0x010213,      0,  64 * 1024,  16, 0) },
-@@ -1130,6 +1151,9 @@ static const struct flash_info spi_nor_i
+@@ -1130,6 +1151,9 @@ static const struct flash_info spi_nor_ids[] = {
        { "w25x80", INFO(0xef3014, 0, 64 * 1024,  16, SECT_4K) },
        { "w25x16", INFO(0xef3015, 0, 64 * 1024,  32, SECT_4K) },
        { "w25x32", INFO(0xef3016, 0, 64 * 1024,  64, SECT_4K) },
@@ -812,7 +776,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        { "w25q32", INFO(0xef4016, 0, 64 * 1024,  64, SECT_4K) },
        {
                "w25q32dw", INFO(0xef6016, 0, 64 * 1024,  64,
-@@ -1192,6 +1216,53 @@ static const struct flash_info *spi_nor_
+@@ -1192,6 +1216,53 @@ static const struct flash_info *spi_nor_read_id(struct spi_nor *nor)
                id[0], id[1], id[2]);
        return ERR_PTR(-ENODEV);
  }
@@ -866,7 +830,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len,
                        size_t *retlen, u_char *buf)
-@@ -1411,7 +1482,7 @@ static int macronix_quad_enable(struct s
+@@ -1411,7 +1482,7 @@ static int macronix_quad_enable(struct spi_nor *nor)
   * Write status Register and configuration register with 2 bytes
   * The first byte will be written to the status register, while the
   * second byte will be written to the configuration register.
@@ -875,7 +839,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  static int write_sr_cr(struct spi_nor *nor, u16 val)
  {
-@@ -1459,6 +1530,24 @@ static int spansion_quad_enable(struct s
+@@ -1459,6 +1530,24 @@ static int spansion_quad_enable(struct spi_nor *nor)
        return 0;
  }
  
@@ -900,7 +864,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info)
  {
        int status;
-@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1604,9 +1693,25 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
                write_sr(nor, 0);
                spi_nor_wait_till_ready(nor);
        }
@@ -926,7 +890,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        mtd->priv = nor;
        mtd->type = MTD_NORFLASH;
        mtd->writesize = 1;
-@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1639,6 +1744,8 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
                nor->flags |= SNOR_F_USE_FSR;
        if (info->flags & SPI_NOR_HAS_TB)
                nor->flags |= SNOR_F_HAS_SR_TB;
@@ -935,7 +899,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS
        /* prefer "small sector" erase if possible */
-@@ -1676,9 +1783,15 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1676,9 +1783,15 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
        /* Some devices cannot do fast-read, no matter what DT tells us */
        if (info->flags & SPI_NOR_NO_FR)
                nor->flash_read = SPI_NOR_NORMAL;
@@ -954,7 +918,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                ret = set_quad_mode(nor, info);
                if (ret) {
                        dev_err(dev, "quad mode not supported\n");
-@@ -1691,6 +1804,9 @@ int spi_nor_scan(struct spi_nor *nor, co
+@@ -1691,6 +1804,9 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode)
  
        /* Default commands */
        switch (nor->flash_read) {
@@ -964,6 +928,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        case SPI_NOR_QUAD:
                nor->read_opcode = SPINOR_OP_READ_1_1_4;
                break;
+diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h
+index f2a71803..5003ff64 100644
 --- a/include/linux/mtd/spi-nor.h
 +++ b/include/linux/mtd/spi-nor.h
 @@ -31,10 +31,10 @@
@@ -1028,3 +994,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops);
        void (*unprepare)(struct spi_nor *nor, enum spi_nor_ops ops);
+-- 
+2.14.1
+
index 56c07c5..f048788 100644 (file)
@@ -1,4 +1,4 @@
-From 6fe4518adbbbab0404958db4aa95673d60174881 Mon Sep 17 00:00:00 2001
+From 3cd36deb674720ab34eabb9783648ed743e52121 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 11:58:03 +0800
 Subject: [PATCH] sdk_dpaa: support layerscape
@@ -18,15 +18,15 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.c |  180 +
  .../net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.h |   43 +
  drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c | 1213 ++++
- drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h |  698 ++
+ drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h |  687 ++
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_base.c    |  205 +
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_base.h    |   49 +
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c   | 1992 +++++
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h   |  237 +
- .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c  | 1811 +++++
+ .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c  | 1820 +++++
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.h  |  225 +
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_proxy.c   |  381 +
- .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c  | 1179 +++
+ .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c  | 1168 +++
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_sysfs.c   |  278 +
  .../ethernet/freescale/sdk_dpaa/dpaa_eth_trace.h   |  144 +
  .../net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c |  544 ++
@@ -41,24 +41,24 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../freescale/sdk_fman/Peripherals/FM/HC/Makefile  |   15 +
  .../freescale/sdk_fman/Peripherals/FM/HC/hc.c      | 1232 ++++
  .../freescale/sdk_fman/Peripherals/FM/MAC/Makefile |   28 +
- .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c  | 1464 ++++
+ .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c  | 1465 ++++
  .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.h  |  228 +
  .../sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.c    |   97 +
  .../sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.h    |   42 +
- .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c |  658 ++
- .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h |  225 +
+ .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c |  674 ++
+ .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h |  226 +
  .../sdk_fman/Peripherals/FM/MAC/fman_crc32.c       |  119 +
  .../sdk_fman/Peripherals/FM/MAC/fman_crc32.h       |   43 +
  .../sdk_fman/Peripherals/FM/MAC/fman_dtsec.c       |  845 +++
  .../Peripherals/FM/MAC/fman_dtsec_mii_acc.c        |  163 +
- .../sdk_fman/Peripherals/FM/MAC/fman_memac.c       |  511 ++
+ .../sdk_fman/Peripherals/FM/MAC/fman_memac.c       |  532 ++
  .../Peripherals/FM/MAC/fman_memac_mii_acc.c        |  213 +
  .../sdk_fman/Peripherals/FM/MAC/fman_tgec.c        |  367 +
- .../freescale/sdk_fman/Peripherals/FM/MAC/memac.c  | 1096 +++
+ .../freescale/sdk_fman/Peripherals/FM/MAC/memac.c  | 1153 +++
  .../freescale/sdk_fman/Peripherals/FM/MAC/memac.h  |  110 +
  .../sdk_fman/Peripherals/FM/MAC/memac_mii_acc.c    |   78 +
  .../sdk_fman/Peripherals/FM/MAC/memac_mii_acc.h    |   73 +
- .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.c   |  975 +++
+ .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.c   | 1017 +++
  .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.h   |  151 +
  .../sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.c     |  139 +
  .../sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.h     |   80 +
@@ -124,7 +124,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../sdk_fman/inc/Peripherals/crc_mac_addr_ext.h    |  364 +
  .../freescale/sdk_fman/inc/Peripherals/dpaa_ext.h  |  210 +
  .../freescale/sdk_fman/inc/Peripherals/fm_ext.h    | 1731 +++++
- .../sdk_fman/inc/Peripherals/fm_mac_ext.h          |  859 +++
+ .../sdk_fman/inc/Peripherals/fm_mac_ext.h          |  887 +++
  .../sdk_fman/inc/Peripherals/fm_macsec_ext.h       | 1271 ++++
  .../sdk_fman/inc/Peripherals/fm_muram_ext.h        |  170 +
  .../sdk_fman/inc/Peripherals/fm_pcd_ext.h          | 3974 ++++++++++
@@ -154,7 +154,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../freescale/sdk_fman/inc/flib/fsl_fman_dtsec.h   | 1096 +++
  .../sdk_fman/inc/flib/fsl_fman_dtsec_mii_acc.h     |  107 +
  .../freescale/sdk_fman/inc/flib/fsl_fman_kg.h      |  514 ++
- .../freescale/sdk_fman/inc/flib/fsl_fman_memac.h   |  427 ++
+ .../freescale/sdk_fman/inc/flib/fsl_fman_memac.h   |  434 ++
  .../sdk_fman/inc/flib/fsl_fman_memac_mii_acc.h     |   78 +
  .../freescale/sdk_fman/inc/flib/fsl_fman_port.h    |  593 ++
  .../freescale/sdk_fman/inc/flib/fsl_fman_prs.h     |  102 +
@@ -195,7 +195,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../freescale/sdk_fman/src/inc/system/sys_io_ext.h |   46 +
  .../freescale/sdk_fman/src/inc/types_linux.h       |  208 +
  .../sdk_fman/src/inc/wrapper/fsl_fman_test.h       |   84 +
- .../sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h      |  128 +
+ .../sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h      |  130 +
  .../sdk_fman/src/inc/wrapper/lnxwrp_fm_ext.h       |  163 +
  .../sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h     |  921 +++
  .../ethernet/freescale/sdk_fman/src/inc/xx/xx.h    |   50 +
@@ -206,7 +206,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.c     | 2908 ++++++++
  .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.h     |  294 +
  .../sdk_fman/src/wrapper/lnxwrp_fm_port.c          | 1480 ++++
- .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c        | 4813 +++++++++++++
+ .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c        | 4854 +++++++++++++
  .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c | 1297 ++++
  .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.h |  755 ++
  .../sdk_fman/src/wrapper/lnxwrp_resources.h        |  121 +
@@ -262,13 +262,13 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  include/uapi/linux/fmd/Peripherals/Kbuild          |    4 +
  include/uapi/linux/fmd/Peripherals/fm_ioctls.h     |  628 ++
  include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h | 3084 ++++++++
- .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h    |  948 +++
+ .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h    |  973 +++
  .../uapi/linux/fmd/Peripherals/fm_test_ioctls.h    |  208 +
  include/uapi/linux/fmd/integrations/Kbuild         |    1 +
  .../linux/fmd/integrations/integration_ioctls.h    |   56 +
  include/uapi/linux/fmd/ioctls.h                    |   96 +
  include/uapi/linux/fmd/net_ioctls.h                |  430 ++
- 257 files changed, 152931 insertions(+)
+ 257 files changed, 153159 insertions(+)
  create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/Kconfig
  create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/Makefile
  create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.c
@@ -527,6 +527,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  create mode 100644 include/uapi/linux/fmd/ioctls.h
  create mode 100644 include/uapi/linux/fmd/net_ioctls.h
 
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/Kconfig b/drivers/net/ethernet/freescale/sdk_dpaa/Kconfig
+new file mode 100644
+index 00000000..92118b76
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/Kconfig
 @@ -0,0 +1,173 @@
@@ -703,6 +706,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              # cat /sys/kernel/debug/powerpc/fsl_dpa/eth4_loop
 +                      4->5
 +endif # FSL_SDK_DPAA_ETH
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/Makefile b/drivers/net/ethernet/freescale/sdk_dpaa/Makefile
+new file mode 100644
+index 00000000..a0f4b190
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/Makefile
 @@ -0,0 +1,46 @@
@@ -752,6 +758,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +# Needed by the tracing framework
 +CFLAGS_dpaa_eth.o := -I$(src)
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.c
+new file mode 100644
+index 00000000..3bf8cbca
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.c
 @@ -0,0 +1,580 @@
@@ -1335,6 +1344,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      kfree(tsu);
 +}
 +EXPORT_SYMBOL(dpa_ptp_cleanup);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.h
+new file mode 100644
+index 00000000..73390168
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.h
 @@ -0,0 +1,138 @@
@@ -1476,6 +1488,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                              struct sk_buff *skb, void *data);
 +extern int dpa_ioctl_1588(struct net_device *dev, struct ifreq *ifr, int cmd);
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.c
+new file mode 100644
+index 00000000..25d9f5f1
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.c
 @@ -0,0 +1,180 @@
@@ -1659,6 +1674,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +{
 +      debugfs_remove(dpa_debugfs_root);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.h
+new file mode 100644
+index 00000000..63d35427
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.h
 @@ -0,0 +1,43 @@
@@ -1705,6 +1723,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +void __exit dpa_debugfs_module_exit(void);
 +
 +#endif /* DPAA_DEBUGFS_H_ */
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c
+new file mode 100644
+index 00000000..7026f916
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c
 @@ -0,0 +1,1213 @@
@@ -2921,9 +2942,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              KBUILD_BASENAME".c", __func__);
 +}
 +module_exit(dpa_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
+new file mode 100644
+index 00000000..57c9bef4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
-@@ -0,0 +1,698 @@
+@@ -0,0 +1,687 @@
 +/* Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
 + * Redistribution and use in source and binary forms, with or without
@@ -3440,17 +3464,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return fd->offset;
 +}
 +
-+/* Verifies if the skb length is below the interface MTU */
-+static inline int dpa_check_rx_mtu(struct sk_buff *skb, int mtu)
-+{
-+      if (unlikely(skb->len > mtu))
-+              if ((skb->protocol != htons(ETH_P_8021Q))
-+                              || (skb->len > mtu + 4))
-+                      return -1;
-+
-+      return 0;
-+}
-+
 +static inline uint16_t dpa_get_headroom(struct dpa_buffer_layout_s *bl)
 +{
 +      uint16_t headroom;
@@ -3622,6 +3635,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif  /* !CONFIG_PPC */
 +
 +#endif        /* __DPA_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_base.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_base.c
+new file mode 100644
+index 00000000..507e77c3
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_base.c
 @@ -0,0 +1,205 @@
@@ -3830,6 +3846,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +}
 +module_exit(dpa_advanced_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_base.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_base.h
+new file mode 100644
+index 00000000..6ec68c3c
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_base.h
 @@ -0,0 +1,49 @@
@@ -3882,6 +3901,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              size_t count);
 +
 +#endif /* __DPAA_ETH_BASE_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
+new file mode 100644
+index 00000000..cac613b7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c
 @@ -0,0 +1,1992 @@
@@ -5877,6 +5899,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +module_init(ceetm_register);
 +module_exit(ceetm_unregister);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h
+new file mode 100644
+index 00000000..63cc3475
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h
 @@ -0,0 +1,237 @@
@@ -6117,9 +6142,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +int __hot ceetm_tx(struct sk_buff *skb, struct net_device *net_dev);
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
+new file mode 100644
+index 00000000..19a8a3c3
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c
-@@ -0,0 +1,1811 @@
+@@ -0,0 +1,1820 @@
 +/* Copyright 2008-2013 Freescale Semiconductor, Inc.
 + *
 + * Redistribution and use in source and binary forms, with or without
@@ -6385,7 +6413,16 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +int dpa_change_mtu(struct net_device *net_dev, int new_mtu)
 +{
-+      const int max_mtu = dpa_get_max_mtu();
++      int max_mtu = dpa_get_max_mtu();
++
++#ifndef CONFIG_PPC
++      /* Due to the A010022 FMan errata, we can not use contig frames larger
++       * than 4K, nor S/G frames. We need to prevent the user from setting a
++       * large MTU.
++       */
++      if (unlikely(dpaa_errata_a010022))
++              max_mtu = DPA_BP_RAW_SIZE;
++#endif
 +
 +      /* Make sure we don't exceed the Ethernet controller's MAXFRM */
 +      if (new_mtu < 68 || new_mtu > max_mtu) {
@@ -7931,6 +7968,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +EXPORT_SYMBOL(dpa_disable_ceetm);
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h
+new file mode 100644
+index 00000000..41db4302
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h
 @@ -0,0 +1,225 @@
@@ -8159,6 +8199,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                    struct net_device *net_dev);
 +
 +#endif /* __DPAA_ETH_COMMON_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_proxy.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_proxy.c
+new file mode 100644
+index 00000000..994d38cd
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_proxy.c
 @@ -0,0 +1,381 @@
@@ -8543,9 +8586,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              KBUILD_BASENAME".c", __func__);
 +}
 +module_exit(dpa_proxy_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
+new file mode 100644
+index 00000000..32e62e6d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
-@@ -0,0 +1,1179 @@
+@@ -0,0 +1,1168 @@
 +/* Copyright 2012 Freescale Semiconductor Inc.
 + *
 + * Redistribution and use in source and binary forms, with or without
@@ -9164,13 +9210,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      (*count_ptr)--;
 +      skb->protocol = eth_type_trans(skb, net_dev);
 +
-+      /* IP Reassembled frames are allowed to be larger than MTU */
-+      if (unlikely(dpa_check_rx_mtu(skb, net_dev->mtu) &&
-+              !(fd_status & FM_FD_IPR))) {
-+              percpu_stats->rx_dropped++;
-+              goto drop_bad_frame;
-+      }
-+
 +      skb_len = skb->len;
 +
 +#ifdef CONFIG_FSL_DPAA_DBG_LOOP
@@ -9203,10 +9242,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +packet_dropped:
 +      return;
 +
-+drop_bad_frame:
-+      dev_kfree_skb(skb);
-+      return;
-+
 +_release_frame:
 +      dpa_fd_release(net_dev, fd);
 +}
@@ -9725,6 +9760,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return NETDEV_TX_OK;
 +}
 +EXPORT_SYMBOL(dpa_tx_extended);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sysfs.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sysfs.c
+new file mode 100644
+index 00000000..3542d0b2
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sysfs.c
 @@ -0,0 +1,278 @@
@@ -10006,6 +10044,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      for (i = 0; i < ARRAY_SIZE(dpaa_eth_attrs); i++)
 +              device_remove_file(dev, &dpaa_eth_attrs[i]);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_trace.h b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_trace.h
+new file mode 100644
+index 00000000..30069ef9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_trace.h
 @@ -0,0 +1,144 @@
@@ -10153,6 +10194,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#undef TRACE_INCLUDE_FILE
 +#define TRACE_INCLUDE_FILE    dpaa_eth_trace
 +#include <trace/define_trace.h>
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c
+new file mode 100644
+index 00000000..4b784662
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c
 @@ -0,0 +1,544 @@
@@ -10700,6 +10744,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      .set_wol = dpa_set_wol,
 +#endif
 +};
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ptp.c b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ptp.c
+new file mode 100644
+index 00000000..f54a3d67
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_ptp.c
 @@ -0,0 +1,291 @@
@@ -10994,6 +11041,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      ptp_clock_unregister(clock);
 +}
 +module_exit(dpa_ptp_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c
+new file mode 100644
+index 00000000..2c5652d9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac-api.c
 @@ -0,0 +1,907 @@
@@ -11904,6 +11954,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      [XGMAC] = setup_xgmac,
 +      [MEMAC] = setup_memac
 +};
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/mac.c b/drivers/net/ethernet/freescale/sdk_dpaa/mac.c
+new file mode 100644
+index 00000000..60133b02
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac.c
 @@ -0,0 +1,489 @@
@@ -12396,6 +12449,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              KBUILD_BASENAME".c", __func__);
 +}
 +module_exit(mac_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/mac.h b/drivers/net/ethernet/freescale/sdk_dpaa/mac.h
+new file mode 100644
+index 00000000..b5288f2a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/mac.h
 @@ -0,0 +1,135 @@
@@ -12534,6 +12590,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +void get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause, bool *tx_pause);
 +
 +#endif        /* __MAC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/offline_port.c b/drivers/net/ethernet/freescale/sdk_dpaa/offline_port.c
+new file mode 100644
+index 00000000..fb084af5
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/offline_port.c
 @@ -0,0 +1,848 @@
@@ -13385,6 +13444,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              KBUILD_BASENAME".c", __func__);
 +}
 +module_exit(oh_port_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_dpaa/offline_port.h b/drivers/net/ethernet/freescale/sdk_dpaa/offline_port.h
+new file mode 100644
+index 00000000..432ee88d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_dpaa/offline_port.h
 @@ -0,0 +1,59 @@
@@ -13447,6 +13509,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +};
 +
 +#endif /* __OFFLINE_PORT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Kconfig b/drivers/net/ethernet/freescale/sdk_fman/Kconfig
+new file mode 100644
+index 00000000..d98c0989
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Kconfig
 @@ -0,0 +1,153 @@
@@ -13603,6 +13668,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +endif # FSL_SDK_FMAN
 +
 +endmenu
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Makefile
+new file mode 100644
+index 00000000..25ce7e6a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Makefile
 @@ -0,0 +1,11 @@
@@ -13617,6 +13685,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += etc/
 +obj-y         += Peripherals/FM/
 +obj-y         += src/
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/HC/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/HC/Makefile
+new file mode 100644
+index 00000000..d0e76727
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/HC/Makefile
 @@ -0,0 +1,15 @@
@@ -13635,6 +13706,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += fsl-ncsw-Hc.o
 +
 +fsl-ncsw-Hc-objs      :=   hc.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/HC/hc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/HC/hc.c
+new file mode 100644
+index 00000000..363c8f95
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/HC/hc.c
 @@ -0,0 +1,1232 @@
@@ -14870,6 +14944,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    t_FmHc *p_FmHc = (t_FmHc*)h_FmHc;
 +    return p_FmHc->h_HcPortDev;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/Makefile
+new file mode 100644
+index 00000000..f6b090da
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/Makefile
 @@ -0,0 +1,28 @@
@@ -14901,9 +14978,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +fsl-ncsw-MAC-objs       +=  memac.o memac_mii_acc.o fman_memac_mii_acc.o
 +endif
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c
+new file mode 100644
+index 00000000..38948f97
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c
-@@ -0,0 +1,1464 @@
+@@ -0,0 +1,1465 @@
 +/*
 + * Copyright 2008-2013 Freescale Semiconductor Inc.
 + *
@@ -16295,6 +16375,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    p_FmMacControllerDriver->f_FM_MAC_ResetCounters             = DtsecResetCounters;
 +    p_FmMacControllerDriver->f_FM_MAC_GetStatistics             = DtsecGetStatistics;
++    p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters            = NULL;
 +
 +    p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr             = DtsecModifyMacAddress;
 +    p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr            = DtsecAddHashMacAddress;
@@ -16368,6 +16449,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return p_Dtsec;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.h
+new file mode 100644
+index 00000000..c26f40cc
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.h
 @@ -0,0 +1,228 @@
@@ -16599,6 +16683,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __DTSEC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.c
+new file mode 100644
+index 00000000..87da25ff
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.c
 @@ -0,0 +1,97 @@
@@ -16699,6 +16786,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    return E_OK;
 +}
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.h
+new file mode 100644
+index 00000000..75cc658a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.h
 @@ -0,0 +1,42 @@
@@ -16744,9 +16834,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +t_Error DTSEC_MII_ReadPhyReg(t_Handle  h_Dtsec, uint8_t phyAddr, uint8_t reg, uint16_t *p_Data);
 +
 +#endif /* __DTSEC_MII_ACC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c
+new file mode 100644
+index 00000000..caf3940a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c
-@@ -0,0 +1,658 @@
+@@ -0,0 +1,674 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -17210,6 +17303,22 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +/* ......................................................................... */
 +
++t_Error FM_MAC_GetFrameSizeCounters(t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type)
++{
++    t_FmMacControllerDriver *p_FmMacControllerDriver = (t_FmMacControllerDriver *)h_FmMac;
++
++    SANITY_CHECK_RETURN_ERROR(p_FmMacControllerDriver, E_INVALID_HANDLE);
++
++    memset(p_FrameSizeCounters, 0, sizeof(t_FmMacFrameSizeCounters));
++
++    if (p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters)
++        return p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters(h_FmMac, p_FrameSizeCounters, type);
++
++    RETURN_ERROR(MINOR, E_NOT_SUPPORTED, NO_MSG);
++}
++
++/* ......................................................................... */
++
 +t_Error FM_MAC_ModifyMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr)
 +{
 +    t_FmMacControllerDriver *p_FmMacControllerDriver = (t_FmMacControllerDriver *)h_FmMac;
@@ -17405,9 +17514,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    RETURN_ERROR(MINOR, E_NOT_SUPPORTED, NO_MSG);
 +}
 +#endif /* (defined(DEBUG_ERRORS) && ... */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h
+new file mode 100644
+index 00000000..ba3b9133
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h
-@@ -0,0 +1,225 @@
+@@ -0,0 +1,226 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -17516,6 +17628,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    t_Error (*f_FM_MAC_ResetCounters) (t_Handle h_FmMac);
 +    t_Error (*f_FM_MAC_GetStatistics) (t_Handle h_FmMac, t_FmMacStatistics *p_Statistics);
++    t_Error (*f_FM_MAC_GetFrameSizeCounters) (t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type);
 +
 +    t_Error (*f_FM_MAC_ModifyMacAddr) (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
 +    t_Error (*f_FM_MAC_AddHashMacAddr) (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
@@ -17633,6 +17746,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MAC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_crc32.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_crc32.c
+new file mode 100644
+index 00000000..b6a4ca25
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_crc32.c
 @@ -0,0 +1,119 @@
@@ -17755,6 +17871,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      crc = get_mirror32(crc);
 +      return crc;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_crc32.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_crc32.h
+new file mode 100644
+index 00000000..6e32fdc6
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_crc32.h
 @@ -0,0 +1,43 @@
@@ -17801,6 +17920,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FMAN_CRC32_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_dtsec.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_dtsec.c
+new file mode 100644
+index 00000000..5b092865
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_dtsec.c
 @@ -0,0 +1,845 @@
@@ -18649,6 +18771,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      return ret_val;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_dtsec_mii_acc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_dtsec_mii_acc.c
+new file mode 100644
+index 00000000..8819f8fc
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_dtsec_mii_acc.c
 @@ -0,0 +1,163 @@
@@ -18815,9 +18940,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return 0;
 +}
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac.c
+new file mode 100644
+index 00000000..f31a92a2
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac.c
-@@ -0,0 +1,511 @@
+@@ -0,0 +1,532 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -19180,24 +19308,45 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    case E_MEMAC_COUNTER_R64:
 +        ret_val = GET_MEMAC_CNTR_64(r64);
 +        break;
++    case E_MEMAC_COUNTER_T64:
++        ret_val = GET_MEMAC_CNTR_64(t64);
++        break;
 +    case E_MEMAC_COUNTER_R127:
 +        ret_val = GET_MEMAC_CNTR_64(r127);
 +        break;
++    case E_MEMAC_COUNTER_T127:
++        ret_val = GET_MEMAC_CNTR_64(t127);
++        break;
 +    case E_MEMAC_COUNTER_R255:
 +        ret_val = GET_MEMAC_CNTR_64(r255);
 +        break;
++    case E_MEMAC_COUNTER_T255:
++        ret_val = GET_MEMAC_CNTR_64(t255);
++        break;
 +    case E_MEMAC_COUNTER_R511:
 +        ret_val = GET_MEMAC_CNTR_64(r511);
 +        break;
++    case E_MEMAC_COUNTER_T511:
++        ret_val = GET_MEMAC_CNTR_64(t511);
++        break;
 +    case E_MEMAC_COUNTER_R1023:
 +        ret_val = GET_MEMAC_CNTR_64(r1023);
 +        break;
++    case E_MEMAC_COUNTER_T1023:
++        ret_val = GET_MEMAC_CNTR_64(t1023);
++        break;
 +    case E_MEMAC_COUNTER_R1518:
 +        ret_val = GET_MEMAC_CNTR_64(r1518);
 +        break;
++    case E_MEMAC_COUNTER_T1518:
++        ret_val = GET_MEMAC_CNTR_64(t1518);
++        break;
 +    case E_MEMAC_COUNTER_R1519X:
 +        ret_val = GET_MEMAC_CNTR_64(r1519x);
 +        break;
++    case E_MEMAC_COUNTER_T1519X:
++        ret_val = GET_MEMAC_CNTR_64(t1519x);
++        break;
 +    case E_MEMAC_COUNTER_RFRG:
 +        ret_val = GET_MEMAC_CNTR_64(rfrg);
 +        break;
@@ -19329,6 +19478,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    cfg->debug_mode                   = FALSE;
 +    cfg->wake_on_lan        = FALSE;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac_mii_acc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac_mii_acc.c
+new file mode 100755
+index 00000000..ccda11ec
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac_mii_acc.c
 @@ -0,0 +1,213 @@
@@ -19545,6 +19697,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +/* ......................................................................... */
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_tgec.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_tgec.c
+new file mode 100644
+index 00000000..fff9d5de
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_tgec.c
 @@ -0,0 +1,367 @@
@@ -19915,9 +20070,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      iowrite32be(tmp, &regs->tx_ipg_len);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c
+new file mode 100644
+index 00000000..0f299e72
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c
-@@ -0,0 +1,1096 @@
+@@ -0,0 +1,1153 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -20513,6 +20671,62 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +/* ......................................................................... */
 +
++static t_Error MemacGetFrameSizeCounters(t_Handle h_Memac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type)
++{
++    t_Memac     *p_Memac = (t_Memac *)h_Memac;
++
++    SANITY_CHECK_RETURN_ERROR(p_Memac, E_NULL_POINTER);
++    SANITY_CHECK_RETURN_ERROR(!p_Memac->p_MemacDriverParam, E_INVALID_STATE);
++    SANITY_CHECK_RETURN_ERROR(p_FrameSizeCounters, E_NULL_POINTER);
++
++    switch (type)
++    {
++    case e_COMM_MODE_NONE:
++      break;
++
++    case e_COMM_MODE_RX:
++        p_FrameSizeCounters->count_pkts_64             = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R64);
++        p_FrameSizeCounters->count_pkts_65_to_127      = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R127);
++        p_FrameSizeCounters->count_pkts_128_to_255     = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R255);
++        p_FrameSizeCounters->count_pkts_256_to_511     = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R511);
++        p_FrameSizeCounters->count_pkts_512_to_1023    = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1023);
++        p_FrameSizeCounters->count_pkts_1024_to_1518   = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1518);
++        p_FrameSizeCounters->count_pkts_1519_to_1522   = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1519X);
++      break;
++
++    case e_COMM_MODE_TX:
++        p_FrameSizeCounters->count_pkts_64             = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T64);
++        p_FrameSizeCounters->count_pkts_65_to_127      = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T127);
++        p_FrameSizeCounters->count_pkts_128_to_255     = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T255);
++        p_FrameSizeCounters->count_pkts_256_to_511     = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T511);
++        p_FrameSizeCounters->count_pkts_512_to_1023    = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1023);
++        p_FrameSizeCounters->count_pkts_1024_to_1518   = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1518);
++        p_FrameSizeCounters->count_pkts_1519_to_1522   = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1519X);
++      break;
++
++    case e_COMM_MODE_RX_AND_TX:
++        p_FrameSizeCounters->count_pkts_64             = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R64)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T64);
++        p_FrameSizeCounters->count_pkts_65_to_127      = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R127)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T127);
++        p_FrameSizeCounters->count_pkts_128_to_255     = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R255)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T255);
++        p_FrameSizeCounters->count_pkts_256_to_511     = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R511)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T511);
++        p_FrameSizeCounters->count_pkts_512_to_1023    = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1023)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1023);
++        p_FrameSizeCounters->count_pkts_1024_to_1518   = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1518)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1518);
++        p_FrameSizeCounters->count_pkts_1519_to_1522   = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1519X)
++                                                       + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1519X);
++      break;
++    }
++
++    return E_OK;
++}
++
++/* ......................................................................... */
++
 +static t_Error MemacModifyMacAddress (t_Handle h_Memac, t_EnetAddr *p_EnetAddr)
 +{
 +    t_Memac     *p_Memac = (t_Memac *)h_Memac;
@@ -20945,6 +21159,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    p_FmMacControllerDriver->f_FM_MAC_ResetCounters             = MemacResetCounters;
 +    p_FmMacControllerDriver->f_FM_MAC_GetStatistics             = MemacGetStatistics;
++    p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters      = MemacGetFrameSizeCounters;
 +
 +    p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr             = MemacModifyMacAddress;
 +    p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr            = MemacAddHashMacAddress;
@@ -21014,6 +21229,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return p_Memac;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.h
+new file mode 100644
+index 00000000..2fd89dae
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.h
 @@ -0,0 +1,110 @@
@@ -21127,6 +21345,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MEMAC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac_mii_acc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac_mii_acc.c
+new file mode 100644
+index 00000000..56eaffbc
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac_mii_acc.c
 @@ -0,0 +1,78 @@
@@ -21208,6 +21429,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                                       p_Data,
 +                                       (enum enet_speed)ENET_SPEED_FROM_MODE(p_Memac->enetMode));
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac_mii_acc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac_mii_acc.h
+new file mode 100644
+index 00000000..325ec082
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac_mii_acc.h
 @@ -0,0 +1,73 @@
@@ -21284,9 +21508,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MEMAC_MII_ACC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.c
+new file mode 100644
+index 00000000..eb00759f
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.c
-@@ -0,0 +1,975 @@
+@@ -0,0 +1,1017 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -21727,6 +21954,47 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +/* ......................................................................... */
 +
++static t_Error TgecGetFrameSizeCounters(t_Handle h_Tgec, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type)
++{
++    t_Tgec              *p_Tgec = (t_Tgec *)h_Tgec;
++    struct tgec_regs    *p_TgecMemMap;
++
++    SANITY_CHECK_RETURN_ERROR(p_Tgec, E_NULL_POINTER);
++    SANITY_CHECK_RETURN_ERROR(!p_Tgec->p_TgecDriverParam, E_INVALID_STATE);
++    SANITY_CHECK_RETURN_ERROR(p_FrameSizeCounters, E_NULL_POINTER);
++
++    p_TgecMemMap = p_Tgec->p_MemMap;
++
++    switch (type)
++    {
++    case e_COMM_MODE_NONE:
++      break;
++
++    case e_COMM_MODE_RX:
++        p_FrameSizeCounters->count_pkts_64             = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R64);
++        p_FrameSizeCounters->count_pkts_65_to_127      = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R127);
++        p_FrameSizeCounters->count_pkts_128_to_255     = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R255);
++        p_FrameSizeCounters->count_pkts_256_to_511     = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R511);
++        p_FrameSizeCounters->count_pkts_512_to_1023    = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1023);
++        p_FrameSizeCounters->count_pkts_1024_to_1518   = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1518);
++        p_FrameSizeCounters->count_pkts_1519_to_1522   = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1519X);
++      break;
++
++    case e_COMM_MODE_TX:
++      //Tx counters not supported
++      break;
++
++    case e_COMM_MODE_RX_AND_TX:
++      //Tx counters not supported
++      break;
++    }
++
++    return E_OK;
++}
++
++
++/* ......................................................................... */
++
 +static t_Error TgecEnable1588TimeStamp(t_Handle h_Tgec)
 +{
 +    t_Tgec      *p_Tgec = (t_Tgec *)h_Tgec;
@@ -22194,6 +22462,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    p_FmMacControllerDriver->f_FM_MAC_ResetCounters             = TgecResetCounters;
 +    p_FmMacControllerDriver->f_FM_MAC_GetStatistics             = TgecGetStatistics;
++    p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters      = TgecGetFrameSizeCounters;
 +
 +    p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr             = TgecModifyMacAddress;
 +    p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr            = TgecAddHashMacAddress;
@@ -22262,6 +22531,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return p_Tgec;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.h
+new file mode 100644
+index 00000000..2aa39238
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.h
 @@ -0,0 +1,151 @@
@@ -22416,6 +22688,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __TGEC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.c
+new file mode 100644
+index 00000000..e0fafd1d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.c
 @@ -0,0 +1,139 @@
@@ -22558,6 +22833,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return E_OK;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.h
+new file mode 100644
+index 00000000..645cdde5
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.h
 @@ -0,0 +1,80 @@
@@ -22641,6 +22919,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __TGEC_MII_ACC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/Makefile
+new file mode 100644
+index 00000000..bfa02f5e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/Makefile
 @@ -0,0 +1,15 @@
@@ -22659,6 +22940,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += fsl-ncsw-macsec.o
 +
 +fsl-ncsw-macsec-objs  := fm_macsec.o fm_macsec_guest.o fm_macsec_master.o fm_macsec_secy.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec.c
+new file mode 100644
+index 00000000..0a1b31f1
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec.c
 @@ -0,0 +1,237 @@
@@ -22899,6 +23183,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    RETURN_ERROR(MINOR, E_NOT_SUPPORTED, NO_MSG);
 +}
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec.h
+new file mode 100644
+index 00000000..fbe51875
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec.h
 @@ -0,0 +1,203 @@
@@ -23105,6 +23392,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MACSEC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_guest.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_guest.c
+new file mode 100644
+index 00000000..31d789d0
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_guest.c
 @@ -0,0 +1,59 @@
@@ -23167,6 +23457,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    UNUSED(p_FmMacsecParam);
 +    return NULL;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_master.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_master.c
+new file mode 100644
+index 00000000..623612ac
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_master.c
 @@ -0,0 +1,1031 @@
@@ -24201,6 +24494,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    }
 +    return p_FmMacsec;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_master.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_master.h
+new file mode 100644
+index 00000000..2296a0f1
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_master.h
 @@ -0,0 +1,479 @@
@@ -24683,6 +24979,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MACSEC_MASTER_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_secy.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_secy.c
+new file mode 100644
+index 00000000..7c72dc98
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_secy.c
 @@ -0,0 +1,883 @@
@@ -25569,6 +25868,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    RETURN_ERROR(MINOR, E_NOT_SUPPORTED, NO_MSG);
 +}
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_secy.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_secy.h
+new file mode 100644
+index 00000000..0cf624e6
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MACSEC/fm_macsec_secy.h
 @@ -0,0 +1,144 @@
@@ -25716,6 +26018,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MACSEC_SECY_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Makefile
+new file mode 100644
+index 00000000..619f6608
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Makefile
 @@ -0,0 +1,23 @@
@@ -25742,6 +26047,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += HC/
 +obj-y         += Rtc/
 +obj-y         += MACSEC/
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/Makefile
+new file mode 100644
+index 00000000..62fbd73c
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/Makefile
 @@ -0,0 +1,26 @@
@@ -25771,6 +26079,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +fsl-ncsw-Pcd-objs     += fm_replic.o
 +endif
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/crc64.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/crc64.h
+new file mode 100644
+index 00000000..335ee681
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/crc64.h
 @@ -0,0 +1,360 @@
@@ -26134,6 +26445,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __CRC64_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.c
+new file mode 100644
+index 00000000..17c933b4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.c
 @@ -0,0 +1,7582 @@
@@ -33719,6 +34033,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return FM_PCD_MatchTableGetMissStatistics(h_HashBucket, p_MissStatistics);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.h
+new file mode 100644
+index 00000000..3456bb56
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.h
 @@ -0,0 +1,399 @@
@@ -34121,6 +34438,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_CC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c
+new file mode 100644
+index 00000000..f183d2f9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c
 @@ -0,0 +1,3242 @@
@@ -37366,6 +37686,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +        WRITE_UINT32(p_Regs->fmkg_gdv1r,value);
 +    return E_OK;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.h
+new file mode 100644
+index 00000000..cb7521a1
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.h
 @@ -0,0 +1,206 @@
@@ -37575,6 +37898,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_KG_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.c
+new file mode 100644
+index 00000000..113777e5
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.c
 @@ -0,0 +1,5571 @@
@@ -43149,6 +43475,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    return p_Manip;
 +}
 +#endif /* (defined(FM_CAPWAP_SUPPORT) && (DPAA_VERSION == 10)) */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.h
+new file mode 100644
+index 00000000..853bb834
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.h
 @@ -0,0 +1,555 @@
@@ -43707,6 +44036,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MANIP_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd.c
+new file mode 100644
+index 00000000..91f70a1a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd.c
 @@ -0,0 +1,2095 @@
@@ -45805,6 +46137,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    return FmHcGetPort(p_FmPcd->h_Hc);
 +}
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd.h
+new file mode 100644
+index 00000000..27ec9c5b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd.h
 @@ -0,0 +1,543 @@
@@ -46351,6 +46686,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PCD_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd_ipc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd_ipc.h
+new file mode 100644
+index 00000000..325d3e33
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_pcd_ipc.h
 @@ -0,0 +1,280 @@
@@ -46634,6 +46972,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PCD_IPC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_plcr.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_plcr.c
+new file mode 100644
+index 00000000..e3753305
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_plcr.c
 @@ -0,0 +1,1847 @@
@@ -48484,6 +48825,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return E_OK;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_plcr.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_plcr.h
+new file mode 100644
+index 00000000..2bb8b969
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_plcr.h
 @@ -0,0 +1,165 @@
@@ -48652,6 +48996,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PLCR_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_prs.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_prs.c
+new file mode 100644
+index 00000000..ff4f0a2f
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_prs.c
 @@ -0,0 +1,423 @@
@@ -49078,6 +49425,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return E_OK;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_prs.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_prs.h
+new file mode 100644
+index 00000000..056f225e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_prs.h
 @@ -0,0 +1,316 @@
@@ -49397,6 +49747,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    bitMask = 0x80000000>>prsPortId
 +
 +#endif /* __FM_PRS_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_replic.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_replic.c
+new file mode 100644
+index 00000000..ee82f730
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_replic.c
 @@ -0,0 +1,984 @@
@@ -50384,6 +50737,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +/*********************** End of API routines ************************/
 +
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_replic.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_replic.h
+new file mode 100644
+index 00000000..0e8e8bc0
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_replic.h
 @@ -0,0 +1,101 @@
@@ -50488,6 +50844,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_REPLIC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fman_kg.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fman_kg.c
+new file mode 100644
+index 00000000..49b86e8e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fman_kg.c
 @@ -0,0 +1,888 @@
@@ -51379,6 +51738,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      err = fman_kg_write_ar_wait(regs, tmp_reg);
 +      return err;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fman_prs.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fman_prs.c
+new file mode 100644
+index 00000000..108779db
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fman_prs.c
 @@ -0,0 +1,129 @@
@@ -51511,6 +51873,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      else
 +              iowrite32be(0, &regs->fmpr_ppsc);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/Makefile
+new file mode 100644
+index 00000000..7d928e0a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/Makefile
 @@ -0,0 +1,15 @@
@@ -51529,6 +51894,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += fsl-ncsw-Pcd.o
 +
 +fsl-ncsw-Pcd-objs     :=   fm_port.o fm_port_im.o fman_port.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c
+new file mode 100644
+index 00000000..ec6e0ed5
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c
 @@ -0,0 +1,6436 @@
@@ -57968,6 +58336,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    stats->snmpGetNextCnt = snmp_stats->snmpGetNextReqCnt;
 +    return E_OK;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.h
+new file mode 100644
+index 00000000..85986f55
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.h
 @@ -0,0 +1,999 @@
@@ -58970,6 +59341,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PORT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port_dsar.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port_dsar.h
+new file mode 100755
+index 00000000..95619eff
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port_dsar.h
 @@ -0,0 +1,494 @@
@@ -59467,6 +59841,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PORT_DSAR_H_ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port_im.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port_im.c
+new file mode 100644
+index 00000000..8de8f5fd
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port_im.c
 @@ -0,0 +1,753 @@
@@ -60223,6 +60600,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return FmPortImRx(p_FmPort);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fman_port.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fman_port.c
+new file mode 100755
+index 00000000..60acbf34
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fman_port.c
 @@ -0,0 +1,1568 @@
@@ -61794,6 +62174,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    }
 +    return 0;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/Makefile
+new file mode 100644
+index 00000000..d2c21d34
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/Makefile
 @@ -0,0 +1,15 @@
@@ -61812,6 +62195,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += fsl-ncsw-RTC.o
 +
 +fsl-ncsw-RTC-objs     :=   fm_rtc.o fman_rtc.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fm_rtc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fm_rtc.c
+new file mode 100644
+index 00000000..99de427b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fm_rtc.c
 @@ -0,0 +1,692 @@
@@ -62507,6 +62893,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return E_OK;
 +}
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fm_rtc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fm_rtc.h
+new file mode 100644
+index 00000000..843ca008
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fm_rtc.h
 @@ -0,0 +1,96 @@
@@ -62606,6 +62995,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_RTC_H__ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fman_rtc.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fman_rtc.c
+new file mode 100755
+index 00000000..acdf507e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Rtc/fman_rtc.c
 @@ -0,0 +1,334 @@
@@ -62943,6 +63335,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              fman_rtc_set_timer_ctrl(regs, fman_rtc_get_timer_ctrl(regs) | tmpReg);
 +      }
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/Makefile b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/Makefile
+new file mode 100644
+index 00000000..fae50ce4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/Makefile
 @@ -0,0 +1,15 @@
@@ -62961,6 +63356,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += fsl-ncsw-sp.o
 +
 +fsl-ncsw-sp-objs      := fm_sp.o fman_sp.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fm_sp.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fm_sp.c
+new file mode 100644
+index 00000000..0994f34d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fm_sp.c
 @@ -0,0 +1,757 @@
@@ -63721,6 +64119,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +
 +#endif /* (DPAA_VERSION >= 11) */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fm_sp.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fm_sp.h
+new file mode 100644
+index 00000000..9c171d85
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fm_sp.h
 @@ -0,0 +1,85 @@
@@ -63809,6 +64210,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_SP_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fman_sp.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fman_sp.c
+new file mode 100755
+index 00000000..0f772e91
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/SP/fman_sp.c
 @@ -0,0 +1,197 @@
@@ -64009,6 +64413,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    /* buffer margins - fill spliodn register */
 +    iowrite32be(liodn_offset, &sp_regs->fm_sp_spliodn);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c
+new file mode 100644
+index 00000000..a870b47e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c
 @@ -0,0 +1,5216 @@
@@ -69228,6 +69635,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      WRITE_UINT32(p_Fm->p_FmFpmRegs->fm_rcr, rcr);
 +}
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.h
+new file mode 100644
+index 00000000..0bded75d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.h
 @@ -0,0 +1,648 @@
@@ -69879,6 +70289,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm_ipc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm_ipc.h
+new file mode 100644
+index 00000000..7ce36a76
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm_ipc.h
 @@ -0,0 +1,465 @@
@@ -70347,6 +70760,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_IPC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm_muram.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm_muram.c
+new file mode 100644
+index 00000000..0bc67cb7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm_muram.c
 @@ -0,0 +1,174 @@
@@ -70524,6 +70940,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return MM_GetFreeMemSize(p_FmMuram->h_Mem);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fman.c b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fman.c
+new file mode 100755
+index 00000000..a41ecd04
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fman.c
 @@ -0,0 +1,1398 @@
@@ -71925,6 +72344,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      iowrite32be(tmp, &fpm_rg->fmfp_ee);
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_common.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_common.h
+new file mode 100644
+index 00000000..204840c9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_common.h
 @@ -0,0 +1,1214 @@
@@ -73142,6 +73564,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_COMMON_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_hc.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_hc.h
+new file mode 100644
+index 00000000..492aa8a3
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_hc.h
 @@ -0,0 +1,93 @@
@@ -73238,6 +73663,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_HC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_sp_common.h b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_sp_common.h
+new file mode 100644
+index 00000000..f9dd384b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/inc/fm_sp_common.h
 @@ -0,0 +1,117 @@
@@ -73358,6 +73786,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_SP_COMMON_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/Makefile b/drivers/net/ethernet/freescale/sdk_fman/etc/Makefile
+new file mode 100644
+index 00000000..d03a519c
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/Makefile
 @@ -0,0 +1,12 @@
@@ -73373,6 +73804,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += fsl-ncsw-etc.o
 +
 +fsl-ncsw-etc-objs     := mm.o memcpy.o sprint.o list.o error.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/error.c b/drivers/net/ethernet/freescale/sdk_fman/etc/error.c
+new file mode 100644
+index 00000000..fead7f50
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/error.c
 @@ -0,0 +1,95 @@
@@ -73471,6 +73905,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    return NULL;
 +}
 +#endif /* (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/list.c b/drivers/net/ethernet/freescale/sdk_fman/etc/list.c
+new file mode 100644
+index 00000000..2d044be2
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/list.c
 @@ -0,0 +1,71 @@
@@ -73545,6 +73982,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +    return numOfObjs;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/memcpy.c b/drivers/net/ethernet/freescale/sdk_fman/etc/memcpy.c
+new file mode 100644
+index 00000000..fa203ec7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/memcpy.c
 @@ -0,0 +1,620 @@
@@ -74168,6 +74608,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +        XX_Print("\r\n");
 +    }
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/mm.c b/drivers/net/ethernet/freescale/sdk_fman/etc/mm.c
+new file mode 100644
+index 00000000..9fcc46e0
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/mm.c
 @@ -0,0 +1,1155 @@
@@ -75326,6 +75769,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +        XX_Print("\n");
 +    }
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/mm.h b/drivers/net/ethernet/freescale/sdk_fman/etc/mm.h
+new file mode 100644
+index 00000000..43b2298f
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/mm.h
 @@ -0,0 +1,105 @@
@@ -75434,6 +75880,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MM_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/etc/sprint.c b/drivers/net/ethernet/freescale/sdk_fman/etc/sprint.c
+new file mode 100644
+index 00000000..46d2956a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/etc/sprint.c
 @@ -0,0 +1,81 @@
@@ -75518,6 +75967,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    return i;
 +}
 +#endif /* NCSW_VXWORKS */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/fmanv3h_dflags.h b/drivers/net/ethernet/freescale/sdk_fman/fmanv3h_dflags.h
+new file mode 100644
+index 00000000..435b0d2b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/fmanv3h_dflags.h
 @@ -0,0 +1,57 @@
@@ -75578,6 +76030,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define EVENT_GLOBAL_LEVEL  REPORT_LEVEL_MINOR
 +
 +#endif /* __dflags_h */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/fmanv3l_dflags.h b/drivers/net/ethernet/freescale/sdk_fman/fmanv3l_dflags.h
+new file mode 100644
+index 00000000..789eb879
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/fmanv3l_dflags.h
 @@ -0,0 +1,56 @@
@@ -75637,6 +76092,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define EVENT_GLOBAL_LEVEL  REPORT_LEVEL_MINOR
 +
 +#endif /* __dflags_h */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/crc_mac_addr_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/crc_mac_addr_ext.h
+new file mode 100644
+index 00000000..a84d5631
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/crc_mac_addr_ext.h
 @@ -0,0 +1,364 @@
@@ -76004,6 +76462,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __crc_mac_addr_ext_h */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/dpaa_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/dpaa_ext.h
+new file mode 100644
+index 00000000..e6d9e932
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/dpaa_ext.h
 @@ -0,0 +1,210 @@
@@ -76217,6 +76678,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __DPAA_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_ext.h
+new file mode 100644
+index 00000000..a8a64386
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_ext.h
 @@ -0,0 +1,1731 @@
@@ -77951,9 +78415,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_EXT */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_mac_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_mac_ext.h
+new file mode 100644
+index 00000000..be99b7c9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_mac_ext.h
-@@ -0,0 +1,859 @@
+@@ -0,0 +1,887 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -78153,6 +78620,19 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                                               - Other */
 +} t_FmMacStatistics;
 +
++/**************************************************************************//**
++ @Description   FM MAC Frame Size Counters
++*//***************************************************************************/
++typedef struct t_FmMacFrameSizeCounters {
++
++        uint64_t  count_pkts_64;            /**< 64 byte frame counter */
++        uint64_t  count_pkts_65_to_127;     /**< 65 to 127 byte frame counter */
++        uint64_t  count_pkts_128_to_255;    /**< 128 to 255 byte frame counter */
++        uint64_t  count_pkts_256_to_511;    /**< 256 to 511 byte frame counter */
++        uint64_t  count_pkts_512_to_1023;   /**< 512 to 1023 byte frame counter */
++        uint64_t  count_pkts_1024_to_1518;  /**< 1024 to 1518 byte frame counter */
++        uint64_t  count_pkts_1519_to_1522;  /**< 1519 to 1522 byte good frame count */
++} t_FmMacFrameSizeCounters;
 +
 +/**************************************************************************//**
 + @Group         FM_mac_init_grp FM MAC Initialization Unit
@@ -78610,6 +79090,21 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +t_Error FM_MAC_GetStatistics(t_Handle h_FmMac, t_FmMacStatistics *p_Statistics);
 +
 +/**************************************************************************//**
++ @Function      FM_MAC_GetFrameSizeCounters
++
++ @Description   get MAC statistics counters for different frame size
++
++ @Param[in]     h_FmMac       -  A handle to a FM MAC Module.
++ @Param[in]     p_FrameSizeCounters  -  Structure with counters
++ @Param[in]     type                                  -  Type of counters to be read
++
++ @Return        E_OK on success; Error code otherwise.
++
++ @Cautions      Allowed only following FM_Init().
++*//***************************************************************************/
++t_Error FM_MAC_GetFrameSizeCounters(t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type);
++
++/**************************************************************************//**
 + @Function      FM_MAC_ModifyMacAddr
 +
 + @Description   Replace the main MAC Address
@@ -78813,6 +79308,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MAC_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_macsec_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_macsec_ext.h
+new file mode 100644
+index 00000000..57925f10
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_macsec_ext.h
 @@ -0,0 +1,1271 @@
@@ -80087,6 +80585,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MACSEC_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_muram_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_muram_ext.h
+new file mode 100644
+index 00000000..ef62c8ef
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_muram_ext.h
 @@ -0,0 +1,170 @@
@@ -80260,6 +80761,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_MURAM_EXT */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_pcd_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_pcd_ext.h
+new file mode 100644
+index 00000000..8d1c3d88
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_pcd_ext.h
 @@ -0,0 +1,3974 @@
@@ -84237,6 +84741,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PCD_EXT */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_port_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_port_ext.h
+new file mode 100644
+index 00000000..08a5aa59
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_port_ext.h
 @@ -0,0 +1,2608 @@
@@ -86848,6 +87355,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_PORT_EXT */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_rtc_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_rtc_ext.h
+new file mode 100644
+index 00000000..72078ac4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_rtc_ext.h
 @@ -0,0 +1,619 @@
@@ -87470,6 +87980,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_RTC_EXT_H__ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_vsp_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_vsp_ext.h
+new file mode 100644
+index 00000000..f9aed036
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_vsp_ext.h
 @@ -0,0 +1,411 @@
@@ -87884,6 +88397,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_VSP_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/mii_acc_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/mii_acc_ext.h
+new file mode 100644
+index 00000000..f635d3c2
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/mii_acc_ext.h
 @@ -0,0 +1,76 @@
@@ -87963,6 +88479,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MII_ACC_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/core_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/core_ext.h
+new file mode 100644
+index 00000000..ec89a6dd
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/core_ext.h
 @@ -0,0 +1,90 @@
@@ -88056,6 +88575,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define fsl_mem_core_barrier() CORE_MemoryBarrier()
 +
 +#endif /* __CORE_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/cores/arm_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/cores/arm_ext.h
+new file mode 100644
+index 00000000..e63444a7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/cores/arm_ext.h
 @@ -0,0 +1,55 @@
@@ -88114,6 +88636,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +
 +#endif /* __PPC_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/cores/e500v2_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/cores/e500v2_ext.h
+new file mode 100644
+index 00000000..e79b1ddf
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/cores/e500v2_ext.h
 @@ -0,0 +1,476 @@
@@ -88593,6 +89118,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __E500V2_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/cores/ppc_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/cores/ppc_ext.h
+new file mode 100644
+index 00000000..9344b3a1
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/cores/ppc_ext.h
 @@ -0,0 +1,141 @@
@@ -88737,6 +89265,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PPC_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/ddr_std_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/ddr_std_ext.h
+new file mode 100644
+index 00000000..8bb343fc
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/ddr_std_ext.h
 @@ -0,0 +1,77 @@
@@ -88817,6 +89348,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#endif /* __DDR_SDT_EXT_H */
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/debug_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/debug_ext.h
+new file mode 100644
+index 00000000..57db0a14
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/debug_ext.h
 @@ -0,0 +1,233 @@
@@ -89053,6 +89587,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#endif /* __DEBUG_EXT_H */
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/endian_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/endian_ext.h
+new file mode 100644
+index 00000000..5cdec668
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/endian_ext.h
 @@ -0,0 +1,447 @@
@@ -89503,6 +90040,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#endif /* __ENDIAN_EXT_H */
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/enet_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/enet_ext.h
+new file mode 100644
+index 00000000..ef3bee55
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/enet_ext.h
 @@ -0,0 +1,205 @@
@@ -89711,6 +90251,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __ENET_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/error_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/error_ext.h
+new file mode 100644
+index 00000000..2a5ad67b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/error_ext.h
 @@ -0,0 +1,529 @@
@@ -90243,6 +90786,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif /* __ERROR_EXT_H */
 +
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/etc/list_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/list_ext.h
+new file mode 100644
+index 00000000..ee6b9f29
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/list_ext.h
 @@ -0,0 +1,358 @@
@@ -90604,6 +91150,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __LIST_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/etc/mem_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/mem_ext.h
+new file mode 100644
+index 00000000..d0565d41
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/mem_ext.h
 @@ -0,0 +1,318 @@
@@ -90925,6 +91474,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MEM_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/etc/memcpy_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/memcpy_ext.h
+new file mode 100644
+index 00000000..1b3a2fac
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/memcpy_ext.h
 @@ -0,0 +1,208 @@
@@ -91136,6 +91688,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MEMCPY_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/etc/mm_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/mm_ext.h
+new file mode 100644
+index 00000000..fa7c85e3
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/mm_ext.h
 @@ -0,0 +1,310 @@
@@ -91449,6 +92004,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +/** @} */ /* end of etc_id group */
 +
 +#endif /* __MM_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/etc/sprint_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/sprint_ext.h
+new file mode 100644
+index 00000000..52f7a9dc
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/etc/sprint_ext.h
 @@ -0,0 +1,118 @@
@@ -91570,6 +92128,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __SPRINT_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/common/arch/ppc_access.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/common/arch/ppc_access.h
+new file mode 100644
+index 00000000..c7b9b46f
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/common/arch/ppc_access.h
 @@ -0,0 +1,37 @@
@@ -91610,6 +92171,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#endif /* FL_E500_MACROS_H */
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/common/general.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/common/general.h
+new file mode 100644
+index 00000000..b3f516fb
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/common/general.h
 @@ -0,0 +1,52 @@
@@ -91665,6 +92229,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __GENERAL_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fman_common.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fman_common.h
+new file mode 100755
+index 00000000..8b194e99
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fman_common.h
 @@ -0,0 +1,78 @@
@@ -91746,6 +92313,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define NIA_BMI_AC_FETCH_ALL_FRAME              0x0000020c
 +
 +#endif /* __FMAN_COMMON_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_enet.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_enet.h
+new file mode 100644
+index 00000000..caa87fc6
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_enet.h
 @@ -0,0 +1,273 @@
@@ -92022,6 +92592,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      } while (0)
 +
 +#endif /* __FSL_ENET_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman.h
+new file mode 100755
+index 00000000..96a63fa7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman.h
 @@ -0,0 +1,825 @@
@@ -92850,6 +93423,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FSL_FMAN_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_dtsec.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_dtsec.h
+new file mode 100644
+index 00000000..6004e478
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_dtsec.h
 @@ -0,0 +1,1096 @@
@@ -93949,6 +94525,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FSL_FMAN_DTSEC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_dtsec_mii_acc.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_dtsec_mii_acc.h
+new file mode 100644
+index 00000000..0dda09c3
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_dtsec_mii_acc.h
 @@ -0,0 +1,107 @@
@@ -94059,6 +94638,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                      uint16_t dtsec_freq);
 +
 +#endif /* __FSL_FMAN_DTSEC_MII_ACC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_kg.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_kg.h
+new file mode 100644
+index 00000000..010e4b70
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_kg.h
 @@ -0,0 +1,514 @@
@@ -94576,9 +95158,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +
 +#endif /* __FSL_FMAN_KG_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac.h
+new file mode 100644
+index 00000000..058da159
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac.h
-@@ -0,0 +1,427 @@
+@@ -0,0 +1,434 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -94727,12 +95312,19 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +enum memac_counters {
 +      E_MEMAC_COUNTER_R64,
++      E_MEMAC_COUNTER_T64,
 +      E_MEMAC_COUNTER_R127,
++      E_MEMAC_COUNTER_T127,
 +      E_MEMAC_COUNTER_R255,
++      E_MEMAC_COUNTER_T255,
 +      E_MEMAC_COUNTER_R511,
++      E_MEMAC_COUNTER_T511,
 +      E_MEMAC_COUNTER_R1023,
++      E_MEMAC_COUNTER_T1023,
 +      E_MEMAC_COUNTER_R1518,
++      E_MEMAC_COUNTER_T1518,
 +      E_MEMAC_COUNTER_R1519X,
++      E_MEMAC_COUNTER_T1519X,
 +      E_MEMAC_COUNTER_RFRG,
 +      E_MEMAC_COUNTER_RJBR,
 +      E_MEMAC_COUNTER_RDRP,
@@ -95006,6 +95598,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /*__FSL_FMAN_MEMAC_H*/
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac_mii_acc.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac_mii_acc.h
+new file mode 100755
+index 00000000..b4304450
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac_mii_acc.h
 @@ -0,0 +1,78 @@
@@ -95087,6 +95682,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      enum enet_speed enet_speed);
 +
 +#endif /* __MAC_API_MEMAC_MII_ACC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_port.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_port.h
+new file mode 100755
+index 00000000..080a23e9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_port.h
 @@ -0,0 +1,593 @@
@@ -95683,6 +96281,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FSL_FMAN_PORT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_prs.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_prs.h
+new file mode 100644
+index 00000000..b18997dc
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_prs.h
 @@ -0,0 +1,102 @@
@@ -95788,6 +96389,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +void fman_prs_set_stst_port_msk(struct fman_prs_regs *regs, uint32_t pid_msk);
 +void fman_prs_set_stst(struct fman_prs_regs *regs, bool enable);
 +#endif /* __FSL_FMAN_PRS_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_rtc.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_rtc.h
+new file mode 100755
+index 00000000..f6b69a1f
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_rtc.h
 @@ -0,0 +1,449 @@
@@ -96240,6 +96844,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +};
 +
 +#endif /* __FSL_FMAN_RTC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_sp.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_sp.h
+new file mode 100755
+index 00000000..f8ef7d56
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_sp.h
 @@ -0,0 +1,138 @@
@@ -96381,6 +96988,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FSL_FMAN_SP_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_tgec.h b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_tgec.h
+new file mode 100644
+index 00000000..a0373141
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_tgec.h
 @@ -0,0 +1,479 @@
@@ -96863,6 +97473,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FSL_FMAN_TGEC_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/dpaa_integration_ext.h
+new file mode 100644
+index 00000000..0346cf60
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/dpaa_integration_ext.h
 @@ -0,0 +1,291 @@
@@ -97157,6 +97770,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define NUM_OF_SA_PER_TX_SC         2
 +
 +#endif /* __DPAA_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/part_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/part_ext.h
+new file mode 100644
+index 00000000..0d62dd15
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/part_ext.h
 @@ -0,0 +1,71 @@
@@ -97231,6 +97847,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/part_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/part_integration_ext.h
+new file mode 100644
+index 00000000..3254c766
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3H/part_integration_ext.h
 @@ -0,0 +1,304 @@
@@ -97538,6 +98157,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/dpaa_integration_ext.h
+new file mode 100644
+index 00000000..f7f8eb07
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/dpaa_integration_ext.h
 @@ -0,0 +1,293 @@
@@ -97834,6 +98456,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define NUM_OF_SA_PER_TX_SC         2
 +
 +#endif /* __DPAA_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/part_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/part_ext.h
+new file mode 100644
+index 00000000..ba9732ee
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/part_ext.h
 @@ -0,0 +1,59 @@
@@ -97896,6 +98521,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/part_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/part_integration_ext.h
+new file mode 100644
+index 00000000..3254c766
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/FMANV3L/part_integration_ext.h
 @@ -0,0 +1,304 @@
@@ -98203,6 +98831,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/dpaa_integration_ext.h
+new file mode 100644
+index 00000000..5a8f3583
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/dpaa_integration_ext.h
 @@ -0,0 +1,291 @@
@@ -98497,6 +99128,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define NUM_OF_SA_PER_TX_SC         2
 +
 +#endif /* __DPAA_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/part_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/part_ext.h
+new file mode 100644
+index 00000000..4787e19c
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/part_ext.h
 @@ -0,0 +1,64 @@
@@ -98564,6 +99198,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/part_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/part_integration_ext.h
+new file mode 100644
+index 00000000..85ba2a47
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/part_integration_ext.h
 @@ -0,0 +1,185 @@
@@ -98752,6 +99389,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/dpaa_integration_ext.h
+new file mode 100644
+index 00000000..7b5390de
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/dpaa_integration_ext.h
 @@ -0,0 +1,213 @@
@@ -98968,6 +99608,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __DPAA_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/part_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/part_ext.h
+new file mode 100644
+index 00000000..6814d5fb
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/part_ext.h
 @@ -0,0 +1,82 @@
@@ -99053,6 +99696,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/part_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/part_integration_ext.h
+new file mode 100644
+index 00000000..e838283d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P1023/part_integration_ext.h
 @@ -0,0 +1,635 @@
@@ -99691,6 +100337,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h
+new file mode 100644
+index 00000000..6e2b925f
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/dpaa_integration_ext.h
 @@ -0,0 +1,276 @@
@@ -99970,6 +100619,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __DPAA_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/part_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/part_ext.h
+new file mode 100644
+index 00000000..512f0baf
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/part_ext.h
 @@ -0,0 +1,83 @@
@@ -100056,6 +100708,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __PART_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/part_integration_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/part_integration_ext.h
+new file mode 100644
+index 00000000..03c59b8b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/P3040_P4080_P5020/part_integration_ext.h
 @@ -0,0 +1,336 @@
@@ -100395,6 +101050,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    { /* Port A */ 0xFFFFFFFF }
 +
 +#endif /* __PART_INTEGRATION_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/math_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/math_ext.h
+new file mode 100644
+index 00000000..4ecfc6ed
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/math_ext.h
 @@ -0,0 +1,100 @@
@@ -100498,6 +101156,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __MATH_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/ncsw_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/ncsw_ext.h
+new file mode 100644
+index 00000000..dc32e249
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/ncsw_ext.h
 @@ -0,0 +1,435 @@
@@ -100936,6 +101597,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __NCSW_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/net_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/net_ext.h
+new file mode 100644
+index 00000000..8f3bc369
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/net_ext.h
 @@ -0,0 +1,430 @@
@@ -101369,6 +102033,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __NET_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/std_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/std_ext.h
+new file mode 100644
+index 00000000..d91e6fdd
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/std_ext.h
 @@ -0,0 +1,48 @@
@@ -101420,6 +102087,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __STD_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/stdarg_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/stdarg_ext.h
+new file mode 100644
+index 00000000..3c8bb0a0
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/stdarg_ext.h
 @@ -0,0 +1,49 @@
@@ -101472,6 +102142,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __STDARG_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/stdlib_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/stdlib_ext.h
+new file mode 100644
+index 00000000..a47860cf
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/stdlib_ext.h
 @@ -0,0 +1,162 @@
@@ -101637,6 +102310,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __STDLIB_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/string_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/string_ext.h
+new file mode 100644
+index 00000000..a5c6c7e0
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/string_ext.h
 @@ -0,0 +1,56 @@
@@ -101696,6 +102372,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __STRING_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/types_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/types_ext.h
+new file mode 100644
+index 00000000..8c87edb7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/types_ext.h
 @@ -0,0 +1,62 @@
@@ -101761,6 +102440,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif /* defined (__ROCOO__) */
 +
 +#endif /* __TYPES_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/xx_common.h b/drivers/net/ethernet/freescale/sdk_fman/inc/xx_common.h
+new file mode 100644
+index 00000000..8e81094b
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/xx_common.h
 @@ -0,0 +1,56 @@
@@ -101820,6 +102502,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define MODULE_FM_SP            0x00080000
 +#define MODULE_FM_MACSEC        0x00090000
 +#endif /* __XX_COMMON_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/inc/xx_ext.h b/drivers/net/ethernet/freescale/sdk_fman/inc/xx_ext.h
+new file mode 100644
+index 00000000..21b62d0a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/xx_ext.h
 @@ -0,0 +1,791 @@
@@ -102614,6 +103299,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __XX_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/ls1043_dflags.h b/drivers/net/ethernet/freescale/sdk_fman/ls1043_dflags.h
+new file mode 100644
+index 00000000..c3a5a623
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/ls1043_dflags.h
 @@ -0,0 +1,56 @@
@@ -102673,6 +103361,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define EVENT_GLOBAL_LEVEL  REPORT_LEVEL_MINOR
 +
 +#endif /* __dflags_h */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk b/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk
+new file mode 100644
+index 00000000..586f9c79
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/ncsw_config.mk
 @@ -0,0 +1,53 @@
@@ -102729,6 +103420,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +ccflags-y += -I$(srctree)/include/uapi/linux/fmd
 +ccflags-y += -I$(srctree)/include/uapi/linux/fmd/Peripherals
 +ccflags-y += -I$(srctree)/include/uapi/linux/fmd/integrations
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/p1023_dflags.h b/drivers/net/ethernet/freescale/sdk_fman/p1023_dflags.h
+new file mode 100644
+index 00000000..b48819d7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/p1023_dflags.h
 @@ -0,0 +1,65 @@
@@ -102797,6 +103491,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __dflags_h */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/p3040_4080_5020_dflags.h b/drivers/net/ethernet/freescale/sdk_fman/p3040_4080_5020_dflags.h
+new file mode 100644
+index 00000000..74389742
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/p3040_4080_5020_dflags.h
 @@ -0,0 +1,62 @@
@@ -102862,6 +103559,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __dflags_h */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/Makefile b/drivers/net/ethernet/freescale/sdk_fman/src/Makefile
+new file mode 100644
+index 00000000..49405d0e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/Makefile
 @@ -0,0 +1,11 @@
@@ -102876,6 +103576,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +obj-y         += system/
 +obj-y         += wrapper/
 +obj-y         += xx/
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/system/sys_ext.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/system/sys_ext.h
+new file mode 100644
+index 00000000..20f27d29
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/system/sys_ext.h
 @@ -0,0 +1,118 @@
@@ -102997,6 +103700,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +        } else
 +
 +#endif /* __SYS_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/system/sys_io_ext.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/system/sys_io_ext.h
+new file mode 100644
+index 00000000..d6aa9d41
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/system/sys_io_ext.h
 @@ -0,0 +1,46 @@
@@ -103046,6 +103752,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __SYS_IO_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/types_linux.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/types_linux.h
+new file mode 100644
+index 00000000..201ad699
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/types_linux.h
 @@ -0,0 +1,208 @@
@@ -103257,6 +103966,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __TYPES_LINUX_H__ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/fsl_fman_test.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/fsl_fman_test.h
+new file mode 100644
+index 00000000..0466a473
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/fsl_fman_test.h
 @@ -0,0 +1,84 @@
@@ -103344,9 +104056,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define FMAN_TEST_MAX_TX_FQS 8
 +
 +#endif /* __FSL_FMAN_TEST_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h
+new file mode 100644
+index 00000000..dd0f03ac
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h
-@@ -0,0 +1,128 @@
+@@ -0,0 +1,130 @@
 +/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
 + * All rights reserved.
 + *
@@ -103472,9 +104187,14 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +/* FMAN MAC exported routines */
 +EXPORT_SYMBOL(FM_MAC_GetStatistics);
 +
++EXPORT_SYMBOL(FM_MAC_GetFrameSizeCounters);
++
 +EXPORT_SYMBOL(FM_GetSpecialOperationCoding);
 +
 +#endif /* __LNXWRP_EXP_SYM_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fm_ext.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fm_ext.h
+new file mode 100644
+index 00000000..a72c8670
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fm_ext.h
 @@ -0,0 +1,163 @@
@@ -103641,6 +104361,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __LNXWRP_FM_EXT_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h
+new file mode 100644
+index 00000000..c50031cf
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h
 @@ -0,0 +1,921 @@
@@ -104565,6 +105288,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define DPA_PTP_NOMINAL_FREQ_PERIOD_NS (1 << DPA_PTP_NOMINAL_FREQ_PERIOD_SHIFT) /* 4ns,250MHz */
 +
 +#endif /* __LNXWRP_FSL_FMAN_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/inc/xx/xx.h b/drivers/net/ethernet/freescale/sdk_fman/src/inc/xx/xx.h
+new file mode 100644
+index 00000000..b183c86d
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/xx/xx.h
 @@ -0,0 +1,50 @@
@@ -104618,6 +105344,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __XX_H */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/system/Makefile b/drivers/net/ethernet/freescale/sdk_fman/src/system/Makefile
+new file mode 100644
+index 00000000..667cd859
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/system/Makefile
 @@ -0,0 +1,10 @@
@@ -104631,6 +105360,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#
 +
 +obj-y         += sys_io.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/system/sys_io.c b/drivers/net/ethernet/freescale/sdk_fman/src/system/sys_io.c
+new file mode 100644
+index 00000000..c106a8b7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/system/sys_io.c
 @@ -0,0 +1,171 @@
@@ -104805,6 +105537,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +        return (uint64_t)(addr - p_IoMap->virtAddr + p_IoMap->physAddr);
 +    return (uint64_t)virt_to_phys(UINT_TO_PTR(addr));
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/Makefile b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/Makefile
+new file mode 100644
+index 00000000..62713d62
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/Makefile
 @@ -0,0 +1,19 @@
@@ -104827,6 +105562,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +fsl-ncsw-PFM-objs     :=      lnxwrp_fm.o lnxwrp_fm_port.o lnxwrp_ioctls_fm.o \
 +                              lnxwrp_sysfs.o lnxwrp_sysfs_fm.o lnxwrp_sysfs_fm_port.o 
 +obj-$(CONFIG_COMPAT)     +=   lnxwrp_ioctls_fm_compat.o
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/fman_test.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/fman_test.c
+new file mode 100644
+index 00000000..270d07b8
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/fman_test.c
 @@ -0,0 +1,1665 @@
@@ -106495,6 +107233,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +module_init(fmt_load);
 +module_exit(fmt_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
+new file mode 100755
+index 00000000..31f654b4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
 @@ -0,0 +1,2908 @@
@@ -109406,6 +110147,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +module_init (fm_load);
 +module_exit (fm_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.h
+new file mode 100644
+index 00000000..09832563
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.h
 @@ -0,0 +1,294 @@
@@ -109703,6 +110447,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +void LnxWrpPCDIOCTLEnumChecking(void);
 +
 +#endif /* __LNXWRP_FM_H__ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
+new file mode 100644
+index 00000000..00ab4bcb
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm_port.c
 @@ -0,0 +1,1480 @@
@@ -111186,9 +111933,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +module_init(fm_port_load);
 +module_exit(fm_port_unload);
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c
+new file mode 100644
+index 00000000..06833ba8
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c
-@@ -0,0 +1,4813 @@
+@@ -0,0 +1,4854 @@
 +/*
 + * Copyright 2008-2012 Freescale Semiconductor Inc.
 + *
@@ -115799,6 +116549,47 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +            break;
 +        }
 +
++        case FM_PORT_IOC_GET_MAC_FRAME_SIZE_COUNTERS:
++        {
++            t_LnxWrpFmDev *p_LnxWrpFmDev =
++                    (t_LnxWrpFmDev *)p_LnxWrpFmPortDev->h_LnxWrpFmDev;
++            ioc_fm_port_mac_frame_size_counters_t param;
++            t_FmMacFrameSizeCounters frameSizeCounters;
++            int mac_id = p_LnxWrpFmPortDev->id;
++
++            if (!p_LnxWrpFmDev)
++                RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!"));
++
++            if (&p_LnxWrpFmDev->txPorts[mac_id] != p_LnxWrpFmPortDev &&
++                &p_LnxWrpFmDev->rxPorts[mac_id] != p_LnxWrpFmPortDev)
++                mac_id += FM_MAX_NUM_OF_1G_MACS; /* 10G port */
++
++            if (!p_LnxWrpFmDev->macs[mac_id].h_Dev)
++                RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!"));
++
++            if (copy_from_user(&param, (ioc_fm_port_mac_frame_size_counters_t *)arg,
++                        sizeof(ioc_fm_port_mac_frame_size_counters_t)))
++                RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
++
++            if (FM_MAC_GetFrameSizeCounters(p_LnxWrpFmDev->macs[mac_id].h_Dev,
++                        &frameSizeCounters, param.type))
++                RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
++
++            param.count_pkts_64 = frameSizeCounters.count_pkts_64;
++            param.count_pkts_65_to_127 = frameSizeCounters.count_pkts_65_to_127;
++            param.count_pkts_128_to_255 = frameSizeCounters.count_pkts_128_to_255;
++            param.count_pkts_256_to_511 = frameSizeCounters.count_pkts_256_to_511;
++            param.count_pkts_512_to_1023 = frameSizeCounters.count_pkts_512_to_1023;
++            param.count_pkts_1024_to_1518 = frameSizeCounters.count_pkts_1024_to_1518;
++            param.count_pkts_1519_to_1522 = frameSizeCounters.count_pkts_1519_to_1522;
++
++            if (copy_to_user((ioc_fm_port_mac_frame_size_counters_t *)arg, &param,
++                        sizeof(ioc_fm_port_mac_frame_size_counters_t)))
++                RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG);
++
++            break;
++        }
++
 +        case FM_PORT_IOC_GET_BMI_COUNTERS:
 +        {
 +            t_LnxWrpFmDev *p_LnxWrpFmDev =
@@ -116002,6 +116793,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    .open =             fm_open,
 +    .release =          fm_close,
 +};
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c
+new file mode 100644
+index 00000000..322ae9ef
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c
 @@ -0,0 +1,1297 @@
@@ -117302,6 +118096,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    _fm_cpt_dbg (compat, " ...->}\n");
 +}
 +#endif /* (DPAA_VERSION >= 11) */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.h
+new file mode 100644
+index 00000000..187011f7
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.h
 @@ -0,0 +1,755 @@
@@ -118060,6 +118857,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +/* } pcd compat functions */
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources.h
+new file mode 100644
+index 00000000..1b72e1d5
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources.h
 @@ -0,0 +1,121 @@
@@ -118184,6 +118984,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* LNXWRP_RESOURCES_H_ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.c
+new file mode 100644
+index 00000000..6c06a5a6
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.c
 @@ -0,0 +1,191 @@
@@ -118378,6 +119181,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      return 0;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.h
+new file mode 100644
+index 00000000..063946eb
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.h
 @@ -0,0 +1,144 @@
@@ -118525,6 +119331,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +} _PackedType t_FmPrsResult;
 +
 +#endif
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.make b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.make
+new file mode 100644
+index 00000000..58009cd8
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_resources_ut.make
 @@ -0,0 +1,28 @@
@@ -118556,6 +119365,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +clean:
 +      rm -f *.o
 +      rm -f $(LNXWRP_RESS_UT)
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs.c
+new file mode 100644
+index 00000000..813771bf
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs.c
 @@ -0,0 +1,60 @@
@@ -118619,6 +119431,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      WARN(1, "FMD: Should never get here!");
 +      return 0;
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs.h
+new file mode 100644
+index 00000000..2098b244
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs.h
 @@ -0,0 +1,60 @@
@@ -118682,6 +119497,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                              uint8_t *offset);
 +
 +#endif /* LNXWRP_SYSFS_H_ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.c
+new file mode 100644
+index 00000000..1badbf98
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.c
 @@ -0,0 +1,1855 @@
@@ -120540,6 +121358,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      /* should never get here */
 +      return -EINVAL; /* counter not available */
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.h
+new file mode 100644
+index 00000000..137653e9
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.h
 @@ -0,0 +1,136 @@
@@ -120679,6 +121500,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      } while (0)
 +
 +#endif /* LNXWRP_SYSFS_FM_H_ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm_port.c b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm_port.c
+new file mode 100644
+index 00000000..db8e824c
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm_port.c
 @@ -0,0 +1,1268 @@
@@ -121950,6 +122774,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return n;
 +}
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm_port.h b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm_port.h
+new file mode 100644
+index 00000000..1e7636f4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm_port.h
 @@ -0,0 +1,56 @@
@@ -122009,6 +122836,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* LNXWRP_SYSFS_FM_PORT_H_ */
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/xx/Makefile b/drivers/net/ethernet/freescale/sdk_fman/src/xx/Makefile
+new file mode 100644
+index 00000000..1071c22a
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/xx/Makefile
 @@ -0,0 +1,18 @@
@@ -122030,6 +122860,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                              module_strings.o
 +endif
 +
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/xx/module_strings.c b/drivers/net/ethernet/freescale/sdk_fman/src/xx/module_strings.c
+new file mode 100644
+index 00000000..d7fed170
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/xx/module_strings.c
 @@ -0,0 +1,46 @@
@@ -122079,6 +122912,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +    "FM-SP",                    /* MODULE_FM_SP */
 +    "FM-MACSEC"                 /* MODULE_FM_MACSEC */
 +};
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/xx/xx_arm_linux.c b/drivers/net/ethernet/freescale/sdk_fman/src/xx/xx_arm_linux.c
+new file mode 100644
+index 00000000..dd3e376e
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/xx/xx_arm_linux.c
 @@ -0,0 +1,905 @@
@@ -122987,6 +123823,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +{
 +    xx_Free((void*)(*((uintptr_t *)(p) - 1)));
 +}
+diff --git a/drivers/net/ethernet/freescale/sdk_fman/src/xx/xx_linux.c b/drivers/net/ethernet/freescale/sdk_fman/src/xx/xx_linux.c
+new file mode 100644
+index 00000000..992757d4
 --- /dev/null
 +++ b/drivers/net/ethernet/freescale/sdk_fman/src/xx/xx_linux.c
 @@ -0,0 +1,918 @@
@@ -123908,6 +124747,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +{
 +    xx_Free((void*)(*((uintptr_t *)(p) - 1)));
 +}
+diff --git a/drivers/staging/fsl_qbman/Kconfig b/drivers/staging/fsl_qbman/Kconfig
+new file mode 100644
+index 00000000..93dcb7d3
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/Kconfig
 @@ -0,0 +1,228 @@
@@ -124139,6 +124981,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +endmenu
+diff --git a/drivers/staging/fsl_qbman/Makefile b/drivers/staging/fsl_qbman/Makefile
+new file mode 100644
+index 00000000..777d7d34
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/Makefile
 @@ -0,0 +1,28 @@
@@ -124170,6 +125015,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +# USDPAA
 +obj-$(CONFIG_FSL_USDPAA)      += fsl_usdpaa.o fsl_usdpaa_irq.o
+diff --git a/drivers/staging/fsl_qbman/bman_config.c b/drivers/staging/fsl_qbman/bman_config.c
+new file mode 100644
+index 00000000..bb397730
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_config.c
 @@ -0,0 +1,720 @@
@@ -124893,6 +125741,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +module_exit(bman_ctrl_exit);
 +
 +#endif /* CONFIG_SYSFS */
+diff --git a/drivers/staging/fsl_qbman/bman_debugfs.c b/drivers/staging/fsl_qbman/bman_debugfs.c
+new file mode 100644
+index 00000000..96909348
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_debugfs.c
 @@ -0,0 +1,119 @@
@@ -125015,6 +125866,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +module_init(bman_debugfs_module_init);
 +module_exit(bman_debugfs_module_exit);
 +MODULE_LICENSE("Dual BSD/GPL");
+diff --git a/drivers/staging/fsl_qbman/bman_driver.c b/drivers/staging/fsl_qbman/bman_driver.c
+new file mode 100644
+index 00000000..86fabef6
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_driver.c
 @@ -0,0 +1,575 @@
@@ -125593,6 +126447,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return;
 +}
 +#endif
+diff --git a/drivers/staging/fsl_qbman/bman_high.c b/drivers/staging/fsl_qbman/bman_high.c
+new file mode 100644
+index 00000000..c066602d
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_high.c
 @@ -0,0 +1,1145 @@
@@ -126741,6 +127598,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +{
 +      return portal->sharing_redirect ? NULL : portal->config;
 +}
+diff --git a/drivers/staging/fsl_qbman/bman_low.h b/drivers/staging/fsl_qbman/bman_low.h
+new file mode 100644
+index 00000000..3da70571
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_low.h
 @@ -0,0 +1,565 @@
@@ -127309,6 +128169,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      }
 +      return 0;
 +}
+diff --git a/drivers/staging/fsl_qbman/bman_private.h b/drivers/staging/fsl_qbman/bman_private.h
+new file mode 100644
+index 00000000..64eefe7d
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_private.h
 @@ -0,0 +1,166 @@
@@ -127478,6 +128341,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* CONFIG_FSL_BMAN_CONFIG */
+diff --git a/drivers/staging/fsl_qbman/bman_test.c b/drivers/staging/fsl_qbman/bman_test.c
+new file mode 100644
+index 00000000..db5b7fd3
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_test.c
 @@ -0,0 +1,56 @@
@@ -127537,6 +128403,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +module_init(test_init);
 +module_exit(test_exit);
+diff --git a/drivers/staging/fsl_qbman/bman_test.h b/drivers/staging/fsl_qbman/bman_test.h
+new file mode 100644
+index 00000000..fcd65056
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_test.h
 @@ -0,0 +1,44 @@
@@ -127584,6 +128453,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +void bman_test_high(void);
 +void bman_test_thresh(void);
+diff --git a/drivers/staging/fsl_qbman/bman_test_high.c b/drivers/staging/fsl_qbman/bman_test_high.c
+new file mode 100644
+index 00000000..1617a531
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_test_high.c
 @@ -0,0 +1,183 @@
@@ -127770,6 +128642,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      bman_free_pool(pool);
 +      pr_info("BMAN:  --- finished high-level test ---\n");
 +}
+diff --git a/drivers/staging/fsl_qbman/bman_test_thresh.c b/drivers/staging/fsl_qbman/bman_test_thresh.c
+new file mode 100644
+index 00000000..67093693
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/bman_test_thresh.c
 @@ -0,0 +1,196 @@
@@ -127969,6 +128844,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      pr_info("bman_test_thresh: done\n");
 +}
+diff --git a/drivers/staging/fsl_qbman/dpa_alloc.c b/drivers/staging/fsl_qbman/dpa_alloc.c
+new file mode 100644
+index 00000000..44db3e1e
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/dpa_alloc.c
 @@ -0,0 +1,706 @@
@@ -128678,6 +129556,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      spin_unlock_irq(&list_head->lock);
 +      return res;
 +}
+diff --git a/drivers/staging/fsl_qbman/dpa_sys.h b/drivers/staging/fsl_qbman/dpa_sys.h
+new file mode 100644
+index 00000000..e144f5a4
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/dpa_sys.h
 @@ -0,0 +1,259 @@
@@ -128940,6 +129821,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                           void **iir_reg);
 +#endif
 +#endif /* DPA_SYS_H */
+diff --git a/drivers/staging/fsl_qbman/dpa_sys_arm.h b/drivers/staging/fsl_qbman/dpa_sys_arm.h
+new file mode 100644
+index 00000000..17c5500e
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/dpa_sys_arm.h
 @@ -0,0 +1,95 @@
@@ -129038,6 +129922,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#define hard_smp_processor_id() raw_smp_processor_id()
 +#endif
+diff --git a/drivers/staging/fsl_qbman/dpa_sys_arm64.h b/drivers/staging/fsl_qbman/dpa_sys_arm64.h
+new file mode 100644
+index 00000000..247c8d97
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/dpa_sys_arm64.h
 @@ -0,0 +1,102 @@
@@ -129143,6 +130030,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif
+diff --git a/drivers/staging/fsl_qbman/dpa_sys_ppc32.h b/drivers/staging/fsl_qbman/dpa_sys_ppc32.h
+new file mode 100644
+index 00000000..874616df
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/dpa_sys_ppc32.h
 @@ -0,0 +1,70 @@
@@ -129216,6 +130106,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +
 +#endif
+diff --git a/drivers/staging/fsl_qbman/dpa_sys_ppc64.h b/drivers/staging/fsl_qbman/dpa_sys_ppc64.h
+new file mode 100644
+index 00000000..d9803199
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/dpa_sys_ppc64.h
 @@ -0,0 +1,79 @@
@@ -129298,6 +130191,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +
 +#endif
+diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa.c b/drivers/staging/fsl_qbman/fsl_usdpaa.c
+new file mode 100644
+index 00000000..3a6d3722
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/fsl_usdpaa.c
 @@ -0,0 +1,1983 @@
@@ -131284,6 +132180,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +MODULE_LICENSE("GPL");
 +MODULE_AUTHOR("Freescale Semiconductor");
 +MODULE_DESCRIPTION("Freescale USDPAA process driver");
+diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa_irq.c b/drivers/staging/fsl_qbman/fsl_usdpaa_irq.c
+new file mode 100644
+index 00000000..914c7471
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/fsl_usdpaa_irq.c
 @@ -0,0 +1,289 @@
@@ -131576,6 +132475,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +MODULE_LICENSE("GPL");
 +MODULE_AUTHOR("Freescale Semiconductor");
 +MODULE_DESCRIPTION("Freescale USDPAA process IRQ driver");
+diff --git a/drivers/staging/fsl_qbman/qbman_driver.c b/drivers/staging/fsl_qbman/qbman_driver.c
+new file mode 100644
+index 00000000..ab487d5f
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qbman_driver.c
 @@ -0,0 +1,88 @@
@@ -131667,6 +132569,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return 0;
 +}
 +subsys_initcall(qbman_init);
+diff --git a/drivers/staging/fsl_qbman/qman_config.c b/drivers/staging/fsl_qbman/qman_config.c
+new file mode 100644
+index 00000000..9bb1e11a
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_config.c
 @@ -0,0 +1,1224 @@
@@ -132894,6 +133799,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +module_exit(qman_ctrl_exit);
 +
 +#endif /* CONFIG_SYSFS */
+diff --git a/drivers/staging/fsl_qbman/qman_debugfs.c b/drivers/staging/fsl_qbman/qman_debugfs.c
+new file mode 100644
+index 00000000..fb8ecba1
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_debugfs.c
 @@ -0,0 +1,1594 @@
@@ -134491,6 +135399,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +module_init(qman_debugfs_module_init);
 +module_exit(qman_debugfs_module_exit);
 +MODULE_LICENSE("Dual BSD/GPL");
+diff --git a/drivers/staging/fsl_qbman/qman_driver.c b/drivers/staging/fsl_qbman/qman_driver.c
+new file mode 100644
+index 00000000..857ecd62
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_driver.c
 @@ -0,0 +1,977 @@
@@ -135471,6 +136382,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return;
 +}
 +#endif
+diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c
+new file mode 100644
+index 00000000..1651e62c
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_high.c
 @@ -0,0 +1,5669 @@
@@ -141143,6 +142057,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +{
 +      return portal->sharing_redirect ? NULL : portal->config;
 +}
+diff --git a/drivers/staging/fsl_qbman/qman_low.h b/drivers/staging/fsl_qbman/qman_low.h
+new file mode 100644
+index 00000000..547b5fa2
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_low.h
 @@ -0,0 +1,1427 @@
@@ -142573,6 +143490,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      }
 +      return -1;
 +}
+diff --git a/drivers/staging/fsl_qbman/qman_private.h b/drivers/staging/fsl_qbman/qman_private.h
+new file mode 100644
+index 00000000..ee025cff
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_private.h
 @@ -0,0 +1,398 @@
@@ -142974,6 +143894,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +void suspend_unused_qportal(void);
 +void resume_unused_qportal(void);
 +#endif
+diff --git a/drivers/staging/fsl_qbman/qman_test.c b/drivers/staging/fsl_qbman/qman_test.c
+new file mode 100644
+index 00000000..7995dd8c
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_test.c
 @@ -0,0 +1,57 @@
@@ -143034,6 +143957,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +module_init(test_init);
 +module_exit(test_exit);
+diff --git a/drivers/staging/fsl_qbman/qman_test.h b/drivers/staging/fsl_qbman/qman_test.h
+new file mode 100644
+index 00000000..8c4181c7
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_test.h
 @@ -0,0 +1,45 @@
@@ -143082,6 +144008,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +void qman_test_hotpotato(void);
 +void qman_test_high(void);
 +
+diff --git a/drivers/staging/fsl_qbman/qman_test_high.c b/drivers/staging/fsl_qbman/qman_test_high.c
+new file mode 100644
+index 00000000..65ee270e
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_test_high.c
 @@ -0,0 +1,216 @@
@@ -143301,6 +144230,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      retire_complete = 1;
 +      wake_up(&waitqueue);
 +}
+diff --git a/drivers/staging/fsl_qbman/qman_test_hotpotato.c b/drivers/staging/fsl_qbman/qman_test_hotpotato.c
+new file mode 100644
+index 00000000..899d2aa9
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_test_hotpotato.c
 @@ -0,0 +1,502 @@
@@ -143806,6 +144738,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      kmem_cache_destroy(hp_handler_slab);
 +      pr_info("qman_test_hotpotato finished\n");
 +}
+diff --git a/drivers/staging/fsl_qbman/qman_utility.c b/drivers/staging/fsl_qbman/qman_utility.c
+new file mode 100644
+index 00000000..f1e39023
 --- /dev/null
 +++ b/drivers/staging/fsl_qbman/qman_utility.c
 @@ -0,0 +1,129 @@
@@ -143938,6 +144873,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return pool->used;
 +}
 +EXPORT_SYMBOL(qman_fqid_pool_used);
+diff --git a/include/linux/fsl_bman.h b/include/linux/fsl_bman.h
+new file mode 100644
+index 00000000..43942221
 --- /dev/null
 +++ b/include/linux/fsl_bman.h
 @@ -0,0 +1,532 @@
@@ -144473,6 +145411,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* FSL_BMAN_H */
+diff --git a/include/linux/fsl_qman.h b/include/linux/fsl_qman.h
+new file mode 100644
+index 00000000..4e4b21d5
 --- /dev/null
 +++ b/include/linux/fsl_qman.h
 @@ -0,0 +1,3888 @@
@@ -148364,6 +149305,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* FSL_QMAN_H */
+diff --git a/include/linux/fsl_usdpaa.h b/include/linux/fsl_usdpaa.h
+new file mode 100644
+index 00000000..381853de
 --- /dev/null
 +++ b/include/linux/fsl_usdpaa.h
 @@ -0,0 +1,372 @@
@@ -148739,6 +149683,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* FSL_USDPAA_H */
+diff --git a/include/uapi/linux/fmd/Kbuild b/include/uapi/linux/fmd/Kbuild
+new file mode 100644
+index 00000000..56a20401
 --- /dev/null
 +++ b/include/uapi/linux/fmd/Kbuild
 @@ -0,0 +1,5 @@
@@ -148747,6 +149694,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +header-y += ioctls.h
 +header-y += net_ioctls.h
+diff --git a/include/uapi/linux/fmd/Peripherals/Kbuild b/include/uapi/linux/fmd/Peripherals/Kbuild
+new file mode 100644
+index 00000000..43883efe
 --- /dev/null
 +++ b/include/uapi/linux/fmd/Peripherals/Kbuild
 @@ -0,0 +1,4 @@
@@ -148754,6 +149704,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +header-y += fm_port_ioctls.h
 +header-y += fm_pcd_ioctls.h
 +header-y += fm_test_ioctls.h
+diff --git a/include/uapi/linux/fmd/Peripherals/fm_ioctls.h b/include/uapi/linux/fmd/Peripherals/fm_ioctls.h
+new file mode 100644
+index 00000000..e0c2dd31
 --- /dev/null
 +++ b/include/uapi/linux/fmd/Peripherals/fm_ioctls.h
 @@ -0,0 +1,628 @@
@@ -149385,6 +150338,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define FMD_API_VERSION_RESPIN 0
 +
 +#endif /* __FM_IOCTLS_H */
+diff --git a/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h b/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h
+new file mode 100644
+index 00000000..d13e878d
 --- /dev/null
 +++ b/include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h
 @@ -0,0 +1,3084 @@
@@ -152472,9 +153428,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +/** @} */ /* end of lnx_ioctl_FM_PCD_Runtime_grp group */
 +/** @} */ /* end of lnx_ioctl_FM_PCD_grp group */
 +/** @} */ /* end of lnx_ioctl_FM_grp group */
+diff --git a/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h b/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h
+new file mode 100644
+index 00000000..eb9bd9a7
 --- /dev/null
 +++ b/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h
-@@ -0,0 +1,948 @@
+@@ -0,0 +1,973 @@
 +/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc.
 + * All rights reserved.
 + *
@@ -153416,6 +154375,31 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +#define FM_PORT_IOC_GET_BMI_COUNTERS _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(42), ioc_fm_port_bmi_stats_t)
 +
++typedef struct ioc_fm_port_mac_frame_size_counters_t {
++
++        e_CommMode type;
++        uint64_t  count_pkts_64;            /**< 64 byte frame counter */
++        uint64_t  count_pkts_65_to_127;     /**< 65 to 127 byte frame counter */
++        uint64_t  count_pkts_128_to_255;    /**< 128 to 255 byte frame counter */
++        uint64_t  count_pkts_256_to_511;    /**< 256 to 511 byte frame counter */
++        uint64_t  count_pkts_512_to_1023;   /**< 512 to 1023 byte frame counter */
++        uint64_t  count_pkts_1024_to_1518;  /**< 1024 to 1518 byte frame counter */
++        uint64_t  count_pkts_1519_to_1522;  /**< 1519 to 1522 byte good frame count */
++} ioc_fm_port_mac_frame_size_counters_t;
++
++/**************************************************************************//**
++ @Function      FM_MAC_GetFrameSizeCounters
++
++ @Description   get MAC statistics counters for different frame size
++
++ @Param[out]    ioc_fm_port_mac_frame_size_counters_t    A structure holding the counters
++
++ @Return        E_OK on success; Error code otherwise.
++
++ @Cautions      Allowed only following FM_Init().
++*//***************************************************************************/
++#define FM_PORT_IOC_GET_MAC_FRAME_SIZE_COUNTERS        _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(43), ioc_fm_port_mac_frame_size_counters_t)
++
 +
 +/** @} */ /* end of lnx_ioctl_FM_PORT_pcd_runtime_control_grp group */
 +/** @} */ /* end of lnx_ioctl_FM_PORT_runtime_control_grp group */
@@ -153423,6 +154407,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +/** @} */ /* end of lnx_ioctl_FM_PORT_grp group */
 +/** @} */ /* end of lnx_ioctl_FM_grp group */
 +#endif /* __FM_PORT_IOCTLS_H */
+diff --git a/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h b/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h
+new file mode 100644
+index 00000000..207ed1eb
 --- /dev/null
 +++ b/include/uapi/linux/fmd/Peripherals/fm_test_ioctls.h
 @@ -0,0 +1,208 @@
@@ -153634,10 +154621,16 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __FM_TEST_IOCTLS_H */
+diff --git a/include/uapi/linux/fmd/integrations/Kbuild b/include/uapi/linux/fmd/integrations/Kbuild
+new file mode 100644
+index 00000000..e548d676
 --- /dev/null
 +++ b/include/uapi/linux/fmd/integrations/Kbuild
 @@ -0,0 +1 @@
 +header-y += integration_ioctls.h
+diff --git a/include/uapi/linux/fmd/integrations/integration_ioctls.h b/include/uapi/linux/fmd/integrations/integration_ioctls.h
+new file mode 100644
+index 00000000..61d696e2
 --- /dev/null
 +++ b/include/uapi/linux/fmd/integrations/integration_ioctls.h
 @@ -0,0 +1,56 @@
@@ -153697,6 +154690,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#endif
 +
 +#endif /* __INTG_IOCTLS_H */
+diff --git a/include/uapi/linux/fmd/ioctls.h b/include/uapi/linux/fmd/ioctls.h
+new file mode 100644
+index 00000000..4f36cb05
 --- /dev/null
 +++ b/include/uapi/linux/fmd/ioctls.h
 @@ -0,0 +1,96 @@
@@ -153796,6 +154792,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __IOCTLS_H__ */
+diff --git a/include/uapi/linux/fmd/net_ioctls.h b/include/uapi/linux/fmd/net_ioctls.h
+new file mode 100644
+index 00000000..c99d64cf
 --- /dev/null
 +++ b/include/uapi/linux/fmd/net_ioctls.h
 @@ -0,0 +1,430 @@
@@ -154229,3 +155228,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +
 +#endif /* __NET_IOCTLS_H */
+-- 
+2.14.1
+
index 4e3b139..946a1c5 100644 (file)
@@ -1,4 +1,4 @@
-From c4813da334b0c31e9c55eea015f1e898e84ff45b Mon Sep 17 00:00:00 2001
+From 9e6e0a53b29190dbd86a39304b59c3028f5b36c2 Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 11:04:10 +0800
 Subject: [PATCH] pci: support layerscape
@@ -15,21 +15,23 @@ Signed-off-by: Mingkai Hu <mingkai.hu@nxp.com>
 Signed-off-by: Christoph Hellwig <hch@lst.de>
 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 ---
- drivers/irqchip/irq-ls-scfg-msi.c            | 256 +++++++--
+ drivers/irqchip/irq-ls-scfg-msi.c            | 257 +++++++--
  drivers/pci/host/Makefile                    |   2 +-
  drivers/pci/host/pci-layerscape-ep-debugfs.c | 758 +++++++++++++++++++++++++++
  drivers/pci/host/pci-layerscape-ep.c         | 309 +++++++++++
  drivers/pci/host/pci-layerscape-ep.h         | 115 ++++
- drivers/pci/host/pci-layerscape.c            |  37 +-
+ drivers/pci/host/pci-layerscape.c            |  38 +-
  drivers/pci/host/pcie-designware.c           |   6 +
  drivers/pci/host/pcie-designware.h           |   1 +
  drivers/pci/pcie/portdrv_core.c              | 181 +++----
  include/linux/pci.h                          |   1 +
- 10 files changed, 1518 insertions(+), 148 deletions(-)
+ 10 files changed, 1520 insertions(+), 148 deletions(-)
  create mode 100644 drivers/pci/host/pci-layerscape-ep-debugfs.c
  create mode 100644 drivers/pci/host/pci-layerscape-ep.c
  create mode 100644 drivers/pci/host/pci-layerscape-ep.h
 
+diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
+index 02cca74c..57e3d900 100644
 --- a/drivers/irqchip/irq-ls-scfg-msi.c
 +++ b/drivers/irqchip/irq-ls-scfg-msi.c
 @@ -17,13 +17,32 @@
@@ -82,7 +84,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  };
  
  static struct irq_chip ls_scfg_msi_irq_chip = {
-@@ -49,19 +71,56 @@ static struct msi_domain_info ls_scfg_ms
+@@ -49,19 +71,56 @@ static struct msi_domain_info ls_scfg_msi_domain_info = {
        .chip   = &ls_scfg_msi_irq_chip,
  };
  
@@ -141,7 +143,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  }
  
  static struct irq_chip ls_scfg_msi_parent_chip = {
-@@ -81,8 +140,8 @@ static int ls_scfg_msi_domain_irq_alloc(
+@@ -81,8 +140,8 @@ static int ls_scfg_msi_domain_irq_alloc(struct irq_domain *domain,
        WARN_ON(nr_irqs != 1);
  
        spin_lock(&msi_data->lock);
@@ -152,7 +154,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                __set_bit(pos, msi_data->used);
        else
                err = -ENOSPC;
-@@ -106,7 +165,7 @@ static void ls_scfg_msi_domain_irq_free(
+@@ -106,7 +165,7 @@ static void ls_scfg_msi_domain_irq_free(struct irq_domain *domain,
        int pos;
  
        pos = d->hwirq;
@@ -161,7 +163,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                pr_err("failed to teardown msi. Invalid hwirq %d\n", pos);
                return;
        }
-@@ -123,15 +182,22 @@ static const struct irq_domain_ops ls_sc
+@@ -123,15 +182,22 @@ static const struct irq_domain_ops ls_scfg_msi_domain_ops = {
  
  static void ls_scfg_msi_irq_handler(struct irq_desc *desc)
  {
@@ -189,7 +191,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                if (virq)
                        generic_handle_irq(virq);
        }
-@@ -143,7 +209,7 @@ static int ls_scfg_msi_domains_init(stru
+@@ -143,7 +209,7 @@ static int ls_scfg_msi_domains_init(struct ls_scfg_msi *msi_data)
  {
        /* Initialize MSI domain parent */
        msi_data->parent = irq_domain_add_linear(NULL,
@@ -198,7 +200,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                                                 &ls_scfg_msi_domain_ops,
                                                 msi_data);
        if (!msi_data->parent) {
-@@ -164,16 +230,117 @@ static int ls_scfg_msi_domains_init(stru
+@@ -164,16 +230,118 @@ static int ls_scfg_msi_domains_init(struct ls_scfg_msi *msi_data)
        return 0;
  }
  
@@ -288,6 +290,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      { .compatible = "fsl,1s1021a-msi", .data = &ls1021_msi_cfg},
 +      { .compatible = "fsl,1s1043a-msi", .data = &ls1021_msi_cfg},
 +
++      { .compatible = "fsl,ls1012a-msi", .data = &ls1021_msi_cfg },
 +      { .compatible = "fsl,ls1021a-msi", .data = &ls1021_msi_cfg },
 +      { .compatible = "fsl,ls1043a-msi", .data = &ls1021_msi_cfg },
 +      { .compatible = "fsl,ls1043a-v1.1-msi", .data = &ls1043_v1_1_msi_cfg },
@@ -317,7 +320,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        msi_data->regs = devm_ioremap_resource(&pdev->dev, res);
        if (IS_ERR(msi_data->regs)) {
-@@ -182,23 +349,48 @@ static int ls_scfg_msi_probe(struct plat
+@@ -182,23 +350,48 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)
        }
        msi_data->msiir_addr = res->start;
  
@@ -376,7 +379,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        platform_set_drvdata(pdev, msi_data);
  
        return 0;
-@@ -207,8 +399,10 @@ static int ls_scfg_msi_probe(struct plat
+@@ -207,8 +400,10 @@ static int ls_scfg_msi_probe(struct platform_device *pdev)
  static int ls_scfg_msi_remove(struct platform_device *pdev)
  {
        struct ls_scfg_msi *msi_data = platform_get_drvdata(pdev);
@@ -388,7 +391,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        irq_domain_remove(msi_data->msi_domain);
        irq_domain_remove(msi_data->parent);
-@@ -218,12 +412,6 @@ static int ls_scfg_msi_remove(struct pla
+@@ -218,12 +413,6 @@ static int ls_scfg_msi_remove(struct platform_device *pdev)
        return 0;
  }
  
@@ -401,9 +404,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  static struct platform_driver ls_scfg_msi_driver = {
        .driver = {
                .name = "ls-scfg-msi",
+diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
+index 084cb498..88e87704 100644
 --- a/drivers/pci/host/Makefile
 +++ b/drivers/pci/host/Makefile
-@@ -17,7 +17,7 @@ obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx
+@@ -17,7 +17,7 @@ obj-$(CONFIG_PCIE_XILINX) += pcie-xilinx.o
  obj-$(CONFIG_PCIE_XILINX_NWL) += pcie-xilinx-nwl.o
  obj-$(CONFIG_PCI_XGENE) += pci-xgene.o
  obj-$(CONFIG_PCI_XGENE_MSI) += pci-xgene-msi.o
@@ -412,6 +417,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  obj-$(CONFIG_PCI_VERSATILE) += pci-versatile.o
  obj-$(CONFIG_PCIE_IPROC) += pcie-iproc.o
  obj-$(CONFIG_PCIE_IPROC_MSI) += pcie-iproc-msi.o
+diff --git a/drivers/pci/host/pci-layerscape-ep-debugfs.c b/drivers/pci/host/pci-layerscape-ep-debugfs.c
+new file mode 100644
+index 00000000..5f4870ba
 --- /dev/null
 +++ b/drivers/pci/host/pci-layerscape-ep-debugfs.c
 @@ -0,0 +1,758 @@
@@ -1173,6 +1181,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +MODULE_AUTHOR("Minghuan Lian <Minghuan.Lian@freescale.com>");
 +MODULE_DESCRIPTION("Freescale Layerscape PCIe EP controller driver");
 +MODULE_LICENSE("GPL v2");
+diff --git a/drivers/pci/host/pci-layerscape-ep.c b/drivers/pci/host/pci-layerscape-ep.c
+new file mode 100644
+index 00000000..8f1cca6e
 --- /dev/null
 +++ b/drivers/pci/host/pci-layerscape-ep.c
 @@ -0,0 +1,309 @@
@@ -1485,6 +1496,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +MODULE_AUTHOR("Minghuan Lian <Minghuan.Lian@freescale.com>");
 +MODULE_DESCRIPTION("Freescale Layerscape PCIe EP driver");
 +MODULE_LICENSE("GPL v2");
+diff --git a/drivers/pci/host/pci-layerscape-ep.h b/drivers/pci/host/pci-layerscape-ep.h
+new file mode 100644
+index 00000000..990c0ff5
 --- /dev/null
 +++ b/drivers/pci/host/pci-layerscape-ep.h
 @@ -0,0 +1,115 @@
@@ -1603,6 +1617,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +int ls_pcie_ep_dbgfs_remove(struct ls_pcie *pcie);
 +
 +#endif /* _PCIE_LAYERSCAPE_EP_H */
+diff --git a/drivers/pci/host/pci-layerscape.c b/drivers/pci/host/pci-layerscape.c
+index 65370799..7ce32ff0 100644
 --- a/drivers/pci/host/pci-layerscape.c
 +++ b/drivers/pci/host/pci-layerscape.c
 @@ -35,12 +35,14 @@
@@ -1622,7 +1638,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        struct pcie_host_ops *ops;
  };
  
-@@ -86,6 +88,14 @@ static void ls_pcie_drop_msg_tlp(struct
+@@ -86,6 +88,14 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie)
        iowrite32(val, pcie->pp.dbi_base + PCIE_STRFMR1);
  }
  
@@ -1637,7 +1653,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  static int ls1021_pcie_link_up(struct pcie_port *pp)
  {
        u32 state;
-@@ -134,7 +144,7 @@ static int ls_pcie_link_up(struct pcie_p
+@@ -134,7 +144,7 @@ static int ls_pcie_link_up(struct pcie_port *pp)
        struct ls_pcie *pcie = to_ls_pcie(pp);
        u32 state;
  
@@ -1646,7 +1662,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                 pcie->drvdata->ltssm_shift) &
                 LTSSM_STATE_MASK;
  
-@@ -153,6 +163,9 @@ static void ls_pcie_host_init(struct pci
+@@ -153,6 +163,9 @@ static void ls_pcie_host_init(struct pcie_port *pp)
        ls_pcie_clear_multifunction(pcie);
        ls_pcie_drop_msg_tlp(pcie);
        iowrite32(0, pcie->pp.dbi_base + PCIE_DBI_RO_WR_EN);
@@ -1656,7 +1672,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  }
  
  static int ls_pcie_msi_host_init(struct pcie_port *pp,
-@@ -196,20 +209,38 @@ static struct ls_pcie_drvdata ls1021_drv
+@@ -196,20 +209,39 @@ static struct ls_pcie_drvdata ls1021_drvdata = {
  static struct ls_pcie_drvdata ls1043_drvdata = {
        .lut_offset = 0x10000,
        .ltssm_shift = 24,
@@ -1686,6 +1702,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  };
  
  static const struct of_device_id ls_pcie_of_match[] = {
++      { .compatible = "fsl,ls1012a-pcie", .data = &ls1046_drvdata },
        { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata },
        { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata },
 +      { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata },
@@ -1695,9 +1712,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        { },
  };
  
+diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
+index af8f6e92..2358e049 100644
 --- a/drivers/pci/host/pcie-designware.c
 +++ b/drivers/pci/host/pcie-designware.c
-@@ -478,6 +478,12 @@ int dw_pcie_wait_for_link(struct pcie_po
+@@ -478,6 +478,12 @@ int dw_pcie_wait_for_link(struct pcie_port *pp)
        return -ETIMEDOUT;
  }
  
@@ -1710,18 +1729,22 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  int dw_pcie_link_up(struct pcie_port *pp)
  {
        u32 val;
+diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h
+index a567ea28..4e6672b2 100644
 --- a/drivers/pci/host/pcie-designware.h
 +++ b/drivers/pci/host/pcie-designware.h
-@@ -82,5 +82,6 @@ int dw_pcie_wait_for_link(struct pcie_po
+@@ -82,5 +82,6 @@ int dw_pcie_wait_for_link(struct pcie_port *pp);
  int dw_pcie_link_up(struct pcie_port *pp);
  void dw_pcie_setup_rc(struct pcie_port *pp);
  int dw_pcie_host_init(struct pcie_port *pp);
 +void dw_pcie_disable_outbound_atu(struct pcie_port *pp, int index);
  
  #endif /* _PCIE_DESIGNWARE_H */
+diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
+index e9270b40..1bad877a 100644
 --- a/drivers/pci/pcie/portdrv_core.c
 +++ b/drivers/pci/pcie/portdrv_core.c
-@@ -44,52 +44,30 @@ static void release_pcie_device(struct d
+@@ -44,52 +44,30 @@ static void release_pcie_device(struct device *dev)
  }
  
  /**
@@ -1785,7 +1808,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /*
         * Allocate as many entries as the port wants, so that we can check
-@@ -97,20 +75,13 @@ static int pcie_port_enable_msix(struct
+@@ -97,20 +75,13 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
         * equal to the number of entries this port actually uses, we'll happily
         * go through without any tricks.
         */
@@ -1811,7 +1834,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
                /*
                 * The code below follows the PCI Express Base Specification 2.0
-@@ -125,18 +96,16 @@ static int pcie_port_enable_msix(struct
+@@ -125,18 +96,16 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
                pcie_capability_read_word(dev, PCI_EXP_FLAGS, &reg16);
                entry = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9;
                if (entry >= nr_entries)
@@ -1835,7 +1858,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
                /*
                 * The code below follows Section 7.10.10 of the PCI Express
-@@ -151,13 +120,11 @@ static int pcie_port_enable_msix(struct
+@@ -151,13 +120,11 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
                pci_read_config_dword(dev, pos + PCI_ERR_ROOT_STATUS, &reg32);
                entry = reg32 >> 27;
                if (entry >= nr_entries)
@@ -1852,7 +1875,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        }
  
        /*
-@@ -165,41 +132,54 @@ static int pcie_port_enable_msix(struct
+@@ -165,41 +132,54 @@ static int pcie_port_enable_msix(struct pci_dev *dev, int *vectors, int mask)
         * what we have.  Otherwise, the port has some extra entries not for the
         * services we know and we need to work around that.
         */
@@ -1926,7 +1949,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /*
         * If MSI cannot be used for PCIe PME or hotplug, we have to use
-@@ -207,41 +187,25 @@ static int init_service_irqs(struct pci_
+@@ -207,41 +187,25 @@ static int init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
         */
        if (((mask & PCIE_PORT_SERVICE_PME) && pcie_pme_no_msi()) ||
            ((mask & PCIE_PORT_SERVICE_HP) && pciehp_no_msi())) {
@@ -1980,7 +2003,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /**
   * get_port_device_capability - discover capabilities of a PCI Express port
   * @dev: PCI Express port to examine
-@@ -378,7 +342,7 @@ int pcie_port_device_register(struct pci
+@@ -378,7 +342,7 @@ int pcie_port_device_register(struct pci_dev *dev)
         * that can be used in the absence of irqs.  Allow them to determine
         * if that is to be used.
         */
@@ -1989,7 +2012,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        if (status) {
                capabilities &= PCIE_PORT_SERVICE_VC | PCIE_PORT_SERVICE_HP;
                if (!capabilities)
-@@ -401,7 +365,7 @@ int pcie_port_device_register(struct pci
+@@ -401,7 +365,7 @@ int pcie_port_device_register(struct pci_dev *dev)
        return 0;
  
  error_cleanup_irqs:
@@ -1998,7 +2021,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  error_disable:
        pci_disable_device(dev);
        return status;
-@@ -469,7 +433,7 @@ static int remove_iter(struct device *de
+@@ -469,7 +433,7 @@ static int remove_iter(struct device *dev, void *data)
  void pcie_port_device_remove(struct pci_dev *dev)
  {
        device_for_each_child(&dev->dev, NULL, remove_iter);
@@ -2007,7 +2030,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        pci_disable_device(dev);
  }
  
-@@ -499,7 +463,6 @@ static int pcie_port_probe_service(struc
+@@ -499,7 +463,6 @@ static int pcie_port_probe_service(struct device *dev)
        if (status)
                return status;
  
@@ -2015,7 +2038,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        get_device(dev);
        return 0;
  }
-@@ -524,8 +487,6 @@ static int pcie_port_remove_service(stru
+@@ -524,8 +487,6 @@ static int pcie_port_remove_service(struct device *dev)
        pciedev = to_pcie_device(dev);
        driver = to_service_driver(dev->driver);
        if (driver && driver->remove) {
@@ -2024,9 +2047,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                driver->remove(pciedev);
                put_device(dev);
        }
+diff --git a/include/linux/pci.h b/include/linux/pci.h
+index 1b711796..6738d816 100644
 --- a/include/linux/pci.h
 +++ b/include/linux/pci.h
-@@ -1823,6 +1823,7 @@ void pcibios_release_device(struct pci_d
+@@ -1823,6 +1823,7 @@ void pcibios_release_device(struct pci_dev *dev);
  void pcibios_penalize_isa_irq(int irq, int active);
  int pcibios_alloc_irq(struct pci_dev *dev);
  void pcibios_free_irq(struct pci_dev *dev);
@@ -2034,3 +2059,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  #ifdef CONFIG_HIBERNATE_CALLBACKS
  extern struct dev_pm_ops pcibios_pm_ops;
+-- 
+2.14.1
+
index 2927c7e..ab0afad 100644 (file)
@@ -1,4 +1,4 @@
-From 464b4d9b8282e0f1e5040e4914505f91ce4d3750 Mon Sep 17 00:00:00 2001
+From afb7254de9f03c3efaf4e306dcf5f88e1873fc6b Mon Sep 17 00:00:00 2001
 From: Yangbo Lu <yangbo.lu@nxp.com>
 Date: Mon, 25 Sep 2017 12:06:25 +0800
 Subject: [PATCH] fsl-mc: layerscape support
@@ -29,7 +29,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  .../{include/dpcon-cmd.h => bus/dpio/dpio-cmd.h}   |   73 +-
  drivers/staging/fsl-mc/bus/dpio/dpio-driver.c      |  296 ++++++
  drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt    |  135 +++
- drivers/staging/fsl-mc/bus/dpio/dpio-service.c     |  689 +++++++++++++
+ drivers/staging/fsl-mc/bus/dpio/dpio-service.c     |  693 +++++++++++++
  drivers/staging/fsl-mc/bus/dpio/dpio.c             |  224 +++++
  drivers/staging/fsl-mc/bus/dpio/dpio.h             |  109 ++
  drivers/staging/fsl-mc/bus/dpio/qbman-portal.c     | 1049 ++++++++++++++++++++
@@ -68,7 +68,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  drivers/staging/fsl-mc/include/mc-cmd.h            |   44 +-
  drivers/staging/fsl-mc/include/mc-sys.h            |    3 +-
  drivers/staging/fsl-mc/include/mc.h                |   17 +-
- 49 files changed, 7380 insertions(+), 2612 deletions(-)
+ 49 files changed, 7384 insertions(+), 2612 deletions(-)
  create mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h
  create mode 100644 drivers/staging/fsl-mc/bus/dpcon-cmd.h
  create mode 100644 drivers/staging/fsl-mc/bus/dpcon.c
@@ -94,6 +94,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  create mode 100644 drivers/staging/fsl-mc/include/dpcon.h
  create mode 100644 drivers/staging/fsl-mc/include/dpopr.h
 
+diff --git a/drivers/staging/fsl-mc/bus/Kconfig b/drivers/staging/fsl-mc/bus/Kconfig
+index 1f959339..67847c0e 100644
 --- a/drivers/staging/fsl-mc/bus/Kconfig
 +++ b/drivers/staging/fsl-mc/bus/Kconfig
 @@ -1,25 +1,40 @@
@@ -150,6 +152,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +        help
 +          Driver that provides kernel support for the Freescale Management
 +          Complex resource manager user-space tool.
+diff --git a/drivers/staging/fsl-mc/bus/Makefile b/drivers/staging/fsl-mc/bus/Makefile
+index 38716fd5..e7e2239c 100644
 --- a/drivers/staging/fsl-mc/bus/Makefile
 +++ b/drivers/staging/fsl-mc/bus/Makefile
 @@ -17,4 +17,12 @@ mc-bus-driver-objs := fsl-mc-bus.o \
@@ -166,6 +170,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +# MC restool kernel support
 +obj-$(CONFIG_FSL_MC_RESTOOL) += mc-restool.o
+diff --git a/drivers/staging/fsl-mc/bus/dpbp-cmd.h b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
+new file mode 100644
+index 00000000..8aa65452
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpbp-cmd.h
 @@ -0,0 +1,80 @@
@@ -249,6 +256,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +};
 +
 +#endif /* _FSL_DPBP_CMD_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpbp.c b/drivers/staging/fsl-mc/bus/dpbp.c
+index 5d4cd812..d9e450a6 100644
 --- a/drivers/staging/fsl-mc/bus/dpbp.c
 +++ b/drivers/staging/fsl-mc/bus/dpbp.c
 @@ -1,4 +1,5 @@
@@ -276,10 +285,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  /**
   * dpbp_open() - Open a control session for the specified object.
-@@ -105,74 +106,6 @@ int dpbp_close(struct fsl_mc_io *mc_io,
+@@ -104,74 +105,6 @@ int dpbp_close(struct fsl_mc_io *mc_io,
+ }
  EXPORT_SYMBOL(dpbp_close);
  
- /**
+-/**
 - * dpbp_create() - Create the DPBP object.
 - * @mc_io:    Pointer to MC portal's I/O object
 - * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
@@ -347,11 +357,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      return mc_send_command(mc_io, &cmd);
 -}
 -
--/**
+ /**
   * dpbp_enable() - Enable the DPBP.
   * @mc_io:    Pointer to MC portal's I/O object
-  * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
-@@ -250,6 +183,7 @@ int dpbp_is_enabled(struct fsl_mc_io *mc
+@@ -250,6 +183,7 @@ int dpbp_is_enabled(struct fsl_mc_io *mc_io,
  
        return 0;
  }
@@ -671,7 +680,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  /**
   * dpbp_get_attributes - Retrieve DPBP attributes.
-@@ -609,83 +240,40 @@ int dpbp_get_attributes(struct fsl_mc_io
+@@ -609,83 +240,40 @@ int dpbp_get_attributes(struct fsl_mc_io *mc_io,
        rsp_params = (struct dpbp_rsp_get_attributes *)cmd.params;
        attr->bpid = le16_to_cpu(rsp_params->bpid);
        attr->id = le32_to_cpu(rsp_params->id);
@@ -768,6 +777,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        return 0;
  }
 +EXPORT_SYMBOL(dpbp_get_api_version);
+diff --git a/drivers/staging/fsl-mc/bus/dpcon-cmd.h b/drivers/staging/fsl-mc/bus/dpcon-cmd.h
+new file mode 100644
+index 00000000..2bb66988
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpcon-cmd.h
 @@ -0,0 +1,85 @@
@@ -856,6 +868,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +};
 +
 +#endif /* _FSL_DPCON_CMD_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpcon.c b/drivers/staging/fsl-mc/bus/dpcon.c
+new file mode 100644
+index 00000000..eb713578
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpcon.c
 @@ -0,0 +1,317 @@
@@ -1176,6 +1191,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return 0;
 +}
 +EXPORT_SYMBOL(dpcon_get_api_version);
+diff --git a/drivers/staging/fsl-mc/bus/dpio/Makefile b/drivers/staging/fsl-mc/bus/dpio/Makefile
+new file mode 100644
+index 00000000..1c28794e
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/Makefile
 @@ -0,0 +1,11 @@
@@ -1190,48 +1208,53 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +fsl-mc-dpio-objs := dpio.o qbman-portal.o dpio-service.o dpio-driver.o
 +
 +obj-$(CONFIG_FSL_QBMAN_DEBUG) += qbman_debug.o
+diff --git a/drivers/staging/fsl-mc/include/dpcon-cmd.h b/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
+similarity index 64%
+rename from drivers/staging/fsl-mc/include/dpcon-cmd.h
+rename to drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
+index 536b2ef1..b2dc6e76 100644
 --- a/drivers/staging/fsl-mc/include/dpcon-cmd.h
-+++ /dev/null
-@@ -1,62 +0,0 @@
++++ b/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
+@@ -1,4 +1,6 @@
 -/* Copyright 2013-2015 Freescale Semiconductor Inc.
++/*
++ * Copyright 2013-2016 Freescale Semiconductor Inc.
++ * Copyright 2016 NXP
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions are met:
+@@ -11,7 +13,6 @@
+  * names of any contributors may be used to endorse or promote products
+  * derived from this software without specific prior written permission.
+  *
 - *
-- * Redistribution and use in source and binary forms, with or without
-- * modification, are permitted provided that the following conditions are met:
-- * * Redistributions of source code must retain the above copyright
-- * notice, this list of conditions and the following disclaimer.
-- * * Redistributions in binary form must reproduce the above copyright
-- * notice, this list of conditions and the following disclaimer in the
-- * documentation and/or other materials provided with the distribution.
-- * * Neither the name of the above-listed copyright holders nor the
-- * names of any contributors may be used to endorse or promote products
-- * derived from this software without specific prior written permission.
-- *
-- *
-- * ALTERNATIVELY, this software may be distributed under the terms of the
-- * GNU General Public License ("GPL") as published by the Free Software
-- * Foundation, either version 2 of that License or (at your option) any
-- * later version.
-- *
-- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
-- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- * POSSIBILITY OF SUCH DAMAGE.
-- */
+  * ALTERNATIVELY, this software may be distributed under the terms of the
+  * GNU General Public License ("GPL") as published by the Free Software
+  * Foundation, either version 2 of that License or (at your option) any
+@@ -29,34 +30,46 @@
+  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
 -#ifndef _FSL_DPCON_CMD_H
 -#define _FSL_DPCON_CMD_H
--
++#ifndef _FSL_DPIO_CMD_H
++#define _FSL_DPIO_CMD_H
++
++/* DPIO Version */
++#define DPIO_VER_MAJOR                        4
++#define DPIO_VER_MINOR                        2
++
++/* Command Versioning */
++
++#define DPIO_CMD_ID_OFFSET            4
++#define DPIO_CMD_BASE_VERSION         1
 -/* DPCON Version */
 -#define DPCON_VER_MAJOR                               2
 -#define DPCON_VER_MINOR                               1
--
--/* Command IDs */
++#define DPIO_CMD(id)  (((id) << DPIO_CMD_ID_OFFSET) | DPIO_CMD_BASE_VERSION)
+ /* Command IDs */
 -#define DPCON_CMDID_CLOSE                             0x800
 -#define DPCON_CMDID_OPEN                              0x808
 -#define DPCON_CMDID_CREATE                            0x908
@@ -1255,56 +1278,6 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -#define DPCON_CMDID_SET_NOTIFICATION                  0x100
 -
 -#endif /* _FSL_DPCON_CMD_H */
---- /dev/null
-+++ b/drivers/staging/fsl-mc/bus/dpio/dpio-cmd.h
-@@ -0,0 +1,75 @@
-+/*
-+ * Copyright 2013-2016 Freescale Semiconductor Inc.
-+ * Copyright 2016 NXP
-+ *
-+ * Redistribution and use in source and binary forms, with or without
-+ * modification, are permitted provided that the following conditions are met:
-+ * * Redistributions of source code must retain the above copyright
-+ * notice, this list of conditions and the following disclaimer.
-+ * * Redistributions in binary form must reproduce the above copyright
-+ * notice, this list of conditions and the following disclaimer in the
-+ * documentation and/or other materials provided with the distribution.
-+ * * Neither the name of the above-listed copyright holders nor the
-+ * names of any contributors may be used to endorse or promote products
-+ * derived from this software without specific prior written permission.
-+ *
-+ * ALTERNATIVELY, this software may be distributed under the terms of the
-+ * GNU General Public License ("GPL") as published by the Free Software
-+ * Foundation, either version 2 of that License or (at your option) any
-+ * later version.
-+ *
-+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
-+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-+ * POSSIBILITY OF SUCH DAMAGE.
-+ */
-+#ifndef _FSL_DPIO_CMD_H
-+#define _FSL_DPIO_CMD_H
-+
-+/* DPIO Version */
-+#define DPIO_VER_MAJOR                        4
-+#define DPIO_VER_MINOR                        2
-+
-+/* Command Versioning */
-+
-+#define DPIO_CMD_ID_OFFSET            4
-+#define DPIO_CMD_BASE_VERSION         1
-+
-+#define DPIO_CMD(id)  (((id) << DPIO_CMD_ID_OFFSET) | DPIO_CMD_BASE_VERSION)
-+
-+/* Command IDs */
 +#define DPIO_CMDID_CLOSE                              DPIO_CMD(0x800)
 +#define DPIO_CMDID_OPEN                                       DPIO_CMD(0x803)
 +#define DPIO_CMDID_GET_API_VERSION                    DPIO_CMD(0xa03)
@@ -1333,6 +1306,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +};
 +
 +#endif /* _FSL_DPIO_CMD_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c b/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c
+new file mode 100644
+index 00000000..8c8244a1
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/dpio-driver.c
 @@ -0,0 +1,296 @@
@@ -1632,6 +1608,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +module_init(dpio_driver_init);
 +module_exit(dpio_driver_exit);
+diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt b/drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt
+new file mode 100644
+index 00000000..0ba67716
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt
 @@ -0,0 +1,135 @@
@@ -1770,9 +1749,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +   manipulate them are defined in dpaa2-fd.h.
 +
 +   Dequeue result struct and parsing APIs are defined in dpaa2-global.h.
+diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio-service.c b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c
+new file mode 100644
+index 00000000..8449d988
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c
-@@ -0,0 +1,689 @@
+@@ -0,0 +1,693 @@
 +/*
 + * Copyright 2014-2016 Freescale Semiconductor Inc.
 + * Copyright 2016 NXP
@@ -1852,14 +1834,14 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      if (d)
 +              return d;
 +
-+      if (unlikely(cpu >= num_possible_cpus()))
++      if (unlikely(cpu >= (int)num_possible_cpus()))
 +              return NULL;
 +
 +      /*
 +       * If cpu == -1, choose the current cpu, with no guarantees about
 +       * potentially being migrated away.
 +       */
-+      if (unlikely(cpu < 0))
++      if (cpu < 0)
 +              cpu = smp_processor_id();
 +
 +      /* If a specific cpu was requested, pick it up immediately */
@@ -1871,6 +1853,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      if (d)
 +              return d;
 +
++      d = service_select_by_cpu(d, -1);
++      if (d)
++              return d;
++
 +      spin_lock(&dpio_list_lock);
 +      d = list_entry(dpio_list.next, struct dpaa2_io, node);
 +      list_del(&d->node);
@@ -1897,7 +1883,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              return NULL;
 +
 +      /* check if CPU is out of range (-1 means any cpu) */
-+      if (desc->cpu >= num_possible_cpus()) {
++      if (desc->cpu >= (int)num_possible_cpus()) {
 +              kfree(obj);
 +              return NULL;
 +      }
@@ -2462,6 +2448,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +}
 +EXPORT_SYMBOL(dpaa2_io_query_bp_count);
 +#endif
+diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio.c b/drivers/staging/fsl-mc/bus/dpio/dpio.c
+new file mode 100644
+index 00000000..d81e0232
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/dpio.c
 @@ -0,0 +1,224 @@
@@ -2689,6 +2678,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      return 0;
 +}
+diff --git a/drivers/staging/fsl-mc/bus/dpio/dpio.h b/drivers/staging/fsl-mc/bus/dpio/dpio.h
+new file mode 100644
+index 00000000..ced1103d
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/dpio.h
 @@ -0,0 +1,109 @@
@@ -2801,6 +2793,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                       u16 *minor_ver);
 +
 +#endif /* __FSL_DPIO_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
+new file mode 100644
+index 00000000..e14fb65b
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.c
 @@ -0,0 +1,1049 @@
@@ -3853,6 +3848,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      return 0;
 +}
+diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman-portal.h b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.h
+new file mode 100644
+index 00000000..4254034c
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/qbman-portal.h
 @@ -0,0 +1,662 @@
@@ -4518,6 +4516,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define qb_cl(d) (&(d)->dont_manipulate_directly[0])
 +
 +#endif /* __FSL_QBMAN_PORTAL_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman_debug.c b/drivers/staging/fsl-mc/bus/dpio/qbman_debug.c
+new file mode 100644
+index 00000000..1c77fa6a
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/qbman_debug.c
 @@ -0,0 +1,853 @@
@@ -5374,6 +5375,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +      return qbman_cgr_statistics_query(s, cgid, clear, 0,
 +                                        frame_cnt, byte_cnt);
 +}
+diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman_debug.h b/drivers/staging/fsl-mc/bus/dpio/qbman_debug.h
+new file mode 100644
+index 00000000..0a247a49
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/qbman_debug.h
 @@ -0,0 +1,136 @@
@@ -5513,6 +5517,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +                               u64 *frame_cnt, u64 *byte_cnt);
 +int qbman_cq_dequeue_statistics(struct qbman_swp *s, u32 cgid, int clear,
 +                              u64 *frame_cnt, u64 *byte_cnt);
+diff --git a/drivers/staging/fsl-mc/bus/dpio/qbman_private.h b/drivers/staging/fsl-mc/bus/dpio/qbman_private.h
+new file mode 100644
+index 00000000..98a64be2
 --- /dev/null
 +++ b/drivers/staging/fsl-mc/bus/dpio/qbman_private.h
 @@ -0,0 +1,171 @@
@@ -5687,6 +5694,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +
 +      __hexdump(start, end, p, sz, c);
 +}
+diff --git a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
+index d098a6d8..384a13d0 100644
 --- a/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
 +++ b/drivers/staging/fsl-mc/bus/dpmcp-cmd.h
 @@ -1,4 +1,5 @@
@@ -5710,16 +5719,27 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  /* Minimal supported DPMCP Version */
 -#define DPMCP_MIN_VER_MAJOR                           3
 -#define DPMCP_MIN_VER_MINOR                           0
--
++#define DPMCP_MIN_VER_MAJOR           3
++#define DPMCP_MIN_VER_MINOR           0
 -/* Command IDs */
 -#define DPMCP_CMDID_CLOSE                             0x800
 -#define DPMCP_CMDID_OPEN                              0x80b
 -#define DPMCP_CMDID_CREATE                            0x90b
 -#define DPMCP_CMDID_DESTROY                           0x900
--
++/* Command versioning */
++#define DPMCP_CMD_BASE_VERSION                1
++#define DPMCP_CMD_ID_OFFSET           4
 -#define DPMCP_CMDID_GET_ATTR                          0x004
 -#define DPMCP_CMDID_RESET                             0x005
--
++#define DPMCP_CMD(id) ((id << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION)
++
++/* Command IDs */
++#define DPMCP_CMDID_CLOSE             DPMCP_CMD(0x800)
++#define DPMCP_CMDID_OPEN              DPMCP_CMD(0x80b)
++#define DPMCP_CMDID_GET_API_VERSION   DPMCP_CMD(0xa0b)
 -#define DPMCP_CMDID_SET_IRQ                           0x010
 -#define DPMCP_CMDID_GET_IRQ                           0x011
 -#define DPMCP_CMDID_SET_IRQ_ENABLE                    0x012
@@ -5727,11 +5747,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -#define DPMCP_CMDID_SET_IRQ_MASK                      0x014
 -#define DPMCP_CMDID_GET_IRQ_MASK                      0x015
 -#define DPMCP_CMDID_GET_IRQ_STATUS                    0x016
--
--struct dpmcp_cmd_open {
--      __le32 dpmcp_id;
--};
--
++#define DPMCP_CMDID_RESET             DPMCP_CMD(0x005)
+ struct dpmcp_cmd_open {
+       __le32 dpmcp_id;
+ };
 -struct dpmcp_cmd_create {
 -      __le32 portal_id;
 -};
@@ -5762,21 +5783,15 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      __le32 irq_num;
 -      __le32 type;
 -};
-+#define DPMCP_MIN_VER_MAJOR           3
-+#define DPMCP_MIN_VER_MINOR           0
+-
 -#define DPMCP_ENABLE          0x1
-+/* Command versioning */
-+#define DPMCP_CMD_BASE_VERSION                1
-+#define DPMCP_CMD_ID_OFFSET           4
+-
 -struct dpmcp_cmd_set_irq_enable {
 -      u8 enable;
 -      u8 pad[3];
 -      u8 irq_index;
 -};
-+#define DPMCP_CMD(id) ((id << DPMCP_CMD_ID_OFFSET) | DPMCP_CMD_BASE_VERSION)
+-
 -struct dpmcp_cmd_get_irq_enable {
 -      __le32 pad;
 -      u8 irq_index;
@@ -5799,17 +5814,12 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -struct dpmcp_rsp_get_irq_mask {
 -      __le32 mask;
 -};
-+/* Command IDs */
-+#define DPMCP_CMDID_CLOSE             DPMCP_CMD(0x800)
-+#define DPMCP_CMDID_OPEN              DPMCP_CMD(0x80b)
-+#define DPMCP_CMDID_GET_API_VERSION   DPMCP_CMD(0xa0b)
+-
 -struct dpmcp_cmd_get_irq_status {
 -      __le32 status;
 -      u8 irq_index;
 -};
-+#define DPMCP_CMDID_RESET             DPMCP_CMD(0x005)
+-
 -struct dpmcp_rsp_get_irq_status {
 -      __le32 status;
 -};
@@ -5821,11 +5831,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      /* response word 1 */
 -      __le16 version_major;
 -      __le16 version_minor;
-+struct dpmcp_cmd_open {
-+      __le32 dpmcp_id;
- };
+-};
+-
  #endif /* _FSL_DPMCP_CMD_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpmcp.c b/drivers/staging/fsl-mc/bus/dpmcp.c
+index 55766f78..ad4c8b43 100644
 --- a/drivers/staging/fsl-mc/bus/dpmcp.c
 +++ b/drivers/staging/fsl-mc/bus/dpmcp.c
 @@ -1,4 +1,5 @@
@@ -5843,10 +5853,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * ALTERNATIVELY, this software may be distributed under the terms of the
   * GNU General Public License ("GPL") as published by the Free Software
   * Foundation, either version 2 of that License or (at your option) any
-@@ -104,76 +104,6 @@ int dpmcp_close(struct fsl_mc_io *mc_io,
+@@ -103,76 +103,6 @@ int dpmcp_close(struct fsl_mc_io *mc_io,
+       return mc_send_command(mc_io, &cmd);
  }
  
- /**
+-/**
 - * dpmcp_create() - Create the DPMCP object.
 - * @mc_io:    Pointer to MC portal's I/O object
 - * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
@@ -5916,10 +5927,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      return mc_send_command(mc_io, &cmd);
 -}
 -
--/**
+ /**
   * dpmcp_reset() - Reset the DPMCP, returns the object to initial state.
   * @mc_io:    Pointer to MC portal's I/O object
-  * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
 @@ -196,309 +126,33 @@ int dpmcp_reset(struct fsl_mc_io *mc_io,
  }
  
@@ -6242,6 +6252,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        return 0;
  }
+diff --git a/drivers/staging/fsl-mc/bus/dpmcp.h b/drivers/staging/fsl-mc/bus/dpmcp.h
+index fe79d4d9..f616031e 100644
 --- a/drivers/staging/fsl-mc/bus/dpmcp.h
 +++ b/drivers/staging/fsl-mc/bus/dpmcp.h
 @@ -1,4 +1,5 @@
@@ -6284,9 +6296,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  int dpmcp_close(struct fsl_mc_io *mc_io,
 -              uint32_t cmd_flags,
 -              uint16_t token);
-+              u32 cmd_flags,
-+              u16 token);
+-
 -/**
 - * struct dpmcp_cfg - Structure representing DPMCP configuration
 - * @portal_id:        Portal ID; 'DPMCP_GET_PORTAL_ID_FROM_POOL' to get the portal ID
@@ -6300,7 +6310,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -               uint32_t               cmd_flags,
 -               const struct dpmcp_cfg *cfg,
 -              uint16_t                *token);
--
++              u32 cmd_flags,
++              u16 token);
 -int dpmcp_destroy(struct fsl_mc_io *mc_io,
 -                uint32_t cmd_flags,
 -                uint16_t token);
@@ -6400,6 +6412,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +              u16 token);
  
  #endif /* __FSL_DPMCP_H */
+diff --git a/drivers/staging/fsl-mc/bus/dpmng-cmd.h b/drivers/staging/fsl-mc/bus/dpmng-cmd.h
+index a7b77d58..cdddfb80 100644
 --- a/drivers/staging/fsl-mc/bus/dpmng-cmd.h
 +++ b/drivers/staging/fsl-mc/bus/dpmng-cmd.h
 @@ -12,7 +12,6 @@
@@ -6431,6 +6445,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
  struct dpmng_rsp_get_version {
        __le32 revision;
+diff --git a/drivers/staging/fsl-mc/bus/dpmng.c b/drivers/staging/fsl-mc/bus/dpmng.c
+index 96b1d677..ad5d5bbe 100644
 --- a/drivers/staging/fsl-mc/bus/dpmng.c
 +++ b/drivers/staging/fsl-mc/bus/dpmng.c
 @@ -1,4 +1,5 @@
@@ -6448,7 +6464,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * ALTERNATIVELY, this software may be distributed under the terms of the
   * GNU General Public License ("GPL") as published by the Free Software
   * Foundation, either version 2 of that License or (at your option) any
-@@ -72,36 +72,3 @@ int mc_get_version(struct fsl_mc_io *mc_
+@@ -72,36 +72,3 @@ int mc_get_version(struct fsl_mc_io *mc_io,
  }
  EXPORT_SYMBOL(mc_get_version);
  
@@ -6485,6 +6501,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      return 0;
 -}
 -
+diff --git a/drivers/staging/fsl-mc/bus/dprc-cmd.h b/drivers/staging/fsl-mc/bus/dprc-cmd.h
+index 009d6567..b7d8c345 100644
 --- a/drivers/staging/fsl-mc/bus/dprc-cmd.h
 +++ b/drivers/staging/fsl-mc/bus/dprc-cmd.h
 @@ -12,7 +12,6 @@
@@ -6503,7 +6521,13 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 +#define DPRC_MIN_VER_MAJOR                    6
  #define DPRC_MIN_VER_MINOR                    0
  
--/* Command IDs */
++/* Command versioning */
++#define DPRC_CMD_BASE_VERSION                 1
++#define DPRC_CMD_ID_OFFSET                    4
++
++#define DPRC_CMD(id)  ((id << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
++
+ /* Command IDs */
 -#define DPRC_CMDID_CLOSE                      0x800
 -#define DPRC_CMDID_OPEN                               0x805
 -#define DPRC_CMDID_CREATE                     0x905
@@ -6540,14 +6564,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -#define DPRC_CMDID_DISCONNECT                 0x168
 -#define DPRC_CMDID_GET_POOL                   0x169
 -#define DPRC_CMDID_GET_POOL_COUNT             0x16A
-+/* Command versioning */
-+#define DPRC_CMD_BASE_VERSION                 1
-+#define DPRC_CMD_ID_OFFSET                    4
+-
 -#define DPRC_CMDID_GET_CONNECTION             0x16C
-+#define DPRC_CMD(id)  ((id << DPRC_CMD_ID_OFFSET) | DPRC_CMD_BASE_VERSION)
-+
-+/* Command IDs */
 +#define DPRC_CMDID_CLOSE                        DPRC_CMD(0x800)
 +#define DPRC_CMDID_OPEN                         DPRC_CMD(0x805)
 +#define DPRC_CMDID_GET_API_VERSION              DPRC_CMD(0xa05)
@@ -6603,6 +6621,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  };
  
  struct dprc_cmd_set_obj_label {
+diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
+index c5ee4639..f6e6211b 100644
 --- a/drivers/staging/fsl-mc/bus/dprc-driver.c
 +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
 @@ -1,7 +1,7 @@
@@ -6614,7 +6634,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * Author: German Rivera <German.Rivera@freescale.com>
   *
   * This file is licensed under the terms of the GNU General Public
-@@ -160,6 +160,8 @@ static void check_plugged_state_change(s
+@@ -160,6 +160,8 @@ static void check_plugged_state_change(struct fsl_mc_device *mc_dev,
   * dprc_add_new_devices - Adds devices to the logical bus for a DPRC
   *
   * @mc_bus_dev: pointer to the fsl-mc device that represents a DPRC object
@@ -6623,7 +6643,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * @obj_desc_array: array of device descriptors for child devices currently
   * present in the physical DPRC.
   * @num_child_objects_in_mc: number of entries in obj_desc_array
-@@ -169,6 +171,7 @@ static void check_plugged_state_change(s
+@@ -169,6 +171,7 @@ static void check_plugged_state_change(struct fsl_mc_device *mc_dev,
   * in the physical DPRC.
   */
  static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
@@ -6631,7 +6651,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                                 struct dprc_obj_desc *obj_desc_array,
                                 int num_child_objects_in_mc)
  {
-@@ -188,11 +191,12 @@ static void dprc_add_new_devices(struct
+@@ -188,11 +191,12 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
                child_dev = fsl_mc_device_lookup(obj_desc, mc_bus_dev);
                if (child_dev) {
                        check_plugged_state_change(child_dev, obj_desc);
@@ -6645,7 +6665,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                if (error < 0)
                        continue;
        }
-@@ -202,6 +206,8 @@ static void dprc_add_new_devices(struct
+@@ -202,6 +206,8 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
   * dprc_scan_objects - Discover objects in a DPRC
   *
   * @mc_bus_dev: pointer to the fsl-mc device that represents a DPRC object
@@ -6654,7 +6674,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * @total_irq_count: total number of IRQs needed by objects in the DPRC.
   *
   * Detects objects added and removed from a DPRC and synchronizes the
-@@ -217,6 +223,7 @@ static void dprc_add_new_devices(struct
+@@ -217,6 +223,7 @@ static void dprc_add_new_devices(struct fsl_mc_device *mc_bus_dev,
   * of the device drivers for the non-allocatable devices.
   */
  int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
@@ -6662,7 +6682,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                      unsigned int *total_irq_count)
  {
        int num_child_objects;
-@@ -297,7 +304,7 @@ int dprc_scan_objects(struct fsl_mc_devi
+@@ -297,7 +304,7 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev,
        dprc_remove_devices(mc_bus_dev, child_obj_desc_array,
                            num_child_objects);
  
@@ -6671,7 +6691,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                             num_child_objects);
  
        if (child_obj_desc_array)
-@@ -328,7 +335,7 @@ int dprc_scan_container(struct fsl_mc_de
+@@ -328,7 +335,7 @@ int dprc_scan_container(struct fsl_mc_device *mc_bus_dev)
         * Discover objects in the DPRC:
         */
        mutex_lock(&mc_bus->scan_mutex);
@@ -6680,7 +6700,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
        mutex_unlock(&mc_bus->scan_mutex);
        if (error < 0)
                goto error;
-@@ -415,7 +422,7 @@ static irqreturn_t dprc_irq0_handler_thr
+@@ -415,7 +422,7 @@ static irqreturn_t dprc_irq0_handler_thread(int irq_num, void *arg)
                      DPRC_IRQ_EVENT_OBJ_CREATED)) {
                unsigned int irq_count;
  
@@ -6689,7 +6709,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                if (error < 0) {
                        /*
                         * If the error is -ENXIO, we ignore it, as it indicates
-@@ -505,7 +512,7 @@ static int register_dprc_irq_handler(str
+@@ -505,7 +512,7 @@ static int register_dprc_irq_handler(struct fsl_mc_device *mc_dev)
                                          dprc_irq0_handler,
                                          dprc_irq0_handler_thread,
                                          IRQF_NO_SUSPEND | IRQF_ONESHOT,
@@ -6698,7 +6718,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                                          &mc_dev->dev);
        if (error < 0) {
                dev_err(&mc_dev->dev,
-@@ -597,6 +604,7 @@ static int dprc_probe(struct fsl_mc_devi
+@@ -597,6 +604,7 @@ static int dprc_probe(struct fsl_mc_device *mc_dev)
        struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev);
        bool mc_io_created = false;
        bool msi_domain_set = false;
@@ -6706,7 +6726,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        if (WARN_ON(strcmp(mc_dev->obj_desc.type, "dprc") != 0))
                return -EINVAL;
-@@ -669,13 +677,21 @@ static int dprc_probe(struct fsl_mc_devi
+@@ -669,13 +677,21 @@ static int dprc_probe(struct fsl_mc_device *mc_dev)
                goto error_cleanup_open;
        }
  
@@ -6733,6 +6753,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
                error = -ENOTSUPP;
                goto error_cleanup_open;
        }
+diff --git a/drivers/staging/fsl-mc/bus/dprc.c b/drivers/staging/fsl-mc/bus/dprc.c
+index 9fea3def..764cd3fb 100644
 --- a/drivers/staging/fsl-mc/bus/dprc.c
 +++ b/drivers/staging/fsl-mc/bus/dprc.c
 @@ -1,4 +1,5 @@
@@ -6750,10 +6772,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * ALTERNATIVELY, this software may be distributed under the terms of the
   * GNU General Public License ("GPL") as published by the Free Software
   * Foundation, either version 2 of that License or (at your option) any
-@@ -100,93 +100,6 @@ int dprc_close(struct fsl_mc_io *mc_io,
+@@ -99,93 +99,6 @@ int dprc_close(struct fsl_mc_io *mc_io,
+ }
  EXPORT_SYMBOL(dprc_close);
  
- /**
+-/**
 - * dprc_create_container() - Create child container
 - * @mc_io:    Pointer to MC portal's I/O object
 - * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
@@ -6840,11 +6863,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -      return mc_send_command(mc_io, &cmd);
 -}
 -
--/**
+ /**
   * dprc_reset_container - Reset child container.
   * @mc_io:    Pointer to MC portal's I/O object
-  * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
-@@ -565,279 +478,6 @@ int dprc_get_attributes(struct fsl_mc_io
+@@ -565,279 +478,6 @@ int dprc_get_attributes(struct fsl_mc_io *mc_io,
        attr->icid = le16_to_cpu(rsp_params->icid);
        attr->options = le32_to_cpu(rsp_params->options);
        attr->portal_id = le32_to_cpu(rsp_params->portal_id);
@@ -7124,10 +7146,11 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        return 0;
  }
-@@ -934,64 +574,6 @@ int dprc_get_obj(struct fsl_mc_io *mc_io
+@@ -933,64 +573,6 @@ int dprc_get_obj(struct fsl_mc_io *mc_io,
+ }
  EXPORT_SYMBOL(dprc_get_obj);
  
- /**
+-/**
 - * dprc_get_obj_desc() - Get object descriptor.
 - *
 - * @mc_io:    Pointer to MC portal's I/O object
@@ -7185,14 +7208,14 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -}
 -EXPORT_SYMBOL(dprc_get_obj_desc);
 -
--/**
+ /**
   * dprc_set_obj_irq() - Set IRQ information for object to trigger an interrupt.
   * @mc_io:    Pointer to MC portal's I/O object
-  * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
-@@ -1130,52 +712,6 @@ int dprc_get_res_count(struct fsl_mc_io
+@@ -1129,52 +711,6 @@ int dprc_get_res_count(struct fsl_mc_io *mc_io,
+ }
  EXPORT_SYMBOL(dprc_get_res_count);
  
- /**
+-/**
 - * dprc_get_res_ids() - Obtains IDs of free resources in the container
 - * @mc_io:    Pointer to MC portal's I/O object
 - * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
@@ -7238,11 +7261,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
 -}
 -EXPORT_SYMBOL(dprc_get_res_ids);
 -
--/**
+ /**
   * dprc_get_obj_region() - Get region information for a specified object.
   * @mc_io:    Pointer to MC portal's I/O object
-  * @cmd_flags:        Command flags; one or more of 'MC_CMD_FLAG_'
-@@ -1216,160 +752,66 @@ int dprc_get_obj_region(struct fsl_mc_io
+@@ -1216,160 +752,66 @@ int dprc_get_obj_region(struct fsl_mc_io *mc_io,
  
        /* retrieve response parameters */
        rsp_params = (struct dprc_rsp_get_obj_region *)cmd.params;
@@ -7433,7 +7455,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        /* send command to mc*/
        err = mc_send_command(mc_io, &cmd);
-@@ -1377,12 +819,7 @@ int dprc_get_connection(struct fsl_mc_io
+@@ -1377,12 +819,7 @@ int dprc_get_connection(struct fsl_mc_io *mc_io,
                return err;
  
        /* retrieve response parameters */
@@ -7447,6 +7469,8 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
  
        return 0;
  }
+diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
+index e93ab53b..ce07096c 100644
 --- a/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
 +++ b/drivers/staging/fsl-mc/bus/fsl-mc-allocator.c
 @@ -1,7 +1,7 @@
@@ -7492,7 +7516,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus
                                                                *mc_bus,
-@@ -95,10 +92,10 @@ out:
+@@ -95,10 +92,10 @@ static int __must_check fsl_mc_resource_pool_add_device(struct fsl_mc_bus
   * fsl_mc_resource_pool_remove_device - remove an allocatable device from a
   * resource pool
   *
@@ -7506,7 +7530,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  static int __must_check fsl_mc_resource_pool_remove_device(struct fsl_mc_device
                                                                   *mc_dev)
-@@ -255,17 +252,18 @@ out_unlock:
+@@ -255,17 +252,18 @@ void fsl_mc_resource_free(struct fsl_mc_resource *resource)
  EXPORT_SYMBOL_GPL(fsl_mc_resource_free);
  
  /**
@@ -7534,7 +7558,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   *
   * NOTE: pool_type must be different from FSL_MC_POOL_MCP, since MC
   * portals are allocated using fsl_mc_portal_allocate(), instead of
-@@ -312,10 +310,9 @@ error:
+@@ -312,10 +310,9 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev,
  EXPORT_SYMBOL_GPL(fsl_mc_object_allocate);
  
  /**
@@ -7548,7 +7572,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  void fsl_mc_object_free(struct fsl_mc_device *mc_adev)
  {
-@@ -332,8 +329,14 @@ void fsl_mc_object_free(struct fsl_mc_de
+@@ -332,8 +329,14 @@ void fsl_mc_object_free(struct fsl_mc_device *mc_adev)
  EXPORT_SYMBOL_GPL(fsl_mc_object_free);
  
  /*
@@ -7565,7 +7589,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
                             unsigned int irq_count)
-@@ -395,7 +398,7 @@ cleanup_msi_irqs:
+@@ -395,7 +398,7 @@ int fsl_mc_populate_irq_pool(struct fsl_mc_bus *mc_bus,
  EXPORT_SYMBOL_GPL(fsl_mc_populate_irq_pool);
  
  /**
@@ -7574,7 +7598,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   * It frees the IRQs that were allocated to the pool, back to the GIC-ITS.
   */
  void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus)
-@@ -422,11 +425,7 @@ void fsl_mc_cleanup_irq_pool(struct fsl_
+@@ -422,11 +425,7 @@ void fsl_mc_cleanup_irq_pool(struct fsl_mc_bus *mc_bus)
  EXPORT_SYMBOL_GPL(fsl_mc_cleanup_irq_pool);
  
  /**
@@ -7587,7 +7611,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
   */
  int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev)
  {
-@@ -495,8 +494,7 @@ error_resource_alloc:
+@@ -495,8 +494,7 @@ int __must_check fsl_mc_allocate_irqs(struct fsl_mc_device *mc_dev)
  EXPORT_SYMBOL_GPL(fsl_mc_all