diff options
author | Patrick Delaunay <patrick.delaunay@foss.st.com> | 2023-01-06 15:20:15 +0300 |
---|---|---|
committer | Patrice Chotard <patrice.chotard@foss.st.com> | 2023-01-12 18:37:13 +0300 |
commit | 33a909a42a07b35c78782fc4c9dbb36f066641fd (patch) | |
tree | b61535ae15ac787b9ead08a50b5079526359515c /board | |
parent | 27bad4e7fcb143c80a0e9337bb7e0ee95799c9f6 (diff) | |
download | u-boot-33a909a42a07b35c78782fc4c9dbb36f066641fd.tar.xz |
stm32mp: Add OP-TEE support in bsec driver
When OP-TEE is used, the SMC for BSEC management are not available and
the STM32MP BSEC pseudo TA must be used (it is mandatory for STM32MP13
and it is a new feature for STM32MP15x).
The BSEC driver try to open a session to this PTA BSEC at probe
and use it for OTP read or write access to fuse or to shadow.
This patch also adapts the commands stm32key and stboard to handle
the BSEC_LOCK_PERM lock value instead of 1.
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/st/common/cmd_stboard.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/board/st/common/cmd_stboard.c b/board/st/common/cmd_stboard.c index e12669b862..213fb5d302 100644 --- a/board/st/common/cmd_stboard.c +++ b/board/st/common/cmd_stboard.c @@ -34,6 +34,7 @@ #include <command.h> #include <console.h> #include <misc.h> +#include <asm/arch/bsec.h> #include <dm/device.h> #include <dm/uclass.h> @@ -109,7 +110,7 @@ static int do_stboard(struct cmd_tbl *cmdtp, int flag, int argc, else display_stboard(otp); printf(" OTP %d %s locked !\n", BSEC_OTP_BOARD, - lock == 1 ? "" : "NOT"); + lock & BSEC_LOCK_PERM ? "" : "NOT"); return CMD_RET_SUCCESS; } @@ -178,7 +179,7 @@ static int do_stboard(struct cmd_tbl *cmdtp, int flag, int argc, } /* write persistent lock */ - otp = 1; + otp = BSEC_LOCK_PERM; ret = misc_write(dev, STM32_BSEC_LOCK(BSEC_OTP_BOARD), &otp, sizeof(otp)); if (ret != sizeof(otp)) { |