pre-CFI sharp driver

John Lenz jelenz at
Wed Apr 21 21:54:33 EDT 2004

The device I am developing for is the Sharp Zaurus SL5500 (which is  
codenamed collie).  I am currently working on porting the kernel used  
for from 2.4 to 2.6.  In 2.4, we used the pre-CFI  
sharp driver.  NOTE: the root filesystem is located on the flash  
device.  I am using the maps/sa1100-flash.c map.

I have tried using the Intel/Sharp flash chips (cfi_cmdset_0001.c) and  
cfi_probe and have had some success.

1) On a stock 2.6.5, doesn't work
2) On a 2.6.5 with the mtd cvs code using the Intel CFI driver and  
using cfi_probe, I am able to mount the root filesystem (jffs2) and am  
able to log in and busybox works and such.  When booting tho, there are  
a bunch of errors like
jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00a00000:  
0x8080 instead.
I get around 50-60 of these messages at different addresses.
Note, the address given there is near the end of the flash.

But ignoring those, the root fs is still mounted.

But when I try and write a file, jffs2_flash_writev returns -15.  i.e.  
I get a "Write of x bytes at x failed.  returned -15, retlen 0" error.

The sharp device also starts up completly locked, and I have to add the  
following code to the maps/sa1100-collie.c after cfi_probe has been  
{ int k;
for (k = 0; k < sa[i].mtd->numeraseregions; k++) {
	int retval;
	retval = sa[i].mtd->unlock(sa[i].mtd, sa[i].mtd->eraseregions 
	if (retval)
		printk(KERN_WARNING "SA1100 flash: Error while  
unlocking region 0x%08x\n",
} }

It could be possible that since the 0x00a0000 is past the end of the  
last erase block (we create the jffs2 filesystem with the --pad  
option), they are still locked?  but why would that impact the  

I am able to mount the root filesystem and write files and everything  
works with the attached patch  I don't even need the mtd cvs code, it  
works with just the stock 2.6.5 kernel.  This is just a forward port of  
the changes we had to sharp.c  note that we have defined AUTOUNLOCK.

This is difficult to debug, because I do not have any specs for the  
device.  The only reference we have is the code that sharp has  
released, which uses the pre-CFI device with the same changes I have  


-------------- next part --------------
A non-text attachment was scrubbed...
Name: sharp.diff
Type: text/x-patch
Size: 9064 bytes
Desc: not available
Url : 

More information about the linux-mtd mailing list