AM437x: Add runtime DTB selection for QSPI Boot
cover AM437x: Add runtime DTB selection for QSPI Boot
With SPI framework moving to DM only mode, am437x QSPI XIP boot needs to move to runtime DTB selection to chose proper DT for IDK vs SK. This series adds generic DT file for board detection which is replaced with actual DT once after board discovery via EEPROM. Approach is similar to what is done with K2G EVM.
Tested on AM437x SK and IDK boards. Sanity tested on AM437x GP EVM.
Vignesh R (3):
board: ti: am43xx: Define embedded_dtb_select for runtime DTB
selection in U-boot
ARM: dts: Add new "generic" am4372 device tree file.
configs: am43xx_evm_qspiboot_defconfig: Move to DM
arch/arm/dts/Makefile | 3 ++- arch/arm/dts/am4372-generic-u-boot.dtsi | 15 +++++++++++++++ arch/arm/dts/am4372-generic.dts | 24 ++++++++++++++++++++++++ arch/arm/dts/am437x-idk-evm-u-boot.dtsi | 23 +++++++++++++++++++++++ arch/arm/dts/am437x-sk-evm-u-boot.dtsi | 23 +++++++++++++++++++++++ board/ti/am43xx/board.c | 18 ++++++++++++++++-- configs/am43xx_evm_qspiboot_defconfig | 10 +++++++++- 7 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 arch/arm/dts/am4372-generic-u-boot.dtsi create mode 100644 arch/arm/dts/am4372-generic.dts create mode 100644 arch/arm/dts/am437x-idk-evm-u-boot.dtsi create mode 100644 arch/arm/dts/am437x-sk-evm-u-boot.dtsi
Signature · 1 line
2.16.2
PATCH 1/3 board: ti: am43xx: Define embedded_dtb_select for runtime DTB selection in U-boot
AM437x QSPI boot is a single stage boot and hence needs runtime DTB selection to support AM437x-SK and AM437x-IDK with DM enabled. This is required to move am43xx_evm_qspiboot_defconfig to use DM/DT.
--- board/ti/am43xx/board.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
board/ti/am43xx/board.c +16 -2
@@ -852,10 +852,14 @@ int ft_board_setup(void *blob, bd_t *bd) }#endif -#ifdef CONFIG_SPL_LOAD_FIT +#if defined(CONFIG_SPL_LOAD_FIT ) || defined(CONFIG_DTB_RESELECT )int board_fit_config_name_match (const char *name) { -if (board_is_evm () && !strcmp (name,"am437x-gp-evm" )) +bool eeprom_read =board_ti_was_eeprom_read (); + +if (!strcmp (name,"am4372-generic" ) && !eeprom_read) +return 0 ; +else if (board_is_evm () && !strcmp (name,"am437x-gp-evm" ))return 0 ;else if (board_is_sk () && !strcmp (name,"am437x-sk-evm" ))return 0 ;
@@ -868,6 +872,16 @@ int board_fit_config_name_match(const char *name) }#endif +#ifdef CONFIG_DTB_RESELECT +int embedded_dtb_select (void ) +{ +do_board_detect (); +fdtdec_setup (); + +return 0 ; +} +#endif +#ifdef CONFIG_TI_SECURE_DEVICE void board_fit_image_post_process (void **p_image,size_t *p_size) {
Signature · 1 line
2.16.2
PATCH 1/3 board: ti: am43xx: Define embedded_dtb_select for runtime DTB selection in U-boot
Quoted 5 lines · Vignesh R
AM437x QSPI boot is a single stage boot and hence needs runtime DTB selection to support AM437x-SK and AM437x-IDK with DM enabled. This is required to move
am43xx_evm_qspiboot_defconfigto use DM/DT.Signed-off-by Vignesh R <[email protected]>
Thanks and regards,
Lokesh
Quoted 43 lines
--- board/ti/am43xx/board.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)board/ti/am43xx/board.c +16
-2@@ -852,10 +852,14 @@ int ft_board_setup(void *blob, bd_t *bd) }#endif -#ifdef CONFIG_SPL_LOAD_FIT +#if defined(CONFIG_SPL_LOAD_FIT ) || defined(CONFIG_DTB_RESELECT )int board_fit_config_name_match (const char *name) { -if (board_is_evm () && !strcmp (name,"am437x-gp-evm" )) +bool eeprom_read =board_ti_was_eeprom_read (); + +if (!strcmp (name,"am4372-generic" ) && !eeprom_read) +return 0 ; +else if (board_is_evm () && !strcmp (name,"am437x-gp-evm" ))return 0 ;else if (board_is_sk () && !strcmp (name,"am437x-sk-evm" ))return 0 ;@@ -868,6 +872,16 @@ int board_fit_config_name_match(const char *name) }#endif +#ifdef CONFIG_DTB_RESELECT +int embedded_dtb_select (void ) +{ +do_board_detect (); +fdtdec_setup (); + +return 0 ; +} +#endif +#ifdef CONFIG_TI_SECURE_DEVICE void board_fit_image_post_process (void **p_image,size_t *p_size) {
PATCH 1/3 board: ti: am43xx: Define embedded_dtb_select for runtime DTB selection in U-boot
In reply to Vignesh RQuoted 6 lines · Vignesh R
AM437x QSPI boot is a single stage boot and hence needs runtime DTB selection to support AM437x-SK and AM437x-IDK with DM enabled. This is required to move
am43xx_evm_qspiboot_defconfigto use DM/DT.Signed-off-by Vignesh R <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180407/1e3b967b/attachment.sig>
PATCH 2/3 ARM: dts: Add new "generic" am4372 device tree file.
In reply to Vignesh RWith U-boot runtime board detect for DTB selection a "default" dtb needs to be created. This will be used temporarily until the "proper" dtb is selected.
Also, add -u-boot.dtsi for AM437x SK and IDK to enable I2C for board detection via DM_I2C.
--- arch/arm/dts/Makefile | 3 ++- arch/arm/dts/am4372-generic-u-boot.dtsi | 15 +++++++++++++++ arch/arm/dts/am4372-generic.dts | 24 ++++++++++++++++++++++++ arch/arm/dts/am437x-idk-evm-u-boot.dtsi | 23 +++++++++++++++++++++++ arch/arm/dts/am437x-sk-evm-u-boot.dtsi | 23 +++++++++++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/am4372-generic-u-boot.dtsi create mode 100644 arch/arm/dts/am4372-generic.dts create mode 100644 arch/arm/dts/am437x-idk-evm-u-boot.dtsi create mode 100644 arch/arm/dts/am437x-sk-evm-u-boot.dtsi
arch/arm/dts/Makefile +2 -1
@@ -167,7 +167,8 @@ dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb \ am335x-pdu001.dtb dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb \ am43x-epos-evm.dtb \ - am437x-idk-evm.dtb + am437x-idk-evm.dtb \ + am4372-generic.dtb dtb-$(CONFIG_TI816X) += dm8168-evm.dtb dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
arch/arm/dts/am4372-generic-u-boot.dtsi new file +15 -0
@@ -0,0 +1,15 @@ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/{ + ocp { + u-boot,dm-pre-reloc; + }; +}; + +&i2c0 { + u-boot,dm-pre-reloc; +};
arch/arm/dts/am4372-generic.dts new file +24 -0
@@ -0,0 +1,24 @@ +/* + * Device Tree Source for Generic AM4372 EVM + * + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "am4372.dtsi" + +/ { + compatible = "ti,am4372", "ti,am43"; + model = "Texas Instruments AM4372 Generic"; + + chosen { + stdout-path = &uart0; + }; +}; + +&i2c0 { + status = "okay"; +};
arch/arm/dts/am437x-idk-evm-u-boot.dtsi new file +23 -0
@@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/{ + ocp { + u-boot,dm-spl; + }; +}; + +&uart0 { + u-boot,dm-spl; +}; + +&i2c0 { + u-boot,dm-spl; +}; + +&mmc1 { + u-boot,dm-spl; +};
arch/arm/dts/am437x-sk-evm-u-boot.dtsi new file +23 -0
@@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/{ + ocp { + u-boot,dm-spl; + }; +}; + +&uart0 { + u-boot,dm-spl; +}; + +&i2c0 { + u-boot,dm-spl; +}; + +&mmc1 { + u-boot,dm-spl; +};
Signature · 1 line
2.16.2
PATCH 2/3 ARM: dts: Add new "generic" am4372 device tree file.
Quoted 8 lines · Vignesh R
With U-boot runtime board detect for DTB selection a "default" dtb needs to be created. This will be used temporarily until the "proper" dtb is selected.
Also, add
-u-boot.dtsifor AM437x SK and IDK to enable I2C for board detection viaDM_I2C.Signed-off-by Vignesh R <[email protected]>
Thanks and regards,
Lokesh
Quoted 136 lines
--- arch/arm/dts/Makefile | 3 ++- arch/arm/dts/am4372-generic-u-boot.dtsi | 15 +++++++++++++++ arch/arm/dts/am4372-generic.dts | 24 ++++++++++++++++++++++++ arch/arm/dts/am437x-idk-evm-u-boot.dtsi | 23 +++++++++++++++++++++++ arch/arm/dts/am437x-sk-evm-u-boot.dtsi | 23 +++++++++++++++++++++++ 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/am4372-generic-u-boot.dtsi create mode 100644 arch/arm/dts/am4372-generic.dts create mode 100644 arch/arm/dts/am437x-idk-evm-u-boot.dtsi create mode 100644 arch/arm/dts/am437x-sk-evm-u-boot.dtsiarch/arm/dts/Makefile +2
-1@@ -167,7 +167,8 @@ dtb-$(CONFIG_AM33XX) += am335x-boneblack.dtb am335x-bone.dtb \ am335x-pdu001.dtb dtb-$(CONFIG_AM43XX) += am437x-gp-evm.dtb am437x-sk-evm.dtb \ am43x-epos-evm.dtb \ - am437x-idk-evm.dtb + am437x-idk-evm.dtb \ + am4372-generic.dtb dtb-$(CONFIG_TI816X) += dm8168-evm.dtb dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtbarch/arm/dts/am4372-generic-u-boot.dtsi new file +15
-0@@ -0,0 +1,15 @@ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/{ + ocp { + u-boot,dm-pre-reloc; + }; +}; + +&i2c0 { + u-boot,dm-pre-reloc; +};arch/arm/dts/am4372-generic.dts new file +24
-0@@ -0,0 +1,24 @@ +/* + * Device Tree Source for Generic AM4372 EVM + * + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; + +#include "am4372.dtsi" + +/ { + compatible = "ti,am4372", "ti,am43"; + model = "Texas Instruments AM4372 Generic"; + + chosen { + stdout-path = &uart0; + }; +}; + +&i2c0 { + status = "okay"; +};arch/arm/dts/am437x-idk-evm-u-boot.dtsi new file +23
-0@@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/{ + ocp { + u-boot,dm-spl; + }; +}; + +&uart0 { + u-boot,dm-spl; +}; + +&i2c0 { + u-boot,dm-spl; +}; + +&mmc1 { + u-boot,dm-spl; +};arch/arm/dts/am437x-sk-evm-u-boot.dtsi new file +23
-0@@ -0,0 +1,23 @@ +/* + * Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/{ + ocp { + u-boot,dm-spl; + }; +}; + +&uart0 { + u-boot,dm-spl; +}; + +&i2c0 { + u-boot,dm-spl; +}; + +&mmc1 { + u-boot,dm-spl; +};
PATCH 2/3 ARM: dts: Add new "generic" am4372 device tree file.
In reply to Vignesh RQuoted 9 lines · Vignesh R
With U-boot runtime board detect for DTB selection a "default" dtb needs to be created. This will be used temporarily until the "proper" dtb is selected.
Also, add
-u-boot.dtsifor AM437x SK and IDK to enable I2C for board detection viaDM_I2C.Signed-off-by Vignesh R <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180407/72557fac/attachment.sig>
PATCH 3/3 configs: am43xx_evm_qspiboot_defconfig: Move to DM
In reply to Vignesh RMove am43xx_evm_qspiboot_defconfig to DM. This is required as SPI core and TI QSPI driver no longer supports non DM interfaces.
--- configs/am43xx_evm_qspiboot_defconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
configs/am43xx_evm_qspiboot_defconfig +9 -1
@@ -3,6 +3,7 @@ CONFIG_ARM=y CONFIG_ARCH_OMAP2PLUS=y CONFIG_SYS_TEXT_BASE=0x30000000 CONFIG_AM43XX=y +CONFIG_DEFAULT_DEVICE_TREE="am437x-sk-evm" CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,QSPI,QSPI_BOOT" CONFIG_QSPI_BOOT=y
@@ -23,10 +24,18 @@ CONFIG_CMD_SPI=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_EXT4_WRITE=y +CONFIG_OF_CONTROL=y +CONFIG_OF_LIST="am4372-generic am437x-sk-evm am437x-idk-evm" +CONFIG_DTB_RESELECT=y +CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_DM=y +# CONFIG_BLK is not set CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y +CONFIG_DM_GPIO=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_MACRONIX=y
@@ -48,4 +57,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0403 CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00 CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_FAT_WRITE=y -CONFIG_OF_LIBFDT=y
Signature · 1 line
2.16.2
PATCH 3/3 configs: am43xx_evm_qspiboot_defconfig: Move to DM
Quoted 4 lines · Vignesh R
Move
am43xx_evm_qspiboot_defconfigto DM. This is required as SPI core and TI QSPI driver no longer supports non DM interfaces.Signed-off-by Vignesh R <[email protected]>
Thanks and regards,
Lokesh
Quoted 41 lines
--- configs/am43xx_evm_qspiboot_defconfig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)configs/am43xx_evm_qspiboot_defconfig +9
-1@@ -3,6 +3,7 @@ CONFIG_ARM=y CONFIG_ARCH_OMAP2PLUS=y CONFIG_SYS_TEXT_BASE=0x30000000 CONFIG_AM43XX=y +CONFIG_DEFAULT_DEVICE_TREE="am437x-sk-evm" CONFIG_DISTRO_DEFAULTS=y CONFIG_SYS_EXTRA_OPTIONS="SERIAL1,CONS_INDEX=1,QSPI,QSPI_BOOT" CONFIG_QSPI_BOOT=y@@ -23,10 +24,18 @@ CONFIG_CMD_SPI=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set CONFIG_CMD_EXT4_WRITE=y +CONFIG_OF_CONTROL=y +CONFIG_OF_LIST="am4372-generic am437x-sk-evm am437x-idk-evm" +CONFIG_DTB_RESELECT=y +CONFIG_MULTI_DTB_FIT=y CONFIG_ENV_IS_IN_SPI_FLASH=y +CONFIG_DM=y +# CONFIG_BLK is not set CONFIG_DFU_MMC=y CONFIG_DFU_RAM=y CONFIG_DFU_SF=y +CONFIG_DM_GPIO=y +CONFIG_DM_MMC=y CONFIG_MMC_OMAP_HS=y CONFIG_SPI_FLASH=y CONFIG_SPI_FLASH_MACRONIX=y@@ -48,4 +57,3 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0403 CONFIG_USB_GADGET_PRODUCT_NUM=0xbd00 CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_FAT_WRITE=y -CONFIG_OF_LIBFDT=y
PATCH 3/3 configs: am43xx_evm_qspiboot_defconfig: Move to DM
In reply to Vignesh RQuoted 5 lines · Vignesh R
Move
am43xx_evm_qspiboot_defconfigto DM. This is required as SPI core and TI QSPI driver no longer supports non DM interfaces.Signed-off-by Vignesh R <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180407/c1232b81/attachment.sig>