Home | History | Annotate | Line # | Download | only in include
i82489reg.h revision 1.3.6.1
      1  1.3.6.1  bouyer /*	$NetBSD: i82489reg.h,v 1.3.6.1 2008/01/23 19:27:27 bouyer Exp $	*/
      2      1.1    fvdl 
      3      1.1    fvdl /*-
      4      1.1    fvdl  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5      1.1    fvdl  * All rights reserved.
      6      1.1    fvdl  *
      7      1.1    fvdl  * This code is derived from software contributed to The NetBSD Foundation
      8      1.1    fvdl  * by Frank van der Linden.
      9      1.1    fvdl  *
     10      1.1    fvdl  * Redistribution and use in source and binary forms, with or without
     11      1.1    fvdl  * modification, are permitted provided that the following conditions
     12      1.1    fvdl  * are met:
     13      1.1    fvdl  * 1. Redistributions of source code must retain the above copyright
     14      1.1    fvdl  *    notice, this list of conditions and the following disclaimer.
     15      1.1    fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1    fvdl  *    notice, this list of conditions and the following disclaimer in the
     17      1.1    fvdl  *    documentation and/or other materials provided with the distribution.
     18      1.1    fvdl  * 3. All advertising materials mentioning features or use of this software
     19      1.1    fvdl  *    must display the following acknowledgement:
     20      1.1    fvdl  *	This product includes software developed by the NetBSD
     21      1.1    fvdl  *	Foundation, Inc. and its contributors.
     22      1.1    fvdl  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23      1.1    fvdl  *    contributors may be used to endorse or promote products derived
     24      1.1    fvdl  *    from this software without specific prior written permission.
     25      1.1    fvdl  *
     26      1.1    fvdl  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27      1.1    fvdl  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28      1.1    fvdl  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29      1.1    fvdl  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30      1.1    fvdl  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31      1.1    fvdl  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32      1.1    fvdl  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33      1.1    fvdl  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34      1.1    fvdl  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35      1.1    fvdl  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36      1.1    fvdl  * POSSIBILITY OF SUCH DAMAGE.
     37      1.1    fvdl  */
     38      1.1    fvdl 
     39      1.1    fvdl 
     40      1.1    fvdl /*
     41      1.1    fvdl  * Registers and constants for the 82489DX and Pentium (and up) integrated
     42      1.1    fvdl  * "local" APIC.
     43      1.1    fvdl  */
     44      1.1    fvdl 
     45      1.1    fvdl #define	LAPIC_ID		0x020		/* ID. RW */
     46      1.1    fvdl #	define LAPIC_ID_MASK		0x0f000000
     47      1.1    fvdl #	define LAPIC_ID_SHIFT		24
     48      1.1    fvdl 
     49      1.1    fvdl #define LAPIC_VERS		0x030		/* Version. R */
     50      1.1    fvdl #	define LAPIC_VERSION_MASK	0x000000ff
     51      1.1    fvdl #	define LAPIC_VERSION_LVT_MASK	0x00ff0000
     52      1.1    fvdl #	define LAPIC_VERSION_LVT_SHIFT	16
     53      1.1    fvdl 
     54      1.1    fvdl #define LAPIC_TPRI		0x080		/* Task Prio. RW */
     55      1.1    fvdl #	define LAPIC_TPRI_MASK		0x000000ff
     56      1.1    fvdl #	define LAPIC_TPRI_INT_MASK	0x000000f0
     57      1.1    fvdl #	define LAPIC_TPRI_SUB_MASK	0x0000000f
     58      1.1    fvdl 
     59      1.1    fvdl #define LAPIC_APRI		0x090		/* Arbitration prio R */
     60      1.1    fvdl #	define LAPIC_APRI_MASK		0x000000ff
     61      1.1    fvdl 
     62      1.1    fvdl #define LAPIC_PPRI		0x0a0		/* Processor prio. R */
     63      1.1    fvdl #define LAPIC_EOI		0x0b0		/* End Int. W */
     64      1.1    fvdl #define LAPIC_RRR		0x0c0		/* Remote read R */
     65      1.1    fvdl #define LAPIC_LDR		0x0d0		/* Logical dest. RW */
     66      1.3   joerg 
     67      1.1    fvdl #define LAPIC_DFR		0x0e0		/* Dest. format RW */
     68      1.3   joerg #	define LAPIC_DFR_MASK		0xf0000000
     69      1.3   joerg #	define LAPIC_DFR_FLAT		0xf0000000
     70      1.3   joerg #	define LAPIC_DFR_CLUSTER	0x00000000
     71      1.1    fvdl 
     72      1.1    fvdl #define LAPIC_SVR		0x0f0		/* Spurious intvec RW */
     73      1.1    fvdl #	define LAPIC_SVR_VECTOR_MASK	0x000000ff
     74      1.1    fvdl #	define LAPIC_SVR_VEC_FIX	0x0000000f
     75      1.1    fvdl #	define LAPIC_SVR_VEC_PROG	0x000000f0
     76      1.1    fvdl #	define LAPIC_SVR_ENABLE		0x00000100
     77      1.1    fvdl #	define LAPIC_SVR_SWEN		0x00000100
     78      1.1    fvdl #	define LAPIC_SVR_FOCUS		0x00000200
     79      1.1    fvdl #	define LAPIC_SVR_FDIS		0x00000200
     80      1.1    fvdl 
     81      1.3   joerg #define LAPIC_ISR	0x100			/* In-Service Status */
     82      1.3   joerg #define LAPIC_TMR	0x180			/* Trigger Mode */
     83      1.3   joerg #define LAPIC_IRR	0x200			/* Interrupt Req */
     84      1.1    fvdl #define LAPIC_ESR	0x280			/* Err status. R */
     85      1.1    fvdl 
     86      1.1    fvdl #define LAPIC_ICRLO	0x300			/* Int. cmd. RW */
     87      1.1    fvdl #	define LAPIC_DLMODE_MASK	0x00000700
     88      1.1    fvdl #	define LAPIC_DLMODE_FIXED	0x00000000
     89      1.1    fvdl #	define LAPIC_DLMODE_LOW		0x00000100
     90      1.1    fvdl #	define LAPIC_DLMODE_SMI		0x00000200
     91      1.1    fvdl #	define LAPIC_DLMODE_NMI		0x00000400
     92      1.1    fvdl #	define LAPIC_DLMODE_INIT	0x00000500
     93      1.1    fvdl #	define LAPIC_DLMODE_STARTUP	0x00000600
     94      1.2      ad #	define LAPIC_DLMODE_EXTINT	0x00000700
     95      1.1    fvdl 
     96      1.3   joerg #	define LAPIC_DSTMODE_PHYS	0x00000000
     97      1.1    fvdl #	define LAPIC_DSTMODE_LOG	0x00000800
     98      1.1    fvdl 
     99      1.1    fvdl #	define LAPIC_DLSTAT_BUSY	0x00001000
    100      1.3   joerg #	define LAPIC_DLSTAT_IDLE	0x00000000
    101      1.1    fvdl 
    102  1.3.6.1  bouyer #	define LAPIC_LEVEL_MASK		0x00002000
    103  1.3.6.1  bouyer #	define LAPIC_LEVEL_ASSERT	0x00002000
    104      1.3   joerg #	define LAPIC_LEVEL_DEASSERT	0x00000000
    105      1.3   joerg 
    106      1.3   joerg #	define LAPIC_TRIGGER_MASK	0x00008000
    107      1.3   joerg #	define LAPIC_TRIGGER_EDGE	0x00000000
    108      1.3   joerg #	define LAPIC_TRIGGER_LEVEL	0x00008000
    109      1.1    fvdl 
    110      1.1    fvdl #	define LAPIC_DEST_MASK		0x000c0000
    111      1.3   joerg #	define LAPIC_DEST_DEFAULT	0x00000000
    112      1.1    fvdl #	define LAPIC_DEST_SELF		0x00040000
    113      1.1    fvdl #	define LAPIC_DEST_ALLINCL	0x00080000
    114      1.1    fvdl #	define LAPIC_DEST_ALLEXCL	0x000c0000
    115      1.1    fvdl 
    116      1.1    fvdl 
    117      1.1    fvdl #define LAPIC_ICRHI	0x310			/* Int. cmd. RW */
    118      1.1    fvdl #	define LAPIC_ID_MASK		0x0f000000
    119      1.1    fvdl #	define LAPIC_ID_SHIFT		24
    120      1.1    fvdl 
    121      1.1    fvdl #define LAPIC_LVTT	0x320			/* Loc.vec.(timer) RW */
    122      1.1    fvdl #	define LAPIC_LVTT_VEC_MASK	0x000000ff
    123      1.1    fvdl #	define LAPIC_LVTT_DS		0x00001000
    124      1.1    fvdl #	define LAPIC_LVTT_M		0x00010000
    125      1.1    fvdl #	define LAPIC_LVTT_TM		0x00020000
    126      1.1    fvdl 
    127      1.3   joerg #define LAPIC_TMINT	0x330			/* Loc.vec (Thermal) */
    128      1.3   joerg #define LAPIC_PCINT	0x340			/* Loc.vec (Perf Mon) */
    129      1.1    fvdl #define LAPIC_LVINT0	0x350			/* Loc.vec (LINT0) RW */
    130      1.1    fvdl #	define LAPIC_LVT_MASKED		0x00010000
    131      1.1    fvdl #	define LAPIC_LVT_LEVTRIG	0x00008000
    132      1.1    fvdl #	define LAPIC_LVT_REMOTE_IRR	0x00004000
    133      1.1    fvdl #	define LAPIC_INP_POL		0x00002000
    134      1.1    fvdl #	define LAPIC_PEND_SEND		0x00001000
    135      1.1    fvdl 
    136      1.1    fvdl #define LAPIC_LVINT1	0x360			/* Loc.vec (LINT1) RW */
    137      1.1    fvdl #define LAPIC_LVERR	0x370			/* Loc.vec (ERROR) RW */
    138      1.1    fvdl #define LAPIC_ICR_TIMER	0x380			/* Initial count RW */
    139      1.1    fvdl #define LAPIC_CCR_TIMER	0x390			/* Current count RO */
    140      1.1    fvdl 
    141      1.1    fvdl #define LAPIC_DCR_TIMER	0x3e0			/* Divisor config register */
    142      1.1    fvdl #	define LAPIC_DCRT_DIV1		0x0b
    143      1.1    fvdl #	define LAPIC_DCRT_DIV2		0x00
    144      1.1    fvdl #	define LAPIC_DCRT_DIV4		0x01
    145      1.1    fvdl #	define LAPIC_DCRT_DIV8		0x02
    146      1.1    fvdl #	define LAPIC_DCRT_DIV16		0x03
    147      1.1    fvdl #	define LAPIC_DCRT_DIV32		0x08
    148      1.1    fvdl #	define LAPIC_DCRT_DIV64		0x09
    149      1.1    fvdl #	define LAPIC_DCRT_DIV128	0x0a
    150      1.1    fvdl 
    151      1.1    fvdl #define LAPIC_BASE		0xfee00000
    152      1.1    fvdl 
    153      1.1    fvdl #define LAPIC_IRQ_MASK(i)	(1 << ((i) + 1))
    154