diff options
author | Aseda Aboagye <aaboagye@google.com> | 2017-07-10 18:19:41 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-07-11 17:48:04 -0700 |
commit | 9015087c90f71198b72df9ef1563e3f21ac852c7 (patch) | |
tree | 55623ddb87c5e0a6ab415a948020e2d864a63918 | |
parent | dccb0ed867c7409e06faf7b9b353ddb235c43ee0 (diff) | |
download | chrome-ec-9015087c90f71198b72df9ef1563e3f21ac852c7.tar.gz |
cr50: Always read LONG_LIFE_SCRATCH1 for brdprop.
The `brdprop` command simply returned board_properties, however,
board_properties is just a cache of the properties from init time. When
the `brdprop` command was issued, it would only return the cached value.
This commit changes the functionality of the `brdprop` command to always
query the LONG_LIFE_SCRATCH1 register.
BUG=b:63456150
BRANCH=cr50
TEST=Flash bob. Unplug and plug in battery, verify that
BOARD_WP_ASSERTED is set when running the `brdprop` command.
Change-Id: I0a7feb5e63f3e528b554ed0820924ac0705f5517
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/566240
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r-- | board/cr50/board.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 8a60949eb7..5e989ac875 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -87,7 +87,7 @@ static int device_state_changed(enum device_type device, enum device_state state); /* Board specific configuration settings */ -static uint32_t board_properties; +static uint32_t board_properties; /* Mainly used as a cache for strap config. */ static uint8_t reboot_request_posted; /* Which UARTs we'd like to be able to bitbang. */ @@ -1559,7 +1559,12 @@ DECLARE_VENDOR_COMMAND(VENDOR_CC_COMMIT_NVMEM, vc_commit_nvmem); static int command_board_properties(int argc, char **argv) { - ccprintf("properties = 0x%x\n", board_properties); + /* + * The board properties are stored in LONG_LIFE_SCRATCH1. Note that we + * don't just simply return board_properties here since that's just a + * cached value from init time. + */ + ccprintf("properties = 0x%x\n", GREG32(PMU, LONG_LIFE_SCRATCH1)); return EC_SUCCESS; } |