[U-Boot-Users] JFFS2 CRC problem with kernel and ramdisk in U-boot 0.4.0

Hello,
We are currently using u-boot 0.4.0 on our custom MPC8270 board with a Intel StrataFlash. Everything is working fine and we can boot the Denx PPC Linux Kernel 2.4.4 using NFS. Now we are trying to boot linux kernel through JFFS2 and we are encountering problems similar to the problem posted by Vitali Martin on 7-22-2003. (See link below.)
http://sourceforge.net/mailarchive/forum.php?thread_id=2814642&forum_id=... 8
Not entirely sure if this was resolved because the thread just died without the real answer.
So, basically we did the same thing using eraseall in Denx PPC distribution.
But in this case, we are trying the ramdisk image. bash-2.05# eraseall /dev/mtd1 Erased 4096 Kibyte @ 0 -- 100% complete. bash-2.05# mount -t jffs2 /dev/mtdblock1 /mnt bash-2.05# cp rImage /mnt bash-2.05# cd /mnt/ bash-2.05# ls -l total 4997 -rw-r--r-- 1 root root 5116534 Dec 31 1969 rImage bash-2.05# diff rImage /mnt/rImage bash-2.05# cd .. bash-2.05# umount /mnt Same as Martin did, we rebooted the board and went into u-boot and did the following:
-> ls Scanning JFFS2 FS: . done. -rw-r--r-- 5116534 Thu Jan 01 00:01:00 1970 rImage -> fsload 100000 rImage ### JFFS2 loading 'rImage' to 0x100000 ** WARNING ** rImage is version 0 (in find, ignoring) ** WARNING ** rImage is version 0 (in resolve, ignoring) ### JFFS2 load complete: 5116534 bytes loaded to 0x100000 -> imi 100000
## Checking Image at 00100000 ... Image Name: Basit ramdisk image Created: 2003-12-01 18:01:23 UTC Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 5116470 Bytes = 4.9 MB Load Address: fe100000 Entry Point: fe100000 Verifying Checksum ... Bad Data CRC ->
But with the same ext2 file that was copied to the JFFS2 file format, using tftp everything is fine.
-> tftp 800000 rImage Bytes transferred = 5116534 (4e1276 hex) -> imi 800000
## Checking Image at 00800000 ... Image Name: Basit ramdisk image Created: 2003-12-01 18:01:23 UTC Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 5116470 Bytes = 4.9 MB Load Address: fe100000 Entry Point: fe100000 Verifying Checksum ... OK
But when comparing the files, I noticed that they are not the same.
-> cmp.b 100000 800000 4e1276 byte at 0x00106002 (0xfe) != byte at 0x00806002 (0xae) Total of 24578 bytes were the same
I noticed that u-boot 0.4.0 are packing the JFFS2 data structures and in the Denx PPC 2.4.4 kernel it is not using the __attribute__((packed)) at all in the same data structures.
I know one post with similar problems said that going to the 2.4.19pre1 fixed his problem. I know the mtd tools in the Denx PPC kernel is old but trying to update the Denx kernel to use the current MTD kernel, fs, utilities is not trivial.
Is there someone there who knows how to resolve this problem? I'm sure that
Wolfgang will not put a distribution out there if it is not working. So somehow there are incompatibilities between Denx PPC kernel 2.4.4 and U-boot 0.4.0. Should we just bite the bullet and go to the current linux distribution?
We are in a crunch time right now thus, any help is greatly appreciated.
thanks, Maynard

In message 159C486347C8D3119B1D005004A4694002F4AD09@OLIVE you wrote:
JFFS2 and we are encountering problems similar to the problem posted by Vitali Martin on 7-22-2003. (See link below.)
http://sourceforge.net/mailarchive/forum.php?thread_id=2814642&forum_id=...
Not entirely sure if this was resolved because the thread just died without the real answer.
This is what I know, too.
bash-2.05# cp rImage /mnt bash-2.05# cd /mnt/ bash-2.05# ls -l total 4997 -rw-r--r-- 1 root root 5116534 Dec 31 1969 rImage bash-2.05# diff rImage /mnt/rImage
Can you please try a umount, reboot, mount here, and then run a "cmp rImage /mnt/rImage" ?
[diff is not really good for binary images.]
I noticed that u-boot 0.4.0 are packing the JFFS2 data structures and in the Denx PPC 2.4.4 kernel it is not using the __attribute__((packed)) at all in the same data structures.
This is probably the explanation for the problems.
I know one post with similar problems said that going to the 2.4.19pre1 fixed his problem. I know the mtd tools in the Denx PPC kernel is old but trying to update the Denx kernel to use the current MTD kernel, fs, utilities is not trivial.
You can try using our linuxppc_2_4_devel kernel tree.
Is there someone there who knows how to resolve this problem? I'm sure that Wolfgang will not put a distribution out there if it is not working. So
Well, as you mentioned before, the linux-2.4(.4) kernel tree is old, and so is the included MTD (and thus JFFS2) code. It seemes there were changes to the JFFS2 code since that broke compatibility. There is little you can do about this.
there are incompatibilities between Denx PPC kernel 2.4.4 and U-boot 0.4.0. Should we just bite the bullet and go to the current linux distribution?
We are in a crunch time right now thus, any help is greatly appreciated.
Try our linuxppc_2_4_devel kernel tree.
Best regards,
Wolfgang Denk

Maynard Cabiente wrote:
We are currently using u-boot 0.4.0 on our custom MPC8270 board with a
Intel StrataFlash. Everything is working fine and we can boot the
Denx PPC
Linux Kernel 2.4.4 using NFS. Now we are trying to boot linux kernel
through
JFFS2 and we are encountering problems similar to the problem posted
by
Vitali Martin on 7-22-2003. (See link below.)
http://sourceforge.net/mailarchive/forum.php?thread_id=2814642&forum_id= 12898
Not entirely sure if this was resolved because the thread just died
without
the real answer.
I fixed some JFFS2 problems for U-Boot 0.4.8. If you can't just use the latest U-Boot you need to update fs/jffs2/jffs2_1pass.c and include/jffs2/jffs2.h.
Before the patch a clean jffs2 image from mkfs.jffs2 would work fine, but I had problems if I copied a new kernel in with cp or ftp. It would usually (but not always) be corrupted when read by U-Boot, but it was fine when read by Linux.
Dave
Dave Ellis ~~~~~~~~~~~~~~~~~~~~~~~~~~ SIXNET - "Leading the Industrial Ethernet Revolution" 331 Ushers Road, P.O. Box 767, Clifton Park, NY 12065 USA Tel +1 (518) 877-5173 Fax +1 (518) 877-8346 Email me at: dge@sixnetio.com Detailed product info: www.sixnetio.com ~~~~~~~~~~~~~~~~~~~~~~~~~~
participants (3)
-
Dave Ellis
-
Maynard Cabiente
-
Wolfgang Denk