
On Thu, 10 Jun 2021 at 06:41, Nandor Han nandor.han@vaisala.com wrote:
The driver will use a syscon regmap as backend and supports both 16 and 32 size value. The value will be stored in the CPU's endianness.
Signed-off-by: Nandor Han nandor.han@vaisala.com
Notes: Description ----------- Add a new driver for bootcount feature that supports `syscon` device as backend.
Testing ------- UnitTests: 1. Verify that unit-tests run successfully: PASS ``` ./test/py/test.py --bd sandbox --build -k ut_dm_bootcount -v test/py/tests/test_ut.py::test_ut[ut_dm_bootcount_rtc] PASSED [ 33%] test/py/tests/test_ut.py::test_ut[ut_dm_bootcount_syscon_four_bytes] PASSED [ 66%] test/py/tests/test_ut.py::test_ut[ut_dm_bootcount_syscon_two_bytes] PASSED [100%] ``` Using hardware: Board: i.MX6sx based dev board U-Boot version: 2020.01 1. Use `bootcount` command to verity that value is updated correctly: PASS
Changes since v1:
- rebased
arch/sandbox/dts/test.dts | 14 ++ configs/sandbox_defconfig | 1 + doc/device-tree-bindings/bootcount-syscon.txt | 25 +++ drivers/bootcount/Kconfig | 12 ++ drivers/bootcount/Makefile | 1 + drivers/bootcount/bootcount_syscon.c | 159 ++++++++++++++++++ test/dm/bootcount.c | 48 +++++- 7 files changed, 257 insertions(+), 3 deletions(-) create mode 100644 doc/device-tree-bindings/bootcount-syscon.txt create mode 100644 drivers/bootcount/bootcount_syscon.c
Reviewed-by: Simon Glass sjg@chromium.org