Merge branch 'master' of /home/wd/git/u-boot/custodians
[platform/kernel/u-boot.git] / board / mpc8540eval / flash.c
index 7300a04..98fd168 100644 (file)
 
 flash_info_t   flash_info[CFG_MAX_FLASH_BANKS]; /* info for FLASH chips        */
 
-#if defined(CFG_ENV_IS_IN_FLASH)
-# ifndef  CFG_ENV_ADDR
-#  define CFG_ENV_ADDR (CFG_FLASH_BASE + CFG_ENV_OFFSET)
+#if defined(CONFIG_ENV_IS_IN_FLASH)
+# ifndef  CONFIG_ENV_ADDR
+#  define CONFIG_ENV_ADDR      (CFG_FLASH_BASE + CONFIG_ENV_OFFSET)
 # endif
-# ifndef  CFG_ENV_SIZE
-#  define CFG_ENV_SIZE CFG_ENV_SECT_SIZE
+# ifndef  CONFIG_ENV_SIZE
+#  define CONFIG_ENV_SIZE      CONFIG_ENV_SECT_SIZE
 # endif
-# ifndef  CFG_ENV_SECT_SIZE
-#  define CFG_ENV_SECT_SIZE  CFG_ENV_SIZE
+# ifndef  CONFIG_ENV_SECT_SIZE
+#  define CONFIG_ENV_SECT_SIZE  CONFIG_ENV_SIZE
 # endif
 #endif
 
@@ -103,11 +103,11 @@ unsigned long flash_init (void)
                      &flash_info[0]);
 #endif
 
-#ifdef CFG_ENV_IS_IN_FLASH
+#ifdef CONFIG_ENV_IS_IN_FLASH
        /* ENV protection ON by default */
        flash_protect(FLAG_PROTECT_SET,
-                     CFG_ENV_ADDR,
-                     CFG_ENV_ADDR+CFG_ENV_SECT_SIZE-1,
+                     CONFIG_ENV_ADDR,
+                     CONFIG_ENV_ADDR+CONFIG_ENV_SECT_SIZE-1,
                      &flash_info[0]);
 #endif
 #endif
@@ -591,7 +591,7 @@ int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt)
                cnt -= FLASH_BLOCK_SIZE;
                if (((count-cnt)>>10)>temp) {
                        temp=(count-cnt)>>10;
-                       printf("\r%d KB",temp);
+                       printf("\r%lu KB",temp);
                }
        }
        printf("\n");
@@ -699,7 +699,8 @@ static int write_block(flash_info_t *info, uchar * src, ulong dest, ulong cnt)
                        }
                }
                if (csr & 0x4040) {
-                       printf ("CSR indicates write error (%04x) at %08lx\n", csr, (ulong)addr);
+                       printf ("CSR indicates write error (%04lx) at %08lx\n",
+                               csr, (ulong)addr);
                        flag = 1;
                }
                /* Clear Status Registers Command */
@@ -756,7 +757,8 @@ static int write_short (flash_info_t *info, ulong dest, ushort data)
                        }
                }
                if (csr & 0x4040) {
-                       printf ("CSR indicates write error (%04x) at %08lx\n", csr, (ulong)addr);
+                       printf ("CSR indicates write error (%04lx) at %08lx\n",
+                               csr, (ulong)addr);
                        flag = 1;
                }
                /* Clear Status Registers Command */