zephyr/drivers/flash
Thomas Stranger cfac53b76f drivers: flash: stm32g0: dual bank handling
This commit fixes dual bank flash handling on stm32g0 targets.
In contrast to other Series (G4, L5) the flash page size does not change
in single bank configuration (2KiB in both configurations).

nSWAP_BANK:
While the reference manual(RM) only documents:
"This bit selects the bank that is the subject of empty check upon boot"
as expected, this behaves similar to BFB2 on G4 and SWAP_BANK on L5.
It has been observed that this bit swaps the address mapping of bank1
and bank2, regardless of DUAL_BANK bit being set or not.
As documented in the RM the nSWAP_BANK bit is ignored when the BOOT_LOOK
bit is set. This applies to the empty check as well as the address
mapping.

On this Series FLASH_CR_BKER must be set in single-bank as well as
dual-bank configuration for erase operations on bank2 regardless of
the swap status.

On a G0B1RE (dev-id: 0x467) I could not observe a difference between
DUAL_BANK flash option bit set and not.
It this may be different on 256KiB Flash targets.
The HAL indicates that "FLASH_SALES_TYPE_0" only uses a single bank if
OB_DUAL_BANK_VALUE is not set, but as I don't know which SoC this is
and I can't test the behaviour and the driver does not take this into
account.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-11-17 11:06:59 -05:00
..
CMakeLists.txt
flash_esp32.c
flash_gecko.c
flash_handlers.c
flash_ite_it8xxx2.c
flash_mcux_flexspi_hyperflash.c
flash_mcux_flexspi_mx25um51345g.c
flash_mcux_flexspi_nor.c
flash_page_layout.c
flash_priv.h
flash_sam.c
flash_sam0.c
flash_shell.c
flash_simulator.c
flash_stm32_qspi.c
flash_stm32_v1.c
flash_stm32.c
flash_stm32.h
flash_stm32f2x.c
flash_stm32f4x.c
flash_stm32f7x.c
flash_stm32g4x.c
flash_stm32g0x.c
flash_stm32h7x.c
flash_stm32l4x.c
flash_stm32l5x.c
flash_stm32wbx.c
jesd216.c
jesd216.h
Kconfig
Kconfig.at45
Kconfig.b91
Kconfig.esp32
Kconfig.gecko
Kconfig.it8xxx2
Kconfig.lpc
Kconfig.mcux
Kconfig.nios2_qspi
Kconfig.nor
Kconfig.nordic_qspi_nor
Kconfig.nrf
Kconfig.rv32m1
Kconfig.sam
Kconfig.sam0
Kconfig.simulator
Kconfig.stm32
Kconfig.stm32_qspi
nrf_qspi_nor.c
soc_flash_b91.c
soc_flash_lpc.c
soc_flash_mcux.c
soc_flash_nios2_qspi.c
soc_flash_nrf_ticker.c
soc_flash_nrf.c
soc_flash_nrf.h
soc_flash_rv32m1.c
spi_flash_at45.c
spi_nor.c
spi_nor.h