]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
meson-gx: reserved memory regions
authorxypron.glpk@gmx.de <xypron.glpk@gmx.de>
Fri, 9 Jun 2017 20:13:59 +0000 (22:13 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 22 Jul 2017 19:36:18 +0000 (15:36 -0400)
The Odroid C2 has two GiB of memory with two reserved regions.
reg = <0x0 0x0 0x0 0x1000000>;
reg = <0x0 0x10000000 0x0 0x200000>;

Patch
bfcef28ae4cf (arm: add initial support for Amlogic Meson and
ODROID-C2) provided function dram_init_banksize to reserve the
first 16 MiB of RAM for firmware in function dram_init_banksize
in arch/arm/mach-meson/board.c and defined
CONFIG_NR_DRAM_BANKS = 1.

With this patch dram_init_banksize is changed to additionally
reserve the 2MiB region for the ARM Trusted Firmware (BL31).
CONFIG_NR_DRAM_BANKS is set to 2.

Cc: Andreas Färber <afaerber@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
arch/arm/mach-meson/board.c
include/configs/meson-gxbb-common.h

index 273dbeb02081f1c5005e32b9e09b3eeaaec7cae5..e89c6aace98d6e021ee5b86030ac7529623aafc5 100644 (file)
@@ -37,9 +37,11 @@ int dram_init(void)
 int dram_init_banksize(void)
 {
        /* Reserve first 16 MiB of RAM for firmware */
-       gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE + (16 * 1024 * 1024);
-       gd->bd->bi_dram[0].size = gd->ram_size - (16 * 1024 * 1024);
-
+       gd->bd->bi_dram[0].start = 0x1000000;
+       gd->bd->bi_dram[0].size  = 0xf000000;
+       /* Reserve 2 MiB for ARM Trusted Firmware (BL31) */
+       gd->bd->bi_dram[1].start = 0x10000000;
+       gd->bd->bi_dram[1].size  = gd->ram_size - 0x10200000;
        return 0;
 }
 
index 89e3807a14b56ff169fafcdfd64f5d6e807d6222..ed55f441a4528a3e1921ac691bcf589d774df453 100644 (file)
@@ -10,7 +10,7 @@
 
 #define CONFIG_CPU_ARMV8
 #define CONFIG_REMAKE_ELF
-#define CONFIG_NR_DRAM_BANKS           1
+#define CONFIG_NR_DRAM_BANKS           2
 #define CONFIG_ENV_IS_NOWHERE          1
 #define CONFIG_ENV_SIZE                        0x2000
 #define CONFIG_SYS_MAXARGS             32