diff options
Diffstat (limited to 'board/cr50')
-rw-r--r-- | board/cr50/board.c | 11 | ||||
-rw-r--r-- | board/cr50/scratch_reg1.h | 4 |
2 files changed, 6 insertions, 9 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 180d33af9d..a28c901b72 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -194,22 +194,17 @@ int board_get_ccd_rec_lid_pin(void) bool board_fips_power_up_done(void) { - return !!(board_properties & BOARD_FIPS_POWERUP_DONE); + return !!(GREG32(PMU, PWRDN_SCRATCH22) == BOARD_FIPS_POWERUP_DONE); } /* Set status of FIPS power-up tests. */ void board_set_fips_policy_test(bool asserted) { /* Enable writing to the long life register */ - GWRITE_FIELD(PMU, LONG_LIFE_SCRATCH_WR_EN, REG1, 1); - if (asserted) - GREG32(PMU, LONG_LIFE_SCRATCH1) |= BOARD_FIPS_POWERUP_DONE; + GREG32(PMU, PWRDN_SCRATCH22) = BOARD_FIPS_POWERUP_DONE; else - GREG32(PMU, LONG_LIFE_SCRATCH1) &= ~BOARD_FIPS_POWERUP_DONE; - - /* Disable writing to the long life register */ - GWRITE_FIELD(PMU, LONG_LIFE_SCRATCH_WR_EN, REG1, 0); + GREG32(PMU, PWRDN_SCRATCH22) = 0; } /* Get header address of the backup RW copy. */ diff --git a/board/cr50/scratch_reg1.h b/board/cr50/scratch_reg1.h index 0a7f973f2d..298450aa46 100644 --- a/board/cr50/scratch_reg1.h +++ b/board/cr50/scratch_reg1.h @@ -102,8 +102,10 @@ /* * Indicates successful completion of FIPS power up * tests earlier. Reduces wake up time after sleep. + * Stored in PWRDN_SCRATCH22 and use multiple bits to harden against + * fault injection. */ -#define BOARD_FIPS_POWERUP_DONE BIT(24) +#define BOARD_FIPS_POWERUP_DONE 0xAA556633 /* * Macro to capture all properties related to board strapping pins. This must be |