Skip to contentSkip to conversation

ls102xa: HYP/non-sec: for ls102xa.

PATCH New Xiubo Li 2 participants 13 messages Nov 21, 2014 – Dec 11, 2014

Subsystems (2)
lore
Share & tools
lore

Xiubo Li

author
#0 lore raw

v4 cover ls102xa: HYP/non-sec: for ls102xa.

Change for V4:
- Split V3's 3/5 patch in two.
- Add a strong version of smp_kick_all_cpus().

Change for V3:
- Fixed the language in commit message.

Change for V2:
- All the registers were defined as a struct, here use it.
- Used CONFIG_PEN_ADDR_BIG_ENDIAN instead of CONFIG_SOC_BIG_ENDIAN.

Xiubo Li (6):
ARM: HYP/non-sec: add the pen address BE mode support.
ARM: HYP/non-sec: Fix the ARCH Timer frequency setting.
ls1021a: adding a secondary core boot address and kick functions
ls102xa: changing a few targets' configurations.
ARM: ls102xa: allow all the peripheral access permission as R/W.
ARM: ls102xa: Setting device's stream id for SMMUs.

 arch/arm/cpu/armv7/ls102xa/cpu.c                   |  18 ++++
 arch/arm/cpu/armv7/nonsec_virt.S                   |   7 +-
 arch/arm/include/asm/arch-ls102xa/config.h         |   3 +
 arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h  |   3 +
 .../include/asm/arch-ls102xa/ls102xa_stream_id.h   |  17 +++
 arch/arm/include/asm/arch-ls102xa/ns_access.h      | 118 +++++++++++++++++++++
 board/freescale/common/Makefile                    |   4 +
 board/freescale/common/ls102xa_stream_id.c         |  18 ++++
 board/freescale/common/ns_access.c                 |  30 ++++++
 board/freescale/ls1021aqds/ls1021aqds.c            | 113 ++++++++++++++++++++
 board/freescale/ls1021atwr/ls1021atwr.c            | 112 +++++++++++++++++++
 include/configs/ls1021aqds.h                       |  10 ++
 include/configs/ls1021atwr.h                       |  10 ++
 include/configs/sun7i.h                            |   1 +
 14 files changed, 462 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-ls102xa/ls102xa_stream_id.h
 create mode 100644 arch/arm/include/asm/arch-ls102xa/ns_access.h
 create mode 100644 board/freescale/common/ls102xa_stream_id.c
 create mode 100644 board/freescale/common/ns_access.c
Signature · 1 line
2.1.0.27.g96db324
author
#1 lore raw

PATCH v4 1/6 ARM: HYP/non-sec: add the pen address BE mode support.

For some SoCs, the pen address register maybe in BE mode and the CPUs are in LE mode.

This patch adds BE mode support for smp pen address.

---
 arch/arm/cpu/armv7/nonsec_virt.S | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/cpu/armv7/nonsec_virt.S +3 -0
index 745670e..1ab5d54 100644
@@ -191,6 +191,9 @@ ENTRY(smp_waitloop)
 	wfi
 	ldr	r1, =CONFIG_SMP_PEN_ADDR	@ load start address
 	ldr	r1, [r1]
+#ifdef CONFIG_PEN_ADDR_BIG_ENDIAN
+	rev	r1, r1
+#endif
 	cmp	r0, r1			@ make sure we dont execute this code
 	beq	smp_waitloop		@ again (due to a spurious wakeup)
 	mov	r0, r1
Signature · 1 line
2.1.0.27.g96db324
#2 lore raw

PATCH v4 1/6 ARM: HYP/non-sec: add the pen address BE mode support.

Quoted 8 lines · Xiubo Li

For some SoCs, the pen address register maybe in BE mode and the CPUs are in LE mode.

This patch adds BE mode support for smp pen address.

---

Applied to u-boot-fsl-qoriq master, awaiting upstream.

York

author
#3 lore raw

PATCH v4 2/6 ARM: HYP/non-sec: Fix the ARCH Timer frequency setting.

In reply to Xiubo Li

For some SoCs, the system clock frequency may not equal to the ARCH Timer's frequency.

This patch uses the CONFIG_TIMER_CLK_FREQ instead of CONFIG_SYS_CLK_FREQ, then the system clock macro and arch timer macor could be set separately and without interfering each other.

---
 arch/arm/cpu/armv7/nonsec_virt.S | 4 ++--
 include/configs/sun7i.h          | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/cpu/armv7/nonsec_virt.S +2 -2
index 1ab5d54..30d81db 100644
@@ -169,11 +169,11 @@ ENTRY(_nonsec_init)
  * we do this here instead.
  * But first check if we have the generic timer.
  */
-#ifdef CONFIG_SYS_CLK_FREQ
+#ifdef CONFIG_TIMER_CLK_FREQ
 	mrc	p15, 0, r0, c0, c1, 1		@ read ID_PFR1
 	and	r0, r0, #CPUID_ARM_GENTIMER_MASK	@ mask arch timer bits
 	cmp	r0, #(1 << CPUID_ARM_GENTIMER_SHIFT)
-	ldreq	r1, =CONFIG_SYS_CLK_FREQ
+	ldreq	r1, =CONFIG_TIMER_CLK_FREQ
 	mcreq	p15, 0, r1, c14, c0, 0		@ write CNTFRQ
 #endif
 
include/configs/sun7i.h +1 -0
index ea40790..5f8b95b 100644
@@ -28,6 +28,7 @@
 #define CONFIG_ARMV7_PSCI_NR_CPUS	2
 #define CONFIG_ARMV7_SECURE_BASE	SUNXI_SRAM_B_BASE
 #define CONFIG_SYS_CLK_FREQ		24000000
+#define CONFIG_SYS_TIMER_CLK_FREQ	CONFIG_SYS_CLK_FREQ
 
 /*
  * Include common sunxi configuration where most the settings are
Signature · 1 line
2.1.0.27.g96db324
#4 lore raw

PATCH v4 2/6 ARM: HYP/non-sec: Fix the ARCH Timer frequency setting.

Quoted 10 lines · Xiubo Li

For some SoCs, the system clock frequency may not equal to the ARCH Timer's frequency.

This patch uses the CONFIG_TIMER_CLK_FREQ instead of CONFIG_SYS_CLK_FREQ, then the system clock macro and arch timer macor could be set separately and without interfering each other.

---

Applied to u-boot-fsl-qoriq master, awaiting upstream.
This patch has been respined, the difference is applied as a separated commit.

York

author
#5 lore raw

PATCH v4 3/6 ls1021a: adding a secondary core boot address and kick functions

In reply to Xiubo Li

Define the board specific smp_set_cpu_boot_addr() function to set the start address for secondary cores in the LS1021A specific manner.

Define the board specific smp_kick_all_cpus() functioin to boot a secondary core. Here the BRR contains control bits for enabling boot for each core. On exiting HRESET or PORESET, the RCW BOOT_HO field optionally allows for logical core 0 to be released for booting or to remain in boot holdoff. All other cores remain in boot holdoff until their corresponding bit is set.

---
 arch/arm/cpu/armv7/ls102xa/cpu.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/arm/cpu/armv7/ls102xa/cpu.c +18 -0
index b7dde45..32b09e0 100644
@@ -101,3 +101,21 @@ int cpu_eth_init(bd_t *bis)
 
 	return 0;
 }
+
+#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+/* Set the address at which the secondary core starts from.*/
+void smp_set_core_boot_addr(unsigned long addr, int corenr)
+{
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+
+	out_be32(&gur->scratchrw[0], addr);
+}
+
+/* Release the secondary core from holdoff state and kick it */
+void smp_kick_all_cpus(void)
+{
+	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
+
+	out_be32(&gur->brrl, 0x2);
+}
+#endif
Signature · 1 line
2.1.0.27.g96db324
#6 lore raw

PATCH v4 3/6 ls1021a: adding a secondary core boot address and kick functions

Quoted 10 lines · Xiubo Li

Define the board specific smp_set_cpu_boot_addr() function to set the start address for secondary cores in the LS1021A specific manner.

Define the board specific smp_kick_all_cpus() functioin to boot a secondary core. Here the BRR contains control bits for enabling boot for each core. On exiting HRESET or PORESET, the RCW BOOT_HO field optionally allows for logical core 0 to be released for booting or to remain in boot holdoff. All other cores remain in boot holdoff until their corresponding bit is set.

Quoted 3 lines

---

Applied to u-boot-fsl-qoriq master, awaiting upstream.

York

author
#7 lore raw

PATCH v4 4/6 ls102xa: changing a few targets' configurations.

In reply to Xiubo Li

Enable hypervisors utilizing the ARMv7 virtualization extension on the LS1021A-QDS/TWR boards with the A7 core tile, we add the required configuration variable.

---
 arch/arm/include/asm/arch-ls102xa/config.h        | 2 ++
 arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h | 3 +++
 include/configs/ls1021aqds.h                      | 7 +++++++
 include/configs/ls1021atwr.h                      | 7 +++++++
 4 files changed, 19 insertions(+)
arch/arm/include/asm/arch-ls102xa/config.h +2 -0
index f2c9687..750429f 100644
@@ -11,6 +11,8 @@
 
 #define OCRAM_BASE_ADDR				0x10000000
 #define OCRAM_SIZE				0x00020000
+#define OCRAM_BASE_S_ADDR			0x10010000
+#define OCRAM_S_SIZE				0x00010000
 
 #define CONFIG_SYS_IMMR				0x01000000
 
arch/arm/include/asm/arch-ls102xa/immap_ls102xa.h +3 -0
index 7995fe2..0bac353 100644
@@ -17,6 +17,9 @@
 #define SOC_VER_LS1021		0x11
 #define SOC_VER_LS1022		0x12
 
+#define CCSR_BRR_OFFSET		0xe4
+#define CCSR_SCRATCHRW1_OFFSET	0x200
+
 #define RCWSR0_SYS_PLL_RAT_SHIFT	25
 #define RCWSR0_SYS_PLL_RAT_MASK		0x1f
 #define RCWSR0_MEM_PLL_RAT_SHIFT	16
include/configs/ls1021aqds.h +7 -0
index d1f6ea7..b53e9d0 100644
@@ -327,6 +327,13 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_CMD_IMLS
 
+#define CONFIG_ARMV7_NONSEC
+#define CONFIG_ARMV7_VIRT
+#define CONFIG_PEN_ADDR_BIG_ENDIAN
+#define CONFIG_SMP_PEN_ADDR		0x01ee0200
+#define CONFIG_TIMER_CLK_FREQ		12500000
+#define CONFIG_ARMV7_SECURE_BASE	OCRAM_BASE_S_ADDR
+
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
include/configs/ls1021atwr.h +7 -0
index 3c73af8..58cd10a 100644
@@ -229,6 +229,13 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_CMD_IMLS
 
+#define CONFIG_ARMV7_NONSEC
+#define CONFIG_ARMV7_VIRT
+#define CONFIG_PEN_ADDR_BIG_ENDIAN
+#define CONFIG_SMP_PEN_ADDR		0x01ee0200
+#define CONFIG_TIMER_CLK_FREQ		12500000
+#define CONFIG_ARMV7_SECURE_BASE	OCRAM_BASE_S_ADDR
+
 #define CONFIG_HWCONFIG
 #define HWCONFIG_BUFFER_SIZE		128
 
Signature · 1 line
2.1.0.27.g96db324
#8 lore raw

PATCH v4 4/6 ls102xa: changing a few targets' configurations.

Quoted 7 lines · Xiubo Li

Enable hypervisors utilizing the ARMv7 virtualization extension on the LS1021A-QDS/TWR boards with the A7 core tile, we add the required configuration variable.

---

Applied to u-boot-fsl-qoriq master, awaiting upstream.

York

author
#9 lore raw

PATCH v4 5/6 ARM: ls102xa: allow all the peripheral access permission as R/W.

In reply to Xiubo Li

The Central Security Unit (CSU) allows secure world software to change the default access control policies of peripherals/bus slaves, determining which bus masters may access them. This allows peripherals to be separated into distinct security domains. Combined with SMMU configuration of the system masters privileges, these features provide protection against indirect unauthorized access to data.

For now we configure all the peripheral access permissions as R/W.

---
 arch/arm/include/asm/arch-ls102xa/config.h    |   1 +
 arch/arm/include/asm/arch-ls102xa/ns_access.h | 118 ++++++++++++++++++++++++++
 board/freescale/common/Makefile               |   2 +
 board/freescale/common/ns_access.c            |  30 +++++++
 board/freescale/ls1021aqds/ls1021aqds.c       |  92 ++++++++++++++++++++
 board/freescale/ls1021atwr/ls1021atwr.c       |  91 ++++++++++++++++++++
 include/configs/ls1021aqds.h                  |   1 +
 include/configs/ls1021atwr.h                  |   1 +
 8 files changed, 336 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-ls102xa/ns_access.h
 create mode 100644 board/freescale/common/ns_access.c
arch/arm/include/asm/arch-ls102xa/config.h +1 -0
index 750429f..28e27c7 100644
@@ -18,6 +18,7 @@
 
 #define CONFIG_SYS_FSL_DDR_ADDR			(CONFIG_SYS_IMMR + 0x00080000)
 #define CONFIG_SYS_CCI400_ADDR			(CONFIG_SYS_IMMR + 0x00180000)
+#define CONFIG_SYS_FSL_CSU_ADDR                 (CONFIG_SYS_IMMR + 0x00510000)
 #define CONFIG_SYS_IFC_ADDR			(CONFIG_SYS_IMMR + 0x00530000)
 #define CONFIG_SYS_FSL_ESDHC_ADDR		(CONFIG_SYS_IMMR + 0x00560000)
 #define CONFIG_SYS_FSL_SCFG_ADDR		(CONFIG_SYS_IMMR + 0x00570000)
arch/arm/include/asm/arch-ls102xa/ns_access.h new file +118 -0

118 lines not on this page · raw message

board/freescale/common/Makefile +2 -0
index 32b5a3b..c009852 100644
@@ -60,4 +60,6 @@ obj-$(CONFIG_P3041DS)	+= p_corenet/
 obj-$(CONFIG_P4080DS)	+= p_corenet/
 obj-$(CONFIG_P5020DS)	+= p_corenet/
 obj-$(CONFIG_P5040DS)	+= p_corenet/
+
+obj-$(CONFIG_LS102XA_NS_ACCESS)	+= ns_access.o
 endif
board/freescale/common/ns_access.c new file +30 -0
new file mode 100644
index 0000000..d7de982
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2014 Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/ns_access.h>
+
+void enable_devices_ns_access(struct csu_ns_dev *ns_dev, uint32_t num)
+{
+	u32 *base = (u32 *)CONFIG_SYS_FSL_CSU_ADDR;
+	u32 *reg;
+	uint32_t val;
+	int i;
+
+	for (i = 0; i < num; i++) {
+		reg = base + ns_dev[i].ind / 2;
+		val = in_be32(reg);
+		if (ns_dev[i].ind % 2 == 0) {
+			val &= 0x0000ffff;
+			val |= ns_dev[i].val << 16;
+		} else {
+			val &= 0xffff0000;
+			val |= ns_dev[i].val;
+		}
+		out_be32(reg, val);
+	}
+}
board/freescale/ls1021aqds/ls1021aqds.c +92 -0

110 lines not on this page · raw message

board/freescale/ls1021atwr/ls1021atwr.c +91 -0

109 lines not on this page · raw message

include/configs/ls1021aqds.h +1 -0
index b53e9d0..efb4b61 100644
@@ -330,6 +330,7 @@ unsigned long get_board_ddr_clk(void);
 #define CONFIG_ARMV7_NONSEC
 #define CONFIG_ARMV7_VIRT
 #define CONFIG_PEN_ADDR_BIG_ENDIAN
+#define CONFIG_LS102XA_NS_ACCESS
 #define CONFIG_SMP_PEN_ADDR		0x01ee0200
 #define CONFIG_TIMER_CLK_FREQ		12500000
 #define CONFIG_ARMV7_SECURE_BASE	OCRAM_BASE_S_ADDR
include/configs/ls1021atwr.h +1 -0
index 58cd10a..a36afdf 100644
@@ -232,6 +232,7 @@
 #define CONFIG_ARMV7_NONSEC
 #define CONFIG_ARMV7_VIRT
 #define CONFIG_PEN_ADDR_BIG_ENDIAN
+#define CONFIG_LS102XA_NS_ACCESS
 #define CONFIG_SMP_PEN_ADDR		0x01ee0200
 #define CONFIG_TIMER_CLK_FREQ		12500000
 #define CONFIG_ARMV7_SECURE_BASE	OCRAM_BASE_S_ADDR
Signature · 1 line
2.1.0.27.g96db324
#10 lore raw

PATCH v4 5/6 ARM: ls102xa: allow all the peripheral access permission as R/W.

Quoted 8 lines · Xiubo Li

The Central Security Unit (CSU) allows secure world software to change the default access control policies of peripherals/bus slaves, determining which bus masters may access them. This allows peripherals to be separated into distinct security domains. Combined with SMMU configuration of the system masters privileges, these features provide protection against indirect unauthorized access to data.

Quoted 5 lines

For now we configure all the peripheral access permissions as R/W.

---

Applied to u-boot-fsl-qoriq master, awaiting upstream.

York

author
#11 lore raw

PATCH v4 6/6 ARM: ls102xa: Setting device's stream id for SMMUs.

In reply to Xiubo Li

LS1 has 4 SMMUs for address translation of the masters. All the SMMUs' stream IDs are 8-bit. The address translation depends on the stream ID of the incoming transaction.
Each master has unique stream ID assigned to it and is configurable through SCFG registers. The stream ID for the masters is identical and share the same register field of STREAM ID registers.

---
 .../include/asm/arch-ls102xa/ls102xa_stream_id.h    | 17 +++++++++++++++++
 board/freescale/common/Makefile                     |  2 ++
 board/freescale/common/ls102xa_stream_id.c          | 18 ++++++++++++++++++
 board/freescale/ls1021aqds/ls1021aqds.c             | 21 +++++++++++++++++++++
 board/freescale/ls1021atwr/ls1021atwr.c             | 21 +++++++++++++++++++++
 include/configs/ls1021aqds.h                        |  2 ++
 include/configs/ls1021atwr.h                        |  2 ++
 7 files changed, 83 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-ls102xa/ls102xa_stream_id.h
 create mode 100644 board/freescale/common/ls102xa_stream_id.c
arch/arm/include/asm/arch-ls102xa/ls102xa_stream_id.h new file +17 -0
new file mode 100644
index 0000000..abd70fc
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2014 Freescale Semiconductor, Inc.
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#ifndef __FSL_LS102XA_STREAM_ID_H_
+#define __FSL_LS102XA_STREAM_ID_H_
+
+struct smmu_stream_id {
+	uint16_t offset;
+	uint16_t stream_id;
+	char dev_name[32];
+};
+
+void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num);
+#endif
board/freescale/common/Makefile +2 -0
index c009852..d676fcd 100644
@@ -54,6 +54,8 @@ obj-$(CONFIG_VSC_CROSSBAR)    += vsc3316_3308.o
 obj-$(CONFIG_IDT8T49N222A)	+= idt8t49n222a_serdes_clk.o
 obj-$(CONFIG_ZM7300)		+= zm7300.o
 
+obj-$(CONFIG_LS102XA_STREAM_ID)	+= ls102xa_stream_id.o
+
 # deal with common files for P-series corenet based devices
 obj-$(CONFIG_P2041RDB)	+= p_corenet/
 obj-$(CONFIG_P3041DS)	+= p_corenet/
board/freescale/common/ls102xa_stream_id.c new file +18 -0
new file mode 100644
index 0000000..6154c9c
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2014 Freescale Semiconductor
+ *
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/ls102xa_stream_id.h>
+
+void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num)
+{
+	uint32_t *scfg = (uint32_t *)CONFIG_SYS_FSL_SCFG_ADDR;
+	int i;
+
+	for (i = 0; i < num; i++)
+		out_be32(scfg + id[i].offset, id[i].stream_id);
+}
board/freescale/ls1021aqds/ls1021aqds.c +21 -0
index c43f0c3..72c6544 100644
@@ -11,6 +11,7 @@
 #include <asm/arch/ns_access.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/fsl_serdes.h>
+#include <asm/arch/ls102xa_stream_id.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <fsl_ifc.h>
@@ -310,6 +311,23 @@ static struct csu_ns_dev ns_dev[] = {
 };
 #endif
 
+struct smmu_stream_id dev_stream_id[] = {
+	{ 0x100, 0x01, "ETSEC MAC1" },
+	{ 0x104, 0x02, "ETSEC MAC2" },
+	{ 0x108, 0x03, "ETSEC MAC3" },
+	{ 0x10c, 0x04, "PEX1" },
+	{ 0x110, 0x05, "PEX2" },
+	{ 0x114, 0x06, "qDMA" },
+	{ 0x118, 0x07, "SATA" },
+	{ 0x11c, 0x08, "USB3" },
+	{ 0x120, 0x09, "QE" },
+	{ 0x124, 0x0a, "eSDHC" },
+	{ 0x128, 0x0b, "eMA" },
+	{ 0x14c, 0x0c, "2D-ACE" },
+	{ 0x150, 0x0d, "USB2" },
+	{ 0x18c, 0x0e, "DEBUG" },
+};
+
 int board_init(void)
 {
 	struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
@@ -325,6 +343,9 @@ int board_init(void)
 	config_serdes_mux();
 #endif
 
+	ls102xa_config_smmu_stream_id(dev_stream_id,
+				      ARRAY_SIZE(dev_stream_id));
+
 #ifdef CONFIG_LS102XA_NS_ACCESS
 	enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev));
 #endif
board/freescale/ls1021atwr/ls1021atwr.c +21 -0
index fff391c..e7d75de 100644
@@ -11,6 +11,7 @@
 #include <asm/arch/ns_access.h>
 #include <asm/arch/clock.h>
 #include <asm/arch/fsl_serdes.h>
+#include <asm/arch/ls102xa_stream_id.h>
 #include <mmc.h>
 #include <fsl_esdhc.h>
 #include <fsl_ifc.h>
@@ -358,6 +359,23 @@ static struct csu_ns_dev ns_dev[] = {
 };
 #endif
 
+struct smmu_stream_id dev_stream_id[] = {
+	{ 0x100, 0x01, "ETSEC MAC1" },
+	{ 0x104, 0x02, "ETSEC MAC2" },
+	{ 0x108, 0x03, "ETSEC MAC3" },
+	{ 0x10c, 0x04, "PEX1" },
+	{ 0x110, 0x05, "PEX2" },
+	{ 0x114, 0x06, "qDMA" },
+	{ 0x118, 0x07, "SATA" },
+	{ 0x11c, 0x08, "USB3" },
+	{ 0x120, 0x09, "QE" },
+	{ 0x124, 0x0a, "eSDHC" },
+	{ 0x128, 0x0b, "eMA" },
+	{ 0x14c, 0x0c, "2D-ACE" },
+	{ 0x150, 0x0d, "USB2" },
+	{ 0x18c, 0x0e, "DEBUG" },
+};
+
 int board_init(void)
 {
 #ifndef CONFIG_SYS_FSL_NO_SERDES
@@ -365,6 +383,9 @@ int board_init(void)
 	config_serdes_mux();
 #endif
 
+	ls102xa_config_smmu_stream_id(dev_stream_id,
+				      ARRAY_SIZE(dev_stream_id));
+
 #ifdef CONFIG_LS102XA_NS_ACCESS
 	enable_devices_ns_access(ns_dev, ARRAY_SIZE(ns_dev));
 #endif
include/configs/ls1021aqds.h +2 -0
index efb4b61..7468233 100644
@@ -369,6 +369,8 @@ unsigned long get_board_ddr_clk(void);
 
 #define CONFIG_SYS_LOAD_ADDR		0x82000000
 
+#define CONFIG_LS102XA_STREAM_ID
+
 /*
  * Stack sizes
  * The stack sizes are set up in start.S using the settings below
include/configs/ls1021atwr.h +2 -0
index a36afdf..a2980aa 100644
@@ -270,6 +270,8 @@
 
 #define CONFIG_SYS_LOAD_ADDR		0x82000000
 
+#define CONFIG_LS102XA_STREAM_ID
+
 /*
  * Stack sizes
  * The stack sizes are set up in start.S using the settings below
Signature · 1 line
2.1.0.27.g96db324
#12 lore raw

PATCH v4 6/6 ARM: ls102xa: Setting device's stream id for SMMUs.

Quoted 10 lines · Xiubo Li

LS1 has 4 SMMUs for address translation of the masters. All the SMMUs' stream IDs are 8-bit. The address translation depends on the stream ID of the incoming transaction.
Each master has unique stream ID assigned to it and is configurable through SCFG registers. The stream ID for the masters is identical and share the same register field of STREAM ID registers.

---

Applied to u-boot-fsl-qoriq master, awaiting upstream.

York