[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCHv4 4/9] plat/common: Introduce fdt_{address, size}_cells_or_parent helpers
On 10/04/2019 06:43, Jia He wrote: Hi Sharan After I dig more on it, I would like to rework this patch 4/9. Please see the comments from libfdt author [1] " * #address-cells and #size-cells describe the format of addresses for children of this node, not this node itself. So if you're looking to parse 'reg' for this node, you *always* need to look at the parent, not just as a fallback. * #address-cells and #size-cells are *not* inherited. If they're missing in a node, then the format for its children's addresses is 2 cell addresses and 2 cell sizes, it is *not* correct to look at the next parent up for these properties. " As I pointed out earlier on, the Device-Tree spec requires to return 1 is #size-cells is missing. This is different from the libfdt implementation. So ... So, seems I should parent = fdt_parent_offset(fdt, nodeoffset); naddr = fdt_address_cells(parent, nodeoffset); nsize = fdt_size_cells(parent, nodeoffset); ... this would return the wrong value if #size-cells is no present. Cheers, -- Julien Grall _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |