[PATCH] ARM: imx: Enable kaslrseed command on DH i.MX8M Plus DHCOM

Tim Harvey tharvey at gateworks.com
Thu Apr 18 19:53:31 CEST 2024


On Thu, Apr 18, 2024 at 10:33 AM Marek Vasut <marex at denx.de> wrote:
>
> On 4/18/24 6:21 PM, Tim Harvey wrote:
> > On Fri, Jan 19, 2024 at 4:36 PM Marek Vasut <marex at denx.de> wrote:
> >>
> >> Linux 6.6.y with KASLR enabled would print the following message on boot:
> >> "
> >> KASLR disabled due to lack of seed
> >> "
> >> Enable the 'kaslrseed' command so a random number seed can be pulled
> >> from CAAM and inserted into the /chosen node 'kaslr-seed' property of
> >> Linux kernel DT before boot, thus letting KASLR work properly.
> >>
> >> Signed-off-by: Marek Vasut <marex at denx.de>
> >> ---
> >> Cc: Fabio Estevam <festevam at denx.de>
> >> Cc: Stefano Babic <sbabic at denx.de>
> >> Cc: u-boot at dh-electronics.com
> >> ---
> >>   configs/imx8mp_dhcom_pdk2_defconfig | 2 ++
> >>   configs/imx8mp_dhcom_pdk3_defconfig | 2 ++
> >>   2 files changed, 4 insertions(+)
> >>
> >> diff --git a/configs/imx8mp_dhcom_pdk2_defconfig b/configs/imx8mp_dhcom_pdk2_defconfig
> >> index 4f907ce00d0..23fb6272ad5 100644
> >> --- a/configs/imx8mp_dhcom_pdk2_defconfig
> >> +++ b/configs/imx8mp_dhcom_pdk2_defconfig
> >> @@ -117,6 +117,7 @@ CONFIG_CMD_BOOTCOUNT=y
> >>   CONFIG_CMD_CACHE=y
> >>   CONFIG_CMD_TIME=y
> >>   CONFIG_CMD_GETTIME=y
> >> +CONFIG_CMD_KASLRSEED=y
> >>   CONFIG_CMD_SYSBOOT=y
> >>   CONFIG_CMD_UUID=y
> >>   CONFIG_CMD_PMIC=y
> >> @@ -223,6 +224,7 @@ CONFIG_DM_REGULATOR_PCA9450=y
> >>   CONFIG_SPL_DM_REGULATOR_PCA9450=y
> >>   CONFIG_DM_REGULATOR_FIXED=y
> >>   CONFIG_DM_REGULATOR_GPIO=y
> >> +CONFIG_DM_RNG=y
> >>   CONFIG_DM_RTC=y
> >>   CONFIG_RTC_M41T62=y
> >>   CONFIG_CONS_INDEX=2
> >> diff --git a/configs/imx8mp_dhcom_pdk3_defconfig b/configs/imx8mp_dhcom_pdk3_defconfig
> >> index 9972e2d96b6..0d47c12b1f9 100644
> >> --- a/configs/imx8mp_dhcom_pdk3_defconfig
> >> +++ b/configs/imx8mp_dhcom_pdk3_defconfig
> >> @@ -119,6 +119,7 @@ CONFIG_CMD_BOOTCOUNT=y
> >>   CONFIG_CMD_CACHE=y
> >>   CONFIG_CMD_TIME=y
> >>   CONFIG_CMD_GETTIME=y
> >> +CONFIG_CMD_KASLRSEED=y
> >>   CONFIG_CMD_SYSBOOT=y
> >>   CONFIG_CMD_UUID=y
> >>   CONFIG_CMD_PMIC=y
> >> @@ -228,6 +229,7 @@ CONFIG_DM_REGULATOR_PCA9450=y
> >>   CONFIG_SPL_DM_REGULATOR_PCA9450=y
> >>   CONFIG_DM_REGULATOR_FIXED=y
> >>   CONFIG_DM_REGULATOR_GPIO=y
> >> +CONFIG_DM_RNG=y
> >>   CONFIG_DM_RTC=y
> >>   CONFIG_RTC_M41T62=y
> >>   CONFIG_CONS_INDEX=2
> >> --
> >> 2.43.0
> >>
> >
> > Hi Marek,
> >
> > Sorry to respond to an old thread but I ran across this when enabling
> > KALSR on my boards.
> >
> > I have noticed when you enable DM_RNG on IMX8M that SPL fails to bind
> > the driver:
> > Couldn't bind rng driver (-96)
> > SEC0:  RNG instantiated
> >
> > sec_init failed!
>
> Did you enable CAAM and ARCH_MISC_INIT on your machine, to initialize
> CAAM in SPL ?

yes

>
> > Didn't you encounter this as well? It seems to me that we may need to
> > add the ability to disable DM_RNG in the SPL unless I'm missing
> > something.
>
> No, but see above, I suspect that might be it, see also
>
> 1f908b1898bd ("ARM: imx8m: Deduplicate CAAM init with arch_misc_init()
> call")

yes, I have that same patch with
c8645e74113c6 ("configs: imx8m: Prepare imx8m-venice boards for HAB support")

Do you have an IMX8M board on hand to check against to see if you see
the same error in the SPL?

Fabio, if you enable CONFIG_DM_RNG on an imx8m{m,p}_evk do you get the
following in the SPL?
Couldn't bind rng driver (-96)
SEC0:  RNG instantiated

sec_init failed!

Best Regards,

Tim


More information about the U-Boot mailing list