This repository has been archived by the owner on Sep 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
msm8998-oneplus-common.dtsi
620 lines (522 loc) · 12.5 KB
/
msm8998-oneplus-common.dtsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
// SPDX-License-Identifier: BSD-3-Clause
/*
* OnePlus 5(T) (cheeseburger / dumpling) common device tree source based on msm8998-mtp.dtsi
*
* Copyright (c) 2021, Jami Kettunen <[email protected]>
* Copyright (c) 2016, The Linux Foundation. All rights reserved.
*/
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
#include "msm8998.dtsi"
#include "pm8998.dtsi"
#include "pmi8998.dtsi"
#include "pm8005.dtsi"
/ {
/* Required for bootloader to select correct board */
qcom,msm-id = <292 0x20001>; /* 8998 v2.1 */
chosen {
#address-cells = <2>;
#size-cells = <2>;
ranges;
/* Use display framebuffer setup by the UEFI XBL bootloader for simplefb */
framebuffer0: framebuffer@9d400000 {
compatible = "simple-framebuffer";
reg = <0x0 0x9d400000 0x0 0x2400000>;
width = <1080>;
height = <1920>;
stride = <(1080 * 4)>;
format = "a8r8g8b8";
status = "disabled";
};
};
reserved-memory {
/* Bootloader display framebuffer region */
cont_splash_mem: memory@9d400000 {
reg = <0x0 0x9d400000 0x0 0x2400000>;
no-map;
};
/* For getting crash logs using Android downstream kernels */
ramoops@ac000000 {
compatible = "ramoops";
reg = <0x0 0xac000000 0x0 0x200000>;
console-size = <0x80000>;
pmsg-size = <0x40000>;
record-size = <0x8000>;
ftrace-size = <0x20000>;
};
/*
* The following memory regions on downstream are "dynamically allocated"
* but given the same addresses every time. Hard code them as these addresses
* are where the OnePlus signed firmware expects them to be.
*/
ipa_fws_region: ipa@f6800000 {
compatible = "shared-dma-pool";
reg = <0x0 0xf6800000 0x0 0x5000>;
no-map;
};
zap_shader_region: gpu@f6900000 {
compatible = "shared-dma-pool";
reg = <0x0 0xf6900000 0x0 0x2000>;
no-map;
};
};
gpio-keys {
compatible = "gpio-keys";
label = "Volume buttons";
autorepeat;
pinctrl-names = "default";
pinctrl-0 = <&vol_keys_default>;
vol-down {
label = "Volume down";
gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;
linux,code = <KEY_VOLUMEDOWN>;
debounce-interval = <15>;
wakeup-source;
};
vol-up {
label = "Volume up";
gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
linux,code = <KEY_VOLUMEUP>;
debounce-interval = <15>;
wakeup-source;
};
};
gpio-hall-sensor {
compatible = "gpio-keys";
label = "Hall effect sensor";
pinctrl-names = "default";
pinctrl-0 = <&hall_sensor_default>;
hall-sensor {
label = "Hall Effect Sensor";
gpios = <&tlmm 124 GPIO_ACTIVE_LOW>;
linux,input-type = <EV_SW>;
linux,code = <SW_LID>;
linux,can-disable;
wakeup-source;
};
};
vph_pwr: vph-pwr-regulator {
compatible = "regulator-fixed";
regulator-name = "vph_pwr";
regulator-always-on;
regulator-boot-on;
};
};
/*
* OnePlus' ADSP firmware requires 30 MiB in total, so increase the adsp_mem
* region by 4 MiB to account for this while relocating the other now
* conflicting memory nodes accordingly.
*/
&adsp_mem {
reg = <0x0 0x8b200000 0x0 0x1e00000>;
};
&mpss_mem {
reg = <0x0 0x8d000000 0x0 0x7000000>;
};
&venus_mem {
reg = <0x0 0x94000000 0x0 0x500000>;
};
&mba_mem {
reg = <0x0 0x94500000 0x0 0x200000>;
};
&slpi_mem {
reg = <0x0 0x94700000 0x0 0xf00000>;
};
&ipa_fw_mem {
reg = <0x0 0x95600000 0x0 0x10000>;
};
&ipa_gsi_mem {
reg = <0x0 0x95610000 0x0 0x5000>;
};
&gpu_mem {
reg = <0x0 0x95615000 0x0 0x100000>;
};
&wlan_msa_mem {
reg = <0x0 0x95715000 0x0 0x100000>;
};
&blsp1_i2c5 {
status = "okay";
rmi4_i2c: touchscreen@20 {
compatible = "syna,rmi4-i2c";
reg = <0x20>;
#address-cells = <1>;
#size-cells = <0>;
interrupt-parent = <&tlmm>;
interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
pinctrl-names = "default";
pinctrl-0 = <&ts_int_active &ts_reset_active>;
vdd-supply = <&vreg_l28_3p0>;
vio-supply = <&vreg_l6a_1p8>;
syna,reset-delay-ms = <20>;
syna,startup-delay-ms = <20>;
rmi4-f01@1 {
reg = <0x01>;
syna,nosleep-mode = <1>;
};
rmi4_f12: rmi4-f12@12 {
reg = <0x12>;
syna,rezero-wait-ms = <20>;
syna,sensor-type = <1>;
touchscreen-x-mm = <68>;
touchscreen-y-mm = <122>;
};
};
};
&blsp1_i2c5_sleep {
/delete-property/ bias-pull-up;
/* Configure a no-pull on TP I2C sleep to match downstream. */
bias-disable;
};
&blsp1_uart3 {
status = "okay";
bluetooth {
compatible = "qcom,wcn3990-bt";
vddio-supply = <&vreg_s4a_1p8>;
vddxo-supply = <&vreg_l7a_1p8>;
vddrf-supply = <&vreg_l17a_1p3>;
vddch0-supply = <&vreg_l25a_3p3>;
max-speed = <3200000>;
};
};
&blsp1_uart3_on {
rx {
/delete-property/ bias-disable;
/*
* Configure a pull-up on 46 (RX). This is needed to
* avoid garbage data when the TX pin of the Bluetooth
* module is in tri-state (module powered off or not
* driving the signal yet).
*/
bias-pull-up;
};
cts {
/delete-property/ bias-disable;
/*
* Configure a pull-down on 47 (CTS) to match the pull
* of the Bluetooth module.
*/
bias-pull-down;
};
};
&blsp2_uart1 {
status = "okay";
};
&ipa {
status = "okay";
memory-region = <&ipa_fws_region>; // ipa_fw_mem? ipa_gsi_mem?
firmware-name = "qcom/msm8998/oneplus/ipa_fws.mbn";
};
&pm8005_lsid1 {
pm8005-regulators {
compatible = "qcom,pm8005-regulators";
vdd_s1-supply = <&vph_pwr>;
pm8005_s1: s1 { /* VDD_GFX supply */
regulator-min-microvolt = <524000>;
regulator-max-microvolt = <1100000>;
regulator-enable-ramp-delay = <500>;
/* hack until we rig up the gpu consumer */
regulator-always-on;
};
};
};
&pm8998_gpio {
vol_keys_default: vol-keys-default {
pinconf {
pins = "gpio5", "gpio6";
function = "normal";
bias-pull-up;
input-enable;
qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
};
};
};
&pmi8998_fg {
status = "okay";
qcom,max-voltage-uv = <4370000>;
qcom,min-voltage-uv = <3700000>;
qcom,battery-capacity-ua = <3300000>;
};
&pmi8998_lpg {
status = "okay";
qcom,power-source = <0>;
led@3 {
reg = <3>;
label = "blue";
};
led@4 {
reg = <4>;
label = "green";
};
led@5 {
reg = <5>;
label = "red";
};
};
&pmi8998_haptics {
status = "okay";
qcom,wave-play-rate-us = <4255>;
};
&qusb2phy {
status = "okay";
vdda-pll-supply = <&vreg_l12a_1p8>;
vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
};
&rpm_requests {
pm8998-regulators {
compatible = "qcom,rpm-pm8998-regulators";
vdd_s1-supply = <&vph_pwr>; /* GPU? */
vdd_s3-supply = <&vph_pwr>;
vdd_s4-supply = <&vph_pwr>;
vdd_s5-supply = <&vph_pwr>;
vdd_s7-supply = <&vph_pwr>;
vdd_l1-supply = <&vreg_s7a_1p025>;
vdd_l2_l17-supply = <&vreg_s3a_1p35>;
vdd_l5-supply = <&vreg_s7a_1p025>;
vdd_l6-supply = <&vreg_s5a_2p04>;
vdd_l7_l12_l14-supply = <&vreg_s5a_2p04>;
vdd_l25-supply = <&vreg_bob>;
vdd_l28-supply = <&vreg_bob>;
vdd_l20_l24-supply = <&vreg_bob>;
vdd_l26-supply = <&vreg_s3a_1p35>;
vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
vreg_s3a_1p35: s3 {
regulator-min-microvolt = <1352000>;
regulator-max-microvolt = <1352000>;
};
vreg_s4a_1p8: s4 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-allow-set-load;
};
vreg_s5a_2p04: s5 {
regulator-min-microvolt = <1904000>;
regulator-max-microvolt = <2040000>;
};
vreg_s7a_1p025: s7 {
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1028000>;
};
vreg_l1a_0p875: l1 { /* UFS PHY */
regulator-min-microvolt = <880000>;
regulator-max-microvolt = <880000>;
};
vreg_l2a_1p2: l2 { /* UFS PHY */
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
};
vreg_l5a_0p8: l5 { /* Wi-Fi */
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <800000>;
};
vreg_l6a_1p8: l6 { /* Touchscreen */
regulator-min-microvolt = <1808000>;
regulator-max-microvolt = <1808000>;
};
vreg_l7a_1p8: l7 { /* Wi-Fi + BT */
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};
vreg_l12a_1p8: l12 { /* QUSB2 PHY */
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
};
vreg_l14a_1p88: l14 { /* DSI display */
regulator-min-microvolt = <1880000>;
regulator-max-microvolt = <1880000>;
};
vreg_l17a_1p3: l17 { /* Wi-Fi + BT */
regulator-min-microvolt = <1304000>;
regulator-max-microvolt = <1304000>;
};
vreg_l20a_2p95: l20 { /* UFS HC */
regulator-min-microvolt = <2960000>;
regulator-max-microvolt = <2960000>;
regulator-allow-set-load;
};
vreg_l24a_3p075: l24 { /* QUSB2 PHY */
regulator-min-microvolt = <3088000>;
regulator-max-microvolt = <3088000>;
};
vreg_l25a_3p3: l25 { /* Wi-Fi + BT */
regulator-min-microvolt = <3104000>;
regulator-max-microvolt = <3312000>;
};
vreg_l26a_1p2: l26 { /* UFS PHY + HC */
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-allow-set-load;
};
vreg_l28_3p0: l28 { /* Touchscreen */
regulator-min-microvolt = <3008000>;
regulator-max-microvolt = <3008000>;
};
vreg_lvs1a_1p8: lvs1 { };
vreg_lvs2a_1p8: lvs2 { };
};
pmi8998-regulators {
compatible = "qcom,rpm-pmi8998-regulators";
vdd_bob-supply = <&vph_pwr>;
vreg_bob: bob {
regulator-min-microvolt = <3312000>;
regulator-max-microvolt = <3600000>;
};
};
};
&remoteproc_adsp {
status = "okay";
firmware-name = "qcom/msm8998/oneplus/adsp.mbn";
};
&remoteproc_mss {
status = "okay";
firmware-name = "qcom/msm8998/oneplus/mba.mbn", "qcom/msm8998/oneplus/modem.mbn";
};
&remoteproc_slpi {
status = "okay";
firmware-name = "qcom/msm8998/oneplus/slpi_v2.mbn";
};
&mmcc {
status = "okay";
};
&mmss_smmu {
status = "okay";
};
&mdss {
status = "okay";
};
&mdss_mdp {
status = "okay";
};
&dsi0 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
vdd-supply = <&vreg_l1a_0p875>;
vdda-supply = <&vreg_l2a_1p2>;
panel: panel@0 {
reg = <0>;
reset-gpios = <&tlmm 94 GPIO_ACTIVE_LOW>;
disp-te-gpios = <&tlmm 11 GPIO_ACTIVE_LOW>;
vddio-supply = <&vreg_l14a_1p88>; // TODO: Could this be moved under dsi0?
pinctrl-names = "default";
pinctrl-0 = <&panel_reset_n &disp_en_default &mdp_vsync_n>;
port {
panel_in: endpoint {
remote-endpoint = <&dsi0_out>;
};
};
};
};
&dsi0_phy {
status = "okay";
vdds-supply = <&vreg_l1a_0p875>;
};
&dsi0_out {
remote-endpoint = <&panel_in>;
data-lanes = <0 1 2 3>;
};
/* Adreno 540 GPU */
&gpucc {
status = "ok";
};
&gpu_mem {
compatible = "shared-dma-pool";
};
&adreno_gpu {
status = "ok";
zap-shader {
memory-region = <&zap_shader_region>; // gpu_mem?
firmware-name = "qcom/a540_zap.mbn";
};
};
&adreno_smmu {
status = "ok";
};
/*
* HACK: Shoot GPU voltage high to stabilize Adreno 540 at high frequencies
* until the GPU CPR is brought up.
*/
&pm8005_s1 {
regulator-min-microvolt = <988000>; /* 0,524V -> 0,988V */
//regulator-max-microvolt = <1100000>;
};
&tlmm {
gpio-reserved-ranges = <0 4>, <81 4>;
disp_en_default: disp-en {
pins = "gpio62";
function = "gpio";
drive-strength = <8>;
bias-disable;
};
panel_reset_n: panel-rst-n {
pins = "gpio94";
function = "gpio";
drive-strength = <8>;
bias-disable;
};
mdp_vsync_n: mdp-vsync-n {
pins = "gpio11";
function = "mdp_vsync_a";
drive-strength = <2>;
bias-pull-down;
};
hall_sensor_default: hall-sensor-default {
pins = "gpio124";
function = "gpio";
drive-strength = <2>;
bias-disable;
input-enable;
};
ts_int_active: ts-int-active {
pins = "gpio125";
function = "gpio";
drive-strength = <8>;
bias-pull-up;
};
ts_reset_active: ts-reset-active {
pins = "gpio89";
function = "gpio";
drive-strength = <8>;
bias-pull-up;
};
};
&ufshc {
status = "okay";
vcc-supply = <&vreg_l20a_2p95>;
vccq-supply = <&vreg_l26a_1p2>;
vccq2-supply = <&vreg_s4a_1p8>;
vcc-max-microamp = <750000>;
vccq-max-microamp = <560000>;
vccq2-max-microamp = <750000>;
};
&ufsphy {
status = "okay";
vdda-phy-supply = <&vreg_l1a_0p875>;
vdda-pll-supply = <&vreg_l2a_1p2>;
vddp-ref-clk-supply = <&vreg_l26a_1p2>;
vdda-phy-max-microamp = <51400>;
vdda-pll-max-microamp = <14600>;
vddp-ref-clk-max-microamp = <100>;
vddp-ref-clk-always-on;
};
&usb3 {
status = "okay";
/* Disable USB3 clock requirement as the device only supports USB2 */
qcom,select-utmi-as-pipe-clk;
};
&usb3_dwc3 {
/* Drop the unused USB 3 PHY */
phys = <&qusb2phy>;
phy-names = "usb2-phy";
/* Fastest mode for USB 2 */
maximum-speed = "high-speed";
/* Force to peripheral until we can switch modes */
dr_mode = "peripheral";
};
&wifi {
status = "okay";
vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
};