[U-Boot] [PATCH v5 0/2] arm: ppc: Share DPAA1 fixups between ARCHs

2017-12-15 Thread Ahmed Mansour
- Support DPAA1 QBMan device tree fixups in a shared location for both
  arm and ppc architectures
- cleanup a define from header files and add as Kconfig with auto
  selection based on SOC

Changes in v5:
- Include  to fix missing prototype in p1023rdb.c
- Add net device to T1024QDS_DDR4_defconfig to enable QBMan fixup
- Remove QBMan define in kmp204x-common.h and rely on SOC auto select

Changes in v4:
- Update function name setup_portals() to setup_qbman_portals() in
  files that were missed the first time
- Add QBMan support in Kconfig auto select for B4420 and T4160 SOCs

Changes in v3:
- Add freescale old copyright in new file since it is a modified copy
- Add ifdef QBMAN guard around get_qman_freq()
- Return freq_qman instead of freq_systembus. More readable and robust
- Add white space before return line in get_qman_freq()

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

Ahmed Mansour (2):
  drivers/misc: Share qbman init between archs
  Move SYS_DPAA_QBMAN to Kconfig

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  14 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 board/freescale/p1023rdb/p1023rdb.c|   3 +-
 board/keymile/kmp204x/kmp204x.c|   2 +-
 board/varisys/cyrus/cyrus.c|   2 +-
 configs/T1024QDS_DDR4_defconfig|   1 +
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 305 +
 drivers/net/Kconfig|  24 ++
 include/configs/B4860QDS.h |   1 -
 include/configs/P1023RDB.h |   1 -
 include/configs/P2041RDB.h |   1 -
 include/configs/T102xQDS.h |   1 -
 include/configs/T102xRDB.h |   1 -
 include/configs/T1040QDS.h |   1 -
 include/configs/T104xRDB.h |   1 -
 include/configs/T208xQDS.h |   1 -
 include/configs/T208xRDB.h |   1 -
 include/configs/T4240QDS.h |   1 -
 include/configs/T4240RDB.h |   1 -
 include/configs/corenet_ds.h   |   1 -
 include/configs/cyrus.h|   1 -
 include/configs/km/kmp204x-common.h|   1 -
 include/configs/ls1046a_common.h   |   4 -
 include/fsl_qbman.h|  75 +
 34 files changed, 477 insertions(+), 369 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v5 2/2] Move SYS_DPAA_QBMAN to Kconfig

2017-12-15 Thread Ahmed Mansour
The CONFIG_SYS_DPAA_QBMAN define is used by DPAA1 freescale SOCs to
add device tree fixups that allow deep sleep in Linux. The define was
placed in header files included by a number of boards, but was not
explicitly documented in any of the Kconfigs. A description was added
to the drivers/networking menuconfig and default selection for
current SOCs that have this part

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v5:
- Add net device to T1024QDS_DDR4_defconfig to enable QBMan fixup
- Remove QBMan define in kmp204x-common.h and rely on SOC auto select

Changes in v4:
- Add QBMan support in Kconfig auto select for B4420 and T4160 SOCs

Changes in v3: None
Changes in v2: None

 configs/T1024QDS_DDR4_defconfig |  1 +
 drivers/net/Kconfig | 24 
 include/configs/B4860QDS.h  |  1 -
 include/configs/P1023RDB.h  |  1 -
 include/configs/P2041RDB.h  |  1 -
 include/configs/T102xQDS.h  |  1 -
 include/configs/T102xRDB.h  |  1 -
 include/configs/T1040QDS.h  |  1 -
 include/configs/T104xRDB.h  |  1 -
 include/configs/T208xQDS.h  |  1 -
 include/configs/T208xRDB.h  |  1 -
 include/configs/T4240QDS.h  |  1 -
 include/configs/T4240RDB.h  |  1 -
 include/configs/corenet_ds.h|  1 -
 include/configs/cyrus.h |  1 -
 include/configs/km/kmp204x-common.h |  1 -
 include/configs/ls1043a_common.h|  2 --
 include/configs/ls1046a_common.h|  4 
 18 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/configs/T1024QDS_DDR4_defconfig b/configs/T1024QDS_DDR4_defconfig
index b8e083c..4a09a5c 100644
--- a/configs/T1024QDS_DDR4_defconfig
+++ b/configs/T1024QDS_DDR4_defconfig
@@ -34,6 +34,7 @@ CONFIG_SPI_FLASH_EON=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_SST=y
 CONFIG_PHYLIB=y
+CONFIG_NETDEVICES=y
 CONFIG_SYS_NS16550=y
 CONFIG_FSL_ESPI=y
 CONFIG_USB=y
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 52555da..49f78fc 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -365,4 +365,28 @@ config FEC2_PHY_NORXERR
  The PHY does not have a RXERR line (RMII only).
  (so program the FEC to ignore it).
 
+config SYS_DPAA_QBMAN
+   bool "Device tree fixup for QBMan on freescale SOCs"
+   depends on (ARM || PPC) && !SPL_BUILD
+   default y if ARCH_B4860 || \
+ARCH_B4420 || \
+ARCH_P1023 || \
+ARCH_P2041 || \
+ARCH_T1023 || \
+ARCH_T1024 || \
+ARCH_T1040 || \
+ARCH_T1042 || \
+ARCH_T2080 || \
+ARCH_T2081 || \
+ARCH_T4240 || \
+ARCH_T4160 || \
+ARCH_P4080 || \
+ARCH_P3041 || \
+ARCH_P5040 || \
+ARCH_P5020 || \
+ARCH_LS1043A || \
+ARCH_LS1046A
+   help
+ QBman fixups to allow deep sleep in DPAA 1 SOCs
+
 endif # NETDEVICES
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 661bc8b..7f9482d 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -572,7 +572,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS25
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
index 1b78a4f..56e3f48 100644
--- a/include/configs/P1023RDB.h
+++ b/include/configs/P1023RDB.h
@@ -272,7 +272,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADADDR100
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* support Q/Bman */
 #define CONFIG_SYS_QMAN_MEM_BASE   0xff00
 #define CONFIG_SYS_QMAN_MEM_PHYS   CONFIG_SYS_QMAN_MEM_BASE
 #define CONFIG_SYS_QMAN_MEM_SIZE   0x0020
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 917e5d5..aa89405 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -438,7 +438,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_PCIE3_IO_SIZE   0x0001  /* 64k */
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index ed6df53..181ec42 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -642,7 +642,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NU

[U-Boot] [PATCH v5 1/2] drivers/misc: Share qbman init between archs

2017-12-15 Thread Ahmed Mansour
This patch adds changes necessary to move functionality present in
PowerPC folders with ARM architectures that have DPAA1 QBMan hardware

- Create new board/freescale/common/fsl_portals.c to house shared
  device tree fixups for DPAA1 devices with ARM and PowerPC cores
- Add new header file to top includes directory to allow files in
  both architectures to grab the function prototypes
- Port inhibit_portals() from PowerPC to ARM. This function is used in
  setup to disable interrupts on all QMan and BMan portals. It is
  needed because the interrupts are enabled by default for all portals
  including unused/uninitialised portals. When the kernel attempts to
  go to deep sleep the unused portals prevent it from doing so

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v5:
- Include  to fix missing prototype in p1023rdb.c

Changes in v4:
- Update function name setup_portals() to setup_qbman_portals() in
  files that were missed the first time

Changes in v3:
- Add freescale old copyright in new file since it is a modified copy
- Add ifdef QBMAN guard around get_qman_freq()
- Return freq_qman instead of freq_systembus. More readable and robust
- Add white space before return line in get_qman_freq()

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  14 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 board/freescale/p1023rdb/p1023rdb.c|   3 +-
 board/keymile/kmp204x/kmp204x.c|   2 +-
 board/varisys/cyrus/cyrus.c|   2 +-
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 305 +
 include/configs/ls1043a_common.h   |   2 +
 include/fsl_qbman.h|  75 +
 18 files changed, 454 insertions(+), 351 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index d082629..3fd352f 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -30,6 +30,7 @@
 #endif
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -565,6 +566,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_FMAN_ENET
fman_enet_init();
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   setup_qbman_portals();
+#endif
return 0;
 }
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index cae59da..382bf3d 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -26,6 +26,8 @@
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
 #include 
 #endif
+#include 
+#include 
 
 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
@@ -415,6 +417,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_esdhc(blob, bd);
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   fdt_fixup_bportals(blob);
+   fdt_fixup_qportals(blob);
+   do_fixup_by_compat_u32(blob, "fsl,qman",
+  "clock-frequency", get_qman_freq(), 1);
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_firmware(blob);
 #endif
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
index 2d7775e..5f23aad 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
@@ -155,8 +155,22 @@ void get_sys_info(struct sys_info *sys_info)
sys_info->freq_localbus = sys_info->freq_systembus /
CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   sys_info->freq_qman = sys_info->freq_systembus;
+#endif
 }
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+unsigned long get_qman_freq(void)
+{
+   struct sys_info sys_info;
+
+   get_sys_info(_info);
+
+   return sys_info.freq_qman;
+}
+#endif
+
 int get_clocks(void)
 {
struct sys_info sys_info;
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b

[U-Boot] [PATCH v4 1/2] drivers/misc: Share qbman init between archs

2017-12-14 Thread Ahmed Mansour
This patch adds changes necessary to move functionality present in
PowerPC folders with ARM architectures that have DPAA1 QBMan hardware

- Create new board/freescale/common/fsl_portals.c to house shared
  device tree fixups for DPAA1 devices with ARM and PowerPC cores
- Add new header file to top includes directory to allow files in
  both architectures to grab the function prototypes
- Port inhibit_portals() from PowerPC to ARM. This function is used in
  setup to disable interrupts on all QMan and BMan portals. It is
  needed because the interrupts are enabled by default for all portals
  including unused/uninitialised portals. When the kernel attempts to
  go to deep sleep the unused portals prevent it from doing so

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v4:
- Update function name setup_portals() to setup_qbman_portals() in
  files that were missed the first time

Changes in v3:
- Add freescale old copyright in new file since it is a modified copy
- Add ifdef QBMAN guard around get_qman_freq()
- Return freq_qman instead of freq_systembus. More readable and robust
- Add white space before return line in get_qman_freq()

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  14 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 board/freescale/p1023rdb/p1023rdb.c|   2 +-
 board/keymile/kmp204x/kmp204x.c|   2 +-
 board/varisys/cyrus/cyrus.c|   2 +-
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 305 +
 include/configs/ls1043a_common.h   |   2 +
 include/fsl_qbman.h|  75 +
 18 files changed, 453 insertions(+), 351 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index d082629..3fd352f 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -30,6 +30,7 @@
 #endif
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -565,6 +566,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_FMAN_ENET
fman_enet_init();
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   setup_qbman_portals();
+#endif
return 0;
 }
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index cae59da..382bf3d 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -26,6 +26,8 @@
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
 #include 
 #endif
+#include 
+#include 
 
 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
@@ -415,6 +417,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_esdhc(blob, bd);
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   fdt_fixup_bportals(blob);
+   fdt_fixup_qportals(blob);
+   do_fixup_by_compat_u32(blob, "fsl,qman",
+  "clock-frequency", get_qman_freq(), 1);
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_firmware(blob);
 #endif
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
index 2d7775e..5f23aad 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
@@ -155,8 +155,22 @@ void get_sys_info(struct sys_info *sys_info)
sys_info->freq_localbus = sys_info->freq_systembus /
CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   sys_info->freq_qman = sys_info->freq_systembus;
+#endif
 }
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+unsigned long get_qman_freq(void)
+{
+   struct sys_info sys_info;
+
+   get_sys_info(_info);
+
+   return sys_info.freq_qman;
+}
+#endif
+
 int get_clocks(void)
 {
struct sys_info sys_info;
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index 2561e

[U-Boot] [PATCH v4 0/2] arm: ppc: Share DPAA1 fixups between ARCHs

2017-12-14 Thread Ahmed Mansour
- Support DPAA1 QBMan device tree fixups in a shared location for both
  arm and ppc architectures
- cleanup a define from header files and add as Kconfig with auto
  selection based on SOC

Changes in v4:
- Update function name setup_portals() to setup_qbman_portals() in
  files that were missed the first time
- Added QBMan support in Kconfig auto select for B4420 and T4160 SOCs

Changes in v3:
- Add freescale old copyright in new file since it is a modified copy
- Add ifdef QBMAN guard around get_qman_freq()
- Return freq_qman instead of freq_systembus. More readable and robust
- Add white space before return line in get_qman_freq()

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

Ahmed Mansour (2):
  drivers/misc: Share qbman init between archs
  Move SYS_DPAA_QBMAN to Kconfig

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  14 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 board/freescale/p1023rdb/p1023rdb.c|   2 +-
 board/keymile/kmp204x/kmp204x.c|   2 +-
 board/varisys/cyrus/cyrus.c|   2 +-
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 305 +
 drivers/net/Kconfig|  24 ++
 include/configs/B4860QDS.h |   1 -
 include/configs/P1023RDB.h |   1 -
 include/configs/P2041RDB.h |   1 -
 include/configs/T102xQDS.h |   1 -
 include/configs/T102xRDB.h |   1 -
 include/configs/T1040QDS.h |   1 -
 include/configs/T104xRDB.h |   1 -
 include/configs/T208xQDS.h |   1 -
 include/configs/T208xRDB.h |   1 -
 include/configs/T4240QDS.h |   1 -
 include/configs/T4240RDB.h |   1 -
 include/configs/corenet_ds.h   |   1 -
 include/configs/cyrus.h|   1 -
 include/configs/ls1046a_common.h   |   4 -
 include/fsl_qbman.h|  75 +
 32 files changed, 475 insertions(+), 368 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v4 2/2] Move SYS_DPAA_QBMAN to Kconfig

2017-12-14 Thread Ahmed Mansour
The CONFIG_SYS_DPAA_QBMAN define is used by DPAA1 freescale SOCs to
add device tree fixups that allow deep sleep in Linux. The define was
placed in header files included by a number of boards, but was not
explicitly documented in any of the Kconfigs. A description was added
to the drivers/networking menuconfig and default selection for
current SOCs that have this part

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v4:
- Added QBMan support in Kconfig auto select for B4420 and T4160 SOCs

Changes in v3: None
Changes in v2: None

 drivers/net/Kconfig  | 24 
 include/configs/B4860QDS.h   |  1 -
 include/configs/P1023RDB.h   |  1 -
 include/configs/P2041RDB.h   |  1 -
 include/configs/T102xQDS.h   |  1 -
 include/configs/T102xRDB.h   |  1 -
 include/configs/T1040QDS.h   |  1 -
 include/configs/T104xRDB.h   |  1 -
 include/configs/T208xQDS.h   |  1 -
 include/configs/T208xRDB.h   |  1 -
 include/configs/T4240QDS.h   |  1 -
 include/configs/T4240RDB.h   |  1 -
 include/configs/corenet_ds.h |  1 -
 include/configs/cyrus.h  |  1 -
 include/configs/ls1043a_common.h |  2 --
 include/configs/ls1046a_common.h |  4 
 16 files changed, 24 insertions(+), 19 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 52555da..49f78fc 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -365,4 +365,28 @@ config FEC2_PHY_NORXERR
  The PHY does not have a RXERR line (RMII only).
  (so program the FEC to ignore it).
 
+config SYS_DPAA_QBMAN
+   bool "Device tree fixup for QBMan on freescale SOCs"
+   depends on (ARM || PPC) && !SPL_BUILD
+   default y if ARCH_B4860 || \
+ARCH_B4420 || \
+ARCH_P1023 || \
+ARCH_P2041 || \
+ARCH_T1023 || \
+ARCH_T1024 || \
+ARCH_T1040 || \
+ARCH_T1042 || \
+ARCH_T2080 || \
+ARCH_T2081 || \
+ARCH_T4240 || \
+ARCH_T4160 || \
+ARCH_P4080 || \
+ARCH_P3041 || \
+ARCH_P5040 || \
+ARCH_P5020 || \
+ARCH_LS1043A || \
+ARCH_LS1046A
+   help
+ QBman fixups to allow deep sleep in DPAA 1 SOCs
+
 endif # NETDEVICES
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 661bc8b..7f9482d 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -572,7 +572,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS25
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
index 1b78a4f..56e3f48 100644
--- a/include/configs/P1023RDB.h
+++ b/include/configs/P1023RDB.h
@@ -272,7 +272,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADADDR100
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* support Q/Bman */
 #define CONFIG_SYS_QMAN_MEM_BASE   0xff00
 #define CONFIG_SYS_QMAN_MEM_PHYS   CONFIG_SYS_QMAN_MEM_BASE
 #define CONFIG_SYS_QMAN_MEM_SIZE   0x0020
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 917e5d5..aa89405 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -438,7 +438,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_PCIE3_IO_SIZE   0x0001  /* 64k */
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index ed6df53..181ec42 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -642,7 +642,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index 7dee2f0..e1f2196 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -649,7 +649,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index bc5c0d2..220eddc 100644
--- a/include/configs/T1040QDS

[U-Boot] [PATCH v3 0/2] arm: ppc: Share DPAA1 fixups between ARCHs

2017-12-11 Thread Ahmed Mansour
- Support DPAA1 QBMan device tree fixups in a shared location for both
  arm and ppc architectures
- cleanup a define from header files and add as Kconfig with auto
  selection based on SOC

Changes in v3:
- Add freescale old copyright in new file since it is a modified copy
- Add ifdef QBMAN guard around get_qman_freq()
- Return freq_qman instead of freq_systembus. More readable and robust
- Add white space before return line in get_qman_freq()

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

Ahmed Mansour (2):
  drivers/misc: Share qbman init between archs
  Move SYS_DPAA_QBMAN to Kconfig

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  14 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 305 +
 drivers/net/Kconfig|  22 ++
 include/configs/B4860QDS.h |   1 -
 include/configs/P1023RDB.h |   1 -
 include/configs/P2041RDB.h |   1 -
 include/configs/T102xQDS.h |   1 -
 include/configs/T102xRDB.h |   1 -
 include/configs/T1040QDS.h |   1 -
 include/configs/T104xRDB.h |   1 -
 include/configs/T208xQDS.h |   1 -
 include/configs/T208xRDB.h |   1 -
 include/configs/T4240QDS.h |   1 -
 include/configs/T4240RDB.h |   1 -
 include/configs/corenet_ds.h   |   1 -
 include/configs/cyrus.h|   1 -
 include/configs/ls1046a_common.h   |   4 -
 include/fsl_qbman.h|  75 +
 29 files changed, 470 insertions(+), 365 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 1/2] drivers/misc: Share qbman init between archs

2017-12-11 Thread Ahmed Mansour
This patch adds changes necessary to move functionality present in
PowerPC folders with ARM architectures that have DPAA1 QBMan hardware

- Create new board/freescale/common/fsl_portals.c to house shared
  device tree fixups for DPAA1 devices with ARM and PowerPC cores
- Add new header file to top includes directory to allow files in
  both architectures to grab the function prototypes
- Port inhibit_portals() from PowerPC to ARM. This function is used in
  setup to disable interrupts on all QMan and BMan portals. It is
  needed because the interrupts are enabled by default for all portals
  including unused/uninitialised portals. When the kernel attempts to
  go to deep sleep the unused portals prevent it from doing so

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v3:
- Add freescale old copyright in new file since it is a modified copy
- Add ifdef QBMAN guard around get_qman_freq()
- Return freq_qman instead of freq_systembus. More readable and robust
- Add white space before return line in get_qman_freq()

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  14 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   3 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 305 +
 include/configs/ls1043a_common.h   |   2 +
 include/fsl_qbman.h|  75 +
 15 files changed, 450 insertions(+), 348 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index d082629..3fd352f 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -30,6 +30,7 @@
 #endif
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -565,6 +566,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_FMAN_ENET
fman_enet_init();
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   setup_qbman_portals();
+#endif
return 0;
 }
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index cae59da..382bf3d 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -26,6 +26,8 @@
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
 #include 
 #endif
+#include 
+#include 
 
 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
@@ -415,6 +417,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_esdhc(blob, bd);
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   fdt_fixup_bportals(blob);
+   fdt_fixup_qportals(blob);
+   do_fixup_by_compat_u32(blob, "fsl,qman",
+  "clock-frequency", get_qman_freq(), 1);
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_firmware(blob);
 #endif
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
index 2d7775e..5f23aad 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
@@ -155,8 +155,22 @@ void get_sys_info(struct sys_info *sys_info)
sys_info->freq_localbus = sys_info->freq_systembus /
CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   sys_info->freq_qman = sys_info->freq_systembus;
+#endif
 }
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+unsigned long get_qman_freq(void)
+{
+   struct sys_info sys_info;
+
+   get_sys_info(_info);
+
+   return sys_info.freq_qman;
+}
+#endif
+
 int get_clocks(void)
 {
struct sys_info sys_info;
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index 2561ead..1ff5cac 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -23,6 +23,8 @@
 #define CONFIG_SYS_FSL_GUTS_ADDR   (CONFIG_SYS_IMMR + 0x00ee)
 #define CONFIG_SYS_FSL_RST_ADDR   

[U-Boot] [PATCH v3 2/2] Move SYS_DPAA_QBMAN to Kconfig

2017-12-11 Thread Ahmed Mansour
The CONFIG_SYS_DPAA_QBMAN define is used by DPAA1 freescale SOCs to
add device tree fixups that allow deep sleep in Linux. The define was
placed in header files included by a number of boards, but was not
explicitly documented in any of the Kconfigs. A description was added
to the drivers/networking menuconfig and default selection for
current SOCs that have this part

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v3: None
Changes in v2: None

 drivers/net/Kconfig  | 22 ++
 include/configs/B4860QDS.h   |  1 -
 include/configs/P1023RDB.h   |  1 -
 include/configs/P2041RDB.h   |  1 -
 include/configs/T102xQDS.h   |  1 -
 include/configs/T102xRDB.h   |  1 -
 include/configs/T1040QDS.h   |  1 -
 include/configs/T104xRDB.h   |  1 -
 include/configs/T208xQDS.h   |  1 -
 include/configs/T208xRDB.h   |  1 -
 include/configs/T4240QDS.h   |  1 -
 include/configs/T4240RDB.h   |  1 -
 include/configs/corenet_ds.h |  1 -
 include/configs/cyrus.h  |  1 -
 include/configs/ls1043a_common.h |  2 --
 include/configs/ls1046a_common.h |  4 
 16 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 52555da..db4c176 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -365,4 +365,26 @@ config FEC2_PHY_NORXERR
  The PHY does not have a RXERR line (RMII only).
  (so program the FEC to ignore it).
 
+config SYS_DPAA_QBMAN
+   bool "Device tree fixup for QBMan on freescale SOCs"
+   depends on (ARM || PPC) && !SPL_BUILD
+   default y if ARCH_B4860 || \
+ARCH_P1023 || \
+ARCH_P2041 || \
+ARCH_T1023 || \
+ARCH_T1024 || \
+ARCH_T1040 || \
+ARCH_T1042 || \
+ARCH_T2080 || \
+ARCH_T2081 || \
+ARCH_T4240 || \
+ARCH_P4080 || \
+ARCH_P3041 || \
+ARCH_P5040 || \
+ARCH_P5020 || \
+ARCH_LS1043A || \
+ARCH_LS1046A
+   help
+ QBman fixups to allow deep sleep in DPAA 1 SOCs
+
 endif # NETDEVICES
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 661bc8b..7f9482d 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -572,7 +572,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS25
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
index 1b78a4f..56e3f48 100644
--- a/include/configs/P1023RDB.h
+++ b/include/configs/P1023RDB.h
@@ -272,7 +272,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADADDR100
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* support Q/Bman */
 #define CONFIG_SYS_QMAN_MEM_BASE   0xff00
 #define CONFIG_SYS_QMAN_MEM_PHYS   CONFIG_SYS_QMAN_MEM_BASE
 #define CONFIG_SYS_QMAN_MEM_SIZE   0x0020
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 6008237..5f7ebe7 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -438,7 +438,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_PCIE3_IO_SIZE   0x0001  /* 64k */
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index 259e8a0..13f4c92 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -644,7 +644,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index 7dee2f0..e1f2196 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -649,7 +649,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index c694e50..c186d15 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -535,7 +535,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#defi

[U-Boot] [PATCH v2 0/2] arm: ppc: Share DPAA1 fixups between ARCHs

2017-12-08 Thread Ahmed Mansour
- Support DPAA1 QBMan device tree fixups in a shared location for both
  arm and ppc architectures
- cleanup a define from header files and add as Kconfig with auto
  selection based on SOC

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

Ahmed Mansour (2):
  drivers/misc: Share qbman init between archs
  Move SYS_DPAA_QBMAN to Kconfig

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  11 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   1 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 304 +
 drivers/net/Kconfig|  22 ++
 include/configs/B4860QDS.h |   1 -
 include/configs/P1023RDB.h |   1 -
 include/configs/P2041RDB.h |   1 -
 include/configs/T102xQDS.h |   1 -
 include/configs/T102xRDB.h |   1 -
 include/configs/T1040QDS.h |   1 -
 include/configs/T104xRDB.h |   1 -
 include/configs/T208xQDS.h |   1 -
 include/configs/T208xRDB.h |   1 -
 include/configs/T4240QDS.h |   1 -
 include/configs/T4240RDB.h |   1 -
 include/configs/corenet_ds.h   |   1 -
 include/configs/cyrus.h|   1 -
 include/configs/ls1046a_common.h   |   4 -
 include/fsl_qbman.h|  75 +
 29 files changed, 464 insertions(+), 365 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v2 2/2] Move SYS_DPAA_QBMAN to Kconfig

2017-12-08 Thread Ahmed Mansour
The CONFIG_SYS_DPAA_QBMAN define is used by DPAA1 freescale SOCs to
add device tree fixups that allow deep sleep in Linux. The define was
placed in header files included by a number of boards, but was not
explicitly documented in any of the Kconfigs. A description was added
to the drivers/networking menuconfig and default selection for
current SOCs that have this part

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v2: None

 drivers/net/Kconfig  | 22 ++
 include/configs/B4860QDS.h   |  1 -
 include/configs/P1023RDB.h   |  1 -
 include/configs/P2041RDB.h   |  1 -
 include/configs/T102xQDS.h   |  1 -
 include/configs/T102xRDB.h   |  1 -
 include/configs/T1040QDS.h   |  1 -
 include/configs/T104xRDB.h   |  1 -
 include/configs/T208xQDS.h   |  1 -
 include/configs/T208xRDB.h   |  1 -
 include/configs/T4240QDS.h   |  1 -
 include/configs/T4240RDB.h   |  1 -
 include/configs/corenet_ds.h |  1 -
 include/configs/cyrus.h  |  1 -
 include/configs/ls1043a_common.h |  2 --
 include/configs/ls1046a_common.h |  4 
 16 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 52555da..db4c176 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -365,4 +365,26 @@ config FEC2_PHY_NORXERR
  The PHY does not have a RXERR line (RMII only).
  (so program the FEC to ignore it).
 
+config SYS_DPAA_QBMAN
+   bool "Device tree fixup for QBMan on freescale SOCs"
+   depends on (ARM || PPC) && !SPL_BUILD
+   default y if ARCH_B4860 || \
+ARCH_P1023 || \
+ARCH_P2041 || \
+ARCH_T1023 || \
+ARCH_T1024 || \
+ARCH_T1040 || \
+ARCH_T1042 || \
+ARCH_T2080 || \
+ARCH_T2081 || \
+ARCH_T4240 || \
+ARCH_P4080 || \
+ARCH_P3041 || \
+ARCH_P5040 || \
+ARCH_P5020 || \
+ARCH_LS1043A || \
+ARCH_LS1046A
+   help
+ QBman fixups to allow deep sleep in DPAA 1 SOCs
+
 endif # NETDEVICES
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 661bc8b..7f9482d 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -572,7 +572,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS25
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
index 1b78a4f..56e3f48 100644
--- a/include/configs/P1023RDB.h
+++ b/include/configs/P1023RDB.h
@@ -272,7 +272,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADADDR100
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* support Q/Bman */
 #define CONFIG_SYS_QMAN_MEM_BASE   0xff00
 #define CONFIG_SYS_QMAN_MEM_PHYS   CONFIG_SYS_QMAN_MEM_BASE
 #define CONFIG_SYS_QMAN_MEM_SIZE   0x0020
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 6008237..5f7ebe7 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -438,7 +438,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_PCIE3_IO_SIZE   0x0001  /* 64k */
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index 259e8a0..13f4c92 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -644,7 +644,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index 7dee2f0..e1f2196 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -649,7 +649,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index c694e50..c186d15 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -535,7 +535,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN   

[U-Boot] [PATCH v2 1/2] drivers/misc: Share qbman init between archs

2017-12-08 Thread Ahmed Mansour
This patch adds changes necessary to move functionality present in
PowerPC folders with ARM architectures that have DPAA1 QBMan hardware

- Create new board/freescale/common/fsl_portals.c to house shared
  device tree fixups for DPAA1 devices with ARM and PowerPC cores
- Add new header file to top includes directory to allow files in
  both architectures to grab the function prototypes
- Port inhibit_portals() from PowerPC to ARM. This function is used in
  setup to disable interrupts on all QMan and BMan portals. It is
  needed because the interrupts are enabled by default for all portals
  including unused/uninitialised portals. When the kernel attempts to
  go to deep sleep the unused portals prevent it from doing so

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

Changes in v2:
- Add get_qman_freq() to replace get_sys_info() for readability
- Correct the copyright year in new files
- Replace !ARM with PPC to wall off PowerPC SOCs specific qman setup
- Rename portals.c -> fsl_portals.c for clarity

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|   9 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |  11 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/arm/include/asm/arch-fsl-layerscape/speed.h   |   1 +
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 drivers/misc/Makefile  |   1 +
 drivers/misc/fsl_portals.c | 304 +
 include/configs/ls1043a_common.h   |   2 +
 include/fsl_qbman.h|  75 +
 15 files changed, 444 insertions(+), 348 deletions(-)
 create mode 100644 drivers/misc/fsl_portals.c
 create mode 100644 include/fsl_qbman.h

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index d082629..3fd352f 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -30,6 +30,7 @@
 #endif
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -565,6 +566,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_FMAN_ENET
fman_enet_init();
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   setup_qbman_portals();
+#endif
return 0;
 }
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index cae59da..382bf3d 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -26,6 +26,8 @@
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
 #include 
 #endif
+#include 
+#include 
 
 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
@@ -415,6 +417,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_esdhc(blob, bd);
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   fdt_fixup_bportals(blob);
+   fdt_fixup_qportals(blob);
+   do_fixup_by_compat_u32(blob, "fsl,qman",
+  "clock-frequency", get_qman_freq(), 1);
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_firmware(blob);
 #endif
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
index 2d7775e..f707205 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
@@ -155,6 +155,17 @@ void get_sys_info(struct sys_info *sys_info)
sys_info->freq_localbus = sys_info->freq_systembus /
CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   sys_info->freq_qman = sys_info->freq_systembus;
+#endif
+}
+
+unsigned long get_qman_freq(void)
+{
+   struct sys_info sys_info;
+
+   get_sys_info(_info);
+   return sys_info.freq_systembus;
 }
 
 int get_clocks(void)
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index 2561ead..1ff5cac 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -23,6 +23,8 @@
 #define CONFIG_SYS_FSL_GUTS_ADDR   (CONFIG_SYS_IMMR + 0x00ee)
 #define CONFIG_SYS_FSL_RST_ADDR(CONFIG_SYS_IMMR + 
0x00ee00b0)
 #define CONFIG_SYS_FSL_SCFG_ADDR   (CONFIG_SYS_IMMR + 0x0057)
+#define CONFIG_SYS_FSL_BMAN_ADDR   (CONFIG_SYS_IMMR + 0x0089)
+#define CONFIG_SYS_FSL_QMAN_ADDR   (CONFIG_SYS_IMMR + 0x0088)
 #define CONFIG_SYS_FSL_FMAN_ADDR   (CONFIG_SYS_IMMR + 0x00a0

[U-Boot] [PATCH v1 2/2] Move SYS_DPAA_QBMAN to Kconfig

2017-12-07 Thread Ahmed Mansour
The CONFIG_SYS_DPAA_QBMAN define is used by DPAA1 freescale SOCs to
add device tree fixups that allow deep sleep in Linux. The define was
placed in header files included by a number of boards, but was not
explicitly documented in any of the Kconfigs. A description was added
to the drivers/networking menuconfig and default selection for
current SOCs that have this part

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>

---

 drivers/net/Kconfig  | 22 ++
 include/configs/B4860QDS.h   |  1 -
 include/configs/P1023RDB.h   |  1 -
 include/configs/P2041RDB.h   |  1 -
 include/configs/T102xQDS.h   |  1 -
 include/configs/T102xRDB.h   |  1 -
 include/configs/T1040QDS.h   |  1 -
 include/configs/T104xRDB.h   |  1 -
 include/configs/T208xQDS.h   |  1 -
 include/configs/T208xRDB.h   |  1 -
 include/configs/T4240QDS.h   |  1 -
 include/configs/T4240RDB.h   |  1 -
 include/configs/corenet_ds.h |  1 -
 include/configs/cyrus.h  |  1 -
 include/configs/ls1043a_common.h |  2 --
 include/configs/ls1046a_common.h |  4 
 16 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 52555da..db4c176 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -365,4 +365,26 @@ config FEC2_PHY_NORXERR
  The PHY does not have a RXERR line (RMII only).
  (so program the FEC to ignore it).
 
+config SYS_DPAA_QBMAN
+   bool "Device tree fixup for QBMan on freescale SOCs"
+   depends on (ARM || PPC) && !SPL_BUILD
+   default y if ARCH_B4860 || \
+ARCH_P1023 || \
+ARCH_P2041 || \
+ARCH_T1023 || \
+ARCH_T1024 || \
+ARCH_T1040 || \
+ARCH_T1042 || \
+ARCH_T2080 || \
+ARCH_T2081 || \
+ARCH_T4240 || \
+ARCH_P4080 || \
+ARCH_P3041 || \
+ARCH_P5040 || \
+ARCH_P5020 || \
+ARCH_LS1043A || \
+ARCH_LS1046A
+   help
+ QBman fixups to allow deep sleep in DPAA 1 SOCs
+
 endif # NETDEVICES
diff --git a/include/configs/B4860QDS.h b/include/configs/B4860QDS.h
index 661bc8b..7f9482d 100644
--- a/include/configs/B4860QDS.h
+++ b/include/configs/B4860QDS.h
@@ -572,7 +572,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS25
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/P1023RDB.h b/include/configs/P1023RDB.h
index 1b78a4f..56e3f48 100644
--- a/include/configs/P1023RDB.h
+++ b/include/configs/P1023RDB.h
@@ -272,7 +272,6 @@ extern unsigned long get_clock_freq(void);
 #define CONFIG_LOADADDR100
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* support Q/Bman */
 #define CONFIG_SYS_QMAN_MEM_BASE   0xff00
 #define CONFIG_SYS_QMAN_MEM_PHYS   CONFIG_SYS_QMAN_MEM_BASE
 #define CONFIG_SYS_QMAN_MEM_SIZE   0x0020
diff --git a/include/configs/P2041RDB.h b/include/configs/P2041RDB.h
index 6008237..5f7ebe7 100644
--- a/include/configs/P2041RDB.h
+++ b/include/configs/P2041RDB.h
@@ -438,7 +438,6 @@ unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_SYS_PCIE3_IO_SIZE   0x0001  /* 64k */
 
 /* Qman/Bman */
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xQDS.h b/include/configs/T102xQDS.h
index 259e8a0..13f4c92 100644
--- a/include/configs/T102xQDS.h
+++ b/include/configs/T102xQDS.h
@@ -644,7 +644,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T102xRDB.h b/include/configs/T102xRDB.h
index 7dee2f0..e1f2196 100644
--- a/include/configs/T102xRDB.h
+++ b/include/configs/T102xRDB.h
@@ -649,7 +649,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Support Q/Bman */
 #define CONFIG_SYS_BMAN_NUM_PORTALS10
 #define CONFIG_SYS_BMAN_MEM_BASE   0xf400
 #ifdef CONFIG_PHYS_64BIT
diff --git a/include/configs/T1040QDS.h b/include/configs/T1040QDS.h
index c694e50..c186d15 100644
--- a/include/configs/T1040QDS.h
+++ b/include/configs/T1040QDS.h
@@ -535,7 +535,6 @@ unsigned long get_board_ddr_clk(void);
 
 /* Qman/Bman */
 #ifndef CONFIG_NOBQFMAN
-#define CONFIG_SYS_DPAA_QBMAN  /* Su

[U-Boot] [PATCH v1 0/2] arm: ppc: Share DPAA1 fixups between ARCHs

2017-12-07 Thread Ahmed Mansour
- Support DPAA1 QBMan device tree fixups in a shared location for both
  arm and ppc architectures
- cleanup a define from header files and add as Kconfig with auto
  selection based on SOC


Ahmed Mansour (2):
  drivers/misc: Share qbman init between archs
  Move SYS_DPAA_QBMAN to Kconfig

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|  15 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |   3 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 drivers/misc/Makefile  |   1 +
 drivers/misc/portals.c | 312 +
 drivers/net/Kconfig|  22 ++
 include/configs/B4860QDS.h |   1 -
 include/configs/P1023RDB.h |   1 -
 include/configs/P2041RDB.h |   1 -
 include/configs/T102xQDS.h |   1 -
 include/configs/T102xRDB.h |   1 -
 include/configs/T1040QDS.h |   1 -
 include/configs/T104xRDB.h |   1 -
 include/configs/T208xQDS.h |   1 -
 include/configs/T208xRDB.h |   1 -
 include/configs/T4240QDS.h |   1 -
 include/configs/T4240RDB.h |   1 -
 include/configs/corenet_ds.h   |   1 -
 include/configs/cyrus.h|   1 -
 include/configs/ls1046a_common.h   |   4 -
 include/fsl_qbman.h|  75 +
 28 files changed, 469 insertions(+), 365 deletions(-)
 create mode 100644 drivers/misc/portals.c
 create mode 100644 include/fsl_qbman.h

-- 
2.7.4

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v1 1/2] drivers/misc: Share qbman init between archs

2017-12-07 Thread Ahmed Mansour
This patch adds changes necessary to move functionality present in
PowerPC folders with ARM architectures that have DPAA1 QBMan hardware

- Created new board/freescale/common/portals.c to house shared device
  tree fixups for DPAA1 devices with ARM and PowerPC cores
- Added new header file to top includes directory to allow files in
  both architectures to grab the function prototypes
- Port inhibit_portals() from PowerPC to ARM. This function is used in
  setup to disable interrupts on all QMan and BMan portals. It is
  needed because the interrupts are enabled by default for all portals
  including unused/uninitialised portals. When the kernel attempts to
  go to deep sleep the unused portals prevent it from doing so

Signed-off-by: Ahmed Mansour <ahmed.mans...@nxp.com>
---

 arch/arm/cpu/armv8/fsl-layerscape/cpu.c|   4 +
 arch/arm/cpu/armv8/fsl-layerscape/fdt.c|  15 +
 .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c |   3 +
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  29 ++
 arch/powerpc/cpu/mpc85xx/cpu_init.c|   3 +-
 arch/powerpc/cpu/mpc85xx/fdt.c |   1 +
 arch/powerpc/cpu/mpc85xx/portals.c | 281 ---
 arch/powerpc/include/asm/fsl_liodn.h   |   7 +-
 arch/powerpc/include/asm/fsl_portals.h |   4 -
 arch/powerpc/include/asm/immap_85xx.h  |  60 
 drivers/misc/Makefile  |   1 +
 drivers/misc/portals.c | 312 +
 include/configs/ls1043a_common.h   |   2 +
 include/fsl_qbman.h|  75 +
 14 files changed, 449 insertions(+), 348 deletions(-)
 create mode 100644 drivers/misc/portals.c
 create mode 100644 include/fsl_qbman.h

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c 
b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
index ab5d76e..e67f489 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
@@ -29,6 +29,7 @@
 #include 
 #endif
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -527,6 +528,9 @@ int arch_early_init_r(void)
 #ifdef CONFIG_FMAN_ENET
fman_enet_init();
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   setup_qbman_portals();
+#endif
return 0;
 }
 
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
index cae59da..ba8b9e0 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
@@ -26,6 +26,8 @@
 #ifdef CONFIG_ARMV8_SEC_FIRMWARE_SUPPORT
 #include 
 #endif
+#include 
+#include 
 
 int fdt_fixup_phy_connection(void *blob, int offset, phy_interface_t phyc)
 {
@@ -395,6 +397,12 @@ void ft_cpu_setup(void *blob, bd_t *bd)
}
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   struct sys_info sysinfo;
+
+   get_sys_info();
+#endif
+
 #ifdef CONFIG_MP
ft_fixup_cpu(blob);
 #endif
@@ -415,6 +423,13 @@ void ft_cpu_setup(void *blob, bd_t *bd)
fdt_fixup_esdhc(blob, bd);
 #endif
 
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   fdt_fixup_bportals(blob);
+   fdt_fixup_qportals(blob);
+   do_fixup_by_compat_u32(blob, "fsl,qman",
+  "clock-frequency", sysinfo.freq_qman, 1);
+#endif
+
 #ifdef CONFIG_SYS_DPAA_FMAN
fdt_fixup_fman_firmware(blob);
 #endif
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c 
b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
index 2d7775e..eaab948 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c
@@ -155,6 +155,9 @@ void get_sys_info(struct sys_info *sys_info)
sys_info->freq_localbus = sys_info->freq_systembus /
CONFIG_SYS_FSL_IFC_CLK_DIV;
 #endif
+#ifdef CONFIG_SYS_DPAA_QBMAN
+   sys_info->freq_qman = sys_info->freq_systembus;
+#endif
 }
 
 int get_clocks(void)
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h 
b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index 2561ead..1ff5cac 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -23,6 +23,8 @@
 #define CONFIG_SYS_FSL_GUTS_ADDR   (CONFIG_SYS_IMMR + 0x00ee)
 #define CONFIG_SYS_FSL_RST_ADDR(CONFIG_SYS_IMMR + 
0x00ee00b0)
 #define CONFIG_SYS_FSL_SCFG_ADDR   (CONFIG_SYS_IMMR + 0x0057)
+#define CONFIG_SYS_FSL_BMAN_ADDR   (CONFIG_SYS_IMMR + 0x0089)
+#define CONFIG_SYS_FSL_QMAN_ADDR   (CONFIG_SYS_IMMR + 0x0088)
 #define CONFIG_SYS_FSL_FMAN_ADDR   (CONFIG_SYS_IMMR + 0x00a0)
 #define CONFIG_SYS_FSL_SERDES_ADDR (CONFIG_SYS_IMMR + 0x00ea)
 #define CONFIG_SYS_FSL_DCFG_ADDR   (CONFIG_SYS_IMMR + 0x00ee)
@@ -41,6 +43,33 @@
 #define CONFIG_SYS_SEC_MON_ADDR