sdm660-xiaomi-lavender.dts 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2020, Alexey Minnekhanov <[email protected]>
  4. * Copyright (c) 2021, Dang Huynh <[email protected]>
  5. */
  6. /dts-v1/;
  7. #include "sdm660.dtsi"
  8. #include "pm660.dtsi"
  9. #include "pm660l.dtsi"
  10. #include <dt-bindings/input/input.h>
  11. #include <dt-bindings/input/gpio-keys.h>
  12. / {
  13. model = "Xiaomi Redmi Note 7";
  14. compatible = "xiaomi,lavender", "qcom,sdm660";
  15. chassis-type = "handset";
  16. aliases {
  17. serial0 = &blsp1_uart2;
  18. };
  19. chosen {
  20. #address-cells = <2>;
  21. #size-cells = <2>;
  22. ranges;
  23. stdout-path = "serial0:115200n8";
  24. framebuffer0: framebuffer@9d400000 {
  25. compatible = "simple-framebuffer";
  26. reg = <0 0x9d400000 0 (1080 * 2340 * 4)>;
  27. width = <1080>;
  28. height = <2340>;
  29. stride = <(1080 * 4)>;
  30. format = "a8r8g8b8";
  31. };
  32. };
  33. vph_pwr: vph-pwr-regulator {
  34. compatible = "regulator-fixed";
  35. regulator-name = "vph_pwr";
  36. regulator-min-microvolt = <3700000>;
  37. regulator-max-microvolt = <3700000>;
  38. regulator-always-on;
  39. regulator-boot-on;
  40. };
  41. gpio-keys {
  42. compatible = "gpio-keys";
  43. key-volup {
  44. label = "Volume Up";
  45. gpios = <&pm660l_gpios 7 GPIO_ACTIVE_LOW>;
  46. linux,code = <KEY_VOLUMEUP>;
  47. debounce-interval = <15>;
  48. };
  49. };
  50. reserved-memory {
  51. #address-cells = <2>;
  52. #size-cells = <2>;
  53. ranges;
  54. ramoops@a0000000 {
  55. compatible = "ramoops";
  56. reg = <0x0 0xa0000000 0x0 0x400000>;
  57. console-size = <0x20000>;
  58. record-size = <0x20000>;
  59. ftrace-size = <0x0>;
  60. pmsg-size = <0x20000>;
  61. };
  62. framebuffer_mem: memory@9d400000 {
  63. reg = <0x0 0x9d400000 0x0 0x23ff000>;
  64. no-map;
  65. };
  66. };
  67. /*
  68. * Until we hook up type-c detection, we
  69. * have to stick with this. But it works.
  70. */
  71. extcon_usb: extcon-usb {
  72. compatible = "linux,extcon-usb-gpio";
  73. id-gpio = <&tlmm 58 GPIO_ACTIVE_HIGH>;
  74. };
  75. };
  76. &blsp1_uart2 {
  77. status = "okay";
  78. };
  79. &pon_pwrkey {
  80. status = "okay";
  81. };
  82. &pon_resin {
  83. status = "okay";
  84. linux,code = <KEY_VOLUMEDOWN>;
  85. };
  86. &qusb2phy0 {
  87. status = "okay";
  88. vdd-supply = <&vreg_l1b_0p925>;
  89. vdda-phy-dpdm-supply = <&vreg_l7b_3p125>;
  90. };
  91. &rpm_requests {
  92. pm660l-regulators {
  93. compatible = "qcom,rpm-pm660l-regulators";
  94. vdd_s1-supply = <&vph_pwr>;
  95. vdd_s2-supply = <&vph_pwr>;
  96. vdd_s3_s4-supply = <&vph_pwr>;
  97. vdd_s5-supply = <&vph_pwr>;
  98. vdd_s6-supply = <&vph_pwr>;
  99. vdd_l1_l9_l10-supply = <&vreg_s2b_1p05>;
  100. vdd_l2-supply = <&vreg_bob>;
  101. vdd_l3_l5_l7_l8-supply = <&vreg_bob>;
  102. vdd_l4_l6-supply = <&vreg_bob>;
  103. vdd_bob-supply = <&vph_pwr>;
  104. vreg_s1b_1p125: s1 {
  105. regulator-min-microvolt = <1125000>;
  106. regulator-max-microvolt = <1125000>;
  107. regulator-enable-ramp-delay = <200>;
  108. };
  109. vreg_s2b_1p05: s2 {
  110. regulator-min-microvolt = <1050000>;
  111. regulator-max-microvolt = <1050000>;
  112. regulator-enable-ramp-delay = <200>;
  113. };
  114. /* LDOs */
  115. vreg_l1b_0p925: l1 {
  116. regulator-min-microvolt = <800000>;
  117. regulator-max-microvolt = <925000>;
  118. regulator-enable-ramp-delay = <250>;
  119. regulator-allow-set-load;
  120. };
  121. /* SDHCI 3.3V signal doesn't seem to be supported. */
  122. vreg_l2b_2p95: l2 {
  123. regulator-min-microvolt = <1648000>;
  124. regulator-max-microvolt = <2696000>;
  125. regulator-enable-ramp-delay = <250>;
  126. regulator-allow-set-load;
  127. };
  128. vreg_l3b_3p3: l3 {
  129. regulator-min-microvolt = <1700000>;
  130. regulator-max-microvolt = <3300000>;
  131. regulator-enable-ramp-delay = <250>;
  132. regulator-allow-set-load;
  133. };
  134. vreg_l4b_2p95: l4 {
  135. regulator-min-microvolt = <2944000>;
  136. regulator-max-microvolt = <2952000>;
  137. regulator-enable-ramp-delay = <250>;
  138. regulator-min-microamp = <200>;
  139. regulator-max-microamp = <600000>;
  140. regulator-system-load = <570000>;
  141. regulator-allow-set-load;
  142. };
  143. /*
  144. * Downstream specifies a range of 1721-3600mV,
  145. * but the only assigned consumers are SDHCI2 VMMC
  146. * and Coresight QPDI that both request pinned 2.95V.
  147. * Tighten the range to 1.8-3.328 (closest to 3.3) to
  148. * make the mmc driver happy.
  149. */
  150. vreg_l5b_2p95: l5 {
  151. regulator-min-microvolt = <1800000>;
  152. regulator-max-microvolt = <3328000>;
  153. regulator-enable-ramp-delay = <250>;
  154. regulator-allow-set-load;
  155. regulator-system-load = <800000>;
  156. };
  157. vreg_l7b_3p125: l7 {
  158. regulator-min-microvolt = <2700000>;
  159. regulator-max-microvolt = <3125000>;
  160. regulator-enable-ramp-delay = <250>;
  161. };
  162. vreg_l8b_3p3: l8 {
  163. regulator-min-microvolt = <3200000>;
  164. regulator-max-microvolt = <3400000>;
  165. regulator-enable-ramp-delay = <250>;
  166. };
  167. vreg_bob: bob {
  168. regulator-min-microvolt = <3300000>;
  169. regulator-max-microvolt = <3600000>;
  170. regulator-enable-ramp-delay = <500>;
  171. };
  172. };
  173. pm660-regulators {
  174. compatible = "qcom,rpm-pm660-regulators";
  175. vdd_s1-supply = <&vph_pwr>;
  176. vdd_s2-supply = <&vph_pwr>;
  177. vdd_s3-supply = <&vph_pwr>;
  178. vdd_s4-supply = <&vph_pwr>;
  179. vdd_s5-supply = <&vph_pwr>;
  180. vdd_s6-supply = <&vph_pwr>;
  181. vdd_l1_l6_l7-supply = <&vreg_s5a_1p35>;
  182. vdd_l2_l3-supply = <&vreg_s2b_1p05>;
  183. vdd_l5-supply = <&vreg_s2b_1p05>;
  184. vdd_l8_l9_l10_l11_l12_l13_l14-supply = <&vreg_s4a_2p04>;
  185. vdd_l15_l16_l17_l18_l19-supply = <&vreg_bob>;
  186. /*
  187. * S1A (FTAPC0), S2A (FTAPC1), S3A (HFAPC1) are managed
  188. * by the Core Power Reduction hardened (CPRh) and the
  189. * Operating State Manager (OSM) HW automatically.
  190. */
  191. vreg_s4a_2p04: s4 {
  192. regulator-min-microvolt = <1805000>;
  193. regulator-max-microvolt = <2040000>;
  194. regulator-enable-ramp-delay = <200>;
  195. regulator-always-on;
  196. };
  197. vreg_s5a_1p35: s5 {
  198. regulator-min-microvolt = <1224000>;
  199. regulator-max-microvolt = <1350000>;
  200. regulator-enable-ramp-delay = <200>;
  201. };
  202. vreg_s6a_0p87: s6 {
  203. regulator-min-microvolt = <504000>;
  204. regulator-max-microvolt = <992000>;
  205. regulator-enable-ramp-delay = <150>;
  206. };
  207. /* LDOs */
  208. vreg_l1a_1p225: l1 {
  209. regulator-min-microvolt = <1150000>;
  210. regulator-max-microvolt = <1250000>;
  211. regulator-enable-ramp-delay = <250>;
  212. regulator-allow-set-load;
  213. };
  214. vreg_l2a_1p0: l2 {
  215. regulator-min-microvolt = <950000>;
  216. regulator-max-microvolt = <1010000>;
  217. regulator-enable-ramp-delay = <250>;
  218. };
  219. vreg_l3a_1p0: l3 {
  220. regulator-min-microvolt = <950000>;
  221. regulator-max-microvolt = <1010000>;
  222. regulator-enable-ramp-delay = <250>;
  223. };
  224. vreg_l5a_0p848: l5 {
  225. regulator-min-microvolt = <525000>;
  226. regulator-max-microvolt = <950000>;
  227. regulator-enable-ramp-delay = <250>;
  228. };
  229. vreg_l6a_1p3: l6 {
  230. regulator-min-microvolt = <1200000>;
  231. regulator-max-microvolt = <1370000>;
  232. regulator-allow-set-load;
  233. regulator-enable-ramp-delay = <250>;
  234. };
  235. vreg_l7a_1p2: l7 {
  236. regulator-min-microvolt = <1200000>;
  237. regulator-max-microvolt = <1200000>;
  238. regulator-enable-ramp-delay = <250>;
  239. };
  240. vreg_l8a_1p8: l8 {
  241. regulator-min-microvolt = <1750000>;
  242. regulator-max-microvolt = <1800000>;
  243. regulator-enable-ramp-delay = <250>;
  244. regulator-system-load = <325000>;
  245. regulator-allow-set-load;
  246. };
  247. vreg_l9a_1p8: l9 {
  248. regulator-min-microvolt = <1750000>;
  249. regulator-max-microvolt = <1900000>;
  250. regulator-enable-ramp-delay = <250>;
  251. regulator-allow-set-load;
  252. };
  253. vreg_l10a_1p8: l10 {
  254. regulator-min-microvolt = <1780000>;
  255. regulator-max-microvolt = <1950000>;
  256. regulator-enable-ramp-delay = <250>;
  257. regulator-allow-set-load;
  258. };
  259. vreg_l11a_1p8: l11 {
  260. regulator-min-microvolt = <1780000>;
  261. regulator-max-microvolt = <1950000>;
  262. regulator-enable-ramp-delay = <250>;
  263. };
  264. vreg_l12a_1p8: l12 {
  265. regulator-min-microvolt = <1780000>;
  266. regulator-max-microvolt = <1950000>;
  267. regulator-enable-ramp-delay = <250>;
  268. };
  269. /* This gives power to the LPDDR4: never turn it off! */
  270. vreg_l13a_1p8: l13 {
  271. regulator-min-microvolt = <1780000>;
  272. regulator-max-microvolt = <1950000>;
  273. regulator-enable-ramp-delay = <250>;
  274. regulator-boot-on;
  275. regulator-always-on;
  276. };
  277. vreg_l14a_1p8: l14 {
  278. regulator-min-microvolt = <1710000>;
  279. regulator-max-microvolt = <1900000>;
  280. regulator-enable-ramp-delay = <250>;
  281. };
  282. vreg_l15a_1p8: l15 {
  283. regulator-min-microvolt = <1650000>;
  284. regulator-max-microvolt = <2950000>;
  285. regulator-enable-ramp-delay = <250>;
  286. };
  287. vreg_l16a_2p7: l16 {
  288. regulator-min-microvolt = <2800000>;
  289. regulator-max-microvolt = <2800000>;
  290. regulator-enable-ramp-delay = <250>;
  291. regulator-always-on;
  292. };
  293. vreg_l17a_1p8: l17 {
  294. regulator-min-microvolt = <1648000>;
  295. regulator-max-microvolt = <2952000>;
  296. regulator-enable-ramp-delay = <250>;
  297. };
  298. vreg_l19a_3p3: l19 {
  299. regulator-min-microvolt = <3312000>;
  300. regulator-max-microvolt = <3400000>;
  301. regulator-enable-ramp-delay = <250>;
  302. regulator-allow-set-load;
  303. };
  304. };
  305. };
  306. &pm660l_wled {
  307. status = "okay";
  308. qcom,switching-freq = <800>;
  309. qcom,current-limit-microamp = <20000>;
  310. qcom,num-strings = <2>;
  311. };
  312. &sdc2_state_on {
  313. sd-cd {
  314. pins = "gpio54";
  315. bias-pull-up;
  316. drive-strength = <2>;
  317. };
  318. };
  319. &sdc2_state_off {
  320. sd-cd {
  321. pins = "gpio54";
  322. bias-disable;
  323. drive-strength = <2>;
  324. };
  325. };
  326. &sdhc_1 {
  327. status = "okay";
  328. supports-cqe;
  329. mmc-hs200-1_8v;
  330. mmc-hs400-1_8v;
  331. mmc-hs400-enhanced-strobe;
  332. vmmc-supply = <&vreg_l4b_2p95>;
  333. vqmmc-supply = <&vreg_l8a_1p8>;
  334. };
  335. &sdhc_2 {
  336. status = "okay";
  337. vmmc-supply = <&vreg_l5b_2p95>;
  338. vqmmc-supply = <&vreg_l2b_2p95>;
  339. };
  340. &tlmm {
  341. gpio-reserved-ranges = <8 4>;
  342. };
  343. &usb3 {
  344. status = "okay";
  345. };
  346. &usb3_dwc3 {
  347. dr_mode = "peripheral";
  348. extcon = <&extcon_usb>;
  349. };