summaryrefslogtreecommitdiff
path: root/drivers/mtd/cfi_flash.c
diff options
context:
space:
mode:
authorHeiko Schocher <hs@denx.de>2011-04-11 14:16:19 +0200
committerStefan Roese <sr@denx.de>2011-04-21 15:51:39 +0200
commit5b448adb4b2f3244419de6409949a730771f8b21 (patch)
treea8d5ee5dc0c96a7dc58964086fbbee006e989422 /drivers/mtd/cfi_flash.c
parent6a011ce851a0ba23ad50f9bac06dc323a863d0c5 (diff)
downloadu-boot-imx-5b448adb4b2f3244419de6409949a730771f8b21.zip
u-boot-imx-5b448adb4b2f3244419de6409949a730771f8b21.tar.gz
u-boot-imx-5b448adb4b2f3244419de6409949a730771f8b21.tar.bz2
mtd, cfi: read AMD 3-byte (expanded) device ids on 16bit devices
tested on the a4m072 board with a S29GL512P flash. flinfo without this patch Bank # 1: CFI conformant flash (16 x 16) Size: 32 MB in 256 Sectors AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E Erase timeout: 16384 ms, write timeout: 2 ms Buffer write timeout: 5 ms, buffer size: 32 bytes [...] flinfo with this patch Bank # 1: CFI conformant flash (16 x 16) Size: 32 MB in 256 Sectors AMD Standard command set, Manufacturer ID: 0x01, Device ID: 0x227E2301 Erase timeout: 16384 ms, write timeout: 2 ms Buffer write timeout: 5 ms, buffer size: 32 bytes [...] Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/mtd/cfi_flash.c')
-rw-r--r--drivers/mtd/cfi_flash.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index b1110a1..aa76f6c 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -1202,8 +1202,9 @@ void flash_print_info (flash_info_t * info)
info->manufacturer_id);
printf (info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X",
info->device_id);
- if (info->device_id == 0x7E) {
- printf("%04X", info->device_id2);
+ if ((info->device_id & 0xff) == 0x7E) {
+ printf(info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X",
+ info->device_id2);
}
printf ("\n Erase timeout: %ld ms, write timeout: %ld ms\n",
info->erase_blk_tout,
@@ -1599,6 +1600,14 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
case FLASH_CFI_16BIT:
info->device_id = flash_read_word (info,
FLASH_OFFSET_DEVICE_ID);
+ if ((info->device_id & 0xff) == 0x7E) {
+ /* AMD 3-byte (expanded) device ids */
+ info->device_id2 = flash_read_uchar (info,
+ FLASH_OFFSET_DEVICE_ID2);
+ info->device_id2 <<= 8;
+ info->device_id2 |= flash_read_uchar (info,
+ FLASH_OFFSET_DEVICE_ID3);
+ }
break;
default:
break;