3 * Heiko Schocher, DENX Software Engineering, hs@denx.de.
5 * SPDX-License-Identifier: GPL-2.0+
9 #include <linux/compiler.h>
14 void bootcount_store(ulong a)
21 ret = i2c_write(CONFIG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR,
22 CONFIG_BOOTCOUNT_ALEN, buf, 2);
24 puts("Error writing bootcount\n");
27 ulong bootcount_load(void)
32 ret = i2c_read(CONFIG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR,
33 CONFIG_BOOTCOUNT_ALEN, buf, 2);
35 puts("Error loading bootcount\n");
38 if (buf[0] == BC_MAGIC)