Skip to content
Snippets Groups Projects
Commit d77c7ac4 authored by Philippe De Muyter's avatar Philippe De Muyter Committed by Stefan Roese
Browse files

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: default avatarPhilippe De Muyter <phdm@macqel.be>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent 2e97394a
Branches
Tags
No related merge requests found
...@@ -1142,8 +1142,10 @@ void flash_print_info (flash_info_t * info) ...@@ -1142,8 +1142,10 @@ void flash_print_info (flash_info_t * info)
printf ("Unknown (%d)", info->vendor); printf ("Unknown (%d)", info->vendor);
break; break;
} }
printf (" command set, Manufacturer ID: 0x%02X, Device ID: 0x%02X", printf (" command set, Manufacturer ID: 0x%02X, Device ID: 0x",
info->manufacturer_id, info->device_id); info->manufacturer_id);
printf (info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X",
info->device_id);
if (info->device_id == 0x7E) { if (info->device_id == 0x7E) {
printf("%04X", info->device_id2); printf("%04X", info->device_id2);
} }
...@@ -1479,8 +1481,9 @@ static void cmdset_intel_read_jedec_ids(flash_info_t *info) ...@@ -1479,8 +1481,9 @@ static void cmdset_intel_read_jedec_ids(flash_info_t *info)
udelay(1000); /* some flash are slow to respond */ udelay(1000); /* some flash are slow to respond */
info->manufacturer_id = flash_read_uchar (info, info->manufacturer_id = flash_read_uchar (info,
FLASH_OFFSET_MANUFACTURER_ID); FLASH_OFFSET_MANUFACTURER_ID);
info->device_id = flash_read_uchar (info, info->device_id = (info->chipwidth == FLASH_CFI_16BIT) ?
FLASH_OFFSET_DEVICE_ID); 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); flash_write_cmd(info, 0, 0, FLASH_CMD_RESET);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment