[PATCH] nor: don't use sector for ERASE_START

Wolfram Sang w.sang at pengutronix.de
Mon Jun 28 00:21:37 EDT 2010


Similar to ac2d4d71ba493fd638ae0bf1a530a51c76d3c53d, copy the behaviour
from Linux which does:

cfi_send_gen_cmd(0x80, cfi->addr_unlock1, chip->start, map, cfi, cfi->device_type, NULL);

Notice the third parameter which is simply chip->start. Needed for some
SST-flashes.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
---
 drivers/nor/cfi_flash_amd.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/nor/cfi_flash_amd.c b/drivers/nor/cfi_flash_amd.c
index 411d8e6..ea4c2c9 100644
--- a/drivers/nor/cfi_flash_amd.c
+++ b/drivers/nor/cfi_flash_amd.c
@@ -74,8 +74,7 @@ static int amd_flash_is_busy (flash_info_t * info, flash_sect_t sect)
 static int amd_flash_erase_one (flash_info_t * info, long sect)
 {
 	flash_unlock_seq(info);
-	flash_write_cmd (info, sect, AMD_ADDR_ERASE_START,
-				AMD_CMD_ERASE_START);
+	flash_write_cmd (info, 0, AMD_ADDR_ERASE_START, AMD_CMD_ERASE_START);
 	flash_unlock_seq(info);
 	flash_write_cmd (info, sect, 0, AMD_CMD_ERASE_SECTOR);
 
-- 
1.7.1




More information about the barebox mailing list