From: Herve Codina <herve.codina@bootlin.com>
To: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Saravana Kannan <saravanak@google.com>,
Bjorn Helgaas <bhelgaas@google.com>,
Lizhi Hou <lizhi.hou@amd.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-pci@vger.kernel.org,
Allan Nielsen <allan.nielsen@microchip.com>,
Horatiu Vultur <horatiu.vultur@microchip.com>,
Steen Hegelund <steen.hegelund@microchip.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v2 5/6] of: Add #address-cells/#size-cells in the device-tree root empty node
Date: Fri, 8 Nov 2024 18:39:58 +0100 [thread overview]
Message-ID: <20241108183958.0f136e01@bootlin.com> (raw)
In-Reply-To: <CAL_JsqLWUSCJMU5LMz8X_0gU74YNy6-vRXGvY24ZpVj+EZW-sA@mail.gmail.com>
On Fri, 8 Nov 2024 11:24:36 -0600
Rob Herring <robh@kernel.org> wrote:
> On Fri, Nov 8, 2024 at 10:29 AM Herve Codina <herve.codina@bootlin.com> wrote:
> >
> > Hi Rob,
> >
> > On Fri, 8 Nov 2024 10:03:31 -0600
> > Rob Herring <robh@kernel.org> wrote:
> >
> > > On Fri, Nov 8, 2024 at 8:36 AM Herve Codina <herve.codina@bootlin.com> wrote:
> > > >
> > > > On systems where ACPI is enabled or when a device-tree is not passed to
> > > > the kernel by the bootloader, a device-tree root empty node is created.
> > > > This device-tree root empty node doesn't have the #address-cells and the
>
> > > > + /*
> > > > + * #address-cells/#size-cells are required properties at root node
> > > > + * according to the devicetree specification. Use same values as default
> > > > + * values mentioned for #address-cells/#size-cells properties.
> > >
> > > Which default? We have multiple...
> >
> > I will reword:
> > Use values mentioned in the devicetree specification as default values
> > for #address-cells and #size-cells properties
>
> My point was that "default" is meaningless because there are multiple
> sources of what's default.
I see thanks.
I will update the code comment.
>
> > >
> > > There's also dtc's idea of default which IIRC is 2 and 1 like OpenFirmware.
> >
> > I can re-add this part in the commit log:
> > The device tree compiler already uses 2 as default value for address cells
> > and 1 for size cells. The powerpc PROM code also use 2 as default value
> > for #address-cells and 1 for #size-cells. Modern implementation should
> > have the #address-cells and the #size-cells properties set and should
> > not rely on default values.
> >
> > In your opinion, does it make sense?
> >
> > >
> > > > + */
> > > > + #address-cells = <0x02>;
> > > > + #size-cells = <0x01>;
> > >
> > > I think we should just do 2 cells for size.
> >
> > Why using 2 for #size-cells?
> >
> > I understand that allows to have size defined on 64bits but is that needed?
> > How to justify this value here?
>
> Most systems are 64-bit today. And *all* ACPI based systems are. Not
> that the DT has to match 32 vs 64 bit CPU, most of the time it does.
>
> It also doesn't actually change anything for you because you're going
> to have "pci" nodes and the "ranges" there takes #size-cells from the
> pci node, not the parent.
>
Right.
I will set:
#address-cells = <0x02>;
#size-cells = <0x02>;
Best regards,
Hervé
next prev parent reply other threads:[~2024-11-08 17:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 14:35 [PATCH v2 0/6] Add support for the PCI host bridge device-tree node creation Herve Codina
2024-11-08 14:35 ` [PATCH v2 1/6] driver core: Introduce device_{add,remove}_of_node() Herve Codina
2024-11-08 14:35 ` [PATCH v2 2/6] PCI: of: Use device_{add,remove}_of_node() to attach of_node to existing device Herve Codina
2024-11-08 14:35 ` [PATCH v2 3/6] PCI: of_property: Add support for NULL pdev in of_pci_set_address() Herve Codina
2024-11-08 14:35 ` [PATCH v2 4/6] PCI: of_property: Constify parameter in of_pci_get_addr_flags() Herve Codina
2024-11-08 14:35 ` [PATCH v2 5/6] of: Add #address-cells/#size-cells in the device-tree root empty node Herve Codina
2024-11-08 16:03 ` Rob Herring
2024-11-08 16:29 ` Herve Codina
2024-11-08 17:24 ` Rob Herring
2024-11-08 17:39 ` Herve Codina [this message]
2024-11-08 14:35 ` [PATCH v2 6/6] PCI: of: Create device-tree PCI host bridge node Herve Codina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241108183958.0f136e01@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=allan.nielsen@microchip.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=horatiu.vultur@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lizhi.hou@amd.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=steen.hegelund@microchip.com \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox