Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_HPET_H
0003 #define _ASM_HPET_H
0004 
0005 #ifdef CONFIG_RS780_HPET
0006 
0007 #define HPET_MMAP_SIZE      1024
0008 
0009 #define HPET_ID         0x000
0010 #define HPET_PERIOD     0x004
0011 #define HPET_CFG        0x010
0012 #define HPET_STATUS     0x020
0013 #define HPET_COUNTER    0x0f0
0014 
0015 #define HPET_Tn_CFG(n)      (0x100 + 0x20 * n)
0016 #define HPET_Tn_CMP(n)      (0x108 + 0x20 * n)
0017 #define HPET_Tn_ROUTE(n)    (0x110 + 0x20 * n)
0018 
0019 #define HPET_T0_IRS     0x001
0020 #define HPET_T1_IRS     0x002
0021 #define HPET_T3_IRS     0x004
0022 
0023 #define HPET_T0_CFG     0x100
0024 #define HPET_T0_CMP     0x108
0025 #define HPET_T0_ROUTE   0x110
0026 #define HPET_T1_CFG     0x120
0027 #define HPET_T1_CMP     0x128
0028 #define HPET_T1_ROUTE   0x130
0029 #define HPET_T2_CFG     0x140
0030 #define HPET_T2_CMP     0x148
0031 #define HPET_T2_ROUTE   0x150
0032 
0033 #define HPET_ID_REV         0x000000ff
0034 #define HPET_ID_NUMBER      0x00001f00
0035 #define HPET_ID_64BIT       0x00002000
0036 #define HPET_ID_LEGSUP      0x00008000
0037 #define HPET_ID_VENDOR      0xffff0000
0038 #define HPET_ID_NUMBER_SHIFT    8
0039 #define HPET_ID_VENDOR_SHIFT    16
0040 
0041 #define HPET_CFG_ENABLE     0x001
0042 #define HPET_CFG_LEGACY     0x002
0043 #define HPET_LEGACY_8254        2
0044 #define HPET_LEGACY_RTC     8
0045 
0046 #define HPET_TN_LEVEL       0x0002
0047 #define HPET_TN_ENABLE      0x0004
0048 #define HPET_TN_PERIODIC    0x0008
0049 #define HPET_TN_PERIODIC_CAP    0x0010
0050 #define HPET_TN_64BIT_CAP   0x0020
0051 #define HPET_TN_SETVAL      0x0040
0052 #define HPET_TN_32BIT       0x0100
0053 #define HPET_TN_ROUTE       0x3e00
0054 #define HPET_TN_FSB         0x4000
0055 #define HPET_TN_FSB_CAP     0x8000
0056 #define HPET_TN_ROUTE_SHIFT 9
0057 
0058 /* Max HPET Period is 10^8 femto sec as in HPET spec */
0059 #define HPET_MAX_PERIOD     100000000UL
0060 /*
0061  * Min HPET period is 10^5 femto sec just for safety. If it is less than this,
0062  * then 32 bit HPET counter wrapsaround in less than 0.5 sec.
0063  */
0064 #define HPET_MIN_PERIOD     100000UL
0065 
0066 #define HPET_ADDR       0x20000
0067 #define HPET_MMIO_ADDR  0x90000e0000020000
0068 #define HPET_FREQ       14318780
0069 #define HPET_COMPARE_VAL    ((HPET_FREQ + HZ / 2) / HZ)
0070 #define HPET_T0_IRQ     0
0071 
0072 extern void __init setup_hpet_timer(void);
0073 #endif /* CONFIG_RS780_HPET */
0074 #endif /* _ASM_HPET_H */