blob: 0acbac299e49b5d2be2c58efe308d4ac1bb760a1 [file] [log] [blame]
Jacob Panbb24c472009-09-02 07:37:17 -07001/*
2 * apb_timer.h: Driver for Langwell APB timer based on Synopsis DesignWare
3 *
4 * (C) Copyright 2009 Intel Corporation
5 * Author: Jacob Pan (jacob.jun.pan@intel.com)
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; version 2
10 * of the License.
11 *
12 * Note:
13 */
14
15#ifndef ASM_X86_APBT_H
16#define ASM_X86_APBT_H
17#include <linux/sfi.h>
18
19#ifdef CONFIG_APB_TIMER
20
Jacob Panbb24c472009-09-02 07:37:17 -070021/* default memory mapped register base */
22#define LNW_SCU_ADDR 0xFF100000
23#define LNW_EXT_TIMER_OFFSET 0x1B800
24#define APBT_DEFAULT_BASE (LNW_SCU_ADDR+LNW_EXT_TIMER_OFFSET)
25#define LNW_EXT_TIMER_PGOFFSET 0x800
26
27/* APBT clock speed range from PCLK to fabric base, 25-100MHz */
Jamie Iles06c3df42011-06-06 12:43:07 +010028#define APBT_MAX_FREQ 50000000
29#define APBT_MIN_FREQ 1000000
Jacob Panbb24c472009-09-02 07:37:17 -070030#define APBT_MMAP_SIZE 1024
31
32#define APBT_DEV_USED 1
33
34extern void apbt_time_init(void);
Jacob Panbb24c472009-09-02 07:37:17 -070035extern unsigned long apbt_quick_calibrate(void);
36extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);
37extern void apbt_setup_secondary_clock(void);
Jacob Panbb24c472009-09-02 07:37:17 -070038
39extern struct sfi_timer_table_entry *sfi_get_mtmr(int hint);
40extern void sfi_free_mtmr(struct sfi_timer_table_entry *mtmr);
41extern int sfi_mtimer_num;
42
43#else /* CONFIG_APB_TIMER */
44
45static inline unsigned long apbt_quick_calibrate(void) {return 0; }
Jesper Juhle376fd62011-05-26 11:12:53 +020046static inline void apbt_time_init(void) { }
Jacob Panbb24c472009-09-02 07:37:17 -070047
48#endif
49#endif /* ASM_X86_APBT_H */