[PATCH 10/12] cfi_flash: move reset command assigment to specific chipset init function

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Nov 26 14:52:39 EST 2010


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/nor/cfi_flash.c       |    2 --
 drivers/nor/cfi_flash_amd.c   |    5 +++--
 drivers/nor/cfi_flash_intel.c |    5 +++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index a7df3b4..6d22a53 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 738389c..f225757 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 f28301d..8e8a820 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);
 }
 
 /*
-- 
1.7.1




More information about the barebox mailing list