* 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
* 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
diff --git a/include/dataflash.h b/include/dataflash.h
index 5e11863..c404016 100644
--- a/include/dataflash.h
+++ b/include/dataflash.h
@@ -37,16 +37,15 @@
#include <asm/arch/hardware.h>
#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 @@
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 @@
} 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 @@
#define AT45DB161 0x2c
#define AT45DB321 0x34
#define AT45DB642 0x3c
+#define AT45DB128 0x10
#define AT91C_DATAFLASH_TIMEOUT 10000 /* For AT91F_DataFlashWaitReady */
@@ -166,6 +167,9 @@
/*-------------------------------------------------------------------------------------------------*/
+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);