summaryrefslogtreecommitdiffstats
path: root/test
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 /test
parent698e30f7a862ae6eb4754ef0d42b8dc8cf416edd (diff)
downloadu-boot-7791df576c4e0bcb0529850e14173d028ec37275.tar.gz
u-boot-7791df576c4e0bcb0529850e14173d028ec37275.tar.xz
u-boot-7791df576c4e0bcb0529850e14173d028ec37275.zip
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 'test')
-rw-r--r--test/dm/cros_ec.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/dm/cros_ec.c b/test/dm/cros_ec.c
index 823245ca70..3d0e5dc08d 100644
--- a/test/dm/cros_ec.c
+++ b/test/dm/cros_ec.c
@@ -30,3 +30,20 @@ static int dm_test_cros_ec_hello(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_cros_ec_hello, UT_TESTF_SCAN_FDT);
+
+static int dm_test_cros_ec_sku_id(struct unit_test_state *uts)
+{
+ struct udevice *dev;
+
+ ut_assertok(uclass_first_device_err(UCLASS_CROS_EC, &dev));
+ ut_asserteq(1234, cros_ec_get_sku_id(dev));
+
+ /* try the command */
+ console_record_reset();
+ ut_assertok(run_command("crosec sku", 0));
+ ut_assert_nextline("1234");
+ ut_assert_console_end();
+
+ return 0;
+}
+DM_TEST(dm_test_cros_ec_sku_id, UT_TESTF_SCAN_FDT);