* Add board BananaPi M4 Zero Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com> * HACK: wrong DRAM size: add extra barrier in mctl_mem_matches People report that this is fixed by adding another "dsb();" at the beginning of the mctl_mem_matches() function. https://lore.kernel.org/all/ZWMv816r8YxPwsJO@BOB1/T/#mec26415158efa10e6f78c5c1a651bb834f8599c4 Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com> * v2 add barrier and udelay to mctl_mem_matches function Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com> --------- Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com> Co-authored-by: Patrick Yavitz <pyavitz@xxxxx.com>
60 lines
1.5 KiB
Diff
60 lines
1.5 KiB
Diff
From e9d34fce0765cb2927abeb4bde2225c5aee2925c Mon Sep 17 00:00:00 2001
|
|
From: Patrick Yavitz <pyavitz@xxxxx.com>
|
|
Date: Wed, 28 Feb 2024 11:55:04 -0500
|
|
Subject: [PATCH] drivers: mmc: sunxi_mmc: bpi-m4-zero emmc boot support
|
|
|
|
Signed-off-by: Patrick Yavitz <pyavitz@xxxxx.com>
|
|
---
|
|
drivers/mmc/sunxi_mmc.c | 18 ++++++++++++++----
|
|
1 file changed, 14 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
|
|
index 714706d241..2d23932099 100644
|
|
--- a/drivers/mmc/sunxi_mmc.c
|
|
+++ b/drivers/mmc/sunxi_mmc.c
|
|
@@ -543,6 +543,10 @@ struct mmc *sunxi_mmc_init(int sdc_no)
|
|
|
|
cfg->f_min = 400000;
|
|
cfg->f_max = 52000000;
|
|
+
|
|
+ if (sdc_no == 2) {
|
|
+ cfg->f_max = 8000000;
|
|
+ }
|
|
|
|
if (mmc_resource_init(sdc_no) != 0)
|
|
return NULL;
|
|
@@ -640,20 +644,26 @@ static int sunxi_mmc_probe(struct udevice *dev)
|
|
struct mmc_config *cfg = &plat->cfg;
|
|
struct ofnode_phandle_args args;
|
|
u32 *ccu_reg;
|
|
- int ret;
|
|
+ int bus_width, ret;
|
|
|
|
cfg->name = dev->name;
|
|
+ bus_width = dev_read_u32_default(dev, "bus-width", 1);
|
|
|
|
cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
|
|
+ cfg->host_caps = 0;
|
|
+ if (bus_width == 8)
|
|
+ cfg->host_caps |= MMC_MODE_8BIT;
|
|
+ if (bus_width >= 4)
|
|
+ cfg->host_caps |= MMC_MODE_4BIT;
|
|
cfg->host_caps = MMC_MODE_HS_52MHz | MMC_MODE_HS;
|
|
cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
|
|
|
|
cfg->f_min = 400000;
|
|
cfg->f_max = 52000000;
|
|
|
|
- ret = mmc_of_parse(dev, cfg);
|
|
- if (ret)
|
|
- return ret;
|
|
+ if (bus_width == 8) {
|
|
+ cfg->f_max = 52000000;
|
|
+ }
|
|
|
|
priv->reg = dev_read_addr_ptr(dev);
|
|
|
|
--
|
|
2.39.2
|
|
|