4 Commits

Author SHA1 Message Date
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
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
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 ac019bbfa2 drivers/mtd: cfi-flash driver
Realization of cfi-flash driver.
Add the interfaces of intel and amd command sets.

Signed-off-by: zhengyu9 <zhengyu9@xiaomi.com>
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
2025-02-11 17:23:44 +08:00