1// SPDX-License-Identifier: BSD-3-Clause 2/* 3 * Copyright (c) 2020, Konrad Dybcio <konrad.dybcio@somainline.org> 4 */ 5 6#include "msm8994.dtsi" 7#include "pm8994.dtsi" 8#include "pmi8994.dtsi" 9#include <dt-bindings/gpio/gpio.h> 10#include <dt-bindings/input/gpio-keys.h> 11 12/ { 13 /* required for bootloader to select correct board */ 14 15 /* 16 * We support MSM8994 v2 (0x20000) and v2.1 (0x20001). 17 * The V1 chip (0x0 and 0x10000) is significantly different 18 * and requires driver-side changes (including CPR, be warned!!). 19 * Besides that, it's very rare. 20 */ 21 qcom,msm-id = <207 0x20000>, <207 0x20001>; 22 /* We only use pm8994+pmi8994. */ 23 qcom,pmic-id = <0x10009 0x1000a 0x00 0x00>; 24 /* This property is shared across all kitakami devices. */ 25 qcom,board-id = <8 0>; 26 27 /* Kitakami firmware doesn't support PSCI */ 28 /delete-node/ psci; 29 30 gpio_keys { 31 compatible = "gpio-keys"; 32 input-name = "gpio-keys"; 33 #address-cells = <1>; 34 #size-cells = <0>; 35 autorepeat; 36 37 button@0 { 38 label = "Volume Down"; 39 gpios = <&pm8994_gpios 2 GPIO_ACTIVE_LOW>; 40 linux,input-type = <1>; 41 linux,code = <KEY_VOLUMEDOWN>; 42 wakeup-source; 43 debounce-interval = <15>; 44 }; 45 46 button@1 { 47 label = "Volume Up"; 48 gpios = <&pm8994_gpios 3 GPIO_ACTIVE_LOW>; 49 linux,input-type = <1>; 50 linux,code = <KEY_VOLUMEUP>; 51 wakeup-source; 52 debounce-interval = <15>; 53 }; 54 55 button@2 { 56 label = "Camera Snapshot"; 57 gpios = <&pm8994_gpios 4 GPIO_ACTIVE_LOW>; 58 linux,input-type = <1>; 59 linux,code = <KEY_CAMERA>; 60 wakeup-source; 61 debounce-interval = <15>; 62 }; 63 64 button@3 { 65 label = "Camera Focus"; 66 gpios = <&pm8994_gpios 5 GPIO_ACTIVE_LOW>; 67 linux,input-type = <1>; 68 linux,code = <KEY_VOLUMEUP>; 69 wakeup-source; 70 debounce-interval = <15>; 71 }; 72 }; 73 74 reserved-memory { 75 /* This is for getting crash logs using Android downstream kernels */ 76 ramoops@1fe00000 { 77 compatible = "ramoops"; 78 reg = <0 0x1fe00000 0 0x200000>; 79 console-size = <0x100000>; 80 record-size = <0x10000>; 81 ftrace-size = <0x10000>; 82 pmsg-size = <0x80000>; 83 }; 84 85 fb_region: fb_region@40000000 { 86 reg = <0 0x40000000 0 0x1000000>; 87 no-map; 88 }; 89 90 tzapp: memory@c7800000 { 91 reg = <0 0xc7800000 0 0x1900000>; 92 no-map; 93 }; 94 }; 95}; 96 97&blsp1_spi1 { 98 status = "okay"; 99 100 /* FPC fingerprint reader */ 101}; 102 103/* I2C1 is disabled on this board */ 104 105&blsp1_i2c2 { 106 status = "okay"; 107 clock-frequency = <355000>; 108 109 /* NXP PN547 NFC */ 110}; 111 112&blsp1_i2c4 { 113 status = "okay"; 114 clock-frequency = <355000>; 115 116 /* Empty but active */ 117}; 118 119&blsp1_i2c6 { 120 status = "okay"; 121 clock-frequency = <355000>; 122 123 touchscreen: rmi4-i2c-dev@2c { 124 compatible = "syna,rmi4-i2c"; 125 reg = <0x2c>; 126 #address-cells = <1>; 127 #size-cells = <0>; 128 129 interrupt-parent = <&tlmm>; 130 interrupts = <42 IRQ_TYPE_EDGE_FALLING>; 131 132 pinctrl-names = "default"; 133 pinctrl-0 = <&ts_int_active &ts_reset_active>; 134 135 vdd-supply = <&pm8994_l22>; 136 vio-supply = <&pm8994_s4>; 137 138 syna,reset-delay-ms = <220>; 139 syna,startup-delay-ms = <220>; 140 141 rmi4-f01@1 { 142 reg = <0x01>; 143 syna,nosleep-mode = <1>; 144 }; 145 146 rmi4-f11@11 { 147 reg = <0x11>; 148 syna,sensor-type = <1>; 149 }; 150 }; 151}; 152 153&blsp1_uart2 { 154 status = "okay"; 155}; 156 157&blsp2_i2c5 { 158 status = "okay"; 159 clock-frequency = <355000>; 160 161 /* sii8620 HDMI/MHL bridge */ 162}; 163 164&blsp2_uart2 { 165 status = "okay"; 166}; 167 168/* 169 * Kitakami bootloader only turns cont_splash on when it detects 170 * specific downstream MDSS/backlight nodes in the active DTB. 171 * One way to use that framebuffer is to load a secondary instance of 172 * LK with the downstream DTB appended and then, only from there, load 173 * mainline Linux. 174 */ 175&cont_splash_mem { 176 reg = <0 0x3401000 0 0x2200000>; 177}; 178 179&pmi8994_spmi_regulators { 180 /* 181 * Yeah, this one *is* managed by RPMPD, but also needs 182 * to be hacked up as a-o due to the GPU device only accepting a single 183 * power domain.. which still isn't enough and forces us to bind 184 * OXILI_CX and OXILI_GX together! 185 */ 186 vdd_gfx: s2 { 187 regulator-name = "VDD_GFX"; 188 regulator-min-microvolt = <980000>; 189 regulator-max-microvolt = <980000>; 190 191 /* hack until we rig up the gpu consumer */ 192 regulator-always-on; 193 }; 194}; 195 196&rpm_requests { 197 pm8994_regulators: pm8994-regulators { 198 compatible = "qcom,rpm-pm8994-regulators"; 199 200 vdd_s1-supply = <&vph_pwr>; 201 vdd_s2-supply = <&vph_pwr>; 202 vdd_s3-supply = <&vph_pwr>; 203 vdd_s4-supply = <&vph_pwr>; 204 vdd_s5-supply = <&vph_pwr>; 205 vdd_s6-supply = <&vph_pwr>; 206 vdd_s7-supply = <&vph_pwr>; 207 vdd_s8-supply = <&vph_pwr>; 208 vdd_s9-supply = <&vph_pwr>; 209 vdd_s10-supply = <&vph_pwr>; 210 vdd_s11-supply = <&vph_pwr>; 211 vdd_s12-supply = <&vph_pwr>; 212 vdd_l1-supply = <&pmi8994_s1>; 213 vdd_l2_l26_l28-supply = <&pm8994_s3>; 214 vdd_l3_l11-supply = <&pm8994_s3>; 215 vdd_l4_l27_l31-supply = <&pm8994_s3>; 216 vdd_l5_l7-supply = <&pm8994_s5>; 217 vdd_l6_l12_l32-supply = <&pm8994_s5>; 218 vdd_l8_l16_l30-supply = <&vph_pwr>; 219 vdd_l9_l10_l18_l22-supply = <&pmi8994_bby>; 220 vdd_l13_l19_l23_l24-supply = <&pmi8994_bby>; 221 vdd_l14_l15-supply = <&pm8994_s5>; 222 vdd_l17_l29-supply = <&pmi8994_bby>; 223 vdd_l20_l21-supply = <&pmi8994_bby>; 224 vdd_l25-supply = <&pm8994_s3>; 225 vdd_lvs1_lvs2-supply = <&pm8994_s4>; 226 227 /* S1, S2, S6 and S12 are managed by RPMPD */ 228 229 pm8994_s3: s3 { 230 regulator-min-microvolt = <1300000>; 231 regulator-max-microvolt = <1300000>; 232 }; 233 234 pm8994_s4: s4 { 235 regulator-min-microvolt = <1800000>; 236 regulator-max-microvolt = <1800000>; 237 regulator-allow-set-load; 238 regulator-always-on; 239 regulator-system-load = <325000>; 240 }; 241 242 pm8994_s5: s5 { 243 regulator-min-microvolt = <2150000>; 244 regulator-max-microvolt = <2150000>; 245 }; 246 247 pm8994_s7: s7 { 248 regulator-min-microvolt = <1000000>; 249 regulator-max-microvolt = <1000000>; 250 }; 251 252 /* 253 * S8 - SPMI-managed VDD_APC0 254 * S9, S10 and S11 (the main one) - SPMI-managed VDD_APC1 255 */ 256 257 pm8994_l1: l1 { 258 regulator-min-microvolt = <1000000>; 259 regulator-max-microvolt = <1000000>; 260 }; 261 262 pm8994_l2: l2 { 263 regulator-min-microvolt = <1250000>; 264 regulator-max-microvolt = <1250000>; 265 regulator-allow-set-load; 266 regulator-system-load = <10000>; 267 }; 268 269 pm8994_l3: l3 { 270 regulator-min-microvolt = <1100000>; 271 regulator-max-microvolt = <1100000>; 272 }; 273 274 pm8994_l4: l4 { 275 regulator-min-microvolt = <1225000>; 276 regulator-max-microvolt = <1225000>; 277 }; 278 279 /* L5 is inaccessible from RPM */ 280 281 pm8994_l6: l6 { 282 regulator-min-microvolt = <1800000>; 283 regulator-max-microvolt = <1800000>; 284 }; 285 286 /* L7 is inaccessible from RPM */ 287 288 pm8994_l8: l8 { 289 regulator-min-microvolt = <1800000>; 290 regulator-max-microvolt = <1800000>; 291 }; 292 293 pm8994_l9: l9 { 294 regulator-min-microvolt = <1800000>; 295 regulator-max-microvolt = <1800000>; 296 }; 297 298 pm8994_l10: l10 { 299 regulator-min-microvolt = <1800000>; 300 regulator-max-microvolt = <1800000>; 301 }; 302 303 pm8994_l11: l11 { 304 regulator-min-microvolt = <1200000>; 305 regulator-max-microvolt = <1200000>; 306 }; 307 308 pm8994_l12: l12 { 309 regulator-min-microvolt = <1800000>; 310 regulator-max-microvolt = <1800000>; 311 regulator-allow-set-load; 312 regulator-system-load = <10000>; 313 }; 314 315 pm8994_l13: l13 { 316 regulator-min-microvolt = <1800000>; 317 regulator-max-microvolt = <2950000>; 318 }; 319 320 pm8994_l14: l14 { 321 regulator-min-microvolt = <1800000>; 322 regulator-max-microvolt = <1800000>; 323 regulator-allow-set-load; 324 regulator-system-load = <10000>; 325 }; 326 327 pm8994_l15: l15 { 328 regulator-min-microvolt = <1800000>; 329 regulator-max-microvolt = <1800000>; 330 }; 331 332 pm8994_l16: l16 { 333 regulator-min-microvolt = <2700000>; 334 regulator-max-microvolt = <2700000>; 335 }; 336 337 pm8994_l17: l17 { 338 regulator-min-microvolt = <2200000>; 339 regulator-max-microvolt = <2200000>; 340 }; 341 342 pm8994_l18: l18 { 343 regulator-min-microvolt = <2850000>; 344 regulator-max-microvolt = <2850000>; 345 regulator-always-on; 346 }; 347 348 pm8994_l19: l19 { 349 regulator-min-microvolt = <2850000>; 350 regulator-max-microvolt = <2850000>; 351 }; 352 353 pm8994_l20: l20 { 354 regulator-min-microvolt = <2950000>; 355 regulator-max-microvolt = <2950000>; 356 regulator-always-on; 357 regulator-boot-on; 358 regulator-allow-set-load; 359 regulator-system-load = <570000>; 360 }; 361 362 pm8994_l21: l21 { 363 regulator-min-microvolt = <2950000>; 364 regulator-max-microvolt = <2950000>; 365 regulator-always-on; 366 regulator-allow-set-load; 367 regulator-system-load = <800000>; 368 }; 369 370 pm8994_l22: l22 { 371 regulator-min-microvolt = <3000000>; 372 regulator-max-microvolt = <3000000>; 373 }; 374 375 pm8994_l23: l23 { 376 regulator-min-microvolt = <2800000>; 377 regulator-max-microvolt = <2800000>; 378 }; 379 380 pm8994_l24: l24 { 381 regulator-min-microvolt = <3075000>; 382 regulator-max-microvolt = <3150000>; 383 }; 384 385 pm8994_l25: l25 { 386 regulator-min-microvolt = <1000000>; 387 regulator-max-microvolt = <1000000>; 388 }; 389 390 pm8994_l26: l26 { 391 regulator-min-microvolt = <987500>; 392 regulator-max-microvolt = <987500>; 393 }; 394 395 pm8994_l27: l27 { 396 regulator-min-microvolt = <1200000>; 397 regulator-max-microvolt = <1200000>; 398 }; 399 400 pm8994_l28: l28 { 401 regulator-min-microvolt = <1000000>; 402 regulator-max-microvolt = <1000000>; 403 regulator-allow-set-load; 404 regulator-system-load = <10000>; 405 }; 406 407 pm8994_l29: l29 { 408 regulator-min-microvolt = <2700000>; 409 regulator-max-microvolt = <2700000>; 410 }; 411 412 pm8994_l30: l30 { 413 regulator-min-microvolt = <1800000>; 414 regulator-max-microvolt = <1800000>; 415 }; 416 417 pm8994_l31: l31 { 418 regulator-min-microvolt = <1200000>; 419 regulator-max-microvolt = <1200000>; 420 regulator-allow-set-load; 421 regulator-system-load = <10000>; 422 }; 423 424 pm8994_l32: l32 { 425 regulator-min-microvolt = <1800000>; 426 regulator-max-microvolt = <1800000>; 427 }; 428 429 pm8994_lvs1: lvs1 {}; 430 pm8994_lvs2: lvs2 {}; 431 }; 432 433 pmi8994_regulators: pmi8994-regulators { 434 compatible = "qcom,rpm-pmi8994-regulators"; 435 436 vdd_s1-supply = <&vph_pwr>; 437 vdd_bst_byp-supply = <&vph_pwr>; 438 439 pmi8994_s1: s1 { 440 regulator-min-microvolt = <1025000>; 441 regulator-max-microvolt = <1025000>; 442 }; 443 444 /* S2 & S3 - VDD_GFX */ 445 446 pmi8994_bby: boost-bypass { 447 regulator-min-microvolt = <3150000>; 448 regulator-max-microvolt = <3600000>; 449 }; 450 }; 451}; 452 453&sdhc1 { 454 /* 455 * There is an issue with the eMMC causing permanent 456 * damage to the card if a quirk isn't addressed. 457 * Until it's fixed, disable the MMC so as not to brick 458 * devices. 459 */ 460 status = "disabled"; 461 462 /* 463 * Downstream pushes 2.95V to the sdhci device, 464 * but upstream driver REALLY wants to make vmmc 1.8v 465 * cause of the hs400-1_8v mode. MMC works fine without 466 * that regulator, so let's not use it for now. 467 * vqmmc is also disabled cause driver stll complains. 468 * 469 * vmmc-supply = <&pm8994_l20>; 470 * vqmmc-supply = <&pm8994_s4>; 471 */ 472}; 473 474&sdhc2 { 475 status = "okay"; 476 477 cd-gpios = <&tlmm 100 0>; 478 vmmc-supply = <&pm8994_l21>; 479 vqmmc-supply = <&pm8994_l13>; 480}; 481 482&tlmm { 483 ts_int_active: ts-int-active { 484 pins = "gpio42"; 485 drive-strength = <2>; 486 bias-disable; 487 input-enable; 488 }; 489 490 ts_reset_active: ts-reset-active { 491 pins = "gpio109"; 492 drive-strength = <2>; 493 bias-disable; 494 output-low; 495 }; 496}; 497