Skip to contentSkip to conversation

X1E Surface Laptop 7 support

PATCH Applied Konrad Dybcio 3 participants 9 messages Aug 26, 2024 – Aug 31, 2024

Subsystems (3)
lore
Share & tools
lore

Konrad Dybcio

author maintainer
#0 lore raw

v2 cover X1E Surface Laptop 7 support

This series brings support for X Elite-based Surface Laptop 7 devices.

See patch 4 for a more detailed status explanation

---
Changes in v2:
- Style fixes
- incorporate SAM support
- separate out adding PMC8380C PWM
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Konrad Dybcio (5):
dt-bindings: arm: qcom: Add Surface Laptop 7 devices
firmware: qcom: scm: Allow QSEECOM on Surface Laptop 7 models
arm64: dts: qcom: x1e80100-pmics: Add PMC8380C PWM
arm64: dts: qcom: x1e80100: Add UART2
arm64: dts: qcom: Add support for X1-based Surface Laptop 7 devices

 Documentation/devicetree/bindings/arm/qcom.yaml    |   2 +
 arch/arm64/boot/dts/qcom/Makefile                  |   2 +
 .../boot/dts/qcom/x1e80100-microsoft-romulus.dtsi  | 835 +++++++++++++++++++++
 .../boot/dts/qcom/x1e80100-microsoft-romulus13.dts |  13 +
 .../boot/dts/qcom/x1e80100-microsoft-romulus15.dts |  13 +
 arch/arm64/boot/dts/qcom/x1e80100-pmics.dtsi       |   8 +
 arch/arm64/boot/dts/qcom/x1e80100.dtsi             |  70 +-
 drivers/firmware/qcom/qcom_scm.c                   |   2 +
 8 files changed, 940 insertions(+), 5 deletions(-)

---
base-commit: 1ca4237ad9ce29b0c66fe87862f1da54ac56a1e8
change-id: 20240809-topic-sl7-db3eef0ada6d

Best regards,

Signature · 1 line
Konrad Dybcio <[email protected]>
author maintainer
#1 lore raw

PATCH v2 1/5 dt-bindings: arm: qcom: Add Surface Laptop 7 devices

From: Konrad Dybcio <[email protected]>

Document the X1E80100-based Microsoft laptops.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/arm/qcom.yaml +2 -0
index c0529486810f..2cee7d96ce6d 100644
@@ -1053,6 +1053,8 @@ properties:
           - enum:
               - asus,vivobook-s15
               - lenovo,yoga-slim7x
+              - microsoft,romulus13
+              - microsoft,romulus15
               - qcom,x1e80100-crd
               - qcom,x1e80100-qcp
           - const: qcom,x1e80100
Signature · 1 line
2.46.0
author maintainer
#4 lore raw

PATCH v2 2/5 firmware: qcom: scm: Allow QSEECOM on Surface Laptop 7 models

In reply to Konrad Dybcio

From: Konrad Dybcio <[email protected]>

Add the aforementioned machines to the list to get e.g. efivars up.

---
 drivers/firmware/qcom/qcom_scm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/firmware/qcom/qcom_scm.c +2 -0
index bdb5e98b82ef..10986cb11ec0 100644
@@ -1734,6 +1734,8 @@ static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
 	{ .compatible = "lenovo,flex-5g" },
 	{ .compatible = "lenovo,thinkpad-t14s" },
 	{ .compatible = "lenovo,thinkpad-x13s", },
+	{ .compatible = "microsoft,romulus13", },
+	{ .compatible = "microsoft,romulus15", },
 	{ .compatible = "qcom,sc8180x-primus" },
 	{ .compatible = "qcom,x1e80100-crd" },
 	{ .compatible = "qcom,x1e80100-qcp" },
Signature · 1 line
2.46.0
author maintainer
#5 lore raw

PATCH v2 3/5 arm64: dts: qcom: x1e80100-pmics: Add PMC8380C PWM

In reply to Konrad Dybcio

From: Konrad Dybcio <[email protected]>

The PMC8380C (PM8550) has a PWM block, describe it.

---
 arch/arm64/boot/dts/qcom/x1e80100-pmics.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/qcom/x1e80100-pmics.dtsi +8 -0
index a5ca0fa4e5ae..5b54ee79f048 100644
@@ -249,6 +249,14 @@ pmk8550_gpios: gpio@8800 {
 			interrupt-controller;
 			#interrupt-cells = <2>;
 		};
+
+		pmk8550_pwm: pwm {
+			compatible = "qcom,pmk8550-pwm";
+
+			#pwm-cells = <2>;
+
+			status = "disabled";
+		};
 	};
 
 	/* PMC8380C */
Signature · 1 line
2.46.0
author maintainer
#6 lore raw

PATCH v2 4/5 arm64: dts: qcom: x1e80100: Add UART2

In reply to Konrad Dybcio

From: Konrad Dybcio <[email protected]>

GENI SE2 within QUP0 is used as UART on some devices, describe it. While at it, rewrite the adjacent UART21 pins node to make it more easily modifiable.

---
 arch/arm64/boot/dts/qcom/x1e80100.dtsi | 70 +++++++++++++++++++++++++++++++---
 1 file changed, 65 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/qcom/x1e80100.dtsi +65 -5
index 6abff8258674..f9e0b1dda4c0 100644
@@ -2143,6 +2143,28 @@ &config_noc SLAVE_QUP_0 QCOM_ICC_TAG_ALWAYS>,
 				status = "disabled";
 			};
 
+			uart2: serial@b88000 {
+				compatible = "qcom,geni-uart";
+				reg = <0 0x00b88000 0 0x4000>;
+
+				interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
+
+				clocks = <&gcc GCC_QUPV3_WRAP0_S2_CLK>;
+				clock-names = "se";
+
+				interconnects = <&clk_virt MASTER_QUP_CORE_0 QCOM_ICC_TAG_ALWAYS
+						 &clk_virt SLAVE_QUP_CORE_0 QCOM_ICC_TAG_ALWAYS>,
+						<&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS
+						 &config_noc SLAVE_QUP_0 QCOM_ICC_TAG_ALWAYS>;
+				interconnect-names = "qup-core",
+						     "qup-config";
+
+				pinctrl-0 = <&qup_uart2_default>;
+				pinctrl-names = "default";
+
+				status = "disabled";
+			};
+
 			spi2: spi@b88000 {
 				compatible = "qcom,geni-spi";
 				reg = <0 0x00b88000 0 0x4000>;
@@ -5559,12 +5581,50 @@ qup_spi23_data_clk: qup-spi23-data-clk-state {
 				bias-disable;
 			};
 
+			qup_uart2_default: qup-uart2-default-state {
+				cts-pins {
+					pins = "gpio8";
+					function = "qup0_se2";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				rts-pins {
+					pins = "gpio9";
+					function = "qup0_se2";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				tx-pins {
+					pins = "gpio10";
+					function = "qup0_se2";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				rx-pins {
+					pins = "gpio11";
+					function = "qup0_se2";
+					drive-strength = <2>;
+					bias-disable;
+				};
+			};
+
 			qup_uart21_default: qup-uart21-default-state {
-				/* TX, RX */
-				pins = "gpio86", "gpio87";
-				function = "qup2_se5";
-				drive-strength = <2>;
-				bias-disable;
+				tx-pins {
+					pins = "gpio86";
+					function = "qup2_se5";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				rx-pins {
+					pins = "gpio87";
+					function = "qup2_se5";
+					drive-strength = <2>;
+					bias-disable;
+				};
 			};
 		};
 
Signature · 1 line
2.46.0
author maintainer
#7 lore raw

PATCH v2 5/5 arm64: dts: qcom: Add support for X1-based Surface Laptop 7 devices

In reply to Konrad Dybcio

From: Konrad Dybcio <[email protected]>

Add support for Surface Laptop 7 machines, based on X1E80100.

The feature status is mostly on par with other X Elite machines, notably lacking:

- USB-A and probably USB-over-Surface-connector (pending NXP retimer support)
- SD card reader (Realtek RTS5261 connected over PCIe)
- Touchscreen and touchpad support (hid-over-SPI [1])
- Audio (a quick look suggests the setup is very close to the one in X1E CRD)

The two Surface Laptop 7 SKUs (13.8" and 15") only have very minor differences, amounting close to none on the software side. Even the MBN firmware files and ACPI tables are shared between the two machines.

With that in mind, support is added for both, although only the larger one was physically tested. Display differences will be taken care of through fused-in EDID and other matters should be solved within the EC and boot firmware.

[1] https://www.microsoft.com/en-us/download/details.aspx?id=103325

---
 arch/arm64/boot/dts/qcom/Makefile                  |   2 +
 .../boot/dts/qcom/x1e80100-microsoft-romulus.dtsi  | 835 +++++++++++++++++++++
 .../boot/dts/qcom/x1e80100-microsoft-romulus13.dts |  13 +
 .../boot/dts/qcom/x1e80100-microsoft-romulus15.dts |  13 +
 4 files changed, 863 insertions(+)
arch/arm64/boot/dts/qcom/Makefile +2 -0
index 197ab325c0b9..0982819137e4 100644
@@ -271,4 +271,6 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sm8650-qrd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= x1e80100-asus-vivobook-s15.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= x1e80100-crd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= x1e80100-lenovo-yoga-slim7x.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= x1e80100-microsoft-romulus13.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= x1e80100-microsoft-romulus15.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= x1e80100-qcp.dtb
arch/arm64/boot/dts/qcom/x1e80100-microsoft-romulus.dtsi new file +835 -0

835 lines not on this page · raw message

arch/arm64/boot/dts/qcom/x1e80100-microsoft-romulus13.dts new file +13 -0
new file mode 100644
index 000000000000..eb7580dd9684
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "x1e80100-microsoft-romulus.dtsi"
+
+/ {
+	model = "Microsoft Surface Laptop 7 (13.8 inch)";
+	compatible = "microsoft,romulus13", "qcom,x1e80100";
+};
arch/arm64/boot/dts/qcom/x1e80100-microsoft-romulus15.dts new file +13 -0
new file mode 100644
index 000000000000..4751ad9b510b
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include "x1e80100-microsoft-romulus.dtsi"
+
+/ {
+	model = "Microsoft Surface Laptop 7 (15 inch)";
+	compatible = "microsoft,romulus15", "qcom,x1e80100";
+};
Signature · 1 line
2.46.0
maintainer Applied
#8 lore raw

Re: (subset) [PATCH v2 0/5] X1E Surface Laptop 7 support

In reply to Konrad Dybcio
Quoted 5 lines · Konrad Dybcio

This series brings support for X Elite-based Surface Laptop 7 devices.

See patch 4 for a more detailed status explanation

Applied, thanks!

[1/5] dt-bindings: arm: qcom: Add Surface Laptop 7 devices

      commit: 2538d0689cfe0a3c45c1fbed54d14cd56df8781c
[3/5] arm64: dts: qcom: x1e80100-pmics: Add PMC8380C PWM
      commit: 02a1bfb34ca8607fc0ed5b5155fd81b7574e931e
[4/5] arm64: dts: qcom: x1e80100: Add UART2
      commit: ecbdce2041ee09cb3a046fd2b7d000fa5e333773
[5/5] arm64: dts: qcom: Add support for X1-based Surface Laptop 7 devices
      commit: 09d77be56093b9fc7daa14c9c745e77ae3a56492

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>