public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Xavier Drudis Ferran <xdrudis@tinet.cat>
To: u-boot@lists.denx.de
Cc: sjg@chromium.org, philipp.tomsich@vrull.eu,
	kever.yang@rock-chips.com, lukma@denx.de, seanga2@gmail.com
Subject: Re: [PATCH 2/3] Add a couple of missing clocks for MMCSD.
Date: Thu, 2 Jun 2022 13:06:59 +0200	[thread overview]
Message-ID: <20220602110659.GD1727@begut> (raw)
In-Reply-To: <20220602110200.GB1727@begut>

This helped boot a Radxa Rock Pi 4B from SD card. With U-boot master
at commit 4fe629d2e8bb ("Merge
https://source.denx.de/u-boot/custodians/u-boot-riscv") from
2022-05-27T08:50:42-0400 and the SPI clock shorted to GND to make the
bootrom boot from SD card, SPL stopped at the "Trying to boot from
MMC1" message.

Signed-off-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
---
 drivers/clk/rockchip/clk_rk3399.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/clk/rockchip/clk_rk3399.c b/drivers/clk/rockchip/clk_rk3399.c
index 7d31a9f22a..fc3a5d4e9b 100644
--- a/drivers/clk/rockchip/clk_rk3399.c
+++ b/drivers/clk/rockchip/clk_rk3399.c
@@ -1184,6 +1184,12 @@ static int rk3399_clk_enable(struct clk *clk)
 	case SCLK_PCIEPHY_REF:
 		rk_clrreg(&priv->cru->clksel_con[18], BIT(10));
 		break;
+	case SCLK_SDMMC:
+		rk_clrreg(&priv->cru->clksel_con[6], BIT(1));
+		break;
+	case HCLK_SDMMC:
+		rk_clrreg(&priv->cru->clksel_con[33], BIT(8));
+		break;
 	default:
 		debug("%s: unsupported clk %ld\n", __func__, clk->id);
 		return -ENOENT;
@@ -1278,6 +1284,12 @@ static int rk3399_clk_disable(struct clk *clk)
 	case SCLK_PCIEPHY_REF:
 		rk_clrreg(&priv->cru->clksel_con[18], BIT(10));
 		break;
+	case SCLK_SDMMC:
+		rk_setreg(&priv->cru->clksel_con[6], BIT(1));
+		break;
+	case HCLK_SDMMC:
+		rk_setreg(&priv->cru->clksel_con[33], BIT(8));
+		break;
 	default:
 		debug("%s: unsupported clk %ld\n", __func__, clk->id);
 		return -ENOENT;
-- 
2.20.1


  parent reply	other threads:[~2022-06-02 11:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 11:02 [PATCH 0/3] arm: rockchip: rk3399: rock-pi-4: power domain driver to boot from MMCSD Xavier Drudis Ferran
2022-06-02 11:05 ` [PATCH 1/3] Reserve some RAM at 0 for bl31_0x00000000.bin for Radxa Rock Pi 4 Xavier Drudis Ferran
2022-06-02 11:06 ` Xavier Drudis Ferran [this message]
2022-06-02 11:08 ` [PATCH 3/3] arm: rockchip: rk3399: Power domain driver for rockchip Xavier Drudis Ferran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220602110659.GD1727@begut \
    --to=xdrudis@tinet.cat \
    --cc=kever.yang@rock-chips.com \
    --cc=lukma@denx.de \
    --cc=philipp.tomsich@vrull.eu \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox