summaryrefslogtreecommitdiff
path: root/util/comm-host.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2016-04-22 11:09:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-04-22 17:17:56 -0700
commite54d1284ffbd1d7c3b1f77a2a696ce275c527de4 (patch)
treedba186d112dd55598819dd5c53db6e451d59407e /util/comm-host.c
parent1546b4de0b6d8b443f6c8b3e49810010f896b40b (diff)
downloadchrome-ec-e54d1284ffbd1d7c3b1f77a2a696ce275c527de4.tar.gz
ectool: Revert "ectool: Remove CROS_EC_DEV_IOCRDMEM"
CROS_EC_DEV_IOCRDMEM must be used on architecture where legacy IO mapped registers are accessed inderectly via EMI. The kernel is taking care of the translation. TEST=Check on reks that we need to use the IOCTL. BUG=chrome-os-partner:52550,chromium:602832 BRANCH=none This reverts commit de45353bbdf0 ("ectool: Remove CROS_EC_DEV_IOCRDMEM"). Change-Id: I8efad56df90c58c25bdc9ccd70a508547e629a77 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/340348 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'util/comm-host.c')
-rw-r--r--util/comm-host.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/util/comm-host.c b/util/comm-host.c
index f7514904cd..31ad56343e 100644
--- a/util/comm-host.c
+++ b/util/comm-host.c
@@ -25,6 +25,10 @@ void *ec_outbuf;
void *ec_inbuf;
static int command_offset;
+int comm_init_dev(const char *device_name) __attribute__((weak));
+int comm_init_lpc(void) __attribute__((weak));
+int comm_init_i2c(void) __attribute__((weak));
+
static int fake_readmem(int offset, int bytes, void *dest)
{
struct ec_params_read_memmap p;
@@ -88,15 +92,16 @@ int comm_init(int interfaces, const char *device_name)
}
/* Prefer new /dev method */
- if ((interfaces & COMM_DEV) && !comm_init_dev(device_name))
+ if ((interfaces & COMM_DEV) && comm_init_dev &&
+ !comm_init_dev(device_name))
goto init_ok;
/* Fallback to direct LPC on x86 */
- if ((interfaces & COMM_LPC) && !comm_init_lpc(0))
+ if ((interfaces & COMM_LPC) && comm_init_lpc && !comm_init_lpc())
goto init_ok;
/* Fallback to direct i2c on ARM */
- if ((interfaces & COMM_I2C) && !comm_init_i2c())
+ if ((interfaces & COMM_I2C) && comm_init_i2c && !comm_init_i2c())
goto init_ok;
/* Give up */