diff options
author | Vikas Manocha <vikas.manocha@st.com> | 2016-03-09 15:18:13 -0800 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-03-26 18:49:28 -0400 |
commit | 9ecb0c416c68d3105bc9b6607bc8601cab2ecf35 (patch) | |
tree | 049e372d9109963019def79dceebaf24d8713c2e /drivers/mtd/stm32_flash.h | |
parent | f9d0fd8a566f78f27a510258c34b3526f9822e92 (diff) | |
download | u-boot-9ecb0c416c68d3105bc9b6607bc8601cab2ecf35.zip u-boot-9ecb0c416c68d3105bc9b6607bc8601cab2ecf35.tar.gz u-boot-9ecb0c416c68d3105bc9b6607bc8601cab2ecf35.tar.bz2 |
stm32: stm32f4: move flash driver to mtd driver location
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>
Diffstat (limited to 'drivers/mtd/stm32_flash.h')
-rw-r--r-- | drivers/mtd/stm32_flash.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/mtd/stm32_flash.h b/drivers/mtd/stm32_flash.h new file mode 100644 index 0000000..8cb81ef --- /dev/null +++ b/drivers/mtd/stm32_flash.h @@ -0,0 +1,27 @@ +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) |