diff mbox series

[U-Boot,5/5] imx: Kconfig: Add HAS_CAAM option

Message ID 1511824140-21384-1-git-send-email-brenomatheus@gmail.com
State Accepted
Commit 52384b7e5c6c8229329138f83e2305675e13a98a
Delegated to: Stefano Babic
Headers show
Series [U-Boot,1/5] mx6slevk: imximage.cfg: Handle the CONFIG_SECURE_BOOT case | expand

Commit Message

Breno Matheus Lima Nov. 27, 2017, 11:09 p.m. UTC
From: Breno Lima <breno.lima@nxp.com>

Currently CONFIG_SECURE_BOOT is selecting FSL_CAAM for all i.MX devices,
this causes the following error when building mx6sl boards since
this SoC doesn't have the CAAM block:

In file included from drivers/crypto/fsl/jobdesc.c:12:0:
drivers/crypto/fsl/jobdesc.c: In function 'inline_cnstr_jobdesc_blob_dek':
include/fsl_sec.h:268:25: error: 'CAAM_ARB_BASE_ADDR' undeclared (first use
in this function)
 #define SEC_MEM_PAGE1  (CAAM_ARB_BASE_ADDR + 0x1000)
                         ^
drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro 'SEC_MEM_PAGE1'
  memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
                     ^
include/fsl_sec.h:268:25: note: each undeclared identifier is reported only
once for each function it appears in
 #define SEC_MEM_PAGE1  (CAAM_ARB_BASE_ADDR + 0x1000)
                         ^
drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro 'SEC_MEM_PAGE1'
  memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
                     ^
scripts/Makefile.build:280: recipe for target 'drivers/crypto/fsl/jobdesc.o'
failed
make[3]: *** [drivers/crypto/fsl/jobdesc.o] Error 1
scripts/Makefile.build:425: recipe for target 'drivers/crypto/fsl' failed
make[2]: *** [drivers/crypto/fsl] Error 2
scripts/Makefile.build:425: recipe for target 'drivers/crypto' failed
make[1]: *** [drivers/crypto] Error 2

Add HAS_CAAM configuration to avoid this error.

Signed-off-by: Breno Lima <breno.lima@nxp.com>
---
 arch/arm/mach-imx/Kconfig     | 5 ++++-
 arch/arm/mach-imx/mx6/Kconfig | 7 +++++++
 arch/arm/mach-imx/mx7/Kconfig | 1 +
 3 files changed, 12 insertions(+), 1 deletion(-)

Comments

Fabio Estevam Nov. 28, 2017, 12:03 a.m. UTC | #1
On Mon, Nov 27, 2017 at 9:09 PM, Breno Lima <brenomatheus@gmail.com> wrote:
> From: Breno Lima <breno.lima@nxp.com>
>
> Currently CONFIG_SECURE_BOOT is selecting FSL_CAAM for all i.MX devices,
> this causes the following error when building mx6sl boards since
> this SoC doesn't have the CAAM block:
>
> In file included from drivers/crypto/fsl/jobdesc.c:12:0:
> drivers/crypto/fsl/jobdesc.c: In function 'inline_cnstr_jobdesc_blob_dek':
> include/fsl_sec.h:268:25: error: 'CAAM_ARB_BASE_ADDR' undeclared (first use
> in this function)
>  #define SEC_MEM_PAGE1  (CAAM_ARB_BASE_ADDR + 0x1000)
>                          ^
> drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro 'SEC_MEM_PAGE1'
>   memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
>                      ^
> include/fsl_sec.h:268:25: note: each undeclared identifier is reported only
> once for each function it appears in
>  #define SEC_MEM_PAGE1  (CAAM_ARB_BASE_ADDR + 0x1000)
>                          ^
> drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro 'SEC_MEM_PAGE1'
>   memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
>                      ^
> scripts/Makefile.build:280: recipe for target 'drivers/crypto/fsl/jobdesc.o'
> failed
> make[3]: *** [drivers/crypto/fsl/jobdesc.o] Error 1
> scripts/Makefile.build:425: recipe for target 'drivers/crypto/fsl' failed
> make[2]: *** [drivers/crypto/fsl] Error 2
> scripts/Makefile.build:425: recipe for target 'drivers/crypto' failed
> make[1]: *** [drivers/crypto] Error 2
>
> Add HAS_CAAM configuration to avoid this error.
>
> Signed-off-by: Breno Lima <breno.lima@nxp.com>

Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Stefano Babic Dec. 17, 2017, 10:31 a.m. UTC | #2
On 28/11/2017 00:09, Breno Lima wrote:
> From: Breno Lima <breno.lima@nxp.com>
> 
> Currently CONFIG_SECURE_BOOT is selecting FSL_CAAM for all i.MX devices,
> this causes the following error when building mx6sl boards since
> this SoC doesn't have the CAAM block:
> 
> In file included from drivers/crypto/fsl/jobdesc.c:12:0:
> drivers/crypto/fsl/jobdesc.c: In function 'inline_cnstr_jobdesc_blob_dek':
> include/fsl_sec.h:268:25: error: 'CAAM_ARB_BASE_ADDR' undeclared (first use
> in this function)
>  #define SEC_MEM_PAGE1  (CAAM_ARB_BASE_ADDR + 0x1000)
>                          ^
> drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro 'SEC_MEM_PAGE1'
>   memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
>                      ^
> include/fsl_sec.h:268:25: note: each undeclared identifier is reported only
> once for each function it appears in
>  #define SEC_MEM_PAGE1  (CAAM_ARB_BASE_ADDR + 0x1000)
>                          ^
> drivers/crypto/fsl/jobdesc.c:140:21: note: in expansion of macro 'SEC_MEM_PAGE1'
>   memcpy((uint32_t *)SEC_MEM_PAGE1, (uint32_t *)plain_txt, in_sz);
>                      ^
> scripts/Makefile.build:280: recipe for target 'drivers/crypto/fsl/jobdesc.o'
> failed
> make[3]: *** [drivers/crypto/fsl/jobdesc.o] Error 1
> scripts/Makefile.build:425: recipe for target 'drivers/crypto/fsl' failed
> make[2]: *** [drivers/crypto/fsl] Error 2
> scripts/Makefile.build:425: recipe for target 'drivers/crypto' failed
> make[1]: *** [drivers/crypto] Error 2
> 
> Add HAS_CAAM configuration to avoid this error.
> 
> Signed-off-by: Breno Lima <breno.lima@nxp.com>
> ---
>  arch/arm/mach-imx/Kconfig     | 5 ++++-
>  arch/arm/mach-imx/mx6/Kconfig | 7 +++++++
>  arch/arm/mach-imx/mx7/Kconfig | 1 +
>  3 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index cd8b8d2..a6f67c8 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -1,3 +1,6 @@
> +config HAS_CAAM
> +	bool
> +
>  config IMX_CONFIG
>  	string
>  
> @@ -28,7 +31,7 @@ config USE_IMXIMG_PLUGIN
>  config SECURE_BOOT
>  	bool "Support i.MX HAB features"
>  	depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5
> -	select FSL_CAAM
> +	select FSL_CAAM if HAS_CAAM
>  	imply CMD_DEKBLOB
>  	help
>  	  This option enables the support for secure boot (HAB).
> diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
> index 279f088..8f98d9f 100644
> --- a/arch/arm/mach-imx/mx6/Kconfig
> +++ b/arch/arm/mach-imx/mx6/Kconfig
> @@ -14,28 +14,34 @@ config MX6
>  	imply CMD_FUSE
>  
>  config MX6D
> +	select HAS_CAAM
>  	select MX6_SMP
>  	bool
>  
>  config MX6DL
> +	select HAS_CAAM
>  	select MX6_SMP
>  	bool
>  
>  config MX6Q
> +	select HAS_CAAM
>  	select MX6_SMP
>  	bool
>  
>  config MX6QDL
> +	select HAS_CAAM
>  	select MX6_SMP
>  	bool
>  
>  config MX6S
> +	select HAS_CAAM
>  	bool
>  
>  config MX6SL
>  	bool
>  
>  config MX6SX
> +	select HAS_CAAM
>  	select ROM_UNIFIED_SECTIONS
>  	bool
>  
> @@ -44,6 +50,7 @@ config MX6SLL
>  	bool
>  
>  config MX6UL
> +	select HAS_CAAM
>  	select SYS_L2CACHE_OFF
>  	select ROM_UNIFIED_SECTIONS
>  	bool
> diff --git a/arch/arm/mach-imx/mx7/Kconfig b/arch/arm/mach-imx/mx7/Kconfig
> index 365501d..4f8b4e1 100644
> --- a/arch/arm/mach-imx/mx7/Kconfig
> +++ b/arch/arm/mach-imx/mx7/Kconfig
> @@ -10,6 +10,7 @@ config MX7
>  	default y
>  
>  config MX7D
> +	select HAS_CAAM
>  	select ROM_UNIFIED_SECTIONS
>  	imply CMD_FUSE
>  	bool
> 
Applied to u-boot-imx, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index cd8b8d2..a6f67c8 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -1,3 +1,6 @@ 
+config HAS_CAAM
+	bool
+
 config IMX_CONFIG
 	string
 
@@ -28,7 +31,7 @@  config USE_IMXIMG_PLUGIN
 config SECURE_BOOT
 	bool "Support i.MX HAB features"
 	depends on ARCH_MX7 || ARCH_MX6 || ARCH_MX5
-	select FSL_CAAM
+	select FSL_CAAM if HAS_CAAM
 	imply CMD_DEKBLOB
 	help
 	  This option enables the support for secure boot (HAB).
diff --git a/arch/arm/mach-imx/mx6/Kconfig b/arch/arm/mach-imx/mx6/Kconfig
index 279f088..8f98d9f 100644
--- a/arch/arm/mach-imx/mx6/Kconfig
+++ b/arch/arm/mach-imx/mx6/Kconfig
@@ -14,28 +14,34 @@  config MX6
 	imply CMD_FUSE
 
 config MX6D
+	select HAS_CAAM
 	select MX6_SMP
 	bool
 
 config MX6DL
+	select HAS_CAAM
 	select MX6_SMP
 	bool
 
 config MX6Q
+	select HAS_CAAM
 	select MX6_SMP
 	bool
 
 config MX6QDL
+	select HAS_CAAM
 	select MX6_SMP
 	bool
 
 config MX6S
+	select HAS_CAAM
 	bool
 
 config MX6SL
 	bool
 
 config MX6SX
+	select HAS_CAAM
 	select ROM_UNIFIED_SECTIONS
 	bool
 
@@ -44,6 +50,7 @@  config MX6SLL
 	bool
 
 config MX6UL
+	select HAS_CAAM
 	select SYS_L2CACHE_OFF
 	select ROM_UNIFIED_SECTIONS
 	bool
diff --git a/arch/arm/mach-imx/mx7/Kconfig b/arch/arm/mach-imx/mx7/Kconfig
index 365501d..4f8b4e1 100644
--- a/arch/arm/mach-imx/mx7/Kconfig
+++ b/arch/arm/mach-imx/mx7/Kconfig
@@ -10,6 +10,7 @@  config MX7
 	default y
 
 config MX7D
+	select HAS_CAAM
 	select ROM_UNIFIED_SECTIONS
 	imply CMD_FUSE
 	bool