rename CFG_ENV macros to CONFIG_ENV
[platform/kernel/u-boot.git] / board / omap1610inn / flash.c
index b316c1d..d88a981 100644 (file)
@@ -2,7 +2,7 @@
  * (C) Copyright 2001
  * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
  *
- * (C) Copyright 2001
+ * (C) Copyright 2001-2004
  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  *
  * (C) Copyright 2003
@@ -80,6 +80,7 @@ void flash_print_info (flash_info_t * info);
 void flash_unprotect_sectors (FPWV * addr);
 int flash_erase (flash_info_t * info, int s_first, int s_last);
 int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt);
+void flash_unlock(flash_info_t * info);
 
 /*-----------------------------------------------------------------------
  */
@@ -88,11 +89,12 @@ unsigned long flash_init (void)
 {
        int i;
        ulong size = 0;
+
        for (i = 0; i < CFG_MAX_FLASH_BANKS; i++) {
                switch (i) {
                case 0:
-                       flash_get_size ((FPW *) PHYS_FLASH_1, &flash_info[i]);
-                       flash_get_offsets (PHYS_FLASH_1, &flash_info[i]);
+                       flash_get_size ((FPW *) CFG_FLASH_BASE, &flash_info[i]);
+                       flash_get_offsets (CFG_FLASH_BASE, &flash_info[i]);
                        /* to reset the lock bit */
                        flash_unlock(&flash_info[i]);
                        break;
@@ -110,15 +112,15 @@ unsigned long flash_init (void)
                        CFG_FLASH_BASE + monitor_flash_len - 1, &flash_info[0]);
 
        flash_protect (FLAG_PROTECT_SET,
-                       CFG_ENV_ADDR,
-                       CFG_ENV_ADDR + CFG_ENV_SIZE - 1, &flash_info[0]);
+                       CONFIG_ENV_ADDR,
+                       CONFIG_ENV_ADDR + CONFIG_ENV_SIZE - 1, &flash_info[0]);
 
        return size;
 }
 
 /*-----------------------------------------------------------------------
  */
-flash_unlock(flash_info_t * info)
+void flash_unlock(flash_info_t * info)
 {
        int j;
        for (j=2;j<CFG_MAX_FLASH_SECT;j++){