summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-11-27 00:59:39 +0800
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2010-12-03 01:53:14 +0800
commit0df2a8d2632715b3fa4d27a632c2527d99904180 (patch)
treeb346ddcf84098b9f494fad9e60215b2a9cb0e178
parent04191aa0fc14eb01a750641343e5e0b98d7725c6 (diff)
downloadbarebox-0df2a8d2632715b3fa4d27a632c2527d99904180.tar.gz
barebox-0df2a8d2632715b3fa4d27a632c2527d99904180.tar.xz
cfi_flash: move reset command assigment to specific chipset init function
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
-rw-r--r--drivers/nor/cfi_flash.c2
-rw-r--r--drivers/nor/cfi_flash_amd.c5
-rw-r--r--drivers/nor/cfi_flash_intel.c5
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index a7df3b4f4d..6d22a531b4 100644
--- a/drivers/nor/cfi_flash.c
+++ b/drivers/nor/cfi_flash.c
@@ -372,7 +372,6 @@ static ulong flash_get_size (struct flash_info *info, ulong base)
case CFI_CMDSET_INTEL_STANDARD:
case CFI_CMDSET_INTEL_EXTENDED:
default:
- info->cmd_reset = FLASH_CMD_RESET;
#ifdef CFG_FLASH_PROTECTION
/* read legacy lock/unlock bit from intel flash */
if (info->ext_addr) {
@@ -383,7 +382,6 @@ static ulong flash_get_size (struct flash_info *info, ulong base)
break;
case CFI_CMDSET_AMD_STANDARD:
case CFI_CMDSET_AMD_EXTENDED:
- info->cmd_reset = AMD_CMD_RESET;
/* check if flash geometry needs reversal */
if (num_erase_regions <= 1)
break;
diff --git a/drivers/nor/cfi_flash_amd.c b/drivers/nor/cfi_flash_amd.c
index 738389cce5..f2257571fa 100644
--- a/drivers/nor/cfi_flash_amd.c
+++ b/drivers/nor/cfi_flash_amd.c
@@ -16,6 +16,7 @@ static void flash_unlock_seq (struct flash_info *info)
*/
static void amd_read_jedec_ids (struct flash_info *info)
{
+ info->cmd_reset = AMD_CMD_RESET;
info->manufacturer_id = 0;
info->device_id = 0;
info->device_id2 = 0;
@@ -38,7 +39,7 @@ static void amd_read_jedec_ids (struct flash_info *info)
info->addr_unlock2 = 0x555;
}
- flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
+ flash_write_cmd(info, 0, 0, info->cmd_reset);
flash_unlock_seq(info);
flash_write_cmd(info, 0, info->addr_unlock1, FLASH_CMD_READ_ID);
udelay(1000); /* some flash are slow to respond */
@@ -54,7 +55,7 @@ static void amd_read_jedec_ids (struct flash_info *info)
info->device_id2 |= flash_read_uchar (info,
FLASH_OFFSET_DEVICE_ID3);
}
- flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
+ flash_write_cmd(info, 0, 0, info->cmd_reset);
}
static int flash_toggle (struct flash_info *info, flash_sect_t sect, uint offset, uchar cmd)
diff --git a/drivers/nor/cfi_flash_intel.c b/drivers/nor/cfi_flash_intel.c
index f28301d699..8e8a820600 100644
--- a/drivers/nor/cfi_flash_intel.c
+++ b/drivers/nor/cfi_flash_intel.c
@@ -9,18 +9,19 @@
*/
static void intel_read_jedec_ids (struct flash_info *info)
{
+ info->cmd_reset = FLASH_CMD_RESET;
info->manufacturer_id = 0;
info->device_id = 0;
info->device_id2 = 0;
- flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
+ flash_write_cmd(info, 0, 0, info->cmd_reset);
flash_write_cmd(info, 0, 0, FLASH_CMD_READ_ID);
udelay(1000); /* some flash are slow to respond */
info->manufacturer_id = jedec_read_mfr(info);
info->device_id = flash_read_uchar (info,
FLASH_OFFSET_DEVICE_ID);
- flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
+ flash_write_cmd(info, 0, 0, info->cmd_reset);
}
/*