]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
DataFlash AT45DB021 support
authorSergey Lapin <slapin@ossfans.org>
Thu, 5 Jun 2008 07:06:29 +0000 (11:06 +0400)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Thu, 10 Jul 2008 20:50:28 +0000 (22:50 +0200)
Some boards based on AT91SAM926X-EK use smaller DF chips to keep
bootstrap, u-boot and its environment, using NAND or other external
storage for kernel and rootfs. This patch adds support for
small 1024x263 chip.

Signed-off-by: Sergey Lapin <slapin@ossfans.org>
drivers/mtd/dataflash.c
include/dataflash.h

index 8247aa03b5f30df32a39f598b79d172f8b497870..a092dc634fa7363e25cd1da93f404f522b4f7419 100644 (file)
@@ -54,6 +54,17 @@ int AT91F_DataflashInit (void)
                                &dataflash_info[i].Desc);
 
                switch (dfcode) {
+               case AT45DB021:
+                       dataflash_info[i].Device.pages_number = 1024;
+                       dataflash_info[i].Device.pages_size = 263;
+                       dataflash_info[i].Device.page_offset = 9;
+                       dataflash_info[i].Device.byte_mask = 0x300;
+                       dataflash_info[i].Device.cs = cs[i].cs;
+                       dataflash_info[i].Desc.DataFlash_state = IDLE;
+                       dataflash_info[i].logical_address = cs[i].addr;
+                       dataflash_info[i].id = dfcode;
+                       found[i] += dfcode;;
+                       break;
                case AT45DB161:
                        dataflash_info[i].Device.pages_number = 4096;
                        dataflash_info[i].Device.pages_size = 528;
@@ -178,6 +189,9 @@ void dataflash_print_info (void)
                if (dataflash_info[i].id != 0) {
                        printf("DataFlash:");
                        switch (dataflash_info[i].id) {
+                       case AT45DB021:
+                               printf("AT45DB021\n");
+                               break;
                        case AT45DB161:
                                printf("AT45DB161\n");
                                break;
index f20c738686f387b67f7c1bebe2d3fd8dc12a6129..80f0633aa944a4096b89fe4297795baa27003451 100644 (file)
@@ -137,6 +137,7 @@ struct dataflash_addr {
 /*-------------------------------------------------------------------------------------------------*/
 
 #define AT45DB161      0x2c
+#define AT45DB021      0x14
 #define AT45DB321      0x34
 #define AT45DB642      0x3c
 #define AT45DB128      0x10