arch/arm/src/lpc17xx/lpc176x_clockconfig.c: The code preserves undocumented reserved bits only if board does not set them to keep previous behavior for boards where developers (hopefully) know what values should be set into these bits.

This commit is contained in:
Pavel Pisa 2019-01-27 17:30:01 -06:00 committed by Gregory Nutt
parent 78c8485b0d
commit f43560c080

View File

@ -215,6 +215,21 @@ void lpc17_clockconfig(void)
/* Configure FLASH */
#ifdef CONFIG_LPC17_FLASH
putreg32(BOARD_FLASHCFG_VALUE, LPC17_SYSCON_FLASHCFG);
{
uint32_t regval;
if (BOARD_FLASHCFG_VALUE & ~SYSCON_FLASHCFG_TIM_MASK)
{
regval = BOARD_FLASHCFG_VALUE;
}
else
{
regval = getreg32(LPC17_SYSCON_FLASHCFG);
regval &= ~SYSCON_FLASHCFG_TIM_MASK;
regval |= BOARD_FLASHCFG_VALUE;
}
putreg32(BOARD_FLASHCFG_VALUE, LPC17_SYSCON_FLASHCFG);
}
#endif
}