Skip to contentSkip to conversation

imx: support i.MX8QM DMSSE20 a1 board

PATCH Superseded Oliver Graute 2 participants 4 messages Nov 30, 2021

Subsystems (3)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 imx: support i.MX8QM DMSSE20 a1 board

Add i.MX8QM DMSSE20 a1 board support

U-Boot 2021.10-00029-g4ad997ec17 (Nov 30 2021 - 09:40:26 +0100)

Model: Advantech iMX8QM DMSSE20
Board: DMS-SE20A1 8GB
Build: SCFW 875cfeb5, SECO-FW d63fdb21, ATF 09c5cc9
Boot:  USB
DRAM:  8 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial@5a060000
Out:   serial@5a060000
Err:   serial@5a060000
Net:   eth0: ethernet@5b040000 [PRIME]
Warning: ethernet@5b050000 (eth1) using random MAC address - c6:1b:bf:cc:e5:6c

, eth1: ethernet@5b050000
Hit any key to stop autoboot: 0

---

This is working on 2021.10. Can you give me some hints what I have to do to get it working with current master branch? There are some imx related changes that I don't overlook.

Changes for v3
-Remove addr parameter from reset_cpu()
-moved some configs into defconfig

Changes for v2
-replaced bd_t with struct bd_info
-added missing DTS in MAINTAINERS
-replaced README with imx8qm-dmsse20-a1.rst
-move CMD_FUSE to Kconfig
-removed fdt_high
-added i2c support
-added rtc support

 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/imx8qm-dmsse20-a1.dts            | 407 ++++++++++++++++++
 arch/arm/mach-imx/imx8/Kconfig                |   7 +
 board/advantech/imx8qm_dmsse20_a1/Kconfig     |  14 +
 board/advantech/imx8qm_dmsse20_a1/MAINTAINERS |   7 +
 board/advantech/imx8qm_dmsse20_a1/Makefile    |   8 +
 .../imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c     | 188 ++++++++
 .../advantech/imx8qm_dmsse20_a1/imximage.cfg  |  21 +
 board/advantech/imx8qm_dmsse20_a1/spl.c       | 224 ++++++++++
 common/Kconfig                                |   2 +-
 configs/imx8qm_dmsse20a1_defconfig            | 102 +++++
 doc/board/advantech/imx8qm-dmsse20-a1.rst     |  58 +++
 doc/board/advantech/index.rst                 |   1 +
 include/configs/imx8qm_dmsse20.h              | 177 ++++++++
 14 files changed, 1216 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/dts/imx8qm-dmsse20-a1.dts
 create mode 100644 board/advantech/imx8qm_dmsse20_a1/Kconfig
 create mode 100644 board/advantech/imx8qm_dmsse20_a1/MAINTAINERS
 create mode 100644 board/advantech/imx8qm_dmsse20_a1/Makefile
 create mode 100644 board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c
 create mode 100644 board/advantech/imx8qm_dmsse20_a1/imximage.cfg
 create mode 100644 board/advantech/imx8qm_dmsse20_a1/spl.c
 create mode 100644 configs/imx8qm_dmsse20a1_defconfig
 create mode 100644 doc/board/advantech/imx8qm-dmsse20-a1.rst
 create mode 100644 include/configs/imx8qm_dmsse20.h
arch/arm/dts/Makefile +1 -0
index fc16a57e60..08d06b7f2f 100644
@@ -855,6 +855,7 @@ dtb-$(CONFIG_ARCH_IMX8) += \
 	fsl-imx8qm-apalis.dtb \
 	fsl-imx8qm-mek.dtb \
 	imx8qm-cgtqmx8.dtb \
+	imx8qm-dmsse20-a1.dtb \
 	imx8qm-rom7720-a1.dtb \
 	fsl-imx8qxp-ai_ml.dtb \
 	fsl-imx8qxp-colibri.dtb \
arch/arm/dts/imx8qm-dmsse20-a1.dts new file +407 -0

407 lines not on this page · raw message

arch/arm/mach-imx/imx8/Kconfig +7 -0
index b43739e5c6..2598e527ac 100644
@@ -85,6 +85,12 @@ config TARGET_IMX8QM_ROM7720_A1
 	select SUPPORT_SPL
 	select IMX8QM
 
+config TARGET_IMX8QM_DMSSE20_A1
+	bool "Support i.MX8QM DMS-SE20-A1 board"
+	select BOARD_LATE_INIT
+	select SUPPORT_SPL
+	select IMX8QM
+
 config TARGET_IMX8QXP_MEK
 	bool "Support i.MX8QXP MEK board"
 	select BOARD_LATE_INIT
@@ -95,6 +101,7 @@ endchoice
 source "board/freescale/imx8qm_mek/Kconfig"
 source "board/freescale/imx8qxp_mek/Kconfig"
 source "board/congatec/cgtqmx8/Kconfig"
+source "board/advantech/imx8qm_dmsse20_a1/Kconfig"
 source "board/advantech/imx8qm_rom7720_a1/Kconfig"
 source "board/toradex/apalis-imx8/Kconfig"
 source "board/toradex/colibri-imx8x/Kconfig"
board/advantech/imx8qm_dmsse20_a1/Kconfig new file +14 -0
new file mode 100644
index 0000000000..1d5e68a96f
@@ -0,0 +1,14 @@
+if TARGET_IMX8QM_DMSSE20_A1
+
+config SYS_BOARD
+	default "imx8qm_dmsse20_a1"
+
+config SYS_VENDOR
+	default "advantech"
+
+config SYS_CONFIG_NAME
+	default "imx8qm_dmsse20"
+
+source "board/freescale/common/Kconfig"
+
+endif
board/advantech/imx8qm_dmsse20_a1/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..8292c6ba71
@@ -0,0 +1,7 @@
+i.MX8QM ROM DMSSE20 a1 BOARD
+M:	Oliver Graute <[email protected]>
+S:	Maintained
+F:	board/advantech/imx8qm_dmsse20_a1/
+F:	arch/arm/dts/imx8qm-dmsse20-a1.dtb
+F:	include/configs/imx8qm_dmsse20.h
+F:	configs/imx8qm_dmsse20a1_defconfig
board/advantech/imx8qm_dmsse20_a1/Makefile new file +8 -0
new file mode 100644
index 0000000000..262ffcd683
@@ -0,0 +1,8 @@
+#
+# Copyright 2017 NXP
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y += imx8qm_dmsse20_a1.o
+obj-$(CONFIG_SPL_BUILD) += spl.o
board/advantech/imx8qm_dmsse20_a1/imx8qm_dmsse20_a1.c new file +188 -0

188 lines not on this page · raw message

board/advantech/imx8qm_dmsse20_a1/imximage.cfg new file +21 -0
new file mode 100644
index 0000000000..e324c7ca37
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier:	GPL-2.0+ */
+/*
+ * Copyright 2018 NXP
+ */
+
+#define __ASSEMBLY__
+
+/* Boot from SD, sector size 0x400 */
+BOOT_FROM SD 0x400
+/* SoC type IMX8QM */
+SOC_TYPE IMX8QM
+/* Append seco container image */
+APPEND mx8qm-ahab-container.img
+/* Create the 2nd container */
+CONTAINER
+/* Add scfw image with exec attribute */
+IMAGE SCU mx8qm-val-scfw-tcm.bin
+/* Add ATF image with exec attribute */
+IMAGE A35 bl31.bin 0x80000000
+/* Add U-Boot image with load attribute */
+DATA A35 u-boot-dtb.bin 0x80020000
board/advantech/imx8qm_dmsse20_a1/spl.c new file +224 -0

224 lines not on this page · raw message

common/Kconfig +1 -1
index ee14d3ad5b..bc4696deb1 100644
@@ -461,7 +461,7 @@ config BOARD_TYPES
 
 config DISPLAY_CPUINFO
 	bool "Display information about the CPU during start up"
-	default y if ARC|| ARM || NIOS2 || X86 || XTENSA || M68K
+	default y if ARC || ARM || NIOS2 || X86 || XTENSA || M68K
 	help
 	  Display information about the CPU that U-Boot is running on
 	  when U-Boot starts up. The function print_cpuinfo() is called
configs/imx8qm_dmsse20a1_defconfig new file +102 -0

102 lines not on this page · raw message

doc/board/advantech/imx8qm-dmsse20-a1.rst new file +58 -0

58 lines not on this page · raw message

doc/board/advantech/index.rst +1 -0
index e9b198c5c3..125b98c1f7 100644
@@ -7,3 +7,4 @@ Advantech
    :maxdepth: 2
 
    imx8qm-rom7720-a1.rst
+   imx8qm-dmsse20-a1.rst
include/configs/imx8qm_dmsse20.h new file +177 -0

177 lines not on this page · raw message

Signature · 1 line
2.17.1
reviewer
#1 lore raw

Hi Oliver,

Quoted 20 lines · Oliver Graute

Add i.MX8QM DMSSE20 a1 board support

U-Boot 2021.10-00029-g4ad997ec17 (Nov 30 2021 - 09:40:26 +0100)

Model: Advantech iMX8QM DMSSE20
Board: DMS-SE20A1 8GB
Build: SCFW 875cfeb5, SECO-FW d63fdb21, ATF 09c5cc9
Boot:  USB
DRAM:  8 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial@5a060000
Out:   serial@5a060000
Err:   serial@5a060000
Net:   eth0: ethernet@5b040000 [PRIME]
Warning: ethernet@5b050000 (eth1) using random MAC address - c6:1b:bf:cc:e5:6c

, eth1: ethernet@5b050000
Hit any key to stop autoboot: 0

Quoted 6 lines

---

This is working on 2021.10. Can you give me some hints what I have to do to get it working with current master branch? There are some imx related changes that I don't overlook.

What are the exact errors you see with the master branch?

#2 lore raw
Quoted 24 lines · Fabio Estevam

Hi Oliver,

Quoted 20 lines · Oliver Graute

Add i.MX8QM DMSSE20 a1 board support

U-Boot 2021.10-00029-g4ad997ec17 (Nov 30 2021 - 09:40:26 +0100)

Model: Advantech iMX8QM DMSSE20
Board: DMS-SE20A1 8GB
Build: SCFW 875cfeb5, SECO-FW d63fdb21, ATF 09c5cc9
Boot:  USB
DRAM:  8 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial@5a060000
Out:   serial@5a060000
Err:   serial@5a060000
Net:   eth0: ethernet@5b040000 [PRIME]
Warning: ethernet@5b050000 (eth1) using random MAC address - c6:1b:bf:cc:e5:6c

, eth1: ethernet@5b050000
Hit any key to stop autoboot: 0

Quoted 8 lines
Quoted 6 lines

---

This is working on 2021.10. Can you give me some hints what I have to do to get it working with current master branch? There are some imx related changes that I don't overlook.

What are the exact errors you see with the master branch?

It's more or less the problem where which definition belongs to nowerdays. I get the following errors on configure and compiling:

+ make imx8qm_dmsse20a1_defconfig arch/../configs/imx8qm_dmsse20a1_defconfig:78:warning: override: reassigning to symbol MII #

# configuration written to .config
#
+ echo 'start the u-boot build'
start the u-boot build
+ make u-boot.bin
scripts/kconfig/conf  --syncconfig Kconfig
.config:279:warning: symbol value '' invalid for SYS_LOAD_ADDR
*
* Restart config...
*
*
* General setup
*
Local version - append to U-Boot release (LOCALVERSION) []
Automatically append version information to the version string (LOCALVERSION_AUTO) [Y/n/?] y
Optimize for size (CC_OPTIMIZE_FOR_SIZE) [Y/n/?] y
Allow compiler to uninline functions marked 'inline' in full U-Boot (OPTIMIZE_INLINING) [N/y/?] n
Allow compiler to uninline functions marked 'inline' in SPL (SPL_OPTIMIZE_INLINING) [N/y/?] n
Enable Link Time Optimizations (LTO) [N/y/?] n
Select U-Boot be run as a bootloader for XEN Virtual Machine (XEN) [N/y/?] n
Select defaults suitable for booting general purpose Linux distributions (DISTRO_DEFAULTS) [N/y/?] n
Add arch, board, vendor and soc variables to default environment (ENV_VARS_UBOOT_CONFIG) [N/y/?] n
Number of DRAM banks (NR_DRAM_BANKS) [4] 4
Enable kernel command line setup (SYS_BOOT_GET_CMDLINE) [N/y/?] n
Enable kernel board information setup (SYS_BOOT_GET_KBD) [N/y/?] n
Enable malloc() pool before relocation (SYS_MALLOC_F) [Y/?] y
  Size of malloc() pool before relocation (SYS_MALLOC_F_LEN) [0x4000] 0x4000
Define memory for Dynamic allocation (SYS_MALLOC_LEN) [0x400000] 0x400000
Size of malloc() pool in SPL (SPL_SYS_MALLOC_F_LEN) [0x4000] 0x4000
64bit physical address support (PHYS_64BIT) [Y/?] y
SPL image used in the combined SPL+U-Boot image (SPL_IMAGE) [spl/u-boot-spl.bin] spl/u-boot-spl.bin
Build target special images (BUILD_TARGET) []
Use a custom location for the U-Boot linker script (SYS_CUSTOM_LDSCRIPT) [N/y/?] n
Address in memory to use by default (SYS_LOAD_ADDR) [] (NEW)

Where is the place to set SYS_LOAD_ADDR to 0x80280000?

Address in memory to use by default (SYS_LOAD_ADDR) [] (NEW) 0x80280000 Define max stack size that can be used by U-Boot (STACK_SIZE) [0x1000000] 0x1000000 Compile API examples (EXAMPLES) [N/y/?] n

  CFG     u-boot.cfg
  GEN     include/autoconf.mk
  GEN     include/autoconf.mk.dep
  CFG     spl/u-boot.cfg
  GEN     spl/include/autoconf.mk
  UPD     include/generated/timestamp_autogenerated.h
./arch/arm/mach-imx/spl_sd.cfg:7:10: fatal error: config.h: Datei oder Verzeichnis nicht gefunden
 #include <config.h>
          ^~~~~~~~~~

compilation terminated.
CC cmd/version.o
In file included from include/common.h:16:0,
from cmd/version.c:7:
include/config.h:2:0: warning: "CONFIG_IMX_CONFIG" redefined
#define CONFIG_IMX_CONFIG board/advantech/imx8qm_dmsse20_a1/imximage.cfg

In file included from ././include/linux/kconfig.h:4:0,

                 from <command-line>:0:

include/generated/autoconf.h:315:0: note: this is the location of the previous definition
#define CONFIG_IMX_CONFIG "arch/arm/mach-imx/spl_sd.cfg"

In file included from include/config.h:5:0,
from include/common.h:16,
from cmd/version.c:7:
include/configs/imx8qm_dmsse20.h:120:0: warning: "CONFIG_SYS_LOAD_ADDR" redefined
#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR

In file included from ././include/linux/kconfig.h:4:0,

                 from <command-line>:0:

include/generated/autoconf.h:128:0: note: this is the location of the previous definition
#define CONFIG_SYS_LOAD_ADDR 0x80280000

In file included from include/config.h:5:0,
from include/common.h:16,
from cmd/version.c:7:
include/configs/imx8qm_dmsse20.h:138:0: warning: "CONFIG_SYS_MMC_ENV_DEV" redefined
#define CONFIG_SYS_MMC_ENV_DEV 2 /* USDHC3 */

In file included from ././include/linux/kconfig.h:4:0,

                 from <command-line>:0:

include/generated/autoconf.h:115:0: note: this is the location of the previous definition
#define CONFIG_SYS_MMC_ENV_DEV 0

In file included from include/config.h:5:0,
from include/common.h:16,
from cmd/version.c:7:
include/configs/imx8qm_dmsse20.h:143:0: warning: "CONFIG_SYS_MALLOC_LEN" redefined
#define CONFIG_SYS_MALLOC_LEN ((CONFIG_ENV_SIZE + (32 * 1024)) * 1024)

In file included from ././include/linux/kconfig.h:4:0,

                 from <command-line>:0:

include/generated/autoconf.h:16:0: note: this is the location of the previous definition
#define CONFIG_SYS_MALLOC_LEN 0x400000

snippet

Best regards,

Oliver

reviewer
#3 lore raw

Hi Oliver,

Quoted 2 lines · Oliver Graute

It's more or less the problem where which definition belongs to nowerdays. I get the following errors on configure and compiling:

In each new release, many config options are moved to Kconfig.

I would suggest you try to compare with another imx8mq targets supported in mainline U-Boot.

Quoted 2 lines

+ make imx8qm_dmsse20a1_defconfig arch/../configs/imx8qm_dmsse20a1_defconfig:78:warning: override: reassigning to symbol MII

You have CONFIG_MII=y twice in your defconfig.

Quoted 1 line

Where is the place to set SYS_LOAD_ADDR to 0x80280000?

Just put:
CONFIG_SYS_LOAD_ADDR=0x80280000 in your defconfig and remove its definition from include/configs/imx8qm_dmsse20.h