mt7622-bananapi-bpi-r64.dts 9.8 KB

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