mt7622-bananapi-bpi-r64.dts 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  1. /*
  2. * Copyright (c) 2018 MediaTek Inc.
  3. * Author: Ryder Lee <ryder.lee@mediatek.com>
  4. *
  5. * SPDX-License-Identifier: (GPL-2.0 OR MIT)
  6. */
  7. /dts-v1/;
  8. #include <dt-bindings/input/input.h>
  9. #include <dt-bindings/gpio/gpio.h>
  10. #include <dt-bindings/leds/common.h>
  11. #include "mt7622.dtsi"
  12. #include "mt6380.dtsi"
  13. / {
  14. model = "Bananapi BPI-R64";
  15. chassis-type = "embedded";
  16. compatible = "bananapi,bpi-r64", "mediatek,mt7622";
  17. aliases {
  18. serial0 = &uart0;
  19. };
  20. chosen {
  21. stdout-path = "serial0:115200n8";
  22. bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512";
  23. };
  24. cpus {
  25. cpu@0 {
  26. proc-supply = <&mt6380_vcpu_reg>;
  27. sram-supply = <&mt6380_vm_reg>;
  28. };
  29. cpu@1 {
  30. proc-supply = <&mt6380_vcpu_reg>;
  31. sram-supply = <&mt6380_vm_reg>;
  32. };
  33. };
  34. gpio-keys {
  35. compatible = "gpio-keys";
  36. factory-key {
  37. label = "factory";
  38. linux,code = <BTN_0>;
  39. gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
  40. };
  41. wps-key {
  42. label = "wps";
  43. linux,code = <KEY_WPS_BUTTON>;
  44. gpios = <&pio 102 GPIO_ACTIVE_LOW>;
  45. };
  46. };
  47. leds {
  48. compatible = "gpio-leds";
  49. led-0 {
  50. label = "bpi-r64:pio:green";
  51. color = <LED_COLOR_ID_GREEN>;
  52. gpios = <&pio 89 GPIO_ACTIVE_HIGH>;
  53. default-state = "off";
  54. };
  55. led-1 {
  56. label = "bpi-r64:pio:red";
  57. color = <LED_COLOR_ID_RED>;
  58. gpios = <&pio 88 GPIO_ACTIVE_HIGH>;
  59. default-state = "off";
  60. };
  61. };
  62. memory@40000000 {
  63. reg = <0 0x40000000 0 0x40000000>;
  64. device_type = "memory";
  65. };
  66. reg_1p8v: regulator-1p8v {
  67. compatible = "regulator-fixed";
  68. regulator-name = "fixed-1.8V";
  69. regulator-min-microvolt = <1800000>;
  70. regulator-max-microvolt = <1800000>;
  71. regulator-always-on;
  72. };
  73. reg_3p3v: regulator-3p3v {
  74. compatible = "regulator-fixed";
  75. regulator-name = "fixed-3.3V";
  76. regulator-min-microvolt = <3300000>;
  77. regulator-max-microvolt = <3300000>;
  78. regulator-boot-on;
  79. regulator-always-on;
  80. };
  81. reg_5v: regulator-5v {
  82. compatible = "regulator-fixed";
  83. regulator-name = "fixed-5V";
  84. regulator-min-microvolt = <5000000>;
  85. regulator-max-microvolt = <5000000>;
  86. regulator-boot-on;
  87. regulator-always-on;
  88. };
  89. };
  90. &bch {
  91. status = "disabled";
  92. };
  93. &btif {
  94. status = "okay";
  95. };
  96. &cir {
  97. pinctrl-names = "default";
  98. pinctrl-0 = <&irrx_pins>;
  99. status = "okay";
  100. };
  101. &eth {
  102. status = "okay";
  103. gmac0: mac@0 {
  104. compatible = "mediatek,eth-mac";
  105. reg = <0>;
  106. phy-mode = "2500base-x";
  107. fixed-link {
  108. speed = <2500>;
  109. full-duplex;
  110. pause;
  111. };
  112. };
  113. gmac1: mac@1 {
  114. compatible = "mediatek,eth-mac";
  115. reg = <1>;
  116. phy-mode = "rgmii";
  117. fixed-link {
  118. speed = <1000>;
  119. full-duplex;
  120. pause;
  121. };
  122. };
  123. mdio: mdio-bus {
  124. #address-cells = <1>;
  125. #size-cells = <0>;
  126. switch@1f {
  127. compatible = "mediatek,mt7531";
  128. reg = <0x1f>;
  129. interrupt-controller;
  130. #interrupt-cells = <1>;
  131. interrupts-extended = <&pio 53 IRQ_TYPE_LEVEL_HIGH>;
  132. reset-gpios = <&pio 54 0>;
  133. ports {
  134. #address-cells = <1>;
  135. #size-cells = <0>;
  136. port@0 {
  137. reg = <0>;
  138. label = "wan";
  139. };
  140. port@1 {
  141. reg = <1>;
  142. label = "lan0";
  143. };
  144. port@2 {
  145. reg = <2>;
  146. label = "lan1";
  147. };
  148. port@3 {
  149. reg = <3>;
  150. label = "lan2";
  151. };
  152. port@4 {
  153. reg = <4>;
  154. label = "lan3";
  155. };
  156. port@5 {
  157. reg = <5>;
  158. ethernet = <&gmac1>;
  159. phy-mode = "rgmii";
  160. fixed-link {
  161. speed = <1000>;
  162. full-duplex;
  163. pause;
  164. };
  165. };
  166. port@6 {
  167. reg = <6>;
  168. label = "cpu";
  169. ethernet = <&gmac0>;
  170. phy-mode = "2500base-x";
  171. fixed-link {
  172. speed = <2500>;
  173. full-duplex;
  174. pause;
  175. };
  176. };
  177. };
  178. };
  179. };
  180. };
  181. &i2c1 {
  182. pinctrl-names = "default";
  183. pinctrl-0 = <&i2c1_pins>;
  184. status = "okay";
  185. };
  186. &i2c2 {
  187. pinctrl-names = "default";
  188. pinctrl-0 = <&i2c2_pins>;
  189. status = "okay";
  190. };
  191. &mmc0 {
  192. pinctrl-names = "default", "state_uhs";
  193. pinctrl-0 = <&emmc_pins_default>;
  194. pinctrl-1 = <&emmc_pins_uhs>;
  195. status = "okay";
  196. bus-width = <8>;
  197. max-frequency = <50000000>;
  198. cap-mmc-highspeed;
  199. mmc-hs200-1_8v;
  200. vmmc-supply = <&reg_3p3v>;
  201. vqmmc-supply = <&reg_1p8v>;
  202. assigned-clocks = <&topckgen CLK_TOP_MSDC30_0_SEL>;
  203. assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>;
  204. non-removable;
  205. };
  206. &mmc1 {
  207. pinctrl-names = "default", "state_uhs";
  208. pinctrl-0 = <&sd0_pins_default>;
  209. pinctrl-1 = <&sd0_pins_uhs>;
  210. status = "okay";
  211. bus-width = <4>;
  212. max-frequency = <50000000>;
  213. cap-sd-highspeed;
  214. cd-gpios = <&pio 81 GPIO_ACTIVE_LOW>;
  215. vmmc-supply = <&reg_3p3v>;
  216. vqmmc-supply = <&reg_3p3v>;
  217. assigned-clocks = <&topckgen CLK_TOP_MSDC30_1_SEL>;
  218. assigned-clock-parents = <&topckgen CLK_TOP_UNIV48M>;
  219. };
  220. &nandc {
  221. pinctrl-names = "default";
  222. pinctrl-0 = <&parallel_nand_pins>;
  223. status = "disabled";
  224. };
  225. &bch {
  226. status = "okay";
  227. };
  228. &snfi {
  229. pinctrl-names = "default";
  230. pinctrl-0 = <&serial_nand_pins>;
  231. status = "okay";
  232. flash@0 {
  233. compatible = "spi-nand";
  234. reg = <0>;
  235. spi-tx-bus-width = <4>;
  236. spi-rx-bus-width = <4>;
  237. nand-ecc-engine = <&snfi>;
  238. partitions {
  239. compatible = "fixed-partitions";
  240. #address-cells = <1>;
  241. #size-cells = <1>;
  242. partition@0 {
  243. label = "bl2";
  244. reg = <0x0 0x80000>;
  245. read-only;
  246. };
  247. partition@80000 {
  248. label = "fip";
  249. reg = <0x80000 0x200000>;
  250. read-only;
  251. };
  252. ubi: partition@280000 {
  253. label = "ubi";
  254. reg = <0x280000 0x7d80000>;
  255. };
  256. };
  257. };
  258. };
  259. &pcie0 {
  260. pinctrl-names = "default";
  261. pinctrl-0 = <&pcie0_pins>;
  262. status = "okay";
  263. };
  264. &pcie1 {
  265. pinctrl-names = "default";
  266. pinctrl-0 = <&pcie1_pins>;
  267. status = "okay";
  268. };
  269. &pio {
  270. /* Attention: GPIO 90 is used to switch between PCIe@1,0 and
  271. * SATA functions. i.e. output-high: PCIe, output-low: SATA
  272. */
  273. asm_sel {
  274. gpio-hog;
  275. gpios = <90 GPIO_ACTIVE_HIGH>;
  276. output-high;
  277. };
  278. /* eMMC is shared pin with parallel NAND */
  279. emmc_pins_default: emmc-pins-default {
  280. mux {
  281. function = "emmc";
  282. groups = "emmc", "emmc_rst";
  283. };
  284. /* "NDL0","NDL1","NDL2","NDL3","NDL4","NDL5","NDL6","NDL7",
  285. * "NRB","NCLE" pins are used as DAT0,DAT1,DAT2,DAT3,DAT4,
  286. * DAT5,DAT6,DAT7,CMD,CLK for eMMC respectively
  287. */
  288. conf-cmd-dat {
  289. pins = "NDL0", "NDL1", "NDL2",
  290. "NDL3", "NDL4", "NDL5",
  291. "NDL6", "NDL7", "NRB";
  292. input-enable;
  293. bias-pull-up;
  294. };
  295. conf-clk {
  296. pins = "NCLE";
  297. bias-pull-down;
  298. };
  299. };
  300. emmc_pins_uhs: emmc-pins-uhs {
  301. mux {
  302. function = "emmc";
  303. groups = "emmc";
  304. };
  305. conf-cmd-dat {
  306. pins = "NDL0", "NDL1", "NDL2",
  307. "NDL3", "NDL4", "NDL5",
  308. "NDL6", "NDL7", "NRB";
  309. input-enable;
  310. drive-strength = <4>;
  311. bias-pull-up;
  312. };
  313. conf-clk {
  314. pins = "NCLE";
  315. drive-strength = <4>;
  316. bias-pull-down;
  317. };
  318. };
  319. eth_pins: eth-pins {
  320. mux {
  321. function = "eth";
  322. groups = "mdc_mdio", "rgmii_via_gmac2";
  323. };
  324. };
  325. i2c1_pins: i2c1-pins {
  326. mux {
  327. function = "i2c";
  328. groups = "i2c1_0";
  329. };
  330. };
  331. i2c2_pins: i2c2-pins {
  332. mux {
  333. function = "i2c";
  334. groups = "i2c2_0";
  335. };
  336. };
  337. i2s1_pins: i2s1-pins {
  338. mux {
  339. function = "i2s";
  340. groups = "i2s_out_mclk_bclk_ws",
  341. "i2s1_in_data",
  342. "i2s1_out_data";
  343. };
  344. conf {
  345. pins = "I2S1_IN", "I2S1_OUT", "I2S_BCLK",
  346. "I2S_WS", "I2S_MCLK";
  347. drive-strength = <12>;
  348. bias-pull-down;
  349. };
  350. };
  351. irrx_pins: irrx-pins {
  352. mux {
  353. function = "ir";
  354. groups = "ir_1_rx";
  355. };
  356. };
  357. irtx_pins: irtx-pins {
  358. mux {
  359. function = "ir";
  360. groups = "ir_1_tx";
  361. };
  362. };
  363. /* Parallel nand is shared pin with eMMC */
  364. parallel_nand_pins: parallel-nand-pins {
  365. mux {
  366. function = "flash";
  367. groups = "par_nand";
  368. };
  369. };
  370. pcie0_pins: pcie0-pins {
  371. mux {
  372. function = "pcie";
  373. groups = "pcie0_pad_perst",
  374. "pcie0_1_waken",
  375. "pcie0_1_clkreq";
  376. };
  377. };
  378. pcie1_pins: pcie1-pins {
  379. mux {
  380. function = "pcie";
  381. groups = "pcie1_pad_perst",
  382. "pcie1_0_waken",
  383. "pcie1_0_clkreq";
  384. };
  385. };
  386. pmic_bus_pins: pmic-bus-pins {
  387. mux {
  388. function = "pmic";
  389. groups = "pmic_bus";
  390. };
  391. };
  392. pwm_pins: pwm-pins {
  393. mux {
  394. function = "pwm";
  395. groups = "pwm_ch1_0", /* mt7622_pwm_ch1_0_pins[] = { 51, }; */
  396. "pwm_ch2_0", /* mt7622_pwm_ch2_0_pins[] = { 52, }; */
  397. "pwm_ch3_2", /* mt7622_pwm_ch3_2_pins[] = { 97, }; */
  398. "pwm_ch4_1", /* mt7622_pwm_ch4_1_pins[] = { 67, }; */
  399. "pwm_ch5_0", /* mt7622_pwm_ch5_0_pins[] = { 68, }; */
  400. "pwm_ch6_0"; /* mt7622_pwm_ch6_0_pins[] = { 69, }; */
  401. };
  402. };
  403. wled_pins: wled-pins {
  404. mux {
  405. function = "led";
  406. groups = "wled";
  407. };
  408. };
  409. sd0_pins_default: sd0-pins-default {
  410. mux {
  411. function = "sd";
  412. groups = "sd_0";
  413. };
  414. /* "I2S2_OUT, "I2S4_IN"", "I2S3_IN", "I2S2_IN",
  415. * "I2S4_OUT", "I2S3_OUT" are used as DAT0, DAT1,
  416. * DAT2, DAT3, CMD, CLK for SD respectively.
  417. */
  418. conf-cmd-data {
  419. pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN",
  420. "I2S2_IN","I2S4_OUT";
  421. input-enable;
  422. drive-strength = <8>;
  423. bias-pull-up;
  424. };
  425. conf-clk {
  426. pins = "I2S3_OUT";
  427. drive-strength = <12>;
  428. bias-pull-down;
  429. };
  430. conf-cd {
  431. pins = "TXD3";
  432. bias-pull-up;
  433. };
  434. };
  435. sd0_pins_uhs: sd0-pins-uhs {
  436. mux {
  437. function = "sd";
  438. groups = "sd_0";
  439. };
  440. conf-cmd-data {
  441. pins = "I2S2_OUT", "I2S4_IN", "I2S3_IN",
  442. "I2S2_IN","I2S4_OUT";
  443. input-enable;
  444. bias-pull-up;
  445. };
  446. conf-clk {
  447. pins = "I2S3_OUT";
  448. bias-pull-down;
  449. };
  450. };
  451. /* Serial NAND is shared pin with SPI-NOR */
  452. serial_nand_pins: serial-nand-pins {
  453. mux {
  454. function = "flash";
  455. groups = "snfi";
  456. };
  457. };
  458. spic0_pins: spic0-pins {
  459. mux {
  460. function = "spi";
  461. groups = "spic0_0";
  462. };
  463. };
  464. spic1_pins: spic1-pins {
  465. mux {
  466. function = "spi";
  467. groups = "spic1_0";
  468. };
  469. };
  470. /* SPI-NOR is shared pin with serial NAND */
  471. spi_nor_pins: spi-nor-pins {
  472. mux {
  473. function = "flash";
  474. groups = "spi_nor";
  475. };
  476. };
  477. /* serial NAND is shared pin with SPI-NOR */
  478. serial_nand_pins: serial-nand-pins {
  479. mux {
  480. function = "flash";
  481. groups = "snfi";
  482. };
  483. };
  484. uart0_pins: uart0-pins {
  485. mux {
  486. function = "uart";
  487. groups = "uart0_0_tx_rx" ;
  488. };
  489. };
  490. uart2_pins: uart2-pins {
  491. mux {
  492. function = "uart";
  493. groups = "uart2_1_tx_rx" ;
  494. };
  495. };
  496. watchdog_pins: watchdog-pins {
  497. mux {
  498. function = "watchdog";
  499. groups = "watchdog";
  500. };
  501. };
  502. };
  503. &pwm {
  504. pinctrl-names = "default";
  505. pinctrl-0 = <&pwm_pins>;
  506. status = "okay";
  507. };
  508. &pwrap {
  509. pinctrl-names = "default";
  510. pinctrl-0 = <&pmic_bus_pins>;
  511. status = "okay";
  512. };
  513. &sata {
  514. status = "disabled";
  515. };
  516. &sata_phy {
  517. status = "disabled";
  518. };
  519. &spi0 {
  520. pinctrl-names = "default";
  521. pinctrl-0 = <&spic0_pins>;
  522. status = "okay";
  523. };
  524. &spi1 {
  525. pinctrl-names = "default";
  526. pinctrl-0 = <&spic1_pins>;
  527. };
  528. &ssusb {
  529. vusb33-supply = <&reg_3p3v>;
  530. vbus-supply = <&reg_5v>;
  531. status = "okay";
  532. };
  533. &u3phy {
  534. status = "okay";
  535. };
  536. &uart0 {
  537. pinctrl-names = "default";
  538. pinctrl-0 = <&uart0_pins>;
  539. status = "okay";
  540. };
  541. &uart2 {
  542. pinctrl-names = "default";
  543. pinctrl-0 = <&uart2_pins>;
  544. };
  545. &watchdog {
  546. pinctrl-names = "default";
  547. pinctrl-0 = <&watchdog_pins>;
  548. status = "okay";
  549. };
  550. &wmac {
  551. status = "okay";
  552. };