[PATCH] bootcount: zynqmp: Extend ZynqMP specific bootcount support

Heiko Schocher hs at denx.de
Thu Jan 30 06:24:01 CET 2025


Hello Marek,

On 30.01.25 02:37, Marek Vasut wrote:
> The PGGS area contains four registers, each of which can hold up to
> 32bit of data. Extend the boot counter to support storing boot count
> in either of the four registers with arbitrary mask to avoid limiting
> the boot counter only to the PGGS register 2 LSByte.
> 
> Drop U_BOOT_DRVINFO() as that would instantiate the boot counter even
> if there is no DT node associated with it, that is undesired behavior.
> 
> The boot counter configuration is implemented using three new DT properties:
> reg - PGGS register address, fallback to PGGS 2 at 0xffd80058
> u-boot,bootcount-reg-mask - Register mask, applied on PGGS register
> u-boot,bootcount-mask - Boot counter mask, applied on boot counter
> u-boot,bootcount-magic - Boot counter magic, applied on boot counter
> 
> Example configuration of 16bit boot counter with 0xb0010000 magic in PGGS0:
> 
> &amba {
> 	bootcount at 0xffd80050 {
> 		compatible = "u-boot,bootcount-zynqmp";
> 		reg = <0 0xffd80050 0 0x4>;
> 		u-boot,bootcount-magic = <0xb0010000>;
> 		u-boot,bootcount-mask = <0xffff>;
> 		u-boot,bootcount-reg-mask = <0xffffffff>;
> 	};
> };
> 
> Signed-off-by: Marek Vasut <marex at denx.de>
> ---
> Cc: Heiko Schocher <hs at denx.de>
> Cc: Michal Simek <michal.simek at amd.com>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: Vasileios Amoiridis <vasileios.amoiridis at cern.ch>
> Cc: u-boot at lists.denx.de
> ---
>   drivers/bootcount/bootcount_zynqmp.c | 79 +++++++++++++++++++++++++---
>   1 file changed, 71 insertions(+), 8 deletions(-)

Nitpick: Should there not be a change in a file where the new properties
and the compatible entry is documented?

Beside of that:

Reviewed-by: Heiko Schocher <hs at denx.de>

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list