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 <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user