Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2002 |
Albert ARIBAUD | fa82f87 | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 4 | * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 7 | /* i8254.h Intel 8254 PIT registers */ |
| 8 | |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 9 | #ifndef _ASMI386_I8254_H_ |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 10 | #define _ASMI386_I8954_H_ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 11 | |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 12 | #define PIT_T0 0x00 /* PIT channel 0 count/status */ |
| 13 | #define PIT_T1 0x01 /* PIT channel 1 count/status */ |
| 14 | #define PIT_T2 0x02 /* PIT channel 2 count/status */ |
| 15 | #define PIT_COMMAND 0x03 /* PIT mode control, latch and read back */ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 16 | |
| 17 | /* PIT Command Register Bit Definitions */ |
| 18 | |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 19 | #define PIT_CMD_CTR0 0x00 /* Select PIT counter 0 */ |
| 20 | #define PIT_CMD_CTR1 0x40 /* Select PIT counter 1 */ |
| 21 | #define PIT_CMD_CTR2 0x80 /* Select PIT counter 2 */ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 22 | |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 23 | #define PIT_CMD_LATCH 0x00 /* Counter Latch Command */ |
| 24 | #define PIT_CMD_LOW 0x10 /* Access counter bits 7-0 */ |
| 25 | #define PIT_CMD_HIGH 0x20 /* Access counter bits 15-8 */ |
| 26 | #define PIT_CMD_BOTH 0x30 /* Access counter bits 15-0 in two accesses */ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 27 | |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 28 | #define PIT_CMD_MODE0 0x00 /* Select mode 0 */ |
| 29 | #define PIT_CMD_MODE1 0x02 /* Select mode 1 */ |
| 30 | #define PIT_CMD_MODE2 0x04 /* Select mode 2 */ |
| 31 | #define PIT_CMD_MODE3 0x06 /* Select mode 3 */ |
| 32 | #define PIT_CMD_MODE4 0x08 /* Select mode 4 */ |
| 33 | #define PIT_CMD_MODE5 0x0a /* Select mode 5 */ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 34 | |
Bin Meng | 80de049 | 2014-11-09 22:19:25 +0800 | [diff] [blame] | 35 | /* The clock frequency of the i8253/i8254 PIT */ |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 36 | #define PIT_TICK_RATE 1193182 |
Bin Meng | 80de049 | 2014-11-09 22:19:25 +0800 | [diff] [blame] | 37 | |
Bin Meng | 0a2ea02 | 2015-10-22 19:13:28 -0700 | [diff] [blame] | 38 | #endif /* _ASMI386_I8954_H_ */ |