: bootcount: zynqmp: Add bootcount API
Subsystems (3)
v3 cover : bootcount: zynqmp: Add bootcount API
From: Vasileios Amoiridis <[email protected]>
Changes in v3:
1) Organize correctly headers
2) Remove redundant "mio" and change "write" to "read"
3) Add "depends on ARCH_ZYNQMP"
v2: https://lore.kernel.org/u-boot/[email protected]/
v1: https://lore.kernel.org/u-boot/[email protected]/
Vasileios Amoiridis (1):
drivers: bootcount: Add ZynqMP specific bootcount support
MAINTAINERS | 1 + arch/arm/mach-zynqmp/include/mach/hardware.h | 2 + drivers/bootcount/Kconfig | 7 +++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_zynqmp.c | 47 ++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 drivers/bootcount/bootcount_zynqmp.c
base-commit: 56accc56b9aab87ef4809ccc588e1257969cd271
Signature · 1 line
2.34.1
PATCH v3 1/1 drivers: bootcount: Add ZynqMP specific bootcount support
From: Vasileios Amoiridis <[email protected]>
Add native support of the bootcount mechanism in the ZynqMP by utilising internal PMU registers. The Persistent Global Storage Registers of the Platform Management Unit can keep their value during reboot cycles unless there is a POR reset, making them appropriate for the bootcount mechanism.
--- MAINTAINERS | 1 + arch/arm/mach-zynqmp/include/mach/hardware.h | 2 + drivers/bootcount/Kconfig | 7 +++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_zynqmp.c | 47 ++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 drivers/bootcount/bootcount_zynqmp.c
MAINTAINERS +1 -0
@@ -860,6 +860,7 @@ M: Michal Simek <[email protected]> S: Maintained T: git https://source.denx.de/u-boot/custodians/u-boot-microblaze.git F: arch/arm/mach-zynqmp/ +F: drivers/bootcount/bootcount_zynqmp.c F: drivers/clk/clk_zynqmp.c F: driver/firmware/firmware-zynqmp.c F: drivers/fpga/zynqpl.c
arch/arm/mach-zynqmp/include/mach/hardware.h +2 -0
@@ -188,6 +188,8 @@ struct pmu_regs {u32 gen_storage4;/* 0x40 */ u32 reserved1[1 ];u32 gen_storage6;/* 0x48 */ +u32 reserved2[3 ]; +u32 pers_gen_storage2;/* 0x58 */ };#define pmu_base ((struct pmu_regs *)ZYNQMP_PMU_BASEADDR)
drivers/bootcount/Kconfig +7 -0
@@ -164,6 +164,13 @@ config DM_BOOTCOUNT_SYSCON Accessing the backend is done using the regmap interface. +config DM_BOOTCOUNT_ZYNQMP + bool "Support ZynqMP PMUFW as a backing store for bootcount" + depends on ARCH_ZYNQMP + help + Enable support for the bootcount API by utilising the Persistent + Global General Storage Register 2 of the PMU. + endmenu endif
drivers/bootcount/Makefile +1 -0
@@ -16,3 +16,4 @@ obj-$(CONFIG_DM_BOOTCOUNT_I2C_EEPROM) += i2c-eeprom.o obj-$(CONFIG_DM_BOOTCOUNT_I2C) += bootcount_dm_i2c.o obj-$(CONFIG_DM_BOOTCOUNT_SPI_FLASH) += spi-flash.o obj-$(CONFIG_DM_BOOTCOUNT_SYSCON) += bootcount_syscon.o +obj-$(CONFIG_DM_BOOTCOUNT_ZYNQMP) += bootcount_zynqmp.o
drivers/bootcount/bootcount_zynqmp.c new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
2.34.1
Quoted 20 lines · Vasileios Amoiridis
From: Vasileios Amoiridis <[email protected]>
Changes in v3:
1) Organize correctly headers
2) Remove redundant "mio" and change "write" to "read"
3) Add "depends onARCH_ZYNQMP"v2: https://lore.kernel.org/u-boot/[email protected]/
v1: https://lore.kernel.org/u-boot/[email protected]/Vasileios Amoiridis (1):
drivers: bootcount: Add ZynqMP specific bootcount supportMAINTAINERS | 1 + arch/arm/mach-zynqmp/include/mach/hardware.h | 2 + drivers/bootcount/Kconfig | 7 +++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_zynqmp.c | 47 ++++++++++++++++++++ 5 files changed, 58 insertions(+)
Quoted 4 lines
create mode 100644
drivers/bootcount/bootcount_zynqmp.cbase-commit:
56accc56b9aab87ef4809ccc588e1257969cd271
Applied.
M