From: Rob Herring <robh@kernel.org>
To: Herve Codina <herve.codina@bootlin.com>
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 v4 5/6] of: Add #address-cells/#size-cells in the device-tree root empty node
Date: Mon, 2 Dec 2024 09:48:00 -0600 [thread overview]
Message-ID: <20241202154800.GA2617722-robh@kernel.org> (raw)
In-Reply-To: <20241202131522.142268-6-herve.codina@bootlin.com>
On Mon, Dec 02, 2024 at 02:15:17PM +0100, Herve Codina 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 does not have the #address-cells and
> the #size-cells properties
>
> This leads to the use of the default address cells and size cells values
> which are defined in the code to 1 for the address cells value and 1 for
> the size cells value.
>
> According to the devicetree specification and the OpenFirmware standard
> (IEEE 1275-1994) the default value for #address-cells should be 2.
>
> Also, according to the devicetree specification, the #address-cells and
> the #size-cells are required properties in the root node.
>
> The device tree compiler already uses 2 as default value for address
> cells and 1 for size cells. The powerpc PROM code also uses 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.
>
> On x86, this root empty node is used and the code default values are
> used.
>
> In preparation of the support for device-tree overlay on PCI devices
> feature on x86 (i.e. the creation of the PCI root bus device-tree node),
> the default value for #address-cells needs to be updated. Indeed, on
> x86_64, addresses are on 64bits and the upper part of an address is
> needed for correct address translations. On x86_32 having the default
> value updated does not lead to issues while the upper part of a 64-bit
> value is zero.
>
> Changing the default value for all architectures may break device-tree
> compatibility. Indeed, existing dts file without the #address-cells
> property set in the root node will not be compatible with this
> modification.
>
> Instead of updating default values, add both required #address-cells
> and #size-cells properties in the device-tree empty node.
>
> Use 2 for both properties value in order to fully support 64-bit
> addresses and sizes on systems using this empty root node.
>
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> ---
> drivers/of/empty_root.dts | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
This also fixes unittest hitting a warning added for 6.13. So
I've applied this patch as a fix.
Rob
next prev parent reply other threads:[~2024-12-02 15:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-02 13:15 [PATCH v4 0/6] Add support for the PCI host bridge device-tree node creation Herve Codina
2024-12-02 13:15 ` [PATCH v4 1/6] driver core: Introduce device_{add,remove}_of_node() Herve Codina
2024-12-04 21:38 ` Bjorn Helgaas
2024-12-05 7:00 ` Greg Kroah-Hartman
2024-12-05 7:33 ` Herve Codina
2024-12-02 13:15 ` [PATCH v4 2/6] PCI: of: Use device_{add,remove}_of_node() to attach of_node to existing device Herve Codina
2024-12-02 13:15 ` [PATCH v4 3/6] PCI: of_property: Add support for NULL pdev in of_pci_set_address() Herve Codina
2024-12-02 13:15 ` [PATCH v4 4/6] PCI: of_property: Constify parameter in of_pci_get_addr_flags() Herve Codina
2024-12-02 13:15 ` [PATCH v4 5/6] of: Add #address-cells/#size-cells in the device-tree root empty node Herve Codina
2024-12-02 15:48 ` Rob Herring [this message]
2024-12-02 13:15 ` [PATCH v4 6/6] PCI: of: Create device-tree PCI host bridge node Herve Codina
2024-12-04 21:48 ` Bjorn Helgaas
2024-12-05 7:37 ` 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=20241202154800.GA2617722-robh@kernel.org \
--to=robh@kernel.org \
--cc=allan.nielsen@microchip.com \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=herve.codina@bootlin.com \
--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=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.