changeset 2781:0b208f1f4dd5

Initialize the I2C subsystem with the right priority
author bartv
date Mon, 09 Feb 2009 22:22:54 +0000
parents b55bdbf25043
children 188914a57f30
files packages/io/i2c/current/ChangeLog packages/io/i2c/current/cdl/i2c.cdl packages/io/i2c/current/doc/i2c.sgml packages/io/i2c/current/src/i2c.cxx
diffstat 4 files changed, 21 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/packages/io/i2c/current/ChangeLog
+++ b/packages/io/i2c/current/ChangeLog
@@ -1,3 +1,11 @@
+2009-02-09  Bart Veer  <bartv@ecoscentric.com>
+
+	* cdl/i2c.cdl, src/i2c.cxx, doc/i2c.sgml: I2C buses now initialize
+	at a fixed priority CYG_INIT_BUS_I2C, instead of a configurable
+	priority with default CYG_INIT_DRIVERS.
+
+	doc/i2c.sgml: remove a spurious & in the bitbang description.
+	
 2008-12-30  John Dallaway  <john@dallaway.org.uk>
 
 	* cdl/i2c.cdl: Reference per-package documentation.
@@ -43,7 +51,7 @@ 2004-10-05  Bart Veer  <bartv@ecoscentri
 // ####GPLCOPYRIGHTBEGIN####                                                
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.                  
+// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.                  
 //
 // This program is free software; you can redistribute it and/or modify     
 // it under the terms of the GNU General Public License as published by     
--- a/packages/io/i2c/current/cdl/i2c.cdl
+++ b/packages/io/i2c/current/cdl/i2c.cdl
@@ -8,7 +8,7 @@
 ## ####ECOSGPLCOPYRIGHTBEGIN####                                            
 ## -------------------------------------------                              
 ## This file is part of eCos, the Embedded Configurable Operating System.   
-## Copyright (C) 2004 Free Software Foundation, Inc.                        
+## Copyright (C) 2004, 2009 Free Software Foundation, Inc.                        
 ##
 ## 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     
@@ -59,19 +59,6 @@ cdl_package CYGPKG_IO_I2C {
         be written and how I2C devices should be defined. There is also
         support for bit-banged I2C buses."
 
-    cdl_option CYGNUM_I2C_INIT_PRIORITY {
-	display		"I2C initialization priority"
-	flavor		data
-	default_value	{ "CYG_INIT_DRIVERS" }
-
-	description "
-            The generic I2C package will initialize each I2C bus during
-            system startup, using a prioritized static constructor. This
-            option controls the priority that is used. The default value,
-            CYG_INIT_DRIVERS, means that I2C buses get initialized early
-            on."
-    }
-
     cdl_component CYGPKG_IO_I2C_OPTIONS {
         display "I2C build options"
         flavor  none
--- a/packages/io/i2c/current/doc/i2c.sgml
+++ b/packages/io/i2c/current/doc/i2c.sgml
@@ -11,7 +11,7 @@
 <!-- =============================================================== -->
 <!-- ####ECOSDOCCOPYRIGHTBEGIN####                                   -->
 <!-- =============================================================== -->
-<!-- Copyright (C) 2004 Free Software Foundation, Inc.               -->
+<!-- Copyright (C) 2004, 2009 Free Software Foundation, Inc.         -->
 <!-- This material may be distributed only subject to the terms      -->
 <!-- and conditions set forth in the Open Publication License, v1.0  -->
 <!-- or later (the latest version is presently available at          -->
@@ -546,12 +546,11 @@ before the transaction is ended.
     <para>
 The generic package <varname>CYGPKG_IO_I2C</varname> arranges for all
 I2C bus devices to be initialized via a single prioritized C++ static
-constructor. Usually this constructor will run early on during system
-startup, before any application code. The default priority is
-<literal>CYG_INIT_DRIVERS</literal>, but this can be changed via the
-configuration option <varname>CYGNUM_I2C_INIT_PRIORITY</varname>.
-Other code should not try to access any of the I2C devices until after
-the buses have been initialized.
+constructor. This constructor will run early on during system startup,
+before any application code, with priority
+<literal>CYG_INIT_BUS_I2C</literal>. Other code should not try to
+access any of the I2C devices until after the buses have been
+initialized.
     </para>
   </refsect1>
 
@@ -730,7 +729,7 @@ hal_alaia_i2c_bitbang(cyg_i2c_bus* bus, 
     return result;
 }
 
-CYG_I2C_BITBANG_BUS(&amp;hal_alaia_i2c_bus, &amp;hal_alaia_i2c_bitbang);
+CYG_I2C_BITBANG_BUS(hal_alaia_i2c_bus, &amp;hal_alaia_i2c_bitbang);
     </programlisting>
     <para>
 This gives a structure <varname>hal_alaia_i2c_bus</varname> which can
@@ -768,9 +767,8 @@ The bitbang function should support the 
         <term><literal>CYG_I2C_BITBANG_INIT</literal></term>
         <listitem><para>
 This will be called during system initialization, as a side effect of
-a prioritized C++ static constructor. By default this constructor will
-run at <literal>CYG_INIT_DRIVERS</literal> priority. The bitbang
-function should ensure that both SCL and SDA are driven high.
+a prioritized C++ static constructor. The bitbang function should
+ensure that both SCL and SDA are driven high.
         </para></listitem>
       </varlistentry>
       <varlistentry>
--- a/packages/io/i2c/current/src/i2c.cxx
+++ b/packages/io/i2c/current/src/i2c.cxx
@@ -8,7 +8,7 @@
 // ####ECOSGPLCOPYRIGHTBEGIN####                                            
 // -------------------------------------------                              
 // This file is part of eCos, the Embedded Configurable Operating System.   
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.                  
+// Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.                  
 //
 // 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     
@@ -71,10 +71,6 @@
 // then all required code and data should get included, otherwise it
 // will all be elided.
 //
-// The init priority is configurable, defaulting to CYG_INIT_DRIVERS.
-// Arguably it should happen a bit earlier to allow other drivers to
-// perform I2C operations, but there is no CYG_INIT_BUS.
-//
 // All I2C buses are kept in a table, so that the init code can
 // iterate through each one.
 
@@ -87,7 +83,7 @@ class cyg_i2c_init {
     cyg_i2c_init();
 };
 
-static cyg_i2c_init cyg_i2c_init_object CYGBLD_ATTRIB_INIT_PRI(CYGNUM_I2C_INIT_PRIORITY);
+static cyg_i2c_init cyg_i2c_init_object CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_BUS_I2C);
 
 cyg_i2c_init::cyg_i2c_init()
 {