- 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
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEUdvKHhzqrUYPB/u8L21+TfbCqH4FAl69A9oSHG1icnVnZ2Vy
 QHN1c2UuY29tAAoJEC9tfk32wqh+/vYP/1UaHpYRyjW4AbiKeQHUA/orMx7CxNH2
 wMLl59iIA7Ef5m2lON2RpJxFhEWTeBRD6gRenKZnGp7wESEeDlCmocXRuOSWVBHG
 hjo52f9QXIm1WTlS21aZh6fVuBHNHbn89pBhBRcBI3uaZADkWnM3p3ZB3WCoYAqw
 SRE4T5FtDGBXF0vpyRJq90B6cgK74XifowXlVxsJolI0PYjm3mQunnh1Z3jAPn1i
 IVdFW4453o38N4sx8nsLVJYhYDvFOlxJx66zJN3Ac6fqAPN/6XPaO46+A0a64Rpw
 Bs8a90fLhkUze4Mmk2ZlEBgXvQG5Zlu8cqxxapFNINxO7eEFC6YHAEllRz8lNx1N
 KwfXMwU0HAoDhxQJ7z86iA0rGN7yHkeZps/dCpbqER+7GdZFmr2Rwmdk0L9B6cP1
 LJ5nbtgZcsTdflyBcMTds3rdPEwHXHSZUcGEBuwDnD56V0jOvmmDiIXU+4IRD9lZ
 HhNQqdj6lSJgCqBkdkC+1AQHfEWxvTfJHaQwJ7r8sOP50Uch8IEYTNNgaGoBlhvq
 icBoH1CAakkboBtjLmgmU157JjPRiYfjHXIeZQigtb8gWJ7xJnGbTDGfcdwPrYod
 HMHQ5KXPhFDiAPpfE2By8embM3J/ogWS8SV5l2bxHb5ZDI31aoT66elF2s4gMDS7
 d92/1HzkKEKl
 =66oV
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Tom Rini 2020-05-14 08:43:33 -04:00
commit fe16786149
11 changed files with 56 additions and 26 deletions

View File

@ -19,3 +19,11 @@
&gpio {
u-boot,dm-pre-reloc;
};
&uart0_gpio14 {
u-boot,dm-pre-reloc;
};
&uart1_gpio14 {
u-boot,dm-pre-reloc;
};

View File

@ -209,4 +209,6 @@ config SYS_SOC
config SYS_CONFIG_NAME
default "rpi"
source "board/raspberrypi/rpi/Kconfig"
endmenu

View File

@ -0,0 +1,10 @@
if SYS_BOARD = "rpi"
config RPI_EFI_NR_SPIN_PAGES
int "Spin table page count"
default 1
help
Number of pages to reserve starting at page 0 for spin tables in the EFI
memory map
endif

View File

@ -489,7 +489,8 @@ int ft_board_setup(void *blob, bd_t *bd)
#ifdef CONFIG_EFI_LOADER
/* Reserve the spin table */
efi_add_memory_map(0, 1, EFI_RESERVED_MEMORY_TYPE, 0);
efi_add_memory_map(0, CONFIG_RPI_EFI_NR_SPIN_PAGES,
EFI_RESERVED_MEMORY_TYPE, 0);
#endif
return 0;

View File

@ -24,6 +24,7 @@ CONFIG_DFU_MMC=y
CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_DM_ETH=y
CONFIG_BCMGENET=y

View File

@ -24,6 +24,7 @@ CONFIG_DFU_MMC=y
CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_DM_ETH=y
CONFIG_BCMGENET=y

View File

@ -3,6 +3,7 @@ CONFIG_ARCH_BCM283X=y
CONFIG_SYS_TEXT_BASE=0x00080000
CONFIG_TARGET_RPI_ARM64=y
CONFIG_SYS_MALLOC_F_LEN=0x2000
CONFIG_ENV_SIZE=0x4000
CONFIG_NR_DRAM_BANKS=2
CONFIG_DISTRO_DEFAULTS=y
CONFIG_OF_BOARD_SETUP=y
@ -22,6 +23,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
CONFIG_DM_KEYBOARD=y
CONFIG_DM_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_SDMA=y
CONFIG_MMC_SDHCI_BCM2835=y
CONFIG_DM_ETH=y
CONFIG_BCMGENET=y

View File

@ -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)) {

View File

@ -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));

View File

@ -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,

View File

@ -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,