From 936f1aea8006ba5fda13a6d9d2f08baf0a4e7b97 Mon Sep 17 00:00:00 2001 From: Patrick Delaunay Date: Wed, 18 Mar 2020 09:24:58 +0100 Subject: stm32mp: stm32prog: add otp update support Add a virtual partition to update the STM32MP15x OTP based on SMC service provided by TF-A. Signed-off-by: Patrick Delaunay Reviewed-by: Patrice Chotard --- arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c') diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c index ed2cdbc66f..4a4b4d326b 100644 --- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c +++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog_usb.c @@ -130,6 +130,10 @@ int stm32prog_write_medium_virt(struct dfu_entity *dfu, u64 offset, switch (dfu->data.virt.dev_num) { case PHASE_CMD: return stm32prog_cmd_write(offset, buf, len); + + case PHASE_OTP: + return stm32prog_otp_write(stm32prog_data, (u32)offset, + buf, len); } *len = 0; return 0; @@ -144,6 +148,10 @@ int stm32prog_read_medium_virt(struct dfu_entity *dfu, u64 offset, switch (dfu->data.virt.dev_num) { case PHASE_CMD: return stm32prog_cmd_read(offset, buf, len); + + case PHASE_OTP: + return stm32prog_otp_read(stm32prog_data, (u32)offset, + buf, len); } *len = 0; return 0; @@ -162,6 +170,9 @@ int stm32prog_get_medium_size_virt(struct dfu_entity *dfu, u64 *size) case PHASE_CMD: *size = 512; break; + case PHASE_OTP: + *size = OTP_SIZE; + break; } return 0; -- cgit