Support up to 7 banks for ids as specified in JEDEC JEP106Z. see http://www.jedec.org/download/search/jep106Z.pdf Add some second source legacy flash chips 256x8.
PATCH 1/1 Support up to 7 banks for ids as specified in JEDEC JEP106Z. see http://www.jedec.org/download/search/jep106Z.pdf Add some second source legacy flash chips 256x8.
--- drivers/mtd/cfi_flash.c | 15 +++++++++- drivers/mtd/jedec_flash.c | 67 +++++++++++++++++++++++++++++++++++++++++++++ include/flash.h | 10 ++++++- 3 files changed, 89 insertions(+), 3 deletions(-)
drivers/mtd/cfi_flash.c +13 -2
@@ -106,6 +106,8 @@#define ATM_CMD_SOFTLOCK_START 0x80#define ATM_CMD_LOCK_SECT 0x40 +#define FLASH_CONTINUATION_CODE 0x7F +#define FLASH_OFFSET_MANUFACTURER_ID 0x00#define FLASH_OFFSET_DEVICE_ID 0x01#define FLASH_OFFSET_DEVICE_ID2 0x0E
@@ -1541,13 +1543,22 @@ static int cmdset_intel_init(flash_info_t *info, struct cfi_qry *qry)static void cmdset_amd_read_jedec_ids (flash_info_t *info) { +ushort bankId =0 ; +uchar manuId; +flash_write_cmd (info,0 ,0 ,AMD_CMD_RESET );flash_unlock_seq (info,0 );flash_write_cmd (info,0 , info->addr_unlock1,FLASH_CMD_READ_ID );udelay (1000 );/* some flash are slow to respond */ - info->manufacturer_id =flash_read_uchar (info, -FLASH_OFFSET_MANUFACTURER_ID ); + manuId =flash_read_uchar (info,FLASH_OFFSET_MANUFACTURER_ID ); +/* JEDEC JEP106Z specifies ID codes up to bank 7 */ +while (manuId ==FLASH_CONTINUATION_CODE && bankId <0x800 ) { + bankId +=0x100 ; + manuId =flash_read_uchar (info, + bankId |FLASH_OFFSET_MANUFACTURER_ID ); + } + info->manufacturer_id = manuId;switch (info->chipwidth){case FLASH_CFI_8BIT :
drivers/mtd/jedec_flash.c +67 -0
79 lines not on this page · raw message
include/flash.h +9 -1
@@ -46,7 +46,7 @@ typedef struct {ushort cmd_reset;/* vendor specific reset command */ ushort interface;/* used for x8/x16 adjustments */ ushort legacy_unlock;/* support Intel legacy (un)locking */ -uchar manufacturer_id;/* manufacturer id */ +ushort manufacturer_id;/* manufacturer id */ ushort device_id;/* device id */ ushort device_id2;/* extended device id */ ushort ext_addr;/* extended query table address */
@@ -154,6 +154,7 @@ extern flash_info_t *flash_get_info(ulong base);* Device IDs */ +/* Manufacturers inside bank 0 have ids like 0x00xx00xx */ #define AMD_MANUFACT 0x00010001/* AMD manuf. ID in D23..D16, D7..D0 */ #define FUJ_MANUFACT 0x00040004/* FUJITSU manuf. ID in D23..D16, D7..D0 */ #define ATM_MANUFACT 0x001F001F/* ATMEL */
@@ -166,6 +167,13 @@ extern flash_info_t *flash_get_info(ulong base);#define TOSH_MANUFACT 0x00980098/* TOSHIBA manuf. ID in D23..D16, D7..D0 */ #define MT2_MANUFACT 0x002C002C/* alternate MICRON manufacturer ID*/ #define EXCEL_MANUFACT 0x004A004A/* Excel Semiconductor */ +#define AMIC_MANUFACT 0x00370037/* AMIC manuf. ID in D23..D16, D7..D0 */ +#define WINB_MANUFACT 0x00DA00DA/* Winbond manuf. ID in D23..D16, D7..D0 */ + +/* Manufacturers inside bank 1 have ids like 0x01xx01xx */ +#define EON_MANUFACT 0x011C011C/* EON manuf. ID in D23..D16, D7..D0 */ + +/* Manufacturers inside bank 2 have ids like 0x02xx02xx */ /* Micron Technologies (INTEL compat.) */ #define MT_ID_28F400_T 0x44704470/* 28F400B3 ID ( 4 M, top boot sector) */
Signature · 1 line
1.6.3.3
PATCH 1/1 Support up to 7 banks for ids as specified in JEDEC JEP106Z. see http://www.jedec.org/download/search/jep106Z.pdf Add some second source legacy flash chips 256x8.
Hi Niklaus,
now you've got a very looong subject. Please split this into a shorter subject and put the rest in the commit text.
Thanks.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================