[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



Hello Julien,


On 4/10/19 10:52 AM, Julien Grall wrote:


On 10/04/2019 09:43, Sharan Santhanam wrote:
Hello Jia He,

On 4/10/19 7:43 AM, 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.
"

So, seems I should

parent = fdt_parent_offset(fdt, nodeoffset);
naddr = fdt_address_cells(parent, nodeoffset);
nsize = fdt_size_cells(parent, nodeoffset);

I agree, we could do this way as well.

My suggestion was based on the previous patch where we implement interrupt-cells. For interpreting the interrupt property, we read interrupt-cell of the parent within the function fdt_interrupt_cells. In this function we pass the node offset of the child. We could try and keep the APIs consistent for similar type of functions.

Parsing #address-cells and #size-cells is different from parsing #interrupt-cells. The first two are found in the parent node, while the latter is found in the interrupt controller node (looked up via interrupt-parent).

Sorry, I did not mean it that way.

In the function fdt_interrupt_cells we expect the "offset" argument to be the node containing the interrupt property identify the interrupt-controller using the interrupt-parent whereas in the functions fdt_address_cells_or_parent we expect the "offset" argument to be the offset of the parent as we read the address-cell property within it.

My suggestion was to keep the offset argument represent the node containing the interrupt and reg property respectively.


Cheers,


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.