Changeset a4ff2a2 in rtems
- Timestamp:
- 06/21/16 08:24:13 (7 years ago)
- Branches:
- 5, master
- Children:
- bc884f6
- Parents:
- 291945f1
- git-author:
- Sebastian Huber <sebastian.huber@…> (06/21/16 08:24:13)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (06/21/16 13:54:18)
- Location:
- c/src/lib/libbsp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/shared/include/fatal.h
r291945f1 ra4ff2a2 1 1 /* 2 * Copyright (c) 2012 -2015embedded brains GmbH. All rights reserved.2 * Copyright (c) 2012, 2016 embedded brains GmbH. All rights reserved. 3 3 * 4 4 * embedded brains GmbH … … 56 56 LEON3_FATAL_INVALID_CACHE_CONFIG_MAIN_PROCESSOR, 57 57 LEON3_FATAL_INVALID_CACHE_CONFIG_SECONDARY_PROCESSOR, 58 LEON3_FATAL_CLOCK_NO_IRQMP_TIMESTAMP_SUPPORT, 58 59 59 60 /* LPC24XX fatal codes */ -
c/src/lib/libbsp/sparc/leon3/clock/ckinit.c
r291945f1 ra4ff2a2 13 13 * COPYRIGHT (c) 2004. 14 14 * Gaisler Research. 15 * 16 * Copyright (c) 2014, 2016 embedded brains GmbH 15 17 * 16 18 * The license and distribution terms for this file may be … … 80 82 } 81 83 #endif 84 85 static uint32_t leon3_tc_get_timecount_up_counter(struct timecounter *tc) 86 { 87 return leon3_up_counter_low(); 88 } 82 89 83 90 static uint32_t leon3_tc_get_timecount_irqmp(struct timecounter *tc) … … 203 210 static void leon3_clock_initialize(void) 204 211 { 205 volatile struct irqmp_timestamp_regs *irqmp_ts = 206 &LEON3_IrqCtrl_Regs->timestamp[0]; 207 208 LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].reload = 212 volatile struct irqmp_timestamp_regs *irqmp_ts; 213 volatile struct gptimer_regs *gpt; 214 215 irqmp_ts = &LEON3_IrqCtrl_Regs->timestamp[0]; 216 gpt = LEON3_Timer_Regs; 217 218 gpt->timer[LEON3_CLOCK_INDEX].reload = 209 219 rtems_configuration_get_microseconds_per_tick() - 1; 210 LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX].ctrl =220 gpt->timer[LEON3_CLOCK_INDEX].ctrl = 211 221 GPTIMER_TIMER_CTRL_EN | GPTIMER_TIMER_CTRL_RS | 212 222 GPTIMER_TIMER_CTRL_LD | GPTIMER_TIMER_CTRL_IE; 213 223 214 if (leon3_irqmp_has_timestamp(irqmp_ts)) { 224 leon3_up_counter_enable(); 225 226 if (leon3_up_counter_is_available()) { 227 /* Use the LEON4 up-counter if available */ 228 leon3_tc.tc.tc_get_timecount = leon3_tc_get_timecount_up_counter; 229 leon3_tc.tc.tc_counter_mask = 0xffffffff; 230 leon3_tc.tc.tc_frequency = leon3_up_counter_frequency(); 231 leon3_tc.tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER; 232 233 #ifdef RTEMS_PROFILING 234 if (!leon3_irqmp_has_timestamp(irqmp_ts)) { 235 bsp_fatal(LEON3_FATAL_CLOCK_NO_IRQMP_TIMESTAMP_SUPPORT); 236 } 237 #endif 238 239 leon3_tc_tick = leon3_tc_tick_irqmp_timestamp_init; 240 rtems_timecounter_install(&leon3_tc.tc); 241 } else if (leon3_irqmp_has_timestamp(irqmp_ts)) { 242 /* Use the interrupt controller timestamp counter if available */ 215 243 leon3_tc.tc.tc_get_timecount = leon3_tc_get_timecount_irqmp; 216 244 leon3_tc.tc.tc_counter_mask = 0xffffffff; … … 226 254 * in free running mode for the timecounter. 227 255 */ 228 LEON3_Timer_Regs->timer[LEON3_CLOCK_INDEX + 1].ctrl =256 gpt->timer[LEON3_CLOCK_INDEX + 1].ctrl = 229 257 GPTIMER_TIMER_CTRL_EN | GPTIMER_TIMER_CTRL_IE; 230 258 leon3_tc.tc.tc_get_timecount = leon3_tc_get_timecount_second_timer;
Note: See TracChangeset
for help on using the changeset viewer.