Edward O'Callaghan (eocallaghan@alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5666
-gerrit
commit a0c5cc065c5a403e22354ec470e2dc1fb138b93c Author: Edward O'Callaghan eocallaghan@alterapraxis.com Date: Tue May 6 17:24:59 2014 +1000
superio/common/conf_mode: Provide another common pnp entry/exit
ITE Super I/O's make use of this method to enter and exit in and out of their PNP configuration. Provide functions for use in ram stage component.
Change-Id: I2b546c2b17eefc89aaab4982192f5e9a15a16c2f Signed-off-by: Edward O'Callaghan eocallaghan@alterapraxis.com --- src/include/superio/conf_mode.h | 5 ++++- src/superio/common/conf_mode.c | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/src/include/superio/conf_mode.h b/src/include/superio/conf_mode.h index b93b889..c49cae7 100644 --- a/src/include/superio/conf_mode.h +++ b/src/include/superio/conf_mode.h @@ -27,8 +27,11 @@ void pnp_enter_conf_mode_55(device_t dev); void pnp_enter_conf_mode_8787(device_t dev); void pnp_exit_conf_mode_aa(device_t dev); +void pnp_enter_conf_mode_870155aa(device_t dev); +void pnp_exit_conf_mode_0202(device_t dev);
extern const struct pnp_mode_ops pnp_conf_mode_55_aa; extern const struct pnp_mode_ops pnp_conf_mode_8787_aa; +extern const struct pnp_mode_ops pnp_conf_mode_870155_aa;
-#endif +#endif /* DEVICE_PNP_CONF_MODE_H */ diff --git a/src/superio/common/conf_mode.c b/src/superio/common/conf_mode.c index 40583ff..f3e6277 100644 --- a/src/superio/common/conf_mode.c +++ b/src/superio/common/conf_mode.c @@ -39,6 +39,25 @@ void pnp_exit_conf_mode_aa(device_t dev) outb(0xaa, dev->path.pnp.port); }
+void pnp_enter_conf_mode_870155aa(device_t dev) +{ + outb(0x87, dev->path.pnp.port); + outb(0x01, dev->path.pnp.port); + outb(0x55, dev->path.pnp.port); + + if (dev->path.pnp.port == 0x4e) + outb(0xaa, dev->path.pnp.port); + else + outb(0x55, dev->path.pnp.port); +} + +void pnp_exit_conf_mode_0202(device_t dev) +{ + outb(0x02, dev->path.pnp.port); + outb(0x02, dev->path.pnp.port + 1); +} + + const struct pnp_mode_ops pnp_conf_mode_55_aa = { .enter_conf_mode = pnp_enter_conf_mode_55, .exit_conf_mode = pnp_exit_conf_mode_aa, @@ -48,3 +67,8 @@ const struct pnp_mode_ops pnp_conf_mode_8787_aa = { .enter_conf_mode = pnp_enter_conf_mode_8787, .exit_conf_mode = pnp_exit_conf_mode_aa, }; + +const struct pnp_mode_ops pnp_conf_mode_870155_aa = { + .enter_conf_mode = pnp_enter_conf_mode_870155aa, + .exit_conf_mode = pnp_exit_conf_mode_0202, +};