Skip to content

Commit f882306

Browse files
timg236popcornmix
authored andcommitted
dtoverlay: Add an overlay for the Raspberry Pi firmware UART
Add a device-tree overlay to configure the GPIOs for the Raspberry Pi firmware UART. Example config.txt dtoverlay=rpi-fw-uart,txd0_pin=20,rxd0_pin=21 Signed-off-by: Phil Elwell <phil@raspberrypi.com> Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
1 parent a49feff commit f882306

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
234234
rpi-dacpro.dtbo \
235235
rpi-digiampplus.dtbo \
236236
rpi-ft5406.dtbo \
237+
rpi-fw-uart.dtbo \
237238
rpi-poe.dtbo \
238239
rpi-poe-plus.dtbo \
239240
rpi-sense.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4175,6 +4175,18 @@ Params: touchscreen-size-x Touchscreen X resolution (default 800)
41754175
touchscreen-swapped-x-y Swap X and Y cordinates (default 0);
41764176

41774177

4178+
Name: rpi-fw-uart
4179+
Info: Configures the firmware software UART driver.
4180+
This driver requires exclusive usage of the second VPU core. The
4181+
following config.txt entries should be set when this driver is used.
4182+
dtparam=audio=off
4183+
isp_use_vpu0=1
4184+
Load: dtoverlay=rpi-fw-uart,<param>[=<val>]
4185+
Params: txd0_pin GPIO pin for TXD0 (any free - default 20)
4186+
4187+
rxd0_pin GPIO pin for RXD0 (any free - default 21)
4188+
4189+
41784190
Name: rpi-poe
41794191
Info: Raspberry Pi PoE HAT fan
41804192
Load: dtoverlay=rpi-poe,<param>[=<val>]
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
// Overlay for the Raspberry Pi Firmware UART driver
3+
/dts-v1/;
4+
/plugin/;
5+
6+
/{
7+
compatible = "brcm,bcm2835";
8+
9+
fragment@0 {
10+
target = <&gpio>;
11+
__overlay__ {
12+
rpi_fw_uart_pins: rpi_fw_uart_pins@4 {
13+
brcm,pins = <20 21>;
14+
brcm,function = <1 0>; /* output input */
15+
brcm,pull = <0 2>; /* none pull-up */
16+
};
17+
};
18+
};
19+
20+
fragment@1 {
21+
target = <&soc>;
22+
__overlay__ {
23+
rpi_fw_uart: rpi_fw_uart@7e000000 {
24+
compatible = "raspberrypi,firmware-uart";
25+
reg = <0x7e000000 0x100>; /* VideoCore MS sync regs */
26+
firmware = <&firmware>;
27+
pinctrl-names = "default";
28+
pinctrl-0 = <&rpi_fw_uart_pins>;
29+
tx-gpios = <&gpio 20 0>;
30+
rx-gpios = <&gpio 21 0>;
31+
};
32+
};
33+
};
34+
35+
__overrides__ {
36+
txd0_pin = <&rpi_fw_uart>,"tx-gpios:4",
37+
<&rpi_fw_uart_pins>, "brcm,pins:0";
38+
rxd0_pin = <&rpi_fw_uart>,"rx-gpios:4",
39+
<&rpi_fw_uart_pins>, "brcm,pins:4";
40+
};
41+
};

0 commit comments

Comments
 (0)