Add Xiaomi 12 Lite 5G (taoyao) device tree
cover Add Xiaomi 12 Lite 5G (taoyao) device tree
This series adds device tree support for the Xiaomi 12 Lite 5G (taoyao), based on the Qualcomm SM7325 SoC.
The display panel model is unknown, so bootloader-initialized simple-framebuffer is therefore used to expose the display.
Stanislav Zaikin (2):
dt-bindings: arm: qcom: Add SM7325 Xiaomi 12 Lite 5G (taoyao)
arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
.../devicetree/bindings/arm/qcom.yaml | 1 + arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sm7325-xiaomi-taoyao.dts | 866 ++++++++++++++++++ 3 files changed, 868 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts
Signature · 1 line
2.51.0
PATCH 1/2 dt-bindings: arm: qcom: Add SM7325 Xiaomi 12 Lite 5G (taoyao)
Xiaomi 12 Lite 5G (xiaomi,taoyao) is a smartphone based on the SM7325 SoC.
--- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
@@ -982,6 +982,7 @@ properties: - items: - enum: - nothing,spacewar + - xiaomi,taoyao - const: qcom,sm7325 - items:
Signature · 1 line
2.51.0
Re: [PATCH 1/2] dt-bindings: arm: qcom: Add SM7325 Xiaomi 12 Lite 5G (taoyao)
Quoted 8 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G (xiaomi,taoyao) is a smartphone based on the SM7325 SoC.
Signed-off-by Stanislav Zaikin <[email protected]>--- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+)
PATCH 2/2 arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
In reply to Stanislav ZaikinXiaomi 12 Lite 5G is a handset released in 2022
This commit has the following features working:
- Display (with simple fb)
- Touchscreen
- UFS
- Power and volume buttons
- Pinctrl
- RPM Regulators
- Remoteprocs - wifi, bluetooth
- USB (Device Mode)
--- arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sm7325-xiaomi-taoyao.dts | 866 ++++++++++++++++++ 2 files changed, 867 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
@@ -280,6 +280,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sm7125-xiaomi-curtana.dtb dtb-$(CONFIG_ARCH_QCOM) += sm7125-xiaomi-joyeuse.dtb dtb-$(CONFIG_ARCH_QCOM) += sm7225-fairphone-fp4.dtb dtb-$(CONFIG_ARCH_QCOM) += sm7325-nothing-spacewar.dtb +dtb-$(CONFIG_ARCH_QCOM) += sm7325-xiaomi-taoyao.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-hdk.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-microsoft-surface-duo.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtb
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +866 -0
866 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [PATCH 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 12 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
This commit has the following features working:
- Display (with simple fb)
- Touchscreen
- UFS
- Power and volume buttons
- Pinctrl
- RPM Regulators
- Remoteprocs - wifi, bluetooth
- USB (Device Mode)
Quoted 2 lines
Signed-off-by Stanislav Zaikin <[email protected]>---
Hello, this looks good, couple nits
[...]
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 123
Quoted 1 line
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +1
-0+ // S2B is really ebi.lvl but it's there for supply map completeness sake.
/* C-style comments */ are preferred
[...]
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 157
Quoted 1 line
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +1
-0+ /* Mainline video_mem is downstream cvp_mem */
What does that mean? CVP is strongly connected with the video hardware, but they're not quite the same
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +10
-0+ real_video_mem: video@8ad00000 { + reg = <0x0 0x8ad00000 0x0 0x500000>; + no-map; + }; + + ipa_gsi_mem: ipa-gsi@8b710000 { + reg = <0x0 0x8b710000 0x0 0xa000>; + no-map; + }; +
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 177
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +10
-0+ cdsp_mem: cdsp@9c700000 { + reg = <0x0 0x9c700000 0x0 0x1e00000>; + no-map; + }; + + ramoops@a9000000 { + compatible = "ramoops"; + reg = <0x0 0xa9000000 0x0 0x200000>; + pmsg-size = <0x200000>; + mem-type = <0x02>;
= <2> would be neater
If you have an easy way of modifying the (presumably) downstream-based image which you use for ramoops, you may want to add ecc-size = <8> too, so that it's more robust
[...]
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 693
Quoted 2 lines
+&tlmm {
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +1
-0+ gpio-reserved-ranges = <32 2>, <48 4>, <56 4>;
Any chance you know what they're used for? (you can often correlate them with QUP pinctrl entries, as they're often fingerprint scanner/NFC eSE connections)
If you do, please sprinkle in some comments, like in x1-crd.dtsi
[...]
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 841
Quoted 10 lines
+&usb_1 {
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +9
-0+ /* USB 2.0 only */ + qcom,select-utmi-as-pipe-clk; + + dr_mode = "otg"; + usb-role-switch; + maximum-speed = "high-speed"; + /* Remove USB3 phy */ + phys = <&usb_1_hsphy>; + phy-names = "usb2-phy";
Did you check whether that's the case with a ""real"" USB3 Type-C cable? Does a Type-C dongle with a HDMI/DP output work if you plug it in when running downstream?
Konrad
Re: [PATCH 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
In reply to Stanislav ZaikinQuoted 77 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
This commit has the following features working:
- Display (with simple fb)
- Touchscreen
- UFS
- Power and volume buttons
- Pinctrl
- RPM Regulators
- Remoteprocs - wifi, bluetooth
- USB (Device Mode)Signed-off-by Stanislav Zaikin <[email protected]>--- arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sm7325-xiaomi-taoyao.dts | 866 ++++++++++++++++++ 2 files changed, 867 insertions(+)create mode 100644
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dtsarch/arm64/boot/dts/qcom/Makefile +1
-0@@ -280,6 +280,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sm7125-xiaomi-curtana.dtb dtb-$(CONFIG_ARCH_QCOM) += sm7125-xiaomi-joyeuse.dtb dtb-$(CONFIG_ARCH_QCOM) += sm7225-fairphone-fp4.dtb dtb-$(CONFIG_ARCH_QCOM) += sm7325-nothing-spacewar.dtb +dtb-$(CONFIG_ARCH_QCOM) += sm7325-xiaomi-taoyao.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-hdk.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-microsoft-surface-duo.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtbarch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +40
-0@@ -0,0 +1,866 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (c) 2025, Stanislav Zaikin <[email protected]> + */ + +/dts-v1/; + +/* PM7250B is configured to use SID8/9 */ +#define PM7250B_SID 8 +#define PM7250B_SID1 9 + +#include <dt-bindings/arm/qcom,ids.h> +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/iio/qcom,spmi-adc7-pm7325.h> +#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h> +#include <dt-bindings/leds/common.h> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h> +#include <dt-bindings/regulator/qcom,rpmh-regulator.h> +#include <dt-bindings/sound/qcom,q6afe.h> +#include <dt-bindings/sound/qcom,q6asm.h> + +#include "sm7325.dtsi" +#include "pm7325.dtsi" +#include "pm7250b.dtsi" /* PM7250B */ +#include "pm8350c.dtsi" /* PM7350C */ +#include "pmk8350.dtsi" /* PMK7325 */ + +/* The following reserved memory regions have different addresses or sizes */ +/delete-node/ &adsp_mem; +/delete-node/ &cdsp_mem; +/delete-node/ &rmtfs_mem; + +/ { + model = "Xiaomi 12 Lite 5G"; + compatible = "xiaomi,taoyao", "qcom,sm7325"; + chassis-type = "handset"; + + aliases { + serial0 = &uart5; + serial1 = &uart7;
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 50
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +10
-0+ }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + framebuffer0: framebuffer@e1000000 { + compatible = "simple-framebuffer"; + reg = <0x0 0xe1000000 0x0 (1080 * 2400 * 4)>;
Hello Stanislav.
Use memory-region instead of reg property pointing to framebuffer.
Happy to see the phone progressing towards mainline support!
David
Quoted 159 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +159
-0+ width = <1080>; + height = <2400>; + stride = <(1080 * 4)>; + format = "a8r8g8b8"; + + clocks = <&gcc GCC_DISP_HF_AXI_CLK>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&key_vol_up>; + pinctrl-names = "default"; + + key-volume-up { + label = "Volume Up"; + gpios = <&pm7325_gpios 6 GPIO_ACTIVE_LOW>; + linux,code = <KEY_VOLUMEUP>; + }; + }; + + pmic-glink { + compatible = "qcom,sm7325-pmic-glink", + "qcom,qcm6490-pmic-glink", + "qcom,pmic-glink"; + + #address-cells = <1>; + #size-cells = <0>; + + orientation-gpios = <&tlmm 140 GPIO_ACTIVE_HIGH>; + + connector@0 { + compatible = "usb-c-connector"; + reg = <0>; + power-role = "dual"; + data-role = "dual"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + + pmic_glink_hs_in: endpoint { + remote-endpoint = <&usb_1_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + + pmic_glink_sbu: endpoint { + remote-endpoint = <&fsa4480_sbu_mux>; + }; + }; + }; + }; + }; + + vreg_oled_dvdd: regulator-oled-dvdd { + compatible = "regulator-fixed"; + regulator-name = "oled_dvdd"; + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + gpio = <&tlmm 46 GPIO_ACTIVE_HIGH>; + enable-active-high; + vin-supply = <&vreg_s1b_1p856>; + regulator-boot-on; + }; + + // S2B is really ebi.lvl but it's there for supply map completeness sake. + vreg_s2b_0p7: regulator-smpa3 { + compatible = "regulator-fixed"; + regulator-name = "vreg_s2b_0p7"; + + regulator-min-microvolt = <700000>; + regulator-max-microvolt = <700000>; + regulator-always-on; + vin-supply = <&vph_pwr>; + }; + + vph_pwr: regulator-vph-pwr { + compatible = "regulator-fixed"; + regulator-name = "vph_pwr"; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; + }; + + reserved-memory { + cdsp_secure_heap_mem: cdsp-secure-heap@81800000 { + reg = <0x0 0x81800000 0x0 0x1e00000>; + no-map; + }; + + camera_mem: camera@86200000 { + reg = <0x0 0x86200000 0x0 0x500000>; + no-map; + }; + + adsp_mem: adsp@86700000 { + reg = <0x0 0x86700000 0x0 0x4000000>; + no-map; + }; + + /* Mainline video_mem is downstream cvp_mem */ + real_video_mem: video@8ad00000 { + reg = <0x0 0x8ad00000 0x0 0x500000>; + no-map; + }; + + ipa_gsi_mem: ipa-gsi@8b710000 { + reg = <0x0 0x8b710000 0x0 0xa000>; + no-map; + }; + + cdsp_mem: cdsp@9c700000 { + reg = <0x0 0x9c700000 0x0 0x1e00000>; + no-map; + }; + + ramoops@a9000000 { + compatible = "ramoops"; + reg = <0x0 0xa9000000 0x0 0x200000>; + pmsg-size = <0x200000>; + mem-type = <0x02>; + }; + + removed_mem: removed@c0000000 { + reg = <0x0 0xc0000000 0x0 0x6800000>; + no-map; + }; + + pil_trustedvm_mem: pil-trustedvm-region@d0800000 { + reg = <0x0 0xd0800000 0x0 0x76f7000>; + no-map; + }; + + qrtr_shmem: qrtr-shmem@d7ef7000 { + reg = <0x0 0xd7ef7000 0x0 0x9000>; + no-map; + }; + + neuron_block_0_mem: neuron-block@d7f00000 { + reg = <0x0 0xd7f00000 0x0 0x80000>; + no-map; + }; + + neuron_block_1_mem: neuron-block@d7f80000 { + reg = <0x0 0xd7f80000 0x0 0x80000>; + no-map; + }; + + framebuffer@e1000000 { + reg = <0x0 0xe1000000 0x0 (1080 * 2400 * 4)>; + no-map; + }; +
[...]
Re: [PATCH 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 10 lines · David Heidelberg
Quoted 8 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
[...]
+
+ framebuffer0: framebuffer@e1000000 {
+ compatible = "simple-framebuffer";
+ reg = <0x00xe10000000x0(1080 * 2400 * 4)>;
Quoted 7 lines
Hello Stanislav.
Use memory-region instead of reg property pointing to framebuffer.
Happy to see the phone progressing towards mainline support!
David
Hello David,
Thank you for the review. I will fix it in v2.
Best regards,
Stanislav