Add pmic bootcount driver
v2 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.
Changes in v2:
- Migrated bootcount driver to driver model
- Introduced error handling. Previously errors were ignored.
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/pmic_pfuze100.c | 161 ++++++++++++++++++++++++++++++ include/power/pfuze100_pmic.h | 5 + 4 files changed, 174 insertions(+) create mode 100644 drivers/bootcount/pmic_pfuze100.c
Signature · 1 line
2.34.1
PATCH v2 1/2 power: pfuze100: Add MEMx register definitions
Add missing MEMA - MEMD register definitions for PFUZE100.
Based on work from Heiko Schocher <[email protected]>.
---
(no changes since v1)
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
Re: [PATCH v2 1/2] power: pfuze100: Add MEMx register definitions
Quoted 4 lines · Philip Oberfichtner
Add missing MEMA - MEMD register definitions for PFUZE100.
Based on work from Heiko Schocher <[email protected]>.
Signed-off-by Philip Oberfichtner <[email protected]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom
PATCH v2 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]>.
---
Changes in v2:
- Migrated bootcount driver to driver model
- Introduced error handling. Previously errors were ignored.
drivers/bootcount/Kconfig | 7 ++ drivers/bootcount/Makefile | 1 + drivers/bootcount/pmic_pfuze100.c | 161 ++++++++++++++++++++++++++++++ 3 files changed, 169 insertions(+) create mode 100644 drivers/bootcount/pmic_pfuze100.c
drivers/bootcount/Kconfig +7 -0
@@ -127,6 +127,13 @@ config DM_BOOTCOUNT_I2C_EEPROM pointing to the underlying i2c eeprom device) and an optional 'offset' property are supported. +config DM_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 DM_BOOTCOUNT_SPI_FLASH bool "Support SPI flash devices as a backing store for bootcount" depends on DM_SPI_FLASH
drivers/bootcount/Makefile +1 -0
@@ -11,6 +11,7 @@ obj-$(CONFIG_BOOTCOUNT_EXT) += bootcount_ext.o obj-$(CONFIG_BOOTCOUNT_AM33XX_NVMEM) += bootcount_nvmem.o obj-$(CONFIG_DM_BOOTCOUNT) += bootcount-uclass.o +obj-$(CONFIG_DM_BOOTCOUNT_PMIC_PFUZE100) += pmic_pfuze100.o obj-$(CONFIG_DM_BOOTCOUNT_RTC) += rtc.o obj-$(CONFIG_DM_BOOTCOUNT_I2C_EEPROM) += i2c-eeprom.o obj-$(CONFIG_DM_BOOTCOUNT_SPI_FLASH) += spi-flash.o
drivers/bootcount/pmic_pfuze100.c new file +161 -0
161 lines not on this page · raw message
Signature · 1 line
2.34.1
Re: [PATCH v2 2/2] bootcount: Add pmic pfuze100 bootcount driver
Quoted 5 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]>
Applied to u-boot/next, thanks!
Signature · 1 line
Tom