Fishwaldo opened a new pull request, #20063:
URL: https://github.com/apache/nuttx/pull/20063

   ## 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 tables
   - `boards: Report the pads at startup.`: one line of boot output
   - `arch: Describe the pads through procfs.`: `get_pad`, so pads carry names
   - `boards: Enable the pinctrl procfs entry.`: the two board configurations
   
   The 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
   
   ```
   [CPU0] pinctrl: 166 pads, 3 configured
   ```
   
   `/proc/pinctrl`, abridged from 166 rows:
   
   ```
   pinctrl0: 166 pads
   0    CHIP_MODE            func:0 sel:CHIP_MODE        ds:0 pu:0 pd:1 ie:1 
smt:1 slew:-
   5    XIN                  func:- sel:-                ds:12 pu:- pd:- ie:- 
smt:- slew:- frs:2 rd:0
   103  UART0_TX             func:0 sel:UART0_TX         ds:1 pu:0 pd:0 ie:0 
smt:0 slew:-
   139  GPIO92               func:0 sel:I2C8_SCL         ds:1 pu:0 pd:0 ie:1 
smt:0 slew:-
   141  S_MODE               func:2 sel:GPIO94           ds:1 pu:0 pd:1 ie:0 
smt:0 slew:-
   163  LPDDR_REF_CLK        func:- sel:-                ds:0 pu:0 pd:0 ie:1 
smt:0 slew:- ms:3
   164  ADDR_RGMII0_SEL_MODE func:- sel:-                ds:- pu:- pd:- ie:- 
smt:- slew:- ms1:1 ms2:1
   ```
   
   Every line carries the same tokens, with `-` where the pad's layout has no 
such
   field, 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_MODE` while `sel:` reads `GPIO94`. The name table costs about 9 KiB and is
   built only when something will print it.
   
   ## Testing
   
   Booted on the ESWIN EIC7700 EVB, TFTP loaded from U-Boot, `/proc/pinctrl` 
read
   back in full: ids 0 to 165, no gaps or repeats.
   
   Compiled with `-Wno-cpp -Werror`. `tools/checkpatch.sh -c -u -m -g 
master..HEAD`
   passes.
   
   `CONFIG_PINCTRL_PROCFS` depends on `FS_PROCFS_REGISTER`, so both board
   configurations enable it; without it the symbol is dropped when the
   configuration is regenerated and the entry never appears.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to