]> git.proxmox.com Git - mirror_qemu.git/blame - hw/hpet_emul.h
hpet: Move static timer field initialization
[mirror_qemu.git] / hw / hpet_emul.h
CommitLineData
16b29ae1
AL
1/*
2 * QEMU Emulated HPET support
3 *
4 * Copyright IBM, Corp. 2008
5 *
6 * Authors:
7 * Beth Kon <bkon@us.ibm.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13#ifndef QEMU_HPET_EMUL_H
14#define QEMU_HPET_EMUL_H
15
16#define HPET_BASE 0xfed00000
17#define HPET_CLK_PERIOD 10000000ULL /* 10000000 femtoseconds == 10ns*/
18
19#define FS_PER_NS 1000000
20#define HPET_NUM_TIMERS 3
16b29ae1
AL
21
22#define HPET_CFG_ENABLE 0x001
23#define HPET_CFG_LEGACY 0x002
24
25#define HPET_ID 0x000
26#define HPET_PERIOD 0x004
27#define HPET_CFG 0x010
28#define HPET_STATUS 0x020
29#define HPET_COUNTER 0x0f0
30#define HPET_TN_CFG 0x000
31#define HPET_TN_CMP 0x008
32#define HPET_TN_ROUTE 0x010
35730fa0 33#define HPET_CFG_WRITE_MASK 0x3
16b29ae1 34
27bb0b2d 35#define HPET_TN_TYPE_LEVEL 0x002
16b29ae1
AL
36#define HPET_TN_ENABLE 0x004
37#define HPET_TN_PERIODIC 0x008
38#define HPET_TN_PERIODIC_CAP 0x010
39#define HPET_TN_SIZE_CAP 0x020
40#define HPET_TN_SETVAL 0x040
41#define HPET_TN_32BIT 0x100
42#define HPET_TN_INT_ROUTE_MASK 0x3e00
35730fa0 43#define HPET_TN_CFG_WRITE_MASK 0x3f4e
16b29ae1
AL
44#define HPET_TN_INT_ROUTE_SHIFT 9
45#define HPET_TN_INT_ROUTE_CAP_SHIFT 32
46#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U
47
ce88f890 48#if defined TARGET_I386
16b29ae1
AL
49extern uint32_t hpet_in_legacy_mode(void);
50extern void hpet_init(qemu_irq *irq);
51#endif
52
53#endif