summaryrefslogtreecommitdiff
path: root/board/g2000/strataflash.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-12-16 21:44:03 +0000
committerwdenk <wdenk>2004-12-16 21:44:03 +0000
commitefe2a4d5cf96dd37bc4782ba1880cee4ed1117c5 (patch)
tree9b8636853fefbfcd38e804ddccac013bd216d50e /board/g2000/strataflash.c
parentbea8e84b52ac3c499b5868978a29c20cf92cf88f (diff)
downloadu-boot-imx-efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5.zip
u-boot-imx-efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5.tar.gz
u-boot-imx-efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5.tar.bz2
Code cleanup.
Diffstat (limited to 'board/g2000/strataflash.c')
-rw-r--r--board/g2000/strataflash.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/board/g2000/strataflash.c b/board/g2000/strataflash.c
index 06fedec..8446e02 100644
--- a/board/g2000/strataflash.c
+++ b/board/g2000/strataflash.c
@@ -85,12 +85,8 @@
#define FLASH_OFFSET_USER_PROTECTION 0x85
#define FLASH_OFFSET_INTEL_PROTECTION 0x81
-
#define FLASH_MAN_CFI 0x01000000
-
-
-
typedef union {
unsigned char c;
unsigned short w;
@@ -107,13 +103,10 @@ typedef union {
flash_info_t flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips */
-
/*-----------------------------------------------------------------------
* Functions
*/
-
-
static void flash_add_byte(flash_info_t *info, cfiword_t * cword, uchar c);
static void flash_make_cmd(flash_info_t * info, uchar cmd, void * cmdbuf);
static void flash_write_cmd(flash_info_t * info, int sect, uchar offset, uchar cmd);
@@ -286,28 +279,28 @@ void flash_print_info (flash_info_t *info)
int erased;
volatile unsigned long *flash;
- /*
- * Check if whole sector is erased
- */
- if (i != (info->sector_count-1))
- size = info->start[i+1] - info->start[i];
- else
- size = info->start[0] + info->size - info->start[i];
- erased = 1;
- flash = (volatile unsigned long *)info->start[i];
- size = size >> 2; /* divide by 4 for longword access */
- for (k=0; k<size; k++)
- {
- if (*flash++ != 0xffffffff)
- {
- erased = 0;
- break;
- }
- }
+ /*
+ * Check if whole sector is erased
+ */
+ if (i != (info->sector_count-1))
+ size = info->start[i+1] - info->start[i];
+ else
+ size = info->start[0] + info->size - info->start[i];
+ erased = 1;
+ flash = (volatile unsigned long *)info->start[i];
+ size = size >> 2; /* divide by 4 for longword access */
+ for (k=0; k<size; k++)
+ {
+ if (*flash++ != 0xffffffff)
+ {
+ erased = 0;
+ break;
+ }
+ }
if ((i % 5) == 0)
printf ("\n ");
- /* print empty and read-only info */
+ /* print empty and read-only info */
printf (" %08lX%s%s",
info->start[i],
erased ? " E" : " ",
@@ -464,7 +457,7 @@ static int flash_full_status_check(flash_info_t * info, ulong sector, ulong tout
printf("Command Sequence Error.\n");
} else if(flash_isset(info, sector, 0, FLASH_STATUS_ECLBS)){
printf("Block Erase Error.\n");
- retcode = ERR_NOT_ERASED;
+ retcode = ERR_NOT_ERASED;
} else if (flash_isset(info, sector, 0, FLASH_STATUS_PSLBS)) {
printf("Locking Error\n");
}