summaryrefslogtreecommitdiff
path: root/src/superio/smsc/lpc47n227/superio.c
diff options
context:
space:
mode:
authorAntonello Dettori <dev@dettori.io>2016-03-07 01:59:48 +0000
committerMartin Roth <martinroth@google.com>2016-03-08 13:41:03 +0100
commit6321d7c14bf96719d199cfe921d4299c93cd441f (patch)
treeb5b51fa4c1170102461c7590dc07bbc06de89736 /src/superio/smsc/lpc47n227/superio.c
parent2a3434757ef425dbdfedf1fc69e1a033a6e7310d (diff)
roda/rk9: Remove #include early_serial.c from romstage
Remove dependency on early_serial.c and instead use the Super I/O's header to access the functions needed. Also re-organize some of the superio code in order to succesfully compile the rom. Change-Id: I85a6f1352ae3b91c3c98e4d3fa0b90b87e02babc Signed-off-by: Antonello Dettori <dev@dettori.io> Reviewed-on: https://review.coreboot.org/13925 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/superio/smsc/lpc47n227/superio.c')
-rw-r--r--src/superio/smsc/lpc47n227/superio.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/src/superio/smsc/lpc47n227/superio.c b/src/superio/smsc/lpc47n227/superio.c
index 787aeabeb3..af4c7ef7b1 100644
--- a/src/superio/smsc/lpc47n227/superio.c
+++ b/src/superio/smsc/lpc47n227/superio.c
@@ -25,6 +25,8 @@
#include <assert.h>
#include <stdlib.h>
#include <pc80/keyboard.h>
+#include <superio/conf_mode.h>
+
#include "lpc47n227.h"
/* Forward declarations. */
@@ -38,8 +40,6 @@ void lpc47n227_pnp_set_iobase(struct device *dev, u16 iobase);
void lpc47n227_pnp_set_drq(struct device *dev, u8 drq);
void lpc47n227_pnp_set_irq(struct device *dev, u8 irq);
void lpc47n227_pnp_set_enable(struct device *dev, int enable);
-static void pnp_enter_conf_state(struct device *dev);
-static void pnp_exit_conf_state(struct device *dev);
struct chip_operations superio_smsc_lpc47n227_ops = {
CHIP_NAME("SMSC LPC47N227 Super I/O")
@@ -86,10 +86,10 @@ void lpc47n227_pnp_set_resources(struct device *dev)
{
struct resource *res;
- pnp_enter_conf_state(dev);
+ pnp_enter_conf_mode_55(dev);
for (res = dev->resource_list; res; res = res->next)
lpc47n227_pnp_set_resource(dev, res);
- pnp_exit_conf_state(dev);
+ pnp_exit_conf_mode_aa(dev);
}
/*
@@ -98,9 +98,9 @@ void lpc47n227_pnp_set_resources(struct device *dev)
*/
void lpc47n227_pnp_enable_resources(struct device *dev)
{
- pnp_enter_conf_state(dev);
+ pnp_enter_conf_mode_55(dev);
lpc47n227_pnp_set_enable(dev, 1);
- pnp_exit_conf_state(dev);
+ pnp_exit_conf_mode_aa(dev);
}
/*
@@ -109,9 +109,9 @@ void lpc47n227_pnp_enable_resources(struct device *dev)
*/
void lpc47n227_pnp_enable(struct device *dev)
{
- pnp_enter_conf_state(dev);
+ pnp_enter_conf_mode_55(dev);
lpc47n227_pnp_set_enable(dev, !!dev->enabled);
- pnp_exit_conf_state(dev);
+ pnp_exit_conf_mode_aa(dev);
}
/**
@@ -271,13 +271,3 @@ void lpc47n227_pnp_set_enable(struct device *dev, int enable)
}
pnp_write_config(dev, power_register, new_power);
}
-
-static void pnp_enter_conf_state(struct device *dev)
-{
- outb(0x55, dev->path.pnp.port);
-}
-
-static void pnp_exit_conf_state(struct device *dev)
-{
- outb(0xaa, dev->path.pnp.port);
-}