changeset 2180:c1e37181a6da

* include/flash_am29xxxxx_parts.inl [CYGHWR_DEVS_FLASH_AMD_MX29LV128]: * cdl/flash_amd_am29xxxxx.cdl: Add MXIC MX29LV128 part. * include/flash_am29xxxxx.inl: (find_sector) Fixed dealing with bootblocks. Was returning device block size even for boot blocks.
author asl
date Sun, 09 Apr 2006 11:33:52 +0000
parents 74ad444238e4
children d9e9cf8adc85
files packages/devs/flash/amd/am29xxxxx/current/ChangeLog packages/devs/flash/amd/am29xxxxx/current/cdl/flash_amd_am29xxxxx.cdl packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx_parts.inl
diffstat 4 files changed, 49 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/packages/devs/flash/amd/am29xxxxx/current/ChangeLog
+++ b/packages/devs/flash/amd/am29xxxxx/current/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-03  Lars Povlsen  <lpovlsen@vitesse.com>
+
+	* include/flash_am29xxxxx_parts.inl [CYGHWR_DEVS_FLASH_AMD_MX29LV128]:
+	* cdl/flash_amd_am29xxxxx.cdl: Add MXIC MX29LV128 part.
+
+	* include/flash_am29xxxxx.inl: (find_sector) Fixed dealing with
+	bootblocks. Was returning device block size even for boot blocks.
+
 2006-02-15  Stephane Deltour  <stephane.deltour@barco.com>
 
 	* include/flash_am29xxxxx_parts.inl [CYGHWR_DEVS_FLASH_AMD_S29GL128N]:
--- a/packages/devs/flash/amd/am29xxxxx/current/cdl/flash_amd_am29xxxxx.cdl
+++ b/packages/devs/flash/amd/am29xxxxx/current/cdl/flash_amd_am29xxxxx.cdl
@@ -107,6 +107,16 @@ cdl_package CYGPKG_DEVS_FLASH_AMD_AM29XX
             part in the family."
     }
 
+    cdl_option CYGHWR_DEVS_FLASH_AMD_MX29LV128 {
+        display       "MXIC MX29LV128 flash memory support"
+        default_value 0
+        implements    CYGINT_DEVS_FLASH_AMD_VARIANTS
+        description   "
+            When this option is enabled, the AMD flash driver will be
+            able to recognize and handle the MX29LV128
+            part in the family."
+    }
+
     cdl_option CYGHWR_DEVS_FLASH_AMD_AM29LV160 {
         display       "AMD AM29LV160 flash memory support"
         default_value 0
--- a/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl
+++ b/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl
@@ -613,20 +613,18 @@ find_sector(volatile flash_data_t * addr
     if (flash_dev_info->bootblock) {
         cyg_uint32 * bootblocks = flash_dev_info->bootblocks;
         while (*bootblocks != _LAST_BOOTBLOCK) {
-            int ls = flash_dev_info->block_size;
-
-            if (*bootblocks++ == (res - base)) {
-                while (res + *bootblocks < a) {
+            if (*bootblocks++ == (res - base)) { /* Matching offset marker */
+                while (res + *bootblocks <= a) {
                     res += *bootblocks++;
                 }
+                *remain_size = *bootblocks - (a - res);
+                break;
             } else {
+                int ls = flash_dev_info->block_size;
                 // Skip over segment
                 while ((ls -= *bootblocks++) > 0) ;
             }
         }
-
-        if (*bootblocks != _LAST_BOOTBLOCK)   
-            *remain_size = *bootblocks - (a - res);
     }
     
     return (flash_data_t *) res;
--- a/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx_parts.inl
+++ b/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx_parts.inl
@@ -597,6 +597,32 @@
         bufsiz     : 16
     },
 #endif
+#ifdef CYGHWR_DEVS_FLASH_AMD_MX29LV128
+    {   // MX29LV128M-T
+        long_device_id: true,
+        device_id  : FLASHWORD(0x227e),
+        device_id2 : FLASHWORD(0x2211),
+        device_id3 : FLASHWORD(0x2201),
+        block_size : 0x10000 * CYGNUM_FLASH_INTERLEAVE,
+        block_count: 256,
+        device_size: 0x1000000 * CYGNUM_FLASH_INTERLEAVE,
+        base_mask  : ~(0x1000000 * CYGNUM_FLASH_INTERLEAVE - 1),
+        bootblock  : true,
+        bootblocks : { 0xff0000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       0x002000 * CYGNUM_FLASH_INTERLEAVE,
+                       _LAST_BOOTBLOCK
+                     },
+        banked     : false,
+        bufsiz     : 16
+    },
+#endif
 #ifdef CYGHWR_DEVS_FLASH_AMD_AM29LV160
     {   // MBM29LV160-T | AM29LV160-T
         device_id  : FLASHWORD(0x22c4),