Skip to contentSkip to conversation

colibri_imx7: disable HAB and CAAM support

PATCH New Igor Opaniuk 4 participants 6 messages Dec 19, 2019 – Jan 3, 2020 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 colibri_imx7: disable HAB and CAAM support

From: Igor Opaniuk <[email protected]>

Currently Colibri iMX7 NAND version doesn't boot at all with HABv4 support enabled. If CSF section is included in the final imx binary, BootROM every time switches to usb recovery mode. However eMMC version of the same SoM works without any issues.

Disable HAB and CAAM support for now until the problem is properly investigated and fixed.

For additional details about the problem check [2], [3], [4].

[1] https://www.nxp.com/docs/en/application-note/AN4581.pdf
[2] https://lists.denx.de/pipermail/u-boot/2019-July/379103.html
[3] https://lists.denx.de/pipermail/u-boot/2019-September/383412.html
[4] https://community.nxp.com/message/1138659

---

 configs/colibri_imx7_defconfig | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
configs/colibri_imx7_defconfig +1 -4
index 29ddd7d3e9..7a4caca977 100644
@@ -8,8 +8,6 @@ CONFIG_ENV_OFFSET=0x380000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
-CONFIG_IMX_HAB=y
-# CONFIG_CMD_DEKBLOB is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_imx7/imximage.cfg,MX7D"
 CONFIG_BOOTDELAY=1
@@ -39,7 +37,6 @@ CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_BOOTP_PXE is not set
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
-# CONFIG_CMD_HASH is not set
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:512k(mx7-bcb),1536k(u-boot1)ro,1536k(u-boot2)ro,512k(u-boot-env),-(ubi)"
@@ -52,7 +49,6 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
-CONFIG_FSL_CAAM=y
 CONFIG_DFU_NAND=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
@@ -84,5 +80,6 @@ CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_BPP8=y
 CONFIG_VIDEO_BPP16=y
 CONFIG_VIDEO_BPP32=y
+CONFIG_SHA_HW_ACCEL=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 colibri_imx7: disable HAB and CAAM support

Quoted 11 lines · Igor Opaniuk

From: Igor Opaniuk <[email protected]>

Currently Colibri iMX7 NAND version doesn't boot at all with HABv4 support enabled. If CSF section is included in the final imx binary, BootROM every time switches to usb recovery mode. However eMMC version of the same SoM works without any issues.

Disable HAB and CAAM support for now until the problem is properly investigated and fixed.

Quoted 8 lines

For additional details about the problem check [2], [3], [4].

[1] https://www.nxp.com/docs/en/application-note/AN4581.pdf
[2] https://lists.denx.de/pipermail/u-boot/2019-July/379103.html
[3] https://lists.denx.de/pipermail/u-boot/2019-September/383412.html
[4] https://community.nxp.com/message/1138659

Quoted 44 lines

---

 configs/colibri_imx7_defconfig | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
configs/colibri_imx7_defconfig +1 -5
index 29ddd7d3e9..7a4caca977 100644
@@ -8,8 +8,6 @@ CONFIG_ENV_OFFSET=0x380000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_IMX_RDC=y
 CONFIG_IMX_BOOTAUX=y
-CONFIG_IMX_HAB=y
-# CONFIG_CMD_DEKBLOB is not set
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/toradex/colibri_imx7/imximage.cfg,MX7D"
 CONFIG_BOOTDELAY=1
@@ -39,7 +37,6 @@ CONFIG_CMD_USB_MASS_STORAGE=y
 # CONFIG_BOOTP_PXE is not set
 CONFIG_CMD_BMP=y
 CONFIG_CMD_CACHE=y
-# CONFIG_CMD_HASH is not set
 CONFIG_CMD_MTDPARTS=y
 CONFIG_MTDIDS_DEFAULT="nand0=gpmi-nand"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=gpmi-nand:512k(mx7-bcb),1536k(u-boot1)ro,1536k(u-boot2)ro,512k(u-boot-env),-(ubi)"
@@ -52,7 +49,6 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=16352
-CONFIG_FSL_CAAM=y
 CONFIG_DFU_NAND=y
 CONFIG_DM_GPIO=y
 CONFIG_DM_I2C=y
@@ -84,5 +80,6 @@ CONFIG_DM_VIDEO=y
 CONFIG_VIDEO_BPP8=y
 CONFIG_VIDEO_BPP16=y
 CONFIG_VIDEO_BPP32=y
+CONFIG_SHA_HW_ACCEL=y
 CONFIG_OF_LIBFDT_OVERLAY=y
 CONFIG_FDT_FIXUP_PARTITIONS=y
--

2.17.1

Signature · 4 lines
Best regards

Oleksandr Suvorov
cryosay at gmail.com
#2 lore raw

PATCH 1/1 colibri_imx7: disable HAB and CAAM support

In reply to Igor Opaniuk

Hi Igor,

Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk <[email protected]> escreveu:

Quoted 11 lines

From: Igor Opaniuk <[email protected]>

Currently Colibri iMX7 NAND version doesn't boot at all with HABv4 support enabled. If CSF section is included in the final imx binary, BootROM every time switches to usb recovery mode. However eMMC version of the same SoM works without any issues.

Disable HAB and CAAM support for now until the problem is properly investigated and fixed.

This issue is also happening with i.MX6ULL, seems that padding the U-Boot binary to the size defined in boot data is addressing this issue.

Please follow example below.

1. Dump boot data:

$ hexdump u-boot-dtb.imx | head
0000000 00d1 4020 0000 8780 0000 0000 f42c 877f
0000010 f420 877f f400 877f 6000 878d 0000 0000
0000020 f000 877f b000 000d 0000 0000 01d2 40e8
0000030 01cc 04e4 0c02 6840 ffff ffff 0c02 6c40

IVT self = 0x877ff400
Boot data addr = 0x877ff000
Boot data size = 0x000db000

2. Calculate image size:

Image offset = IVT self(0x877ff400) - Boot data addr(0x877ff000) = 0x400 Total image size = Boot data size(0x000db000) - Image offset(0x400) = 0xdac00

3. Pad U-Boot image:

$ objcopy -I binary -O binary --pad-to 0xdac00 --gap-fill=0x00
u-boot-dtb.imx u-boot-dtb.imx.pad

Could you please try similar in your i.MX7D board?

Thanks,
Breno Lima

#3 lore raw

PATCH 1/1 colibri_imx7: disable HAB and CAAM support

Hi Breno,

Quoted 42 lines · Breno Matheus Lima

Hi Igor,

Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk <[email protected]> escreveu:

Quoted 11 lines

From: Igor Opaniuk <[email protected]>

Currently Colibri iMX7 NAND version doesn't boot at all with HABv4 support enabled. If CSF section is included in the final imx binary, BootROM every time switches to usb recovery mode. However eMMC version of the same SoM works without any issues.

Disable HAB and CAAM support for now until the problem is properly investigated and fixed.

This issue is also happening with i.MX6ULL, seems that padding the U-Boot binary to the size defined in boot data is addressing this issue.

Please follow example below.

1. Dump boot data:

$ hexdump u-boot-dtb.imx | head
0000000 00d1 4020 0000 8780 0000 0000 f42c 877f
0000010 f420 877f f400 877f 6000 878d 0000 0000
0000020 f000 877f b000 000d 0000 0000 01d2 40e8
0000030 01cc 04e4 0c02 6840 ffff ffff 0c02 6c40

IVT self = 0x877ff400
Boot data addr = 0x877ff000
Boot data size = 0x000db000

2. Calculate image size:

Image offset = IVT self(0x877ff400) - Boot data addr(0x877ff000) = 0x400 Total image size = Boot data size(0x000db000) - Image offset(0x400) = 0xdac00

3. Pad U-Boot image:

Quoted 7 lines
$ objcopy -I binary -O binary --pad-to 0xdac00 --gap-fill=0x00
u-boot-dtb.imx u-boot-dtb.imx.pad

Could you please try similar in your i.MX7D board?

Thanks,
Breno Lima

Finally, it works!

Thanks a lot for your help! This should be documented (I'll create a patch for this)
or padding should implicitly be done in makefiles when building the final imx image,
including initial padding for 0x400, like here [1].

Regards,
Igor

[1] https://patchwork.ozlabs.org/patch/1136343/

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk
#4 lore raw

PATCH 1/1 colibri_imx7: disable HAB and CAAM support

Hi Igor,

Quoted 54 lines · Igor Opaniuk

Hi Breno,

Quoted 42 lines · Breno Matheus Lima

Hi Igor,

Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk <[email protected]> escreveu:

Quoted 11 lines

From: Igor Opaniuk <[email protected]>

Currently Colibri iMX7 NAND version doesn't boot at all with HABv4 support enabled. If CSF section is included in the final imx binary, BootROM every time switches to usb recovery mode. However eMMC version of the same SoM works without any issues.

Disable HAB and CAAM support for now until the problem is properly investigated and fixed.

This issue is also happening with i.MX6ULL, seems that padding the U-Boot binary to the size defined in boot data is addressing this issue.

Please follow example below.

1. Dump boot data:

$ hexdump u-boot-dtb.imx | head
0000000 00d1 4020 0000 8780 0000 0000 f42c 877f
0000010 f420 877f f400 877f 6000 878d 0000 0000
0000020 f000 877f b000 000d 0000 0000 01d2 40e8
0000030 01cc 04e4 0c02 6840 ffff ffff 0c02 6c40

IVT self = 0x877ff400
Boot data addr = 0x877ff000
Boot data size = 0x000db000

2. Calculate image size:

Image offset = IVT self(0x877ff400) - Boot data addr(0x877ff000) = 0x400 Total image size = Boot data size(0x000db000) - Image offset(0x400) = 0xdac00

3. Pad U-Boot image:

Quoted 7 lines
$ objcopy -I binary -O binary --pad-to 0xdac00 --gap-fill=0x00
u-boot-dtb.imx u-boot-dtb.imx.pad

Could you please try similar in your i.MX7D board?

Thanks,
Breno Lima

Quoted 7 lines

Finally, it works!

Thanks a lot for your help! This should be documented (I'll create a patch for this)
or padding should implicitly be done in makefiles when building the final imx image,
including initial padding for 0x400, like here [1].

I left [1] in my queue and I have always asked myself if we really need it. Frankly speaking, I prefer that the case should be clearly documented instead of adding an initial padding. Padding could forbid (or makes more difficult) to pack u-boot inside another container.

Regards,
Stefano

Quoted 6 lines

Regards,
Igor

[1] https://patchwork.ozlabs.org/patch/1136343/

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
=====================================================================
#5 lore raw

PATCH 1/1 colibri_imx7: disable HAB and CAAM support

Hi Stefano,

Quoted 66 lines · Stefano Babic

Hi Igor,

Quoted 54 lines · Igor Opaniuk

Hi Breno,

Quoted 42 lines · Breno Matheus Lima

Hi Igor,

Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk <[email protected]> escreveu:

Quoted 11 lines

From: Igor Opaniuk <[email protected]>

Currently Colibri iMX7 NAND version doesn't boot at all with HABv4 support enabled. If CSF section is included in the final imx binary, BootROM every time switches to usb recovery mode. However eMMC version of the same SoM works without any issues.

Disable HAB and CAAM support for now until the problem is properly investigated and fixed.

This issue is also happening with i.MX6ULL, seems that padding the U-Boot binary to the size defined in boot data is addressing this issue.

Please follow example below.

1. Dump boot data:

$ hexdump u-boot-dtb.imx | head
0000000 00d1 4020 0000 8780 0000 0000 f42c 877f
0000010 f420 877f f400 877f 6000 878d 0000 0000
0000020 f000 877f b000 000d 0000 0000 01d2 40e8
0000030 01cc 04e4 0c02 6840 ffff ffff 0c02 6c40

IVT self = 0x877ff400
Boot data addr = 0x877ff000
Boot data size = 0x000db000

2. Calculate image size:

Image offset = IVT self(0x877ff400) - Boot data addr(0x877ff000) = 0x400 Total image size = Boot data size(0x000db000) - Image offset(0x400) = 0xdac00

3. Pad U-Boot image:

Quoted 7 lines
$ objcopy -I binary -O binary --pad-to 0xdac00 --gap-fill=0x00
u-boot-dtb.imx u-boot-dtb.imx.pad

Could you please try similar in your i.MX7D board?

Thanks,
Breno Lima

Quoted 7 lines

Finally, it works!

Thanks a lot for your help! This should be documented (I'll create a patch for this)
or padding should implicitly be done in makefiles when building the final imx image,
including initial padding for 0x400, like here [1].

Quoted 4 lines

I left [1] in my queue and I have always asked myself if we really need it. Frankly speaking, I prefer that the case should be clearly documented instead of adding an initial padding. Padding could forbid (or makes more difficult) to pack u-boot inside another container.

I would say that [1] is a dirty workaround. I'm currently trying to understand if it's
possible to address both issues in tools/imximage.c, so please just ignore [1].

Quoted 11 lines

Regards,
Stefano

Quoted 6 lines

Regards,
Igor

[1] https://patchwork.ozlabs.org/patch/1136343/

Quoted 6 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
=====================================================================

Thanks

Signature · 8 lines
Best regards - Freundliche Grüsse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk