summaryrefslogtreecommitdiff
path: root/util/ectool/ectool.c
diff options
context:
space:
mode:
authorAnton Kochkov <anton.kochkov@gmail.com>2010-06-29 21:13:20 +0000
committerStefan Reinauer <stepan@openbios.org>2010-06-29 21:13:20 +0000
commit7e59f769ef02599a6e88df7443780727dc64e3ca (patch)
tree0107a088d81e0577899e47265ab64cc61afbf3a0 /util/ectool/ectool.c
parent9a82eebe1a60ed5e49fbfc14cbe006c320846f01 (diff)
Add support to extended EC series
Signed-off-by: Anton Kochkov <anton.kochkov@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5650 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/ectool/ectool.c')
-rw-r--r--util/ectool/ectool.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/util/ectool/ectool.c b/util/ectool/ectool.c
index b7bb0ef079..086f159b30 100644
--- a/util/ectool/ectool.c
+++ b/util/ectool/ectool.c
@@ -45,16 +45,17 @@ void print_version(void)
void print_usage(const char *name)
{
- printf("usage: %s [-vh?V]\n", name);
+ printf("usage: %s [-vh?Vi]\n", name);
printf("\n"
" -v | --version: print the version\n"
" -h | --help: print this help\n\n"
" -V | --verbose: print debug information\n"
+ " -i | --idx: print IDX RAM\n"
"\n");
exit(1);
}
-int verbose = 0;
+int verbose = 0, dump_idx = 0;
int main(int argc, char *argv[])
{
@@ -64,10 +65,11 @@ int main(int argc, char *argv[])
{"version", 0, 0, 'v'},
{"help", 0, 0, 'h'},
{"verbose", 0, 0, 'V'},
+ {"idx", 0, 0, 'i'},
{0, 0, 0, 0}
};
- while ((opt = getopt_long(argc, argv, "vh?V",
+ while ((opt = getopt_long(argc, argv, "vh?Vi",
long_options, &option_index)) != EOF) {
switch (opt) {
case 'v':
@@ -77,6 +79,8 @@ int main(int argc, char *argv[])
case 'V':
verbose = 1;
break;
+ case 'i':
+ dump_idx = 1;
case 'h':
case '?':
default:
@@ -99,14 +103,17 @@ 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));
+ if (dump_idx) {
+ 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");
+ } else {
+ printf("Not dumping EC IDX RAM.\n");
}
- printf("\n\n");
-
return 0;
}