jffs2+mtd+big endian problem

Li Yang-r58472 LeoLi at motorola.com
Mon Jan 19 03:43:11 EST 2004


Hi,

I'm doing a JFFS2 port to a PowerPC target board.  I have several questions while porting.

1. Which kind of endian should I use in JFFS2?  Mkfs.jffs2 (older version, I have tried the new binary on JFFS2 website, the big-endian option breaks) can generate images of the two endian types.

2. I added a new map file in driver/mtd/maps directory.  Which read/write/memcpy operation should I use?  __raw_readw() or readw()? Or Inw()?  They determined whether to swap bytes.

I have tried several cases.  When I use little-endian fs and __raw_read(), the JFFS2 mount got error: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x8519 instead.  

However, after I change to use big-endian fs, mount can be successful.  Create new file on JFFS2 got error: Node totlen on flash (0x44000000) != totlen in node ref (0x00000044).  Seems data written to flash are 32-bit byte-swaped.

Has anyone here done JFFS2 on Powerpc Big-endian system?  What are your options?


--
Leo Li
Software Engineer
Metrowerks -- a Motorola company
Linux Solutions Group
 
Office: +8610-65642272
LeoLi at motorola.com
 




More information about the linux-mtd mailing list