Home | History | Annotate | Line # | Download | only in include
i82093reg.h revision 1.1
      1  1.1  fvdl /* 	$NetBSD: i82093reg.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */
      2  1.1  fvdl 
      3  1.1  fvdl /*-
      4  1.1  fvdl  * Copyright (c) 2000 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 RedBack Networks Inc.
      9  1.1  fvdl  *
     10  1.1  fvdl  * Author: Bill Sommerfeld
     11  1.1  fvdl  *
     12  1.1  fvdl  * Redistribution and use in source and binary forms, with or without
     13  1.1  fvdl  * modification, are permitted provided that the following conditions
     14  1.1  fvdl  * are met:
     15  1.1  fvdl  * 1. Redistributions of source code must retain the above copyright
     16  1.1  fvdl  *    notice, this list of conditions and the following disclaimer.
     17  1.1  fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     18  1.1  fvdl  *    notice, this list of conditions and the following disclaimer in the
     19  1.1  fvdl  *    documentation and/or other materials provided with the distribution.
     20  1.1  fvdl  * 3. All advertising materials mentioning features or use of this software
     21  1.1  fvdl  *    must display the following acknowledgement:
     22  1.1  fvdl  *        This product includes software developed by the NetBSD
     23  1.1  fvdl  *        Foundation, Inc. and its contributors.
     24  1.1  fvdl  * 4. Neither the name of The NetBSD Foundation nor the names of its
     25  1.1  fvdl  *    contributors may be used to endorse or promote products derived
     26  1.1  fvdl  *    from this software without specific prior written permission.
     27  1.1  fvdl  *
     28  1.1  fvdl  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     29  1.1  fvdl  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     30  1.1  fvdl  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     31  1.1  fvdl  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     32  1.1  fvdl  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     33  1.1  fvdl  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     34  1.1  fvdl  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     35  1.1  fvdl  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     36  1.1  fvdl  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     37  1.1  fvdl  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     38  1.1  fvdl  * POSSIBILITY OF SUCH DAMAGE.
     39  1.1  fvdl  */
     40  1.1  fvdl 
     41  1.1  fvdl /*
     42  1.1  fvdl  * Typically, the first apic lives here.
     43  1.1  fvdl  */
     44  1.1  fvdl #define IOAPIC_BASE_DEFAULT	0xfec00000
     45  1.1  fvdl 
     46  1.1  fvdl /*
     47  1.1  fvdl  * Memory-space registers.
     48  1.1  fvdl  */
     49  1.1  fvdl 
     50  1.1  fvdl /*
     51  1.1  fvdl  * The externally visible registers are all 32 bits wide;
     52  1.1  fvdl  * store the register number of interest in IOAPIC_REG, and store/fetch
     53  1.1  fvdl  * the real value in IOAPIC_DATA.
     54  1.1  fvdl  */
     55  1.1  fvdl 
     56  1.1  fvdl 
     57  1.1  fvdl 
     58  1.1  fvdl #define	IOAPIC_REG		0x0000
     59  1.1  fvdl #define IOAPIC_DATA		0x0010
     60  1.1  fvdl 
     61  1.1  fvdl /*
     62  1.1  fvdl  * Internal I/O APIC registers.
     63  1.1  fvdl  */
     64  1.1  fvdl 
     65  1.1  fvdl #define IOAPIC_ID		0x00
     66  1.1  fvdl 
     67  1.1  fvdl #define 	IOAPIC_ID_SHIFT		24
     68  1.1  fvdl #define		IOAPIC_ID_MASK		0x0f000000
     69  1.1  fvdl 
     70  1.1  fvdl /* Version, and maximum interrupt pin number. */
     71  1.1  fvdl 
     72  1.1  fvdl #define IOAPIC_VER		0x01
     73  1.1  fvdl 
     74  1.1  fvdl #define		IOAPIC_VER_SHIFT		0
     75  1.1  fvdl #define		IOAPIC_VER_MASK			0x000000ff
     76  1.1  fvdl 
     77  1.1  fvdl #define		IOAPIC_MAX_SHIFT	       	16
     78  1.1  fvdl #define		IOAPIC_MAX_MASK	       	0x00ff0000
     79  1.1  fvdl 
     80  1.1  fvdl /*
     81  1.1  fvdl  * Arbitration ID.  Same format as IOAPIC_ID register.
     82  1.1  fvdl  */
     83  1.1  fvdl #define IOAPIC_ARB		0x02
     84  1.1  fvdl 
     85  1.1  fvdl /*
     86  1.1  fvdl  * Redirection table registers.
     87  1.1  fvdl  */
     88  1.1  fvdl 
     89  1.1  fvdl #define IOAPIC_REDHI(pin)	(0x11 + ((pin)<<1))
     90  1.1  fvdl #define IOAPIC_REDLO(pin)	(0x10 + ((pin)<<1))
     91  1.1  fvdl 
     92  1.1  fvdl #define IOAPIC_REDHI_DEST_SHIFT		24	   /* destination. */
     93  1.1  fvdl #define IOAPIC_REDHI_DEST_MASK		0xff000000
     94  1.1  fvdl 
     95  1.1  fvdl #define IOAPIC_REDLO_MASK		0x00010000 /* 0=enabled; 1=masked */
     96  1.1  fvdl 
     97  1.1  fvdl #define IOAPIC_REDLO_LEVEL		0x00008000 /* 0=edge, 1=level */
     98  1.1  fvdl #define IOAPIC_REDLO_RIRR		0x00004000 /* remote IRR; read only */
     99  1.1  fvdl #define IOAPIC_REDLO_ACTLO		0x00002000 /* 0=act. hi; 1=act. lo */
    100  1.1  fvdl #define IOAPIC_REDLO_DELSTS		0x00001000 /* 0=idle; 1=send pending */
    101  1.1  fvdl #define IOAPIC_REDLO_DSTMOD		0x00000800 /* 0=physical; 1=logical */
    102  1.1  fvdl 
    103  1.1  fvdl #define IOAPIC_REDLO_DEL_MASK		0x00000700 /* del. mode mask */
    104  1.1  fvdl #define IOAPIC_REDLO_DEL_SHIFT		8
    105  1.1  fvdl 
    106  1.1  fvdl #define IOAPIC_REDLO_DEL_FIXED		0
    107  1.1  fvdl #define IOAPIC_REDLO_DEL_LOPRI		1
    108  1.1  fvdl #define IOAPIC_REDLO_DEL_SMI		2
    109  1.1  fvdl #define IOAPIC_REDLO_DEL_NMI		4
    110  1.1  fvdl #define IOAPIC_REDLO_DEL_INIT		5
    111  1.1  fvdl #define IOAPIC_REDLO_DEL_EXTINT		7
    112  1.1  fvdl 
    113  1.1  fvdl #define IOAPIC_REDLO_VECTOR_MASK	0x000000ff /* delivery vector */
    114  1.1  fvdl 
    115  1.1  fvdl #define IMCR_ADDR		0x22
    116  1.1  fvdl #define IMCR_DATA		0x23
    117  1.1  fvdl 
    118  1.1  fvdl #define IMCR_REGISTER		0x70
    119  1.1  fvdl #define		IMCR_PIC	0x00
    120  1.1  fvdl #define 	IMCR_APIC	0x01
    121