Skip to content

Commit 2199a6a

Browse files
committed
drivers: flash: Add support for Atmel AT25 SPI flash variant
The AT25XV021A variant is a flash variant of Atmel's AT25 family that adds extra protections, requiring additional writes to the device to program or erase data. This commit adds a flash driver for AT25XV021A devices instead of modifying (1) the existing AT45 SPI flash driver or (2) the existing AT24/25 EEPROM driver because this variant poses fundamental changes that affect all aspects of the driver. Notably, - AT25XV021A includes a second status register, and the format and functions of the existing status register is changed from the existing drivers. - AT25XV021A requires executing page or chip erase commands before writing, making it incompatible with the existing AT24/25 EEPROM driver. - AT25XV021A adds a software protection layer that requires extra writes before executing program or erase commands. This driver implements flash_erase, but flash_write also implicitly erases. Tested writing to and reading/erasing from an AT25XV021A device across page boundaries with varying lengths (less than and greater than page size). Tested chip erase functions. Tested driver initialization from varying initial hardware states. Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
1 parent defe9ec commit 2199a6a

File tree

6 files changed

+1088
-0
lines changed

6 files changed

+1088
-0
lines changed

drivers/flash/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_SILABS_SIWX91X soc_flash_silabs_si
6868
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_SMARTBOND flash_smartbond.c)
6969
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_TELINK_B91 soc_flash_b91.c)
7070
zephyr_library_sources_ifdef(CONFIG_SOC_FLASH_XMC4XXX soc_flash_xmc4xxx.c)
71+
zephyr_library_sources_ifdef(CONFIG_SPI_FLASH_AT25XV021A spi_flash_at25xv021a.c)
7172
zephyr_library_sources_ifdef(CONFIG_SPI_FLASH_AT45 spi_flash_at45.c)
7273
zephyr_library_sources_ifdef(CONFIG_SPI_NOR spi_nor.c)
7374
# zephyr-keep-sorted-stop

drivers/flash/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ config FLASH_INIT_PRIORITY
166166
# zephyr-keep-sorted-start
167167
source "drivers/flash/Kconfig.ambiq"
168168
source "drivers/flash/Kconfig.andes"
169+
source "drivers/flash/Kconfig.at25xv021a"
169170
source "drivers/flash/Kconfig.at45"
170171
source "drivers/flash/Kconfig.b91"
171172
source "drivers/flash/Kconfig.cadence_nand"

drivers/flash/Kconfig.at25xv021a

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2025 Cirrus Logic, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SPI_FLASH_AT25XV021A
5+
bool "Atmel AT25 SPI flash variant"
6+
default y
7+
depends on DT_HAS_ATMEL_AT25XV021A_ENABLED
8+
select FLASH_HAS_DRIVER_ENABLED
9+
select FLASH_HAS_PAGE_LAYOUT
10+
select FLASH_HAS_EXPLICIT_ERASE
11+
select SPI
12+
help
13+
Enable support for AT25XV021A SPI flash variants.
14+
15+
Vendors that have manufactured such variants include:
16+
- Renesas Electronics
17+
- Adesto Technologies

0 commit comments

Comments
 (0)