cfi_flash: use specific width types for cword
authorRyan Harkin <ryan.harkin@linaro.org>
Fri, 23 Oct 2015 15:50:51 +0000 (16:50 +0100)
committerStefan Roese <sr@denx.de>
Tue, 27 Oct 2015 10:51:53 +0000 (11:51 +0100)
commit622b95274e4d699f3c713c325e958565312625ad
tree28ec0682890f858c4d434b166a70ca04f67bf4eb
parent677f970bc62a661690b3431543d5a5d5e682ba70
cfi_flash: use specific width types for cword

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@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_flash.c
include/mtd/cfi_flash.h