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

35 Commits

Author SHA1 Message Date
Gunar Schorcht
bd67236788 drivers/mtd: store MTD pointers as XFA 2023-10-02 12:27:35 +02:00
Gunar Schorcht
ca44651d78 drivers/mtd: fix missing dependency in Kconfig for periph_sdmmc 2023-09-29 07:49:41 +02:00
Gunar Schorcht
00275326a8 drivers/mtd: add SDMMC support 2023-08-08 09:09:12 +02:00
Gunar Schorcht
556ef5235c drivers: add periph_sdmmc support 2023-08-08 09:09:12 +02:00
Gunar Schorcht
609c090ceb drivers/mtd_emulatd: MTD emulated in RAM for testing
This driver provides support for MTDs emulated in RAM to test MTD-based applications on boards that do not provide MTDs in hardware.
2023-04-11 17:42:10 +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
6f9dd8cf86 drivers/mtd_sdcard: add mtd_sdcard_default module 2023-02-05 19:03:09 +01:00
MrKevinWeiss
40f4950f85
drivers/at24cxxx: Fix kconfig model 2022-08-17 14:37:21 +02:00
Gunar Schorcht
a0d8882a55 drivers/mtd: fix module name for mtd_sdcard in Kconfig 2022-08-03 08:26:59 +02: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
benpicco
4b6da5c8e4
Merge pull request #17863 from benpicco/sam0_sdhc
cpu/samd5x: add SD Host Controller implementation
2022-05-31 15:33:24 +02:00
Benjamin Valentin
babee877ce cpu/sam0_common: add SD Host Controller implementation 2022-05-31 11:07:20 +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
Francisco Molina
36d1911e65 dirvers/mtd: use imply instead of select
Using imply allow for user to deselect the default MTD backends
2021-09-29 10:13:51 +02:00
Francisco
0b7eb2bbc9
Merge pull request #16836 from fjmolinas/pr_kconfig_mtd
drivers/mtd: fix Kconfig dependencies
2021-09-22 10:08:14 +02:00
Francisco Molina
14ef09b8b4 drivers/mtd: fix Kconfig dependencies
Currently implementations of the MTD api are selecting the module,
this makes it easy for default backends to be selected. But the
correct modeling is simply selecting the MTD api and then selecting
a backend. BOARDs providing one of the backends can expose this and
then that backend can be selected by default.

There is also currently nothing preventing from using the MTD api
with no backend since a mock backend can easily be provided as is
done in all mtd tests.
2021-09-22 09:22:51 +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
Leandro Lanzieri
8abd8bc3d4
drivers/mtd: add module to Kconfig 2020-11-18 18:38:49 +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
304bce3724
drivers: configure per driver dependency resolution 2020-07-20 14:32:16 +02:00
fabian18
a3a1c160ee mtd: Change API to return 0 on success
Returning the number of bytes written/read could return a negative integer
because a uint32_t is expected for the length in read()/write() operations.
2020-05-06 20:24:27 +02:00
94c753c07a drivers: doxygen cleanup 2017-09-01 15:12:20 +02:00
8d74212afa drivers/mtd: constify where possible 2017-06-29 22:46:16 +02:00
Joakim Nohlgård
6d3304f52c mtd: Add MTD VFS wrapper for use with DevFS 2017-03-16 16:45:49 +01:00
Aurelien Gonce
49ebf55b0d mtd: add a low level generic driver for flash file system 2017-03-16 11:23:53 +01:00