Merge branch 'master' of git://git.denx.de/u-boot-fdt
[platform/kernel/u-boot.git] / include / flash.h
index 05fa572..8b8979e 100644 (file)
@@ -33,7 +33,7 @@ typedef struct {
        ulong   size;                   /* total bank size in bytes             */
        ushort  sector_count;           /* number of erase units                */
        ulong   flash_id;               /* combined device & manufacturer code  */
-       ulong   start[CONFIG_SYS_MAX_FLASH_SECT];   /* physical sector start addresses */
+       ulong   start[CONFIG_SYS_MAX_FLASH_SECT];   /* virtual sector start address */
        uchar   protect[CONFIG_SYS_MAX_FLASH_SECT]; /* sector protection status */
 #ifdef CONFIG_SYS_FLASH_CFI
        uchar   portwidth;              /* the width of the port                */
@@ -86,6 +86,9 @@ typedef unsigned long flash_sect_t;
 
 /* convert between bit value and numeric value */
 #define CFI_FLASH_SHIFT_WIDTH  3
+
+/* cfi-mtd device name */
+#define        CFI_MTD_DEV_NAME        "cfi-mtd"
 /* Prototypes */
 
 extern unsigned long flash_init (void);
@@ -103,6 +106,11 @@ extern int flash_write (char *, ulong, ulong);
 extern flash_info_t *addr2info (ulong);
 extern int write_buff (flash_info_t *info, uchar *src, ulong addr, ulong cnt);
 
+/* drivers/mtd/cfi_mtd.c */
+#ifdef CONFIG_FLASH_CFI_MTD
+extern int cfi_mtd_init(void);
+#endif
+
 /* board/?/flash.c */
 #if defined(CONFIG_SYS_FLASH_PROTECTION)
 extern int flash_real_protect(flash_info_t *info, long sector, int prot);
@@ -116,6 +124,9 @@ extern int jedec_flash_match(flash_info_t *info, ulong base);
 #define CFI_CMDSET_AMD_LEGACY          0xFFF0
 #endif
 
+#if defined(CONFIG_SYS_FLASH_CFI)
+extern flash_info_t *flash_get_info(ulong base);
+#endif
 
 /*-----------------------------------------------------------------------
  * return codes from flash_write():