rk3399-gru-chromebook.dtsi 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592
  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. enable-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
  154. power-supply = <&pp3300_disp>;
  155. pinctrl-names = "default";
  156. pinctrl-0 = <&bl_en>;
  157. pwm-delay-us = <10000>;
  158. };
  159. gpio_keys: gpio-keys {
  160. compatible = "gpio-keys";
  161. pinctrl-names = "default";
  162. pinctrl-0 = <&bt_host_wake_l>;
  163. wake_on_bt: key-wake-on-bt {
  164. label = "Wake-on-Bluetooth";
  165. gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
  166. linux,code = <KEY_WAKEUP>;
  167. wakeup-source;
  168. };
  169. };
  170. };
  171. &ppvar_bigcpu {
  172. min-slew-down-rate = <225>;
  173. ovp-threshold-percent = <16>;
  174. };
  175. &ppvar_litcpu {
  176. min-slew-down-rate = <225>;
  177. ovp-threshold-percent = <16>;
  178. };
  179. &ppvar_gpu {
  180. min-slew-down-rate = <225>;
  181. ovp-threshold-percent = <16>;
  182. };
  183. &cdn_dp {
  184. extcon = <&usbc_extcon0>, <&usbc_extcon1>;
  185. };
  186. &dmc {
  187. center-supply = <&ppvar_centerlogic>;
  188. rockchip,pd-idle-dis-freq-hz = <800000000>;
  189. rockchip,sr-idle-dis-freq-hz = <800000000>;
  190. rockchip,sr-mc-gate-idle-dis-freq-hz = <800000000>;
  191. };
  192. &edp {
  193. status = "okay";
  194. /*
  195. * eDP PHY/clk don't sync reliably at anything other than 24 MHz. Only
  196. * set this here, because rk3399-gru.dtsi ensures we can generate this
  197. * off GPLL=600MHz, whereas some other RK3399 boards may not.
  198. */
  199. assigned-clocks = <&cru PCLK_EDP>;
  200. assigned-clock-rates = <24000000>;
  201. ports {
  202. edp_out: port@1 {
  203. reg = <1>;
  204. #address-cells = <1>;
  205. #size-cells = <0>;
  206. edp_out_panel: endpoint@0 {
  207. reg = <0>;
  208. remote-endpoint = <&panel_in_edp>;
  209. };
  210. };
  211. };
  212. };
  213. &gpio0 {
  214. gpio-line-names = /* GPIO0 A 0-7 */
  215. "AP_RTC_CLK_IN",
  216. "EC_AP_INT_L",
  217. "PP1800_AUDIO_EN",
  218. "BT_HOST_WAKE_L",
  219. "WLAN_MODULE_PD_L",
  220. "H1_INT_OD_L",
  221. "CENTERLOGIC_DVS_PWM",
  222. "",
  223. /* GPIO0 B 0-4 */
  224. "WIFI_HOST_WAKE_L",
  225. "PMUIO2_33_18_L",
  226. "PP1500_EN",
  227. "AP_EC_WARM_RESET_REQ",
  228. "PP3000_EN";
  229. };
  230. &gpio1 {
  231. gpio-line-names = /* GPIO1 A 0-7 */
  232. "",
  233. "",
  234. "SPK_PA_EN",
  235. "",
  236. "TRACKPAD_INT_L",
  237. "AP_EC_S3_S0_L",
  238. "AP_EC_OVERTEMP",
  239. "AP_SPI_FLASH_MISO",
  240. /* GPIO1 B 0-7 */
  241. "AP_SPI_FLASH_MOSI_R",
  242. "AP_SPI_FLASH_CLK_R",
  243. "AP_SPI_FLASH_CS_L_R",
  244. "WLAN_MODULE_RESET_L",
  245. "WIFI_DISABLE_L",
  246. "MIC_INT",
  247. "",
  248. "AP_I2C_DVS_SDA",
  249. /* GPIO1 C 0-7 */
  250. "AP_I2C_DVS_SCL",
  251. "AP_BL_EN",
  252. /*
  253. * AP_FLASH_WP is crossystem ABI. Schematics call it
  254. * AP_FW_WP or CPU1_FW_WP, depending on the variant.
  255. */
  256. "AP_FLASH_WP",
  257. "LITCPU_DVS_PWM",
  258. "AP_I2C_AUDIO_SDA",
  259. "AP_I2C_AUDIO_SCL",
  260. "",
  261. "HEADSET_INT_L";
  262. };
  263. &gpio2 {
  264. gpio-line-names = /* GPIO2 A 0-7 */
  265. "",
  266. "",
  267. "SD_IO_PWR_EN",
  268. "",
  269. "",
  270. "",
  271. "",
  272. "",
  273. /* GPIO2 B 0-7 */
  274. "",
  275. "",
  276. "",
  277. "",
  278. "",
  279. "",
  280. "",
  281. "",
  282. /* GPIO2 C 0-7 */
  283. "",
  284. "",
  285. "",
  286. "",
  287. "AP_SPI_EC_MISO",
  288. "AP_SPI_EC_MOSI",
  289. "AP_SPI_EC_CLK",
  290. "AP_SPI_EC_CS_L",
  291. /* GPIO2 D 0-4 */
  292. "BT_DEV_WAKE_L",
  293. "",
  294. "WIFI_PCIE_CLKREQ_L",
  295. "WIFI_PERST_L",
  296. "SD_PWR_3000_1800_L";
  297. };
  298. &gpio3 {
  299. gpio-line-names = /* GPIO3 A 0-7 */
  300. "",
  301. "",
  302. "",
  303. "",
  304. "AP_SPI_TPM_MISO",
  305. "AP_SPI_TPM_MOSI_R",
  306. "AP_SPI_TPM_CLK_R",
  307. "AP_SPI_TPM_CS_L_R",
  308. /* GPIO3 B 0-7 */
  309. "EC_IN_RW",
  310. "",
  311. "AP_I2C_TP_SDA",
  312. "AP_I2C_TP_SCL",
  313. "AP_I2C_TP_PU_EN",
  314. "TOUCH_INT_L",
  315. "",
  316. "",
  317. /* GPIO3 C 0-7 */
  318. "",
  319. "",
  320. "",
  321. "",
  322. "",
  323. "",
  324. "",
  325. "",
  326. /* GPIO3 D 0-7 */
  327. "I2S0_SCLK",
  328. "I2S0_LRCK_RX",
  329. "I2S0_LRCK_TX",
  330. "I2S0_SDI_0",
  331. "I2S0_SDI_1",
  332. "",
  333. "I2S0_SDO_1",
  334. "I2S0_SDO_0";
  335. };
  336. &gpio4 {
  337. gpio-line-names = /* GPIO4 A 0-7 */
  338. "I2S_MCLK",
  339. "AP_I2C_MIC_SDA",
  340. "AP_I2C_MIC_SCL",
  341. "",
  342. "",
  343. "",
  344. "",
  345. "",
  346. /* GPIO4 B 0-7 */
  347. "",
  348. "",
  349. "",
  350. "",
  351. "",
  352. "",
  353. "",
  354. "",
  355. /* GPIO4 C 0-7 */
  356. "AP_I2C_TS_SDA",
  357. "AP_I2C_TS_SCL",
  358. "GPU_DVS_PWM",
  359. "UART_DBG_TX_AP_RX",
  360. "UART_AP_TX_DBG_RX",
  361. "",
  362. "BIGCPU_DVS_PWM",
  363. "EDP_HPD_3V0",
  364. /* GPIO4 D 0-5 */
  365. "SD_CARD_DET_L",
  366. "USB_DP_HPD",
  367. "TOUCH_RESET_L",
  368. "PP3300_DISP_EN",
  369. "",
  370. "SD_SLOT_PWR_EN";
  371. };
  372. ap_i2c_mic: &i2c1 {
  373. status = "okay";
  374. clock-frequency = <400000>;
  375. /* These are relatively safe rise/fall times */
  376. i2c-scl-falling-time-ns = <50>;
  377. i2c-scl-rising-time-ns = <300>;
  378. headsetcodec: rt5514@57 {
  379. compatible = "realtek,rt5514";
  380. reg = <0x57>;
  381. realtek,dmic-init-delay-ms = <20>;
  382. };
  383. };
  384. ap_i2c_tp: &i2c5 {
  385. status = "okay";
  386. clock-frequency = <400000>;
  387. /* These are relatively safe rise/fall times */
  388. i2c-scl-falling-time-ns = <50>;
  389. i2c-scl-rising-time-ns = <300>;
  390. /*
  391. * Note strange pullup enable. Apparently this avoids leakage but
  392. * still allows us to get nice 4.7K pullups for high speed i2c
  393. * transfers. Basically we want the pullup on whenever the ap is
  394. * alive, so the "en" pin just gets set to output high.
  395. */
  396. pinctrl-0 = <&i2c5_xfer &ap_i2c_tp_pu_en>;
  397. };
  398. &cros_ec {
  399. cros_ec_pwm: pwm {
  400. compatible = "google,cros-ec-pwm";
  401. #pwm-cells = <1>;
  402. };
  403. usbc_extcon1: extcon1 {
  404. compatible = "google,extcon-usbc-cros-ec";
  405. google,usb-port-id = <1>;
  406. };
  407. };
  408. &sound {
  409. rockchip,codec = <&max98357a &headsetcodec
  410. &codec &wacky_spi_audio &cdn_dp>;
  411. };
  412. &spi2 {
  413. wacky_spi_audio: spi2@0 {
  414. compatible = "realtek,rt5514";
  415. reg = <0>;
  416. interrupt-parent = <&gpio1>;
  417. interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
  418. pinctrl-names = "default";
  419. pinctrl-0 = <&mic_int>;
  420. /* May run faster once verified. */
  421. spi-max-frequency = <10000000>;
  422. wakeup-source;
  423. };
  424. };
  425. &pci_rootport {
  426. mvl_wifi: wifi@0,0 {
  427. compatible = "pci1b4b,2b42";
  428. reg = <0x83010000 0x0 0x00000000 0x0 0x00100000
  429. 0x83010000 0x0 0x00100000 0x0 0x00100000>;
  430. interrupt-parent = <&gpio0>;
  431. interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
  432. pinctrl-names = "default";
  433. pinctrl-0 = <&wlan_host_wake_l>;
  434. wakeup-source;
  435. };
  436. };
  437. &tcphy1 {
  438. status = "okay";
  439. extcon = <&usbc_extcon1>;
  440. };
  441. &u2phy1 {
  442. status = "okay";
  443. };
  444. &usb_host0_ehci {
  445. status = "okay";
  446. };
  447. &usb_host1_ehci {
  448. status = "okay";
  449. };
  450. &usb_host1_ohci {
  451. status = "okay";
  452. };
  453. &usbdrd3_1 {
  454. status = "okay";
  455. extcon = <&usbc_extcon1>;
  456. };
  457. &usbdrd_dwc3_1 {
  458. status = "okay";
  459. dr_mode = "host";
  460. };
  461. &pinctrl {
  462. discrete-regulators {
  463. pp1500_en: pp1500-en {
  464. rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO
  465. &pcfg_pull_none>;
  466. };
  467. pp1800_audio_en: pp1800-audio-en {
  468. rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO
  469. &pcfg_pull_down>;
  470. };
  471. pp3000_en: pp3000-en {
  472. rockchip,pins = <0 RK_PB4 RK_FUNC_GPIO
  473. &pcfg_pull_none>;
  474. };
  475. pp3300_disp_en: pp3300-disp-en {
  476. rockchip,pins = <4 RK_PD3 RK_FUNC_GPIO
  477. &pcfg_pull_none>;
  478. };
  479. wlan_module_pd_l: wlan-module-pd-l {
  480. rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO
  481. &pcfg_pull_down>;
  482. };
  483. };
  484. };
  485. &wifi {
  486. wifi_perst_l: wifi-perst-l {
  487. rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
  488. };
  489. wlan_host_wake_l: wlan-host-wake-l {
  490. /* Kevin has an external pull up, but Bob does not */
  491. rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
  492. };
  493. };