devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Add support for the root PCI bus device-tree node creation.
@ 2024-11-04 17:19 Herve Codina
  2024-11-04 17:19 ` [PATCH 1/6] driver core: Introduce device_{add,remove}_of_node() Herve Codina
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Herve Codina @ 2024-11-04 17:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Rob Herring,
	Saravana Kannan, Bjorn Helgaas, Lizhi Hou
  Cc: linux-kernel, devicetree, linux-pci, Allan Nielsen,
	Horatiu Vultur, Steen Hegelund, Thomas Petazzoni, Herve Codina

Hi,

This series adds support for creating a device-tree node for a root PCI
bus on non device-tree based system.

Creating device-tree nodes for PCI devices already exists upstream. It
was added in commit 407d1a51921e ("PCI: Create device tree node for
bridge"). Created device-tree nodes need a parent node to be attached
to. For the first level devices, on device-tree based system, this
parent node (i.e. the root PCI bus) is described in the base device-tree
(PCI controller).

The LAN966x PCI device driver was recently accepted [1] and relies on
this feature.

On system where the base hardware is not described by a device-tree, the
root PCI bus node to which first level created PCI devices need to be
attach to does not exist. This is the case for instance on ACPI
described systems such as x86.

This series goal is to handle this case.

In order to have the root PCI bus device-tree node available even on
x86, this top level node is created (if not already present) based on
information computed by the PCI core. It follows the same mechanism as
the one used for PCI devices device-tree node creation.

In order to have this feature available, a number of changes are needed:
  - Patch 1 and 2: Introduce and use device_{add,remove}_of_node().
    This function will also be used in the root PCI bus node creation.

  - Patch 3 and 4: Improve existing functions to reuse them in the root
    PCI bus node creation.

  - Patch 5: Update the default value used when #address-cells is not
    available in the device-tree root node.

  - Patch 6: The root PCI bus device-tree node creation itself.

With those modifications, the LAN966x PCI device is working on x86 systems.

[1] https://lore.kernel.org/lkml/7512cbb7911b8395d926e9e9e390fbb55ce3aea9.camel@pengutronix.de/

Best regards,
Hervé Codina

Herve Codina (6):
  driver core: Introduce device_{add,remove}_of_node()
  PCI: of: Use device_{add,remove}_of_node() to attach of_node to
    existing device
  PCI: of_property: Add support for NULL pdev in of_pci_set_address()
  PCI: of_property: Constify parameter in of_pci_get_addr_flags()
  of: Use the standards compliant default address cells value for x86
  PCI: of: Create device-tree root bus node

 drivers/base/core.c       |  52 ++++++++++++++++++
 drivers/of/of_private.h   |   2 +-
 drivers/pci/of.c          |  89 +++++++++++++++++++++++++++++-
 drivers/pci/of_property.c | 113 ++++++++++++++++++++++++++++++++++++--
 drivers/pci/pci.h         |   6 ++
 drivers/pci/probe.c       |   2 +
 drivers/pci/remove.c      |   2 +
 include/linux/device.h    |   2 +
 8 files changed, 260 insertions(+), 8 deletions(-)

-- 
2.46.2


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-11-06 16:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04 17:19 [PATCH 0/6] Add support for the root PCI bus device-tree node creation Herve Codina
2024-11-04 17:19 ` [PATCH 1/6] driver core: Introduce device_{add,remove}_of_node() Herve Codina
2024-11-04 17:19 ` [PATCH 2/6] PCI: of: Use device_{add,remove}_of_node() to attach of_node to existing device Herve Codina
2024-11-04 20:20   ` Rob Herring
2024-11-05 16:16     ` Herve Codina
2024-11-04 17:19 ` [PATCH 3/6] PCI: of_property: Add support for NULL pdev in of_pci_set_address() Herve Codina
2024-11-04 17:19 ` [PATCH 4/6] PCI: of_property: Constify parameter in of_pci_get_addr_flags() Herve Codina
2024-11-04 17:19 ` [PATCH 5/6] of: Use the standards compliant default address cells value for x86 Herve Codina
2024-11-04 20:07   ` Rob Herring
2024-11-05 16:35     ` Herve Codina
2024-11-04 17:20 ` [PATCH 6/6] PCI: of: Create device-tree root bus node Herve Codina
2024-11-05 18:59   ` Bjorn Helgaas
2024-11-06 14:53     ` Herve Codina
2024-11-06 16:47       ` Bjorn Helgaas
2024-11-04 20:15 ` [PATCH 0/6] Add support for the root PCI bus device-tree node creation Rob Herring
2024-11-05 17:44   ` Herve Codina
2024-11-05 19:59     ` Rob Herring
2024-11-06 13:33       ` Herve Codina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).