0164-BCM270X_DT-Add-pi3-miniuart-bt-DT-overlay.patch 3.4 KB

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