Commit graph

709 commits

Author SHA1 Message Date
Ansh Rai
54b0066a69 libs/libc: Fix divide-by-zero in stat() with large filesystem block sizes
blksize_t is currently defined as int16_t, which overflows when a
filesystem reports a block size larger than 32767 bytes. This causes
st_blksize to become zero, leading to an integer divide-by-zero when
st_blocks is calculated in stat().

Widen blksize_t to int32_t to support larger filesystem block sizes.

Update nuttx_blksize_t in include/nuttx/fs/hostfs.h to keep it
consistent with include/sys/types.h.

struct geometry.geo_sectorsize (include/nuttx/fs/ioctl.h) is also
typed blksize_t, so every debug print of that field using a 16-bit
format specifier is updated to PRId32 to match the new width:
drivers/misc/ramdisk.c, drivers/mmcsd/mmcsd_spi.c, drivers/mtd/ftl.c,
fs/driver/fs_blockmerge.c, drivers/mtd/smart.c,
drivers/usbhost/usbhost_storage.c, drivers/mmcsd/mmcsd_sdio.c,
arch/arm/src/s32k1xx/s32k1xx_eeeprom.c,
arch/arm/src/lc823450/lc823450_mmcl.c.

Signed-off-by: Ansh Rai <anshrai331@gmail.com>
Signed-off-by: root <root@LAPTOP-9C7LKDC5.localdomain>
2026-07-16 23:37:22 +08:00
Catalin Visinescu
a30bbfee6b drivers/: Multiple Drivers Are Registered With World Writable Part 3
Summary

Permissions (Part 3)

Description:

In kernel builds, any unprivileged process running on the NuttX device can
open /dev/efuse and attempt to read/write fuse content. Reading the fuses
may provide valuable information to an attacker controlling the user process.
The write operation, in extreme cases where the fuse blocks are not locked,
may brick the device.

DISCLAIMER: I tried to be strict with the settings, better to relax them
later if it's needed.

This is part of https://github.com/apache/nuttx/issues/19410

Impact

See https://github.com/apache/nuttx/issues/19410

Testing

Compiles ok.

Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
2026-07-16 09:49:07 -03:00
Catalin Visinescu
081e4c478a drivers/: Multiple Drivers Are Registered With World Writable - Part 2
Permissions (Part 2)

Description:

In kernel builds, any unprivileged process running on the NuttX
device can open /dev/efuse and attempt to read/write fuse content.
Reading the fuses may provide valuable information to an attacker
controlling the user process. The write operation, in extreme cases
where the fuse blocks are not locked, may brick the device.

DISCLAIMER: I tried to be strict with the settings, better to relax them
later if it's needed.

This is part of https://github.com/apache/nuttx/issues/19410

See https://github.com/apache/nuttx/issues/19410

Compiles ok.

Signed-off-by: Catalin Visinescu <catalin_visinescu@yahoo.com>
2026-07-15 15:27:28 +08:00
Xiang Xiao
9e141acab3 !include/fcntl.h: align open flags with Linux values
Align the NuttX open(2) flag constants with the Linux asm-generic
values so that the FUSE wire protocol and other cross-platform
interfaces work without conversion.

All code that used '(flags & O_RDONLY)' as a bitmask check (always 0
now that O_RDONLY=0) has been updated to use '(flags & O_ACCMODE)'
comparisons.

The NUTTX_O_* constants in include/nuttx/fs/hostfs.h are updated to
match, and the sim hostfs open flag mapping is fixed.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-30 13:43:44 +08:00
Xiang Xiao
6161c73639 include/fcntl.h: remove O_RDOK/O_WROK aliases
O_RDOK and O_WROK are non-standard aliases for O_RDONLY and O_WRONLY
respectively.  Having two names for the same flag creates confusion,
especially when aligning the flag values with Linux.  Remove the
aliases and replace all uses with the standard O_RDONLY/O_WRONLY.

No functional change — O_RDOK was defined as O_RDONLY and O_WROK as
O_WRONLY, so the replacement is a pure text substitution.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-06-28 09:10:11 -03:00
Sammy Tran
2a7cf05a20 drivers/mtd/gd25: add QSPI support
Add QSPI mode to the GD25 MTD driver alongside the existing SPI path.
When CONFIG_GD25_QSPI is selected, sector erase, chip erase, byte read,
page write, and byte write all use the QSPI command/memory interfaces
instead of SPI. Reads use the quad I/O fast-read command (1-4-4) and
writes use the quad page-program command (1-1-4) via QSPIMEM_QUADDATA.
A new Kconfig option enables the QE bit in SR2 at initialisation so the
quad I/O pins are active.

Signed-off-by: Sammy Tran <sammytran@geotab.com>
2026-06-21 09:43:29 -03:00
Jukka Laitinen
cbfaa7c3b0 drivers/mtd: Make compile time check for sane mtd isbad/markbad configuration
This removes the DEBUGASSERT in ftl_initialize_by_path. Instead, check
compile time that FTL is enabled in case some of the drivers implement
the isbad and markbad functions.

Also select the FTL_BBM for those drivers as they require it.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-16 14:12:44 +08:00
Jukka Laitinen
9c10bbd04a drivers/mtd: Remove bad block management in FTL for devices not needing it
Bad block management and the logical->physical mapping is only needed
with raw NAND type memories, so we can compile that in conditionally,
saving ~600 bytes of flash on a 32-bit arm when NAND is not used.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
2026-06-08 10:00:07 +02:00
Carlos Sanchez
ee57ca0800 drivers/mtd/mx25rxx.c: add support for MX25L12873G
MX25L12873G is a SPI memory very similar to MX25L25673G,
but 128Mbit, which means it does not use 4-byte addresses.

Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2026-05-20 14:50:18 -03:00
Saurav Pal
4f6e695f7c fs/mnemofs: Add mnemofs version 1 support.
Split mnemofs into allocation, directory, file, CTZ, and read/write
modules, and update direntry traversal and file handling. Add superblock
format version 1 support, reject newer on-flash versions, and preserve
the mounted version when rewriting metadata.

Update the NAND simulator drivers for the new mnemofs behavior by fixing
spare writes, exposing the erase state, allowing raw reads, and documenting
the background-task startup flow.

Signed-off-by: Saurav Pal <resyfer.dev@gmail.com>
2026-05-19 10:29:11 +08:00
Julian Oes
2fd76ea150 drivers/mtd/w25n: address review comments
- Replace syslog() with finfo()/fwarn() to follow the NuttX subsystem
  debug convention.
- Merge adjacent early-continue `if` branches in w25n_pick_free_spare
  and w25n_scan_factory_bad.
- Add Input Parameters / Returned Value sections to the BBM helper
  headers.
- Clarify why only -EIO triggers a remap retry in w25n_erase and
  w25n_bwrite (block-level E-FAIL/P-FAIL vs. transient bus faults).

Signed-off-by: Julian Oes <julian@oes.ch>
2026-04-23 16:26:44 +02:00
Julian Oes
0c287d6f45 drivers/mtd/w25n: implement bad block management
Use the chip's built-in 20-entry non-volatile Bad Block Management
Look-Up Table (datasheet section 8.2.7) to transparently route around
bad blocks.

Init:
- Reserve the top 24 blocks of the array as a spare pool
- Clamp the MTD geometry to W25N_USER_BLOCKS = 1000 so upper layers
  never see the spare area (125 MB usable instead of 128 MB)
- Force BUF=1 alongside enabling ECC. The W25N01GVxxIT variant
  power-ups with BUF=0 (Continuous Read mode), in which Read Data
  ignores the column address and always starts at byte 0 - which
  silently broke any read targeting a non-zero column (OOB markers,
  sub-page reads in w25n_read).
- Scan all 1024 blocks for factory bad markers (non-FFh at byte 0 of
  the spare area of page 0) and remap any user-area bad blocks via the
  A1h BBM command. Idempotent across reboots: blocks already present
  in the LUT are skipped, so repeated scans don't consume LUT slots.

Runtime:
- On E-FAIL from w25n_block_erase or P-FAIL from w25n_program_execute,
  allocate a spare and issue A1h, then retry the operation once. The
  chip routes the retry to the spare PBA transparently. Data buffer is
  reloaded on program retry.
- Uncorrectable read ECC is left as -EIO (soft errors shouldn't trigger
  permanent remap, and remapping discards data we may still recover).

Safeguards against burning LUT slots on bogus bad blocks:
- w25n_pick_free_spare erases each candidate spare as an active proof
  of life before returning it - the factory OOB marker alone isn't
  trusted.
- w25n_bbm_swap rejects A1h with LBA outside the user area or PBA
  outside the spare pool.

Stack discipline for the logger-thread hot path:
- The 20-entry cached LUT lives in the device struct, not on the stack.
- w25n_read_bbm_lut decodes 4 bytes at a time instead of reading the
  full 80-byte LUT dump into a local buffer.

Boot diagnostics are emitted via syslog so they appear unconditionally:
- [w25n] BBM scan summary (new/remapped/unremapped/previously-remapped/
  LUT slots used)
- [w25n] W25N01GV ready line with user blocks, spare count, geometry,
  and actual SPI frequency
- [w25n] per-remap info and warnings on runtime E-FAIL/P-FAIL paths

Note: existing littlefs filesystems become unmountable because the
block count shrinks from 1024 to 1000; both PX4 board init.c paths
already mount with autoformat so they reformat on first boot after
this change.

Signed-off-by: Julian Oes <julian@oes.ch>
2026-04-23 16:26:44 +02:00
Carlos Sanchez
81d57ad5d5 drivers/mtd/mx25rxx.c: use 4 byte address for large flash memories.
On power-up, MX25L25673G uses 3-byte addresses, so only the lower
128Mb (half the memory) can be accessed. This change ensures 4-byte
addresses are used so the whole memory can be used.

Co-Authored-By: Randy Rossi <randyrossi@geotab.com>
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
2026-04-08 09:52:57 +08:00
Piyush Patle
13d0e64ee6 style: fix checkpatch issues after debug.h move
Fixed copespell errors, for CI sucess!

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
Piyush Patle
0dccc8ba21 include/debug.h: Move to include/nuttx/debug.h
debug.h is a NuttX-specific, non-POSIX header. Placing it in the
top-level include/ directory creates naming conflicts with external
projects that define their own debug.h.
This commit moves the canonical header to include/nuttx/debug.h,
following the NuttX convention for non-POSIX/non-standard headers,
and updates all in-tree references.

A backward-compatibility shim is left at include/debug.h that
emits a deprecation #warning and re-includes <nuttx/debug.h>,
allowing out-of-tree code to continue building while migrating.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
2026-04-07 07:50:06 -03:00
Huang Qi
e09048cc88 style: Fix "is is" typo across the codebase.
Correct duplicate "is is" word found in 181 files throughout the
codebase.
In most cases "is is" was changed to "is", but in contexts like
"MCU is is sleep mode" it was corrected to "MCU in sleep mode".

Also fixes a "the the" typo in net/inet/inet_sockif.c.

This is a pure style/documentation fix that improves code readability.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-24 09:39:26 +08:00
simbit18
3d555976bb drivers: Fix Make style
- Remove spaces from make file

Signed-off-by: simbit18 <simbit18@gmail.com>
2026-03-23 18:16:46 -04:00
Huang Qi
e3eeaefd6d style: Fix "the the" typo across the codebase.
Fix 269 occurrences of duplicate "the" word typo found in 209 files
across source code, header files, and configuration.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2026-03-23 11:07:49 +01:00
Michal Lenc
014f22b1c2 drivers/mtd/w25.c: ensure the device is not in power down mode
If power down mode is set, trying to read ID ends in an infinite loop
because w25_waitwritecomplete never returns as status register never
signalizes write complete. Therefore ensure the device is not in a
power down mode before trying to read from it.

This can be an issue if the board is trying to check for more NOR
memories on one SPI bus and one chip select. For example GD25 driver
returns the memory to power down state after read id is finished,
therefore board initialization is stuck in an infinite loop if it first
checks for GD25 and then fallbacks to W25.

The commit fixes the possible issue by ensuring W25 is brought back
to normal operation mode before trying to obtain the manufacturer ID.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2026-03-19 16:23:45 -04:00
Neil Berkman
c1c6e26395 drivers/mtd/ftl: bypass rwbuffer when O_DIRECT is set
ftl_write() unconditionally routes writes through rwb_write() when
FTL_HAVE_RWBUFFER is defined, ignoring the O_DIRECT flag stored in
dev->oflags. This means callers that open with O_DIRECT expecting
unbuffered writes still get their data buffered in RAM.

The O_DIRECT flag is already checked in ftl_flush() to select
between direct and read-modify-write paths, but the buffering
decision in ftl_write() never consults it.

Add O_DIRECT checks in both ftl_write() and ftl_read() to bypass
rwbuffer entirely when the flag is set. For writes, go directly to
ftl_flush() and normalize the return value to match the block
driver convention (nsectors on success). For reads, go directly to
ftl_reload(), bypassing any read-ahead cache.

This gives O_DIRECT callers a complete bypass of the rwbuffer layer
for both reads and writes, matching the documented contract.

Signed-off-by: Neil Berkman <neil@xuku.com>
2026-03-18 13:05:20 +01:00
zhaoxingyu1
2061ef5d2b mtdconfig/nvs: clean up block without valid data during GC
Invalid data is cleared during garbage collection rather than
deleted during initialization, thus accelerating the
initialization speed.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
dd60589895 mtdconfig/nvs: add key check when gc
When key string found corrupted during garbage collection,
then remove key-value pair from the flash.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
9a3f2003df mtdconfig/nvs: add dirty data clean ablility
Remove dirty data to ensure sufficient available
storage space in the flash memory.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
84a16e6842 mtdconfig/nvs: fix -Werror=unused-variable
when enable MTD_CONFIG_BUFFER_SIZE,
1669:10: error: unused variable 'ate_size' [-Werror=unused-variable]
1669 |   size_t ate_size = nvs_ate_size(fs);
2160:10: error: unused variable 'ate_size' [-Werror=unused-variable]
2160 |   size_t ate_size = nvs_ate_size(fs);

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
1b587db667 mtdconfig/nvs: use a fixed size buffer instead of vla
use a fixed size buffer on stack instead of vla,
When it needs to pass misra-c check

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
2e4ce22774 mtd_config/nvs: add data crc8
The purpose is to reduce the conflict rate of ate CRC and
verify the data

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
59f05be525 mtd_config/nvs: keep offset increasing during ate traversal
Enhance the robustness of ATE traversal.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
73de239ad2 mtdconfig/nvs: return 0 when delete a non-exist kv
Deleting a non-existent key-value pair is deemed a successful deletion.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
4b7b56a096 mtd/nvs: Fix the issue of compilation failure using the tasking compiler
the tasking compiler reports the error: expression must be constant
in line 510

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-29 14:56:19 +08:00
zhaoxingyu1
0e1dd46f3b mtd/mtd_config: add mtdconfig_register_by_path/mtdconfig_unregister_by_path api
mtd_config/mtd_config_nvs should all support
mtdconfig_register_by_path/mtdconfig_unregister_by_path api

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-26 10:52:51 +08:00
zhaoxingyu1
e4a73edec8 mtdconfig: lomtdconfig device change to depends on !MTD_CONFIG_NONE
The structure of mtd_config in Kconfig has changed.

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-26 10:52:51 +08:00
zhaoxingyu1
273222c06e mtdconfig: modify mtdconfig kconfig
change filename  mtd/mtd_config_fs.c to mtd/mtd_config_nvs.c
and optimize the configuration related to mtdconfig

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-26 10:52:51 +08:00
guohao15
5e117fda60 mtdconfig: support ram_mtdconfig device && lomtdconfig device
For nvs test in qemu

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2026-01-22 23:18:26 +08:00
guohao15
0af8d03d88 mtd/nvs: add nvs cache buffer
improve the speed of finding the target ate

Signed-off-by: guohao15 <guohao15@xiaomi.com>
2026-01-22 19:56:28 +08:00
jingfei
9483df3571 driver/cfi-flash: Add a config option for the page size of CFI flash.
We have added a defconfig configuration to set the page size of the flash.
According to the CFI protocol, the flash supports a single write operation
with a data volume ranging from byte size up to the maximum number of bytes.
However, the MTD device structure requires defining a page size, which serves
as the minimum write unit of the flash. Hence, this configuration is introduced.
Any page size within the range of 1 to the maximum number of bytes is considered
valid.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-16 20:38:26 +08:00
zhaoxingyu1
c4cf7ead30 bugfix: reading expired content need in expired range
By obtaining the erase value to set the nvs special ID
instead of using a fixed value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
61f4bd522c mtd/nvs: rename MTD_BLOCKSIZE_MULTIPLE
rename MTD_BLOCKSIZE_MULTIPLE to
CONFIG_MTD_CONFIG_BLOCKSIZE_MULTIPLE

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
Xiang Xiao
23e1066322 mtd/mtd_config_fs: Add NVS_ prefix to ADDR_XXX
and rename ret to rc for keeping the consistency with other macros

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
3fa0844da9 mtd/nvs: remove macro NVS_SPECIAL_ATE_ID
By obtaining the erase value to set the nvs
special ID instead of using a fixed value

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
525a27b859 mtd/nvs: compatible with bread/bwrite
add MTD_BREAD/MTD_BWRITE in nvs when
CONFIG_MTD_BYTE_WRITE is n

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
zhaoxingyu1
2274f1aeb3 mtd/nvs: remove CONFIG_MTD_WRITE_ALIGN_SIZE kconfig
remove CONFIG_MTD_WRITE_ALIGN_SIZE kconfig instead of
using geo.blocksize directly

Signed-off-by: zhaoxingyu1 <zhaoxingyu1@xiaomi.com>
2026-01-16 20:35:34 +08:00
jingfei
36e5752205 ftl:optimize ftl's MTD_ERASE return value check
the MTD ERASE interface has inconsistent return values.
Some implementations return the number of erased sectors,
while others return OK (0). It is currently recommended
to uniformly treat ERASE success as OK. Therefore, the
logic for judging the return value of MTD_ERASE in the
FTL erase interface should be changed to check if it is
greater than 0.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-14 09:56:04 +08:00
jingfei
3559e97659 mtd/parition:MTD partiton check whether the erase interface exist
Since there is a storage device like RRAM that doesn't
require erasing, the MTD erase function may not exist.
Here, we should first check whether the erase interface
exists before performing the erasing operation.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-14 09:56:04 +08:00
jingfei
e8fbc997fa ftl:adjust ftl for RRAM/MRAM
Accessing RRAM/MRAM from the FTL interface can
cause errors because RRAM lacks an erase interface.
To make RRAM/MRAM compatible with FTL, the FTL layer
erase interface needs to be modified.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-14 09:56:04 +08:00
jingfei
152ea6c4bd ftl:remove erase buffer for mtd device without erase interface
When there's no erase function for mtd, we decide if we
need erase_buffer based on this:

1. If we've got bad block marking, we still need the erase buffer.
   If a write fails, it's used to read back the entire bad block's
   contents before writing to a new block.
2. If we don't have bad block marking, the erase buffer isn't
   needed and can be skipped.

Signed-off-by: jingfei <jingfei@xiaomi.com>
2026-01-14 09:56:04 +08:00
dongjiuzhu1
0a381a3ff7 driver/cfi: fix write failed issue for unalign length with bankwidth
1. In cfi_write_unalign(): Add additional check to ensure nbytes is
   at least bankwidth size before skipping unaligned start handling.
   This prevents incorrect behavior when writing small amounts of
   data that are less than bankwidth.

2. In cfi_write(): Align down the write size to bankwidth boundary
   when the remaining nbytes is less than the buffer write size.
   This ensures the buffer write operation always works with properly
   aligned data size, preventing write failures.))

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-12-31 02:36:01 +08:00
zhengyu9
491ce83508 drivers/mtd: add MTDIOC_ISBAD ioctl
add an ioctl item MTDIOC_ISBAD
used for flashtool command to check bad blocks

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
2025-12-23 09:26:34 -03:00
Julian Oes
7e46d282eb drivers/mtd: Add W25N SPI NAND flash driver
Add MTD driver for Winbond W25N series SPI NAND flash.

Currently supports W25N01GV (1Gbit/128MB).

Features:
- Standard SPI interface with configurable frequency (up to 104 MHz)
- Hardware ECC enabled by default
- Block erase with sleep-based wait (releases SPI bus)
- Page read/write with busy-wait for fast operations

Limitations:
- No bad block management (BBM). Factory bad blocks and runtime bad
  blocks are not tracked.
- No bad block table (BBT) scanning at initialization.
- No Quad SPI support (standard SPI only).
- No access to spare area (64 bytes/page) or OTP region.

Tested using:
- Board with STM32H743
- W25N01GV on SPI at 96 MHz with DMA enabled
- Flash mounted using littlefs
- Tested using sdbench:
  - Sequential write speed of 1760 KB/s
  - Sequential read speed of 4900 KB/s

Signed-off-by: Julian Oes <julian@oes.ch>
2025-12-19 10:00:33 +08:00
Antoine Juckler
d5633f75a8 mtd/at25ee: Use eeprom/spi_xx25xx internally
In order to reduce code duplication, use the eeprom/spi_xx25xx
driver within mtd/at25ee.

The eeprom/xxx.h includes have been merged into eeprom/eeprom.h, to
provide a common include file like mtd/mtd.h.

Signed-off-by: Antoine Juckler <6445757+ajuckler@users.noreply.github.com>
2025-12-17 19:03:54 +01:00
Michal Lenc
edf3cc55a5 drivers/mtd/w25: support custom SPI transfers delay
This commit adds SPI_SETDELAY interface if CONFIG_SPI_DELAY_CONTROL
option is set. This allows to set custom delay between SPI transfers,
chip selects and so on.

Default values are set to 0. W25 SPI NOR flash works with them and
I haven't found any other values in the datasheet.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
2025-11-27 22:27:40 +08:00