rk3399-sapphire.dtsi 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
  4. */
  5. #include "dt-bindings/pwm/pwm.h"
  6. #include "dt-bindings/input/input.h"
  7. #include "rk3399.dtsi"
  8. #include "rk3399-opp.dtsi"
  9. / {
  10. compatible = "rockchip,rk3399-sapphire", "rockchip,rk3399";
  11. backlight: backlight {
  12. compatible = "pwm-backlight";
  13. brightness-levels = <
  14. 0 1 2 3 4 5 6 7
  15. 8 9 10 11 12 13 14 15
  16. 16 17 18 19 20 21 22 23
  17. 24 25 26 27 28 29 30 31
  18. 32 33 34 35 36 37 38 39
  19. 40 41 42 43 44 45 46 47
  20. 48 49 50 51 52 53 54 55
  21. 56 57 58 59 60 61 62 63
  22. 64 65 66 67 68 69 70 71
  23. 72 73 74 75 76 77 78 79
  24. 80 81 82 83 84 85 86 87
  25. 88 89 90 91 92 93 94 95
  26. 96 97 98 99 100 101 102 103
  27. 104 105 106 107 108 109 110 111
  28. 112 113 114 115 116 117 118 119
  29. 120 121 122 123 124 125 126 127
  30. 128 129 130 131 132 133 134 135
  31. 136 137 138 139 140 141 142 143
  32. 144 145 146 147 148 149 150 151
  33. 152 153 154 155 156 157 158 159
  34. 160 161 162 163 164 165 166 167
  35. 168 169 170 171 172 173 174 175
  36. 176 177 178 179 180 181 182 183
  37. 184 185 186 187 188 189 190 191
  38. 192 193 194 195 196 197 198 199
  39. 200 201 202 203 204 205 206 207
  40. 208 209 210 211 212 213 214 215
  41. 216 217 218 219 220 221 222 223
  42. 224 225 226 227 228 229 230 231
  43. 232 233 234 235 236 237 238 239
  44. 240 241 242 243 244 245 246 247
  45. 248 249 250 251 252 253 254 255>;
  46. default-brightness-level = <200>;
  47. pwms = <&pwm0 0 25000 0>;
  48. };
  49. clkin_gmac: external-gmac-clock {
  50. compatible = "fixed-clock";
  51. clock-frequency = <125000000>;
  52. clock-output-names = "clkin_gmac";
  53. #clock-cells = <0>;
  54. };
  55. dc_12v: dc-12v {
  56. compatible = "regulator-fixed";
  57. regulator-name = "dc_12v";
  58. regulator-always-on;
  59. regulator-boot-on;
  60. regulator-min-microvolt = <12000000>;
  61. regulator-max-microvolt = <12000000>;
  62. };
  63. keys: gpio-keys {
  64. compatible = "gpio-keys";
  65. autorepeat;
  66. power {
  67. debounce-interval = <100>;
  68. gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
  69. label = "GPIO Power";
  70. linux,code = <KEY_POWER>;
  71. linux,input-type = <1>;
  72. pinctrl-names = "default";
  73. pinctrl-0 = <&pwr_btn>;
  74. wakeup-source;
  75. };
  76. };
  77. /* switched by pmic_sleep */
  78. vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
  79. compatible = "regulator-fixed";
  80. regulator-name = "vcc1v8_s3";
  81. regulator-always-on;
  82. regulator-boot-on;
  83. regulator-min-microvolt = <1800000>;
  84. regulator-max-microvolt = <1800000>;
  85. vin-supply = <&vcc_1v8>;
  86. };
  87. vcc3v0_sd: vcc3v0-sd {
  88. compatible = "regulator-fixed";
  89. enable-active-high;
  90. gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
  91. pinctrl-names = "default";
  92. pinctrl-0 = <&sdmmc0_pwr_h>;
  93. regulator-always-on;
  94. regulator-max-microvolt = <3000000>;
  95. regulator-min-microvolt = <3000000>;
  96. regulator-name = "vcc3v0_sd";
  97. vin-supply = <&vcc3v3_sys>;
  98. };
  99. vcc3v3_sys: vcc3v3-sys {
  100. compatible = "regulator-fixed";
  101. regulator-name = "vcc3v3_sys";
  102. regulator-always-on;
  103. regulator-boot-on;
  104. regulator-min-microvolt = <3300000>;
  105. regulator-max-microvolt = <3300000>;
  106. vin-supply = <&vcc_sys>;
  107. };
  108. vcc_sys: vcc-sys {
  109. compatible = "regulator-fixed";
  110. regulator-name = "vcc_sys";
  111. regulator-always-on;
  112. regulator-boot-on;
  113. regulator-min-microvolt = <5000000>;
  114. regulator-max-microvolt = <5000000>;
  115. vin-supply = <&dc_12v>;
  116. };
  117. vcc5v0_host: vcc5v0-host-regulator {
  118. compatible = "regulator-fixed";
  119. enable-active-high;
  120. gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
  121. pinctrl-names = "default";
  122. pinctrl-0 = <&vcc5v0_host_en>;
  123. regulator-name = "vcc5v0_host";
  124. regulator-always-on;
  125. vin-supply = <&vcc_sys>;
  126. };
  127. vdd_log: vdd-log {
  128. compatible = "pwm-regulator";
  129. pwms = <&pwm2 0 25000 1>;
  130. regulator-name = "vdd_log";
  131. regulator-always-on;
  132. regulator-boot-on;
  133. regulator-min-microvolt = <800000>;
  134. regulator-max-microvolt = <1400000>;
  135. vin-supply = <&vcc_sys>;
  136. };
  137. };
  138. &cpu_l0 {
  139. cpu-supply = <&vdd_cpu_l>;
  140. };
  141. &cpu_l1 {
  142. cpu-supply = <&vdd_cpu_l>;
  143. };
  144. &cpu_l2 {
  145. cpu-supply = <&vdd_cpu_l>;
  146. };
  147. &cpu_l3 {
  148. cpu-supply = <&vdd_cpu_l>;
  149. };
  150. &cpu_b0 {
  151. cpu-supply = <&vdd_cpu_b>;
  152. };
  153. &cpu_b1 {
  154. cpu-supply = <&vdd_cpu_b>;
  155. };
  156. &emmc_phy {
  157. status = "okay";
  158. };
  159. &gmac {
  160. assigned-clocks = <&cru SCLK_RMII_SRC>;
  161. assigned-clock-parents = <&clkin_gmac>;
  162. clock_in_out = "input";
  163. phy-supply = <&vcc_lan>;
  164. phy-mode = "rgmii";
  165. pinctrl-names = "default";
  166. pinctrl-0 = <&rgmii_pins>;
  167. snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
  168. snps,reset-active-low;
  169. snps,reset-delays-us = <0 10000 50000>;
  170. tx_delay = <0x28>;
  171. rx_delay = <0x11>;
  172. status = "okay";
  173. };
  174. &gpu {
  175. mali-supply = <&vdd_gpu>;
  176. status = "okay";
  177. };
  178. &hdmi {
  179. ddc-i2c-bus = <&i2c3>;
  180. status = "okay";
  181. };
  182. &hdmi_sound {
  183. status = "okay";
  184. };
  185. &i2c0 {
  186. clock-frequency = <400000>;
  187. i2c-scl-rising-time-ns = <168>;
  188. i2c-scl-falling-time-ns = <4>;
  189. status = "okay";
  190. rk808: pmic@1b {
  191. compatible = "rockchip,rk808";
  192. reg = <0x1b>;
  193. interrupt-parent = <&gpio1>;
  194. interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
  195. #clock-cells = <1>;
  196. clock-output-names = "xin32k", "rk808-clkout2";
  197. pinctrl-names = "default";
  198. pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
  199. rockchip,system-power-controller;
  200. wakeup-source;
  201. vcc1-supply = <&vcc_sys>;
  202. vcc2-supply = <&vcc_sys>;
  203. vcc3-supply = <&vcc_sys>;
  204. vcc4-supply = <&vcc_sys>;
  205. vcc6-supply = <&vcc_sys>;
  206. vcc7-supply = <&vcc_sys>;
  207. vcc8-supply = <&vcc3v3_sys>;
  208. vcc9-supply = <&vcc_sys>;
  209. vcc10-supply = <&vcc_sys>;
  210. vcc11-supply = <&vcc_sys>;
  211. vcc12-supply = <&vcc3v3_sys>;
  212. vddio-supply = <&vcc1v8_pmu>;
  213. regulators {
  214. vdd_center: DCDC_REG1 {
  215. regulator-name = "vdd_center";
  216. regulator-always-on;
  217. regulator-boot-on;
  218. regulator-min-microvolt = <750000>;
  219. regulator-max-microvolt = <1350000>;
  220. regulator-ramp-delay = <6001>;
  221. regulator-state-mem {
  222. regulator-off-in-suspend;
  223. };
  224. };
  225. vdd_cpu_l: DCDC_REG2 {
  226. regulator-name = "vdd_cpu_l";
  227. regulator-always-on;
  228. regulator-boot-on;
  229. regulator-min-microvolt = <750000>;
  230. regulator-max-microvolt = <1350000>;
  231. regulator-ramp-delay = <6001>;
  232. regulator-state-mem {
  233. regulator-off-in-suspend;
  234. };
  235. };
  236. vcc_ddr: DCDC_REG3 {
  237. regulator-name = "vcc_ddr";
  238. regulator-always-on;
  239. regulator-boot-on;
  240. regulator-state-mem {
  241. regulator-on-in-suspend;
  242. };
  243. };
  244. vcc_1v8: DCDC_REG4 {
  245. regulator-name = "vcc_1v8";
  246. regulator-always-on;
  247. regulator-boot-on;
  248. regulator-min-microvolt = <1800000>;
  249. regulator-max-microvolt = <1800000>;
  250. regulator-state-mem {
  251. regulator-on-in-suspend;
  252. regulator-suspend-microvolt = <1800000>;
  253. };
  254. };
  255. vcc1v8_dvp: LDO_REG1 {
  256. regulator-name = "vcc1v8_dvp";
  257. regulator-always-on;
  258. regulator-boot-on;
  259. regulator-min-microvolt = <1800000>;
  260. regulator-max-microvolt = <1800000>;
  261. regulator-state-mem {
  262. regulator-off-in-suspend;
  263. };
  264. };
  265. vcc3v0_tp: LDO_REG2 {
  266. regulator-name = "vcc3v0_tp";
  267. regulator-always-on;
  268. regulator-boot-on;
  269. regulator-min-microvolt = <3000000>;
  270. regulator-max-microvolt = <3000000>;
  271. regulator-state-mem {
  272. regulator-off-in-suspend;
  273. };
  274. };
  275. vcc1v8_pmu: LDO_REG3 {
  276. regulator-name = "vcc1v8_pmu";
  277. regulator-always-on;
  278. regulator-boot-on;
  279. regulator-min-microvolt = <1800000>;
  280. regulator-max-microvolt = <1800000>;
  281. regulator-state-mem {
  282. regulator-on-in-suspend;
  283. regulator-suspend-microvolt = <1800000>;
  284. };
  285. };
  286. vcc_sdio: LDO_REG4 {
  287. regulator-name = "vcc_sdio";
  288. regulator-always-on;
  289. regulator-boot-on;
  290. regulator-min-microvolt = <1800000>;
  291. regulator-max-microvolt = <3300000>;
  292. regulator-state-mem {
  293. regulator-on-in-suspend;
  294. regulator-suspend-microvolt = <3000000>;
  295. };
  296. };
  297. vcca3v0_codec: LDO_REG5 {
  298. regulator-name = "vcca3v0_codec";
  299. regulator-always-on;
  300. regulator-boot-on;
  301. regulator-min-microvolt = <3000000>;
  302. regulator-max-microvolt = <3000000>;
  303. regulator-state-mem {
  304. regulator-off-in-suspend;
  305. };
  306. };
  307. vcc_1v5: LDO_REG6 {
  308. regulator-name = "vcc_1v5";
  309. regulator-always-on;
  310. regulator-boot-on;
  311. regulator-min-microvolt = <1500000>;
  312. regulator-max-microvolt = <1500000>;
  313. regulator-state-mem {
  314. regulator-on-in-suspend;
  315. regulator-suspend-microvolt = <1500000>;
  316. };
  317. };
  318. vcca1v8_codec: LDO_REG7 {
  319. regulator-name = "vcca1v8_codec";
  320. regulator-always-on;
  321. regulator-boot-on;
  322. regulator-min-microvolt = <1800000>;
  323. regulator-max-microvolt = <1800000>;
  324. regulator-state-mem {
  325. regulator-off-in-suspend;
  326. };
  327. };
  328. vcc_3v0: LDO_REG8 {
  329. regulator-name = "vcc_3v0";
  330. regulator-always-on;
  331. regulator-boot-on;
  332. regulator-min-microvolt = <3000000>;
  333. regulator-max-microvolt = <3000000>;
  334. regulator-state-mem {
  335. regulator-on-in-suspend;
  336. regulator-suspend-microvolt = <3000000>;
  337. };
  338. };
  339. vcc3v3_s3: vcc_lan: SWITCH_REG1 {
  340. regulator-name = "vcc3v3_s3";
  341. regulator-always-on;
  342. regulator-boot-on;
  343. regulator-state-mem {
  344. regulator-off-in-suspend;
  345. };
  346. };
  347. vcc3v3_s0: SWITCH_REG2 {
  348. regulator-name = "vcc3v3_s0";
  349. regulator-always-on;
  350. regulator-boot-on;
  351. regulator-state-mem {
  352. regulator-off-in-suspend;
  353. };
  354. };
  355. };
  356. };
  357. vdd_cpu_b: regulator@40 {
  358. compatible = "silergy,syr827";
  359. reg = <0x40>;
  360. fcs,suspend-voltage-selector = <1>;
  361. regulator-name = "vdd_cpu_b";
  362. regulator-min-microvolt = <712500>;
  363. regulator-max-microvolt = <1500000>;
  364. regulator-ramp-delay = <1000>;
  365. regulator-always-on;
  366. regulator-boot-on;
  367. vin-supply = <&vcc_sys>;
  368. regulator-state-mem {
  369. regulator-off-in-suspend;
  370. };
  371. };
  372. vdd_gpu: regulator@41 {
  373. compatible = "silergy,syr828";
  374. reg = <0x41>;
  375. fcs,suspend-voltage-selector = <1>;
  376. regulator-name = "vdd_gpu";
  377. regulator-min-microvolt = <712500>;
  378. regulator-max-microvolt = <1500000>;
  379. regulator-ramp-delay = <1000>;
  380. regulator-always-on;
  381. regulator-boot-on;
  382. vin-supply = <&vcc_sys>;
  383. regulator-state-mem {
  384. regulator-off-in-suspend;
  385. };
  386. };
  387. };
  388. &i2c3 {
  389. i2c-scl-rising-time-ns = <450>;
  390. i2c-scl-falling-time-ns = <15>;
  391. status = "okay";
  392. };
  393. &i2s2 {
  394. status = "okay";
  395. };
  396. &io_domains {
  397. status = "okay";
  398. bt656-supply = <&vcc_3v0>;
  399. audio-supply = <&vcca1v8_codec>;
  400. sdmmc-supply = <&vcc_sdio>;
  401. gpio1830-supply = <&vcc_3v0>;
  402. };
  403. &pmu_io_domains {
  404. pmu1830-supply = <&vcc_3v0>;
  405. status = "okay";
  406. };
  407. &pinctrl {
  408. buttons {
  409. pwr_btn: pwr-btn {
  410. rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
  411. };
  412. };
  413. pmic {
  414. pmic_int_l: pmic-int-l {
  415. rockchip,pins =
  416. <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
  417. };
  418. pmic_dvs2: pmic-dvs2 {
  419. rockchip,pins =
  420. <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
  421. };
  422. vsel1_gpio: vsel1-gpio {
  423. rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
  424. };
  425. vsel2_gpio: vsel2-gpio {
  426. rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
  427. };
  428. };
  429. sd {
  430. sdmmc0_pwr_h: sdmmc0-pwr-h {
  431. rockchip,pins =
  432. <RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
  433. };
  434. };
  435. usb2 {
  436. vcc5v0_host_en: vcc5v0-host-en {
  437. rockchip,pins =
  438. <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
  439. };
  440. };
  441. };
  442. &pwm0 {
  443. status = "okay";
  444. };
  445. &pwm2 {
  446. status = "okay";
  447. };
  448. &saradc {
  449. vref-supply = <&vcca1v8_s3>;
  450. status = "okay";
  451. };
  452. &sdhci {
  453. bus-width = <8>;
  454. mmc-hs400-1_8v;
  455. mmc-hs400-enhanced-strobe;
  456. non-removable;
  457. status = "okay";
  458. };
  459. &sdmmc {
  460. broken-cd;
  461. bus-width = <4>;
  462. cap-mmc-highspeed;
  463. cap-sd-highspeed;
  464. clock-frequency = <150000000>;
  465. disable-wp;
  466. max-frequency = <150000000>;
  467. pinctrl-names = "default";
  468. pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
  469. vmmc-supply = <&vcc3v0_sd>;
  470. vqmmc-supply = <&vcc_sdio>;
  471. status = "okay";
  472. };
  473. &tcphy0 {
  474. status = "okay";
  475. };
  476. &tcphy1 {
  477. status = "okay";
  478. };
  479. &tsadc {
  480. /* tshut mode 0:CRU 1:GPIO */
  481. rockchip,hw-tshut-mode = <1>;
  482. /* tshut polarity 0:LOW 1:HIGH */
  483. rockchip,hw-tshut-polarity = <1>;
  484. status = "okay";
  485. };
  486. &u2phy0 {
  487. status = "okay";
  488. u2phy0_otg: otg-port {
  489. status = "okay";
  490. };
  491. u2phy0_host: host-port {
  492. phy-supply = <&vcc5v0_host>;
  493. status = "okay";
  494. };
  495. };
  496. &u2phy1 {
  497. status = "okay";
  498. u2phy1_otg: otg-port {
  499. status = "okay";
  500. };
  501. u2phy1_host: host-port {
  502. phy-supply = <&vcc5v0_host>;
  503. status = "okay";
  504. };
  505. };
  506. &uart0 {
  507. pinctrl-names = "default";
  508. pinctrl-0 = <&uart0_xfer &uart0_cts>;
  509. status = "okay";
  510. };
  511. &uart2 {
  512. status = "okay";
  513. };
  514. &usb_host0_ehci {
  515. status = "okay";
  516. };
  517. &usb_host0_ohci {
  518. status = "okay";
  519. };
  520. &usb_host1_ehci {
  521. status = "okay";
  522. };
  523. &usb_host1_ohci {
  524. status = "okay";
  525. };
  526. &usbdrd3_0 {
  527. status = "okay";
  528. };
  529. &usbdrd_dwc3_0 {
  530. status = "okay";
  531. dr_mode = "otg";
  532. };
  533. &usbdrd3_1 {
  534. status = "okay";
  535. };
  536. &usbdrd_dwc3_1 {
  537. status = "okay";
  538. dr_mode = "host";
  539. };
  540. &vopb {
  541. status = "okay";
  542. };
  543. &vopb_mmu {
  544. status = "okay";
  545. };
  546. &vopl {
  547. status = "okay";
  548. };
  549. &vopl_mmu {
  550. status = "okay";
  551. };