[U-Boot-Users] Suggestion on CRCing data on NAND?

I need to calculate CRC for the data (jffs2) on NAND flash. (u-boot is on separate NOR flash, btw.) What do you all think is the best way to do so? I'm guessing that I need to do the nand read.jffs2 and then perform CRC on that data where its read.
Can anyone suggest a better/faster way?

In message e0590900608171108x20a32b79va810cf81dc140fac@mail.gmail.com you wrote:
I need to calculate CRC for the data (jffs2) on NAND flash. (u-boot is
I cannot imagine what that would be good for. The CRC would ounly be useful if this was a read-only partition, then JFFS2 is probably not the optimal solution; or it is a writable partition, and then your CRC is void.
Can anyone suggest a better/faster way?
Explain what you really want to do. I guess you are on the wrong track.
Best regards,
Wolfgang Denk

Wolfgang,
Here's what I need to do from u-boot. I'd like to check the validity of rootfs before launching Linux kernel. NFS is not available for what I'm doing so if the rootfs is corrupted, the kernel will just panic and hang there. We can't use boot disk, etc. either. So, I'd like to check rootfs and if it seems corrupted, u-boot will download the valid rootfs image (via tftp) and burn it on flash before it launches kernel.
I'm planning on making the rootfs read-only so that CRC checking make sense for this purpose. If there's anything we need to save, we will just save them in a flash in a separate partition.
Is there a better way for this process that we can do from u-boot? If so, I'd love to hear it.
Thanks!
mitsy
On 8/17/06, Wolfgang Denk wd@denx.de wrote:
In message e0590900608171108x20a32b79va810cf81dc140fac@mail.gmail.com you wrote:
I need to calculate CRC for the data (jffs2) on NAND flash. (u-boot is
I cannot imagine what that would be good for. The CRC would ounly be useful if this was a read-only partition, then JFFS2 is probably not the optimal solution; or it is a writable partition, and then your CRC is void.
Can anyone suggest a better/faster way?
Explain what you really want to do. I guess you are on the wrong track.
Best regards,
Wolfgang Denk
-- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de Looks clean and obviously correct to me, but then _everything_ I write always looks obviously correct to me. - Linus Torvalds in Pine.LNX.4.10.10012090054360.791-100000@penguin.transmeta.com

In message e0590900608171344p51945061i8d6cda6f14e6515c@mail.gmail.com you wrote:
Here's what I need to do from u-boot. I'd like to check the validity of rootfs before launching Linux kernel. NFS is not available for what I'm doing so if the rootfs is corrupted, the kernel will just panic and hang there. We can't use boot disk, etc. either. So, I'd like to check rootfs and if it seems corrupted, u-boot will download the valid rootfs image (via tftp) and burn it on flash before it launches kernel.
I'm planning on making the rootfs read-only so that CRC checking make sense for this purpose. If there's anything we need to save, we will just save them in a flash in a separate partition.
OK, understood. Sounds OK.
Best regards,
Wolfgang Denk
participants (2)
-
mitsy
-
Wolfgang Denk