diff options
| author | Stefan Roese <sr@denx.de> | 2007-08-15 21:06:27 +0200 | 
|---|---|---|
| committer | Stefan Roese <sr@denx.de> | 2007-08-15 21:06:27 +0200 | 
| commit | b706d63559aeec352bc72dd86d7d5423c15f6a60 (patch) | |
| tree | fdeda4d61970fef239d9d66ecd851fa46cfe5ec0 /include/dataflash.h | |
| parent | c8603cfbd4573379a6076c9c208545ba2bbf019a (diff) | |
| parent | 594e79838ce5078a90d0c27abb2b2d61d5f8e8a7 (diff) | |
| download | olio-uboot-2014.01-b706d63559aeec352bc72dd86d7d5423c15f6a60.tar.xz olio-uboot-2014.01-b706d63559aeec352bc72dd86d7d5423c15f6a60.zip | |
Merge with git://www.denx.de/git/u-boot.git
Diffstat (limited to 'include/dataflash.h')
| -rw-r--r-- | include/dataflash.h | 43 | 
1 files changed, 42 insertions, 1 deletions
| diff --git a/include/dataflash.h b/include/dataflash.h index 650454e7e..fbd5e17f4 100644 --- a/include/dataflash.h +++ b/include/dataflash.h @@ -38,13 +38,47 @@  #include "config.h"  /*number of protected area*/ -#define NB_DATAFLASH_AREA	4 +#ifdef	CONFIG_NEW_PARTITION +# define NB_DATAFLASH_AREA	6 +#else +# define NB_DATAFLASH_AREA	4 +#endif + +#ifdef CFG_NO_FLASH + +/*----------------------------------------------------------------------- + * return codes from flash_write(): + */ +# define ERR_OK				0 +# define ERR_TIMOUT			1 +# define ERR_NOT_ERASED			2 +# define ERR_PROTECTED			4 +# define ERR_INVAL			8 +# define ERR_ALIGN			16 +# define ERR_UNKNOWN_FLASH_VENDOR	32 +# define ERR_UNKNOWN_FLASH_TYPE		64 +# define ERR_PROG_ERROR			128 + +/*----------------------------------------------------------------------- + * Protection Flags for flash_protect(): + */ +# define FLAG_PROTECT_SET		0x01 +# define FLAG_PROTECT_CLEAR		0x02 +# define FLAG_PROTECT_INVALID		0x03 + +/*----------------------------------------------------------------------- + * Set Environment according to label: + */ +# define	FLAG_SETENV		0x80 +#endif /* CFG_NO_FLASH */  /*define the area structure*/  typedef struct {  	unsigned long start;  	unsigned long end;  	unsigned char protected; +	unsigned char setenv; +	unsigned char label[20];  } dataflash_protect_t;  typedef unsigned int AT91S_DataFlashStatus; @@ -96,6 +130,7 @@ typedef struct _AT91S_DATAFLASH_INFO {  	AT91S_DataflashDesc Desc;  	AT91S_DataflashFeatures Device; /* Pointer on a dataflash features array */  	unsigned long logical_address; +	unsigned long end_address;  	unsigned int id;			/* device id */  } AT91S_DATAFLASH_INFO, *AT91PS_DATAFLASH_INFO; @@ -106,6 +141,7 @@ typedef struct _AT91S_DATAFLASH_INFO {  #define AT45DB321	0x34  #define AT45DB642	0x3c  #define AT45DB128	0x10 +#define	PAGES_PER_BLOCK	8  #define AT91C_DATAFLASH_TIMEOUT		10000	/* For AT91F_DataFlashWaitReady */ @@ -168,6 +204,7 @@ typedef struct _AT91S_DATAFLASH_INFO {  extern int size_dataflash (AT91PS_DataFlash pdataFlash, unsigned long addr, unsigned long size);  extern int prot_dataflash (AT91PS_DataFlash pdataFlash, unsigned long addr); +extern int addr2ram(ulong addr);  extern int dataflash_real_protect (int flag, unsigned long start_addr, unsigned long end_addr);  extern int addr_dataflash (unsigned long addr);  extern int read_dataflash (unsigned long addr, unsigned long size, char *result); @@ -175,4 +212,8 @@ extern int write_dataflash (unsigned long addr, unsigned long dest, unsigned lon  extern void dataflash_print_info (void);  extern void dataflash_perror (int err); +#ifdef	CONFIG_NEW_DF_PARTITION +extern int AT91F_DataflashSetEnv (void); #endif +#endif +  #endif |