Skip to contentSkip to conversation

ARM: dts: exynos: Add Samsung Galaxy Tab 3 8.0 boards

PATCH Superseded Artur Weber 2 participants 4 messages Jun 4, 2023 – Jun 23, 2023

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ARM: dts: exynos: Add Samsung Galaxy Tab 3 8.0 boards

Introduce support for the Galaxy Tab 3 8.0 series of boards:

- Samsung Galaxy Tab 3 8.0 WiFi (SM-T310/lt01wifi)
- Samsung Galaxy Tab 3 8.0 3G (SM-T311/lt013g)
- Samsung Galaxy Tab 3 8.0 LTE (SM-T315/lt01lte)

What works:

- Display and backlight
- Touchscreen
- GPIO buttons, hall sensor
- WiFi and Bluetooth
- USB, fuel gauge, charging
- Accelerometer and magnetometer
- Audio: speaker, microphone, headset
- WiFi model only: light sensor

---
This is an updated version of "[PATCH v3 13/13] ARM: dts: exynos: Add Samsung Galaxy Tab 3 8.0 boards"[1].

Changed in v4:
- Added touchkey keycodes
- Added audio nodes
- Added MMC aliases
- Fixed dtbs_check warnings
- Fixed indentation in pinctrl sleep state overrides

Changed in v3:
- Addressed review comments
- Removed rtc node (RTC is provided by PMIC)
- Added CPU thermal node
- Fixed dtbs_check warnings
- Added common changes from next/dt

Should pass dtbs_check with no errors, provided that the following patches are present:

Backlight node is adapted to changes from "[PATCH v2 1/4] dt-bindings:
backlight: lp855x: convert to YAML and modernize"[2]. The whole patchset has been reviewed, waiting for any further reviews or a merge.

Touchkey keycode property is added by "[PATCH 1/2] dt-bindings: mms114: Add linux,keycodes property for touch keys"[3]. So far only the bindings part of the patch has been acked, otherwise everything is awaiting review.

Display bindings have been added by "[PATCH v5 1/3] dt-bindings: display:
panel: Add Samsung S6D7AA0 LCD panel controller"[4]. These are already reviewed and merged into the DRM tree.

[1] https://lore.kernel.org/linux-devicetree/[email protected]/
[2] https://lore.kernel.org/linux-devicetree/[email protected]/
[3] https://lore.kernel.org/linux-devicetree/[email protected]/
[4] https://lore.kernel.org/linux-devicetree/[email protected]/

---
 arch/arm/boot/dts/Makefile                  |    3 +
 arch/arm/boot/dts/exynos4212-tab3-3g8.dts   |   29 +
 arch/arm/boot/dts/exynos4212-tab3-lte8.dts  |   44 +
 arch/arm/boot/dts/exynos4212-tab3-wifi8.dts |   26 +
 arch/arm/boot/dts/exynos4212-tab3.dtsi      | 1303 +++++++++++++++++++
 5 files changed, 1405 insertions(+)
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3-3g8.dts
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3-lte8.dts
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3-wifi8.dts
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3.dtsi
arch/arm/boot/dts/Makefile +3 -0
index 59829fc90315..6a4ca481171e 100644
@@ -217,6 +217,9 @@ dtb-$(CONFIG_ARCH_EXYNOS4) += \
 	exynos4210-smdkv310.dtb \
 	exynos4210-trats.dtb \
 	exynos4210-universal_c210.dtb \
+	exynos4212-tab3-3g8.dtb \
+	exynos4212-tab3-lte8.dtb \
+	exynos4212-tab3-wifi8.dtb \
 	exynos4412-i9300.dtb \
 	exynos4412-i9305.dtb \
 	exynos4412-itop-elite.dtb \
arch/arm/boot/dts/exynos4212-tab3-3g8.dts new file +29 -0
new file mode 100644
index 000000000000..d96b2dd44608
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos4212 based Galaxy Tab 3 8.0 3G board device tree
+ * source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ */
+
+/dts-v1/;
+#include "exynos4212-tab3.dtsi"
+
+/ {
+	model = "Samsung Galaxy Tab 3 8.0 3G (SM-T311) based on Exynos4212";
+	compatible = "samsung,t311", "samsung,tab3", "samsung,exynos4212", "samsung,exynos4";
+	chassis-type = "tablet";
+};
+
+/* Pin control sleep state overrides */
+&sleep0 {
+	PIN_SLP(gpb-5, INPUT, UP);
+};
+
+&sleep1 {
+	PIN_SLP(gpl0-0, OUT0, NONE);
+	PIN_SLP(gpl1-0, OUT0, NONE);
+	PIN_SLP(gpl2-4, OUT0, NONE);
+	PIN_SLP(gpm3-3, OUT1, NONE);
+};
arch/arm/boot/dts/exynos4212-tab3-lte8.dts new file +44 -0

44 lines not on this page · raw message

arch/arm/boot/dts/exynos4212-tab3-wifi8.dts new file +26 -0
new file mode 100644
index 000000000000..54cb01703b60
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos4212 based Galaxy Tab 3 8.0 WiFi board device tree
+ * source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ */
+
+/dts-v1/;
+#include "exynos4212-tab3.dtsi"
+
+/ {
+	model = "Samsung Galaxy Tab 3 8.0 WiFi (SM-T310) based on Exynos4212";
+	compatible = "samsung,t310", "samsung,tab3", "samsung,exynos4212", "samsung,exynos4";
+	chassis-type = "tablet";
+};
+
+&i2c_lightsensor {
+	status = "okay";
+
+	lightsensor@10 {
+		compatible = "capella,cm3323";
+		reg = <0x10>;
+	};
+};
arch/arm/boot/dts/exynos4212-tab3.dtsi new file +1303 -0

1,303 lines not on this page · raw message

base-commit: a3119e95a0d193a0c13168ba48bd081ce11060ff

Signature · 1 line
2.41.0
#1 lore raw
Quoted 220 lines · Artur Weber

Introduce support for the Galaxy Tab 3 8.0 series of boards:

- Samsung Galaxy Tab 3 8.0 WiFi (SM-T310/lt01wifi)
- Samsung Galaxy Tab 3 8.0 3G (SM-T311/lt013g)
- Samsung Galaxy Tab 3 8.0 LTE (SM-T315/lt01lte)

What works:

- Display and backlight
- Touchscreen
- GPIO buttons, hall sensor
- WiFi and Bluetooth
- USB, fuel gauge, charging
- Accelerometer and magnetometer
- Audio: speaker, microphone, headset
- WiFi model only: light sensor

---
This is an updated version of "[PATCH v3 13/13] ARM: dts: exynos: Add Samsung Galaxy Tab 3 8.0 boards"[1].

Changed in v4:
- Added touchkey keycodes
- Added audio nodes
- Added MMC aliases
- Fixed dtbs_check warnings
- Fixed indentation in pinctrl sleep state overrides

Changed in v3:
- Addressed review comments
- Removed rtc node (RTC is provided by PMIC)
- Added CPU thermal node
- Fixed dtbs_check warnings
- Added common changes from next/dt

Should pass dtbs_check with no errors, provided that the following patches are present:

Backlight node is adapted to changes from "[PATCH v2 1/4] dt-bindings:
backlight: lp855x: convert to YAML and modernize"[2]. The whole patchset has been reviewed, waiting for any further reviews or a merge.

Touchkey keycode property is added by "[PATCH 1/2] dt-bindings: mms114: Add linux,keycodes property for touch keys"[3]. So far only the bindings part of the patch has been acked, otherwise everything is awaiting review.

Display bindings have been added by "[PATCH v5 1/3] dt-bindings: display:
panel: Add Samsung S6D7AA0 LCD panel controller"[4]. These are already reviewed and merged into the DRM tree.

[1] https://lore.kernel.org/linux-devicetree/[email protected]/
[2] https://lore.kernel.org/linux-devicetree/[email protected]/
[3] https://lore.kernel.org/linux-devicetree/[email protected]/
[4] https://lore.kernel.org/linux-devicetree/[email protected]/

---
 arch/arm/boot/dts/Makefile                  |    3 +
 arch/arm/boot/dts/exynos4212-tab3-3g8.dts   |   29 +
 arch/arm/boot/dts/exynos4212-tab3-lte8.dts  |   44 +
 arch/arm/boot/dts/exynos4212-tab3-wifi8.dts |   26 +
 arch/arm/boot/dts/exynos4212-tab3.dtsi      | 1303 +++++++++++++++++++
 5 files changed, 1405 insertions(+)
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3-3g8.dts
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3-lte8.dts
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3-wifi8.dts
 create mode 100644 arch/arm/boot/dts/exynos4212-tab3.dtsi
arch/arm/boot/dts/Makefile +3 -0
index 59829fc90315..6a4ca481171e 100644
@@ -217,6 +217,9 @@ dtb-$(CONFIG_ARCH_EXYNOS4) += \
 	exynos4210-smdkv310.dtb \
 	exynos4210-trats.dtb \
 	exynos4210-universal_c210.dtb \
+	exynos4212-tab3-3g8.dtb \
+	exynos4212-tab3-lte8.dtb \
+	exynos4212-tab3-wifi8.dtb \
 	exynos4412-i9300.dtb \
 	exynos4412-i9305.dtb \
 	exynos4412-itop-elite.dtb \
arch/arm/boot/dts/exynos4212-tab3-3g8.dts new file +29 -0
new file mode 100644
index 000000000000..d96b2dd44608
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos4212 based Galaxy Tab 3 8.0 3G board device tree
+ * source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ */
+
+/dts-v1/;
+#include "exynos4212-tab3.dtsi"
+
+/ {
+	model = "Samsung Galaxy Tab 3 8.0 3G (SM-T311) based on Exynos4212";
+	compatible = "samsung,t311", "samsung,tab3", "samsung,exynos4212", "samsung,exynos4";
+	chassis-type = "tablet";
+};
+
+/* Pin control sleep state overrides */
+&sleep0 {
+	PIN_SLP(gpb-5, INPUT, UP);
+};
+
+&sleep1 {
+	PIN_SLP(gpl0-0, OUT0, NONE);
+	PIN_SLP(gpl1-0, OUT0, NONE);
+	PIN_SLP(gpl2-4, OUT0, NONE);
+	PIN_SLP(gpm3-3, OUT1, NONE);
+};
arch/arm/boot/dts/exynos4212-tab3-lte8.dts new file +44 -0
new file mode 100644
index 000000000000..bbb398eca7b0
@@ -0,0 +1,44 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos4212 based Galaxy Tab 3 8.0 LTE board device tree
+ * source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ */
+
+/dts-v1/;
+#include "exynos4212-tab3.dtsi"
+
+/ {
+	model = "Samsung Galaxy Tab 3 8.0 LTE (SM-T315) based on Exynos4212";
+	compatible = "samsung,t315", "samsung,tab3", "samsung,exynos4212", "samsung,exynos4";
+	chassis-type = "tablet";
+};
+
+/* Pin control sleep state overrides */
+&sleep0 {
+	PIN_SLP(gpa0-4, INPUT, UP);
+	PIN_SLP(gpa0-5, INPUT, UP);
+
+	PIN_SLP(gpb-5, INPUT, UP);
+
+	PIN_SLP(gpc0-0, PREV, NONE);
+	PIN_SLP(gpc1-3, INPUT, NONE);
+
+	PIN_SLP(gpf1-6, INPUT, NONE);
+	PIN_SLP(gpf2-2, PREV, NONE);
+};
+
+&sleep1 {
+	PIN_SLP(gpl0-0, PREV, NONE);
+
+	PIN_SLP(gpl1-0, PREV, NONE);
+
+	PIN_SLP(gpl2-1, INPUT, DOWN);
+	PIN_SLP(gpl2-2, INPUT, DOWN);
+	PIN_SLP(gpl2-4, OUT0, NONE);
+	PIN_SLP(gpl2-5, PREV, NONE);
+
+	PIN_SLP(gpm3-3, OUT1, NONE);
+};
arch/arm/boot/dts/exynos4212-tab3-wifi8.dts new file +26 -0
new file mode 100644
index 000000000000..54cb01703b60
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos4212 based Galaxy Tab 3 8.0 WiFi board device tree
+ * source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ */
+
+/dts-v1/;
+#include "exynos4212-tab3.dtsi"
+
+/ {
+	model = "Samsung Galaxy Tab 3 8.0 WiFi (SM-T310) based on Exynos4212";
+	compatible = "samsung,t310", "samsung,tab3", "samsung,exynos4212", "samsung,exynos4";
+	chassis-type = "tablet";
+};
+
+&i2c_lightsensor {
+	status = "okay";
+
+	lightsensor@10 {
+		compatible = "capella,cm3323";
+		reg = <0x10>;
+	};
+};
arch/arm/boot/dts/exynos4212-tab3.dtsi new file +16 -0
new file mode 100644
index 000000000000..e014100e11f8
@@ -0,0 +1,1303 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Samsung's Exynos4212 based Galaxy Tab 3 board common source
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *		http://www.samsung.com
+ */
+
+/dts-v1/;
+#include "exynos4212.dtsi"
+#include "exynos4412-ppmu-common.dtsi"
+#include "exynos-mfc-reserved-memory.dtsi"
+#include <dt-bindings/clock/samsung,s2mps11.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/input/gpio-keys.h>

arch/arm/boot/dts/exynos4212-tab3.dtsi line 26

Quoted 10 lines
arch/arm/boot/dts/exynos4212-tab3.dtsi new file +10 -0
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+#include "exynos-pinctrl.h"
+
+/*
+ * This device does not use the built-in RTC; instead, the RTC in the
+ * S5M8786 PMIC is used instead. Remove the unused node to avoid DTB check
+ * warnings.
+ */
+/delete-node/ &rtc;

This is not the solution. The S3C RTC is there. Just like all other boards we have two RTCs and DTS should be complete. Definitely you should not remove something just because there were warnings. Instead warnings should be fixed.

Best regards,
Krzysztof

#2 lore raw
Quoted 12 lines · Krzysztof Kozlowski

arch/arm/boot/dts/exynos4212-tab3.dtsi line 26

Quoted 6 lines · Artur Weber
arch/arm/boot/dts/exynos4212-tab3.dtsi new file +6 -0
+/*
+ * This device does not use the built-in RTC; instead, the RTC in the
+ * S5M8786 PMIC is used instead. Remove the unused node to avoid DTB check
+ * warnings.
+ */
+/delete-node/ &rtc;

This is not the solution. The S3C RTC is there. Just like all other boards we have two RTCs and DTS should be complete. Definitely you should not remove something just because there were warnings. Instead warnings should be fixed.

The problem is that the built-in RTC does not seem to work on this device. I attempted to add it, using the same clocks as other devices in mainline using the S5M8676 PMIC:

&rtc {
	status = "okay";
	clocks = <&clock CLK_RTC>, <&s5m8767_osc S2MPS11_CLK_AP>;
	clock-names = "rtc", "rtc_src";
};

However, it just prints the following on startup:

s3c-rtc 10070000.rtc: rtc disabled, re-enabling s3c-rtc 10070000.rtc: registered as rtc0
s3c-rtc 10070000.rtc: hctosys: unable to read the hardware clock

Since the internal RTC gets registered as rtc0, it's used as the default by the OS, whereas the working RTC from the PMIC is registered as rtc1. Writing to the internal RTC succeeds but the settings are not kept after a reboot. The PMIC's RTC works fine.

This isn't a mainline-only issue; the internal RTC does not work in the downstream kernel on this device either.

Not adding the RTC node results in a warning about missing clocks (exynos4.dtsi only provides 1 clock, whereas bindings require 2):

arch/arm/boot/dts/exynos4212-tab3-3g8.dtb: rtc@10070000: clocks: [[5, 346]] is too short
From schema: /mnt/linux/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml
arch/arm/boot/dts/exynos4212-tab3-3g8.dtb: rtc@10070000: clock-names: ['rtc'] is too short
From schema: /mnt/linux/Documentation/devicetree/bindings/rtc/s3c-rtc.yaml

...which makes sense, since we don't want to add clocks given that we're not going to be using this RTC. I suppose deleting the node with delete-node is a bit too destructive though.

I guess a good solution would be to set up the &rtc node as seen in the snippet I sent earlier, but keep it disabled + add a note explaining why it's done.

In your opinion, what would be the best solution?

Best regards
Artur

#3 lore raw
Quoted 24 lines · Artur Weber
Quoted 12 lines · Krzysztof Kozlowski

arch/arm/boot/dts/exynos4212-tab3.dtsi line 26

Quoted 6 lines · Artur Weber
arch/arm/boot/dts/exynos4212-tab3.dtsi new file +6 -0
+/*
+ * This device does not use the built-in RTC; instead, the RTC in the
+ * S5M8786 PMIC is used instead. Remove the unused node to avoid DTB check
+ * warnings.
+ */
+/delete-node/ &rtc;

This is not the solution. The S3C RTC is there. Just like all other boards we have two RTCs and DTS should be complete. Definitely you should not remove something just because there were warnings. Instead warnings should be fixed.

The problem is that the built-in RTC does not seem to work on this device. I attempted to add it, using the same clocks as other devices in mainline using the S5M8676 PMIC:

&rtc {
	status = "okay";
	clocks = <&clock CLK_RTC>, <&s5m8767_osc S2MPS11_CLK_AP>;
	clock-names = "rtc", "rtc_src";
};
Quoted 5 lines

However, it just prints the following on startup:

s3c-rtc 10070000.rtc: rtc disabled, re-enabling s3c-rtc 10070000.rtc: registered as rtc0
s3c-rtc 10070000.rtc: hctosys: unable to read the hardware clock

This should be debugged then... but with explanation is fine to leave the node disabled.

Removal of nodes is almost never correct.

Best regards,
Krzysztof