Path: blob/master/arch/x86/include/asm/apb_timer.h
10821 views
/*1* apb_timer.h: Driver for Langwell APB timer based on Synopsis DesignWare2*3* (C) Copyright 2009 Intel Corporation4* Author: Jacob Pan ([email protected])5*6* This program is free software; you can redistribute it and/or7* modify it under the terms of the GNU General Public License8* as published by the Free Software Foundation; version 29* of the License.10*11* Note:12*/1314#ifndef ASM_X86_APBT_H15#define ASM_X86_APBT_H16#include <linux/sfi.h>1718#ifdef CONFIG_APB_TIMER1920/* Langwell DW APB timer registers */21#define APBTMR_N_LOAD_COUNT 0x0022#define APBTMR_N_CURRENT_VALUE 0x0423#define APBTMR_N_CONTROL 0x0824#define APBTMR_N_EOI 0x0c25#define APBTMR_N_INT_STATUS 0x102627#define APBTMRS_INT_STATUS 0xa028#define APBTMRS_EOI 0xa429#define APBTMRS_RAW_INT_STATUS 0xa830#define APBTMRS_COMP_VERSION 0xac31#define APBTMRS_REG_SIZE 0x143233/* register bits */34#define APBTMR_CONTROL_ENABLE (1<<0)35#define APBTMR_CONTROL_MODE_PERIODIC (1<<1) /*1: periodic 0:free running */36#define APBTMR_CONTROL_INT (1<<2)3738/* default memory mapped register base */39#define LNW_SCU_ADDR 0xFF10000040#define LNW_EXT_TIMER_OFFSET 0x1B80041#define APBT_DEFAULT_BASE (LNW_SCU_ADDR+LNW_EXT_TIMER_OFFSET)42#define LNW_EXT_TIMER_PGOFFSET 0x8004344/* APBT clock speed range from PCLK to fabric base, 25-100MHz */45#define APBT_MAX_FREQ 5046#define APBT_MIN_FREQ 147#define APBT_MMAP_SIZE 10244849#define APBT_DEV_USED 15051extern void apbt_time_init(void);52extern struct clock_event_device *global_clock_event;53extern unsigned long apbt_quick_calibrate(void);54extern int arch_setup_apbt_irqs(int irq, int trigger, int mask, int cpu);55extern void apbt_setup_secondary_clock(void);5657extern struct sfi_timer_table_entry *sfi_get_mtmr(int hint);58extern void sfi_free_mtmr(struct sfi_timer_table_entry *mtmr);59extern int sfi_mtimer_num;6061#else /* CONFIG_APB_TIMER */6263static inline unsigned long apbt_quick_calibrate(void) {return 0; }64static inline void apbt_time_init(void) { }6566#endif67#endif /* ASM_X86_APBT_H */686970