This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Atmel at29cxxxx flash driver with two devices parallel (16 bit access)


The atached patch improves the Atmel at29cxxxx flash driver so, that it works 
with 16 bit wide access.

The driver have to write 256 times after each command sequence, but with 16 
bit wide or two 8 bit divices parallel, the driver writes only 128 times.

Roland Caßebohm

Index: packages/devs/flash/atmel/at29cxxxx/current/ChangeLog
===================================================================
RCS file: /home/cassebohm/net/USERS/CVSROOT/VSprojects/ecos/packages/devs/flash/atmel/at29cxxxx/current/ChangeLog,v
retrieving revision 1.1.1.1
diff -u -5 -p -r1.1.1.1 ChangeLog
--- packages/devs/flash/atmel/at29cxxxx/current/ChangeLog	29 Sep 2003 15:15:36 -0000	1.1.1.1
+++ packages/devs/flash/atmel/at29cxxxx/current/ChangeLog	2 Oct 2003 10:32:22 -0000
@@ -1,5 +1,12 @@
+2003-10-02  Roland Cassebohm  <r.cassebohm@visionsystems.de>
+
+	* include/flash_at29cxxxx.inl: Improves driver, to work with 16 bit
+	wide access. The driver have to write 256 times after each command 
+	sequence, but with two 8 bit divices parallel, the driver writes
+	only 128 times.
+
 2001-09-13  Jesper Skov  <jskov@redhat.com>
 
 	* include/flash_at29cxxxx.inl: Added support for AT29LV1024. Added
 	code to erase blocks. Made driver work with 16bit wide
 	parts. Fixed flash size calculations.
Index: packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl
===================================================================
RCS file: /home/cassebohm/net/USERS/CVSROOT/VSprojects/ecos/packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl,v
retrieving revision 1.1.1.1
diff -u -5 -p -r1.1.1.1 flash_at29cxxxx.inl
--- packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl	29 Sep 2003 15:15:36 -0000	1.1.1.1
+++ packages/devs/flash/atmel/at29cxxxx/current/include/flash_at29cxxxx.inl	2 Oct 2003 10:45:09 -0000
@@ -230,14 +230,13 @@ flash_erase_block(void* block, unsigned 
         ROM[FLASH_Setup_Addr1] = FLASH_Program;
 
         addr_ptr2 = addr_ptr;
         len2 = len;
 
-        // Always load 256 bytes
-        for (i = 0; i < 256;) {
+        // Always load 256 times
+        for (i = 0; i < 256; i++) {
             *addr_ptr2++ = FLASH_BlankValue;
-            i += sizeof(*addr_ptr2);
         }
 
         // Wait for completion (bit 6 stops toggling)
         timeout = 5000000;
         prev_state = *addr_ptr & FLASH_Busy;
@@ -303,19 +302,18 @@ flash_program_buf(void* addr, void* data
 
         addr_ptr2 = addr_ptr;
         data_ptr2 = data_ptr;
         len2 = len;
 
-        // Always load 256 bytes
-        for (i = 0; i < 256;) {
+        // Always load 256 times
+        for (i = 0; i < 256; i++) {
             if (len2 > 0) {
                 *addr_ptr2++ = *data_ptr2++;
                 len2 -= sizeof(*data_ptr2);
             } else {
                 *addr_ptr2++ = FLASH_BlankValue;
             }
-            i += sizeof(*data_ptr2);
         }
 
         // Wait for completion (bit 6 stops toggling)
         timeout = 5000000;
         prev_state = *addr_ptr & FLASH_Busy;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]