[U-Boot] JFFS2 Loading Error on non 8k blocksize NAND [DEMO PATCH 1/1]
Wolfgang Denk
wd at denx.de
Mon Dec 21 21:37:02 CET 2009
Dear Hunter Cobbs,
In message <ad84a70a0912151341h115e4c59n9494caef776ea92b at 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
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Where shall I begin, please your Majesty?" he asked. "Begin at the
beginning," the King said, gravely, "and go on till you come to the
end: then stop." - Alice's Adventures in Wonderland, Lewis Carroll
More information about the U-Boot
mailing list