aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorPeng Fan2020-07-09 15:26:06 +0800
committerPeng Fan2020-07-14 15:23:48 +0800
commit3c41728d80f7a6178dd4ec91c28347d9768ab200 (patch)
treee5aa2f4a4f03e0071c76d3f4b502aed467583f9c /board
parentec04ae4217e6f68ad7ccd7740e540d79a3f4e1c1 (diff)
imx8m: Refactor the OPTEE memory removal
Current codes assume the OPTEE address is at the end of first DRAM bank. Adjust the process to allow OPTEE in the middle of first bank. When OPTEE memory is removed from first bank, it may split the first bank to two banks, adjust the MMU table for the split case, Since the default CONFIG_NR_DRAM_BANKS is 4, it is enough, just enlarge i.MX8MP evk to default to avoid issue. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Silvano di Ninno <silvano.dininno@nxp.com> Tested-by: Silvano di Ninno <silvano.dininno@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'board')
-rw-r--r--board/beacon/imx8mm/imx8mm_beacon.c11
-rw-r--r--board/freescale/imx8mm_evk/imx8mm_evk.c11
-rw-r--r--board/freescale/imx8mn_evk/imx8mn_evk.c7
-rw-r--r--board/freescale/imx8mp_evk/imx8mp_evk.c40
-rw-r--r--board/freescale/imx8mq_evk/imx8mq_evk.c11
-rw-r--r--board/google/imx8mq_phanbell/imx8mq_phanbell.c11
-rw-r--r--board/technexion/pico-imx8mq/pico-imx8mq.c26
-rw-r--r--board/toradex/verdin-imx8mm/verdin-imx8mm.c11
8 files changed, 12 insertions, 116 deletions
diff --git a/board/beacon/imx8mm/imx8mm_beacon.c b/board/beacon/imx8mm/imx8mm_beacon.c
index e82e8b78d80..c61d25fbead 100644
--- a/board/beacon/imx8mm/imx8mm_beacon.c
+++ b/board/beacon/imx8mm/imx8mm_beacon.c
@@ -13,17 +13,6 @@
DECLARE_GLOBAL_DATA_PTR;
-int dram_init(void)
-{
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->ram_size = PHYS_SDRAM_SIZE;
-
- return 0;
-}
-
#if IS_ENABLED(CONFIG_FEC_MXC)
static int setup_fec(void)
{
diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c
index c43af9bc484..6af71006966 100644
--- a/board/freescale/imx8mm_evk/imx8mm_evk.c
+++ b/board/freescale/imx8mm_evk/imx8mm_evk.c
@@ -15,17 +15,6 @@
DECLARE_GLOBAL_DATA_PTR;
-int dram_init(void)
-{
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->ram_size = PHYS_SDRAM_SIZE;
-
- return 0;
-}
-
#if IS_ENABLED(CONFIG_FEC_MXC)
static int setup_fec(void)
{
diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c b/board/freescale/imx8mn_evk/imx8mn_evk.c
index ea02bb75f41..e5ca54f9ae7 100644
--- a/board/freescale/imx8mn_evk/imx8mn_evk.c
+++ b/board/freescale/imx8mn_evk/imx8mn_evk.c
@@ -9,13 +9,6 @@
DECLARE_GLOBAL_DATA_PTR;
-int dram_init(void)
-{
- gd->ram_size = PHYS_SDRAM_SIZE;
-
- return 0;
-}
-
int board_init(void)
{
return 0;
diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c
index 97ba15645a2..034a349236e 100644
--- a/board/freescale/imx8mp_evk/imx8mp_evk.c
+++ b/board/freescale/imx8mp_evk/imx8mp_evk.c
@@ -40,46 +40,6 @@ int board_early_init_f(void)
return 0;
}
-int dram_init(void)
-{
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->ram_size = PHYS_SDRAM_SIZE;
-
-#if CONFIG_NR_DRAM_BANKS > 1
- gd->ram_size += PHYS_SDRAM_2_SIZE;
-#endif
-
- return 0;
-}
-
-int dram_init_banksize(void)
-{
- gd->bd->bi_dram[0].start = PHYS_SDRAM;
- if (rom_pointer[1])
-
- gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE;
-
-#if CONFIG_NR_DRAM_BANKS > 1
- gd->bd->bi_dram[1].start = PHYS_SDRAM_2;
- gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE;
-#endif
-
- return 0;
-}
-
-phys_size_t get_effective_memsize(void)
-{
- if (rom_pointer[1])
- return (PHYS_SDRAM_SIZE - rom_pointer[1]);
- else
- return PHYS_SDRAM_SIZE;
-}
-
int board_init(void)
{
return 0;
diff --git a/board/freescale/imx8mq_evk/imx8mq_evk.c b/board/freescale/imx8mq_evk/imx8mq_evk.c
index ae3be5785c9..1ad670b8ccf 100644
--- a/board/freescale/imx8mq_evk/imx8mq_evk.c
+++ b/board/freescale/imx8mq_evk/imx8mq_evk.c
@@ -53,17 +53,6 @@ int board_early_init_f(void)
return 0;
}
-int dram_init(void)
-{
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->ram_size = PHYS_SDRAM_SIZE;
-
- return 0;
-}
-
#ifdef CONFIG_FEC_MXC
static int setup_fec(void)
{
diff --git a/board/google/imx8mq_phanbell/imx8mq_phanbell.c b/board/google/imx8mq_phanbell/imx8mq_phanbell.c
index c0cc3e9b71d..746071b4150 100644
--- a/board/google/imx8mq_phanbell/imx8mq_phanbell.c
+++ b/board/google/imx8mq_phanbell/imx8mq_phanbell.c
@@ -48,17 +48,6 @@ int board_early_init_f(void)
return 0;
}
-int dram_init(void)
-{
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->ram_size = PHYS_SDRAM_SIZE;
-
- return 0;
-}
-
#ifdef CONFIG_FEC_MXC
static int setup_fec(void)
{
diff --git a/board/technexion/pico-imx8mq/pico-imx8mq.c b/board/technexion/pico-imx8mq/pico-imx8mq.c
index 2a3e6e7e265..330de7137c3 100644
--- a/board/technexion/pico-imx8mq/pico-imx8mq.c
+++ b/board/technexion/pico-imx8mq/pico-imx8mq.c
@@ -51,24 +51,22 @@ int board_early_init_f(void)
return 0;
}
-int dram_init(void)
+int board_phys_sdram_size(phys_size_t *size)
{
int ddr_size = readl(M4_BOOTROM_BASE_ADDR);
- if (ddr_size == 0x4)
- gd->ram_size = 0x100000000;
- else if (ddr_size == 0x3)
- gd->ram_size = 0xc0000000;
- else if (ddr_size == 0x2)
- gd->ram_size = 0x80000000;
- else if (ddr_size == 0x1)
- gd->ram_size = 0x40000000;
- else
+ if (ddr_size == 0x4) {
+ *size = 0x100000000;
+ } else if (ddr_size == 0x3) {
+ *size = 0xc0000000;
+ } else if (ddr_size == 0x2) {
+ *size = 0x80000000;
+ } else if (ddr_size == 0x1) {
+ *size = 0x40000000;
+ } else {
printf("Unknown DDR type!!!\n");
-
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size -= rom_pointer[1];
+ return -1;
+ }
return 0;
}
diff --git a/board/toradex/verdin-imx8mm/verdin-imx8mm.c b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
index ff05c7d5523..fa51b776abc 100644
--- a/board/toradex/verdin-imx8mm/verdin-imx8mm.c
+++ b/board/toradex/verdin-imx8mm/verdin-imx8mm.c
@@ -14,17 +14,6 @@
DECLARE_GLOBAL_DATA_PTR;
-int dram_init(void)
-{
- /* rom_pointer[1] contains the size of TEE occupies */
- if (rom_pointer[1])
- gd->ram_size = PHYS_SDRAM_SIZE - rom_pointer[1];
- else
- gd->ram_size = PHYS_SDRAM_SIZE;
-
- return 0;
-}
-
#if IS_ENABLED(CONFIG_FEC_MXC)
static int setup_fec(void)
{