armv8: layerscape: Enable EHCI access for LS1012A
authorRan Wang <ran.wang_1@nxp.com>
Fri, 10 Aug 2018 07:00:00 +0000 (15:00 +0800)
committerYork Sun <york.sun@nxp.com>
Fri, 10 Aug 2018 17:37:39 +0000 (10:37 -0700)
Program Central Security Unit (CSU) to grant access to USB 2.0
controller.

Signed-off-by: Ran Wang <ran.wang_1@nxp.com>
[YS: rewrite commit message]
Reviewed-by: York Sun <york.sun@nxp.com>
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/include/asm/arch-fsl-layerscape/ns_access.h

index 2f306c509ab0bb9593db522ddbbb309d44eccb8f..3f15cb08ffbd401012048df52a064a060f2dc145 100644 (file)
@@ -11,6 +11,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>
 #include <asm/arch-fsl-layerscape/fsl_icid.h>
 #ifdef CONFIG_LAYERSCAPE_NS_ACCESS
 #include <fsl_csu.h>
@@ -615,6 +616,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();
index 2bbfab7388c2e211c29e7b3dec822bd9f8f14a82..a265106686d15c01ea00cee406cf4e070efa0c00 100644 (file)
@@ -39,6 +39,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,