diff options
author | Tom Rini <trini@konsulko.com> | 2020-05-14 08:43:33 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-14 08:43:33 -0400 |
commit | fe16786149c8f1b2db95ed614a760bc443da6472 (patch) | |
tree | f752f84e6e532497b167cb51b65e132993618c9b | |
parent | cae802924e423900df24dc58f382896ceb42a54b (diff) | |
parent | 82aef6c6f8a74a0595501bfbb2f6f763c786324f (diff) |
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
-rw-r--r-- | arch/arm/dts/bcm283x-u-boot.dtsi | 8 | ||||
-rw-r--r-- | arch/arm/mach-bcm283x/Kconfig | 2 | ||||
-rw-r--r-- | board/raspberrypi/rpi/Kconfig | 10 | ||||
-rw-r--r-- | board/raspberrypi/rpi/rpi.c | 3 | ||||
-rw-r--r-- | configs/rpi_4_32b_defconfig | 1 | ||||
-rw-r--r-- | configs/rpi_4_defconfig | 1 | ||||
-rw-r--r-- | configs/rpi_arm64_defconfig | 2 | ||||
-rw-r--r-- | drivers/mmc/sdhci.c | 17 | ||||
-rw-r--r-- | drivers/net/bcmgenet.c | 5 | ||||
-rw-r--r-- | drivers/serial/serial_bcm283x_mu.c | 21 | ||||
-rw-r--r-- | drivers/serial/serial_bcm283x_pl011.c | 12 |
11 files changed, 56 insertions, 26 deletions
diff --git a/arch/arm/dts/bcm283x-u-boot.dtsi b/arch/arm/dts/bcm283x-u-boot.dtsi index 36548dad62..68d03627f4 100644 --- a/arch/arm/dts/bcm283x-u-boot.dtsi +++ b/arch/arm/dts/bcm283x-u-boot.dtsi @@ -19,3 +19,11 @@ &gpio { u-boot,dm-pre-reloc; }; + +&uart0_gpio14 { + u-boot,dm-pre-reloc; +}; + +&uart1_gpio14 { + u-boot,dm-pre-reloc; +}; diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig index 00419bf254..e6eb904e7f 100644 --- a/arch/arm/mach-bcm283x/Kconfig +++ b/arch/arm/mach-bcm283x/Kconfig @@ -209,4 +209,6 @@ config SYS_SOC config SYS_CONFIG_NAME default "rpi" +source "board/raspberrypi/rpi/Kconfig" + endmenu diff --git a/board/raspberrypi/rpi/Kconfig b/board/raspberrypi/rpi/Kconfig new file mode 100644 index 0000000000..e40088fde1 --- /dev/null +++ b/board/raspberrypi/rpi/Kconfig @@ -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 diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index e367ba3092..0206a093d4 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -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; diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig index 8d262d89b4..52bdd0ab02 100644 --- a/configs/rpi_4_32b_defconfig +++ b/configs/rpi_4_32b_defconfig @@ -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 diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig index 2a0cea4222..2ce1b6b6ec 100644 --- a/configs/rpi_4_defconfig +++ b/configs/rpi_4_defconfig @@ -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 diff --git a/configs/rpi_arm64_defconfig b/configs/rpi_arm64_defconfig index d2406ca36d..66c4a5368c 100644 --- a/configs/rpi_arm64_defconfig +++ b/configs/rpi_arm64_defconfig @@ -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 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, |