diff options
Diffstat (limited to 'board/phytec')
-rw-r--r-- | board/phytec/common/Makefile | 4 | ||||
-rw-r--r-- | board/phytec/common/k3/board.c | 76 | ||||
-rw-r--r-- | board/phytec/common/phytec_som_detection_blocks.c | 1 | ||||
-rw-r--r-- | board/phytec/phycore_am62ax/phycore_am62ax.env | 3 | ||||
-rw-r--r-- | board/phytec/phycore_am62x/phycore_am62x.env | 4 | ||||
-rw-r--r-- | board/phytec/phycore_am62x/rm-cfg.yaml | 26 | ||||
-rw-r--r-- | board/phytec/phycore_am64x/phycore_am64x.env | 4 | ||||
-rw-r--r-- | board/phytec/phycore_imx8mm/phycore_imx8mm.env | 2 | ||||
-rw-r--r-- | board/phytec/phycore_imx8mp/phycore_imx8mp.env | 2 | ||||
-rw-r--r-- | board/phytec/phycore_imx93/phycore_imx93.env | 2 |
10 files changed, 92 insertions, 32 deletions
diff --git a/board/phytec/common/Makefile b/board/phytec/common/Makefile index 8126f7356e1..948f9dab626 100644 --- a/board/phytec/common/Makefile +++ b/board/phytec/common/Makefile @@ -3,8 +3,8 @@ # Author: Teresa Remmet <t.remmet@phytec.de> ifdef CONFIG_XPL_BUILD -# necessary to create built-in.o -obj- := __dummy__.o +# necessary to create built-in.a +obj- := __dummy__.a endif obj-y += phytec_som_detection.o phytec_som_detection_blocks.o diff --git a/board/phytec/common/k3/board.c b/board/phytec/common/k3/board.c index 828973a8e28..7f34d71d530 100644 --- a/board/phytec/common/k3/board.c +++ b/board/phytec/common/k3/board.c @@ -94,7 +94,7 @@ int mmc_get_env_dev(void) return 1; }; - return CONFIG_SYS_MMC_ENV_DEV; + return CONFIG_ENV_MMC_DEVICE_INDEX; } #endif @@ -121,24 +121,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,26 +161,49 @@ int board_late_init(void) break; }; - 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 (!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); +} + +static 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); } } +} + +int board_late_init(void) +{ + boot_targets_setup(); + + if (IS_ENABLED(CONFIG_PHYTEC_SOM_DETECTION_BLOCKS)) + setup_mac_from_eeprom(); #if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) configure_capsule_updates(); diff --git a/board/phytec/common/phytec_som_detection_blocks.c b/board/phytec/common/phytec_som_detection_blocks.c index 5f3c27ef0c2..b44ff85972f 100644 --- a/board/phytec/common/phytec_som_detection_blocks.c +++ b/board/phytec/common/phytec_som_detection_blocks.c @@ -4,6 +4,7 @@ * Author: Daniel Schultz <d.schultz@phytec.de> */ +#include <env.h> #include <malloc.h> #include <u-boot/crc.h> #include <net.h> diff --git a/board/phytec/phycore_am62ax/phycore_am62ax.env b/board/phytec/phycore_am62ax/phycore_am62ax.env index 40787b0cbcb..797904013dc 100644 --- a/board/phytec/phycore_am62ax/phycore_am62ax.env +++ b/board/phytec/phycore_am62ax/phycore_am62ax.env @@ -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 diff --git a/board/phytec/phycore_am62x/phycore_am62x.env b/board/phytec/phycore_am62x/phycore_am62x.env index 5c48e856685..797904013dc 100644 --- a/board/phytec/phycore_am62x/phycore_am62x.env +++ b/board/phytec/phycore_am62x/phycore_am62x.env @@ -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 @@ -23,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 diff --git a/board/phytec/phycore_am62x/rm-cfg.yaml b/board/phytec/phycore_am62x/rm-cfg.yaml index e4221f82f92..26d99b03b80 100644 --- a/board/phytec/phycore_am62x/rm-cfg.yaml +++ b/board/phytec/phycore_am62x/rm-cfg.yaml @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0+ -# Copyright (C) 2022-2023 Texas Instruments Incorporated - https://www.ti.com/ +# Copyright (C) 2022-2024 Texas Instruments Incorporated - https://www.ti.com/ # -# Resource management configuration for AM62 +# Resource management configuration for AM62X # --- @@ -244,7 +244,7 @@ rm-cfg: subhdr: magic: 0x7B25 size: 8 - resasg_entries_size: 960 + resasg_entries_size: 976 reserved: 0 resasg_entries: - @@ -285,11 +285,23 @@ rm-cfg: reserved: 0 - start_resource: 0 - num_resource: 4 + num_resource: 2 type: 320 host_id: 12 reserved: 0 - + start_resource: 2 + num_resource: 2 + type: 320 + host_id: 35 + reserved: 0 + - + start_resource: 2 + num_resource: 2 + type: 320 + host_id: 36 + reserved: 0 + - start_resource: 4 num_resource: 4 type: 320 @@ -501,13 +513,13 @@ rm-cfg: reserved: 0 - start_resource: 44 - num_resource: 36 + num_resource: 35 type: 1802 host_id: 35 reserved: 0 - start_resource: 44 - num_resource: 36 + num_resource: 35 type: 1802 host_id: 36 reserved: 0 @@ -543,7 +555,7 @@ rm-cfg: reserved: 0 - start_resource: 909 - num_resource: 627 + num_resource: 626 type: 1805 host_id: 128 reserved: 0 diff --git a/board/phytec/phycore_am64x/phycore_am64x.env b/board/phytec/phycore_am64x/phycore_am64x.env index d69dfe75674..36ab16e2f7a 100644 --- a/board/phytec/phycore_am64x/phycore_am64x.env +++ b/board/phytec/phycore_am64x/phycore_am64x.env @@ -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 @@ -22,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 diff --git a/board/phytec/phycore_imx8mm/phycore_imx8mm.env b/board/phytec/phycore_imx8mm/phycore_imx8mm.env index a7d14e774a0..402d967ab7d 100644 --- a/board/phytec/phycore_imx8mm/phycore_imx8mm.env +++ b/board/phytec/phycore_imx8mm/phycore_imx8mm.env @@ -34,7 +34,7 @@ mmcboot= echo WARN: Cannot load the DT; fi; fi; -mmcdev=CONFIG_SYS_MMC_ENV_DEV +mmcdev=CONFIG_ENV_MMC_DEVICE_INDEX mmcpart=1 mmcroot=2 netargs= diff --git a/board/phytec/phycore_imx8mp/phycore_imx8mp.env b/board/phytec/phycore_imx8mp/phycore_imx8mp.env index 2c12fc65432..69690aa92e4 100644 --- a/board/phytec/phycore_imx8mp/phycore_imx8mp.env +++ b/board/phytec/phycore_imx8mp/phycore_imx8mp.env @@ -51,7 +51,7 @@ mmcboot= else echo WARN: Cannot load the DT; fi; -mmcdev=CONFIG_SYS_MMC_ENV_DEV +mmcdev=CONFIG_ENV_MMC_DEVICE_INDEX mmcpart=1 mmcroot=2 netargs= diff --git a/board/phytec/phycore_imx93/phycore_imx93.env b/board/phytec/phycore_imx93/phycore_imx93.env index 3b2f30118e7..7b0a90e6447 100644 --- a/board/phytec/phycore_imx93/phycore_imx93.env +++ b/board/phytec/phycore_imx93/phycore_imx93.env @@ -23,7 +23,7 @@ bootenv_addr_r=0x90500000 fdtfile=CONFIG_DEFAULT_FDT_FILE ip_dyn=yes prepare_mcore=setenv optargs "${optargs} clk-imx93.mcore_booted" -mmcdev=CONFIG_SYS_MMC_ENV_DEV +mmcdev=CONFIG_ENV_MMC_DEVICE_INDEX mmcpart=1 mmcroot=2 mmcautodetect=yes |