vasantr@utdallas.edu said:
> Do you have some sample code I could look at that writes to MTD Flash
> devices? We compiled support in for MTD and CFI/Intel parts (and I
> edited the header files so things match our hardware) and I would like
> to write our bootloader & kernel/RAMDISK to flash.
The support for CFI/Intel parts really does only support the chips. You
also need a 'map' driver which provides read/write access to the correct
memory locations. I usually point people at physmap.c but in this case
nora.c is probably more useful - and it also shows how to 'partition' the
flash into multiple separate devices.
Also, you need the mtdchar driver which presents MTD devices as a character
device. read/lseek/write work as you might expect, with the exception that
write can only clear bits. There's an ioctl() for erase.
The MTD CVS tree contains a handful of utils which could be useful -
'doc_loadbios' will load a file into an MTD device, erasing it first, and
despite its can be used quite happily for loading kernels, firmware etc.
-- dwmw2Received on Thu Aug 24 01:20:57 2000
This archive was generated by hypermail 2.1.8 : Tue May 04 2004 - 09:43:40 EDT