summaryrefslogtreecommitdiff
path: root/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2020-03-18 09:24:59 +0100
committerPatrick Delaunay <patrick.delaunay@st.com>2020-05-14 09:02:12 +0200
commit6ce1f4ad8d300272e7584a514d9be0c334754ff7 (patch)
tree571dbcb64fdff2b9a6d81afdfd8c7d6db35e738a /arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
parent936f1aea8006ba5fda13a6d9d2f08baf0a4e7b97 (diff)
stm32mp: stm32prog: add pmic NVM update support
Add a virtual partition to update the pmic non volatile memory. (on ST board, STPMIC1). Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h')
-rw-r--r--arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
index 6024657433a..83b27980f5d 100644
--- a/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
+++ b/arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.h
@@ -12,6 +12,7 @@
#define PHASE_LAST_USER 0xF0
#define PHASE_CMD 0xF1
#define PHASE_OTP 0xF2
+#define PHASE_PMIC 0xF4
#define PHASE_END 0xFE
#define PHASE_RESET 0xFF
#define PHASE_DO_RESET 0x1FF
@@ -19,6 +20,7 @@
#define DEFAULT_ADDRESS 0xFFFFFFFF
#define OTP_SIZE 1024
+#define PMIC_SIZE 8
enum stm32prog_target {
STM32PROG_NONE,
@@ -120,6 +122,7 @@ struct stm32prog_data {
char error[255];
struct stm32prog_part_t *cur_part;
u32 *otp_part;
+ u8 pmic_part[PMIC_SIZE];
/* STM32 header information */
struct raw_header_s *header_data;
@@ -135,6 +138,13 @@ int stm32prog_otp_read(struct stm32prog_data *data, u32 offset,
u8 *buffer, long *size);
int stm32prog_otp_start(struct stm32prog_data *data);
+/* PMIC access */
+int stm32prog_pmic_write(struct stm32prog_data *data, u32 offset,
+ u8 *buffer, long *size);
+int stm32prog_pmic_read(struct stm32prog_data *data, u32 offset,
+ u8 *buffer, long *size);
+int stm32prog_pmic_start(struct stm32prog_data *data);
+
/* generic part*/
u8 stm32prog_header_check(struct raw_header_s *raw_header,
struct image_header_s *header);