Skip to content

Commit fca326a

Browse files
[nrf fromlist] soc: nordic: uicr: fix pin function ignore handling in CTRLSEL lookup
Upstream PR #: 100579 Selecting the correct CTRLSEL value for VPR IO pins relies on mapping any pinctrl psel value with the correct port/pin set on the VPR nodes in devicetree to the same CTRLSEL value, to avoid enumerating all permutations of (pin function, port, pin). However, the mechanism did not work as intended and ended up mapping all these pins to GPIO instead, which meant that the pins did not behave as expected. Update the handling so that it works as intended. Signed-off-by: Jonathan Nilsen <[email protected]>
1 parent 084b65b commit fca326a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

soc/nordic/common/uicr/periphconf/builder.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,19 +1116,21 @@ def lookup_ctrlsel_for_property(self, prop: Property, psel: tuple[int, int]) ->
11161116

11171117
def lookup_ctrlsel_for_pinctrl(self, prop: PinCtrl, psel: NrfPsel) -> Ctrlsel | None:
11181118
"""Find the appopriate CTRLSEL value for a given pinctrl."""
1119+
ctrlsel_default = None
11191120
if psel.fun == NrfFun.ASSUMED_GPIO:
11201121
# We map unsupported values to GPIO CTRLSEL
1121-
return CTRLSEL_DEFAULT
1122+
ctrlsel_default = CTRLSEL_DEFAULT
11221123

11231124
periph_addr = dt_reg_addr(prop.node, secure=True)
1124-
return self._lookup_ctrlsel(periph_addr, psel)
1125+
return self._lookup_ctrlsel(periph_addr, psel, ctrlsel_default=ctrlsel_default)
11251126

11261127
def _lookup_ctrlsel(
11271128
self,
11281129
periph_addr: int,
11291130
prop_or_psel: NrfPsel | GpiosProp,
1131+
ctrlsel_default: Ctrlsel | None = None,
11301132
) -> Ctrlsel | None:
1131-
ctrlsel = None
1133+
ctrlsel = ctrlsel_default
11321134

11331135
if periph_addr in self.ctrlsel_lookup:
11341136
ident_lut = self.ctrlsel_lookup[periph_addr]

0 commit comments

Comments
 (0)