aboutsummaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/ec_lpc.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-10-12 17:19:53 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-10-18 15:01:40 +0000
commit32ca3cd246746c2a1d584e4a63bcd43ebb7fe23f (patch)
tree85a19dfcf13c2504545a0ed69172cbf519a4bd4c /src/ec/google/chromeec/ec_lpc.c
parent26cf00ab498a78b59c9170d38d6ee7ced930259c (diff)
ec/google/chromeec: Use common MEC interface
Switch to using the common MEC interface instead of the Chrome EC specific code. Tested on a Chell chromebook that has a MEC based Chrome EC to ensure that the EC interface is still functional. Change-Id: Idf26e62c2843993c2df2ab8ef157b263a71a97c9 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/29112 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/ec/google/chromeec/ec_lpc.c')
-rw-r--r--src/ec/google/chromeec/ec_lpc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ec/google/chromeec/ec_lpc.c b/src/ec/google/chromeec/ec_lpc.c
index f584630f54..c8665c9e82 100644
--- a/src/ec/google/chromeec/ec_lpc.c
+++ b/src/ec/google/chromeec/ec_lpc.c
@@ -18,6 +18,7 @@
#include <console/console.h>
#include <delay.h>
#include <device/pnp.h>
+#include <ec/google/common/mec.h>
#include <stdint.h>
#include <stdlib.h>
@@ -40,7 +41,9 @@ static void read_bytes(u16 port, unsigned int length, u8 *dest, u8 *csum)
#if IS_ENABLED(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);
+ csum += mec_io_bytes(MEC_IO_READ, MEC_EMI_BASE,
+ port - MEC_EMI_RANGE_START,
+ dest, length);
return;
}
#endif
@@ -75,7 +78,9 @@ static void write_bytes(u16 port, unsigned int length, u8 *msg, u8 *csum)
#if IS_ENABLED(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);
+ csum += mec_io_bytes(MEC_IO_WRITE, MEC_EMI_BASE,
+ port - MEC_EMI_RANGE_START,
+ msg, length);
return;
}
#endif