Skip to content

Commit aae807a

Browse files
author
Phil Elwell
committed
overlays: Add uart0 overlay to change pin usage
Signed-off-by: Phil Elwell <[email protected]>
1 parent 5aa4c31 commit aae807a

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
115115
spi2-2cs.dtbo \
116116
spi2-3cs.dtbo \
117117
tinylcd35.dtbo \
118+
uart0.dtbo \
118119
uart1.dtbo \
119120
vc4-fkms-v3d.dtbo \
120121
vc4-kms-v3d.dtbo \

arch/arm/boot/dts/overlays/README

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1643,8 +1643,19 @@ Params: speed Display SPI bus speed
16431643
dtoverlay=tinylcd35,touch,touchgpio=3
16441644

16451645

1646+
Name: uart0
1647+
Info: Change the pin usage of uart0
1648+
Load: dtoverlay=uart0,<param>=<val>
1649+
Params: txd0_pin GPIO pin for TXD0 (14, 32 or 36 - default 14)
1650+
1651+
rxd0_pin GPIO pin for RXD0 (15, 33 or 37 - default 15)
1652+
1653+
pin_func Alternative pin function - 4(Alt0) for 14&15,
1654+
7(Alt3) for 32&33, 6(Alt2) for 36&37
1655+
1656+
16461657
Name: uart1
1647-
Info: Enable uart1 in place of uart0
1658+
Info: Change the pin usage of uart1
16481659
Load: dtoverlay=uart1,<param>=<val>
16491660
Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14)
16501661

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/{
5+
compatible = "brcm,bcm2708";
6+
7+
fragment@0 {
8+
target = <&uart0>;
9+
__overlay__ {
10+
pinctrl-names = "default";
11+
pinctrl-0 = <&uart0_pins>;
12+
status = "okay";
13+
};
14+
};
15+
16+
fragment@1 {
17+
target = <&gpio>;
18+
__overlay__ {
19+
uart0_pins: uart0_pins {
20+
brcm,pins = <14 15>;
21+
brcm,function = <4>; /* alt0 */
22+
brcm,pull = <0 2>;
23+
};
24+
};
25+
};
26+
27+
__overrides__ {
28+
txd0_pin = <&uart0_pins>,"brcm,pins:0";
29+
rxd0_pin = <&uart0_pins>,"brcm,pins:4";
30+
pin_func = <&uart0_pins>,"brcm,function:0";
31+
};
32+
};

0 commit comments

Comments
 (0)