]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
feat(imx8mm): add hab and map required memory blocks
authorAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Mon, 26 Sep 2022 20:41:08 +0000 (22:41 +0200)
committerAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Wed, 19 Oct 2022 13:47:39 +0000 (15:47 +0200)
In order for HAB to perform operations, memory regions has to be mapped
in TF-A, which HAB ROM code would use internally.

Include those memory blocks for i.MX8MM SoC. Of a special note, the DRAM
block is mapped with complete size available on the platform and uses
MT_RW attributes, this is required to minimize the size of translation
tables and provide a possibility to exchange the execution results
between EL3 and EL1&2, see details in [1].

Link: [1]: https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/16880
Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Change-Id: I6a3a3d7105b85c2f4ab6ea6cfbca67c9a325eb11

plat/imx/imx8m/imx8mm/imx8mm_bl31_setup.c
plat/imx/imx8m/imx8mm/include/platform_def.h

index 1667baf45958a5519a8cd886d00417f64e9467b8..38fac92b63df0b3ca6b3327317ed369e115c4d38 100644 (file)
 
 #define TRUSTY_PARAMS_LEN_BYTES      (4096*2)
 
+/*
+ * Note: DRAM region is mapped with entire size available and uses MT_RW
+ * attributes.
+ * See details in docs/plat/imx8m.rst "High Assurance Boot (HABv4)" section
+ * for explanation of this mapping scheme.
+ */
 static const mmap_region_t imx_mmap[] = {
        MAP_REGION_FLAT(IMX_GIC_BASE, IMX_GIC_SIZE, MT_DEVICE | MT_RW),
        MAP_REGION_FLAT(IMX_AIPS_BASE, IMX_AIPS_SIZE, MT_DEVICE | MT_RW), /* AIPS map */
        MAP_REGION_FLAT(OCRAM_S_BASE, OCRAM_S_SIZE, MT_DEVICE | MT_RW), /* OCRAM_S */
        MAP_REGION_FLAT(IMX_DDRPHY_BASE, IMX_DDR_IPS_SIZE, MT_DEVICE | MT_RW), /* DDRMIX */
        MAP_REGION_FLAT(IMX_VPUMIX_BASE, IMX_VPUMIX_SIZE, MT_DEVICE | MT_RW), /* VPUMIX */
+       MAP_REGION_FLAT(IMX_CAAM_RAM_BASE, IMX_CAAM_RAM_SIZE, MT_MEMORY | MT_RW), /* CAMM RAM */
+       MAP_REGION_FLAT(IMX_NS_OCRAM_BASE, IMX_NS_OCRAM_SIZE, MT_MEMORY | MT_RW), /* NS OCRAM */
+       MAP_REGION_FLAT(IMX_ROM_BASE, IMX_ROM_SIZE, MT_MEMORY | MT_RO), /* ROM code */
+       MAP_REGION_FLAT(IMX_DRAM_BASE, IMX_DRAM_SIZE, MT_MEMORY | MT_RW | MT_NS), /* DRAM */
        {0},
 };
 
index 84d86b90667c5560984932b121598aacd4d1102c..930372fceb2fec6d82d9d3d9159a74e1203c4c27 100644 (file)
 #define IMX_DDRPHY_BASE                        U(0x3c000000)
 #define IMX_DDR_IPS_BASE               U(0x3d000000)
 #define IMX_DDR_IPS_SIZE               U(0x1800000)
+#define IMX_VPUMIX_BASE                        U(0x38330000)
+#define IMX_VPUMIX_SIZE                        U(0x100000)
 #define IMX_ROM_BASE                   U(0x0)
-#define IMX_VPUMIX_BASE                U(0x38330000)
-#define IMX_VPUMIX_SIZE                U(0x100000)
+#define IMX_ROM_SIZE                   U(0x40000)
+#define IMX_NS_OCRAM_BASE              U(0x900000)
+#define IMX_NS_OCRAM_SIZE              U(0x20000)
+#define IMX_CAAM_RAM_BASE              U(0x100000)
+#define IMX_CAAM_RAM_SIZE              U(0x10000)
+#define IMX_DRAM_BASE                  U(0x40000000)
+#define IMX_DRAM_SIZE                  U(0xc0000000)
 
 #define GPV_BASE                       U(0x32000000)
 #define GPV_SIZE                       U(0x800000)