diff options
author | Gwendal Grignou <gwendal@chromium.org> | 2016-04-13 12:34:08 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-04-15 13:40:17 -0700 |
commit | de45353bbdf0c6c4afb88420d3cb2e182eae7450 (patch) | |
tree | c8679091de030c771b515fc96ac2b5c2e35fe14a /util/comm-host.c | |
parent | fef9abf3b3473dad728e2f2bd8557e230214f03d (diff) | |
download | chrome-ec-de45353bbdf0c6c4afb88420d3cb2e182eae7450.tar.gz |
ectool: Remove CROS_EC_DEV_IOCRDMEM
On !LPC EC, we can read memory via CROS_EC_DEV_IOCXCMD ioctl,
using command EC_CMD_READ_MEMMAP.
On platform that supports direct memory access (lpc), we access
the memory directly, bypassing the ioctl.
BUG=chromium:602832
TEST=On gnawty and veyron, check 'ectool battery' works.
Verify that gnawty use io mapped registers.
BRANCH=none
Change-Id: I9bfcddcf450bf8df63ead78e1df97dd7392289e6
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/338853
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'util/comm-host.c')
-rw-r--r-- | util/comm-host.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/util/comm-host.c b/util/comm-host.c index 31ad56343e..f7514904cd 100644 --- a/util/comm-host.c +++ b/util/comm-host.c @@ -25,10 +25,6 @@ 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; @@ -92,16 +88,15 @@ int comm_init(int interfaces, const char *device_name) } /* Prefer new /dev method */ - if ((interfaces & COMM_DEV) && comm_init_dev && - !comm_init_dev(device_name)) + if ((interfaces & COMM_DEV) && !comm_init_dev(device_name)) goto init_ok; /* Fallback to direct LPC on x86 */ - if ((interfaces & COMM_LPC) && comm_init_lpc && !comm_init_lpc()) + if ((interfaces & COMM_LPC) && !comm_init_lpc(0)) goto init_ok; /* Fallback to direct i2c on ARM */ - if ((interfaces & COMM_I2C) && comm_init_i2c && !comm_init_i2c()) + if ((interfaces & COMM_I2C) && !comm_init_i2c()) goto init_ok; /* Give up */ |