0052-bcm2835-Match-with-BCM2708-Device-Trees.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. From 5869509197e8b3b6080f212a22e7d10310fc0a9b Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
  3. Date: Sat, 15 Aug 2015 20:47:07 +0200
  4. Subject: [PATCH 052/381] bcm2835: Match with BCM2708 Device Trees
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  9. ---
  10. arch/arm/boot/dts/bcm2835-rpi-b-plus.dts | 132 ++++++++++++++++++---
  11. arch/arm/boot/dts/bcm2835-rpi-b.dts | 115 ++++++++++++++++--
  12. arch/arm/boot/dts/bcm2835.dtsi | 195 +++----------------------------
  13. 3 files changed, 237 insertions(+), 205 deletions(-)
  14. --- a/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
  15. +++ b/arch/arm/boot/dts/bcm2835-rpi-b-plus.dts
  16. @@ -1,30 +1,128 @@
  17. /dts-v1/;
  18. -#include "bcm2835-rpi.dtsi"
  19. +#include "bcm2835.dtsi"
  20. / {
  21. compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
  22. model = "Raspberry Pi Model B+";
  23. -
  24. - leds {
  25. - act {
  26. - gpios = <&gpio 47 0>;
  27. - };
  28. -
  29. - pwr {
  30. - label = "PWR";
  31. - gpios = <&gpio 35 0>;
  32. - default-state = "keep";
  33. - linux,default-trigger = "default-on";
  34. - };
  35. - };
  36. };
  37. &gpio {
  38. - pinctrl-0 = <&gpioout &alt0 &i2s_alt0 &alt3>;
  39. + spi0_pins: spi0_pins {
  40. + brcm,pins = <7 8 9 10 11>;
  41. + brcm,function = <4>; /* alt0 */
  42. + };
  43. +
  44. + i2c0_pins: i2c0 {
  45. + brcm,pins = <0 1>;
  46. + brcm,function = <4>;
  47. + };
  48. - /* I2S interface */
  49. - i2s_alt0: i2s_alt0 {
  50. + i2c1_pins: i2c1 {
  51. + brcm,pins = <2 3>;
  52. + brcm,function = <4>;
  53. + };
  54. +
  55. + i2s_pins: i2s {
  56. brcm,pins = <18 19 20 21>;
  57. - brcm,function = <BCM2835_FSEL_ALT0>;
  58. + brcm,function = <4>; /* alt0 */
  59. + };
  60. +};
  61. +
  62. +&mmc {
  63. + status = "okay";
  64. + bus-width = <4>;
  65. +};
  66. +
  67. +&fb {
  68. + status = "okay";
  69. +};
  70. +
  71. +&uart0 {
  72. + status = "okay";
  73. +};
  74. +
  75. +&spi0 {
  76. + pinctrl-names = "default";
  77. + pinctrl-0 = <&spi0_pins>;
  78. +
  79. + spidev@0{
  80. + compatible = "spidev";
  81. + reg = <0>; /* CE0 */
  82. + #address-cells = <1>;
  83. + #size-cells = <0>;
  84. + spi-max-frequency = <500000>;
  85. + };
  86. +
  87. + spidev@1{
  88. + compatible = "spidev";
  89. + reg = <1>; /* CE1 */
  90. + #address-cells = <1>;
  91. + #size-cells = <0>;
  92. + spi-max-frequency = <500000>;
  93. + };
  94. +};
  95. +
  96. +&i2c0 {
  97. + pinctrl-names = "default";
  98. + pinctrl-0 = <&i2c0_pins>;
  99. + clock-frequency = <100000>;
  100. +};
  101. +
  102. +&i2c1 {
  103. + pinctrl-names = "default";
  104. + pinctrl-0 = <&i2c1_pins>;
  105. + clock-frequency = <100000>;
  106. +};
  107. +
  108. +&i2c2 {
  109. + clock-frequency = <100000>;
  110. +};
  111. +
  112. +&i2s {
  113. + #sound-dai-cells = <0>;
  114. + pinctrl-names = "default";
  115. + pinctrl-0 = <&i2s_pins>;
  116. +};
  117. +
  118. +&leds {
  119. + act_led: act {
  120. + label = "led0";
  121. + linux,default-trigger = "mmc0";
  122. + gpios = <&gpio 47 0>;
  123. + };
  124. +
  125. + pwr_led: pwr {
  126. + label = "led1";
  127. + linux,default-trigger = "input";
  128. + gpios = <&gpio 35 0>;
  129. + };
  130. +};
  131. +
  132. +/ {
  133. + __overrides__ {
  134. + uart0 = <&uart0>,"status";
  135. + uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
  136. + uart1_clkrate = <&uart1>,"clock-frequency:0";
  137. + i2s = <&i2s>,"status";
  138. + spi = <&spi0>,"status";
  139. + i2c0 = <&i2c0>,"status";
  140. + i2c1 = <&i2c1>,"status";
  141. + i2c2_iknowwhatimdoing = <&i2c2>,"status";
  142. + i2c0_baudrate = <&i2c0>,"clock-frequency:0";
  143. + i2c1_baudrate = <&i2c1>,"clock-frequency:0";
  144. + i2c2_baudrate = <&i2c2>,"clock-frequency:0";
  145. + core_freq = <&clk_core>,"clock-frequency:0";
  146. +
  147. + act_led_gpio = <&act_led>,"gpios:4";
  148. + act_led_activelow = <&act_led>,"gpios:8";
  149. + act_led_trigger = <&act_led>,"linux,default-trigger";
  150. +
  151. + pwr_led_gpio = <&pwr_led>,"gpios:4";
  152. + pwr_led_activelow = <&pwr_led>,"gpios:8";
  153. + pwr_led_trigger = <&pwr_led>,"linux,default-trigger";
  154. +
  155. + audio = <&audio>,"status";
  156. + watchdog = <&watchdog>,"status";
  157. + random = <&random>,"status";
  158. };
  159. };
  160. --- a/arch/arm/boot/dts/bcm2835-rpi-b.dts
  161. +++ b/arch/arm/boot/dts/bcm2835-rpi-b.dts
  162. @@ -1,17 +1,118 @@
  163. /dts-v1/;
  164. -#include "bcm2835-rpi.dtsi"
  165. +#include "bcm2835.dtsi"
  166. / {
  167. compatible = "raspberrypi,model-b", "brcm,bcm2835";
  168. model = "Raspberry Pi Model B";
  169. +};
  170. - leds {
  171. - act {
  172. - gpios = <&gpio 16 1>;
  173. - };
  174. +&gpio {
  175. + spi0_pins: spi0_pins {
  176. + brcm,pins = <7 8 9 10 11>;
  177. + brcm,function = <4>; /* alt0 */
  178. + };
  179. +
  180. + i2c0_pins: i2c0 {
  181. + brcm,pins = <0 1>;
  182. + brcm,function = <4>;
  183. + };
  184. +
  185. + i2c1_pins: i2c1 {
  186. + brcm,pins = <2 3>;
  187. + brcm,function = <4>;
  188. + };
  189. +
  190. + i2s_pins: i2s {
  191. + brcm,pins = <28 29 30 31>;
  192. + brcm,function = <6>; /* alt2 */
  193. };
  194. };
  195. -&gpio {
  196. - pinctrl-0 = <&gpioout &alt0 &alt3>;
  197. +&mmc {
  198. + status = "okay";
  199. + bus-width = <4>;
  200. +};
  201. +
  202. +&fb {
  203. + status = "okay";
  204. +};
  205. +
  206. +&uart0 {
  207. + status = "okay";
  208. +};
  209. +
  210. +&spi0 {
  211. + pinctrl-names = "default";
  212. + pinctrl-0 = <&spi0_pins>;
  213. +
  214. + spidev@0{
  215. + compatible = "spidev";
  216. + reg = <0>; /* CE0 */
  217. + #address-cells = <1>;
  218. + #size-cells = <0>;
  219. + spi-max-frequency = <500000>;
  220. + };
  221. +
  222. + spidev@1{
  223. + compatible = "spidev";
  224. + reg = <1>; /* CE1 */
  225. + #address-cells = <1>;
  226. + #size-cells = <0>;
  227. + spi-max-frequency = <500000>;
  228. + };
  229. +};
  230. +
  231. +&i2c0 {
  232. + pinctrl-names = "default";
  233. + pinctrl-0 = <&i2c0_pins>;
  234. + clock-frequency = <100000>;
  235. +};
  236. +
  237. +&i2c1 {
  238. + pinctrl-names = "default";
  239. + pinctrl-0 = <&i2c1_pins>;
  240. + clock-frequency = <100000>;
  241. +};
  242. +
  243. +&i2c2 {
  244. + clock-frequency = <100000>;
  245. +};
  246. +
  247. +&i2s {
  248. + #sound-dai-cells = <0>;
  249. + pinctrl-names = "default";
  250. + pinctrl-0 = <&i2s_pins>;
  251. +};
  252. +
  253. +&leds {
  254. + act_led: act {
  255. + label = "led0";
  256. + linux,default-trigger = "mmc0";
  257. + gpios = <&gpio 16 1>;
  258. + };
  259. +};
  260. +
  261. +/ {
  262. + __overrides__ {
  263. + uart0 = <&uart0>,"status";
  264. + uart0_clkrate = <&clk_uart0>,"clock-frequency:0";
  265. + uart1_clkrate = <&uart1>,"clock-frequency:0";
  266. + i2s = <&i2s>,"status";
  267. + spi = <&spi0>,"status";
  268. + i2c0 = <&i2c0>,"status";
  269. + i2c1 = <&i2c1>,"status";
  270. + i2c2_iknowwhatimdoing = <&i2c2>,"status";
  271. + i2c0_baudrate = <&i2c0>,"clock-frequency:0";
  272. + i2c1_baudrate = <&i2c1>,"clock-frequency:0";
  273. + i2c2_baudrate = <&i2c2>,"clock-frequency:0";
  274. + core_freq = <&clk_core>,"clock-frequency:0";
  275. +
  276. + act_led_gpio = <&act_led>,"gpios:4";
  277. + act_led_activelow = <&act_led>,"gpios:8";
  278. + act_led_trigger = <&act_led>,"linux,default-trigger";
  279. +
  280. + audio = <&audio>,"status";
  281. + watchdog = <&watchdog>,"status";
  282. + random = <&random>,"status";
  283. + };
  284. };
  285. --- a/arch/arm/boot/dts/bcm2835.dtsi
  286. +++ b/arch/arm/boot/dts/bcm2835.dtsi
  287. @@ -1,206 +1,39 @@
  288. -#include <dt-bindings/pinctrl/bcm2835.h>
  289. -#include <dt-bindings/clock/bcm2835.h>
  290. -#include "skeleton.dtsi"
  291. +#include "bcm2708_common.dtsi"
  292. / {
  293. compatible = "brcm,bcm2835";
  294. model = "BCM2835";
  295. - interrupt-parent = <&intc>;
  296. chosen {
  297. - bootargs = "earlyprintk console=ttyAMA0";
  298. + bootargs = "";
  299. };
  300. soc {
  301. - compatible = "simple-bus";
  302. - #address-cells = <1>;
  303. - #size-cells = <1>;
  304. - ranges = <0x7e000000 0x20000000 0x02000000>;
  305. + ranges = <0x7e000000 0x20000000 0x01000000>;
  306. dma-ranges = <0x40000000 0x00000000 0x20000000>;
  307. timer@7e003000 {
  308. compatible = "brcm,bcm2835-system-timer";
  309. reg = <0x7e003000 0x1000>;
  310. interrupts = <1 0>, <1 1>, <1 2>, <1 3>;
  311. - /* This could be a reference to BCM2835_CLOCK_TIMER,
  312. - * but we don't have the driver using the common clock
  313. - * support yet.
  314. - */
  315. clock-frequency = <1000000>;
  316. };
  317. - dma: dma@7e007000 {
  318. - compatible = "brcm,bcm2835-dma";
  319. - reg = <0x7e007000 0xf00>;
  320. - interrupts = <1 16>,
  321. - <1 17>,
  322. - <1 18>,
  323. - <1 19>,
  324. - <1 20>,
  325. - <1 21>,
  326. - <1 22>,
  327. - <1 23>,
  328. - <1 24>,
  329. - <1 25>,
  330. - <1 26>,
  331. - <1 27>,
  332. - <1 28>;
  333. -
  334. - #dma-cells = <1>;
  335. - brcm,dma-channel-mask = <0x7f35>;
  336. - };
  337. -
  338. - intc: interrupt-controller@7e00b200 {
  339. - compatible = "brcm,bcm2835-armctrl-ic";
  340. - reg = <0x7e00b200 0x200>;
  341. - interrupt-controller;
  342. - #interrupt-cells = <2>;
  343. - };
  344. -
  345. - watchdog@7e100000 {
  346. - compatible = "brcm,bcm2835-pm-wdt";
  347. - reg = <0x7e100000 0x28>;
  348. - };
  349. -
  350. - clocks: cprman@7e101000 {
  351. - compatible = "brcm,bcm2835-cprman";
  352. - #clock-cells = <1>;
  353. - reg = <0x7e101000 0x2000>;
  354. -
  355. - /* CPRMAN derives everything from the platform's
  356. - * oscillator.
  357. - */
  358. - clocks = <&clk_osc>;
  359. - };
  360. -
  361. - rng@7e104000 {
  362. - compatible = "brcm,bcm2835-rng";
  363. - reg = <0x7e104000 0x10>;
  364. - };
  365. -
  366. - mailbox: mailbox@7e00b800 {
  367. - compatible = "brcm,bcm2835-mbox";
  368. - reg = <0x7e00b880 0x40>;
  369. - interrupts = <0 1>;
  370. - #mbox-cells = <0>;
  371. - };
  372. -
  373. - gpio: gpio@7e200000 {
  374. - compatible = "brcm,bcm2835-gpio";
  375. - reg = <0x7e200000 0xb4>;
  376. - /*
  377. - * The GPIO IP block is designed for 3 banks of GPIOs.
  378. - * Each bank has a GPIO interrupt for itself.
  379. - * There is an overall "any bank" interrupt.
  380. - * In order, these are GIC interrupts 17, 18, 19, 20.
  381. - * Since the BCM2835 only has 2 banks, the 2nd bank
  382. - * interrupt output appears to be mirrored onto the
  383. - * 3rd bank's interrupt signal.
  384. - * So, a bank0 interrupt shows up on 17, 20, and
  385. - * a bank1 interrupt shows up on 18, 19, 20!
  386. - */
  387. - interrupts = <2 17>, <2 18>, <2 19>, <2 20>;
  388. -
  389. - gpio-controller;
  390. - #gpio-cells = <2>;
  391. -
  392. - interrupt-controller;
  393. - #interrupt-cells = <2>;
  394. - };
  395. -
  396. - uart0: uart@7e201000 {
  397. - compatible = "brcm,bcm2835-pl011", "arm,pl011", "arm,primecell";
  398. - reg = <0x7e201000 0x1000>;
  399. - interrupts = <2 25>;
  400. - clocks = <&clocks BCM2835_CLOCK_UART>,
  401. - <&clocks BCM2835_CLOCK_VPU>;
  402. - clock-names = "uartclk", "apb_pclk";
  403. - arm,primecell-periphid = <0x00241011>;
  404. - };
  405. -
  406. - i2s: i2s@7e203000 {
  407. - compatible = "brcm,bcm2835-i2s";
  408. - reg = <0x7e203000 0x24>,
  409. - <0x7e101098 0x08>;
  410. -
  411. - dmas = <&dma 2>,
  412. - <&dma 3>;
  413. - dma-names = "tx", "rx";
  414. - status = "disabled";
  415. - };
  416. -
  417. - spi: spi@7e204000 {
  418. - compatible = "brcm,bcm2835-spi";
  419. - reg = <0x7e204000 0x1000>;
  420. - interrupts = <2 22>;
  421. - clocks = <&clocks BCM2835_CLOCK_VPU>;
  422. - #address-cells = <1>;
  423. - #size-cells = <0>;
  424. - status = "disabled";
  425. - };
  426. -
  427. - i2c0: i2c@7e205000 {
  428. - compatible = "brcm,bcm2835-i2c";
  429. - reg = <0x7e205000 0x1000>;
  430. - interrupts = <2 21>;
  431. - clocks = <&clocks BCM2835_CLOCK_VPU>;
  432. - #address-cells = <1>;
  433. - #size-cells = <0>;
  434. - status = "disabled";
  435. - };
  436. -
  437. - sdhci: sdhci@7e300000 {
  438. - compatible = "brcm,bcm2835-sdhci";
  439. - reg = <0x7e300000 0x100>;
  440. - interrupts = <2 30>;
  441. - clocks = <&clocks BCM2835_CLOCK_EMMC>;
  442. - status = "disabled";
  443. - };
  444. -
  445. - i2c1: i2c@7e804000 {
  446. - compatible = "brcm,bcm2835-i2c";
  447. - reg = <0x7e804000 0x1000>;
  448. - interrupts = <2 21>;
  449. - clocks = <&clocks BCM2835_CLOCK_VPU>;
  450. - #address-cells = <1>;
  451. - #size-cells = <0>;
  452. - status = "disabled";
  453. - };
  454. -
  455. - i2c2: i2c@7e805000 {
  456. - compatible = "brcm,bcm2835-i2c";
  457. - reg = <0x7e805000 0x1000>;
  458. - interrupts = <2 21>;
  459. - clocks = <&clocks BCM2835_CLOCK_VPU>;
  460. - #address-cells = <1>;
  461. - #size-cells = <0>;
  462. - status = "disabled";
  463. - };
  464. -
  465. - usb@7e980000 {
  466. - compatible = "brcm,bcm2835-usb";
  467. - reg = <0x7e980000 0x10000>;
  468. - interrupts = <1 9>;
  469. - };
  470. -
  471. arm-pmu {
  472. compatible = "arm,arm1176-pmu";
  473. };
  474. - };
  475. - clocks {
  476. - compatible = "simple-bus";
  477. - #address-cells = <1>;
  478. - #size-cells = <0>;
  479. -
  480. - /* The oscillator is the root of the clock tree. */
  481. - clk_osc: clock@3 {
  482. - compatible = "fixed-clock";
  483. - reg = <3>;
  484. - #clock-cells = <0>;
  485. - clock-output-names = "osc";
  486. - clock-frequency = <19200000>;
  487. + aux_enable: aux_enable@0x7e215004 {
  488. + compatible = "bcrm,bcm2835-aux-enable";
  489. + reg = <0x7e215004 0x04>;
  490. };
  491. -
  492. };
  493. };
  494. +
  495. +&intc {
  496. + compatible = "brcm,bcm2835-armctrl-ic";
  497. +};
  498. +
  499. +&watchdog {
  500. + status = "okay";
  501. +};