Skip to contentSkip to conversation

bootcount: add a DM i2c eeprom backing store for bootcount

PATCH New Robert Beckett 2 participants 2 messages Oct 28, 2019 – Jan 10, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootcount: add a DM i2c eeprom backing store for bootcount

This driver allows the use of i2c eeprom device or partition as backing store for boot counter values with DM enabled.

---

 drivers/bootcount/Kconfig      | 10 ++++
 drivers/bootcount/Makefile     |  1 +
 drivers/bootcount/i2c-eeprom.c | 95 ++++++++++++++++++++++++++++++++++
 3 files changed, 106 insertions(+)
 create mode 100644 drivers/bootcount/i2c-eeprom.c
drivers/bootcount/Kconfig +10 -0
index b7c29f2fd3..0e506c9ea2 100644
@@ -96,6 +96,16 @@ config DM_BOOTCOUNT_RTC
 	  Accesses to the backing store are performed using the write16
 	  and read16 ops of DM RTC devices.
 
+config DM_BOOTCOUNT_I2C_EEPROM
+	bool "Support i2c eeprom devices as a backing store for bootcount"
+	depends on I2C_EEPROM
+	help
+	  Enabled reading/writing the bootcount in a DM i2c eeprom device.
+	  The wrapper device is to be specified with the compatible string
+	  'u-boot,bootcount-i2c-eeprom' and the 'i2c-eeprom'-property (a phandle
+	  pointing to the underlying i2c eeprom device) and an optional 'offset'
+	  property are supported.
+
 endmenu
 
 endif
drivers/bootcount/Makefile +1 -0
index f9841d8615..73ccfb5a08 100644
@@ -10,3 +10,4 @@ obj-$(CONFIG_BOOTCOUNT_EXT)	+= bootcount_ext.o
 
 obj-$(CONFIG_DM_BOOTCOUNT)      += bootcount-uclass.o
 obj-$(CONFIG_DM_BOOTCOUNT_RTC)  += rtc.o
+obj-$(CONFIG_DM_BOOTCOUNT_I2C_EEPROM)	+= i2c-eeprom.o
drivers/bootcount/i2c-eeprom.c new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 bootcount: add a DM i2c eeprom backing store for bootcount

Quoted 4 lines · Robert Beckett

This driver allows the use of i2c eeprom device or partition as backing store for boot counter values with DM enabled.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200110/cf53445c/attachment.sig>