blob: 48e4df25b82d24e0ce6233913b36757c8e4fe4bc [file] [log] [blame]
wdenk591dda52002-11-18 00:14:45 +00001/*
2 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02003 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se.
wdenk591dda52002-11-18 00:14:45 +00004 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk591dda52002-11-18 00:14:45 +00006 */
7
wdenk591dda52002-11-18 00:14:45 +00008/* i8254.h Intel 8254 PIT registers */
9
wdenk591dda52002-11-18 00:14:45 +000010#ifndef _ASMI386_I8254_H_
Bin Mengcb68a1a2015-10-22 19:13:28 -070011#define _ASMI386_I8954_H_
wdenk591dda52002-11-18 00:14:45 +000012
Bin Mengcb68a1a2015-10-22 19:13:28 -070013#define PIT_T0 0x00 /* PIT channel 0 count/status */
14#define PIT_T1 0x01 /* PIT channel 1 count/status */
15#define PIT_T2 0x02 /* PIT channel 2 count/status */
16#define PIT_COMMAND 0x03 /* PIT mode control, latch and read back */
wdenk591dda52002-11-18 00:14:45 +000017
18/* PIT Command Register Bit Definitions */
19
Bin Mengcb68a1a2015-10-22 19:13:28 -070020#define PIT_CMD_CTR0 0x00 /* Select PIT counter 0 */
21#define PIT_CMD_CTR1 0x40 /* Select PIT counter 1 */
22#define PIT_CMD_CTR2 0x80 /* Select PIT counter 2 */
wdenk591dda52002-11-18 00:14:45 +000023
Bin Mengcb68a1a2015-10-22 19:13:28 -070024#define PIT_CMD_LATCH 0x00 /* Counter Latch Command */
25#define PIT_CMD_LOW 0x10 /* Access counter bits 7-0 */
26#define PIT_CMD_HIGH 0x20 /* Access counter bits 15-8 */
27#define PIT_CMD_BOTH 0x30 /* Access counter bits 15-0 in two accesses */
wdenk591dda52002-11-18 00:14:45 +000028
Bin Mengcb68a1a2015-10-22 19:13:28 -070029#define PIT_CMD_MODE0 0x00 /* Select mode 0 */
30#define PIT_CMD_MODE1 0x02 /* Select mode 1 */
31#define PIT_CMD_MODE2 0x04 /* Select mode 2 */
32#define PIT_CMD_MODE3 0x06 /* Select mode 3 */
33#define PIT_CMD_MODE4 0x08 /* Select mode 4 */
34#define PIT_CMD_MODE5 0x0a /* Select mode 5 */
wdenk591dda52002-11-18 00:14:45 +000035
Bin Mengbba97052014-11-09 22:19:25 +080036/* The clock frequency of the i8253/i8254 PIT */
Bin Mengcb68a1a2015-10-22 19:13:28 -070037#define PIT_TICK_RATE 1193182
Bin Mengbba97052014-11-09 22:19:25 +080038
Bin Mengcb68a1a2015-10-22 19:13:28 -070039#endif /* _ASMI386_I8954_H_ */