board: phytec: phycore_am62x: Update environment for fitboot
PATCH 1/7 board: phytec: phycore_am62x: Update environment for fitboot
From: Nathan Morrisson <[email protected]>
Add fit_addr_r to the environment to allow us to boot from a FIT image.
--- board/phytec/phycore_am62x/phycore_am62x.env | 1 + 1 file changed, 1 insertion(+)
board/phytec/phycore_am62x/phycore_am62x.env +1 -0
@@ -10,6 +10,7 @@ fdt_addr_r=0x88000000 kernel_addr_r=0x82000000 ramdisk_addr_r=0x88080000 fdtoverlay_addr_r=0x89000000 +fit_addr_r=0x90000000 fdtfile=CONFIG_DEFAULT_FDT_FILE mmcdev=1
Signature · 1 line
2.34.1
PATCH 2/7 board: phytec: phycore_am64x: Update environment for fitboot
From: Nathan Morrisson <[email protected]>
Add fit_addr_r to the environment to allow us to boot from a FIT image.
--- board/phytec/phycore_am64x/phycore_am64x.env | 1 + 1 file changed, 1 insertion(+)
board/phytec/phycore_am64x/phycore_am64x.env +1 -0
@@ -9,6 +9,7 @@ fdt_addr_r=0x88000000 kernel_addr_r=0x82000000 ramdisk_addr_r=0x88080000 fdtoverlay_addr_r=0x89000000 +fit_addr_r=0x90000000 fdtfile=CONFIG_DEFAULT_FDT_FILE mmcdev=1
Signature · 1 line
2.34.1
PATCH 3/7 board: phytec: phycore_am6xx: Set bootmeths & boot_targets environment
In reply to Wadim EgorovAs part of our migration to the standard boot process, configure the default values for the bootmeths and boot_targets environment variables.
--- board/phytec/phycore_am62ax/phycore_am62ax.env | 3 +++ board/phytec/phycore_am62x/phycore_am62x.env | 3 +++ board/phytec/phycore_am64x/phycore_am64x.env | 3 +++ 3 files changed, 9 insertions(+)
board/phytec/phycore_am62ax/phycore_am62ax.env +3 -0
@@ -23,3 +23,6 @@ get_cmd=tftp spi_fdt_addr=0x700000 spi_image_addr=0x800000 spi_ramdisk_addr=0x1e00000 + +bootmeths=script efi extlinux pxe +boot_targets=mmc1 mmc0 spi_flash dhcp
board/phytec/phycore_am62x/phycore_am62x.env +3 -0
@@ -24,3 +24,6 @@ get_cmd=tftp spi_fdt_addr=0x700000 spi_image_addr=0x800000 spi_ramdisk_addr=0x2200000 + +bootmeths=script efi extlinux pxe +boot_targets=mmc1 mmc0 spi_flash dhcp
board/phytec/phycore_am64x/phycore_am64x.env +3 -0
@@ -23,3 +23,6 @@ get_cmd=tftp spi_fdt_addr=0x700000 spi_image_addr=0x800000 spi_ramdisk_addr=0x2200000 + +bootmeths=script efi extlinux pxe +boot_targets=mmc1 mmc0 spi_flash dhcp
Signature · 1 line
2.34.1
PATCH 4/7 configs: phycore_am6xx: Default BOOTCOMMAND to standard boot
In reply to Wadim EgorovMake the "bootflow scan -lb" command execute first and fallback to the legacy BSP boot scripts.
--- configs/phycore_am62ax_a53_defconfig | 2 +- configs/phycore_am62x_a53_defconfig | 2 +- configs/phycore_am64x_a53_defconfig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
configs/phycore_am62ax_a53_defconfig +1 -1
@@ -42,7 +42,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_BOOTSTD_FULL=y CONFIG_OF_BOARD_SETUP=y -CONFIG_BOOTCOMMAND="run ${boot}boot; bootflow scan -lb" +CONFIG_BOOTCOMMAND="bootflow scan -lb; run ${boot}boot" CONFIG_DEFAULT_FDT_FILE="oftree" CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_MAX_SIZE=0x58000
configs/phycore_am62x_a53_defconfig +1 -1
@@ -46,7 +46,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_BOOTSTD_FULL=y CONFIG_OF_BOARD_SETUP=y -CONFIG_BOOTCOMMAND="run ${boot}boot; bootflow scan -lb" +CONFIG_BOOTCOMMAND="bootflow scan -lb; run ${boot}boot" CONFIG_DEFAULT_FDT_FILE="oftree" CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_MAX_SIZE=0x58000
configs/phycore_am64x_a53_defconfig +1 -1
@@ -41,7 +41,7 @@ CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_LOAD_FIT_ADDRESS=0x81000000 CONFIG_BOOTSTD_FULL=y CONFIG_OF_BOARD_SETUP=y -CONFIG_BOOTCOMMAND="run ${boot}boot; bootflow scan -lb" +CONFIG_BOOTCOMMAND="bootflow scan -lb; run ${boot}boot" CONFIG_DEFAULT_FDT_FILE="oftree" CONFIG_BOARD_LATE_INIT=y CONFIG_SPL_MAX_SIZE=0x180000
Signature · 1 line
2.34.1
PATCH 5/7 board: phytec: common: k3: Update boot_targets at runtime
In reply to Wadim EgorovFactor out boot device detection from board_late_init() into a new boot_targets_setup() helper.
Adjust the boot_targets environment variable to favor the device we just booted from. If boot_targets is still at its default value, prepend the current boot device to the list; otherwise leave any user-customized order untouched.
--- board/phytec/common/k3/board.c | 36 ++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-)
board/phytec/common/k3/board.c +34 -2
@@ -120,25 +120,37 @@ enum env_location env_get_location(enum env_operation op, int prio) }; } -#if IS_ENABLED (CONFIG_BOARD_LATE_INIT ) -int board_late_init (void ) +/** +* Ensure the boot order favors the device we just booted from. +* If boot_targets is still at its default value, move the current +* boot device to the front of the list. Otherwise, leave any customized +* order untouched. +*/ +static void boot_targets_setup (void ) {u32 boot_device =get_boot_device (); +const char *boot_targets =NULL ; +char boot_targets_default[100 ]; +int ret;switch (boot_device) {case BOOT_DEVICE_MMC1 :env_set_ulong ("mmcdev" ,0 );env_set ("boot" ,"mmc" ); + boot_targets ="mmc0 mmc1 spi_flash dhcp" ;break ;case BOOT_DEVICE_MMC2 :env_set_ulong ("mmcdev" ,1 );env_set ("boot" ,"mmc" ); + boot_targets ="mmc1 mmc0 spi_flash dhcp" ;break ;case BOOT_DEVICE_SPI :env_set ("boot" ,"spi" ); + boot_targets ="spi_flash mmc0 mmc1 dhcp" ;break ;case BOOT_DEVICE_ETHERNET :env_set ("boot" ,"net" ); + boot_targets ="dhcp mmc0 mmc1 spi_flash" ;break ;case BOOT_DEVICE_UART :env_set ("boot" ,"uart" );
@@ -148,6 +160,26 @@ int board_late_init(void)break ; }; +if (!boot_targets) +return ; + + ret =env_get_default_into ("boot_targets" , boot_targets_default,sizeof (boot_targets_default)); +if (ret <0 ) + boot_targets_default[0 ] ='\0' ; + +if (strcmp (boot_targets_default,env_get ("boot_targets" ))) { +debug ("boot_targets not default, don't change it\n" ); +return ; + } + +env_set ("boot_targets" , boot_targets); +} + +#if IS_ENABLED (CONFIG_BOARD_LATE_INIT ) +int board_late_init (void ) +{ +boot_targets_setup (); +if (IS_ENABLED (CONFIG_PHYTEC_SOM_DETECTION_BLOCKS )) {struct phytec_api3_element *block_element;struct phytec_eeprom_data data;
Signature · 1 line
2.34.1
PATCH 6/7 board: phytec: common: k3: Factor out mac address setup
In reply to Wadim EgorovFactor out the mac address setup into setup_mac_from_eeprom().
--- board/phytec/common/k3/board.c | 44 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 20 deletions(-)
board/phytec/common/k3/board.c +24 -20
@@ -175,31 +175,35 @@ static void boot_targets_setup(void)env_set ("boot_targets" , boot_targets); } +void setup_mac_from_eeprom (void ) +{ +struct phytec_api3_element *block_element; +struct phytec_eeprom_data data; +int ret; + + ret =phytec_eeprom_data_setup (&data,0 ,EEPROM_ADDR ); +if (ret || !data.valid) +return ; + + PHYTEC_API3_FOREACH_BLOCK(block_element, &data) { +switch (block_element->block_type) { +case PHYTEC_API3_BLOCK_MAC : +phytec_blocks_add_mac_to_env (block_element); +break ; +default : +debug ("%s: Unknown block type %i\n" , __func__, + block_element->block_type); + } + } +} +#if IS_ENABLED (CONFIG_BOARD_LATE_INIT )int board_late_init (void ) {boot_targets_setup (); -if (IS_ENABLED (CONFIG_PHYTEC_SOM_DETECTION_BLOCKS )) { -struct phytec_api3_element *block_element; -struct phytec_eeprom_data data; -int ret; - - ret =phytec_eeprom_data_setup (&data,0 ,EEPROM_ADDR ); -if (ret || !data.valid) -return 0 ; - - PHYTEC_API3_FOREACH_BLOCK(block_element, &data) { -switch (block_element->block_type) { -case PHYTEC_API3_BLOCK_MAC : -phytec_blocks_add_mac_to_env (block_element); -break ; -default : -debug ("%s: Unknown block type %i\n" , __func__, - block_element->block_type); - } - } - } +if (IS_ENABLED (CONFIG_PHYTEC_SOM_DETECTION_BLOCKS )) +setup_mac_from_eeprom ();#if IS_ENABLED (CONFIG_EFI_HAVE_CAPSULE_SUPPORT )configure_capsule_updates ();
Signature · 1 line
2.34.1
PATCH 7/7 configs: phycore_am6xx_a53_defconfig: Enable BOOTDEV_SPI_FLASH
In reply to Wadim EgorovEnable standard boot with SPI Flash & sync after savedefconfig.
--- configs/phycore_am62ax_a53_defconfig | 2 +- configs/phycore_am62x_a53_defconfig | 2 +- configs/phycore_am64x_a53_defconfig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
configs/phycore_am62ax_a53_defconfig +1 -1
@@ -74,7 +74,6 @@ CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y # CONFIG_CMD_POWEROFF is not set -CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_USB=y CONFIG_CMD_USB_MASS_STORAGE=y CONFIG_CMD_CACHE=y
@@ -131,6 +130,7 @@ CONFIG_MMC_SDHCI_AM654=y CONFIG_MTD=y CONFIG_DM_MTD=y CONFIG_DM_SPI_FLASH=y +CONFIG_BOOTDEV_SPI_FLASH=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y # CONFIG_SPI_FLASH_SMART_HWCAPS is not set CONFIG_SPI_FLASH_SOFT_RESET=y
configs/phycore_am62x_a53_defconfig +1 -1
@@ -79,7 +79,6 @@ CONFIG_CMD_GPIO=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y -CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_USB=y CONFIG_CMD_CACHE=y CONFIG_CMD_EFIDEBUG=y
@@ -128,6 +127,7 @@ CONFIG_MMC_SDHCI_AM654=y CONFIG_MTD=y CONFIG_DM_MTD=y CONFIG_DM_SPI_FLASH=y +CONFIG_BOOTDEV_SPI_FLASH=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y # CONFIG_SPI_FLASH_SMART_HWCAPS is not set CONFIG_SPI_FLASH_SOFT_RESET=y
configs/phycore_am64x_a53_defconfig +1 -1
@@ -77,7 +77,6 @@ CONFIG_CMD_GPT=y CONFIG_CMD_I2C=y CONFIG_CMD_MMC=y CONFIG_CMD_MTD=y -CONFIG_CMD_REMOTEPROC=y CONFIG_CMD_USB=y CONFIG_CMD_CACHE=y CONFIG_CMD_EFIDEBUG=y
@@ -133,6 +132,7 @@ CONFIG_MMC_SDHCI_AM654=y CONFIG_MTD=y CONFIG_DM_MTD=y CONFIG_DM_SPI_FLASH=y +CONFIG_BOOTDEV_SPI_FLASH=y CONFIG_SPI_FLASH_SFDP_SUPPORT=y # CONFIG_SPI_FLASH_SMART_HWCAPS is not set CONFIG_SPI_FLASH_SOFT_RESET=y
Signature · 1 line
2.34.1
Quoted 9 lines · Wadim Egorov
From: Nathan Morrisson <[email protected]>
Add
fit_addr_rto the environment to allow us to boot from a FIT image.Signed-off-by Nathan Morrisson <[email protected]>Signed-off-by Wadim Egorov <[email protected]>--- board/phytec/phycore_am62x/phycore_am62x.env | 1 + 1 file changed, 1 insertion(+)
Please rebase on top of current master, this does not compile, thanks.
Signature · 1 line
Tom