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
Benjamin Valentin
babee877ce cpu/sam0_common: add SD Host Controller implementation 2022-05-31 11:07:20 +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
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