Skip to contentSkip to conversation

arm64: dts: qcom: sc8280xp: add several missing pdc map entries

PATCH Applied Pengyu Luo 3 participants 9 messages Apr 19 – Jul 2

Subsystems (3)
lore
Share & tools
lore

Pengyu Luo

author
#0 lore raw

PATCH 1/2 arm64: dts: qcom: sc8280xp: add several missing pdc map entries

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

---
 arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +2 -2
index 8d526ffede36..fa1bd27aa16f 100644
@@ -5365,7 +5365,7 @@ pdc: interrupt-controller@b220000 {
 					  <211 699 1>,
 					  <212 705 1>,
 					  <213 450 1>,
-					  <214 643 1>,
+					  <214 643 2>,
 					  <216 646 5>,
 					  <221 390 5>,
 					  <226 700 3>,
@@ -5388,7 +5388,7 @@ pdc: interrupt-controller@b220000 {
 					  <252 798 1>,
 					  <253 765 1>,
 					  <254 763 1>,
-					  <255 454 1>,
+					  <255 454 3>,
 					  <258 139 1>,
 					  <259 786 2>,
 					  <261 370 2>,
Signature · 1 line
2.53.0
author
#1 lore raw

PATCH 2/2 arm64: dts: qcom: sc8280xp: gaokun3: correct EC interrupt pin

Unlike other sc8280xp platforms, on this platform, in dsdt, gpio 0x2c0 is not mapped to gpio107, it is gpio103, so fix it. I found this until I did a trigger track, irq is regularly triggerd every several millisecs. In the past, since here gpio107 was low forever, ec irq would keep to be triggered and polling the event every several millisecs.

About how to get the map, please check openbsd driver for it
https://github.com/openbsd/src/blob/master/sys/dev/acpi/qcgpio.c

---
 arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc8280xp-huawei-gaokun3.dts +1 -1
index 9819454abe13..d9d55241336e 100644
@@ -637,7 +637,7 @@ embedded-controller@38 {
 		compatible = "huawei,gaokun3-ec";
 		reg = <0x38>;
 
-		interrupts-extended = <&tlmm 107 IRQ_TYPE_LEVEL_LOW>;
+		interrupts-extended = <&tlmm 103 IRQ_TYPE_LEVEL_LOW>;
 
 		#address-cells = <1>;
 		#size-cells = <0>;
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] arm64: dts: qcom: sc8280xp: gaokun3: correct EC interrupt pin

Quoted 7 lines · Pengyu Luo

Unlike other sc8280xp platforms, on this platform, in dsdt, gpio 0x2c0 is not mapped to gpio107, it is gpio103, so fix it. I found this until I did a trigger track, irq is regularly triggerd every several millisecs. In the past, since here gpio107 was low forever, ec irq would keep to be triggered and polling the event every several millisecs.

Quoted 5 lines

About how to get the map, please check openbsd driver for it
https://github.com/openbsd/src/blob/master/sys/dev/acpi/qcgpio.c

---

Konrad

Reviewed-by on v1 1/2
#3 lore raw
In reply to Pengyu Luo
Quoted 6 lines · Pengyu Luo

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

---

Konrad

The below change on top will fully align it with the data in the docs (no functional change)

(yes that's a removal of one irq mapping)

arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
index 761f229e8f47..23e80c765384 100644
@@ -5310,7 +5310,7 @@ pdc: interrupt-controller@b220000 {
                                          <66 438 3>,
                                          <69 86 1>,
                                          <70 520 54>,
-                                         <124 609 28>,
+                                         <124 609 27>,
                                          <159 638 1>,
                                          <160 720 8>,
                                          <168 801 1>,
author
#4 lore raw
Quoted 9 lines · Konrad Dybcio
Quoted 6 lines · Pengyu Luo

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

---

Quoted 7 lines

Konrad

The below change on top will fully align it with the data in the docs (no functional change)

Glad to know. Could you please help to check the tlmm map too? When I was parsing the binary, I found

tlmm 65535 => pdc 70 => gic 520 tlmm 65535 => pdc 174 => gic 733 tlmm 65535 => pdc 175 => gic 734 tlmm 65535 => pdc 176 => gic 735 tlmm 65535 => pdc 177 => gic 736 tlmm 65535 => pdc 178 => gic 737 tlmm 65535 => pdc 184 => gic 743 tlmm 65535 => pdc 185 => gic 744 tlmm 65535 => pdc 186 => gic 745 tlmm 65535 => pdc 187 => gic 746 tlmm 65535 => pdc 188 => gic 747 tlmm 65535 => pdc 194 => gic 753 tlmm 65535 => pdc 195 => gic 754 tlmm 65535 => pdc 196 => gic 755 tlmm 65535 => pdc 197 => gic 756 tlmm 65535 => pdc 198 => gic 757 tlmm 65535 => pdc 199 => gic 416 tlmm 65535 => pdc 204 => gic 462 tlmm 65535 => pdc 205 => gic 264

If 65536 means the pin is missing, I will send v2 to remove the tlmm map together with the pdc removal.

Best wishes,
Pengyu

Quoted 15 lines

(yes that's a removal of one irq mapping)

arch/arm64/boot/dts/qcom/sc8280xp.dtsi +1 -1
index 761f229e8f47..23e80c765384 100644
@@ -5310,7 +5310,7 @@ pdc: interrupt-controller@b220000 {
                                          <66 438 3>,
                                          <69 86 1>,
                                          <70 520 54>,
-                                         <124 609 28>,
+                                         <124 609 27>,
                                          <159 638 1>,
                                          <160 720 8>,
                                          <168 801 1>,
#5 lore raw
Quoted 42 lines · Pengyu Luo
Quoted 9 lines · Konrad Dybcio
Quoted 6 lines · Pengyu Luo

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

---

Quoted 7 lines

Konrad

The below change on top will fully align it with the data in the docs (no functional change)

Glad to know. Could you please help to check the tlmm map too? When I was parsing the binary, I found

tlmm 65535 => pdc 70 => gic 520 tlmm 65535 => pdc 174 => gic 733 tlmm 65535 => pdc 175 => gic 734 tlmm 65535 => pdc 176 => gic 735 tlmm 65535 => pdc 177 => gic 736 tlmm 65535 => pdc 178 => gic 737 tlmm 65535 => pdc 184 => gic 743 tlmm 65535 => pdc 185 => gic 744 tlmm 65535 => pdc 186 => gic 745 tlmm 65535 => pdc 187 => gic 746 tlmm 65535 => pdc 188 => gic 747 tlmm 65535 => pdc 194 => gic 753 tlmm 65535 => pdc 195 => gic 754 tlmm 65535 => pdc 196 => gic 755 tlmm 65535 => pdc 197 => gic 756 tlmm 65535 => pdc 198 => gic 757 tlmm 65535 => pdc 199 => gic 416 tlmm 65535 => pdc 204 => gic 462 tlmm 65535 => pdc 205 => gic 264

Quoted 2 lines

If 65536 means the pin is missing, I will send v2 to remove the tlmm map together with the pdc removal.

These seem to be LPASS/SSC GPIOs

There are missing pairs of:

TLMM 151 -> PDC 264 -> GIC 191
TLMM 143 -> PDC 261 -> GIC 402

and very interestingly, GPIO 190 has two mappings:
PDC 70 -> GIC 552
PDC 178 -> GIC 769

Konrad

author
#6 lore raw
Quoted 49 lines · Konrad Dybcio
Quoted 42 lines · Pengyu Luo
Quoted 9 lines · Konrad Dybcio
Quoted 6 lines · Pengyu Luo

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

---

Quoted 7 lines

Konrad

The below change on top will fully align it with the data in the docs (no functional change)

Glad to know. Could you please help to check the tlmm map too? When I was parsing the binary, I found

tlmm 65535 => pdc 70 => gic 520 tlmm 65535 => pdc 174 => gic 733 tlmm 65535 => pdc 175 => gic 734 tlmm 65535 => pdc 176 => gic 735 tlmm 65535 => pdc 177 => gic 736 tlmm 65535 => pdc 178 => gic 737 tlmm 65535 => pdc 184 => gic 743 tlmm 65535 => pdc 185 => gic 744 tlmm 65535 => pdc 186 => gic 745 tlmm 65535 => pdc 187 => gic 746 tlmm 65535 => pdc 188 => gic 747 tlmm 65535 => pdc 194 => gic 753 tlmm 65535 => pdc 195 => gic 754 tlmm 65535 => pdc 196 => gic 755 tlmm 65535 => pdc 197 => gic 756 tlmm 65535 => pdc 198 => gic 757 tlmm 65535 => pdc 199 => gic 416 tlmm 65535 => pdc 204 => gic 462 tlmm 65535 => pdc 205 => gic 264

Quoted 2 lines

If 65536 means the pin is missing, I will send v2 to remove the tlmm map together with the pdc removal.

These seem to be LPASS/SSC GPIOs

Quoted 7 lines

There are missing pairs of:

TLMM 151 -> PDC 264 -> GIC 191
TLMM 143 -> PDC 261 -> GIC 402

and very interestingly, GPIO 190 has two mappings:
PDC 70 -> GIC 552

PDC 70 is connected to swr2, which is wakeable. Speaking of this, in qcom,pdc.yaml

Drivers requiring wakeup capabilities of their device interrupts routed through the PDC, must specify PDC as their interrupt controller and request the PDC port associated with the GIC interrupt.

But swr2 specifies GIC.

I wonder, when should we use tlmm, when pdc, when gic?

Best wishes,
Pengyu

Quoted 4 lines

PDC 178 -> GIC 769

Konrad

#7 lore raw
Quoted 62 lines · Pengyu Luo
Quoted 49 lines · Konrad Dybcio
Quoted 42 lines · Pengyu Luo
Quoted 9 lines · Konrad Dybcio
Quoted 6 lines · Pengyu Luo

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

---

Quoted 7 lines

Konrad

The below change on top will fully align it with the data in the docs (no functional change)

Glad to know. Could you please help to check the tlmm map too? When I was parsing the binary, I found

tlmm 65535 => pdc 70 => gic 520 tlmm 65535 => pdc 174 => gic 733 tlmm 65535 => pdc 175 => gic 734 tlmm 65535 => pdc 176 => gic 735 tlmm 65535 => pdc 177 => gic 736 tlmm 65535 => pdc 178 => gic 737 tlmm 65535 => pdc 184 => gic 743 tlmm 65535 => pdc 185 => gic 744 tlmm 65535 => pdc 186 => gic 745 tlmm 65535 => pdc 187 => gic 746 tlmm 65535 => pdc 188 => gic 747 tlmm 65535 => pdc 194 => gic 753 tlmm 65535 => pdc 195 => gic 754 tlmm 65535 => pdc 196 => gic 755 tlmm 65535 => pdc 197 => gic 756 tlmm 65535 => pdc 198 => gic 757 tlmm 65535 => pdc 199 => gic 416 tlmm 65535 => pdc 204 => gic 462 tlmm 65535 => pdc 205 => gic 264

Quoted 2 lines

If 65536 means the pin is missing, I will send v2 to remove the tlmm map together with the pdc removal.

These seem to be LPASS/SSC GPIOs

Quoted 7 lines

There are missing pairs of:

TLMM 151 -> PDC 264 -> GIC 191
TLMM 143 -> PDC 261 -> GIC 402

and very interestingly, GPIO 190 has two mappings:
PDC 70 -> GIC 552

PDC 70 is connected to swr2, which is wakeable. Speaking of this, in qcom,pdc.yaml

Quoted 7 lines

Drivers requiring wakeup capabilities of their device interrupts routed through the PDC, must specify PDC as their interrupt controller and request the PDC port associated with the GIC interrupt.

But swr2 specifies GIC.

I wonder, when should we use tlmm, when pdc, when gic?

I would assume "pdc, whenever available"

Konrad

maintainer Applied
#8 lore raw

Re: (subset) [PATCH 1/2] arm64: dts: qcom: sc8280xp: add several missing pdc map entries

In reply to Pengyu Luo
Quoted 5 lines · Pengyu Luo

pdc 215, 256, 257 are missing, but we can find tlmm pin 103, 84, 90 are mapped to them respectively, so add the map entries from pdc to gic. These entries are reversed from .data section of qcgpio.sys

Applied, thanks!

[1/2] arm64: dts: qcom: sc8280xp: add several missing pdc map entries

      commit: 96f65d01f3132a163a8c0e84aca00f2acdc75e9b
[2/2] arm64: dts: qcom: sc8280xp: gaokun3: correct EC interrupt pin
      commit: 6267f93eac9aa6963797c5bc1a18de9571ccac26

Best regards,

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