2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved.
10 * This file contains definitions for accessing a platform supported high resolution
11 * clock. The clock is monitonically increasing and can be accessed from any node
12 * in the system. The clock is synchronized across nodes - all nodes see the
15 * RTC_COUNTER_ADDR - contains the address of the counter
17 * GET_RTC_COUNTER() - macro to read the value of the clock
19 * RTC_CYCLES_PER_SEC - clock frequency in ticks per second
23 #ifndef _ASM_IA64_SN_CLKSUPPORT_H
24 #define _ASM_IA64_SN_CLKSUPPORT_H
26 #include <asm/sn/arch.h>
27 #include <asm/sn/addrs.h>
28 #include <asm/sn/sn2/addrs.h>
29 #include <asm/sn/sn2/shubio.h>
30 #include <asm/sn/sn2/shub_mmr.h>
32 typedef long clkreg_t;
34 extern unsigned long sn_rtc_cycles_per_second;
35 extern unsigned long sn_rtc_per_itc;
37 #define RTC_MASK SH_RTC_MASK
38 #define RTC_COUNTER_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
39 #define RTC_COMPARE_A_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
40 #define RTC_COMPARE_B_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
41 #define RTC_INT_PENDING_A_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
42 #define RTC_INT_PENDING_B_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
43 #define RTC_INT_ENABLED_A_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
44 #define RTC_INT_ENABLED_B_ADDR ((clkreg_t*)LOCAL_MMR_ADDR(SH_RTC))
46 #define SN_RTC_PER_ITC_SHIFT 34
47 #define GET_RTC_COUNTER() (*RTC_COUNTER_ADDR)
48 #define rtc_time() GET_RTC_COUNTER()
50 #define RTC_CYCLES_PER_SEC sn_rtc_cycles_per_second
52 #endif /* _ASM_IA64_SN_CLKSUPPORT_H */