Skip to content

sys/auto_init: new auto_init_storage#16497

Closed
fabian18 wants to merge 3 commits intoRIOT-OS:masterfrom
fabian18:auto_init_storage_at24cxxx_mtd
Closed

sys/auto_init: new auto_init_storage#16497
fabian18 wants to merge 3 commits intoRIOT-OS:masterfrom
fabian18:auto_init_storage_at24cxxx_mtd

Conversation

@fabian18
Copy link
Contributor

Contribution description

  • Add new module auto_init_storage to auto-initialize storage devices
  • A storage device <d> shall be auto initialized if the pseudomodule auto_init_storage_<d> is pulled in
  • If the storage device has an MTD layer, the auto_init module shall setup the MTD device from device params
  • A board that uses an MTD device for a dedicated purpose can implement a hook auto_init_mtd_<d>
  • implement auto_init_storage_at24cxxx as an example

I´ll mark this as a draft because the implementation of the auto-initialization of the at24cxxx should probably be another PR.
This PR could be just the auto_init_storage module, if you agree with the code changes.

Testing procedure

Board sam54e-xpro has an MTD at24mac.
Add to boards/sam54e-xpro/board.c:

#include <stdio.h>
void auto_init_mtd_at24cxxx(mtd_at24cxxx_t *at24cxxx, at24cxxx_id_t numof)
{
    puts("auto init at24cxxx");
}

Try USEMODULE="mtd auto_init_storage_at24cxxx" BOARD=sam54e-xpro make -C examples/gnrc_networking and verify that it is called. The board does not use the MTD for a special purpose, so this is just an example.
A board that has to actually read or write something on auto-init must call mtd_init() and do whatever it needs to do.
I do not have that board but I have another board that is not in RIOT for which it works well.

Issues/PRs references

Similar as #11871

@github-actions github-actions bot added Area: boards Area: Board ports Area: build system Area: Build system Area: drivers Area: Device drivers Area: sys Area: System labels May 25, 2021
@fabian18 fabian18 force-pushed the auto_init_storage_at24cxxx_mtd branch from 5aa3ede to 801ef85 Compare May 29, 2021 09:26
@maribu maribu requested a review from benpicco June 3, 2021 12:34
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 21, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Mar 2, 2022
@benpicco
Copy link
Contributor

benpicco commented Mar 3, 2022

I think this is obsoleted by #17341.
While auto-mount is not exactly the same, I think for things where there can only be a single user (MTD device) it is also the obligation of that user (file system, FlashDB, …) to initialize the MTD device.

For things that then act more like infrastructure with many users (file systems, database) auto-init is the way to go.

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Mar 3, 2022
@benpicco benpicco added the State: stale State: The issue / PR has no activity for >185 days label Mar 3, 2022
@fabian18
Copy link
Contributor Author

fabian18 commented Mar 3, 2022

I think this is obsoleted by #17341.

Yes kind of. I do not intend to pursue this PR any further. So closing this one.

@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Mar 3, 2022
@fabian18 fabian18 closed this Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: build system Area: Build system Area: drivers Area: Device drivers Area: sys Area: System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants