[PATCH v2 00/22] apalis-imx8: boot issue fix and support refresh

From: Francesco Dolcini francesco.dolcini@toradex.com
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 - use correct type for sc_pm_setup_uart() return value - remove board_phy_config() from board file - initialize svns - add aux cores helpers - add emmc/mmc card pinctrl's for different speeds
Changes in v2: - fixed issue in pcb version and soc variant handling for 8GB SKU - remove another spurious variable from the environment, boot_file - new commit: use correct type for sc_pm_setup_uart() return value - new commit: remove useless board_phy_config() from board file - new commit: initialize svns - new commit: add aux core helpers - new commit: add emmc/mmc card pinctrl's for different speeds
Andrejs Cainikovs (5): board: apalis-imx8: remove board_phy_config duplicate board: apalis-imx8: initialize snvs apalis-imx8: set bootaux memory base and size apalis-imx8: add M4 boot environment helpers apalis-imx8: add emmc/mmc card pinctrl's for different speeds
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
Philippe Schenker (1): board: apalis-imx8: get rid of sc_err_t type
arch/arm/dts/fsl-imx8qm-apalis.dts | 12 +- board/toradex/apalis-imx8/Makefile | 4 +- .../apalis-imx8/apalis-imx8-imximage.cfg | 4 +- board/toradex/apalis-imx8/apalis-imx8.c | 152 ++++++++++++++++-- configs/apalis-imx8_defconfig | 12 +- configs/colibri-imx8x_defconfig | 1 + include/configs/apalis-imx8.h | 54 +++---- include/configs/colibri-imx8x.h | 1 - 8 files changed, 183 insertions(+), 57 deletions(-)

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Fixes: c5ef2025579e ("dm: fix DM_EVENT dependencies") Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- configs/apalis-imx8_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index 6226d50c8ace..b2f8416e3263 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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

Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?

On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.

On Sat, Jan 14, 2023 at 08:27:25AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.
The more I look at this, the more confused I get. With DEBUG_UART enabled, where do thing fail without CONFIG_EVENT (and CONFIG_DM_EVENT, which is then enabled due to "imply DM_EVENT" in arch/arm/Kconfig, under ARCH_IMX8) ? How about if you turn DM_EVENT back off?

On Sat, Jan 14, 2023 at 11:57:20AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:27:25AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.
The more I look at this, the more confused I get. With DEBUG_UART enabled, where do thing fail without CONFIG_EVENT (and CONFIG_DM_EVENT, which is then enabled due to "imply DM_EVENT" in arch/arm/Kconfig, under ARCH_IMX8) ? How about if you turn DM_EVENT back off?
The only other data point I can add right now is that it's not entirely generic, I think. I can disable EFI_LOADER and EVENT and DM_EVENT on am65x_evm (both r5 and a53 portions) and still boot up fine. I don't have something imx8 in my lab, however.

On Sat, Jan 14, 2023 at 12:22:24PM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 11:57:20AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:27:25AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.
The more I look at this, the more confused I get. With DEBUG_UART enabled, where do thing fail without CONFIG_EVENT (and CONFIG_DM_EVENT, which is then enabled due to "imply DM_EVENT" in arch/arm/Kconfig, under ARCH_IMX8) ? How about if you turn DM_EVENT back off?
The only other data point I can add right now is that it's not entirely generic, I think. I can disable EFI_LOADER and EVENT and DM_EVENT on am65x_evm (both r5 and a53 portions) and still boot up fine. I don't have something imx8 in my lab, however.
Wait, no, I finally found it I think: commit 7fe32b3442f0d0e77a0768dcc1ee65fb352a080a Author: Simon Glass sjg@chromium.org Date: Fri Mar 4 08:43:05 2022 -0700
event: Convert arch_cpu_init_dm() to use events
Instead of a special function, send an event after driver model is inited and adjust the boards which use this function.
Signed-off-by: Simon Glass sjg@chromium.org
That uses "imply DM_EVENT" when it needs to be using select. I'll post a patch shortly.

On 1/14/23 18:22, Tom Rini wrote:
On Sat, Jan 14, 2023 at 11:57:20AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:27:25AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.
The more I look at this, the more confused I get. With DEBUG_UART enabled, where do thing fail without CONFIG_EVENT (and CONFIG_DM_EVENT, which is then enabled due to "imply DM_EVENT" in arch/arm/Kconfig, under ARCH_IMX8) ? How about if you turn DM_EVENT back off?
The only other data point I can add right now is that it's not entirely generic, I think. I can disable EFI_LOADER and EVENT and DM_EVENT on am65x_evm (both r5 and a53 portions) and still boot up fine. I don't have something imx8 in my lab, however.
I cannot find event_register() used outside of lib/efi_driver/efi_block_device.c and test/common/event.c)
Why should any board with CONFIG_EFI_LOADER=n depend on events?
Could it be that we have some other problem which by chance is hidden when addresses are moved by enabling events?
Best regards
Heinrich

On Sat, Jan 14, 2023 at 07:00:08PM +0100, Heinrich Schuchardt wrote:
On 1/14/23 18:22, Tom Rini wrote:
On Sat, Jan 14, 2023 at 11:57:20AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:27:25AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Without the DM_EVENT absolutely no output whatsoever and the system does not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.
The more I look at this, the more confused I get. With DEBUG_UART enabled, where do thing fail without CONFIG_EVENT (and CONFIG_DM_EVENT, which is then enabled due to "imply DM_EVENT" in arch/arm/Kconfig, under ARCH_IMX8) ? How about if you turn DM_EVENT back off?
The only other data point I can add right now is that it's not entirely generic, I think. I can disable EFI_LOADER and EVENT and DM_EVENT on am65x_evm (both r5 and a53 portions) and still boot up fine. I don't have something imx8 in my lab, however.
I cannot find event_register() used outside of lib/efi_driver/efi_block_device.c and test/common/event.c)
Why should any board with CONFIG_EFI_LOADER=n depend on events?
There's other events, using EVENT_SPY(...). I'm working on a patch to fix things up now.

Hello Tom,
On Sat, Jan 14, 2023 at 01:23:11PM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 07:00:08PM +0100, Heinrich Schuchardt wrote:
On 1/14/23 18:22, Tom Rini wrote:
On Sat, Jan 14, 2023 at 11:57:20AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:27:25AM -0500, Tom Rini wrote:
On Sat, Jan 14, 2023 at 08:25:19AM -0300, Fabio Estevam wrote:
Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote: > > From: Marcel Ziswiler marcel.ziswiler@toradex.com > > Without the DM_EVENT absolutely no output whatsoever and the system does > not boot at all.
Why do we need to select CONFIG_EVENT=y in the first place?
Oliver on CC reported the same issue for his board, and we have other broken boards too that do not select CONFIG_EVENT=y.
Can we have a generic fix for this?
Tom, Heinrich?
Yes, if someone can explain what the problem is, we can correct the dependency. I gather most platforms have whatever this problem is ignored due to enabling EFI_LOADER.
The more I look at this, the more confused I get. With DEBUG_UART enabled, where do thing fail without CONFIG_EVENT (and CONFIG_DM_EVENT, which is then enabled due to "imply DM_EVENT" in arch/arm/Kconfig, under ARCH_IMX8) ? How about if you turn DM_EVENT back off?
The only other data point I can add right now is that it's not entirely generic, I think. I can disable EFI_LOADER and EVENT and DM_EVENT on am65x_evm (both r5 and a53 portions) and still boot up fine. I don't have something imx8 in my lab, however.
I cannot find event_register() used outside of lib/efi_driver/efi_block_device.c and test/common/event.c)
Why should any board with CONFIG_EFI_LOADER=n depend on events?
There's other events, using EVENT_SPY(...). I'm working on a patch to fix things up now.
Given that this is now solved by your patch Tom, we can just drop this, together with patch 10. The question here is if I should send another series with those 2 removed or you just do not apply those.
Francesco

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Implement PCB version and SoC variant handling which automatically loads the correct device tree for the Linux kernel.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: added missing 8GB SKU --- board/toradex/apalis-imx8/apalis-imx8.c | 105 +++++++++++++++++++++++- configs/apalis-imx8_defconfig | 2 + include/configs/apalis-imx8.h | 3 +- 3 files changed, 107 insertions(+), 3 deletions(-)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 408198843fd5..6f28367cf034 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -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,75 @@ 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: + case APALIS_IMX8QM_8GB_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 +316,7 @@ int board_late_init(void) env_set("board_rev", "v1.0"); #endif
+ select_dt_from_module_version(); + return 0; } diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index b2f8416e3263..c14cb996a3e9 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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 diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index e2e491bdb0aa..6275751273c2 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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" \

From: Marcel Ziswiler marcel.ziswiler@toradex.com
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.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- board/toradex/apalis-imx8/apalis-imx8.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 6f28367cf034..1622900bd1da 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -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");

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Display build info with information about the version of SCFW, SECO and TF-A (ATF).
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- board/toradex/apalis-imx8/apalis-imx8.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 1622900bd1da..743d015b8360 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -333,6 +333,8 @@ int board_late_init(void) env_set("board_rev", "v1.0"); #endif
+ build_info(); + select_dt_from_module_version();
return 0;

From: Igor Opaniuk igor.opaniuk@toradex.com
This provides correct system prompt for U-Boot console.
Signed-off-by: Igor Opaniuk igor.opaniuk@toradex.com Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- configs/apalis-imx8_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index c14cb996a3e9..92a0c67b32e5 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Set the boot delay to one second.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- configs/apalis-imx8_defconfig | 1 + 1 file changed, 1 insertion(+)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index 92a0c67b32e5..aee43d078163 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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

From: Oleksandr Suvorov oleksandr.suvorov@toradex.com
There is no "apply" command enabled for "fdt". Enable "apply" command to allow overlays to be applied.
Signed-off-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- configs/apalis-imx8_defconfig | 1 + configs/colibri-imx8x_defconfig | 1 + 2 files changed, 2 insertions(+)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index aee43d078163..eabdb12478c3 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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 diff --git a/configs/colibri-imx8x_defconfig b/configs/colibri-imx8x_defconfig index 6896236045bf..70b9927406d8 100644 --- a/configs/colibri-imx8x_defconfig +++ b/configs/colibri-imx8x_defconfig @@ -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

From: Oleksandr Suvorov oleksandr.suvorov@toradex.com
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.
Signed-off-by: Oleksandr Suvorov oleksandr.suvorov@toradex.com Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- include/configs/apalis-imx8.h | 1 - include/configs/colibri-imx8x.h | 1 - 2 files changed, 2 deletions(-)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 6275751273c2..d08d211f4952 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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 " \ diff --git a/include/configs/colibri-imx8x.h b/include/configs/colibri-imx8x.h index d641fbf47e75..734034e9944b 100644 --- a/include/configs/colibri-imx8x.h +++ b/include/configs/colibri-imx8x.h @@ -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 " \

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Enable optional environment bootcount limit functionality.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- configs/apalis-imx8_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index eabdb12478c3..019846e1af22 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Update SPDX license identifier string.
While at it also update copyright period.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- 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(-)
diff --git a/arch/arm/dts/fsl-imx8qm-apalis.dts b/arch/arm/dts/fsl-imx8qm-apalis.dts index 0d8d3b3e8e8d..7daa4483d72c 100644 --- a/arch/arm/dts/fsl-imx8qm-apalis.dts +++ b/arch/arm/dts/fsl-imx8qm-apalis.dts @@ -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/; diff --git a/board/toradex/apalis-imx8/Makefile b/board/toradex/apalis-imx8/Makefile index a8c3eb7240ba..fe19cfdf695f 100644 --- a/board/toradex/apalis-imx8/Makefile +++ b/board/toradex/apalis-imx8/Makefile @@ -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 diff --git a/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg b/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg index 16183f96679d..fc4aa74990cd 100644 --- a/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg +++ b/board/toradex/apalis-imx8/apalis-imx8-imximage.cfg @@ -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 diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 743d015b8360..4d094507333a 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -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> diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index d08d211f4952..30cfae870cfa 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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

On Fri, Jan 13, 2023 at 06:17:39PM +0100, Francesco Dolcini wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Update SPDX license identifier string.
While at it also update copyright period.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com
v2: no changes
Please don't do this. We have far more "GPL-2.0+" (almost 10000) than we do "GPL-2.0-or-later" (225). And updating copyright years without any other change isn't meaningful. If your legal department is insisting it must be done, fine, please have them Signed-off-by the change. But for the dts file, please get that by re-syncing with the kernel instead.

On Sat, Jan 14, 2023 at 12:27:11PM -0500, Tom Rini wrote:
On Fri, Jan 13, 2023 at 06:17:39PM +0100, Francesco Dolcini wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Update SPDX license identifier string.
While at it also update copyright period.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com
v2: no changes
Please don't do this. We have far more "GPL-2.0+" (almost 10000) than we do "GPL-2.0-or-later" (225). And updating copyright years without any other change isn't meaningful. If your legal department is insisting it must be done, fine, please have them Signed-off-by the change. But for the dts file, please get that by re-syncing with the kernel instead.
I talked with Marcel and we agree on dropping this.
Should I send a v3 or you just skip it when applying?
Francesco

On Mon, Jan 16, 2023 at 11:49:10AM +0100, Francesco Dolcini wrote:
On Sat, Jan 14, 2023 at 12:27:11PM -0500, Tom Rini wrote:
On Fri, Jan 13, 2023 at 06:17:39PM +0100, Francesco Dolcini wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Update SPDX license identifier string.
While at it also update copyright period.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com
v2: no changes
Please don't do this. We have far more "GPL-2.0+" (almost 10000) than we do "GPL-2.0-or-later" (225). And updating copyright years without any other change isn't meaningful. If your legal department is insisting it must be done, fine, please have them Signed-off-by the change. But for the dts file, please get that by re-syncing with the kernel instead.
I talked with Marcel and we agree on dropping this.
Should I send a v3 or you just skip it when applying?
I'm fine with just skipping both when applying, but Stefano is the one who will be putting this all in a PR when he gets back.

On Mon, Jan 16, 2023 at 09:23:57AM -0500, Tom Rini wrote:
On Mon, Jan 16, 2023 at 11:49:10AM +0100, Francesco Dolcini wrote:
On Sat, Jan 14, 2023 at 12:27:11PM -0500, Tom Rini wrote:
On Fri, Jan 13, 2023 at 06:17:39PM +0100, Francesco Dolcini wrote:
From: Marcel Ziswiler marcel.ziswiler@toradex.com
Update SPDX license identifier string.
While at it also update copyright period.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com
v2: no changes
Please don't do this. We have far more "GPL-2.0+" (almost 10000) than we do "GPL-2.0-or-later" (225). And updating copyright years without any other change isn't meaningful. If your legal department is insisting it must be done, fine, please have them Signed-off-by the change. But for the dts file, please get that by re-syncing with the kernel instead.
I talked with Marcel and we agree on dropping this.
Should I send a v3 or you just skip it when applying?
I'm fine with just skipping both when applying, but Stefano is the one who will be putting this all in a PR when he gets back.
I just sent a v3, I hope it will simplify Stefano's job.
Thanks!
Francesco

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Remove obsolete SDHC related config defines. Nowadays, all SDHC related hardware configuration comes from the device tree.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- include/configs/apalis-imx8.h | 9 --------- 1 file changed, 9 deletions(-)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 30cfae870cfa..66e8727b60f6 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Remove obsolete net USB start.
While at it also add a comment about enabling distro-boot.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- include/configs/apalis-imx8.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 66e8727b60f6..92e81d8854a0 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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 \

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Introduce setup setting setupargs and move earlycon there.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- include/configs/apalis-imx8.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 92e81d8854a0..92b71e7a7c5e 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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 " \

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Drop obsolete environment variables fdt_addr, finduuid, boot_file, mmcargs, mmcdev, mmcpart and panel.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: remove additional boot_file variable --- include/configs/apalis-imx8.h | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 92b71e7a7c5e..86827ad85bc2 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -32,19 +32,11 @@ #define CONFIG_EXTRA_ENV_SETTINGS \ BOOTENV \ MEM_LAYOUT_ENV_SETTINGS \ - "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)?; " \

From: Marcel Ziswiler marcel.ziswiler@toradex.com
Update update_uboot confirmation message.
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- include/configs/apalis-imx8.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 86827ad85bc2..596799f050e6 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -39,7 +39,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 " \

From: Marcel Ziswiler marcel.ziswiler@toradex.com
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).
Signed-off-by: Marcel Ziswiler marcel.ziswiler@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: no changes --- configs/apalis-imx8_defconfig | 2 +- include/configs/apalis-imx8.h | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index 019846e1af22..8acf645167ea 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -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 diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 596799f050e6..415a84a2558f 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -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) \

From: Philippe Schenker philippe.schenker@toradex.com
sc_pm_setup_uart() returns int, not sc_err_t.
Signed-off-by: Philippe Schenker philippe.schenker@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: new patch --- board/toradex/apalis-imx8/apalis-imx8.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 4d094507333a..4e2634359823 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -169,12 +169,12 @@ void board_mem_get_layout(u64 *phys_sdram_1_start, int board_early_init_f(void) { sc_pm_clock_rate_t rate = SC_80MHZ; - sc_err_t err = 0; + int ret;
/* Set UART1 clock root to 80 MHz and enable it */ - err = sc_pm_setup_uart(SC_R_UART_1, rate); - if (err != SC_ERR_NONE) - return 0; + ret = sc_pm_setup_uart(SC_R_UART_1, rate); + if (ret) + return ret;
setup_iomux_uart();

From: Andrejs Cainikovs andrejs.cainikovs@toradex.com
Remove a duplicate of weak board_phy_config() implementation in drivers/net/phy/phy.c.
Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: new patch --- board/toradex/apalis-imx8/apalis-imx8.c | 12 ------------ 1 file changed, 12 deletions(-)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index 4e2634359823..d24e1b8d174e 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -199,18 +199,6 @@ static void board_gpio_init(void) static inline void board_gpio_init(void) {} #endif
-#if IS_ENABLED(CONFIG_FEC_MXC) -#include <miiphy.h> - -int board_phy_config(struct phy_device *phydev) -{ - if (phydev->drv->config) - phydev->drv->config(phydev); - - return 0; -} -#endif - /* * Backlight off before OS handover */

From: Andrejs Cainikovs andrejs.cainikovs@toradex.com
Initialize Secure Non-Volatile Storage, aka SNVS.
Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: new patch --- board/toradex/apalis-imx8/apalis-imx8.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/board/toradex/apalis-imx8/apalis-imx8.c b/board/toradex/apalis-imx8/apalis-imx8.c index d24e1b8d174e..11a48a3ff420 100644 --- a/board/toradex/apalis-imx8/apalis-imx8.c +++ b/board/toradex/apalis-imx8/apalis-imx8.c @@ -12,6 +12,7 @@ #include <asm/arch/imx8-pins.h> #include <asm/arch/iomux.h> #include <asm/arch/sci/sci.h> +#include <asm/arch/snvs_security_sc.h> #include <asm/arch/sys_proto.h> #include <asm/gpio.h> #include <asm/io.h> @@ -290,6 +291,13 @@ int board_init(void) { board_gpio_init();
+ if (IS_ENABLED(CONFIG_IMX_SNVS_SEC_SC_AUTO)) { + int ret = snvs_security_sc_init(); + + if (ret) + return ret; + } + return 0; }

From: Andrejs Cainikovs andrejs.cainikovs@toradex.com
Set i.MX auxiliary core memory base and size.
Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: new patch --- configs/apalis-imx8_defconfig | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/configs/apalis-imx8_defconfig b/configs/apalis-imx8_defconfig index 8acf645167ea..0f783e871ab8 100644 --- a/configs/apalis-imx8_defconfig +++ b/configs/apalis-imx8_defconfig @@ -8,6 +8,8 @@ CONFIG_ENV_SIZE=0x2000 CONFIG_ENV_OFFSET=0xFFFFDE00 CONFIG_DM_GPIO=y CONFIG_DEFAULT_DEVICE_TREE="fsl-imx8qm-apalis" +CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000 +CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000 CONFIG_TARGET_APALIS_IMX8=y CONFIG_SYS_PROMPT="Apalis iMX8 # " CONFIG_SYS_LOAD_ADDR=0x95400000

From: Andrejs Cainikovs andrejs.cainikovs@toradex.com
Add M4 boot environment functions for reference.
Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: new patch --- include/configs/apalis-imx8.h | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/include/configs/apalis-imx8.h b/include/configs/apalis-imx8.h index 415a84a2558f..e22f8cc73114 100644 --- a/include/configs/apalis-imx8.h +++ b/include/configs/apalis-imx8.h @@ -22,6 +22,15 @@ "ramdisk_addr_r=0x9d500000\0" \ "scriptaddr=0x9d480000\0"
+/* Boot M4 */ +#define M4_BOOT_ENV \ + "m4_0_image=m4_0.bin\0" \ + "m4_1_image=m4_1.bin\0" \ + "loadm4image_0=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4_0_image}\0" \ + "loadm4image_1=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${m4_1_image}\0" \ + "m4boot_0=run loadm4image_0; dcache flush; bootaux ${loadaddr} 0\0" \ + "m4boot_1=run loadm4image_1; dcache flush; bootaux ${loadaddr} 1\0" \ + /* Enable Distro Boot */ #define BOOT_TARGET_DEVICES(func) \ func(MMC, mmc, 1) \ @@ -33,6 +42,7 @@ /* Initial environment variables */ #define CONFIG_EXTRA_ENV_SETTINGS \ BOOTENV \ + M4_BOOT_ENV \ MEM_LAYOUT_ENV_SETTINGS \ "boot_script_dhcp=boot.scr\0" \ "console=ttyLP1\0" \

From: Andrejs Cainikovs andrejs.cainikovs@toradex.com
Add pinctrl's for high speed eMMC and MMC cards.
Signed-off-by: Andrejs Cainikovs andrejs.cainikovs@toradex.com Signed-off-by: Philippe Schenker philippe.schenker@toradex.com Signed-off-by: Francesco Dolcini francesco.dolcini@toradex.com --- v2: new patch --- arch/arm/dts/fsl-imx8qm-apalis.dts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/fsl-imx8qm-apalis.dts b/arch/arm/dts/fsl-imx8qm-apalis.dts index 7daa4483d72c..3a3067ffec5b 100644 --- a/arch/arm/dts/fsl-imx8qm-apalis.dts +++ b/arch/arm/dts/fsl-imx8qm-apalis.dts @@ -589,8 +589,10 @@
/* eMMC */ &usdhc1 { - pinctrl-names = "default"; + pinctrl-names = "default", "state_100mhz", "state_200mhz"; pinctrl-0 = <&pinctrl_usdhc1>; + pinctrl-1 = <&pinctrl_usdhc1>; + pinctrl-2 = <&pinctrl_usdhc1>; bus-width = <8>; non-removable; status = "okay"; @@ -598,8 +600,10 @@
/* Apalis MMC1 */ &usdhc2 { - pinctrl-names = "default"; + pinctrl-names = "default", "state_100mhz", "state_200mhz"; pinctrl-0 = <&pinctrl_usdhc2>, <&pinctrl_mmc1_cd>; + pinctrl-1 = <&pinctrl_usdhc2>, <&pinctrl_mmc1_cd>; + pinctrl-2 = <&pinctrl_usdhc2>, <&pinctrl_mmc1_cd>; bus-width = <8>; cd-gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; /* Apalis MMC1_CD# */ status = "okay";

Hi Francesco,
On Fri, Jan 13, 2023 at 2:18 PM Francesco Dolcini francesco@dolcini.it wrote:
From: Francesco Dolcini francesco.dolcini@toradex.com
This series fixes a boot issue and refreshes Apalis iMX8 support as follows:
The whole series looks good.
- fix booting caused by missing DM_EVENT
My only comment is that this one should be fixed in a global way, as it does not affect apalis-imx8 only.
With this fixed, for all the series:
Reviewed-by: Fabio Estevam festevam@denx.de
participants (4)
-
Fabio Estevam
-
Francesco Dolcini
-
Heinrich Schuchardt
-
Tom Rini