diff options
author | Tom Rini <trini@konsulko.com> | 2022-03-23 09:10:34 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-03-23 09:10:34 -0400 |
commit | 5bc486286f4f54d9f399adaa560720d4bf9f6566 (patch) | |
tree | 23c2e67a3c2a0068a0879e1669d02da5adc476df /drivers | |
parent | 3789b6a92fe958174da8d045c1f5d39822eaba7d (diff) | |
parent | fc1383ae2b5ca69e51bee68e4047589a5ee7b386 (diff) |
Merge tag 'i2c-2022-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-i2c
i2c changes for fixes-for-2022.04
- atsha204a-i2c.c
DTS and I2C fixes for Atmel ATSHA204 from Adrian
- i2c: fix always-true condition in i2c_probe_chip()
from Nikita
- eeprom: Do not rewrite EEPROM I2C bus with DM I2C enabled
from Marek
- clarify bootcount documentation fix from Michael
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bootcount/Kconfig | 10 | ||||
-rw-r--r-- | drivers/i2c/i2c-uclass.c | 2 | ||||
-rw-r--r-- | drivers/misc/atsha204a-i2c.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/drivers/bootcount/Kconfig b/drivers/bootcount/Kconfig index 607027c968..65c052fc2e 100644 --- a/drivers/bootcount/Kconfig +++ b/drivers/bootcount/Kconfig @@ -68,15 +68,15 @@ config BOOTCOUNT_ENV "bootcount" is stored in the environment. To prevent a saveenv on all reboots, the environment variable "upgrade_available" is used. If "upgrade_available" is - 0, "bootcount" is always 0, if "upgrade_available" is - 1 "bootcount" is incremented in the environment. + 0, "bootcount" is always 0. If "upgrade_available" is 1, + "bootcount" is incremented in the environment. So the Userspace Application must set the "upgrade_available" - and "bootcount" variable to 0, if a boot was successfully. + and "bootcount" variables to 0, if the system booted successfully. config BOOTCOUNT_RAM bool "Boot counter in RAM" help - Store the bootcount in DRAM protected against against bit errors + Store the bootcount in DRAM protected against bit errors due to short power loss or holding a system in RESET. config BOOTCOUNT_I2C @@ -166,7 +166,7 @@ config BOOTCOUNT_BOOTLIMIT help Set the Maximum number of reboot cycles allowed without the boot counter being cleared. - If set to 0 do not set a boot limit in the environment. + If set to 0, do not set a boot limit in the environment. config BOOTCOUNT_ALEN int "I2C address length" diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index 5539becc19..335911c46b 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -280,7 +280,7 @@ static int i2c_probe_chip(struct udevice *bus, uint chip_addr, if (ops->probe_chip) { ret = ops->probe_chip(bus, chip_addr, chip_flags); - if (!ret || ret != -ENOSYS) + if (ret != -ENOSYS) return ret; } diff --git a/drivers/misc/atsha204a-i2c.c b/drivers/misc/atsha204a-i2c.c index 715dabb279..b89463babb 100644 --- a/drivers/misc/atsha204a-i2c.c +++ b/drivers/misc/atsha204a-i2c.c @@ -240,10 +240,10 @@ int atsha204a_wakeup(struct udevice *dev) } debug("success\n"); - break; + return 0; } - return 0; + return -ETIMEDOUT; } int atsha204a_idle(struct udevice *dev) @@ -280,6 +280,7 @@ static int atsha204a_transaction(struct udevice *dev, struct atsha204a_req *req, } do { + udelay(ATSHA204A_EXECTIME); res = atsha204a_recv_resp(dev, resp); if (!res || res == -EMSGSIZE || res == -EBADMSG) break; @@ -287,7 +288,6 @@ static int atsha204a_transaction(struct udevice *dev, struct atsha204a_req *req, debug("ATSHA204A transaction polling for response " "(timeout = %d)\n", timeout); - udelay(ATSHA204A_EXECTIME); timeout -= ATSHA204A_EXECTIME; } while (timeout > 0); @@ -388,7 +388,7 @@ static int atsha204a_of_to_plat(struct udevice *dev) fdt_addr_t *priv = dev_get_priv(dev); fdt_addr_t addr; - addr = fdtdec_get_addr(gd->fdt_blob, dev_of_offset(dev), "reg"); + addr = dev_read_addr(dev); if (addr == FDT_ADDR_T_NONE) { debug("Can't get ATSHA204A I2C base address\n"); return -ENXIO; |