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]

V2 flash - header file clean-up


This patch performs a little clean-up in the V2 flash code. It
eliminates one of the exported headers, <cyg/io/flash_priv.h>, leaving
just <cyg/io/flash.h> defining the public API and <cyg/io/flash_dev.h>
containing everything needed for writing a flash driver. Effectively
flash_priv.h has been merged into flash_dev.h. Previously drivers
tended to use:

  #define _FLASH_PRIVATE_
  #include <cyg/io/flash.h>

Instead they now use:

  #include <cyg/io/flash_dev.h>

_FLASH_PRIVATE_ does still serve a purpose: if it is defined when
#include'ing <cyg/io/flash_dev.h> then that header will export utility
macros FLASH_P2V() and FLASHWORD(). This is for use by device drivers
which still use those macros.

Bart

Index: io/flash/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/ChangeLog,v
retrieving revision 1.38.2.24
diff -u -r1.38.2.24 ChangeLog
--- io/flash/current/ChangeLog	29 Nov 2004 14:49:21 -0000	1.38.2.24
+++ io/flash/current/ChangeLog	22 Feb 2005 20:36:22 -0000
@@ -1,3 +1,15 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* include/flash_dev.h: now provides everything needed by flash
+	device drivers.
+
+	* include/flash_priv.h: removed, subsumed by flash_dev.h
+	
+	* include/flash.h, src/flash.c, src/flashiodev.c,
+	  src/legacy_api.c, src/legacy_dev.c:
+	Replace implicit #include's of <cyg/io/flash_priv.h> with explicit
+	#include's of <cyg/io/flash_dev.h>
+
 2004-11-29  Bart Veer  <bartv@ecoscentric.com>
 	
 	* include/flash_priv.h, src/flash.c, src/legacy_dev.c: remove
Index: io/flash/current/include/flash.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/include/flash.h,v
retrieving revision 1.18.2.5
diff -u -r1.18.2.5 flash.h
--- io/flash/current/include/flash.h	22 Nov 2004 12:05:57 -0000	1.18.2.5
+++ io/flash/current/include/flash.h	22 Feb 2005 20:36:41 -0000
@@ -189,8 +189,4 @@
 } cyg_io_flash_getconfig_blocksize_t;
 #endif
 
-#ifdef _FLASH_PRIVATE_
-#include <cyg/io/flash_priv.h>
-#endif
-
 #endif  // _IO_FLASH_H_
Index: io/flash/current/include/flash_dev.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/include/flash_dev.h,v
retrieving revision 1.6
diff -u -r1.6 flash_dev.h
--- io/flash/current/include/flash_dev.h	14 Apr 2003 11:59:19 -0000	1.6
+++ io/flash/current/include/flash_dev.h	22 Feb 2005 20:36:55 -0000
@@ -42,6 +45,144 @@
 //==========================================================================
 //#####DESCRIPTIONBEGIN####
 //
+// Author(s):    gthomas
+// Contributors: gthomas, Andrew Lunn, bartv
+// Date:         2000-07-14
+// Purpose:      
+// Description:  
+//              
+//####DESCRIPTIONEND####
+//
+//==========================================================================
+
+#include <pkgconf/system.h>
+#include <pkgconf/io_flash.h>
+#include <cyg/infra/cyg_type.h>
+#include <cyg/io/flash.h>
+#include <cyg/hal/hal_cache.h>
+#include <cyg/hal/hal_tables.h>
+
+// Forward reference of the device structure
+struct cyg_flash_dev;
+
+// Structure of pointers to functions in the device driver
+struct cyg_flash_dev_funs {
+  int     (*flash_init) (struct cyg_flash_dev *dev);
+  size_t  (*flash_query) (struct cyg_flash_dev *dev,
+                          void * data, size_t len);
+  int     (*flash_erase_block) (struct cyg_flash_dev *dev, 
+                                cyg_flashaddr_t block_base);
+  int     (*flash_program) (struct cyg_flash_dev *dev, 
+                            cyg_flashaddr_t base, 
+                            const void* data, size_t len);
+  int     (*flash_read) (struct cyg_flash_dev *dev, 
+                         const cyg_flashaddr_t base, 
+                         void* data, size_t len);
+#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING    
+  int     (*flash_block_lock) (struct cyg_flash_dev *dev, 
+                               const cyg_flashaddr_t block_base);
+  int     (*flash_block_unlock) (struct cyg_flash_dev *dev, 
+                                 const cyg_flashaddr_t block_base);
+#endif    
+};
+
+// Dummy functions for some of the above operations, if a device does
+// not support e.g. locking.
+externC int     cyg_flash_devfn_init_nop(struct cyg_flash_dev*);
+externC size_t  cyg_flash_devfn_query_nop(struct cyg_flash_dev*, void*, const size_t);
+externC int     cyg_flash_devfn_lock_nop(struct cyg_flash_dev*, const cyg_flashaddr_t);
+externC int     cyg_flash_devfn_unlock_nop(struct cyg_flash_dev*, const cyg_flashaddr_t);
+
+// Facilitate function calls between flash-resident code and .2ram
+// functions.
+externC void*   cyg_flash_anonymizer(void*);
+
+// Structure each device places in the HAL table
+struct cyg_flash_dev {
+  const struct cyg_flash_dev_funs *funs;            // Function pointers
+  cyg_uint32                      flags;            // Device characteristics
+  cyg_flashaddr_t                 start;            // First address
+  cyg_flashaddr_t                 end;              // Last address
+  cyg_uint32                      num_block_infos;  // Number of entries
+  const cyg_flash_block_info_t    *block_info;      // Info about one block size
+
+  const void                      *priv;            // Devices private data
+
+  // The following are only written to by the FLASH IO layer.
+  cyg_flash_printf                *pf;              // Pointer to diagnostic printf
+  bool                            init;             // Device has been initialised
+#ifdef CYGPKG_KERNEL
+  cyg_mutex_t                     mutex;            // Mutex for thread safeness
+#endif
+#if (CYGHWR_IO_FLASH_DEVICE > 1)    
+  struct cyg_flash_dev            *next;            // Pointer to next device
+#endif    
+} CYG_HAL_TABLE_TYPE;
+
+// Macros for instantiating the above structures.
+#ifdef CYGHWR_IO_FLASH_BLOCK_LOCKING
+# define CYG_FLASH_FUNS(_funs_, _init_, _query_ , _erase_, _prog_ , _read_, _lock_, _unlock_) \
+struct cyg_flash_dev_funs _funs_ =      \
+{										\
+	.flash_init             = _init_,   \
+	.flash_query            = _query_,  \
+	.flash_erase_block      = _erase_,  \
+	.flash_program          = _prog_,   \
+	.flash_read             = _read_,   \
+	.flash_block_lock       = _lock_,   \
+	.flash_block_unlock     = _unlock_  \
+}
+#else
+# define CYG_FLASH_FUNS(_funs_, _init_, _query_ , _erase_, _prog_ , _read_, _lock_, _unlock_) \
+struct cyg_flash_dev_funs _funs_ =      \
+{										\
+	.flash_init             = _init_,   \
+	.flash_query            = _query_,  \
+	.flash_erase_block      = _erase_,  \
+	.flash_program          = _prog_,   \
+	.flash_read             = _read_    \
+}
+#endif
+
+// We assume HAL tables are placed into RAM.
+#define CYG_FLASH_DRIVER(_name_, _funs_, _flags_, _start_, _end_, _num_block_infos_, _block_info_, _priv_)  \
+struct cyg_flash_dev _name_ CYG_HAL_TABLE_ENTRY(cyg_flashdev) = \
+{                                                               \
+    .funs               = _funs_,                               \
+    .flags              = _flags_,                              \
+    .start              = _start_,                              \
+    .end                = _end_,                                \
+    .num_block_infos    = _num_block_infos_,                    \
+    .block_info         = _block_info_,                         \
+    .priv               = _priv_                                \
+}
+
+// Additional support for legacy device drivers.
+#ifdef CYGHWR_IO_FLASH_DEVICE_LEGACY
+struct flash_info {
+  int	block_size;	  // Assuming fixed size "blocks"
+  int	blocks;		  // Number of blocks
+  int	buffer_size;  // Size of write buffer (only defined for some devices)
+  unsigned long block_mask;
+  void *start, *end;  // Address range
+  int	init;
+  cyg_flash_printf *pf;
+};
+
+externC struct flash_info flash_info;
+externC int	 flash_hwr_init(void);
+externC int	 flash_hwr_map_error(int err);
+externC void flash_dev_query(void *data);
+#endif // CYGHWR_IO_FLASH_DEVICE_LEGACY
+
+// ----------------------------------------------------------------------------
+// This section provides utility macros used by some flash drivers, especially
+// the legacy ones. Such flash drivers need to #define _FLASH_PRIVATE before
+// including this file.
+
+#ifdef _FLASH_PRIVATE_
+
+//==========================================================================
 // Author(s):    hmt
 // Contributors: hmt, jskov, Jose Pascual <josepascual@almudi.com>
 // Date:         2001-02-22
@@ -53,16 +194,8 @@
 //               The FLASH_P2V macro can be used to fix up non-linear
 //               mappings of flash blocks (defaults to a linear 
 //               implementation).
-//              
-//####DESCRIPTIONEND####
-//
 //==========================================================================
 
-#ifdef _FLASH_PRIVATE_
-#include <cyg/infra/cyg_type.h>
-
-// ------------------------------------------------------------------------
-//
 // No mapping on this target - but these casts would be needed if some
 // manipulation did occur.  An example of this might be:
 // // First 4K page of flash at physical address zero is
@@ -165,3 +298,4 @@
 #endif // CYGONCE_IO_FLASH_FLASH_DEV_H
 //----------------------------------------------------------------------------
 // end of flash_dev.h
+
Index: io/flash/current/src/flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/flash.c,v
retrieving revision 1.26.2.17
diff -u -r1.26.2.17 flash.c
--- io/flash/current/src/flash.c	29 Nov 2004 14:49:20 -0000	1.26.2.17
+++ io/flash/current/src/flash.c	22 Feb 2005 20:38:59 -0000
@@ -65,8 +65,8 @@
 #include <cyg/infra/cyg_ass.h>
 #include <string.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 #include "flash_legacy.h"
 
 // When this flag is set, do not actually jump to the relocated code.
Index: io/flash/current/src/flashiodev.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/flashiodev.c,v
retrieving revision 1.8.2.6
diff -u -r1.8.2.6 flashiodev.c
--- io/flash/current/src/flashiodev.c	21 Aug 2004 13:47:56 -0000	1.8.2.6
+++ io/flash/current/src/flashiodev.c	22 Feb 2005 20:39:13 -0000
@@ -51,9 +51,7 @@
 //
 //==========================================================================
 
-#define _FLASH_PRIVATE_
 #include <pkgconf/io_flash.h>
-
 #include <errno.h>
 #include <cyg/infra/cyg_type.h>
 #include <cyg/io/devtab.h>
Index: io/flash/current/src/legacy_api.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/Attic/legacy_api.c,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 legacy_api.c
--- io/flash/current/src/legacy_api.c	21 Aug 2004 13:47:56 -0000	1.1.2.2
+++ io/flash/current/src/legacy_api.c	22 Feb 2005 20:39:34 -0000
@@ -53,7 +53,6 @@
 #include <pkgconf/system.h>
 #include <pkgconf/io_flash.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
 
 int
Index: io/flash/current/src/legacy_dev.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/src/Attic/legacy_dev.c,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 legacy_dev.c
--- io/flash/current/src/legacy_dev.c	29 Nov 2004 14:49:20 -0000	1.1.2.11
+++ io/flash/current/src/legacy_dev.c	22 Feb 2005 20:39:45 -0000
@@ -58,8 +58,8 @@
 #include <cyg/hal/hal_cache.h>
 #include <string.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 #include "flash_legacy.h"
 
 // When this flag is set, do not actually jump to the relocated code.
Index: devs/flash/amd/am29xxxxxv2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/Attic/ChangeLog,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 ChangeLog
--- devs/flash/amd/am29xxxxxv2/current/ChangeLog	29 Nov 2004 14:49:23 -0000	1.1.2.7
+++ devs/flash/amd/am29xxxxxv2/current/ChangeLog	22 Feb 2005 20:40:06 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/am29xxxxx.c, include/am29xxxxx_dev.h: <cyg/io/flash_priv.h>
+	no longer exists, use <cyg/io/flash_dev.h> instead.
+
 2004-11-29  Bart Veer  <bartv@ecoscentric.com>
 
 	* include/am29xxxxx_dev.h, src/am29xxxxx.c: eliminate
Index: devs/flash/amd/am29xxxxxv2/current/include/am29xxxxx_dev.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/include/Attic/am29xxxxx_dev.h,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 am29xxxxx_dev.h
--- devs/flash/amd/am29xxxxxv2/current/include/am29xxxxx_dev.h	29 Nov 2004 14:49:23 -0000	1.1.2.5
+++ devs/flash/amd/am29xxxxxv2/current/include/am29xxxxx_dev.h	22 Feb 2005 20:40:17 -0000
@@ -50,7 +50,7 @@
 #include <pkgconf/devs_flash_amd_am29xxxxx_v2.h>
 #include <cyg/infra/cyg_type.h>
 #include <cyg/io/flash.h>
-#include <cyg/io/flash_priv.h>
+#include <cyg/io/flash_dev.h>
 
 externC int cyg_am29xxxxx_read_devid_8(     struct cyg_flash_dev*);
 externC int cyg_am29xxxxx_read_devid_16(    struct cyg_flash_dev*);
Index: devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/src/Attic/am29xxxxx.c,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 am29xxxxx.c
--- devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c	29 Nov 2004 14:49:22 -0000	1.1.2.4
+++ devs/flash/amd/am29xxxxxv2/current/src/am29xxxxx.c	22 Feb 2005 20:40:33 -0000
@@ -50,7 +50,7 @@
 #include <cyg/infra/cyg_ass.h>
 #include <cyg/infra/diag.h>
 #include <cyg/io/flash.h>
-#include <cyg/io/flash_priv.h>
+#include <cyg/io/flash_dev.h>
 #include <cyg/io/am29xxxxx_dev.h>
 #include <cyg/hal/hal_arch.h>
 #include <cyg/hal/hal_cache.h>
Index: devs/flash/arm/at91/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/at91/current/Attic/ChangeLog,v
retrieving revision 1.3.4.1
diff -u -r1.3.4.1 ChangeLog
--- devs/flash/arm/at91/current/ChangeLog	5 Aug 2004 13:38:16 -0000	1.3.4.1
+++ devs/flash/arm/at91/current/ChangeLog	22 Feb 2005 20:41:08 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/at91_flash.c: explicitly include <cyg/io/flash_dev.h> rather
+	than just defining _FLASH_PRIVATE_
+
 2004-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* cdl/flash_at91.cdl: Indicate we need the legacy device API.
Index: devs/flash/arm/at91/current/src/at91_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/at91/current/src/Attic/at91_flash.c,v
retrieving revision 1.3
diff -u -r1.3 at91_flash.c
--- devs/flash/arm/at91/current/src/at91_flash.c	23 May 2002 23:00:50 -0000	1.3
+++ devs/flash/arm/at91/current/src/at91_flash.c	22 Feb 2005 20:41:17 -0000
@@ -55,8 +55,8 @@
 #include <cyg/hal/hal_cache.h>
 #include <cyg/hal/hal_io.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "flash.h"
 
Index: devs/flash/arm/ebsa285/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/ebsa285/current/ChangeLog,v
retrieving revision 1.13.2.1
diff -u -r1.13.2.1 ChangeLog
--- devs/flash/arm/ebsa285/current/ChangeLog	5 Aug 2004 13:38:16 -0000	1.13.2.1
+++ devs/flash/arm/ebsa285/current/ChangeLog	22 Feb 2005 20:41:27 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/ebsa285_flash.c: explicitly include <cyg/io/flash_dev.h>
+	rather than just defining _FLASH_PRIVATE_
+
 2004-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* cdl/flash_ebsa285.cdl: Indicate we need the legacy device API.
Index: devs/flash/arm/ebsa285/current/src/ebsa285_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/ebsa285/current/src/ebsa285_flash.c,v
retrieving revision 1.10
diff -u -r1.10 ebsa285_flash.c
--- devs/flash/arm/ebsa285/current/src/ebsa285_flash.c	14 Sep 2003 13:12:31 -0000	1.10
+++ devs/flash/arm/ebsa285/current/src/ebsa285_flash.c	22 Feb 2005 20:41:40 -0000
@@ -54,8 +54,8 @@
 #include <cyg/hal/hal_arch.h>
 #include <cyg/infra/diag.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "flash.h"
 
Index: devs/flash/arm/edb7xxx/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/ChangeLog,v
retrieving revision 1.10.2.1
diff -u -r1.10.2.1 ChangeLog
--- devs/flash/arm/edb7xxx/current/ChangeLog	5 Aug 2004 13:38:17 -0000	1.10.2.1
+++ devs/flash/arm/edb7xxx/current/ChangeLog	22 Feb 2005 20:41:53 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/edb7xxx_flash.c: explicitly include <cyg/io/flash_dev.h>
+	rather than just defining _FLASH_PRIVATE_
+
 2004-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* cdl/flash_edb7xxx.cdl: Indicate we need the legacy device API.
Index: devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c,v
retrieving revision 1.7
diff -u -r1.7 edb7xxx_flash.c
--- devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c	20 Nov 2003 12:33:37 -0000	1.7
+++ devs/flash/arm/edb7xxx/current/src/edb7xxx_flash.c	22 Feb 2005 20:42:04 -0000
@@ -53,8 +53,8 @@
 #include <pkgconf/hal.h>
 #include <cyg/hal/hal_arch.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "flash.h"
 
Index: devs/flash/arm/iq80310/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/ChangeLog,v
retrieving revision 1.11.2.1
diff -u -r1.11.2.1 ChangeLog
--- devs/flash/arm/iq80310/current/ChangeLog	5 Aug 2004 13:38:18 -0000	1.11.2.1
+++ devs/flash/arm/iq80310/current/ChangeLog	22 Feb 2005 20:42:15 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/iq80310_flash.c: explicitly include <cyg/io/flash_dev.h>
+	rather than just defining _FLASH_PRIVATE_
+
 2004-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* cdl/flash_iq80310.cdl: Indicate we need the legacy device API
Index: devs/flash/arm/iq80310/current/src/iq80310_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/iq80310/current/src/iq80310_flash.c,v
retrieving revision 1.6
diff -u -r1.6 iq80310_flash.c
--- devs/flash/arm/iq80310/current/src/iq80310_flash.c	4 Oct 2003 18:30:21 -0000	1.6
+++ devs/flash/arm/iq80310/current/src/iq80310_flash.c	22 Feb 2005 20:42:27 -0000
@@ -54,8 +54,8 @@
 #include <cyg/hal/hal_arch.h>
 #include <cyg/infra/diag.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "flash.h"
 
Index: devs/flash/arm/sa1100mm/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/sa1100mm/current/ChangeLog,v
retrieving revision 1.9.2.1
diff -u -r1.9.2.1 ChangeLog
--- devs/flash/arm/sa1100mm/current/ChangeLog	5 Aug 2004 13:38:18 -0000	1.9.2.1
+++ devs/flash/arm/sa1100mm/current/ChangeLog	22 Feb 2005 20:42:41 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/sa1100mm_flash.c: explicitly include <cyg/io/flash_dev.h>
+	rather than just defining _FLASH_PRIVATE_
+
 2004-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* cdl/flash_sa1100mm.cdl: Indicate we need the legacy device API.
Index: devs/flash/arm/sa1100mm/current/src/sa1100mm_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/arm/sa1100mm/current/src/sa1100mm_flash.c,v
retrieving revision 1.7
diff -u -r1.7 sa1100mm_flash.c
--- devs/flash/arm/sa1100mm/current/src/sa1100mm_flash.c	14 Sep 2003 13:15:24 -0000	1.7
+++ devs/flash/arm/sa1100mm/current/src/sa1100mm_flash.c	22 Feb 2005 20:42:51 -0000
@@ -53,8 +53,8 @@
 #include <pkgconf/hal.h>
 #include <cyg/hal/hal_arch.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "flash.h"
 
Index: devs/flash/atmel/dataflash/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/atmel/dataflash/current/Attic/ChangeLog,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 ChangeLog
--- devs/flash/atmel/dataflash/current/ChangeLog	29 Nov 2004 14:49:22 -0000	1.1.2.9
+++ devs/flash/atmel/dataflash/current/ChangeLog	22 Feb 2005 20:43:00 -0000
@@ -1,3 +1,9 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* include/dataflash.h,
+	src/devs_flash_atmel_dataflash_flash_dev_funs.c: include
+	<cyg/io/flash_dev.h> explicitly rather than using _FLASH_PRIVATE_
+
 2004-11-29  Bart Veer  <bartv@ecoscentric.com>
 
 	(df_flash_hwr_map_error): this is now internal to the driver, no
Index: devs/flash/atmel/dataflash/current/include/dataflash.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/atmel/dataflash/current/include/Attic/dataflash.h,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 dataflash.h
--- devs/flash/atmel/dataflash/current/include/dataflash.h	22 Nov 2004 21:05:43 -0000	1.1.2.3
+++ devs/flash/atmel/dataflash/current/include/dataflash.h	22 Feb 2005 20:43:11 -0000
@@ -98,8 +98,8 @@
 
 //----------------------------------------------------------------------------
 
-#ifdef _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 typedef struct cyg_dataflash_flash_dev_priv_s
 {
@@ -128,8 +128,6 @@
                      cyg_dataflash_priv_ ## name.block_info,                    \
                      & cyg_dataflash_priv_ ## name                              \
         )
-
-#endif // _FLASH_PRIVATE_
     
 //----------------------------------------------------------------------------
 
Index: devs/flash/atmel/dataflash/current/src/devs_flash_atmel_dataflash_flash_dev_funs.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/atmel/dataflash/current/src/Attic/devs_flash_atmel_dataflash_flash_dev_funs.c,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 devs_flash_atmel_dataflash_flash_dev_funs.c
--- devs/flash/atmel/dataflash/current/src/devs_flash_atmel_dataflash_flash_dev_funs.c	29 Nov 2004 14:49:22 -0000	1.1.2.6
+++ devs/flash/atmel/dataflash/current/src/devs_flash_atmel_dataflash_flash_dev_funs.c	22 Feb 2005 20:43:23 -0000
@@ -56,8 +56,6 @@
 #include <cyg/infra/cyg_type.h>
 #include <cyg/infra/cyg_ass.h>
 #include <cyg/io/spi.h>
-
-#define  _FLASH_PRIVATE_
 #include <cyg/io/dataflash.h>
 
 // -------------------------------------------------------------------------- 
Index: devs/flash/intel/strata/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/ChangeLog,v
retrieving revision 1.20
diff -u -r1.20 ChangeLog
--- devs/flash/intel/strata/current/ChangeLog	26 Jan 2004 23:59:10 -0000	1.20
+++ devs/flash/intel/strata/current/ChangeLog	22 Feb 2005 20:43:40 -0000
@@ -1,3 +1,7 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/strata.c: leave _FLASH_PRIVATE_ to the private strata.h
+
 2005-01-26  Scott Wilkinson <scott@alliantnetworks.com>
 	* src/strata.h:
 	* src/strata.c:
Index: devs/flash/intel/strata/current/src/strata.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/strata/current/src/strata.c,v
retrieving revision 1.9
diff -u -r1.9 strata.c
--- devs/flash/intel/strata/current/src/strata.c	26 Jan 2004 23:59:10 -0000	1.9
+++ devs/flash/intel/strata/current/src/strata.c	22 Feb 2005 20:43:51 -0000
@@ -54,9 +54,7 @@
 #include <pkgconf/hal.h>
 #include <cyg/hal/hal_arch.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
-
 #include "strata.h"
 
 #define _si(p) ((p[1]<<8)|p[0])
Index: devs/flash/mips/atlas/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/mips/atlas/current/ChangeLog,v
retrieving revision 1.6.2.1
diff -u -r1.6.2.1 ChangeLog
--- devs/flash/mips/atlas/current/ChangeLog	5 Aug 2004 13:38:21 -0000	1.6.2.1
+++ devs/flash/mips/atlas/current/ChangeLog	22 Feb 2005 20:44:02 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/atlas_flash.c: include <cyg/io/flash_dev.h> explicitly
+	rather than defining _FLASH_PRIVATE_
+
 2004-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* cdl/flash_atlas.cdl: Indicate we need the legacy device API
Index: devs/flash/mips/atlas/current/src/atlas_flash.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/mips/atlas/current/src/atlas_flash.c,v
retrieving revision 1.5
diff -u -r1.5 atlas_flash.c
--- devs/flash/mips/atlas/current/src/atlas_flash.c	23 Sep 2003 09:50:18 -0000	1.5
+++ devs/flash/mips/atlas/current/src/atlas_flash.c	22 Feb 2005 20:44:10 -0000
@@ -54,8 +54,8 @@
 #include <cyg/hal/hal_arch.h>
 #include <cyg/infra/diag.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "flash.h"
 
Index: devs/flash/synth/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synth/current/ChangeLog,v
retrieving revision 1.4.2.2
diff -u -r1.4.2.2 ChangeLog
--- devs/flash/synth/current/ChangeLog	22 Nov 2004 16:39:27 -0000	1.4.2.2
+++ devs/flash/synth/current/ChangeLog	22 Feb 2005 20:44:21 -0000
@@ -1,3 +1,9 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* src/synth.c: explicitly include <cyg/io/flash_dev.h> rather than
+	just defining _FLASH_PRIVATE_
+	* tests/flash2.c (cyg_user_start): update as per the v2 testcase
+
 2004-11-22  Bart Veer  <bartv@ecoscentric.com>
 
 	* cdl/flash_synth.cdl: fix testcase definitions
Index: devs/flash/synth/current/src/synth.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synth/current/src/synth.c,v
retrieving revision 1.3.4.1
diff -u -r1.3.4.1 synth.c
--- devs/flash/synth/current/src/synth.c	5 Aug 2004 13:34:45 -0000	1.3.4.1
+++ devs/flash/synth/current/src/synth.c	22 Feb 2005 20:44:30 -0000
@@ -57,8 +57,8 @@
 #include <errno.h>
 #include <string.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 #include "synth.h"
 
Index: devs/flash/synth/current/tests/flash2.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synth/current/tests/Attic/flash2.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 flash2.c
--- devs/flash/synth/current/tests/flash2.c	5 Aug 2004 13:37:09 -0000	1.1.2.1
+++ devs/flash/synth/current/tests/flash2.c	22 Feb 2005 20:49:16 -0000
@@ -80,9 +80,9 @@
 void cyg_user_start(void)
 {
     int ret;
-    cyg_flashaddr_t flash_start, flash_end;
+    cyg_flashaddr_t flash_start=0, flash_end=0;
     cyg_flash_info_t info;
-    int block_size, blocks;
+    int block_size=0, blocks=0;
     cyg_flashaddr_t prog_start;
     unsigned char * ptr;
     cyg_uint32 i=0;
@@ -94,25 +94,17 @@
   
     CYG_TEST_PASS_FAIL((ret == CYG_FLASH_ERR_OK),"flash_init");
 
-    ret = cyg_flash_get_limits(&flash_start,&flash_end);
-    CYG_TEST_PASS_FAIL((ret == CYG_FLASH_ERR_OK),"flash_get_limits");
-    diag_printf("INFO: flash_start=%p, flash_end=%p\n", 
-                flash_start, flash_end);
-    
-    ret = cyg_flash_get_block_info(&block_size, &blocks);
-    CYG_TEST_PASS_FAIL((ret == CYG_FLASH_ERR_OK),"flash_get_block_info");
-    CYG_TEST_PASS_FAIL((block_size == CYGNUM_FLASH_SYNTH_BLOCKSIZE),
-                      "correct block size");
-    CYG_TEST_PASS_FAIL((blocks == CYGNUM_FLASH_SYNTH_NUMBLOCKS),
-                      "correct number of blocks");
-    
-    diag_printf("INFO: block_size=0x%x, blocks=%d\n", block_size, blocks);
-    
     do {
       ret = cyg_flash_get_info(i, &info);
       if (ret == CYG_FLASH_ERR_OK) {
         diag_printf("INFO: Nth=%d, start=%p, end=%p\n",
                     i, info.start, info.end);
+        if (i == 0) {
+          flash_start = info.start;
+          flash_end = info.end;
+          block_size = info.block_info[0].block_size;
+          blocks = info.block_info[0].blocks;
+        }
         for (j=0;j < info.num_block_infos; j++) {
           diag_printf("INFO:\t block_size %d, blocks %d\n",
                       info.block_info[j].block_size,
Index: devs/flash/synthv2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synthv2/current/Attic/ChangeLog,v
retrieving revision 1.1.2.9
diff -u -r1.1.2.9 ChangeLog
--- devs/flash/synthv2/current/ChangeLog	29 Nov 2004 14:49:21 -0000	1.1.2.9
+++ devs/flash/synthv2/current/ChangeLog	22 Feb 2005 20:45:25 -0000
@@ -1,3 +1,8 @@
+2004-12-02  Bart Veer  <bartv@ecoscentric.com>
+
+	* include/synth.h, src/synth.c: explicitly include
+	<cyg/io/flash_dev.h> rather than just defining _FLASH_PRIVATE_
+
 2004-11-29  Bart Veer  <bartv@ecoscentric.com>
 
 	* src/synth.c: eliminate hwr_map_error() support, no longer needed
Index: devs/flash/synthv2/current/include/synth.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synthv2/current/include/Attic/synth.h,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 synth.h
--- devs/flash/synthv2/current/include/synth.h	22 Nov 2004 20:54:04 -0000	1.1.2.3
+++ devs/flash/synthv2/current/include/synth.h	22 Feb 2005 20:45:36 -0000
@@ -52,7 +52,8 @@
 //
 //==========================================================================
 
-#include <cyg/io/flash_priv.h>
+#include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 
 // Structure of data private to each flash device
 struct cyg_flash_synth_priv 
Index: devs/flash/synthv2/current/src/synth.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synthv2/current/src/Attic/synth.c,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 synth.c
--- devs/flash/synthv2/current/src/synth.c	29 Nov 2004 14:49:21 -0000	1.1.2.6
+++ devs/flash/synthv2/current/src/synth.c	22 Feb 2005 20:45:46 -0000
@@ -56,8 +56,8 @@
 #include <cyg/infra/cyg_ass.h>
 #include <string.h>
 
-#define  _FLASH_PRIVATE_
 #include <cyg/io/flash.h>
+#include <cyg/io/flash_dev.h>
 #include <cyg/flash/synth.h>
 
 #ifndef MIN


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