NAND Flash Framework for review
Andrew Turner
andrew at fubar.geek.nz
Sun Mar 14 07:58:31 UTC 2010
On Tue, 9 Mar 2010 00:28:53 +0100
Rafal Jaworowski <raj at semihalf.com> wrote:
> We are looking for review, comments and any other feedback.
Below is my first set of notes from reading the code. I haven't ported
the driver to my hardware yet so these are only from using with nandsim.
Chip drivers:
- lnand and snand have magic numbers to figure out which drive to use.
We should move these to a flag in the chip parameters.
- nand_read_pages should be a device method so we can customise how we
handle reading of pages.
- Split nand_generic into separate files with different device options
so we can compile only the one we need.
- nand_generic.c should be split into multiple files to allow us to
support only the chips we have.
nandbus:
- nandbus should not know what commands to send to nand chips. These
requests should be moved up to the chip driver.
- Why is nandbus not exposing it's interface via NEWBUS?
- Where is nandbus_destroy used?
- Why is malloc called with M_NOWAIT when allocating the nandbus ivar?
- What should happen when nandbus_send_command, nandbus_send_address,
nandbus_start_command, nandbus_read_buffer or nandbus_write_buffer
fail?
- Why does nandbus need to know if we are an ONFi part or not? We
can push the check into the onand driver's probe function.
nandsim:
- nandsim sample config has invalid time values (too small.
- There is a kernel crash in nandsim_log.
General:
- malloc with M_WAITOK will always succeed, no need to check return
value.
- Should define our own malloc type.
Ideas:
- Can we move ecc and bbt handling into GEOM? This will allow us to
bypass them when required.
Andrew
More information about the freebsd-embedded
mailing list