1 From 76b656349a6786fa81cf69ac7762c31675cd567e Mon Sep 17 00:00:00 2001
2 From: Andrei Gherzan <andrei@balena.io>
3 Date: Fri, 12 Jul 2019 14:27:31 +0100
4 Subject: [PATCH 7/7] rpi: Add memory map for bcm2838
6 Define the memory map for the BCM2838 based on the dt configuration
7 available in the Raspberry Pi kernel fork.
9 Signed-off-by: Andrei Gherzan <andrei@balena.io>
10 Upstream-status: Pending
12 board/raspberrypi/rpi/rpi.c | 27 ++++++++++++++++++++++++---
13 1 file changed, 24 insertions(+), 3 deletions(-)
15 diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
16 index 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;
23 -static struct mm_region bcm2837_mem_map[] = {
24 +#ifndef CONFIG_BCM2838
25 +static struct mm_region bcm283x_mem_map[] = {
29 @@ -268,8 +269,28 @@ static struct mm_region bcm2837_mem_map[] = {
34 -struct mm_region *mem_map = bcm2837_mem_map;
36 +static struct mm_region bcm283x_mem_map[] = {
38 + .virt = 0x00000000UL,
39 + .phys = 0x00000000UL,
40 + .size = 0xfe000000UL,
41 + .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
42 + PTE_BLOCK_INNER_SHARE
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
51 + /* List terminator */
56 +struct mm_region *mem_map = bcm283x_mem_map;