summaryrefslogtreecommitdiff
path: root/src/ec/google/chromeec/ec_lpc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ec/google/chromeec/ec_lpc.c')
-rw-r--r--src/ec/google/chromeec/ec_lpc.c16
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)