brcm2708: update patches to latest version
[openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0172-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch
1 From 3b93a5e60a2272bea6b50561c6e871dde5295dfb Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Mon, 7 Mar 2016 09:53:03 +0000
4 Subject: [PATCH 172/180] BCM270X_DT: Add pi3-miniuart-bt DT overlay
5
6 Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
7 UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
8 usable baudrate.
9
10 It is also necessary to edit /lib/systemd/system/hciuart.server and
11 replace ttyAMA0 with ttyS0.
12
13 If cmdline.txt uses the alias serial0 to refer to the user-accessable port
14 then the firmware will replace with the appropriate port whether or not
15 this overlay is used.
16
17 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
18 ---
19  arch/arm/boot/dts/overlays/Makefile                |  1 +
20  arch/arm/boot/dts/overlays/README                  | 10 ++++
21  .../boot/dts/overlays/pi3-miniuart-bt-overlay.dts  | 61 ++++++++++++++++++++++
22  3 files changed, 72 insertions(+)
23  create mode 100644 arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts
24
25 --- a/arch/arm/boot/dts/overlays/Makefile
26 +++ b/arch/arm/boot/dts/overlays/Makefile
27 @@ -40,6 +40,7 @@ dtb-$(RPI_DT_OVERLAYS) += mcp2515-can1-o
28  dtb-$(RPI_DT_OVERLAYS) += mmc-overlay.dtb
29  dtb-$(RPI_DT_OVERLAYS) += mz61581-overlay.dtb
30  dtb-$(RPI_DT_OVERLAYS) += pi3-disable-bt-overlay.dtb
31 +dtb-$(RPI_DT_OVERLAYS) += pi3-miniuart-bt-overlay.dtb
32  dtb-$(RPI_DT_OVERLAYS) += piscreen-overlay.dtb
33  dtb-$(RPI_DT_OVERLAYS) += piscreen2r-overlay.dtb
34  dtb-$(RPI_DT_OVERLAYS) += pitft28-capacitive-overlay.dtb
35 --- a/arch/arm/boot/dts/overlays/README
36 +++ b/arch/arm/boot/dts/overlays/README
37 @@ -504,6 +504,16 @@ Load:   dtoverlay=pi3-disable-bt
38  Params: <None>
39  
40  
41 +Name:   pi3-miniuart-bt
42 +Info:   Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
43 +        UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
44 +        usable baudrate.
45 +        N.B. It is also necessary to edit /lib/systemd/system/hciuart.server
46 +        and replace ttyAMA0 with ttyS0.
47 +Load:   dtoverlay=pi3-miniuart-bt
48 +Params: <None>
49 +
50 +
51  Name:   piscreen
52  Info:   PiScreen display by OzzMaker.com
53  Load:   dtoverlay=piscreen,<param>=<val>
54 --- /dev/null
55 +++ b/arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts
56 @@ -0,0 +1,61 @@
57 +/dts-v1/;
58 +/plugin/;
59 +
60 +/* Switch Pi3 Bluetooth function to use the mini-UART (ttyS0) and restore
61 +   UART0/ttyAMA0 over GPIOs 14 & 15. Note that this may reduce the maximum
62 +   usable baudrate.
63 +
64 +   It is also necessary to edit /lib/systemd/system/hciuart.server and
65 +   replace ttyAMA0 with ttyS0.
66 +
67 +   If cmdline.txt uses the alias serial0 to refer to the user-accessable port
68 +   then the firmware will replace with the appropriate port whether or not
69 +   this overlay is used.
70 +*/
71 +
72 +/{
73 +       compatible = "brcm,bcm2708";
74 +
75 +       fragment@0 {
76 +               target = <&uart0>;
77 +               __overlay__ {
78 +                       pinctrl-names = "default";
79 +                       pinctrl-0 = <&uart0_pins>;
80 +                       status = "okay";
81 +               };
82 +       };
83 +
84 +       fragment@1 {
85 +               target = <&uart1>;
86 +               __overlay__ {
87 +                       pinctrl-names = "default";
88 +                       pinctrl-0 = <&uart1_pins>;
89 +                       status = "okay";
90 +               };
91 +       };
92 +
93 +       fragment@2 {
94 +               target = <&gpio>;
95 +               __overlay__ {
96 +                       uart0_pins: uart0_pins {
97 +                               brcm,pins = <14 15>;
98 +                               brcm,function = <4>; /* alt0 */
99 +                               brcm,pull = <0 2>;
100 +                       };
101 +
102 +                       uart1_pins: uart1_pins {
103 +                               brcm,pins = <32 33>;
104 +                               brcm,function = <2>; /* alt5=UART1 */
105 +                               brcm,pull = <0 0>;
106 +                       };
107 +               };
108 +       };
109 +
110 +       fragment@3 {
111 +               target-path = "/aliases";
112 +               __overlay__ {
113 +                       serial0 = "/soc/uart@7e201000";
114 +                       serial1 = "/soc/uart@7e215040";
115 +               };
116 +       };
117 +};