Skip to content

Commit 9552455

Browse files
scripts: genpinctrl: treat STM32MP13 and STM32MP15 as separate series
Instead of hacking around when processing the STM32MP1 series, separate STM32MP13 and STM32MP15 SoCs lines into dedicated series ("families", as the script calls them). This allows simplifying the script's logic. Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
1 parent c60a842 commit 9552455

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

scripts/genpinctrl/genpinctrl.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"stm32l4",
6767
"stm32l5",
6868
"stm32mp1",
69+
"stm32mp13",
6970
"stm32mp2",
7071
"stm32n6",
7172
"stm32u0",
@@ -456,6 +457,16 @@ def get_mcu_signals(data_path, gpio_ip_afs):
456457
family = mcu_root.get("Family").replace("+", "")
457458
ref = mcu_root.get("RefName")
458459

460+
# STM32MP13 line and STM32MP15 line SoCs are grouped under
461+
# the same "STM32MP1" family in Open Pin Data, but we want
462+
# to generate pinctrl for these lines in separate directories.
463+
# Change family based on SoC model if this is an MP1 SoC.
464+
if family == "STM32MP1":
465+
if ref.lower().startswith("stm32mp13"):
466+
family = "STM32MP13"
467+
elif ref.lower().startswith("stm32mp15"):
468+
family = "STM32MP1"
469+
459470
gpio_ip_version = None
460471
for ip in mcu_root.findall(NS + "IP"):
461472
if ip.get("Name") == "GPIO":
@@ -637,15 +648,12 @@ def main(data_path, output):
637648
else:
638649
logger.info(f"Processing family {family}...")
639650

640-
# create directory for each family and process each reference
641-
for ref in refs:
642-
if ref["name"].lower().startswith("stm32mp13"):
643-
family_dir = output / "st" / "mp13"
644-
else:
645-
family_dir = output / "st" / family.lower()[5:]
646-
if not family_dir.exists():
647-
family_dir.mkdir(parents=True)
651+
# create destination directory for the family
652+
family_dir = output / "st" / family.lower().removeprefix("stm32")
653+
family_dir.mkdir(parents=True, exist_ok=True)
648654

655+
# process each reference of the family
656+
for ref in refs:
649657
entries = dict()
650658

651659
# process each pin in the current reference

0 commit comments

Comments
 (0)