ARM Versatile PB926EJ-S, Rev.D: Added support for flash 28F256L30B
PATCH 1/1 ARM Versatile PB926EJ-S, Rev.D: Added support for flash 28F256L30B
Current u-boot works with ARM Versatile PB926EJ-S, HW- Rev.C (NOR flash 28F256K3).
This patch adds support for 28F256L30B (asymmetrical sectors:
4 small sectors at bottom) used on HW-Rev.D.
--- board/versatile/flash.c | 84 +++++++++++++++++++++++++++++++++++-------- include/configs/versatile.h | 2 +- include/flash.h | 10 ++++-- 3 files changed, 77 insertions(+), 19 deletions(-)
board/versatile/flash.c +0 -1
@@ -31,7 +31,9 @@#include <common.h> #include <linux/byteorder/swab.h> -#define PHYS_FLASH_SECT_SIZE 0x00020000/* 256 KB sectors (x2)
*/
+#define PHYS_FLASH_SECT_SIZE 0x00020000 /* *2 = 256 KB
sectors */
+#define PHYS_FLASH_MAIN_SECT_SIZE 0x00020000 /* *2 = 256 KB
sectors */
+#define PHYS_FLASH_PARAM_SECT_SIZE 0x00008000 /* *2 = 64 KB
sectors */
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips
*/
/* Board support for 1 or 2 flash devices */
@@ -62,10 +64,19 @@ typedef struct OrgDef {
/* Flash Organizations */
-OrgDef OrgIntel_28F256K3[] = {
+OrgDef OrgIntel_28F256K3[] = { /* for Hw-Rev. C */
{256, 128 * 1024}, /* 256 * 128kBytes sectors */
};
+OrgDef OrgIntel_28F256L18T[] = {
+ {255, 128 * 1024}, /* 255 * 128kBytes sectors */
+ { 4, 32 * 1024}, /* 4 * 32kBytes sectors */
+};
+
+OrgDef OrgIntel_28F256L30B[] = { /* for Hw-Rev. D */
+ { 4, 32 * 1024}, /* 4 * 32kBytes sectors */
+ {255, 128 * 1024}, /* 255 * 128kBytes sectors */
+};
/*---------------------------------------------------------------------- -
* Functions
@@ -132,23 +143,55 @@ static void flash_get_offsets (ulong base, flash_info_t * info)
int i;
OrgDef *pOrgDef;
- pOrgDef = OrgIntel_28F256K3;
- if (info->flash_id == FLASH_UNKNOWN) {
+ switch (info->flash_id & FLASH_VENDMASK) {
+ case FLASH_MAN_INTEL:
+ break;
+ default:
return;
}
- if ((info->flash_id & FLASH_VENDMASK) == FLASH_MAN_INTEL) {
+ switch (info->flash_id & FLASH_TYPEMASK) {
+ case FLASH_28F256K3:
+ pOrgDef = OrgIntel_28F256K3;
for (i = 0; i < info->sector_count; i++) {
+ info->start[i] = base + (i *PHYS_FLASH_SECT_SIZE);
+ info->protect[i] = 0;
+ }
+ break;
+ case FLASH_28F256L18T:
+ pOrgDef = OrgIntel_28F256L18T;
+ for (i = 0; i < info->sector_count; i++) {
+ /* top param block type */
if (i > 255) {
- info->start[i] = base + (i * 0x8000);
- info->protect[i] = 0;
+ info->start[i] = base +
+ (255 *PHYS_FLASH_MAIN_SECT_SIZE) +
+ ((i -255)*PHYS_FLASH_PARAM_SECT_SIZE);
+ } else {
+ info->start[i] = base +
+ (i *PHYS_FLASH_MAIN_SECT_SIZE);
+ }
+ info->protect[i] = 0;
+ }
+ break;
+ case FLASH_28F256L30B:
+ pOrgDef = OrgIntel_28F256L30B;
+ for (i = 0; i < info->sector_count; i++) {
+ /* bottom param block type */
+ if (i < 4) {
+ info->start[i] = base +
+ (i *PHYS_FLASH_PARAM_SECT_SIZE);
} else {
info->start[i] = base +
- (i *PHYS_FLASH_SECT_SIZE);
- info->protect[i] = 0;
+ ((i - 3) *PHYS_FLASH_MAIN_SECT_SIZE);
}
+ info->protect[i] = 0;
}
+ break;
+ default:
+ return;
}
+
+ return;
}
/*---------------------------------------------------------------------- -
@@ -172,11 +215,14 @@ void flash_print_info (flash_info_t * info)
}
switch (info->flash_id & FLASH_TYPEMASK) {
+ case FLASH_28F256K3:
+ printf ("FLASH 28F256K3\n");
+ break;
case FLASH_28F256L18T:
printf ("FLASH 28F256L18T\n"); break;
- case FLASH_28F256K3:
- printf ("FLASH 28F256K3\n");
+ case FLASH_28F256L30B:
+ printf ("FLASH 28F256L30B\n");
break;
default:
printf ("Unknown Chip Type\n");
@@ -221,6 +267,7 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info)
info->flash_id = FLASH_UNKNOWN; info->sector_count = 0;
info->size = 0;
+ printf ("Unknown flash vendor %0x\n", value);
addr[0] = (FPW) 0x00FF00FF; /* restore read mode */
return (0); /* no or unknown flash */
}
@@ -229,20 +276,27 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info)
value = addr[1]; /* device ID */
switch (value) {
+ case (FPW)(INTEL_ID_28F256K3):
+ info->flash_id += FLASH_28F256K3;
+ info->sector_count = 256;
+ info->size = 0x02000000;
+ break;
+
case (FPW) (INTEL_ID_28F256L18T):
info->flash_id += FLASH_28F256L18T; info->sector_count = 259; info->size = 0x02000000;
break; /* => 32 MB */
- case (FPW)(INTEL_ID_28F256K3):
- info->flash_id += FLASH_28F256K3;
- info->sector_count = 256;
- info->size = 0x02000000;
+ case (FPW)(INTEL_ID_28F256L30B):
+ info->flash_id += FLASH_28F256L30B;
+ info->sector_count = 259;
+ info->size = 0x02000000; /* 32 MB */
break;
default:
info->flash_id = FLASH_UNKNOWN;
+ printf ("Unknown chip type %0x\n", value);
break;
}
include/configs/versatile.h +0 -0
@@ -166,7 +166,7 @@/* timeout values are in ticks */ #define CFG_FLASH_ERASE_TOUT (20*CFG_HZ)/* Timeout for Flash
Erase */
#define CFG_FLASH_WRITE_TOUT (20*CFG_HZ) /* Timeout for Flash
Write */
-#define CFG_MAX_FLASH_SECT (256)
+#define CFG_MAX_FLASH_SECT (259)
#define PHYS_FLASH_1 (CFG_FLASH_BASE)
include/flash.h +0 -0
@@ -284,10 +284,12 @@ extern void flash_read_factory_serial(flash_info_t
* info, void * buffer, int of
#define INTEL_ID_28F640J3A 0x00170017 /* 64M = 128K x 64 */ #define INTEL_ID_28F128J3A 0x00180018 /* 128M = 128K x 128 */ #define INTEL_ID_28F256J3A 0x001D001D /* 256M = 128K x 256 */ +#define INTEL_ID_28F64K3 0x88018801 /* 64M = 32K x 256 */ +#define INTEL_ID_28F128K3 0x88028802 /* 128M = 64K x 256 */ +#define INTEL_ID_28F256K3 0x88038803 /* 256M = 128K x 256 */
#define INTEL_ID_28F256L18T 0x880D880D /* 256M = 128K x 255 + 32k x 4
*/
-#define INTEL_ID_28F64K3 0x88018801 /* 64M = 32K x 255 + 32k x 4
*/
-#define INTEL_ID_28F128K3 0x88028802 /* 128M = 64K x 255 + 32k x 4
*/
-#define INTEL_ID_28F256K3 0x88038803 /* 256M = 128K x 255 + 32k x 4
*/
+#define INTEL_ID_28F256L30T 0x88138813 /* 256M = 128K x 255 + 32k x 4
*/
+#define INTEL_ID_28F256L30B 0x88168816 /* 256M = 128K x 255 + 32k x 4
*/
#define INTEL_ID_28F64P30T 0x88178817 /* 64M = 32K x 255 + 32k x 4
*/
#define INTEL_ID_28F64P30B 0x881A881A /* 64M = 32K x 255 + 32k x 4
*/
#define INTEL_ID_28F128P30T 0x88188818 /* 128M = 64K x 255 + 32k x 4
*/
@@ -420,6 +422,8 @@ extern void flash_read_factory_serial(flash_info_t * info, void * buffer, int of
#define FLASH_28F64K3 0x00B4 /* Intel 28F64K3 ( 64M)
*/
#define FLASH_28F128K3 0x00B6 /* Intel 28F128K3 ( 128M = 8M x
16 ) */
#define FLASH_28F256K3 0x00B8 /* Intel 28F256K3 ( 256M = 16M
x 16 ) */
+#define FLASH_28F256L30T 0x00B9 /* Intel 28F256L30T (
256M = 16M x 16 ) */
+#define FLASH_28F256L30B 0x00BA /* Intel 28F256L30B (
256M = 16M x 16 ) */
#define FLASH_28F320J3A 0x00C0 /* INTEL 28F320J3A ( 32M = 128K
x 32) */
#define FLASH_28F640J3A 0x00C2 /* INTEL 28F640J3A ( 64M = 128K
x 64) */
Signature · 1 line
1.5.0.2
PATCH 1/1 ARM Versatile PB926EJ-S, Rev.D: Added support for flash 28F256L30B
Hi Josef,
Quoted 4 lines · Josef Meser
Current u-boot works with ARM Versatile PB926EJ-S, HW- Rev.C (NOR flash 28F256K3).
This patch adds support for 28F256L30B (asymmetrical sectors:
4 small sectors at bottom) used on HW-Rev.D.
Your patch is line wrapped. Please fix and resend.
One question: Why can't you use the common CFI driver on this board?
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
=====================================================================
PATCH 1/1 ARM Versatile PB926EJ-S, Rev.D: Added support for flash 28F256L30B
In reply to Josef MeserReceived
Quoted 282 lines
-----Original Message-----
From: Josef Meser [mailto:Josef.Meser at odm.at]
Sent: 25 May 2007 06:56
To: Peter Pearse
Cc: u-boot-users at lists.sourceforge.net
Subject: [PATCH] ARM Versatile PB926EJ-S, Rev.D: Added support for flash 28F256L30BCurrent u-boot works with ARM Versatile PB926EJ-S, HW- Rev.C (NOR flash 28F256K3).
This patch adds support for 28F256L30B (asymmetrical sectors:
4 small sectors at bottom) used on HW-Rev.D.Signed-off-by Josef Meser <[email protected]>--- board/versatile/flash.c | 84 +++++++++++++++++++++++++++++++++++-------- include/configs/versatile.h | 2 +- include/flash.h | 10 ++++-- 3 files changed, 77 insertions(+), 19 deletions(-)(quoted diff) +0
-0
b/board/versatile/flash.cindex 7153371..b79761f 100644board/versatile/flash.c +1
-1@@ -31,7 +31,9 @@#include <common.h> #include <linux/byteorder/swab.h> -#define PHYS_FLASH_SECT_SIZE 0x00020000/* 256 KB sectors (x2) */ +#define PHYS_FLASH_SECT_SIZE 0x00020000/* *2 = 256 KB sectors */
+#definePHYS_FLASH_MAIN_SECT_SIZE0x00020000/* *2 = 256 KB
sectors */
+#definePHYS_FLASH_PARAM_SECT_SIZE0x00008000/* *2 = 64 KB
sectors */
flash_info_tflash_info[CFG_MAX_FLASH_BANKS]; /* info
for FLASH chips
*//* Board support for 1 or 2 flash devices */ @@ -62,10
+64,19 @@ typedef struct OrgDef {/* Flash Organizations */
board/versatile/flash.c +10
-1-OrgDef OrgIntel_28F256K3[] = { +OrgDef OrgIntel_28F256K3[] = {/* for Hw-Rev. C */ {256 ,128 *1024 },/* 256 * 128kBytes sectors */ }; +OrgDef OrgIntel_28F256L18T[] = { + {255 ,128 *1024 },/* 255 * 128kBytes sectors */ + {4 ,32 *1024 },/* 4 * 32kBytes sectors */ +}; + +OrgDef OrgIntel_28F256L30B[] = {/* for Hw-Rev. D */ + {4 ,32 *1024 },/* 4 * 32kBytes sectors */ + {255 ,128 *1024 },/* 255 * 128kBytes sectors */ +};/*------------------------------------------------------------
----------board/versatile/flash.c +17
-6-* Functions @@ -132,23 +143,55 @@ static void flash_get_offsets (ulong base, flash_info_t * info)int i;OrgDef *pOrgDef; - pOrgDef = OrgIntel_28F256K3; -if (info->flash_id ==FLASH_UNKNOWN ) { +switch (info->flash_id &FLASH_VENDMASK ) { +case FLASH_MAN_INTEL : +break ; +default :return ; } -if ((info->flash_id &FLASH_VENDMASK ) ==FLASH_MAN_INTEL ) { +switch (info->flash_id &FLASH_TYPEMASK ) { +case FLASH_28F256K3 : + pOrgDef = OrgIntel_28F256K3;for (i =0 ; i < info->sector_count; i++) { + info->start[i] = base + (i *PHYS_FLASH_SECT_SIZE ); + info->protect[i] =0 ; + } +break ; +case FLASH_28F256L18T : + pOrgDef = OrgIntel_28F256L18T; +for (i =0 ; i < info->sector_count; i++) { +/* top param block type */ if (i >255 ) { - info->start[i] = base + (i *0x8000 ); - info->protect[i] =0 ; + info->start[i] = base + + (255 *
PHYS_FLASH_MAIN_SECT_SIZE) +board/versatile/flash.c +1
-0+ ((i -255)*
PHYS_FLASH_PARAM_SECT_SIZE);board/versatile/flash.c +3
-0+ }else { + info->start[i] = base + + (i *
PHYS_FLASH_MAIN_SECT_SIZE);board/versatile/flash.c +11
-0+ } + info->protect[i] =0 ; + } +break ; +case FLASH_28F256L30B : + pOrgDef = OrgIntel_28F256L30B; +for (i =0 ; i < info->sector_count; i++) { +/* bottom param block type */ +if (i <4 ) { + info->start[i] = base + + (i *
PHYS_FLASH_PARAM_SECT_SIZE);board/versatile/flash.c +0
-1}else { info->start[i] = base + - (i *
PHYS_FLASH_SECT_SIZE);board/versatile/flash.c +1
-1- info->protect[i] =0 ; + ((i - 3) *
PHYS_FLASH_MAIN_SECT_SIZE);board/versatile/flash.c +6
-0} + info->protect[i] =0 ; } +break ; +default : +return ; } + +return ; }/*------------------------------------------------------------
----------board/versatile/flash.c +6
-3-@@ -172,11 +215,14 @@ void flash_print_info (flash_info_t * info) }switch (info->flash_id &FLASH_TYPEMASK ) { +case FLASH_28F256K3 : +printf ("FLASH 28F256K3\n" ); +break ;case FLASH_28F256L18T :printf ("FLASH 28F256L18T\n" );break ; -case FLASH_28F256K3 : -printf ("FLASH 28F256K3\n" ); +case FLASH_28F256L30B : +printf ("FLASH 28F256L30B\n" );break ;default :printf ("Unknown Chip Type\n" );@@ -221,6 +267,7 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info) info->flash_id = FLASH_UNKNOWN; info->sector_count =0 ; info->size =0 ; +printf ("Unknown flash vendor %0x\n" , value); addr[0 ] = (FPW )0x00FF00FF ;/* restore read mode */ return (0 );/* no or unknown flash */ board/versatile/flash.c +11
-4}@@ -229,20 +276,27 @@ static ulong flash_get_size (FPW * addr, flash_info_t * info) value = addr[1 ];/* device ID */ switch (value) { +case (FPW )(INTEL_ID_28F256K3 ): + info->flash_id +=FLASH_28F256K3 ; + info->sector_count =256 ; + info->size =0x02000000 ; +break ; +case (FPW ) (INTEL_ID_28F256L18T ): info->flash_id +=FLASH_28F256L18T ; info->sector_count =259 ; info->size =0x02000000 ;break ;/* => 32 MB */ -case (FPW )(INTEL_ID_28F256K3 ): - info->flash_id +=FLASH_28F256K3 ; - info->sector_count =256 ; - info->size =0x02000000 ; +case (FPW )(INTEL_ID_28F256L30B ): + info->flash_id +=FLASH_28F256L30B ; + info->sector_count =259 ; + info->size =0x02000000 ;/* 32 MB */ break ;default : info->flash_id =FLASH_UNKNOWN ; +printf ("Unknown chip type %0x\n" , value);break ; }(quoted diff) +0
-0
b/include/configs/versatile.hindex 16db43b..fe26c42 100644include/configs/versatile.h +0
-0@@ -166,7 +166,7 @@/* timeout values are in ticks */ #define CFG_FLASH_ERASE_TOUT (20*CFG_HZ)/* Timeout for Flash Erase */
#defineCFG_FLASH_WRITE_TOUT(20*CFG_HZ) /* Timeout for Flash
Write */include/configs/versatile.h +1
-1-#define CFG_MAX_FLASH_SECT (256) +#define CFG_MAX_FLASH_SECT (259)#define PHYS_FLASH_1 (CFG_FLASH_BASE)include/flash.h index renamed from include/flash.h +0
-043b9c6b..c1e327f 100644
include/flash.h +0
-0@@ -284,10 +284,12 @@ extern voidflash_read_factory_serial(flash_info_t
* info, void * buffer, int of
#defineINTEL_ID_28F640J3A0x00170017/* 64M = 128K
x 64 */
#defineINTEL_ID_28F128J3A0x00180018/* 128M = 128K
x 128 */
#defineINTEL_ID_28F256J3A0x001D001D/* 256M = 128K
x 256 */include/flash.h +3
-0+#define INTEL_ID_28F64K3 0x88018801/* 64M = 32K x 256 */ +#define INTEL_ID_28F128K3 0x88028802/* 128M = 64K x 256 */ +#define INTEL_ID_28F256K3 0x88038803/* 256M = 128K x 256 */ #define INTEL_ID_28F256L18T 0x880D880D/* 256M = 128K x 255 + 32k x 4
*/
-#defineINTEL_ID_28F64K30x88018801/* 64M = 32K
x 255 + 32k x 4
*/
-#defineINTEL_ID_28F128K30x88028802/* 128M = 64K
x 255 + 32k x 4
*/
-#defineINTEL_ID_28F256K30x88038803/* 256M = 128K
x 255 + 32k x 4
*/
+#defineINTEL_ID_28F256L30T0x88138813/* 256M = 128K
x 255 + 32k x 4
*/
+#defineINTEL_ID_28F256L30B0x88168816/* 256M = 128K
x 255 + 32k x 4
*/
#defineINTEL_ID_28F64P30T0x88178817/* 64M = 32K
x 255 + 32k x 4
*/
#defineINTEL_ID_28F64P30B0x881A881A/* 64M = 32K
x 255 + 32k x 4
*/
#defineINTEL_ID_28F128P30T0x88188818/* 128M = 64K
x 255 + 32k x 4
*/include/flash.h +0
-0@@ -420,6 +422,8 @@ extern voidflash_read_factory_serial(flash_info_t * info, void * buffer, int of
#defineFLASH_28F64K30x00B4/* Intel
28F64K3 ( 64M)
*/
#defineFLASH_28F128K30x00B6/* Intel
28F128K3 ( 128M = 8M x
16 ) */
#defineFLASH_28F256K30x00B8/* Intel
28F256K3 ( 256M = 16M
x 16 ) */
+#defineFLASH_28F256L30T0x00B9/* Intel 28F256L30T (
256M = 16M x 16 ) */
+#defineFLASH_28F256L30B0x00BA/* Intel 28F256L30B (
256M = 16M x 16 ) */#define
FLASH_28F320J3A0x00C0/* INTEL
28F320J3A ( 32M = 128K
x 32) */
#defineFLASH_28F640J3A0x00C2/* INTEL
28F640J3A ( 64M = 128K
x 64) */
--
1.5.0.2