summaryrefslogtreecommitdiff
path: root/drivers/mtd/cfi_flash.c
diff options
context:
space:
mode:
authorPhilippe De Muyter <phdm@macqel.be>2010-08-10 16:54:52 +0200
committerStefan Roese <sr@denx.de>2010-08-18 09:09:00 +0200
commitd77c7ac47e4ea750cc13c2f0ecc037ab7afa7964 (patch)
tree71aa440303d0c56e5cc7d0cc8fe57e242b579026 /drivers/mtd/cfi_flash.c
parent2e97394a6d07a36dfc139b7b98b12e452b5bd8dc (diff)
downloadu-boot-imx-d77c7ac47e4ea750cc13c2f0ecc037ab7afa7964.zip
u-boot-imx-d77c7ac47e4ea750cc13c2f0ecc037ab7afa7964.tar.gz
u-boot-imx-d77c7ac47e4ea750cc13c2f0ecc037ab7afa7964.tar.bz2
Fix printing & reading of 16-bit CFI device identifiers
Fix reading and printing of CFI flashes 16-bit devices identifiers Nowadays CFI flashes have a 16-bit device identifier. U-boot still print them and read them as if they were only 8-bit wide. Fix that. Before: Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x1B After: Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x881B Signed-off-by: Philippe De Muyter <phdm@macqel.be> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/mtd/cfi_flash.c')
-rw-r--r--drivers/mtd/cfi_flash.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 1c73686..2157c02 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1142,8 +1142,10 @@ void flash_print_info (flash_info_t * info)
printf ("Unknown (%d)", info->vendor);
break;
}
- printf (" command set, Manufacturer ID: 0x%02X, Device ID: 0x%02X",
- info->manufacturer_id, info->device_id);
+ printf (" command set, Manufacturer ID: 0x%02X, Device ID: 0x",
+ info->manufacturer_id);
+ printf (info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X",
+ info->device_id);
if (info->device_id == 0x7E) {
printf("%04X", info->device_id2);
}
@@ -1479,8 +1481,9 @@ static void cmdset_intel_read_jedec_ids(flash_info_t *info)
udelay(1000); /* some flash are slow to respond */
info->manufacturer_id = flash_read_uchar (info,
FLASH_OFFSET_MANUFACTURER_ID);
- info->device_id = flash_read_uchar (info,
- FLASH_OFFSET_DEVICE_ID);
+ info->device_id = (info->chipwidth == FLASH_CFI_16BIT) ?
+ flash_read_word (info, FLASH_OFFSET_DEVICE_ID) :
+ flash_read_uchar (info, FLASH_OFFSET_DEVICE_ID);
flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
}