diff options
author | Teo Hall <teo.hall@nxp.com> | 2017-05-03 17:46:41 -0500 |
---|---|---|
committer | Abel Vesa <abel.vesa@nxp.com> | 2018-06-08 17:34:08 +0300 |
commit | 57b4f1dd8006f7c3cbbcd154cc006f5a3a9062d6 (patch) | |
tree | c3c6a9e99188d1ecc8909e48ebf70a6ac6a8ef46 | |
parent | 03883508dfbd6f6bb91951965d2d1f2f44e771ff (diff) |
update secure partition and add NS access
add more resources to secure partition for
protection. Also add in functionality to allow
for register access of some secure-owned
peripherals.
These peripherals will still be protected from
power or clk changes.
Signed-off-by: Teo Hall <teo.hall@nxp.com>
-rw-r--r-- | plat/imx/imx8qm/imx8qm_bl31_setup.c | 6 | ||||
-rw-r--r-- | plat/imx/imx8qm/include/sec_rsrc.h | 27 |
2 files changed, 25 insertions, 8 deletions
diff --git a/plat/imx/imx8qm/imx8qm_bl31_setup.c b/plat/imx/imx8qm/imx8qm_bl31_setup.c index 81d333e7..3524bdf4 100644 --- a/plat/imx/imx8qm/imx8qm_bl31_setup.c +++ b/plat/imx/imx8qm/imx8qm_bl31_setup.c @@ -206,6 +206,12 @@ void mx8_partition_resources(void) /* move all movable resources and pins to non-secure partition */ err = sc_rm_move_all(ipc_handle, secure_part, os_part, true, true); + /* iterate through peripherals to give NS OS part access */ + for(i = 0; i<(sizeof(ns_access_allowed)/sizeof(sc_rsrc_t)); i++){ + err = sc_rm_set_peripheral_permissions(ipc_handle, ns_access_allowed[i], + os_part, SC_RM_PERM_FULL); + } + /* * sc_rm_set_peripheral_permissions * diff --git a/plat/imx/imx8qm/include/sec_rsrc.h b/plat/imx/imx8qm/include/sec_rsrc.h index df3ccfdd..b05f0aa0 100644 --- a/plat/imx/imx8qm/include/sec_rsrc.h +++ b/plat/imx/imx8qm/include/sec_rsrc.h @@ -1,14 +1,25 @@ /* Copyright 2017 NXP */ /* Include file detailing the resource partitioning for ATF */ - - - - +/* resources that are going to stay in secure partition */ sc_rsrc_t secure_rsrcs[] = { - SC_R_MU_1A + SC_R_MU_1A, + SC_R_A53, + SC_R_A53_0, + SC_R_A53_1, + SC_R_A53_2, + SC_R_A53_3, + SC_R_A72, + SC_R_A72_0, + SC_R_A72_1, + SC_R_GIC, + SC_R_GIC_SMMU, + SC_R_CCI }; - - - +/* resources that have register access for non-secure domain */ +sc_rsrc_t ns_access_allowed[] = { + SC_R_GIC, + SC_R_GIC_SMMU, + SC_R_CCI +}; |