Commit 327cb93b3e75cca8e3123cf405d3404ace4eb89e

Authored by Ji Luo
1 parent 91a544df4c

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>

Showing 2 changed files with 12 additions and 0 deletions Side-by-side Diff

arch/arm/mach-imx/imx8/cpu.c
... ... @@ -1637,7 +1637,11 @@
1637 1637 {
1638 1638 if ((addr_start >= PHYS_SDRAM_1 && addr_start <= ((sc_faddr_t)PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE))
1639 1639 || (addr_start >= PHYS_SDRAM_2 && addr_start <= ((sc_faddr_t)PHYS_SDRAM_2 + PHYS_SDRAM_2_SIZE)))
  1640 +#ifdef CONFIG_IMX_TRUSTY_OS
  1641 + return (PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_INNER_SHARE);
  1642 +#else
1640 1643 return (PTE_BLOCK_MEMTYPE(MT_NORMAL) | PTE_BLOCK_OUTER_SHARE);
  1644 +#endif
1641 1645  
1642 1646 return (PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | PTE_BLOCK_NON_SHARE | PTE_BLOCK_PXN | PTE_BLOCK_UXN);
1643 1647 }
arch/arm/mach-imx/imx8m/soc.c
... ... @@ -128,7 +128,11 @@
128 128 .phys = 0x40000000UL,
129 129 .size = PHYS_SDRAM_SIZE,
130 130 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
  131 +#ifdef CONFIG_IMX_TRUSTY_OS
  132 + PTE_BLOCK_INNER_SHARE
  133 +#else
131 134 PTE_BLOCK_OUTER_SHARE
  135 +#endif
132 136 #if CONFIG_NR_DRAM_BANKS > 1
133 137 }, {
134 138 /* DRAM2 */
135 139  
... ... @@ -136,7 +140,11 @@
136 140 .phys = 0x100000000UL,
137 141 .size = PHYS_SDRAM_2_SIZE,
138 142 .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
  143 +#ifdef CONFIG_IMX_TRUSTY_OS
  144 + PTE_BLOCK_INNER_SHARE
  145 +#else
139 146 PTE_BLOCK_OUTER_SHARE
  147 +#endif
140 148 #endif
141 149 }, {
142 150 /* List terminator */