Skip to content

Commit 902300d

Browse files
committed
Merge tag 'arm-soc/for-6.19/devicetree-arm64-fixes' of https://github.com/Broadcom/stblinux into arm/fixes
This pull request contains Broadcom ARM64-SoC Device Tree fixes for 6.19, please pull the following: - Andrea fixes the RP1 DeviceTree hierarchy and drop overlay support, this resolves a number of DTC warnings and other issues * tag 'arm-soc/for-6.19/devicetree-arm64-fixes' of https://github.com/Broadcom/stblinux: arm64: dts: broadcom: rp1: drop RP1 overlay arm64: dts: broadcom: bcm2712: fix RP1 endpoint PCI topology misc: rp1: drop overlay support dt-bindings: misc: pci1de4,1: add required reg property for endpoint Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents c4c6db7 + 9a96cc8 commit 902300d

11 files changed

Lines changed: 40 additions & 108 deletions

File tree

Documentation/devicetree/bindings/misc/pci1de4,1.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ properties:
2525
items:
2626
- const: pci1de4,1
2727

28+
reg:
29+
maxItems: 1
30+
description: The PCI Bus-Device-Function address.
31+
2832
'#interrupt-cells':
2933
const: 2
3034
description: |
@@ -101,6 +105,7 @@ unevaluatedProperties: false
101105

102106
required:
103107
- compatible
108+
- reg
104109
- '#interrupt-cells'
105110
- interrupt-controller
106111
- pci-ep-bus@1
@@ -111,8 +116,9 @@ examples:
111116
#address-cells = <3>;
112117
#size-cells = <2>;
113118
114-
rp1@0,0 {
119+
dev@0,0 {
115120
compatible = "pci1de4,1";
121+
reg = <0x10000 0x0 0x0 0x0 0x0>;
116122
ranges = <0x01 0x00 0x00000000 0x82010000 0x00 0x00 0x00 0x400000>;
117123
#address-cells = <3>;
118124
#size-cells = <2>;

arch/arm64/boot/dts/broadcom/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
77
bcm2711-rpi-4-b.dtb \
88
bcm2711-rpi-cm4-io.dtb \
99
bcm2712-rpi-5-b.dtb \
10-
bcm2712-rpi-5-b-ovl-rp1.dtb \
1110
bcm2712-d-rpi-5-b.dtb \
1211
bcm2837-rpi-2-b.dtb \
1312
bcm2837-rpi-3-a-plus.dtb \
1413
bcm2837-rpi-3-b.dtb \
1514
bcm2837-rpi-3-b-plus.dtb \
1615
bcm2837-rpi-cm3-io3.dtb \
17-
bcm2837-rpi-zero-2-w.dtb \
18-
rp1.dtbo
16+
bcm2837-rpi-zero-2-w.dtb
1917

2018
subdir-y += bcmbca
2119
subdir-y += northstar2

arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-ovl-rp1.dts renamed to arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi

File renamed without changes.

arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
22
/*
3-
* bcm2712-rpi-5-b-ovl-rp1.dts is the overlay-ready DT which will make
4-
* the RP1 driver to load the RP1 dtb overlay at runtime, while
5-
* bcm2712-rpi-5-b.dts (this file) is the fully defined one (i.e. it
6-
* already contains RP1 node, so no overlay is loaded nor needed).
7-
* This file is intended to host the override nodes for the RP1 peripherals,
8-
* e.g. to declare the phy of the ethernet interface or the custom pin setup
9-
* for several RP1 peripherals.
10-
* This in turn is due to the fact that there's no current generic
11-
* infrastructure to reference nodes (i.e. the nodes in rp1-common.dtsi) that
12-
* are not yet defined in the DT since they are loaded at runtime via overlay.
3+
* As a loose attempt to separate RP1 customizations from SoC peripherals
4+
* definitioni, this file is intended to host the override nodes for the RP1
5+
* peripherals, e.g. to declare the phy of the ethernet interface or custom
6+
* pin setup.
137
* All other nodes that do not have anything to do with RP1 should be added
14-
* to the included bcm2712-rpi-5-b-ovl-rp1.dts instead.
8+
* to the included bcm2712-rpi-5-b-base.dtsi instead.
159
*/
1610

1711
/dts-v1/;
1812

19-
#include "bcm2712-rpi-5-b-ovl-rp1.dts"
13+
#include "bcm2712-rpi-5-b-base.dtsi"
2014

2115
/ {
2216
aliases {
@@ -25,7 +19,26 @@
2519
};
2620

2721
&pcie2 {
28-
#include "rp1-nexus.dtsi"
22+
pci@0,0 {
23+
reg = <0x0 0x0 0x0 0x0 0x0>;
24+
ranges;
25+
bus-range = <0 1>;
26+
device_type = "pci";
27+
#address-cells = <3>;
28+
#size-cells = <2>;
29+
30+
dev@0,0 {
31+
compatible = "pci1de4,1";
32+
reg = <0x10000 0x0 0x0 0x0 0x0>;
33+
ranges = <0x1 0x0 0x0 0x82010000 0x0 0x0 0x0 0x400000>;
34+
interrupt-controller;
35+
#interrupt-cells = <2>;
36+
#address-cells = <3>;
37+
#size-cells = <2>;
38+
39+
#include "rp1-common.dtsi"
40+
};
41+
};
2942
};
3043

3144
&rp1_eth {

arch/arm64/boot/dts/broadcom/rp1-nexus.dtsi

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

arch/arm64/boot/dts/broadcom/rp1.dtso

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

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

0 commit comments

Comments
 (0)