From 5725ea30ddadf35099e5cdd5074663f3ca9b939b Mon Sep 17 00:00:00 2001 From: Shawn Nematbakhsh Date: Wed, 1 Apr 2015 16:52:37 -0700 Subject: 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 Original-Commit-Id: 58ed3c50ab97ca1e172d5cdc00f4cd8e069e565c Original-Change-Id: I32b897836d28ef4f3b3aa5f81b9023f2ceb629c8 Original-Signed-off-by: Shawn Nematbakhsh Original-Reviewed-on: https://chromium-review.googlesource.com/263611 Original-Reviewed-by: Duncan Laurie Reviewed-on: http://review.coreboot.org/9910 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/ec/google/chromeec/ec_lpc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/ec/google/chromeec/ec_lpc.c') 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) -- cgit v1.2.3