diff options
author | Bill Richardson <wfrichar@google.com> | 2018-12-19 13:40:37 -0800 |
---|---|---|
committer | Bill Richardson <wfrichar@google.com> | 2019-01-10 14:24:26 -0800 |
commit | a37e5da56e8002cf7f601cd25e799f913aa2e7c4 (patch) | |
tree | e89da87d517dcd3cfbe567624530504cf2c48f49 | |
parent | e25db9a18d6d0891ce2f525eb6e5d782d92c4ebc (diff) | |
download | generic-a37e5da56e8002cf7f601cd25e799f913aa2e7c4.tar.gz |
Add headers to support Board ID
This adds the codesigner header changes and a new Nugget OS
command definition to support Board ID.
Bug: 78508518
Test: manual
Change-Id: I5cc8c8d8bb0a09792000ec8d768cd97764436fa6
Signed-off-by: David Lin <dtwlin@google.com>
Signed-off-by: Bill Richardson <wfrichar@google.com>
-rw-r--r-- | nugget/include/app_nugget.h | 19 | ||||
-rw-r--r-- | nugget/include/signed_header.h | 22 |
2 files changed, 40 insertions, 1 deletions
diff --git a/nugget/include/app_nugget.h b/nugget/include/app_nugget.h index e9d4787..2efeb07 100644 --- a/nugget/include/app_nugget.h +++ b/nugget/include/app_nugget.h @@ -264,6 +264,25 @@ enum nugget_ap_uart_passthru_cfg { #define NUGGET_PARAM_RDD_CFG 0x000e /* + * Set / Get Board ID + * + * This sets or gets the Board ID of the device. + * + * @param args <none> OR nugget_app_board_id + * @param arg_len 0 OR sizeof nugget_app_board_id + * @param reply struct nugget_app_board_id + * @param reply_len sizeof struct nugget_app_board_id + * + * @errors APP_ERROR_BOGUS_ARGS + */ +struct nugget_app_board_id { + uint32_t type; + uint32_t flag; + uint32_t inv; /* must equal ~type when setting */ +} __packed; +#define NUGGET_PARAM_BOARD_ID 0x000f + +/* * Enable/Disable the RDD SuzyQable Deteaction * * This always returns the current state of the RDD SuezyQable detection diff --git a/nugget/include/signed_header.h b/nugget/include/signed_header.h index 81be877..37cae8d 100644 --- a/nugget/include/signed_header.h +++ b/nugget/include/signed_header.h @@ -41,6 +41,9 @@ #define INFO_IGNORE INFO_IGNORE_B #endif +/* Default value for _pad[] words */ +#define SIGNED_HEADER_PADDING 0x33333333 + typedef struct SignedHeader { #ifdef __cplusplus SignedHeader() @@ -61,6 +64,7 @@ typedef struct SignedHeader { memset(fusemap, 0, sizeof(fusemap)); memset(infomap, 0, sizeof(infomap)); memset(&_pad, '3', sizeof(_pad)); + memset(&board_id_, SIGNED_HEADER_PADDING, sizeof(board_id_)); } void markFuse(uint32_t n) { @@ -121,6 +125,14 @@ typedef struct SignedHeader { printf("%08X", infomap[i]); } printf("\n"); + printf("hdr.dev_id0 : %08x\n", dev_id0_); + printf("hdr.dev_id1 : %08x\n", dev_id1_); + printf("hdr.brd.type : %08x\n", + SIGNED_HEADER_PADDING ^ board_id_.type); + printf("hdr.brd.type_mask : %08x\n", + SIGNED_HEADER_PADDING ^ board_id_.type_mask); + printf("hdr.brd.flags : %08x\n", + SIGNED_HEADER_PADDING ^ board_id_.flags); } #endif // __cplusplus @@ -149,7 +161,7 @@ typedef struct SignedHeader { uint32_t expect_response_; // action to take when expectation is violated union { uint32_t - _pad[256 - 1 - 96 - 1 - 7 - 1 - 96 - 5 * 1 - 4 - 4 - 9 * 1 - 2 - 1 - 2]; + _pad[256 - 1 - 96 - 1 - 7 - 1 - 96 - 5 * 1 - 4 - 4 - 9 * 1 - 2 - 1 - 2 - 3]; struct { // 2nd FIPS signature (gnubby RW) uint32_t keyid; @@ -157,6 +169,14 @@ typedef struct SignedHeader { uint32_t s[8]; } ext_sig; } _pad; + + struct { + // CR50 board class locking + uint32_t type; // Board type + uint32_t type_mask; // Mask of board type bits to use. + uint32_t flags; // Flags + } board_id_; + uint32_t dev_id0_; // node id, if locked uint32_t dev_id1_; uint32_t fuses_chk_; // top 32 bit of expected fuses hash |