X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fdataflash.h;h=63b3bf9634334e7ccd7c7ead82a0e095fed9afb2;hb=d6f324d03d7829a1da1dee8b60f91b173a3976f0;hp=c597e69f17d11fc0d02e94fde921f038ded33450;hpb=3f76451b4a9f52f8c37a0526df217d12175182ea;p=u-boot diff --git a/include/dataflash.h b/include/dataflash.h index c597e69f17..63b3bf9634 100644 --- a/include/dataflash.h +++ b/include/dataflash.h @@ -38,13 +38,9 @@ #include "config.h" /*number of protected area*/ -#ifdef CONFIG_NEW_PARTITION -# define NB_DATAFLASH_AREA 6 -#else -# define NB_DATAFLASH_AREA 4 -#endif +#define NB_DATAFLASH_AREA 5 -#ifdef CFG_NO_FLASH +#ifdef CONFIG_SYS_NO_FLASH /*----------------------------------------------------------------------- * return codes from flash_write(): @@ -70,7 +66,7 @@ * Set Environment according to label: */ # define FLAG_SETENV 0x80 -#endif /* CFG_NO_FLASH */ +#endif /* CONFIG_SYS_NO_FLASH */ /*define the area structure*/ typedef struct { @@ -78,7 +74,7 @@ typedef struct { unsigned long end; unsigned char protected; unsigned char setenv; - unsigned char label[20]; + unsigned char label[20]; } dataflash_protect_t; typedef unsigned int AT91S_DataFlashStatus; @@ -134,10 +130,14 @@ typedef struct _AT91S_DATAFLASH_INFO { unsigned int id; /* device id */ } AT91S_DATAFLASH_INFO, *AT91PS_DATAFLASH_INFO; - +struct dataflash_addr { + unsigned long addr; + int cs; +}; /*-------------------------------------------------------------------------------------------------*/ - #define AT45DB161 0x2c +#define AT45DB021 0x14 +#define AT45DB081 0x24 #define AT45DB321 0x34 #define AT45DB642 0x3c #define AT45DB128 0x10 @@ -211,9 +211,9 @@ extern int read_dataflash (unsigned long addr, unsigned long size, char *result) extern int write_dataflash (unsigned long addr, unsigned long dest, unsigned long size); extern void dataflash_print_info (void); extern void dataflash_perror (int err); +extern void AT91F_DataflashSetEnv (void); -#ifdef CONFIG_NEW_DF_PARTITION -extern int AT91F_DataflashSetEnv (void); #endif -#endif - +extern struct dataflash_addr cs[CONFIG_SYS_MAX_DATAFLASH_BANKS]; +extern dataflash_protect_t area_list[NB_DATAFLASH_AREA]; +extern AT91S_DATAFLASH_INFO dataflash_info[]; #endif