rename CFG_ENV macros to CONFIG_ENV
[platform/kernel/u-boot.git] / board / funkwerk / vovpn-gw / flash.c
index 1e53d45..0308611 100644 (file)
@@ -5,7 +5,7 @@
  * Support for the Elmeg VoVPN Gateway Module
  * ------------------------------------------
  * This is a signle bank flashdriver for INTEL 28F320J3, 28F640J3
- * and 28F128J3A flashs working in 8 Bit mode. 
+ * and 28F128J3A flashs working in 8 Bit mode.
  *
  * Most of this code is taken from existing u-boot source code.
  *
@@ -151,10 +151,10 @@ flash_init(void)
                      CFG_MONITOR_FLASH+CFG_MONITOR_LEN-1,
                      &flash_info[0]);
 #endif
-#ifdef CFG_ENV_IS_IN_FLASH
+#ifdef CONFIG_ENV_IS_IN_FLASH
        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
        return (size);
@@ -286,8 +286,8 @@ flash_erase(flash_info_t *info, int s_first, int s_last)
 
 static int
 write_buff2( volatile FLASH_WORD_SIZE *dst,
-             volatile FLASH_WORD_SIZE *src,
-             unsigned long cnt )
+            volatile FLASH_WORD_SIZE *src,
+            unsigned long cnt )
 {
        unsigned long start;
        FLASH_WORD_SIZE status;
@@ -447,60 +447,3 @@ flash_real_protect(flash_info_t *info, long sector, int prot)
        *addr = FLASH_CMD_RESET;
        return (0);
 }
-
-/*-----------------------------------------------------------------------
- * Support for flash file system (JFFS2)
- *
- * We use custom partition info function because we have to fit the
- * file system image between first sector (containing hard reset
- * configuration word) and the sector containing U-Boot image. Standard
- * partition info function does not allow for last sector specification
- * and assumes that the file system occupies flash bank up to and
- * including bank's last sector.
- */
-#if (CONFIG_COMMANDS & CFG_CMD_JFFS2) && defined(CFG_JFFS_CUSTOM_PART)
-#error TODO
-
-#ifndef CFG_JFFS2_FIRST_SECTOR
-#define CFG_JFFS2_FIRST_SECTOR 0
-#endif
-#ifndef CFG_JFFS2_FIRST_BANK
-#define CFG_JFFS2_FIRST_BANK 0
-#endif
-#ifndef CFG_JFFS2_NUM_BANKS
-#define CFG_JFFS2_NUM_BANKS 1
-#endif
-#define CFG_JFFS2_LAST_BANK (CFG_JFFS2_FIRST_BANK + CFG_JFFS2_NUM_BANKS - 1)
-
-#include <jffs2/jffs2.h>
-
-static struct part_info partition;
-
-struct part_info *jffs2_part_info(int part_num)
-{
-       int i;
-
-       if (part_num == 0) {
-               if (partition.usr_priv == 0) {
-                       partition.offset =
-                               (unsigned char *) flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR];
-                       for (i = CFG_JFFS2_FIRST_BANK; i <= CFG_JFFS2_LAST_BANK; i++)
-                               partition.size += flash_info[i].size;
-                       partition.size -=
-                               flash_info[CFG_JFFS2_FIRST_BANK].start[CFG_JFFS2_FIRST_SECTOR] -
-                               flash_info[CFG_JFFS2_FIRST_BANK].start[0];
-#ifdef CFG_JFFS2_LAST_SECTOR
-                       i = flash_info[CFG_JFFS2_LAST_BANK].sector_count - 1;
-                       partition.size -=
-                               flash_info[CFG_JFFS2_LAST_BANK].start[i] -
-                               flash_info[CFG_JFFS2_LAST_BANK].start[CFG_JFFS2_LAST_SECTOR];
-#endif
-
-                       partition.usr_priv = (void *)1;
-               }
-               return &partition;
-       }
-       return 0;
-}
-
-#endif /* JFFS2 */