Skip to contentSkip to conversation

configs/imx8mmevk: new defconfig

PATCH In review Fabio Estevam 3 participants 4 messages Jan 14, 2022 – Jul 24, 2022 Arm i.MX and Layerscape

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/1 configs/imx8mmevk: new defconfig

Add support for imx8mmevk_defconfig that allows booting kernel, U-Boot and TFA from the upstream repositories.

---
Changes since v1:
- Also use TF-A and U-Boot upstream versions.

 DEVELOPERS                                    |  1 +
 board/freescale/imx8mmevk/genimage.cfg        | 16 ++++++++
 board/freescale/imx8mmevk/readme.txt          |  6 +++
 .../boot/extlinux/extlinux.conf               |  4 ++
 configs/imx8mmevk_defconfig                   | 39 +++++++++++++++++++
 5 files changed, 66 insertions(+)
 create mode 100644 board/freescale/imx8mmevk/genimage.cfg
 create mode 100644 board/freescale/imx8mmevk/rootfs_overlay/boot/extlinux/extlinux.conf
 create mode 100644 configs/imx8mmevk_defconfig
DEVELOPERS +1 -0
index 12777e8d61..e19072a14e 100644
@@ -839,6 +839,7 @@ F:	configs/imx6ullevk_defconfig
 F:	configs/imx6ulpico_defconfig
 F:	configs/imx7d-sdb_defconfig
 F:	configs/imx7dpico_defconfig
+F:	configs/imx8mmevk_defconfig
 F:	configs/imx8mqevk_defconfig
 F:	configs/mx25pdk_defconfig
 F:	configs/mx51evk_defconfig
board/freescale/imx8mmevk/genimage.cfg new file +16 -0
new file mode 100644
index 0000000000..3a83aa1f03
@@ -0,0 +1,16 @@
+image sdcard.img {
+	hdimage {
+	}
+
+	partition imx-boot {
+		in-partition-table = "no"
+		image = "flash.bin"
+		offset = 33k
+	}
+
+	partition rootfs {
+		partition-type = 0x83
+		image = "rootfs.ext4"
+		offset = 8M
+	}
+}
board/freescale/imx8mmevk/readme.txt +6 -0
index 7b69405d30..a8e80a48f9 100644
@@ -10,8 +10,14 @@ Build
 
 First, configure Buildroot for the i.MX8MM EVK board:
 
+If you want to use the NXP kernel:
+
   make freescale_imx8mmevk_defconfig
 
+Or if you want to use a mainline kernel:
+
+  make imx8mmevk_defconfig
+
 Build all components:
 
   make
board/freescale/imx8mmevk/rootfs_overlay/boot/extlinux/extlinux.conf new file +4 -0
new file mode 100644
index 0000000000..0ba2e4cbfc
@@ -0,0 +1,4 @@
+Label imx8mm-evk-buildroot
+  kernel /boot/Image
+  devicetree /boot/imx8mm-evk.dtb
+  append root=/dev/mmcblk1p1 rootwait rw 
configs/imx8mmevk_defconfig new file +39 -0
new file mode 100644
index 0000000000..170b8d273b
@@ -0,0 +1,39 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_OVERLAY="board/freescale/imx8mmevk/rootfs_overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/freescale/imx8mmevk/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.15.14"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="240M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.6"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="IMX_BOOT_UART_BASE=0x30890000"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="flash.bin"
+BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_GENIMAGE=y
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Fabio,

Am Fr., 14. Jan. 2022 um 03:46 Uhr schrieb Fabio Estevam <[email protected]>:

Quoted 37 lines

Add support for imx8mmevk_defconfig that allows booting kernel, U-Boot and TFA from the upstream repositories.

---
Changes since v1:
- Also use TF-A and U-Boot upstream versions.

 DEVELOPERS                                    |  1 +
 board/freescale/imx8mmevk/genimage.cfg        | 16 ++++++++
 board/freescale/imx8mmevk/readme.txt          |  6 +++
 .../boot/extlinux/extlinux.conf               |  4 ++
 configs/imx8mmevk_defconfig                   | 39 +++++++++++++++++++
 5 files changed, 66 insertions(+)
 create mode 100644 board/freescale/imx8mmevk/genimage.cfg
 create mode 100644 board/freescale/imx8mmevk/rootfs_overlay/boot/extlinux/extlinux.conf
 create mode 100644 configs/imx8mmevk_defconfig
DEVELOPERS +1 -0
index 12777e8d61..e19072a14e 100644
@@ -839,6 +839,7 @@ F:  configs/imx6ullevk_defconfig
 F:     configs/imx6ulpico_defconfig
 F:     configs/imx7d-sdb_defconfig
 F:     configs/imx7dpico_defconfig
+F:     configs/imx8mmevk_defconfig
 F:     configs/imx8mqevk_defconfig
 F:     configs/mx25pdk_defconfig
 F:     configs/mx51evk_defconfig
board/freescale/imx8mmevk/genimage.cfg new file +0 -0
new file mode 100644
index 0000000000..3a83aa1f03

board/freescale/imx8mmevk/genimage.cfg line 8

Quoted 8 lines
board/freescale/imx8mmevk/genimage.cfg new file +8 -0
@@ -0,0 +1,16 @@
+image sdcard.img {
+       hdimage {
+       }
+
+       partition imx-boot {
+               in-partition-table = "no"
+               image = "flash.bin"
+               offset = 33k

Giulio pointed out to me that the units should be described with capital letters.

Quoted 33 lines
board/freescale/imx8mmevk/genimage.cfg new file +8 -0
+       }
+
+       partition rootfs {
+               partition-type = 0x83
+               image = "rootfs.ext4"
+               offset = 8M
+       }
+}
board/freescale/imx8mmevk/readme.txt +6 -0
index 7b69405d30..a8e80a48f9 100644
@@ -10,8 +10,14 @@ Build
 
 First, configure Buildroot for the i.MX8MM EVK board:
 
+If you want to use the NXP kernel:
+
   make freescale_imx8mmevk_defconfig
 
+Or if you want to use a mainline kernel:
+
+  make imx8mmevk_defconfig
+
 Build all components:
 
   make
board/freescale/imx8mmevk/rootfs_overlay/boot/extlinux/extlinux.conf new file +0 -0
new file mode 100644
index 0000000000..0ba2e4cbfc

board/freescale/imx8mmevk/rootfs_overlay/boot/extlinux/extlinux.conf line 4

Quoted 4 lines
board/freescale/imx8mmevk/rootfs_overlay/boot/extlinux/extlinux.conf new file +4 -0
@@ -0,0 +1,4 @@
+Label imx8mm-evk-buildroot
+  kernel /boot/Image
+  devicetree /boot/imx8mm-evk.dtb
+  append root=/dev/mmcblk1p1 rootwait rw

I my respin I used:

append root=PARTUUID=%PARTUUID% rootwait rw

The UUID is created in a post-build.sh script and set it in extlinux.conf and genimage.cfg

With that the image would not limited to be located on the SD card.

Quoted 16 lines
configs/imx8mmevk_defconfig new file +10 -0
new file mode 100644
index 0000000000..170b8d273b
@@ -0,0 +1,39 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc1"
+BR2_ROOTFS_OVERLAY="board/freescale/imx8mmevk/rootfs_overlay"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="-c board/freescale/imx8mmevk/genimage.cfg"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="5.15.14"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y

configs/imx8mmevk_defconfig line 20

Quoted 10 lines
configs/imx8mmevk_defconfig new file +10 -0
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/imx8mm-evk"
+BR2_LINUX_KERNEL_INSTALL_TARGET=y
+BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8MM=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="240M"

Do you need 240MB here?

Quoted 22 lines
configs/imx8mmevk_defconfig new file +19 -1
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.6"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mm"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES="IMX_BOOT_UART_BASE=0x30890000"
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION=y
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2022.01"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mm_evk"
+BR2_TARGET_UBOOT_NEEDS_DTC=y
+BR2_TARGET_UBOOT_NEEDS_PYTHON3=y
+BR2_TARGET_UBOOT_NEEDS_PYLIBFDT=y
+BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_IMX_FIRMWARE=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="flash.bin"
+BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_GENIMAGE=y
--

2.25.1

Signature · 5 lines
Heiko
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author reviewer
#2 lore raw

Hi Heiko,

Quoted 7 lines · Heiko Thiery

board/freescale/imx8mmevk/genimage.cfg line 8

Quoted 4 lines
board/freescale/imx8mmevk/genimage.cfg new file +4 -0
+       partition imx-boot {
+               in-partition-table = "no"
+               image = "flash.bin"
+               offset = 33k

Giulio pointed out to me that the units should be described with capital letters.

Thanks for pointing this out. I will change it.

In the long term, we could probably use a common genimage.cfg too.

Quoted 8 lines

I my respin I used:

append root=PARTUUID=%PARTUUID% rootwait rw

The UUID is created in a post-build.sh script and set it in extlinux.conf and genimage.cfg

With that the image would not limited to be located on the SD card.

Good idea. Will change it.

Quoted 3 lines

configs/imx8mmevk_defconfig line 23

Quoted 3 lines
configs/imx8mmevk_defconfig new file +3 -0
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE="v2.6"

On my tests, I noticed that if I build U-Boot 2022.01 + TF-A mainline, then the kernel 5.16 does not boot.

Using TF-A from the NXP BSP allows me to boot 5.16 without issues.

I will try to investigate why this happens with imx8mm-evk, as your board does not show issues.

Thanks
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Fabio Estevam

Hello Fabio,

Quoted 7 lines · On Thu, 13 Jan 2022 23:45:55 -0300 Fabio Estevam <[email protected]> wrote:

Add support for imx8mmevk_defconfig that allows booting kernel, U-Boot and TFA from the upstream repositories.

---
Changes since v1:
- Also use TF-A and U-Boot upstream versions.

You had some comments from Heiko on this patch, and you said you would come back with a newer version, but unless I missed it, I couldn't find a v3.

I'll now mark this v2 as Changes Requested in patchwork, so if you don't submit a v3, we will most likely forget about this topic. But it would be good to have a defconfig for the i.MX8MM EVK.

Thanks a lot!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot