1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/package/boot/uboot-rockchip/patches/005-rockchip-rk356x-HACK-fix-sdmmc-support.patch

51 lines
1.5 KiB
Diff
Raw Normal View History

2022-11-18 17:10:38 +00:00
From 01e8a38985a90043abddc5c5bcd049c74bb29a53 Mon Sep 17 00:00:00 2001
From: Peter Geis <pgwipeout@gmail.com>
Date: Sun, 19 Dec 2021 18:52:18 -0500
Subject: [PATCH 05/11] rockchip: rk356x: HACK: fix sdmmc support
HACK: lock mmc0 to initial frequency and disable dw-mmc control of power
line.
The sdmmc on quartz64-a is powered by the sdmmc0 power line, which is
active low.
Even though it is set as a gpio, it still seems to be triggered by the
dw-mmc driver toggling the power line.
Downstream fixes this by setting this to "0" instead of "1" using
kconfigs.
Also, for some reason the controller will only operate at initial
frequencies.
Signed-off-by: Peter Geis <pgwipeout@gmail.com>
---
arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi | 4 +++-
drivers/mmc/dw_mmc.c | 3 ++-
2 files changed, 5 insertions(+), 2 deletions(-)
--- a/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
+++ b/arch/arm/dts/rk3566-quartz64-a-u-boot.dtsi
@@ -13,8 +13,10 @@
};
&sdmmc0 {
+ max-frequency = <400000>;
+ bus-width = <4>;
u-boot,dm-spl;
- status = "okay";
+ u-boot,spl-fifo-mode;
};
&uart2 {
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -529,7 +529,8 @@ static int dwmci_init(struct mmc *mmc)
if (host->board_init)
host->board_init(host);
- dwmci_writel(host, DWMCI_PWREN, 1);
+// dwmci_writel(host, DWMCI_PWREN, 1);
+ dwmci_writel(host, DWMCI_PWREN, 0);
if (!dwmci_wait_reset(host, DWMCI_RESET_ALL)) {
debug("%s[%d] Fail-reset!!\n", __func__, __LINE__);