1 // SPDX-License-Identifier: GPL-2.0+
4 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
8 #include <linux/compiler.h>
13 void bootcount_store(ulong a)
20 ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR,
21 CONFIG_BOOTCOUNT_ALEN, buf, 2);
23 puts("Error writing bootcount\n");
26 ulong bootcount_load(void)
31 ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR,
32 CONFIG_BOOTCOUNT_ALEN, buf, 2);
34 puts("Error loading bootcount\n");
37 if (buf[0] == BC_MAGIC)