From dcad9abe7b60d765279c408846160f2720cae545 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 9 Jun 2022 07:59:17 +0200 Subject: mci: bcm2835: add bcm2711-emmc2 (Rpi4) support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While older Raspberry Pis didn't mind the POWER_CONTROL register being 0x00, the BCM2711 on the Raspberry Pi 4 does mind, so initialize it for 3.3V like we do in many other SDHCI drivers. With the compatible added, this can access the SD-Card on the Raspberry Pi 4. Change tested on both Raspberry Pi 3b and Raspberry Pi 4b. Signed-off-by: Uwe Kleine-König Signed-off-by: Ahmad Fatoum Link: https://lore.barebox.org/20220609055922.667016-17-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer --- drivers/mci/mci-bcm2835.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mci/mci-bcm2835.c b/drivers/mci/mci-bcm2835.c index 3380fa2afc..f092156f9a 100644 --- a/drivers/mci/mci-bcm2835.c +++ b/drivers/mci/mci-bcm2835.c @@ -324,7 +324,7 @@ static int bcm2835_mci_reset(struct mci_host *mci, struct device_d *mci_dev) sdhci_write32(&host->sdhci, SDHCI_HOST_CONTROL__POWER_CONTROL__BLOCK_GAP_CONTROL, - 0x00); + (SDHCI_BUS_VOLTAGE_330 | SDHCI_BUS_POWER_EN) << 8); sdhci_write32(&host->sdhci, SDHCI_ACMD12_ERR__HOST_CONTROL2, 0x00); sdhci_write32(&host->sdhci, @@ -423,6 +423,8 @@ static int bcm2835_mci_probe(struct device_d *hw_dev) static __maybe_unused struct of_device_id bcm2835_mci_compatible[] = { { .compatible = "brcm,bcm2835-sdhci", + }, { + .compatible = "brcm,bcm2711-emmc2", }, { /* sentinel */ } -- cgit v1.2.3