summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/include/leon.h
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2015-02-19 10:06:54 +0100
committerDaniel Hellstrom <daniel@gaisler.com>2015-04-17 01:10:15 +0200
commit5da315ffdce891a2bb45d5b7ed3e6ae6cebef220 (patch)
tree78813b5186faf0c0ff08af84f9a57f47d6f858bb /c/src/lib/libbsp/sparc/leon3/include/leon.h
parentleon3: always clear interrupt controller (diff)
downloadrtems-5da315ffdce891a2bb45d5b7ed3e6ae6cebef220.tar.bz2
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.
Diffstat (limited to 'c/src/lib/libbsp/sparc/leon3/include/leon.h')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/include/leon.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/include/leon.h b/c/src/lib/libbsp/sparc/leon3/include/leon.h
index c7270cf7d9..6057c42f4b 100644
--- a/c/src/lib/libbsp/sparc/leon3/include/leon.h
+++ b/c/src/lib/libbsp/sparc/leon3/include/leon.h
@@ -94,8 +94,11 @@ extern "C" {
/* LEON3 Interrupt Controller */
extern volatile struct irqmp_regs *LEON3_IrqCtrl_Regs;
+extern struct ambapp_dev *irqmp_dev;
+
/* LEON3 GP Timer */
extern volatile struct gptimer_regs *LEON3_Timer_Regs;
+extern struct ambapp_dev *timer_dev;
/* LEON3 CPU Index of boot CPU */
extern uint32_t LEON3_Cpu_Index;
@@ -308,6 +311,27 @@ extern int syscon_uart_index;
*/
extern int debug_uart_index;
+/* Let user override which on-chip TIMER core will be used for system clock
+ * timer. This controls which timer core will be accociated with
+ * LEON3_Timer_Regs registers base address. This value will by destroyed during
+ * initialization.
+ * 0 = Default configuration. GPTIMER[0]
+ * 1 = GPTIMER[1]
+ * 2 = GPTIMER[2]
+ * ...
+ */
+extern int leon3_timer_core_index;
+
+/* Let user override system clock timer prescaler. This affects all timer
+ * instances on the system clock timer core determined by
+ * leon3_timer_core_index.
+ * 0 = Default configuration. Use bootloader configured value.
+ * N = Prescaler is set to N. N must not be less that number of timers.
+ * 8 = Prescaler is set to 8 (the fastest prescaler possible on all HW)
+ * ...
+ */
+extern unsigned int leon3_timer_prescaler;
+
void leon3_cpu_counter_initialize(void);
/* GRLIB extended IRQ controller register */