diff options
author | Mary Ruthven <mruthven@chromium.org> | 2023-03-22 14:58:09 -0500 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-04-14 21:01:30 +0000 |
commit | 37fa38296266e62adfe10226b7b1a22ac9335537 (patch) | |
tree | b27f394e393eae05bf28186ae0f8e0db8b70a50a /board/cr50/board.c | |
parent | a5f1053242499cf10d55dfa1124392aa92830426 (diff) | |
download | chrome-ec-37fa38296266e62adfe10226b7b1a22ac9335537.tar.gz |
cr50: add a factory config space
Add a 64 bit write once factory config space to info1. If the factory
has something they want to configure, they can use part of the space to
store that configration.
Right now nothing in cr50 uses the factory config space. If we need to
modify cr50 behavior based on the space value, we can add functionality
later. The factory just needs to set the bit in the factory config.
BUG=b:214065944
TEST=manual
Clear the Board ID
set the config to 0. Verify it does nothing
gsctool -a --factory_config 0
gsctool -a --factory_config
0
Set the flags
gsctool -ai 0xffffffff:0x10
Set the config to something
gsctool -a --factory_config 0x12345678cafecafe
gsctool -a --factory_config
12345678CAFECAFE
# Set it to the same thing. Verify cr50 returns EC_SUCCESS.
gsctool -a --factory_config 0x12345678cafecafe
gsctool -a --factory_config
12345678CAFECAFE
[40.114944 write_factory_config: ok.]
Try to set it to something else. Verify it's rejected because
the space is set.
gsctool -a --factory_config 0xcafe
[43.331302 write_factory_config: factory cfg already programmed]
gsctool -a --factory_config
12345678CAFECAFE
Set the Board ID Type
gsctool -ai ZZCR:0x10
Try to set the config again. Verify it's rejected because the
board id type is set.
gsctool -a --factory_config 0x12345678cafecafe
Factory config failed. (7)
gsctool -a --factory_config
12345678CAFECAFE
Change-Id: Ie816ebffcf6c24ad94bbcd2dc2f0c3936caafb11
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4424873
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board/cr50/board.c')
-rw-r--r-- | board/cr50/board.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 7fa4ced4c5..dff0b7bfac 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -14,6 +14,7 @@ #include "ec_version.h" #include "endian.h" #include "extension.h" +#include "factory_config.h" #include "fips_rand.h" #include "fips.h" #include "flash.h" @@ -1900,6 +1901,7 @@ static int command_board_properties(int argc, char **argv) */ ccprintf("properties = 0x%x\n", GREG32(PMU, LONG_LIFE_SCRATCH1)); ccprintf("tpm board cfg = 0x%x\n", board_cfg_reg_read()); + print_factory_config(); return EC_SUCCESS; } DECLARE_SAFE_CONSOLE_COMMAND(brdprop, command_board_properties, |