aboutsummaryrefslogtreecommitdiff
path: root/include/dataflash.h
diff options
context:
space:
mode:
authorwdenk <wdenk>2003-12-06 23:55:10 +0000
committerwdenk <wdenk>2003-12-06 23:55:10 +0000
commit5779d8d985d95104ad74332f5fa3cb6c67645509 (patch)
treefe9c2bacd2e097b24c4968ae8e929bd28d74c167 /include/dataflash.h
parent8bf3b005ddee3eee179ec961e1c2bd0693e3b79d (diff)
downloadu-boot-linaro-stable-5779d8d985d95104ad74332f5fa3cb6c67645509.tar.gz
* 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
Diffstat (limited to 'include/dataflash.h')
-rw-r--r--include/dataflash.h22
1 files changed, 13 insertions, 9 deletions
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 <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 @@ 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);