Skip to content

Commit 866cf94

Browse files
author
Phil Elwell
committed
BCM270X_DT: Add pi3-miniuart-bt DT overlay
Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum usable baudrate. It is also necessary to edit /lib/systemd/system/hciuart.server and replace ttyAMA0 with ttyS0. If cmdline.txt uses the alias serial0 to refer to the user-accessable port then the firmware will replace with the appropriate port whether or not this overlay is used. Signed-off-by: Phil Elwell <[email protected]>
1 parent b39e1e3 commit 866cf94

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

arch/arm/boot/dts/overlays/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dtb-$(RPI_DT_OVERLAYS) += mcp2515-can1-overlay.dtb
3838
dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
3939
dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
4040
dtb-$(RPI_DT_OVERLAYS) += pi3-disable-bt-overlay.dtb
41+
dtb-$(RPI_DT_OVERLAYS) += pi3-miniuart-bt-overlay.dtb
4142
dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
4243
dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb
4344
dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb

arch/arm/boot/dts/overlays/README

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,16 @@ Load: dtoverlay=pi3-disable-bt
483483
Params: <None>
484484

485485

486+
Name: pi3-miniuart-bt
487+
Info: Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
488+
UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
489+
usable baudrate.
490+
N.B. It is also necessary to edit /lib/systemd/system/hciuart.server
491+
and replace ttyAMA0 with ttyS0.
492+
Load: dtoverlay=pi3-miniuart-bt
493+
Params: <None>
494+
495+
486496
Name: piscreen
487497
Info: PiScreen display by OzzMaker.com
488498
Load: dtoverlay=piscreen,<param>=<val>
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/dts-v1/;
2+
/plugin/;
3+
4+
/* Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
5+
UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
6+
usable baudrate.
7+
8+
It is also necessary to edit /lib/systemd/system/hciuart.server and
9+
replace ttyAMA0 with ttyS0.
10+
11+
If cmdline.txt uses the alias serial0 to refer to the user-accessable port
12+
then the firmware will replace with the appropriate port whether or not
13+
this overlay is used.
14+
*/
15+
16+
/{
17+
compatible = "brcm,bcm2708";
18+
19+
fragment@0 {
20+
target = <&uart0>;
21+
__overlay__ {
22+
pinctrl-names = "default";
23+
pinctrl-0 = <&uart0_pins>;
24+
status = "okay";
25+
};
26+
};
27+
28+
fragment@1 {
29+
target = <&uart1>;
30+
__overlay__ {
31+
pinctrl-names = "default";
32+
pinctrl-0 = <&uart1_pins>;
33+
status = "okay";
34+
};
35+
};
36+
37+
fragment@2 {
38+
target = <&gpio>;
39+
__overlay__ {
40+
uart0_pins: uart0_pins {
41+
brcm,pins = <14 15>;
42+
brcm,function = <4>; /* alt0 */
43+
brcm,pull = <0 2>;
44+
};
45+
46+
uart1_pins: uart1_pins {
47+
brcm,pins = <32 33>;
48+
brcm,function = <2>; /* alt5=UART1 */
49+
brcm,pull = <0 0>;
50+
};
51+
};
52+
};
53+
54+
fragment@3 {
55+
target-path = "/aliases";
56+
__overlay__ {
57+
serial0 = "/soc/uart@7e201000";
58+
serial1 = "/soc/uart@7e215040";
59+
};
60+
};
61+
};

0 commit comments

Comments
 (0)