]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
misc: atsha204a: fix i2c address readout from DTS
authorAdrian Fiergolski <adrian.fiergolski@fastree3d.com>
Tue, 11 Jan 2022 18:05:31 +0000 (19:05 +0100)
committerHeiko Schocher <hs@denx.de>
Wed, 23 Mar 2022 06:27:37 +0000 (07:27 +0100)
This patch replaces use fdtdec_get_addr with simpler dev_read_addr().
fdtdec_get_addr doesn't work properly on ZynqMP-based (64bit) system. Although
not confirmed, it could be related to the fact, that quoting the documentation,
"This variant hard-codes the number of cells used to represent the address and
size based on sizeof(fdt_addr_t) and sizeof(fdt_size_t)".

Signed-off-by: Adrian Fiergolski <adrian.fiergolski@fastree3d.com>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
drivers/misc/atsha204a-i2c.c

index d264477927d5a6151b8d9fb1cceedc836d9edda5..b89463babb561b3d6d3e1522c5699f282524b8b5 100644 (file)
@@ -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;