Skip to contentSkip to conversation

Add support for the OnePlus 6 and 6T

PATCH Superseded Caleb Connolly 3 participants 7 messages Jan 14, 2021 – Jan 15, 2021

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 Add support for the OnePlus 6 and 6T

* Display panels and hardware accelerated graphics
* Touch screen with Synaptics RMI4
* Modem and other remoteprocessors
* WiFi / Bluetooth
* Buttons
* USB gadget mode

Both devices are almost identical, but use different display panels, with the 6T lacking a headphone jack and notification LED.

The panel driver for the devices is already upstream, although the driver doesn't seem to work on the 6T, all other functionality does however. I'm in the process of obtaining a device to get the driver fixed ASAP.

---

Caleb Connolly (2):
arm64: dts: sdm845: add oneplus6/6t devices
dt-bindings: Document bindings for new SDM845 devices

Documentation/devicetree/bindings/arm/qcom.yaml      |   5 +
.../devicetree/bindings/vendor-prefixes.yaml         |   2 +
arch/arm64/boot/dts/qcom/Makefile                    |   2 +
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi  | 621 ++++++++++++++++++++++
.../arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts |  19 +
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts   |  23 +
6 files changed, 672 insertions(+)
#1 lore raw

PATCH v3 1/2 arm64: dts: sdm845: add oneplus6/6t devices

Add initial support for the OnePlus 6 (enchilada) and 6T (fajita) based on the sdm845-mtp DT with the following functionality:

* Touch
* Display
* GPU
* Wlan and Bluetooth
* USB peripheral mode
* Remoteproc

---
Changes since v1
* Remove unused pinctrl nodes
* Properly model touchscreen vio supply GPIO
* Improve comments
* Remove bq27541 battery as it doesn't work

Changes since v2
* Specify clock frequency of touchscreen i2c
* Remove tri-state-key nodes until a better solution can be found
* Cleaned up pinctrl nodes
* Remove unused regulators
* Improve formatting
* Address Bjorn's comments
* Remove unused regulators

---
 arch/arm64/boot/dts/qcom/Makefile             |   2 +
 .../boot/dts/qcom/sdm845-oneplus-common.dtsi  | 621 ++++++++++++++++++
 .../dts/qcom/sdm845-oneplus-enchilada.dts     |  19 +
 .../boot/dts/qcom/sdm845-oneplus-fajita.dts   |  23 +
 4 files changed, 665 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts
 create mode 100644 arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts
arch/arm64/boot/dts/qcom/Makefile +2 -0
index 5113fac80b7a..19f18af3ecff 100644
@@ -44,6 +44,8 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-cheza-r3.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-db845c.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-beryllium.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-enchilada.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-fajita.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm850-lenovo-yoga-c630.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8150-hdk.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8150-mtp.dtb
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +621 -0

622 lines not on this page · raw message

arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts new file +19 -0
new file mode 100644
index 000000000000..72842c887617
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SDM845 OnePlus 6 (enchilada) device tree.
+ *
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+#include "sdm845-oneplus-common.dtsi"
+
+/ {
+	model = "OnePlus 6";
+	compatible = "oneplus,enchilada", "qcom,sdm845";
+};
+
+&display_panel {
+	status = "okay";
+
+	compatible = "samsung,sofef00";
+};
arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts new file +23 -0
new file mode 100644
index 000000000000..969b36dc9e2c
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * SDM845 OnePlus 6T (fajita) device tree.
+ *
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+#include "sdm845-oneplus-common.dtsi"
+
+/ {
+	model = "OnePlus 6T";
+	compatible = "oneplus,fajita", "qcom,sdm845";
+};
+
+&display_panel {
+	status = "okay";
+
+	compatible = "samsung,s6e3fc2x01";
+};
+
+&rmi4_f12 {
+	touchscreen-y-mm = <148>;
+};
Signature · 1 line
2.29.2
#2 lore raw

Re: [PATCH v3 1/2] arm64: dts: sdm845: add oneplus6/6t devices

Hi!

arch/arm64/boot/dts/qcom/Makefile dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb · line 49

Quoted 6 lines

dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb
dtb-$(CONFIG_ARCH_QCOM) += sdm845-mtp.dtb
dtb-$(CONFIG_ARCH_QCOM) += sdm845-xiaomi-beryllium.dtb

arch/arm64/boot/dts/qcom/Makefile +2 -0
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-enchilada.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-fajita.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sdm850-lenovo-yoga-c630.dtb

Please sort.

Review

Quoted 2 lines
(quoted diff) +2 -0
+/ {
+

Redundant newline.

Quoted 12 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +12 -0
+	gpio-keys {
+		compatible = "gpio-keys";
+		label = "Volume keys";
+		autorepeat;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&volume_down_gpio &volume_up_gpio>;
+
+		vol-down {
+			label = "Volume down";
+			linux,code = <KEY_VOLUMEDOWN>;
+			gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi line 124

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+			debounce-interval = <15>;
+		};
+
+		vol-up {
+			label = "Volume up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
+	};

Perhaps gpio-keys could come before the fixed regulators to keep it a bit more sane/sorted?

Quoted 1 line

+&adsp_pas {

This should come before apps_rsc alphabetically.

Quoted 1 line

+// Prevent garbage data on bluetooth UART lines

Please use C-style comments (/* thing */).

Quoted 13 lines

+&usb_1 {

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +12 -0
+	status = "okay";
+
+	/*
+	 * disable USB3 clock requirement as the device only supports
+	 * USB2.
+	 */
+	qcom,select-utmi-as-pipe-clk;
+};
+
+&usb_1_dwc3 {
+	/*
+	 * We don't have the capability to switch modes yet.

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi line 547

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+	 */
+	dr_mode = "peripheral";
+
+	/* fastest mode for USB 2 */
+	maximum-speed = "high-speed";
+
+	/* Remove USB3 phy as it's unused on this device. */
+	phys = <&usb_1_hsphy>;
+	phy-names = "usb2-phy";
+};

Are you sure you can't get USB3 in host mode? Perhaps it's not worth discarding it upfront, as some boards can do that, definitely do check!

Quoted 1 line

\ No newline at end of file

Please add a newline.

The DTS files look correct, but don't you need at least one of msm-id, board-id, pmic-id? I'm not exactly sure what OnePlus does, but I can imagine they would require such properties..

Konrad

#3 lore raw

Re: [PATCH v3 1/2] arm64: dts: sdm845: add oneplus6/6t devices

Quoted 56 lines · Konrad Dybcio

Hi!

arch/arm64/boot/dts/qcom/Makefile dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb · line 49

Quoted 6 lines
  dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-db845c.dtb
  dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-mtp.dtb
  dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-xiaomi-beryllium.dtb
arch/arm64/boot/dts/qcom/Makefile +2 -0
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-enchilada.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sdm845-oneplus-fajita.dtb
  dtb-$(CONFIG_ARCH_QCOM)	+= sdm850-lenovo-yoga-c630.dtb

Please sort.

Review

Quoted 2 lines
(quoted diff) +2 -0
+/ {
+

Redundant newline.

Quoted 12 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +12 -0
+	gpio-keys {
+		compatible = "gpio-keys";
+		label = "Volume keys";
+		autorepeat;
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&volume_down_gpio &volume_up_gpio>;
+
+		vol-down {
+			label = "Volume down";
+			linux,code = <KEY_VOLUMEDOWN>;
+			gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>;

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi line 124

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+			debounce-interval = <15>;
+		};
+
+		vol-up {
+			label = "Volume up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
+	};

Perhaps gpio-keys could come before the fixed regulators to keep it a bit more sane/sorted?

Quoted 1 line

+&adsp_pas {

This should come before apps_rsc alphabetically.

Quoted 1 line

+// Prevent garbage data on bluetooth UART lines

Please use C-style comments (/* thing */).

Quoted 16 lines

+&usb_1 {

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +15 -0
+	status = "okay";
+
+	/*
+	 * disable USB3 clock requirement as the device only supports
+	 * USB2.
+	 */
+	qcom,select-utmi-as-pipe-clk;
+};
+
+&usb_1_dwc3 {
+	/*
+	 * We don't have the capability to switch modes yet.
+	 */
+	dr_mode = "peripheral";
+
Quoted 8 lines

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi line 547

Quoted 7 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +7 -0
+	/* fastest mode for USB 2 */
+	maximum-speed = "high-speed";
+
+	/* Remove USB3 phy as it's unused on this device. */
+	phys = <&usb_1_hsphy>;
+	phy-names = "usb2-phy";
+};

Are you sure you can't get USB3 in host mode? Perhaps it's not worth discarding it upfront, as some boards can do that, definitely do check!

The device definitely doesn't support USB3, although downstream does leave the USB3 phy enabled the hardware doesn't support it. So it made sense to disable it here.

Quoted 5 lines
Quoted 1 line

\ No newline at end of file

Please add a newline.

The DTS files look correct, but don't you need at least one of msm-id, board-id, pmic-id? I'm not exactly sure what OnePlus does, but I can imagine they would require such properties..

OnePlus' bootloader doesn't seem to care about these values so I left them out for simplicity.

Cheers,

Caleb

Quoted 3 lines

Konrad

#4 lore raw

Re: [PATCH v3 1/2] arm64: dts: sdm845: add oneplus6/6t devices

Quoted 4 lines

The device definitely doesn't support USB3, although downstream does leave the USB3 phy enabled the hardware doesn't support it. So it made sense to disable it here.

Sure.

Quoted 2 lines

OnePlus' bootloader doesn't seem to care about these values so I left them out for simplicity.

Sounds strange, but it's not the first time vendors surprise us.

Konrad

#5 lore raw

Re: [PATCH v3 1/2] arm64: dts: sdm845: add oneplus6/6t devices

Quoted 6 lines · Konrad Dybcio
Quoted 4 lines

The device definitely doesn't support USB3, although downstream does leave the USB3 phy enabled the hardware doesn't support it. So it made sense to disable it here.

Quoted 8 lines

Sure.

Quoted 2 lines

OnePlus' bootloader doesn't seem to care about these values so I left them out for simplicity.

Sounds strange, but it's not the first time vendors surprise us.

This particular requirement seems to be rather random. Some board loads a single dtb without these properties, others require them even for the single, appended, case.

Regards,
Bjorn

#6 lore raw

PATCH v3 2/2 dt-bindings: Document bindings for new SDM845 devices

In reply to Caleb Connolly

Document compatible bindings for the new OnePlus 6/6T devices.

---
 Documentation/devicetree/bindings/arm/qcom.yaml        | 5 +++++
 Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
 2 files changed, 7 insertions(+)
Documentation/devicetree/bindings/arm/qcom.yaml +5 -0
index c97d4a580f47..f3ad845754d3 100644
@@ -171,6 +171,11 @@ properties:
           - enum:
               - qcom,ipq6018-cp01-c1
           - const: qcom,ipq6018
+      - items:
+          - enum:
+              - oneplus,enchilada
+              - oneplus,fajita
+          - const: qcom,sdm845
 
       - items:
           - enum:
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 041ae90b0d8f..aff440b18293 100644
@@ -800,6 +800,8 @@ patternProperties:
     description: OLIMEX Ltd.
   "^olpc,.*":
     description: One Laptop Per Child
+  "^oneplus,.*":
+    description: One Plus Technology (Shenzhen) Co., Ltd.
   "^onion,.*":
     description: Onion Corporation
   "^onnn,.*":
Signature · 1 line
2.29.2