• Przemyslaw Marczak's avatar
    fdtdec: fix parsing 'reg' property with zero value in '#size-cells' · ff0a6358
    Przemyslaw Marczak authored
    After rework of lib/fdtdec.c by:
    
    commit: 02464e38 fdt: add new fdt address parsing functions
    
    the function fdtdec_get_addr() doesn't work as previous,
    because the implementation assumes that properties '#address-cells'
    and '#size-cells' are equal to 1, which can be not true sometimes.
    
    The new API introduced fdtdec_get_addr_size_auto_parent() for the 'reg'
    property parsing, but the implementation assumes, that #size-cells
    can't be less than 1.
    
    This causes that the following children's 'reg' property can't be reached:
    
    parent@0x0 {
         #address-cells = <1>;
         #size-cells = <0>;
         children@0x100 {
             reg = < 0x100 >;
         };
    };
    
    Change the condition value from '1' to '0', which allows parsing property
    with at least zero #size-cells, fixes the issue.
    
    Now, fdtdec_get_addr_size_auto_parent() works properly.
    
    Tested on: Odroid U3/X2, Trats, Trats2, Odroid XU3, Snow (by Simon).
    Signed-off-by: default avatarPrzemyslaw Marczak <p.marczak@samsung.com>
    Acked-by: default avatarStephen Warren <swarren@nvidia.com>
    Acked-by: default avatarSimon Glass <sjg@chromium.org>
    Tested-by: default avatarSimon Glass <sjg@chromium.org>
    ff0a6358
Name
Last commit
Last update
..
bzip2 Loading commit data...
dhry Loading commit data...
efi Loading commit data...
libfdt Loading commit data...
lzma Loading commit data...
lzo Loading commit data...
rsa Loading commit data...
tizen Loading commit data...
zlib Loading commit data...
Kconfig Loading commit data...
Makefile Loading commit data...
addr_map.c Loading commit data...
aes.c Loading commit data...
asm-offsets.c Loading commit data...
bch.c Loading commit data...
bitrev.c Loading commit data...
circbuf.c Loading commit data...
crc16.c Loading commit data...
crc32.c Loading commit data...
crc7.c Loading commit data...
crc8.c Loading commit data...
ctype.c Loading commit data...
display_options.c Loading commit data...
div64.c Loading commit data...
errno.c Loading commit data...
errno_str.c Loading commit data...
fdtdec.c Loading commit data...
fdtdec_common.c Loading commit data...
fdtdec_test.c Loading commit data...
gunzip.c Loading commit data...
gzip.c Loading commit data...
hang.c Loading commit data...
hashtable.c Loading commit data...
initcall.c Loading commit data...
ldiv.c Loading commit data...
linux_compat.c Loading commit data...
linux_string.c Loading commit data...
list_sort.c Loading commit data...
lmb.c Loading commit data...
md5.c Loading commit data...
net_utils.c Loading commit data...
physmem.c Loading commit data...
qsort.c Loading commit data...
rand.c Loading commit data...
rbtree.c Loading commit data...
rc4.c Loading commit data...
sha1.c Loading commit data...
sha256.c Loading commit data...
slre.c Loading commit data...
string.c Loading commit data...
strmhz.c Loading commit data...
time.c Loading commit data...
tpm.c Loading commit data...
trace.c Loading commit data...
uuid.c Loading commit data...
vsprintf.c Loading commit data...