All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk)
@ 2018-03-03  8:17 Erik Larsson
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 1/4] imx-mkimage: new package Erik Larsson
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Erik Larsson @ 2018-03-03  8:17 UTC (permalink / raw)
  To: buildroot

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 v3
================
  - Use Buildroot toolchain instead of external Linareo toolchain.
  - Changed title on patch number 2

Changes since v2
================
  - Build kernel, u-boot, atf based on tags instead of branches.
  - Make sure to assign BR2_PACKAGE_FREESCALE_IMX_PLATFORM to IMX8M.
  - Remove kernel defconfig from board folder and use arch default in kernel tree.
  - Split third commit into two commits.

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 (4):
  imx-mkimage: new package
  freescale-imx: add config option for i.MX8M
  firmware-imx: add support for iMX8M firmware
  configs/freescale_imx8mqevk: new defconfig

 .../common/imx/genimage.cfg.template_imx8          | 40 ++++++++++++++++++++++
 board/freescale/common/imx/post-image.sh           | 10 ++++--
 configs/freescale_imx8mqevk_defconfig              | 38 ++++++++++++++++++++
 package/Config.in.host                             |  1 +
 package/freescale-imx/Config.in                    |  5 ++-
 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   | 29 ++++++++++++++++
 package/imx-mkimage/Config.in.host                 | 11 ++++++
 package/imx-mkimage/imx-mkimage.hash               |  3 ++
 package/imx-mkimage/imx-mkimage.mk                 | 39 +++++++++++++++++++++
 11 files changed, 181 insertions(+), 5 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 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

-- 
2.7.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] imx-mkimage: new package
  2018-03-03  8:17 [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
@ 2018-03-03  8:17 ` Erik Larsson
  2018-03-03 15:47   ` Thomas Petazzoni
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 2/4] freescale-imx: add config option for i.MX8M Erik Larsson
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Erik Larsson @ 2018-03-03  8:17 UTC (permalink / raw)
  To: buildroot

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

Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
---
v4: No changes
v3: Use BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME in U-Boot so we don't
    need to copy u-boot.bin to u-boot-nodtb.bin (suggested by Baruch)
    Update license to GPL-2.0+ (suggested by Marcus F.)
v2: Moved package from package/freescale-imx to package (suggested by Thomas P.)
    Add upstread URL in Config.in (suggested by Thomas P.)
    Fix install syntax in imx-mkimage.mk (suggested by Thomas P.)
    Use Makefile in imx-mkimage to build imx-boot-imx8mqevk-sd.bin instead of doing that in the post-script.sh (suggested Baruch)
---
 package/Config.in.host                             |  1 +
 .../imx-mkimage/0001-remove-git-build-info.patch   | 29 ++++++++++++++++
 package/imx-mkimage/Config.in.host                 | 11 ++++++
 package/imx-mkimage/imx-mkimage.hash               |  3 ++
 package/imx-mkimage/imx-mkimage.mk                 | 39 ++++++++++++++++++++++
 5 files changed, 83 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

diff --git a/package/Config.in.host b/package/Config.in.host
index 199a8e9..06ef5cb 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -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"
diff --git a/package/imx-mkimage/0001-remove-git-build-info.patch b/package/imx-mkimage/0001-remove-git-build-info.patch
new file mode 100644
index 0000000..9f8da02
--- /dev/null
+++ b/package/imx-mkimage/0001-remove-git-build-info.patch
@@ -0,0 +1,29 @@
+From d1bb893300b1bd80eaac27fcc8eb4347f56f83b4 Mon Sep 17 00:00:00 2001
+From: Erik Larsson <erik.larsson@combitech.se>
+Date: Thu, 22 Feb 2018 09:56:53 +0100
+Subject: [PATCH] Remove buildinformation step.
+
+Signed-off-by: Erik Larsson <erik.larsson@combitech.se>
+Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
+---
+ 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
+
diff --git a/package/imx-mkimage/Config.in.host b/package/imx-mkimage/Config.in.host
new file mode 100644
index 0000000..411f67c
--- /dev/null
+++ b/package/imx-mkimage/Config.in.host
@@ -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
diff --git a/package/imx-mkimage/imx-mkimage.hash b/package/imx-mkimage/imx-mkimage.hash
new file mode 100644
index 0000000..08d31ce
--- /dev/null
+++ b/package/imx-mkimage/imx-mkimage.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256 4ddb144520001c33baa24493f68ef2ea9434ac36bf3ae223f78d7ec581aa484c  imx-mkimage-imx_4.9.51_imx8m_beta.tar.gz
+sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c  iMX8dv/COPYING
diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk
new file mode 100644
index 0000000..506ae75
--- /dev/null
+++ b/package/imx-mkimage/imx-mkimage.mk
@@ -0,0 +1,39 @@
+################################################################################
+#
+# 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
+	cp ${BINARIES_DIR}/u-boot-nodtb.bin $(@D)/iMX8M
+
+	# 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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 2/4] freescale-imx: add config option for i.MX8M
  2018-03-03  8:17 [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 1/4] imx-mkimage: new package Erik Larsson
@ 2018-03-03  8:17 ` Erik Larsson
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 3/4] firmware-imx: add support for iMX8M firmware Erik Larsson
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Erik Larsson @ 2018-03-03  8:17 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
---
v4: Changed title on commit (suggested by Gary B.)
---
 package/freescale-imx/Config.in | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/freescale-imx/Config.in b/package/freescale-imx/Config.in
index b5e5ab2..fe993f3 100644
--- a/package/freescale-imx/Config.in
+++ b/package/freescale-imx/Config.in
@@ -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
@@ -54,6 +56,7 @@ config BR2_PACKAGE_FREESCALE_IMX_PLATFORM
 	default "IMX6S" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6S
 	default "IMX6UL" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX6UL
 	default "IMX7" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX7
+	default "IMX8" if BR2_PACKAGE_FREESCALE_IMX_PLATFORM_IMX8M
 
 config BR2_PACKAGE_FREESCALE_IMX_HAS_VPU
 	bool
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 3/4] firmware-imx: add support for iMX8M firmware
  2018-03-03  8:17 [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 1/4] imx-mkimage: new package Erik Larsson
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 2/4] freescale-imx: add config option for i.MX8M Erik Larsson
@ 2018-03-03  8:17 ` Erik Larsson
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 4/4] configs/freescale_imx8mqevk: new defconfig Erik Larsson
  2018-03-04 18:05 ` [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Fabio Estevam
  4 siblings, 0 replies; 12+ messages in thread
From: Erik Larsson @ 2018-03-03  8:17 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
---
v4: No changes
v3: Split v2 commit into two commits (suggested by Garry B.)
v2: Split v1 commit into two commits (suggested by Baruch)
---
 package/freescale-imx/firmware-imx/Config.in       | 2 +-
 package/freescale-imx/firmware-imx/firmware-imx.mk | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/freescale-imx/firmware-imx/Config.in b/package/freescale-imx/firmware-imx/Config.in
index fca280a..56d5b80 100644
--- a/package/freescale-imx/firmware-imx/Config.in
+++ b/package/freescale-imx/firmware-imx/Config.in
@@ -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.
 
diff --git a/package/freescale-imx/firmware-imx/firmware-imx.mk b/package/freescale-imx/firmware-imx/firmware-imx.mk
index 630afca..f03daf2 100644
--- a/package/freescale-imx/firmware-imx/firmware-imx.mk
+++ b/package/freescale-imx/firmware-imx/firmware-imx.mk
@@ -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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 4/4] configs/freescale_imx8mqevk: new defconfig
  2018-03-03  8:17 [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
                   ` (2 preceding siblings ...)
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 3/4] firmware-imx: add support for iMX8M firmware Erik Larsson
@ 2018-03-03  8:17 ` Erik Larsson
  2018-03-04 17:25   ` Baruch Siach
  2018-03-04 18:05 ` [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Fabio Estevam
  4 siblings, 1 reply; 12+ messages in thread
From: Erik Larsson @ 2018-03-03  8:17 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
---
v4: Change to Buildroot toolchain from external toolchain
v3: Change commit message (suggested by Thomas P.)
    Make sure to use tags instead of branches in kernel,bootloader and ATF repositorires (Arnout V.)
    Use BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG instead of copy kernel defconfig to board folder (suggested by Arnout V.)
    Split v2 commit into two commits
---
 .../common/imx/genimage.cfg.template_imx8          | 40 ++++++++++++++++++++++
 board/freescale/common/imx/post-image.sh           | 10 ++++--
 configs/freescale_imx8mqevk_defconfig              | 38 ++++++++++++++++++++
 3 files changed, 85 insertions(+), 3 deletions(-)
 create mode 100644 board/freescale/common/imx/genimage.cfg.template_imx8
 create mode 100644 configs/freescale_imx8mqevk_defconfig

diff --git a/board/freescale/common/imx/genimage.cfg.template_imx8 b/board/freescale/common/imx/genimage.cfg.template_imx8
new file mode 100644
index 0000000..138beff
--- /dev/null
+++ b/board/freescale/common/imx/genimage.cfg.template_imx8
@@ -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"
+  }
+}
diff --git a/board/freescale/common/imx/post-image.sh b/board/freescale/common/imx/post-image.sh
index b239743..264c8a4 100755
--- a/board/freescale/common/imx/post-image.sh
+++ b/board/freescale/common/imx/post-image.sh
@@ -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"
diff --git a/configs/freescale_imx8mqevk_defconfig b/configs/freescale_imx8mqevk_defconfig
new file mode 100644
index 0000000..313bfd9
--- /dev/null
+++ b/configs/freescale_imx8mqevk_defconfig
@@ -0,0 +1,38 @@
+BR2_aarch64=y
+BR2_ARM_FPU_VFPV3=y
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=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="rel_imx_4.9.51_8mq_beta"
+BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
+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="rel_imx_4.9.51_8mq_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="o8.0.0_1.3.0_8m-prc"
+BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mq_evk"
+BR2_TARGET_UBOOT_FORMAT_IMX=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
+BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-nodtb.bin"
+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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] imx-mkimage: new package
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 1/4] imx-mkimage: new package Erik Larsson
@ 2018-03-03 15:47   ` Thomas Petazzoni
  2018-03-03 18:46     ` Erik Larsson
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2018-03-03 15:47 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat,  3 Mar 2018 09:17:37 +0100, Erik Larsson wrote:

> diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk
> new file mode 100644
> index 0000000..506ae75
> --- /dev/null
> +++ b/package/imx-mkimage/imx-mkimage.mk
> @@ -0,0 +1,39 @@
> +################################################################################
> +#
> +# 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
> +	cp ${BINARIES_DIR}/u-boot-nodtb.bin $(@D)/iMX8M
> +
> +	# 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

I'm not a big fan of the fact that this host package not does not
install any host tool, but instead post-processes images created by
other packages.

Would it be possible for this package to just install host tools, and
then have a post-image script that uses these host tools to provide the
final flash.bin image ?

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] imx-mkimage: new package
  2018-03-03 15:47   ` Thomas Petazzoni
@ 2018-03-03 18:46     ` Erik Larsson
  2018-03-09 15:26       ` Thomas Petazzoni
  0 siblings, 1 reply; 12+ messages in thread
From: Erik Larsson @ 2018-03-03 18:46 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

2018-03-03 16:47 GMT+01:00 Thomas Petazzoni <thomas.petazzoni@bootlin.com>:
> Hello,
>
> On Sat,  3 Mar 2018 09:17:37 +0100, Erik Larsson wrote:
>
>> diff --git a/package/imx-mkimage/imx-mkimage.mk b/package/imx-mkimage/imx-mkimage.mk
>> new file mode 100644
>> index 0000000..506ae75
>> --- /dev/null
>> +++ b/package/imx-mkimage/imx-mkimage.mk
>> @@ -0,0 +1,39 @@
>> +################################################################################
>> +#
>> +# 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
>> +     cp ${BINARIES_DIR}/u-boot-nodtb.bin $(@D)/iMX8M
>> +
>> +     # 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
>
> I'm not a big fan of the fact that this host package not does not
> install any host tool, but instead post-processes images created by
> other packages.
>
> Would it be possible for this package to just install host tools, and
> then have a post-image script that uses these host tools to provide the
> final flash.bin image ?

This first version if this patch-serie did sort of that. It build and
installed host tools. And then they were used in post-image.sh. But
after a comments/suggestion from Baruch I got encouraged do it this
way. This solution is much clearer when reading the code then the
first version, but maybe with the drawback of this host-package not
really being a host-package as you stated. If you compare this
solution with the first you will see that there is a pretty convoluted
solution for doing parts that are in the Makefile och imx-mkimage. The
main problem here may be the fact that NXP put stuff in there Makefile
that rally doesn't have anything with the creation of the tool.


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

/Erik

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 4/4] configs/freescale_imx8mqevk: new defconfig
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 4/4] configs/freescale_imx8mqevk: new defconfig Erik Larsson
@ 2018-03-04 17:25   ` Baruch Siach
  0 siblings, 0 replies; 12+ messages in thread
From: Baruch Siach @ 2018-03-04 17:25 UTC (permalink / raw)
  To: buildroot

Hi Erik,

On Sat, Mar 03, 2018 at 09:17:40AM +0100, Erik Larsson wrote:
> Signed-off-by: Erik Larsson <karl.erik.larsson@gmail.com>
> Signed-off-by: Christopher Dahlberg <crille.dahlberg@gmail.com>
> ---

[snip]

> diff --git a/configs/freescale_imx8mqevk_defconfig b/configs/freescale_imx8mqevk_defconfig
> new file mode 100644
> index 0000000..313bfd9
> --- /dev/null
> +++ b/configs/freescale_imx8mqevk_defconfig
> @@ -0,0 +1,38 @@
> +BR2_aarch64=y
> +BR2_ARM_FPU_VFPV3=y
> +BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_4_9=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="rel_imx_4.9.51_8mq_beta"

You can now use the more recent 'rel_imx_4.9.51_8mq_beta_patch' tag here, ...

> +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y
> +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="rel_imx_4.9.51_8mq_beta"

... here, and ...

> +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="o8.0.0_1.3.0_8m-prc"

... here.

> +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="imx8mq_evk"
> +BR2_TARGET_UBOOT_FORMAT_IMX=y
> +BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
> +BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot-nodtb.bin"
> +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

-- 
     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 -

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk)
  2018-03-03  8:17 [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
                   ` (3 preceding siblings ...)
  2018-03-03  8:17 ` [Buildroot] [PATCH v4 4/4] configs/freescale_imx8mqevk: new defconfig Erik Larsson
@ 2018-03-04 18:05 ` Fabio Estevam
  2018-03-06 13:09   ` Erik Larsson
  4 siblings, 1 reply; 12+ messages in thread
From: Fabio Estevam @ 2018-03-04 18:05 UTC (permalink / raw)
  To: buildroot

Hi Erik,

On Sat, Mar 3, 2018 at 5:17 AM, Erik Larsson
<karl.erik.larsson@gmail.com> wrote:
> 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.

Thanks for working on this series.

In case you need to respin it, please add a readme.txt file so that
people can know how to build and flash a SD card to boot this board.

An example of a readme.txt: board/freescale/imx51evk/readme.txt

Thanks

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk)
  2018-03-04 18:05 ` [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Fabio Estevam
@ 2018-03-06 13:09   ` Erik Larsson
  0 siblings, 0 replies; 12+ messages in thread
From: Erik Larsson @ 2018-03-06 13:09 UTC (permalink / raw)
  To: buildroot

Hi Fabio

2018-03-04 19:05 GMT+01:00 Fabio Estevam <festevam@gmail.com>:

> Hi Erik,
>
> On Sat, Mar 3, 2018 at 5:17 AM, Erik Larsson
> <karl.erik.larsson@gmail.com> wrote:
> > 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.
>
> Thanks for working on this series.
>
> In case you need to respin it, please add a readme.txt file so that
> people can know how to build and flash a SD card to boot this board.
>
> An example of a readme.txt: board/freescale/imx51evk/readme.txt

I will add a readme file and respin these patches.


>
Thanks
>
/Erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180306/9a9b416b/attachment.html>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] imx-mkimage: new package
  2018-03-03 18:46     ` Erik Larsson
@ 2018-03-09 15:26       ` Thomas Petazzoni
  2018-03-10 19:58         ` Baruch Siach
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Petazzoni @ 2018-03-09 15:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 3 Mar 2018 19:46:34 +0100, Erik Larsson wrote:

> > I'm not a big fan of the fact that this host package not does not
> > install any host tool, but instead post-processes images created by
> > other packages.
> >
> > Would it be possible for this package to just install host tools, and
> > then have a post-image script that uses these host tools to provide the
> > final flash.bin image ?  
> 
> This first version if this patch-serie did sort of that. It build and
> installed host tools. And then they were used in post-image.sh. But
> after a comments/suggestion from Baruch I got encouraged do it this
> way. This solution is much clearer when reading the code then the
> first version, but maybe with the drawback of this host-package not
> really being a host-package as you stated. If you compare this
> solution with the first you will see that there is a pretty convoluted
> solution for doing parts that are in the Makefile och imx-mkimage. The
> main problem here may be the fact that NXP put stuff in there Makefile
> that rally doesn't have anything with the creation of the tool.

I think I really prefer the approach where the imx-mkimage package only
installs a host tool, and then a post-image script that uses the host
tool installed by imx-mkimage to post-process the images, and generate
the final bootloader.

Best regards,

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Buildroot] [PATCH v4 1/4] imx-mkimage: new package
  2018-03-09 15:26       ` Thomas Petazzoni
@ 2018-03-10 19:58         ` Baruch Siach
  0 siblings, 0 replies; 12+ messages in thread
From: Baruch Siach @ 2018-03-10 19:58 UTC (permalink / raw)
  To: buildroot

Hi Thomas,

On Fri, Mar 09, 2018 at 04:26:04PM +0100, Thomas Petazzoni wrote:
> On Sat, 3 Mar 2018 19:46:34 +0100, Erik Larsson wrote:
> 
> > > I'm not a big fan of the fact that this host package not does not
> > > install any host tool, but instead post-processes images created by
> > > other packages.
> > >
> > > Would it be possible for this package to just install host tools, and
> > > then have a post-image script that uses these host tools to provide the
> > > final flash.bin image ?  
> > 
> > This first version if this patch-serie did sort of that. It build and
> > installed host tools. And then they were used in post-image.sh. But
> > after a comments/suggestion from Baruch I got encouraged do it this
> > way. This solution is much clearer when reading the code then the
> > first version, but maybe with the drawback of this host-package not
> > really being a host-package as you stated. If you compare this
> > solution with the first you will see that there is a pretty convoluted
> > solution for doing parts that are in the Makefile och imx-mkimage. The
> > main problem here may be the fact that NXP put stuff in there Makefile
> > that rally doesn't have anything with the creation of the tool.
> 
> I think I really prefer the approach where the imx-mkimage package only
> installs a host tool, and then a post-image script that uses the host
> tool installed by imx-mkimage to post-process the images, and generate
> the final bootloader.

Erik has been quick to respin the series. The result is at

  http://lists.busybox.net/pipermail/buildroot/2018-March/215611.html

(not on patchwork). Now the gen_imx8_boot() shell function in the post image 
script duplicates the logic from the imx-mkimage Makefile to generate the boot 
image. Do you find this better?

baruch

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-03-10 19:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-03  8:17 [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Erik Larsson
2018-03-03  8:17 ` [Buildroot] [PATCH v4 1/4] imx-mkimage: new package Erik Larsson
2018-03-03 15:47   ` Thomas Petazzoni
2018-03-03 18:46     ` Erik Larsson
2018-03-09 15:26       ` Thomas Petazzoni
2018-03-10 19:58         ` Baruch Siach
2018-03-03  8:17 ` [Buildroot] [PATCH v4 2/4] freescale-imx: add config option for i.MX8M Erik Larsson
2018-03-03  8:17 ` [Buildroot] [PATCH v4 3/4] firmware-imx: add support for iMX8M firmware Erik Larsson
2018-03-03  8:17 ` [Buildroot] [PATCH v4 4/4] configs/freescale_imx8mqevk: new defconfig Erik Larsson
2018-03-04 17:25   ` Baruch Siach
2018-03-04 18:05 ` [Buildroot] [PATCH v4 0/4] Initial support for NXP iMX8 (imx8mq-evk) Fabio Estevam
2018-03-06 13:09   ` Erik Larsson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.