1 From b6b126861062020fb50859c5af71d8846ce43d7c Mon Sep 17 00:00:00 2001
2 From: Tim Gover <tim.gover@raspberrypi.com>
3 Date: Mon, 4 Nov 2024 13:44:10 +0000
4 Subject: [PATCH] dtoverlay: Add an overlay for the Raspberry Pi firmware UART
6 Add a device-tree overlay to configure the GPIOs for the
7 Raspberry Pi firmware UART.
10 dtoverlay=rpi-fw-uart,txd0_pin=20,rxd0_pin=21
12 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
13 Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
15 arch/arm/boot/dts/overlays/Makefile | 1 +
16 arch/arm/boot/dts/overlays/README | 12 ++++++
17 .../boot/dts/overlays/rpi-fw-uart-overlay.dts | 41 +++++++++++++++++++
18 3 files changed, 54 insertions(+)
19 create mode 100644 arch/arm/boot/dts/overlays/rpi-fw-uart-overlay.dts
21 --- a/arch/arm/boot/dts/overlays/Makefile
22 +++ b/arch/arm/boot/dts/overlays/Makefile
23 @@ -233,6 +233,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
25 rpi-digiampplus.dtbo \
31 --- a/arch/arm/boot/dts/overlays/README
32 +++ b/arch/arm/boot/dts/overlays/README
33 @@ -4141,6 +4141,18 @@ Params: touchscreen-size-x Touchscr
34 touchscreen-swapped-x-y Swap X and Y cordinates (default 0);
38 +Info: Configures the firmware software UART driver.
39 + This driver requires exclusive usage of the second VPU core. The
40 + following config.txt entries should be set when this driver is used.
43 +Load: dtoverlay=rpi-fw-uart,<param>[=<val>]
44 +Params: txd0_pin GPIO pin for TXD0 (any free - default 20)
46 + rxd0_pin GPIO pin for RXD0 (any free - default 21)
50 Info: Raspberry Pi PoE HAT fan
51 Load: dtoverlay=rpi-poe,<param>[=<val>]
53 +++ b/arch/arm/boot/dts/overlays/rpi-fw-uart-overlay.dts
55 +// SPDX-License-Identifier: GPL-2.0
56 +// Overlay for the Raspberry Pi Firmware UART driver
61 + compatible = "brcm,bcm2835";
66 + rpi_fw_uart_pins: rpi_fw_uart_pins@4 {
67 + brcm,pins = <20 21>;
68 + brcm,function = <1 0>; /* output input */
69 + brcm,pull = <0 2>; /* none pull-up */
77 + rpi_fw_uart: rpi_fw_uart@7e000000 {
78 + compatible = "raspberrypi,firmware-uart";
79 + reg = <0x7e000000 0x100>; /* VideoCore MS sync regs */
80 + firmware = <&firmware>;
81 + pinctrl-names = "default";
82 + pinctrl-0 = <&rpi_fw_uart_pins>;
83 + tx-gpios = <&gpio 20 0>;
84 + rx-gpios = <&gpio 21 0>;
90 + txd0_pin = <&rpi_fw_uart>,"tx-gpios:4",
91 + <&rpi_fw_uart_pins>, "brcm,pins:0";
92 + rxd0_pin = <&rpi_fw_uart>,"rx-gpios:4",
93 + <&rpi_fw_uart_pins>, "brcm,pins:4";