Skip to contentSkip to conversation

tools/imximage: share DCD information via Kconfig

PATCH New Jorge Ramirez-Ortiz 3 participants 4 messages Dec 11, 2019 – Dec 28, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/imximage: share DCD information via Kconfig

IMX based platforms can have the DCD table located on different addresses due to differences in their memory maps (ie iMX7ULP).

This information is required by the user to sign the images for secure boot so continue making it accessible via mkimage.

---
 arch/arm/mach-imx/Kconfig | 11 +++++++++++
 tools/imximage.c          |  5 +++--
 2 files changed, 14 insertions(+), 2 deletions(-)
arch/arm/mach-imx/Kconfig +11 -0
index fee6d56c4d..4ce2799b72 100644
@@ -113,3 +113,14 @@ config DDRMC_VF610_CALIBRATION
 config SPL_IMX_ROMAPI_LOADADDR
 	hex "Default load address to load image through ROM API"
 	depends on IMX8MN
+
+config IMX_DCD_ADDR
+	hex "DCD Blocks location on the image"
+	default 0x00910000 if !ARCH_MX7ULP
+	default 0x2f010000 if ARCH_MX7ULP
+	help
+	  Indicates where the Device Configuration Data, a binary table used by
+	  the ROM code to configure the device at early boot stage, is located.
+	  This information is shared with the user via mkimage -l just so the
+	  image can be signed.
+
tools/imximage.c +3 -2
index d7c0b6e883..392c239812 100644
@@ -11,6 +11,7 @@
 #include "imagetool.h"
 #include <image.h>
 #include "imximage.h"
+#include <generated/autoconf.h>
 
 #define UNDEFINED 0xFFFFFFFF
 
@@ -524,8 +525,8 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
 			printf("HAB Blocks:   0x%08x 0x%08x 0x%08x\n",
 			       (uint32_t)fhdr_v2->self, 0,
 			       (uint32_t)(fhdr_v2->csf - fhdr_v2->self));
-			printf("DCD Blocks:   0x00910000 0x%08x 0x%08x\n",
-			       offs, be16_to_cpu(dcdlen));
+			printf("DCD Blocks:   0x%08x 0x%08x 0x%08x\n",
+			       offs, CONFIG_IMX_DCD_ADDR, be16_to_cpu(dcdlen));
 		}
 	} else {
 		imx_header_v2_t *next_hdr_v2;
Signature · 1 line
2.17.1
reviewer
#1 lore raw

PATCH 1/1 tools/imximage: share DCD information via Kconfig

Quoted 8 lines · Jorge Ramirez-Ortiz

IMX based platforms can have the DCD table located on different addresses due to differences in their memory maps (ie iMX7ULP).

This information is required by the user to sign the images for secure boot so continue making it accessible via mkimage.

Stefano,

This is a bug fix for 2020.01.

Thanks

#2 lore raw

PATCH 1/1 tools/imximage: share DCD information via Kconfig

Hi Jorge, Fabio,

Quoted 8 lines · Fabio Estevam
Quoted 7 lines · Jorge Ramirez-Ortiz

IMX based platforms can have the DCD table located on different addresses due to differences in their memory maps (ie iMX7ULP).

This information is required by the user to sign the images for secure boot so continue making it accessible via mkimage.

Quoted 8 lines
Quoted 1 line

Stefano,

This is a bug fix for 2020.01.

It is, but CONFIG_IMX_DCD_ADDR is then undefined for all architectures outside i.MX (because the config does not run), while imximage.c is always built. Then outside i.MX leads to broken build. I would at least add in imximage a check if it is not set and set it to the default value, like:

#if !defined(CONFIG_IMX_DCD_ADDR)
#define CONFIG_IMX_DCD_ADDR 0x00910000
#endif

Regards,
Stefano

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================
#3 lore raw

PATCH 1/1 tools/imximage: share DCD information via Kconfig

In reply to Jorge Ramirez-Ortiz
Quoted 6 lines

IMX based platforms can have the DCD table located on different addresses due to differences in their memory maps (ie iMX7ULP). This information is required by the user to sign the images for secure boot so continue making it accessible via mkimage.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================