2019-11-01 20:45:29 +08:00
|
|
|
# ST Microelectronics STM32 MCUs Flash driver config
|
|
|
|
|
2016-11-02 22:34:02 +08:00
|
|
|
# Copyright (c) 2016 RnDity Sp. z o.o.
|
2017-05-02 22:55:08 +08:00
|
|
|
# Copyright (c) 2017 BayLibre, SAS
|
2022-12-19 18:43:01 +08:00
|
|
|
# Copyright (c) 2022 Linaro Limited
|
2022-11-10 22:33:12 +08:00
|
|
|
# Copyright (c) 2023 Google Inc
|
2017-01-19 23:38:51 +08:00
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
2016-11-02 22:34:02 +08:00
|
|
|
|
2024-06-06 19:43:33 +08:00
|
|
|
config STM32_MEMMAP
|
|
|
|
bool "NOR Flash in MemoryMapped for XiP"
|
|
|
|
depends on XIP && \
|
|
|
|
(DT_HAS_ST_STM32_OSPI_NOR_ENABLED || \
|
2024-06-07 22:49:27 +08:00
|
|
|
DT_HAS_ST_STM32_QSPI_NOR_ENABLED || \
|
|
|
|
DT_HAS_ST_STM32_XSPI_NOR_ENABLED)
|
2024-06-06 19:43:33 +08:00
|
|
|
help
|
|
|
|
This option enables the XIP mode for the external NOR flash
|
|
|
|
mounted on STM32 boards.
|
|
|
|
|
2024-09-04 19:23:12 +08:00
|
|
|
menuconfig SOC_FLASH_STM32
|
2018-08-14 22:19:20 +08:00
|
|
|
bool "STM32 flash driver"
|
2023-09-11 17:46:19 +08:00
|
|
|
depends on DT_HAS_ST_STM32_FLASH_CONTROLLER_ENABLED
|
2018-03-07 21:31:56 +08:00
|
|
|
select FLASH_HAS_DRIVER_ENABLED
|
2017-01-30 01:01:38 +08:00
|
|
|
default y
|
2022-12-17 00:40:25 +08:00
|
|
|
select FLASH_HAS_PAGE_LAYOUT
|
2024-02-02 21:46:29 +08:00
|
|
|
select FLASH_HAS_EXPLICIT_ERASE
|
2019-11-04 22:49:21 +08:00
|
|
|
select MPU_ALLOW_FLASH_WRITE if ARM_MPU
|
2023-12-20 00:07:37 +08:00
|
|
|
select USE_STM32_HAL_FLASH if BT_STM32WBA
|
|
|
|
select USE_STM32_HAL_FLASH_EX if BT_STM32WBA
|
2016-11-02 22:34:02 +08:00
|
|
|
help
|
2022-12-17 00:40:25 +08:00
|
|
|
Enable flash driver for STM32 series
|
2022-11-10 22:33:12 +08:00
|
|
|
|
|
|
|
if SOC_FLASH_STM32
|
|
|
|
|
|
|
|
config FLASH_STM32_WRITE_PROTECT
|
|
|
|
bool "Extended operation for flash write protection control"
|
|
|
|
depends on SOC_SERIES_STM32F4X
|
2023-08-10 21:23:00 +08:00
|
|
|
select FLASH_HAS_EX_OP
|
2022-11-10 22:33:12 +08:00
|
|
|
default n
|
|
|
|
help
|
|
|
|
Enables flash extended operation for enabling/disabling flash write
|
|
|
|
protection.
|
|
|
|
|
|
|
|
config FLASH_STM32_WRITE_PROTECT_DISABLE_PREVENTION
|
|
|
|
bool "Prevent from disabling flash write protection"
|
|
|
|
depends on FLASH_STM32_WRITE_PROTECT
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
If enabled, all requests to disable flash write protection will be
|
|
|
|
blocked.
|
|
|
|
|
2022-11-10 22:33:12 +08:00
|
|
|
config FLASH_STM32_READOUT_PROTECTION
|
|
|
|
bool "Extended operation for flash readout protection control"
|
2024-07-19 19:35:59 +08:00
|
|
|
depends on SOC_SERIES_STM32F4X || SOC_SERIES_STM32L4X || \
|
|
|
|
SOC_SERIES_STM32G4X || SOC_SERIES_STM32F7X
|
2023-08-10 21:23:00 +08:00
|
|
|
select FLASH_HAS_EX_OP
|
2022-11-10 22:33:12 +08:00
|
|
|
default n
|
|
|
|
help
|
|
|
|
Enables flash extended operation for enabling/disabling flash readout
|
|
|
|
protection.
|
|
|
|
|
|
|
|
config FLASH_STM32_READOUT_PROTECTION_DISABLE_ALLOW
|
|
|
|
bool "Allow disabling readout protection"
|
|
|
|
depends on FLASH_STM32_READOUT_PROTECTION
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
With this option enabled it will be possible to disable readout
|
|
|
|
protection. On STM32 devices it will trigger flash mass erase!
|
|
|
|
|
|
|
|
config FLASH_STM32_READOUT_PROTECTION_PERMANENT_ALLOW
|
|
|
|
bool "Allow enabling readout protection permanently"
|
|
|
|
depends on FLASH_STM32_READOUT_PROTECTION
|
|
|
|
default n
|
|
|
|
help
|
|
|
|
With this option enabled it will be possible to enable readout
|
|
|
|
protection permanently.
|
|
|
|
|
2023-03-15 21:11:35 +08:00
|
|
|
config FLASH_STM32_BLOCK_REGISTERS
|
|
|
|
bool "Extended operation for blocking option and control registers"
|
2024-05-13 14:52:41 +08:00
|
|
|
select FLASH_HAS_EX_OP
|
2023-03-15 21:11:35 +08:00
|
|
|
default n
|
|
|
|
help
|
|
|
|
Enables flash extended operations that can be used to disable access
|
|
|
|
to option and control registers until reset. Disabling access to these
|
|
|
|
registers improves system security, because flash content (or
|
|
|
|
protection settings) can't be changed even when exploit was found.
|
|
|
|
|
2024-06-19 17:27:54 +08:00
|
|
|
config USE_MICROCHIP_QSPI_FLASH_WITH_STM32
|
|
|
|
bool "Include patch for Microchip qspi flash when running with stm32"
|
|
|
|
depends on DT_HAS_ST_STM32_QSPI_NOR_ENABLED
|
|
|
|
help
|
|
|
|
Set to use Microchip qspi flash memories which supports
|
|
|
|
the Global Block Protection Unlock instruction (ULBPR - 98H),
|
|
|
|
and write with SPI_NOR_CMD_PP_1_1_4 on 4 lines
|
|
|
|
|
2022-11-10 22:33:12 +08:00
|
|
|
endif # SOC_FLASH_STM32
|