Skip to content

Commit ce26f58

Browse files
Andrea della Portaffainelli
authored andcommitted
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>
1 parent c6d0cdf commit ce26f58

5 files changed

Lines changed: 6 additions & 66 deletions

File tree

drivers/misc/rp1/Kconfig

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55

66
config MISC_RP1
77
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
109
help
1110
Support the RP1 peripheral chip found on Raspberry Pi 5 board.
1211

@@ -15,6 +14,3 @@ config MISC_RP1
1514

1615
The driver is responsible for enabling the DT node once the PCIe
1716
endpoint has been configured, and handling interrupts.
18-
19-
This driver uses an overlay to load other drivers to support for
20-
RP1 internal sub-devices.

drivers/misc/rp1/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
# 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

drivers/misc/rp1/rp1-pci.dtso

Lines changed: 0 additions & 25 deletions
This file was deleted.

drivers/misc/rp1/rp1_pci.c

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,11 @@
3434
/* Interrupts */
3535
#define RP1_INT_END 61
3636

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-
4137
struct rp1_dev {
4238
struct pci_dev *pdev;
4339
struct irq_domain *domain;
4440
struct irq_data *pcie_irqds[64];
4541
void __iomem *bar1;
46-
int ovcs_id; /* overlay changeset id */
4742
bool level_triggered_irq[RP1_INT_END];
4843
};
4944

@@ -184,24 +179,13 @@ static void rp1_unregister_interrupts(struct pci_dev *pdev)
184179

185180
static int rp1_probe(struct pci_dev *pdev, const struct pci_device_id *id)
186181
{
187-
u32 dtbo_size = __dtbo_rp1_pci_end - __dtbo_rp1_pci_begin;
188-
void *dtbo_start = __dtbo_rp1_pci_begin;
189182
struct device *dev = &pdev->dev;
190183
struct device_node *rp1_node;
191-
bool skip_ovl = true;
192184
struct rp1_dev *rp1;
193185
int err = 0;
194186
int i;
195187

196-
/*
197-
* Either use rp1_nexus node if already present in DT, or
198-
* set a flag to load it from overlay at runtime
199-
*/
200-
rp1_node = of_find_node_by_name(NULL, "rp1_nexus");
201-
if (!rp1_node) {
202-
rp1_node = dev_of_node(dev);
203-
skip_ovl = false;
204-
}
188+
rp1_node = dev_of_node(dev);
205189

206190
if (!rp1_node) {
207191
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)
276260
rp1_chained_handle_irq, rp1);
277261
}
278262

279-
if (!skip_ovl) {
280-
err = of_overlay_fdt_apply(dtbo_start, dtbo_size, &rp1->ovcs_id,
281-
rp1_node);
282-
if (err)
283-
goto err_unregister_interrupts;
284-
}
285-
286263
err = of_platform_default_populate(rp1_node, NULL, dev);
287264
if (err) {
288265
dev_err_probe(&pdev->dev, err, "Error populating devicetree\n");
289-
goto err_unload_overlay;
266+
goto err_unregister_interrupts;
290267
}
291268

292-
if (skip_ovl)
293-
of_node_put(rp1_node);
269+
of_node_put(rp1_node);
294270

295271
return 0;
296272

297-
err_unload_overlay:
298-
of_overlay_remove(&rp1->ovcs_id);
299273
err_unregister_interrupts:
300274
rp1_unregister_interrupts(pdev);
301275
err_put_node:
302-
if (skip_ovl)
303-
of_node_put(rp1_node);
276+
of_node_put(rp1_node);
304277

305278
return err;
306279
}
307280

308281
static void rp1_remove(struct pci_dev *pdev)
309282
{
310-
struct rp1_dev *rp1 = pci_get_drvdata(pdev);
311283
struct device *dev = &pdev->dev;
312284

313285
of_platform_depopulate(dev);
314-
of_overlay_remove(&rp1->ovcs_id);
315286
rp1_unregister_interrupts(pdev);
316287
}
317288

drivers/pci/quirks.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6308,7 +6308,6 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5020, of_pci_make_dev_node);
63086308
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_XILINX, 0x5021, of_pci_make_dev_node);
63096309
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_REDHAT, 0x0005, of_pci_make_dev_node);
63106310
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);
63126311

63136312
/*
63146313
* Devices known to require a longer delay before first config space access

0 commit comments

Comments
 (0)