diff options
author | wdenk <wdenk> | 2004-12-16 21:44:03 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2004-12-16 21:44:03 +0000 |
commit | efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5 (patch) | |
tree | 9b8636853fefbfcd38e804ddccac013bd216d50e /board/g2000 | |
parent | bea8e84b52ac3c499b5868978a29c20cf92cf88f (diff) | |
download | u-boot-midas-efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5.tar.gz u-boot-midas-efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5.tar.bz2 u-boot-midas-efe2a4d5cf96dd37bc4782ba1880cee4ed1117c5.zip |
Code cleanup.
Diffstat (limited to 'board/g2000')
-rw-r--r-- | board/g2000/g2000.c | 34 | ||||
-rw-r--r-- | board/g2000/strataflash.c | 47 |
2 files changed, 35 insertions, 46 deletions
diff --git a/board/g2000/g2000.c b/board/g2000/g2000.c index c0b36762b2..5967e90e1e 100644 --- a/board/g2000/g2000.c +++ b/board/g2000/g2000.c @@ -25,7 +25,6 @@ #include <asm/processor.h> #include <command.h> - #define MEM_MCOPT1_INIT_VAL 0x00800000 #define MEM_RTR_INIT_VAL 0x04070000 #define MEM_PMIT_INIT_VAL 0x07c00000 @@ -34,11 +33,8 @@ #define MEM_SDTR1_INIT_VAL 0x00854005 #define SDRAM0_CFG_ENABLE 0x80000000 - - #define CFG_SDRAM_SIZE 0x04000000 /* 64 MB */ - int board_early_init_f (void) { #if 0 /* test-only */ @@ -119,19 +115,19 @@ int checkboard (void) long int init_sdram_static_settings(void) { #define mtsdram0(reg, data) mtdcr(memcfga,reg);mtdcr(memcfgd,data) - /* disable memcontroller so updates work */ - mtsdram0( mem_mcopt1, MEM_MCOPT1_INIT_VAL ); - mtsdram0( mem_rtr , MEM_RTR_INIT_VAL ); - mtsdram0( mem_pmit , MEM_PMIT_INIT_VAL ); - mtsdram0( mem_mb0cf , MEM_MB0CF_INIT_VAL ); - mtsdram0( mem_mb1cf , MEM_MB1CF_INIT_VAL ); - mtsdram0( mem_sdtr1 , MEM_SDTR1_INIT_VAL ); - - /* SDRAM have a power on delay, 500 micro should do */ - udelay(500); - mtsdram0( mem_mcopt1, MEM_MCOPT1_INIT_VAL|SDRAM0_CFG_ENABLE ); - - return (CFG_SDRAM_SIZE); /* CFG_SDRAM_SIZE is in G2000.h */ + /* disable memcontroller so updates work */ + mtsdram0( mem_mcopt1, MEM_MCOPT1_INIT_VAL ); + mtsdram0( mem_rtr , MEM_RTR_INIT_VAL ); + mtsdram0( mem_pmit , MEM_PMIT_INIT_VAL ); + mtsdram0( mem_mb0cf , MEM_MB0CF_INIT_VAL ); + mtsdram0( mem_mb1cf , MEM_MB1CF_INIT_VAL ); + mtsdram0( mem_sdtr1 , MEM_SDTR1_INIT_VAL ); + + /* SDRAM have a power on delay, 500 micro should do */ + udelay(500); + mtsdram0( mem_mcopt1, MEM_MCOPT1_INIT_VAL|SDRAM0_CFG_ENABLE ); + + return (CFG_SDRAM_SIZE); /* CFG_SDRAM_SIZE is in G2000.h */ } @@ -141,9 +137,9 @@ long int initdram (int board_type) /* flzt, we can still turn this on in the future */ /* #ifdef CONFIG_SPD_EEPROM - ret = spd_sdram (); + ret = spd_sdram (); #else - ret = init_sdram_static_settings(); + ret = init_sdram_static_settings(); #endif */ diff --git a/board/g2000/strataflash.c b/board/g2000/strataflash.c index 06fedeccd3..8446e02106 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"); } |