summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/cfi_flash.c
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2010-10-25 18:31:39 +0200
committerStefan Roese <sr@denx.de>2010-12-17 09:54:10 +0100
commit4d2ca9d6a0452edeaf5922cbae3b939974114214 (patch)
treefa45d26843bcbe13769af9493707f6f3820efe68 /drivers/mtd/cfi_flash.c
parentdf4e813b72bf07d9026b00455f5e7dffd694ae48 (diff)
downloadblackbird-obmc-uboot-4d2ca9d6a0452edeaf5922cbae3b939974114214.tar.gz
blackbird-obmc-uboot-4d2ca9d6a0452edeaf5922cbae3b939974114214.zip
cfi_flash: Use flash_read32() in sector_erased()
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>
Diffstat (limited to 'drivers/mtd/cfi_flash.c')
-rw-r--r--drivers/mtd/cfi_flash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 643cd87731..7859753807 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -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 */
}
OpenPOWER on IntegriCloud