All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] colibri_imx7: disable HAB and CAAM support
@ 2019-12-19 10:55 Igor Opaniuk
  2019-12-19 14:13 ` Oleksandr Suvorov
  2019-12-23 17:07 ` Breno Matheus Lima
  0 siblings, 2 replies; 6+ messages in thread
From: Igor Opaniuk @ 2019-12-19 10:55 UTC (permalink / raw)
  To: u-boot

From: Igor Opaniuk <igor.opaniuk@toradex.com>

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

Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>
---

 configs/colibri_imx7_defconfig | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig
index 29ddd7d3e9..7a4caca977 100644
--- a/configs/colibri_imx7_defconfig
+++ b/configs/colibri_imx7_defconfig
@@ -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

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

* [PATCH v1] colibri_imx7: disable HAB and CAAM support
  2019-12-19 10:55 [PATCH v1] colibri_imx7: disable HAB and CAAM support Igor Opaniuk
@ 2019-12-19 14:13 ` Oleksandr Suvorov
  2019-12-23 17:07 ` Breno Matheus Lima
  1 sibling, 0 replies; 6+ messages in thread
From: Oleksandr Suvorov @ 2019-12-19 14:13 UTC (permalink / raw)
  To: u-boot

On Thu, Dec 19, 2019 at 12:55 PM Igor Opaniuk <igor.opaniuk@gmail.com> wrote:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> 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
>
> Signed-off-by: Igor Opaniuk <igor.opaniuk@toradex.com>

Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>

> ---
>
>  configs/colibri_imx7_defconfig | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/configs/colibri_imx7_defconfig b/configs/colibri_imx7_defconfig
> index 29ddd7d3e9..7a4caca977 100644
> --- a/configs/colibri_imx7_defconfig
> +++ b/configs/colibri_imx7_defconfig
> @@ -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
>


-- 
Best regards

Oleksandr Suvorov
cryosay at gmail.com

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

* [PATCH v1] colibri_imx7: disable HAB and CAAM support
  2019-12-19 10:55 [PATCH v1] colibri_imx7: disable HAB and CAAM support Igor Opaniuk
  2019-12-19 14:13 ` Oleksandr Suvorov
@ 2019-12-23 17:07 ` Breno Matheus Lima
  2019-12-27  9:23   ` Igor Opaniuk
  1 sibling, 1 reply; 6+ messages in thread
From: Breno Matheus Lima @ 2019-12-23 17:07 UTC (permalink / raw)
  To: u-boot

Hi Igor,

Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk
<igor.opaniuk@gmail.com> escreveu:
>
> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>
> 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

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

* [PATCH v1] colibri_imx7: disable HAB and CAAM support
  2019-12-23 17:07 ` Breno Matheus Lima
@ 2019-12-27  9:23   ` Igor Opaniuk
  2020-01-03 11:23     ` Stefano Babic
  0 siblings, 1 reply; 6+ messages in thread
From: Igor Opaniuk @ 2019-12-27  9:23 UTC (permalink / raw)
  To: u-boot

Hi Breno,

On Mon, Dec 23, 2019 at 7:07 PM Breno Matheus Lima
<brenomatheus@gmail.com> wrote:
>
> Hi Igor,
>
> Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk
> <igor.opaniuk@gmail.com> escreveu:
> >
> > From: Igor Opaniuk <igor.opaniuk@toradex.com>
> >
> > 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

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/

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

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

* [PATCH v1] colibri_imx7: disable HAB and CAAM support
  2019-12-27  9:23   ` Igor Opaniuk
@ 2020-01-03 11:23     ` Stefano Babic
  2020-01-03 11:53       ` Igor Opaniuk
  0 siblings, 1 reply; 6+ messages in thread
From: Stefano Babic @ 2020-01-03 11:23 UTC (permalink / raw)
  To: u-boot

Hi Igor,

On 27/12/19 10:23, Igor Opaniuk wrote:
> Hi Breno,
> 
> On Mon, Dec 23, 2019 at 7:07 PM Breno Matheus Lima
> <brenomatheus@gmail.com> wrote:
>>
>> Hi Igor,
>>
>> Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk
>> <igor.opaniuk@gmail.com> escreveu:
>>>
>>> From: Igor Opaniuk <igor.opaniuk@toradex.com>
>>>
>>> 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
> 
> 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

> 
> Regards,
> Igor
> 
> [1] https://patchwork.ozlabs.org/patch/1136343/
> 

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

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

* [PATCH v1] colibri_imx7: disable HAB and CAAM support
  2020-01-03 11:23     ` Stefano Babic
@ 2020-01-03 11:53       ` Igor Opaniuk
  0 siblings, 0 replies; 6+ messages in thread
From: Igor Opaniuk @ 2020-01-03 11:53 UTC (permalink / raw)
  To: u-boot

Hi Stefano,

On Fri, Jan 3, 2020 at 1:23 PM Stefano Babic <sbabic@denx.de> wrote:
>
> Hi Igor,
>
> On 27/12/19 10:23, Igor Opaniuk wrote:
> > Hi Breno,
> >
> > On Mon, Dec 23, 2019 at 7:07 PM Breno Matheus Lima
> > <brenomatheus@gmail.com> wrote:
> >>
> >> Hi Igor,
> >>
> >> Em qui., 19 de dez. de 2019 às 07:55, Igor Opaniuk
> >> <igor.opaniuk@gmail.com> escreveu:
> >>>
> >>> From: Igor Opaniuk <igor.opaniuk@toradex.com>
> >>>
> >>> 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
> >
> > 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.

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

>
> Regards,
> Stefano
>
> >
> > Regards,
> > Igor
> >
> > [1] https://patchwork.ozlabs.org/patch/1136343/
> >
>
> --
> =====================================================================
> 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

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

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

end of thread, other threads:[~2020-01-03 11:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-19 10:55 [PATCH v1] colibri_imx7: disable HAB and CAAM support Igor Opaniuk
2019-12-19 14:13 ` Oleksandr Suvorov
2019-12-23 17:07 ` Breno Matheus Lima
2019-12-27  9:23   ` Igor Opaniuk
2020-01-03 11:23     ` Stefano Babic
2020-01-03 11:53       ` Igor Opaniuk

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.