sdm845-oneplus-common.dtsi 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * SDM845 OnePlus 6(T) (enchilada / fajita) common device tree source
  4. *
  5. * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  6. */
  7. /dts-v1/;
  8. #include <dt-bindings/input/linux-event-codes.h>
  9. #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
  10. #include "sdm845.dtsi"
  11. #include "pm8998.dtsi"
  12. #include "pmi8998.dtsi"
  13. /delete-node/ &rmtfs_mem;
  14. / {
  15. aliases {
  16. serial0 = &uart9;
  17. hsuart0 = &uart6;
  18. };
  19. chosen {
  20. stdout-path = "serial0:115200n8";
  21. };
  22. gpio-keys {
  23. compatible = "gpio-keys";
  24. label = "Volume keys";
  25. autorepeat;
  26. pinctrl-names = "default";
  27. pinctrl-0 = <&volume_down_gpio &volume_up_gpio>;
  28. key-vol-down {
  29. label = "Volume down";
  30. linux,code = <KEY_VOLUMEDOWN>;
  31. gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
  32. debounce-interval = <15>;
  33. };
  34. key-vol-up {
  35. label = "Volume up";
  36. linux,code = <KEY_VOLUMEUP>;
  37. gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
  38. debounce-interval = <15>;
  39. };
  40. };
  41. reserved-memory {
  42. /* The rmtfs_mem needs to be guarded due to "XPU limitations"
  43. * it is otherwise possible for an allocation adjacent to the
  44. * rmtfs_mem region to trigger an XPU violation, causing a crash.
  45. */
  46. rmtfs_lower_guard: rmtfs-lower-guard@f5b00000 {
  47. no-map;
  48. reg = <0 0xf5b00000 0 0x1000>;
  49. };
  50. /*
  51. * The rmtfs memory region in downstream is 'dynamically allocated'
  52. * but given the same address every time. Hard code it as this address is
  53. * where the modem firmware expects it to be.
  54. */
  55. rmtfs_mem: rmtfs-mem@f5b01000 {
  56. compatible = "qcom,rmtfs-mem";
  57. reg = <0 0xf5b01000 0 0x200000>;
  58. no-map;
  59. qcom,client-id = <1>;
  60. qcom,vmid = <15>;
  61. };
  62. rmtfs_upper_guard: rmtfs-upper-guard@f5d01000 {
  63. no-map;
  64. reg = <0 0xf5d01000 0 0x1000>;
  65. };
  66. /*
  67. * It seems like reserving the old rmtfs_mem region is also needed to prevent
  68. * random crashes which are most likely modem related, more testing needed.
  69. */
  70. removed_region: removed-region@88f00000 {
  71. no-map;
  72. reg = <0 0x88f00000 0 0x1c00000>;
  73. };
  74. ramoops: ramoops@ac300000 {
  75. compatible = "ramoops";
  76. reg = <0 0xac300000 0 0x400000>;
  77. record-size = <0x40000>;
  78. console-size = <0x40000>;
  79. ftrace-size = <0x40000>;
  80. pmsg-size = <0x200000>;
  81. ecc-size = <16>;
  82. };
  83. };
  84. vph_pwr: vph-pwr-regulator {
  85. compatible = "regulator-fixed";
  86. regulator-name = "vph_pwr";
  87. regulator-min-microvolt = <3700000>;
  88. regulator-max-microvolt = <3700000>;
  89. };
  90. /*
  91. * Apparently RPMh does not provide support for PM8998 S4 because it
  92. * is always-on; model it as a fixed regulator.
  93. */
  94. vreg_s4a_1p8: pm8998-smps4 {
  95. compatible = "regulator-fixed";
  96. regulator-name = "vreg_s4a_1p8";
  97. regulator-min-microvolt = <1800000>;
  98. regulator-max-microvolt = <1800000>;
  99. regulator-always-on;
  100. regulator-boot-on;
  101. vin-supply = <&vph_pwr>;
  102. };
  103. /*
  104. * The touchscreen regulator seems to be controlled somehow by a gpio.
  105. * Model it as a fixed regulator and keep it on. Without schematics we
  106. * don't know how this is actually wired up...
  107. */
  108. ts_1p8_supply: ts-1p8-regulator {
  109. compatible = "regulator-fixed";
  110. regulator-name = "ts_1p8_supply";
  111. regulator-min-microvolt = <1800000>;
  112. regulator-max-microvolt = <1800000>;
  113. gpio = <&tlmm 88 0>;
  114. enable-active-high;
  115. regulator-boot-on;
  116. };
  117. };
  118. &adsp_pas {
  119. status = "okay";
  120. firmware-name = "qcom/sdm845/oneplus6/adsp.mbn";
  121. };
  122. &apps_rsc {
  123. pm8998-rpmh-regulators {
  124. compatible = "qcom,pm8998-rpmh-regulators";
  125. qcom,pmic-id = "a";
  126. vdd-s1-supply = <&vph_pwr>;
  127. vdd-s2-supply = <&vph_pwr>;
  128. vdd-s3-supply = <&vph_pwr>;
  129. vdd-s4-supply = <&vph_pwr>;
  130. vdd-s5-supply = <&vph_pwr>;
  131. vdd-s6-supply = <&vph_pwr>;
  132. vdd-s7-supply = <&vph_pwr>;
  133. vdd-s8-supply = <&vph_pwr>;
  134. vdd-s9-supply = <&vph_pwr>;
  135. vdd-s10-supply = <&vph_pwr>;
  136. vdd-s11-supply = <&vph_pwr>;
  137. vdd-s12-supply = <&vph_pwr>;
  138. vdd-s13-supply = <&vph_pwr>;
  139. vdd-l1-l27-supply = <&vreg_s7a_1p025>;
  140. vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
  141. vdd-l3-l11-supply = <&vreg_s7a_1p025>;
  142. vdd-l4-l5-supply = <&vreg_s7a_1p025>;
  143. vdd-l6-supply = <&vph_pwr>;
  144. vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
  145. vdd-l9-supply = <&vreg_bob>;
  146. vdd-l10-l23-l25-supply = <&vreg_bob>;
  147. vdd-l13-l19-l21-supply = <&vreg_bob>;
  148. vdd-l16-l28-supply = <&vreg_bob>;
  149. vdd-l18-l22-supply = <&vreg_bob>;
  150. vdd-l20-l24-supply = <&vreg_bob>;
  151. vdd-l26-supply = <&vreg_s3a_1p35>;
  152. vin-lvs-1-2-supply = <&vreg_s4a_1p8>;
  153. vreg_s3a_1p35: smps3 {
  154. regulator-min-microvolt = <1352000>;
  155. regulator-max-microvolt = <1352000>;
  156. };
  157. vreg_s5a_2p04: smps5 {
  158. regulator-min-microvolt = <1904000>;
  159. regulator-max-microvolt = <2040000>;
  160. };
  161. vreg_s7a_1p025: smps7 {
  162. regulator-min-microvolt = <900000>;
  163. regulator-max-microvolt = <1028000>;
  164. };
  165. vdda_mipi_dsi0_pll:
  166. vdda_qlink_lv:
  167. vdda_ufs1_core:
  168. vdda_usb1_ss_core:
  169. vreg_l1a_0p875: ldo1 {
  170. regulator-min-microvolt = <880000>;
  171. regulator-max-microvolt = <880000>;
  172. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  173. };
  174. vreg_l2a_1p2: ldo2 {
  175. regulator-min-microvolt = <1200000>;
  176. regulator-max-microvolt = <1200000>;
  177. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  178. regulator-always-on;
  179. };
  180. vreg_l5a_0p8: ldo5 {
  181. regulator-min-microvolt = <800000>;
  182. regulator-max-microvolt = <800000>;
  183. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  184. };
  185. vreg_l7a_1p8: ldo7 {
  186. regulator-min-microvolt = <1800000>;
  187. regulator-max-microvolt = <1800000>;
  188. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  189. };
  190. vdda_qusb_hs0_1p8:
  191. vreg_l12a_1p8: ldo12 {
  192. regulator-min-microvolt = <1800000>;
  193. regulator-max-microvolt = <1800000>;
  194. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  195. };
  196. vreg_l14a_1p88: ldo14 {
  197. regulator-min-microvolt = <1800000>;
  198. regulator-max-microvolt = <1800000>;
  199. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  200. regulator-always-on;
  201. };
  202. vreg_l17a_1p3: ldo17 {
  203. regulator-min-microvolt = <1304000>;
  204. regulator-max-microvolt = <1304000>;
  205. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  206. };
  207. vreg_l20a_2p95: ldo20 {
  208. regulator-min-microvolt = <2704000>;
  209. regulator-max-microvolt = <2960000>;
  210. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  211. };
  212. vreg_l23a_3p3: ldo23 {
  213. regulator-min-microvolt = <3300000>;
  214. regulator-max-microvolt = <3312000>;
  215. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  216. };
  217. vdda_qusb_hs0_3p1:
  218. vreg_l24a_3p075: ldo24 {
  219. regulator-min-microvolt = <3088000>;
  220. regulator-max-microvolt = <3088000>;
  221. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  222. };
  223. vreg_l25a_3p3: ldo25 {
  224. regulator-min-microvolt = <3300000>;
  225. regulator-max-microvolt = <3312000>;
  226. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  227. };
  228. vdda_mipi_dsi0_1p2:
  229. vdda_ufs1_1p2:
  230. vreg_l26a_1p2: ldo26 {
  231. regulator-min-microvolt = <1200000>;
  232. regulator-max-microvolt = <1200000>;
  233. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  234. };
  235. vreg_l28a_3p0: ldo28 {
  236. regulator-min-microvolt = <2856000>;
  237. regulator-max-microvolt = <3008000>;
  238. regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
  239. };
  240. };
  241. pmi8998-rpmh-regulators {
  242. compatible = "qcom,pmi8998-rpmh-regulators";
  243. qcom,pmic-id = "b";
  244. vdd-bob-supply = <&vph_pwr>;
  245. vreg_bob: bob {
  246. regulator-min-microvolt = <3312000>;
  247. regulator-max-microvolt = <3600000>;
  248. regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
  249. regulator-allow-bypass;
  250. };
  251. };
  252. pm8005-rpmh-regulators {
  253. compatible = "qcom,pm8005-rpmh-regulators";
  254. qcom,pmic-id = "c";
  255. vdd-s1-supply = <&vph_pwr>;
  256. vdd-s2-supply = <&vph_pwr>;
  257. vdd-s3-supply = <&vph_pwr>;
  258. vdd-s4-supply = <&vph_pwr>;
  259. vreg_s3c_0p6: smps3 {
  260. regulator-min-microvolt = <600000>;
  261. regulator-max-microvolt = <600000>;
  262. };
  263. };
  264. };
  265. &cdsp_pas {
  266. status = "okay";
  267. firmware-name = "qcom/sdm845/oneplus6/cdsp.mbn";
  268. };
  269. &dsi0 {
  270. status = "okay";
  271. vdda-supply = <&vdda_mipi_dsi0_1p2>;
  272. /*
  273. * Both devices use different panels but all other properties
  274. * are common. Compatible line is declared in device dts.
  275. */
  276. display_panel: panel@0 {
  277. status = "disabled";
  278. #address-cells = <1>;
  279. #size-cells = <0>;
  280. reg = <0>;
  281. vddio-supply = <&vreg_l14a_1p88>;
  282. reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
  283. pinctrl-names = "default";
  284. pinctrl-0 = <&panel_reset_pins &panel_te_pin &panel_esd_pin>;
  285. port {
  286. panel_in: endpoint {
  287. remote-endpoint = <&dsi0_out>;
  288. };
  289. };
  290. };
  291. };
  292. &dsi0_out {
  293. remote-endpoint = <&panel_in>;
  294. data-lanes = <0 1 2 3>;
  295. };
  296. &dsi0_phy {
  297. status = "okay";
  298. vdds-supply = <&vdda_mipi_dsi0_pll>;
  299. };
  300. &gcc {
  301. protected-clocks = <GCC_QSPI_CORE_CLK>,
  302. <GCC_QSPI_CORE_CLK_SRC>,
  303. <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
  304. <GCC_LPASS_Q6_AXI_CLK>,
  305. <GCC_LPASS_SWAY_CLK>;
  306. };
  307. &gmu {
  308. status = "okay";
  309. };
  310. &gpu {
  311. status = "okay";
  312. zap-shader {
  313. memory-region = <&gpu_mem>;
  314. firmware-name = "qcom/sdm845/oneplus6/a630_zap.mbn";
  315. };
  316. };
  317. &i2c10 {
  318. status = "okay";
  319. clock-frequency = <100000>;
  320. bq27441_fg: bq27441-battery@55 {
  321. compatible = "ti,bq27411";
  322. status = "okay";
  323. reg = <0x55>;
  324. };
  325. };
  326. &i2c12 {
  327. status = "okay";
  328. clock-frequency = <400000>;
  329. synaptics-rmi4-i2c@20 {
  330. compatible = "syna,rmi4-i2c";
  331. reg = <0x20>;
  332. #address-cells = <1>;
  333. #size-cells = <0>;
  334. interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
  335. pinctrl-names = "default";
  336. pinctrl-0 = <&ts_default_pins>;
  337. vdd-supply = <&vreg_l28a_3p0>;
  338. vio-supply = <&ts_1p8_supply>;
  339. syna,reset-delay-ms = <200>;
  340. syna,startup-delay-ms = <200>;
  341. rmi4-f01@1 {
  342. reg = <0x01>;
  343. syna,nosleep-mode = <1>;
  344. };
  345. rmi4_f12: rmi4-f12@12 {
  346. reg = <0x12>;
  347. touchscreen-x-mm = <68>;
  348. touchscreen-y-mm = <144>;
  349. syna,sensor-type = <1>;
  350. syna,rezero-wait-ms = <200>;
  351. };
  352. };
  353. };
  354. &ipa {
  355. status = "okay";
  356. memory-region = <&ipa_fw_mem>;
  357. firmware-name = "qcom/sdm845/oneplus6/ipa_fws.mbn";
  358. };
  359. &mdss {
  360. status = "okay";
  361. };
  362. /* Modem/wifi*/
  363. &mss_pil {
  364. status = "okay";
  365. firmware-name = "qcom/sdm845/oneplus6/mba.mbn", "qcom/sdm845/oneplus6/modem.mbn";
  366. };
  367. &pm8998_gpio {
  368. volume_down_gpio: pm8998-gpio5-state {
  369. pinconf {
  370. pins = "gpio5";
  371. function = "normal";
  372. input-enable;
  373. bias-pull-up;
  374. qcom,drive-strength = <0>;
  375. };
  376. };
  377. volume_up_gpio: pm8998-gpio6-state {
  378. pinconf {
  379. pins = "gpio6";
  380. function = "normal";
  381. input-enable;
  382. bias-pull-up;
  383. qcom,drive-strength = <0>;
  384. };
  385. };
  386. };
  387. &qupv3_id_1 {
  388. status = "okay";
  389. };
  390. &qupv3_id_0 {
  391. status = "okay";
  392. };
  393. &qup_i2c12_default {
  394. mux {
  395. pins = "gpio49", "gpio50";
  396. function = "qup12";
  397. drive-strength = <2>;
  398. bias-disable;
  399. };
  400. };
  401. &qup_i2c10_default {
  402. pinconf {
  403. pins = "gpio55", "gpio56";
  404. drive-strength = <2>;
  405. bias-disable;
  406. };
  407. };
  408. &qup_uart9_default {
  409. pinconf-tx {
  410. pins = "gpio4";
  411. drive-strength = <2>;
  412. bias-disable;
  413. };
  414. pinconf-rx {
  415. pins = "gpio5";
  416. drive-strength = <2>;
  417. bias-pull-up;
  418. };
  419. };
  420. /*
  421. * Prevent garbage data on bluetooth UART lines
  422. */
  423. &qup_uart6_default {
  424. pinmux {
  425. pins = "gpio45", "gpio46", "gpio47", "gpio48";
  426. function = "qup6";
  427. };
  428. cts {
  429. pins = "gpio45";
  430. bias-pull-down;
  431. };
  432. rts-tx {
  433. pins = "gpio46", "gpio47";
  434. drive-strength = <2>;
  435. bias-disable;
  436. };
  437. rx {
  438. pins = "gpio48";
  439. bias-pull-up;
  440. };
  441. };
  442. &uart6 {
  443. status = "okay";
  444. bluetooth {
  445. compatible = "qcom,wcn3990-bt";
  446. /*
  447. * This path is relative to the qca/
  448. * subdir under lib/firmware.
  449. */
  450. firmware-name = "oneplus6/crnv21.bin";
  451. vddio-supply = <&vreg_s4a_1p8>;
  452. vddxo-supply = <&vreg_l7a_1p8>;
  453. vddrf-supply = <&vreg_l17a_1p3>;
  454. vddch0-supply = <&vreg_l25a_3p3>;
  455. max-speed = <3200000>;
  456. };
  457. };
  458. &uart9 {
  459. label = "LS-UART1";
  460. status = "okay";
  461. };
  462. &ufs_mem_hc {
  463. status = "okay";
  464. reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
  465. vcc-supply = <&vreg_l20a_2p95>;
  466. vcc-max-microamp = <600000>;
  467. };
  468. &ufs_mem_phy {
  469. status = "okay";
  470. vdda-phy-supply = <&vdda_ufs1_core>;
  471. vdda-pll-supply = <&vdda_ufs1_1p2>;
  472. };
  473. &usb_1 {
  474. status = "okay";
  475. /*
  476. * disable USB3 clock requirement as the device only supports
  477. * USB2.
  478. */
  479. qcom,select-utmi-as-pipe-clk;
  480. };
  481. &usb_1_dwc3 {
  482. /*
  483. * We don't have the capability to switch modes yet.
  484. */
  485. dr_mode = "peripheral";
  486. /* fastest mode for USB 2 */
  487. maximum-speed = "high-speed";
  488. /* Remove USB3 phy as it's unused on this device. */
  489. phys = <&usb_1_hsphy>;
  490. phy-names = "usb2-phy";
  491. };
  492. &usb_1_hsphy {
  493. status = "okay";
  494. vdd-supply = <&vdda_usb1_ss_core>;
  495. vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
  496. vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
  497. qcom,imp-res-offset-value = <8>;
  498. qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
  499. qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
  500. qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
  501. };
  502. &tlmm {
  503. gpio-reserved-ranges = <0 4>, <81 4>;
  504. tri_state_key_default: tri_state_key_default {
  505. mux {
  506. pins = "gpio40", "gpio42", "gpio26";
  507. function = "gpio";
  508. drive-strength = <2>;
  509. bias-disable;
  510. };
  511. };
  512. ts_default_pins: ts-int {
  513. mux {
  514. pins = "gpio99", "gpio125";
  515. function = "gpio";
  516. drive-strength = <16>;
  517. bias-pull-up;
  518. };
  519. };
  520. panel_reset_pins: panel-reset {
  521. mux {
  522. pins = "gpio6", "gpio25", "gpio26";
  523. function = "gpio";
  524. drive-strength = <8>;
  525. bias-disable;
  526. };
  527. };
  528. panel_te_pin: panel-te {
  529. mux {
  530. pins = "gpio10";
  531. function = "mdp_vsync";
  532. drive-strength = <2>;
  533. bias-disable;
  534. input-enable;
  535. };
  536. };
  537. panel_esd_pin: panel-esd {
  538. mux {
  539. pins = "gpio30";
  540. function = "gpio";
  541. drive-strength = <2>;
  542. bias-pull-down;
  543. input-enable;
  544. };
  545. };
  546. };
  547. &venus {
  548. status = "okay";
  549. firmware-name = "qcom/sdm845/oneplus6/venus.mbn";
  550. };
  551. &wifi {
  552. status = "okay";
  553. vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
  554. vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
  555. vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
  556. vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
  557. vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
  558. qcom,snoc-host-cap-8bit-quirk;
  559. };