From 90db3d923adcade13d9a8aa50305e5c9c32737af Mon Sep 17 00:00:00 2001 From: Peter Hoyes Date: Thu, 17 Feb 2022 17:02:34 +0000 Subject: [PATCH 1/2] vexpress64: Configure memory using device tree The memory size and memory banks were previously configured statically, using #defines in the vexpress header file, which could conflict with the information in the device tree. Instead, use fdtdec_setup_mem_size_base() to configure the RAM size and fdtdec_setup_memory_banksize() to set up the memory banks. Issue-Id: SCM-3874 Upstream-Status: Inappropriate [other] Implementation pending further discussion Signed-off-by: Peter Hoyes Change-Id: I4add8258cb99dac87f078435272410b562b6fdc7 --- board/armltd/vexpress64/vexpress64.c | 14 ++------------ include/configs/vexpress_aemv8.h | 17 ----------------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/board/armltd/vexpress64/vexpress64.c b/board/armltd/vexpress64/vexpress64.c index 270618a0ff..3f1ac04bac 100644 --- a/board/armltd/vexpress64/vexpress64.c +++ b/board/armltd/vexpress64/vexpress64.c @@ -24,8 +24,6 @@ #include #endif -DECLARE_GLOBAL_DATA_PTR; - static const struct pl01x_serial_plat serial_plat = { .base = V2M_UART0, .type = TYPE_PL011, @@ -128,20 +126,12 @@ int board_init(void) int dram_init(void) { - gd->ram_size = PHYS_SDRAM_1_SIZE; - return 0; + return fdtdec_setup_mem_size_base(); } int dram_init_banksize(void) { - gd->bd->bi_dram[0].start = PHYS_SDRAM_1; - gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; -#ifdef PHYS_SDRAM_2 - gd->bd->bi_dram[1].start = PHYS_SDRAM_2; - gd->bd->bi_dram[1].size = PHYS_SDRAM_2_SIZE; -#endif - - return 0; + return fdtdec_setup_memory_banksize(); } /* Assigned in lowlevel_init.S diff --git a/include/configs/vexpress_aemv8.h b/include/configs/vexpress_aemv8.h index a9086879c9..15a1ae60bf 100644 --- a/include/configs/vexpress_aemv8.h +++ b/include/configs/vexpress_aemv8.h @@ -106,23 +106,6 @@ /* BOOTP options */ #define CONFIG_BOOTP_BOOTFILESIZE -/* Miscellaneous configurable options */ - -/* Physical Memory Map */ -#define PHYS_SDRAM_1 (V2M_BASE) /* SDRAM Bank #1 */ -/* Top 16MB reserved for secure world use */ -#define DRAM_SEC_SIZE 0x01000000 -#define PHYS_SDRAM_1_SIZE 0x80000000 - DRAM_SEC_SIZE -#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1 - -#ifdef CONFIG_TARGET_VEXPRESS64_JUNO -#define PHYS_SDRAM_2 (0x880000000) -#define PHYS_SDRAM_2_SIZE 0x180000000 -#elif CONFIG_NR_DRAM_BANKS == 2 -#define PHYS_SDRAM_2 (0x880000000) -#define PHYS_SDRAM_2_SIZE 0x80000000 -#endif - /* Enable memtest */ /* Initial environment variables */ -- 2.25.1