diff options
author | Frieder Schrempf <frieder.schrempf@kontron.de> | 2021-06-07 14:36:44 +0200 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2021-07-10 16:03:01 +0200 |
commit | e27bddff4b97598baaa7186196ebfb28075f702c (patch) | |
tree | 6e3b62ad651b047bba8df563dfe73ae343d1a771 /arch/arm/mach-imx/imx8m/soc.c | |
parent | ef62fff2698a425cc6628a9696e8ee1cae725f32 (diff) | |
download | u-boot-e27bddff4b97598baaa7186196ebfb28075f702c.tar.gz |
imx8m: Restrict usable memory to space below 4G boundary
Some IPs have their accessible address space restricted by the
interconnect. Let's make sure U-Boot only ever uses the space below
the 4G address boundary (which is 3GiB big), even when the effective
available memory is bigger.
We implement board_get_usable_ram_top() for all i.MX8M SoCs, as the
whole family is affected by this.
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Diffstat (limited to 'arch/arm/mach-imx/imx8m/soc.c')
-rw-r--r-- | arch/arm/mach-imx/imx8m/soc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 0c44022a6d..f5983320c7 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -296,6 +296,20 @@ phys_size_t get_effective_memsize(void) #endif } +ulong board_get_usable_ram_top(ulong total_size) +{ + /* + * Some IPs have their accessible address space restricted by + * the interconnect. Let's make sure U-Boot only ever uses the + * space below the 4G address boundary (which is 3GiB big), + * even when the effective available memory is bigger. + */ + if (PHYS_SDRAM + gd->ram_size > 0x80000000) + return 0x80000000; + + return PHYS_SDRAM + gd->ram_size; +} + static u32 get_cpu_variant_type(u32 type) { struct ocotp_regs *ocotp = (struct ocotp_regs *)OCOTP_BASE_ADDR; |