[Libre-soc-bugs] [Bug 846] Pinmux Pinspec Interconnect Auto-Generation
bugzilla-daemon at libre-soc.org
bugzilla-daemon at libre-soc.org
Sat Sep 17 18:52:03 BST 2022
https://bugs.libre-soc.org/show_bug.cgi?id=846
--- Comment #2 from Andrey Miroshnikov <andrey at technepisteme.xyz> ---
Previous IRC logs on pinmux (didn't see them being linked anywhere):
https://libre-soc.org/irclog/%23libre-soc.2022-06-01.log.html#t2022-06-01T16:21:37
https://libre-soc.org/irclog/%23libre-soc.2022-06-28.log.html#t2022-06-28T12:22:28
https://libre-soc.org/irclog/%23libre-soc.2022-07-21.log.html#t2022-07-21T17:48:57
https://libre-soc.org/irclog/%23libre-soc.2022-08-02.log.html#t2022-08-02T14:12:34
https://libre-soc.org/irclog/%23libre-soc.2022-09-01.log.html#t2022-09-01T22:53:52
The auto-generated pinmux is working, and you can run the example and view the
.gtkw file.
https://git.libre-soc.org/?p=pinmux.git;a=blob;f=src/spec/stage2.py;h=2f79bcff83de1499cd8ab798d3c65da873280e06;hb=cb767260554196bee67d309c67b967ba070fa722
All that's needed for this pinmux to work is a dictionary containing the pads
and their mux/bank peripherals (#l404).
The peripheral entry is of the form [name, unit_number, pin] (pin is needed for
uart and i2c, as tx/rx, sda/scl have to be defined on separate pads.
The following dict defines 4 gpios, a uart, and an i2c:
requested = {"N1": {"mux0": ["gpio", 0],
"mux1": ["uart", 0, "tx"],
"mux2": ["i2c", 0, "sda"]},
"N2": {"mux0": ["gpio", 1],
"mux1": ["uart", 0, "rx"],
"mux2": ["i2c", 0, "scl"]},
"N3": {"mux0": ["gpio", 2]},
"N4": {"mux0": ["gpio", 3]}
}
The disadvantage of this dict is that peripherals are grouped by the pads (thus
requiring the user to split the definitions), whereas it's probably more
convenient to group by peripheral instead.
For example this format modifies the dummy_pinset by encompassing the extra
information for the peripheral within a dict:
{
'gpio': {'signals':['0*'], 'unit':0, 'pads':['N1'], 'bank':0},
'uart': {'signals':['tx+', 'rx-'], 'unit':0, 'pads':['N1', 'N2'],
'bank':1},
'i2c': {'signals':['sda*', 'scl*'], 'unit':0, 'pads':['N1', 'N2'],
'bank':2}
}
I also need to add support for the jtag dir types (+/-/*), because currently
those are hard-coded.
I have not extended the gpio entry to support multiple gpio definition at once,
but that can be added.
ls180.py/ngi_router.py uses the PinSpec class (base.py) and functions defined
in pinfunctions.py (.i2c(), .gpio(), etc.) to create the lists of signals to
add. Should I be using these (or extend them to the bank information)?
Should I make these changes? Or do you have other comments/points?
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the libre-soc-bugs
mailing list