| From 5e4c819c7ab0841429016c098106615b33486c8b Mon Sep 17 00:00:00 2001 |
| From: Rui Miguel Silva <rui.silva@linaro.org> |
| Date: Tue, 5 Apr 2022 10:24:38 +0100 |
| Subject: [PATCH 26/26] 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] |
| --- |
| arch/arm/dts/corstone1000-fvp.dts | 28 +++++++++++++++ |
| board/armltd/corstone1000/corstone1000.c | 46 ++++++++++++++++-------- |
| configs/corstone1000_defconfig | 8 ++++- |
| include/configs/corstone1000.h | 4 ++- |
| 4 files changed, 69 insertions(+), 17 deletions(-) |
| |
| diff --git a/arch/arm/dts/corstone1000-fvp.dts b/arch/arm/dts/corstone1000-fvp.dts |
| index 1fcc137a49..26b0f1b3ce 100644 |
| --- a/arch/arm/dts/corstone1000-fvp.dts |
| +++ b/arch/arm/dts/corstone1000-fvp.dts |
| @@ -20,4 +20,32 @@ |
| interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>; |
| reg-io-width = <2>; |
| }; |
| + |
| + vmmc_v3_3d: fixed_v3_3d { |
| + compatible = "regulator-fixed"; |
| + regulator-name = "vmmc_supply"; |
| + regulator-min-microvolt = <3300000>; |
| + regulator-max-microvolt = <3300000>; |
| + regulator-always-on; |
| + }; |
| + |
| + sdmmc0: mmc@40300000 { |
| + compatible = "arm,pl18x", "arm,primecell"; |
| + reg = <0x40300000 0x1000>; |
| + interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; |
| + max-frequency = <12000000>; |
| + vmmc-supply = <&vmmc_v3_3d>; |
| + clocks = <&smbclk>, <&refclk100mhz>; |
| + clock-names = "smclk", "apb_pclk"; |
| + }; |
| + |
| + sdmmc1: mmc@50000000 { |
| + compatible = "arm,pl18x", "arm,primecell"; |
| + reg = <0x50000000 0x10000>; |
| + interrupts = <GIC_SPI 115 IRQ_TYPE_LEVEL_HIGH>; |
| + max-frequency = <12000000>; |
| + vmmc-supply = <&vmmc_v3_3d>; |
| + clocks = <&smbclk>, <&refclk100mhz>; |
| + clock-names = "smclk", "apb_pclk"; |
| + }; |
| }; |
| diff --git a/board/armltd/corstone1000/corstone1000.c b/board/armltd/corstone1000/corstone1000.c |
| index 2fa485ff37..3d537d7a90 100644 |
| --- a/board/armltd/corstone1000/corstone1000.c |
| +++ b/board/armltd/corstone1000/corstone1000.c |
| @@ -46,22 +46,38 @@ static struct mm_region corstone1000_mem_map[] = { |
| .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| PTE_BLOCK_NON_SHARE | |
| PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| - }, { |
| - /* USB */ |
| - .virt = 0x40200000UL, |
| - .phys = 0x40200000UL, |
| - .size = 0x00100000UL, |
| - .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| - PTE_BLOCK_NON_SHARE | |
| - PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| }, { |
| - /* ethernet */ |
| - .virt = 0x40100000UL, |
| - .phys = 0x40100000UL, |
| - .size = 0x00100000UL, |
| - .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) | |
| - PTE_BLOCK_NON_SHARE | |
| - PTE_BLOCK_PXN | PTE_BLOCK_UXN |
| + /* USB */ |
| + .virt = 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 |
| + }, { |
| + /* ethernet */ |
| + .virt = 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 |
| }, { |
| /* OCVM */ |
| .virt = 0x80000000UL, |
| diff --git a/configs/corstone1000_defconfig b/configs/corstone1000_defconfig |
| index c299dda49f..76e07fc20c 100644 |
| --- a/configs/corstone1000_defconfig |
| +++ b/configs/corstone1000_defconfig |
| @@ -38,7 +38,13 @@ CONFIG_CMD_EFIDEBUG=y |
| CONFIG_CMD_FAT=y |
| CONFIG_OF_CONTROL=y |
| CONFIG_REGMAP=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_DM_SERIAL=y |
| CONFIG_USB=y |
| CONFIG_DM_USB=y |
| diff --git a/include/configs/corstone1000.h b/include/configs/corstone1000.h |
| index 333b1d93b6..815239590e 100644 |
| --- a/include/configs/corstone1000.h |
| +++ b/include/configs/corstone1000.h |
| @@ -89,7 +89,9 @@ |
| #define CONFIG_SYS_MAXARGS 64 /* max command args */ |
| |
| #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.17.1 |
| |