DistroKit Mailinglist
 help / color / mirror / Atom feed
* [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano
@ 2023-07-28 16:49 Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 1/7] v8a: imx8m: tf-a: build for i.MX8M Nano as well Ahmad Fatoum
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit

Kernel is already configured to support booting on i.MX8MN
and all other components just need little tweaking in order
for DistroKit to build a full SD-Card image for it, so let's do it.

This was tested on a DDR4 i.MX8MN EVK, but it should work equally
well on the LPDDR4 variant.

I have a spare DDR4 EVK here, so I'll add it to CI once this PR is
merged, so v8a CI is not limited to Rock-3A and there is at long
last some automated on-device testing for DistroKit on i.MX8M.

Ahmad Fatoum (7):
  v8a: imx8m: tf-a: build for i.MX8M Nano as well
  v8a: imx8m: imx-firmware: install DDR4 PHY firmware
  v8a: barebox: enable i.MX8M Nano EVK support
  v8a: imx8m: use common genimage configuration
  v8a: imx8m: genimage: switch from MBR to GPT images
  v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs
  v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image

 configs/platform-v8a/barebox.config           |  5 ++-
 .../platform-v8a/config/images/imx8m.config   | 17 +++++++++
 .../config/images/imx8mm-evk.config           | 17 ---------
 .../config/images/imx8mp-evk.config           | 17 ---------
 .../config/images/imx8mq-evk.config           | 17 ---------
 configs/platform-v8a/platformconfig           |  5 +--
 .../platforms/image-imx8mn-evk.in             | 10 ++++++
 configs/platform-v8a/rules/firmware-imx.make  | 10 ++++++
 .../platform-v8a/rules/image-imx8mm-evk.make  |  5 ++-
 .../platform-v8a/rules/image-imx8mn-evk.make  | 35 +++++++++++++++++++
 .../platform-v8a/rules/image-imx8mp-evk.make  |  5 ++-
 .../platform-v8a/rules/image-imx8mq-evk.make  |  5 ++-
 12 files changed, 91 insertions(+), 57 deletions(-)
 create mode 100644 configs/platform-v8a/config/images/imx8m.config
 delete mode 100644 configs/platform-v8a/config/images/imx8mm-evk.config
 delete mode 100644 configs/platform-v8a/config/images/imx8mp-evk.config
 delete mode 100644 configs/platform-v8a/config/images/imx8mq-evk.config
 create mode 100644 configs/platform-v8a/platforms/image-imx8mn-evk.in
 create mode 100644 configs/platform-v8a/rules/image-imx8mn-evk.make

-- 
2.39.2




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

* [DistroKit] [PATCH 1/7] v8a: imx8m: tf-a: build for i.MX8M Nano as well
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 2/7] v8a: imx8m: imx-firmware: install DDR4 PHY firmware Ahmad Fatoum
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

While TF-A itself can't build multiple images in one-go, the upstream
PTXdist recipe can, so configure it to build one more image for imx8mn.

This will later be linked into barebox as part of booting DistroKit on
the imx8mn-evk.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v8a/platformconfig          | 2 +-
 configs/platform-v8a/rules/firmware-imx.make | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index 799bb0787151..88c814b87ad1 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -214,7 +214,7 @@ PTXCONF_TF_A_MD5="784a1e94d4b1e938927372e3bc12d12e"
 PTXCONF_TF_A_ARCH_STRING="aarch64"
 PTXCONF_TF_A_ARM_ARCH_MAJOR_8=y
 PTXCONF_TF_A_ARM_ARCH_MAJOR=8
-PTXCONF_TF_A_PLATFORMS="imx8mq imx8mm imx8mp"
+PTXCONF_TF_A_PLATFORMS="imx8mq imx8mm imx8mn imx8mp"
 PTXCONF_TF_A_ARM_ARCH_MINOR=0
 PTXCONF_TF_A_EXTRA_ARGS=""
 PTXCONF_TF_A_ARTIFACTS="bl31.bin"
diff --git a/configs/platform-v8a/rules/firmware-imx.make b/configs/platform-v8a/rules/firmware-imx.make
index 56c8e24ecd69..d543c2fa5dd1 100644
--- a/configs/platform-v8a/rules/firmware-imx.make
+++ b/configs/platform-v8a/rules/firmware-imx.make
@@ -30,6 +30,7 @@ FIRMWARE_IMX_SOURCE	:= $(SRCDIR)/$(FIRMWARE_IMX).$(FIRMWARE_IMX_SUFFIX)
 #
 ifdef PTXCONF_FIRMWARE_IMX
 BAREBOX_INJECT_FILES	+= imx8mm-bl31.bin:firmware/imx8mm-bl31.bin
+BAREBOX_INJECT_FILES	+= imx8mn-bl31.bin:firmware/imx8mn-bl31.bin
 BAREBOX_INJECT_FILES	+= imx8mp-bl31.bin:firmware/imx8mp-bl31.bin
 BAREBOX_INJECT_FILES	+= imx8mq-bl31.bin:firmware/imx8mq-bl31.bin
 BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin:firmware/lpddr4_pmu_train_1d_dmem.bin
-- 
2.39.2




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

* [DistroKit] [PATCH 2/7] v8a: imx8m: imx-firmware: install DDR4 PHY firmware
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 1/7] v8a: imx8m: tf-a: build for i.MX8M Nano as well Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 3/7] v8a: barebox: enable i.MX8M Nano EVK support Ahmad Fatoum
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

There i.MX8MN-EVK comes in multiple variants: with LPDDR4, DDR4 and
DDR3L. barebox supports configuration of both LPDDR4 and DDR4 images,
so enable installation of the DDR4 PHY firmware.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v8a/rules/firmware-imx.make | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/configs/platform-v8a/rules/firmware-imx.make b/configs/platform-v8a/rules/firmware-imx.make
index d543c2fa5dd1..bd49885ad7a7 100644
--- a/configs/platform-v8a/rules/firmware-imx.make
+++ b/configs/platform-v8a/rules/firmware-imx.make
@@ -37,6 +37,10 @@ BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_dmem.bin:firmware/lpddr
 BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_1d_imem.bin:firmware/lpddr4_pmu_train_1d_imem.bin
 BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_2d_dmem.bin:firmware/lpddr4_pmu_train_2d_dmem.bin
 BAREBOX_INJECT_FILES	+= ddr/synopsys/lpddr4_pmu_train_2d_imem.bin:firmware/lpddr4_pmu_train_2d_imem.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_dmem_1d.bin:firmware/ddr4_dmem_1d.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_dmem_2d.bin:firmware/ddr4_dmem_2d.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_imem_1d.bin:firmware/ddr4_imem_1d.bin
+BAREBOX_INJECT_FILES	+= ddr/synopsys/ddr4_imem_2d.bin:firmware/ddr4_imem_2d.bin
 endif
 
 # ----------------------------------------------------------------------------
@@ -62,6 +66,11 @@ ifdef PTXCONF_FIRMWARE_IMX_BOOTIMAGE_IMX8
 		install -v -D -m644 $(FIRMWARE_IMX_PKGDIR)/firmware/ddr/synopsys/$(f) \
 		$(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/ddr/synopsys/$(f)$(ptx/nl))
 
+	@$(foreach f, ddr4_dmem_1d.bin ddr4_dmem_2d.bin \
+	              ddr4_imem_1d.bin ddr4_imem_2d.bin, \
+		install -v -D -m644 $(FIRMWARE_IMX_PKGDIR)/firmware/ddr/synopsys/$(f) \
+		$(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/ddr/synopsys/$(f)$(ptx/nl))
+
 	@$(foreach f, signed_dp_imx8m.bin signed_hdmi_imx8m.bin, \
 		install -v -D -m644 $(FIRMWARE_IMX_PKGDIR)/firmware/hdmi/cadence/$(f) \
 		$(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/hdmi/cadence/$(f)$(ptx/nl))
-- 
2.39.2




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

* [DistroKit] [PATCH 3/7] v8a: barebox: enable i.MX8M Nano EVK support
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 1/7] v8a: imx8m: tf-a: build for i.MX8M Nano as well Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 2/7] v8a: imx8m: imx-firmware: install DDR4 PHY firmware Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 4/7] v8a: imx8m: use common genimage configuration Ahmad Fatoum
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

barebox supports i.MX8MN DDR4 and LPDDR4 EVK with the same image. Enable
it in the defconfig.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v8a/barebox.config | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/configs/platform-v8a/barebox.config b/configs/platform-v8a/barebox.config
index 94dc595c30ea..1c736a378e8b 100644
--- a/configs/platform-v8a/barebox.config
+++ b/configs/platform-v8a/barebox.config
@@ -38,6 +38,7 @@ CONFIG_ARCH_IMX_IMXIMAGE=y
 #
 CONFIG_ARCH_IMX8M=y
 CONFIG_ARCH_IMX8MM=y
+CONFIG_ARCH_IMX8MN=y
 CONFIG_ARCH_IMX8MP=y
 CONFIG_ARCH_IMX8MQ=y
 
@@ -47,7 +48,7 @@ CONFIG_ARCH_IMX8MQ=y
 # CONFIG_MACH_INNOCOMM_WB15 is not set
 # CONFIG_MACH_MNT_REFORM is not set
 CONFIG_MACH_NXP_IMX8MM_EVK=y
-# CONFIG_MACH_NXP_IMX8MN_EVK is not set
+CONFIG_MACH_NXP_IMX8MN_EVK=y
 CONFIG_MACH_NXP_IMX8MP_EVK=y
 CONFIG_MACH_NXP_IMX8MQ_EVK=y
 CONFIG_MACH_PHYTEC_SOM_IMX8MQ=y
@@ -1060,7 +1061,9 @@ CONFIG_DIGEST_SHA1_GENERIC=y
 #
 CONFIG_EXTRA_FIRMWARE_DIR="firmware"
 CONFIG_FIRMWARE_IMX_LPDDR4_PMU_TRAIN=y
+CONFIG_FIRMWARE_IMX_DDR4_PMU_TRAIN=y
 CONFIG_FIRMWARE_IMX8MM_ATF=y
+CONFIG_FIRMWARE_IMX8MN_ATF=y
 CONFIG_FIRMWARE_IMX8MP_ATF=y
 CONFIG_FIRMWARE_IMX8MQ_ATF=y
 # end of Firmware files
-- 
2.39.2




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

* [DistroKit] [PATCH 4/7] v8a: imx8m: use common genimage configuration
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
                   ` (2 preceding siblings ...)
  2023-07-28 16:49 ` [DistroKit] [PATCH 3/7] v8a: barebox: enable i.MX8M Nano EVK support Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 5/7] v8a: imx8m: genimage: switch from MBR to GPT images Ahmad Fatoum
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

The i.MX8M defconfigs are identical, except for the bootloader binary used.
We already fix up the hd image name into the genimage config, so let's
fix up the bootloader image name as well and just have all i.MX8M share a
single config template.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v8a/config/images/imx8m.config | 17 +++++++++++++++++
 .../config/images/imx8mm-evk.config             | 17 -----------------
 .../config/images/imx8mp-evk.config             | 17 -----------------
 .../config/images/imx8mq-evk.config             | 17 -----------------
 .../platform-v8a/rules/image-imx8mm-evk.make    |  5 ++++-
 .../platform-v8a/rules/image-imx8mp-evk.make    |  5 ++++-
 .../platform-v8a/rules/image-imx8mq-evk.make    |  5 ++++-
 7 files changed, 29 insertions(+), 54 deletions(-)
 create mode 100644 configs/platform-v8a/config/images/imx8m.config
 delete mode 100644 configs/platform-v8a/config/images/imx8mm-evk.config
 delete mode 100644 configs/platform-v8a/config/images/imx8mp-evk.config
 delete mode 100644 configs/platform-v8a/config/images/imx8mq-evk.config

diff --git a/configs/platform-v8a/config/images/imx8m.config b/configs/platform-v8a/config/images/imx8m.config
new file mode 100644
index 000000000000..367d98edcc1d
--- /dev/null
+++ b/configs/platform-v8a/config/images/imx8m.config
@@ -0,0 +1,17 @@
+image @IMAGE@ {
+       hdimage {
+               align = 1M
+               disk-signature = 0x9e1b14a8
+       }
+       partition barebox {
+               image = "@BAREBOX_IMAGE@"
+               size = 896K
+               in-partition-table = false
+               holes = {"(440; 1K)"}
+       }
+       partition root {
+               offset = 2M
+               image = "root.ext2"
+               partition-type = 0x83
+       }
+}
diff --git a/configs/platform-v8a/config/images/imx8mm-evk.config b/configs/platform-v8a/config/images/imx8mm-evk.config
deleted file mode 100644
index 80f569139704..000000000000
--- a/configs/platform-v8a/config/images/imx8mm-evk.config
+++ /dev/null
@@ -1,17 +0,0 @@
-image @IMAGE@ {
-	hdimage {
-		align = 1M
-		disk-signature = 0x9e1b14a8
-	}
-	partition barebox {
-		image = "barebox-nxp-imx8mm-evk.img"
-		size = 896K
-		in-partition-table = false
-		holes = {"(440; 1K)"}
-	}
-	partition root {
-		offset = 2M
-		image = "root.ext2"
-		partition-type = 0x83
-	}
-}
diff --git a/configs/platform-v8a/config/images/imx8mp-evk.config b/configs/platform-v8a/config/images/imx8mp-evk.config
deleted file mode 100644
index 2f019381cace..000000000000
--- a/configs/platform-v8a/config/images/imx8mp-evk.config
+++ /dev/null
@@ -1,17 +0,0 @@
-image @IMAGE@ {
-	hdimage {
-		align = 1M
-		disk-signature = 0x9e1b14a8
-	}
-	partition barebox {
-		image = "barebox-nxp-imx8mp-evk.img"
-		size = 896K
-		in-partition-table = false
-		holes = {"(440; 1K)"}
-	}
-	partition root {
-		offset = 2M
-		image = "root.ext2"
-		partition-type = 0x83
-	}
-}
diff --git a/configs/platform-v8a/config/images/imx8mq-evk.config b/configs/platform-v8a/config/images/imx8mq-evk.config
deleted file mode 100644
index 385672543b90..000000000000
--- a/configs/platform-v8a/config/images/imx8mq-evk.config
+++ /dev/null
@@ -1,17 +0,0 @@
-image @IMAGE@ {
-	hdimage {
-		align = 1M
-		disk-signature = 0x9e1b14a8
-	}
-	partition barebox {
-		image = "barebox-nxp-imx8mq-evk.img"
-		size = 896K
-		in-partition-table = false
-		holes = {"(440; 1K)"}
-	}
-	partition root {
-		offset = 2M
-		image = "root.ext2"
-		partition-type = 0x83
-	}
-}
diff --git a/configs/platform-v8a/rules/image-imx8mm-evk.make b/configs/platform-v8a/rules/image-imx8mm-evk.make
index 60b8b3086713..074690bf0c9f 100644
--- a/configs/platform-v8a/rules/image-imx8mm-evk.make
+++ b/configs/platform-v8a/rules/image-imx8mm-evk.make
@@ -18,12 +18,15 @@ IMAGE_IMX8MM_EVK		:= image-imx8mm-evk
 IMAGE_IMX8MM_EVK_DIR	:= $(BUILDDIR)/$(IMAGE_IMX8MM_EVK)
 IMAGE_IMX8MM_EVK_IMAGE	:= $(IMAGEDIR)/imx8mm-evk.img
 IMAGE_IMX8MM_EVK_FILES	:= $(IMAGEDIR)/root.tgz
-IMAGE_IMX8MM_EVK_CONFIG	:= imx8mm-evk.config
+IMAGE_IMX8MM_EVK_CONFIG	:= imx8m.config
 
 # ----------------------------------------------------------------------------
 # Image
 # ----------------------------------------------------------------------------
 
+IMAGE_IMX8MM_EVK_ENV := \
+        BAREBOX_IMAGE=barebox-nxp-imx8mm-evk.img
+
 $(IMAGE_IMX8MM_EVK_IMAGE):
 	@$(call targetinfo)
 	@$(call image/genimage, IMAGE_IMX8MM_EVK)
diff --git a/configs/platform-v8a/rules/image-imx8mp-evk.make b/configs/platform-v8a/rules/image-imx8mp-evk.make
index 758aee9237fb..d37dd7e54328 100644
--- a/configs/platform-v8a/rules/image-imx8mp-evk.make
+++ b/configs/platform-v8a/rules/image-imx8mp-evk.make
@@ -18,12 +18,15 @@ IMAGE_IMX8MP_EVK		:= image-imx8mp-evk
 IMAGE_IMX8MP_EVK_DIR	:= $(BUILDDIR)/$(IMAGE_IMX8MP_EVK)
 IMAGE_IMX8MP_EVK_IMAGE	:= $(IMAGEDIR)/imx8mp-evk.img
 IMAGE_IMX8MP_EVK_FILES	:= $(IMAGEDIR)/root.tgz
-IMAGE_IMX8MP_EVK_CONFIG	:= imx8mp-evk.config
+IMAGE_IMX8MP_EVK_CONFIG	:= imx8m.config
 
 # ----------------------------------------------------------------------------
 # Image
 # ----------------------------------------------------------------------------
 
+IMAGE_IMX8MP_EVK_ENV := \
+        BAREBOX_IMAGE=barebox-nxp-imx8mp-evk.img
+
 $(IMAGE_IMX8MP_EVK_IMAGE):
 	@$(call targetinfo)
 	@$(call image/genimage, IMAGE_IMX8MP_EVK)
diff --git a/configs/platform-v8a/rules/image-imx8mq-evk.make b/configs/platform-v8a/rules/image-imx8mq-evk.make
index b70bd76522ba..84dfe4dc3cc7 100644
--- a/configs/platform-v8a/rules/image-imx8mq-evk.make
+++ b/configs/platform-v8a/rules/image-imx8mq-evk.make
@@ -18,12 +18,15 @@ IMAGE_IMX8MQ_EVK		:= image-imx8mq-evk
 IMAGE_IMX8MQ_EVK_DIR	:= $(BUILDDIR)/$(IMAGE_IMX8MQ_EVK)
 IMAGE_IMX8MQ_EVK_IMAGE	:= $(IMAGEDIR)/imx8mq-evk.img
 IMAGE_IMX8MQ_EVK_FILES	:= $(IMAGEDIR)/root.tgz
-IMAGE_IMX8MQ_EVK_CONFIG	:= imx8mq-evk.config
+IMAGE_IMX8MQ_EVK_CONFIG	:= imx8m.config
 
 # ----------------------------------------------------------------------------
 # Image
 # ----------------------------------------------------------------------------
 
+IMAGE_IMX8MQ_EVK_ENV := \
+        BAREBOX_IMAGE=barebox-nxp-imx8mq-evk.img
+
 $(IMAGE_IMX8MQ_EVK_IMAGE):
 	@$(call targetinfo)
 	@$(call image/genimage, IMAGE_IMX8MQ_EVK)
-- 
2.39.2




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

* [DistroKit] [PATCH 5/7] v8a: imx8m: genimage: switch from MBR to GPT images
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
                   ` (3 preceding siblings ...)
  2023-07-28 16:49 ` [DistroKit] [PATCH 4/7] v8a: imx8m: use common genimage configuration Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 6/7] v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs Ahmad Fatoum
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Johannes Zink, Ahmad Fatoum

MBR is stuff of the past. Switch over to GPT. This is easier on i.MX8M
than on i.MX6, because the BootROM starts execution at an >= 32K offset,
so GPT can be located at its usual location. We should eventually move
barebox into a proper GPT partition, but for now, just keep the old
partition numbering intact.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Cc: Johannes Zink <j.zink@pengutronix.de>
---
 configs/platform-v8a/config/images/imx8m.config | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configs/platform-v8a/config/images/imx8m.config b/configs/platform-v8a/config/images/imx8m.config
index 367d98edcc1d..dfe106612426 100644
--- a/configs/platform-v8a/config/images/imx8m.config
+++ b/configs/platform-v8a/config/images/imx8m.config
@@ -1,17 +1,17 @@
 image @IMAGE@ {
        hdimage {
+               partition-table-type = "gpt"
                align = 1M
-               disk-signature = 0x9e1b14a8
        }
        partition barebox {
                image = "@BAREBOX_IMAGE@"
                size = 896K
                in-partition-table = false
-               holes = {"(440; 1K)"}
+               holes = {"(440; 32K)"}
        }
        partition root {
                offset = 2M
                image = "root.ext2"
-               partition-type = 0x83
+               partition-type-uuid = b921b045-1df0-41c3-af44-4c6f280d3fae
        }
 }
-- 
2.39.2




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

* [DistroKit] [PATCH 6/7] v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
                   ` (4 preceding siblings ...)
  2023-07-28 16:49 ` [DistroKit] [PATCH 5/7] v8a: imx8m: genimage: switch from MBR to GPT images Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-07-28 16:49 ` [DistroKit] [PATCH 7/7] v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image Ahmad Fatoum
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

Now that we are building barebox for the board, enable installation of
the kernel device trees, so we can boot a kernel with it. The necessary
kernel options are already enabled. As DDR4 and LPDDR4 differ in the
PMIC used, we enable two different device trees. barebox will choose the
correct one by comparing their DT compatible against its own.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v8a/platformconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index 88c814b87ad1..8486a1325d02 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -135,7 +135,7 @@ PTXCONF_KERNEL_IMAGE_RAW=y
 PTXCONF_KERNEL_IMAGE="Image"
 PTXCONF_KERNEL_DTB=y
 PTXCONF_KERNEL_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_KERNEL_DTS="armada-3720-community.dts freescale/imx8mm-evk.dts freescale/imx8mp-evk.dts freescale/imx8mq-evk.dts rockchip/rk3568-rock-3a.dts"
+PTXCONF_KERNEL_DTS="armada-3720-community.dts freescale/imx8mm-evk.dts freescale/imx8mn-ddr4-evk.dts freescale/imx8mn-ddr4-evk.dts freescale/imx8mp-evk.dts freescale/imx8mq-evk.dts rockchip/rk3568-rock-3a.dts"
 # PTXCONF_KERNEL_DTBO is not set
 # PTXCONF_KERNEL_CODE_SIGNING is not set
 # PTXCONF_KERNEL_ZSTD is not set
-- 
2.39.2




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

* [DistroKit] [PATCH 7/7] v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
                   ` (5 preceding siblings ...)
  2023-07-28 16:49 ` [DistroKit] [PATCH 6/7] v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs Ahmad Fatoum
@ 2023-07-28 16:49 ` Ahmad Fatoum
  2023-08-13 19:39 ` [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Roland Hieber
  2023-08-15  9:51 ` Robert Schwebel
  8 siblings, 0 replies; 10+ messages in thread
From: Ahmad Fatoum @ 2023-07-28 16:49 UTC (permalink / raw)
  To: distrokit; +Cc: Ahmad Fatoum

Everything is in place now to actually generate an image capable of
booting the i.MX8MN, so let's do it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 configs/platform-v8a/platformconfig           |  1 +
 .../platforms/image-imx8mn-evk.in             | 10 ++++++
 .../platform-v8a/rules/image-imx8mn-evk.make  | 35 +++++++++++++++++++
 3 files changed, 46 insertions(+)
 create mode 100644 configs/platform-v8a/platforms/image-imx8mn-evk.in
 create mode 100644 configs/platform-v8a/rules/image-imx8mn-evk.make

diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index 8486a1325d02..c0158f0b8369 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -245,6 +245,7 @@ PTXCONF_IMAGE_ESPRESSOBIN=y
 # PTXCONF_IMAGE_HD_VDI is not set
 # PTXCONF_IMAGE_HDIMG is not set
 PTXCONF_IMAGE_IMX8MM_EVK=y
+PTXCONF_IMAGE_IMX8MN_EVK=y
 PTXCONF_IMAGE_IMX8MP_EVK=y
 PTXCONF_IMAGE_IMX8MQ_EVK=y
 PTXCONF_IMAGE_KERNEL=y
diff --git a/configs/platform-v8a/platforms/image-imx8mn-evk.in b/configs/platform-v8a/platforms/image-imx8mn-evk.in
new file mode 100644
index 000000000000..4c242f0802ca
--- /dev/null
+++ b/configs/platform-v8a/platforms/image-imx8mn-evk.in
@@ -0,0 +1,10 @@
+## SECTION=image
+
+config IMAGE_IMX8MN_EVK
+	tristate
+	select HOST_GENIMAGE
+	select IMAGE_ROOT_EXT
+	select BAREBOX
+	prompt "Generate images/imx8mn-evk.img"
+	help
+	  Generate a bootable SD card image to deploy a NXP i.MX8MN-EVK board.
diff --git a/configs/platform-v8a/rules/image-imx8mn-evk.make b/configs/platform-v8a/rules/image-imx8mn-evk.make
new file mode 100644
index 000000000000..0d4edd56623a
--- /dev/null
+++ b/configs/platform-v8a/rules/image-imx8mn-evk.make
@@ -0,0 +1,35 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2023 by Ahmad Fatoum <a.fatoum@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_IMX8MN_EVK) += image-imx8mn-evk
+
+#
+# Paths and names
+#
+IMAGE_IMX8MN_EVK		:= image-imx8mn-evk
+IMAGE_IMX8MN_EVK_DIR	:= $(BUILDDIR)/$(IMAGE_IMX8MN_EVK)
+IMAGE_IMX8MN_EVK_IMAGE	:= $(IMAGEDIR)/imx8mn-evk.img
+IMAGE_IMX8MN_EVK_FILES	:= $(IMAGEDIR)/root.tgz
+IMAGE_IMX8MN_EVK_CONFIG	:= imx8m.config
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+IMAGE_IMX8MN_EVK_ENV := \
+        BAREBOX_IMAGE=barebox-nxp-imx8mn-evk.img
+
+$(IMAGE_IMX8MN_EVK_IMAGE):
+	@$(call targetinfo)
+	@$(call image/genimage, IMAGE_IMX8MN_EVK)
+	@$(call finish)
+
+# vim: syntax=make
-- 
2.39.2




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

* Re: [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
                   ` (6 preceding siblings ...)
  2023-07-28 16:49 ` [DistroKit] [PATCH 7/7] v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image Ahmad Fatoum
@ 2023-08-13 19:39 ` Roland Hieber
  2023-08-15  9:51 ` Robert Schwebel
  8 siblings, 0 replies; 10+ messages in thread
From: Roland Hieber @ 2023-08-13 19:39 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: distrokit

On Fri, Jul 28, 2023 at 06:49:26PM +0200, Ahmad Fatoum wrote:
> Kernel is already configured to support booting on i.MX8MN
> and all other components just need little tweaking in order
> for DistroKit to build a full SD-Card image for it, so let's do it.
> 
> This was tested on a DDR4 i.MX8MN EVK, but it should work equally
> well on the LPDDR4 variant.
> 
> I have a spare DDR4 EVK here, so I'll add it to CI once this PR is
> merged, so v8a CI is not limited to Rock-3A and there is at long
> last some automated on-device testing for DistroKit on i.MX8M.
> 
> Ahmad Fatoum (7):
>   v8a: imx8m: tf-a: build for i.MX8M Nano as well
>   v8a: imx8m: imx-firmware: install DDR4 PHY firmware
>   v8a: barebox: enable i.MX8M Nano EVK support
>   v8a: imx8m: use common genimage configuration
>   v8a: imx8m: genimage: switch from MBR to GPT images
>   v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs
>   v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image

Reviewed-by: Roland Hieber <rhi@pengutronix.de>

>  configs/platform-v8a/barebox.config           |  5 ++-
>  .../platform-v8a/config/images/imx8m.config   | 17 +++++++++
>  .../config/images/imx8mm-evk.config           | 17 ---------
>  .../config/images/imx8mp-evk.config           | 17 ---------
>  .../config/images/imx8mq-evk.config           | 17 ---------
>  configs/platform-v8a/platformconfig           |  5 +--
>  .../platforms/image-imx8mn-evk.in             | 10 ++++++
>  configs/platform-v8a/rules/firmware-imx.make  | 10 ++++++
>  .../platform-v8a/rules/image-imx8mm-evk.make  |  5 ++-
>  .../platform-v8a/rules/image-imx8mn-evk.make  | 35 +++++++++++++++++++
>  .../platform-v8a/rules/image-imx8mp-evk.make  |  5 ++-
>  .../platform-v8a/rules/image-imx8mq-evk.make  |  5 ++-
>  12 files changed, 91 insertions(+), 57 deletions(-)
>  create mode 100644 configs/platform-v8a/config/images/imx8m.config
>  delete mode 100644 configs/platform-v8a/config/images/imx8mm-evk.config
>  delete mode 100644 configs/platform-v8a/config/images/imx8mp-evk.config
>  delete mode 100644 configs/platform-v8a/config/images/imx8mq-evk.config
>  create mode 100644 configs/platform-v8a/platforms/image-imx8mn-evk.in
>  create mode 100644 configs/platform-v8a/rules/image-imx8mn-evk.make
> 
> -- 
> 2.39.2
> 
> 
> 

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |



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

* Re: [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano
  2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
                   ` (7 preceding siblings ...)
  2023-08-13 19:39 ` [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Roland Hieber
@ 2023-08-15  9:51 ` Robert Schwebel
  8 siblings, 0 replies; 10+ messages in thread
From: Robert Schwebel @ 2023-08-15  9:51 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: distrokit

Applied series to next, testing.

rsc

On Fri, Jul 28, 2023 at 06:49:26PM +0200, Ahmad Fatoum wrote:
> Kernel is already configured to support booting on i.MX8MN
> and all other components just need little tweaking in order
> for DistroKit to build a full SD-Card image for it, so let's do it.
> 
> This was tested on a DDR4 i.MX8MN EVK, but it should work equally
> well on the LPDDR4 variant.
> 
> I have a spare DDR4 EVK here, so I'll add it to CI once this PR is
> merged, so v8a CI is not limited to Rock-3A and there is at long
> last some automated on-device testing for DistroKit on i.MX8M.
> 
> Ahmad Fatoum (7):
>   v8a: imx8m: tf-a: build for i.MX8M Nano as well
>   v8a: imx8m: imx-firmware: install DDR4 PHY firmware
>   v8a: barebox: enable i.MX8M Nano EVK support
>   v8a: imx8m: use common genimage configuration
>   v8a: imx8m: genimage: switch from MBR to GPT images
>   v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs
>   v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image
> 
>  configs/platform-v8a/barebox.config           |  5 ++-
>  .../platform-v8a/config/images/imx8m.config   | 17 +++++++++
>  .../config/images/imx8mm-evk.config           | 17 ---------
>  .../config/images/imx8mp-evk.config           | 17 ---------
>  .../config/images/imx8mq-evk.config           | 17 ---------
>  configs/platform-v8a/platformconfig           |  5 +--
>  .../platforms/image-imx8mn-evk.in             | 10 ++++++
>  configs/platform-v8a/rules/firmware-imx.make  | 10 ++++++
>  .../platform-v8a/rules/image-imx8mm-evk.make  |  5 ++-
>  .../platform-v8a/rules/image-imx8mn-evk.make  | 35 +++++++++++++++++++
>  .../platform-v8a/rules/image-imx8mp-evk.make  |  5 ++-
>  .../platform-v8a/rules/image-imx8mq-evk.make  |  5 ++-
>  12 files changed, 91 insertions(+), 57 deletions(-)
>  create mode 100644 configs/platform-v8a/config/images/imx8m.config
>  delete mode 100644 configs/platform-v8a/config/images/imx8mm-evk.config
>  delete mode 100644 configs/platform-v8a/config/images/imx8mp-evk.config
>  delete mode 100644 configs/platform-v8a/config/images/imx8mq-evk.config
>  create mode 100644 configs/platform-v8a/platforms/image-imx8mn-evk.in
>  create mode 100644 configs/platform-v8a/rules/image-imx8mn-evk.make
> 
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           | Dipl.-Ing. Robert Schwebel  |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |



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

end of thread, other threads:[~2023-08-15  9:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28 16:49 [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 1/7] v8a: imx8m: tf-a: build for i.MX8M Nano as well Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 2/7] v8a: imx8m: imx-firmware: install DDR4 PHY firmware Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 3/7] v8a: barebox: enable i.MX8M Nano EVK support Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 4/7] v8a: imx8m: use common genimage configuration Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 5/7] v8a: imx8m: genimage: switch from MBR to GPT images Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 6/7] v8a: imx8m: include i.MX8MN DDR4 and LPDDR4 EVK DT in rootfs Ahmad Fatoum
2023-07-28 16:49 ` [DistroKit] [PATCH 7/7] v8a: imx8m: genimage: build i.MX8M Nano SD/eMMC image Ahmad Fatoum
2023-08-13 19:39 ` [DistroKit] [PATCH 0/7] v8a: imx8m: build image for i.MX8M Nano Roland Hieber
2023-08-15  9:51 ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox