[PATCH v2 03/38] common: fdt_support: Support special case of PCI address in fdt_read_prop()
Priyanka Jain
priyanka.jain at nxp.com
Mon Feb 22 08:42:25 CET 2021
>-----Original Message-----
>From: Bin Meng <bmeng.cn at gmail.com>
>Sent: Thursday, February 18, 2021 9:28 PM
>To: Simon Glass <sjg at chromium.org>; Alexander Graf <agraf at csgraf.de>;
>Priyanka Jain <priyanka.jain at nxp.com>
>Cc: U-Boot Mailing List <u-boot at lists.denx.de>; Tom Rini
><trini at konsulko.com>
>Subject: [PATCH v2 03/38] common: fdt_support: Support special case of PCI
>address in fdt_read_prop()
>
>At present fdt_read_prop() can only handle 1 or 2 cells. It is called by
>fdt_read_range() which may be used to read PCI address from <ranges> for a
>PCI bus node where the number of PCI address cell is 3. The <ranges>
>property is an array of:
>
> { <child address> <parent address> <size in child address space> }
>
>When trying to read <child address> from a PCI bus node using
>fdt_read_prop(), as the codes below:
>
> /* Read <child address> */
> if (child_addr) {
> r = fdt_read_prop(ranges, ranges_len, cell, child_addr,
> acells);
> if (r)
> return r;
> }
>
>it will fail, because the PCI child address is made up of 3 cells but
>fdt_read_prop() cannot handle it. We advance the cell offset by 1 so that the
><child address> can be correctly read.
>
>This adds the special handling of such case.
>
>Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>
>---
>
Reviewed-by: Priyanka Jain <priyanka.jain at nxp.com>
More information about the U-Boot
mailing list