8d technologies

Open source flash drivers for Compulab cm-x255 and cm-x270w/l boards using the MTD layer

Alternate flash drivers | Nand patch for cm-x255 | Datasheets | Contact | Links
Alternate flash drivers
Both the cm-x255 and cm-x270w comes with on-board NOR flash (for the bootloader and kernel) and can have NAND flash installed (useful for large root filesystems). Compulab provides drivers for those chips with their Linux patch, but there were a few problems: In order to resolve the problems above, I wrote drivers using the mtd api.

Nand patch for cm-x255
NOTE: An up to date version of the patch is included in my latest kernel patch.

The patch:
cm-x255-nand-mtd-may3-2006.diff

Technical details: Notes about this driver:
In the hwcontrol function, you may see this: asm volatile ("mcr p15, 0, r0, c7, c10, 4);

This operation drains the write buffer. I copied this from the open-source part of compulab's drivers. The reasoning is that since writes to the GPIO registers are unbuffered and uncached, the GPIO pins will change state before the memory read/write occurs (if buffered). However, I've read somewhere that iomapped memory is unbuffered and uncached so I'm not sure draining the write buffer is the right thing to do. Perhaps only a small delay is needed and the delay generated when draining the buffer is enough? I added a udelay(1) to be safe. There is also the read from 0xff000000 and I have no idea what it is for. To be reviewed later.


Nand patch for cm-x270
The patch:
cm-x270-nand-mtd-may3-2006.diff
(Applies on a 2.6.12.2 kernel. Kconfig and Makefile not included) This is BETA, not very well tested.

Technical details: Notes about my driver:
I think that a flash timing requirement is violated somewhere, but I could not find where. The symtom was ecc errors on read. Adding a delay of 100 ns in the device ready function made the problem disappear. I checked the flash pins with a scope but all the timings I could see were ok (would need conditional triggering, more memory or a logic analyser)...

Please also note that this driver overrides the cmdfunc with a command function designed for large page flash. (My board uses K9F1G08X0A). If your board does not use large page flash, use the cmx270_nand_command() function instead of cmx270_nand_command_lp().
TODO: Patch nand_core to allow the user to supply both command functions and let nand_core decice which one to use according to the chip id.

Contact
You may contact me by email if you have suggestions, improvements, patches, information or links that you would like me to post on this page:

Raphael Assenat <raph.armcore@8d.com>

Links
The ARM Linux Project: http://www.arm.linux.org.uk/
ARM linux development: https://arm.nihilisme.ca/
Memory Technology Device (MTD): http://www.linux-mtd.infradead.org/
CompuLab website: http://www.compulab.co.il


created with vim Valid HTML 4.01 Transitional Sponsored and hosted by:8d technologies