From: Fabio Estevam Date: Thu, 9 Jun 2022 20:13:31 +0000 (-0300) Subject: kontron-sl-mx8mm: Add CAAM support X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=b5023254b88a67fcbca913e212e3401dea521fc9;p=u-boot.git kontron-sl-mx8mm: Add CAAM support Add CAAM support, which is required when enabling HAB secure boot. Select CONFIG_SPL_DRIVERS_MISC so that CONFIG_IMX_HAB could build successfully, if selected. Signed-off-by: Fabio Estevam Acked-by: Frieder Schrempf Tested-by: Frieder Schrempf --- diff --git a/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi b/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi index 4eadcc9899..8cd3b23793 100644 --- a/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi +++ b/arch/arm/dts/imx8mm-kontron-n801x-u-boot.dtsi @@ -25,6 +25,23 @@ }; }; +&crypto { + u-boot,dm-spl; +}; + +&sec_jr0 { + u-boot,dm-spl; +}; + +&sec_jr1 { + u-boot,dm-spl; +}; + +&sec_jr2 { + u-boot,dm-spl; +}; + + &i2c1 { u-boot,dm-spl; u-boot,dm-pre-reloc; diff --git a/arch/arm/mach-imx/imx8m/Kconfig b/arch/arm/mach-imx/imx8m/Kconfig index ef8518c06b..09b9d5603d 100644 --- a/arch/arm/mach-imx/imx8m/Kconfig +++ b/arch/arm/mach-imx/imx8m/Kconfig @@ -107,6 +107,9 @@ config TARGET_KONTRON_MX8MM select IMX8MM select SUPPORT_SPL select IMX8M_LPDDR4 + select FSL_CAAM + select ARCH_MISC_INIT + select SPL_CRYPTO if SPL config TARGET_IMX8MN_BSH_SMM_S2 bool "imx8mn-bsh-smm-s2" diff --git a/board/kontron/sl-mx8mm/spl.c b/board/kontron/sl-mx8mm/spl.c index 4ef03c8c17..5a513722c5 100644 --- a/board/kontron/sl-mx8mm/spl.c +++ b/board/kontron/sl-mx8mm/spl.c @@ -13,6 +13,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -213,6 +216,12 @@ void spl_board_init(void) struct udevice *dev; int ret; + if (IS_ENABLED(CONFIG_FSL_CAAM)) { + ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(caam_jr), &dev); + if (ret) + printf("Failed to initialize %s: %d\n", dev->name, ret); + } + puts("Normal Boot\n"); ret = uclass_get_device_by_name(UCLASS_CLK, diff --git a/configs/kontron-sl-mx8mm_defconfig b/configs/kontron-sl-mx8mm_defconfig index 727f99f006..f453ace625 100644 --- a/configs/kontron-sl-mx8mm_defconfig +++ b/configs/kontron-sl-mx8mm_defconfig @@ -16,6 +16,7 @@ CONFIG_SPL_TEXT_BASE=0x7E1000 CONFIG_TARGET_KONTRON_MX8MM=y CONFIG_SPL_MMC=y CONFIG_SPL_SERIAL=y +CONFIG_SPL_DRIVERS_MISC=y CONFIG_BOOTCOUNT_BOOTLIMIT=3 CONFIG_SPL=y CONFIG_SYS_LOAD_ADDR=0x42000000