summaryrefslogtreecommitdiff
path: root/meta-arm/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0020-arm-corstone1000-add-mmc-for-fvp.patch
blob: 93da2536661b487cbfdfba21ded2bccdd6fa797c (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
89
90
91
92
93
94
95
96
97
98
99
From d6c183a99a7d232ef5dbf886c49e7fb75b50ecf9 Mon Sep 17 00:00:00 2001
From: Rui Miguel Silva <rui.silva@linaro.org>
Date: Wed, 30 Nov 2022 15:37:22 +0000
Subject: [PATCH 20/42] arm:corstone1000: add mmc for fvp

Enable support mmc/sdcard for the corstone1000 FVP.

Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Upstream-Status: Pending [Not submitted to upstream yet]
---
 board/armltd/corstone1000/corstone1000.c | 28 +++++++++++++++++++-----
 configs/corstone1000_defconfig           |  8 ++++++-
 include/configs/corstone1000.h           |  4 +++-
 3 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
index 76816f8f4e..d6ca6e8961 100644
--- a/board/armltd/corstone1000/corstone1000.c
+++ b/board/armltd/corstone1000/corstone1000.c
@@ -38,19 +38,35 @@ static struct mm_region corstone1000_mem_map[] = {
 	}, {
 		/* USB */
 		.virt = 0x40200000UL,
-		.phys = 0x40200000UL,
+			.phys = 0x40200000UL,
+			.size = 0x00100000UL,
+			.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+				PTE_BLOCK_NON_SHARE |
+				PTE_BLOCK_PXN | PTE_BLOCK_UXN
+	}, {
+		/* MMC0 */
+		.virt = 0x40300000UL,
+		.phys = 0x40300000UL,
 		.size = 0x00100000UL,
 		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-			PTE_BLOCK_NON_SHARE |
-			PTE_BLOCK_PXN | PTE_BLOCK_UXN
+				 PTE_BLOCK_NON_SHARE |
+				 PTE_BLOCK_PXN | PTE_BLOCK_UXN
 	}, {
 		/* ethernet */
 		.virt = 0x40100000UL,
-		.phys = 0x40100000UL,
+			.phys = 0x40100000UL,
+			.size = 0x00100000UL,
+			.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+				PTE_BLOCK_NON_SHARE |
+				PTE_BLOCK_PXN | PTE_BLOCK_UXN
+	}, {
+		/* MMC1 */
+		.virt = 0x50000000UL,
+		.phys = 0x50000000UL,
 		.size = 0x00100000UL,
 		.attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
-			PTE_BLOCK_NON_SHARE |
-			PTE_BLOCK_PXN | PTE_BLOCK_UXN
+				 PTE_BLOCK_NON_SHARE |
+				 PTE_BLOCK_PXN | PTE_BLOCK_UXN
 	}, {
 		/* OCVM */
 		.virt = 0x80000000UL,
diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
index 06eac3e041..f7c276a10a 100644
--- a/configs/corstone1000_defconfig
+++ b/configs/corstone1000_defconfig
@@ -40,7 +40,13 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_REGMAP=y
 CONFIG_MISC=y
-# CONFIG_MMC is not set
+CONFIG_CLK=y
+CONFIG_CMD_MMC=y
+CONFIG_DM_MMC=y
+CONFIG_ARM_PL180_MMCI=y
+CONFIG_MMC_SDHCI_ADMA_HELPERS=y
+CONFIG_MMC_WRITE=y
+CONFIG_DM_GPIO=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_SMSC=y
 CONFIG_SMC911X=y
diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
index be13b98d48..a015a1630e 100644
--- a/include/configs/corstone1000.h
+++ b/include/configs/corstone1000.h
@@ -59,7 +59,9 @@
 #define CONFIG_SYS_SDRAM_BASE	PHYS_SDRAM_1
 
 #define BOOT_TARGET_DEVICES(func) \
-	func(USB, usb, 0)
+	func(USB, usb, 0) \
+	func(MMC, mmc, 0) \
+	func(MMC, mmc, 1)
 
 #include <config_distro_bootcmd.h>
 
-- 
2.25.1