ar71xx_gpio.c touches SPI_CS1 and 2?

Adrian Chadd adrian at freebsd.org
Mon Dec 5 01:29:42 UTC 2011


On 5 December 2011 01:19, Warner Losh <imp at bsdimp.com> wrote:

> When I was looking into this question for the Atmel chips, I was torn.  On the one hand, it would be nice if there was a pin mux device.  On the other hand, it didn't map well into the device model.  I finally settled on having per-board functions that setup the pins.  This is also the model followed by linux.  Either the boot loader or the board-dependent code would do the setup.

I think we should have a per-board set of hints which lets us dictate
non-default GPIO functions and config.

That way we can override what's going on in the board config without
having to write C code.

As i said, something like this:

hint.blah.gpiofunction_set="0x10000000"
hint.blah.gpiofunction_clear="0x00130000"

It'd also be useful if the device drivers would do this themselves -
eg the ar71xx USB device driver could ensure that the relevant GPIO
function wire were enabled. But we may need to _disable_ some of these
default pins (eg if the eeprom has enabled the digital sound function
block on the SoC) so i still think having the above would work.


Adrian


More information about the freebsd-embedded mailing list