| 1 |
// SPDX-License-Identifier: BSD-3-Clause |
| 2 |
/* |
| 3 |
* Copyright (c) 2025, Gabriel Gonzales <[email protected]> |
| 4 |
*/ |
| 5 |
|
| 6 |
/dts-v1/; |
| 7 |
|
| 8 |
#include <dt-bindings/arm/qcom,ids.h> |
| 9 |
#include <dt-bindings/gpio/gpio.h> |
| 10 |
#include <dt-bindings/input/input.h> |
| 11 |
#include <dt-bindings/input/gpio-keys.h> |
| 12 |
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> |
| 13 |
#include "sm6125.dtsi" |
| 14 |
#include "pm6125.dtsi" |
| 15 |
|
| 16 |
/ { |
| 17 |
model = "Xiaomi Redmi Note 8"; |
| 18 |
compatible = "xiaomi,ginkgo", "qcom,sm6125"; |
| 19 |
chassis-type = "handset"; |
| 20 |
|
| 21 |
/* required for bootloader to select correct board */ |
| 22 |
qcom,msm-id = <QCOM_ID_SM6125 0x10000>; |
| 23 |
qcom,board-id = <22 0>; |
| 24 |
|
| 25 |
chosen { |
| 26 |
#address-cells = <2>; |
| 27 |
#size-cells = <2>; |
| 28 |
ranges; |
| 29 |
|
| 30 |
framebuffer0: framebuffer@5c000000 { |
| 31 |
compatible = "simple-framebuffer"; |
| 32 |
reg = <0 0x5c000000 0 (2340 * 1080 * 4)>; |
| 33 |
width = <1080>; |
| 34 |
height = <2340>; |
| 35 |
stride = <(1080 * 4)>; |
| 36 |
format = "a8r8g8b8"; |
| 37 |
}; |
| 38 |
}; |
| 39 |
|
| 40 |
reserved-memory { |
| 41 |
debug_mem: debug@ffb00000 { |
| 42 |
reg = <0x0 0xffb00000 0x0 0xc0000>; |
| 43 |
no-map; |
| 44 |
}; |
| 45 |
|
| 46 |
last_log_mem: lastlog@ffbc0000 { |
| 47 |
reg = <0x0 0xffbc0000 0x0 0x80000>; |
| 48 |
no-map; |
| 49 |
}; |
| 50 |
|
| 51 |
pstore_mem: ramoops@ffc00000 { |
| 52 |
compatible = "ramoops"; |
| 53 |
reg = <0x0 0xffc40000 0x0 0xc0000>; |
| 54 |
record-size = <0x1000>; |
| 55 |
console-size = <0x40000>; |
| 56 |
pmsg-size = <0x20000>; |
| 57 |
}; |
| 58 |
|
| 59 |
cmdline_mem: memory@ffd00000 { |
| 60 |
reg = <0x0 0xffd40000 0x0 0x1000>; |
| 61 |
no-map; |
| 62 |
}; |
| 63 |
}; |
| 64 |
|
| 65 |
extcon_usb: extcon-usb { |
| 66 |
compatible = "linux,extcon-usb-gpio"; |
| 67 |
id-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>; |
| 68 |
}; |
| 69 |
|
| 70 |
gpio-keys { |
| 71 |
compatible = "gpio-keys"; |
| 72 |
|
| 73 |
pinctrl-0 = <&vol_up_n>; |
| 74 |
pinctrl-names = "default"; |
| 75 |
|
| 76 |
key-volume-up { |
| 77 |
label = "Volume Up"; |
| 78 |
gpios = <&pm6125_gpios 6 GPIO_ACTIVE_LOW>; |
| 79 |
linux,code = <KEY_VOLUMEUP>; |
| 80 |
debounce-interval = <15>; |
| 81 |
linux,can-disable; |
| 82 |
wakeup-source; |
| 83 |
}; |
| 84 |
}; |
| 85 |
}; |
| 86 |
|
| 87 |
&pm6125_gpios { |
| 88 |
vol_up_n: vol-up-n-state { |
| 89 |
pins = "gpio6"; |
| 90 |
function = "normal"; |
| 91 |
power-source = <1>; |
| 92 |
bias-pull-up; |
| 93 |
input-enable; |
| 94 |
}; |
| 95 |
}; |
| 96 |
|
| 97 |
&hsusb_phy1 { |
| 98 |
vdd-supply = <&vreg_l7a>; |
| 99 |
vdda-pll-supply = <&vreg_l10a>; |
| 100 |
vdda-phy-dpdm-supply = <&vreg_l15a>; |
| 101 |
status = "okay"; |
| 102 |
}; |
| 103 |
|
| 104 |
&pon_pwrkey { |
| 105 |
status = "okay"; |
| 106 |
}; |
| 107 |
|
| 108 |
&pon_resin { |
| 109 |
linux,code = <KEY_VOLUMEDOWN>; |
| 110 |
status = "okay"; |
| 111 |
}; |
| 112 |
|
| 113 |
&rpm_requests { |
| 114 |
regulators-0 { |
| 115 |
compatible = "qcom,rpm-pm6125-regulators"; |
| 116 |
|
| 117 |
vreg_s6a: s6 { |
| 118 |
regulator-min-microvolt = <936000>; |
| 119 |
regulator-max-microvolt = <1422000>; |
| 120 |
}; |
| 121 |
|
| 122 |
vreg_l1a: l1 { |
| 123 |
regulator-min-microvolt = <1200000>; |
| 124 |
regulator-max-microvolt = <1256000>; |
| 125 |
}; |
| 126 |
|
| 127 |
vreg_l2a: l2 { |
| 128 |
regulator-min-microvolt = <1000000>; |
| 129 |
regulator-max-microvolt = <1056000>; |
| 130 |
}; |
| 131 |
|
| 132 |
vreg_l3a: l3 { |
| 133 |
regulator-min-microvolt = <1000000>; |
| 134 |
regulator-max-microvolt = <1064000>; |
| 135 |
}; |
| 136 |
|
| 137 |
vreg_l4a: l4 { |
| 138 |
regulator-min-microvolt = <872000>; |
| 139 |
regulator-max-microvolt = <976000>; |
| 140 |
regulator-allow-set-load; |
| 141 |
}; |
| 142 |
|
| 143 |
vreg_l5a: l5 { |
| 144 |
regulator-min-microvolt = <1648000>; |
| 145 |
regulator-max-microvolt = <2950000>; |
| 146 |
regulator-allow-set-load; |
| 147 |
}; |
| 148 |
|
| 149 |
vreg_l6a: l6 { |
| 150 |
regulator-min-microvolt = <576000>; |
| 151 |
regulator-max-microvolt = <656000>; |
| 152 |
}; |
| 153 |
|
| 154 |
vreg_l7a: l7 { |
| 155 |
regulator-min-microvolt = <872000>; |
| 156 |
regulator-max-microvolt = <976000>; |
| 157 |
}; |
| 158 |
|
| 159 |
vreg_l8a: l8 { |
| 160 |
regulator-min-microvolt = <400000>; |
| 161 |
regulator-max-microvolt = <728000>; |
| 162 |
}; |
| 163 |
|
| 164 |
vreg_l9a: l9 { |
| 165 |
regulator-min-microvolt = <1800000>; |
| 166 |
regulator-max-microvolt = <1896000>; |
| 167 |
}; |
| 168 |
|
| 169 |
vreg_l10a: l10 { |
| 170 |
regulator-min-microvolt = <1800000>; |
| 171 |
regulator-max-microvolt = <1896000>; |
| 172 |
regulator-allow-set-load; |
| 173 |
}; |
| 174 |
|
| 175 |
vreg_l11a: l11 { |
| 176 |
regulator-min-microvolt = <1800000>; |
| 177 |
regulator-max-microvolt = <1952000>; |
| 178 |
regulator-allow-set-load; |
| 179 |
}; |
| 180 |
|
| 181 |
vreg_l12a: l12 { |
| 182 |
regulator-min-microvolt = <1800000>; |
| 183 |
regulator-max-microvolt = <1996000>; |
| 184 |
}; |
| 185 |
|
| 186 |
vreg_l13a: l13 { |
| 187 |
regulator-min-microvolt = <1800000>; |
| 188 |
regulator-max-microvolt = <1832000>; |
| 189 |
}; |
| 190 |
|
| 191 |
vreg_l14a: l14 { |
| 192 |
regulator-min-microvolt = <1800000>; |
| 193 |
regulator-max-microvolt = <1904000>; |
| 194 |
}; |
| 195 |
|
| 196 |
vreg_l15a: l15 { |
| 197 |
regulator-min-microvolt = <3104000>; |
| 198 |
regulator-max-microvolt = <3232000>; |
| 199 |
}; |
| 200 |
|
| 201 |
vreg_l16a: l16 { |
| 202 |
regulator-min-microvolt = <1800000>; |
| 203 |
regulator-max-microvolt = <1904000>; |
| 204 |
}; |
| 205 |
|
| 206 |
vreg_l17a: l17 { |
| 207 |
regulator-min-microvolt = <1248000>; |
| 208 |
regulator-max-microvolt = <1304000>; |
| 209 |
}; |
| 210 |
|
| 211 |
vreg_l18a: l18 { |
| 212 |
regulator-min-microvolt = <1200000>; |
| 213 |
regulator-max-microvolt = <1264000>; |
| 214 |
regulator-allow-set-load; |
| 215 |
}; |
| 216 |
|
| 217 |
vreg_l19a: l19 { |
| 218 |
regulator-min-microvolt = <1648000>; |
| 219 |
regulator-max-microvolt = <2952000>; |
| 220 |
}; |
| 221 |
|
| 222 |
vreg_l20a: l20 { |
| 223 |
regulator-min-microvolt = <1648000>; |
| 224 |
regulator-max-microvolt = <2952000>; |
| 225 |
}; |
| 226 |
|
| 227 |
vreg_l21a: l21 { |
| 228 |
regulator-min-microvolt = <2600000>; |
| 229 |
regulator-max-microvolt = <2856000>; |
| 230 |
}; |
| 231 |
|
| 232 |
vreg_l22a: l22 { |
| 233 |
regulator-min-microvolt = <2944000>; |
| 234 |
regulator-max-microvolt = <2950000>; |
| 235 |
regulator-allow-set-load; |
| 236 |
}; |
| 237 |
|
| 238 |
vreg_l23a: l23 { |
| 239 |
regulator-min-microvolt = <3000000>; |
| 240 |
regulator-max-microvolt = <3400000>; |
| 241 |
}; |
| 242 |
|
| 243 |
vreg_l24a: l24 { |
| 244 |
regulator-min-microvolt = <2944000>; |
| 245 |
regulator-max-microvolt = <2950000>; |
| 246 |
regulator-allow-set-load; |
| 247 |
}; |
| 248 |
|
| 249 |
}; |
| 250 |
}; |
| 251 |
|
| 252 |
&sdc2_off_state { |
| 253 |
sd-cd-pins { |
| 254 |
pins = "gpio98"; |
| 255 |
function = "gpio"; |
| 256 |
drive-strength = <2>; |
| 257 |
bias-disable; |
| 258 |
}; |
| 259 |
}; |
| 260 |
|
| 261 |
&sdc2_on_state { |
| 262 |
sd-cd-pins { |
| 263 |
pins = "gpio98"; |
| 264 |
function = "gpio"; |
| 265 |
drive-strength = <2>; |
| 266 |
bias-pull-up; |
| 267 |
}; |
| 268 |
}; |
| 269 |
|
| 270 |
&sdhc_1 { |
| 271 |
vmmc-supply = <&vreg_l24a>; |
| 272 |
vqmmc-supply = <&vreg_l11a>; |
| 273 |
status = "okay"; |
| 274 |
}; |
| 275 |
|
| 276 |
&sdhc_2 { |
| 277 |
cd-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>; |
| 278 |
vmmc-supply = <&vreg_l22a>; |
| 279 |
vqmmc-supply = <&vreg_l5a>; |
| 280 |
no-sdio; |
| 281 |
no-mmc; |
| 282 |
status = "okay"; |
| 283 |
}; |
| 284 |
|
| 285 |
&tlmm { |
| 286 |
gpio-reserved-ranges = <22 2>, <28 6>; |
| 287 |
}; |
| 288 |
|
| 289 |
&usb3 { |
| 290 |
status = "okay"; |
| 291 |
}; |
| 292 |
|
| 293 |
&usb3_dwc3 { |
| 294 |
extcon = <&extcon_usb>; |
| 295 |
}; |