STM32MP1 Backup registers

Sean Nyekjær sean at geanix.com
Wed Feb 1 02:25:01 PST 2023


Hi list,

We are using the u-boot "boot count" feature to store the boot count in the TAMP register BOOT_COUNTER.

If I export the register via the sram driver we can reset it (when everything goes well).
devicetree diff:
+&soc {
+       sram: sram at 5c00a100 {
+               compatible = "mmio-sram";
+               reg = <0x5c00a100 0x100>;
+               ranges = <0 0x5c00a100 0x100>;
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               bootcount at 54 {
+                       reg = <0x54 0x4>;
+                       export;
+               };
+       };
+};

But the memory range is already used by the "st,stm32-tamp” entry.
At some point we want to use the m4’s, so I guess my solution won’t work there.

What are the thoughts about this? And what is the preferred way of reseting the boot counter?
I’m thinking about doing an syscon driver for this, could that be an idea?

Br,
/Sean


More information about the linux-arm-kernel mailing list