arm64: dts: qcom: Add Xiaomi Poco M3 (citrus)
v2 cover arm64: dts: qcom: Add Xiaomi Poco M3 (citrus)
This series adds initial support for the Xiaomi Poco M3 (codename citrus), a smartphone based on the Qualcomm Snapdragon 662 (SM6115).
Currently working:
- UFS and microSD
- USB host (OTG), limited to high-speed (SuperSpeed is untested)
- WiFi
- Bluetooth
- Remoteprocs (ADSP, CDSP and modem)
The memory map for the ADSP, CDSP, IPA and GPU regions differs from the SM6115 defaults and follows the layout of the stock firmware.
Not included yet: the display panel, touchscreen and the GPU display pipeline, which depend on drivers that are not upstream. Until then the display is only available through simple-framebuffer. Audio is not included either.
Firmware and userspace: WiFi, Bluetooth and the remoteprocs need device-specific firmware which is not part of this series. WiFi additionally needs qrtr, tqftpserv and rmtfs running in userspace, and the Bluetooth controller needs its BD address set from userspace.
Tested on a Poco M3 booted from microSD with a v7.2-based kernel. The series is based on qcom/for-next, builds without new warnings with W=1 and passes CHECK_DTBS=y for qcom/sm6115-xiaomi-citrus.dtb. The existing dsi@5e94000 warning comes from sm6115.dtsi.
Changes in v2:
- Unrolled the wcn3950-pmu regulator scopes, used lowercase hex and kept a blank line before 'status' (Konrad)
- gpio-reserved-ranges: dropped <0 4>, the device boots fine without it. Kept <14 4> (SE5 SPI), without it the device bootloops. Added a comment (Konrad)
- Kept citrus separate from lemon: reserved-memory, PM6125 regulators and the wifi/bluetooth bits differ, and I can't test lemon (Konrad)
- Patch 1/2: no changes
Link to v1:
https://lore.kernel.org/all/[email protected]/
Amir Hanip (2):
dt-bindings: arm: qcom: Document Xiaomi Poco M3
arm64: dts: qcom: Add Xiaomi Poco M3
.../devicetree/bindings/arm/qcom.yaml | 1 + arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sm6115-xiaomi-citrus.dts | 538 ++++++++++++++++++ 3 files changed, 540 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts
Signature · 1 line
2.47.3
PATCH v2 1/2 dt-bindings: arm: qcom: Document Xiaomi Poco M3
Add compatible for Xiaomi Poco M3 codename citrus, which is based on Snapdragon 662 (SM6115) SoC.
--- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
@@ -1068,6 +1068,7 @@ properties: - items: - enum: - fxtec,pro1x + - xiaomi,citrus - xiaomi,lemon - const: qcom,sm6115
Signature · 1 line
2.47.3
Re: [PATCH v2 1/2] dt-bindings: arm: qcom: Document Xiaomi Poco M3
Quoted 7 lines · Amir Hanip
Add compatible for Xiaomi Poco M3 codename citrus, which is based on Snapdragon 662 (SM6115) SoC.
Signed-off-by Amir Hanip <[email protected]>--- Documentation/devicetree/bindings/arm/qcom.yaml | 1 + 1 file changed, 1 insertion(+)
Best regards,
Krzysztof
PATCH v2 2/2 arm64: dts: qcom: Add Xiaomi Poco M3
In reply to Amir HanipAdd initial device tree for the Xiaomi Poco M3 (codename citrus), based on the Qualcomm Snapdragon 662 (SM6115) SoC.
Currently working:
- UFS and microSD
- USB host (OTG)
- WiFi
- Bluetooth
- Remoteprocs (ADSP, CDSP and modem)
WiFi, Bluetooth and the remoteprocs need device-specific firmware, which is not part of this series. WiFi additionally needs qrtr, tqftpserv and rmtfs running in userspace, and the Bluetooth controller needs its BD address set from userspace.
Display panel, touchscreen, and the GPU display pipeline will be added later, so the display is currently only available through simple-framebuffer.
--- arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sm6115-xiaomi-citrus.dts | 538 ++++++++++++++++++ 2 files changed, 539 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
@@ -386,6 +386,7 @@ dtb-$(CONFIG_ARCH_QCOM) += shikra-iqs-evk-imx577-camera.dtb dtb-$(CONFIG_ARCH_QCOM) += sm4250-oneplus-billie2.dtb dtb-$(CONFIG_ARCH_QCOM) += sm4450-qrd.dtb dtb-$(CONFIG_ARCH_QCOM) += sm6115-fxtec-pro1x.dtb +dtb-$(CONFIG_ARCH_QCOM) += sm6115-xiaomi-citrus.dtb dtb-$(CONFIG_ARCH_QCOM) += sm6115-xiaomi-lemon.dtb dtb-$(CONFIG_ARCH_QCOM) += sm6115p-lenovo-j606f.dtb dtb-$(CONFIG_ARCH_QCOM) += sm6125-sony-xperia-seine-pdx201.dtb
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +538 -0
538 lines not on this page · raw message
Signature · 1 line
2.47.3
[email protected]
AI reviewRe: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] arm64: dts: qcom: citrus: wifi node bypasses wcn3950-pmu regulators - [Low] arm64: dts: qcom…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] arm64: dts: qcom: citrus: wifi node bypasses wcn3950-pmu regulators
- [Low] arm64: dts: qcom: citrus: mismatched unit-addresses on reserved-memory nodes --
commit f6a18aab14c146c73ad430a3e102de48b29909dc
Author: Amir Hanip <[email protected]>
arm64: dts: qcom: Add Xiaomi Poco M3
This commit adds the initial device tree for the Xiaomi Poco M3 (codename citrus) based on the Qualcomm Snapdragon 662 (SM6115) SoC, enabling UFS, microSD, USB host, WiFi, Bluetooth, and remoteprocs.
Quoted 5 lines
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +0
-0
[ ... ]
Quoted 36 lines
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +36
-0+ wcn3950-pmu { + compatible = "qcom,wcn3950-pmu"; + + pinctrl-0 = <&sw_ctrl_default>; + pinctrl-names = "default"; + + vddio-supply = <&pm6125_l9>; + vddxo-supply = <&pm6125_l16>; + vddrf-supply = <&pm6125_l17>; + vddch0-supply = <&pm6125_l23>; + + swctrl-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>; + + regulators { + vreg_pmu_io: ldo0 { + regulator-name = "vreg_pmu_io"; + }; + + vreg_pmu_xo: ldo1 { + regulator-name = "vreg_pmu_xo"; + }; + + vreg_pmu_rf: ldo2 { + regulator-name = "vreg_pmu_rf"; + }; + + vreg_pmu_ch0: ldo3 { + regulator-name = "vreg_pmu_ch0"; + }; + + vreg_pmu_ch1: ldo4 { + regulator-name = "vreg_pmu_ch1"; + }; + }; + }; +};
[ ... ]
Quoted 9 lines
+&pil_adsp_mem {
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +8
-0+ reg = <0x0 0x53800000 0x0 0x2200000>; +}; + +&pil_cdsp_mem { + reg = <0x0 0x51a00000 0x0 0xa00000>; +}; + +&pil_gpu_mem {
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts line 132
Quoted 10 lines
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +10
-0+ reg = <0x0 0x55a15000 0x0 0x2000>; +}; + +&pil_ipa_fw_mem { + reg = <0x0 0x55a00000 0x0 0x10000>; +}; + +&pil_ipa_gsi_mem { + reg = <0x0 0x55a10000 0x0 0x5000>; +};
[Severity: Low]
In arch/arm64/boot/dts/qcom/sm6115.dtsi, pil_ipa_fw_mem, pil_ipa_gsi_mem, and pil_gpu_mem are declared under /reserved-memory with unit-addresses matching their original base addresses:
arch/arm64/boot/dts/qcom/sm6115.dtsi:
pil_ipa_fw_mem: memory@56100000 {
reg = <0x0 0x56100000 0x0 0x10000>;
no-map;
};
pil_ipa_gsi_mem: memory@56110000 {
reg = <0x0 0x56110000 0x0 0x5000>;
no-map;
};
pil_gpu_mem: memory@56115000 {
reg = <0x0 0x56115000 0x0 0x2000>;
no-map;
};Overriding their reg properties in-place leaves the compiled DTB with memory@56100000, memory@56110000, and memory@56115000 nodes whose unit-addresses no longer match their reg base addresses (0x55a00000, 0x55a10000, and 0x55a15000), which causes dtbs_check warnings.
Should these nodes be removed with /delete-node/ and recreated under /reserved-memory with matching unit-addresses (memory@55a00000, memory@55a10000, and memory@55a15000)?
[ ... ]
Quoted 15 lines
+&uart3 {
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +14
-0+ pinctrl-0 = <&uart3_default>; + pinctrl-1 = <&uart3_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3950-bt"; + vddio-supply = <&vreg_pmu_io>; + vddxo-supply = <&vreg_pmu_xo>; + vddrf-supply = <&vreg_pmu_rf>; + vddch0-supply = <&vreg_pmu_ch0>; + }; +};
[ ... ]
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts line 534
Quoted 9 lines
+&wifi {
arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +8
-0+ vdd-0.8-cx-mx-supply = <&pm6125_l4>; + vdd-1.8-xo-supply = <&pm6125_l16>; + vdd-1.3-rfa-supply = <&pm6125_l17>; + vdd-3.3-ch0-supply = <&pm6125_l23>; + vdd-3.3-ch1-supply = <&pm6125_l24>; + + status = "okay"; +};
[Severity: Medium]
Should the wifi node reference the wcn3950-pmu regulators (&vreg_pmu_xo, &vreg_pmu_rf, and &vreg_pmu_ch0) instead of pointing directly to the PM6125 RPM regulators?
When drivers/power/sequencing/pwrseq-qcom-wcn.c binds to wcn3950-pmu, pwrseq_qcom_wcn3990_match() matches the WiFi device by checking whether vdd-1.8-xo-supply resolves to a regulator subnode under wcn3950-pmu:
drivers/power/sequencing/pwrseq-qcom-wcn.c:pwrseq_qcom_wcn3990_match() {
/* BT device */
ret = pwrseq_qcom_wcn_match_regulator(pwrseq, dev, "vddio-supply");
if (ret == PWRSEQ_MATCH_OK)
return ret;
/* WiFi device match */
return pwrseq_qcom_wcn_match_regulator(pwrseq, dev, "vdd-1.8-xo-supply");
}Because wifi points vdd-1.8-xo-supply directly to &pm6125_l16 rather than &vreg_pmu_xo, pwrseq_qcom_wcn3990_match() returns PWRSEQ_NO_MATCH, causing devm_pwrseq_get(&pdev->dev, "wlan") in ath10k_snoc_probe() to return -EPROBE_DEFER and fall back to legacy regulator management with ar_snoc->pwrseq = NULL:
drivers/net/wireless/ath/ath10k/snoc.c:ath10k_snoc_probe() {
ar_snoc->pwrseq = devm_pwrseq_get(&pdev->dev, "wlan");
if (IS_ERR(ar_snoc->pwrseq)) {
ret = PTR_ERR(ar_snoc->pwrseq);
ar_snoc->pwrseq = NULL;
if (ret != -EPROBE_DEFER)
goto err_free_irq;
ar_snoc->num_vregs = ARRAY_SIZE(ath10k_regulators);
} else {
ar_snoc->num_vregs = 1;
}
}As a result, ath10k bypasses the wcn3950-pmu power sequencer and never enables or votes on vddio-supply (&pm6125_l9), which is only referenced by wcn3950-pmu and is not in ath10k_regulators[]. Will this leave vddio unpowered when WiFi is used while Bluetooth is off, or cause pwrseq_disable() to turn off &pm6125_l9 when Bluetooth is disabled while WiFi is active?
Also, if ch1 is used on this board, should wcn3950-pmu define vddch1-supply and wifi reference &vreg_pmu_ch1, or if WCN3950 only uses ch0, should vdd-3.3-ch1-supply on wifi and vreg_pmu_ch1 on wcn3950-pmu be dropped?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
In reply to Amir HanipQuoted 15 lines · Amir Hanip
Add initial device tree for the Xiaomi Poco M3 (codename citrus), based on the Qualcomm Snapdragon 662 (SM6115) SoC.
Currently working:
- UFS and microSD
- USB host (OTG)
- WiFi
- Bluetooth
- Remoteprocs (ADSP, CDSP and modem)WiFi, Bluetooth and the remoteprocs need device-specific firmware, which is not part of this series. WiFi additionally needs qrtr, tqftpserv and rmtfs running in userspace, and the Bluetooth controller needs its BD address set from userspace.
Quoted 6 lines
Display panel, touchscreen, and the GPU display pipeline will be added later, so the display is currently only available through simple-framebuffer.
Signed-off-by Amir Hanip <[email protected]>---
Konrad
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
In reply to Amir HanipQuoted 31 lines · Amir Hanip
Add initial device tree for the Xiaomi Poco M3 (codename citrus), based on the Qualcomm Snapdragon 662 (SM6115) SoC.
Currently working:
- UFS and microSD
- USB host (OTG)
- WiFi
- Bluetooth
- Remoteprocs (ADSP, CDSP and modem)WiFi, Bluetooth and the remoteprocs need device-specific firmware, which is not part of this series. WiFi additionally needs qrtr, tqftpserv and rmtfs running in userspace, and the Bluetooth controller needs its BD address set from userspace.
Display panel, touchscreen, and the GPU display pipeline will be added later, so the display is currently only available through simple-framebuffer.
Signed-off-by Amir Hanip <[email protected]>--- arch/arm64/boot/dts/qcom/Makefile | 1 + .../boot/dts/qcom/sm6115-xiaomi-citrus.dts | 538 ++++++++++++++++++ 2 files changed, 539 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dtsarch/arm64/boot/dts/qcom/Makefile +0
-0@@ -386,6 +386,7 @@ dtb-$(CONFIG_ARCH_QCOM) +=
Quoted 5 lines
shikra-iqs-evk-imx577-camera.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm4250-oneplus-billie2.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm4450-qrd.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm6115-fxtec-pro1x.dtb
+dtb-$(CONFIG_ARCH_QCOM) += sm6115-xiaomi-citrus.dtb
Hi,
Poco M3 (citrus) is same HW like Redmi 9T (lime) and Remi 9T NFC (lemon) basically is
a lime with NFC.
So i think it would be better make a common base from lemon's devicetree instead of making the same devicetree again for the different variants where only the compatible and the model property will be the difference.
Check sm6125-xiaomi-gingkgo-common for example, it was the same case for Redmi Note 8 (ginkgo) and 8T (willow).
Quoted 547 lines
dtb-$(CONFIG_ARCH_QCOM) += sm6115-xiaomi-lemon.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm6115p-lenovo-j606f.dtb
dtb-$(CONFIG_ARCH_QCOM) += sm6125-sony-xperia-seine-pdx201.dtbarch/arm64/boot/dts/qcom/sm6115-xiaomi-citrus.dts new file +538
-0@@ -0,0 +1,538 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright (c) 2023 - 2024, Dang Huynh <[email protected]> + * Copyright (c) 2026, Amir Hanip <[email protected]> + */ + +/dts-v1/; + +#include "sm6115.dtsi" +#include "pm6125.dtsi" +#include "pmi632.dtsi" +#include <dt-bindings/arm/qcom,ids.h> + +/delete-node/ &cdsp_sec_mem; + +/ { + model = "Xiaomi Poco M3"; + compatible = "xiaomi,citrus", "qcom,sm6115"; + chassis-type = "handset"; + + qcom,msm-id = <QCOM_ID_SM4250 0x10000>, <QCOM_ID_SM6115 0x10000>; + qcom,board-id = <0x00 0x303>; + + aliases { + serial1 = &uart3; + }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + framebuffer0: framebuffer@5c000000 { + compatible = "simple-framebuffer"; + reg = <0x0 0x5c000000 0x0 (1080 * 2340 * 4)>; + width = <1080>; + height = <2340>; + stride = <(1080 * 4)>; + format = "a8r8g8b8"; + clocks = <&gcc GCC_DISP_HF_AXI_CLK>; + }; + }; + + gpio-keys { + compatible = "gpio-keys"; + + pinctrl-0 = <&vol_up_n>; + pinctrl-names = "default"; + + key-volume-up { + label = "Volume Up"; + linux,code = <KEY_VOLUMEUP>; + gpios = <&pm6125_gpios 5 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + linux,can-disable; + wakeup-source; + }; + }; + + wcn3950-pmu { + compatible = "qcom,wcn3950-pmu"; + + pinctrl-0 = <&sw_ctrl_default>; + pinctrl-names = "default"; + + vddio-supply = <&pm6125_l9>; + vddxo-supply = <&pm6125_l16>; + vddrf-supply = <&pm6125_l17>; + vddch0-supply = <&pm6125_l23>; + + swctrl-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>; + + regulators { + vreg_pmu_io: ldo0 { + regulator-name = "vreg_pmu_io"; + }; + + vreg_pmu_xo: ldo1 { + regulator-name = "vreg_pmu_xo"; + }; + + vreg_pmu_rf: ldo2 { + regulator-name = "vreg_pmu_rf"; + }; + + vreg_pmu_ch0: ldo3 { + regulator-name = "vreg_pmu_ch0"; + }; + + vreg_pmu_ch1: ldo4 { + regulator-name = "vreg_pmu_ch1"; + }; + }; + }; +}; + +&dispcc { + /* Prevent simplefb from dying until we wire panel driver */ + status = "disabled"; +}; + +&gpi_dma0 { + status = "okay"; +}; + +&gpu { + status = "okay"; +}; + +&gpu_zap_shader { + firmware-name = "qcom/sm6115/xiaomi-citrus/a610_zap.mbn"; +}; + +&pil_adsp_mem { + reg = <0x0 0x53800000 0x0 0x2200000>; +}; + +&pil_cdsp_mem { + reg = <0x0 0x51a00000 0x0 0xa00000>; +}; + +&pil_gpu_mem { + reg = <0x0 0x55a15000 0x0 0x2000>; +}; + +&pil_ipa_fw_mem { + reg = <0x0 0x55a00000 0x0 0x10000>; +}; + +&pil_ipa_gsi_mem { + reg = <0x0 0x55a10000 0x0 0x5000>; +}; + +&pm6125_gpios { + vol_up_n: vol-up-n-state { + pins = "gpio5"; + function = "normal"; + power-source = <0>; + bias-pull-up; + input-enable; + }; +}; + +&pmi632_typec { + status = "okay"; + + connector { + compatible = "usb-c-connector"; + + power-role = "dual"; + data-role = "dual"; + self-powered; + + typec-power-opmode = "default"; + pd-disable; + + vbus-supply = <&pmi632_vbus>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + pmi632_hs_in: endpoint { + remote-endpoint = <&usb_dwc3_hs>; + }; + }; + + port@1 { + reg = <1>; + pmi632_ss_in: endpoint { + remote-endpoint = <&usb_qmpphy_out>; + }; + }; + }; + }; +}; + +&pmi632_vbus { + regulator-min-microamp = <500000>; + regulator-max-microamp = <1000000>; + + status = "okay"; +}; + +&pon_pwrkey { + status = "okay"; +}; + +&pon_resin { + linux,code = <KEY_VOLUMEDOWN>; + + status = "okay"; +}; + +&qupv3_id_0 { + status = "okay"; +}; + +&remoteproc_adsp { + firmware-name = "qcom/sm6115/xiaomi-citrus/adsp.mdt"; + + status = "okay"; +}; + +&remoteproc_cdsp { + firmware-name = "qcom/sm6115/xiaomi-citrus/cdsp.mdt"; + + status = "okay"; +}; + +&remoteproc_mpss { + firmware-name = "qcom/sm6115/xiaomi-citrus/modem.mdt"; + + status = "okay"; +}; + +&rpm_requests { + regulators-0 { + compatible = "qcom,rpm-pm6125-regulators"; + + pm6125_s6: s6 { + regulator-min-microvolt = <304000>; + regulator-max-microvolt = <1456000>; + }; + + pm6125_s7: s7 { + regulator-min-microvolt = <1280000>; + regulator-max-microvolt = <2040000>; + }; + + pm6125_s8: s8 { + regulator-min-microvolt = <1064000>; + regulator-max-microvolt = <1304000>; + }; + + pm6125_l1: l1 { + regulator-min-microvolt = <952000>; + regulator-max-microvolt = <1152000>; + }; + + pm6125_l4: l4 { + regulator-min-microvolt = <488000>; + regulator-max-microvolt = <1000000>; + }; + + pm6125_l5: l5 { + regulator-min-microvolt = <1648000>; + regulator-max-microvolt = <3056000>; + regulator-allow-set-load; + }; + + pm6125_l6: l6 { + regulator-min-microvolt = <576000>; + regulator-max-microvolt = <656000>; + }; + + pm6125_l7: l7 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1304000>; + }; + + pm6125_l8: l8 { + regulator-min-microvolt = <400000>; + regulator-max-microvolt = <728000>; + }; + + pm6125_l9: l9 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2000000>; + }; + + pm6125_l10: l10 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <1904000>; + }; + + pm6125_l11: l11 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <1952000>; + regulator-allow-set-load; + }; + + pm6125_l12: l12 { + regulator-min-microvolt = <1624000>; + regulator-max-microvolt = <1984000>; + }; + + pm6125_l13: l13 { + regulator-min-microvolt = <1504000>; + regulator-max-microvolt = <1952000>; + }; + + pm6125_l14: l14 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <1904000>; + }; + + pm6125_l15: l15 { + regulator-min-microvolt = <2920000>; + regulator-max-microvolt = <3232000>; + }; + + pm6125_l16: l16 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <1904000>; + }; + + pm6125_l17: l17 { + regulator-min-microvolt = <1304000>; + regulator-max-microvolt = <1304000>; + }; + + pm6125_l18: l18 { + regulator-min-microvolt = <1104000>; + regulator-max-microvolt = <1312000>; + }; + + pm6125_l19: l19 { + regulator-min-microvolt = <1624000>; + regulator-max-microvolt = <3304000>; + }; + + pm6125_l20: l20 { + regulator-min-microvolt = <1624000>; + regulator-max-microvolt = <3304000>; + }; + + pm6125_l21: l21 { + regulator-min-microvolt = <2400000>; + regulator-max-microvolt = <3600000>; + }; + + pm6125_l22: l22 { + regulator-min-microvolt = <2952000>; + regulator-max-microvolt = <3304000>; + }; + + pm6125_l23: l23 { + regulator-min-microvolt = <3200000>; + regulator-max-microvolt = <3400000>; + }; + + pm6125_l24: l24 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <3600000>; + regulator-allow-set-load; + }; + }; +}; + +&sdc2_state_off { + cd-pins { + pins = "gpio88"; + function = "gpio"; + drive-strength = <2>; + bias-disable; + }; +}; + +&sdc2_state_on { + cd-pins { + pins = "gpio88"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; +}; + +&sdhc_2 { + pinctrl-0 = <&sdc2_state_on>; + pinctrl-1 = <&sdc2_state_off>; + pinctrl-names = "default", "sleep"; + + cd-gpios = <&tlmm 88 GPIO_ACTIVE_HIGH>; + + vmmc-supply = <&pm6125_l22>; + vqmmc-supply = <&pm6125_l5>; + + status = "okay"; +}; + +&sleep_clk { + clock-frequency = <32764>; +}; + +&tlmm { + gpio-reserved-ranges = <14 4>; /* SE5 SPI, not usable from Linux */ + + uart3_default: uart3-default-state { + cts-pins { + pins = "gpio8"; + function = "qup3"; + drive-strength = <2>; + bias-bus-hold; + }; + + rts-pins { + pins = "gpio9"; + function = "qup3"; + drive-strength = <2>; + bias-disable; + }; + + tx-pins { + pins = "gpio10"; + function = "qup3"; + drive-strength = <2>; + bias-disable; + }; + + rx-pins { + pins = "gpio11"; + function = "qup3"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + uart3_sleep: uart3-sleep-state { + cts-pins { + pins = "gpio8"; + function = "gpio"; + drive-strength = <2>; + bias-bus-hold; + }; + + rts-pins { + pins = "gpio9"; + function = "gpio"; + drive-strength = <2>; + bias-pull-down; + }; + + tx-pins { + pins = "gpio10"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + + rx-pins { + pins = "gpio11"; + function = "gpio"; + drive-strength = <2>; + bias-pull-up; + }; + }; + + sw_ctrl_default: sw-ctrl-default-state { + pins = "gpio87"; + function = "gpio"; + bias-pull-down; + }; +}; + +&uart3 { + pinctrl-0 = <&uart3_default>; + pinctrl-1 = <&uart3_sleep>; + pinctrl-names = "default", "sleep"; + + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3950-bt"; + vddio-supply = <&vreg_pmu_io>; + vddxo-supply = <&vreg_pmu_xo>; + vddrf-supply = <&vreg_pmu_rf>; + vddch0-supply = <&vreg_pmu_ch0>; + }; +}; + +&ufs_mem_hc { + vcc-supply = <&pm6125_l24>; + vcc-max-microamp = <600000>; + vccq2-supply = <&pm6125_l11>; + vccq2-max-microamp = <600000>; + vdd-hba-supply = <&pm6125_l18>; + + status = "okay"; +}; + +&ufs_mem_phy { + vdda-phy-supply = <&pm6125_l4>; + vdda-pll-supply = <&pm6125_l12>; + + status = "okay"; +}; + +&usb { + status = "okay"; +}; + +&usb_dwc3 { + maximum-speed = "high-speed"; + + status = "okay"; +}; + +&usb_dwc3_hs { + remote-endpoint = <&pmi632_hs_in>; +}; + +&usb_hsphy { + vdd-supply = <&pm6125_l4>; + vdda-pll-supply = <&pm6125_l12>; + vdda-phy-dpdm-supply = <&pm6125_l15>; + + status = "okay"; +}; + +&usb_qmpphy { + /delete-property/ orientation-switch; + + vdda-phy-supply = <&pm6125_l4>; + vdda-pll-supply = <&pm6125_l12>; + + status = "okay"; +}; + +&usb_qmpphy_out { + remote-endpoint = <&pmi632_ss_in>; +}; + +&wifi { + vdd-0.8-cx-mx-supply = <&pm6125_l4>; + vdd-1.8-xo-supply = <&pm6125_l16>; + vdd-1.3-rfa-supply = <&pm6125_l17>; + vdd-3.3-ch0-supply = <&pm6125_l23>; + vdd-3.3-ch1-supply = <&pm6125_l24>; + + status = "okay"; +}; + +&xo_board { + clock-frequency = <19200000>; +};
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Quoted 8 lines · Barnabas Czeman
Poco M3 (citrus) is same HW like Redmi 9T (lime) and Remi 9T NFC (lemon) basically is a lime with NFC.
So i think it would be better make a common base from lemon's devicetree instead of making the same devicetree again for the different variants where only the compatible and the model property will be the difference.
Check sm6115-xiaomi-gingkgo-common for example, it was the same case for Redmi Note 8 (ginkgo) and 8T (willow).
Hi Barnabas, Adam,
Thanks for the review, that makes sense. I am preparing a v3 that moves the shared parts of lemon into sm6115-xiaomi-lime-common.dtsi and has both lemon and citrus include it. I used the name lime-common following your naming. Happy to rename it.
Plan for v3:
1. dt-bindings (unchanged)
2. lemon: move the shared nodes into the common dtsi, no functional change intended
3. citrus on top of the common dtsi
I can only test citrus. I do not own a Redmi 9T, so lemon is untested on hardware. Instead, I compared the lemon DTS before and after the split, normalized with dtc (dtc -I dts -O dts -s). The only difference is the numbering of two auto-generated phandles. I will describe the check in the cover letter. Adam,
would you be able to test lemon once v3 is posted, or look at the split beforehand?
The IPA carve-outs (pil_ipa_fw_mem and pil_ipa_gsi_mem) are identical on both, so they now live in the common dtsi.
I kept the following per variant because I cannot tell whether they are real hardware differences or just differences between the stock firmware images:
- ADSP carve-out: 0x53800000/0x2200000 on citrus, 0x53400000/0x2600000 on lemon. Both regions end at 0x55a00000, so only the start and size differ. I can only confirm that the citrus value works on my device.
- GPU carve-out: 0x55a15000 on citrus (right after pil_ipa_gsi_mem, like the SoC dtsi defaults), 0xfa400000 on lemon. The citrus value
works: the GPU runs with a full DT that includes the display pipeline, which is not part of this series. I cannot verify lemon's value. Adam, is 0xfa400000 intentional?
- PM6125 regulators: seven have different voltage ranges (s7, l5, l7, l11, l17, l18, l22). l24 has the same range, but only citrus sets regulator-allow-set-load. lemon also marks l5, l7 and l22 as always-on, citrus does not.
- citrus deletes cdsp_sec_mem and the orientation-switch property of usb_qmpphy, lemon does not.
Barnabas, Adam: do you know whether these differences are real, or whether they only come from the firmware of each model?
Thanks,
Amir
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Quoted 34 lines · Amir Hanip
Quoted 8 lines · Barnabas Czeman
Poco M3 (citrus) is same HW like Redmi 9T (lime) and Remi 9T NFC (lemon) basically is a lime with NFC.
So i think it would be better make a common base from lemon's devicetree instead of making the same devicetree again for the different variants where only the compatible and the model property will be the difference.
Check sm6115-xiaomi-gingkgo-common for example, it was the same case for Redmi Note 8 (ginkgo) and 8T (willow).Hi Barnabas, Adam,
Thanks for the review, that makes sense. I am preparing a v3 that moves the shared parts of lemon into
sm6115-xiaomi-lime-common.dtsiand has both lemon and citrus include it. I used the name lime-common following your naming. Happy to rename it.Plan for v3:
1. dt-bindings (unchanged)
2. lemon: move the shared nodes into the common dtsi, no functional change intended
3. citrus on top of the common dtsiI can only test citrus. I do not own a Redmi 9T, so lemon is untested on hardware. Instead, I compared the lemon DTS before and after the split, normalized with dtc (dtc -I dts -O dts -s). The only difference is the numbering of two auto-generated phandles. I will describe the check in the cover letter. Adam,
would you be able to test lemon once v3 is posted, or look at the split beforehand?The IPA carve-outs (
pil_ipa_fw_memandpil_ipa_gsi_mem) are identical on both, so they now live in the common dtsi.
Quoted 8 lines
I kept the following per variant because I cannot tell whether they are real hardware differences or just differences between the stock firmware images:
- ADSP carve-out: 0x53800000/0x2200000 on citrus, 0x53400000/0x2600000 on lemon. Both regions end at
0x55a00000, so only the start and size differ. I can only confirm that the citrus value works on my device.
If there are no overlaps the bigger range could work for both of them.
Quoted 9 lines
- GPU carve-out:
0x55a15000on citrus (right afterpil_ipa_gsi_mem, like the SoC dtsi defaults),0xfa400000on lemon. The citrus value
works: the GPU runs with a full DT that includes the display pipeline, which is not part of this series. I cannot verify lemon's value. Adam, is0xfa400000intentional?
- PM6125 regulators: seven have different voltage ranges (s7, l5, l7, l11, l17, l18, l22). l24 has the same range, but only citrus sets regulator-allow-set-load. lemon also marks l5, l7 and l22 as always-on, citrus does not.
You should check where the regulators are used, at downstream many times driver bindings are overriding the ranges. You should check properties like these:
-min-voltage = <1800000 0>; -max-voltage = <1800000 0>; -load-current = <180000 0>;
For the always-on it could be a bad habit from downstream
where they are not leave to the driver to set the regulator on/off, keeping always-on properties not always necessary with the upstream drivers.
Quoted 2 lines
- citrus deletes
cdsp_sec_memand the orientation-switch property ofusb_qmpphy, lemon does not.
I think it could be just left over from the reference design since these devices are not supporting DP.
Quoted 6 lines
Barnabas, Adam: do you know whether these differences are real, or whether they only come from the firmware of each model?
Thanks,
Amir
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Quoted 39 lines · Barnabás Czémán
Quoted 38 lines · Amir Hanip
Quoted 8 lines · Barnabas Czeman
Poco M3 (citrus) is same HW like Redmi 9T (lime) and Remi 9T NFC (lemon) basically is a lime with NFC.
So i think it would be better make a common base from lemon's devicetree instead of making the same devicetree again for the different variants where only the compatible and the model property will be the difference.
Check sm6115-xiaomi-gingkgo-common for example, it was the same case for Redmi Note 8 (ginkgo) and 8T (willow).Hi Barnabas, Adam,
Thanks for the review, that makes sense. I am preparing a v3 that moves the shared parts of lemon into
sm6115-xiaomi-lime-common.dtsiand has both lemon and citrus include it. I used the name lime-common following your naming. Happy to rename it.Plan for v3:
1. dt-bindings (unchanged)
2. lemon: move the shared nodes into the common dtsi, no functional change intended
3. citrus on top of the common dtsiI can only test citrus. I do not own a Redmi 9T, so lemon is untested on hardware. Instead, I compared the lemon DTS before and after the split, normalized with dtc (dtc -I dts -O dts -s). The only difference is the numbering of two auto-generated phandles. I will describe the check in the cover letter. Adam,
would you be able to test lemon once v3 is posted, or look at the split beforehand?The IPA carve-outs (
pil_ipa_fw_memandpil_ipa_gsi_mem) are identical on both, so they now live in the common dtsi.I kept the following per variant because I cannot tell whether they are real hardware differences or just differences between the stock firmware images:
Quoted 5 lines
Quoted 4 lines
- ADSP carve-out: 0x53800000/0x2200000 on citrus, 0x53400000/0x2600000 on lemon. Both regions end at
0x55a00000, so only the start and size differ. I can only confirm that the citrus value works on my device.If there are no overlaps the bigger range could work for both of them.
Waste of precious RAM!
Konrad
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Quoted 40 lines · Konrad Dybcio
Quoted 39 lines · Barnabás Czémán
Quoted 38 lines · Amir Hanip
Quoted 8 lines · Barnabas Czeman
Poco M3 (citrus) is same HW like Redmi 9T (lime) and Remi 9T NFC (lemon) basically is a lime with NFC.
So i think it would be better make a common base from lemon's devicetree instead of making the same devicetree again for the different variants where only the compatible and the model property will be the difference.
Check sm6115-xiaomi-gingkgo-common for example, it was the same case for Redmi Note 8 (ginkgo) and 8T (willow).Hi Barnabas, Adam,
Thanks for the review, that makes sense. I am preparing a v3 that moves the shared parts of lemon into
sm6115-xiaomi-lime-common.dtsiand has both lemon and citrus include it. I used the name lime-common following your naming. Happy to rename it.Plan for v3:
1. dt-bindings (unchanged)
2. lemon: move the shared nodes into the common dtsi, no functional change intended
3. citrus on top of the common dtsiI can only test citrus. I do not own a Redmi 9T, so lemon is untested on hardware. Instead, I compared the lemon DTS before and after the split, normalized with dtc (dtc -I dts -O dts -s). The only difference is the numbering of two auto-generated phandles. I will describe the check in the cover letter. Adam,
would you be able to test lemon once v3 is posted, or look at the split beforehand?The IPA carve-outs (
pil_ipa_fw_memandpil_ipa_gsi_mem) are identical on both, so they now live in the common dtsi.I kept the following per variant because I cannot tell whether they are real hardware differences or just differences between the stock firmware images:
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
- ADSP carve-out: 0x53800000/0x2200000 on citrus, 0x53400000/0x2600000
on lemon. Both regions end at0x55a00000, so only the start and size differ. I can only confirm that the citrus value works on my device.If there are no overlaps the bigger range could work for both of them.
Waste of precious RAM!
I have checked it seems lemon have same adsp region like citrus. pil_adsp_region@53800000
Quoted 2 lines
Konrad
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Quoted 2 lines · Barnabas Czeman
I have checked it seems lemon have same adsp region like citrus.
pil_adsp_region@53800000
Thanks for checking, Barnabas. Where did you see it for lemon, in a downstream DT or in the stock firmware? If lemon's stock layout also starts at 0x53800000, the 0x53400000/0x2600000 in the lemon DTS may be worth rechecking.
I will keep the ADSP carve-out per variant in v3, since I cannot test lemon. Adam, if you can try lemon with 0x53800000/0x2200000, the node could move to the common dtsi in a follow-up.
Thanks,
Amir
Re: [PATCH v2 2/2] arm64: dts: qcom: Add Xiaomi Poco M3
Quoted 6 lines · Amir Hanip
Quoted 2 lines · Barnabas Czeman
I have checked it seems lemon have same adsp region like citrus.
pil_adsp_region@53800000Thanks for checking, Barnabas. Where did you see it for lemon, in a downstream DT or in the stock firmware?
I get it from MIUI sysfs.
If lemon's stock layout also
Quoted 9 lines
starts at
0x53800000, the 0x53400000/0x2600000 in the lemon DTS may be worth rechecking.I will keep the ADSP carve-out per variant in v3, since I cannot test lemon. Adam, if you can try lemon with 0x53800000/0x2200000, the node could move to the common dtsi in a follow-up.
Thanks,
Amir