Files
u-boot/drivers
Samuel Holland 29babfd92b sunxi: pinctrl: Implement pin muxing functions
Implement the operations to get pin and function names, and to set the
mux for a pin. The pin count and pin names are calculated as if each
bank has the maximum number of pins. Function names are simply the index
into a list of { function name, mux value } pairs.

We assume all pins associated with a function use the same mux value for
that function. This is generally true within a group of pins on a single
port, but generally false when some peripheral can be muxed to multiple
ports. For example, A64 UART3 uses mux 3 on port D, and mux 2 on port H.
But all of the port D pins use the same mux value, and so do all of the
port H pins. This applies even when the pins for some function are not
contiguous, and when the lower-numbered mux values are unused. A good
example of both of these cases is SPI0 on most SoCs.

This strategy saves a lot of space (which is especially important for
SPL), but where the mux value for a certain function differs across
ports, it forces us to choose a single port for that function at build
time. Since almost all boards use the default (i.e. reference design)
pin muxes[1], this is unlikely to be a problem.

[1]: See commit dda9fa734f ("sunxi: Simplify MMC pinmux selection")

Signed-off-by: Samuel Holland <samuel@sholland.org>
[Andre: add comment summarising the commit message]
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-04-04 23:24:01 +01:00
..
2022-01-25 11:44:36 -07:00
2021-09-25 09:46:15 -06:00
2021-10-05 08:50:15 -04:00
2022-02-08 09:41:27 -05:00
2022-01-13 07:57:49 -05:00
2022-03-28 08:22:17 -04:00
2022-01-13 07:57:49 -05:00
2022-03-04 08:38:05 +01:00
2021-11-09 11:57:22 +09:00
2022-02-08 09:41:27 -05:00
2022-02-25 01:41:04 -05:00
2022-01-19 18:11:34 +01:00
2022-03-15 17:43:11 +08:00
2022-01-19 18:11:34 +01:00
2022-01-19 18:11:34 +01:00
2021-10-01 21:08:18 -04:00
2021-10-31 08:46:44 -04:00
2021-10-31 08:46:44 -04:00