Skip to content

Commit

Permalink
overlays: Add uart0 overlay to change pin usage
Browse files Browse the repository at this point in the history
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  • Loading branch information
Phil Elwell authored and popcornmix committed Feb 9, 2018
1 parent 003504e commit 8c7e717
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/arm/boot/dts/overlays/Makefile
Expand Up @@ -117,6 +117,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
spi2-2cs.dtbo \
spi2-3cs.dtbo \
tinylcd35.dtbo \
uart0.dtbo \
uart1.dtbo \
vc4-fkms-v3d.dtbo \
vc4-kms-v3d.dtbo \
Expand Down
13 changes: 12 additions & 1 deletion arch/arm/boot/dts/overlays/README
Expand Up @@ -1671,8 +1671,19 @@ Params: speed Display SPI bus speed
dtoverlay=tinylcd35,touch,touchgpio=3


Name: uart0
Info: Change the pin usage of uart0
Load: dtoverlay=uart0,<param>=<val>
Params: txd0_pin GPIO pin for TXD0 (14, 32 or 36 - default 14)

rxd0_pin GPIO pin for RXD0 (15, 33 or 37 - default 15)

pin_func Alternative pin function - 4(Alt0) for 14&15,
7(Alt3) for 32&33, 6(Alt2) for 36&37


Name: uart1
Info: Enable uart1 in place of uart0
Info: Change the pin usage of uart1
Load: dtoverlay=uart1,<param>=<val>
Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14)

Expand Down
32 changes: 32 additions & 0 deletions arch/arm/boot/dts/overlays/uart0-overlay.dts
@@ -0,0 +1,32 @@
/dts-v1/;
/plugin/;

/{
compatible = "brcm,bcm2708";

fragment@0 {
target = <&uart0>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&uart0_pins>;
status = "okay";
};
};

fragment@1 {
target = <&gpio>;
__overlay__ {
uart0_pins: uart0_pins {
brcm,pins = <14 15>;
brcm,function = <4>; /* alt0 */
brcm,pull = <0 2>;
};
};
};

__overrides__ {
txd0_pin = <&uart0_pins>,"brcm,pins:0";
rxd0_pin = <&uart0_pins>,"brcm,pins:4";
pin_func = <&uart0_pins>,"brcm,function:0";
};
};

0 comments on commit 8c7e717

Please sign in to comment.