diff options
author | Tom Rini <trini@konsulko.com> | 2023-11-02 10:12:33 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-11-02 10:12:33 -0400 |
commit | 07fe79c93c5caba181f37844ca95fbda4db3f613 (patch) | |
tree | 9766b3de49837bae1d4ea6c6b69fc33710333fd2 /drivers/bootcount/bootcount_i2c.c | |
parent | b0c391ce0c01064a96711965e22f5d745e73edc3 (diff) | |
parent | 5b6ee512ceb8d990e010646c4fe7b8a3633fad68 (diff) |
Merge tag 'i2cfixes-for-v2024-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-i2c
i2c updates for v2024.01-rc2
- nuvoton: support standard/fast/fast plus mode
- bootcount: remove legacy i2c driver and implement
DM based version
Bugfixes:
- designware_i2c: adjust timing calculation
SPL probing failed on the StarFive VisionFive 2 board
Heinrich fixed this, by syncing timing calculation with
linux implementation.
Diffstat (limited to 'drivers/bootcount/bootcount_i2c.c')
-rw-r--r-- | drivers/bootcount/bootcount_i2c.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/drivers/bootcount/bootcount_i2c.c b/drivers/bootcount/bootcount_i2c.c deleted file mode 100644 index b3ac67ea35..0000000000 --- a/drivers/bootcount/bootcount_i2c.c +++ /dev/null @@ -1,43 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0+ -/* - * (C) Copyright 2013 - * Heiko Schocher, DENX Software Engineering, hs@denx.de. - */ - -#include <bootcount.h> -#include <linux/compiler.h> -#include <i2c.h> - -#define BC_MAGIC 0xbc - -void bootcount_store(ulong a) -{ - unsigned char buf[3]; - int ret; - - buf[0] = BC_MAGIC; - buf[1] = (a & 0xff); - ret = i2c_write(CFG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR, - CONFIG_BOOTCOUNT_ALEN, buf, 2); - if (ret != 0) - puts("Error writing bootcount\n"); -} - -ulong bootcount_load(void) -{ - unsigned char buf[3]; - int ret; - - ret = i2c_read(CFG_SYS_I2C_RTC_ADDR, CONFIG_SYS_BOOTCOUNT_ADDR, - CONFIG_BOOTCOUNT_ALEN, buf, 2); - if (ret != 0) { - puts("Error loading bootcount\n"); - return 0; - } - if (buf[0] == BC_MAGIC) - return buf[1]; - - bootcount_store(0); - - return 0; -} |