Skip to content

Commit 23816e6

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
overlays: Add uart0 overlay to change pin usage
Signed-off-by: Phil Elwell <[email protected]>
1 parent 8826f8d commit 23816e6

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
@@ -117,6 +117,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
117117
spi2-2cs.dtbo \
118118
spi2-3cs.dtbo \
119119
tinylcd35.dtbo \
120+
uart0.dtbo \
120121
uart1.dtbo \
121122
vc4-fkms-v3d.dtbo \
122123
vc4-kms-v3d.dtbo \

arch/arm/boot/dts/overlays/README

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

16731673

1674+
Name: uart0
1675+
Info: Change the pin usage of uart0
1676+
Load: dtoverlay=uart0,<param>=<val>
1677+
Params: txd0_pin GPIO pin for TXD0 (14, 32 or 36 - default 14)
1678+
1679+
rxd0_pin GPIO pin for RXD0 (15, 33 or 37 - default 15)
1680+
1681+
pin_func Alternative pin function - 4(Alt0) for 14&15,
1682+
7(Alt3) for 32&33, 6(Alt2) for 36&37
1683+
1684+
16741685
Name: uart1
1675-
Info: Enable uart1 in place of uart0
1686+
Info: Change the pin usage of uart1
16761687
Load: dtoverlay=uart1,<param>=<val>
16771688
Params: txd1_pin GPIO pin for TXD1 (14, 32 or 40 - default 14)
16781689

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)