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

Marek Vasut marex at denx.de
Thu Jan 30 11:36:32 CET 2025


On 1/30/25 6:24 AM, Heiko Schocher wrote:
> 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?

Do we have one ? I don't see one with git grep, but I can write one.

That said, I would very much like to get feedback from the CERN person, 
to make sure this change does not break their setup.


More information about the U-Boot mailing list