From 3db0989e68ee23db9d5ae970304890100b4fb9bb Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Thu, 25 Jul 2019 16:20:41 +0300 Subject: [PATCH 01/15] env: ti: boot: Handle reboot reason from BCB In case of Android boot, reboot reason can be written into BCB (usually it's an area in 'misc' partition). U-Boot then can obtain that reboot reason from BCB and handle it accordingly to achieve correct Android boot flow, like it was suggested in [1]: - if it's empty: perform normal Android boot from eMMC - if it contains "bootonce-bootloader": get into fastboot mode - if it contains "boot-recovery": perform recovery boot The latter is not implemented yet, as it depends on some features that are not implemented on TI platforms yet (in AOSP and in U-Boot). [1] https://marc.info/?l=u-boot&m=152508418909737&w=2 Signed-off-by: Sam Protsenko --- include/environment/ti/boot.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h index e55a4aec57..684a744f31 100644 --- a/include/environment/ti/boot.h +++ b/include/environment/ti/boot.h @@ -98,6 +98,10 @@ #define AB_SELECT "" #endif +#define FASTBOOT_CMD \ + "echo Booting into fastboot ...; " \ + "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " + #define DEFAULT_COMMON_BOOT_TI_ARGS \ "console=" CONSOLEDEV ",115200n8\0" \ "fdtfile=undefined\0" \ @@ -117,6 +121,28 @@ "setenv mmcroot /dev/mmcblk0p2 rw; " \ "run mmcboot;\0" \ "emmc_android_boot=" \ + "if bcb load " __stringify(CONFIG_FASTBOOT_FLASH_MMC_DEV) " " \ + CONTROL_PARTITION "; then " \ + "if bcb test command = bootonce-bootloader; then " \ + "echo BCB: Bootloader boot...; " \ + "bcb clear command; bcb store; " \ + FASTBOOT_CMD \ + "elif bcb test command = boot-recovery; then " \ + "echo BCB: Recovery boot...; " \ + "echo Warning: recovery is not implemented; " \ + "echo Performing normal boot for now...; " \ + "bcb clear command; bcb store; " \ + "run emmc_android_normal_boot; " \ + "else " \ + "echo BCB: Normal boot requested...; " \ + "run emmc_android_normal_boot; " \ + "fi; " \ + "else " \ + "echo Warning: BCB is corrupted or does not exist; " \ + "echo Performing normal boot...; " \ + "run emmc_android_normal_boot; " \ + "fi;\0" \ + "emmc_android_normal_boot=" \ "echo Trying to boot Android from eMMC ...; " \ "run update_to_fit; " \ "setenv eval_bootargs setenv bootargs $bootargs; " \ @@ -176,8 +202,7 @@ "if test ${dofastboot} -eq 1; then " \ "echo Boot fastboot requested, resetting dofastboot ...;" \ "setenv dofastboot 0; saveenv;" \ - "echo Booting into fastboot ...; " \ - "fastboot " __stringify(CONFIG_FASTBOOT_USB_DEV) "; " \ + FASTBOOT_CMD \ "fi;" \ "if test ${boot_fit} -eq 1; then " \ "run update_to_fit;" \ From 4347b0b0b26e41376640872650e5558fc07aea76 Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Thu, 25 Jul 2019 20:11:53 +0300 Subject: [PATCH 02/15] omap: Correct the fastboot product var "fastboot flashall" expects "fastboot getvar product" value to be one of values provided in android-info.txt file (in AOSP), from "require board=" list. Before this patch, "am57xx" is returned for all AM57xx based boards, as it's set in $board env var from SYS_BOARD in board/ti/am57xx/Kconfig file, which is used for default implementation of "fastboot getvar product". In order to fix that inconsistency, let's do next: 1. In U-Boot: override fastboot.product, reusing the value from $board_name 2. In AOSP: provide values for all AM57xx boards we can use to device/ti/beagle_x15/board-info.txt file This way requirements check in "fastboot flashall" will work as expected, verifying that user tries to flash images to the board which those images were built for. Signed-off-by: Sam Protsenko Acked-by: Andrew F. Davis --- arch/arm/mach-omap2/utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c index edf5edcb68..7d01446940 100644 --- a/arch/arm/mach-omap2/utils.c +++ b/arch/arm/mach-omap2/utils.c @@ -129,12 +129,25 @@ static inline void omap_set_fastboot_userdata_size(void) { } #endif /* CONFIG_FASTBOOT_FLASH_MMC */ + +static void omap_set_fastboot_product(void) +{ + const char *board_name; + + board_name = env_get("board_name"); + if (board_name == NULL) + printf("Warning: fastboot.product: unknown board\n"); + + env_set("fastboot.product", board_name); +} + void omap_set_fastboot_vars(void) { omap_set_fastboot_cpu(); omap_set_fastboot_secure(); omap_set_fastboot_board_rev(); omap_set_fastboot_userdata_size(); + omap_set_fastboot_product(); } #endif /* CONFIG_FASTBOOT_FLASH */ From 29e783d672136c192153ac4d6b8d5015026529c2 Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Thu, 25 Jul 2019 20:20:18 +0300 Subject: [PATCH 03/15] configs: am57xx_evm_defconfig: Enable 'bcb' command It is essential to have an access to BCB area of 'misc' partition on Android devices [1]. For BeagleBoard X15 the 'bcb' command will be further used for reboot reason implementation and booting to recovery. It can be also used for debugging reasons, like checking RescueParty messages in BCB area. [1] doc/android/bcb.txt Signed-off-by: Sam Protsenko --- configs/am57xx_evm_defconfig | 1 + configs/am57xx_hs_evm_defconfig | 1 + configs/am57xx_hs_evm_usb_defconfig | 1 + 3 files changed, 3 insertions(+) diff --git a/configs/am57xx_evm_defconfig b/configs/am57xx_evm_defconfig index a3de7a4ec4..a1b8d2d988 100644 --- a/configs/am57xx_evm_defconfig +++ b/configs/am57xx_evm_defconfig @@ -29,6 +29,7 @@ CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_SPL=y +CONFIG_CMD_BCB=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_PMIC is not set diff --git a/configs/am57xx_hs_evm_defconfig b/configs/am57xx_hs_evm_defconfig index d2548ff660..4563e98401 100644 --- a/configs/am57xx_hs_evm_defconfig +++ b/configs/am57xx_hs_evm_defconfig @@ -31,6 +31,7 @@ CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_DMA_SUPPORT=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_SPI_LOAD=y +CONFIG_CMD_BCB=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_PMIC is not set diff --git a/configs/am57xx_hs_evm_usb_defconfig b/configs/am57xx_hs_evm_usb_defconfig index b52d321a69..20063d1ebb 100644 --- a/configs/am57xx_hs_evm_usb_defconfig +++ b/configs/am57xx_hs_evm_usb_defconfig @@ -36,6 +36,7 @@ CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_DFU=y CONFIG_SPL_YMODEM_SUPPORT=y +CONFIG_CMD_BCB=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_PMIC is not set From 914694d6a90cac6eeefea9106408112e0c026adc Mon Sep 17 00:00:00 2001 From: Sam Protsenko Date: Thu, 25 Jul 2019 20:20:19 +0300 Subject: [PATCH 04/15] configs: am57xx_evm_defconfig: Enable 'dtimg' command We are going to implement DTBO partition for BeagleBoard X15 further. To support this, 'dtimg' command must be enabled. Signed-off-by: Sam Protsenko --- configs/am57xx_evm_defconfig | 1 + configs/am57xx_hs_evm_defconfig | 1 + configs/am57xx_hs_evm_usb_defconfig | 1 + 3 files changed, 3 insertions(+) diff --git a/configs/am57xx_evm_defconfig b/configs/am57xx_evm_defconfig index a1b8d2d988..96de6f48c9 100644 --- a/configs/am57xx_evm_defconfig +++ b/configs/am57xx_evm_defconfig @@ -28,6 +28,7 @@ CONFIG_SPL_DMA_SUPPORT=y CONFIG_SPL_OS_BOOT=y CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y +CONFIG_CMD_DTIMG=y CONFIG_CMD_SPL=y CONFIG_CMD_BCB=y # CONFIG_CMD_FLASH is not set diff --git a/configs/am57xx_hs_evm_defconfig b/configs/am57xx_hs_evm_defconfig index 4563e98401..d776a0b244 100644 --- a/configs/am57xx_hs_evm_defconfig +++ b/configs/am57xx_hs_evm_defconfig @@ -31,6 +31,7 @@ CONFIG_SPL_SEPARATE_BSS=y CONFIG_SPL_DMA_SUPPORT=y # CONFIG_SPL_NAND_SUPPORT is not set CONFIG_SPL_SPI_LOAD=y +CONFIG_CMD_DTIMG=y CONFIG_CMD_BCB=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set diff --git a/configs/am57xx_hs_evm_usb_defconfig b/configs/am57xx_hs_evm_usb_defconfig index 20063d1ebb..6419c53296 100644 --- a/configs/am57xx_hs_evm_usb_defconfig +++ b/configs/am57xx_hs_evm_usb_defconfig @@ -36,6 +36,7 @@ CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_USB_GADGET=y CONFIG_SPL_DFU=y CONFIG_SPL_YMODEM_SUPPORT=y +CONFIG_CMD_DTIMG=y CONFIG_CMD_BCB=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_SETEXPR is not set From ef97842b43efe98fcfa251b668b52e82ed1e5ff7 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Fri, 26 Jul 2019 17:53:45 -0500 Subject: [PATCH 05/15] ARM: da850evm: Split MTDPARTS into SPL and u-boot The MTDPARTS currently lists just u-boot.ais as 512k in size. This works when loading the ais file via serial port, but if one wanted to update just the u-boot portion, it's not really possible. This patch splits the MTDPARTS into a 32k SPL partiion and a 480k u-boot partition which allows u-boot.img to be burned to the u-boot partition. The remaining partitions are left with the same sizes and offsets to not break backwards compatibility. Signed-off-by: Adam Ford --- configs/da850evm_defconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index 7de1d2ffc4..dd0eb982aa 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -36,7 +36,7 @@ CONFIG_CMD_DM=y CONFIG_CMD_FS_UUID=y CONFIG_CMD_MTDPARTS=y CONFIG_MTDIDS_DEFAULT="nor0=spi0.0" -CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:512k(u-boot.ais),64k(u-boot-env),7552k(kernel-spare),64k(MAC-Address)" +CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:32k(SPL),480k(u-boot),64k(u-boot-env),7552k(kernel-spare),64k(MAC-Address)" CONFIG_CMD_DIAG=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y @@ -77,4 +77,3 @@ CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_DA8XX=y CONFIG_USB_STORAGE=y # CONFIG_FAT_WRITE is not set -CONFIG_USE_TINY_PRINTF=y From 3cdecb341e0a1507910601b14ae2a5f81f86d1d3 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Fri, 26 Jul 2019 18:31:13 -0500 Subject: [PATCH 06/15] ARM: da850-evm: Replace CMD_SF with CMD_MTD This patch enables MTD and CMD_MTD and it works with SPI NOR, so the older CMD_SF can be removed. Signed-off-by: Adam Ford --- configs/da850evm_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/da850evm_defconfig b/configs/da850evm_defconfig index dd0eb982aa..a161ad5e02 100644 --- a/configs/da850evm_defconfig +++ b/configs/da850evm_defconfig @@ -30,6 +30,8 @@ CONFIG_CRC32_VERIFY=y CONFIG_CMD_DM=y # CONFIG_CMD_FLASH is not set # CONFIG_CMD_GPT is not set +CONFIG_CMD_MTD=y +# CONFIG_CMD_SF is not set # CONFIG_CMD_SETEXPR is not set # CONFIG_CMD_TIME is not set # CONFIG_CMD_EXT4 is not set From dcddf0fd83e668999db1f7eefa1e644a2784a516 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Mon, 29 Jul 2019 11:13:41 -0500 Subject: [PATCH 07/15] arm: dts: k3-am654-base-board: Fix cpsw_nuss power-domains property The commit 355be915ed08 ("arm: dts: k3-am654: Update power-domains property for each node") has updated the power-domain cells value and updated power-domains property in various existing dts nodes but missed updating the cpsw_nuss node. This results in the following build warning, fix this. arch/arm/dts/k3-am654-base-board.dtb: Warning (power_domains_property): /interconnect@100000/interconnect@28380000/cpsw_nuss@046000000:power-domains: property size (8) too small for cell size 2 arch/arm/dts/k3-am654-r5-base-board.dtb: Warning (power_domains_property): /interconnect@100000/interconnect@28380000/cpsw_nuss@046000000:power-domains: property size (8) too small for cell size 2 Fixes: 355be915ed08 ("arm: dts: k3-am654: Update power-domains property for each node") Signed-off-by: Suman Anna Reviewed-by: Lokesh Vutla --- arch/arm/dts/k3-am654-base-board-u-boot.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi index 8a9d147ffa..8589f76d23 100644 --- a/arch/arm/dts/k3-am654-base-board-u-boot.dtsi +++ b/arch/arm/dts/k3-am654-base-board-u-boot.dtsi @@ -98,7 +98,7 @@ dma-coherent; clocks = <&k3_clks 5 10>; clock-names = "fck"; - power-domains = <&k3_pds 5>; + power-domains = <&k3_pds 5 TI_SCI_PD_EXCLUSIVE>; ti,psil-base = <0x7000>; dmas = <&mcu_udmap &mcu_cpsw 0 UDMA_DIR_TX>, From 8162e8ac70226adfc75766bd283d0d116daf95fe Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Mon, 29 Jul 2019 11:48:02 -0500 Subject: [PATCH 08/15] configs: am65x_evm_a53: Disable K3_SYSTEM_CONTROLLER The K3 System Controller driver is used for loading and starting the System Firmware, and is used only on R5 SPL. It need not be enabled and built for the A53 U-Boot and SPL, so disable it from both the GP and HS AM65x A53 defconfigs. While at this, also remove the unneeded CONFIG_SPL_REMOTEPROC and CONFIG_CMD_REMOTEPROC as no remoteprocs are now loaded from A53 SPL. Signed-off-by: Suman Anna Reviewed-by: Lokesh Vutla --- configs/am65x_evm_a53_defconfig | 3 --- configs/am65x_hs_evm_a53_defconfig | 3 --- 2 files changed, 6 deletions(-) diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig index 2cf3a693fc..d43df6a187 100644 --- a/configs/am65x_evm_a53_defconfig +++ b/configs/am65x_evm_a53_defconfig @@ -28,14 +28,12 @@ CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_POWER_DOMAIN=y -CONFIG_SPL_REMOTEPROC=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ASKENV=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y -CONFIG_CMD_REMOTEPROC=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y # CONFIG_ISO_PARTITION is not set @@ -79,7 +77,6 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y -CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_DM_RESET=y CONFIG_RESET_TI_SCI=y CONFIG_DM_SERIAL=y diff --git a/configs/am65x_hs_evm_a53_defconfig b/configs/am65x_hs_evm_a53_defconfig index 48b28b390e..8ac16f0372 100644 --- a/configs/am65x_hs_evm_a53_defconfig +++ b/configs/am65x_hs_evm_a53_defconfig @@ -31,13 +31,11 @@ CONFIG_SPL_I2C_SUPPORT=y CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_POWER_DOMAIN=y -CONFIG_SPL_REMOTEPROC=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ASKENV=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y -CONFIG_CMD_REMOTEPROC=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y # CONFIG_ISO_PARTITION is not set @@ -76,7 +74,6 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y -CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_DM_RESET=y CONFIG_RESET_TI_SCI=y CONFIG_DM_SERIAL=y From 5b56a4c162f64b5903063fe188a516848a7998b1 Mon Sep 17 00:00:00 2001 From: Suman Anna Date: Mon, 29 Jul 2019 11:48:03 -0500 Subject: [PATCH 09/15] configs: j721e_evm_a72: Disable K3_SYSTEM_CONTROLLER The K3 System Controller driver is used for loading and starting the System Firmware, and is used only on R5 SPL. It need not be enabled and built for the A72 U-Boot and SPL, so disable it from the j721e_evm_a72 defconfig. While at this, also remove the unneeded CONFIG_SPL_REMOTEPROC and CONFIG_CMD_REMOTEPROC as no remoteprocs are now loaded from A72 SPL. Signed-off-by: Suman Anna --- configs/j721e_evm_a72_defconfig | 3 --- 1 file changed, 3 deletions(-) diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig index 237dc6b601..917e33d683 100644 --- a/configs/j721e_evm_a72_defconfig +++ b/configs/j721e_evm_a72_defconfig @@ -28,13 +28,11 @@ CONFIG_SPL_DM_MAILBOX=y CONFIG_SPL_DM_RESET=y CONFIG_SPL_POWER_SUPPORT=y CONFIG_SPL_POWER_DOMAIN=y -CONFIG_SPL_REMOTEPROC=y CONFIG_SPL_SPI_LOAD=y CONFIG_SPL_YMODEM_SUPPORT=y CONFIG_CMD_ASKENV=y # CONFIG_CMD_FLASH is not set CONFIG_CMD_MMC=y -CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_SF=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_TIME=y @@ -73,7 +71,6 @@ CONFIG_SPL_PINCTRL=y CONFIG_PINCTRL_SINGLE=y CONFIG_POWER_DOMAIN=y CONFIG_TI_SCI_POWER_DOMAIN=y -CONFIG_K3_SYSTEM_CONTROLLER=y CONFIG_DM_RESET=y CONFIG_RESET_TI_SCI=y CONFIG_DM_SERIAL=y From a9c5d4ba0ddc9c094d994f8b73318e6db8449c1d Mon Sep 17 00:00:00 2001 From: Suniel Mahesh Date: Tue, 30 Jul 2019 13:25:20 +0530 Subject: [PATCH 10/15] configs: am335x_boneblack_vboot_defconfig: Fix regression by enabling BLK and DM support, disable in SPL This patch adds BLK and DM support for verified boot on TI AM335x chipsets. The following compile warnings are removed: ===================== WARNING ====================== This board does not use CONFIG_DM_MMC. Please update the board to use CONFIG_DM_MMC before the v2019.04 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info. ==================================================== ===================== WARNING ====================== This board does not use CONFIG_DM_USB. Please update the board to use CONFIG_DM_USB before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info. ==================================================== BLK and DM_MMC are enabled by default in SPL as well, which is making the build to break with an overflow(spl image doesn't fit into SRAM because of size constraints). LD spl/drivers/built-in.o LD spl/u-boot-spl arm-linux-ld.bfd: u-boot-spl section .u_boot_list will not fit in region .sram arm-linux-ld.bfd: region .sram overflowed by 116 bytes make[1]: *** [spl/u-boot-spl] Error 1 make: *** [spl/u-boot-spl] Error 2 For the above reason BLK and DM_MMC is disabled in SPL. Built and tested on AM335x device (BeagleboneBlack). Signed-off-by: Suniel Mahesh --- configs/am335x_boneblack_vboot_defconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig index 9ccbd68241..a6c32acb9c 100644 --- a/configs/am335x_boneblack_vboot_defconfig +++ b/configs/am335x_boneblack_vboot_defconfig @@ -33,7 +33,7 @@ CONFIG_OF_CONTROL=y CONFIG_DEFAULT_DEVICE_TREE="am335x-boneblack" CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y -# CONFIG_BLK is not set +# CONFIG_SPL_BLK is not set CONFIG_BOOTCOUNT_LIMIT=y CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y @@ -42,6 +42,7 @@ CONFIG_DM_I2C=y CONFIG_MISC=y CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y +# CONFIG_SPL_DM_MMC is not set CONFIG_SPI_FLASH=y CONFIG_SF_DEFAULT_SPEED=24000000 CONFIG_SPI_FLASH_WINBOND=y From 575ce432b8e0f42a4f4777c04a823c31e11a3a45 Mon Sep 17 00:00:00 2001 From: Suniel Mahesh Date: Tue, 30 Jul 2019 13:25:21 +0530 Subject: [PATCH 11/15] configs: am335x_boneblack_vboot_defconfig: Add DM for SPI and Flash devices This patch adds SPI and SPI_FLASH DM support for verified boot on TI AM335 chipsets. The following compile warning is removed: ===================== WARNING ====================== This board does not use CONFIG_DM_SPI_FLASH. Please update the board to use CONFIG_SPI_FLASH before the v2019.07 release. Failure to update by the deadline may result in board removal. See doc/driver-model/MIGRATION.txt for more info. ==================================================== Built and tested on AM335x device (BeagleboneBlack). Signed-off-by: Suniel Mahesh --- configs/am335x_boneblack_vboot_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/am335x_boneblack_vboot_defconfig b/configs/am335x_boneblack_vboot_defconfig index a6c32acb9c..a7fcde6940 100644 --- a/configs/am335x_boneblack_vboot_defconfig +++ b/configs/am335x_boneblack_vboot_defconfig @@ -43,6 +43,7 @@ CONFIG_MISC=y CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y # CONFIG_SPL_DM_MMC is not set +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SF_DEFAULT_SPEED=24000000 CONFIG_SPI_FLASH_WINBOND=y @@ -51,6 +52,7 @@ CONFIG_PHY_GIGE=y CONFIG_MII=y CONFIG_DRIVER_TI_CPSW=y CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_OMAP3_SPI=y CONFIG_TIMER=y CONFIG_OMAP_TIMER=y From 2fd156b307b950ab30bd09ef52d8090eee0ca164 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Tue, 30 Jul 2019 08:32:37 -0500 Subject: [PATCH 12/15] ARM: dts: da850-evm: Fix MDIO pinmux In attempts to speed up SPL and reduce size, the MDIO pin muxing was inadvertently affected. Since the ethernet driver will setup the pin muxing when ethernet is loaded, this patch will also pinmux the MDIO pins at the same time. Once an DM compatible MDIO driver is available, this can be removed. Fixes: 877ab2423bc2 ("ARM: davinci: da850: Manual pinmux only when PINCTRL not available") Signed-off-by: Adam Ford --- arch/arm/dts/da850-evm-u-boot.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/dts/da850-evm-u-boot.dtsi b/arch/arm/dts/da850-evm-u-boot.dtsi index d9e8b9926a..aa42d30c72 100644 --- a/arch/arm/dts/da850-evm-u-boot.dtsi +++ b/arch/arm/dts/da850-evm-u-boot.dtsi @@ -16,6 +16,10 @@ }; }; +ð0 { + pinctrl-0 = <&mii_pins>, <&mdio_pins>; +}; + &flash { compatible = "m25p64", "jedec,spi-nor"; }; From 3380d1c131f376b4bd02d08a96e29af24c846601 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Tue, 30 Jul 2019 08:58:58 -0500 Subject: [PATCH 13/15] ARM: da850-evm: Remove references to CONFIG_DA850_AM18X_EVM With the removal of da850_am18xxevm, there is at least one whitelisted CONFIG option that can be deleted. This patch removes CONFIG_DA850_AM18X_EVM since it's not required any more Signed-off-by: Adam Ford --- board/davinci/da8xxevm/da850evm.c | 3 --- scripts/config_whitelist.txt | 1 - 2 files changed, 4 deletions(-) diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index fcf9334ba9..f04392ecdc 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -300,9 +300,6 @@ u32 get_board_rev(void) rev = 2; else if (maxcpuclk >= 372000000) rev = 1; -#ifdef CONFIG_DA850_AM18X_EVM - rev |= REV_AM18X_EVM; -#endif return rev; } diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt index 89119aea22..85f75a48bf 100644 --- a/scripts/config_whitelist.txt +++ b/scripts/config_whitelist.txt @@ -280,7 +280,6 @@ CONFIG_CTL_JTAG CONFIG_CTL_TBE CONFIG_CUSTOMER_BOARD_SUPPORT CONFIG_D2NET_V2 -CONFIG_DA850_AM18X_EVM CONFIG_DA850_EVM_MAX_CPU_CLK CONFIG_DBGU CONFIG_DB_784MP_GP From 51443f57d868dc622eb9ad367ac7f7a173ed986e Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 30 Jul 2019 23:29:21 +0200 Subject: [PATCH 14/15] nand: davinci: avoid out of bounds array access The array bounds have to be checked before accessing the array element. Identified by cppcheck. Fixes: 67ac6ffaeefb ("mtd: nand: davinci: add opportunity to write keystone U-boot image") Signed-off-by: Heinrich Schuchardt --- drivers/mtd/nand/raw/davinci_nand.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/davinci_nand.c b/drivers/mtd/nand/raw/davinci_nand.c index 33c2f16be8..724bbee752 100644 --- a/drivers/mtd/nand/raw/davinci_nand.c +++ b/drivers/mtd/nand/raw/davinci_nand.c @@ -739,8 +739,8 @@ static void davinci_nand_init(struct nand_chip *nand) layout = &nand_keystone_rbl_4bit_layout_oobfirst; layout->oobavail = 0; - for (i = 0; layout->oobfree[i].length && - i < ARRAY_SIZE(layout->oobfree); i++) + for (i = 0; i < ARRAY_SIZE(layout->oobfree) && + layout->oobfree[i].length; i++) layout->oobavail += layout->oobfree[i].length; nand->write_page = nand_davinci_write_page; From b9ad74d9011ef13dbed3ed43b858dc2ef63faf82 Mon Sep 17 00:00:00 2001 From: Adam Ford Date: Wed, 31 Jul 2019 09:17:31 -0500 Subject: [PATCH 15/15] Revert "ARM: davinci: da850: Manual pinmux only when PINCTRL not available" This reverts commit 877ab2423bc257045a06bc23d4b9440b82bda6fb. The above patch was designed to shrink code by only pin-muxing items needed for SPL in SPL and relying on driver model or SPL to mux other items. Unfortunately, da850evm_direct_nor doesn't use SPL so items that were only muxed during SPL are not muxed causing the board to no longer boot. Signed-off-by: Adam Ford --- board/davinci/da8xxevm/da850evm.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index f04392ecdc..2d5710076d 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -215,29 +215,21 @@ static const struct pinmux_config gpio_pins[] = { }; const struct pinmux_resource pinmuxes[] = { -#ifndef CONFIG_SPL_BUILD #ifdef CONFIG_DRIVER_TI_EMAC PINMUX_ITEM(emac_pins_mdio), #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII PINMUX_ITEM(emac_pins_rmii), #else PINMUX_ITEM(emac_pins_mii), -#endif /* CONFIG_DRIVER_TI_EMAC */ -#endif /* CONFIG_DRIVER_TI_EMAC_USE_RMII */ -#endif /* CONFIG_SPL_BUILD */ +#endif +#endif #ifdef CONFIG_SPI_FLASH -#if !CONFIG_IS_ENABLED(PINCTRL) PINMUX_ITEM(spi1_pins_base), PINMUX_ITEM(spi1_pins_scs0), #endif -#endif -#if !CONFIG_IS_ENABLED(PINCTRL) PINMUX_ITEM(uart2_pins_txrx), PINMUX_ITEM(uart2_pins_rtscts), -#endif -#if !CONFIG_IS_ENABLED(PINCTRL) PINMUX_ITEM(i2c0_pins), -#endif #ifdef CONFIG_NAND_DAVINCI PINMUX_ITEM(emifa_pins_cs3), PINMUX_ITEM(emifa_pins_cs4), @@ -248,10 +240,8 @@ const struct pinmux_resource pinmuxes[] = { #endif PINMUX_ITEM(gpio_pins), #ifdef CONFIG_MMC_DAVINCI -#if !CONFIG_IS_ENABLED(PINCTRL) PINMUX_ITEM(mmc0_pins), #endif -#endif }; const int pinmuxes_size = ARRAY_SIZE(pinmuxes);