]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
misc: rp1: drop overlay support
authorAndrea della Porta <andrea.porta@suse.com>
Thu, 18 Dec 2025 19:09:07 +0000 (20:09 +0100)
committerFlorian Fainelli <florian.fainelli@broadcom.com>
Fri, 19 Dec 2025 20:42:23 +0000 (12:42 -0800)
The RP1 driver can load an overlay at runtime to describe the inner
peripherals. This has led to a lot of confusion regarding the naming
of nodes, their topology and the reclaiming of related node resources.

Since the overlay is currently not fully functional, drop its support
in the driver in favor of the fully described static DT.

This also means that this driver does not depend on CONFIG_PCI_DYNAMIC_OF_NODES
and no longer requires PCI quirks to dynamically create the intermediate
PCI nodes.

Signed-off-by: Andrea della Porta <andrea.porta@suse.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/4b0aa7160877cf128b9bc713776bcac73c46eb24.1766077285.git.andrea.porta@suse.com
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
drivers/misc/rp1/Kconfig
drivers/misc/rp1/Makefile
drivers/misc/rp1/rp1-pci.dtso [deleted file]
drivers/misc/rp1/rp1_pci.c
drivers/pci/quirks.c

index 5232e70d3079b8011ba15604bf82415600551924..2c13b3968b011a5af889891c628f13a69d3c4a58 100644 (file)
@@ -5,8 +5,7 @@
 
 config MISC_RP1
        tristate "RaspberryPi RP1 misc device"
-       depends on OF_IRQ && OF_OVERLAY && PCI_MSI && PCI_QUIRKS
-       select PCI_DYNAMIC_OF_NODES
+       depends on OF_IRQ && PCI_MSI
        help
          Support the RP1 peripheral chip found on Raspberry Pi 5 board.
 
@@ -15,6 +14,3 @@ config MISC_RP1
 
          The driver is responsible for enabling the DT node once the PCIe
          endpoint has been configured, and handling interrupts.
-
-         This driver uses an overlay to load other drivers to support for
-         RP1 internal sub-devices.
index 508b4cb056277843c5a4dd3ef052032d3ee4096a..ab32b433d7edea945180c746a9ffdfb4f8af7785 100644 (file)
@@ -1,3 +1,2 @@
 # SPDX-License-Identifier: GPL-2.0-only
-obj-$(CONFIG_MISC_RP1)         += rp1-pci.o
-rp1-pci-objs                   := rp1_pci.o rp1-pci.dtbo.o
+obj-$(CONFIG_MISC_RP1)         += rp1_pci.o
diff --git a/drivers/misc/rp1/rp1-pci.dtso b/drivers/misc/rp1/rp1-pci.dtso
deleted file mode 100644 (file)
index eea826b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0 OR MIT)
-
-/*
- * The dts overlay is included from the dts directory so
- * it can be possible to check it with CHECK_DTBS while
- * also compile it from the driver source directory.
- */
-
-/dts-v1/;
-/plugin/;
-
-/ {
-       fragment@0 {
-               target-path="";
-               __overlay__ {
-                       compatible = "pci1de4,1";
-                       #address-cells = <3>;
-                       #size-cells = <2>;
-                       interrupt-controller;
-                       #interrupt-cells = <2>;
-
-                       #include "arm64/broadcom/rp1-common.dtsi"
-               };
-       };
-};
index a342bcc6164bb64ba3a807a775a97ce0b8cf1d1e..d210da84c30a2a79a520be991657fe112197dca9 100644 (file)
 /* Interrupts */
 #define RP1_INT_END            61
 
-/* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.lib */
-extern char __dtbo_rp1_pci_begin[];
-extern char __dtbo_rp1_pci_end[];
-
 struct rp1_dev {
        struct pci_dev *pdev;
        struct irq_domain *domain;
        struct irq_data *pcie_irqds[64];
        void __iomem *bar1;
-       int ovcs_id;    /* overlay changeset id */
        bool level_triggered_irq[RP1_INT_END];
 };
 
@@ -184,24 +179,13 @@ static void rp1_unregister_interrupts(struct pci_dev *pdev)
 
 static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
-       u32 dtbo_size = __dtbo_rp1_pci_end - __dtbo_rp1_pci_begin;
-       void *dtbo_start = __dtbo_rp1_pci_begin;
        struct device *dev = &pdev->dev;
        struct device_node *rp1_node;
-       bool skip_ovl = true;
        struct rp1_dev *rp1;
        int err = 0;
        int i;
 
-       /*
-        * Either use rp1_nexus node if already present in DT, or
-        * set a flag to load it from overlay at runtime
-        */
-       rp1_node = of_find_node_by_name(NULL, "rp1_nexus");
-       if (!rp1_node) {
-               rp1_node = dev_of_node(dev);
-               skip_ovl = false;
-       }
+       rp1_node = dev_of_node(dev);
 
        if (!rp1_node) {
                dev_err(dev, "Missing of_node for device\n");
@@ -276,42 +260,29 @@ static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                                                 rp1_chained_handle_irq, rp1);
        }
 
-       if (!skip_ovl) {
-               err = of_overlay_fdt_apply(dtbo_start, dtbo_size, &rp1->ovcs_id,
-                                          rp1_node);
-               if (err)
-                       goto err_unregister_interrupts;
-       }
-
        err = of_platform_default_populate(rp1_node, NULL, dev);
        if (err) {
                dev_err_probe(&pdev->dev, err, "Error populating devicetree\n");
-               goto err_unload_overlay;
+               goto err_unregister_interrupts;
        }
 
-       if (skip_ovl)
-               of_node_put(rp1_node);
+       of_node_put(rp1_node);
 
        return 0;
 
-err_unload_overlay:
-       of_overlay_remove(&rp1->ovcs_id);
 err_unregister_interrupts:
        rp1_unregister_interrupts(pdev);
 err_put_node:
-       if (skip_ovl)
-               of_node_put(rp1_node);
+       of_node_put(rp1_node);
 
        return err;
 }
 
 static void rp1_remove(struct pci_dev *pdev)
 {
-       struct rp1_dev *rp1 = pci_get_drvdata(pdev);
        struct device *dev = &pdev->dev;
 
        of_platform_depopulate(dev);
-       of_overlay_remove(&rp1->ovcs_id);
        rp1_unregister_interrupts(pdev);
 }
 
index b9c252aa6fe08a864cebe245f5dd7bf41fcc5116..280cd50d693bd2ec8bcb400eeeb924ba8162593e 100644 (file)
@@ -6308,7 +6308,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node);
-DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_RPI, PCI_DEVICE_ID_RPI_RP1_C0, of_pci_make_dev_node);
 
 /*
  * Devices known to require a longer delay before first config space access