drivers: flash: stm32 flash register name for the stm32h7RS serie
Adapt the stm32 flash driver for the stm32h7rs serie where some bit of the FLASH registers are named differently from stm32h7 serie. Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
parent
b0416f51b6
commit
2000ae6ac9
1 changed files with 9 additions and 1 deletions
|
|
@ -85,8 +85,11 @@ static __unused int write_optb(const struct device *dev, uint32_t mask,
|
|||
}
|
||||
|
||||
regs->OPTCR = (regs->OPTCR & ~mask) | value;
|
||||
#ifdef CONFIG_SOC_SERIES_STM32H7RSX
|
||||
regs->OPTCR |= FLASH_OPTCR_PG_OPT;
|
||||
#else
|
||||
regs->OPTCR |= FLASH_OPTCR_OPTSTART;
|
||||
|
||||
#endif /* CONFIG_SOC_SERIES_STM32H7RSX */
|
||||
/* Make sure previous write is completed. */
|
||||
barrier_dsync_fence_full();
|
||||
|
||||
|
|
@ -121,8 +124,13 @@ int flash_stm32_option_bytes_lock(const struct device *dev, bool enable)
|
|||
if (enable) {
|
||||
regs->OPTCR |= FLASH_OPTCR_OPTLOCK;
|
||||
} else if (regs->OPTCR & FLASH_OPTCR_OPTLOCK) {
|
||||
#ifdef CONFIG_SOC_SERIES_STM32H7RSX
|
||||
regs->OPTKEYR = FLASH_OPTKEY1;
|
||||
regs->OPTKEYR = FLASH_OPTKEY2;
|
||||
#else
|
||||
regs->OPTKEYR = FLASH_OPT_KEY1;
|
||||
regs->OPTKEYR = FLASH_OPT_KEY2;
|
||||
#endif /* CONFIG_SOC_SERIES_STM32H7RSX */
|
||||
}
|
||||
|
||||
if (enable) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue