X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fflash.h;h=b016162009fa244ab9f1250b8b9309c0976b48a2;hb=3b9043a7c03290c9bdbef03848307263f5f3472c;hp=a6e91b5e69fb1a8fc8711ea1afdcab7a9d86f529;hpb=f61f1e150c84f5b9347fca79a4bc5f2286c545d2;p=u-boot diff --git a/include/flash.h b/include/flash.h index a6e91b5e69..b016162009 100644 --- a/include/flash.h +++ b/include/flash.h @@ -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 */ @@ -58,6 +58,8 @@ typedef struct { #endif } flash_info_t; +typedef unsigned long flash_sect_t; + /* * Values for the width of the port */ @@ -84,6 +86,7 @@ typedef struct { /* convert between bit value and numeric value */ #define CFI_FLASH_SHIFT_WIDTH 3 + /* Prototypes */ extern unsigned long flash_init (void); @@ -92,6 +95,8 @@ extern int flash_erase (flash_info_t *, int, int); extern int flash_sect_erase (ulong addr_first, ulong addr_last); extern int flash_sect_protect (int flag, ulong addr_first, ulong addr_last); extern int flash_sect_roundb (ulong *addr); +extern unsigned long flash_sector_size(flash_info_t *info, flash_sect_t sect); +extern void flash_set_verbose(uint); /* common/flash.c */ extern void flash_protect (int flag, ulong from, ulong to, flash_info_t *info); @@ -99,6 +104,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); @@ -112,6 +122,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():