Skip to contentSkip to conversation

apalis-imx8: boot issue fix and support refresh

PATCH In review Marcel Ziswiler 5 participants 23 messages Dec 12, 2022 – Jan 16, 2023

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

cover apalis-imx8: boot issue fix and support refresh

From: Marcel Ziswiler <[email protected]>

This series fixes a boot issue and refreshes Apalis iMX8 support as follows:
- fix booting caused by missing DM_EVENT
- implement PCB version and SoC variant handling
- turn off LCD backlight before OS handover
- display build info
- provide proper prompt
- set bootdelay
- add overlays support
- remove global environment variable script
- enable environment bootcount limit
- update SPDX license identifier string
- remove obsolete SDHC related config defines
- remove obsolete net usb start
- introduce setup setting setupargs
- drop obsolete environment variables
- update update_uboot confirmation message
- update env memory layout

Igor Opaniuk (1):
apalis-imx8: provide proper config_sys_prompt

Marcel Ziswiler (13):
apalis-imx8: fix booting caused by missing dm_event
apalis-imx8: implement pcb version and soc variant handling
apalis-imx8: turn off lcd backlight before os handover
apalis-imx8: display build info
apalis-imx8: set bootdelay
apalis-imx8: enable environment bootcount limit
apalis-imx8: update spdx license identifier string
apalis-imx8: remove obsolete sdhc related config defines
apalis-imx8: remove obsolete net usb start
apalis-imx8: introduce setup setting setupargs
apalis-imx8: drop obsolete environment variables
apalis-imx8: update update_uboot confirmation message
apalis-imx8: update env memory layout

Oleksandr Suvorov (2):
apalis/colibri-imx8/8x: add overlay support for i.mx 8/8x-based soms apalis/colibri-imx8/8x: remove global variable script

 arch/arm/dts/fsl-imx8qm-apalis.dts            |   4 +-
 board/toradex/apalis-imx8/Makefile            |   4 +-
 .../apalis-imx8/apalis-imx8-imximage.cfg      |   4 +-
 board/toradex/apalis-imx8/apalis-imx8.c       | 129 +++++++++++++++++-
 configs/apalis-imx8_defconfig                 |  10 +-
 configs/colibri-imx8x_defconfig               |   1 +
 include/configs/apalis-imx8.h                 |  45 ++----
 include/configs/colibri-imx8x.h               |   1 -
 8 files changed, 156 insertions(+), 42 deletions(-)
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/16 apalis-imx8: fix booting caused by missing dm_event

From: Marcel Ziswiler <[email protected]>

Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.

Fixes c5ef2025579e ("dm: fix DM_EVENT dependencies")

---

 configs/apalis-imx8_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apalis-imx8_defconfig +1 -0
index 6226d50c8ac..b2f8416e326 100644
@@ -22,6 +22,7 @@ CONFIG_OF_SYSTEM_SETUP=y
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_EVENT=y
 CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SYS_MAXARGS=64
 CONFIG_SYS_CBSIZE=2048
Signature · 1 line
2.35.1
#2 lore raw

PATCH 2/16 apalis-imx8: implement pcb version and soc variant handling

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Implement PCB version and SoC variant handling which automatically loads the correct device tree for the Linux kernel.

---

 board/toradex/apalis-imx8/apalis-imx8.c | 104 +++++++++++++++++++++++-
 configs/apalis-imx8_defconfig           |   2 +
 include/configs/apalis-imx8.h           |   3 +-
 3 files changed, 106 insertions(+), 3 deletions(-)
board/toradex/apalis-imx8/apalis-imx8.c +103 -1
index 408198843fd..d4be999e24d 100644
@@ -15,10 +15,12 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <command.h>
 #include <env.h>
 #include <errno.h>
-#include <linux/libfdt.h>
 #include <linux/bitops.h>
+#include <linux/delay.h>
+#include <linux/libfdt.h>
 
 #include "../common/tdx-cfg-block.h"
 
@@ -29,11 +31,41 @@ DECLARE_GLOBAL_DATA_PTR;
 			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
 			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
 
+#define PCB_VERS_DETECT	((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
+			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
+			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
+			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
+
+#define GPIO_PAD_CTRL	((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
+			 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
+			 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT) | \
+			 (SC_PAD_28FDSOI_PS_PU << PADRING_PULL_SHIFT))
+
+#define PCB_VERS_DEFAULT	((SC_PAD_CONFIG_NORMAL << PADRING_CONFIG_SHIFT) | \
+				 (SC_PAD_ISO_OFF << PADRING_LPCONFIG_SHIFT) | \
+				 (SC_PAD_28FDSOI_PS_PD << PADRING_PULL_SHIFT) | \
+				 (SC_PAD_28FDSOI_DSE_DV_HIGH << PADRING_DSE_SHIFT))
+
 #define TDX_USER_FUSE_BLOCK1_A	276
 #define TDX_USER_FUSE_BLOCK1_B	277
 #define TDX_USER_FUSE_BLOCK2_A	278
 #define TDX_USER_FUSE_BLOCK2_B	279
 
+enum pcb_rev_t {
+	PCB_VERSION_1_0,
+	PCB_VERSION_1_1
+};
+
+static iomux_cfg_t pcb_vers_detect[] = {
+	SC_P_MIPI_DSI0_GPIO0_00 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(PCB_VERS_DETECT),
+	SC_P_MIPI_DSI0_GPIO0_01 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(PCB_VERS_DETECT),
+};
+
+static iomux_cfg_t pcb_vers_default[] = {
+	SC_P_MIPI_DSI0_GPIO0_00 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(PCB_VERS_DEFAULT),
+	SC_P_MIPI_DSI0_GPIO0_01 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(PCB_VERS_DEFAULT),
+};
+
 static iomux_cfg_t uart1_pads[] = {
 	SC_P_UART1_RX | MUX_PAD_CTRL(UART_PAD_CTRL),
 	SC_P_UART1_TX | MUX_PAD_CTRL(UART_PAD_CTRL),
@@ -180,6 +212,74 @@ int checkboard(void)
 	return 0;
 }
 
+static enum pcb_rev_t get_pcb_revision(void)
+{
+	unsigned int pcb_vers = 0;
+
+	imx8_iomux_setup_multiple_pads(pcb_vers_detect,
+				       ARRAY_SIZE(pcb_vers_detect));
+
+	gpio_request(IMX_GPIO_NR(1, 18),
+		     "PCB version detection on PAD SC_P_MIPI_DSI0_GPIO0_00");
+	gpio_request(IMX_GPIO_NR(1, 19),
+		     "PCB version detection on PAD SC_P_MIPI_DSI0_GPIO0_01");
+	gpio_direction_input(IMX_GPIO_NR(1, 18));
+	gpio_direction_input(IMX_GPIO_NR(1, 19));
+
+	udelay(1000);
+
+	pcb_vers = gpio_get_value(IMX_GPIO_NR(1, 18));
+	pcb_vers |= gpio_get_value(IMX_GPIO_NR(1, 19)) << 1;
+
+	/* Set muxing back to default values for saving energy */
+	imx8_iomux_setup_multiple_pads(pcb_vers_default,
+				       ARRAY_SIZE(pcb_vers_default));
+
+	switch (pcb_vers) {
+	case 0b11:
+		return PCB_VERSION_1_0;
+	case 0b10:
+		return PCB_VERSION_1_1;
+	default:
+		printf("Unknown PCB version=0x%x, default to V1.1\n", pcb_vers);
+		return PCB_VERSION_1_1;
+	}
+}
+
+static void select_dt_from_module_version(void)
+{
+	env_set("soc", "imx8qm");
+	env_set("variant", "-v1.1");
+
+	switch (tdx_hw_tag.prodid) {
+	/* Select Apalis iMX8QM device trees */
+	case APALIS_IMX8QM_IT:
+	case APALIS_IMX8QM_WIFI_BT_IT:
+		if (get_pcb_revision() == PCB_VERSION_1_0)
+			env_set("variant", "");
+		break;
+	/* Select Apalis iMX8QP device trees */
+	case APALIS_IMX8QP_WIFI_BT:
+	case APALIS_IMX8QP:
+		env_set("soc", "imx8qp");
+		break;
+	default:
+		printf("Unknown Apalis iMX8 module\n");
+		return;
+	}
+}
+
+static int do_select_dt_from_module_version(struct cmd_tbl *cmdtp, int flag,
+					    int argc, char * const argv[])
+{
+	select_dt_from_module_version();
+	return 0;
+}
+
+U_BOOT_CMD(select_dt_from_module_version, CONFIG_SYS_MAXARGS, 1, do_select_dt_from_module_version,
+	   "\n", "    - select devicetree from module version"
+);
+
 int board_init(void)
 {
 	board_gpio_init();
@@ -215,5 +315,7 @@ int board_late_init(void)
 	env_set("board_rev", "v1.0");
 #endif
 
+	select_dt_from_module_version();
+
 	return 0;
 }
configs/apalis-imx8_defconfig +2 -0
index b2f8416e326..c14cb996a3e 100644
@@ -19,6 +19,8 @@ CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_USE_PREBOOT=y
+CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile ${soc}-apalis${variant}-${fdt_board}.dtb"
 CONFIG_LOG=y
 # CONFIG_DISPLAY_BOARDINFO is not set
 CONFIG_DISPLAY_BOARDINFO_LATE=y
include/configs/apalis-imx8.h +1 -2
index e2e491bdb0a..6275751273c 100644
@@ -41,8 +41,7 @@
 	"boot_script_dhcp=boot.scr\0" \
 	"console=ttyLP1 earlycon\0" \
 	"fdt_addr=0x83000000\0"	\
-	"fdt_file=fsl-imx8qm-apalis-eval.dtb\0" \
-	"fdtfile=fsl-imx8qm-apalis-eval.dtb\0" \
+	"fdt_board=eval\0" \
 	"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
 	"initrd_addr=0x83800000\0" \
 	"initrd_high=0xffffffffffffffff\0" \
Signature · 1 line
2.35.1
#3 lore raw

PATCH 3/16 apalis-imx8: turn off lcd backlight before os handover

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

U-Boot typically tears down the display controller before handing control over to Linux. On LCD displays disabling pixel clock leads to a fading out effect with vertical/horizontal lines. Make sure to disable back light GPIO Apalis BKL1 before booting Linux.

---

 board/toradex/apalis-imx8/apalis-imx8.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
board/toradex/apalis-imx8/apalis-imx8.c +18 -1
index d4be999e24d..d8c68765d16 100644
@@ -182,9 +182,18 @@ int board_early_init_f(void)
 }
 
 #if CONFIG_IS_ENABLED(DM_GPIO)
+
+#define BKL1_GPIO   IMX_GPIO_NR(1, 10)
+
+static iomux_cfg_t board_gpios[] = {
+	SC_P_LVDS1_GPIO00 | MUX_MODE_ALT(3) | MUX_PAD_CTRL(GPIO_PAD_CTRL),
+};
+
 static void board_gpio_init(void)
 {
-	/* TODO */
+	imx8_iomux_setup_multiple_pads(board_gpios, ARRAY_SIZE(board_gpios));
+
+	gpio_request(BKL1_GPIO, "BKL1_GPIO");
 }
 #else
 static inline void board_gpio_init(void) {}
@@ -202,6 +211,14 @@ int board_phy_config(struct phy_device *phydev)
 }
 #endif
 
+/*
+ * Backlight off before OS handover
+ */
+void board_preboot_os(void)
+{
+	gpio_direction_output(BKL1_GPIO, 0);
+}
+
 int checkboard(void)
 {
 	puts("Model: Toradex Apalis iMX8\n");
Signature · 1 line
2.35.1
#4 lore raw

PATCH 4/16 apalis-imx8: display build info

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Display build info with information about the version of SCFW, SECO and TF-A (ATF).

---

 board/toradex/apalis-imx8/apalis-imx8.c | 2 ++
 1 file changed, 2 insertions(+)
board/toradex/apalis-imx8/apalis-imx8.c +2 -0
index d8c68765d16..84d700107af 100644
@@ -332,6 +332,8 @@ int board_late_init(void)
 	env_set("board_rev", "v1.0");
 #endif
 
+	build_info();
+
 	select_dt_from_module_version();
 
 	return 0;
Signature · 1 line
2.35.1
#5 lore raw

PATCH 5/16 apalis-imx8: provide proper config_sys_prompt

In reply to Marcel Ziswiler

From: Igor Opaniuk <[email protected]>

This provides correct system prompt for U-Boot console.

---

 configs/apalis-imx8_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apalis-imx8_defconfig +1 -0
index c14cb996a3e..92a0c67b32e 100644
@@ -9,6 +9,7 @@ CONFIG_ENV_OFFSET=0xFFFFDE00
 CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis"
 CONFIG_TARGET_APALIS_IMX8=y
+CONFIG_SYS_PROMPT="Apalis iMX8 # "
 CONFIG_SYS_LOAD_ADDR=0x80280000
 CONFIG_SYS_MEMTEST_START=0x88000000
 CONFIG_SYS_MEMTEST_END=0x89000000
Signature · 1 line
2.35.1
#6 lore raw

PATCH 6/16 apalis-imx8: set bootdelay

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Set the boot delay to one second.

---

 configs/apalis-imx8_defconfig | 1 +
 1 file changed, 1 insertion(+)
configs/apalis-imx8_defconfig +1 -0
index 92a0c67b32e..aee43d07816 100644
@@ -20,6 +20,7 @@ CONFIG_REMAKE_ELF=y
 CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_SYSTEM_SETUP=y
+CONFIG_BOOTDELAY=1
 CONFIG_USE_PREBOOT=y
 CONFIG_PREBOOT="test -n ${fdtfile} || setenv fdtfile ${soc}-apalis${variant}-${fdt_board}.dtb"
 CONFIG_LOG=y
Signature · 1 line
2.35.1
#7 lore raw

PATCH 7/16 apalis/colibri-imx8/8x: add overlay support for i.mx 8/8x-based soms

In reply to Marcel Ziswiler

From: Oleksandr Suvorov <[email protected]>

There is no "apply" command enabled for "fdt". Enable "apply" command to allow overlays to be applied.

---

 configs/apalis-imx8_defconfig   | 1 +
 configs/colibri-imx8x_defconfig | 1 +
 2 files changed, 2 insertions(+)
configs/apalis-imx8_defconfig +1 -0
index aee43d07816..eabdb12478c 100644
@@ -80,4 +80,5 @@ CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_SCU_THERMAL=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 # CONFIG_EFI_LOADER is not set
configs/colibri-imx8x_defconfig +1 -0
index 6896236045b..70b9927406d 100644
@@ -74,4 +74,5 @@ CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
 CONFIG_DM_THERMAL=y
 CONFIG_IMX_SCU_THERMAL=y
+CONFIG_OF_LIBFDT_OVERLAY=y
 # CONFIG_EFI_LOADER is not set
Signature · 1 line
2.35.1
#8 lore raw

PATCH 8/16 apalis/colibri-imx8/8x: remove global variable script

In reply to Marcel Ziswiler

From: Oleksandr Suvorov <[email protected]>

The distroboot script system scans boot_scripts variable and try to find and use to boot each script name mentioned there. Setting global variable "script" breaks this general mechanism of searching and running a distro boot script. Remove global variables "script" to fix working the general distro boot script mechanism.

---

 include/configs/apalis-imx8.h   | 1 -
 include/configs/colibri-imx8x.h | 1 -
 2 files changed, 2 deletions(-)
include/configs/apalis-imx8.h +0 -1
index 6275751273c..d08d211f495 100644
@@ -50,7 +50,6 @@
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
 	"mmcpart=1\0" \
 	"panel=NULL\0" \
-	"script=boot.scr\0" \
 	"update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; " \
 		"if test \"$confirm\" = \"y\"; then " \
 		"setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \
include/configs/colibri-imx8x.h +0 -1
index d641fbf47e7..734034e9944 100644
@@ -81,7 +81,6 @@
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
 	"mmcpart=1\0" \
 	"panel=NULL\0" \
-	"script=boot.scr\0" \
 	"update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; " \
 		"if test \"$confirm\" = \"y\"; then " \
 		"setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \
Signature · 1 line
2.35.1
#9 lore raw

PATCH 9/16 apalis-imx8: enable environment bootcount limit

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Enable optional environment bootcount limit functionality.

---

 configs/apalis-imx8_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/apalis-imx8_defconfig +2 -0
index eabdb12478c..019846e1af2 100644
@@ -53,6 +53,8 @@ CONFIG_VERSION_VARIABLE=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_TFTP_TSIZE=y
+CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_BOOTCOUNT_ENV=y
 CONFIG_CLK_IMX8=y
 CONFIG_CPU=y
 CONFIG_MXC_GPIO=y
Signature · 1 line
2.35.1
#10 lore raw

PATCH 10/16 apalis-imx8: update spdx license identifier string

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Update SPDX license identifier string.

While at it also update copyright period.

---

 arch/arm/dts/fsl-imx8qm-apalis.dts                 | 4 ++--
 board/toradex/apalis-imx8/Makefile                 | 4 ++--
 board/toradex/apalis-imx8/apalis-imx8-imximage.cfg | 4 ++--
 board/toradex/apalis-imx8/apalis-imx8.c            | 4 ++--
 include/configs/apalis-imx8.h                      | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)
arch/arm/dts/fsl-imx8qm-apalis.dts +2 -2
index 0d8d3b3e8e8..7daa4483d72 100644
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+ OR X11
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright 2017-2019 Toradex
+ * Copyright 2017-2022 Toradex
  */
 
 /dts-v1/;
board/toradex/apalis-imx8/Makefile +2 -2
index a8c3eb7240b..fe19cfdf695 100644
@@ -1,6 +1,6 @@
-# SPDX-License-Identifier: GPL-2.0+
+# SPDX-License-Identifier: GPL-2.0-or-later
 #
-# Copyright 2019 Toradex
+# Copyright 2019-2022 Toradex
 #
 
 obj-y += apalis-imx8.o
board/toradex/apalis-imx8/apalis-imx8-imximage.cfg +2 -2
index 16183f96679..fc4aa74990c 100644
@@ -1,6 +1,6 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
- * Copyright 2019 Toradex
+ * Copyright 2019-2022 Toradex
  *
  * Refer doc/imx/mkimage/imx8image.txt for more details about how-to configure
  * and create imx8image boot image
board/toradex/apalis-imx8/apalis-imx8.c +2 -2
index 84d700107af..1eaf9951d55 100644
@@ -1,6 +1,6 @@
-// SPDX-License-Identifier: GPL-2.0+
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * Copyright 2019 Toradex
+ * Copyright 2019-2022 Toradex
  */
 
 #include <common.h>
include/configs/apalis-imx8.h +2 -2
index d08d211f495..30cfae870cf 100644
@@ -1,6 +1,6 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 /*
- * Copyright 2019-2021 Toradex
+ * Copyright 2019-2022 Toradex
  */
 
 #ifndef __APALIS_IMX8_H
Signature · 1 line
2.35.1
#11 lore raw

PATCH 11/16 apalis-imx8: remove obsolete sdhc related config defines

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Remove obsolete SDHC related config defines. Nowadays, all SDHC related hardware configuration comes from the device tree.

---

 include/configs/apalis-imx8.h | 9 ---------
 1 file changed, 9 deletions(-)
include/configs/apalis-imx8.h +0 -9
index 30cfae870cf..66e8727b60f 100644
@@ -9,10 +9,6 @@
 #include <asm/arch/imx-regs.h>
 #include <linux/sizes.h>
 
-#define CFG_SYS_FSL_ESDHC_ADDR	0
-#define USDHC1_BASE_ADDR		0x5b010000
-#define USDHC2_BASE_ADDR		0x5b020000
-
 /* Networking */
 #define CONFIG_IPADDR			192.168.10.2
 #define CONFIG_NETMASK			255.255.255.0
@@ -56,11 +52,6 @@
 		"${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \
 		"${blkcnt}; fi\0"
 
-/* Link Definitions */
-
-/* On Apalis iMX8 USDHC1 is eMMC, USDHC2 is 8-bit and USDHC3 is 4-bit MMC/SD */
-#define CFG_SYS_FSL_USDHC_NUM	3
-
 #define CONFIG_SYS_SDRAM_BASE		0x80000000
 #define PHYS_SDRAM_1			0x80000000
 #define PHYS_SDRAM_2			0x880000000
Signature · 1 line
2.35.1
#12 lore raw

PATCH 12/16 apalis-imx8: remove obsolete net usb start

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Remove obsolete net USB start.

While at it also add a comment about enabling distro-boot.

---

 include/configs/apalis-imx8.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
include/configs/apalis-imx8.h +1 -2
index 66e8727b60f..92e81d8854a 100644
@@ -20,14 +20,13 @@
 	"ramdisk_addr_r=0x94400000\0" \
 	"scriptaddr=0x87000000\0"
 
+/* Enable Distro Boot */
 #define BOOT_TARGET_DEVICES(func) \
 	func(MMC, mmc, 1) \
 	func(MMC, mmc, 2) \
 	func(MMC, mmc, 0) \
 	func(DHCP, dhcp, na)
 #include <config_distro_bootcmd.h>
-#undef BOOTENV_RUN_NET_USB_START
-#define BOOTENV_RUN_NET_USB_START ""
 
 /* Initial environment variables */
 #define CONFIG_EXTRA_ENV_SETTINGS \
Signature · 1 line
2.35.1
#13 lore raw

PATCH 13/16 apalis-imx8: introduce setup setting setupargs

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Introduce setup setting setupargs and move earlycon there.

---

 include/configs/apalis-imx8.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
include/configs/apalis-imx8.h +3 -1
index 92e81d8854a..92b71e7a7c5 100644
@@ -34,7 +34,7 @@
 	MEM_LAYOUT_ENV_SETTINGS \
 	"boot_file=Image\0" \
 	"boot_script_dhcp=boot.scr\0" \
-	"console=ttyLP1 earlycon\0" \
+	"console=ttyLP1\0" \
 	"fdt_addr=0x83000000\0"	\
 	"fdt_board=eval\0" \
 	"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
@@ -45,6 +45,8 @@
 	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
 	"mmcpart=1\0" \
 	"panel=NULL\0" \
+	"setup=setenv setupargs console=tty1 console=${console},${baudrate} " \
+		"consoleblank=0 earlycon\0" \
 	"update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; " \
 		"if test \"$confirm\" = \"y\"; then " \
 		"setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \
Signature · 1 line
2.35.1
#14 lore raw

PATCH 14/16 apalis-imx8: drop obsolete environment variables

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Drop obsolete environment variables fdt_addr, finduuid, mmcargs, mmcdev, mmcpart and panel.

---

 include/configs/apalis-imx8.h | 7 -------
 1 file changed, 7 deletions(-)
include/configs/apalis-imx8.h +0 -7
index 92b71e7a7c5..85c305f8f00 100644
@@ -35,16 +35,9 @@
 	"boot_file=Image\0" \
 	"boot_script_dhcp=boot.scr\0" \
 	"console=ttyLP1\0" \
-	"fdt_addr=0x83000000\0"	\
 	"fdt_board=eval\0" \
-	"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
 	"initrd_addr=0x83800000\0" \
 	"initrd_high=0xffffffffffffffff\0" \
-	"mmcargs=setenv bootargs console=${console},${baudrate} " \
-		"root=PARTUUID=${uuid} rootwait " \
-	"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV) "\0" \
-	"mmcpart=1\0" \
-	"panel=NULL\0" \
 	"setup=setenv setupargs console=tty1 console=${console},${baudrate} " \
 		"consoleblank=0 earlycon\0" \
 	"update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; " \
Signature · 1 line
2.35.1
#15 lore raw

PATCH 15/16 apalis-imx8: update update_uboot confirmation message

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Update update_uboot confirmation message.

---

 include/configs/apalis-imx8.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/apalis-imx8.h +1 -1
index 85c305f8f00..c54c4d0465a 100644
@@ -40,7 +40,7 @@
 	"initrd_high=0xffffffffffffffff\0" \
 	"setup=setenv setupargs console=tty1 console=${console},${baudrate} " \
 		"consoleblank=0 earlycon\0" \
-	"update_uboot=askenv confirm Did you load u-boot-dtb.imx (y/N)?; " \
+	"update_uboot=askenv confirm Did you load flash.bin resp. u-boot-dtb.imx (y/N)?; " \
 		"if test \"$confirm\" = \"y\"; then " \
 		"setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt " \
 		"${blkcnt} / 0x200; mmc dev 0 1; mmc write ${loadaddr} 0x0 " \
Signature · 1 line
2.35.1
#16 lore raw

PATCH 16/16 apalis-imx8: update env memory layout

In reply to Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

Update the distro config env memory layout for the Apalis iMX8 aka QuadMax:

- kernel_comp_addr_r=0xf0000000 temporary area for uncompressing (ie FIT images or Image.gz booted using booti)
- kernel_comp_size=0x08000000
- loadaddr=0x95400000 avoiding any reserved areas located before that
- fdt_addr_r = loadaddr + 128MB - allows for 128MB kernel
- scriptaddr = fdt_addr_r + 512KB - allows for 512KB fdt
- ramdisk_addr_r = scriptaddr + 512KB - allows for 512KB script

Basic idea of memory layout taken from commit fd5c7173ade4 ("imx8m{m,n}_venice: update env memory layout"). However, moved past any reserved areas to avoid any kind of conflicts.

Note that for our regular BSP Layers and Reference Images for Yocto Project an updated distro boot script is required (see meta-toradex-bsp-common/recipes-bsp/u-boot/u-boot-distro-boot).

---

 configs/apalis-imx8_defconfig |  2 +-
 include/configs/apalis-imx8.h | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
configs/apalis-imx8_defconfig +1 -1
index 019846e1af2..8acf645167e 100644
@@ -10,7 +10,7 @@ CONFIG_DM_GPIO=y
 CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis"
 CONFIG_TARGET_APALIS_IMX8=y
 CONFIG_SYS_PROMPT="Apalis iMX8 # "
-CONFIG_SYS_LOAD_ADDR=0x80280000
+CONFIG_SYS_LOAD_ADDR=0x95400000
 CONFIG_SYS_MEMTEST_START=0x88000000
 CONFIG_SYS_MEMTEST_END=0x89000000
 CONFIG_DISTRO_DEFAULTS=y
include/configs/apalis-imx8.h +6 -4
index c54c4d0465a..c4f2cd604d5 100644
@@ -15,10 +15,12 @@
 #define CONFIG_SERVERIP			192.168.10.1
 
 #define MEM_LAYOUT_ENV_SETTINGS \
-	"fdt_addr_r=0x84000000\0" \
-	"kernel_addr_r=0x82000000\0" \
-	"ramdisk_addr_r=0x94400000\0" \
-	"scriptaddr=0x87000000\0"
+	"fdt_addr_r=0x9d400000\0" \
+	"kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+	"kernel_comp_addr_r=0xf0000000\0" \
+	"kernel_comp_size=0x08000000\0" \
+	"ramdisk_addr_r=0x9d500000\0" \
+	"scriptaddr=0x9d480000\0"
 
 /* Enable Distro Boot */
 #define BOOT_TARGET_DEVICES(func) \
Signature · 1 line
2.35.1
#17 lore raw
In reply to Marcel Ziswiler

Any feedback?

@Stefano: Any plans to apply anything?

@Tom: Or should we be sending you pull-requests directly?

Quoted 54 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This series fixes a boot issue and refreshes Apalis iMX8 support as follows:
- fix booting caused by missing DM_EVENT
- implement PCB version and SoC variant handling
- turn off LCD backlight before OS handover
- display build info
- provide proper prompt
- set bootdelay
- add overlays support
- remove global environment variable script
- enable environment bootcount limit
- update SPDX license identifier string
- remove obsolete SDHC related config defines
- remove obsolete net usb start
- introduce setup setting setupargs
- drop obsolete environment variables
- update update_uboot confirmation message
- update env memory layout

Igor Opaniuk (1):
  apalis-imx8: provide proper config_sys_prompt

Marcel Ziswiler (13):
  apalis-imx8: fix booting caused by missing dm_event
  apalis-imx8: implement pcb version and soc variant handling
  apalis-imx8: turn off lcd backlight before os handover
  apalis-imx8: display build info
  apalis-imx8: set bootdelay
  apalis-imx8: enable environment bootcount limit
  apalis-imx8: update spdx license identifier string
  apalis-imx8: remove obsolete sdhc related config defines
  apalis-imx8: remove obsolete net usb start
  apalis-imx8: introduce setup setting setupargs
  apalis-imx8: drop obsolete environment variables
  apalis-imx8: update update_uboot confirmation message
  apalis-imx8: update env memory layout

Oleksandr Suvorov (2):
  apalis/colibri-imx8/8x: add overlay support for i.mx 8/8x-based soms apalis/colibri-imx8/8x: remove global variable script

 arch/arm/dts/fsl-imx8qm-apalis.dts            |   4 +- board/toradex/apalis-imx8/Makefile            |   4 +- .../apalis-imx8/apalis-imx8-imximage.cfg      |   4 +- board/toradex/apalis-imx8/apalis-imx8.c       | 129 +++++++++++++++++- configs/apalis-imx8_defconfig                 |  10 +- configs/colibri-imx8x_defconfig               |   1 + include/configs/apalis-imx8.h                 |  45 ++---- include/configs/colibri-imx8x.h               |   1 -

 8 files changed, 156 insertions(+), 42 deletions(-)
#18 lore raw
Quoted 5 lines · Marcel Ziswiler

Any feedback?

@Stefano: Any plans to apply anything?

@Tom: Or should we be sending you pull-requests directly?

Stefano, do you want some help with the iMX queue?

Quoted 56 lines · Marcel Ziswiler
Quoted 54 lines

From: Marcel Ziswiler <[email protected]>

This series fixes a boot issue and refreshes Apalis iMX8 support as follows:
- fix booting caused by missing DM_EVENT
- implement PCB version and SoC variant handling
- turn off LCD backlight before OS handover
- display build info
- provide proper prompt
- set bootdelay
- add overlays support
- remove global environment variable script
- enable environment bootcount limit
- update SPDX license identifier string
- remove obsolete SDHC related config defines
- remove obsolete net usb start
- introduce setup setting setupargs
- drop obsolete environment variables
- update update_uboot confirmation message
- update env memory layout

Igor Opaniuk (1):
  apalis-imx8: provide proper config_sys_prompt

Marcel Ziswiler (13):
  apalis-imx8: fix booting caused by missing dm_event
  apalis-imx8: implement pcb version and soc variant handling
  apalis-imx8: turn off lcd backlight before os handover
  apalis-imx8: display build info
  apalis-imx8: set bootdelay
  apalis-imx8: enable environment bootcount limit
  apalis-imx8: update spdx license identifier string
  apalis-imx8: remove obsolete sdhc related config defines
  apalis-imx8: remove obsolete net usb start
  apalis-imx8: introduce setup setting setupargs
  apalis-imx8: drop obsolete environment variables
  apalis-imx8: update update_uboot confirmation message
  apalis-imx8: update env memory layout

Oleksandr Suvorov (2):
  apalis/colibri-imx8/8x: add overlay support for i.mx 8/8x-based soms apalis/colibri-imx8/8x: remove global variable script

 arch/arm/dts/fsl-imx8qm-apalis.dts            |   4 +- board/toradex/apalis-imx8/Makefile            |   4 +- .../apalis-imx8/apalis-imx8-imximage.cfg      |   4 +- board/toradex/apalis-imx8/apalis-imx8.c       | 129 +++++++++++++++++- configs/apalis-imx8_defconfig                 |  10 +- configs/colibri-imx8x_defconfig               |   1 + include/configs/apalis-imx8.h                 |  45 ++---- include/configs/colibri-imx8x.h               |   1 -

 8 files changed, 156 insertions(+), 42 deletions(-)
Signature · 1 line
Tom
#19 lore raw
Quoted 8 lines · Tom Rini
Quoted 5 lines · Marcel Ziswiler

Any feedback?

@Stefano: Any plans to apply anything?

@Tom: Or should we be sending you pull-requests directly?

Stefano, do you want some help with the iMX queue?

I am not in office until 23.1, and I could not merge / send PR until then. Please apply directly series if they cannot wait, I will go on when I will be back.

Stefano

Quoted 58 lines
Quoted 57 lines · Marcel Ziswiler
Quoted 54 lines

From: Marcel Ziswiler <[email protected]>

This series fixes a boot issue and refreshes Apalis iMX8 support as follows:
- fix booting caused by missing DM_EVENT
- implement PCB version and SoC variant handling
- turn off LCD backlight before OS handover
- display build info
- provide proper prompt
- set bootdelay
- add overlays support
- remove global environment variable script
- enable environment bootcount limit
- update SPDX license identifier string
- remove obsolete SDHC related config defines
- remove obsolete net usb start
- introduce setup setting setupargs
- drop obsolete environment variables
- update update_uboot confirmation message
- update env memory layout

Igor Opaniuk (1):
  apalis-imx8: provide proper config_sys_prompt

Marcel Ziswiler (13):
  apalis-imx8: fix booting caused by missing dm_event
  apalis-imx8: implement pcb version and soc variant handling
  apalis-imx8: turn off lcd backlight before os handover
  apalis-imx8: display build info
  apalis-imx8: set bootdelay
  apalis-imx8: enable environment bootcount limit
  apalis-imx8: update spdx license identifier string
  apalis-imx8: remove obsolete sdhc related config defines
  apalis-imx8: remove obsolete net usb start
  apalis-imx8: introduce setup setting setupargs
  apalis-imx8: drop obsolete environment variables
  apalis-imx8: update update_uboot confirmation message
  apalis-imx8: update env memory layout

Oleksandr Suvorov (2):
  apalis/colibri-imx8/8x: add overlay support for i.mx 8/8x-based soms apalis/colibri-imx8/8x: remove global variable script

  arch/arm/dts/fsl-imx8qm-apalis.dts            |   4 +-
  board/toradex/apalis-imx8/Makefile            |   4 +-
  .../apalis-imx8/apalis-imx8-imximage.cfg      |   4 +-
  board/toradex/apalis-imx8/apalis-imx8.c       | 129 +++++++++++++++++-
  configs/apalis-imx8_defconfig                 |  10 +-
  configs/colibri-imx8x_defconfig               |   1 +
  include/configs/apalis-imx8.h                 |  45 ++----
  include/configs/colibri-imx8x.h               |   1 -
  8 files changed, 156 insertions(+), 42 deletions(-)
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#20 lore raw

Hello Stefano,

Quoted 6 lines · Stefano Babic
Quoted 5 lines · Tom Rini
Quoted 4 lines · Marcel Ziswiler

Any feedback?

@Stefano: Any plans to apply anything?

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

@Tom: Or should we be sending you pull-requests directly?

Stefano, do you want some help with the iMX queue?

I am not in office until 23.1, and I could not merge / send PR until then. Please apply directly series if they cannot wait, I will go on when I will be back.

Just a quick head-up for when you are back, please apply version 3 of this series:

https://lore.kernel.org/all/[email protected]/
http://patchwork.ozlabs.org/project/uboot/list/?series=336920

Thanks!
Francesco

#21 lore raw
In reply to Marcel Ziswiler

Hi Marcel,

Quoted 3 lines · Marcel Ziswiler

Any feedback?

@Stefano: Any plans to apply anything?

I am not in my office until 23.1, I won't be able to do any merge / PR before I will be back, sorry.

Best regards,
Stefano

Quoted 58 lines

@Tom: Or should we be sending you pull-requests directly?

Quoted 54 lines · Marcel Ziswiler

From: Marcel Ziswiler <[email protected]>

This series fixes a boot issue and refreshes Apalis iMX8 support as follows:
- fix booting caused by missing DM_EVENT
- implement PCB version and SoC variant handling
- turn off LCD backlight before OS handover
- display build info
- provide proper prompt
- set bootdelay
- add overlays support
- remove global environment variable script
- enable environment bootcount limit
- update SPDX license identifier string
- remove obsolete SDHC related config defines
- remove obsolete net usb start
- introduce setup setting setupargs
- drop obsolete environment variables
- update update_uboot confirmation message
- update env memory layout

Igor Opaniuk (1):
  apalis-imx8: provide proper config_sys_prompt

Marcel Ziswiler (13):
  apalis-imx8: fix booting caused by missing dm_event
  apalis-imx8: implement pcb version and soc variant handling
  apalis-imx8: turn off lcd backlight before os handover
  apalis-imx8: display build info
  apalis-imx8: set bootdelay
  apalis-imx8: enable environment bootcount limit
  apalis-imx8: update spdx license identifier string
  apalis-imx8: remove obsolete sdhc related config defines
  apalis-imx8: remove obsolete net usb start
  apalis-imx8: introduce setup setting setupargs
  apalis-imx8: drop obsolete environment variables
  apalis-imx8: update update_uboot confirmation message
  apalis-imx8: update env memory layout

Oleksandr Suvorov (2):
  apalis/colibri-imx8/8x: add overlay support for i.mx 8/8x-based soms apalis/colibri-imx8/8x: remove global variable script

  arch/arm/dts/fsl-imx8qm-apalis.dts            |   4 +-
  board/toradex/apalis-imx8/Makefile            |   4 +-
  .../apalis-imx8/apalis-imx8-imximage.cfg      |   4 +-
  board/toradex/apalis-imx8/apalis-imx8.c       | 129 +++++++++++++++++-
  configs/apalis-imx8_defconfig                 |  10 +-
  configs/colibri-imx8x_defconfig               |   1 +
  include/configs/apalis-imx8.h                 |  45 ++----
  include/configs/colibri-imx8x.h               |   1 -
  8 files changed, 156 insertions(+), 42 deletions(-)
Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich,   Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected]
=====================================================================
#22 lore raw

Hello Stefano, Marcel and all

Quoted 9 lines · Stefano Babic
Quoted 3 lines · Marcel Ziswiler

Any feedback?

@Stefano: Any plans to apply anything?

I am not in my office until 23.1, I won't be able to do any merge / PR before I will be back, sorry.

Quoted 1 line

@Tom: Or should we be sending you pull-requests directly?

I sent a v2 of this series [0], sharing this here to be sure that v1 is not applied by mistake.

Francesco

[0] https://lore.kernel.org/u-boot/[email protected]/