Martin Roth (martinroth@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14960
-gerrit
commit b5a057ea74bbffcca7b43623e66d240da68df5b0 Author: Timothy Pearson tpearson@raptorengineering.com Date: Tue May 24 15:48:50 2016 -0500
sio/winbond/common: Add function to configure pin mux
Certain mainboards require SuperIO pinmux configuration before peripherals will become operational. Allow each mainboard to configure the pinmux(es) of Winbond chips if needed.
Change-Id: Ice19f8d8514b66b15920a5b893700d636ed75cec Signed-off-by: Timothy Pearson tpearson@raptorengineering.com --- 3rdparty/blobs | 2 +- src/superio/winbond/common/early_serial.c | 13 +++++++++++++ src/superio/winbond/common/winbond.h | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/3rdparty/blobs b/3rdparty/blobs index cca0337..b0eeddd 160000 --- a/3rdparty/blobs +++ b/3rdparty/blobs @@ -1 +1 @@ -Subproject commit cca0337ea0fba8a07a73ad1627338dd5738f4d3f +Subproject commit b0eeddd4f5c583818e66521f2552cd3448b357b2 diff --git a/src/superio/winbond/common/early_serial.c b/src/superio/winbond/common/early_serial.c index 6482a94..aebbd38 100644 --- a/src/superio/winbond/common/early_serial.c +++ b/src/superio/winbond/common/early_serial.c @@ -66,3 +66,16 @@ void winbond_enable_serial(pnp_devfn_t dev, u16 iobase) pnp_set_enable(dev, 1); pnp_exit_conf_state(dev); } + +void winbond_set_pinmux(pnp_devfn_t dev, uint8_t offset, uint8_t mask, uint8_t state) +{ + uint8_t byte; + + /* Configure pin mux */ + pnp_enter_conf_state(dev); + byte = pnp_read_config(dev, offset); + byte &= ~mask; + byte |= state; + pnp_write_config(dev, offset, byte); + pnp_exit_conf_state(dev); +} diff --git a/src/superio/winbond/common/winbond.h b/src/superio/winbond/common/winbond.h index 1f7e7b1..6e67eeb 100644 --- a/src/superio/winbond/common/winbond.h +++ b/src/superio/winbond/common/winbond.h @@ -20,7 +20,8 @@ #include <arch/io.h> #include <stdint.h>
-void winbond_enable_serial(pnp_devfn_t dev, u16 iobase); +void winbond_enable_serial(pnp_devfn_t dev, uint16_t iobase); +void winbond_set_pinmux(pnp_devfn_t dev, uint8_t offset, uint8_t mask, uint8_t state);
void pnp_enter_conf_state(pnp_devfn_t dev); void pnp_exit_conf_state(pnp_devfn_t dev);