diff options
Diffstat (limited to 'chip/lm4/system.c')
-rw-r--r-- | chip/lm4/system.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/chip/lm4/system.c b/chip/lm4/system.c index 3f0e990e16..46d2fa68da 100644 --- a/chip/lm4/system.c +++ b/chip/lm4/system.c @@ -341,18 +341,16 @@ void system_pre_init(void) check_reset_cause(); - /* HEY: read LM4_SYSTEM_BOOTCFG bit 4 to determine WRKEY value */ - -#ifdef BOARD_link /* FIXME: crosbug.com/p/19366 */ /* Initialize bootcfg if needed */ - if (LM4_SYSTEM_BOOTCFG != BOOTCFG_VALUE) { - LM4_FLASH_FMD = BOOTCFG_VALUE; + if (LM4_SYSTEM_BOOTCFG != CONFIG_BOOTCFG_VALUE) { + /* read-modify-write */ + LM4_FLASH_FMD = (LM4_SYSTEM_BOOTCFG_MASK & LM4_SYSTEM_BOOTCFG) + | (~LM4_SYSTEM_BOOTCFG_MASK & CONFIG_BOOTCFG_VALUE); LM4_FLASH_FMA = 0x75100000; LM4_FLASH_FMC = 0xa4420008; /* WRKEY | COMT */ while (LM4_FLASH_FMC & 0x08) ; } -#endif /* Brown-outs should trigger a reset */ LM4_SYSTEM_PBORCTL |= 0x02; |