mt7622-bananapi-bpi-r64.dts 8.7 KB

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