From f96d0ccb038eaf068174b021fa0f2eee6d352e4e Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.com>
Date: Fri, 1 Nov 2024 09:13:53 +0000
Subject: [PATCH] dts: bcm2712-rpi: Add the RP1 PIO device

Declare the device that proxies RP1's PIO hardware.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
---
 arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi |  5 +++++
 arch/arm64/boot/dts/broadcom/rp1.dtsi         | 12 ++++++++++++
 2 files changed, 17 insertions(+)

--- a/arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi
+++ b/arch/arm64/boot/dts/broadcom/bcm2712-rpi.dtsi
@@ -97,6 +97,10 @@
 	};
 };
 
+pio: &rp1_pio {
+	status = "okay";
+};
+
 / {
 	chosen: chosen {
 		bootargs = "reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave";
@@ -129,6 +133,7 @@
 		i2c12 = &i2c10;
 		mailbox = &mailbox;
 		mmc0 = &sdio1;
+		pio0 = &pio;
 		serial0 = &uart0;
 		serial1 = &uart1;
 		serial10 = &uart10;
--- a/arch/arm64/boot/dts/broadcom/rp1.dtsi
+++ b/arch/arm64/boot/dts/broadcom/rp1.dtsi
@@ -1028,6 +1028,18 @@
 			status = "disabled";
 		};
 
+		rp1_pio: pio@178000 {
+			reg = <0xc0 0x40178000  0x0 0x20>;
+			compatible = "raspberrypi,rp1-pio";
+			firmware = <&rp1_firmware>;
+			dmas = <&rp1_dma RP1_DMA_PIO_CH0_TX>, <&rp1_dma RP1_DMA_PIO_CH0_RX>,
+				   <&rp1_dma RP1_DMA_PIO_CH1_TX>, <&rp1_dma RP1_DMA_PIO_CH1_RX>,
+				   <&rp1_dma RP1_DMA_PIO_CH2_TX>, <&rp1_dma RP1_DMA_PIO_CH2_RX>,
+				   <&rp1_dma RP1_DMA_PIO_CH3_TX>, <&rp1_dma RP1_DMA_PIO_CH3_RX>;
+			dma-names = "tx0", "rx0", "tx1", "rx1", "tx2", "rx2", "tx3", "rx3";
+			status = "disabled";
+		};
+
 		rp1_mmc0: mmc@180000 {
 			reg = <0xc0 0x40180000  0x0 0x100>;
 			compatible = "raspberrypi,rp1-dwcmshc";
