rk3399-firefly.dts 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /*
  2. * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. /dts-v1/;
  7. #include <dt-bindings/pwm/pwm.h>
  8. #include <dt-bindings/pinctrl/rockchip.h>
  9. #include "rk3399.dtsi"
  10. #include "rk3399-sdram-ddr3-1333.dtsi"
  11. / {
  12. model = "Firefly-RK3399 Board";
  13. compatible = "firefly,firefly-rk3399", "rockchip,rk3399";
  14. chosen {
  15. stdout-path = &uart2;
  16. u-boot,spl-boot-order = &sdhci, &sdmmc;
  17. };
  18. backlight: backlight {
  19. compatible = "pwm-backlight";
  20. enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
  21. pwms = <&pwm0 0 25000 0>;
  22. brightness-levels = <
  23. 0 1 2 3 4 5 6 7
  24. 8 9 10 11 12 13 14 15
  25. 16 17 18 19 20 21 22 23
  26. 24 25 26 27 28 29 30 31
  27. 32 33 34 35 36 37 38 39
  28. 40 41 42 43 44 45 46 47
  29. 48 49 50 51 52 53 54 55
  30. 56 57 58 59 60 61 62 63
  31. 64 65 66 67 68 69 70 71
  32. 72 73 74 75 76 77 78 79
  33. 80 81 82 83 84 85 86 87
  34. 88 89 90 91 92 93 94 95
  35. 96 97 98 99 100 101 102 103
  36. 104 105 106 107 108 109 110 111
  37. 112 113 114 115 116 117 118 119
  38. 120 121 122 123 124 125 126 127
  39. 128 129 130 131 132 133 134 135
  40. 136 137 138 139 140 141 142 143
  41. 144 145 146 147 148 149 150 151
  42. 152 153 154 155 156 157 158 159
  43. 160 161 162 163 164 165 166 167
  44. 168 169 170 171 172 173 174 175
  45. 176 177 178 179 180 181 182 183
  46. 184 185 186 187 188 189 190 191
  47. 192 193 194 195 196 197 198 199
  48. 200 201 202 203 204 205 206 207
  49. 208 209 210 211 212 213 214 215
  50. 216 217 218 219 220 221 222 223
  51. 224 225 226 227 228 229 230 231
  52. 232 233 234 235 236 237 238 239
  53. 240 241 242 243 244 245 246 247
  54. 248 249 250 251 252 253 254 255>;
  55. default-brightness-level = <200>;
  56. };
  57. clkin_gmac: external-gmac-clock {
  58. compatible = "fixed-clock";
  59. clock-frequency = <125000000>;
  60. clock-output-names = "clkin_gmac";
  61. #clock-cells = <0>;
  62. };
  63. rt5640-sound {
  64. compatible = "simple-audio-card";
  65. simple-audio-card,name = "rockchip,rt5640-codec";
  66. simple-audio-card,format = "i2s";
  67. simple-audio-card,mclk-fs = <256>;
  68. simple-audio-card,widgets =
  69. "Microphone", "Mic Jack",
  70. "Headphone", "Headphone Jack";
  71. simple-audio-card,routing =
  72. "Mic Jack", "MICBIAS1",
  73. "IN1P", "Mic Jack",
  74. "Headphone Jack", "HPOL",
  75. "Headphone Jack", "HPOR";
  76. simple-audio-card,cpu {
  77. sound-dai = <&i2s1>;
  78. };
  79. simple-audio-card,codec {
  80. sound-dai = <&rt5640>;
  81. };
  82. };
  83. sdio_pwrseq: sdio-pwrseq {
  84. compatible = "mmc-pwrseq-simple";
  85. clocks = <&rk808 1>;
  86. clock-names = "ext_clock";
  87. pinctrl-names = "default";
  88. pinctrl-0 = <&wifi_enable_h>;
  89. /*
  90. * On the module itself this is one of these (depending
  91. * on the actual card populated):
  92. * - SDIO_RESET_L_WL_REG_ON
  93. * - PDN (power down when low)
  94. */
  95. reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
  96. };
  97. vcc3v3_pcie: vcc3v3-pcie-regulator {
  98. compatible = "regulator-fixed";
  99. enable-active-high;
  100. gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
  101. pinctrl-names = "default";
  102. pinctrl-0 = <&pcie_drv>;
  103. regulator-name = "vcc3v3_pcie";
  104. regulator-always-on;
  105. regulator-boot-on;
  106. };
  107. vcc3v3_sys: vcc3v3-sys {
  108. compatible = "regulator-fixed";
  109. regulator-name = "vcc3v3_sys";
  110. regulator-always-on;
  111. regulator-boot-on;
  112. regulator-min-microvolt = <3300000>;
  113. regulator-max-microvolt = <3300000>;
  114. };
  115. vcc5v0_host: vcc5v0-host-regulator {
  116. compatible = "regulator-fixed";
  117. enable-active-high;
  118. gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
  119. pinctrl-names = "default";
  120. pinctrl-0 = <&host_vbus_drv>;
  121. regulator-name = "vcc5v0_host";
  122. regulator-always-on;
  123. };
  124. vcc5v0_sys: vcc5v0-sys {
  125. compatible = "regulator-fixed";
  126. regulator-name = "vcc5v0_sys";
  127. regulator-always-on;
  128. regulator-boot-on;
  129. regulator-min-microvolt = <5000000>;
  130. regulator-max-microvolt = <5000000>;
  131. };
  132. vcc_phy: vcc-phy-regulator {
  133. compatible = "regulator-fixed";
  134. regulator-name = "vcc_phy";
  135. regulator-always-on;
  136. regulator-boot-on;
  137. };
  138. vdd_log: vdd-log {
  139. compatible = "pwm-regulator";
  140. pwms = <&pwm2 0 25000 1>;
  141. regulator-name = "vdd_log";
  142. regulator-always-on;
  143. regulator-boot-on;
  144. regulator-min-microvolt = <800000>;
  145. regulator-max-microvolt = <1400000>;
  146. };
  147. vccadc_ref: vccadc-ref {
  148. compatible = "regulator-fixed";
  149. regulator-name = "vcc1v8_sys";
  150. regulator-always-on;
  151. regulator-boot-on;
  152. regulator-min-microvolt = <1800000>;
  153. regulator-max-microvolt = <1800000>;
  154. };
  155. };
  156. &cpu_l0 {
  157. cpu-supply = <&vdd_cpu_l>;
  158. };
  159. &cpu_l1 {
  160. cpu-supply = <&vdd_cpu_l>;
  161. };
  162. &cpu_l2 {
  163. cpu-supply = <&vdd_cpu_l>;
  164. };
  165. &cpu_l3 {
  166. cpu-supply = <&vdd_cpu_l>;
  167. };
  168. &cpu_b0 {
  169. cpu-supply = <&vdd_cpu_b>;
  170. };
  171. &cpu_b1 {
  172. cpu-supply = <&vdd_cpu_b>;
  173. };
  174. &emmc_phy {
  175. status = "okay";
  176. };
  177. &gmac {
  178. assigned-clocks = <&cru SCLK_RMII_SRC>;
  179. assigned-clock-parents = <&clkin_gmac>;
  180. clock_in_out = "input";
  181. phy-supply = <&vcc_phy>;
  182. phy-mode = "rgmii";
  183. pinctrl-names = "default";
  184. pinctrl-0 = <&rgmii_pins>;
  185. snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
  186. snps,reset-active-low;
  187. snps,reset-delays-us = <0 10000 50000>;
  188. tx_delay = <0x28>;
  189. rx_delay = <0x11>;
  190. status = "okay";
  191. };
  192. &i2c0 {
  193. clock-frequency = <400000>;
  194. i2c-scl-rising-time-ns = <168>;
  195. i2c-scl-falling-time-ns = <4>;
  196. status = "okay";
  197. rk808: pmic@1b {
  198. compatible = "rockchip,rk808";
  199. reg = <0x1b>;
  200. interrupt-parent = <&gpio1>;
  201. interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
  202. #clock-cells = <1>;
  203. clock-output-names = "xin32k", "rk808-clkout2";
  204. pinctrl-names = "default";
  205. pinctrl-0 = <&pmic_int_l>;
  206. rockchip,system-power-controller;
  207. wakeup-source;
  208. vcc1-supply = <&vcc3v3_sys>;
  209. vcc2-supply = <&vcc3v3_sys>;
  210. vcc3-supply = <&vcc3v3_sys>;
  211. vcc4-supply = <&vcc3v3_sys>;
  212. vcc6-supply = <&vcc3v3_sys>;
  213. vcc7-supply = <&vcc3v3_sys>;
  214. vcc8-supply = <&vcc3v3_sys>;
  215. vcc9-supply = <&vcc3v3_sys>;
  216. vcc10-supply = <&vcc3v3_sys>;
  217. vcc11-supply = <&vcc3v3_sys>;
  218. vcc12-supply = <&vcc3v3_sys>;
  219. vddio-supply = <&vcc1v8_pmu>;
  220. regulators {
  221. vdd_center: DCDC_REG1 {
  222. regulator-name = "vdd_center";
  223. regulator-always-on;
  224. regulator-boot-on;
  225. regulator-min-microvolt = <750000>;
  226. regulator-max-microvolt = <1350000>;
  227. regulator-ramp-delay = <6001>;
  228. regulator-state-mem {
  229. regulator-off-in-suspend;
  230. };
  231. };
  232. vdd_cpu_l: DCDC_REG2 {
  233. regulator-name = "vdd_cpu_l";
  234. regulator-always-on;
  235. regulator-boot-on;
  236. regulator-min-microvolt = <750000>;
  237. regulator-max-microvolt = <1350000>;
  238. regulator-ramp-delay = <6001>;
  239. regulator-state-mem {
  240. regulator-off-in-suspend;
  241. };
  242. };
  243. vcc_ddr: DCDC_REG3 {
  244. regulator-name = "vcc_ddr";
  245. regulator-always-on;
  246. regulator-boot-on;
  247. regulator-state-mem {
  248. regulator-on-in-suspend;
  249. };
  250. };
  251. vcc_1v8: DCDC_REG4 {
  252. regulator-name = "vcc_1v8";
  253. regulator-always-on;
  254. regulator-boot-on;
  255. regulator-min-microvolt = <1800000>;
  256. regulator-max-microvolt = <1800000>;
  257. regulator-state-mem {
  258. regulator-on-in-suspend;
  259. regulator-suspend-microvolt = <1800000>;
  260. };
  261. };
  262. vcc1v8_dvp: LDO_REG1 {
  263. regulator-name = "vcc1v8_dvp";
  264. regulator-always-on;
  265. regulator-boot-on;
  266. regulator-min-microvolt = <1800000>;
  267. regulator-max-microvolt = <1800000>;
  268. regulator-state-mem {
  269. regulator-off-in-suspend;
  270. };
  271. };
  272. vcc3v0_tp: LDO_REG2 {
  273. regulator-name = "vcc3v0_tp";
  274. regulator-always-on;
  275. regulator-boot-on;
  276. regulator-min-microvolt = <3000000>;
  277. regulator-max-microvolt = <3000000>;
  278. regulator-state-mem {
  279. regulator-off-in-suspend;
  280. };
  281. };
  282. vcc1v8_pmu: LDO_REG3 {
  283. regulator-name = "vcc1v8_pmu";
  284. regulator-always-on;
  285. regulator-boot-on;
  286. regulator-min-microvolt = <1800000>;
  287. regulator-max-microvolt = <1800000>;
  288. regulator-state-mem {
  289. regulator-on-in-suspend;
  290. regulator-suspend-microvolt = <1800000>;
  291. };
  292. };
  293. vcc_sd: LDO_REG4 {
  294. regulator-name = "vcc_sd";
  295. regulator-always-on;
  296. regulator-boot-on;
  297. regulator-min-microvolt = <1800000>;
  298. regulator-max-microvolt = <3300000>;
  299. regulator-state-mem {
  300. regulator-on-in-suspend;
  301. regulator-suspend-microvolt = <3300000>;
  302. };
  303. };
  304. vcca3v0_codec: LDO_REG5 {
  305. regulator-name = "vcca3v0_codec";
  306. regulator-always-on;
  307. regulator-boot-on;
  308. regulator-min-microvolt = <3000000>;
  309. regulator-max-microvolt = <3000000>;
  310. regulator-state-mem {
  311. regulator-off-in-suspend;
  312. };
  313. };
  314. vcc_1v5: LDO_REG6 {
  315. regulator-name = "vcc_1v5";
  316. regulator-always-on;
  317. regulator-boot-on;
  318. regulator-min-microvolt = <1500000>;
  319. regulator-max-microvolt = <1500000>;
  320. regulator-state-mem {
  321. regulator-on-in-suspend;
  322. regulator-suspend-microvolt = <1500000>;
  323. };
  324. };
  325. vcca1v8_codec: LDO_REG7 {
  326. regulator-name = "vcca1v8_codec";
  327. regulator-always-on;
  328. regulator-boot-on;
  329. regulator-min-microvolt = <1800000>;
  330. regulator-max-microvolt = <1800000>;
  331. regulator-state-mem {
  332. regulator-off-in-suspend;
  333. };
  334. };
  335. vcc_3v0: LDO_REG8 {
  336. regulator-name = "vcc_3v0";
  337. regulator-always-on;
  338. regulator-boot-on;
  339. regulator-min-microvolt = <3000000>;
  340. regulator-max-microvolt = <3000000>;
  341. regulator-state-mem {
  342. regulator-on-in-suspend;
  343. regulator-suspend-microvolt = <3000000>;
  344. };
  345. };
  346. vcc3v3_s3: SWITCH_REG1 {
  347. regulator-name = "vcc3v3_s3";
  348. regulator-always-on;
  349. regulator-boot-on;
  350. regulator-state-mem {
  351. regulator-off-in-suspend;
  352. };
  353. };
  354. vcc3v3_s0: SWITCH_REG2 {
  355. regulator-name = "vcc3v3_s0";
  356. regulator-always-on;
  357. regulator-boot-on;
  358. regulator-state-mem {
  359. regulator-off-in-suspend;
  360. };
  361. };
  362. };
  363. };
  364. vdd_cpu_b: regulator@40 {
  365. compatible = "silergy,syr827";
  366. reg = <0x40>;
  367. fcs,suspend-voltage-selector = <0>;
  368. regulator-name = "vdd_cpu_b";
  369. regulator-min-microvolt = <712500>;
  370. regulator-max-microvolt = <1500000>;
  371. regulator-ramp-delay = <1000>;
  372. regulator-always-on;
  373. regulator-boot-on;
  374. vin-supply = <&vcc5v0_sys>;
  375. regulator-state-mem {
  376. regulator-off-in-suspend;
  377. };
  378. };
  379. vdd_gpu: regulator@41 {
  380. compatible = "silergy,syr828";
  381. reg = <0x41>;
  382. fcs,suspend-voltage-selector = <1>;
  383. regulator-name = "vdd_gpu";
  384. regulator-min-microvolt = <712500>;
  385. regulator-max-microvolt = <1500000>;
  386. regulator-ramp-delay = <1000>;
  387. regulator-always-on;
  388. regulator-boot-on;
  389. vin-supply = <&vcc5v0_sys>;
  390. regulator-state-mem {
  391. regulator-off-in-suspend;
  392. };
  393. };
  394. };
  395. &i2c1 {
  396. i2c-scl-rising-time-ns = <300>;
  397. i2c-scl-falling-time-ns = <15>;
  398. status = "okay";
  399. rt5640: rt5640@1c {
  400. compatible = "realtek,rt5640";
  401. reg = <0x1c>;
  402. clocks = <&cru SCLK_I2S_8CH_OUT>;
  403. clock-names = "mclk";
  404. realtek,in1-differential;
  405. #sound-dai-cells = <0>;
  406. pinctrl-names = "default";
  407. pinctrl-0 = <&rt5640_hpcon>;
  408. };
  409. };
  410. &i2c3 {
  411. i2c-scl-rising-time-ns = <450>;
  412. i2c-scl-falling-time-ns = <15>;
  413. status = "okay";
  414. };
  415. &i2c4 {
  416. i2c-scl-rising-time-ns = <600>;
  417. i2c-scl-falling-time-ns = <20>;
  418. status = "okay";
  419. accelerometer@68 {
  420. compatible = "invensense,mpu6500";
  421. reg = <0x68>;
  422. interrupt-parent = <&gpio1>;
  423. interrupts = <RK_PC6 IRQ_TYPE_EDGE_RISING>;
  424. };
  425. };
  426. &i2s0 {
  427. rockchip,playback-channels = <8>;
  428. rockchip,capture-channels = <8>;
  429. #sound-dai-cells = <0>;
  430. status = "okay";
  431. };
  432. &i2s1 {
  433. rockchip,playback-channels = <2>;
  434. rockchip,capture-channels = <2>;
  435. #sound-dai-cells = <0>;
  436. status = "okay";
  437. };
  438. &i2s2 {
  439. #sound-dai-cells = <0>;
  440. status = "okay";
  441. };
  442. &io_domains {
  443. status = "okay";
  444. bt656-supply = <&vcc1v8_dvp>;
  445. audio-supply = <&vcca1v8_codec>;
  446. sdmmc-supply = <&vcc_sd>;
  447. gpio1830-supply = <&vcc_3v0>;
  448. };
  449. &pcie_phy {
  450. status = "okay";
  451. };
  452. &pcie0 {
  453. ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
  454. num-lanes = <4>;
  455. pinctrl-names = "default";
  456. pinctrl-0 = <&pcie_clkreqn>;
  457. status = "okay";
  458. };
  459. &pmu_io_domains {
  460. pmu1830-supply = <&vcc_3v0>;
  461. status = "okay";
  462. };
  463. &pinctrl {
  464. buttons {
  465. pwrbtn: pwrbtn {
  466. rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
  467. };
  468. };
  469. lcd-panel {
  470. lcd_panel_reset: lcd-panel-reset {
  471. rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
  472. };
  473. };
  474. pcie {
  475. pcie_drv: pcie-drv {
  476. rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
  477. };
  478. pcie_3g_drv: pcie-3g-drv {
  479. rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
  480. };
  481. };
  482. pmic {
  483. vsel1_gpio: vsel1-gpio {
  484. rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
  485. };
  486. vsel2_gpio: vsel2-gpio {
  487. rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
  488. };
  489. };
  490. sdio-pwrseq {
  491. wifi_enable_h: wifi-enable-h {
  492. rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
  493. };
  494. };
  495. rt5640 {
  496. rt5640_hpcon: rt5640-hpcon {
  497. rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
  498. };
  499. };
  500. pmic {
  501. pmic_int_l: pmic-int-l {
  502. rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
  503. };
  504. };
  505. usb2 {
  506. host_vbus_drv: host-vbus-drv {
  507. rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
  508. };
  509. };
  510. };
  511. &pwm0 {
  512. status = "okay";
  513. };
  514. &pwm2 {
  515. status = "okay";
  516. };
  517. &saradc {
  518. vref-supply = <&vccadc_ref>;
  519. status = "okay";
  520. };
  521. &sdmmc {
  522. u-boot,dm-pre-reloc;
  523. bus-width = <4>;
  524. status = "okay";
  525. };
  526. &sdhci {
  527. bus-width = <8>;
  528. keep-power-in-suspend;
  529. mmc-hs400-1_8v;
  530. mmc-hs400-enhanced-strobe;
  531. non-removable;
  532. status = "okay";
  533. };
  534. &tsadc {
  535. /* tshut mode 0:CRU 1:GPIO */
  536. rockchip,hw-tshut-mode = <1>;
  537. /* tshut polarity 0:LOW 1:HIGH */
  538. rockchip,hw-tshut-polarity = <1>;
  539. status = "okay";
  540. };
  541. &u2phy0 {
  542. status = "okay";
  543. u2phy0_otg: otg-port {
  544. status = "okay";
  545. };
  546. u2phy0_host: host-port {
  547. phy-supply = <&vcc5v0_host>;
  548. status = "okay";
  549. };
  550. };
  551. &u2phy1 {
  552. status = "okay";
  553. u2phy1_otg: otg-port {
  554. status = "okay";
  555. };
  556. u2phy1_host: host-port {
  557. phy-supply = <&vcc5v0_host>;
  558. status = "okay";
  559. };
  560. };
  561. &uart0 {
  562. pinctrl-names = "default";
  563. pinctrl-0 = <&uart0_xfer &uart0_cts>;
  564. status = "okay";
  565. };
  566. &uart2 {
  567. status = "okay";
  568. };
  569. &usb_host0_ehci {
  570. status = "okay";
  571. };
  572. &usb_host0_ohci {
  573. status = "okay";
  574. };
  575. &usb_host1_ehci {
  576. status = "okay";
  577. };
  578. &usb_host1_ohci {
  579. status = "okay";
  580. };