Skip to contentSkip to conversation

Add support for the OnePlus 6 and 6T SDM845 devices

PATCH Applied Caleb Connolly 7 participants 21 messages Nov 12, 2020 – Dec 2, 2020

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

The OnePlus 6/T handsets are based on the SDM845 platform and were released in late 2017. Add support for booting with core functionality including:

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

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

This series depends on the SMMU stream mapping patches which can be found here:
https://lore.kernel.org/linux-iommu/[email protected]/

The devices will fail early in the boot process otherwise.

drm/panel/samsung-sofef00: Add panel for OnePlus 6/T devices
dt-bindings: panel-simple-dsi: add samsung panels for OnePlus 6/T
arm64: dts: sdm845: add oneplus 6/t devices
dt-bindings: add vendor bindings for OnePlus
i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

 .../bindings/arm/oneplus/oneplus-boards.yaml          |  25 +
 .../bindings/display/panel/panel-simple-dsi.yaml      |   4 +
 .../devicetree/bindings/vendor-prefixes.yaml          |   2 +
 arch/arm64/boot/dts/qcom/Makefile                     |   2 +
 arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi   | 822 ++++++++++++++++++++++
 arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts |  19 +
 arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts    |  23 +
 drivers/gpu/drm/panel/Kconfig                         |  12 +
 drivers/gpu/drm/panel/Makefile                        |   1 +
 drivers/gpu/drm/panel/panel-samsung-sofef00.c         | 353 ++++++++++
 drivers/i2c/busses/i2c-qcom-geni.c                    |   6 +-
 11 files changed, 1267 insertions(+), 2 deletions(-)
#1 lore raw

PATCH 1/5 drm/panel/samsung-sofef00: Add panel for OnePlus 6/T devices

The OnePlus 6/T devices use different panels however they are functionally identical with the only differences being the resolution. The panels also don't seem to be used by any other devices, just combine them into one driver.

The panels are: samsung,sofef00
and samsung,s6e3fc2x01

---

Changes since v1:
* Rename driver to samsung-sofef00 rather than be device specific.
* Make use of drm_panel backlight, simplifying the driver.
* Make reset function do a full reset, instead of simply taking the panel out of reset.
* Removed get_brightness function as it doesn't return correct data.

---
 drivers/gpu/drm/panel/Kconfig                 |  12 +
 drivers/gpu/drm/panel/Makefile                |   1 +
 drivers/gpu/drm/panel/panel-samsung-sofef00.c | 353 ++++++++++++++++++
 3 files changed, 366 insertions(+)
 create mode 100644 drivers/gpu/drm/panel/panel-samsung-sofef00.c
drivers/gpu/drm/panel/Kconfig +12 -0
index b9dbedf8f15e..c4486b6b4e5a 100644
@@ -361,6 +361,18 @@ config DRM_PANEL_SAMSUNG_S6E8AA0
 	select DRM_MIPI_DSI
 	select VIDEOMODE_HELPERS
 
+config DRM_PANEL_SAMSUNG_SOFEF00
+	tristate "Samsung sofef00/s6e3fc2x01 OnePlus 6/6T DSI cmd mode panels"
+	depends on OF
+	depends on DRM_MIPI_DSI
+	depends on BACKLIGHT_CLASS_DEVICE
+	select VIDEOMODE_HELPERS
+	help
+	  Say Y or M here if you want to enable support for the Samsung AMOLED
+	  command mode panels found in the OnePlus 6/6T smartphones.
+
+	  The panels are 2280x1080@60Hz and 2340x1080@60Hz respectively
+
 config DRM_PANEL_SEIKO_43WVF1G
 	tristate "Seiko 43WVF1G panel"
 	depends on OF
drivers/gpu/drm/panel/Makefile +1 -0
index 2ba560bca61d..ebb67f3de10e 100644
@@ -38,6 +38,7 @@ obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_SPI) += panel-samsung-s6e63m0-spi.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E63M0_DSI) += panel-samsung-s6e63m0-dsi.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E88A0_AMS452EF01) += panel-samsung-s6e88a0-ams452ef01.o
 obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o
+obj-$(CONFIG_DRM_PANEL_SAMSUNG_SOFEF00) += panel-samsung-sofef00.o
 obj-$(CONFIG_DRM_PANEL_SEIKO_43WVF1G) += panel-seiko-43wvf1g.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LQ101R1SX01) += panel-sharp-lq101r1sx01.o
 obj-$(CONFIG_DRM_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o
drivers/gpu/drm/panel/panel-samsung-sofef00.c new file +353 -0

353 lines not on this page · raw message

Signature · 1 line
2.29.2
Applied
#2 lore raw

Re: [PATCH 1/5] drm/panel/samsung-sofef00: Add panel for OnePlus 6/T devices

Hi Caleb,

Quoted 9 lines · Caleb Connolly

The OnePlus 6/T devices use different panels however they are functionally identical with the only differences being the resolution. The panels also don't seem to be used by any other devices, just combine them into one driver.

The panels are: samsung,sofef00
and samsung,s6e3fc2x01

Thanks, applied to drm-misc-next.
Fixed a few checkpatch --strict warnings when applying. Please check with --strict in the future.

Sam

#3 lore raw

PATCH 2/5 dt-bindings: panel-simple-dsi: add samsung panels for OnePlus 6/T

In reply to Caleb Connolly

Add compatibles for the samsung,sofef00 and samsung,s6e3fc2x01 panels used in the OnePlus 6 & 6T respectively.

---
 .../devicetree/bindings/display/panel/panel-simple-dsi.yaml   | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/display/panel/panel-simple-dsi.yaml +4 -0
index c0dd9fa29f1d..04d829177aa8 100644
@@ -47,6 +47,10 @@ properties:
       - panasonic,vvx10f004b00
         # Panasonic 10" WUXGA TFT LCD panel
       - panasonic,vvx10f034n00
+        # Samsung sofef00 1080x2280 AMOLED panel
+      - samsung,sofef00
+        # Samsung s6e3fc2x01 1080x2340 AMOLED panel
+      - samsung,s6e3fc2x01
 
   reg:
     maxItems: 1
Signature · 1 line
2.29.2
#4 lore raw

Re: [PATCH 2/5] dt-bindings: panel-simple-dsi: add samsung panels for OnePlus 6/T

Hi Caleb,

Quoted 4 lines · Caleb Connolly

Add compatibles for the samsung,sofef00 and samsung,s6e3fc2x01 panels used in the OnePlus 6 & 6T respectively.

Thansk, applied to drm-misc-next.
Fixed so entries are sorted alphabetically when applying.

Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

PATCH 3/5 arm64: dts: sdm845: add oneplus 6/t devices

In reply to Caleb Connolly

Add initial support for the OnePlus 6 (enchilada) and 6T (fajita) based on the sdm845-mtp DT. Support includes:

* Display panels and Adreno 630
* Touch screen support with synaptics rmi4
* All remoteprocs start correctly
* WLAN / Bluetooth
* Volume / power buttons and OnePlus Tri-State switch are functional The tri-state switch is a 3 state mute slider on the side of the phone
* USB support, currently forced to peripheral as type C detection isn't functional.

Support for this device depends on the following series:
https://lore.kernel.org/linux-iommu/[email protected]/

---

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

---
 arch/arm64/boot/dts/qcom/Makefile             |   2 +
 .../boot/dts/qcom/sdm845-oneplus-common.dtsi  | 822 ++++++++++++++++++
 .../dts/qcom/sdm845-oneplus-enchilada.dts     |  19 +
 .../boot/dts/qcom/sdm845-oneplus-fajita.dts   |  23 +
 4 files changed, 866 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 fb4631f898fd..f45eddfb7dc5 100644
@@ -40,6 +40,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-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8250-mtp.dtb
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +822 -0

822 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..a02f1b99a64f
@@ -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", "oneplus,oneplus6", "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..3a05e3b64c03
@@ -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", "oneplus,oneplus6", "qcom,sdm845";
+};
+
+&display_panel {
+	status = "okay";
+
+	compatible = "samsung,s6e3fc2x01";
+};
+
+&rmi4_f12 {
+	touchscreen-y-mm = <148>;
+};
Signature · 1 line
2.29.2
#6 lore raw

Re: [PATCH 3/5] arm64: dts: sdm845: add oneplus 6/t devices

Hi!

Quoted 10 lines

Add initial support for the OnePlus 6 (enchilada) and 6T (fajita) based on the sdm845-mtp DT. Support includes:

* Display panels and Adreno 630
* Touch screen support with synaptics rmi4
* All remoteprocs start correctly
* WLAN / Bluetooth
* Volume / power buttons and OnePlus Tri-State switch are functional The tri-state switch is a 3 state mute slider on the side of the phone * USB
support, currently forced to peripheral as type C detection isn't functional.

I have similar switches on my joystick... but I don't believe modelling it as 3 separate keys with "macro" keysym is the right way to go.

Quoted 16 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +16 -0
+		state-top {
+			label = "Tri-state key top";
+			linux,code = <KEY_MACRO1>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};
+
+		state-middle {
+			label = "Tri-state key middle";
+			linux,code = <KEY_MACRO2>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <52 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;

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

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+		};
+
+		state-bottom {
+			label = "Tri-state key bottom";
+			linux,code = <KEY_MACRO3>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <126 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#7 lore raw

Re: [PATCH 3/5] arm64: dts: sdm845: add oneplus 6/t devices

Quoted 12 lines · Pavel Machek

Hi!

Quoted 10 lines

Add initial support for the OnePlus 6 (enchilada) and 6T (fajita) based on the sdm845-mtp DT. Support includes:

* Display panels and Adreno 630
* Touch screen support with synaptics rmi4
* All remoteprocs start correctly
* WLAN / Bluetooth
* Volume / power buttons and OnePlus Tri-State switch are functional The tri-state switch is a 3 state mute slider on the side of the phone * USB
support, currently forced to peripheral as type C detection isn't functional.

Quoted 2 lines

I have similar switches on my joystick... but I don't believe modelling it as 3 separate keys with "macro" keysym is the right way to go.

Hi! I agree that this is a bit of a weird way to model the switch, do you have any ideas for a better solution?

I'm happy to drop this from the patch for now and come up with a better method down the line.

Regards,

Caleb

Quoted 31 lines
Quoted 16 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +16 -0
+		state-top {
+			label = "Tri-state key top";
+			linux,code = <KEY_MACRO1>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};
+
+		state-middle {
+			label = "Tri-state key middle";
+			linux,code = <KEY_MACRO2>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <52 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;

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

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+		};
+
+		state-bottom {
+			label = "Tri-state key bottom";
+			linux,code = <KEY_MACRO3>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <126 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};

Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

#8 lore raw

Re: [PATCH 3/5] arm64: dts: sdm845: add oneplus 6/t devices

Quoted 13 lines · Caleb Connolly
Quoted 12 lines · Pavel Machek

Hi!

Quoted 10 lines

Add initial support for the OnePlus 6 (enchilada) and 6T (fajita) based on the sdm845-mtp DT. Support includes:

* Display panels and Adreno 630
* Touch screen support with synaptics rmi4
* All remoteprocs start correctly
* WLAN / Bluetooth
* Volume / power buttons and OnePlus Tri-State switch are functional The tri-state switch is a 3 state mute slider on the side of the phone * USB
support, currently forced to peripheral as type C detection isn't functional.

Quoted 5 lines
Quoted 2 lines

I have similar switches on my joystick... but I don't believe modelling it as 3 separate keys with "macro" keysym is the right way to go.

Hi! I agree that this is a bit of a weird way to model the switch, do you have any ideas for a better solution?

You should ask on the input mailing list, I guess.

Best regards,
Pavel

Signature · 1 line
http://www.livejournal.com/~pavelmachek
#9 lore raw

Re: [PATCH 3/5] arm64: dts: sdm845: add oneplus 6/t devices

In reply to Caleb Connolly

On Thu 12 Nov 10:21 CST 2020, Caleb Connolly wrote:
[..]

Quoted 8 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +2 -0
new file mode 100644
index 000000000000..4e6477f1e574
@@ -0,0 +1,822 @@
+// SPDX-License-Identifier: GPL-2.0
+/*

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

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+ * SDM845 OnePlus 6(T) (enchilada / fajita) common device tree source
+ *
+ * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/input/linux-event-codes.h>

Please keep these sorted alphabetically.

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

Quoted 3 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +3 -0
+#include "sdm845.dtsi"
+
+// Needed for some GPIO (like the volume buttons)

This is or is going to be needed for more things, so feel free to skip this comment.

Quoted 27 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +27 -0
+#include "pm8998.dtsi"
+#include "pmi8998.dtsi"
+
+/ {
+
+	aliases {
+		hsuart0 = &uart6;
+	};
+
+	vph_pwr: vph-pwr-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "vph_pwr";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+	};
+
+	/*
+	 * Apparently RPMh does not provide support for PM8998 S4 because it
+	 * is always-on; model it as a fixed regulator.
+	 */
+	vreg_s4a_1p8: pm8998-smps4 {
+		compatible = "regulator-fixed";
+		regulator-name = "vreg_s4a_1p8";
+
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+

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

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+		regulator-always-on;
+		regulator-boot-on;
+
+		vin-supply = <&vph_pwr>;
+	};
+
+	/*
+	 * The touchscreen regulator seems to be controlled somehow by a gpio.
+	 */
+	ts_1p8_supply: ts_1v8_regulator {

Please don't use _ in the node name.

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +4 -0
+		compatible = "regulator-fixed";
+		regulator-name = "ts_1p8_supply";
+
+		regulator-min-microvolt = <1800000>;

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

Quoted 10 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +10 -0
+		regulator-max-microvolt = <1800000>;
+
+		gpio = <&tlmm 88 0>;
+		enable-active-high;
+		regulator-boot-on;
+	};
+
+	gpio_tristate_key: gpio-keys {
+		compatible = "gpio-keys";
+		label = "Tri-state keys";

What kind of button is this?

Quoted 31 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +31 -0
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&tri_state_key_default>;
+
+		state-top {
+			label = "Tri-state key top";
+			linux,code = <KEY_MACRO1>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <24 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};
+
+		state-middle {
+			label = "Tri-state key middle";
+			linux,code = <KEY_MACRO2>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <52 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};
+
+		state-bottom {
+			label = "Tri-state key bottom";
+			linux,code = <KEY_MACRO3>;
+			interrupt-parent = <&tlmm>;
+			interrupts = <126 IRQ_TYPE_EDGE_FALLING>;
+			debounce-interval = <500>;
+			linux,can-disable;
+		};
+	};

[..]

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

Quoted 4 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +4 -0
+/* Reserved memory changes */
+/delete-node/ &rmtfs_mem;
+
+/ {

You already have one top-level section higher up, please group this in there as well.

Quoted 1 line
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +1 -0
+	reserved-memory {

[..]

Quoted 1 line

+&mdss {

To avoid trouble finding your way around this file in the future I would prefer if you sorted the nodes alphabetically.

Quoted 3 lines
arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +3 -0
+	status = "okay";
+};
+

[..]

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

Quoted 4 lines

+&i2c12 {

arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file +3 -0
+	status = "okay";
+
+	touchscreen: synaptics-rmi4-i2c@20 {

You don't reference &touchscreen, so please omit this..

Regards,
Bjorn

#10 lore raw

PATCH 4/5 dt-bindings: add vendor bindings for OnePlus

In reply to Caleb Connolly

Used by the OnePlus 6/T device trees

---
 .../bindings/arm/oneplus/oneplus-boards.yaml  | 25 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 ++
 2 files changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml
Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml new file +25 -0
new file mode 100644
index 000000000000..a4d9bbd5681f
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/oneplus/oneplus-boards.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: OnePlus based boards
+
+maintainers:
+  - Caleb Connolly <[email protected]>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: SDM845 based boards
+        items:
+          - enum:
+              - oneplus,enchilada               # OnePlus 6
+              - oneplus,fajita                  # OnePlus 6T
+          - const: oneplus,oneplus6             # OnePlus 6 and derivatives
+
+required:
+  - compatible
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 2735be1a8470..372c1136081e 100644
@@ -768,6 +768,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
maintainer
#11 lore raw

Re: [PATCH 4/5] dt-bindings: add vendor bindings for OnePlus

Quoted 9 lines · Caleb Connolly

Used by the OnePlus 6/T device trees

---
 .../bindings/arm/oneplus/oneplus-boards.yaml  | 25 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 ++
 2 files changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml: 'additionalProperties' is a required property /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml: ignoring, error in schema:
warning: no schema found in file: ./Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml

See https://patchwork.ozlabs.org/patch/1399086

The base for the patch is generally the last rc1. Any dependencies should be noted.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit.

maintainer
#12 lore raw

Re: [PATCH 4/5] dt-bindings: add vendor bindings for OnePlus

In reply to Caleb Connolly
Quoted 22 lines · Caleb Connolly

Used by the OnePlus 6/T device trees

---
 .../bindings/arm/oneplus/oneplus-boards.yaml  | 25 +++++++++++++++++++
 .../devicetree/bindings/vendor-prefixes.yaml  |  2 ++
 2 files changed, 27 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml
Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml new file +7 -0
new file mode 100644
index 000000000000..a4d9bbd5681f
@@ -0,0 +1,25 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/oneplus/oneplus-boards.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: OnePlus based boards

Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml line 17

Quoted 10 lines
Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml new file +10 -0
+
+maintainers:
+  - Caleb Connolly <[email protected]>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: SDM845 based boards

There should be a sdm845 fallback compatible. Also, board level compatibles are documented in a per SoC family schema (qcom.yaml) which should already define the fallback.

Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml line 22

Quoted 5 lines
Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml new file +5 -0
+        items:
+          - enum:
+              - oneplus,enchilada               # OnePlus 6
+              - oneplus,fajita                  # OnePlus 6T
+          - const: oneplus,oneplus6             # OnePlus 6 and derivatives

With a SoC fallback, having this as a 3rd compatible probably isn't too useful. 3 levels of compatible is mainly done when there's a SoM plus baseboard.

Quoted 20 lines
Documentation/devicetree/bindings/arm/oneplus/oneplus-boards.yaml new file +3 -0
+
+required:
+  - compatible
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
index 2735be1a8470..372c1136081e 100644
@@ -768,6 +768,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
#13 lore raw

PATCH 5/5 i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

In reply to Caleb Connolly

The OnePlus 6/T has the same issue as the Yoga c630 causing a crash when DMA is used for i2c, so disable it.

https://patchwork.kernel.org/patch/11133827/

---
 drivers/i2c/busses/i2c-qcom-geni.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +4 -2
index 8b4c35f47a70..9acdcfe73be2 100644
@@ -357,7 +357,8 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))
 		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
 
 	if (dma_buf)
@@ -399,7 +400,8 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))
 		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
 
 	if (dma_buf)
Signature · 1 line
2.29.2
Reviewed-by on v1 5/5
#14 lore raw

Re: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

Quoted 6 lines · Caleb Connolly

The OnePlus 6/T has the same issue as the Yoga c630 causing a crash when DMA is used for i2c, so disable it.

https://patchwork.kernel.org/patch/11133827/

Signature · 1 line
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project
#15 lore raw

Re: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

In reply to Caleb Connolly
Quoted 15 lines · Caleb Connolly

The OnePlus 6/T has the same issue as the Yoga c630 causing a crash when DMA is used for i2c, so disable it.

https://patchwork.kernel.org/patch/11133827/

---
 drivers/i2c/busses/i2c-qcom-geni.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +0 -0
index 8b4c35f47a70..9acdcfe73be2 100644

drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · line 361

Quoted 6 lines
drivers/i2c/busses/i2c-qcom-geni.c +2 -1
@@ -357,7 +357,8 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))

This hack seems to have been working around two separate issues. First with iommu active the GENI wrappers needs to have their stream mapping configured. Secondly there was a bug in the transaction setup that was recently fixed by Doug Anderson.

So can you please give the following patch a go? I've yet to test it on the Lenovo machine, but I think it allows us to remove the quirk.

https://lore.kernel.org/lkml/[email protected]/T/#u

Regards,
Bjorn

Quoted 17 lines
drivers/i2c/busses/i2c-qcom-geni.c +2 -1
 		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
 
 	if (dma_buf)
@@ -399,7 +400,8 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))
 		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
 
 	if (dma_buf)
Signature · 1 line
2.29.2
#16 lore raw

Re: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

Hi Bjorn,

It looks like I still have the same issue even with this patch applied.

Regards,
Caleb

Quoted 53 lines · Bjorn Andersson
Quoted 15 lines · Caleb Connolly

The OnePlus 6/T has the same issue as the Yoga c630 causing a crash when DMA is used for i2c, so disable it.

https://patchwork.kernel.org/patch/11133827/

---
  drivers/i2c/busses/i2c-qcom-geni.c | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-qcom-geni.c +0 -0
index 8b4c35f47a70..9acdcfe73be2 100644

drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · line 361

Quoted 6 lines
drivers/i2c/busses/i2c-qcom-geni.c +2 -1
@@ -357,7 +357,8 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
  	struct geni_se *se = &gi2c->se;
  	size_t len = msg->len;
 
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))

This hack seems to have been working around two separate issues. First with iommu active the GENI wrappers needs to have their stream mapping configured. Secondly there was a bug in the transaction setup that was recently fixed by Doug Anderson.

So can you please give the following patch a go? I've yet to test it on the Lenovo machine, but I think it allows us to remove the quirk.

https://lore.kernel.org/lkml/[email protected]/T/#u

Regards,
Bjorn

Quoted 17 lines
drivers/i2c/busses/i2c-qcom-geni.c +2 -2
  		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
 
  	if (dma_buf)
@@ -399,7 +400,8 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
  	struct geni_se *se = &gi2c->se;
  	size_t len = msg->len;
 
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))
  		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
 
  	if (dma_buf)
--

2.29.2

#17 lore raw

Re: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

Quoted 9 lines
Quoted 9 lines

drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · line 361

Quoted 4 lines
drivers/i2c/busses/i2c-qcom-geni.c +2 -1
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))

This hack seems to have been working around two separate issues. First with iommu active the GENI wrappers needs to have their stream mapping configured. Secondly there was a bug in the transaction setup that was recently fixed by Doug Anderson.

Quoted 4 lines
Quoted 4 lines

So can you please give the following patch a go? I've yet to test it on the Lenovo machine, but I think it allows us to remove the quirk.

https://lore.kernel.org/lkml/[email protected]/T/#u

Please don't top-post. I fixed it this time.

Quoted 1 line

It looks like I still have the same issue even with this patch applied.

So we still need your patch, am I reading correctly?

#18 lore raw

Re: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

Quoted 12 lines · Wolfram Sang
Quoted 12 lines
Quoted 12 lines

drivers/i2c/busses/i2c-qcom-geni.c static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, · line 361

Quoted 4 lines
drivers/i2c/busses/i2c-qcom-geni.c +2 -1
-	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+	if (!of_machine_is_compatible("lenovo,yoga-c630") &&
+	    !of_machine_is_compatible("oneplus,oneplus6"))

This hack seems to have been working around two separate issues. First with iommu active the GENI wrappers needs to have their stream mapping configured. Secondly there was a bug in the transaction setup that was recently fixed by Doug Anderson.

So can you please give the following patch a go? I've yet to test it on the Lenovo machine, but I think it allows us to remove the quirk.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

https://lore.kernel.org/lkml/[email protected]/T/#u

Please don't top-post. I fixed it this time.

Quoted 1 line

It looks like I still have the same issue even with this patch applied.

So we still need your patch, am I reading correctly?

With Doug's recent fixes in the DMA handling and the introduction of proper iommu configuration, which Caleb tested [1], I think we're good without this on the OnePlus. Caleb, please confirm.

If I understood Caleb's report he saw exactly the same problem that Lee Jones did that lead to the workaround for the Lenovo Yoga C630, and with the two changes the i2c-hid keyboard came up nicely on my Yoga. So I posted [2].

[1] https://lore.kernel.org/linux-arm-msm/[email protected]/
[2] https://lore.kernel.org/linux-arm-msm/[email protected]/

Regards,
Bjorn

#19 lore raw

Re: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

Quoted 4 lines

With Doug's recent fixes in the DMA handling and the introduction of proper iommu configuration, which Caleb tested [1], I think we're good without this on the OnePlus. Caleb, please confirm.

Yes, he confirmed already. I missed it was private only.

Thanks for your heads up, too!

#20 lore raw
In reply to Caleb Connolly

This is V2 of the series, it should have been set in the subject line but doesn't seem to have been.

It includes the following changes from V1:

 * Amendments to the panel driver regarding Sam's comments
 * DTS formatting improvements.

Sorry for any confusion caused.
Regards,
Caleb

Quoted 42 lines · Caleb Connolly

The OnePlus 6/T handsets are based on the SDM845 platform and were released in late 2017. Add support for booting with core functionality including:

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

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

This series depends on the SMMU stream mapping patches which can be found here:
https://lore.kernel.org/linux-iommu/[email protected]/

The devices will fail early in the boot process otherwise.

drm/panel/samsung-sofef00: Add panel for OnePlus 6/T devices
dt-bindings: panel-simple-dsi: add samsung panels for OnePlus 6/T
arm64: dts: sdm845: add oneplus 6/t devices
dt-bindings: add vendor bindings for OnePlus
i2c: geni: sdm845: dont perform DMA for OnePlus 6 devices

  .../bindings/arm/oneplus/oneplus-boards.yaml          |  25 +
  .../bindings/display/panel/panel-simple-dsi.yaml      |   4 +
  .../devicetree/bindings/vendor-prefixes.yaml          |   2 +
  arch/arm64/boot/dts/qcom/Makefile                     |   2 +
  arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi   | 822 ++++++++++++++++++++++
  arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts |  19 +
  arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts    |  23 +
  drivers/gpu/drm/panel/Kconfig                         |  12 +
  drivers/gpu/drm/panel/Makefile                        |   1 +
  drivers/gpu/drm/panel/panel-samsung-sofef00.c         | 353 ++++++++++
  drivers/i2c/busses/i2c-qcom-geni.c                    |   6 +-
  11 files changed, 1267 insertions(+), 2 deletions(-)