blob: 1d23d9f99e390070490e3b4e809ba8f1cf92ec13 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 76b656349a6786fa81cf69ac7762c31675cd567e Mon Sep 17 00:00:00 2001
2From: Andrei Gherzan <andrei@balena.io>
3Date: Fri, 12 Jul 2019 14:27:31 +0100
4Subject: [PATCH 7/7] rpi: Add memory map for bcm2838
5
6Define the memory map for the BCM2838 based on the dt configuration
7available in the Raspberry Pi kernel fork.
8
9Signed-off-by: Andrei Gherzan <andrei@balena.io>
10Upstream-status: Pending
11---
12 board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++---
13 1 file changed, 24 insertions(+), 3 deletions(-)
14
15diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
16index 92c6534da6..bddf2a578d 100644
17--- a/board/raspberrypi/rpi/rpi.c
18+++ b/board/raspberrypi/rpi/rpi.c
19@@ -249,7 +249,8 @@ static uint32_t rev_type;
20 static const struct rpi_model *model;
21
22 #ifdef CONFIG_ARM64
23-static struct mm_region bcm2837_mem_map[] = {
24+#ifndef CONFIG_BCM2838
25+static struct mm_region bcm283x_mem_map[] = {
26 {
27 .virt = 0x00000000UL,
28 .phys = 0x00000000UL,
29@@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = {
30 0,
31 }
32 };
33-
34-struct mm_region *mem_map = bcm2837_mem_map;
35+#else
36+static struct mm_region bcm283x_mem_map[] = {
37+ {
38+ .virt = 0x00000000UL,
39+ .phys = 0x00000000UL,
40+ .size = 0xfe000000UL,
41+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
42+ PTE_BLOCK_INNER_SHARE
43+ }, {
44+ .virt = 0xfe000000UL,
45+ .phys = 0xfe000000UL,
46+ .size = 0x01800000UL,
47+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
48+ PTE_BLOCK_NON_SHARE |
49+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
50+ }, {
51+ /* List terminator */
52+ 0,
53+ }
54+};
55+#endif
56+struct mm_region *mem_map = bcm283x_mem_map;
57 #endif
58
59 int dram_init(void)
60--
612.22.0
62