Skip to contentSkip to conversation

arm64: imx: Add support for imx8mp-beacon-kit

PATCH Superseded Adam Ford 2 participants 5 messages Feb 12, 2023 – Feb 13, 2023

Subsystems (3)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/1 arm64: imx: Add support for imx8mp-beacon-kit

Beacon Embedded has an i.MX8M Plus development kit which consists of a SOM + baseboard. The SOM includes Bluetooth, WiFi, QSPI, eMMC, and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet PHY. The device trees are already queued for inclusion in Linux 6.3.

arch/arm/dts/Makefile +1 -0
index d9b719f85d..d812ad4048 100644
@@ -986,6 +986,7 @@ dtb-$(CONFIG_ARCH_IMX8M) += \
 	imx8mn-beacon-kit.dtb \
 	imx8mq-mnt-reform2.dtb \
 	imx8mq-phanbell.dtb \
+	imx8mp-beacon-kit.dtb \
 	imx8mp-dhcom-pdk2.dtb \
 	imx8mp-evk.dtb \
 	imx8mp-icore-mx8mp-edimm2.2.dtb \
arch/arm/dts/imx8mp-beacon-kit-u-boot.dtsi new file +216 -0

216 lines not on this page · raw message

arch/arm/dts/imx8mp-beacon-kit.dts new file +550 -0

550 lines not on this page · raw message

arch/arm/dts/imx8mp-beacon-som.dtsi new file +416 -0

416 lines not on this page · raw message

arch/arm/mach-imx/imx8m/Kconfig +11 -0
index 5e4836b02f..eb45d8d671 100644
@@ -170,6 +170,16 @@ config TARGET_IMX8MN_VENICE
 	select GATEWORKS_SC
 	select MISC
 
+config TARGET_IMX8MP_BEACON
+	bool "imx8mm Beacon Embedded devkit"
+	select BINMAN
+	select IMX8MP
+	select SUPPORT_SPL
+	select IMX8M_LPDDR4
+	select FSL_CAAM
+	select ARCH_MISC_INIT
+	select SPL_CRYPTO if SPL
+
 config TARGET_IMX8MP_DH_DHCOM_PDK2
 	bool "DH electronics DHCOM Premium Developer Kit (2) i.MX8M Plus"
 	select BINMAN
@@ -326,6 +336,7 @@ endchoice
 source "board/advantech/imx8mp_rsb3720a1/Kconfig"
 source "board/beacon/imx8mm/Kconfig"
 source "board/beacon/imx8mn/Kconfig"
+source "board/beacon/imx8mp/Kconfig"
 source "board/bsh/imx8mn_smm_s2/Kconfig"
 source "board/cloos/imx8mm_phg/Kconfig"
 source "board/compulab/imx8mm-cl-iot-gate/Kconfig"
board/beacon/imx8mp/Kconfig new file +16 -0
new file mode 100644
index 0000000000..3c0fca9be8
@@ -0,0 +1,16 @@
+if TARGET_IMX8MP_BEACON
+
+config SYS_BOARD
+	default "imx8mp"
+
+config SYS_VENDOR
+	default "beacon"
+
+config SYS_CONFIG_NAME
+	default "imx8mp_beacon"
+
+config IMX_CONFIG
+	default "board/freescale/imx8mp_evk/imximage-8mp-lpddr4.cfg"
+
+
+endif
board/beacon/imx8mp/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000000..3750551a4a
@@ -0,0 +1,6 @@
+i.MX8MP Beacon EmbeddedWorks Devkit
+M:	Adam Ford <[email protected]>
+S:	Maintained
+F:	board/beacon/imx8mp/
+F:	include/configs/imx8mp_beacon.h
+F:	configs/imx8mp_beacon_defconfig
board/beacon/imx8mp/Makefile new file +13 -0
new file mode 100644
index 0000000000..264720f6d4
@@ -0,0 +1,13 @@
+#
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright 2022 Logic PD, Inc dba Beacon EmbeddedWorks
+#
+
+obj-y += imx8mp_beacon.o
+obj-y += ../../freescale/common/
+
+ifdef CONFIG_SPL_BUILD
+obj-y += spl.o
+obj-$(CONFIG_IMX8M_LPDDR4) += lpddr4_timing.o
+endif
board/beacon/imx8mp/README new file +38 -0
new file mode 100644
index 0000000000..47999bb038
@@ -0,0 +1,38 @@
+U-Boot for the Beacon EmbeddedWorks i.MX8M Nano Devkit
+
+Quick Start
+===========
+- Build the ARM Trusted firmware binary
+- Get ddr firmware
+- Build U-Boot
+- Boot
+
+Get and Build the ARM Trusted firmware
+======================================
+Note: $(srctree) is U-Boot source directory
+
+$ git clone https://source.codeaurora.org/external/imx/imx-atf
+$ git lf-5.15.32-2.0.0
+$ make PLAT=imx8mp bl31 CROSS_COMPILE=aarch64-linux-gnu-
+$ cp build/imx8mn/release/bl31.bin $(srctree)
+
+Get the DDR firmware
+====================
+$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.15.bin
+$ chmod +x firmware-imx-8.15.bin
+$ ./firmware-imx-8.15
+$ cp firmware-imx-8.15/firmware/ddr/synopsys/lpddr4*.bin $(srctree)
+
+Build U-Boot
+============
+$ make imx8mp_beacon_defconfig
+$ make CROSS_COMPILE=aarch64-linux-gnu-
+
+Burn U-Boot to microSD Card
+===========================
+$ sudo dd if=flash.bin of=/dev/sd[x] bs=1024 seek=32
+
+Boot
+====
+Set baseboard DIP switch:
+S17: 1100XXXX
board/beacon/imx8mp/imx8mp_beacon.c new file +63 -0

63 lines not on this page · raw message

board/beacon/imx8mp/imximage-8mp-lpddr4.cfg new file +9 -0
new file mode 100644
index 0000000000..6dedf1724a
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2021 NXP
+ */
+
+
+ROM_VERSION	v2
+BOOT_FROM	sd
+LOADER		u-boot-spl-ddr.bin	0x920000
board/beacon/imx8mp/lpddr4_timing.c new file +1881 -0

1,643 lines not on this page · raw message

board/beacon/imx8mp/spl.c new file +132 -0

132 lines not on this page · raw message

configs/imx8mp_beacon_defconfig new file +171 -0

171 lines not on this page · raw message

include/configs/imx8mp_beacon.h new file +85 -0

85 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.34.1

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 7 lines · Adam Ford

Beacon Embedded has an i.MX8M Plus development kit which consists of a SOM + baseboard. The SOM includes Bluetooth, WiFi, QSPI, eMMC, and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet PHY. The device trees are already queued for inclusion in Linux 6.3.

[snip]

board/beacon/imx8mp/README

Quoted 5 lines
board/beacon/imx8mp/README new file +0 -0
new file mode 100644
index 0000000000..47999bb038

Our rST docs have gotten to the point I think where we should say no to new board README files, this belongs under doc/board/

[snip]

Quoted 42 lines
board/beacon/imx8mp/README new file +42 -0
+#define CFG_EXTRA_ENV_SETTINGS		\
+	"scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+	"kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+	"image=Image\0" \
+	"console=ttymxc1,115200\0" \
+	"fdt_addr_r=0x43000000\0"			\
+	"fdt_addr=0x43000000\0"			\
+	"boot_fdt=try\0" \
+	"boot_fit=no\0" \
+	"fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+	"bootm_size=0x10000000\0" \
+	"mmcdev=1\0" \
+	"mmcpart=1\0" \
+	"optargs=audit=0 video=LVDS-1:d video=LVDS-2:d\0" \
+	"finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
+	"mmcargs=setenv bootargs console=${console} " \
+	" root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
+	"bootscript=echo Running bootscript from mmc ...; " \
+		"source\0" \
+	"loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+	"loadfdt=echo ${fdt_file}; fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \
+	"mmcboot=echo Booting from mmc ...; " \
+		"run finduuid; run mmcargs; " \
+		"if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+			"bootm ${loadaddr}; " \
+		"else " \
+			"if run loadfdt; then " \
+				"booti ${loadaddr} - ${fdt_addr_r}; " \
+			"else " \
+				"echo WARN: Cannot load the DT; " \
+			"fi; " \
+		"fi;\0" \
+	"netargs=setenv bootargs ${jh_clk} console=${console} " \
+		"root=/dev/nfs " \
+		"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+	"netboot=echo Booting from net ...; " \
+		"run netargs;  " \
+		"if test ${ip_dyn} = yes; then " \
+			"setenv get_cmd dhcp; " \
+		"else " \
+			"setenv get_cmd tftp; " \
+		"fi; " \

board/beacon/imx8mp/README

Quoted 10 lines
board/beacon/imx8mp/README new file +10 -0
+		"${get_cmd} ${loadaddr} ${image}; " \
+		"if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+			"bootm ${loadaddr}; " \
+		"else " \
+			"if ${get_cmd} ${fdt_addr_r} ${fdt_file}; then " \
+				"booti ${loadaddr} - ${fdt_addr_r}; " \
+			"else " \
+				"echo WARN: Cannot load the DT; " \
+			"fi; " \
+		"fi;\0"

And this should all be plain text environment (see board/*/*/*.env for examples), and please put it somewhere on your TODO list to migrate other platforms README and environments, thanks!

Signature · 1 line
Tom
author
#2 lore raw
Quoted 11 lines · Tom Rini
Quoted 7 lines · Adam Ford

Beacon Embedded has an i.MX8M Plus development kit which consists of a SOM + baseboard. The SOM includes Bluetooth, WiFi, QSPI, eMMC, and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet PHY. The device trees are already queued for inclusion in Linux 6.3.

[snip]

Quoted 8 lines

board/beacon/imx8mp/README

Quoted 5 lines
board/beacon/imx8mp/README new file +0 -0
new file mode 100644
index 0000000000..47999bb038

Our rST docs have gotten to the point I think where we should say no to new board README files, this belongs under doc/board/

OK. I'll work on that.

Quoted 55 lines

[snip]

Quoted 42 lines
board/beacon/imx8mp/README new file +42 -0
+#define CFG_EXTRA_ENV_SETTINGS               \
+     "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+     "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+     "image=Image\0" \
+     "console=ttymxc1,115200\0" \
+     "fdt_addr_r=0x43000000\0"                       \
+     "fdt_addr=0x43000000\0"                 \
+     "boot_fdt=try\0" \
+     "boot_fit=no\0" \
+     "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+     "bootm_size=0x10000000\0" \
+     "mmcdev=1\0" \
+     "mmcpart=1\0" \
+     "optargs=audit=0 video=LVDS-1:d video=LVDS-2:d\0" \
+     "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
+     "mmcargs=setenv bootargs console=${console} " \
+     " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
+     "bootscript=echo Running bootscript from mmc ...; " \
+             "source\0" \
+     "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+     "loadfdt=echo ${fdt_file}; fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \
+     "mmcboot=echo Booting from mmc ...; " \
+             "run finduuid; run mmcargs; " \
+             "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+                     "bootm ${loadaddr}; " \
+             "else " \
+                     "if run loadfdt; then " \
+                             "booti ${loadaddr} - ${fdt_addr_r}; " \
+                     "else " \
+                             "echo WARN: Cannot load the DT; " \
+                     "fi; " \
+             "fi;\0" \
+     "netargs=setenv bootargs ${jh_clk} console=${console} " \
+             "root=/dev/nfs " \
+             "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+     "netboot=echo Booting from net ...; " \
+             "run netargs;  " \
+             "if test ${ip_dyn} = yes; then " \
+                     "setenv get_cmd dhcp; " \
+             "else " \
+                     "setenv get_cmd tftp; " \
+             "fi; " \

board/beacon/imx8mp/README

Quoted 10 lines
board/beacon/imx8mp/README new file +10 -0
+             "${get_cmd} ${loadaddr} ${image}; " \
+             "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+                     "bootm ${loadaddr}; " \
+             "else " \
+                     "if ${get_cmd} ${fdt_addr_r} ${fdt_file}; then " \
+                             "booti ${loadaddr} - ${fdt_addr_r}; " \
+                     "else " \
+                             "echo WARN: Cannot load the DT; " \
+                     "fi; " \
+             "fi;\0"
Quoted 1 line

And this should all be plain text environment (see board/*/*/*.env for

I didn't even know this was a thing, but after reviewing what others are doing, I like this much better.

Quoted 2 lines

examples), and please put it somewhere on your TODO list to migrate other platforms README and environments, thanks!

Is there a deadline?

thanks

adam

Quoted 3 lines

--
Tom

#3 lore raw
Quoted 78 lines · Adam Ford
Quoted 11 lines · Tom Rini
Quoted 7 lines · Adam Ford

Beacon Embedded has an i.MX8M Plus development kit which consists of a SOM + baseboard. The SOM includes Bluetooth, WiFi, QSPI, eMMC, and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet PHY. The device trees are already queued for inclusion in Linux 6.3.

[snip]

Quoted 8 lines

board/beacon/imx8mp/README

Quoted 5 lines
board/beacon/imx8mp/README new file +0 -0
new file mode 100644
index 0000000000..47999bb038

Our rST docs have gotten to the point I think where we should say no to new board README files, this belongs under doc/board/

OK. I'll work on that.

Quoted 55 lines

[snip]

Quoted 52 lines
board/beacon/imx8mp/README new file +52 -0
+#define CFG_EXTRA_ENV_SETTINGS               \
+     "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+     "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+     "image=Image\0" \
+     "console=ttymxc1,115200\0" \
+     "fdt_addr_r=0x43000000\0"                       \
+     "fdt_addr=0x43000000\0"                 \
+     "boot_fdt=try\0" \
+     "boot_fit=no\0" \
+     "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+     "bootm_size=0x10000000\0" \
+     "mmcdev=1\0" \
+     "mmcpart=1\0" \
+     "optargs=audit=0 video=LVDS-1:d video=LVDS-2:d\0" \
+     "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
+     "mmcargs=setenv bootargs console=${console} " \
+     " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
+     "bootscript=echo Running bootscript from mmc ...; " \
+             "source\0" \
+     "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+     "loadfdt=echo ${fdt_file}; fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \
+     "mmcboot=echo Booting from mmc ...; " \
+             "run finduuid; run mmcargs; " \
+             "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+                     "bootm ${loadaddr}; " \
+             "else " \
+                     "if run loadfdt; then " \
+                             "booti ${loadaddr} - ${fdt_addr_r}; " \
+                     "else " \
+                             "echo WARN: Cannot load the DT; " \
+                     "fi; " \
+             "fi;\0" \
+     "netargs=setenv bootargs ${jh_clk} console=${console} " \
+             "root=/dev/nfs " \
+             "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+     "netboot=echo Booting from net ...; " \
+             "run netargs;  " \
+             "if test ${ip_dyn} = yes; then " \
+                     "setenv get_cmd dhcp; " \
+             "else " \
+                     "setenv get_cmd tftp; " \
+             "fi; " \
+             "${get_cmd} ${loadaddr} ${image}; " \
+             "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+                     "bootm ${loadaddr}; " \
+             "else " \
+                     "if ${get_cmd} ${fdt_addr_r} ${fdt_file}; then " \
+                             "booti ${loadaddr} - ${fdt_addr_r}; " \
+                     "else " \
+                             "echo WARN: Cannot load the DT; " \
+                     "fi; " \
+             "fi;\0"
Quoted 4 lines
Quoted 1 line

And this should all be plain text environment (see board/*/*/*.env for

I didn't even know this was a thing, but after reviewing what others are doing, I like this much better.

That's good to hear.

Quoted 4 lines
Quoted 2 lines

examples), and please put it somewhere on your TODO list to migrate other platforms README and environments, thanks!

Is there a deadline?

Neither has a firm deadline at this point, thanks!

Signature · 1 line
Tom
author
#4 lore raw
Quoted 85 lines · Tom Rini
Quoted 78 lines · Adam Ford
Quoted 11 lines · Tom Rini
Quoted 7 lines · Adam Ford

Beacon Embedded has an i.MX8M Plus development kit which consists of a SOM + baseboard. The SOM includes Bluetooth, WiFi, QSPI, eMMC, and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet PHY. The device trees are already queued for inclusion in Linux 6.3.

[snip]

Quoted 8 lines

board/beacon/imx8mp/README

Quoted 5 lines
board/beacon/imx8mp/README new file +0 -0
new file mode 100644
index 0000000000..47999bb038

Our rST docs have gotten to the point I think where we should say no to new board README files, this belongs under doc/board/

OK. I'll work on that.

Quoted 55 lines

[snip]

Quoted 52 lines
board/beacon/imx8mp/README new file +52 -0
+#define CFG_EXTRA_ENV_SETTINGS               \
+     "scriptaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+     "kernel_addr_r=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+     "image=Image\0" \
+     "console=ttymxc1,115200\0" \
+     "fdt_addr_r=0x43000000\0"                       \
+     "fdt_addr=0x43000000\0"                 \
+     "boot_fdt=try\0" \
+     "boot_fit=no\0" \
+     "fdt_file=" CONFIG_DEFAULT_FDT_FILE "\0" \
+     "bootm_size=0x10000000\0" \
+     "mmcdev=1\0" \
+     "mmcpart=1\0" \
+     "optargs=audit=0 video=LVDS-1:d video=LVDS-2:d\0" \
+     "finduuid=part uuid mmc ${mmcdev}:2 uuid\0" \
+     "mmcargs=setenv bootargs console=${console} " \
+     " root=PARTUUID=${uuid} rootwait rw ${mtdparts} ${optargs}\0" \
+     "bootscript=echo Running bootscript from mmc ...; " \
+             "source\0" \
+     "loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}\0" \
+     "loadfdt=echo ${fdt_file}; fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdt_file}\0" \
+     "mmcboot=echo Booting from mmc ...; " \
+             "run finduuid; run mmcargs; " \
+             "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+                     "bootm ${loadaddr}; " \
+             "else " \
+                     "if run loadfdt; then " \
+                             "booti ${loadaddr} - ${fdt_addr_r}; " \
+                     "else " \
+                             "echo WARN: Cannot load the DT; " \
+                     "fi; " \
+             "fi;\0" \
+     "netargs=setenv bootargs ${jh_clk} console=${console} " \
+             "root=/dev/nfs " \
+             "ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
+     "netboot=echo Booting from net ...; " \
+             "run netargs;  " \
+             "if test ${ip_dyn} = yes; then " \
+                     "setenv get_cmd dhcp; " \
+             "else " \
+                     "setenv get_cmd tftp; " \
+             "fi; " \
+             "${get_cmd} ${loadaddr} ${image}; " \
+             "if test ${boot_fit} = yes || test ${boot_fit} = try; then " \
+                     "bootm ${loadaddr}; " \
+             "else " \
+                     "if ${get_cmd} ${fdt_addr_r} ${fdt_file}; then " \
+                             "booti ${loadaddr} - ${fdt_addr_r}; " \
+                     "else " \
+                             "echo WARN: Cannot load the DT; " \
+                     "fi; " \
+             "fi;\0"
Quoted 4 lines
Quoted 1 line

And this should all be plain text environment (see board/*/*/*.env for

I didn't even know this was a thing, but after reviewing what others are doing, I like this much better.

Quoted 8 lines

That's good to hear.

Quoted 4 lines
Quoted 2 lines

examples), and please put it somewhere on your TODO list to migrate other platforms README and environments, thanks!

Is there a deadline?

Neither has a firm deadline at this point, thanks!

Tom,

I pushed a V2 and CC'd you. If you're OK with both the env file and the rst file for this board, I'll do the same thing for the other Beacon and LogicPD boards. I just don't want to do the work until I know my first attempt at these new files is acceptable.

Thanks,

adam

Quoted 3 lines

--
Tom