rk3399-gru-chromebook.dtsi 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
  2. /*
  3. * Google Gru-Chromebook shared properties
  4. *
  5. * Copyright 2018 Google, Inc
  6. */
  7. #include "rk3399-gru.dtsi"
  8. / {
  9. pp900_ap: pp900-ap {
  10. compatible = "regulator-fixed";
  11. regulator-name = "pp900_ap";
  12. /* EC turns on w/ pp900_ap_en; always on for AP */
  13. regulator-always-on;
  14. regulator-boot-on;
  15. regulator-min-microvolt = <900000>;
  16. regulator-max-microvolt = <900000>;
  17. vin-supply = <&ppvar_sys>;
  18. };
  19. /* EC turns on w/ pp900_usb_en */
  20. pp900_usb: pp900-ap {
  21. };
  22. /* EC turns on w/ pp900_pcie_en */
  23. pp900_pcie: pp900-ap {
  24. };
  25. pp3000: pp3000 {
  26. compatible = "regulator-fixed";
  27. regulator-name = "pp3000";
  28. pinctrl-names = "default";
  29. pinctrl-0 = <&pp3000_en>;
  30. enable-active-high;
  31. gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
  32. regulator-always-on;
  33. regulator-boot-on;
  34. regulator-min-microvolt = <3000000>;
  35. regulator-max-microvolt = <3000000>;
  36. vin-supply = <&ppvar_sys>;
  37. };
  38. ppvar_centerlogic_pwm: ppvar-centerlogic-pwm {
  39. compatible = "pwm-regulator";
  40. regulator-name = "ppvar_centerlogic_pwm";
  41. pwms = <&pwm3 0 3337 0>;
  42. pwm-supply = <&ppvar_sys>;
  43. pwm-dutycycle-range = <100 0>;
  44. pwm-dutycycle-unit = <100>;
  45. /* EC turns on w/ ppvar_centerlogic_en; always on for AP */
  46. regulator-always-on;
  47. regulator-boot-on;
  48. regulator-min-microvolt = <799434>;
  49. regulator-max-microvolt = <1049925>;
  50. };
  51. ppvar_centerlogic: ppvar-centerlogic {
  52. compatible = "vctrl-regulator";
  53. regulator-name = "ppvar_centerlogic";
  54. regulator-min-microvolt = <799434>;
  55. regulator-max-microvolt = <1049925>;
  56. ctrl-supply = <&ppvar_centerlogic_pwm>;
  57. ctrl-voltage-range = <799434 1049925>;
  58. regulator-settling-time-up-us = <378>;
  59. min-slew-down-rate = <225>;
  60. ovp-threshold-percent = <16>;
  61. };
  62. /* Schematics call this PPVAR even though it's fixed */
  63. ppvar_logic: ppvar-logic {
  64. compatible = "regulator-fixed";
  65. regulator-name = "ppvar_logic";
  66. /* EC turns on w/ ppvar_logic_en; always on for AP */
  67. regulator-always-on;
  68. regulator-boot-on;
  69. regulator-min-microvolt = <900000>;
  70. regulator-max-microvolt = <900000>;
  71. vin-supply = <&ppvar_sys>;
  72. };
  73. pp1800_audio: pp1800-audio {
  74. compatible = "regulator-fixed";
  75. regulator-name = "pp1800_audio";
  76. pinctrl-names = "default";
  77. pinctrl-0 = <&pp1800_audio_en>;
  78. enable-active-high;
  79. gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
  80. regulator-always-on;
  81. regulator-boot-on;
  82. vin-supply = <&pp1800>;
  83. };
  84. /* gpio is shared with pp3300_wifi_bt */
  85. pp1800_pcie: pp1800-pcie {
  86. compatible = "regulator-fixed";
  87. regulator-name = "pp1800_pcie";
  88. pinctrl-names = "default";
  89. pinctrl-0 = <&wlan_module_pd_l>;
  90. enable-active-high;
  91. gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
  92. /*
  93. * Need to wait 1ms + ramp-up time before we can power on WiFi.
  94. * This has been approximated as 8ms total.
  95. */
  96. regulator-enable-ramp-delay = <8000>;
  97. vin-supply = <&pp1800>;
  98. };
  99. /* Always on; plain and simple */
  100. pp3000_ap: pp3000_emmc: pp3000 {
  101. };
  102. pp1500_ap_io: pp1500-ap-io {
  103. compatible = "regulator-fixed";
  104. regulator-name = "pp1500_ap_io";
  105. pinctrl-names = "default";
  106. pinctrl-0 = <&pp1500_en>;
  107. enable-active-high;
  108. gpio = <&gpio0 10 GPIO_ACTIVE_HIGH>;
  109. regulator-always-on;
  110. regulator-boot-on;
  111. regulator-min-microvolt = <1500000>;
  112. regulator-max-microvolt = <1500000>;
  113. vin-supply = <&pp1800>;
  114. };
  115. pp3300_disp: pp3300-disp {
  116. compatible = "regulator-fixed";
  117. regulator-name = "pp3300_disp";
  118. pinctrl-names = "default";
  119. pinctrl-0 = <&pp3300_disp_en>;
  120. enable-active-high;
  121. gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>;
  122. startup-delay-us = <2000>;
  123. vin-supply = <&pp3300>;
  124. };
  125. /* EC turns on w/ pp3300_usb_en_l */
  126. pp3300_usb: pp3300 {
  127. };
  128. /* gpio is shared with pp1800_pcie and pinctrl is set there */
  129. pp3300_wifi_bt: pp3300-wifi-bt {
  130. compatible = "regulator-fixed";
  131. regulator-name = "pp3300_wifi_bt";
  132. enable-active-high;
  133. gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
  134. vin-supply = <&pp3300>;
  135. };
  136. /*
  137. * This is a bit of a hack. The WiFi module should be reset at least
  138. * 1ms after its regulators have ramped up (max rampup time is ~7ms).
  139. * With some stretching of the imagination, we can call the 1.8V
  140. * regulator a supply.
  141. */
  142. wlan_pd_n: wlan-pd-n {
  143. compatible = "regulator-fixed";
  144. regulator-name = "wlan_pd_n";
  145. pinctrl-names = "default";
  146. pinctrl-0 = <&wlan_module_reset_l>;
  147. enable-active-high;
  148. gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
  149. vin-supply = <&pp1800_pcie>;
  150. };
  151. backlight: backlight {
  152. compatible = "pwm-backlight";
  153. brightness-levels = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
  154. 17 18 19 20 21 22 23 24 25 26 27 28 29 30
  155. 31 32 33 34 35 36 37 38 39 40 41 42 43 44
  156. 45 46 47 48 49 50 51 52 53 54 55 56 57 58
  157. 59 60 61 62 63 64 65 66 67 68 69 70 71 72
  158. 73 74 75 76 77 78 79 80 81 82 83 84 85 86
  159. 87 88 89 90 91 92 93 94 95 96 97 98 99 100>;
  160. default-brightness-level = <51>;
  161. enable-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
  162. power-supply = <&pp3300_disp>;
  163. pinctrl-names = "default";
  164. pinctrl-0 = <&bl_en>;
  165. pwm-delay-us = <10000>;
  166. };
  167. };
  168. &ppvar_bigcpu {
  169. min-slew-down-rate = <225>;
  170. ovp-threshold-percent = <16>;
  171. };
  172. &ppvar_litcpu {
  173. min-slew-down-rate = <225>;
  174. ovp-threshold-percent = <16>;
  175. };
  176. &ppvar_gpu {
  177. min-slew-down-rate = <225>;
  178. ovp-threshold-percent = <16>;
  179. };
  180. &cdn_dp {
  181. extcon = <&usbc_extcon0>, <&usbc_extcon1>;
  182. };
  183. &edp {
  184. status = "okay";
  185. ports {
  186. edp_out: port@1 {
  187. reg = <1>;
  188. #address-cells = <1>;
  189. #size-cells = <0>;
  190. edp_out_panel: endpoint@0 {
  191. reg = <0>;
  192. remote-endpoint = <&panel_in_edp>;
  193. };
  194. };
  195. };
  196. };
  197. ap_i2c_mic: &i2c1 {
  198. status = "okay";
  199. clock-frequency = <400000>;
  200. /* These are relatively safe rise/fall times */
  201. i2c-scl-falling-time-ns = <50>;
  202. i2c-scl-rising-time-ns = <300>;
  203. headsetcodec: rt5514@57 {
  204. compatible = "realtek,rt5514";
  205. reg = <0x57>;
  206. realtek,dmic-init-delay-ms = <20>;
  207. };
  208. };
  209. ap_i2c_tp: &i2c5 {
  210. status = "okay";
  211. clock-frequency = <400000>;
  212. /* These are relatively safe rise/fall times */
  213. i2c-scl-falling-time-ns = <50>;
  214. i2c-scl-rising-time-ns = <300>;
  215. /*
  216. * Note strange pullup enable. Apparently this avoids leakage but
  217. * still allows us to get nice 4.7K pullups for high speed i2c
  218. * transfers. Basically we want the pullup on whenever the ap is
  219. * alive, so the "en" pin just gets set to output high.
  220. */
  221. pinctrl-0 = <&i2c5_xfer &ap_i2c_tp_pu_en>;
  222. };
  223. &cros_ec {
  224. cros_ec_pwm: ec-pwm {
  225. compatible = "google,cros-ec-pwm";
  226. #pwm-cells = <1>;
  227. };
  228. usbc_extcon1: extcon@1 {
  229. compatible = "google,extcon-usbc-cros-ec";
  230. google,usb-port-id = <1>;
  231. #extcon-cells = <0>;
  232. };
  233. };
  234. &sound {
  235. rockchip,codec = <&max98357a &headsetcodec
  236. &codec &wacky_spi_audio &cdn_dp>;
  237. };
  238. &spi2 {
  239. wacky_spi_audio: spi2@0 {
  240. compatible = "realtek,rt5514";
  241. reg = <0>;
  242. interrupt-parent = <&gpio1>;
  243. interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
  244. pinctrl-names = "default";
  245. pinctrl-0 = <&mic_int>;
  246. /* May run faster once verified. */
  247. spi-max-frequency = <10000000>;
  248. wakeup-source;
  249. };
  250. };
  251. &pci_rootport {
  252. mvl_wifi: wifi@0,0 {
  253. compatible = "pci1b4b,2b42";
  254. reg = <0x83010000 0x0 0x00000000 0x0 0x00100000
  255. 0x83010000 0x0 0x00100000 0x0 0x00100000>;
  256. interrupt-parent = <&gpio0>;
  257. interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
  258. pinctrl-names = "default";
  259. pinctrl-0 = <&wlan_host_wake_l>;
  260. wakeup-source;
  261. };
  262. };
  263. &tcphy1 {
  264. status = "okay";
  265. extcon = <&usbc_extcon1>;
  266. };
  267. &u2phy1 {
  268. status = "okay";
  269. };
  270. &usb_host0_ehci {
  271. status = "okay";
  272. };
  273. &usb_host1_ehci {
  274. status = "okay";
  275. };
  276. &usb_host1_ohci {
  277. status = "okay";
  278. };
  279. &usbdrd3_1 {
  280. status = "okay";
  281. extcon = <&usbc_extcon1>;
  282. };
  283. &usbdrd_dwc3_1 {
  284. status = "okay";
  285. dr_mode = "host";
  286. };
  287. &pinctrl {
  288. discrete-regulators {
  289. pp1500_en: pp1500-en {
  290. rockchip,pins = <RK_GPIO0 10 RK_FUNC_GPIO
  291. &pcfg_pull_none>;
  292. };
  293. pp1800_audio_en: pp1800-audio-en {
  294. rockchip,pins = <RK_GPIO0 2 RK_FUNC_GPIO
  295. &pcfg_pull_down>;
  296. };
  297. pp3000_en: pp3000-en {
  298. rockchip,pins = <RK_GPIO0 12 RK_FUNC_GPIO
  299. &pcfg_pull_none>;
  300. };
  301. pp3300_disp_en: pp3300-disp-en {
  302. rockchip,pins = <RK_GPIO4 27 RK_FUNC_GPIO
  303. &pcfg_pull_none>;
  304. };
  305. wlan_module_pd_l: wlan-module-pd-l {
  306. rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO
  307. &pcfg_pull_down>;
  308. };
  309. };
  310. };
  311. &wifi {
  312. wifi_perst_l: wifi-perst-l {
  313. rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
  314. };
  315. wlan_host_wake_l: wlan-host-wake-l {
  316. rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_none>;
  317. };
  318. };