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 - driver changes for am29xxxxx V2 driver


Device driver changes as per previous patch to the generic flash code

Bart

Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/Attic/ChangeLog,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 ChangeLog
--- ChangeLog	22 Nov 2004 12:06:12 -0000	1.1.2.4
+++ ChangeLog	22 Nov 2004 20:08:49 -0000
@@ -1,5 +1,8 @@
 2004-11-22  Bart Veer  <bartv@ecoscentric.com>
 
+	* include/am29xxxxx_dev.h, src/am29xxxxx.c, src/am29xxxxx_aux.c,
+	doc/am29xxxxx.sgml: implement changes to the interface between the
+	generic flash code and the device drivers.
 	* include/am29xxxxx_dev.h: rename cyg_block_info to
 	cyg_flash_block_info
 
Index: 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.2
diff -u -r1.1.2.2 am29xxxxx_dev.h
--- include/am29xxxxx_dev.h	22 Nov 2004 12:06:11 -0000	1.1.2.2
+++ include/am29xxxxx_dev.h	22 Nov 2004 20:08:57 -0000
@@ -82,21 +82,21 @@
 externC int cyg_am29xxxxx_init_cfi_1616(  struct cyg_flash_dev*);
 externC int cyg_am29xxxxx_init_cfi_16as8( struct cyg_flash_dev*);
 
-externC int cyg_am29xxxxx_erase_8(     struct cyg_flash_dev*, const cyg_flashaddr_t);
-externC int cyg_am29xxxxx_erase_16(    struct cyg_flash_dev*, const cyg_flashaddr_t);
-externC int cyg_am29xxxxx_erase_32(    struct cyg_flash_dev*, const cyg_flashaddr_t);
-externC int cyg_am29xxxxx_erase_88(    struct cyg_flash_dev*, const cyg_flashaddr_t);
-externC int cyg_am29xxxxx_erase_8888(  struct cyg_flash_dev*, const cyg_flashaddr_t);
-externC int cyg_am29xxxxx_erase_1616(  struct cyg_flash_dev*, const cyg_flashaddr_t);
-externC int cyg_am29xxxxx_erase_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_8(     struct cyg_flash_dev*, cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_16(    struct cyg_flash_dev*, cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_32(    struct cyg_flash_dev*, cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_88(    struct cyg_flash_dev*, cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_8888(  struct cyg_flash_dev*, cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_1616(  struct cyg_flash_dev*, cyg_flashaddr_t);
+externC int cyg_am29xxxxx_erase_16as8( struct cyg_flash_dev*, cyg_flashaddr_t);
 
-externC int cyg_am29xxxxx_program_8(     struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
-externC int cyg_am29xxxxx_program_16(    struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
-externC int cyg_am29xxxxx_program_32(    struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
-externC int cyg_am29xxxxx_program_88(    struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
-externC int cyg_am29xxxxx_program_8888(  struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
-externC int cyg_am29xxxxx_program_1616(  struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
-externC int cyg_am29xxxxx_program_16as8( struct cyg_flash_dev*, const cyg_flashaddr_t, const void*, const size_t);
+externC int cyg_am29xxxxx_program_8(     struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
+externC int cyg_am29xxxxx_program_16(    struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
+externC int cyg_am29xxxxx_program_32(    struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
+externC int cyg_am29xxxxx_program_88(    struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
+externC int cyg_am29xxxxx_program_8888(  struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
+externC int cyg_am29xxxxx_program_1616(  struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
+externC int cyg_am29xxxxx_program_16as8( struct cyg_flash_dev*, cyg_flashaddr_t, const void*, size_t);
 
 // FIXME: add program_buffered() support as per e.g. the AM29LV128
 // FIXME: add software lock/unlock support as per e.g. the AM29BDS640
Index: src/am29xxxxx.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/src/Attic/am29xxxxx.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 am29xxxxx.c
--- src/am29xxxxx.c	20 Nov 2004 18:09:53 -0000	1.1.2.1
+++ src/am29xxxxx.c	22 Nov 2004 20:08:57 -0000
@@ -207,7 +207,7 @@
 // A dummy query routine. The implementation of this is specific to
 // each device driver, and I choose to do as little as possible.
 size_t
-cyg_am29xxxxx_query_nop(struct cyg_flash_dev* dev, void* data, const size_t len)
+cyg_am29xxxxx_query_nop(struct cyg_flash_dev* dev, void* data, size_t len)
 {
     CYG_UNUSED_PARAM(struct cyg_flash_dev*, dev);
     CYG_UNUSED_PARAM(void*, data);
Index: src/am29xxxxx_aux.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/src/Attic/am29xxxxx_aux.c,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 am29xxxxx_aux.c
--- src/am29xxxxx_aux.c	20 Nov 2004 18:09:53 -0000	1.1.2.1
+++ src/am29xxxxx_aux.c	22 Nov 2004 20:08:59 -0000
@@ -377,7 +377,7 @@
     int                 result;
     
     CYG_CHECK_DATA_PTR(dev, "valid flash device pointer required");
-    am29_dev    = (cyg_am29xxxxx_dev*) dev->priv;
+    am29_dev    = (cyg_am29xxxxx_dev*) dev->priv;    // Remove const, only place where this is needed.
     addr        = AM29_P2V(dev->start);
     cfi_fn      = (int (*)(struct cyg_flash_dev*, cyg_am29xxxxx_dev*, volatile AM29_TYPE*))
         am29_anonymizer( & AM29_FNNAME(am29_hw_cfi));
@@ -399,7 +399,7 @@
 // Erase a single block. The calling code will have supplied a pointer
 // aligned to a block boundary.
 int
-AM29_FNNAME(cyg_am29xxxxx_erase)(struct cyg_flash_dev* dev, const cyg_flashaddr_t addr)
+AM29_FNNAME(cyg_am29xxxxx_erase)(struct cyg_flash_dev* dev, cyg_flashaddr_t addr)
 {
     void                (*erase_fn)(volatile AM29_TYPE*);
     volatile AM29_TYPE* block;
@@ -435,7 +435,7 @@
 // Write some data to the flash. The destination must be aligned
 // appropriately for the bus width (not the device width).
 int
-AM29_FNNAME(cyg_am29xxxxx_program)(struct cyg_flash_dev* dev, const cyg_flashaddr_t dest, const void* src, const size_t len)
+AM29_FNNAME(cyg_am29xxxxx_program)(struct cyg_flash_dev* dev, cyg_flashaddr_t dest, const void* src, size_t len)
 {
     void                (*program_fn)(volatile AM29_TYPE*, volatile AM29_TYPE*, const cyg_uint8*, cyg_uint32);
     volatile AM29_TYPE* block;
Index: doc/am29xxxxx.sgml
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/doc/Attic/am29xxxxx.sgml,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 am29xxxxx.sgml
--- doc/am29xxxxx.sgml	21 Nov 2004 23:48:19 -0000	1.1.2.2
+++ doc/am29xxxxx.sgml	22 Nov 2004 20:08:57 -0000
@@ -126,14 +126,14 @@
       <funcprototype>
         <funcdef>int <function>cyg_am29xxxxx_erase_XX</function></funcdef>
         <paramdef>struct cyg_flash_dev* <parameter>device</parameter></paramdef>
-        <paramdef>const cyg_flashaddr_t <parameter>addr</parameter></paramdef>
+        <paramdef>cyg_flashaddr_t <parameter>addr</parameter></paramdef>
       </funcprototype>
       <funcprototype>
         <funcdef>int <function>cyg_am29xxxxx_program_XX</function></funcdef>
         <paramdef>struct cyg_flash_dev* <parameter>device</parameter></paramdef>
-        <paramdef>const cyg_flashaddr_t <parameter>addr</parameter></paramdef>
+        <paramdef>cyg_flashaddr_t <parameter>addr</parameter></paramdef>
         <paramdef>const void* <parameter>data</parameter></paramdef>
-        <paramdef>const size_t <parameter>len</parameter></paramdef>
+        <paramdef>size_t <parameter>len</parameter></paramdef>
       </funcprototype>
       <funcprototype>
         <funcdef>int <function>cyg_am29xxxxx_query_nop</function></funcdef>
@@ -303,7 +303,7 @@
     &amp;cyg_am29xxxxx_query_nop,
     &amp;cyg_am29xxxxx_erase_16,
     &amp;cyg_am29xxxxx_program_16,
-    (int (*)(struct cyg_flash_dev*, const cyg_flashaddr_t, void*, const size_t))0,
+    (int (*)(struct cyg_flash_dev*, const cyg_flashaddr_t, void*, size_t))0,
     &amp;cyg_am29xxxxx_hwr_map_error_nop,
     &amp;cyg_am29xxxxx_lock_nop,
     &amp;cyg_am29xxxxx_unlock_nop);
@@ -318,14 +318,15 @@
     }
 };
 
-struct cyg_flash_dev hal_alaia_flash CYG_HAL_TABLE_ENTRY(cyg_flashdev) = {
-    .funs               = &amp;hal_alaia_flash_amd_funs,
-    .start              = 0xFFE00000,
-    .end                = 0xFFFFFFFF,
-    .num_block_infos    = 4,
-    .block_info         = hal_alaia_flash_priv.block_info,
-    .priv               = &amp;hal_alaia_flash_priv
-};
+CYG_FLASH_DRIVER(hal_alaia_flash,
+                 &amp;hal_alaia_flash_amd_funs,
+                 0,
+                 0xFFE00000,
+                 0xFFFFFFFF,
+                 4,
+                 hal_alaia_flash_priv.block_info,
+                 &amp;hal_alaia_flash_priv
+);
 #endif
     </programlisting>
     <para>
@@ -459,7 +460,7 @@
       </para>
       <programlisting width=72>
 static int
-alaia_flash_erase(struct cyg_flash_dev* dev, const cyg_flashaddr_t addr)
+alaia_flash_erase(struct cyg_flash_dev* dev, cyg_flashaddr_t addr)
 {
     int result;
     &hellip;  // Set up the hardware for an erase


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