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]

Re: HAL RTC parameters fix


On Mon, 2003-07-21 at 05:34, Nick Garnett wrote:
> The attached patch converts all the HALs to define the RTC constants
> with "default_value" rather than "calculated". This makes it easier to
> redfine the clock rate. The old mechanism of using the
> CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE component did not work very
> well, since many HALs reference CYGNUM_HAL_RTC_PERIOD directly. As
> they must to avoid introducing unnecessary dependencies on the kernel.
> 
> The patch consequently eliminates the
> CYGPKG_KERNEL_COUNTERS_CLOCK_OVERRIDE component. The only real worry
> is that a little useful documentation has been lost -- I'm looking at
> adding something to the HAL documentation to compensate.
> 
> While this is a simple change, it does touch a lot of files. Hence it
> is being posted here for comments before being applied.
> 
> 

I found some over-zealous changes:

Index: hal/arm/arm9/innovator/current/cdl/hal_arm_arm9_innovator.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/hal/arm/arm9/innovator/current/cdl/hal_arm_arm9_innovator.cdl,v
retrieving revision 1.2
diff -u -5 -r1.2 hal_arm_arm9_innovator.cdl
--- hal/arm/arm9/innovator/current/cdl/hal_arm_arm9_innovator.cdl       13 Feb 2003 01:01:09 -0000  
        1.2
+++ hal/arm/arm9/innovator/current/cdl/hal_arm_arm9_innovator.cdl       18 Jul 2003 17:35:15 -0000
@@ -186,11 +186,11 @@
 #    }
 #
     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_COMM_CHANNELS {
         display      "Number of communication channels on the board"
         flavor       data
-        calculated   1
+        default_value 1
     }
  
     cdl_option CYGNUM_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL {
         display          "Debug serial port"
         active_if        CYGPRI_HAL_VIRTUAL_VECTOR_DEBUG_CHANNEL_CONFIGURABLE

Also, there are a lot of these values that just don't work if you want
to change the actual period.  Many of them are just numbers that have
been hand-calculated.  To make this truly flexible, they would have to
be adjusted to depend on the new period values.  For example, in the
PowerPC CSB281, it should probably be:
         cdl_option CYGNUM_HAL_RTC_PERIOD {
             display       "Real-time clock period"
             flavor        data
-            calculated    { (((CYGHWR_HAL_POWERPC_MEM_SPEED*1000000)/4)/100) }
+            default_value { (((CYGHWR_HAL_POWERPC_MEM_SPEED*1000000)/4)/CYGNUM_HAL_RTC_DENOMINATOR) }
         }

We should take care not to imply that the period is changeable (via
CYGNUM_HAL_RTC_DENOMINATOR mostly) if the calculations don't support
it.  n.b. I think that for the PowerPC targets, this change is correct,
i.e. the PERIOD values all have .../100 which should be replaced by
.../CYGNUM_HAL_RTC_DENOMINATOR

Other than these items, it looks straight forward to apply.


> 
> ______________________________________________________________________
-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


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