[U-Boot] [PATCH] cfi_flash: use specific width types for cword

Linus Walleij linus.walleij at linaro.org
Tue Oct 27 11:31:12 CET 2015


On Fri, Oct 23, 2015 at 5:50 PM, Ryan Harkin <ryan.harkin at linaro.org> wrote:

> This patch changes the cword union to use specific length types that are
> architecture indepented.
>
> This patch also renames the members of the cword union to represent
> their usage, i.e.:
>
>     c  -> w8
>     s  -> w16
>     l  -> w32
>     ll -> w64
>
> Where "w" stands for "width" in bits.
>
> I discovered this problem when enabling CFI flash on vexpress64.
> cword.l was an unsigned long int, but it was intended to be 32 bits wide.
> Unfortunately, it's 64-bits wide on a 64-bit system, meaning that a
> 64-bit system fails when attempting to use 32-bit wide CFI flash parts.
>
> Similar problems also existed with the other cword sizes.
>
> Signed-off-by: Ryan Harkin <ryan.harkin at linaro.org>

Very nice patch.

Reviewed-by: Linus Walleij <linus.walleij at linaro.org>

Yours,
Linus Walleij


More information about the U-Boot mailing list