All of lore.kernel.org
 help / color / mirror / Atom feed
From: Auer, Lukas <lukas.auer@aisec.fraunhofer.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/2] warp7 : run sec_init for CAAM RNG
Date: Fri, 26 Jan 2018 09:09:35 +0000	[thread overview]
Message-ID: <1516957774.3733.42.camel@aisec.fraunhofer.de> (raw)
In-Reply-To: <1516932578-19992-3-git-send-email-bryan.odonoghue@linaro.org>

On Fri, 2018-01-26 at 02:09 +0000, Bryan O'Donoghue wrote:
> This patch adds a sec_init call into board_init. Doing so in
> conjunction
> with the patch "drivers/crypto/fsl: assign job-rings to non-
> TrustZone"
> enables use of the CAAM in Linux when OPTEE/TrustZone is active.
> 
> u-boot will initialise the RNG and assign ownership of the job-ring
> registers to a non-TrustZone context. Linux then simply has to detect
> or be
> told to skip RNG initialisation.
> 
> This change is safe both for the OPTEE/TrustZone boot path and the
> regular
> non-OPTEE/TrustZone boot path.
> 
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@nxp.com>
> Cc: Peng Fan <peng.fan@nxp.com>
> Cc: Marco Franchi <marco.franchi@nxp.com>
> Cc: Vanessa Maegima <vanessa.maegima@nxp.com>
> Cc: Stefano Babic <sbabic@denx.de>
> ---
>  board/warp7/warp7.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/board/warp7/warp7.c b/board/warp7/warp7.c
> index 337e76b..219ab6f 100644
> --- a/board/warp7/warp7.c
> +++ b/board/warp7/warp7.c
> @@ -16,6 +16,7 @@
>  #include <asm/io.h>
>  #include <common.h>
>  #include <fsl_esdhc.h>
> +#include <fsl_sec.h>
>  #include <i2c.h>
>  #include <mmc.h>
>  #include <asm/arch/crm_regs.h>
> @@ -225,6 +226,10 @@ int board_init(void)
>  		setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f,
> &i2c_pad_info1);
>  	#endif
>  
> +	#ifdef CONFIG_FSL_CAAM
> +		sec_init();
> +	#endif
> +
>  	return 0;
>  }
>  
> @@ -366,5 +371,4 @@ int g_dnl_bind_fixup(struct usb_device_descriptor
> *dev, const char *name)
>  
>  	return 0;
>  }
> -
>  #endif /* ifdef CONFIG_USB_GADGET */

Hi Bryan,

this fails to apply for me on current HEAD. It seems like you have
additional modifications to wrap7.c in your tree (there is no
CONFIG_USB_GADGET on master).

Regarding the patch, would it make sense to put sec_init() somewhere
else, so that it does not have to be duplicated in the board file for
all platforms with CAAM?

Thanks,
Lukas

  reply	other threads:[~2018-01-26  9:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-26  2:09 [U-Boot] [PATCH v2 0/2] Fix CAAM for TrustZone enable for warp7 Bryan O'Donoghue
2018-01-26  2:09 ` [U-Boot] [PATCH v2 1/2] drivers/crypto/fsl: assign job-rings to non-TrustZone Bryan O'Donoghue
2018-01-26  8:57   ` Auer, Lukas
2018-01-26  2:09 ` [U-Boot] [PATCH v2 2/2] warp7 : run sec_init for CAAM RNG Bryan O'Donoghue
2018-01-26  9:09   ` Auer, Lukas [this message]
2018-01-26 11:32     ` Bryan O'Donoghue
2018-01-26 12:30       ` Auer, Lukas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516957774.3733.42.camel@aisec.fraunhofer.de \
    --to=lukas.auer@aisec.fraunhofer.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.