From fcddf2fc7ef6a68fc97d1dce9e137692dc129d2e Mon Sep 17 00:00:00 2001 From: Martin Schwan Date: Thu, 2 Oct 2025 13:20:37 +0200 Subject: board: phytec: phycore_imx8mp: Add rauc to bootmeths Add rauc to bootmeths variable if BOOTMETH_RAUC is enabled. This is setting a proper default for RAUC enabled systems. Signed-off-by: Martin Schwan --- board/phytec/phycore_imx8mp/phycore_imx8mp.env | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'board') diff --git a/board/phytec/phycore_imx8mp/phycore_imx8mp.env b/board/phytec/phycore_imx8mp/phycore_imx8mp.env index 9a129a0a4bf..70044997adb 100644 --- a/board/phytec/phycore_imx8mp/phycore_imx8mp.env +++ b/board/phytec/phycore_imx8mp/phycore_imx8mp.env @@ -3,7 +3,11 @@ bootcmd= fastboot 0; fi; bootflow scan -lb; +#ifdef CONFIG_BOOTMETH_RAUC +bootmeths=rauc script efi +#else bootmeths=script efi +#endif boot_targets=mmc2 mmc1 usb ethernet bootenv_addr_r=0x49100000 boot_script_dhcp=boot.scr.uimg -- cgit v1.3.1 From a9b865dd468944e01d88137ebbba7c855645eb18 Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Tue, 7 Oct 2025 10:16:00 +0200 Subject: imx: kontron-sl-mx8mm: Remove deprecation warning for old modules The module version this warning is referring to never really existed except for in-house development and there is a conflict with the I2C address used for detecting it and the I2C EEPROM of the latest OSM-S module. Remove the check. Signed-off-by: Frieder Schrempf --- board/kontron/sl-mx8mm/spl.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'board') diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c index 54ee1e66a7a..e3b029752b8 100644 --- a/board/kontron/sl-mx8mm/spl.c +++ b/board/kontron/sl-mx8mm/spl.c @@ -129,17 +129,6 @@ int do_board_detect(void) (unsigned int)gd->ram_size); } - /* - * Check the I2C PMIC to detect the deprecated SoM with DA9063. - */ - imx_iomux_v3_setup_multiple_pads(i2c1_pads, ARRAY_SIZE(i2c1_pads)); - - if (i2c_get_chip_for_busnum(0, 0x58, 0, &udev) == 0) { - printf("### ATTENTION: DEPRECATED SOM REVISION (N8010 Rev0) DETECTED! ###\n"); - printf("### THIS HW IS NOT SUPPORTED AND BOOTING WILL PROBABLY FAIL ###\n"); - printf("### PLEASE UPGRADE TO LATEST MODULE ###\n"); - } - return 0; } -- cgit v1.3.1 From 83a18f82417137a8cd40dd3718ad21ecfdc03aa3 Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Tue, 7 Oct 2025 10:16:03 +0200 Subject: imx: kontron-sl-mx8mm: Use eMMC boot part for environment if booting from eMMC Depending on the MMC boot device, select the proper location for the environment. * SD card and eMMC main partition: use offsets from CONFIG_ENV_OFFSET and CONFIG_ENV_OFFSET_REDUND. * eMMC boot partition: use offset -2*ENV_SIZE and -ENV_SIZE from the end of the partition. Signed-off-by: Frieder Schrempf --- board/kontron/sl-mx8mm/sl-mx8mm.c | 45 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index 2e387038395..405ac0fb03f 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -142,7 +142,8 @@ enum env_location env_get_location(enum env_operation op, int prio) * the MMC if we are running from SD card or eMMC. */ if (CONFIG_IS_ENABLED(ENV_IS_IN_MMC) && - (boot_dev == SD1_BOOT || boot_dev == SD2_BOOT)) + (boot_dev == SD1_BOOT || boot_dev == SD2_BOOT || + boot_dev == MMC1_BOOT || boot_dev == MMC2_BOOT)) return ENVL_MMC; if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH)) @@ -156,4 +157,46 @@ int board_mmc_get_env_dev(int devno) { return devno; } + +uint mmc_get_env_part(struct mmc *mmc) +{ + if (IS_SD(mmc)) + return EMMC_HWPART_DEFAULT; + + switch (EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config)) { + case EMMC_BOOT_PART_BOOT1: + return EMMC_HWPART_BOOT1; + case EMMC_BOOT_PART_BOOT2: + return EMMC_HWPART_BOOT2; + default: + return EMMC_HWPART_DEFAULT; + } +} + +int mmc_get_env_addr(struct mmc *mmc, int copy, u32 *env_addr) +{ + /* use normal offset for SD card */ + if (IS_SD(mmc)) { + *env_addr = CONFIG_ENV_OFFSET; + if (copy) + *env_addr = CONFIG_ENV_OFFSET_REDUND; + + return 0; + } + + switch (EXT_CSD_EXTRACT_BOOT_PART(mmc->part_config)) { + case EMMC_BOOT_PART_BOOT1: + case EMMC_BOOT_PART_BOOT2: + *env_addr = mmc->capacity - CONFIG_ENV_SIZE - CONFIG_ENV_SIZE; + if (copy) + *env_addr = mmc->capacity - CONFIG_ENV_SIZE; + break; + default: + *env_addr = CONFIG_ENV_OFFSET; + if (copy) + *env_addr = CONFIG_ENV_OFFSET_REDUND; + } + + return 0; +} #endif -- cgit v1.3.1 From d31ca9e2598f0bafb7b8e83e7de1e19d51768bf3 Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Tue, 7 Oct 2025 10:16:04 +0200 Subject: imx: kontron-sl-mx8mm: Export current env config to devicetree This allows userspace tools like libubootenv to determine the location of the currently used environment and select a matching config. Signed-off-by: Frieder Schrempf --- board/kontron/sl-mx8mm/sl-mx8mm.c | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'board') diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index 405ac0fb03f..cb0b3acdd62 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -14,6 +14,7 @@ #include #include #include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -108,12 +109,43 @@ int fdt_set_usb_eth_addr(void *blob) int ft_board_setup(void *blob, struct bd_info *bd) { - int ret = fdt_set_usb_eth_addr(blob); + enum env_location env_loc; + enum boot_device boot_dev; + char env_str_sd[] = "sd-card"; + char env_str_nor[] = "spi-nor"; + char env_str_emmc[] = "emmc"; + char *env_config_str; + int ret; + + ret = fdt_set_usb_eth_addr(blob); + if (ret) + return ret; + ret = fdt_fixup_memory(blob, PHYS_SDRAM, gd->ram_size); if (ret) return ret; - return fdt_fixup_memory(blob, PHYS_SDRAM, gd->ram_size); + env_loc = env_get_location(0, 0); + if (env_loc == ENVL_MMC) { + boot_dev = get_boot_device(); + if (boot_dev == SD2_BOOT) + env_config_str = env_str_sd; + else if (boot_dev == MMC1_BOOT) + env_config_str = env_str_emmc; + else + return 0; + } else if (env_loc == ENVL_SPI_FLASH) { + env_config_str = env_str_nor; + } else { + return 0; + } + + /* + * Export a string to the devicetree that tells userspace tools like + * libubootenv where the environment is currently coming from. + */ + return fdt_find_and_setprop(blob, "/chosen", "u-boot,env-config", + env_config_str, strlen(env_config_str) + 1, 1); } int board_late_init(void) -- cgit v1.3.1 From de704144fff9fad946e7aa62d526ee601b371c3b Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Tue, 7 Oct 2025 10:16:07 +0200 Subject: imx: kontron-sl-mx8mm: Enable USB hub on BL i.MX8MM OSM-S board Probe the USB hub on the BL i.MX8MM OSM-S board. Signed-off-by: Frieder Schrempf --- arch/arm/dts/imx8mm-kontron-bl-osm-s.dts | 1 + board/kontron/sl-mx8mm/sl-mx8mm.c | 8 ++++++++ configs/kontron-sl-mx8mm_defconfig | 1 + 3 files changed, 10 insertions(+) (limited to 'board') diff --git a/arch/arm/dts/imx8mm-kontron-bl-osm-s.dts b/arch/arm/dts/imx8mm-kontron-bl-osm-s.dts index 8b16bd68576..fae00fd9632 100644 --- a/arch/arm/dts/imx8mm-kontron-bl-osm-s.dts +++ b/arch/arm/dts/imx8mm-kontron-bl-osm-s.dts @@ -198,6 +198,7 @@ usb1@1 { compatible = "usb424,9514"; reg = <1>; + vdd-supply = <®_vdd_3v3>; #address-cells = <1>; #size-cells = <0>; diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index cb0b3acdd62..cf71a4cf367 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -150,10 +151,17 @@ int ft_board_setup(void *blob, struct bd_info *bd) int board_late_init(void) { + struct udevice *dev; + int ret; + if (!fdt_node_check_compatible(gd->fdt_blob, 0, "kontron,imx8mm-n802x-som") || !fdt_node_check_compatible(gd->fdt_blob, 0, "kontron,imx8mm-osm-s")) { env_set("som_type", "osm-s"); env_set("touch_rst_gpio", "111"); + + ret = uclass_get_device_by_name(UCLASS_MISC, "usb-hub@2c", &dev); + if (ret) + printf("Error bringing up USB hub (%d)\n", ret); } else { env_set("som_type", "sl"); env_set("touch_rst_gpio", "87"); diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig index 11ce881bc19..a2cc4d03963 100644 --- a/configs/kontron-sl-mx8mm_defconfig +++ b/configs/kontron-sl-mx8mm_defconfig @@ -142,6 +142,7 @@ CONFIG_FASTBOOT_MMC_USER_SUPPORT=y CONFIG_GPIO_HOG=y CONFIG_MXC_GPIO=y CONFIG_DM_I2C=y +CONFIG_USB_HUB_USB251XB=y CONFIG_I2C_EEPROM=y CONFIG_SPL_I2C_EEPROM=y CONFIG_SYS_I2C_EEPROM_ADDR=0x50 -- cgit v1.3.1 From c5ab46695cd7d1c9687b86e3b3eeccaba03b7af5 Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Tue, 7 Oct 2025 10:16:08 +0200 Subject: imx: kontron-sl-mx8mm: Autostart fastboot if booted from USB This is useful for development and manufacturing setups as fastboot can be used without requiring any user input on the device. Signed-off-by: Frieder Schrempf --- board/kontron/sl-mx8mm/sl-mx8mm.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'board') diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index cf71a4cf367..220c9701ca5 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -167,6 +167,11 @@ int board_late_init(void) env_set("touch_rst_gpio", "87"); } + if (is_usb_boot()) { + env_set("bootcmd", "fastboot 0"); + env_set("bootdelay", "0"); + } + return 0; } -- cgit v1.3.1 From 228f7f2e26be36b7314217bac683e06538b0c087 Mon Sep 17 00:00:00 2001 From: Eberhard Stoll Date: Tue, 7 Oct 2025 10:16:09 +0200 Subject: imx: kontron-sl-mx8mm: Force default environment for serial loader boot Enable CONFIG_ENV_IS_NOWHERE and force default environment when SoC boots from serial loader. In this case the U-Boot environment cannot be stored to flash with the 'saveenv' command. This makes serial loader boot completely independent from any environment stored in flash. Signed-off-by: Eberhard Stoll Signed-off-by: Frieder Schrempf --- board/kontron/sl-mx8mm/sl-mx8mm.c | 8 +++++++- configs/kontron-sl-mx8mm_defconfig | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'board') diff --git a/board/kontron/sl-mx8mm/sl-mx8mm.c b/board/kontron/sl-mx8mm/sl-mx8mm.c index 220c9701ca5..df92765cb2d 100644 --- a/board/kontron/sl-mx8mm/sl-mx8mm.c +++ b/board/kontron/sl-mx8mm/sl-mx8mm.c @@ -182,6 +182,9 @@ enum env_location env_get_location(enum env_operation op, int prio) if (prio) return ENVL_UNKNOWN; + if (CONFIG_IS_ENABLED(ENV_IS_NOWHERE) && is_usb_boot()) + return ENVL_NOWHERE; + /* * Make sure that the environment is loaded from * the MMC if we are running from SD card or eMMC. @@ -194,7 +197,10 @@ enum env_location env_get_location(enum env_operation op, int prio) if (CONFIG_IS_ENABLED(ENV_IS_IN_SPI_FLASH)) return ENVL_SPI_FLASH; - return ENVL_NOWHERE; + if (CONFIG_IS_ENABLED(ENV_IS_NOWHERE)) + return ENVL_NOWHERE; + + return ENVL_UNKNOWN; } #if defined(CONFIG_ENV_IS_IN_MMC) diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig index a2cc4d03963..f9484b908d9 100644 --- a/configs/kontron-sl-mx8mm_defconfig +++ b/configs/kontron-sl-mx8mm_defconfig @@ -112,6 +112,7 @@ CONFIG_PARTITION_TYPE_GUID=y CONFIG_OF_CONTROL=y CONFIG_SPL_OF_CONTROL=y CONFIG_OF_LIST="imx8mm-kontron-bl imx8mm-kontron-bl-osm-s" +CONFIG_ENV_IS_NOWHERE=y CONFIG_ENV_IS_IN_MMC=y CONFIG_ENV_IS_IN_SPI_FLASH=y CONFIG_ENV_REDUNDANT=y -- cgit v1.3.1