From 5779d8d985d95104ad74332f5fa3cb6c67645509 Mon Sep 17 00:00:00 2001 From: wdenk Date: Sat, 6 Dec 2003 23:55:10 +0000 Subject: * Patch by Nicolas Lacressonnière, 12 Nov 2003: update for for Atmel AT91RM9200DK development kit: - support for environment variables in DataFlash - Atmel DataFlash AT45DB1282 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Patch by Jeff Carr, 11 Nov 2003: add support for new version of 8270 processors * Patches by George G. Davis, 05 Nov 2003: - only pass the ARM linux initrd tag to the kernel when an initrd is actually present - update omap1510inn configuration file --- include/dataflash.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'include/dataflash.h') diff --git a/include/dataflash.h b/include/dataflash.h index 5e1186388..c40401638 100644 --- a/include/dataflash.h +++ b/include/dataflash.h @@ -37,16 +37,15 @@ #include #include "config.h" +/*number of protected area*/ +#define NB_DATAFLASH_AREA 4 +/*define the area structure*/ typedef struct { - unsigned long base; /* logical base address for a bank */ - unsigned long size; /* total bank size */ - unsigned long page_count; - unsigned long page_size; - unsigned long id; /* device id */ - unsigned char protect[CFG_MAX_DATAFLASH_PAGES]; /* page protection status */ -} dataflash_info_t; - + unsigned long start; + unsigned long end; + unsigned char protected; +} dataflash_protect_t; typedef unsigned int AT91S_DataFlashStatus; @@ -80,6 +79,7 @@ typedef struct _AT91S_Dataflash { int page_offset; /* page offset in command */ int byte_mask; /* byte mask in command */ int cs; + dataflash_protect_t area_list[NB_DATAFLASH_AREA]; /* area protection status */ } AT91S_DataflashFeatures, *AT91PS_DataflashFeatures; /*---------------------------------------------*/ @@ -91,13 +91,13 @@ typedef struct _AT91S_DataFlash { } AT91S_DataFlash, *AT91PS_DataFlash; + typedef struct _AT91S_DATAFLASH_INFO { AT91S_DataflashDesc Desc; AT91S_DataflashFeatures Device; /* Pointer on a dataflash features array */ unsigned long logical_address; unsigned int id; /* device id */ - unsigned char protect[CFG_MAX_DATAFLASH_PAGES]; /* page protection status */ } AT91S_DATAFLASH_INFO, *AT91PS_DATAFLASH_INFO; @@ -106,6 +106,7 @@ typedef struct _AT91S_DATAFLASH_INFO { #define AT45DB161 0x2c #define AT45DB321 0x34 #define AT45DB642 0x3c +#define AT45DB128 0x10 #define AT91C_DATAFLASH_TIMEOUT 10000 /* For AT91F_DataFlashWaitReady */ @@ -166,6 +167,9 @@ 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 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); extern int write_dataflash (unsigned long addr, unsigned long dest, unsigned long size); -- cgit v1.2.3