summaryrefslogtreecommitdiff
path: root/cesar/ecos/packages/hal/sparc
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro2012-06-06 10:45:56 +0200
committerCyril Jourdan2012-09-20 17:00:08 +0200
commit15163a61d2f8280608afdef1de0d3668b5121225 (patch)
tree1bc5b32e9f7e5ae73c32b89042d30b1be6daba14 /cesar/ecos/packages/hal/sparc
parent5d26e826dd195bd3ac55a357ad32334d2c23258e (diff)
cesar/{ecos,hal}: add sysclock support in boot params, refs #3147
eCos system clock is provided by boot params, this is useful to have the same plc.rom file for mse500 and spc300 without knowing the system clock frequency. This system clock differs from one chip to another (147Mhz for spc300 and ~250Mhz for mse500).
Diffstat (limited to 'cesar/ecos/packages/hal/sparc')
-rw-r--r--cesar/ecos/packages/hal/sparc/leon/current/include/hal_clock.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/cesar/ecos/packages/hal/sparc/leon/current/include/hal_clock.h b/cesar/ecos/packages/hal/sparc/leon/current/include/hal_clock.h
index 51255b7325..87a90fe61f 100644
--- a/cesar/ecos/packages/hal/sparc/leon/current/include/hal_clock.h
+++ b/cesar/ecos/packages/hal/sparc/leon/current/include/hal_clock.h
@@ -99,10 +99,11 @@
#define SPARC_LEON_TI1_CONTROL (SPARC_LEON_REG + 0x48)
externC cyg_int32 cyg_hal_sparc_clock_period;
+externC cyg_int32 cyg_hal_system_clock_freq;
#define HAL_CLOCK_INITIALIZE( _period_ ) CYG_MACRO_START \
- HAL_WRITE_UINT32( SPARC_LEON_SCALER, (CYGNUM_HAL_SYSTEM_CLOCK_FREQ-1) );\
- HAL_WRITE_UINT32( SPARC_LEON_SRELOAD, (CYGNUM_HAL_SYSTEM_CLOCK_FREQ-1) );\
+ HAL_WRITE_UINT32( SPARC_LEON_SCALER, (cyg_hal_system_clock_freq-1) );\
+ HAL_WRITE_UINT32( SPARC_LEON_SRELOAD, (cyg_hal_system_clock_freq-1) );\
cyg_hal_sparc_clock_period = (_period_); \
HAL_WRITE_UINT32( SPARC_LEON_TI1_CRELOAD, (_period_) ); \
HAL_WRITE_UINT32( SPARC_LEON_TI1_COUNTER, (_period_) ); \