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>

+40 -108
+7 -1
Documentation/devicetree/bindings/misc/pci1de4,1.yaml
··· 25 25 items: 26 26 - const: pci1de4,1 27 27 28 + reg: 29 + maxItems: 1 30 + description: The PCI Bus-Device-Function address. 31 + 28 32 '#interrupt-cells': 29 33 const: 2 30 34 description: | ··· 105 101 106 102 required: 107 103 - compatible 104 + - reg 108 105 - '#interrupt-cells' 109 106 - interrupt-controller 110 107 - pci-ep-bus@1 ··· 116 111 #address-cells = <3>; 117 112 #size-cells = <2>; 118 113 119 - rp1@0,0 { 114 + dev@0,0 { 120 115 compatible = "pci1de4,1"; 116 + reg = <0x10000 0x0 0x0 0x0 0x0>; 121 117 ranges = <0x01 0x00 0x00000000 0x82010000 0x00 0x00 0x00 0x400000>; 122 118 #address-cells = <3>; 123 119 #size-cells = <2>;
+1 -3
arch/arm64/boot/dts/broadcom/Makefile
··· 7 7 bcm2711-rpi-4-b.dtb \ 8 8 bcm2711-rpi-cm4-io.dtb \ 9 9 bcm2712-rpi-5-b.dtb \ 10 - bcm2712-rpi-5-b-ovl-rp1.dtb \ 11 10 bcm2712-d-rpi-5-b.dtb \ 12 11 bcm2837-rpi-2-b.dtb \ 13 12 bcm2837-rpi-3-a-plus.dtb \ 14 13 bcm2837-rpi-3-b.dtb \ 15 14 bcm2837-rpi-3-b-plus.dtb \ 16 15 bcm2837-rpi-cm3-io3.dtb \ 17 - bcm2837-rpi-zero-2-w.dtb \ 18 - rp1.dtbo 16 + bcm2837-rpi-zero-2-w.dtb 19 17 20 18 subdir-y += bcmbca 21 19 subdir-y += northstar2
arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-ovl-rp1.dts arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b-base.dtsi
+26 -13
arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts
··· 1 1 // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 2 /* 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. 13 7 * 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. 15 9 */ 16 10 17 11 /dts-v1/; 18 12 19 - #include "bcm2712-rpi-5-b-ovl-rp1.dts" 13 + #include "bcm2712-rpi-5-b-base.dtsi" 20 14 21 15 / { 22 16 aliases { ··· 19 25 }; 20 26 21 27 &pcie2 { 22 - #include "rp1-nexus.dtsi" 28 + pci@0,0 { 29 + reg = <0x0 0x0 0x0 0x0 0x0>; 30 + ranges; 31 + bus-range = <0 1>; 32 + device_type = "pci"; 33 + #address-cells = <3>; 34 + #size-cells = <2>; 35 + 36 + dev@0,0 { 37 + compatible = "pci1de4,1"; 38 + reg = <0x10000 0x0 0x0 0x0 0x0>; 39 + ranges = <0x1 0x0 0x0 0x82010000 0x0 0x0 0x0 0x400000>; 40 + interrupt-controller; 41 + #interrupt-cells = <2>; 42 + #address-cells = <3>; 43 + #size-cells = <2>; 44 + 45 + #include "rp1-common.dtsi" 46 + }; 47 + }; 23 48 }; 24 49 25 50 &rp1_eth {
-14
arch/arm64/boot/dts/broadcom/rp1-nexus.dtsi
··· 1 - // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 - 3 - rp1_nexus { 4 - compatible = "pci1de4,1"; 5 - #address-cells = <3>; 6 - #size-cells = <2>; 7 - ranges = <0x01 0x00 0x00000000 8 - 0x02000000 0x00 0x00000000 9 - 0x0 0x400000>; 10 - interrupt-controller; 11 - #interrupt-cells = <2>; 12 - 13 - #include "rp1-common.dtsi" 14 - };
-11
arch/arm64/boot/dts/broadcom/rp1.dtso
··· 1 - // SPDX-License-Identifier: (GPL-2.0 OR MIT) 2 - 3 - /dts-v1/; 4 - /plugin/; 5 - 6 - &pcie2 { 7 - #address-cells = <3>; 8 - #size-cells = <2>; 9 - 10 - #include "rp1-nexus.dtsi" 11 - };
+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