From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9844 invoked by alias); 9 Feb 2009 22:22:48 -0000 Received: (qmail 9836 invoked by uid 22791); 9 Feb 2009 22:22:47 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from hagrid.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Feb 2009 22:22:37 +0000 Received: from localhost (hagrid.ecoscentric.com [127.0.0.1]) by mail.ecoscentric.com (Postfix) with ESMTP id 4336B3B4003E for ; Mon, 9 Feb 2009 22:22:35 +0000 (GMT) Received: from mail.ecoscentric.com ([127.0.0.1]) by localhost (hagrid.ecoscentric.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 381ZIrrJ9ntu; Mon, 9 Feb 2009 22:22:34 +0000 (GMT) Date: Mon, 09 Feb 2009 22:22:00 -0000 Message-Id: From: Bart Veer To: ecos-patches@sourceware.org Subject: update I2C subsystem to use the right init priority Mailing-List: contact ecos-patches-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-patches-owner@ecos.sourceware.org X-SW-Source: 2009-02/txt/msg00055.txt.bz2 All I2C buses now initialize at CYG_INIT_BUS_I2C. This also fixes a bug in the bitbanging documentation. Bart 2009-02-09 Bart Veer * 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. Index: cdl/i2c.cdl =================================================================== RCS file: /cvs/ecos/ecos/packages/io/i2c/current/cdl/i2c.cdl,v retrieving revision 1.3 diff -u -p -r1.3 i2c.cdl --- cdl/i2c.cdl 29 Jan 2009 17:49:47 -0000 1.3 +++ cdl/i2c.cdl 9 Feb 2009 22:19:49 -0000 @@ -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 Index: src/i2c.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/io/i2c/current/src/i2c.cxx,v retrieving revision 1.4 diff -u -p -r1.4 i2c.cxx --- src/i2c.cxx 29 Jan 2009 17:49:47 -0000 1.4 +++ src/i2c.cxx 9 Feb 2009 22:21:19 -0000 @@ -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() { Index: doc/i2c.sgml =================================================================== RCS file: /cvs/ecos/ecos/packages/io/i2c/current/doc/i2c.sgml,v retrieving revision 1.4 diff -u -p -r1.4 i2c.sgml --- doc/i2c.sgml 29 Jan 2009 17:49:47 -0000 1.4 +++ doc/i2c.sgml 9 Feb 2009 22:21:58 -0000 @@ -546,12 +546,11 @@ before the transaction is ended. The generic package CYGPKG_IO_I2C 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 -CYG_INIT_DRIVERS, but this can be changed via the -configuration option CYGNUM_I2C_INIT_PRIORITY. -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 +CYG_INIT_BUS_I2C. Other code should not try to +access any of the I2C devices until after the buses have been +initialized. @@ -730,7 +729,7 @@ hal_alaia_i2c_bitbang(cyg_i2c_bus* bus, return result; } -CYG_I2C_BITBANG_BUS(&hal_alaia_i2c_bus, &hal_alaia_i2c_bitbang); +CYG_I2C_BITBANG_BUS(hal_alaia_i2c_bus, &hal_alaia_i2c_bitbang); This gives a structure hal_alaia_i2c_bus which can @@ -768,9 +767,8 @@ The bitbang function should support the CYG_I2C_BITBANG_INIT This will be called during system initialization, as a side effect of -a prioritized C++ static constructor. By default this constructor will -run at CYG_INIT_DRIVERS 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.