diff options
Diffstat (limited to 'src/ec/acpi')
-rw-r--r-- | src/ec/acpi/Makefile.inc | 1 | ||||
-rw-r--r-- | src/ec/acpi/ec.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/ec/acpi/Makefile.inc b/src/ec/acpi/Makefile.inc index 34c5136052..b39aaa2f94 100644 --- a/src/ec/acpi/Makefile.inc +++ b/src/ec/acpi/Makefile.inc @@ -1,2 +1,3 @@ ramstage-y += ec.c smm-$(CONFIG_HAVE_SMI_HANDLER) += ec.c +romstage-$(CONFIG_BOARD_LENOVO_X201) += ec.c diff --git a/src/ec/acpi/ec.c b/src/ec/acpi/ec.c index d3a6aaf679..ab287d6afd 100644 --- a/src/ec/acpi/ec.c +++ b/src/ec/acpi/ec.c @@ -25,9 +25,18 @@ #include <delay.h> #include "ec.h" +#ifdef __PRE_RAM__ + +static const int ec_cmd_reg = EC_SC; +static const int ec_data_reg = EC_DATA; + +#else + static int ec_cmd_reg = EC_SC; static int ec_data_reg = EC_DATA; +#endif + int send_ec_command(u8 command) { int timeout; @@ -132,12 +141,16 @@ void ec_clr_bit(u8 addr, u8 bit) ec_write(addr, ec_read(addr) & ~(1 << bit)); } +#ifndef __PRE_RAM__ + void ec_set_ports(u16 cmd_reg, u16 data_reg) { ec_cmd_reg = cmd_reg; ec_data_reg = data_reg; } +#endif + #if !defined(__SMM__) && !defined(__PRE_RAM__) struct chip_operations ec_acpi_ops = { CHIP_NAME("ACPI Embedded Controller") |