1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

18 Commits

Author SHA1 Message Date
Gunar Schorcht
bd67236788 drivers/mtd: store MTD pointers as XFA 2023-10-02 12:27:35 +02:00
bors[bot]
2221cbfa9b
Merge #19258
19258: drivers/mtd_flashpage: implement pagewise API, don't use raw addresses r=benpicco a=benpicco



Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
2023-02-16 15:02:19 +00:00
Benjamin Valentin
43fffcd74f drivers/mtd: add bounds checking 2023-02-16 15:50:52 +01:00
Benjamin Valentin
44476137e3 mtd: add fast path to mtd_write_page()
If we overwrite a whole sector, don't perform a read-modify-write cycle.
2023-02-06 15:46:34 +01:00
Benjamin Valentin
bede0615ad drivers/mtd: fix doc of mtd_read_page(), mtd_write_page_raw()
The function allows for offsets greater than the page size.
2022-06-20 14:59:41 +02:00
Benjamin Valentin
f7ab95ad97 dirvers/mtd: return early if init fails
If init fails (e.g. because an SD card was not inserted) don't
fail the `mtd->write_size != 0` assertion but instead return early.
2022-06-07 00:59:37 +02:00
Fabian Hüßler
477a86022f drivers/mtd: move write_size assertion after init call 2022-05-23 19:46:46 +02:00
chrysn
dc7bc9f854
Merge pull request #17683 from chrysn-pull-requests/mtd-granularity
mtd: Introduce write granularity
2022-05-20 11:52:03 +02:00
Benjamin Valentin
e3c8187736 dirvers/mtd: don't use work_buf as proxy for !direct write flag
Currently work_buf is only NULL when MTD_DRIVER_FLAG_DIRECT_WRITE is
set, so it served as a proxy for that flag.

However, we might want to have a work buffer even when writes without
erase are possible.
2022-04-11 14:29:52 +02:00
chrysn
9ec42492da mtd: Introduce write_size, setting no-rewrite policy
... with flags defining more clearly which kinds of overwrites are OK

Co-authored-by: benpicco <benpicco@googlemail.com>
2022-03-31 10:50:30 +02:00
Benjamin Valentin
6f9b05cad8 mtd: fix mtd_write_page() across sector boundaries 2021-09-21 15:20:02 +02:00
Benjamin Valentin
e8bbe1d1c7 mtd: re-add mtd_write_page()
Add a write_page() command that performs a read-modify-write cycle
if necessary.
2021-01-28 11:51:28 +01:00
Benjamin Valentin
60eb75da3c mtd: rename mtd_write_page() -> mtd_write_page_raw()
The function will not abstract away the behavior of the underlying media
(e.g. whether only 1 -> 0 writes are possible without erase), thus rename it.
2021-01-26 11:48:26 +01:00
Benjamin Valentin
90751bcec1 mtd: fix return in mtd_erase()
If `.erase` is implemented we must return, not execute the
fallback code path

fixes #14988
2020-09-09 19:38:40 +02:00
Benjamin Valentin
9a4141880c mtd: allow to use non-pagewise functions
If the underlying driver implements 'plain' read/write/erase
fucntions, don't convert them to pagewise functions and back.

Just use the old direct functions.
2020-09-02 22:50:24 +02:00
Benjamin Valentin
4034f96169 mtd: add page addressed operations
Currently read(), write() and erase() all use 32 bit addressing.
This is a problem when writing to media > 4 GiB, e.g. SD cards.

The current implementation would wrap around after 4 GiB and corrupt data.

To avoid this, add functions to the MTD subsystem that allow for page-wise
addressing. This is how most of the underling storage drivers and the
file-systems above work anyway.

In the future we should then deprecate the 32-bit functions if all drivers
are converted.
2020-08-18 17:25:39 +02:00
94c753c07a drivers: doxygen cleanup 2017-09-01 15:12:20 +02:00
Aurelien Gonce
49ebf55b0d mtd: add a low level generic driver for flash file system 2017-03-16 11:23:53 +01:00