]> git.sur5r.net Git - u-boot/blobdiff - board/ml2/flash.c
sh: Fix rsk7203 alignment problem
[u-boot] / board / ml2 / flash.c
index 4f805a663b1e4d6504fbf54be52b05b3fc87c63e..c125d418d3b493b735125ca2a049c35b61484c7b 100644 (file)
@@ -22,7 +22,7 @@
 
 #define FLASH_BANK_SIZE (64*1024*1024)
 
-flash_info_t    flash_info[CFG_MAX_FLASH_BANKS];
+flash_info_t    flash_info[CONFIG_SYS_MAX_FLASH_BANKS];
 
 #define SECT_SIZE              (512*1024)
 
@@ -61,16 +61,16 @@ ulong flash_init(void) {
        int i, j;
        ulong size = 0;
 
-       for(i=0;i<CFG_MAX_FLASH_BANKS;i++) {
+       for(i=0;i<CONFIG_SYS_MAX_FLASH_BANKS;i++) {
                ulong flashbase = 0;
 
                flash_info[i].flash_id = (INTEL_MANUFACT & FLASH_VENDMASK) |
                                                                 (INTEL_ID_28F128J3A & FLASH_TYPEMASK);
                flash_info[i].size = FLASH_BANK_SIZE;
-               flash_info[i].sector_count = CFG_MAX_FLASH_SECT;
-               memset(flash_info[i].protect, 0, CFG_MAX_FLASH_SECT);
+               flash_info[i].sector_count = CONFIG_SYS_MAX_FLASH_SECT;
+               memset(flash_info[i].protect, 0, CONFIG_SYS_MAX_FLASH_SECT);
                if (i==0)
-                       flashbase = CFG_FLASH_BASE;
+                       flashbase = CONFIG_SYS_FLASH_BASE;
                else
                        panic("configured too many flash banks!\n");
                for (j = 0; j < flash_info[i].sector_count; j++)
@@ -216,13 +216,13 @@ int flash_erase (flash_info_t *info, int s_first, int s_last) {
        return rc;
 }
 
-volatile static int write_word (flash_info_t *info, ulong dest, unsigned long long data) {
+static int write_word (flash_info_t *info, ulong dest, unsigned long long data) {
 
        volatile unsigned long long *addr=(unsigned long long *)dest;
        unsigned long long result;
        int rc = ERR_OK;
 
-       result=*addr;
+       result = *addr;
        if ((result & data) != data)
                return ERR_NOT_ERASED;
 
@@ -234,7 +234,7 @@ volatile static int write_word (flash_info_t *info, ulong dest, unsigned long lo
        eieio();
 
        do {
-               result=*addr;
+               result = *addr;
        } while(~result & BIT_BUSY);
 
        *addr=CMD_READ_ARRAY;
@@ -275,7 +275,7 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt) {
        }
 
        while(cnt>=8) {
-               data=*((unsigned long long *)src);
+               data = *((unsigned long long *)src);
                if ((rc = write_word(info, wp, data)) != 0)
                        return rc;
                src+=8;