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 - configury clean-up


This patch tries to clean up some of the configury issues related to
V2 flash. Unfortunately it will invalidate existing configurations:
two options have been removed because they were unnecessary, and one
has been renamed to get consistent naming. These changes are all in
the V2 world only, and I think it is better to get things sorted out
while it is all on a branch rather than in the trunk.

Specifically:

  CYGHWR_IO_FLASH_DEVICE_V2 did nothing and has been removed. Even a
  legacy device would be accessed via a V2 driver, implemented as
  wrappers over the legacy functions.

  I found CYGSEM_IO_FLASH_LEGACY_DEVICE_API vs.
  CYGHWR_IO_FLASH_DEVICE_LEGACY confusing. In particular there seemed
  to be no point in having LEGACY_DEVICE_API unless there was a legacy
  device. By disabling LEGACY_DEVICE_API you could also end up
  disabling the only flash device in the system, which made no sense.
  So I have removed CYGSEM_IO_FLASH_LEGACY_DEVICE_API and moved the
  functionality into CYGHWR_IO_FLASH_DEVICE_LEGACY

  Some Tcl scripting has been used to generate the block device
  configury, and as a side effect CYGSEM_IO_FLASH_BLOCK_DEVICE_2 is
  now CYGPKG_IO_FLASH_BLOCK_DEVICE_2. CYGSEM_ violated the naming
  conventions.

  I have changed the default offsets and lengths for the block
  devices, and added constraints to make the defaults invalid.
  Hence when enabling the block devices the user is now forced to set
  these to sensible values, rather than use defaults which are very
  unlikely to be appropriate for the target hardware.

  Finally some minor changes to descriptions and constraints.

Bart

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.1
diff -u -r1.1.2.1 ChangeLog
--- devs/flash/amd/am29xxxxxv2/current/ChangeLog	20 Nov 2004 18:09:54 -0000	1.1.2.1
+++ devs/flash/amd/am29xxxxxv2/current/ChangeLog	21 Nov 2004 16:34:54 -0000
@@ -1,3 +1,8 @@
+2004-11-21  Bart Veer  <bartv@ecoscentric.com>
+
+	* cdl/flash_am29xxxxx_v2.cdl: CYGHWR_IO_FLASH_DEVICE_V2 is now
+	implicit
+
 2004-11-05  Bart Veer  <bartv@ecoscentric.com>
 
 	* New AM29xxxxx flash driver created
Index: devs/flash/amd/am29xxxxxv2/current/cdl/flash_am29xxxxx_v2.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/amd/am29xxxxxv2/current/cdl/Attic/flash_am29xxxxx_v2.cdl,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 flash_am29xxxxx_v2.cdl
--- devs/flash/amd/am29xxxxxv2/current/cdl/flash_am29xxxxx_v2.cdl	20 Nov 2004 18:09:54 -0000	1.1.2.1
+++ devs/flash/amd/am29xxxxxv2/current/cdl/flash_am29xxxxx_v2.cdl	21 Nov 2004 16:34:54 -0000
@@ -49,7 +49,6 @@
     parent	CYGPKG_IO_FLASH
     active_if	CYGPKG_IO_FLASH
     implements	CYGHWR_IO_FLASH_DEVICE
-    implements	CYGHWR_IO_FLASH_DEVICE_V2
     include_dir	cyg/io
     compile	am29xxxxx.c
 
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.4
diff -u -r1.1.2.4 ChangeLog
--- devs/flash/atmel/dataflash/current/ChangeLog	20 Nov 2004 23:32:01 -0000	1.1.2.4
+++ devs/flash/atmel/dataflash/current/ChangeLog	21 Nov 2004 16:34:58 -0000
@@ -1,3 +1,8 @@
+2004-11-21  Bart Veer  <bartv@ecoscentric.com>
+
+	* cdl/devs_flash_atmel_dataflash.cdl: CYGHWR_IO_FLASH_DEVICE_V2 is
+	now implicit
+
 2004-11-20  Bart Veer  <bartv@ecoscentric.com>
 
 	* cdl/devs_flash_atmel_dataflash.cdl: data flash requires indirect
Index: devs/flash/atmel/dataflash/current/cdl/devs_flash_atmel_dataflash.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/atmel/dataflash/current/cdl/Attic/devs_flash_atmel_dataflash.cdl,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 devs_flash_atmel_dataflash.cdl
--- devs/flash/atmel/dataflash/current/cdl/devs_flash_atmel_dataflash.cdl	20 Nov 2004 23:32:01 -0000	1.1.2.4
+++ devs/flash/atmel/dataflash/current/cdl/devs_flash_atmel_dataflash.cdl	21 Nov 2004 16:34:58 -0000
@@ -61,7 +61,6 @@
         flavor          bool
         active_if       CYGPKG_IO_FLASH
         implements      CYGHWR_IO_FLASH_DEVICE
-        implements      CYGHWR_IO_FLASH_DEVICE_V2
 	implements	CYGHWR_IO_FLASH_INDIRECT_READS
         compile         devs_flash_atmel_dataflash_flash_dev_funs.c     
         description     "This option will be enabled by platforms which
Index: devs/flash/intel/stratav2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/stratav2/current/Attic/ChangeLog,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 ChangeLog
--- devs/flash/intel/stratav2/current/ChangeLog	14 Sep 2004 16:02:54 -0000	1.1.2.4
+++ devs/flash/intel/stratav2/current/ChangeLog	21 Nov 2004 16:35:01 -0000
@@ -1,3 +1,8 @@
+2004-11-21  Bart Veer  <bartv@ecoscentric.com>
+
+	* cdl/flash_strata_v2.cdl: CYGHWR_IO_FLASH_DEVICE_V2 is now
+	implicit
+
 2004-09-14  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/flash_strata_v2.inl: Return the end address which is the
Index: devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/intel/stratav2/current/cdl/Attic/flash_strata_v2.cdl,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 flash_strata_v2.cdl
--- devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl	21 Aug 2004 08:48:17 -0000	1.1.2.3
+++ devs/flash/intel/stratav2/current/cdl/flash_strata_v2.cdl	21 Nov 2004 16:35:01 -0000
@@ -56,7 +56,6 @@
     active_if	  CYGPKG_IO_FLASH
 
     implements    CYGHWR_IO_FLASH_DEVICE
-    implements    CYGHWR_IO_FLASH_DEVICE_V2
 
     active_if     CYGINT_DEVS_FLASH_STRATA_V2_REQUIRED
 
Index: devs/flash/synthv2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synthv2/current/Attic/ChangeLog,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 ChangeLog
--- devs/flash/synthv2/current/ChangeLog	14 Sep 2004 16:03:53 -0000	1.1.2.4
+++ devs/flash/synthv2/current/ChangeLog	21 Nov 2004 16:35:10 -0000
@@ -1,3 +1,10 @@
+2004-11-21  Bart Veer  <bartv@ecoscentric.com>
+
+	* tests/flash1.c (cyg_user_start):
+	CYGSEM_IO_FLASH_LEGACY_DEVICE_API has been removed, use
+	CYGHWR_IO_FLASH_DEVICE_LEGACY instead
+	* cdl/flash_synth.cdl: CYGHWR_IO_FLASH_DEVICE_V2 is now implicit
+
 2004-09-14  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/synth.c (synth_flash_erase_block): Remove asserts which are
Index: devs/flash/synthv2/current/cdl/flash_synth.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synthv2/current/cdl/Attic/flash_synth.cdl,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 flash_synth.cdl
--- devs/flash/synthv2/current/cdl/flash_synth.cdl	9 Sep 2004 13:13:23 -0000	1.1.2.2
+++ devs/flash/synthv2/current/cdl/flash_synth.cdl	21 Nov 2004 16:35:10 -0000
@@ -56,7 +56,6 @@
     requires      CYGINT_ISO_ERRNO_CODES
 
     implements    CYGHWR_IO_FLASH_DEVICE
-    implements    CYGHWR_IO_FLASH_DEVICE_V2
     
     include_dir   cyg/flash
     description   "FLASH memory device support for Synthetic target"
Index: devs/flash/synthv2/current/tests/flash1.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/flash/synthv2/current/tests/Attic/flash1.c,v
retrieving revision 1.1.2.2
diff -u -r1.1.2.2 flash1.c
--- devs/flash/synthv2/current/tests/flash1.c	9 Sep 2004 13:13:23 -0000	1.1.2.2
+++ devs/flash/synthv2/current/tests/flash1.c	21 Nov 2004 16:35:10 -0000
@@ -94,7 +94,7 @@
   
     CYG_TEST_PASS_FAIL((ret == FLASH_ERR_OK),"flash_init");
 
-#ifdef CYGSEM_IO_FLASH_LEGACY_DEVICE_API
+#ifdef CYGHWR_IO_FLASH_DEVICE_LEGACY
     //Strictly speaking, this is a device driver call, not a user API call.
     flash_dev_query(data);
     CYG_TEST_PASS_FAIL(!strncmp(data,"Linux Synthetic Flash",sizeof(data)),
Index: io/flash/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/ChangeLog,v
retrieving revision 1.38.2.14
diff -u -r1.38.2.14 ChangeLog
--- io/flash/current/ChangeLog	21 Nov 2004 12:09:43 -0000	1.38.2.14
+++ io/flash/current/ChangeLog	21 Nov 2004 16:36:00 -0000
@@ -1,5 +1,9 @@
 2004-11-21  Bart Veer  <bartv@ecoscentric.com>
 
+	* include/flash_priv.h, include/flash.h:
+	CYGSEM_IO_FLASH_LEGACY_DEVICE_API has been removed, test
+	CYGHWR_IO_FLASH_DEVICE_LEGACY instead 
+	* cdl/io_flash.cdl: lots of clean-ups
 	* src/legacy_dev.c (legacy_flash_read): only needed if the
 	underlying legacy driver required indirect reads.
 	* src/flash.c: encapsulate various optional bits of code in
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.2
diff -u -r1.18.2.2 flash.h
--- io/flash/current/include/flash.h	21 Aug 2004 13:47:56 -0000	1.18.2.2
+++ io/flash/current/include/flash.h	21 Nov 2004 16:36:03 -0000
@@ -151,7 +151,7 @@
 externC char *flash_errmsg(int err);
 #endif // CYGSEM_IO_FLASH_LEGACY_API
 
-#if defined(CYGSEM_IO_FLASH_LEGACY_API) || defined(CYGSEM_IO_FLASH_LEGACY_DEVICE_API)
+#if defined(CYGSEM_IO_FLASH_LEGACY_API) || defined(CYGHWR_IO_FLASH_DEVICE_LEGACY)
 #define FLASH_ERR_OK              CYG_FLASH_ERR_OK              
 #define FLASH_ERR_INVALID         CYG_FLASH_ERR_INVALID         
 #define FLASH_ERR_ERASE           CYG_FLASH_ERR_ERASE           
Index: io/flash/current/include/flash_priv.h
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/include/Attic/flash_priv.h,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 flash_priv.h
--- io/flash/current/include/flash_priv.h	5 Aug 2004 13:50:01 -0000	1.1.2.1
+++ io/flash/current/include/flash_priv.h	21 Nov 2004 16:36:04 -0000
@@ -120,7 +120,7 @@
    .start = _start,                                                   \
 };
 
-#ifdef CYGSEM_IO_FLASH_LEGACY_DEVICE_API
+#ifdef CYGHWR_IO_FLASH_DEVICE_LEGACY
 struct flash_info {
   int   block_size;   // Assuming fixed size "blocks"
   int   blocks;       // Number of blocks
@@ -135,7 +135,7 @@
 externC int  flash_hwr_init(void);
 externC int  flash_hwr_map_error(int err);
 externC void flash_dev_query(void *data);
-#endif // CYGSEM_IO_FLASH_LEGACY_DEVICE_API
+#endif // CYGHWR_IO_FLASH_DEVICE_LEGACY
 // 
 // Some FLASH devices may require additional support, e.g. to turn on
 // appropriate voltage drivers, before any operation.
Index: io/flash/current/cdl/io_flash.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/flash/current/cdl/io_flash.cdl,v
retrieving revision 1.17.2.2
diff -u -r1.17.2.2 io_flash.cdl
--- io/flash/current/cdl/io_flash.cdl	20 Nov 2004 23:32:00 -0000	1.17.2.2
+++ io/flash/current/cdl/io_flash.cdl	21 Nov 2004 16:36:01 -0000
@@ -44,7 +45,7 @@
 #
 # Author(s):      gthomas
 # Original data:  gthomas
-# Contributors:   woehler
+# Contributors:   woehler, bartv
 # Date:           2000-07-06
 #
 #####DESCRIPTIONEND####
@@ -52,82 +53,63 @@
 # ====================================================================
 
 cdl_package CYGPKG_IO_FLASH {
-    display       "FLASH device drivers"
-    include_dir   cyg/io
-    doc           ref/flash.html
-    description   "
-        This option enables drivers for basic I/O services on
-        flash devices."
-    requires CYGPKG_ISOINFRA
-    requires CYGINT_ISO_STRING_STRFUNCS
+    display         "FLASH device drivers"
+    include_dir     cyg/io
+    doc             ref/flash.html
+    description     "
+        This package provides support for the flash devices on the
+        current platform."
+    requires    CYGPKG_ISOINFRA
+    requires    CYGINT_ISO_STRING_STRFUNCS
 
-    compile       flash.c
+    compile     flash.c
  
-    define_proc {
-        puts $::cdl_header "#include <pkgconf/system.h>"
-        puts $::cdl_header "#ifdef CYGDAT_IO_FLASH_DEVICE_HEADER"
-        puts $::cdl_header "# include CYGDAT_IO_FLASH_DEVICE_HEADER"
-        puts $::cdl_header "#endif "
-    }
-
     cdl_interface CYGHWR_IO_FLASH_DEVICE {
-        display       "Hardware FLASH device drivers"
-        description   "
-            This option enables the hardware device drivers
-            for the current platform."
-    }
-
-    cdl_interface CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM {
-        display       "Hardware FLASH device drivers are not in RAM"
-        flavor        booldata
-        description   "
-            Use of this interface is deprecated.
-            Drivers should make sure that the functions are
-            linked to RAM by putting them in .2ram sections."
-            requires !CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM
+        display     "Hardware FLASH device drivers"
+        description "
+            This calculated option gives the number of flash devices
+            on the current platform."
     }
 
     cdl_interface CYGHWR_IO_FLASH_BLOCK_LOCKING {
-        display       "Hardware can support block locking"
-        flavor        booldata
-        description   "
+        display     "Hardware can support block locking"
+        flavor      booldata
+        description "
             This option will be enabled by devices which can support
-            locking (write-protection) of individual blocks."
+            locking (write-protection) of individual flash blocks. If
+            none of the devices support locking then the relevant code
+            in the generic flash package can be eliminated."
     }
 
     cdl_interface CYGHWR_IO_FLASH_INDIRECT_READS {
-	display		"Hardware requires indirect reads"
-	flavor		booldata
+	display	    "Hardware requires indirect reads"
+	flavor	    booldata
 	description "
             Some flash devices can be read directly like any other
             memory. Others can only be accessed indirectly, which
             involves extra code. If none of the flash devices on the
             target hardware use indirect reads then the extra code
-            can be eliminated."   
+            can be eliminated."
     }
     
     cdl_interface CYGHWR_IO_FLASH_DEVICE_LEGACY {
-        display       "Hardware driver uses the legacy interface"
-        flavor        booldata
-        description   "
-            The flash device driver implements the legacy interface to the 
-            flash library"
+        display     "Hardware driver uses the legacy interface"
+        flavor      booldata
+        compile     -library=libextras.a legacy_dev.c
+        description "
+            The generic flash code can work with either a legacy device
+            driver or with V2 drivers. If a legacy driver is used on the
+            current platform then this option will be implemented."
+	requires    { CYGHWR_IO_FLASH_DEVICE_LEGACY <= 1 }
     }
 
-    cdl_interface CYGHWR_IO_FLASH_DEVICE_V2 {
-        display       "Hardware driver uses the V2 interface"
-        flavor        booldata
-        description   "
-            The flash device driver implements the V2 interface to the 
-            flash library"
-    }
-        
     cdl_option CYGSEM_IO_FLASH_READ_INDIRECT {
-        display       "Hardware cannot support direct access to FLASH memory"
-        flavor        bool
-        default_value 0
-        requires      { !CYGSEM_IO_FLASH_VERIFY_PROGRAM }
-        description   "
+	display         "Legacy device driver uses indirect reads."
+	active_if       CYGHWR_IO_FLASH_DEVICE_LEGACY
+        flavor          bool
+        default_value   0
+        requires        { !CYGSEM_IO_FLASH_VERIFY_PROGRAM }
+        description     "
             This option will be asserted by devices which cannot support
             direct access to the FLASH memory contents (e.g. EEPROM or NAND
             devices).  In these cases, the driver must provide an appropriate
@@ -135,19 +117,20 @@
     }
 
     cdl_option CYGSEM_IO_FLASH_CHATTER {
-        display          "Display status messages during flash operations"
-        flavor           bool
-        default_value    1
-        description      "
-           Selecting this option will cause the drivers to print status
+        display         "Display status messages during flash operations"
+        flavor          bool
+        default_value   1
+        description     "
+           Selecting this option will cause the flash code to print status
            messages as various flash operations are undertaken."
     }
 
     cdl_option CYGSEM_IO_FLASH_VERIFY_PROGRAM {
-        display          "Verify data programmed to flash"
-        flavor           bool
-        default_value    1
-        description      "
+        display         "Verify data programmed to flash"
+        flavor          bool
+        default_value   1
+	active_if	{ CYGHWR_IO_FLASH_INDIRECT_READS < CYGHWR_IO_FLASH_DEVICE }
+        description     "
            Selecting this option will cause verification of data
            programmed to flash."
     }
@@ -162,7 +145,6 @@
            write-protected or not."
     }
 
-
     cdl_option CYGSEM_IO_FLASH_LEGACY_API {
         display          "Provide the legacy user API"
         flavor           bool
@@ -173,185 +155,133 @@
             onto the new API via a small layer of code"
     }
         
-    cdl_option CYGSEM_IO_FLASH_LEGACY_DEVICE_API {
-        display          "Provide the legacy device API"
-        flavor           bool
-        default_value    CYGHWR_IO_FLASH_DEVICE_LEGACY
-        compile          -library=libextras.a legacy_dev.c
-        description      "
-            Provide an implementation of the legacy device API. This can be 
-            used to interface to one legacy device."
-    }
-    
     cdl_component CYGPKG_IO_FLASH_BLOCK_DEVICE {
-        display         "Instantiate in I/O block device API"
+        display         "Provide /dev block devices"
         flavor          bool
         active_if       CYGPKG_IO
         default_value   0
         compile         -library=libextras.a flashiodev.c
         description     "
-                Provides a block device accessible using the standard I/O
-                API ( cyg_io_read() etc. )"
-
-        cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_1 {
-            display       "Name of flash device 1 block device"
-            flavor        data
-            default_value { "\"/dev/flash1\"" }
-                
-            cdl_interface CYGINT_IO_FLASH_BLOCK_CFG_1 {
-                  requires 1 == CYGINT_IO_FLASH_BLOCK_CFG_1
-                  no_define
-            }
-
-            cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_1 {
-                  display       "Static configuration via offset"
-                  default_value 1
-                  implements    CYGINT_IO_FLASH_BLOCK_CFG_1
-                  description   "
-                        This configures the flash device 1 block device
+            Provide one or more block devices below /dev which can be
+            accessed using standard I/O functions such as eCos cyg_io_read()
+            and POSIX open()."
+
+	for { set ::dev 1 } { $::dev <= 2 } { incr ::dev } {
+	    
+	    cdl_component CYGPKG_IO_FLASH_BLOCK_DEVICE_$::dev {
+		display       "Provide block device $::dev"
+		if { 1 == $::dev } {
+		    default_value 1
+		} else {
+		    default_value 0
+		}
+		description "Provide block device $::dev for use with standard I/O"
+
+		cdl_option CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_$::dev {
+		    display       "Name of flash block device $::dev"
+		    flavor        data
+		    default_value "\"\\\"/dev/flash$::dev\\\"\""
+		    description "
+                        This option determines the name by which the block
+                        device can be accessed."
+		}
+		
+		cdl_interface CYGINT_IO_FLASH_BLOCK_CFG_$::dev {
+		    requires 1 == CYGINT_IO_FLASH_BLOCK_CFG_$::dev
+		    no_define
+		}
+
+		cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_$::dev {
+		    display         "Static configuration via offset"
+		    default_value   1
+		    implements      CYGINT_IO_FLASH_BLOCK_CFG_$::dev
+		    description     "
+                        This configures the flash block device $::dev
                         with static offset from the base of the first
                         flash device and length"
-                        
-                  cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_1 {
-                      display         "Start offset from flash base"
-                      flavor          data
-                      default_value   0x100000
-                      description     "
+		    
+		    cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_$::dev {
+			display         "Start offset from flash base"
+			flavor          data
+			default_value   0xFFFFFFFF
+			requires        0xFFFFFFFF != CYGNUM_IO_FLASH_BLOCK_OFFSET_$::dev
+			description     "
                             This gives the offset from the base of flash 
                             of the first flash device which this block device 
                             corresponds to."
-                  }
-                  cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_1 {
-                      display         "Length"
-                      flavor          data
-                      default_value   0x100000
-                      description     "
+		    }
+		    cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_$::dev {
+			display         "Length"
+			flavor          data
+			default_value   0
+			requires        0 != CYGNUM_IO_FLASH_BLOCK_OFFSET_$::dev
+			description     "
                             This gives the length of the region of flash given over
                             to this block device."
-                  }
-            }
-            cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_ABSOLUTE_1 {
-                  display       "Absolute static configuration"
-                  default_value 0
-                  implements    CYGINT_IO_FLASH_BLOCK_CFG_1
-                  description   "
-                        This configures the flash device 1 block device
+		    }
+		}
+		
+		cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_ABSOLUTE_$::dev {
+		    display         "Static configuration via absolute address"
+		    default_value   0
+		    implements      CYGINT_IO_FLASH_BLOCK_CFG_$::dev
+		    description     "
+                        This configures the flash block device $::dev
                         with absolute base address and a length"
-                        
-                   cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_1 {
-                       display         "Start offset from flash base"
-                       flavor          data
-                       default_value   0x4000000
-                       description     "
-                             This gives the absolute address in flash which this
-                             block device corresponds to."
-                   }
-                   cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_1 {
-                       display         "Length"
-                       flavor          data
-                       default_value   0x100000
-                       description     "
-                             This gives the length of the region of flash given over
-                             to this block device."
-                   }
-             }
-             cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_FIS_1 {
-                    display       "Configuration from FIS"
-                    default_value 0
-                    implements    CYGINT_IO_FLASH_BLOCK_CFG_1
-                    description   "
-                          This configures the flash device 1 block device
+		    
+		    cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_$::dev {
+			display         "Start offset from flash base"
+			flavor          data
+			default_value   0xFFFFFFFF
+			requires        0xFFFFFFFF != CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_$::dev
+			description     "
+                            This gives the absolute address in flash which this
+                            block device corresponds to."
+		    }
+		    cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_$::dev {
+			display         "Length"
+			flavor          data
+			default_value   0
+			requires	0 != CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_$::dev
+			description     "
+                            This gives the length of the region of flash given over
+                            to this block device."
+		    }
+		}
+		
+		cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_FIS_$::dev {
+		    display         "Configuration from FIS"
+		    default_value   0
+		    implements      CYGINT_IO_FLASH_BLOCK_CFG_$::dev
+		    description     "
+                          This configures the flash block device $::dev
                           from Redboot FIS"
-                                       
-                     cdl_component CYGDAT_IO_FLASH_BLOCK_FIS_NAME_1 {
-                            display       "Name of FIS entry"
-                            flavor        data
-                            default_value { "\"jffs2\"" }   
-                     }
-            }        
-        }        
-        cdl_component CYGSEM_IO_FLASH_BLOCK_DEVICE_2 {
-               display       "Implements a second block device"
-               default_value 0
-
-               cdl_component CYGDAT_IO_FLASH_BLOCK_DEVICE_NAME_2 {
-               display       "Name of flash device 2 block device"
-               flavor        data
-               default_value { "\"/dev/flash2\"" }
-                
-               cdl_interface CYGINT_IO_FLASH_BLOCK_CFG_2 {
-                             requires 1 == CYGINT_IO_FLASH_BLOCK_CFG_2
-                             no_define
-               }
-
-               cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_2 {
-                      display       "Static configuration via offset"
-                      default_value 1
-                      implements    CYGINT_IO_FLASH_BLOCK_CFG_2
-                      description   "
-                            This configures the flash device 2 block device
-                            with static offset from the base of the first
-                            flash device and length"
-                        
-                      cdl_option CYGNUM_IO_FLASH_BLOCK_OFFSET_2 {
-                            display         "Start offset from flash base"
-                            flavor          data
-                            default_value   0x100000
-                            description     "
-                                  This gives the offset from the base of flash 
-                                  of the first flash device which this block device 
-                                  corresponds to."
-                      }
-                      cdl_option CYGNUM_IO_FLASH_BLOCK_LENGTH_2 {
-                            display         "Length"
-                            flavor          data
-                            default_value   0x100000
-                            description     "
-                                  This gives the length of the region of flash 
-                                  given over to this block device."
-                      }       
-               }
-               cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_STATIC_ABSOLUTE_2 {
-                      display       "Absolute static configuration"
-                      default_value 0
-                      implements    CYGINT_IO_FLASH_BLOCK_CFG_2
-                      description   "
-                            This configures the flash device 2 block device
-                            with absolute base address and a length"
-                        
-                      cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_START_2 {
-                            display         "Start offset from flash base"
-                            flavor          data
-                            default_value   0x4000000
-                            description     "
-                                  This gives the absolute address in flash which this
-                                  block device corresponds to."
-                      }
-                      cdl_option CYGNUM_IO_FLASH_BLOCK_ABSOLUTE_LENGTH_2 {
-                            display         "Length"
-                            flavor          data
-                            default_value   0x100000
-                            description     "
-                                  This gives the length of the region of flash 
-                                  given over to this block device."
-                      }
-               }
-
-               cdl_component CYGNUM_IO_FLASH_BLOCK_CFG_FIS_2 {
-                      display       "Configuration from FIS"
-                      default_value 0
-                      implements    CYGINT_IO_FLASH_BLOCK_CFG_2
-                      description   "
-                            This configures the flash device 2 block device
-                            from Redboot FIS"
-                                       
-                      cdl_component CYGDAT_IO_FLASH_BLOCK_FIS_NAME_2 {
-                            display       "Name of FIS entry"
-                            flavor        data
-                            default_value { "\"jffs2-2\"" }   
-                      }
-               }        
+		    
+		    cdl_component CYGDAT_IO_FLASH_BLOCK_FIS_NAME_$::dev {
+			display     "Name of FIS entry"
+			flavor      data
+			requires    "\"\"" != CYGDAT_IO_FLASH_BLOCK_FIS_NAME_$::dev
+			if { 1 == $::dev } {
+			    default_value { "\"jffs2\"" }
+			} elseif { 2 == $::dev } {
+			    default_value { "\"jffs2-2\"" }
+			} else {
+			    default_value { "\"\"" }
+			}
+		    }
+		}
             }
-         }
-     }
+	}
+    }
+
+    # FIXME: remove in next release
+    cdl_interface CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM {
+        display       "Hardware FLASH device drivers are not in RAM"
+        flavor        booldata
+        description   "
+            Use of this interface is deprecated.
+            Drivers should make sure that the functions are
+            linked to RAM by putting them in .2ram sections."
+            requires !CYGHWR_IO_FLASH_DEVICE_NOT_IN_RAM
+    }
 }


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