Skip to contentSkip to conversation

arm64: dts: qcom: add initial support for Samsung Galaxy S22

PATCH Superseded Eric Gonçalves 4 participants 8 messages Jun 16, 2025 – Jun 17, 2025

Subsystems (3)

v5 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v5 cover arm64: dts: qcom: add initial support for Samsung Galaxy S22

Changes in v5:
- Properly format the thread

Changes in v4:
- Try to properly format the thread

Changes in v3:
- Removed unnecessary initrd start and end addresses
- Make sure r0q is in right order on Makefile
- Properly format memory addresses
- Set r0q to the correct, alphabetical order in documents

I'm sorry for my mistakes, this is my first patch and I got a bit confused on how the whole patch system works. I hope that is cleared up.

Eric Gonçalves (2):
dt-bindings: arm: qcom: document r0q board binding
arm64: dts: qcom: add initial support for Samsung Galaxy S22

 .../devicetree/bindings/arm/qcom.yaml         |   1 +
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 363 ++++++++++++++++++
 3 files changed, 365 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts
Signature · 1 line
2.49.0
#1 lore raw

PATCH v5 1/2 dt-bindings: arm: qcom: document r0q board binding

Adds compatible for the Samsung Galaxy S22 (SM-S901E) (r0q), based on the Snapdragon 8 Gen 1 SoC.

---
 Documentation/devicetree/bindings/arm/qcom.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/arm/qcom.yaml +1 -0
index b14206d11f8b..491409905da4 100644
@@ -1090,6 +1090,7 @@ properties:
           - enum:
               - qcom,sm8450-hdk
               - qcom,sm8450-qrd
+              - samsung,r0q
               - sony,pdx223
               - sony,pdx224
           - const: qcom,sm8450
Signature · 1 line
2.49.0
#2 lore raw

PATCH v5 2/2 arm64: dts: qcom: add initial support for Samsung Galaxy S22

In reply to Eric Gonçalves

Adds new device support for the Samsung Galaxy S22 (SM-S901E) phone

Working features:
- simple-framebuffer
- side buttons
- storage
- usb

---
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 363 ++++++++++++++++++
 2 files changed, 364 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
index 669b888b27a1..fa38d71d190d 100644
@@ -285,6 +285,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sm8350-sony-xperia-sagami-pdx214.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8350-sony-xperia-sagami-pdx215.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-hdk.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-qrd.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-samsung-r0q.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-sony-xperia-nagara-pdx223.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-sony-xperia-nagara-pdx224.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8550-hdk.dtb
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +363 -0

363 lines not on this page · raw message

Signature · 1 line
2.49.0
#3 lore raw
Quoted 55 lines · Eric Gonçalves

Adds new device support for the Samsung Galaxy S22 (SM-S901E) phone

Working features:
- simple-framebuffer
- side buttons
- storage
- usb

---
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 363 ++++++++++++++++++
 2 files changed, 364 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts
arch/arm64/boot/dts/qcom/Makefile +1 -0
index 669b888b27a1..fa38d71d190d 100644
@@ -285,6 +285,7 @@ dtb-$(CONFIG_ARCH_QCOM)	+= sm8350-sony-xperia-sagami-pdx214.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8350-sony-xperia-sagami-pdx215.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-hdk.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-qrd.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-samsung-r0q.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-sony-xperia-nagara-pdx223.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8450-sony-xperia-nagara-pdx224.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= sm8550-hdk.dtb
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +22 -0
new file mode 100644
index 000000000000..6daf906cde08
@@ -0,0 +1,363 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) 2025, Eric Gonçalves <[email protected]>
+ * Copyright (c) 2025, Arthur Aligon <[email protected]>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/input/linux-event-codes.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+
+#include "sm8450.dtsi"
+#include "pm8350.dtsi"
+#include "pm8350b.dtsi"
+#include "pm8350c.dtsi"
+#include "pm8450.dtsi"
+#include "pmk8350.dtsi"
+#include "pmr735a.dtsi"
+
+/delete-node/ &xbl_ramdump_mem;
+/delete-node/ &xbl_sc_mem;

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 32

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +10 -0
+/delete-node/ &adsp_mem;
+/delete-node/ &rmtfs_mem;
+/delete-node/ &mte_mem;
+/delete-node/ &trusted_apps_mem;
+/delete-node/ &trusted_apps_ext_mem;
+
+/ {
+	chassis-type = "handset";
+	model = "Samsung Galaxy S22 (SM-S901E)";
+	compatible = "samsung,r0q", "qcom,sm8450";

Please open existing DTS and look how it is organized there.

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 39

Quoted 7 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +7 -0
+
+	chosen {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		bootargs = "clk_ignore_unused pd_ignore_unused";

You got comments here.

Respond to comments instead of ignoring them silently.

Quoted 18 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +18 -0
+		stdout-path = "serial0:115200n8";
+
+		framebuffer: framebuffer@b8000000 {
+			compatible = "simple-framebuffer";
+			reg = <0x0 0xb8000000 0x0 0x2b00000>;
+			width = <1080>;
+			height = <2340>;
+			stride = <(1080 * 4)>;
+			format = "a8r8g8b8";
+		};
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+		autorepeat;
+
+		pinctrl-0 = <&vol_up_n>;
+		pinctrl-names = "default";

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 67

Quoted 10 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +10 -0
+
+		key-vol-up {
+			label = "Volume Up";
+			linux,code = <KEY_VOLUMEUP>;
+			gpios = <&pm8350_gpios 6 GPIO_ACTIVE_LOW>;
+			debounce-interval = <15>;
+		};
+	};
+
+	memory {

It does not look like you tested the DTS against bindings. Please run make dtbs_check W=1 (see Documentation/devicetree/bindings/writing-schema.rst or
https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/
for instructions).
Maybe you need to update your dtschema and yamllint. Don't rely on distro packages for dtschema and be sure you are using the latest released dtschema.

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 70

Quoted 3 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +3 -0
+		ddr_device_type = <0x08>;
+		device_type = "memory";
+		reg = <0x00 0x80000000 0x00 0x6a000000 0x00 0xf1c00000 0x00 0xe400000 0x08 0x00 0x00 0x3ab00000 0x08 0x40000000 0x01 0x40000000 0x08 0x3b100000 0x00 0x1e00000>;

Please run scripts/checkpatch.pl on the patches and fix reported warnings. After that, run also 'scripts/checkpatch.pl --strict' on the patches and (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear.

And these are multiple entries, so they have to be split. Again - look at existing, LATEST DTS. There is rarely a reason to do things very different.

Quoted 1 line
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +1 -0
+	};

...

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 326

Quoted 13 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +13 -0
+
+&pon_pwrkey {
+	status = "okay";
+};
+
+&pon_resin {
+	status = "okay";
+	linux,code = <KEY_VOLUMEDOWN>;
+};
+
+&usb_1 {
+	qcom,select-utmi-as-pipe-clk;
+	status = "okay";

Here the last

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 338

Quoted 12 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +12 -0
+};
+
+&usb_1_dwc3 {
+	dr_mode = "peripheral";
+	maximum-speed = "high-speed";
+
+	phys = <&usb_1_hsphy>;
+	phy-names = "usb2-phy";
+};
+
+&usb_1_hsphy {
+	status = "okay";

Here the first. See DTS coding style or recent DTS boards.

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts line 343

Quoted 5 lines
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts new file +5 -0
+	vdda-pll-supply = <&vreg_l5b_0p88>;
+	vdda18-supply = <&vreg_l1c_1p8>;
+	vdda33-supply = <&vreg_l2b_3p07>;
+};
+

Best regards,
Krzysztof

#4 lore raw
In reply to Eric Gonçalves
Quoted 12 lines · Eric Gonçalves

Changes in v5:
- Properly format the thread

Changes in v4:
- Try to properly format the thread

Changes in v3:
- Removed unnecessary initrd start and end addresses
- Make sure r0q is in right order on Makefile
- Properly format memory addresses
- Set r0q to the correct, alphabetical order in documents

Quoted 3 lines

I'm sorry for my mistakes, this is my first patch and I got a bit confused on how the whole patch system works. I hope that is cleared up.

No worries, you may take interest in the b4 tool that abstracts out such formalities:

https://b4.docs.kernel.org/en/latest/

Konrad

#5 lore raw
In reply to Eric Gonçalves
Quoted 20 lines · Eric Gonçalves

Changes in v5:
- Properly format the thread

Changes in v4:
- Try to properly format the thread

Changes in v3:
- Removed unnecessary initrd start and end addresses
- Make sure r0q is in right order on Makefile
- Properly format memory addresses
- Set r0q to the correct, alphabetical order in documents

I'm sorry for my mistakes, this is my first patch and I got a bit confused on how the whole patch system works. I hope that is cleared up.

Eric Gonçalves (2):
dt-bindings: arm: qcom: document r0q board binding
arm64: dts: qcom: add initial support for Samsung Galaxy S22

Quoted 11 lines
 .../devicetree/bindings/arm/qcom.yaml         |   1 +
 arch/arm64/boot/dts/qcom/Makefile             |   1 +
 .../boot/dts/qcom/sm8450-samsung-r0q.dts      | 363 ++++++++++++++++++
 3 files changed, 365 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dts

--
2.49.0

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

  pip3 install dtschema --upgrade

This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/next-20250616 (exact match)

If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically)

New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/qcom/' for [email protected]:

arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: / (samsung,r0q): memory: 'ddr_device_type' does not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/memory.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: / (samsung,r0q): memory: False schema does not allow {'ddr_device_type': [8], 'device_type': ['memory'], 'reg': [[0, 2147483648, 0, 1778384896], [0, 4055891968, 0, 239075328], [8, 0, 0, 984612864], [8, 1073741824, 1, 1073741824], [8, 990904320, 0, 31457280]]}
from schema $id: http://devicetree.org/schemas/root-node.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: memory@fe200000 (qcom,rmtfs-mem): Unevaluated properties are not allowed ('reg-names' was unexpected)
from schema $id: http://devicetree.org/schemas/reserved-memory/qcom,rmtfs-mem.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: clock-controller@aaf0000 (qcom,sm8450-videocc): power-domains: [[98, 6]] is too short
from schema $id: http://devicetree.org/schemas/clock/qcom,sm8450-videocc.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: clock-controller@aaf0000 (qcom,sm8450-videocc): required-opps: [[55]] is too short
from schema $id: http://devicetree.org/schemas/clock/qcom,sm8450-videocc.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: clock-controller@aaf0000 (qcom,sm8450-videocc): Unevaluated properties are not allowed ('power-domains', 'required-opps' were unexpected)
from schema $id: http://devicetree.org/schemas/clock/qcom,sm8450-videocc.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: clock-controller@ade0000 (qcom,sm8450-camcc): power-domains: [[98, 6]] is too short
from schema $id: http://devicetree.org/schemas/clock/qcom,sm8450-camcc.yaml#
arch/arm64/boot/dts/qcom/sm8450-samsung-r0q.dtb: clock-controller@ade0000 (qcom,sm8450-camcc): required-opps: [[55]] is too short
from schema $id: http://devicetree.org/schemas/clock/qcom,sm8450-camcc.yaml#

#6 lore raw
In reply to Eric Gonçalves
Quoted 12 lines · Eric Gonçalves

Changes in v5:
- Properly format the thread

Changes in v4:
- Try to properly format the thread

Changes in v3:
- Removed unnecessary initrd start and end addresses
- Make sure r0q is in right order on Makefile
- Properly format memory addresses
- Set r0q to the correct, alphabetical order in documents

Quoted 4 lines

I'm sorry for my mistakes, this is my first patch and I got a bit confused on how the whole patch system works. I hope that is cleared up.

Can you slow down please? One patchset per day.

<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

You missed at least devicetree list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time.

Please kindly resend and include all necessary To/Cc entries. </form letter>

Best regards,
Krzysztof

#7 lore raw
Quoted 25 lines · Krzysztof Kozlowski
Quoted 12 lines · Eric Gonçalves

Changes in v5:
- Properly format the thread

Changes in v4:
- Try to properly format the thread

Changes in v3:
- Removed unnecessary initrd start and end addresses
- Make sure r0q is in right order on Makefile
- Properly format memory addresses
- Set r0q to the correct, alphabetical order in documents

Quoted 4 lines

I'm sorry for my mistakes, this is my first patch and I got a bit confused on how the whole patch system works. I hope that is cleared up.

Can you slow down please? One patchset per day.

<form letter>
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Quoted 7 lines

Tools like b4 or scripts/get_maintainer.pl provide you proper list of people, so fix your workflow. Tools might also fail if you work on some ancient tree (don't, instead use mainline) or work on fork of kernel (don't, instead use mainline). Just use b4 and everything should be fine, although remember about b4 prep --auto-to-cc if you added new patches to the patchset.

Heh, I already asked that and you ignored the comment. Respond to comments and implement them.

Best regards,
Krzysztof