Skip to contentSkip to conversation

Habv4 on imx8m

DISCUSSION Stefano Babic 4 participants 9 messages Jan 12, 2021 – Mar 8, 2021

lore
Share & tools
lore
#0 lore raw

Hi Peng, Fabio,

I accidental saw this code:

arch/arm/mach-imx/imx8m/soc.c:#if defined(CONFIG_IMX_HAB)

but then arch/arm/mach-imx/Kconfig :

config IMX_HAB
bool "Support i.MX HAB features" depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5

this does not match. As I understand from manual, Habv4 is the same as in mx6. Should we simply enable HAB for imx8m, too ?

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

Hi Stefano,

Quoted 7 lines · Stefano Babic

Hi Peng, Fabio,

I accidental saw this code:

arch/arm/mach-imx/imx8m/soc.c:#if defined(CONFIG_IMX_HAB)

Quoted 8 lines

but then arch/arm/mach-imx/Kconfig :

config IMX_HAB
bool "Support i.MX HAB features" depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5

this does not match. As I understand from manual, Habv4 is the same as in mx6. Should we simply enable HAB for imx8m, too ?

You are right. This should be enabled for i.MX8M too.

The vendor U-Boot code does like this:

config IMX_HAB
bool "Support i.MX HAB features"
depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5 || ARCH_MX7ULP || ARCH_IMX8M

I can submit a patch adding mx7ulp and imx8m if you want.

Thanks

#2 lore raw
Quoted 21 lines · Fabio Estevam

Hi Stefano,

Quoted 7 lines · Stefano Babic

Hi Peng, Fabio,

I accidental saw this code:

arch/arm/mach-imx/imx8m/soc.c:#if defined(CONFIG_IMX_HAB)

Quoted 8 lines

but then arch/arm/mach-imx/Kconfig :

config IMX_HAB
bool "Support i.MX HAB features" depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5

this does not match. As I understand from manual, Habv4 is the same as in mx6. Should we simply enable HAB for imx8m, too ?

You are right. This should be enabled for i.MX8M too.

Quoted 8 lines

The vendor U-Boot code does like this:

config IMX_HAB
bool "Support i.MX HAB features"
depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5 || ARCH_MX7ULP || ARCH_IMX8M

I can submit a patch adding mx7ulp and imx8m if you want.

Nice, thanks !

Stefano

Quoted 2 lines

Thanks

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

Hi Fabio,

Quoted 22 lines · Stefano Babic
Quoted 21 lines · Fabio Estevam

Hi Stefano,

Quoted 7 lines · Stefano Babic

Hi Peng, Fabio,

I accidental saw this code:

arch/arm/mach-imx/imx8m/soc.c:#if defined(CONFIG_IMX_HAB)

Quoted 8 lines

but then arch/arm/mach-imx/Kconfig :

config IMX_HAB
bool "Support i.MX HAB features" depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5

this does not match. As I understand from manual, Habv4 is the same as in mx6. Should we simply enable HAB for imx8m, too ?

You are right. This should be enabled for i.MX8M too.

Quoted 7 lines
Quoted 7 lines

The vendor U-Boot code does like this:

config IMX_HAB
bool "Support i.MX HAB features"
depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5 || ARCH_MX7ULP || ARCH_IMX8M

I can submit a patch adding mx7ulp and imx8m if you want.

Is this still on your list?
It would be great if you could send a patch for this.

Thanks
Frieder

#4 lore raw

Hi Frieder,

Quoted 2 lines · Frieder Schrempf

Is this still on your list?
It would be great if you could send a patch for this.

Thanks for the reminder. I have just sent the patch.

#5 lore raw
Quoted 10 lines · Fabio Estevam

Hi Frieder,

Quoted 2 lines · Frieder Schrempf

Is this still on your list?
It would be great if you could send a patch for this.

Thanks for the reminder. I have just sent the patch.

I forgot it as well, it is just to extend the defconfig. I pick up Fabio's patch, it will be merged into 2021.04

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

Hi all,

Quoted 9 lines · Stefano Babic
Quoted 8 lines · Fabio Estevam

Hi Frieder,

Quoted 2 lines · Frieder Schrempf

Is this still on your list?
It would be great if you could send a patch for this.

Quoted 7 lines
Quoted 2 lines

Thanks for the reminder. I have just sent the patch.

I forgot it as well, it is just to extend the defconfig. I pick up Fabio's patch, it will be merged into 2021.04

Stefano

I tested the patch with CONFIG_IMX_HAB=y for an IMX8m and I got some compiler errors.

A part of the output (in german):
...
CC drivers/crypto/fsl/sec.o
CC drivers/crypto/fsl/jr.o
drivers/crypto/fsl/jr.c:28:21: Fehler: ?CONFIG_SYS_FSL_MAX_NUM_OF_SEC? ist hier nicht deklariert (nicht in einer Funktion)

    28 | uint32_t sec_offset[CONFIG_SYS_FSL_MAX_NUM_OF_SEC] = {
       |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/crypto/fsl/jr.c: In Funktion ?start_jr0?:
drivers/crypto/fsl/jr.c:47:2: Fehler: unbekannter Typname: ?ccsr_sec_t?
    47 |  ccsr_sec_t *sec = (void *)SEC_ADDR(sec_idx);
       |  ^~~~~~~~~~
drivers/crypto/fsl/jr.c:37:4: Fehler: ?CONFIG_SYS_FSL_SEC_ADDR? nicht 
deklariert (erstmalige Verwendung in dieser Funktion); meinten Sie 
?CONFIG_SYS_FSL_ESDHC_ADDR??
    37 |  ((CONFIG_SYS_FSL_SEC_ADDR + sec_offset[idx]))
       |    ^~~~~~~~~~~~~~~~~~~~~~~

...
The list is long and mostly the compiler cannot found some defines:
CONFIG_SYS_FSL_SEC_ADDR
CONFIG_SYS_FSL_JR0_OFFSET
CONFIG_SYS_FSL_SEC_OFFSET

RDSTA_SKVN
RTSDCTL_ENT_DLY_MIN
RTSDCTL_ENT_DLY_MAX

And this type: ccsr_sec_t

I used for the test:
- Das U-Boot master branch
- Cross compiler: aarch64-linux-gnu-
- This documentation:
https://github.com/u-boot/u-boot/blob/master/doc/board/freescale/imx8mm_evk.rst
- I enable in the menuconfig CONFIG_IMX_HAB and SYS_FSL_SEC_LE

Florian

#7 lore raw
Quoted 15 lines · Florian Mayer

Hi all,

Quoted 12 lines · Stefano Babic
Quoted 10 lines · Fabio Estevam

Hi Frieder,

Quoted 2 lines · Frieder Schrempf

Is this still on your list?
It would be great if you could send a patch for this.

Thanks for the reminder. I have just sent the patch.

Quoted 8 lines
Quoted 4 lines

I forgot it as well, it is just to extend the defconfig. I pick up Fabio's patch, it will be merged into 2021.04

Stefano

I tested the patch with CONFIG_IMX_HAB=y for an IMX8m and I got some compiler errors.

There are still multiple issues with HAB and CAAM for ARM64/i.MX8M. I did some quick fixups for the most obvious ones here: [1].

There are still warnings for pointer size mismatches in the drivers as they apparently haven't been made ready for 64-bit archs yet.

And there might be more issues. I don't have time to work on this more at the moment, so I hope someone can add the missing bits and do some tests.

[1] https://git.kontron-electronics.de/linux/u-boot/-/commits/caam_hab_mx8m

#8 lore raw

Hi Frieder,

Quoted 10 lines · Frieder Schrempf

There are still multiple issues with HAB and CAAM for ARM64/i.MX8M. I did some quick fixups for the most obvious ones here: [1].

There are still warnings for pointer size mismatches in the drivers as they apparently haven't been made ready for 64-bit archs yet.

And there might be more issues. I don't have time to work on this more at the moment, so I hope someone can add the missing bits and do some tests.

[1] https://git.kontron-electronics.de/linux/u-boot/-/commits/caam_hab_mx8m

Yes, it seems that someone needs to take a look at the NXP U-Boot implementation and upstream the CAAM support for i.MX8M.

For example:
https://source.codeaurora.org/external/imx/uboot-imx/commit/?h=imx_v2020.04_5.4.70_2.3.0&id=337b9a92acf07a47cfdc9caa30050dbcee6d37c8

Regards,

Fabio Estevam