Skip to contentSkip to conversation

armv8: layerscape: Enable EHCI access for LS1012A

PATCH Superseded Ran Wang 2 participants 2 messages Jul 27, 2018 – Jul 31, 2018 Arm (32-bit)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Ran Wang

author
#0 lore raw

PATCH v2 1/1 armv8: layerscape: Enable EHCI access for LS1012A

Program Central Security Unit (CSU) to grant access permission for USB 2.0 controller, otherwiase EHCI funciton will down.

---
Change in v2:
- Add EL checking code to make sure related programming only happen in EL3

 arch/arm/cpu/armv8/fsl-layerscape/soc.c              | 9 +++++++++
 arch/arm/include/asm/arch-fsl-layerscape/ns_access.h | 1 +
 2 files changed, 10 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/soc.c +9 -0
index 6a56269..d8c3083 100644
@@ -14,6 +14,7 @@
 #include <asm/io.h>
 #include <asm/global_data.h>
 #include <asm/arch-fsl-layerscape/config.h>
+#include <asm/arch-fsl-layerscape/ns_access.h>
 #ifdef CONFIG_LAYERSCAPE_NS_ACCESS
 #include <fsl_csu.h>
 #endif
@@ -668,6 +669,14 @@ void fsl_lsch2_early_init_f(void)
 			 CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN);
 	}
 
+	/*
+	 * Program Central Security Unit (CSU) to grant access
+	 * permission for USB 2.0 controller
+	 */
+#if defined(CONFIG_ARCH_LS1012A) && defined(CONFIG_USB_EHCI_FSL)
+	if (current_el() == 3)
+		set_devices_ns_access(CSU_CSLX_USB_2, CSU_ALL_RW);
+#endif
 	/* Erratum */
 	erratum_a008850_early(); /* part 1 of 2 */
 	erratum_a009929();
arch/arm/include/asm/arch-fsl-layerscape/ns_access.h +1 -0
index fe97a93..d1b8efa 100644
@@ -40,6 +40,7 @@ enum csu_cslx_ind {
 	CSU_CSLX_ESDHC,
 	CSU_CSLX_IFC = 45,
 	CSU_CSLX_I2C1,
+	CSU_CSLX_USB_2,
 	CSU_CSLX_I2C3 = 48,
 	CSU_CSLX_I2C2,
 	CSU_CSLX_DUART2 = 50,
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 armv8: layerscape: Enable EHCI access for LS1012A

Quoted 18 lines · Ran Wang

Program Central Security Unit (CSU) to grant access permission for USB 2.0 controller, otherwiase EHCI funciton will down.

---
Change in v2:
- Add EL checking code to make sure related programming only happen in EL3

 arch/arm/cpu/armv8/fsl-layerscape/soc.c              | 9 +++++++++
 arch/arm/include/asm/arch-fsl-layerscape/ns_access.h | 1 +
 2 files changed, 10 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/soc.c +0 -0
index 6a56269..d8c3083 100644

arch/arm/cpu/armv8/fsl-layerscape/soc.c line 17

Quoted 4 lines
arch/arm/cpu/armv8/fsl-layerscape/soc.c +1 -0
@@ -14,6 +14,7 @@
 #include <asm/io.h>
 #include <asm/global_data.h>
 #include <asm/arch-fsl-layerscape/config.h>
+#include <asm/arch-fsl-layerscape/ns_access.h>

Including this header has a problem. It declares and initializes ns_dev[], causing a compiling warning for soc.c. Please fix.

York