Skip to contentSkip to conversation

Misc changes for Kontron i.MX8MM SoMs and Boards

PATCH Applied Frieder Schrempf 2 participants 15 messages Oct 7, 2025 – Oct 9, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Misc changes for Kontron i.MX8MM SoMs and Boards

From: Frieder Schrempf <[email protected]>

This is a collection of various patches that we have collected downstream and the conversion to OF_UPSTREAM.

Eberhard Stoll (1):
imx: kontron-sl-mx8mm: Force default environment for serial loader
boot

Frieder Schrempf (12):
imx: kontron-sl-mx8mm: Increase CONFIG_SPL_MAX_SIZE
imx: kontron-sl-mx8mm: Enable SDP support for loading via USB
imx: kontron-sl-mx8mm: Remove deprecation warning for old modules
imx: kontron-sl-mx8mm: Enable fixed regulators
imx: kontron-sl-mx8mm: Add support for EEPROM on OSM-S module
imx: kontron-sl-mx8mm: Use eMMC boot part for environment if booting
from eMMC
imx: kontron-sl-mx8mm: Export current env config to devicetree
imx: kontron-sl-mx8mm: Enable multiple useful commands, drivers and
features
imx: kontron-sl-mx8mm: Enable standard boot and disable legacy distro
boot
imx: kontron-sl-mx8mm: Enable USB hub on BL i.MX8MM OSM-S board
imx: kontron-sl-mx8mm: Autostart fastboot if booted from USB
imx: kontron-sl-mx8mm: Convert to OF_UPSTREAM

 arch/arm/dts/Makefile                         |   2 -
 .../dts/imx8mm-kontron-bl-common-u-boot.dtsi  |  16 +
 arch/arm/dts/imx8mm-kontron-bl-osm-s.dts      | 376 ------------------
 arch/arm/dts/imx8mm-kontron-bl.dts            | 355 -----------------
 arch/arm/dts/imx8mm-kontron-osm-s.dtsi        | 335 ----------------
 arch/arm/dts/imx8mm-kontron-sl.dtsi           | 314 ---------------
 board/kontron/sl-mx8mm/sl-mx8mm.c             | 102 ++++-
 board/kontron/sl-mx8mm/spl.c                  |  11 -
 configs/kontron-sl-mx8mm_defconfig            |  75 +++-
 include/configs/kontron-sl-mx8mm.h            |  12 -
 10 files changed, 183 insertions(+), 1415 deletions(-)
 delete mode 100644 arch/arm/dts/imx8mm-kontron-bl-osm-s.dts
 delete mode 100644 arch/arm/dts/imx8mm-kontron-bl.dts
 delete mode 100644 arch/arm/dts/imx8mm-kontron-osm-s.dtsi
 delete mode 100644 arch/arm/dts/imx8mm-kontron-sl.dtsi
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/13 imx: kontron-sl-mx8mm: Increase CONFIG_SPL_MAX_SIZE

From: Frieder Schrempf <[email protected]>

The limit of 0x27000 (156 KiB) was valid at times the DDR firmware required a fixed amount of 96 KiB of space. Now that we use binman to include the DDR firmware it only needs around 57 KiB of space and there is more room for the SPL.

Increase the max SPL size to 196 KiB so there is still 60 KiB for DDR firmware. This allows us to enable USB and SDP support in SPL.

---
 configs/kontron-sl-mx8mm_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/kontron-sl-mx8mm_defconfig +1 -0
index 4f08f2c572c..92583317a07 100644
@@ -43,6 +43,7 @@ CONFIG_SYS_PBSIZE=276
 CONFIG_BOARD_TYPES=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
+CONFIG_SPL_MAX_SIZE=0x31000
 CONFIG_SPL_BOARD_INIT=y
 # CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
 CONFIG_SPL_HAVE_INIT_STACK=y
Signature · 1 line
2.51.0
#2 lore raw

PATCH 2/13 imx: kontron-sl-mx8mm: Enable SDP support for loading via USB

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Enable everything that is required to load via USB. The SPL needs SDP support so it can load the U-Boot proper image via USB after it has been loaded via serial loader mode of the i.MX.

This way we can use the uuu tool for loading SPL and U-Boot proper like this:

uuu -brun flash.bin

---
 .../arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi | 16 ++++++++++++++++
 configs/kontron-sl-mx8mm_defconfig               | 10 ++++++++++
 2 files changed, 26 insertions(+)
arch/arm/dts/imx8mm-kontron-bl-common-u-boot.dtsi +16 -0
index ae542fdcffa..acb26cd5af6 100644
@@ -18,6 +18,10 @@
 	};
 };
 
+&aips4 {
+	bootph-pre-ram;
+};
+
 &i2c1 {
 	bootph-pre-ram;
 	bootph-all;
@@ -108,6 +112,18 @@
 	bootph-all;
 };
 
+&usbmisc1 {
+	bootph-pre-ram;
+};
+
+&usbphynop1 {
+	bootph-pre-ram;
+};
+
+&usbotg1 {
+	bootph-pre-ram;
+};
+
 &usdhc1 {
 	bootph-pre-ram;
 };
configs/kontron-sl-mx8mm_defconfig +10 -0
index 92583317a07..7b6ab1e217f 100644
@@ -69,6 +69,8 @@ CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_MTD=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_USB_SDP=y
+CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_WDT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
@@ -117,6 +119,8 @@ CONFIG_PHY_GIGE=y
 CONFIG_FEC_MXC=y
 CONFIG_RGMII=y
 CONFIG_MII=y
+CONFIG_SPL_PHY=y
+CONFIG_SPL_NOP_PHY=y
 CONFIG_PINCTRL=y
 CONFIG_SPL_PINCTRL=y
 CONFIG_PINCTRL_IMX8M=y
@@ -141,13 +145,19 @@ CONFIG_SYSRESET_PSCI=y
 CONFIG_SYSRESET_WATCHDOG=y
 CONFIG_DM_THERMAL=y
 CONFIG_USB=y
+CONFIG_SPL_USB_HOST=y
 CONFIG_USB_EHCI_HCD=y
+CONFIG_MXC_USB_OTG_HACTIVE=y
+# CONFIG_USB_STORAGE is not set
 CONFIG_USB_GADGET=y
+CONFIG_SPL_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
 CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
+CONFIG_SDP_LOADADDR=0x40400000
 CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_SPL_USB_SDP_SUPPORT=y
 # CONFIG_WATCHDOG_AUTOSTART is not set
 CONFIG_IMX_WATCHDOG=y
 # CONFIG_HEXDUMP is not set
Signature · 1 line
2.51.0
#3 lore raw

PATCH 3/13 imx: kontron-sl-mx8mm: Remove deprecation warning for old modules

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

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.

---
 board/kontron/sl-mx8mm/spl.c | 11 -----------
 1 file changed, 11 deletions(-)
board/kontron/sl-mx8mm/spl.c +0 -11
index 54ee1e66a7a..e3b029752b8 100644
@@ -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;
 }
 
Signature · 1 line
2.51.0
#4 lore raw

PATCH 4/13 imx: kontron-sl-mx8mm: Enable fixed regulators

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Enable support for using fixed regulators from the devicetree and auto enable them if requested.

This way U-Boot will enable the CARRIER_PWR_EN signal of the OSM module automatically while initializing the board.

---
 configs/kontron-sl-mx8mm_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/kontron-sl-mx8mm_defconfig +1 -0
index 7b6ab1e217f..71dde10ee4f 100644
@@ -131,6 +131,7 @@ CONFIG_DM_PMIC_PCA9450=y
 CONFIG_SPL_DM_PMIC_PCA9450=y
 CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_PCA9450=y
+CONFIG_DM_REGULATOR_FIXED=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_RV3028=y
 CONFIG_RTC_RV8803=y
Signature · 1 line
2.51.0
#5 lore raw

PATCH 5/13 imx: kontron-sl-mx8mm: Add support for EEPROM on OSM-S module

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Enable config options to access the EEPROM on the OSM-S i.MX8MM SoM module.

---
 configs/kontron-sl-mx8mm_defconfig | 8 ++++++++
 1 file changed, 8 insertions(+)
configs/kontron-sl-mx8mm_defconfig +8 -0
index 71dde10ee4f..f11e58a8433 100644
@@ -60,6 +60,11 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x58000
 CONFIG_SPL_WATCHDOG=y
 CONFIG_CMD_NVEDIT_EFI=y
+CONFIG_CMD_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
+CONFIG_SYS_EEPROM_SIZE=8192
+CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=5
+CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=6
 # CONFIG_CMD_LZMADEC is not set
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
@@ -100,6 +105,9 @@ CONFIG_CLK_IMX8MM=y
 CONFIG_DFU_SF=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
+CONFIG_I2C_EEPROM=y
+CONFIG_SPL_I2C_EEPROM=y
+CONFIG_SYS_I2C_EEPROM_ADDR=0x50
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_IO_VOLTAGE=y
 CONFIG_MMC_UHS_SUPPORT=y
Signature · 1 line
2.51.0
#6 lore raw

PATCH 6/13 imx: kontron-sl-mx8mm: Use eMMC boot part for environment if booting from eMMC

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

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.

---
 board/kontron/sl-mx8mm/sl-mx8mm.c | 45 ++++++++++++++++++++++++++++++-
 1 file changed, 44 insertions(+), 1 deletion(-)
board/kontron/sl-mx8mm/sl-mx8mm.c +44 -1
index 2e387038395..405ac0fb03f 100644
@@ -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
Signature · 1 line
2.51.0
#7 lore raw

PATCH 7/13 imx: kontron-sl-mx8mm: Export current env config to devicetree

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

This allows userspace tools like libubootenv to determine the location of the currently used environment and select a matching config.

---
 board/kontron/sl-mx8mm/sl-mx8mm.c | 36 +++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)
board/kontron/sl-mx8mm/sl-mx8mm.c +34 -2
index 405ac0fb03f..cb0b3acdd62 100644
@@ -14,6 +14,7 @@
 #include <fdt_support.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
+#include <mmc.h>
 #include <net.h>
 
 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)
Signature · 1 line
2.51.0
#8 lore raw

PATCH 8/13 imx: kontron-sl-mx8mm: Enable multiple useful commands, drivers and features

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Enable a bunch of useful features such as:

* Linux devicetree fixups
* devicetree overlay support
* secure boot dependencies
* commands (filesystems, disks, etc.)
* fastboot support
* USB storage/ethernet

---
 configs/kontron-sl-mx8mm_defconfig | 47 +++++++++++++++++++++++++++---
 1 file changed, 43 insertions(+), 4 deletions(-)
configs/kontron-sl-mx8mm_defconfig +43 -4
index f11e58a8433..1d0a6a83052 100644
@@ -14,6 +14,7 @@ CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
 CONFIG_DEFAULT_DEVICE_TREE="imx8mm-kontron-bl"
 CONFIG_TARGET_KONTRON_MX8MM=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
@@ -38,8 +39,9 @@ CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_OF_BOARD_SETUP=y
+CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_CBSIZE=2048
-CONFIG_SYS_PBSIZE=276
+CONFIG_SYS_PBSIZE=2074
 CONFIG_BOARD_TYPES=y
 # CONFIG_BOARD_INIT is not set
 CONFIG_BOARD_LATE_INIT=y
@@ -60,30 +62,52 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x58000
 CONFIG_SPL_WATCHDOG=y
 CONFIG_CMD_NVEDIT_EFI=y
+CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_EEPROM=y
 CONFIG_SYS_I2C_EEPROM_ADDR_LEN=2
 CONFIG_SYS_EEPROM_SIZE=8192
 CONFIG_SYS_EEPROM_PAGE_WRITE_BITS=5
 CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS=6
+CONFIG_CMD_MD5SUM=y
+CONFIG_MD5SUM_VERIFY=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_SHA1SUM=y
+CONFIG_SHA1SUM_VERIFY=y
 # CONFIG_CMD_LZMADEC is not set
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_FUSE=y
 CONFIG_CMD_GPIO=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_GPT_RENAME=y
 CONFIG_CMD_I2C=y
+CONFIG_CMD_LSBLK=y
+CONFIG_CMD_MBR=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_BKOPS_ENABLE=y
+CONFIG_MMC_SPEED_MODE_SET=y
 CONFIG_CMD_MTD=y
+CONFIG_CMD_READ=y
+CONFIG_CMD_SPI=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_SDP=y
 CONFIG_CMD_USB_MASS_STORAGE=y
 CONFIG_CMD_WDT=y
+CONFIG_CMD_BOOTCOUNT=y
 CONFIG_CMD_CACHE=y
 CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_RTC=y
 CONFIG_CMD_TIME=y
+CONFIG_CMD_GETTIME=y
+CONFIG_CMD_UUID=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_SMC=y
+CONFIG_HASH_VERIFY=y
+CONFIG_CMD_BTRFS=y
 CONFIG_CMD_EXT4_WRITE=y
+CONFIG_CMD_FS_UUID=y
+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"
@@ -93,9 +117,13 @@ CONFIG_ENV_REDUNDANT=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_USE_HOSTNAME=y
 CONFIG_HOSTNAME="kontron-mx8mm"
+CONFIG_VERSION_VARIABLE=y
+CONFIG_TFTP_TSIZE=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_SPL_CLK_COMPOSITE_CCF=y
@@ -103,6 +131,14 @@ CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SPL_CLK_IMX8MM=y
 CONFIG_CLK_IMX8MM=y
 CONFIG_DFU_SF=y
+CONFIG_USB_FUNCTION_FASTBOOT=y
+CONFIG_FASTBOOT_BUF_ADDR=0x42000000
+CONFIG_FASTBOOT_FLASH=y
+CONFIG_FASTBOOT_UUU_SUPPORT=y
+CONFIG_FASTBOOT_FLASH_MMC_DEV=0
+CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y
+CONFIG_FASTBOOT_MMC_USER_SUPPORT=y
+CONFIG_GPIO_HOG=y
 CONFIG_MXC_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_I2C_EEPROM=y
@@ -122,6 +158,7 @@ CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_MTD=y
 CONFIG_PHYLIB=y
 CONFIG_PHY_MSCC=y
+CONFIG_PHY_ETHERNET_ID=y
 CONFIG_DM_ETH_PHY=y
 CONFIG_PHY_GIGE=y
 CONFIG_FEC_MXC=y
@@ -157,7 +194,9 @@ CONFIG_USB=y
 CONFIG_SPL_USB_HOST=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_MXC_USB_OTG_HACTIVE=y
-# CONFIG_USB_STORAGE is not set
+CONFIG_USB_ONBOARD_HUB=y
+CONFIG_USB_HOST_ETHER=y
+CONFIG_USB_ETHER_SMSC95XX=y
 CONFIG_USB_GADGET=y
 CONFIG_SPL_USB_GADGET=y
 CONFIG_USB_GADGET_MANUFACTURER="FSL"
@@ -165,8 +204,8 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0525
 CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
 CONFIG_CI_UDC=y
 CONFIG_SDP_LOADADDR=0x40400000
-CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_USB_ETHER=y
+CONFIG_USB_ETH_CDC=y
 CONFIG_SPL_USB_SDP_SUPPORT=y
 # CONFIG_WATCHDOG_AUTOSTART is not set
 CONFIG_IMX_WATCHDOG=y
-# CONFIG_HEXDUMP is not set
Signature · 1 line
2.51.0
#9 lore raw

PATCH 9/13 imx: kontron-sl-mx8mm: Enable standard boot and disable legacy distro boot

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

The bootstd framework is the new way to support various bootflows and media. Use it instead of legacy distro boot.

---
 configs/kontron-sl-mx8mm_defconfig |  3 ++-
 include/configs/kontron-sl-mx8mm.h | 12 ------------
 2 files changed, 2 insertions(+), 13 deletions(-)
configs/kontron-sl-mx8mm_defconfig +2 -1
index 1d0a6a83052..11ce881bc19 100644
@@ -37,7 +37,7 @@ CONFIG_EFI_CAPSULE_FIRMWARE_FIT=y
 CONFIG_FIT=y
 CONFIG_FIT_EXTERNAL_OFFSET=0x3000
 CONFIG_SPL_LOAD_FIT=y
-CONFIG_DISTRO_DEFAULTS=y
+CONFIG_BOOTSTD_FULL=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_SYS_CBSIZE=2048
@@ -99,6 +99,7 @@ CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_RTC=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_GETTIME=y
+CONFIG_CMD_SYSBOOT=y
 CONFIG_CMD_UUID=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
include/configs/kontron-sl-mx8mm.h +0 -12
index 72a28a6a413..318c39d673a 100644
@@ -29,21 +29,9 @@
 	EFI_GUID(0xd488e45a, 0x4929, 0x4b55, 0x8c, 0x14, \
 		 0x86, 0xce, 0xa2, 0xcd, 0x66, 0x29)
 
-#define BOOT_TARGET_DEVICES(func) \
-	func(MMC, mmc, 1) \
-	func(MMC, mmc, 0) \
-	func(USB, usb, 0) \
-	func(PXE, pxe, na)
-#include <config_distro_bootcmd.h>
-/* Do not try to probe USB net adapters for net boot */
-#undef BOOTENV_RUN_NET_USB_START
-#define BOOTENV_RUN_NET_USB_START
-
 #ifdef CONFIG_XPL_BUILD
 /* malloc f used before GD_FLG_FULL_MALLOC_INIT set */
 #define CFG_MALLOC_F_ADDR		0x930000
 #endif
 
-#define CFG_EXTRA_ENV_SETTINGS BOOTENV
-
 #endif /* __KONTRON_MX8MM_CONFIG_H */
Signature · 1 line
2.51.0
#10 lore raw

PATCH 10/13 imx: kontron-sl-mx8mm: Enable USB hub on BL i.MX8MM OSM-S board

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Probe the USB hub on the BL i.MX8MM OSM-S board.

---
 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(+)
arch/arm/dts/imx8mm-kontron-bl-osm-s.dts +1 -0
index 8b16bd68576..fae00fd9632 100644
@@ -198,6 +198,7 @@
 	usb1@1 {
 		compatible = "usb424,9514";
 		reg = <1>;
+		vdd-supply = <&reg_vdd_3v3>;
 		#address-cells = <1>;
 		#size-cells = <0>;
 
board/kontron/sl-mx8mm/sl-mx8mm.c +8 -0
index cb0b3acdd62..cf71a4cf367 100644
@@ -8,6 +8,7 @@
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/mach-imx/boot_mode.h>
+#include <dm/uclass.h>
 #include <efi.h>
 #include <efi_loader.h>
 #include <env_internal.h>
@@ -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");
configs/kontron-sl-mx8mm_defconfig +1 -0
index 11ce881bc19..a2cc4d03963 100644
@@ -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
Signature · 1 line
2.51.0
#11 lore raw

PATCH 11/13 imx: kontron-sl-mx8mm: Autostart fastboot if booted from USB

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

This is useful for development and manufacturing setups as fastboot can be used without requiring any user input on the device.

---
 board/kontron/sl-mx8mm/sl-mx8mm.c | 5 +++++
 1 file changed, 5 insertions(+)
board/kontron/sl-mx8mm/sl-mx8mm.c +5 -0
index cf71a4cf367..220c9701ca5 100644
@@ -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;
 }
 
Signature · 1 line
2.51.0
#12 lore raw

PATCH 12/13 imx: kontron-sl-mx8mm: Force default environment for serial loader boot

In reply to Frieder Schrempf

From: Eberhard Stoll <[email protected]>

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.

---
 board/kontron/sl-mx8mm/sl-mx8mm.c  | 8 +++++++-
 configs/kontron-sl-mx8mm_defconfig | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)
board/kontron/sl-mx8mm/sl-mx8mm.c +7 -1
index 220c9701ca5..df92765cb2d 100644
@@ -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)
configs/kontron-sl-mx8mm_defconfig +1 -0
index a2cc4d03963..f9484b908d9 100644
@@ -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
Signature · 1 line
2.51.0
#13 lore raw

PATCH 13/13 imx: kontron-sl-mx8mm: Convert to OF_UPSTREAM

In reply to Frieder Schrempf

From: Frieder Schrempf <[email protected]>

Switch to OF_UPSTREAM to make use of the upstream devicetree.

---
 arch/arm/dts/Makefile                    |   2 -
 arch/arm/dts/imx8mm-kontron-bl-osm-s.dts | 377 -----------------------
 arch/arm/dts/imx8mm-kontron-bl.dts       | 355 ---------------------
 arch/arm/dts/imx8mm-kontron-osm-s.dtsi   | 335 --------------------
 arch/arm/dts/imx8mm-kontron-sl.dtsi      | 314 -------------------
 configs/kontron-sl-mx8mm_defconfig       |   5 +-
 6 files changed, 3 insertions(+), 1385 deletions(-)
 delete mode 100644 arch/arm/dts/imx8mm-kontron-bl-osm-s.dts
 delete mode 100644 arch/arm/dts/imx8mm-kontron-bl.dts
 delete mode 100644 arch/arm/dts/imx8mm-kontron-osm-s.dtsi
 delete mode 100644 arch/arm/dts/imx8mm-kontron-sl.dtsi
arch/arm/dts/Makefile +0 -2
index b69eb7cbb94..f63af7c84c1 100644
@@ -891,8 +891,6 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mm-data-modul-edm-sbc.dtb \
 	imx8mm-icore-mx8mm-ctouch2.dtb \
 	imx8mm-icore-mx8mm-edimm2.2.dtb \
-	imx8mm-kontron-bl.dtb \
-	imx8mm-kontron-bl-osm-s.dtb \
 	imx8mm-mx8menlo.dtb \
 	imx8mm-phg.dtb \
 	imx8mq-cm.dtb \
arch/arm/dts/imx8mm-kontron-bl-osm-s.dts deleted +0 -377

377 lines not on this page · raw message

arch/arm/dts/imx8mm-kontron-bl.dts deleted +0 -355

355 lines not on this page · raw message

arch/arm/dts/imx8mm-kontron-osm-s.dtsi deleted +0 -335

335 lines not on this page · raw message

arch/arm/dts/imx8mm-kontron-sl.dtsi deleted +0 -314

314 lines not on this page · raw message

configs/kontron-sl-mx8mm_defconfig +3 -2
index f9484b908d9..42346a305f9 100644
@@ -12,7 +12,7 @@ CONFIG_ENV_SECT_SIZE=0x10000
 CONFIG_IMX_CONFIG="board/kontron/sl-mx8mm/imximage.cfg"
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
-CONFIG_DEFAULT_DEVICE_TREE="imx8mm-kontron-bl"
+CONFIG_DEFAULT_DEVICE_TREE="freescale/imx8mm-kontron-bl"
 CONFIG_TARGET_KONTRON_MX8MM=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_SPL_MMC=y
@@ -111,7 +111,8 @@ CONFIG_CMD_FS_UUID=y
 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_OF_UPSTREAM=y
+CONFIG_OF_LIST="freescale/imx8mm-kontron-bl freescale/imx8mm-kontron-bl-osm-s"
 CONFIG_ENV_IS_NOWHERE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
Signature · 1 line
2.51.0