blob: d4bf65200781fb2f29655b38340061945e528953 [file] [log] [blame]
Patrick Williams8dd68482022-10-04 07:57:18 -05001From 5e4c819c7ab0841429016c098106615b33486c8b Mon Sep 17 00:00:00 2001
Patrick Williams92b42cb2022-09-03 06:53:57 -05002From: Rui Miguel Silva <rui.silva@linaro.org>
3Date: Tue, 5 Apr 2022 10:24:38 +0100
Patrick Williams8dd68482022-10-04 07:57:18 -05004Subject: [PATCH 26/26] arm:corstone1000: add mmc for fvp
Patrick Williams92b42cb2022-09-03 06:53:57 -05005
6Enable support mmc/sdcard for the corstone1000 FVP.
7
8Signed-off-by: Vishnu Banavath <vishnu.banavath@arm.com>
9Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Patrick Williams8dd68482022-10-04 07:57:18 -050010Upstream-Status: Pending [Not submitted to upstream yet]
Patrick Williams92b42cb2022-09-03 06:53:57 -050011---
12 arch/arm/dts/corstone1000-fvp.dts | 28 +++++++++++++++
13 board/armltd/corstone1000/corstone1000.c | 46 ++++++++++++++++--------
14 configs/corstone1000_defconfig | 8 ++++-
15 include/configs/corstone1000.h | 4 ++-
16 4 files changed, 69 insertions(+), 17 deletions(-)
17
18diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts
Patrick Williams8dd68482022-10-04 07:57:18 -050019index 1fcc137a49..26b0f1b3ce 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -050020--- a/arch/arm/dts/corstone1000-fvp.dts
21+++ b/arch/arm/dts/corstone1000-fvp.dts
22@@ -20,4 +20,32 @@
23 interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>;
24 reg-io-width = <2>;
25 };
26+
27+ vmmc_v3_3d: fixed_v3_3d {
28+ compatible = "regulator-fixed";
29+ regulator-name = "vmmc_supply";
30+ regulator-min-microvolt = <3300000>;
31+ regulator-max-microvolt = <3300000>;
32+ regulator-always-on;
33+ };
34+
35+ sdmmc0: mmc@40300000 {
36+ compatible = "arm,pl18x", "arm,primecell";
37+ reg = <0x40300000 0x1000>;
38+ interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
39+ max-frequency = <12000000>;
40+ vmmc-supply = <&vmmc_v3_3d>;
41+ clocks = <&smbclk>, <&refclk100mhz>;
42+ clock-names = "smclk", "apb_pclk";
43+ };
44+
45+ sdmmc1: mmc@50000000 {
46+ compatible = "arm,pl18x", "arm,primecell";
47+ reg = <0x50000000 0x10000>;
48+ interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>;
49+ max-frequency = <12000000>;
50+ vmmc-supply = <&vmmc_v3_3d>;
51+ clocks = <&smbclk>, <&refclk100mhz>;
52+ clock-names = "smclk", "apb_pclk";
53+ };
54 };
55diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c
Patrick Williams8dd68482022-10-04 07:57:18 -050056index 2fa485ff37..3d537d7a90 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -050057--- a/board/armltd/corstone1000/corstone1000.c
58+++ b/board/armltd/corstone1000/corstone1000.c
59@@ -46,22 +46,38 @@ static struct mm_region corstone1000_mem_map[] = {
60 .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
61 PTE_BLOCK_NON_SHARE |
62 PTE_BLOCK_PXN | PTE_BLOCK_UXN
63- }, {
64- /* USB */
65- .virt = 0x40200000UL,
66- .phys = 0x40200000UL,
67- .size = 0x00100000UL,
68- .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
69- PTE_BLOCK_NON_SHARE |
70- PTE_BLOCK_PXN | PTE_BLOCK_UXN
71 }, {
72- /* ethernet */
73- .virt = 0x40100000UL,
74- .phys = 0x40100000UL,
75- .size = 0x00100000UL,
76- .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
77- PTE_BLOCK_NON_SHARE |
78- PTE_BLOCK_PXN | PTE_BLOCK_UXN
79+ /* USB */
80+ .virt = 0x40200000UL,
81+ .phys = 0x40200000UL,
82+ .size = 0x00100000UL,
83+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
84+ PTE_BLOCK_NON_SHARE |
85+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
86+ }, {
87+ /* MMC0 */
88+ .virt = 0x40300000UL,
89+ .phys = 0x40300000UL,
90+ .size = 0x00100000UL,
91+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
92+ PTE_BLOCK_NON_SHARE |
93+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
94+ }, {
95+ /* ethernet */
96+ .virt = 0x40100000UL,
97+ .phys = 0x40100000UL,
98+ .size = 0x00100000UL,
99+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
100+ PTE_BLOCK_NON_SHARE |
101+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
102+ }, {
103+ /* MMC1 */
104+ .virt = 0x50000000UL,
105+ .phys = 0x50000000UL,
106+ .size = 0x00100000UL,
107+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
108+ PTE_BLOCK_NON_SHARE |
109+ PTE_BLOCK_PXN | PTE_BLOCK_UXN
110 }, {
111 /* OCVM */
112 .virt = 0x80000000UL,
113diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig
Patrick Williams8dd68482022-10-04 07:57:18 -0500114index c299dda49f..76e07fc20c 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -0500115--- a/configs/corstone1000_defconfig
116+++ b/configs/corstone1000_defconfig
117@@ -38,7 +38,13 @@ CONFIG_CMD_EFIDEBUG=y
118 CONFIG_CMD_FAT=y
119 CONFIG_OF_CONTROL=y
120 CONFIG_REGMAP=y
121-# CONFIG_MMC is not set
122+CONFIG_CLK=y
123+CONFIG_CMD_MMC=y
124+CONFIG_DM_MMC=y
125+CONFIG_ARM_PL180_MMCI=y
126+CONFIG_MMC_SDHCI_ADMA_HELPERS=y
127+CONFIG_MMC_WRITE=y
128+CONFIG_DM_GPIO=y
129 CONFIG_DM_SERIAL=y
130 CONFIG_USB=y
131 CONFIG_DM_USB=y
132diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h
Patrick Williams8dd68482022-10-04 07:57:18 -0500133index 333b1d93b6..815239590e 100644
Patrick Williams92b42cb2022-09-03 06:53:57 -0500134--- a/include/configs/corstone1000.h
135+++ b/include/configs/corstone1000.h
Patrick Williams8dd68482022-10-04 07:57:18 -0500136@@ -89,7 +89,9 @@
Patrick Williams92b42cb2022-09-03 06:53:57 -0500137 #define CONFIG_SYS_MAXARGS 64 /* max command args */
138
139 #define BOOT_TARGET_DEVICES(func) \
140- func(USB, usb, 0)
141+ func(USB, usb, 0) \
142+ func(MMC, mmc, 0) \
143+ func(MMC, mmc, 1)
144
145 #include <config_distro_bootcmd.h>
146
147--
Patrick Williams8dd68482022-10-04 07:57:18 -05001482.17.1
Patrick Williams92b42cb2022-09-03 06:53:57 -0500149