
Dear Hunter Cobbs,
In message ad84a70a0912151341h115e4c59n9494caef776ea92b@mail.gmail.com you wrote:
Hello everyone. Well, this is my first post on the list and its to announce a small bug that I've found when using JFFS2 on NAND in UBoot.
Thanks.
diff -ruN u-boot/fs/jffs2/jffs2_1pass.c uboot/fs/jffs2/jffs2_1pass.c
Ideally you would use git to track source code changes, and then use "git format-patch" to extract a patch from the git repository and "git send-email" to submit it to the mailing list.
In any case, we need your Signed-off-by: line for such a submission.
--- u-boot/fs/jffs2/jffs2_1pass.c 2009-12-15 14:20:33.000000000 -0600 +++ uboot/fs/jffs2/jffs2_1pass.c 2009-12-15 14:19:27.000000000 -0600 @@ -158,12 +158,12 @@
*/
-#define NAND_PAGE_SIZE 512 +#define NAND_PAGE_SIZE CONFIG_SYS_NAND_PAGE_SIZE #define NAND_PAGE_SHIFT 9
If you change the definition of NAND_PAGE_SIZE, then the value of NAND_PAGE_SHIFT makes no longer sense. Having a close look it is not used anywhere in the code, so I recommend to simply delete this line. While doing this, please also delete the (likewise unsued) definition of ONENAND_PAGE_SHIFT.
#define NAND_PAGE_MASK (~(NAND_PAGE_SIZE-1))
#ifndef NAND_CACHE_PAGES -#define NAND_CACHE_PAGES 16 +#define NAND_CACHE_PAGES CONFIG_SYS_NAND_PAGE_COUNT #endif #define NAND_CACHE_SIZE (NAND_CACHE_PAGES*NAND_PAGE_SIZE)
I think here we should remove the "#ifndef NAND_CACHE_PAGES" / "#endif" lines and change all remaining definitions of NAND_CACHE_PAGES in old board config files (include/configs/CATcenter.h, include/configs/PPChameleonEVB.h, include/configs/NC650.h, and include/configs/SIMPC8313.h) into CONFIG_SYS_NAND_PAGE_COUNT.
Scott, what do you think?
Best regards,
Wolfgang Denk