diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-04-01 16:52:37 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-22 08:58:13 +0200 |
commit | 5725ea30ddadf35099e5cdd5074663f3ca9b939b (patch) | |
tree | 199cb310727d7ef6af6c2d9f90d844e7a3cf8f8e /src/ec/google/chromeec/ec_lpc.c | |
parent | 4f332fbd4aeea3eb1cf2b7c8f103e3928430c9bd (diff) | |
download | coreboot-5725ea30ddadf35099e5cdd5074663f3ca9b939b.tar.xz |
chromeec: lpc: Add variant MEC IO
MEC cannot access memmap-range data directly though LPC and instead must
access through its EMI unit.
BUG=chrome-os-partner:38224
TEST=Verify host command functionality on glower.
BRANCH=None
Change-Id: If98d425014a894ddeafad4268f92af5860878522
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 58ed3c50ab97ca1e172d5cdc00f4cd8e069e565c
Original-Change-Id: I32b897836d28ef4f3b3aa5f81b9023f2ceb629c8
Original-Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/263611
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: http://review.coreboot.org/9910
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/ec/google/chromeec/ec_lpc.c')
-rw-r--r-- | src/ec/google/chromeec/ec_lpc.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c index 0fa0cf8d6d..826142bcf1 100644 --- a/src/ec/google/chromeec/ec_lpc.c +++ b/src/ec/google/chromeec/ec_lpc.c @@ -41,6 +41,14 @@ static void read_bytes(u16 port, unsigned int length, u8 *dest, u8 *csum) { int i; +#if CONFIG_EC_GOOGLE_CHROMEEC_MEC + /* Access desired range though EMI interface */ + if (port >= MEC_EMI_RANGE_START && port <= MEC_EMI_RANGE_END) { + mec_io_bytes(0, port, length, dest, csum); + return; + } +#endif + for (i = 0; i < length; ++i) { dest[i] = inb(port + i); if (csum) @@ -68,6 +76,14 @@ static void write_bytes(u16 port, unsigned int length, u8 *msg, u8 *csum) { int i; +#if CONFIG_EC_GOOGLE_CHROMEEC_MEC + /* Access desired range though EMI interface */ + if (port >= MEC_EMI_RANGE_START && port <= MEC_EMI_RANGE_END) { + mec_io_bytes(1, port, length, msg, csum); + return; + } +#endif + for (i = 0; i < length; ++i) { outb(msg[i], port + i); if (csum) |