arm: fsl-layerscape: move forward the non-secure access permission setup
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Tue, 2 Aug 2016 11:03:23 +0000 (19:03 +0800)
committerYork Sun <york.sun@nxp.com>
Wed, 14 Sep 2016 21:06:56 +0000 (14:06 -0700)
Move forward the basic non-secure access enable operation, so the
subsequent individual device access permission can override it.
And collect the dispersed callers in board level, and then move
them to SoC level.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
arch/arm/cpu/armv7/ls102xa/soc.c
arch/arm/cpu/armv8/fsl-layerscape/soc.c
arch/arm/cpu/armv8/fsl-layerscape/spl.c
board/freescale/ls1012afrdm/ls1012afrdm.c
board/freescale/ls1012aqds/ls1012aqds.c
board/freescale/ls1012ardb/ls1012ardb.c
board/freescale/ls1021aqds/ls1021aqds.c
board/freescale/ls1021atwr/ls1021atwr.c
board/freescale/ls1043aqds/ls1043aqds.c
board/freescale/ls1043ardb/ls1043ardb.c

index b1b0c710ae6fbe84c643bbe8e2dac7a0d7511827..4c93ab7fcbbebfe29487b413d5b64839daa1af00 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/arch/immap_ls102xa.h>
 #include <asm/arch/ls102xa_soc.h>
 #include <asm/arch/ls102xa_stream_id.h>
+#include <fsl_csu.h>
 
 struct liodn_id_table sec_liodn_tbl[] = {
        SET_SEC_JR_LIODN_ENTRY(0, 0x10, 0x10),
@@ -64,6 +65,10 @@ int arch_soc_init(void)
        struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
        unsigned int major;
 
+#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
+       enable_layerscape_ns_access();
+#endif
+
 #ifdef CONFIG_FSL_QSPI
        out_be32(&scfg->qspi_cfg, SCFG_QSPI_CLKSEL);
 #endif
index 28928b3086450aa74fbc7a18db9448f1b684e3ea..2b39a025d953218fbbf6c996edd0713c0a3f8eab 100644 (file)
@@ -12,6 +12,7 @@
 #include <asm/io.h>
 #include <asm/global_data.h>
 #include <asm/arch-fsl-layerscape/config.h>
+#include <fsl_csu.h>
 #ifdef CONFIG_SYS_FSL_DDR
 #include <fsl_ddr_sdram.h>
 #include <fsl_ddr.h>
@@ -305,6 +306,10 @@ void fsl_lsch2_early_init_f(void)
        struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
        struct ccsr_scfg *scfg = (struct ccsr_scfg *)CONFIG_SYS_FSL_SCFG_ADDR;
 
+#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
+       enable_layerscape_ns_access();
+#endif
+
 #ifdef CONFIG_FSL_IFC
        init_early_memctl_regs();       /* tighten IFC timing */
 #endif
index 19e34fade28f15eef3c6cba81a4e1b52a0e530dc..b75547da9022b7339059baf41129e705ae5b0480 100644 (file)
@@ -8,7 +8,6 @@
 #include <spl.h>
 #include <asm/io.h>
 #include <fsl_ifc.h>
-#include <fsl_csu.h>
 #include <i2c.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -66,9 +65,6 @@ void board_init_f(ulong dummy)
        /* Clear the BSS */
        memset(__bss_start, 0, __bss_end - __bss_start);
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
        board_init_r(NULL, 0);
 }
 #endif
index a94a458f53d8f6e184c82c2f041c8d3f5c5ab4f9..5a2b1f48fe4a316abfe0001fb3652b84fc7717c7 100644 (file)
@@ -11,7 +11,6 @@
 #include <asm/arch/fsl_serdes.h>
 #include <asm/arch/soc.h>
 #include <hwconfig.h>
-#include <fsl_csu.h>
 #include <environment.h>
 #include <fsl_mmdc.h>
 #include <netdev.h>
@@ -175,10 +174,6 @@ int board_init(void)
        gd->env_addr = (ulong)&default_environment[0];
 #endif
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
-
        return 0;
 }
 
index 71eea82a0358a487d5077fd12d3363ce48c82fb1..852d683dd8e14d255de19265895f520c2f64fc19 100644 (file)
@@ -17,7 +17,6 @@
 #include <mmc.h>
 #include <scsi.h>
 #include <fm_eth.h>
-#include <fsl_csu.h>
 #include <fsl_esdhc.h>
 #include <fsl_mmdc.h>
 #include <spl.h>
@@ -207,10 +206,6 @@ int board_init(void)
        out_le32(&cci->ctrl_ord,
                 CCI400_CTRLORD_EN_BARRIER);
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
-
 #ifdef CONFIG_ENV_IS_NOWHERE
        gd->env_addr = (ulong)&default_environment[0];
 #endif
index f69768d24e98f7848655d20332077b05614cfbdd..a3748defb697bbb284a9d72746979e88135e2d00 100644 (file)
@@ -14,7 +14,6 @@
 #include <ahci.h>
 #include <mmc.h>
 #include <scsi.h>
-#include <fsl_csu.h>
 #include <fsl_esdhc.h>
 #include <environment.h>
 #include <fsl_mmdc.h>
@@ -207,10 +206,6 @@ int board_init(void)
        gd->env_addr = (ulong)&default_environment[0];
 #endif
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
-
        return 0;
 }
 
index dbea0bff2692ac7692a87311a40e11ab7e93a6e1..291b0f4c724ecb9aa9b02b66e43a6cb86a381699 100644 (file)
@@ -446,10 +446,6 @@ int board_init(void)
 
        ls102xa_smmu_stream_id_init();
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
-
 #ifdef CONFIG_U_QE
        u_qe_init();
 #endif
index 77482a947bf445b52ae19764b067c9e7bc274b50..85c036b36c509c7e6526ee3009ae624238b4d760 100644 (file)
@@ -489,10 +489,6 @@ int board_init(void)
 
        ls102xa_smmu_stream_id_init();
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
-
 #ifdef CONFIG_U_QE
        u_qe_init();
 #endif
index 941dfbc447ebe9f1b3ed29c1d8e7bc1710dee264..16425575b20e8c5880bc2c65df48cfb622fa37d8 100644 (file)
@@ -17,7 +17,6 @@
 #include <mmc.h>
 #include <scsi.h>
 #include <fm_eth.h>
-#include <fsl_csu.h>
 #include <fsl_esdhc.h>
 #include <fsl_ifc.h>
 #include <spl.h>
@@ -316,9 +315,6 @@ int board_init(void)
        config_serdes_mux();
 #endif
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
        return 0;
 }
 
index 70fef79cd0c2633825c9937f67f1f2e3d507d494..33997899ff13e6d41f82028691a7877d25544a32 100644 (file)
@@ -16,7 +16,6 @@
 #include <mmc.h>
 #include <scsi.h>
 #include <fm_eth.h>
-#include <fsl_csu.h>
 #include <fsl_esdhc.h>
 #include <fsl_ifc.h>
 #include <fsl_sec.h>
@@ -90,10 +89,6 @@ int board_init(void)
        init_final_memctl_regs();
 #endif
 
-#ifdef CONFIG_LAYERSCAPE_NS_ACCESS
-       enable_layerscape_ns_access();
-#endif
-
 #ifdef CONFIG_SECURE_BOOT
        /* In case of Secure Boot, the IBR configures the SMMU
         * to allow only Secure transactions.