arch/risc-v/eic7700x: Add the CLMM pad multiplexer. - #20063
Open
Fishwaldo wants to merge 4 commits into
Open
Conversation
Every ball on this SoC is shared between several functions, and nothing in this port could see which function a pad carried or change it. A driver that finds nothing cannot tell a dead block from a pad still pointed somewhere else. Registers the CLMM pad multiplexer with the pinctrl framework and defines every pad and every function select the manual documents, across the straps, JTAG, PCIe, HDMI, Ethernet, I2S, SPI, GPIO, USB, I2C, UART, fan and MIPI CSI groups. Writes nothing at start up: a pad only moves when a driver asks. eic7700x_pinctrl_count() reports how many pads currently differ from their reset defaults, which after boot is the set the boot loader and the drivers have configured; the board start up logs it. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac>
Log one line from board start up with the pad count and how many differ from their reset defaults, through eic7700x_pinctrl_count(). A helper holds its locals so nothing stays on the stack for the bring up that follows. Turn the pinctrl driver's error output on for both boards, so a refused pad write says why rather than merely failing. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac>
Implements the pinctrl get_pad method, so /proc/pinctrl and PINCTRLC_GETPAD carry what this block is actually holding: each layout's common fields with their validity bits, and the layout's own fields, the RGMII and mode-select voltage bits and the oscillator tuning, as key:value text. Names every pad and every documented function select in one PINCTRL_PADNAME() table, so func:2 on S_MODE reads as GPIO94 rather than as a number. The names are the manual's own; a pad's name describes its default function, not its current one. The table costs about 9 KiB and is built only with the file that reads it; the name helpers return NULL without it and the strings stay empty. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac>
Publishes /proc/pinctrl on both boards, which lists every pad with the function it currently carries. The startup banner counts how many pads differ from their reset values, once, at boot; this answers the same question at any later moment, which is what is wanted when a driver has just reconfigured a pad and the result is not what was expected. PINCTRL_PROCFS depends on FS_PROCFS_REGISTER, the entry registering itself at run time rather than being one of the built in ones. Neither board set it, and without it the symbol is dropped when the configuration is regenerated and the entry never appears, which is silent: the defconfig still reads as though the feature were on. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac>
xiaoxiang781216
approved these changes
Sep 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every ball on the EIC7700X is shared between several functions, and nothing in
this port could see which function a pad carried or change it. This registers
the Chip Level Mode Mux with the pinctrl framework, describes all 166 pads and
every documented function select, and lists them in
/proc/pinctrl.It is the first pinctrl provider in the tree: the framework's read-back landed
in #19871 with nothing implementing it until now.
arch: Describe and configure the pads.: the provider and the pad tablesboards: Report the pads at startup.: one line of boot outputarch: Describe the pads through procfs.:get_pad, so pads carry namesboards: Enable the pinctrl procfs entry.: the two board configurationsThe pad tables carry the judgement calls, each recorded with its TRM citation at
the row or function it applies to: which bits the manual says are writable, the
three pads this driver refuses to move, the pads whose documented functions are
a subset of what the field can hold, and the two balls that have no pad register
at all. Initialisation writes nothing to the hardware.
Output
/proc/pinctrl, abridged from 166 rows:Every line carries the same tokens, with
-where the pad's layout has no suchfield, so the file parses without knowing pad shapes. Names are the manual's and
describe a pad's default function, not its current one, which is why pad 141 is
S_MODEwhilesel:readsGPIO94. The name table costs about 9 KiB and isbuilt only when something will print it.
Testing
Booted on the ESWIN EIC7700 EVB, TFTP loaded from U-Boot,
/proc/pinctrlreadback in full: ids 0 to 165, no gaps or repeats.
Compiled with
-Wno-cpp -Werror.tools/checkpatch.sh -c -u -m -g master..HEADpasses.
CONFIG_PINCTRL_PROCFSdepends onFS_PROCFS_REGISTER, so both boardconfigurations enable it; without it the symbol is dropped when the
configuration is regenerated and the entry never appears.