diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-01-16 17:50:55 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-01-16 17:50:55 +0000 |
commit | 984e0f3a0c3a82339ef8afcf7f315f377e0c81fc (patch) | |
tree | 392db09746292a1171b9953810a106d7166394fc /util | |
parent | 350ca4a94faa4f35b0b63045f9c7132c2801e1b8 (diff) | |
download | coreboot-984e0f3a0c3a82339ef8afcf7f315f377e0c81fc.tar.xz |
ectool: Support for dumping EC "index ram"
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5021 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util')
-rw-r--r-- | util/ectool/ec.c | 10 | ||||
-rw-r--r-- | util/ectool/ec.h | 1 | ||||
-rw-r--r-- | util/ectool/ectool.c | 9 |
3 files changed, 20 insertions, 0 deletions
diff --git a/util/ectool/ec.c b/util/ectool/ec.c index 56e9a61905..351015d050 100644 --- a/util/ectool/ec.c +++ b/util/ectool/ec.c @@ -114,3 +114,13 @@ int ec_write(uint8_t addr, uint8_t data) return send_ec_data(data); } + +uint8_t ec_idx_read(uint16_t addr) +{ + uint16_t lpc_idx = 0x380; + + outb(addr & 0xff, lpc_idx + 2); + outb(addr >> 8, lpc_idx + 1); + + return inb(lpc_idx + 3); +} diff --git a/util/ectool/ec.h b/util/ectool/ec.h index b06816de45..7400778117 100644 --- a/util/ectool/ec.h +++ b/util/ectool/ec.h @@ -47,4 +47,5 @@ int send_ec_data_nowait(uint8_t data); uint8_t recv_ec_data(void); uint8_t ec_read(uint8_t addr); +uint8_t ec_idx_read(uint16_t addr); #endif diff --git a/util/ectool/ectool.c b/util/ectool/ectool.c index 91d42fe02d..b7bb0ef079 100644 --- a/util/ectool/ectool.c +++ b/util/ectool/ectool.c @@ -99,5 +99,14 @@ int main(int argc, char *argv[]) } printf("\n\n"); + printf("EC IDX RAM:\n"); + for (i = 0; i < 0x10000; i++) { + if ((i % 0x10) == 0) + printf("\n%04x: ", i); + printf("%02x ", ec_idx_read(i)); + } + printf("\n\n"); + + return 0; } |