aboutsummaryrefslogtreecommitdiffstats
path: root/meta-arm-bsp/recipes-bsp/u-boot/u-boot/fvp-baser-aemv8r64/0012-vexpress64-Configure-memory-using-device-tree.patch
blob: f9b422a9b32a7517216b74dea5a2cf620699d8ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
From 90db3d923adcade13d9a8aa50305e5c9c32737af Mon Sep 17 00:00:00 2001
From: Peter Hoyes <Peter.Hoyes@arm.com>
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 <Peter.Hoyes@arm.com>
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 <virtio.h>
 #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