Hello,

For history our board need 128 Mbit of flash, but the 128 Mbit parts are sloooow and have gigantic erase blocks.

So as an alternative our plan was to have two 64 Mbit SST parts (fast and small erases) and aggregate them in software, so that we can present the other drivers a single 128 Mbit device.

I can do this alone my own way, but I thought this would be of interest for all NuttX developers.


This is the reverse of the mtd_partition driver.

You give it a list of MTD devices (with similar geometries, this will be checked) and the result is one larger MTD device that span all the small ones.

This is a kind of raid0 for MTD devices.


I have questions about the API. Basically there are two choices:

-have an empty initialiser (mtd_agg_init()) that return the larger device, and a function mtd_agg_adddev(child) to grow the device

-have an initializer that takes as parameter the list of devices to aggregate


The assumption is that the returned MTD devices are pointers to malloc()ed ram. So it makes no sense to have the list of child pointers as a const array. it is inherently dynamic device construction.


What is your preference?

The separate add() function requires realloc. This is probably an argument against it.

The initializer with parameters need allocation of a ram array to store the MTD pointers. Not nice.


Should I copy the pointers in my own privately allocated mtd device or should I rely on a stable, externally allocated device list?


Do you have any design advice here, so NuttX can benefit from the best API?

Coding has not started yet, so I have no personal preference.


Sebastien

Reply via email to