]> git.sur5r.net Git - u-boot/commitdiff
flash: Fix CFI buffer size bug
authorJohn Schmoller <jschmoller@xes-inc.com>
Wed, 12 Aug 2009 15:55:47 +0000 (10:55 -0500)
committerStefan Roese <sr@denx.de>
Thu, 13 Aug 2009 07:28:20 +0000 (09:28 +0200)
Fix bug introduced by 9c048b523413ae5f3ff34e00cf57569c3368ab51.

The cfi_flash.c driver cast the flash buffer size to a uchar in
flash_write_cfibuffer(). On some flash parts, (tested on Numonyx
part PC32F512M29EWH), the buffer size is 1KB. Remove the cast to
uchar to enable buffer sizes to be larger.

Signed-off-by: John Schmoller <jschmoller@xes-inc.com>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_flash.c

index 81ac5d318a108b28150c14d8f2b56d3ae914bb54..3ca73e3caef1bb5710d4abb467980e8dc9419438 100644 (file)
@@ -1001,7 +1001,7 @@ static int flash_write_cfibuffer (flash_info_t * info, ulong dest, uchar * cp,
 #endif
                flash_write_cmd(info, sector, offset, AMD_CMD_WRITE_TO_BUFFER);
                cnt = len >> shift;
-               flash_write_cmd(info, sector, offset, (uchar)cnt - 1);
+               flash_write_cmd(info, sector, offset, cnt - 1);
 
                switch (info->portwidth) {
                case FLASH_CFI_8BIT: