[coreboot-gerrit] Patch set updated for coreboot: a6c06e7 ectool: add query function to ectool
Alexander Couzens (lynxis@fe80.eu)
gerrit at coreboot.org
Mon Mar 2 17:49:56 CET 2015
Alexander Couzens (lynxis at fe80.eu) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8382
-gerrit
commit a6c06e7656ecce2a5de5af7ca70eb923c68ba02b
Author: Alexander Couzens <lynxis at fe80.eu>
Date: Fri Feb 6 22:27:33 2015 +0100
ectool: add query function to ectool
`ectool -q` - Query the EC IRQ byte.
Should return 0x00 otherwise the IRQ handler is usally broken or disabled.
Tested-on: Lenovo X201t
Change-Id: I0b8c2dbcf38d2eab89d0fbea05795759c4517f6d
Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
util/ectool/ec.c | 6 ++++++
util/ectool/ec.h | 1 +
util/ectool/ectool.c | 17 +++++++++++++----
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/util/ectool/ec.c b/util/ectool/ec.c
index 0f5b891..dba11cd 100644
--- a/util/ectool/ec.c
+++ b/util/ectool/ec.c
@@ -147,3 +147,9 @@ uint8_t ec_idx_read(uint16_t addr)
return inb(lpc_idx + 3);
}
+
+uint8_t ec_query(void)
+{
+ send_ec_command(0x84);
+ return recv_ec_data();
+}
diff --git a/util/ectool/ec.h b/util/ectool/ec.h
index a7b10e4..f25a3d9 100644
--- a/util/ectool/ec.h
+++ b/util/ectool/ec.h
@@ -50,4 +50,5 @@ int ec_write(uint8_t addr, uint8_t data);
uint8_t ec_ext_read(uint16_t addr);
int ec_ext_write(uint16_t addr, uint8_t data);
uint8_t ec_idx_read(uint16_t addr);
+uint8_t ec_query(void);
#endif
diff --git a/util/ectool/ectool.c b/util/ectool/ectool.c
index a256390..cfb5bfc 100644
--- a/util/ectool/ectool.c
+++ b/util/ectool/ectool.c
@@ -46,20 +46,21 @@ void print_version(void)
void print_usage(const char *name)
{
- printf("usage: %s [-vh?Vid] [-w 0x<addr> -z 0x<data>]\n", name);
+ printf("usage: %s [-vh?Vidq] [-w 0x<addr> -z 0x<data>]\n", name);
printf("\n"
" -v | --version: print the version\n"
" -h | --help: print this help\n\n"
" -V | --verbose: print debug information\n"
" -d | --dump: print RAM\n"
" -i | --idx: print IDX RAM\n"
+ " -q | --query: print query byte\n"
" -w <addr in hex> write to addr\n"
" -z <data in hex> write to data\n"
"\n");
exit(1);
}
-int verbose = 0, dump_idx = 0, dump_ram = 0;
+int verbose = 0, dump_idx = 0, dump_ram = 0, dump_query = 0;
int main(int argc, char *argv[])
{
@@ -72,10 +73,11 @@ int main(int argc, char *argv[])
{"help", 0, 0, 'h'},
{"verbose", 0, 0, 'V'},
{"idx", 0, 0, 'i'},
+ {"query", 0, 0, 'q'},
{0, 0, 0, 0}
};
- while ((opt = getopt_long(argc, argv, "vh?Vidw:z:",
+ while ((opt = getopt_long(argc, argv, "vh?Vidqw:z:",
long_options, &option_index)) != EOF) {
switch (opt) {
case 'v':
@@ -97,6 +99,9 @@ int main(int argc, char *argv[])
case 'd':
dump_ram = 1;
break;
+ case 'q':
+ dump_query = 1;
+ break;
case 'h':
case '?':
default:
@@ -118,7 +123,7 @@ int main(int argc, char *argv[])
}
/* preserve default - dump_ram if nothing selected */
- if (!dump_ram && !dump_idx) {
+ if (!dump_ram && !dump_idx && !dump_query) {
dump_ram = 1;
}
@@ -132,6 +137,10 @@ int main(int argc, char *argv[])
printf("\n\n");
}
+ if (dump_query) {
+ printf("EC QUERY %02x\n", ec_query());
+ }
+
if (dump_idx) {
printf("EC IDX RAM:\n");
for (i = 0; i < 0x10000; i++) {
More information about the coreboot-gerrit
mailing list