All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
@ 2019-07-22  2:12 Peng Fan
  2019-07-22  2:12 ` [U-Boot] [PATCH V3 1/5] imx8: support parsing i.MX8 Container file Peng Fan
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  2:12 UTC (permalink / raw)
  To: u-boot

V3:
 Drops patch 1/5 from V2, add 8QM support, nothing else changed.
 Stefano,
 This patchset was pending in patchwork for more that one month,
 please consider to apply.

V2:
 Drop cleanup Makefile since V1, that patch is not correct.
 Rebased on master

The V2 version:
https://patchwork.ozlabs.org/cover/1118413/

The V1 version:
https://patchwork.ozlabs.org/cover/1096334/

This patchset is to support i.MX8 container loading from SPL,
i.MX8 AHAB secure boot not support FIT image, so we need to
use container image.

Currently still use a fixed offset for the 2nd container(u-boot.cnt),
future patches will drop this fixed offset and use dynamaic offset
according to the size of 1st container for spl.
Only MMC is supported now, future patches will also support SPI/NOR/NAND
following similar style as mmc part, if the mmc part is ok.

Based on the comments in https://patchwork.ozlabs.org/patch/1096336/
So I think we have agreed the approach, the only comments that
not addressed from Lukasz is add doc for the container format.
The detailed format could be found in RM
https://www.nxp.com/docs/en/reference-manual/IMX8DQXPRM.pdf
Chapter 5.9.4 High Level Container Format

CI: https://travis-ci.org/MrVan/u-boot/builds/547161366

Peng Fan (5):
  imx8: support parsing i.MX8 Container file
  spl: mmc: support loading i.MX container format file
  imx: add container target
  imx8qxp_mek: switch to use container image
  imx8qm_mek: switch to use container image

 Makefile                                        |   8 ++
 arch/arm/include/asm/arch-imx8/image.h          |  56 +++++++++++
 arch/arm/mach-imx/Makefile                      |  14 ++-
 arch/arm/mach-imx/imx8/Kconfig                  |  13 +++
 arch/arm/mach-imx/imx8/Makefile                 |   4 +
 arch/arm/mach-imx/imx8/parse-container.c        | 120 ++++++++++++++++++++++++
 board/freescale/imx8qm_mek/README               |   4 +-
 board/freescale/imx8qm_mek/uboot-container.cfg  |  13 +++
 board/freescale/imx8qxp_mek/README              |   4 +-
 board/freescale/imx8qxp_mek/uboot-container.cfg |  13 +++
 common/spl/spl_mmc.c                            |  10 ++
 configs/imx8qm_mek_defconfig                    |   8 +-
 configs/imx8qxp_mek_defconfig                   |   5 +-
 include/spl.h                                   |  12 +++
 14 files changed, 270 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-imx8/image.h
 create mode 100644 arch/arm/mach-imx/imx8/parse-container.c
 create mode 100644 board/freescale/imx8qm_mek/uboot-container.cfg
 create mode 100644 board/freescale/imx8qxp_mek/uboot-container.cfg

-- 
2.16.4

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

* [U-Boot] [PATCH V3 1/5] imx8: support parsing i.MX8 Container file
  2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
@ 2019-07-22  2:12 ` Peng Fan
  2019-07-22  2:12 ` [U-Boot] [PATCH V3 2/5] spl: mmc: support loading i.MX container format file Peng Fan
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  2:12 UTC (permalink / raw)
  To: u-boot

Add parsing i.MX8 Container file support, this is to let
SPL could load images in a container file to destination address.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 arch/arm/include/asm/arch-imx8/image.h   |  56 +++++++++++++++
 arch/arm/mach-imx/imx8/Kconfig           |   6 ++
 arch/arm/mach-imx/imx8/Makefile          |   4 ++
 arch/arm/mach-imx/imx8/parse-container.c | 120 +++++++++++++++++++++++++++++++
 4 files changed, 186 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-imx8/image.h
 create mode 100644 arch/arm/mach-imx/imx8/parse-container.c

diff --git a/arch/arm/include/asm/arch-imx8/image.h b/arch/arm/include/asm/arch-imx8/image.h
new file mode 100644
index 0000000000..c1e5700859
--- /dev/null
+++ b/arch/arm/include/asm/arch-imx8/image.h
@@ -0,0 +1,56 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2018-2019 NXP
+ */
+
+#ifndef __CONTAINER_HEADER_H_
+#define __CONTAINER_HEADER_H_
+
+#include <linux/sizes.h>
+#include <linux/types.h>
+
+#define IV_MAX_LEN			32
+#define HASH_MAX_LEN			64
+
+#define CONTAINER_HDR_ALIGNMENT 0x400
+#define CONTAINER_HDR_EMMC_OFFSET 0
+#define CONTAINER_HDR_MMCSD_OFFSET SZ_32K
+#define CONTAINER_HDR_QSPI_OFFSET SZ_4K
+#define CONTAINER_HDR_NAND_OFFSET SZ_128M
+
+struct container_hdr {
+	u8 version;
+	u8 length_lsb;
+	u8 length_msb;
+	u8 tag;
+	u32 flags;
+	u16 sw_version;
+	u8 fuse_version;
+	u8 num_images;
+	u16 sig_blk_offset;
+	u16 reserved;
+} __packed;
+
+struct boot_img_t {
+	u32 offset;
+	u32 size;
+	u64 dst;
+	u64 entry;
+	u32 hab_flags;
+	u32 meta;
+	u8 hash[HASH_MAX_LEN];
+	u8 iv[IV_MAX_LEN];
+} __packed;
+
+struct signature_block_hdr {
+	u8 version;
+	u8 length_lsb;
+	u8 length_msb;
+	u8 tag;
+	u16 srk_table_offset;
+	u16 cert_offset;
+	u16 blob_offset;
+	u16 signature_offset;
+	u32 reserved;
+} __packed;
+#endif
diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
index bbe323d5ca..e9496cb611 100644
--- a/arch/arm/mach-imx/imx8/Kconfig
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -23,6 +23,12 @@ config IMX8QXP
 config SYS_SOC
 	default "imx8"
 
+config SPL_LOAD_IMX_CONTAINER
+	bool "Enable SPL loading U-Boot as a i.MX Container image"
+	depends on SPL
+	help
+	  This is to let SPL could load i.MX8 Container image
+
 choice
 	prompt "i.MX8 board select"
 	optional
diff --git a/arch/arm/mach-imx/imx8/Makefile b/arch/arm/mach-imx/imx8/Makefile
index 92b5c56acb..5f62b2826e 100644
--- a/arch/arm/mach-imx/imx8/Makefile
+++ b/arch/arm/mach-imx/imx8/Makefile
@@ -5,3 +5,7 @@
 #
 
 obj-y += cpu.o iomux.o misc.o
+
+ifdef CONFIG_SPL_BUILD
+obj-$(CONFIG_SPL_LOAD_IMX_CONTAINER) += parse-container.o
+endif
diff --git a/arch/arm/mach-imx/imx8/parse-container.c b/arch/arm/mach-imx/imx8/parse-container.c
new file mode 100644
index 0000000000..32f78bdddf
--- /dev/null
+++ b/arch/arm/mach-imx/imx8/parse-container.c
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright 2018-2019 NXP
+ */
+
+#include <common.h>
+#include <errno.h>
+#include <spl.h>
+#include <asm/arch/image.h>
+
+static struct boot_img_t *read_auth_image(struct spl_image_info *spl_image,
+					  struct spl_load_info *info,
+					  struct container_hdr *container,
+					  int image_index,
+					  u32 container_sector)
+{
+	struct boot_img_t *images;
+	ulong sector;
+	u32 sectors;
+
+	if (image_index > container->num_images) {
+		debug("Invalid image number\n");
+		return NULL;
+	}
+
+	images = (struct boot_img_t *)((u8 *)container +
+				       sizeof(struct container_hdr));
+
+	if (images[image_index].offset % info->bl_len) {
+		printf("%s: image%d offset not aligned to %u\n",
+		       __func__, image_index, info->bl_len);
+		return NULL;
+	}
+
+	sectors = roundup(images[image_index].size, info->bl_len) /
+		info->bl_len;
+	sector = images[image_index].offset / info->bl_len +
+		container_sector;
+
+	debug("%s: container: %p sector: %lu sectors: %u\n", __func__,
+	      container, sector, sectors);
+	if (info->read(info, sector, sectors,
+		       (void *)images[image_index].entry) != sectors) {
+		printf("%s wrong\n", __func__);
+		return NULL;
+	}
+
+	return &images[image_index];
+}
+
+static int read_auth_container(struct spl_image_info *spl_image,
+			       struct spl_load_info *info, ulong sector)
+{
+	struct container_hdr *container = NULL;
+	u16 length;
+	u32 sectors;
+	int i, size;
+
+	size = roundup(CONTAINER_HDR_ALIGNMENT, info->bl_len);
+	sectors = size / info->bl_len;
+
+	/*
+	 * It will not override the ATF code, so safe to use it here,
+	 * no need malloc
+	 */
+	container = (struct container_hdr *)spl_get_load_buffer(-size, size);
+
+	debug("%s: container: %p sector: %lu sectors: %u\n", __func__,
+	      container, sector, sectors);
+	if (info->read(info, sector, sectors, container) != sectors)
+		return -EIO;
+
+	if (container->tag != 0x87 && container->version != 0x0) {
+		printf("Wrong container header");
+		return -ENOENT;
+	}
+
+	if (!container->num_images) {
+		printf("Wrong container, no image found");
+		return -ENOENT;
+	}
+
+	length = container->length_lsb + (container->length_msb << 8);
+	debug("Container length %u\n", length);
+
+	if (length > CONTAINER_HDR_ALIGNMENT) {
+		size = roundup(length, info->bl_len);
+		sectors = size / info->bl_len;
+
+		container = (struct container_hdr *)spl_get_load_buffer(-size, size);
+
+		debug("%s: container: %p sector: %lu sectors: %u\n",
+		      __func__, container, sector, sectors);
+		if (info->read(info, sector, sectors, container) !=
+		    sectors)
+			return -EIO;
+	}
+
+	for (i = 0; i < container->num_images; i++) {
+		struct boot_img_t *image = read_auth_image(spl_image, info,
+							   container, i,
+							   sector);
+
+		if (!image)
+			return -EINVAL;
+
+		if (i == 0) {
+			spl_image->load_addr = image->dst;
+			spl_image->entry_point = image->entry;
+		}
+	}
+
+	return 0;
+}
+
+int spl_load_imx_container(struct spl_image_info *spl_image,
+			   struct spl_load_info *info, ulong sector)
+{
+	return read_auth_container(spl_image, info, sector);
+}
-- 
2.16.4

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

* [U-Boot] [PATCH V3 2/5] spl: mmc: support loading i.MX container format file
  2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
  2019-07-22  2:12 ` [U-Boot] [PATCH V3 1/5] imx8: support parsing i.MX8 Container file Peng Fan
@ 2019-07-22  2:12 ` Peng Fan
  2019-07-22  2:13 ` [U-Boot] [PATCH V3 3/5] imx: add container target Peng Fan
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  2:12 UTC (permalink / raw)
  To: u-boot

i.MX8 only support AHAB secure boot with Container format image,
we could not use FIT to support secure boot, so introduce container
support to let SPL could load container images.

Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
Cc: Tien Fong Chee <tien.fong.chee@intel.com>
Cc: York Sun <york.sun@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Alex Kiernan <alex.kiernan@gmail.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Kever Yang <kever.yang@rock-chips.com>
Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 common/spl/spl_mmc.c | 10 ++++++++++
 include/spl.h        | 12 ++++++++++++
 2 files changed, 22 insertions(+)

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index b3619889f7..6c6eaf4ec8 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -79,6 +79,16 @@ int mmc_load_image_raw_sector(struct spl_image_info *spl_image,
 		load.bl_len = mmc->read_bl_len;
 		load.read = h_spl_load_read;
 		ret = spl_load_simple_fit(spl_image, &load, sector, header);
+	} else if (IS_ENABLED(CONFIG_SPL_LOAD_IMX_CONTAINER)) {
+		struct spl_load_info load;
+
+		load.dev = mmc;
+		load.priv = NULL;
+		load.filename = NULL;
+		load.bl_len = mmc->read_bl_len;
+		load.read = h_spl_load_read;
+
+		ret = spl_load_imx_container(spl_image, &load, sector);
 	} else {
 		ret = mmc_load_legacy(spl_image, mmc, sector, header);
 	}
diff --git a/include/spl.h b/include/spl.h
index a90f971a23..a984ccef25 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -134,6 +134,18 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
 #define SPL_COPY_PAYLOAD_ONLY	1
 #define SPL_FIT_FOUND		2
 
+/**
+ * spl_load_imx_container() - Loads a imx container image from a device.
+ * @spl_image:	Image description to set up
+ * @info:	Structure containing the information required to load data.
+ * @sector:	Sector number where container image is located in the device
+ *
+ * Reads the container image @sector in the device. Loads u-boot image to
+ * specified load address.
+ */
+int spl_load_imx_container(struct spl_image_info *spl_image,
+			   struct spl_load_info *info, ulong sector);
+
 /* SPL common functions */
 void preloader_console_init(void);
 u32 spl_boot_device(void);
-- 
2.16.4

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

* [U-Boot] [PATCH V3 3/5] imx: add container target
  2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
  2019-07-22  2:12 ` [U-Boot] [PATCH V3 1/5] imx8: support parsing i.MX8 Container file Peng Fan
  2019-07-22  2:12 ` [U-Boot] [PATCH V3 2/5] spl: mmc: support loading i.MX container format file Peng Fan
@ 2019-07-22  2:13 ` Peng Fan
  2019-07-22  2:13 ` [U-Boot] [PATCH V3 4/5] imx8qxp_mek: switch to use container image Peng Fan
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  2:13 UTC (permalink / raw)
  To: u-boot

To support SPL loading container file, add a new Makefile target,
and introduce a new Kconfig file to source the cfg file which
will be parsed by mkimage.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 Makefile                       |  8 ++++++++
 arch/arm/mach-imx/Makefile     | 14 ++++++++++++--
 arch/arm/mach-imx/imx8/Kconfig |  7 +++++++
 3 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 73fdf70cdd..d658469d05 100644
--- a/Makefile
+++ b/Makefile
@@ -1330,9 +1330,17 @@ SPL: spl/u-boot-spl.bin FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
 
 ifeq ($(CONFIG_ARCH_IMX8M)$(CONFIG_ARCH_IMX8), y)
+ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y)
+u-boot.cnt: u-boot.bin FORCE
+	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+
+flash.bin: spl/u-boot-spl.bin u-boot.cnt FORCE
+	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
+else
 flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
 endif
+endif
 
 u-boot-with-spl.imx u-boot-with-nand-spl.imx: SPL u-boot.bin FORCE
 	$(Q)$(MAKE) $(build)=arch/arm/mach-imx $@
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index 08ee52edbf..17b241ae99 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -90,6 +90,11 @@ IMX_CONFIG = $(CONFIG_IMX_CONFIG:"%"=%)
 	$(Q)mkdir -p $(dir $@)
 	$(call if_changed_dep,cpp_cfg)
 
+IMX_CONTAINER_CFG = $(CONFIG_IMX_CONTAINER_CFG:"%"=%)
+container.cfg: $(IMX_CONTAINER_CFG) FORCE
+	$(Q)mkdir -p $(dir $@)
+	$(call if_changed_dep,cpp_cfg)
+
 ifeq ($(CONFIG_ARCH_IMX8), y)
 CNTR_DEPFILES := $(srctree)/tools/imx_cntr_image.sh
 IMAGE_TYPE := imx8image
@@ -158,10 +163,15 @@ SPL:
 MKIMAGEFLAGS_flash.bin = -n spl/u-boot-spl.cfgout -T $(IMAGE_TYPE) -e 0x100000
 flash.bin: MKIMAGEOUTPUT = flash.log
 
-flash.bin: spl/u-boot-spl.bin u-boot.itb FORCE
-ifeq ($(SPL_DEPFILE_EXISTS),0)
+MKIMAGEFLAGS_u-boot.cnt = -n container.cfg -T $(IMAGE_TYPE) -e 0x100000
+u-boot.cnt: MKIMAGEOUTPUT = u-boot.cnt.log
+
+ifeq ($(CONFIG_SPL_LOAD_IMX_CONTAINER), y)
+u-boot.cnt: u-boot.bin container.cfg FORCE
 	$(call if_changed,mkimage)
 endif
+flash.bin: spl/u-boot-spl.bin FORCE
+	$(call if_changed,mkimage)
 endif
 
 else
diff --git a/arch/arm/mach-imx/imx8/Kconfig b/arch/arm/mach-imx/imx8/Kconfig
index e9496cb611..d17760e333 100644
--- a/arch/arm/mach-imx/imx8/Kconfig
+++ b/arch/arm/mach-imx/imx8/Kconfig
@@ -29,6 +29,13 @@ config SPL_LOAD_IMX_CONTAINER
 	help
 	  This is to let SPL could load i.MX8 Container image
 
+config IMX_CONTAINER_CFG
+	string "i.MX Container config file"
+	depends on SPL
+	help
+	  This is to specific the cfg file for generating container
+	  image which will be loaded by SPL.
+
 choice
 	prompt "i.MX8 board select"
 	optional
-- 
2.16.4

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

* [U-Boot] [PATCH V3 4/5] imx8qxp_mek: switch to use container image
  2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
                   ` (2 preceding siblings ...)
  2019-07-22  2:13 ` [U-Boot] [PATCH V3 3/5] imx: add container target Peng Fan
@ 2019-07-22  2:13 ` Peng Fan
  2019-07-22  2:13 ` [U-Boot] [PATCH V3 5/5] imx8qm_mek: " Peng Fan
  2019-07-22  7:41 ` [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Schrempf Frieder
  5 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  2:13 UTC (permalink / raw)
  To: u-boot

Because FIT could not be used for AHAB secure boot on i.MX8,
so switch to use container image that could let SPL verify
ATF and U-Boot with AHAB.

Note: The AHAB related code has not been added.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/freescale/imx8qxp_mek/README              |  4 +---
 board/freescale/imx8qxp_mek/uboot-container.cfg | 13 +++++++++++++
 configs/imx8qxp_mek_defconfig                   |  5 ++---
 3 files changed, 16 insertions(+), 6 deletions(-)
 create mode 100644 board/freescale/imx8qxp_mek/uboot-container.cfg

diff --git a/board/freescale/imx8qxp_mek/README b/board/freescale/imx8qxp_mek/README
index f32290e3a2..6dc151b166 100644
--- a/board/freescale/imx8qxp_mek/README
+++ b/board/freescale/imx8qxp_mek/README
@@ -39,11 +39,9 @@ $ cp imx-sc-firmware-0.7/mx8qx-mek-scfw-tcm.bin	.
 
 Build U-Boot
 ============
-$ export ATF_LOAD_ADDR=0x80000000
-$ export BL33_LOAD_ADDR=0x80020000
 $ make imx8qxp_mek_defconfig
 $ make flash.bin
-$ dd if=u-boot.itb of=flash.bin bs=512 seek=528
+$ dd if=u-boot.cnt of=flash.bin bs=512 seek=528
 
 Flash the binary into the SD card
 =================================
diff --git a/board/freescale/imx8qxp_mek/uboot-container.cfg b/board/freescale/imx8qxp_mek/uboot-container.cfg
new file mode 100644
index 0000000000..8165811818
--- /dev/null
+++ b/board/freescale/imx8qxp_mek/uboot-container.cfg
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 NXP
+ */
+
+#define __ASSEMBLY__
+
+/* This file is to create a container image could be loaded by SPL */
+BOOT_FROM SD 0x400
+SOC_TYPE IMX8QX
+CONTAINER
+IMAGE A35 bl31.bin	0x80000000
+IMAGE A35 u-boot.bin	CONFIG_SYS_TEXT_BASE
diff --git a/configs/imx8qxp_mek_defconfig b/configs/imx8qxp_mek_defconfig
index cf83a671f7..23fdccdee5 100644
--- a/configs/imx8qxp_mek_defconfig
+++ b/configs/imx8qxp_mek_defconfig
@@ -7,15 +7,14 @@ CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_SPL_LOAD_IMX_CONTAINER=y
+CONFIG_IMX_CONTAINER_CFG="board/freescale/imx8qxp_mek/uboot-container.cfg"
 CONFIG_TARGET_IMX8QXP_MEK=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_SPL=y
-CONFIG_FIT=y
-CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8qxp_mek/imximage.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_LOG=y
-- 
2.16.4

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

* [U-Boot] [PATCH V3 5/5] imx8qm_mek: switch to use container image
  2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
                   ` (3 preceding siblings ...)
  2019-07-22  2:13 ` [U-Boot] [PATCH V3 4/5] imx8qxp_mek: switch to use container image Peng Fan
@ 2019-07-22  2:13 ` Peng Fan
  2019-07-22  7:41 ` [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Schrempf Frieder
  5 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  2:13 UTC (permalink / raw)
  To: u-boot

Because FIT could not be used for AHAB secure boot on i.MX8,
so switch to use container image that could let SPL verify
ATF and U-Boot with AHAB.

Enable HUSH_PARSER in defconfig to make run netboot could work.

Note: The AHAB related code has not been added.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 board/freescale/imx8qm_mek/README              |  4 +---
 board/freescale/imx8qm_mek/uboot-container.cfg | 13 +++++++++++++
 configs/imx8qm_mek_defconfig                   |  8 +++++---
 3 files changed, 19 insertions(+), 6 deletions(-)
 create mode 100644 board/freescale/imx8qm_mek/uboot-container.cfg

diff --git a/board/freescale/imx8qm_mek/README b/board/freescale/imx8qm_mek/README
index c3523801ae..ebf630c446 100644
--- a/board/freescale/imx8qm_mek/README
+++ b/board/freescale/imx8qm_mek/README
@@ -39,11 +39,9 @@ $ cp imx-sc-firmware-0.7/mx8qm-mek-scfw-tcm.bin	.
 
 Build U-Boot
 ============
-$ export ATF_LOAD_ADDR=0x80000000
-$ export BL33_LOAD_ADDR=0x80020000
 $ make imx8qm_mek_defconfig
 $ make flash.bin
-$ dd if=u-boot.itb of=flash.bin bs=512 seek=1984
+$ dd if=u-boot.cnt of=flash.bin bs=512 seek=1984
 
 Flash the binary into the SD card
 =================================
diff --git a/board/freescale/imx8qm_mek/uboot-container.cfg b/board/freescale/imx8qm_mek/uboot-container.cfg
new file mode 100644
index 0000000000..6cc47cd102
--- /dev/null
+++ b/board/freescale/imx8qm_mek/uboot-container.cfg
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2019 NXP
+ */
+
+#define __ASSEMBLY__
+
+/* This file is to create a container image could be loaded by SPL */
+BOOT_FROM SD 0x400
+SOC_TYPE IMX8QM
+CONTAINER
+IMAGE A35 bl31.bin	0x80000000
+IMAGE A35 u-boot.bin	CONFIG_SYS_TEXT_BASE
diff --git a/configs/imx8qm_mek_defconfig b/configs/imx8qm_mek_defconfig
index aa23b9caa3..42742bdd3c 100644
--- a/configs/imx8qm_mek_defconfig
+++ b/configs/imx8qm_mek_defconfig
@@ -6,23 +6,25 @@ CONFIG_SYS_TEXT_BASE=0x80020000
 CONFIG_SPL_GPIO_SUPPORT=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_SYS_MALLOC_F_LEN=0x4000
+CONFIG_SPL_LOAD_IMX_CONTAINER=y
+CONFIG_IMX_CONTAINER_CFG="board/freescale/imx8qm_mek/uboot-container.cfg"
 CONFIG_TARGET_IMX8QM_MEK=y
 CONFIG_SPL_MMC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_DRIVERS_MISC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=3
 CONFIG_SPL=y
-CONFIG_FIT=y
-CONFIG_SPL_LOAD_FIT=y
-CONFIG_SPL_FIT_GENERATOR="arch/arm/mach-imx/mkimage_fit_atf.sh"
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/imx8qm_mek/imximage.cfg"
 CONFIG_BOOTDELAY=3
 CONFIG_LOG=y
 CONFIG_SPL_BOARD_INIT=y
+CONFIG_SPL_SYS_MALLOC_SIMPLE=y
 CONFIG_SPL_SEPARATE_BSS=y
 CONFIG_SPL_POWER_SUPPORT=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_WATCHDOG_SUPPORT=y
+CONFIG_HUSH_PARSER=y
 CONFIG_CMD_CPU=y
 # CONFIG_CMD_IMPORTENV is not set
 CONFIG_CMD_CLK=y
-- 
2.16.4

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

* [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
  2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
                   ` (4 preceding siblings ...)
  2019-07-22  2:13 ` [U-Boot] [PATCH V3 5/5] imx8qm_mek: " Peng Fan
@ 2019-07-22  7:41 ` Schrempf Frieder
  2019-07-22  8:08   ` Peng Fan
  5 siblings, 1 reply; 11+ messages in thread
From: Schrempf Frieder @ 2019-07-22  7:41 UTC (permalink / raw)
  To: u-boot

On 22.07.19 04:12, Peng Fan wrote:
> V3:
>   Drops patch 1/5 from V2, add 8QM support, nothing else changed.
>   Stefano,
>   This patchset was pending in patchwork for more that one month,
>   please consider to apply.

I'm not the one to judge here and I don't know the rules for U-Boot, but 
only because they have been pending for a long time, doesn't make the 
patches more suitable for upstream. Even more so, if no one has reviewed 
them yet.

> 
> V2:
>   Drop cleanup Makefile since V1, that patch is not correct.
>   Rebased on master
> 
> The V2 version:
> https://patchwork.ozlabs.org/cover/1118413/
> 
> The V1 version:
> https://patchwork.ozlabs.org/cover/1096334/
> 
> This patchset is to support i.MX8 container loading from SPL,
> i.MX8 AHAB secure boot not support FIT image, so we need to
> use container image.
> 
> Currently still use a fixed offset for the 2nd container(u-boot.cnt),
> future patches will drop this fixed offset and use dynamaic offset
> according to the size of 1st container for spl.
> Only MMC is supported now, future patches will also support SPI/NOR/NAND
> following similar style as mmc part, if the mmc part is ok.
> 
> Based on the comments in https://patchwork.ozlabs.org/patch/1096336/
> So I think we have agreed the approach, the only comments that
> not addressed from Lukasz is add doc for the container format.

So why didn't you add some docs? I support Lukasz's request for a proper 
documentation in some README file. I found it already hard enough to 
find information about the current boot process of the i.MX8 and if you 
need to add even more complexity, please add docs before this gets merged.

> The detailed format could be found in RM
> https://www.nxp.com/docs/en/reference-manual/IMX8DQXPRM.pdf
> Chapter 5.9.4 High Level Container Format
> 
> CI: https://travis-ci.org/MrVan/u-boot/builds/547161366
> 
> Peng Fan (5):
>    imx8: support parsing i.MX8 Container file
>    spl: mmc: support loading i.MX container format file
>    imx: add container target
>    imx8qxp_mek: switch to use container image
>    imx8qm_mek: switch to use container image
> 
>   Makefile                                        |   8 ++
>   arch/arm/include/asm/arch-imx8/image.h          |  56 +++++++++++
>   arch/arm/mach-imx/Makefile                      |  14 ++-
>   arch/arm/mach-imx/imx8/Kconfig                  |  13 +++
>   arch/arm/mach-imx/imx8/Makefile                 |   4 +
>   arch/arm/mach-imx/imx8/parse-container.c        | 120 ++++++++++++++++++++++++
>   board/freescale/imx8qm_mek/README               |   4 +-
>   board/freescale/imx8qm_mek/uboot-container.cfg  |  13 +++
>   board/freescale/imx8qxp_mek/README              |   4 +-
>   board/freescale/imx8qxp_mek/uboot-container.cfg |  13 +++
>   common/spl/spl_mmc.c                            |  10 ++
>   configs/imx8qm_mek_defconfig                    |   8 +-
>   configs/imx8qxp_mek_defconfig                   |   5 +-
>   include/spl.h                                   |  12 +++
>   14 files changed, 270 insertions(+), 14 deletions(-)
>   create mode 100644 arch/arm/include/asm/arch-imx8/image.h
>   create mode 100644 arch/arm/mach-imx/imx8/parse-container.c
>   create mode 100644 board/freescale/imx8qm_mek/uboot-container.cfg
>   create mode 100644 board/freescale/imx8qxp_mek/uboot-container.cfg
> 

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

* [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
  2019-07-22  7:41 ` [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Schrempf Frieder
@ 2019-07-22  8:08   ` Peng Fan
  2019-07-22  9:35     ` Schrempf Frieder
  2019-07-22 14:03     ` Wolfgang Denk
  0 siblings, 2 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  8:08 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
> 
> On 22.07.19 04:12, Peng Fan wrote:
> > V3:
> >   Drops patch 1/5 from V2, add 8QM support, nothing else changed.
> >   Stefano,
> >   This patchset was pending in patchwork for more that one month,
> >   please consider to apply.
> 
> I'm not the one to judge here and I don't know the rules for U-Boot, but only
> because they have been pending for a long time, doesn't make the patches
> more suitable for upstream. Even more so, if no one has reviewed them yet.

Since it was there long time, I just thought no one has comments.

> 
> >
> > V2:
> >   Drop cleanup Makefile since V1, that patch is not correct.
> >   Rebased on master
> >
> > The V2 version:
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.ozlabs.org%2Fcover%2F1118413%2F&amp;data=02%7C01%7Cpeng.fan
> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b4c
> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=xUcj
> AnqE2WHa2yPppBDx2Og8yv8McyWEaULsJOEzNmk%3D&amp;reserved=0
> >
> > The V1 version:
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.ozlabs.org%2Fcover%2F1096334%2F&amp;data=02%7C01%7Cpeng.fan
> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b4c
> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=o4
> Wbxso8J5HuHlvMvnuKsNK8rDFUSEtItv0Yh0ITeQg%3D&amp;reserved=0
> >
> > This patchset is to support i.MX8 container loading from SPL,
> > i.MX8 AHAB secure boot not support FIT image, so we need to
> > use container image.
> >
> > Currently still use a fixed offset for the 2nd container(u-boot.cnt),
> > future patches will drop this fixed offset and use dynamaic offset
> > according to the size of 1st container for spl.
> > Only MMC is supported now, future patches will also support
> SPI/NOR/NAND
> > following similar style as mmc part, if the mmc part is ok.
> >
> > Based on the comments in
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
> work.ozlabs.org%2Fpatch%2F1096336%2F&amp;data=02%7C01%7Cpeng.fan
> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b4c
> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=8aH
> Hmlu%2FZ6g6h20k%2BxIOrPfk3kG4yzwTE93aRucQ%2FCY%3D&amp;reserve
> d=0
> > So I think we have agreed the approach, the only comments that
> > not addressed from Lukasz is add doc for the container format.
> 
> So why didn't you add some docs? I support Lukasz's request for a proper
> documentation in some README file. I found it already hard enough to
> find information about the current boot process of the i.MX8 and if you
> need to add even more complexity, please add docs before this gets merged.

Not sure you are working i.MX8 and i.MX8M both. Or just i.MX8M.
There is a README in the i.MX8QM/QXP board file shows the steps to build images.
Or you wanna me to put the container format from Reference Manual
to U-Boot?

Regards,
Peng.
> 
> > The detailed format could be found in RM
> >
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
> nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX8DQXPRM.pdf&amp;da
> ta=02%7C01%7Cpeng.fan%40nxp.com%7C87ccfec5031249de3fde08d70e77f
> a9a%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636993780782
> 660409&amp;sdata=PMOVoEX30qwR3XDPBThWFWTU7qqFaaC6SyykGweIi2
> E%3D&amp;reserved=0
> > Chapter 5.9.4 High Level Container Format
> >
> > CI:
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-
> ci.org%2FMrVan%2Fu-boot%2Fbuilds%2F547161366&amp;data=02%7C01%7
> Cpeng.fan%40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1
> d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;s
> data=oPp3%2FyB2kpHj4sxi5n1xWPnf21foJ%2FroU21UXskqijM%3D&amp;res
> erved=0
> >
> > Peng Fan (5):
> >    imx8: support parsing i.MX8 Container file
> >    spl: mmc: support loading i.MX container format file
> >    imx: add container target
> >    imx8qxp_mek: switch to use container image
> >    imx8qm_mek: switch to use container image
> >
> >   Makefile                                        |   8 ++
> >   arch/arm/include/asm/arch-imx8/image.h          |  56
> +++++++++++
> >   arch/arm/mach-imx/Makefile                      |  14 ++-
> >   arch/arm/mach-imx/imx8/Kconfig                  |  13 +++
> >   arch/arm/mach-imx/imx8/Makefile                 |   4 +
> >   arch/arm/mach-imx/imx8/parse-container.c        | 120
> ++++++++++++++++++++++++
> >   board/freescale/imx8qm_mek/README               |   4 +-
> >   board/freescale/imx8qm_mek/uboot-container.cfg  |  13 +++
> >   board/freescale/imx8qxp_mek/README              |   4 +-
> >   board/freescale/imx8qxp_mek/uboot-container.cfg |  13 +++
> >   common/spl/spl_mmc.c                            |  10 ++
> >   configs/imx8qm_mek_defconfig                    |   8 +-
> >   configs/imx8qxp_mek_defconfig                   |   5 +-
> >   include/spl.h                                   |  12 +++
> >   14 files changed, 270 insertions(+), 14 deletions(-)
> >   create mode 100644 arch/arm/include/asm/arch-imx8/image.h
> >   create mode 100644 arch/arm/mach-imx/imx8/parse-container.c
> >   create mode 100644 board/freescale/imx8qm_mek/uboot-container.cfg
> >   create mode 100644 board/freescale/imx8qxp_mek/uboot-container.cfg
> >

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

* [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
  2019-07-22  8:08   ` Peng Fan
@ 2019-07-22  9:35     ` Schrempf Frieder
  2019-07-22  9:43       ` Peng Fan
  2019-07-22 14:03     ` Wolfgang Denk
  1 sibling, 1 reply; 11+ messages in thread
From: Schrempf Frieder @ 2019-07-22  9:35 UTC (permalink / raw)
  To: u-boot

On 22.07.19 10:08, Peng Fan wrote:
>> Subject: Re: [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
>>
>> On 22.07.19 04:12, Peng Fan wrote:
>>> V3:
>>>    Drops patch 1/5 from V2, add 8QM support, nothing else changed.
>>>    Stefano,
>>>    This patchset was pending in patchwork for more that one month,
>>>    please consider to apply.
>>
>> I'm not the one to judge here and I don't know the rules for U-Boot, but only
>> because they have been pending for a long time, doesn't make the patches
>> more suitable for upstream. Even more so, if no one has reviewed them yet.
> 
> Since it was there long time, I just thought no one has comments.
> 
>>
>>>
>>> V2:
>>>    Drop cleanup Makefile since V1, that patch is not correct.
>>>    Rebased on master
>>>
>>> The V2 version:
>>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
>> work.ozlabs.org%2Fcover%2F1118413%2F&amp;data=02%7C01%7Cpeng.fan
>> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b4c
>> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=xUcj
>> AnqE2WHa2yPppBDx2Og8yv8McyWEaULsJOEzNmk%3D&amp;reserved=0
>>>
>>> The V1 version:
>>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
>> work.ozlabs.org%2Fcover%2F1096334%2F&amp;data=02%7C01%7Cpeng.fan
>> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b4c
>> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=o4
>> Wbxso8J5HuHlvMvnuKsNK8rDFUSEtItv0Yh0ITeQg%3D&amp;reserved=0
>>>
>>> This patchset is to support i.MX8 container loading from SPL,
>>> i.MX8 AHAB secure boot not support FIT image, so we need to
>>> use container image.
>>>
>>> Currently still use a fixed offset for the 2nd container(u-boot.cnt),
>>> future patches will drop this fixed offset and use dynamaic offset
>>> according to the size of 1st container for spl.
>>> Only MMC is supported now, future patches will also support
>> SPI/NOR/NAND
>>> following similar style as mmc part, if the mmc part is ok.
>>>
>>> Based on the comments in
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatch
>> work.ozlabs.org%2Fpatch%2F1096336%2F&amp;data=02%7C01%7Cpeng.fan
>> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b4c
>> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=8aH
>> Hmlu%2FZ6g6h20k%2BxIOrPfk3kG4yzwTE93aRucQ%2FCY%3D&amp;reserve
>> d=0
>>> So I think we have agreed the approach, the only comments that
>>> not addressed from Lukasz is add doc for the container format.
>>
>> So why didn't you add some docs? I support Lukasz's request for a proper
>> documentation in some README file. I found it already hard enough to
>> find information about the current boot process of the i.MX8 and if you
>> need to add even more complexity, please add docs before this gets merged.
> 
> Not sure you are working i.MX8 and i.MX8M both. Or just i.MX8M.
> There is a README in the i.MX8QM/QXP board file shows the steps to build images.
> Or you wanna me to put the container format from Reference Manual
> to U-Boot?

For now I'm only working on i.MX8M. But if I ever would need to work on 
i.MX8, I would be glad to have a proper documentation of how the 
container format is used in U-Boot and what happens while booting. What 
happens in the different stages, which image is copied to what address 
and things like that.

Thanks,
Frieder

> 
> Regards,
> Peng.
>>
>>> The detailed format could be found in RM
>>>
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
>> nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX8DQXPRM.pdf&amp;da
>> ta=02%7C01%7Cpeng.fan%40nxp.com%7C87ccfec5031249de3fde08d70e77f
>> a9a%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636993780782
>> 660409&amp;sdata=PMOVoEX30qwR3XDPBThWFWTU7qqFaaC6SyykGweIi2
>> E%3D&amp;reserved=0
>>> Chapter 5.9.4 High Level Container Format
>>>
>>> CI:
>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftravis-
>> ci.org%2FMrVan%2Fu-boot%2Fbuilds%2F547161366&amp;data=02%7C01%7
>> Cpeng.fan%40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1
>> d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;s
>> data=oPp3%2FyB2kpHj4sxi5n1xWPnf21foJ%2FroU21UXskqijM%3D&amp;res
>> erved=0
>>>
>>> Peng Fan (5):
>>>     imx8: support parsing i.MX8 Container file
>>>     spl: mmc: support loading i.MX container format file
>>>     imx: add container target
>>>     imx8qxp_mek: switch to use container image
>>>     imx8qm_mek: switch to use container image
>>>
>>>    Makefile                                        |   8 ++
>>>    arch/arm/include/asm/arch-imx8/image.h          |  56
>> +++++++++++
>>>    arch/arm/mach-imx/Makefile                      |  14 ++-
>>>    arch/arm/mach-imx/imx8/Kconfig                  |  13 +++
>>>    arch/arm/mach-imx/imx8/Makefile                 |   4 +
>>>    arch/arm/mach-imx/imx8/parse-container.c        | 120
>> ++++++++++++++++++++++++
>>>    board/freescale/imx8qm_mek/README               |   4 +-
>>>    board/freescale/imx8qm_mek/uboot-container.cfg  |  13 +++
>>>    board/freescale/imx8qxp_mek/README              |   4 +-
>>>    board/freescale/imx8qxp_mek/uboot-container.cfg |  13 +++
>>>    common/spl/spl_mmc.c                            |  10 ++
>>>    configs/imx8qm_mek_defconfig                    |   8 +-
>>>    configs/imx8qxp_mek_defconfig                   |   5 +-
>>>    include/spl.h                                   |  12 +++
>>>    14 files changed, 270 insertions(+), 14 deletions(-)
>>>    create mode 100644 arch/arm/include/asm/arch-imx8/image.h
>>>    create mode 100644 arch/arm/mach-imx/imx8/parse-container.c
>>>    create mode 100644 board/freescale/imx8qm_mek/uboot-container.cfg
>>>    create mode 100644 board/freescale/imx8qxp_mek/uboot-container.cfg
>>>

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

* [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
  2019-07-22  9:35     ` Schrempf Frieder
@ 2019-07-22  9:43       ` Peng Fan
  0 siblings, 0 replies; 11+ messages in thread
From: Peng Fan @ 2019-07-22  9:43 UTC (permalink / raw)
  To: u-boot

> Subject: Re: [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
> 
> On 22.07.19 10:08, Peng Fan wrote:
> >> Subject: Re: [U-Boot] [PATCH V3 0/5] add i.MX8 container loading
> >> support
> >>
> >> On 22.07.19 04:12, Peng Fan wrote:
> >>> V3:
> >>>    Drops patch 1/5 from V2, add 8QM support, nothing else changed.
> >>>    Stefano,
> >>>    This patchset was pending in patchwork for more that one month,
> >>>    please consider to apply.
> >>
> >> I'm not the one to judge here and I don't know the rules for U-Boot,
> >> but only because they have been pending for a long time, doesn't make
> >> the patches more suitable for upstream. Even more so, if no one has
> reviewed them yet.
> >
> > Since it was there long time, I just thought no one has comments.
> >
> >>
> >>>
> >>> V2:
> >>>    Drop cleanup Makefile since V1, that patch is not correct.
> >>>    Rebased on master
> >>>
> >>> The V2 version:
> >>>
> >> https://patch
> >>
> work.ozlabs.org%2Fcover%2F1118413%2F&amp;data=02%7C01%7Cpeng.fan
> >> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b
> 4c
> >>
> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=xUcj
> >>
> AnqE2WHa2yPppBDx2Og8yv8McyWEaULsJOEzNmk%3D&amp;reserved=0
> >>>
> >>> The V1 version:
> >>>
> >> https://patch
> >>
> work.ozlabs.org%2Fcover%2F1096334%2F&amp;data=02%7C01%7Cpeng.fan
> >> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b
> 4c
> >>
> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=o4
> >> Wbxso8J5HuHlvMvnuKsNK8rDFUSEtItv0Yh0ITeQg%3D&amp;reserved=0
> >>>
> >>> This patchset is to support i.MX8 container loading from SPL,
> >>> i.MX8 AHAB secure boot not support FIT image, so we need to use
> >>> container image.
> >>>
> >>> Currently still use a fixed offset for the 2nd
> >>> container(u-boot.cnt), future patches will drop this fixed offset
> >>> and use dynamaic offset according to the size of 1st container for spl.
> >>> Only MMC is supported now, future patches will also support
> >> SPI/NOR/NAND
> >>> following similar style as mmc part, if the mmc part is ok.
> >>>
> >>> Based on the comments in
> >> https://patch
> >>
> work.ozlabs.org%2Fpatch%2F1096336%2F&amp;data=02%7C01%7Cpeng.fan
> >> %40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1d3bc2b
> 4c
> >>
> 6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;sdata=8aH
> >>
> Hmlu%2FZ6g6h20k%2BxIOrPfk3kG4yzwTE93aRucQ%2FCY%3D&amp;reserve
> >> d=0
> >>> So I think we have agreed the approach, the only comments that not
> >>> addressed from Lukasz is add doc for the container format.
> >>
> >> So why didn't you add some docs? I support Lukasz's request for a
> >> proper documentation in some README file. I found it already hard
> >> enough to find information about the current boot process of the
> >> i.MX8 and if you need to add even more complexity, please add docs
> before this gets merged.
> >
> > Not sure you are working i.MX8 and i.MX8M both. Or just i.MX8M.
> > There is a README in the i.MX8QM/QXP board file shows the steps to build
> images.
> > Or you wanna me to put the container format from Reference Manual to
> > U-Boot?
> 
> For now I'm only working on i.MX8M. But if I ever would need to work on
> i.MX8, I would be glad to have a proper documentation of how the container
> format is used in U-Boot and what happens while booting. What happens in
> the different stages, which image is copied to what address and things like
> that.

ok, a file like README.imximage should be ok. V4 will include README.imx8image.

Regards,
Peng.

> 
> Thanks,
> Frieder
> 
> >
> > Regards,
> > Peng.
> >>
> >>> The detailed format could be found in RM
> >>>
> >> https://www.
> >>
> nxp.com%2Fdocs%2Fen%2Freference-manual%2FIMX8DQXPRM.pdf&amp;da
> >>
> ta=02%7C01%7Cpeng.fan%40nxp.com%7C87ccfec5031249de3fde08d70e77f
> >>
> a9a%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636993780782
> >>
> 660409&amp;sdata=PMOVoEX30qwR3XDPBThWFWTU7qqFaaC6SyykGweIi2
> >> E%3D&amp;reserved=0
> >>> Chapter 5.9.4 High Level Container Format
> >>>
> >>> CI:
> >> https://travis-
> >>
> ci.org%2FMrVan%2Fu-boot%2Fbuilds%2F547161366&amp;data=02%7C01%7
> >>
> Cpeng.fan%40nxp.com%7C87ccfec5031249de3fde08d70e77fa9a%7C686ea1
> >>
> d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C636993780782660409&amp;s
> >>
> data=oPp3%2FyB2kpHj4sxi5n1xWPnf21foJ%2FroU21UXskqijM%3D&amp;res
> >> erved=0
> >>>
> >>> Peng Fan (5):
> >>>     imx8: support parsing i.MX8 Container file
> >>>     spl: mmc: support loading i.MX container format file
> >>>     imx: add container target
> >>>     imx8qxp_mek: switch to use container image
> >>>     imx8qm_mek: switch to use container image
> >>>
> >>>    Makefile                                        |   8 ++
> >>>    arch/arm/include/asm/arch-imx8/image.h          |  56
> >> +++++++++++
> >>>    arch/arm/mach-imx/Makefile                      |  14 ++-
> >>>    arch/arm/mach-imx/imx8/Kconfig                  |  13 +++
> >>>    arch/arm/mach-imx/imx8/Makefile                 |   4 +
> >>>    arch/arm/mach-imx/imx8/parse-container.c        | 120
> >> ++++++++++++++++++++++++
> >>>    board/freescale/imx8qm_mek/README               |   4 +-
> >>>    board/freescale/imx8qm_mek/uboot-container.cfg  |  13 +++
> >>>    board/freescale/imx8qxp_mek/README              |   4 +-
> >>>    board/freescale/imx8qxp_mek/uboot-container.cfg |  13 +++
> >>>    common/spl/spl_mmc.c                            |  10 ++
> >>>    configs/imx8qm_mek_defconfig                    |   8 +-
> >>>    configs/imx8qxp_mek_defconfig                   |   5 +-
> >>>    include/spl.h                                   |  12 +++
> >>>    14 files changed, 270 insertions(+), 14 deletions(-)
> >>>    create mode 100644 arch/arm/include/asm/arch-imx8/image.h
> >>>    create mode 100644 arch/arm/mach-imx/imx8/parse-container.c
> >>>    create mode 100644
> board/freescale/imx8qm_mek/uboot-container.cfg
> >>>    create mode 100644
> >>> board/freescale/imx8qxp_mek/uboot-container.cfg
> >>>

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

* [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
  2019-07-22  8:08   ` Peng Fan
  2019-07-22  9:35     ` Schrempf Frieder
@ 2019-07-22 14:03     ` Wolfgang Denk
  1 sibling, 0 replies; 11+ messages in thread
From: Wolfgang Denk @ 2019-07-22 14:03 UTC (permalink / raw)
  To: u-boot

Dear Peng Fan,

In message <AM0PR04MB4481B10F3B36DD27D33C7FA788C40@AM0PR04MB4481.eurprd04.prod.outlook.com> you wrote:
> > Subject: Re: [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support
> > 
> > On 22.07.19 04:12, Peng Fan wrote:
> > > V3:
> > >   Drops patch 1/5 from V2, add 8QM support, nothing else changed.
> > >   Stefano,
> > >   This patchset was pending in patchwork for more that one month,
> > >   please consider to apply.
> > 
> > I'm not the one to judge here and I don't know the rules for U-Boot, but only
> > because they have been pending for a long time, doesn't make the patches
> > more suitable for upstream. Even more so, if no one has reviewed them yet.
> 
> Since it was there long time, I just thought no one has comments.

If you don't get _any_ feedback for a long time this usually means
the stuff is too difficult to digest by most of the readers (aka
TLDR symtom).  Adding better documentation (README, commit messaes,
etc.) may help...

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The only way to get rid of a temptation is to yield to it.
                                                        - Oscar Wilde

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

end of thread, other threads:[~2019-07-22 14:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-22  2:12 [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Peng Fan
2019-07-22  2:12 ` [U-Boot] [PATCH V3 1/5] imx8: support parsing i.MX8 Container file Peng Fan
2019-07-22  2:12 ` [U-Boot] [PATCH V3 2/5] spl: mmc: support loading i.MX container format file Peng Fan
2019-07-22  2:13 ` [U-Boot] [PATCH V3 3/5] imx: add container target Peng Fan
2019-07-22  2:13 ` [U-Boot] [PATCH V3 4/5] imx8qxp_mek: switch to use container image Peng Fan
2019-07-22  2:13 ` [U-Boot] [PATCH V3 5/5] imx8qm_mek: " Peng Fan
2019-07-22  7:41 ` [U-Boot] [PATCH V3 0/5] add i.MX8 container loading support Schrempf Frieder
2019-07-22  8:08   ` Peng Fan
2019-07-22  9:35     ` Schrempf Frieder
2019-07-22  9:43       ` Peng Fan
2019-07-22 14:03     ` Wolfgang Denk

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.