]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
cfi_flash: Use flash_read32() in sector_erased()
authorStefan Roese <sr@denx.de>
Mon, 25 Oct 2010 16:31:39 +0000 (18:31 +0200)
committerStefan Roese <sr@denx.de>
Fri, 17 Dec 2010 08:54:10 +0000 (09:54 +0100)
The function sector_erased() is modified to not use pointer
access, but to use the correct accessor functions. This fixes a
problem on the t3corp board with the Xilinx DS617 flash chips. Here
a board specific accessor function is needed to read from flash
in 32bit mode. This patch enables such an operation mode.

Signed-off-by: Stefan Roese <sr@denx.de>
drivers/mtd/cfi_flash.c

index 643cd877314e96837ad5e7c86c43b9b9688ee890..785975380771d79754b8e79f5c703a8ff2321c1a 100644 (file)
@@ -1112,18 +1112,18 @@ static int sector_erased(flash_info_t *info, int i)
 {
        int k;
        int size;
-       volatile unsigned long *flash;
+       u32 *flash;
 
        /*
         * Check if whole sector is erased
         */
        size = flash_sector_size(info, i);
-       flash = (volatile unsigned long *) info->start[i];
+       flash = (u32 *)info->start[i];
        /* divide by 4 for longword access */
        size = size >> 2;
 
        for (k = 0; k < size; k++) {
-               if (*flash++ != 0xffffffff)
+               if (flash_read32(flash++) != 0xffffffff)
                        return 0;       /* not erased */
        }