Skip to content

sstar: gpio dump walks the per-pad GPIO registers on Infinity6C - #292

Merged
openipc-ai merged 1 commit into
masterfrom
sstar/gpio-dump
Nov 23, 2026
Merged

openipc-ai merged 1 commit into
masterfrom
sstar/gpio-dump

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

ipctool gpio dump refused every SigmaStar part with "not supported on this SoC yet", although gpio get, gpio scan and the IR-cut guess already read SigmaStar's per-pad GPIO registers (sstar_gpio_read()).

  • The per-pin output (pad-mux lookup, text and JSON) moves into gpio_dump_pin(). The PL061 bank walk and a new SigmaStar walk both call it, so HiSilicon output is unchanged byte for byte.
  • On SigmaStar, pins are named GPIO<pad>, the number sysfs uses. The level is the one gpio get reports: the pin for an input, the driven value for an output.
  • Infinity6C only, because sstar_gpio_supported() is. Other SigmaStar families still answer "not supported" until their register table is added.

Verified on an SSC378DE (Infinity6C):

  • 82 pads; the --json output parses.
  • Pad 13 read out 1, out 0 and in 0 as sysfs drove it, matching the raw register (0x6B / 0x68 / 0x6C).
  • Pads carrying a function show the function name, matching reginfo --pads.
  • Native build: every *_test passes.

`gpio dump` refused every SigmaStar part, although `gpio get`, `scan` and
the IR-cut guess already read the per-pad registers there. The per-pin
output moves into gpio_dump_pin(), shared by the PL061 bank walk and a
SigmaStar walk over sstar_gpio_read(); HiSilicon output is unchanged.
Pins are named GPIO<pad>, the number sysfs uses, and the level is the
one `gpio get` reports.

Verified on an SSC378DE: 82 pads, valid JSON, and pad 13 reads out 1,
out 0 and in 0 as sysfs drives it.
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Support GPIO dumps on SigmaStar Infinity6C

✨ Enhancement 🐞 Bug fix 🕐 20-40 Minutes

Grey Divider

AI Description

• Enable GPIO dumps on Infinity6C using its existing per-pad register reader.
• Share pad-mux and output formatting with the PL061 path, preserving HiSilicon output.
• Report sysfs pad numbers and direction-aware levels in text or JSON.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • Fault-specific containment limits risk to the originating changed behavior.
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, SigmaStar was rejected by gpio_dump_cmd while the PL061 bank path handled supported non-SigmaStar chips.
  • After, dispatch selects a SigmaStar loop, reads one per-pad register, applies the already-established input/output and level bit rules, and passes the result through the existing mux/output formatter.
  • The new correctness condition is that each supported SigmaStar pad is paired with the correct register and that its input/output and level bits are decoded consistently.
  • This is a direct transformation using existing read and pad-mux infrastructure; it does not introduce a new state machine, concurrency protocol, coordinated invariant, or nontrivial algorithm.
Potential damage 🟢 Low 🩹 Reversible

  • Conservative damage bound for the originating changed behavior; downstream capabilities remain contained.
  • An incorrect report can mislead an operator or a consumer of the JSON output and may require rerunning the command or using another inspection method.
  • Reverting the code restores the previous unsupported response, but it does not repair any persistent state because this path only reads registers.
  • No external effect or durable corruption is reachable from the changed behavior.
  • Recoverable by rerunning after correction or using existing GPIO/pad-mux inspection commands.
  • Code rollback removes the new report but does not provide SigmaStar dump functionality; no state repair or external compensation is needed.
Assessed commit 5ee9d41
Diagram

graph TD
  CMD["gpio dump"] --> SUPPORT{"Infinity6C?"} -->|yes| SSTAR["Per-pad read"] --> FORMAT["Mux and format"] --> OUTPUT["Text or JSON"]
  SUPPORT -->|no, supported bank| PL061["PL061 bank read"] --> FORMAT
Loading
High-Level Assessment

Reusing the existing Infinity6C register reader and extracting the common per-pin formatter is the appropriate approach. It avoids a second register implementation and duplicated output logic while leaving unsupported SigmaStar families gated out.

Files changed (1) +112 / -73

Enhancement (1) +112 / -73
reginfo.cAdd Infinity6C per-pad GPIO dumps with shared pin formatting +112/-73

Add Infinity6C per-pad GPIO dumps with shared pin formatting

• Extracts pad-mux classification and text/JSON rendering into gpio_dump_pin(), which the existing PL061 walk now calls. Adds an Infinity6C walk using sstar_gpio_read(), names pins by sysfs pad number, and selects input or output levels according to the register direction bit. Read failures still produce partial output and a failure exit status.

src/reginfo.c

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@openipc-ai
openipc-ai merged commit f3a2a4c into master Nov 23, 2026
5 checks passed
@openipc-ai
openipc-ai deleted the sstar/gpio-dump branch November 23, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant