[U-Boot,08/16] mmc: bcm2835_sdhci: Add support for bcm2711 device
diff mbox series

Message ID 20190716133803.1174-9-andrei@gherzan.ro
State Superseded
Delegated to: Matthias Brugger
Headers show
Series
  • Raspberry Pi 32/64 support
Related show

Commit Message

Andrei Gherzan July 16, 2019, 1:37 p.m. UTC
From: Matthias Brugger <mbrugger@suse.com>

The bcm2711 has two emmc controller. The difference is the clocks
they use. Add support for the second emmc contoller.

Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
 drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Matthias Brugger July 16, 2019, 2:32 p.m. UTC | #1
On 16/07/2019 15:37, andrei@gherzan.ro wrote:
> From: Matthias Brugger <mbrugger@suse.com>
> 
> The bcm2711 has two emmc controller. The difference is the clocks
> they use. Add support for the second emmc contoller.
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>

missing your signed-off-by.

> ---
>  drivers/mmc/bcm2835_sdhci.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
> index 08bddd410e..e68dec3be7 100644
> --- a/drivers/mmc/bcm2835_sdhci.c
> +++ b/drivers/mmc/bcm2835_sdhci.c
> @@ -178,12 +178,13 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
>  	fdt_addr_t base;
>  	int emmc_freq;
>  	int ret;
> +	int clock_id = (int)dev_get_driver_data(dev);
>  
>  	base = devfdt_get_addr(dev);
>  	if (base == FDT_ADDR_T_NONE)
>  		return -EINVAL;
>  
> -	ret = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_EMMC);
> +	ret = bcm2835_get_mmc_clock(clock_id);
>  	if (ret < 0) {
>  		debug("%s: Failed to set MMC clock (err=%d)\n", __func__, ret);
>  		return ret;
> @@ -228,7 +229,14 @@ static int bcm2835_sdhci_probe(struct udevice *dev)
>  }
>  
>  static const struct udevice_id bcm2835_sdhci_match[] = {
> -	{ .compatible = "brcm,bcm2835-sdhci" },
> +	{
> +		.compatible = "brcm,bcm2835-sdhci",
> +		.data = BCM2835_MBOX_CLOCK_ID_EMMC
> +	},
> +	{
> +		.compatible = "brcm,bcm2711-emmc2",
> +		.data = BCM2835_MBOX_CLOCK_ID_EMMC2
> +	},
>  	{ /* sentinel */ }
>  };
>  
>

Patch
diff mbox series

diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c
index 08bddd410e..e68dec3be7 100644
--- a/drivers/mmc/bcm2835_sdhci.c
+++ b/drivers/mmc/bcm2835_sdhci.c
@@ -178,12 +178,13 @@  static int bcm2835_sdhci_probe(struct udevice *dev)
 	fdt_addr_t base;
 	int emmc_freq;
 	int ret;
+	int clock_id = (int)dev_get_driver_data(dev);
 
 	base = devfdt_get_addr(dev);
 	if (base == FDT_ADDR_T_NONE)
 		return -EINVAL;
 
-	ret = bcm2835_get_mmc_clock(BCM2835_MBOX_CLOCK_ID_EMMC);
+	ret = bcm2835_get_mmc_clock(clock_id);
 	if (ret < 0) {
 		debug("%s: Failed to set MMC clock (err=%d)\n", __func__, ret);
 		return ret;
@@ -228,7 +229,14 @@  static int bcm2835_sdhci_probe(struct udevice *dev)
 }
 
 static const struct udevice_id bcm2835_sdhci_match[] = {
-	{ .compatible = "brcm,bcm2835-sdhci" },
+	{
+		.compatible = "brcm,bcm2835-sdhci",
+		.data = BCM2835_MBOX_CLOCK_ID_EMMC
+	},
+	{
+		.compatible = "brcm,bcm2711-emmc2",
+		.data = BCM2835_MBOX_CLOCK_ID_EMMC2
+	},
 	{ /* sentinel */ }
 };