aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-01-16 14:52:25 -0700
committerSimon Glass <sjg@chromium.org>2021-01-30 14:25:41 -0700
commit7791df576c4e0bcb0529850e14173d028ec37275 (patch)
tree93b1185fd5fb60bc540d9b93d0478cf072978ac1 /cmd
parent698e30f7a862ae6eb4754ef0d42b8dc8cf416edd (diff)
downloadu-boot-7791df576c4e0bcb0529850e14173d028ec37275.zip
u-boot-7791df576c4e0bcb0529850e14173d028ec37275.tar.gz
u-boot-7791df576c4e0bcb0529850e14173d028ec37275.tar.bz2
cros_ec: Add support for reading the SKU ID
This allows reading strapping pins attached to the EC. Add an implementation for this. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/cros_ec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/cros_ec.c b/cmd/cros_ec.c
index ce1f59a..4e85e18 100644
--- a/cmd/cros_ec.c
+++ b/cmd/cros_ec.c
@@ -352,6 +352,15 @@ static int do_cros_ec(struct cmd_tbl *cmdtp, int flag, int argc,
debug("%s: Could not access LDO%d\n", __func__, index);
return ret;
}
+ } else if (!strcmp("sku", cmd)) {
+ ret = cros_ec_get_sku_id(dev);
+
+ if (ret >= 0) {
+ printf("%d\n", ret);
+ ret = 0;
+ } else {
+ printf("Error: %d\n", ret);
+ }
} else {
return CMD_RET_USAGE;
}
@@ -382,6 +391,7 @@ U_BOOT_CMD(
"crosec write <ro|rw> <addr> [<size>] Write EC image\n"
"crosec vbnvcontext [hexstring] Read [write] VbNvContext from EC\n"
"crosec ldo <idx> [<state>] Switch/Read LDO state\n"
+ "crosec sku Read board SKU ID\n"
"crosec test run tests on cros_ec\n"
"crosec version Read CROS-EC version"
);