0144-BCM270X_DT-Add-dtparams-for-the-SD-interface.patch 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. From dab78628dc1fe1488674cdc8a6864cbf382f72cc Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Fri, 12 Feb 2016 15:38:00 +0000
  4. Subject: [PATCH] BCM270X_DT: Add dtparams for the SD interface
  5. Add new base dtparams sd_overclock, sd_force_pio, sd_pio_limit
  6. and sd_debug.
  7. ---
  8. arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 4 ++++
  9. arch/arm/boot/dts/bcm2708-rpi-b.dts | 4 ++++
  10. arch/arm/boot/dts/bcm2708-rpi-cm.dts | 1 -
  11. arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 13 +++++++++++++
  12. arch/arm/boot/dts/bcm2708_common.dtsi | 2 ++
  13. arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 4 ++++
  14. arch/arm/boot/dts/overlays/README | 11 ++++++++++-
  15. arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 -
  16. arch/arm/boot/dts/overlays/sdhost-overlay.dts | 27 +++++++++++++-------------
  17. arch/arm/boot/dts/overlays/sdtweak-overlay.dts | 14 ++++++-------
  18. 10 files changed, 58 insertions(+), 23 deletions(-)
  19. --- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
  20. +++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts
  21. @@ -141,5 +141,9 @@
  22. audio = <&audio>,"status";
  23. watchdog = <&watchdog>,"status";
  24. random = <&random>,"status";
  25. + sd_overclock = <&sdhost>,"brcm,overclock-50:0";
  26. + sd_force_pio = <&sdhost>,"brcm,force-pio?";
  27. + sd_pio_limit = <&sdhost>,"brcm,pio-limit:0";
  28. + sd_debug = <&sdhost>,"brcm,debug";
  29. };
  30. };
  31. --- a/arch/arm/boot/dts/bcm2708-rpi-b.dts
  32. +++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts
  33. @@ -131,5 +131,9 @@
  34. audio = <&audio>,"status";
  35. watchdog = <&watchdog>,"status";
  36. random = <&random>,"status";
  37. + sd_overclock = <&sdhost>,"brcm,overclock-50:0";
  38. + sd_force_pio = <&sdhost>,"brcm,force-pio?";
  39. + sd_pio_limit = <&sdhost>,"brcm,pio-limit:0";
  40. + sd_debug = <&sdhost>,"brcm,debug";
  41. };
  42. };
  43. --- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts
  44. +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts
  45. @@ -97,6 +97,5 @@
  46. i2c0_baudrate = <&i2c0>,"clock-frequency:0";
  47. i2c1_baudrate = <&i2c1>,"clock-frequency:0";
  48. i2c2_baudrate = <&i2c2>,"clock-frequency:0";
  49. - core_freq = <&clk_core>,"clock-frequency:0";
  50. };
  51. };
  52. --- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
  53. +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
  54. @@ -7,6 +7,13 @@
  55. };
  56. };
  57. +&gpio {
  58. + sdhost_pins: sdhost_pins {
  59. + brcm,pins = <48 49 50 51 52 53>;
  60. + brcm,function = <4>; /* alt0 */
  61. + };
  62. +};
  63. +
  64. &leds {
  65. act_led: act {
  66. label = "led0";
  67. @@ -29,6 +36,8 @@
  68. / {
  69. __overrides__ {
  70. + core_freq = <&clk_core>,"clock-frequency:0";
  71. +
  72. act_led_gpio = <&act_led>,"gpios:4";
  73. act_led_activelow = <&act_led>,"gpios:8";
  74. act_led_trigger = <&act_led>,"linux,default-trigger";
  75. @@ -36,5 +45,9 @@
  76. audio = <&audio>,"status";
  77. watchdog = <&watchdog>,"status";
  78. random = <&random>,"status";
  79. + sd_overclock = <&sdhost>,"brcm,overclock-50:0";
  80. + sd_force_pio = <&sdhost>,"brcm,force-pio?";
  81. + sd_pio_limit = <&sdhost>,"brcm,pio-limit:0";
  82. + sd_debug = <&sdhost>,"brcm,debug";
  83. };
  84. };
  85. --- a/arch/arm/boot/dts/bcm2708_common.dtsi
  86. +++ b/arch/arm/boot/dts/bcm2708_common.dtsi
  87. @@ -135,6 +135,7 @@
  88. dmas = <&dma 13>,
  89. <&dma 13>;
  90. dma-names = "tx", "rx";
  91. + brcm,overclock-50 = <0>;
  92. brcm,pio-limit = <1>;
  93. status = "disabled";
  94. };
  95. @@ -203,6 +204,7 @@
  96. dmas = <&dma 11>,
  97. <&dma 11>;
  98. dma-names = "tx", "rx";
  99. + brcm,overclock-50 = <0>;
  100. status = "disabled";
  101. };
  102. --- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
  103. +++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts
  104. @@ -141,5 +141,9 @@
  105. audio = <&audio>,"status";
  106. watchdog = <&watchdog>,"status";
  107. random = <&random>,"status";
  108. + sd_overclock = <&sdhost>,"brcm,overclock-50:0";
  109. + sd_force_pio = <&sdhost>,"brcm,force-pio?";
  110. + sd_pio_limit = <&sdhost>,"brcm,pio-limit:0";
  111. + sd_debug = <&sdhost>,"brcm,debug";
  112. };
  113. };
  114. --- a/arch/arm/boot/dts/overlays/README
  115. +++ b/arch/arm/boot/dts/overlays/README
  116. @@ -112,6 +112,16 @@ Params:
  117. random Set to "on" to enable the hardware random
  118. number generator (default "on")
  119. + sd_overclock Clock (in MHz) to use when the MMC framework
  120. + requests 50MHz
  121. +
  122. + sd_force_pio Disable DMA support for SD driver (default off)
  123. +
  124. + sd_pio_limit Number of blocks above which to use DMA for
  125. + SD card (default 1)
  126. +
  127. + sd_debug Enable debug output from SD driver (default off)
  128. +
  129. uart0 Set to "off" to disable uart0 (default "on")
  130. watchdog Set to "on" to enable the hardware watchdog
  131. @@ -443,7 +453,6 @@ Info: Selects the bcm2835-mmc SD/MMC d
  132. Load: dtoverlay=mmc,<param>=<val>
  133. Params: overclock_50 Clock (in MHz) to use when the MMC framework
  134. requests 50MHz
  135. - force_pio Disable DMA support
  136. Name: mz61581
  137. --- a/arch/arm/boot/dts/overlays/mmc-overlay.dts
  138. +++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts
  139. @@ -34,6 +34,5 @@
  140. __overrides__ {
  141. overclock_50 = <&frag0>,"brcm,overclock-50:0";
  142. - force_pio = <&frag0>,"brcm,force-pio?";
  143. };
  144. };
  145. --- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts
  146. +++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts
  147. @@ -1,19 +1,14 @@
  148. /dts-v1/;
  149. /plugin/;
  150. +/* Provide backwards compatible aliases for the old sdhost dtparams. */
  151. +
  152. /{
  153. compatible = "brcm,bcm2708";
  154. fragment@0 {
  155. - target = <&mmc>;
  156. - __overlay__ {
  157. - status = "disabled";
  158. - };
  159. - };
  160. -
  161. - fragment@1 {
  162. target = <&sdhost>;
  163. - frag1: __overlay__ {
  164. + frag0: __overlay__ {
  165. brcm,overclock-50 = <0>;
  166. brcm,pio-limit = <1>;
  167. brcm,debug-flags = <0>;
  168. @@ -21,11 +16,17 @@
  169. };
  170. };
  171. + fragment@1 {
  172. + target = <&mmc>;
  173. + __overlay__ {
  174. + status = "disabled";
  175. + };
  176. + };
  177. +
  178. __overrides__ {
  179. - overclock_50 = <&frag1>,"brcm,overclock-50:0";
  180. - force_pio = <&frag1>,"brcm,force-pio?";
  181. - pio_limit = <&frag1>,"brcm,pio-limit:0";
  182. - debug = <&frag1>,"brcm,debug?";
  183. - debug_flags = <&frag1>,"brcm,debug-flags:0";
  184. + overclock_50 = <&frag0>,"brcm,overclock-50:0";
  185. + force_pio = <&frag0>,"brcm,force-pio?";
  186. + pio_limit = <&frag0>,"brcm,pio-limit:0";
  187. + debug = <&frag0>,"brcm,debug?";
  188. };
  189. };
  190. --- a/arch/arm/boot/dts/overlays/sdtweak-overlay.dts
  191. +++ b/arch/arm/boot/dts/overlays/sdtweak-overlay.dts
  192. @@ -1,23 +1,23 @@
  193. /dts-v1/;
  194. /plugin/;
  195. +/* Provide backwards compatible aliases for the old sdhost dtparams. */
  196. +
  197. /{
  198. compatible = "brcm,bcm2708";
  199. fragment@0 {
  200. target = <&sdhost>;
  201. - frag1: __overlay__ {
  202. + frag0: __overlay__ {
  203. brcm,overclock-50 = <0>;
  204. brcm,pio-limit = <1>;
  205. - brcm,debug-flags = <0>;
  206. };
  207. };
  208. __overrides__ {
  209. - overclock_50 = <&frag1>,"brcm,overclock-50:0";
  210. - force_pio = <&frag1>,"brcm,force-pio?";
  211. - pio_limit = <&frag1>,"brcm,pio-limit:0";
  212. - debug = <&frag1>,"brcm,debug?";
  213. - debug_flags = <&frag1>,"brcm,debug-flags:0";
  214. + overclock_50 = <&frag0>,"brcm,overclock-50:0";
  215. + force_pio = <&frag0>,"brcm,force-pio?";
  216. + pio_limit = <&frag0>,"brcm,pio-limit:0";
  217. + debug = <&frag0>,"brcm,debug?";
  218. };
  219. };