Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

misc: rp1: drop overlay support

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>

authored by

Andrea della Porta and committed by
Florian Fainelli
ce26f588 c6d0cdf7

+6 -66
+1 -5
drivers/misc/rp1/Kconfig
··· 5 5 6 6 config MISC_RP1 7 7 tristate "RaspberryPi RP1 misc device" 8 - depends on OF_IRQ && OF_OVERLAY && PCI_MSI && PCI_QUIRKS 9 - select PCI_DYNAMIC_OF_NODES 8 + depends on OF_IRQ && PCI_MSI 10 9 help 11 10 Support the RP1 peripheral chip found on Raspberry Pi 5 board. 12 11 ··· 14 15 15 16 The driver is responsible for enabling the DT node once the PCIe 16 17 endpoint has been configured, and handling interrupts. 17 - 18 - This driver uses an overlay to load other drivers to support for 19 - RP1 internal sub-devices.
+1 -2
drivers/misc/rp1/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - obj-$(CONFIG_MISC_RP1) += rp1-pci.o 3 - rp1-pci-objs := rp1_pci.o rp1-pci.dtbo.o 2 + obj-$(CONFIG_MISC_RP1) += rp1_pci.o
-25
drivers/misc/rp1/rp1-pci.dtso
··· 1 - // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 - 3 - /* 4 - * The dts overlay is included from the dts directory so 5 - * it can be possible to check it with CHECK_DTBS while 6 - * also compile it from the driver source directory. 7 - */ 8 - 9 - /dts-v1/; 10 - /plugin/; 11 - 12 - / { 13 - fragment@0 { 14 - target-path=""; 15 - __overlay__ { 16 - compatible = "pci1de4,1"; 17 - #address-cells = <3>; 18 - #size-cells = <2>; 19 - interrupt-controller; 20 - #interrupt-cells = <2>; 21 - 22 - #include "arm64/broadcom/rp1-common.dtsi" 23 - }; 24 - }; 25 - };
+4 -33
drivers/misc/rp1/rp1_pci.c
··· 34 34 /* Interrupts */ 35 35 #define RP1_INT_END 61 36 36 37 - /* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.lib */ 38 - extern char __dtbo_rp1_pci_begin[]; 39 - extern char __dtbo_rp1_pci_end[]; 40 - 41 37 struct rp1_dev { 42 38 struct pci_dev *pdev; 43 39 struct irq_domain *domain; 44 40 struct irq_data *pcie_irqds[64]; 45 41 void __iomem *bar1; 46 - int ovcs_id; /* overlay changeset id */ 47 42 bool level_triggered_irq[RP1_INT_END]; 48 43 }; 49 44 ··· 179 184 180 185 static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id) 181 186 { 182 - u32 dtbo_size = __dtbo_rp1_pci_end - __dtbo_rp1_pci_begin; 183 - void *dtbo_start = __dtbo_rp1_pci_begin; 184 187 struct device *dev = &pdev->dev; 185 188 struct device_node *rp1_node; 186 - bool skip_ovl = true; 187 189 struct rp1_dev *rp1; 188 190 int err = 0; 189 191 int i; 190 192 191 - /* 192 - * Either use rp1_nexus node if already present in DT, or 193 - * set a flag to load it from overlay at runtime 194 - */ 195 - rp1_node = of_find_node_by_name(NULL, "rp1_nexus"); 196 - if (!rp1_node) { 197 - rp1_node = dev_of_node(dev); 198 - skip_ovl = false; 199 - } 193 + rp1_node = dev_of_node(dev); 200 194 201 195 if (!rp1_node) { 202 196 dev_err(dev, "Missing of_node for device\n"); ··· 260 276 rp1_chained_handle_irq, rp1); 261 277 } 262 278 263 - if (!skip_ovl) { 264 - err = of_overlay_fdt_apply(dtbo_start, dtbo_size, &rp1->ovcs_id, 265 - rp1_node); 266 - if (err) 267 - goto err_unregister_interrupts; 268 - } 269 - 270 279 err = of_platform_default_populate(rp1_node, NULL, dev); 271 280 if (err) { 272 281 dev_err_probe(&pdev->dev, err, "Error populating devicetree\n"); 273 - goto err_unload_overlay; 282 + goto err_unregister_interrupts; 274 283 } 275 284 276 - if (skip_ovl) 277 - of_node_put(rp1_node); 285 + of_node_put(rp1_node); 278 286 279 287 return 0; 280 288 281 - err_unload_overlay: 282 - of_overlay_remove(&rp1->ovcs_id); 283 289 err_unregister_interrupts: 284 290 rp1_unregister_interrupts(pdev); 285 291 err_put_node: 286 - if (skip_ovl) 287 - of_node_put(rp1_node); 292 + of_node_put(rp1_node); 288 293 289 294 return err; 290 295 } 291 296 292 297 static void rp1_remove(struct pci_dev *pdev) 293 298 { 294 - struct rp1_dev *rp1 = pci_get_drvdata(pdev); 295 299 struct device *dev = &pdev->dev; 296 300 297 301 of_platform_depopulate(dev); 298 - of_overlay_remove(&rp1->ovcs_id); 299 302 rp1_unregister_interrupts(pdev); 300 303 } 301 304
-1
drivers/pci/quirks.c
··· 6308 6308 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node); 6309 6309 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node); 6310 6310 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_EFAR, 0x9660, of_pci_make_dev_node); 6311 - DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_RPI, PCI_DEVICE_ID_RPI_RP1_C0, of_pci_make_dev_node); 6312 6311 6313 6312 /* 6314 6313 * Devices known to require a longer delay before first config space access