]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
DataFlash: AT45DB021 fix and AT45DB081 support
authorSergey Lapin <slapin@ossfans.org>
Fri, 8 Aug 2008 21:39:09 +0000 (01:39 +0400)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Fri, 8 Aug 2008 22:15:06 +0000 (00:15 +0200)
Fix for page size of AT45DB021. Also adding bigger AT45DB081
which comes with some newer boards.

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

index 0ad48cdae91e7cd4a24835df61b8e2a54ca3c053..049da69fec3cc2bb2604b90cc7354b0713315045 100644 (file)
@@ -56,7 +56,7 @@ int AT91F_DataflashInit (void)
                switch (dfcode) {
                case AT45DB021:
                        dataflash_info[i].Device.pages_number = 1024;
-                       dataflash_info[i].Device.pages_size = 263;
+                       dataflash_info[i].Device.pages_size = 264;
                        dataflash_info[i].Device.page_offset = 9;
                        dataflash_info[i].Device.byte_mask = 0x300;
                        dataflash_info[i].Device.cs = cs[i].cs;
@@ -65,6 +65,19 @@ int AT91F_DataflashInit (void)
                        dataflash_info[i].id = dfcode;
                        found[i] += dfcode;;
                        break;
+
+               case AT45DB081:
+                       dataflash_info[i].Device.pages_number = 4096;
+                       dataflash_info[i].Device.pages_size = 264;
+                       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;
index 80f0633aa944a4096b89fe4297795baa27003451..de041397d35f0a906d00c81d2187cfa1471bbefe 100644 (file)
@@ -135,9 +135,9 @@ struct dataflash_addr {
        int cs;
 };
 /*-------------------------------------------------------------------------------------------------*/
-
 #define AT45DB161      0x2c
 #define AT45DB021      0x14
+#define AT45DB081      0x24
 #define AT45DB321      0x34
 #define AT45DB642      0x3c
 #define AT45DB128      0x10