Add pmic bootcount driver
cover Add pmic bootcount driver
This series adds a new bootcount driver. The required register definitions and the actual driver are separated in two patches.
Philip Oberfichtner (2):
power: pfuze100: Add MEMx register definitions
bootcount: Add pmic pfuze100 bootcount driver
drivers/bootcount/Kconfig | 7 ++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_pmic_pfuze100.c | 83 +++++++++++++++++++++ include/power/pfuze100_pmic.h | 5 ++ 4 files changed, 96 insertions(+) create mode 100644 drivers/bootcount/bootcount_pmic_pfuze100.c
Signature · 1 line
2.34.1
PATCH 1/2 power: pfuze100: Add MEMx register definitions
Add missing MEMA - MEMD register definitions for PFUZE100.
Based on work from Heiko Schocher <[email protected]>.
---
include/power/pfuze100_pmic.h | 5 +++++ 1 file changed, 5 insertions(+)
include/power/pfuze100_pmic.h +5 -0
@@ -18,6 +18,11 @@ enum {PFUZE100_REVID =0x03 ,PFUZE100_FABID =0x04 , +PFUZE100_MEMA =0x1c , +PFUZE100_MEMB =0x1d , +PFUZE100_MEMC =0x1e , +PFUZE100_MEMD =0x1f , +PFUZE100_SW1ABVOL =0x20 ,PFUZE100_SW1ABSTBY =0x21 , PFUZE100_SW1ABOFF = 0x22,
Signature · 1 line
2.34.1
PATCH 2/2 bootcount: Add pmic pfuze100 bootcount driver
In reply to Philip OberfichtnerUse the MEMA - MEMD registers on the PFUZE100 as bootcount registers.
Based on work from Heiko Schocher <[email protected]>.
---
drivers/bootcount/Kconfig | 7 ++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_pmic_pfuze100.c | 83 +++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 drivers/bootcount/bootcount_pmic_pfuze100.c
drivers/bootcount/Kconfig +7 -0
@@ -73,6 +73,13 @@ config BOOTCOUNT_ENV So the Userspace Application must set the "upgrade_available" and "bootcount" variable to 0, if a boot was successfully. +config BOOTCOUNT_PMIC_PFUZE100 + bool "Enable Bootcount driver for PMIC PFUZE100" + depends on DM_PMIC_PFUZE100 + help + Enable support for the bootcounter using PMIC PFUZE100 registers. + This works only, if the PMIC is not connected. + config BOOTCOUNT_RAM bool "Boot counter in RAM" help
drivers/bootcount/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-$(CONFIG_BOOTCOUNT_ENV) += bootcount_env.o obj-$(CONFIG_BOOTCOUNT_I2C) += bootcount_i2c.o obj-$(CONFIG_BOOTCOUNT_EXT) += bootcount_ext.o obj-$(CONFIG_BOOTCOUNT_AM33XX_NVMEM) += bootcount_nvmem.o +obj-$(CONFIG_BOOTCOUNT_PMIC_PFUZE100) += bootcount_pmic_pfuze100.o obj-$(CONFIG_DM_BOOTCOUNT) += bootcount-uclass.o obj-$(CONFIG_DM_BOOTCOUNT_RTC) += rtc.o
drivers/bootcount/bootcount_pmic_pfuze100.c new file +83 -0
83 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH 2/2] bootcount: Add pmic pfuze100 bootcount driver
Hi Philip,
Quoted 7 lines · Philip Oberfichtner
Use the MEMA - MEMD registers on the PFUZE100 as bootcount registers.
Based on work from Heiko Schocher <[email protected]>.
Signed-off-by Philip Oberfichtner <[email protected]>
Quoted 7 lines
---
drivers/bootcount/Kconfig | 7 ++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_pmic_pfuze100.c | 83 +++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 drivers/bootcount/bootcount_pmic_pfuze100.c
This should use driver model (DM_PMIC). Please don't add new features to unmigrated code.
Regards,
Simon
Re: [PATCH 2/2] bootcount: Add pmic pfuze100 bootcount driver
Quoted 19 lines · Simon Glass
Hi Philip,
Quoted 6 lines · Philip Oberfichtner
Use the MEMA - MEMD registers on the PFUZE100 as bootcount registers.
Based on work from Heiko Schocher <[email protected]>.
Signed-off-by Philip Oberfichtner <[email protected]>Quoted 8 lines
---
drivers/bootcount/Kconfig | 7 ++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_pmic_pfuze100.c | 83 +++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 drivers/bootcount/bootcount_pmic_pfuze100.c
Quoted 5 lines
This should use driver model (
DM_PMIC). Please don't add new features to unmigrated code.Regards,
Simon
Hi Simon,
thanks for the feedback. I sent a V2 using DM.
Best regardsPhilip