Commit graph

1,525 commits

Author SHA1 Message Date
Erwan Gouriou
434ca35827 drivers: flash: stm32_xspi: Minor cleanup
Move around some code before driver instanciation

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2026-02-20 14:58:58 +01:00
Erwan Gouriou
c40651be07 drivers: flash: stm32_xspi: Rework code relating to some properties
Some DT properties where used directly in the code w/o being put in
instatiable device structs (cfg, data).
Move them in these structs and access it from there.

Change definition of STM32_XSPI_RESET_GPIO to DT_ANY_INST

While I'm at it, simplify use of DT macros, replace
DT_NODE_HAS_PROP(DT_INST(0, st_stm32_ospi_nor), foo)
by DT_INST_NODE_HAS_PROP(0, foo).

Remove DT_XSPI_IO_PORT_PROP_OR, which is unused.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2026-02-20 14:58:58 +01:00
Erwan Gouriou
8790a72cd3 drivers: flash: stm32_xspi: Remove DT sfdp-bfp support
While there was a small related piece of code in the driver,
it is not handled in the code.
Remove the related code and make clear in the binding that this property
is not supported.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2026-02-20 14:58:58 +01:00
Erwan Gouriou
eca099fd7f driver: flash: stm32_xspi: Add Kconfig symbol for DMA
Having a dedicated Kconfig symbol will make things easier for next steps.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2026-02-20 14:58:58 +01:00
Petr Buchta
68b153831a drivers: flash: mcux_c40: fix partition parent lookup
Use DT_GPARENT() so that protection entries are generated for
partitions under the fixed-partitions node, even when an extra
intermediate node is present. This ensures the C40 protection table
is correctly derived from the flash<x> partitions.

Signed-off-by: Petr Buchta <petr.buchta@nxp.com>
2026-02-20 07:05:50 +01:00
Petr Buchta
42d9b9ed0a drivers: flash: guard flash_shell against NULL api
Handle the case where the chosen zephyr,flash-controller device has
no flash API (api == NULL). This prevents flash_shell from
dereferencing a NULL api pointer and hard-faulting when no usable
default flash device is available.

Signed-off-by: Petr Buchta <petr.buchta@nxp.com>
2026-02-20 07:05:50 +01:00
Jordan Yates
88fa1e2c94 flash: spi_nand: initial generic driver
Initial generic driver for SPI-NAND devices that expose the ONFI
parameter page. Does not support advanced features such as continuous
reads, software ECC, or optional power down modes.

Configuration comes from devicetree in order to support other modules,
but is validated against the loaded ONFI data at boot.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-02-20 07:05:32 +01:00
Manojkumar Konisetty
e2bb8efb9a drivers: flash: Add Infineon PSOC4 flash driver and CMakeLists
- Implement flash read, write and erase APIs.
- flash rows are automatically erased during Cy_Flash_WriteRow()
  operation.
- Implement erase by writing the erased value (0xFF) to maintain
  compatibility with the Zephyr flash API.i

Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-02-17 13:18:35 -06:00
Manojkumar Konisetty
d48b688dcb drivers: flash: Add Flash Kconfig for PSOC4 series
- Introduce FLASH_INFINEON_PSOC4 to enable the flash driver for the
  Infineon PSoC4 family.
- This option selects required flash capabilities.

Signed-off-by: Manojkumar Konisetty <manoj@aerlync.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
2026-02-17 13:18:35 -06:00
Mathieu Choplain
a11688fab5 drivers: *: stm32: don't check if clock device is ready
If the clock device (i.e., RCC) failed to initialize, we have bigger
problems than trying to call clock_control_{off,on,configure} on it.
Don't bother checking to save some footprint.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2026-02-13 18:59:16 +00:00
Etienne Carriere
2093b9be13 drivers: flash: stm32_*spi: remove unused *SPI_FLASH_MODULE() macros
Remove unused OSPI_FLASH_MODULE(), QSPI_FLASH_MODULE() and
XSPI_FLASH_MODULE() macros.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-02-13 12:36:46 +01:00
Tim Pambor
176a880666 drivers: flash: simulator: support multiple instances
Rework flash simulator to use per-instance configuration,
replacing single global state and enabling support for
multiple independent simulator instances.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-02-11 10:39:29 +01:00
Johannes Schuler
ec94191d70 drivers: flash: stm32u5/stm32l5 rdp
Implement readout protection for the STM32U5 / STM32L5 series.
Move the stm32u5 / stm32l5 flash register manipulation in
flash_stm32_option_bytes_write() to be called by the
flash_stm32_set_rdp_level().

Signed-off-by: Johannes Schuler <jschuler@testo.de>
2026-02-10 22:18:43 +01:00
Firas Sammoura
3bab28349f drivers: flash: npcx: add qspi_npcx_fiu_mutex_is_locked function
Add a helper function to check the lock status of the QSPI-FIU
bus controller mutex. This is useful for debug assertions and
verifying exclusive access in high-level drivers.

Signed-off-by: Firas Sammoura <fsammoura@google.com>
2026-02-10 13:30:14 -06:00
Etienne Carriere
90915fc715 drivers: flash: stm32_*spi: remove ARG_UNUSED() where useless
Remove ARG_UNUSED() where not needed in STM32 QSPI/XSPI drivers.

No functional changes.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-02-10 15:11:28 +01:00
Etienne Carriere
7c90d75a73 drivers: flash: stm32_*spi: duplicated IOMEM registers base address
IOMEM interface base address is stored in both device configuration
and device data structures. Remove the occurence in the config data
that is used only for trace messages.

No functional changes.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2026-02-10 15:11:28 +01:00
Thomas Decker
a88a01c901 drivers: flash: stm32_xspi: Remove hard-coded XSPI2 dependency
Check the used XSPIx peripheral before calling the corresponding function
instead of hard-coded calling the LL_PWR_EnableXSPIM2() and
LL_SBS_EnableXSPI2SpeedOptim() during flash_stm32_xspi_init(...).

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
2026-02-09 13:30:52 +01:00
Tim Pambor
1b4555b575 drivers: flash: shell: print partitions from all partition tables
If a device has multiple flashes, likely it has multiple partition tables.
This change updates the `flash partitions` command to print all partitions
for all partition tables, instead of just one partition table.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-02-06 13:57:08 +01:00
Hau Ho
d6ce5eabcb drivers: flash: Add support for flash driver on RX140 SoC
Add support for flash driver on RX140 SoC

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-02-06 11:09:14 +01:00
Albort Xue
23cdd0f374 drivers: flash: flexspi_nor: Update page program LUT for 4-byte addressing
When 4-byte addressing is enabled, update the page program LUT entry
to use the appropriate 4-byte page program command (SPI_NOR_CMD_PP_4B).

For octal mode (1S-8S-8S), select the correct page program command
based on address width:
- Use SPI_NOR_CMD_PP_1_8_8_4B for 32-bit addressing
- Use SPI_NOR_CMD_PP_1_8_8 for 24-bit addressing

This ensures the flash controller uses the correct command sequence
for page programming operations in both standard and octal modes with
extended addressing.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2026-02-03 14:27:07 -06:00
Albort Xue
8dd7b20f84 drivers: flash: spi_nor: Add octal page program command definitions
- 1-1-8 and 1-8-8 page program commands for 3-byte addressing
- 1-1-8 and 1-8-8 page program commands for 4-byte addressing

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2026-02-03 14:27:07 -06:00
Ha Duong Quang
12ae881233 drivers: flash: add NXP S32 XSPI flash hyperRAM driver for K5
add NXP S32 XSPI flash hyperRAM driver for K5

Signed-off-by: Ha Duong Quang <ha.duongquang@nxp.com>
2026-02-03 08:20:27 -06:00
Fabian Blatz
935a8f7cee drivers: flash: renesas_ra_hp: Replace Z_OOPS with K_OOPS
Replace usage of Z_OOPS with K_OOPS.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2026-02-03 09:46:03 +01:00
Camille BAUD
1df42a1ba2 drivers: flash: Add Netsol S3Axx04 MRAM
Adds a driver for S3Axx04 MRAM on SSPI bus

Signed-off-by: Camille BAUD <mail@massdriver.space>
2026-02-03 09:24:36 +01:00
Pete Johanson
adb65bce2d drivers: flash: Allow configuring dummy byte count for RDID request
Different flash parts have different requirements on the number of dummy
bytes to send when issued a RDID request, so allow configuring the read ID
dummy byte count in devicetree for the MAX32 SPIXF flash driver.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2026-02-02 10:00:36 +01:00
Pisit Sawangvonganan
5a5c23bbea drivers: flash: place API into iterable section
Add the `DEVICE_API` wrapper to the remaining `flash_driver_api`
instances, ensuring that each driver API is placed in its respective
linker section.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2026-01-26 12:09:53 +01:00
Marcelo Roberto Jimenez
1ab8978e66 drivers: flash: flash_shell.c: Fix flash read help text
Actually, the parameter is the number of bytes to read, not the number
of double words.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Marcelo Roberto Jimenez
391ca7c7de drivers: flash: flash_shell.c: Fix parsing of "flash read"
The parsing of the number of bytes to read in the read command was being
done in hexadecimal, causing unexpected behavior.

Now the number can be interpreted in decimal or hexadecimal if prefixed
with 0x.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Marcelo Roberto Jimenez
9535aebafe drivers: flash: flash_shell.c: Run clang-format before patch
This patch runs clang-format on the flash_shell.c file before the
real patch gets applied, otherwise the changes would be hard to
read.

Signed-off-by: Marcelo Roberto Jimenez <marcelo.jimenez@gmail.com>
2026-01-23 09:17:05 -06:00
Albort Xue
9d817c7992 drivers: flash: flash_mcux_flexspi_nor: fix QER S2B1v5 status reg case
The JESD216_DW15_QER_VAL_S2B1v5 case had incorrect status register
read/write logic. It was reading only SR2 but writing both SR1 and SR2,
which could corrupt SR1 if not read first.

Merge the S2B1v5 case with S2B1v1/v4 cases since they all set bit 1 of
SR2. Update the common path to properly handle both single-byte (SR2 only)
and two-byte (SR1+SR2) read/write operations by:

- Reading SR1 first when rd_size is 2, saving it temporarily
- Reading SR2 using the scratch command
- Combining both bytes with SR2 in the upper byte when needed
- Writing the combined value with the QE bit set

Remove the now-redundant S2B1v5-specific case and simplify the LUT
sequence to read SR2 directly instead of reading SR1 first.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2026-01-22 13:00:23 -05:00
Jamie McCrae
3a9189aa3e drivers: Update to use SOC_SERIES_NRF Kconfigs without X suffix
Updates usage of the old Kconfig to use the new Kconfig

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-20 13:21:38 +00:00
Pieter De Gendt
7fb1573311 drivers: flash: flexspi-nor: Support reset GPIO
Add optional reset pin to flash devices.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2026-01-19 15:12:25 +01:00
Jason Yu
4808de2498 drivers: flash: soc_mcux: Fix ram function permission issue
Add workaround for MCUXSDK FTFX driver when FTFx_DRIVER_IS_FLASH_RESIDENT
is enabled.
The SDK places the run command function in data section which
is not executable when Zephyr configures memory permissions.
Implement a RAM function to replace the FTFX driver's run command function

Fixes: #98560

Signed-off-by: Jason Yu <zejiang.yu@nxp.com>
2026-01-16 20:56:50 +00:00
Tim Pambor
a793acaff0 drivers: flash: shell: increase max repeat limit for speed tests
Increase the maximum allowed repeat count for flash speed tests from
10 to 10000. This allows for more accurate measurements over
longer test durations.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2026-01-15 15:27:26 +01:00
Robert Robinson
cf6e4178e9 modules: tf-m: nordic: Add support for nRF7120 TF-M
This commit adds initial support for non secure nRF7120 targets in
zephyr.

There are important limitations, such as:
- The hardware Crypto accelerator is not supported and thus the non
  secure target is NOT secure for production applications in upstream
  Zephyr.
- The BL2 is not supported, so no DFU is supported with this support

Signed-off-by: Robert Robinson <robert.robinson@nordicsemi.no>
2026-01-14 13:02:59 -06:00
Albort Xue
307c13ad7a drivers: flash: flexspi_nor: Add RDSR2 command to quad enable LUT
When qer is S2B1v1 or S2B1v4, reading Status Register
1 and Status Register 2 requires different opcodes,
and writing Status Register 1/2 requires two bytes in a
single write. Add the Read Status Register 2 command
sequence to the LUT used by the quad-enable function,
and ensure the write operation sends two bytes (SR1|SR2)
when setting the QE bit.

Signed-off-by: Albort Xue <yao.xue@nxp.com>
2026-01-14 13:01:34 -06:00
Gaetan Perrot
d3868911f8 drivers: flash: spi_nor: fix typo in an error log message
Fix a typo in an error log message in mxicy_configure.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-14 09:17:34 -06:00
Michał Stasiak
a1ccb9647f drivers: nrf: use NRF_ERRATA_DYNAMIC_CHECK macros
It is now the proper way of checking whether
an anomaly workaround should be performed.

Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
2026-01-13 13:35:39 +01:00
Fabrice DJIATSA
955f376078 drivers: flash: stm32 ospi: use OPI erase opcode in correct mode
The commit c42c8a4da4 (do not invalidate bet at end of loop")
correctly restored the best erase type (bet) selection logic
based on SFDP/JESD216 erase types.
However, this caused a regression
in Octal OPI mode: when bet != NULL, the driver started using bet->cmd
(a standard SPI 1-byte opcode) directly, which is not valid in OPI mode
where the controller expects OPI opcodes (2-byte OCMD).

When bet != NULL:
- In OPI mode, ignore bet->cmd and use the OPI sector erase
opcode SPI_NOR_OCMD_SE.
- In SPI/QPI modes, keep using bet->cmd as intended.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-01-08 11:59:49 +00:00
Merin George
88a40ab6df drivers: flash: cyw920829 configuration moved from driver to boards
- Flash configuration was previously done in the driver selected by
   Kconfig. Instead move flash configuration to the board removing
   the need for ifdefs in the driver. This will allow boards to
   configure specifics related to the on board (not part of the SoC)
   flash.

Signed-off-by: Merin George <merin.george@infineon.com>
2026-01-06 10:32:40 +01:00
Fabrice DJIATSA
4d6eaa6f63 drivers: flash: wb0x: update function to get flash size
For STM32WB0x series, LL_GetFlashSize returns the flash size in words,
not bytes. The previous implementation incorrectly interpreted this
value, leading to a large discrepancy between the expected size (512 KB)
and the computed size (64 MB) in the test_get_size ztest.

This change updates the logic to correctly compute the flash size in
bytes, ensuring accurate results in size-related operations.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2026-01-05 17:17:01 +00:00
Abderrahmane JARMOUNI
fe039cb07b drivers: flash: silabs: replace 'depends on DMA' with 'select'
When a driver requires the usage of a low level driver subsystem
(like SPI, I2C, DMA...), it shall enable it instead of depending on it.
Also, make DMA usage depend on its DT properties being defined.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2026-01-02 16:01:31 +00:00
Hau Ho
ae1c5a9a06 drivers: flash: Add flash driver support for RX261
Add config RX_FLASH_TYPE1 support for RX261

Signed-off-by: Hau Ho <hau.ho.xc@bp.renesas.com>
2026-01-02 09:56:54 +00:00
Pieter De Gendt
7d6a9ab552 drivers: flash: mcux-flexspi-nor: Support octal mode
Add support for JEDEC octal mode.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-24 12:49:47 -05:00
Pieter De Gendt
206cad3b21 drivers: flash: jesd216: Add BFP DW19 decode helpers
Add struct and decode function for dw19 with octal enable requirement.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-12-24 12:49:47 -05:00
Radosław Koppel
63c3c34f74 drivers/flash/flash_simulator: Add write and erase callbacks
Add the functionality that allows to register write and erase callbacks.
The callbacks can modify the behaviour of this operations.
It are meant to be used during testing of the situation when the memory
starts to generate errors or the data cannot be trusted anymore.
It expands the testing possibility, for a situation when the module
is tested that checks the data integrity and and we cannot just jump in
between its internal write and read operations to inject an error.

Signed-off-by: Radosław Koppel <r.koppel@k-el.com>
2025-12-19 07:50:31 -06:00
Jordan Yates
235aa1aa7f flash: flash_simulator: static programmable unit buffer
Move the programmable unit buffer used to detect double writes out of
the function stack. This fixes stack overflows when simulating flash
devices with large programming units (SPI-NAND, 2-4 kB).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-12-18 09:24:40 +01:00
Petr Buchta
53dfed0455 boards: nxp: frdm_mcxe247: Enable flash controller
This commit enables use of FTFC flash controller.
Together with DT changes it adds support for FTFC into soc_flash_mcux.c
driver.

Signed-off-by: Petr Buchta <petr.buchta@nxp.com>
2025-12-18 09:19:24 +01:00
Sreeram Tatapudi
0a06f5b91a dts: bindings: Drop cat1 from the infineon binding files
Drop cat1 from the binding files to enable reuse by other
category devices as well.

Fixes #99174

Signed-off-by: Sreeram Tatapudi <sreeram.praveen@infineon.com>
2025-12-17 13:58:09 -05:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00