mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
9ecb0c416c
Same flash driver can be used by other stm32 families like stm32f7. Better place for this driver would be mtd driver location. Signed-off-by: Vikas Manocha <vikas.manocha@st.com>
27 lines
643 B
C
27 lines
643 B
C
struct stm32_flash_regs {
|
|
u32 acr;
|
|
u32 key;
|
|
u32 optkeyr;
|
|
u32 sr;
|
|
u32 cr;
|
|
u32 optcr;
|
|
u32 optcr1;
|
|
};
|
|
|
|
#define STM32_FLASH_KEY1 0x45670123
|
|
#define STM32_FLASH_KEY2 0xCDEF89AB
|
|
|
|
#define STM32_FLASH_SR_BSY (1 << 16)
|
|
|
|
#define STM32_FLASH_CR_PG (1 << 0)
|
|
#define STM32_FLASH_CR_SER (1 << 1)
|
|
#define STM32_FLASH_CR_STRT (1 << 16)
|
|
#define STM32_FLASH_CR_LOCK (1 << 31)
|
|
#define STM32_FLASH_CR_SNB_OFFSET 3
|
|
#define STM32_FLASH_CR_SNB_MASK (15 << STM32_FLASH_CR_SNB_OFFSET)
|
|
|
|
/* Flash ACR: Access control register */
|
|
#define FLASH_ACR_WS(n) n
|
|
#define FLASH_ACR_PRFTEN (1 << 8)
|
|
#define FLASH_ACR_ICEN (1 << 9)
|
|
#define FLASH_ACR_DCEN (1 << 10)
|