All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] stm32mp: cmd_stm32key: updates
@ 2021-06-28 12:55 Patrick Delaunay
  2021-06-28 12:55 ` [PATCH 1/7] stm32mp: configs: activate the command stm32key only for ST boards Patrick Delaunay
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Patrick Delaunay @ 2021-06-28 12:55 UTC (permalink / raw)
  To: u-boot; +Cc: Patrick Delaunay, Patrice Chotard, U-Boot STM32


Several improvements and protection on the command stm32key.

This command is used to experiment the secure boot on STM32MP15x;
the expected sequence to manually activate it with this U-Boot command is:
- Key generation with STM32 KeyGen tool
- Key registration: update and lock PKH in OTP (stm32key fuse)
- Perform image authentication of an image signed with
  STM32 Signing tool and check that the ROM code accepted them
- Close the device, only signed binary will be accepted (stm32key close)

Warning: Make sure that a device with Secure boot enabled is used,
         check the security field of the chip part number.

Otherwise the chip will be bricked and could not be used anymore.

This command is activated by default on STMicroelectronics evaluation
boards but these OTP can also be updated directly by customer
application or with Secure Secret Provisioning (SSP).



Patrick Delaunay (7):
  stm32mp: configs: activate the command stm32key only for ST boards
  stm32mp: cmd_stm32key: use sub command
  stm32mp: cmd_stm32key: handle error in fuse_hash_value
  stm32mp: cmd_stm32key: lock of PKH OTP after fuse
  stm32mp: cmd_stm32key: add get_misc_dev function
  stm32mp: cmd_stm32key: add read OTP subcommand
  stm32mp: cmd_stm32key: add subcommand close

 arch/arm/mach-stm32mp/Kconfig        |   4 +-
 arch/arm/mach-stm32mp/cmd_stm32key.c | 239 +++++++++++++++++++++++----
 configs/stm32mp15_basic_defconfig    |   1 +
 configs/stm32mp15_trusted_defconfig  |   1 +
 4 files changed, 208 insertions(+), 37 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 23+ messages in thread
* [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function
@ 2021-07-01 15:49 Hexagon Email Recovery
  0 siblings, 0 replies; 23+ messages in thread
From: Hexagon Email Recovery @ 2021-07-01 15:49 UTC (permalink / raw)
  To: u-boot; +Cc: patrick.delaunay, patrice.chotard, uboot-stm32

This message could not be delivered immediately due to an internal mail routing issue.
The mail routing error has been resolved in the meantime.
We apologize for the delay in delivery and any inconvenience this may have caused.
In case of any questions please contact us via it@hexagon.com.

Original sender: patrick.delaunay@foss.st.com
Original delivery time: 28-Jun-2021 01:34 PM (UTC)
-----------------------------------------------------------------------------------------------------------------------
This email is not from Hexagon’s Office 365 instance. Please be careful while clicking links, opening attachments, or replying to this email. Add a helper function to access to BSEC misc driver. Signed-off-by: Patrick Delaunay --- arch/arm/mach-stm32mp/cmd_stm32key.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-stm32mp/cmd_stm32key.c b/arch/arm/mach-stm32mp/cmd_stm32key.c index c4cb6342fa..886c52794f 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32key.c +++ b/arch/arm/mach-stm32mp/cmd_stm32key.c @@ -14,6 +14,17 @@ #define STM32_OTP_HASH_KEY_START 24 #define STM32_OTP_HASH_KEY_SIZE 8 +static int get_misc_dev(struct udevice **dev) +{ + int ret; + + ret = uclass_get_device_by_driver(UCLASS_MISC, DM_DRIVER_GET(stm32mp_bsec), dev); + if (ret) + log_err("Can't find stm32mp_bsec driver\n"); + + return ret; +} + static void read_hash_value(u32 addr) { int i; @@ -31,13 +42,9 @@ static int fuse_hash_value(u32 addr, bool print) u32 word, val; int i, ret; - ret = uclass_get_device_by_driver(UCLASS_MISC, - DM_DRIVER_GET(stm32mp_bsec), - &dev); - if (ret) { - log_err("Can't find stm32mp_bsec driver\n"); + ret = get_misc_dev(&dev); + if (ret) return ret; - } for (i = 0, word = STM32_OTP_HASH_KEY_START; i < STM32_OTP_HASH_KEY_SIZE; -- 2.25.1

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2021-07-16  8:29 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 12:55 [PATCH 0/7] stm32mp: cmd_stm32key: updates Patrick Delaunay
2021-06-28 12:55 ` [PATCH 1/7] stm32mp: configs: activate the command stm32key only for ST boards Patrick Delaunay
2021-07-01  7:35   ` Patrice CHOTARD
2021-07-16  8:27   ` Patrick DELAUNAY
2021-06-28 12:55 ` [PATCH 2/7] stm32mp: cmd_stm32key: use sub command Patrick Delaunay
2021-07-01  7:35   ` Patrice CHOTARD
2021-07-16  8:27   ` Patrick DELAUNAY
2021-06-28 12:55 ` [PATCH 3/7] stm32mp: cmd_stm32key: handle error in fuse_hash_value Patrick Delaunay
2021-07-01  7:35   ` Patrice CHOTARD
2021-07-16  8:28   ` Patrick DELAUNAY
2021-06-28 12:56 ` [PATCH 4/7] stm32mp: cmd_stm32key: lock of PKH OTP after fuse Patrick Delaunay
2021-07-01  7:35   ` Patrice CHOTARD
2021-07-16  8:28   ` Patrick DELAUNAY
2021-06-28 12:56 ` [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function Patrick Delaunay
2021-07-01  7:36   ` Patrice CHOTARD
2021-07-16  8:28   ` Patrick DELAUNAY
2021-06-28 12:56 ` [PATCH 6/7] stm32mp: cmd_stm32key: add read OTP subcommand Patrick Delaunay
2021-07-01  7:36   ` Patrice CHOTARD
2021-07-16  8:28   ` Patrick DELAUNAY
2021-06-28 12:56 ` [PATCH 7/7] stm32mp: cmd_stm32key: add subcommand close Patrick Delaunay
2021-07-01  7:36   ` Patrice CHOTARD
2021-07-16  8:28   ` Patrick DELAUNAY
2021-07-01 15:49 [PATCH 5/7] stm32mp: cmd_stm32key: add get_misc_dev function Hexagon Email Recovery

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.