Ignore:
Timestamp:
Feb 19, 2015, 9:06:54 AM (5 years ago)
Author:
Daniel Hellstrom <daniel@…>
Branches:
4.11, master
Children:
e51eb80
Parents:
ead16ae1
git-author:
Daniel Hellstrom <daniel@…> (02/19/15 09:06:54)
git-committer:
Daniel Hellstrom <daniel@…> (04/16/15 23:10:15)
Message:

leon3: make timer initialization configurable

Its now possible to select which timer core will be used for
system clock timer and to control the timer prescaler that
affects all timer instances on that timer core.

The timer and interrupt controller AMBA devices are exported
to make it possible for other code to get detailed information.
For example the frequency of the timer and interrupt controller
is required by the cpucounter support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/leon3/include/leon.h

    read16ae1 r5da315f  
    9595/* LEON3 Interrupt Controller */
    9696extern volatile struct irqmp_regs *LEON3_IrqCtrl_Regs;
     97extern struct ambapp_dev *irqmp_dev;
     98
    9799/* LEON3 GP Timer */
    98100extern volatile struct gptimer_regs *LEON3_Timer_Regs;
     101extern struct ambapp_dev *timer_dev;
    99102
    100103/* LEON3 CPU Index of boot CPU */
     
    309312extern int debug_uart_index;
    310313
     314/* Let user override which on-chip TIMER core will be used for system clock
     315 * timer. This controls which timer core will be accociated with
     316 * LEON3_Timer_Regs registers base address. This value will by destroyed during
     317 * initialization.
     318 *  0 = Default configuration. GPTIMER[0]
     319 *  1 = GPTIMER[1]
     320 *  2 = GPTIMER[2]
     321 *  ...
     322 */
     323extern int leon3_timer_core_index;
     324
     325/* Let user override system clock timer prescaler. This affects all timer
     326 * instances on the system clock timer core determined by
     327 * leon3_timer_core_index.
     328 *  0 = Default configuration. Use bootloader configured value.
     329 *  N = Prescaler is set to N. N must not be less that number of timers.
     330 *  8 = Prescaler is set to 8 (the fastest prescaler possible on all HW)
     331 *  ...
     332 */
     333extern unsigned int leon3_timer_prescaler;
     334
    311335void leon3_cpu_counter_initialize(void);
    312336
Note: See TracChangeset for help on using the changeset viewer.