Skip to contentSkip to conversation

Initial support for NXP iMX8 (imx8mq-evk)

PATCH Superseded Erik Larsson 6 participants 16 messages Feb 22, 2018 – Feb 27, 2018 Arm i.MX and Layerscape

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v2 cover Initial support for NXP iMX8 (imx8mq-evk)

This series provides initial support for NXP iMX8 (imx8mq-evk).

This series of patches are tested against NXP imx8mq-evk. It only handles basic support for iIMX8M, currently no support for GPU, VPU and other HW features. This series makes it possible to build a minimal system for imx8mq-evk.

Changes since v1
================
- Removed new imx-atf package, use boot/arm-trusted-firmware.
- Move imx-mkimage from package/freescale-imx to package.
- Add upstream URL for imx-mkimage in Config.in.host.
- Fix install command syntax for imx-mkimage package.
- Use Makefile in imx-mkimage to build imx-boot-imx8mqevk-sd.bin instead of doing that in the post-script.sh
- Split third commit into two, one for firmware-img package and one for iMX8 board.

Erik Larsson (3):
imx-mkimage: new package
firmware-imx: add support for iMX8M firmware add support iMX8MQ-evk board

 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++
 package/Config.in.host                             |   1 +
 package/freescale-imx/Config.in                    |   4 +-
 package/freescale-imx/firmware-imx/Config.in       |   2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk |   8 +
 .../imx-mkimage/0001-remove-git-build-info.patch   |  28 +
 package/imx-mkimage/Config.in.host                 |  11 +
 package/imx-mkimage/imx-mkimage.hash               |   3 +
 package/imx-mkimage/imx-mkimage.mk                 |  41 ++
 12 files changed, 805 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 board/freescale/imx8mqevk/linux-4.9.config
 create mode 100644 configs/freescale_imx8mqevk_defconfig
 create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch
 create mode 100644 package/imx-mkimage/Config.in.host
 create mode 100644 package/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/imx-mkimage/imx-mkimage.mk
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/3 imx-mkimage: new package

This package add support for imx-mkimage for iMX8M. Currently the only hardware it's tested for.

---
 package/Config.in.host                             |  1 +
 .../imx-mkimage/0001-remove-git-build-info.patch   | 28 +++++++++++++++
 package/imx-mkimage/Config.in.host                 | 11 ++++++
 package/imx-mkimage/imx-mkimage.hash               |  3 ++
 package/imx-mkimage/imx-mkimage.mk                 | 41 ++++++++++++++++++++++
 5 files changed, 84 insertions(+)
 create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch
 create mode 100644 package/imx-mkimage/Config.in.host
 create mode 100644 package/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/imx-mkimage/imx-mkimage.mk
package/Config.in.host +1 -0
index 199a8e9..06ef5cb 100644
@@ -24,6 +24,7 @@ menu "Host utilities"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/google-breakpad/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
+	source "package/imx-mkimage/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
package/imx-mkimage/0001-remove-git-build-info.patch new file +28 -0
new file mode 100644
index 0000000..e472133
@@ -0,0 +1,28 @@
+From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Thu, 22 Feb 2018 09:56:53 +0100
+Subject: [PATCH] Remove buildinformation step.
+
+Signed-off-by: Erik Larsson <[email protected]>
+---
+ Makefile | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4b449ad..4042a39 100644
+--- a/Makefile
++++ b/Makefile
+@@ -33,9 +33,7 @@ $(MKIMG): buildinfo $(SRCS)
+ bin: $(MKIMG)
+ 
+ buildinfo:
+-	@echo -n '#define MKIMAGE_COMMIT 0x' > src/build_info.h
+-	@git rev-parse --short=8 HEAD >> src/build_info.h
+-	@echo '' >> src/build_info.h
++	@echo "#define MKIMAGE_COMMIT 0x0000" > src/build_info.h
+ 
+ help:
+ 	@echo $(CURR_DIR)
+-- 
+2.7.4
+
package/imx-mkimage/Config.in.host new file +11 -0
new file mode 100644
index 0000000..411f67c
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_HOST_IMX_MKIMAGE
+	bool "host imx-mkimage"
+	select BR2_PACKAGE_HOST_UBOOT_TOOLS
+	select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	depends on BR2_LINUX_KERNEL
+	depends on BR2_TARGET_UBOOT
+	help
+	  imx-mkimage is used to combine input images and generate
+	  final boot image with appropriate IVT set.
+
+	  https://source.codeaurora.org/external/imx/imx-mkimage
package/imx-mkimage/imx-mkimage.hash new file +3 -0
new file mode 100644
index 0000000..08d31ce
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c  imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz
+sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c  iMX8dv/COPYING
package/imx-mkimage/imx-mkimage.mk new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v2 1/3 imx-mkimage: new package

Erik,

Quoted 4 lines · Erik Larsson

This package add support for imx-mkimage for iMX8M. Currently the only hardware it's tested for.

Still no Crille nor Marcus? :-)
Same for the all patches in this set.

Quoted 90 lines
---
 package/Config.in.host                             |  1 +
 .../imx-mkimage/0001-remove-git-build-info.patch   | 28 +++++++++++++++
 package/imx-mkimage/Config.in.host                 | 11 ++++++
 package/imx-mkimage/imx-mkimage.hash               |  3 ++
 package/imx-mkimage/imx-mkimage.mk                 | 41 ++++++++++++++++++++++
 5 files changed, 84 insertions(+)
 create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch
 create mode 100644 package/imx-mkimage/Config.in.host
 create mode 100644 package/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/imx-mkimage/imx-mkimage.mk
package/Config.in.host +1 -0
index 199a8e9..06ef5cb 100644
@@ -24,6 +24,7 @@ menu "Host utilities"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/google-breakpad/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
+	source "package/imx-mkimage/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
package/imx-mkimage/0001-remove-git-build-info.patch new file +28 -0
new file mode 100644
index 0000000..e472133
@@ -0,0 +1,28 @@
+From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Thu, 22 Feb 2018 09:56:53 +0100
+Subject: [PATCH] Remove buildinformation step.
+
+Signed-off-by: Erik Larsson <[email protected]>
+---
+ Makefile | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 4b449ad..4042a39 100644
+--- a/Makefile
++++ b/Makefile
+@@ -33,9 +33,7 @@ $(MKIMG): buildinfo $(SRCS)
+ bin: $(MKIMG)
+ 
+ buildinfo:
+-	@echo -n '#define MKIMAGE_COMMIT 0x' > src/build_info.h
+-	@git rev-parse --short=8 HEAD >> src/build_info.h
+-	@echo '' >> src/build_info.h
++	@echo "#define MKIMAGE_COMMIT 0x0000" > src/build_info.h
+ 
+ help:
+ 	@echo $(CURR_DIR)
+-- 
+2.7.4
+
package/imx-mkimage/Config.in.host new file +11 -0
new file mode 100644
index 0000000..411f67c
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_HOST_IMX_MKIMAGE
+	bool "host imx-mkimage"
+	select BR2_PACKAGE_HOST_UBOOT_TOOLS
+	select BR2_PACKAGE_HOST_UBOOT_TOOLS_FIT_SUPPORT
+	depends on BR2_LINUX_KERNEL
+	depends on BR2_TARGET_UBOOT
+	help
+	  imx-mkimage is used to combine input images and generate
+	  final boot image with appropriate IVT set.
+
+	  https://source.codeaurora.org/external/imx/imx-mkimage
package/imx-mkimage/imx-mkimage.hash new file +3 -0
new file mode 100644
index 0000000..08d31ce
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c  imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz
+sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c  iMX8dv/COPYING
package/imx-mkimage/imx-mkimage.mk new file +0 -0
new file mode 100644
index 0000000..e3c62bb

package/imx-mkimage/imx-mkimage.mk line 10

Quoted 10 lines
package/imx-mkimage/imx-mkimage.mk new file +10 -0
@@ -0,0 +1,41 @@
+################################################################################
+#
+# imx-mkimage
+#
+################################################################################
+
+IMX_MKIMAGE_VERSION = imx_4.9.51_imx8m_beta
+IMX_MKIMAGE_SITE = https://source.codeaurora.org/external/imx/imx-mkimage
+IMX_MKIMAGE_SITE_METHOD = git
+IMX_MKIMAGE_LICENSE = GPL-2.0

The license is GPL-2.0+ as pointed out in v1.

Best regards
Marcus Folkesson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180222/8dab871e/attachment.asc>

#3 lore raw

PATCH v2 1/3 imx-mkimage: new package

In reply to Erik Larsson

Hi Erik,

Quoted 41 lines · Erik Larsson

This package add support for imx-mkimage for iMX8M. Currently the only hardware it's tested for.

---
 package/Config.in.host                             |  1 +
 .../imx-mkimage/0001-remove-git-build-info.patch   | 28 +++++++++++++++
 package/imx-mkimage/Config.in.host                 | 11 ++++++
 package/imx-mkimage/imx-mkimage.hash               |  3 ++
 package/imx-mkimage/imx-mkimage.mk                 | 41 ++++++++++++++++++++++
 5 files changed, 84 insertions(+)
 create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch
 create mode 100644 package/imx-mkimage/Config.in.host
 create mode 100644 package/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/imx-mkimage/imx-mkimage.mk
package/Config.in.host +1 -0
index 199a8e9..06ef5cb 100644
@@ -24,6 +24,7 @@ menu "Host utilities"
 	source "package/go-bootstrap/Config.in.host"
 	source "package/google-breakpad/Config.in.host"
 	source "package/gptfdisk/Config.in.host"
+	source "package/imx-mkimage/Config.in.host"
 	source "package/imx-usb-loader/Config.in.host"
 	source "package/jq/Config.in.host"
 	source "package/jsmin/Config.in.host"
package/imx-mkimage/0001-remove-git-build-info.patch new file +7 -0
new file mode 100644
index 0000000..e472133
@@ -0,0 +1,28 @@
+From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Thu, 22 Feb 2018 09:56:53 +0100
+Subject: [PATCH] Remove buildinformation step.
+
+Signed-off-by: Erik Larsson <[email protected]>
+---

[snip]

Quoted 24 lines
package/imx-mkimage/imx-mkimage.mk new file +18 -0
new file mode 100644
index 0000000..e3c62bb
@@ -0,0 +1,41 @@
+################################################################################
+#
+# imx-mkimage
+#
+################################################################################
+
+IMX_MKIMAGE_VERSION = imx_4.9.51_imx8m_beta
+IMX_MKIMAGE_SITE = https://source.codeaurora.org/external/imx/imx-mkimage
+IMX_MKIMAGE_SITE_METHOD = git
+IMX_MKIMAGE_LICENSE = GPL-2.0
+IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING
+HOST_IMX_MKIMAGE_DEPENDENCIES = uboot linux firmware-imx arm-trusted-firmware
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+	# These files are generated by firmware-imx, uboot and arm-trusted-firmware
+	# Copy the files into the iMX8M folder to make building of this package simple
+	# The NXP engineers has constructed to buildprocess with a bunch of hardcoded
+	# file names and pathes.

package/imx-mkimage/imx-mkimage.mk line 28

Quoted 10 lines
package/imx-mkimage/imx-mkimage.mk new file +10 -0
+
+	# Currently this only supports iMX8M. When more hardware is available
+	# this needs to be selectable based on iMX8-version (iMX8M,iMXQ etc).
+	cp $(BINARIES_DIR)/u-boot-spl.bin $(@D)/iMX8M
+	cp $(BINARIES_DIR)/lpddr4_pmu_train* $(@D)/iMX8M
+	cp $(BINARIES_DIR)/fsl-imx8mq-evk.dtb $(@D)/iMX8M
+	cp $(BINARIES_DIR)/bl31.bin $(@D)/iMX8M
+
+	# We must rename this file because mkimage_fit_atf.sh has hardcoded names
+	cp ${BINARIES_DIR}/u-boot.bin $(@D)/iMX8M/u-boot-nodtb.bin

While testing here again I have seen that NXP provided U-Boot generates an image named u-boot-nodtb.bin in top level directory, which is not the same as u-boot.bin. So you might want to set BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME to u-boot-nodtb.bin, and copy that file directly, without rename.

baruch

Quoted 13 lines
package/imx-mkimage/imx-mkimage.mk new file +13 -0
+
+	# In soc.mk it's hardcoded that the mkimage tool is named mkimage_uboot
+	# and that it's located in the iMX8M folder.
+	cp $(HOST_DIR)/bin/mkimage $(@D)/iMX8M/mkimage_uboot
+
+	$(MAKE) -C $(@D) SOC=iMX8M flash_spl_uboot
+endef
+
+define HOST_IMX_MKIMAGE_INSTALL_CMDS
+	$(INSTALL) -D -m 755 $(@D)/iMX8M/flash.bin $(BINARIES_DIR)/imx-boot-imx8mqevk-sd.bin
+endef
+
+$(eval $(host-generic-package))
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH v2 1/3 imx-mkimage: new package

Hi Baruch,

2018-02-25 9:43 GMT+01:00 Baruch Siach <[email protected]>:

Quoted 78 lines

Hi Erik,

Quoted 41 lines · Erik Larsson

This package add support for imx-mkimage for iMX8M. Currently the only hardware it's tested for.

---
 package/Config.in.host                             |  1 +
 .../imx-mkimage/0001-remove-git-build-info.patch   | 28 +++++++++++++++
 package/imx-mkimage/Config.in.host                 | 11 ++++++
 package/imx-mkimage/imx-mkimage.hash               |  3 ++
 package/imx-mkimage/imx-mkimage.mk                 | 41 ++++++++++++++++++++++
 5 files changed, 84 insertions(+)
 create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch
 create mode 100644 package/imx-mkimage/Config.in.host
 create mode 100644 package/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/imx-mkimage/imx-mkimage.mk
package/Config.in.host +1 -0
index 199a8e9..06ef5cb 100644
@@ -24,6 +24,7 @@ menu "Host utilities"
      source "package/go-bootstrap/Config.in.host"
      source "package/google-breakpad/Config.in.host"
      source "package/gptfdisk/Config.in.host"
+     source "package/imx-mkimage/Config.in.host"
      source "package/imx-usb-loader/Config.in.host"
      source "package/jq/Config.in.host"
      source "package/jsmin/Config.in.host"
package/imx-mkimage/0001-remove-git-build-info.patch new file +7 -0
new file mode 100644
index 0000000..e472133
@@ -0,0 +1,28 @@
+From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <[email protected]>
+Date: Thu, 22 Feb 2018 09:56:53 +0100
+Subject: [PATCH] Remove buildinformation step.
+
+Signed-off-by: Erik Larsson <[email protected]>
+---

[snip]

Quoted 31 lines
package/imx-mkimage/imx-mkimage.mk new file +25 -0
new file mode 100644
index 0000000..e3c62bb
@@ -0,0 +1,41 @@
+################################################################################
+#
+# imx-mkimage
+#
+################################################################################
+
+IMX_MKIMAGE_VERSION = imx_4.9.51_imx8m_beta
+IMX_MKIMAGE_SITE = https://source.codeaurora.org/external/imx/imx-mkimage
+IMX_MKIMAGE_SITE_METHOD = git
+IMX_MKIMAGE_LICENSE = GPL-2.0
+IMX_MKIMAGE_LICENSE_FILES = iMX8dv/COPYING
+HOST_IMX_MKIMAGE_DEPENDENCIES = uboot linux firmware-imx arm-trusted-firmware
+
+define HOST_IMX_MKIMAGE_BUILD_CMDS
+     # These files are generated by firmware-imx, uboot and arm-trusted-firmware
+     # Copy the files into the iMX8M folder to make building of this package simple
+     # The NXP engineers has constructed to buildprocess with a bunch of hardcoded
+     # file names and pathes.
+
+     # Currently this only supports iMX8M. When more hardware is available
+     # this needs to be selectable based on iMX8-version (iMX8M,iMXQ etc).
+     cp $(BINARIES_DIR)/u-boot-spl.bin $(@D)/iMX8M
+     cp $(BINARIES_DIR)/lpddr4_pmu_train* $(@D)/iMX8M
+     cp $(BINARIES_DIR)/fsl-imx8mq-evk.dtb $(@D)/iMX8M
+     cp $(BINARIES_DIR)/bl31.bin $(@D)/iMX8M
Quoted 8 lines

package/imx-mkimage/imx-mkimage.mk line 28

Quoted 3 lines
package/imx-mkimage/imx-mkimage.mk new file +3 -0
+
+     # We must rename this file because mkimage_fit_atf.sh has hardcoded names
+     cp ${BINARIES_DIR}/u-boot.bin $(@D)/iMX8M/u-boot-nodtb.bin

While testing here again I have seen that NXP provided U-Boot generates an image named u-boot-nodtb.bin in top level directory, which is not the same as u-boot.bin. So you might want to set BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME to u-boot-nodtb.bin, and copy that file directly, without rename.

Thank you! I'll test that,

Quoted 13 lines

baruch

Quoted 10 lines
package/imx-mkimage/imx-mkimage.mk new file +10 -0
+
+     # In soc.mk it's hardcoded that the mkimage tool is named mkimage_uboot
+     # and that it's located in the iMX8M folder.
+     cp $(HOST_DIR)/bin/mkimage $(@D)/iMX8M/mkimage_uboot
+
+     $(MAKE) -C $(@D) SOC=iMX8M flash_spl_uboot
+endef
+
+define HOST_IMX_MKIMAGE_INSTALL_CMDS
+     $(INSTALL) -D -m 755 $(@D)/iMX8M/flash.bin $(BINARIES_DIR)/imx-boot-imx8mqevk-sd.bin
Quoted 8 lines

package/imx-mkimage/imx-mkimage.mk line 41

Quoted 3 lines
package/imx-mkimage/imx-mkimage.mk new file +3 -0
+endef
+
+$(eval $(host-generic-package))

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

/Erik

#5 lore raw

PATCH v2 2/3 firmware-imx: add support for iMX8M firmware

In reply to Erik Larsson
---
 package/freescale-imx/Config.in                    | 4 +++-
 package/freescale-imx/firmware-imx/Config.in       | 2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk | 8 ++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)
package/freescale-imx/Config.in +3 -1
index b5e5ab2..b5df642 100644
@@ -1,6 +1,6 @@
 menuconfig BR2_PACKAGE_FREESCALE_IMX
 	bool "Freescale i.MX libraries"
-	depends on BR2_arm
+	depends on BR2_arm || BR2_aarch64
 	help
 	  Those packages provide hardware acceleration for GPU or VPU,
 	  hardware optimization or some hardware tools for Freescale
@@ -40,6 +40,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
 	bool "imx7d/imx7ulp"
 
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	bool "imx8m"
 endchoice
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
package/freescale-imx/firmware-imx/Config.in +1 -1
index fca280a..56d5b80 100644
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_FIRMWARE_IMX
 	bool "firmware-imx"
-	depends on BR2_arm # Only relevant for i.MX
+	depends on BR2_arm || BR2_aarch64 # Only relevant for i.MX
 	help
 	  Firmware blobs for the Freescale i.MX SoCs.
 
package/freescale-imx/firmware-imx/firmware-imx.mk +8 -0
index 630afca..f03daf2 100644
@@ -18,6 +18,13 @@ define FIRMWARE_IMX_EXTRACT_CMDS
 	$(call FREESCALE_IMX_EXTRACT_HELPER,$(DL_DIR)/$(FIRMWARE_IMX_SOURCE))
 endef
 
+ifeq ($(BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M),y)
+FIRMWARE_IMX_INSTALL_IMAGES = YES
+define FIRMWARE_IMX_INSTALL_IMAGES_CMDS
+	cp $(@D)/firmware/ddr/synopsys/lpddr4_pmu_train_*.bin $(BINARIES_DIR)
+	cp $(@D)/firmware/hdmi/cadence/signed_hdmi_imx8m.bin $(BINARIES_DIR)
+endef
+else
 define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/lib/firmware/imx
 	for blobdir in $(FIRMWARE_IMX_BLOBS); do \
@@ -27,5 +34,6 @@ define FIRMWARE_IMX_INSTALL_TARGET_CMDS
 	mv $(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw.nonrestricted \
 		$(TARGET_DIR)/lib/firmware/imx/epdc/epdc_ED060XH2C1.fw
 endef
+endif
 
 $(eval $(generic-package))
Signature · 1 line
2.7.4
#6 lore raw

PATCH v2 2/3 firmware-imx: add support for iMX8M firmware

Hi Erik,

Quoted 20 lines · Erik Larsson
---
 package/freescale-imx/Config.in                    | 4 +++-
 package/freescale-imx/firmware-imx/Config.in       | 2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk | 8 ++++++++
 3 files changed, 12 insertions(+), 2 deletions(-)
package/freescale-imx/Config.in +1 -1
index b5e5ab2..b5df642 100644
@@ -1,6 +1,6 @@
 menuconfig BR2_PACKAGE_FREESCALE_IMX
 	bool "Freescale i.MX libraries"
-	depends on BR2_arm
+	depends on BR2_arm || BR2_aarch64
 	help
 	  Those packages provide hardware acceleration for GPU or VPU,
 	  hardware optimization or some hardware tools for Freescale

package/freescale-imx/Config.in config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL · line 47

Quoted 8 lines
package/freescale-imx/Config.in +2 -0
@@ -40,6 +40,8 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
 	bool "imx7d/imx7ulp"
 
+config BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
+	bool "imx8m"
 endchoice
 
 config BR2_PACKAGE_FREESCALE_IMX_PLATFORM

I actually this should be a separate patch that just adds i.MX8M to the list of supported devices.

Also it is missing BR2_PACKAGE_FREESCALE_IMX_PLATFORM assignment to "IMX8" in order to match Yocto platform naming.

Finally, as an optional step we could hide packages that don't apply to that architecture such as imx-lib, but that can come later.

Regards,
Gary

#7 lore raw

PATCH v2 3/3 add support iMX8MQ-evk board

In reply to Erik Larsson
---
 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++
 4 files changed, 709 insertions(+), 3 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 board/freescale/imx8mqevk/linux-4.9.config
 create mode 100644 configs/freescale_imx8mqevk_defconfig
board/freescale/common/imx/genimage.cfg.template_imx8 new file +40 -0
new file mode 100644
index 0000000..138beff
@@ -0,0 +1,40 @@
+# Minimal SD card image for the Freescale boards Template for SPL Boot
+#
+# We mimic the .sdcard Freescale's image format:
+# * the SD card must have 33 kB free space at the beginning,
+# * U-Boot is integrated into imx-boot-imx8mqevk-sd.bin and is dumped as is,
+# * a FAT partition at offset 64MB is containing Image and DTB files
+# * a single root filesystem partition is required (ext2, ext3 or ext4)
+#
+
+image boot.vfat {
+  vfat {
+    files = {
+      %FILES%
+    }
+  }
+  size = 64M
+}
+
+image sdcard.img {
+  hdimage {
+  }
+
+  partition imx-boot {
+    in-partition-table = "no"
+    image = "imx-boot-imx8mqevk-sd.bin"
+    offset = 33K
+  }
+
+  partition boot {
+    partition-type = 0xC
+    bootable = "true"
+    image = "boot.vfat"
+    offset = 8M
+  }
+
+  partition rootfs {
+    partition-type = 0x83
+    image = "rootfs.ext2"
+  }
+}
board/freescale/common/imx/post-image.sh +7 -3
index b239743..264c8a4 100755
@@ -7,10 +7,10 @@
 #
 dtb_list()
 {
-	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
+	local DTB_LIST="$(sed -n 's/^BR2_LINUX_KERNEL_INTREE_DTS_NAME="\([\/a-z0-9 \-]*\)"$/\1/p' ${BR2_CONFIG})"
 
 	for dt in $DTB_LIST; do
-		echo -n "\"$dt.dtb\", "
+		echo -n "\"`basename $dt`.dtb\", "
 	done
 }
 
@@ -23,6 +23,8 @@ linux_image()
 {
 	if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
 		echo "\"uImage\""
+	elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
+		echo "\"Image\""
 	else
 		echo "\"zImage\""
 	fi
@@ -30,7 +32,9 @@ linux_image()
 
 genimage_type()
 {
-	if grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
+	if grep -Eq "^BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y$" ${BR2_CONFIG}; then
+		echo "genimage.cfg.template_imx8"
+	elif grep -Eq "^BR2_TARGET_UBOOT_SPL=y$" ${BR2_CONFIG}; then
 		echo "genimage.cfg.template_spl"
 	else
 		echo "genimage.cfg.template"
board/freescale/imx8mqevk/linux-4.9.config new file +625 -0

625 lines not on this page · raw message

configs/freescale_imx8mqevk_defconfig new file +37 -0
new file mode 100644
index 0000000..bc12e7c
@@ -0,0 +1,37 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/linux-imx"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="imx_4.9.51_imx8m_beta"
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/freescale/imx8mqevk/linux-4.9.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-imx8mq-evk"
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/imx-atf"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="imx_4.9.51_imx8m_beta"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mq"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="imx_v2017.03_4.9.51_imx8m_beta"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mq_evk"
+BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_IMX_MKIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y
Signature · 1 line
2.7.4
#8 lore raw

PATCH v2 3/3 add support iMX8MQ-evk board

Hi Erik,

Quoted 6 lines · Erik Larsson
---
 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++

Why do we copy the defconfig in board folder although it present in the kernel tree directly?

Regards,
Gary

#9 lore raw

PATCH v2 3/3 add support iMX8MQ-evk board

Hi Gary,

2018-02-23 11:43 GMT+01:00 Gary Bisson <[email protected]>:

Quoted 10 lines

Hi Erik,

Quoted 6 lines · Erik Larsson
---
 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++
Quoted 2 lines

Why do we copy the defconfig in board folder although it present in the kernel tree directly?

The reason I add the kernel defconfig into the board folder is that NXP removed all defconfigs and renamed the valid one to 'defconfig' in the kernel. This makes it impossible (at least I think so) to use an in tree defconfig.

$ ls -l arch/arm64/configs/
total 16
-rw-r--r-- 1 erik erik 14337 dec 15 02:52 defconfig

Copying it into the board folder was the best solution available.

Quoted 3 lines

Regards,
Gary

Regards,
Erik

#10 lore raw

PATCH v2 3/3 add support iMX8MQ-evk board

Quoted 20 lines · Erik Larsson

Hi Gary,

2018-02-23 11:43 GMT+01:00 Gary Bisson <[email protected]>:

Quoted 10 lines

Hi Erik,

Quoted 6 lines · Erik Larsson
---
 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++
Quoted 2 lines

Why do we copy the defconfig in board folder although it present in the kernel tree directly?

The reason I add the kernel defconfig into the board folder is that NXP removed all defconfigs and renamed the valid one to 'defconfig' in the kernel. This makes it impossible (at least I think so) to use an in tree defconfig.

Quoted 5 lines
$ ls -l arch/arm64/configs/
total 16
-rw-r--r-- 1 erik erik 14337 dec 15 02:52 defconfig

Copying it into the board folder was the best solution available.

You should be able to use that in-tree defconfig with
BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#11 lore raw

PATCH v2 3/3 add support iMX8MQ-evk board

In reply to Erik Larsson

Hi Erik,

Quoted 10 lines · Erik Larsson
---
 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++
 4 files changed, 709 insertions(+), 3 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 board/freescale/imx8mqevk/linux-4.9.config
 create mode 100644 configs/freescale_imx8mqevk_defconfig

[snip]

Quoted 6 lines
configs/freescale_imx8mqevk_defconfig new file +0 -0
new file mode 100644
index 0000000..bc12e7c

configs/freescale_imx8mqevk_defconfig line 9

Quoted 9 lines
configs/freescale_imx8mqevk_defconfig new file +9 -0
@@ -0,0 +1,37 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_TOOLCHAIN_EXTERNAL=y
+BR2_TARGET_GENERIC_GETTY_PORT="ttymxc0"
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/freescale/common/imx/post-image.sh"
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/linux-imx"
+BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="imx_4.9.51_imx8m_beta"

For the sake of reproducibility we don't use branch names in defconfigs, since these might change over time. Use the 'rel_imx_4.9.51_8mq_beta' tag name instead. If you believe that commits that follow that tag are essential, you can use the raw commit id of current imx_4.9.51_imx8m_beta branch tip.

Quoted 11 lines
configs/freescale_imx8mqevk_defconfig new file +11 -0
+BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/freescale/imx8mqevk/linux-4.9.config"
+BR2_LINUX_KERNEL_DTS_SUPPORT=y
+BR2_LINUX_KERNEL_INTREE_DTS_NAME="freescale/fsl-imx8mq-evk"
+BR2_PACKAGE_FREESCALE_IMX=y
+BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M=y
+BR2_PACKAGE_FIRMWARE_IMX=y
+BR2_TARGET_ROOTFS_EXT2=y
+BR2_TARGET_ROOTFS_EXT2_4=y
+BR2_TARGET_ROOTFS_EXT2_SIZE="120M"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE=y

configs/freescale_imx8mqevk_defconfig line 30

Quoted 10 lines
configs/freescale_imx8mqevk_defconfig new file +10 -0
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/imx-atf"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="imx_4.9.51_imx8m_beta"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="imx8mq"
+BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31=y
+BR2_TARGET_UBOOT=y
+BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
+BR2_TARGET_UBOOT_CUSTOM_GIT=y
+BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://source.codeaurora.org/external/imx/uboot-imx"
+BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="imx_v2017.03_4.9.51_imx8m_beta"

This is also a branch. You can use the 'o8.0.0_1.3.0_8m-prc' tag, which is currently almost the same, or a commit id.

configs/freescale_imx8mqevk_defconfig line 37

Quoted 7 lines
configs/freescale_imx8mqevk_defconfig new file +7 -0
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mq_evk"
+BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_SPL=y
+BR2_PACKAGE_HOST_DOSFSTOOLS=y
+BR2_PACKAGE_HOST_GENIMAGE=y
+BR2_PACKAGE_HOST_IMX_MKIMAGE=y
+BR2_PACKAGE_HOST_MTOOLS=y

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#12 lore raw

PATCH v2 3/3 add support iMX8MQ-evk board

In reply to Erik Larsson

Hello,

Quoted 1 line · Erik Larsson

Minor nit: the commit title should be something like:

configs/freescale_imx8mqevk: new defconfig

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#13 lore raw

v2 cover Initial support for NXP iMX8 (imx8mq-evk)

In reply to Erik Larsson

Erik,

Quoted 7 lines · Erik Larsson

This series provides initial support for NXP iMX8 (imx8mq-evk).

This series of patches are tested against NXP imx8mq-evk. It only handles basic support for iIMX8M, currently no support for GPU, VPU and other HW features. This series makes it possible to build a minimal system for imx8mq-evk.

Quoted 8 lines

Changes since v1
================
- Removed new imx-atf package, use boot/arm-trusted-firmware.
- Move imx-mkimage from package/freescale-imx to package.
- Add upstream URL for imx-mkimage in Config.in.host.
- Fix install command syntax for imx-mkimage package.
- Use Makefile in imx-mkimage to build imx-boot-imx8mqevk-sd.bin instead of doing that in the post-script.sh
- Split third commit into two, one for firmware-img package and one for iMX8 board.

Please keep the version history in the patches below the --- marker [1]. It is easier to follow how each patch has evolved.

Also, when you submit a new version of a patchset, please mark the old one as superseeded in patchwork [1].

Quoted 18 lines

Erik Larsson (3):
imx-mkimage: new package
firmware-imx: add support for iMX8M firmware add support iMX8MQ-evk board

 .../common/imx/genimage.cfg.template_imx8          |  40 ++
 board/freescale/common/imx/post-image.sh           |  10 +-
 board/freescale/imx8mqevk/linux-4.9.config         | 625 +++++++++++++++++++++
 configs/freescale_imx8mqevk_defconfig              |  37 ++
 package/Config.in.host                             |   1 +
 package/freescale-imx/Config.in                    |   4 +-
 package/freescale-imx/firmware-imx/Config.in       |   2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk |   8 +
 .../imx-mkimage/0001-remove-git-build-info.patch   |  28 +
 package/imx-mkimage/Config.in.host                 |  11 +
 package/imx-mkimage/imx-mkimage.hash               |   3 +
 package/imx-mkimage/imx-mkimage.mk                 |  41 ++
Quoted 16 lines
 12 files changed, 805 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 board/freescale/imx8mqevk/linux-4.9.config
 create mode 100644 configs/freescale_imx8mqevk_defconfig
 create mode 100644 package/imx-mkimage/0001-remove-git-build-info.patch
 create mode 100644 package/imx-mkimage/Config.in.host
 create mode 100644 package/imx-mkimage/imx-mkimage.hash
 create mode 100644 package/imx-mkimage/imx-mkimage.mk
Signature · 6 lines
2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

[1] https://github.com/buildroot/buildroot/blob/master/docs/manual/contribute.txt

Best regards
Marcus Folkesson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180222/b6b7a3c2/attachment.asc>

#14 lore raw

v2 cover Initial support for NXP iMX8 (imx8mq-evk)

In reply to Erik Larsson

Hello Erik,

Quoted 4 lines · Erik Larsson

Erik Larsson (3):
imx-mkimage: new package
firmware-imx: add support for iMX8M firmware
add support iMX8MQ-evk board

Thanks for this new iteration. Seeing the number of comments you have received, I'll mark the patches as "Changes Requested" in our patch tracking system. Could you resubmit a new version that takes into account the comments ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#15 lore raw

v2 cover Initial support for NXP iMX8 (imx8mq-evk)

Of course!
I just need to sort everything out and test it again!

And thanks you all for your reviews! As a knewbie contributer I really appreciate all the feedback.

2018-02-25 22:19 GMT+01:00 Thomas Petazzoni <[email protected]>:

Quoted 21 lines

Hello Erik,

Quoted 4 lines · Erik Larsson

Erik Larsson (3):
imx-mkimage: new package
firmware-imx: add support for iMX8M firmware
add support iMX8MQ-evk board

Thanks for this new iteration. Seeing the number of comments you have received, I'll mark the patches as "Changes Requested" in our patch tracking system. Could you resubmit a new version that takes into account the comments ?

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering
http://bootlin.com