[U-Boot] [PATCH 1/1] NAND Re: mtdparts fails with NAND >= 4GB

Scott Wood scottwood at freescale.com
Tue Feb 1 00:28:22 CET 2011


On Thu, 27 Jan 2011 17:43:10 -0800
Aaron Williams <Aaron.Williams at caviumnetworks.com> wrote:

> I have included my preliminary patch which seems to be working.
> It has not been extensively tested yet.  All of the changes were basically
> making the sizes and offsets u64 instead of u32.  When looking at the Linux
> kernel code it looks like they also use u64. I was mistaken and our NAND
> flash chip is 4GiB in size so I can't test with any larger chips.
> 
> -Aaron

Patch is whitespace-mangled and does not apply.

Also needs sign-off and propper commit message.  See
http://www.denx.de/wiki/U-Boot/Patches
and also the Developer's Certificate of Origin in
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/SubmittingPatches;h=689e2371095cc5dfea9927120009341f369159aa;hb=HEAD

> @@ -207,20 +212,20 @@ static unsigned long memsize_parse (const char *const ptr, const char **retptr)
>   * @param buf output buffer
>   * @param size size to be converted to string
>   */
> -static void memsize_format(char *buf, u32 size)
> +static void memsize_format(char *buf, u64 size)
>  {
>  #define SIZE_GB ((u32)1024*1024*1024)
>  #define SIZE_MB ((u32)1024*1024)
>  #define SIZE_KB ((u32)1024)
> 
>         if ((size % SIZE_GB) == 0)
> -               sprintf(buf, "%ug", size/SIZE_GB);
> +               sprintf(buf, "%llug", size/SIZE_GB);
>         else if ((size % SIZE_MB) == 0)
> -               sprintf(buf, "%um", size/SIZE_MB);
> +               sprintf(buf, "%llum", size/SIZE_MB);
>         else if (size % SIZE_KB == 0)
> -               sprintf(buf, "%uk", size/SIZE_KB);
> +               sprintf(buf, "%lluk", size/SIZE_KB);
>         else
> -               sprintf(buf, "%u", size);
> +               sprintf(buf, "%llu", size);
>  }
> 

Need to make sure there are no boards with MTD enabled but not
CONFIG_SYS_64BIT_VSPRINTF.

-Scot



More information about the U-Boot mailing list