* [U-Boot] [PATCH] Add some second source legacy flash chips 256x8
@ 2009-07-21 19:47 Niklaus Giger
2009-08-26 20:10 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Niklaus Giger @ 2009-07-21 19:47 UTC (permalink / raw)
To: u-boot
Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
---
We tested some boot flashes as possible second source.
As some had ids above 0x7f, we had to implement JEDEC JEP106Z in cfi_flash.c.
I now that I just missed the merge window, but the patches are not urgent
and I was away for a three week
drivers/mtd/cfi_flash.c | 16 +++++++++--
drivers/mtd/jedec_flash.c | 67 +++++++++++++++++++++++++++++++++++++++++++++
include/flash.h | 10 ++++++-
3 files changed, 89 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 81ac5d3..4cd0116 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -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,21 @@ static int cmdset_intel_init(flash_info_t *info, struct cfi_qry *qry)
static void cmdset_amd_read_jedec_ids(flash_info_t *info)
{
- flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
+ 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:
diff --git a/drivers/mtd/jedec_flash.c b/drivers/mtd/jedec_flash.c
index e48acec..488bbec 100644
--- a/drivers/mtd/jedec_flash.c
+++ b/drivers/mtd/jedec_flash.c
@@ -68,6 +68,17 @@
#define SST39SF010A 0x00B5
#define SST39SF020A 0x00B6
+/* MXIC */
+#define MX29LV040 0x004F
+
+/* WINBOND */
+#define W39L040A 0x00D6
+
+/* AMIC */
+#define A29L040 0x0092
+
+/* EON */
+#define EN29LV040A 0x004F
/*
* Unlock address sets for AMD command sets.
@@ -225,6 +236,62 @@ static const struct amd_flash_info jedec_table[] = {
ERASEINFO(0x10000,8),
}
},
+ {
+ .mfr_id = (u16)MX_MANUFACT,
+ .dev_id = MX29LV040,
+ .name = "MXIC MX29LV040",
+ .uaddr = {
+ [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
+ {
+ .mfr_id = (u16)WINB_MANUFACT,
+ .dev_id = W39L040A,
+ .name = "WINBOND W39L040A",
+ .uaddr = {
+ [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
+ {
+ .mfr_id = (u16)AMIC_MANUFACT,
+ .dev_id = A29L040,
+ .name = "AMIC A29L040",
+ .uaddr = {
+ [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
+ {
+ .mfr_id = (u16)EON_MANUFACT,
+ .dev_id = EN29LV040A,
+ .name = "EON EN29LV040A",
+ .uaddr = {
+ [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
#endif
#ifdef CONFIG_SYS_FLASH_LEGACY_512Kx16
{
diff --git a/include/flash.h b/include/flash.h
index b016162..8feca1b 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -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) */
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Add some second source legacy flash chips 256x8
@ 2009-07-22 6:41 Niklaus Giger
2009-07-22 7:02 ` Wolfgang Denk
2009-07-22 8:01 ` Stefan Roese
0 siblings, 2 replies; 6+ messages in thread
From: Niklaus Giger @ 2009-07-22 6:41 UTC (permalink / raw)
To: u-boot
Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
---
We tested some boot flashes as possible second source.
As some had ids above 0x7f, we had to implement JEDEC JEP106Z in cfi_flash.c.
I now that I just missed the merge window, but the patches are not urgent
and I was away for a three week
drivers/mtd/cfi_flash.c | 16 +++++++++--
drivers/mtd/jedec_flash.c | 67 +++++++++++++++++++++++++++++++++++++++++++++
include/flash.h | 10 ++++++-
3 files changed, 89 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 81ac5d3..4cd0116 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -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,21 @@ static int cmdset_intel_init(flash_info_t *info, struct cfi_qry *qry)
static void cmdset_amd_read_jedec_ids(flash_info_t *info)
{
- flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
+ 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:
diff --git a/drivers/mtd/jedec_flash.c b/drivers/mtd/jedec_flash.c
index e48acec..488bbec 100644
--- a/drivers/mtd/jedec_flash.c
+++ b/drivers/mtd/jedec_flash.c
@@ -68,6 +68,17 @@
#define SST39SF010A 0x00B5
#define SST39SF020A 0x00B6
+/* MXIC */
+#define MX29LV040 0x004F
+
+/* WINBOND */
+#define W39L040A 0x00D6
+
+/* AMIC */
+#define A29L040 0x0092
+
+/* EON */
+#define EN29LV040A 0x004F
/*
* Unlock address sets for AMD command sets.
@@ -225,6 +236,62 @@ static const struct amd_flash_info jedec_table[] = {
ERASEINFO(0x10000,8),
}
},
+ {
+ .mfr_id = (u16)MX_MANUFACT,
+ .dev_id = MX29LV040,
+ .name = "MXIC MX29LV040",
+ .uaddr = {
+ [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
+ {
+ .mfr_id = (u16)WINB_MANUFACT,
+ .dev_id = W39L040A,
+ .name = "WINBOND W39L040A",
+ .uaddr = {
+ [0] = MTD_UADDR_0x5555_0x2AAA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
+ {
+ .mfr_id = (u16)AMIC_MANUFACT,
+ .dev_id = A29L040,
+ .name = "AMIC A29L040",
+ .uaddr = {
+ [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
+ {
+ .mfr_id = (u16)EON_MANUFACT,
+ .dev_id = EN29LV040A,
+ .name = "EON EN29LV040A",
+ .uaddr = {
+ [0] = MTD_UADDR_0x0555_0x02AA /* x8 */
+ },
+ .DevSize = SIZE_512KiB,
+ .CmdSet = P_ID_AMD_STD,
+ .NumEraseRegions= 1,
+ .regions = {
+ ERASEINFO(0x10000,8),
+ }
+ },
#endif
#ifdef CONFIG_SYS_FLASH_LEGACY_512Kx16
{
diff --git a/include/flash.h b/include/flash.h
index b016162..8feca1b 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -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) */
--
1.6.3.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Add some second source legacy flash chips 256x8
2009-07-22 6:41 Niklaus Giger
@ 2009-07-22 7:02 ` Wolfgang Denk
2009-07-22 8:01 ` Stefan Roese
1 sibling, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2009-07-22 7:02 UTC (permalink / raw)
To: u-boot
Dear Niklaus Giger,
In message <1248244909-7085-1-git-send-email-niklaus.giger@member.fsf.org> you wrote:
> Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
> ---
>
> We tested some boot flashes as possible second source.
> As some had ids above 0x7f, we had to implement JEDEC JEP106Z in cfi_flash.c.
Please provide at least this statement as part of the commit message.
> I now that I just missed the merge window, but the patches are not urgent
> and I was away for a three week
Stefan is probably willin gto consider this as a bug fix (at least I
would not reprimand him if he did :-)
> static void cmdset_amd_read_jedec_ids(flash_info_t *info)
> {
> - flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
> + ushort bankId = 0;
> + uchar manuId;
> +
> + flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
Please use TAB for indentation.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Use C++ to confuse your enemies; use C to produce stable code.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Add some second source legacy flash chips 256x8
2009-07-22 6:41 Niklaus Giger
2009-07-22 7:02 ` Wolfgang Denk
@ 2009-07-22 8:01 ` Stefan Roese
1 sibling, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2009-07-22 8:01 UTC (permalink / raw)
To: u-boot
On Wednesday 22 July 2009 08:41:49 Niklaus Giger wrote:
> Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
Apart from Wolfgang's comments, please find some minor coding style comments
below.
> We tested some boot flashes as possible second source.
> As some had ids above 0x7f, we had to implement JEDEC JEP106Z in
> cfi_flash.c. I now that I just missed the merge window, but the patches are
> not urgent and I was away for a three week
>
> drivers/mtd/cfi_flash.c | 16 +++++++++--
> drivers/mtd/jedec_flash.c | 67
> +++++++++++++++++++++++++++++++++++++++++++++ include/flash.h |
> 10 ++++++-
> 3 files changed, 89 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
> index 81ac5d3..4cd0116 100644
> --- a/drivers/mtd/cfi_flash.c
> +++ b/drivers/mtd/cfi_flash.c
> @@ -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,21 @@ static int cmdset_intel_init(flash_info_t *info,
> struct cfi_qry *qry)
>
> static void cmdset_amd_read_jedec_ids(flash_info_t *info)
> {
> - flash_write_cmd(info, 0, 0, AMD_CMD_RESET);
> + 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) {
Space before "(".
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@denx.de
=====================================================================
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Add some second source legacy flash chips 256x8
2009-07-21 19:47 [U-Boot] [PATCH] Add some second source legacy flash chips 256x8 Niklaus Giger
@ 2009-08-26 20:10 ` Wolfgang Denk
2009-08-27 4:54 ` Stefan Roese
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2009-08-26 20:10 UTC (permalink / raw)
To: u-boot
Dear Stefan,
In message <1248205624-17062-1-git-send-email-niklaus.giger@member.fsf.org> Niklaus Giger wrote:
> Signed-off-by: Niklaus Giger <niklaus.giger@member.fsf.org>
> ---
>
> We tested some boot flashes as possible second source.
> As some had ids above 0x7f, we had to implement JEDEC JEP106Z in cfi_flash.c.
> I now that I just missed the merge window, but the patches are not urgent
> and I was away for a three week
>
> drivers/mtd/cfi_flash.c | 16 +++++++++--
> drivers/mtd/jedec_flash.c | 67 +++++++++++++++++++++++++++++++++++++++++++++
> include/flash.h | 10 ++++++-
> 3 files changed, 89 insertions(+), 4 deletions(-)
Any chance to pick this up for "next"?
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Ever try. Ever fail. No matter. Try again. Fail again. Fail better.
-- S. Beckett
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot] [PATCH] Add some second source legacy flash chips 256x8
2009-08-26 20:10 ` Wolfgang Denk
@ 2009-08-27 4:54 ` Stefan Roese
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Roese @ 2009-08-27 4:54 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
On Wednesday 26 August 2009 22:10:42 Wolfgang Denk wrote:
> > We tested some boot flashes as possible second source.
> > As some had ids above 0x7f, we had to implement JEDEC JEP106Z in
> > cfi_flash.c. I now that I just missed the merge window, but the patches
> > are not urgent and I was away for a three week
> >
> > drivers/mtd/cfi_flash.c | 16 +++++++++--
> > drivers/mtd/jedec_flash.c | 67
> > +++++++++++++++++++++++++++++++++++++++++++++ include/flash.h |
> > 10 ++++++-
> > 3 files changed, 89 insertions(+), 4 deletions(-)
>
> Any chance to pick this up for "next"?
This patch was superseded by this one:
Support up to 7 banks for ids as specified in JEDEC JEP106Z
which you pulled into next just last night.
Cheers,
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-08-27 4:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-21 19:47 [U-Boot] [PATCH] Add some second source legacy flash chips 256x8 Niklaus Giger
2009-08-26 20:10 ` Wolfgang Denk
2009-08-27 4:54 ` Stefan Roese
-- strict thread matches above, loose matches on Subject: below --
2009-07-22 6:41 Niklaus Giger
2009-07-22 7:02 ` Wolfgang Denk
2009-07-22 8:01 ` Stefan Roese
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox