changeset 1566:aaf044e992cf

Fix buffered programming mode on parallel devices
author gthomas
date Tue, 06 Apr 2004 13:59:21 +0000
parents 5c539c544148
children 9a3dbd0dc33d
files packages/devs/flash/amd/am29xxxxx/current/ChangeLog packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl
diffstat 2 files changed, 8 insertions(+), 3 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,8 @@
+2004-04-06  Gary Thomas  <gary@mlbassoc.com>
+
+	* include/flash_am29xxxxx.inl (flash_program_buf): Buffered program
+	writes failed when configured for parallel devices.
+
 2003-10-21  Jay Foster   <jay@systech.com>
 
 	* include/flash_am29xxxxx_parts.inl (CYGHWR_DEVS_FLASH_AMD_AM29LV033C):
--- a/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl
+++ b/packages/devs/flash/amd/am29xxxxx/current/include/flash_am29xxxxx.inl
@@ -11,7 +11,7 @@
 // -------------------------------------------
 // This file is part of eCos, the Embedded Configurable Operating System.
 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
-// Copyright (C) 2002 Gary Thomas
+// Copyright (C) 2002, 2004 Gary Thomas
 //
 // eCos is free software; you can redistribute it and/or modify it under
 // the terms of the GNU General Public License as published by the Free
@@ -471,7 +471,7 @@ flash_program_buf(void* addr, void* data
                 rem_sect_size /= sizeof (flash_data_t);
             }
 
-            // Computer word count to write                
+            // Compute word count to write                
             nwords = flash_dev_info->bufsiz
                 - (((CYG_ADDRWORD) addr_v & mask) / sizeof (flash_data_t));
             if (nwords > len)
@@ -481,7 +481,7 @@ flash_program_buf(void* addr, void* data
             *f_s1 = FLASH_Setup_Code1;
             *f_s2 = FLASH_Setup_Code2;
             *SECT = FLASH_Load_Buffer;
-            *SECT = nwords - 1;
+            *SECT = FLASHWORD(nwords - 1);  // All devices need to see this
 
             // Load data into write buffer, flush buffer
             for(i = 0; i < nwords; i++)