diff options
author | Tom Rini <trini@konsulko.com> | 2019-09-06 19:49:51 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-09-06 19:49:51 -0400 |
commit | ba83753289f5ad99f64e72fd0ee141c647aeda0f (patch) | |
tree | d1758ddd69cf9c754494d63f2f9e9b98ce61842f /drivers | |
parent | 9562b20dba65e33fc4afc27d83641463f017221b (diff) | |
parent | e0351b242a9bf60dd6abdfd44104bb702e7000a0 (diff) | |
download | u-boot-ba83753289f5ad99f64e72fd0ee141c647aeda0f.tar.gz u-boot-ba83753289f5ad99f64e72fd0ee141c647aeda0f.tar.bz2 u-boot-ba83753289f5ad99f64e72fd0ee141c647aeda0f.zip |
Merge tag 'rpi-next-2019.10' of https://github.com/mbgg/u-boot
- fix mailbox status register used for polling
- fix bcm2835_sdhost to wait long enough for a transfer to complete
- increase kernel image size from 8 MB to 64 MB on arm64
- add support for RPi4
- add prefixes for raspberry pi related stuff to git-mailrc
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/bcm2835_sdhci.c | 12 | ||||
-rw-r--r-- | drivers/mmc/bcm2835_sdhost.c | 12 |
2 files changed, 17 insertions, 7 deletions
diff --git a/drivers/mmc/bcm2835_sdhci.c b/drivers/mmc/bcm2835_sdhci.c index bf3304c4dc..bc9ee95fd5 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; @@ -230,7 +231,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 */ } }; diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c index 1ce019af57..7f70acaf39 100644 --- a/drivers/mmc/bcm2835_sdhost.c +++ b/drivers/mmc/bcm2835_sdhost.c @@ -234,7 +234,7 @@ static void bcm2835_reset_internal(struct bcm2835_host *host) static int bcm2835_wait_transfer_complete(struct bcm2835_host *host) { - int timediff = 0; + ulong tstart_ms = get_timer(0); while (1) { u32 edm, fsm; @@ -254,11 +254,13 @@ static int bcm2835_wait_transfer_complete(struct bcm2835_host *host) break; } - /* Error out after 100000 register reads (~1s) */ - if (timediff++ == 100000) { + /* Error out after ~1s */ + ulong tlapse_ms = get_timer(tstart_ms); + if ( tlapse_ms > 1000 /* ms */ ) { + dev_err(host->dev, - "wait_transfer_complete - still waiting after %d retries\n", - timediff); + "wait_transfer_complete - still waiting after %lu ms\n", + tlapse_ms); bcm2835_dumpregs(host); return -ETIMEDOUT; } |