From 58880b5208e43f324c4cc2d7eca5031e4dc0ee44 Mon Sep 17 00:00:00 2001 From: Matthias Brugger Date: Wed, 30 Nov 2022 12:57:49 +0100 Subject: [PATCH 01/12] MAINTAINERS: add RaspberryPi co-maintainer Peter accpeted to step up as a co-maintainer for the RPis. Reflect that in the corresponding MAINTAINERS files. Signed-off-by: Matthias Brugger Reviewed-by: Peter Robinson --- MAINTAINERS | 1 + board/raspberrypi/rpi/MAINTAINERS | 1 + 2 files changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bc9081b62a..f9f4eeda1c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -192,6 +192,7 @@ N: aspeed ARM BROADCOM BCM283X / BCM27XX M: Matthias Brugger +M: Peter Robinson S: Maintained F: arch/arm/dts/bcm283* F: arch/arm/mach-bcm283x/ diff --git a/board/raspberrypi/rpi/MAINTAINERS b/board/raspberrypi/rpi/MAINTAINERS index 4f1b23efc8..98935119f0 100644 --- a/board/raspberrypi/rpi/MAINTAINERS +++ b/board/raspberrypi/rpi/MAINTAINERS @@ -1,5 +1,6 @@ RPI BOARD M: Matthias Brugger +M: Peter Robinson S: Maintained F: board/raspberrypi/rpi/ F: include/configs/rpi.h From 1cfba53ca46cade2dbf4e067afc8c19e72909a4b Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Thu, 24 Nov 2022 14:05:59 +0000 Subject: [PATCH 02/12] config: tools only: add VIDEO to build bmp_logo Pre 2023.01 the bmp_logo was built as part of the tools-only_defconfig build, something changed and the VIDEO dep needed to build it is no longer pulled in so fix that by explicitly defining it. Signed-off-by: Peter Robinson Reviewed-by: Simon Glass --- configs/tools-only_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/tools-only_defconfig b/configs/tools-only_defconfig index 86464d2f07..de99f3857c 100644 --- a/configs/tools-only_defconfig +++ b/configs/tools-only_defconfig @@ -27,6 +27,7 @@ CONFIG_DM_RTC=y CONFIG_SOUND=y CONFIG_SYSRESET=y CONFIG_TIMER=y +CONFIG_VIDEO=y # CONFIG_VIRTIO_MMIO is not set # CONFIG_VIRTIO_PCI is not set # CONFIG_VIRTIO_SANDBOX is not set From 9f52e765dcf4e5b940db98136ad0382aecb2b932 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 4 Nov 2022 12:28:07 +0100 Subject: [PATCH 03/12] MAINTAINERS: Move usb_storage from DFU to USB The usb_storage.c is the host-side USB mass storage device support, it is not the DFU/UMS gadget-side implementation. Fix the entry. Signed-off-by: Marek Vasut --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index f9f4eeda1c..f0918b5810 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -855,7 +855,6 @@ F: cmd/dfu.c F: cmd/usb_*.c F: common/dfu.c F: common/update.c -F: common/usb_storage.c F: doc/api/dfu.rst F: doc/usage/dfu.rst F: drivers/dfu/ @@ -1483,6 +1482,7 @@ T: git https://source.denx.de/u-boot/custodians/u-boot-usb.git F: drivers/usb/ F: common/usb.c F: common/usb_kbd.c +F: common/usb_storage.c F: include/usb.h USB xHCI From dec64d55afca17bfc48366a48a0d5894b8a3bdd2 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:35 +0000 Subject: [PATCH 04/12] dm: core: Fix iteration over driver_info records We should only perform additional iteration steps when needed to initialize the parent of a device. Other binding errors (such as a missing driver) should not lead to additional iteration steps. Unnecessary iteration steps can cause issues when memory is tightly constrained (such as in the TPL/SPL) since device_bind_by_name() unconditionally allocates memory for a struct udevice. On the SanCloud BBE this led to boot failure caused by memory exhaustion in the SPL when booting from SPI flash. Signed-off-by: Paul Barker --- drivers/core/lists.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/core/lists.c b/drivers/core/lists.c index 3878957c9e..8034a8f48d 100644 --- a/drivers/core/lists.c +++ b/drivers/core/lists.c @@ -120,10 +120,10 @@ int lists_bind_drivers(struct udevice *parent, bool pre_reloc_only) int ret; ret = bind_drivers_pass(parent, pre_reloc_only); - if (!ret) - break; - if (ret != -EAGAIN && !result) + if (!result || result == -EAGAIN) result = ret; + if (ret != -EAGAIN) + break; } return result; From e92f47c06a1492859768ffc43bb2a4e16c2f0e42 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:36 +0000 Subject: [PATCH 05/12] bus: TI sysc driver requires DM This driver does not build if CONFIG_DM is disabled as it uses the function `dev_get_priv`. Signed-off-by: Paul Barker --- drivers/bus/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index d742ed333b..c607d24ecf 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -13,7 +13,7 @@ config TI_PWMSS config TI_SYSC bool "TI sysc interconnect target module driver" - depends on ARCH_OMAP2PLUS + depends on DM && ARCH_OMAP2PLUS help Generic driver for Texas Instruments interconnect target module found on many TI SoCs. From 07744f2ac03c06f0a41aaecccb9a413d38e6c369 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:37 +0000 Subject: [PATCH 06/12] bus: Optionally include TI sysc driver in SPL/TPL The TI sysc bus driver is required to allow access to the SPI bus on am335x platforms. To support SPI boot this driver needs to be enabled in the SPL/TPL as appropriate. Signed-off-by: Paul Barker --- drivers/Makefile | 2 +- drivers/bus/Kconfig | 7 +++++++ drivers/bus/Makefile | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/Makefile b/drivers/Makefile index ac2d83af4e..6f1de58e00 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -37,6 +37,7 @@ obj-$(CONFIG_$(SPL_)SYSINFO) += sysinfo/ obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/ obj-$(CONFIG_XEN) += xen/ obj-$(CONFIG_$(SPL_)FPGA) += fpga/ +obj-y += bus/ ifndef CONFIG_TPL_BUILD ifndef CONFIG_VPL_BUILD @@ -77,7 +78,6 @@ ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) obj-y += adc/ obj-y += ata/ -obj-y += bus/ obj-$(CONFIG_DM_DEMO) += demo/ obj-$(CONFIG_BIOSEMU) += bios_emulator/ obj-y += block/ diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig index c607d24ecf..e60aa722b9 100644 --- a/drivers/bus/Kconfig +++ b/drivers/bus/Kconfig @@ -18,6 +18,13 @@ config TI_SYSC Generic driver for Texas Instruments interconnect target module found on many TI SoCs. +config SPL_TI_SYSC + bool "Support TI sysc interconnect in SPL" + depends on SPL_DM && TI_SYSC + help + Generic driver for Texas Instruments interconnect target module + found on many TI SoCs. + config UNIPHIER_SYSTEM_BUS bool "UniPhier System Bus driver" depends on ARCH_UNIPHIER diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile index a2e71c7b3b..0802b9666b 100644 --- a/drivers/bus/Makefile +++ b/drivers/bus/Makefile @@ -3,6 +3,9 @@ # Makefile for the bus drivers. # +ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_TPL_BUILD),) obj-$(CONFIG_TI_PWMSS) += ti-pwmss.o -obj-$(CONFIG_TI_SYSC) += ti-sysc.o obj-$(CONFIG_UNIPHIER_SYSTEM_BUS) += uniphier-system-bus.o +endif + +obj-$(CONFIG_$(SPL_)TI_SYSC) += ti-sysc.o From 78b9afd2c30dd79655985fd45653a84c253ddf1b Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:38 +0000 Subject: [PATCH 07/12] am335x-evm: Enable required dtb nodes in SPL For successful boot when CONFIG_SPL_OF_CONTROL=y, we need to ensure that the board EEPROM on i2c0, the uart0 serial port and the relevant boot device (mmc1 or mmc2) can be accessed in the SPL. We also need to preserve the parent nodes for each required dtb node. Signed-off-by: Paul Barker --- arch/arm/dts/am335x-evm-u-boot.dtsi | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/arch/arm/dts/am335x-evm-u-boot.dtsi b/arch/arm/dts/am335x-evm-u-boot.dtsi index 4cf5f9928d..8fc65df2ef 100644 --- a/arch/arm/dts/am335x-evm-u-boot.dtsi +++ b/arch/arm/dts/am335x-evm-u-boot.dtsi @@ -6,9 +6,9 @@ #include "am33xx-u-boot.dtsi" &l4_per { - + u-boot,dm-pre-reloc; segment@300000 { - + u-boot,dm-pre-reloc; target-module@e000 { u-boot,dm-pre-reloc; @@ -26,3 +26,29 @@ &usb0 { dr_mode = "peripheral"; }; + +&i2c0 { + u-boot,dm-pre-reloc; +}; + +&l4_wkup { + u-boot,dm-pre-reloc; + segment@200000 { + u-boot,dm-pre-reloc; + target-module@9000 { + u-boot,dm-pre-reloc; + }; + }; +}; + +&uart0 { + u-boot,dm-pre-reloc; +}; + +&mmc1 { + u-boot,dm-pre-reloc; +}; + +&mmc2 { + u-boot,dm-pre-reloc; +}; From f3b9abf5ba019232e38900ec4a241f0ce4630cea Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:39 +0000 Subject: [PATCH 08/12] am335x-evm: Fix spiboot configuration The advanced address translation provided by CONFIG_SPL_OF_TRANSLATE is needed to determine the base address of the uart0 peripheral on am335x platforms when CONFIG_SPL_OF_CONTROL is enabled. If CONFIG_SPL_OF_CONTROL is enabled in the base (non-spiboot) am335x_evm_defconfig, then CONFIG_SPL_OF_TRANSLATE will also need to be enabled there. Unfortunately this cannot be done pre-emptively due to the kconfig dependencies. The TI clk-ctrl & TI sysc drivers are also required to bring up the SPI bus on am335x platforms. Signed-off-by: Paul Barker --- configs/am335x_evm_spiboot_defconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configs/am335x_evm_spiboot_defconfig b/configs/am335x_evm_spiboot_defconfig index 3d04e6fa93..2bc911cfd0 100644 --- a/configs/am335x_evm_spiboot_defconfig +++ b/configs/am335x_evm_spiboot_defconfig @@ -53,10 +53,14 @@ CONFIG_SPL_ENV_IS_NOWHERE=y CONFIG_VERSION_VARIABLE=y CONFIG_NET_RETRY_COUNT=10 CONFIG_BOOTP_SEND_HOSTNAME=y +CONFIG_SPL_OF_TRANSLATE=y +CONFIG_SPL_TI_SYSC=y CONFIG_BOOTCOUNT_LIMIT=y CONFIG_SYS_BOOTCOUNT_BE=y CONFIG_CLK=y +CONFIG_SPL_CLK=y CONFIG_CLK_CDCE9XX=y +CONFIG_CLK_TI_CTRL=y CONFIG_DFU_TFTP=y CONFIG_DFU_MMC=y CONFIG_DFU_NAND=y From d883280b91650ea28c0e58a61888e12b2c66552a Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:40 +0000 Subject: [PATCH 09/12] am335x-evm: Support STMicro/Micron SPI flash This change enables access to the SPI flash on the SanCloud BBE Lite board. Signed-off-by: Paul Barker --- configs/am335x_evm_defconfig | 1 + configs/am335x_evm_spiboot_defconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig index f0fbe475b3..f73123e0b7 100644 --- a/configs/am335x_evm_defconfig +++ b/configs/am335x_evm_defconfig @@ -92,6 +92,7 @@ CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y CONFIG_SYS_NAND_U_BOOT_OFFS=0xc0000 CONFIG_DM_SPI_FLASH=y CONFIG_SF_DEFAULT_SPEED=24000000 +CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_PHY_ATHEROS=y CONFIG_PHY_SMSC=y diff --git a/configs/am335x_evm_spiboot_defconfig b/configs/am335x_evm_spiboot_defconfig index 2bc911cfd0..7f422010c1 100644 --- a/configs/am335x_evm_spiboot_defconfig +++ b/configs/am335x_evm_spiboot_defconfig @@ -84,6 +84,7 @@ CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y CONFIG_SYS_NAND_U_BOOT_OFFS=0xc0000 CONFIG_DM_SPI_FLASH=y CONFIG_SF_DEFAULT_SPEED=24000000 +CONFIG_SPI_FLASH_STMICRO=y CONFIG_SPI_FLASH_WINBOND=y CONFIG_PHY_ATHEROS=y CONFIG_PHY_SMSC=y From 8328022d05eade11859956b099822a4c8eefea68 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:41 +0000 Subject: [PATCH 10/12] am335x-sancloud-bbe-lite: SPI flash is JEDEC compatible Signed-off-by: Paul Barker --- arch/arm/dts/am335x-sancloud-bbe-lite.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/am335x-sancloud-bbe-lite.dts b/arch/arm/dts/am335x-sancloud-bbe-lite.dts index d6ef19311a..8ffbc72dc5 100644 --- a/arch/arm/dts/am335x-sancloud-bbe-lite.dts +++ b/arch/arm/dts/am335x-sancloud-bbe-lite.dts @@ -41,7 +41,7 @@ #address-cells = <1>; #size-cells = <0>; - compatible = "micron,spi-authenta"; + compatible = "micron,spi-authenta", "jedec,spi-nor"; reg = <0>; spi-max-frequency = <16000000>; From b9829e9846ec76696a3e9058d0ffef436a3de4c4 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:42 +0000 Subject: [PATCH 11/12] am335x-sancloud-bbe: Add -u-boot.dtsi files The SanCloud BBE requires the same dtb nodes to be present in the SPL as the AM335x EVM. The SanCloud BBE Lite also requires the SPI flash node and all dependencies to be present in the SPL to support SPI boot. Signed-off-by: Paul Barker --- .../dts/am335x-sancloud-bbe-lite-u-boot.dtsi | 44 +++++++++++++++++++ arch/arm/dts/am335x-sancloud-bbe-u-boot.dtsi | 6 +++ 2 files changed, 50 insertions(+) create mode 100644 arch/arm/dts/am335x-sancloud-bbe-lite-u-boot.dtsi create mode 100644 arch/arm/dts/am335x-sancloud-bbe-u-boot.dtsi diff --git a/arch/arm/dts/am335x-sancloud-bbe-lite-u-boot.dtsi b/arch/arm/dts/am335x-sancloud-bbe-lite-u-boot.dtsi new file mode 100644 index 0000000000..01c105ebb3 --- /dev/null +++ b/arch/arm/dts/am335x-sancloud-bbe-lite-u-boot.dtsi @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ + * Copyright (C) 2021 SanCloud Ltd + */ + +#include "am335x-sancloud-bbe-u-boot.dtsi" + +&l4_wkup { + segment@200000 { + target-module@0 { + u-boot,dm-pre-reloc; + }; + }; +}; + +&prcm { + u-boot,dm-pre-reloc; +}; + +&per_cm { + u-boot,dm-pre-reloc; +}; + +&l4ls_clkctrl { + u-boot,dm-pre-reloc; +}; + +&l4_per { + u-boot,dm-pre-reloc; + segment@0 { + u-boot,dm-pre-reloc; + target-module@30000 { + u-boot,dm-pre-reloc; + }; + }; +}; + +&spi0 { + u-boot,dm-pre-reloc; + channel@0 { + u-boot,dm-pre-reloc; + }; +}; diff --git a/arch/arm/dts/am335x-sancloud-bbe-u-boot.dtsi b/arch/arm/dts/am335x-sancloud-bbe-u-boot.dtsi new file mode 100644 index 0000000000..06e7554a63 --- /dev/null +++ b/arch/arm/dts/am335x-sancloud-bbe-u-boot.dtsi @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2022 SanCloud Ltd + */ + +#include "am335x-evm-u-boot.dtsi" From c9311b5a901f6cbdbce368f1aa4a60e1c0ce8dc6 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Mon, 14 Nov 2022 12:42:43 +0000 Subject: [PATCH 12/12] MAINTAINERS: Adopt SanCloud boards Signed-off-by: Paul Barker Cc: Marc Murphy --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index f0918b5810..75b27bc1cc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -495,6 +495,12 @@ F: arch/arm/mach-exynos/ F: arch/arm/mach-s5pc1xx/ F: arch/arm/cpu/armv7/s5p-common/ +ARM SANCLOUD +M: Paul Barker +R: Marc Murphy +S: Supported +F: arch/arm/dts/am335x-sancloud* + ARM SNAPDRAGON M: Ramon Fried S: Maintained