Skip to content

Commit

Permalink
dtoverlay: Add an overlay for the Raspberry Pi firmware UART
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Elwell <[email protected]>
Signed-off-by: Tim Gover <[email protected]>
  • Loading branch information
timg236 committed Dec 2, 2024
1 parent 2684780 commit 38ef634
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
rpi-dacpro.dtbo \
rpi-digiampplus.dtbo \
rpi-ft5406.dtbo \
rpi-fw-uart.dtbo \
rpi-poe.dtbo \
rpi-poe-plus.dtbo \
rpi-sense.dtbo \
Expand Down
12 changes: 12 additions & 0 deletions arch/arm/boot/dts/overlays/README
Original file line number Diff line number Diff line change
Expand Up @@ -4141,6 +4141,18 @@ Params: touchscreen-size-x Touchscreen X resolution (default 800)
touchscreen-swapped-x-y Swap X and Y cordinates (default 0);


Name: rpi-fw-uart
Info: Configures the firmware software UART driver.
This driver requires exclusive usage of the second VPU core. The
following config.txt entries should be set when this driver is used.
dtparam=audio=off
isp_use_vpu0=1
Load: dtoverlay=rpi-fw-uart,<param>[=<val>]
Params: txd0_pin GPIO pin for TXD0 (any free - default 20)

rxd0_pin GPIO pin for RXD0 (any free - default 21)


Name: rpi-poe
Info: Raspberry Pi PoE HAT fan
Load: dtoverlay=rpi-poe,<param>[=<val>]
Expand Down
41 changes: 41 additions & 0 deletions arch/arm/boot/dts/overlays/rpi-fw-uart-overlay.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: GPL-2.0
// Overlay for the Raspberry Pi Firmware UART driver
/dts-v1/;
/plugin/;

/{
compatible = "brcm,bcm2835";

fragment@0 {
target = <&gpio>;
__overlay__ {
rpi_fw_uart_pins: rpi_fw_uart_pins@4 {
brcm,pins = <20 21>;
brcm,function = <1 0>; /* output input */
brcm,pull = <0 2>; /* none pull-up */
};
};
};

fragment@1 {
target = <&soc>;
__overlay__ {
rpi_fw_uart: rpi_fw_uart@7e000000 {
compatible = "raspberrypi,firmware-uart";
reg = <0x7e000000 0x100>; /* VideoCore MS sync regs */
firmware = <&firmware>;
pinctrl-names = "default";
pinctrl-0 = <&rpi_fw_uart_pins>;
tx-gpios = <&gpio 20 0>;
rx-gpios = <&gpio 21 0>;
};
};
};

__overrides__ {
txd0_pin = <&rpi_fw_uart>,"tx-gpios:4",
<&rpi_fw_uart_pins>, "brcm,pins:0";
rxd0_pin = <&rpi_fw_uart>,"rx-gpios:4",
<&rpi_fw_uart_pins>, "brcm,pins:4";
};
};

0 comments on commit 38ef634

Please sign in to comment.