Attention is currently required from: Kapil Porwal, Subrata Banik.
Julius Werner has posted comments on this change by Kapil Porwal. ( https://review.coreboot.org/c/coreboot/+/86030?usp=email )
Change subject: commonlib/dt: Fix incorrect cell properties ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1:
If we exit from PASS#2 without returning cell properties of current parent (i.e. "/abc") the cell properties would contain values from PASS#1 which is not correct.
No, that is correct, that's the whole point of the original patch. See the FDT specification here: https://devicetree-specification.readthedocs.io/en/stable/devicetree-basics....
The #address-cells property defines the number of <u32> cells used to encode the address field in a child node’s reg property.
The cells properties of a node define the rules for the reg properties of its _children_. That means when you use the normal pattern of ``` struct device_tree_node *node = dt_find_node(tree->root, "/cpus/cpu@0", &address_cells, &size_cells, 0); dt_read_reg_prop(node, address_cells, size_cells, regions, ARRAY_SIZE(regions)); ``` you want `address_cells` and `size_cells` to contain the value up to `/cpus`, _not_ up to `/cpus/cpu@0`. `fdt_find_node()` was already doing the same thing for the same reason.