summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJi Luo <ji.luo@nxp.com>2019-02-27 15:37:05 +0800
committerJi Luo <ji.luo@nxp.com>2019-03-05 15:30:44 +0800
commit584ba4507b6829f1396461d7344e08fa018e588a (patch)
tree1702e369dad2fb0da3f59090eb156aebf2c317e1 /arch
parent31928168d048638dd66fded18cfaf8326f7dff10 (diff)
MA-14147-1 Trusty: change the dram attribute to inner shareable
Trusty OS will check and require the memory passed from non-secure world is inner shareable. Change the memory attribute as PTE_BLOCK_INNER_SHARE in u-boot to meet the requirement. Test: build and boot on imx8qm/imx8qxp. Change-Id: I1aac9b430ecc0fa94f9a1f6dd519b34ce6fef7bd Signed-off-by: Ji Luo <ji.luo@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-imx/imx8/cpu.c4
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 1f7b955e6be..9471f30b5b3 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -1637,7 +1637,11 @@ static u64 get_block_attrs(sc_faddr_t addr_start)
{
if ((addr_start >= PHYS_SDRAM_1 && addr_start <= ((sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE))
|| (addr_start >= PHYS_SDRAM_2 && addr_start <= ((sc_faddr_t)PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE)))
+#ifdef CONFIG_IMX_TRUSTY_OS
+ return (PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE);
+#else
return (PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE);
+#endif
return (PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE | PTE_BLOCK_PXN | PTE_BLOCK_UXN);
}
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index c8d2af8f801..6d8c22c27f1 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -128,7 +128,11 @@ static struct mm_region imx8m_mem_map[] = {
.phys = 0x40000000UL,
.size = PHYS_SDRAM_SIZE,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+#ifdef CONFIG_IMX_TRUSTY_OS
+ PTE_BLOCK_INNER_SHARE
+#else
PTE_BLOCK_OUTER_SHARE
+#endif
#if CONFIG_NR_DRAM_BANKS > 1
}, {
/* DRAM2 */
@@ -136,8 +140,12 @@ static struct mm_region imx8m_mem_map[] = {
.phys = 0x100000000UL,
.size = PHYS_SDRAM_2_SIZE,
.attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+#ifdef CONFIG_IMX_TRUSTY_OS
+ PTE_BLOCK_INNER_SHARE
+#else
PTE_BLOCK_OUTER_SHARE
#endif
+#endif
}, {
/* List terminator */
0,