summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-05-14 08:43:33 -0400
committerTom Rini <trini@konsulko.com>2020-05-14 08:43:33 -0400
commitfe16786149c8f1b2db95ed614a760bc443da6472 (patch)
treef752f84e6e532497b167cb51b65e132993618c9b /drivers
parentcae802924e423900df24dc58f382896ceb42a54b (diff)
parent82aef6c6f8a74a0595501bfbb2f6f763c786324f (diff)
downloadu-boot-fe16786149c8f1b2db95ed614a760bc443da6472.tar.gz
u-boot-fe16786149c8f1b2db95ed614a760bc443da6472.tar.bz2
u-boot-fe16786149c8f1b2db95ed614a760bc443da6472.zip
Merge tag 'rpi-next-2020.07' of https://gitlab.denx.de/u-boot/custodians/u-boot-raspberrypi
- fix phy configuration for RPi4's bcmgenet - sync RPi4's env size with other RPi configs - add kconfig option to reserver more pages in the EFI mem map - add support for SDMA which is used by RPi4 - fix corner case boot bug for RPi3 32-bit
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/sdhci.c17
-rw-r--r--drivers/net/bcmgenet.c5
-rw-r--r--drivers/serial/serial_bcm283x_mu.c21
-rw-r--r--drivers/serial/serial_bcm283x_pl011.c12
4 files changed, 30 insertions, 25 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 372dc0a820..8bb4393ce1 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -16,6 +16,7 @@
#include <sdhci.h>
#include <dm.h>
#include <linux/dma-mapping.h>
+#include <phys2bus.h>
static void sdhci_reset(struct sdhci_host *host, u8 mask)
{
@@ -150,7 +151,8 @@ static void sdhci_prepare_dma(struct sdhci_host *host, struct mmc_data *data,
mmc_get_dma_dir(data));
if (host->flags & USE_SDMA) {
- sdhci_writel(host, host->start_addr, SDHCI_DMA_ADDRESS);
+ sdhci_writel(host, phys_to_bus((ulong)host->start_addr),
+ SDHCI_DMA_ADDRESS);
} else if (host->flags & (USE_ADMA | USE_ADMA64)) {
sdhci_prepare_adma_table(host, data);
@@ -204,7 +206,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data)
start_addr &=
~(SDHCI_DEFAULT_BOUNDARY_SIZE - 1);
start_addr += SDHCI_DEFAULT_BOUNDARY_SIZE;
- sdhci_writel(host, start_addr,
+ sdhci_writel(host, phys_to_bus((ulong)start_addr),
SDHCI_DMA_ADDRESS);
}
}
@@ -739,13 +741,12 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
debug("%s, caps: 0x%x\n", __func__, caps);
#ifdef CONFIG_MMC_SDHCI_SDMA
- if (!(caps & SDHCI_CAN_DO_SDMA)) {
- printf("%s: Your controller doesn't support SDMA!!\n",
- __func__);
- return -EINVAL;
+ if ((caps & SDHCI_CAN_DO_SDMA)) {
+ host->flags |= USE_SDMA;
+ } else {
+ debug("%s: Your controller doesn't support SDMA!!\n",
+ __func__);
}
-
- host->flags |= USE_SDMA;
#endif
#if CONFIG_IS_ENABLED(MMC_SDHCI_ADMA)
if (!(caps & SDHCI_CAN_DO_ADMA2)) {
diff --git a/drivers/net/bcmgenet.c b/drivers/net/bcmgenet.c
index 8f4848aec6..e971b556ac 100644
--- a/drivers/net/bcmgenet.c
+++ b/drivers/net/bcmgenet.c
@@ -448,7 +448,10 @@ static int bcmgenet_adjust_link(struct bcmgenet_eth_priv *priv)
}
clrsetbits_32(priv->mac_reg + EXT_RGMII_OOB_CTRL, OOB_DISABLE,
- RGMII_LINK | RGMII_MODE_EN | ID_MODE_DIS);
+ RGMII_LINK | RGMII_MODE_EN);
+
+ if (phy_dev->interface == PHY_INTERFACE_MODE_RGMII)
+ setbits_32(priv->mac_reg + EXT_RGMII_OOB_CTRL, ID_MODE_DIS);
writel(speed << CMD_SPEED_SHIFT, (priv->mac_reg + UMAC_CMD));
diff --git a/drivers/serial/serial_bcm283x_mu.c b/drivers/serial/serial_bcm283x_mu.c
index a6ffc84b96..febb5ceea2 100644
--- a/drivers/serial/serial_bcm283x_mu.c
+++ b/drivers/serial/serial_bcm283x_mu.c
@@ -74,16 +74,6 @@ out:
return 0;
}
-static int bcm283x_mu_serial_probe(struct udevice *dev)
-{
- struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
- struct bcm283x_mu_priv *priv = dev_get_priv(dev);
-
- priv->regs = (struct bcm283x_mu_regs *)plat->base;
-
- return 0;
-}
-
static int bcm283x_mu_serial_getc(struct udevice *dev)
{
struct bcm283x_mu_priv *priv = dev_get_priv(dev);
@@ -165,15 +155,21 @@ static bool bcm283x_is_serial_muxed(void)
return true;
}
-static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev)
+static int bcm283x_mu_serial_probe(struct udevice *dev)
{
struct bcm283x_mu_serial_platdata *plat = dev_get_platdata(dev);
+ struct bcm283x_mu_priv *priv = dev_get_priv(dev);
fdt_addr_t addr;
/* Don't spawn the device if it's not muxed */
if (!bcm283x_is_serial_muxed())
return -ENODEV;
+ /*
+ * Read the ofdata here rather than in an ofdata_to_platdata() method
+ * since we need the soc simple-bus to be probed so that the 'ranges'
+ * property is used.
+ */
addr = devfdt_get_addr(dev);
if (addr == FDT_ADDR_T_NONE)
return -EINVAL;
@@ -187,6 +183,8 @@ static int bcm283x_mu_serial_ofdata_to_platdata(struct udevice *dev)
*/
plat->skip_init = true;
+ priv->regs = (struct bcm283x_mu_regs *)plat->base;
+
return 0;
}
#endif
@@ -195,7 +193,6 @@ U_BOOT_DRIVER(serial_bcm283x_mu) = {
.name = "serial_bcm283x_mu",
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(bcm283x_mu_serial_id),
- .ofdata_to_platdata = of_match_ptr(bcm283x_mu_serial_ofdata_to_platdata),
.platdata_auto_alloc_size = sizeof(struct bcm283x_mu_serial_platdata),
.probe = bcm283x_mu_serial_probe,
.ops = &bcm283x_mu_serial_ops,
diff --git a/drivers/serial/serial_bcm283x_pl011.c b/drivers/serial/serial_bcm283x_pl011.c
index 7d8ab7b716..923f402fbe 100644
--- a/drivers/serial/serial_bcm283x_pl011.c
+++ b/drivers/serial/serial_bcm283x_pl011.c
@@ -33,7 +33,7 @@ static bool bcm283x_is_serial_muxed(void)
return true;
}
-static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev)
+static int bcm283x_pl011_serial_probe(struct udevice *dev)
{
struct pl01x_serial_platdata *plat = dev_get_platdata(dev);
int ret;
@@ -42,6 +42,11 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev)
if (!bcm283x_is_serial_muxed())
return -ENODEV;
+ /*
+ * Read the ofdata here rather than in an ofdata_to_platdata() method
+ * since we need the soc simple-bus to be probed so that the 'ranges'
+ * property is used.
+ */
ret = pl01x_serial_ofdata_to_platdata(dev);
if (ret)
return ret;
@@ -52,7 +57,7 @@ static int bcm283x_pl011_serial_ofdata_to_platdata(struct udevice *dev)
*/
plat->skip_init = true;
- return 0;
+ return pl01x_serial_probe(dev);
}
static int bcm283x_pl011_serial_setbrg(struct udevice *dev, int baudrate)
@@ -86,9 +91,8 @@ U_BOOT_DRIVER(bcm283x_pl011_uart) = {
.name = "bcm283x_pl011",
.id = UCLASS_SERIAL,
.of_match = of_match_ptr(bcm283x_pl011_serial_id),
- .ofdata_to_platdata = of_match_ptr(bcm283x_pl011_serial_ofdata_to_platdata),
+ .probe = bcm283x_pl011_serial_probe,
.platdata_auto_alloc_size = sizeof(struct pl01x_serial_platdata),
- .probe = pl01x_serial_probe,
.ops = &bcm283x_pl011_serial_ops,
#if !CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_BOARD)
.flags = DM_FLAG_PRE_RELOC,