Re: [PATCH v4 4/4] arm64: dts: qcom: sm6125: Initial support for xiaomi-laurel-sprout

From: Lux Aliaga
Date: Sun Dec 18 2022 - 09:26:50 EST



On 17/12/2022 11:23, Konrad Dybcio wrote:
On 16.12.2022 21:27, Lux Aliaga wrote:
On 16/12/2022 08:32, Konrad Dybcio wrote:
On 15.12.2022 20:04, Lux Aliaga wrote:
Adds support for the Xiaomi Mi A3 (xiaomi-laurel-sprout). Here's a
summary on what's working.

- dmesg output to bootloader preconfigured display
- USB
- UFS
- SMD RPM regulators

Signed-off-by: Lux Aliaga <they@xxxxxxxxx>
---
  arch/arm64/boot/dts/qcom/Makefile             |   1 +
  .../dts/qcom/sm6125-xiaomi-laurel-sprout.dts  | 254 ++++++++++++++++++
  2 files changed, 255 insertions(+)
  create mode 100644 arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index 3e79496292e7..2b2a0170db14 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -157,6 +157,7 @@ dtb-$(CONFIG_ARCH_QCOM)    += sdm850-lenovo-yoga-c630.dtb
  dtb-$(CONFIG_ARCH_QCOM)    += sdm850-samsung-w737.dtb
  dtb-$(CONFIG_ARCH_QCOM)    += sm4250-oneplus-billie2.dtb
  dtb-$(CONFIG_ARCH_QCOM)    += sm6125-sony-xperia-seine-pdx201.dtb
+dtb-$(CONFIG_ARCH_QCOM)    += sm6125-xiaomi-laurel-sprout.dtb
  dtb-$(CONFIG_ARCH_QCOM)    += sm6350-sony-xperia-lena-pdx213.dtb
  dtb-$(CONFIG_ARCH_QCOM)    += sm6375-sony-xperia-murray-pdx225.dtb
  dtb-$(CONFIG_ARCH_QCOM)    += sm7225-fairphone-fp4.dtb
diff --git a/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts b/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts
new file mode 100644
index 000000000000..86e1ec47bf5e
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/sm6125-xiaomi-laurel-sprout.dts
@@ -0,0 +1,254 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2022, Lux Aliaga <they@xxxxxxxxx>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include "sm6125.dtsi"
+
+/ {
+    model = "Xiaomi Mi A3";
+    compatible = "xiaomi,laurel-sprout", "qcom,sm6125";
+    chassis-type = "handset";
+
+    /* required for bootloader to select correct board */
+    qcom,msm-id = <394 0>; /* sm6125 v0 */
Unless you have a prototype device, this is not correct.

Please run `cat /sys/bus/soc/devices/soc0/revision` and confirm
which revision is used on your phone.
This segment has already been cross-referenced from downstream, and the device boots up successfully when using this ID, unless you're referring to the comment next to it, in which case I can recheck later, since currently I'm away from my device.
The device boots fine, because the DTB selection works on a "best match"
basis. If it can't find one for the exact version of the SoC, it may
try to boot the closest one.

Konrad

Confirmed it. It's an sm6125 v1. Will fix.

--
Lux Aliaga
https://nixgoat.me/