Add a devicetree to support the official Raspberry Pi 7inch touchscreen.
This also demuxes the i2c0 controller to support both pinctrls.
Detlev Casanova (2):
ARM: dts: bcm2*: Demux i2c0 with a pinctrl
ARM: dts: Add bcm2711-rpi-4-b-7inch-ts-dsi.dts
arch/arm/boot/dts/Makefile | 1 +
.../boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 129 ++++++++++++++++++
arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 1 +
arch/arm/boot/dts/bcm2711.dtsi | 2 +-
arch/arm/boot/dts/bcm2835-rpi.dtsi | 9 +-
.../boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi | 4 +
arch/arm/boot/dts/bcm283x.dtsi | 26 +++-
arch/arm64/boot/dts/broadcom/Makefile | 1 +
.../broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 2 +
9 files changed, 170 insertions(+), 5 deletions(-)
create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
create mode 100644 arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi
create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
--
2.35.1
Add a device tree to support the official Raspberrypi 7" touchscreen for
the Raspberry Pi 4 B
The panel is connected on the DSI 1 port and uses the simple-panel
driver.
The device tree also makes sure to activate:
* dvp: bcm2711 clock driver
* hvs: Hardware Video Scaler
* pixelvalve[0-4]: CRTC modules
* txp: CRTC Writeback
Signed-off-by: Detlev Casanova <[email protected]>
---
arch/arm/boot/dts/Makefile | 1 +
.../boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 129 ++++++++++++++++++
arch/arm64/boot/dts/broadcom/Makefile | 1 +
.../broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 2 +
4 files changed, 133 insertions(+)
create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 0de64f237cd8..b46daf2df4ce 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -94,6 +94,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
bcm2837-rpi-cm3-io3.dtb \
bcm2711-rpi-400.dtb \
bcm2711-rpi-4-b.dtb \
+ bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
bcm2711-rpi-cm4-io.dtb \
bcm2835-rpi-zero.dtb \
bcm2835-rpi-zero-w.dtb
diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
new file mode 100644
index 000000000000..62e986358c2a
--- /dev/null
+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
@@ -0,0 +1,129 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include "bcm2711-rpi-4-b.dts"
+
+/ {
+ model = "Raspberry Pi 4 Model B + Rpi 7inch touchscreen";
+
+ panel_disp1: panel_disp1@0 {
+ reg = <0 0 0>;
+ compatible = "raspberrypi,7inch-dsi", "simple-panel";
+ backlight = <®_display>;
+ power-supply = <®_display>;
+ status = "okay";
+
+ port {
+ panel_in: endpoint {
+ remote-endpoint = <&bridge_out>;
+ };
+ };
+ };
+
+ reg_bridge: reg_bridge@0 {
+ reg = <0 0 0>;
+ compatible = "regulator-fixed";
+ regulator-name = "bridge_reg";
+ gpio = <®_display 0 0>;
+ vin-supply = <®_display>;
+ enable-active-high;
+ status = "okay";
+ };
+};
+
+&i2c_csi_dsi {
+ ft5406: ts@38 {
+ compatible = "edt,edt-ft5506";
+ reg = <0x38>;
+ status = "okay";
+
+ vcc-supply = <®_display>;
+ reset-gpio = <®_display 1 1>;
+
+ touchscreen-size-x = < 800 >;
+ touchscreen-size-y = < 480 >;
+
+ touchscreen-inverted-x;
+ touchscreen-inverted-y;
+ };
+
+ reg_display: reg_display@45 {
+ compatible = "raspberrypi,7inch-touchscreen-panel-regulator";
+ reg = <0x45>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ status = "okay";
+ };
+
+};
+
+&dsi1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ port {
+ dsi_out: endpoint {
+ remote-endpoint = <&bridge_in>;
+ };
+ };
+
+ bridge@0 {
+ reg = <0>;
+ compatible = "toshiba,tc358762";
+ vddc-supply = <®_bridge>;
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@0 {
+ reg = <0>;
+ bridge_in: endpoint {
+ remote-endpoint = <&dsi_out>;
+ };
+ };
+
+ port@1 {
+ reg = <1>;
+ bridge_out: endpoint {
+ remote-endpoint = <&panel_in>;
+ };
+ };
+ };
+ };
+};
+
+&aon_intr {
+ status = "okay";
+};
+
+&dvp {
+ status = "okay";
+};
+
+&hvs {
+ status = "okay";
+};
+
+&pixelvalve0 {
+ status = "okay";
+};
+
+&pixelvalve1 {
+ status = "okay";
+};
+
+&pixelvalve2 {
+ status = "okay";
+};
+
+&pixelvalve3 {
+ status = "okay";
+};
+
+&pixelvalve4 {
+ status = "okay";
+};
+
+&txp {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile
index c6882032a428..965361bff829 100644
--- a/arch/arm64/boot/dts/broadcom/Makefile
+++ b/arch/arm64/boot/dts/broadcom/Makefile
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
bcm2711-rpi-4-b.dtb \
+ bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
bcm2711-rpi-cm4-io.dtb \
bcm2837-rpi-3-a-plus.dtb \
bcm2837-rpi-3-b.dtb \
diff --git a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
new file mode 100644
index 000000000000..c325adc4f874
--- /dev/null
+++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
@@ -0,0 +1,2 @@
+// SPDX-License-Identifier: GPL-2.0
+#include "arm/bcm2711-rpi-4-b-7inch-ts-dsi.dts"
--
2.35.1
Hi Detlev,
Am 09.02.22 um 17:25 schrieb Detlev Casanova:
> Add a device tree to support the official Raspberrypi 7" touchscreen for
> the Raspberry Pi 4 B
>
> The panel is connected on the DSI 1 port and uses the simple-panel
> driver.
>
> The device tree also makes sure to activate:
> * dvp: bcm2711 clock driver
> * hvs: Hardware Video Scaler
> * pixelvalve[0-4]: CRTC modules
> * txp: CRTC Writeback
>
> Signed-off-by: Detlev Casanova <[email protected]>
> ---
> arch/arm/boot/dts/Makefile | 1 +
> .../boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 129 ++++++++++++++++++
> arch/arm64/boot/dts/broadcom/Makefile | 1 +
> .../broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 2 +
> 4 files changed, 133 insertions(+)
> create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> create mode 100644 arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
>
> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> index 0de64f237cd8..b46daf2df4ce 100644
> --- a/arch/arm/boot/dts/Makefile
> +++ b/arch/arm/boot/dts/Makefile
> @@ -94,6 +94,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
> bcm2837-rpi-cm3-io3.dtb \
> bcm2711-rpi-400.dtb \
> bcm2711-rpi-4-b.dtb \
> + bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
> bcm2711-rpi-cm4-io.dtb \
> bcm2835-rpi-zero.dtb \
> bcm2835-rpi-zero-w.dtb
> diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> new file mode 100644
> index 000000000000..62e986358c2a
> --- /dev/null
> +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
i think this should be an overlay because this board can be connected to
different boards and we want to avoid copy & paste. Unfortunately i
don't know where this should be stored in the kernel tree.
> @@ -0,0 +1,129 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +#include "bcm2711-rpi-4-b.dts"
> +
> +/ {
> + model = "Raspberry Pi 4 Model B + Rpi 7inch touchscreen";
> +
> + panel_disp1: panel_disp1@0 {
> + reg = <0 0 0>;
> + compatible = "raspberrypi,7inch-dsi", "simple-panel";
> + backlight = <®_display>;
> + power-supply = <®_display>;
> + status = "okay";
> +
> + port {
> + panel_in: endpoint {
> + remote-endpoint = <&bridge_out>;
> + };
> + };
> + };
> +
> + reg_bridge: reg_bridge@0 {
> + reg = <0 0 0>;
> + compatible = "regulator-fixed";
> + regulator-name = "bridge_reg";
> + gpio = <®_display 0 0>;
> + vin-supply = <®_display>;
> + enable-active-high;
> + status = "okay";
> + };
> +};
> +
> +&i2c_csi_dsi {
> + ft5406: ts@38 {
s/ts/touchscreen/
> + compatible = "edt,edt-ft5506";
> + reg = <0x38>;
> + status = "okay";
> +
> + vcc-supply = <®_display>;
> + reset-gpio = <®_display 1 1>;
> +
> + touchscreen-size-x = < 800 >;
> + touchscreen-size-y = < 480 >;
> +
> + touchscreen-inverted-x;
> + touchscreen-inverted-y;
> + };
> +
> + reg_display: reg_display@45 {
node name should be regulator
> + compatible = "raspberrypi,7inch-touchscreen-panel-regulator";
> + reg = <0x45>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + status = "okay";
> + };
> +
> +};
> +
> +&dsi1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + status = "okay";
> +
> + port {
> + dsi_out: endpoint {
> + remote-endpoint = <&bridge_in>;
> + };
> + };
> +
> + bridge@0 {
> + reg = <0>;
> + compatible = "toshiba,tc358762";
> + vddc-supply = <®_bridge>;
> + ports {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + port@0 {
> + reg = <0>;
> + bridge_in: endpoint {
> + remote-endpoint = <&dsi_out>;
> + };
> + };
> +
> + port@1 {
> + reg = <1>;
> + bridge_out: endpoint {
> + remote-endpoint = <&panel_in>;
> + };
> + };
> + };
> + };
> +};
> +
> +&aon_intr {
> + status = "okay";
> +};
> +
> +&dvp {
> + status = "okay";
> +};
> +
> +&hvs {
> + status = "okay";
> +};
From my understanding these three are not necessary
> +
> +&pixelvalve0 {
> + status = "okay";
> +};
> +
> +&pixelvalve1 {
> + status = "okay";
> +};
> +
> +&pixelvalve2 {
> + status = "okay";
> +};
> +
> +&pixelvalve3 {
> + status = "okay";
> +};
> +
> +&pixelvalve4 {
> + status = "okay";
> +};
> +
> +&txp {
> + status = "okay";
> +};
Also txp doesn't need to be enabled explicit.
Best regards
> diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile
> index c6882032a428..965361bff829 100644
> --- a/arch/arm64/boot/dts/broadcom/Makefile
> +++ b/arch/arm64/boot/dts/broadcom/Makefile
> @@ -1,6 +1,7 @@
> # SPDX-License-Identifier: GPL-2.0
> dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
> bcm2711-rpi-4-b.dtb \
> + bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
> bcm2711-rpi-cm4-io.dtb \
> bcm2837-rpi-3-a-plus.dtb \
> bcm2837-rpi-3-b.dtb \
> diff --git a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> new file mode 100644
> index 000000000000..c325adc4f874
> --- /dev/null
> +++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> @@ -0,0 +1,2 @@
> +// SPDX-License-Identifier: GPL-2.0
> +#include "arm/bcm2711-rpi-4-b-7inch-ts-dsi.dts"
The i2c0 device has 2 different busses controlled by a pinctrl.
This commit separates the device node into 2 i2c devices:
* pin 0: Base i2c bus
* pin 44: DSI i2c bus
i2c0 is renamed to i2c0if so that device-trees referencing i2c0 don't
break and use the i2c0 node defined in i2c0mux node.
i2c_csi_dsi can be used to control devices via the DSI i2c bus, used for
DSI displays.
Signed-off-by: Detlev Casanova <[email protected]>
---
arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 1 +
arch/arm/boot/dts/bcm2711.dtsi | 2 +-
arch/arm/boot/dts/bcm2835-rpi.dtsi | 9 ++++---
.../boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi | 4 +++
arch/arm/boot/dts/bcm283x.dtsi | 26 ++++++++++++++++++-
5 files changed, 37 insertions(+), 5 deletions(-)
create mode 100644 arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi
diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
index 4432412044de..5dcce58817e6 100644
--- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
@@ -4,6 +4,7 @@
#include "bcm2711-rpi.dtsi"
#include "bcm283x-rpi-usb-peripheral.dtsi"
#include "bcm283x-rpi-wifi-bt.dtsi"
+#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
/ {
compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index 3b60297af7f6..bf6e8251c2c7 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -1037,7 +1037,7 @@ &cma {
alloc-ranges = <0x0 0x00000000 0x40000000>;
};
-&i2c0 {
+&i2c0if {
compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
};
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index 87ddcad76083..1e38f9f0e80e 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -49,13 +49,16 @@ alt0: alt0 {
};
};
-&i2c0 {
- pinctrl-names = "default";
- pinctrl-0 = <&i2c0_gpio0>;
+&i2c0if {
status = "okay";
clock-frequency = <100000>;
};
+&i2c0mux {
+ pinctrl-0 = <&i2c0_gpio0>;
+ status = "okay";
+};
+
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1_gpio2>;
diff --git a/arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi b/arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi
new file mode 100644
index 000000000000..119946d878db
--- /dev/null
+++ b/arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi
@@ -0,0 +1,4 @@
+&i2c0mux {
+ pinctrl-0 = <&i2c0_gpio0>;
+ pinctrl-1 = <&i2c0_gpio44>;
+};
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index a3e06b680947..06d04cde52b9 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -334,7 +334,7 @@ spi: spi@7e204000 {
status = "disabled";
};
- i2c0: i2c@7e205000 {
+ i2c0if: i2c@7e205000 {
compatible = "brcm,bcm2835-i2c";
reg = <0x7e205000 0x200>;
interrupts = <2 21>;
@@ -344,6 +344,30 @@ i2c0: i2c@7e205000 {
status = "disabled";
};
+ i2c0mux: i2c0mux {
+ compatible = "i2c-mux-pinctrl";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c-parent = <&i2c0if>;
+
+ pinctrl-names = "i2c0", "i2c_csi_dsi";
+
+ status = "disabled";
+
+ i2c0: i2c@0 {
+ reg = <0>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ i2c_csi_dsi: i2c@1 {
+ reg = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
dpi: dpi@7e208000 {
compatible = "brcm,bcm2835-dpi";
reg = <0x7e208000 0x8c>;
--
2.35.1
Hi Stefan,
On Wednesday, February 9, 2022 12:10:12 P.M. EST Stefan Wahren wrote:
> Hi Detlev,
>
> Am 09.02.22 um 17:25 schrieb Detlev Casanova:
> > Add a device tree to support the official Raspberrypi 7" touchscreen for
> > the Raspberry Pi 4 B
> >
> > The panel is connected on the DSI 1 port and uses the simple-panel
> > driver.
> >
> > The device tree also makes sure to activate:
> > * dvp: bcm2711 clock driver
> > * hvs: Hardware Video Scaler
> > * pixelvalve[0-4]: CRTC modules
> > * txp: CRTC Writeback
> >
> > Signed-off-by: Detlev Casanova <[email protected]>
> > ---
> >
> > arch/arm/boot/dts/Makefile | 1 +
> > .../boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 129 ++++++++++++++++++
> > arch/arm64/boot/dts/broadcom/Makefile | 1 +
> > .../broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 2 +
> > 4 files changed, 133 insertions(+)
> > create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> > create mode 100644
> > arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts>
> > diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
> > index 0de64f237cd8..b46daf2df4ce 100644
> > --- a/arch/arm/boot/dts/Makefile
> > +++ b/arch/arm/boot/dts/Makefile
> > @@ -94,6 +94,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
> >
> > bcm2837-rpi-cm3-io3.dtb \
> > bcm2711-rpi-400.dtb \
> > bcm2711-rpi-4-b.dtb \
> >
> > + bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
> >
> > bcm2711-rpi-cm4-io.dtb \
> > bcm2835-rpi-zero.dtb \
> > bcm2835-rpi-zero-w.dtb
> >
> > diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> > b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts new file mode 100644
> > index 000000000000..62e986358c2a
> > --- /dev/null
> > +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
>
> i think this should be an overlay because this board can be connected to
> different boards and we want to avoid copy & paste. Unfortunately i
> don't know where this should be stored in the kernel tree.
Yes, that is how it started but the upstream kernel doesn't use them. We
thought that a separate device-tree makes sense as it is the official raspberry
pi touchscreen. Do you know if there are plans for supporting device tree
overlays in the upstream kernel ?
> > @@ -0,0 +1,129 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +
> > +#include "bcm2711-rpi-4-b.dts"
> > +
> > +/ {
> > + model = "Raspberry Pi 4 Model B + Rpi 7inch touchscreen";
> > +
> > + panel_disp1: panel_disp1@0 {
> > + reg = <0 0 0>;
> > + compatible = "raspberrypi,7inch-dsi", "simple-panel";
> > + backlight = <®_display>;
> > + power-supply = <®_display>;
> > + status = "okay";
> > +
> > + port {
> > + panel_in: endpoint {
> > + remote-endpoint = <&bridge_out>;
> > + };
> > + };
> > + };
> > +
> > + reg_bridge: reg_bridge@0 {
> > + reg = <0 0 0>;
> > + compatible = "regulator-fixed";
> > + regulator-name = "bridge_reg";
> > + gpio = <®_display 0 0>;
> > + vin-supply = <®_display>;
> > + enable-active-high;
> > + status = "okay";
> > + };
> > +};
> > +
> > +&i2c_csi_dsi {
> > + ft5406: ts@38 {
>
> s/ts/touchscreen/
>
> > + compatible = "edt,edt-ft5506";
> > + reg = <0x38>;
> > + status = "okay";
> > +
> > + vcc-supply = <®_display>;
> > + reset-gpio = <®_display 1 1>;
> > +
> > + touchscreen-size-x = < 800 >;
> > + touchscreen-size-y = < 480 >;
> > +
> > + touchscreen-inverted-x;
> > + touchscreen-inverted-y;
> > + };
> > +
> > + reg_display: reg_display@45 {
>
> node name should be regulator
Will change it to `reg_display: regulator@45`.
> > + compatible = "raspberrypi,7inch-touchscreen-panel-
regulator";
> > + reg = <0x45>;
> > + gpio-controller;
> > + #gpio-cells = <2>;
> > + status = "okay";
> > + };
> > +
> > +};
> > +
> > +&dsi1 {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > + status = "okay";
> > +
> > + port {
> > + dsi_out: endpoint {
> > + remote-endpoint = <&bridge_in>;
> > + };
> > + };
> > +
> > + bridge@0 {
> > + reg = <0>;
> > + compatible = "toshiba,tc358762";
> > + vddc-supply = <®_bridge>;
> > + ports {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + port@0 {
> > + reg = <0>;
> > + bridge_in: endpoint {
> > + remote-endpoint =
<&dsi_out>;
> > + };
> > + };
> > +
> > + port@1 {
> > + reg = <1>;
> > + bridge_out: endpoint {
> > + remote-endpoint =
<&panel_in>;
> > + };
> > + };
> > + };
> > + };
> > +};
> > +
> > +&aon_intr {
> > + status = "okay";
> > +};
> > +
> > +&dvp {
> > + status = "okay";
> > +};
> > +
> > +&hvs {
> > + status = "okay";
> > +};
>
> From my understanding these three are not necessary
Indeed, they are already enabled.
> > +
> > +&pixelvalve0 {
> > + status = "okay";
> > +};
> > +
> > +&pixelvalve1 {
> > + status = "okay";
> > +};
> > +
> > +&pixelvalve2 {
> > + status = "okay";
> > +};
> > +
> > +&pixelvalve3 {
> > + status = "okay";
> > +};
> > +
> > +&pixelvalve4 {
> > + status = "okay";
> > +};
> > +
> > +&txp {
> > + status = "okay";
> > +};
>
> Also txp doesn't need to be enabled explicit.
Yes, already active. This was more to make sure they were enabled when porting
to other devices, but that probably doesn't make much sense for them to be
disabled.
> > diff --git a/arch/arm64/boot/dts/broadcom/Makefile
> > b/arch/arm64/boot/dts/broadcom/Makefile index c6882032a428..965361bff829
> > 100644
> > --- a/arch/arm64/boot/dts/broadcom/Makefile
> > +++ b/arch/arm64/boot/dts/broadcom/Makefile
> > @@ -1,6 +1,7 @@
> >
> > # SPDX-License-Identifier: GPL-2.0
> > dtb-$(CONFIG_ARCH_BCM2835) += bcm2711-rpi-400.dtb \
> >
> > bcm2711-rpi-4-b.dtb \
> >
> > + bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
> >
> > bcm2711-rpi-cm4-io.dtb \
> > bcm2837-rpi-3-a-plus.dtb \
> > bcm2837-rpi-3-b.dtb \
> >
> > diff --git a/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> > b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts new file
> > mode 100644
> > index 000000000000..c325adc4f874
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts
> > @@ -0,0 +1,2 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +#include "arm/bcm2711-rpi-4-b-7inch-ts-dsi.dts"
Thanks for the fast review,
Detlev.
Hi Detlev,
Am 09.02.22 um 20:44 schrieb Detlev Casanova:
> Hi Stefan,
>
> On Wednesday, February 9, 2022 12:10:12 P.M. EST Stefan Wahren wrote:
>> Hi Detlev,
>>
>> Am 09.02.22 um 17:25 schrieb Detlev Casanova:
>>> Add a device tree to support the official Raspberrypi 7" touchscreen for
>>> the Raspberry Pi 4 B
>>>
>>> The panel is connected on the DSI 1 port and uses the simple-panel
>>> driver.
>>>
>>> The device tree also makes sure to activate:
>>> * dvp: bcm2711 clock driver
>>> * hvs: Hardware Video Scaler
>>> * pixelvalve[0-4]: CRTC modules
>>> * txp: CRTC Writeback
>>>
>>> Signed-off-by: Detlev Casanova <[email protected]>
>>> ---
>>>
>>> arch/arm/boot/dts/Makefile | 1 +
>>> .../boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 129 ++++++++++++++++++
>>> arch/arm64/boot/dts/broadcom/Makefile | 1 +
>>> .../broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts | 2 +
>>> 4 files changed, 133 insertions(+)
>>> create mode 100644 arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
>>> create mode 100644
>>> arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b-7inch-ts-dsi.dts>
>>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>>> index 0de64f237cd8..b46daf2df4ce 100644
>>> --- a/arch/arm/boot/dts/Makefile
>>> +++ b/arch/arm/boot/dts/Makefile
>>> @@ -94,6 +94,7 @@ dtb-$(CONFIG_ARCH_BCM2835) += \
>>>
>>> bcm2837-rpi-cm3-io3.dtb \
>>> bcm2711-rpi-400.dtb \
>>> bcm2711-rpi-4-b.dtb \
>>>
>>> + bcm2711-rpi-4-b-7inch-ts-dsi.dtb \
>>>
>>> bcm2711-rpi-cm4-io.dtb \
>>> bcm2835-rpi-zero.dtb \
>>> bcm2835-rpi-zero-w.dtb
>>>
>>> diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
>>> b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts new file mode 100644
>>> index 000000000000..62e986358c2a
>>> --- /dev/null
>>> +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b-7inch-ts-dsi.dts
>> i think this should be an overlay because this board can be connected to
>> different boards and we want to avoid copy & paste. Unfortunately i
>> don't know where this should be stored in the kernel tree.
> Yes, that is how it started but the upstream kernel doesn't use them. We
> thought that a separate device-tree makes sense as it is the official raspberry
> pi touchscreen.
i'm not an expert here, but this seems not quite correct. AFAIK there is
no full runtime overlay support in the kernel, but the resources that i
found are promising [1], [2], [3]. Unfortunately i never test it by myself.
Please understand that all these possible combination would result in a
unmaintable mess.
Best regards
[1] - https://u-boot.readthedocs.io/en/latest/usage/fdt_overlays.html
[2] - https://www.kernel.org/doc/html/latest/devicetree/overlay-notes.html
[3] -
https://bootlin.com/pub/conferences/2021/lee/maincent-devicetree-overlay-and-uboot-extension-board-management/maincent-devicetree-overlay-and-uboot-extension-board-management.pdf