Add Xiaomi 12 Lite 5G (taoyao) device tree
v4 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.
Changes in v4:
- Patch no. 1 - no changes
- Removed Konrad's R-b tag, please take a look again (patch no. 2)
- Fixed vreg_s2b_0p7 regulator name to spmb2 (patch no. 2)
- Switched bluetooth to wcn6750-pmu (patch no. 2)
- Dropped qcom,local-bd-address-broken as it has no effect (patch no. 2)
- Added wifi calibration variant "Xiaomi_taoyao" (also sent board-2.bin files to ath11k) (patch no. 2)
- Link to v3:
https://lore.kernel.org/all/[email protected]/
Changes in v3:
- Patch no. 1 - no changes
- Drop unit address for framebuffer node (patch no. 2)
- Add Konrad's R-b tag (patch no. 2)
- Link to v2:
https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Add Rob's A-b tag (patch no. 1)
- Add explicit framebuffer_reserved label (patch no. 2)
- Use memory-region for simple-framebuffer (patch no. 2)
- Fix reserved-memory naming: make node names consistent with labels and intended subsystem (CVP/camera/video) (patch no. 2)
- Convert mem-type value from <0x02> to <2> (patch no. 2)
- Fix s2b regulator comment style (patch no. 2)
- Remove unused gpio-reserved-ranges entry (<32 2>) (patch no. 2)
- Link to v1:
https://lore.kernel.org/all/[email protected]/
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 | 907 ++++++++++++++++++ 3 files changed, 909 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts
Signature · 1 line
2.51.0
PATCH v4 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
PATCH v4 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 | 907 ++++++++++++++++++ 2 files changed, 908 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 +907 -0
907 lines not on this page · raw message
Signature · 1 line
2.51.0
Re: [PATCH v4 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]>---
Konrad
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
In reply to Stanislav ZaikinQuoted 21 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 diff) +8
-0+ vreg_l7b_2p96: ldo7 { + regulator-name = "vreg_l7b_2p96"; + /* Constrained for UFS VCC, at least until UFS driver scales voltage */ + regulator-min-microvolt = <2952000>; + regulator-max-microvolt = <2952000>; + regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + }; +&ufs_mem_hc {
Review
Quoted 10 lines
(quoted diff) +10
-0+ reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>; + + vcc-supply = <&vreg_l7b_2p96>; + vcc-max-microamp = <800000>; + /* + * Technically l9b enables an eLDO (supplied by s1b) which then powers + * VCCQ2 of the UFS. + */ + vccq-supply = <&vreg_l9b_1p2>; + vccq-max-microamp = <900000>;
If this device has UFS 3.x flash, which it most likely does, the copy-pasted eLDO comment does not apply.. and VCC range is 2.4V-2.7V, 2.95 is overvoltage!
If it's actually UFS 2 after all, it would be better to rename the property to vccq2-supply.
~val
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 36 lines · Val Packett
Quoted 25 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)
[…]
+vreg_l7b_2p96: ldo7 {
+ regulator-name = "vreg_l7b_2p96";
+ /* Constrained for UFS VCC, at least until UFS driver scales voltage */
+ regulator-min-microvolt = <2952000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + };
[…]
+&ufs_mem_hc {
+ reset-gpios = <&tlmm 175GPIO_ACTIVE_LOW>;
+
+ vcc-supply = <&vreg_l7b_2p96>;Quoted 8 lines
+ vcc-max-microamp = <800000>;
+ /*
+ * Technically l9b enables an eLDO (supplied by s1b) which then powers
+ * VCCQ2 of the UFS.
+ */
+ vccq-supply = <&vreg_l9b_1p2>;
+ vccq-max-microamp = <900000>;
Quoted 1 line
If this device has UFS 3.x flash, which it most likely does, the copy-pasted eLDO comment does not apply.. and VCC range is 2.4V-2.7V, 2.95 is overvoltage!
Hello Val,
Thank you for the review.
Though you're right that this comment is a copy-paste, taoyao has ufs2. This is the explaining comment from the downstream sources:
Quoted 8 lines
/*
* Yupik target supports both UFS2.2 & UFS3.1, here
* vccq2 is supplied via eLDO, and that is controlled via
* L9B which supports a max voltage of 1.2V, but eLDO would
* supply 1.8V. and same L9B acts as vccq voltage for UFS3.1
* devices.
* Here L9B can max support for 1.2V but UFS GKI driver code
* votes for 1.8V, which is leading to failure from pmic
Quoted 8 lines
* regulator.
*
* Now since vccq and control of eLDO are common that is L9B
* we can use vccq vote as control of eLDO for vccq2.
* Hence vccq entries shall be used for both type of UFS
* devices only. And vccq entries should not be changed/removed
* for any design alteration.
*/
So I thought it's better to keep a small comment regarding eLDO.
Quoted 1 line
If it's actually UFS 2 after all, it would be better to rename the property to vccq2-supply.
Could you elaborate please? Do you mean l9b?
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 43 lines · Stanislav Zaikin
Quoted 36 lines · Val Packett
Quoted 25 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)
[…]
+vreg_l7b_2p96: ldo7 {
+ regulator-name = "vreg_l7b_2p96";
+ /* Constrained for UFS VCC, at least until UFS driver scales voltage */
+ regulator-min-microvolt = <2952000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + };
[…]
+&ufs_mem_hc {
+ reset-gpios = <&tlmm 175GPIO_ACTIVE_LOW>;
+
+ vcc-supply = <&vreg_l7b_2p96>;Quoted 8 lines
+ vcc-max-microamp = <800000>;
+ /*
+ * Technically l9b enables an eLDO (supplied by s1b) which then powers
+ * VCCQ2 of the UFS.
+ */
+ vccq-supply = <&vreg_l9b_1p2>;
+ vccq-max-microamp = <900000>;Quoted 1 line
If this device has UFS 3.x flash, which it most likely does, the copy-pasted eLDO comment does not apply.. and VCC range is 2.4V-2.7V, 2.95 is overvoltage!
Hello Val,
Thank you for the review.
Quoted 7 lines
Though you're right that this comment is a copy-paste, taoyao has ufs2. This is the explaining comment from the downstream sources:
Quoted 3 lines
/*
* Yupik target supports both UFS2.2 & UFS3.1, here
* vccq2 is supplied via eLDO, [..]So I thought it's better to keep a small comment regarding eLDO.
That's a comment from the qcom reference sources! I've literally seen it already in the downstream DTS for the device I'm currently working on (motorola-dubai) which definitely has UFS 3, hehe.
You can read /sys/bus/platform/devices/1d84000.ufshc/device_descriptor/specification_version to see which UFS spec version your flash is (0x310 == 3.1 etc.)
(Lots of interesting stuff around there, there's also health_descriptor that shows your flash's wear estimation..)
Also if you have the schematics, you can check for whether an LDO is actually present there and whether VCCQ or VCCQ2 is connected :)
Quoted 2 lines
Quoted 1 line
If it's actually UFS 2 after all, it would be better to rename the property to vccq2-supply.
Could you elaborate please? Do you mean l9b?
No, the "vccq-supply". If you look at Documentation/devicetree/bindings/ufs/ufs-common.yaml you can see it supports both vccq-supply and vccq2-supply, the former is used for UFS3 and the latter for UFS2.
Thanks,
~val
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 51 lines · Val Packett
Quoted 49 lines · Stanislav Zaikin
Quoted 36 lines · Val Packett
Quoted 25 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)
[…]
+vreg_l7b_2p96: ldo7 {
+ regulator-name = "vreg_l7b_2p96";
+ /* Constrained for UFS VCC, at least until UFS driver scales voltage */
+ regulator-min-microvolt = <2952000>;
+ regulator-max-microvolt = <2952000>;
+ regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; + };
[…]
+&ufs_mem_hc {
+ reset-gpios = <&tlmm 175GPIO_ACTIVE_LOW>;
+
+ vcc-supply = <&vreg_l7b_2p96>;Quoted 8 lines
+ vcc-max-microamp = <800000>;
+ /*
+ * Technically l9b enables an eLDO (supplied by s1b) which then powers
+ * VCCQ2 of the UFS.
+ */
+ vccq-supply = <&vreg_l9b_1p2>;
+ vccq-max-microamp = <900000>;Quoted 1 line
If this device has UFS 3.x flash, which it most likely does, the copy-pasted eLDO comment does not apply.. and VCC range is 2.4V-2.7V, 2.95 is overvoltage!
Hello Val,
Thank you for the review.
Though you're right that this comment is a copy-paste, taoyao has ufs2. This is the explaining comment from the downstream sources:
Quoted 3 lines
/*
* Yupik target supports both UFS2.2 & UFS3.1, here
* vccq2 is supplied via eLDO, [..]
Quoted 5 lines
Quoted 1 line
So I thought it's better to keep a small comment regarding eLDO.
That's a comment from the qcom reference sources! I've literally seen it already in the downstream DTS for the device I'm currently working on (motorola-dubai) which definitely has UFS 3, hehe.
You can read
/sys/bus/platform/devices/1d84000.ufshc/device_descriptor/specification_versionto see which UFS spec version your flash is (0x310== 3.1 etc.)
/home/user # cat /sys/bus/platform/devices/1d84000.ufshc/device_descriptor/specification_version
0x0220
Quoted 3 lines
(Lots of interesting stuff around there, there's also
health_descriptorthat shows your flash's wear estimation..)Also if you have the schematics, you can check for whether an LDO is actually present there and whether VCCQ or VCCQ2 is connected :)
Unfortunately, I wasn't able to find schematics. It also a bummer that I don't know panel's name because I have a (semi-generated) driver for it.
Quoted 4 lines
Quoted 2 lines
Quoted 1 line
If it's actually UFS 2 after all, it would be better to rename the property to vccq2-supply.
Could you elaborate please? Do you mean l9b?
No, the "vccq-supply". If you look at
Documentation/devicetree/bindings/ufs/ufs-common.yamlyou can see it supports bothvccq-supplyandvccq2-supply, the former is used for UFS3 and the latter for UFS2.
Will fix it in v5. Thanks a lot for so many inputs!
Best regards,
Stanislav
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
In reply to Stanislav ZaikinHello again :)
Quoted 8 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
[…]arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +6
-0+ touchscreen@0 { + compatible = "goodix,gt9916"; + reg = <0>; + + interrupts-extended = <&tlmm 81 IRQ_TYPE_LEVEL_LOW>; +
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 736
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +9
-0+ reset-gpios = <&tlmm 105 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l7c_3p0>; + vddio-supply = <&vreg_l2c_1p8>; + + spi-max-frequency = <5000000>; + + touchscreen-size-x = <10800>; + touchscreen-size-y = <24000>;
I have noticed this previously and started wondering why the size was 10x higher. Now with my own device (motorola-dubai) I actually found out why…
With the actual 1080x2400 size, the mm values reported by libinput are 10x higher than what they should be, e.g. touching the bottom right corner with libinput debug-events:
event3 TOUCH_MOTION 2 +1.493s 0 (0) 98.80/98.75 (1067.00/2370.00mm)
(2.4 meter tall phone! :D) which was mooooostly "fine" except Phosh's on-screen keyboard was accidentally detecting super-fast down swipes as I was typing normally, and suddenly closing the keyboard as I was typing.
Let's do this in a more acceptable way, in the goodix-berlin driver:
https://lore.kernel.org/all/[email protected]/
so set the properties to 1080/2400 in v5!
Thanks,
~val
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 24 lines · Val Packett
Hello again :)
Quoted 8 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
[…]
+ touchscreen@0 {
+ compatible = "goodix,gt9916";
+ reg = <0>;arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +3
-0+ + interrupts-extended = <&tlmm 81 IRQ_TYPE_LEVEL_LOW>; +arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 736
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +9
-0+ reset-gpios = <&tlmm 105 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l7c_3p0>; + vddio-supply = <&vreg_l2c_1p8>; + + spi-max-frequency = <5000000>; + + touchscreen-size-x = <10800>; + touchscreen-size-y = <24000>;I have noticed this previously and started wondering why the size was 10x higher. Now with my own device (motorola-dubai) I actually found out why…
Quoted 6 lines
With the actual 1080x2400 size, the mm values reported by libinput are 10x higher than what they should be, e.g. touching the bottom right corner with libinput debug-events:
event3 TOUCH_MOTION 2 +1.493s 0 (0) 98.80/98.75 (1067.00/2370.00mm)
(2.4 meter tall phone! :D) which was mooooostly "fine" except Phosh's on-screen keyboard was accidentally detecting super-fast down swipes as I was typing normally, and suddenly closing the keyboard as I was typing.
I wonder why some other devices with gt9916 (there are a couple in mainline) that specifies 1080x2400. I don't think we can make this assumption unless there was a mistake already in those mainline dts.
Best regards,
Stanislav
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 27 lines · Stanislav Zaikin
Quoted 26 lines · Val Packett
Hello again :)
Quoted 8 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
[…]
+ touchscreen@0 {
+ compatible = "goodix,gt9916";
+ reg = <0>;arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +3
-0+ + interrupts-extended = <&tlmm 81 IRQ_TYPE_LEVEL_LOW>; +arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 736
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +9
-0+ reset-gpios = <&tlmm 105 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l7c_3p0>; + vddio-supply = <&vreg_l2c_1p8>; + + spi-max-frequency = <5000000>; + + touchscreen-size-x = <10800>; + touchscreen-size-y = <24000>;I have noticed this previously and started wondering why the size was 10x higher. Now with my own device (motorola-dubai) I actually found out why…
With the actual 1080x2400 size, the mm values reported by libinput are 10x higher than what they should be, e.g. touching the bottom right corner with libinput debug-events:
Quoted 8 lines
Quoted 4 lines
event3 TOUCH_MOTION 2 +1.493s 0 (0) 98.80/98.75 (1067.00/2370.00mm)
(2.4 meter tall phone! :D) which was mooooostly "fine" except Phosh's on-screen keyboard was accidentally detecting super-fast down swipes as I was typing normally, and suddenly closing the keyboard as I was typing.
I wonder why some other devices with gt9916 (there are a couple in mainline) that specifies 1080x2400. I don't think we can make this assumption unless there was a mistake already in those mainline dts.
Best regards,
Stanislav
Not sure what you meant there..
I have not seen other devices do the 10800/24000 thing. Please set 1080/2400 (actual size not 10x larger).
~val
Re: [PATCH v4 2/2] arm64: dts: qcom: Add Xiaomi 12 Lite 5G (taoyao) DTS
Quoted 31 lines · Val Packett
Quoted 29 lines · Stanislav Zaikin
Quoted 28 lines · Val Packett
Hello again :)
Quoted 8 lines · Stanislav Zaikin
Xiaomi 12 Lite 5G is a handset released in 2022
[…]
+ touchscreen@0 {
+ compatible = "goodix,gt9916";
+ reg = <0>;arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +3
-0+ + interrupts-extended = <&tlmm 81 IRQ_TYPE_LEVEL_LOW>; +arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts line 736
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm7325-xiaomi-taoyao.dts new file +9
-0+ reset-gpios = <&tlmm 105 GPIO_ACTIVE_LOW>; + + avdd-supply = <&vreg_l7c_3p0>; + vddio-supply = <&vreg_l2c_1p8>; + + spi-max-frequency = <5000000>; + + touchscreen-size-x = <10800>; + touchscreen-size-y = <24000>;I have noticed this previously and started wondering why the size was 10x higher. Now with my own device (motorola-dubai) I actually found out why…
With the actual 1080x2400 size, the mm values reported by libinput are 10x higher than what they should be, e.g. touching the bottom right corner with libinput debug-events:
event3 TOUCH_MOTION 2 +1.493s 0 (0) 98.80/98.75 (1067.00/2370.00mm)
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
(2.4 meter tall phone! :D) which was mooooostly "fine" except Phosh's on-screen keyboard was accidentally detecting super-fast down swipes as I was typing normally, and suddenly closing the keyboard as I was typing.
I wonder why some other devices with gt9916 (there are a couple in mainline) that specifies 1080x2400. I don't think we can make this assumption unless there was a mistake already in those mainline dts.
Best regards,
StanislavNot sure what you meant there..
I meant the existing dts files that use gt9916:
sm8550-qrd.dts
sm8650-qrd.dts
sm8650-hdk-display-card.dtso
All of those specify 1080x2400. That means either those boards weren't tested (by physically tapping the touchscreen at least) or that there's something else.
Quoted 1 line
I have not seen other devices do the 10800/24000 thing. Please set 1080/2400 (actual size not 10x larger).
That part I get and I will.
Best regards,
Stanislav