Home | History | Annotate | Line # | Download | only in pci
      1  1.3  thorpej /* $NetBSD: sioreg.h,v 1.3 2021/06/25 13:32:39 thorpej Exp $ */
      2  1.1      cgd 
      3  1.1      cgd /*
      4  1.1      cgd  * Copyright (c) 1996 BBN Corporation.
      5  1.1      cgd  *   BBN Systems and Technologies Division
      6  1.1      cgd  *   10 Moulton Street
      7  1.1      cgd  *   Cambridge, Ma. 02138
      8  1.1      cgd  *   617-873-3000
      9  1.1      cgd  *
     10  1.1      cgd  *  Permission to use, copy, modify, distribute, and sell this software and its
     11  1.1      cgd  *  documentation for  any purpose is hereby granted without fee, provided that
     12  1.1      cgd  *  the above copyright notice and this permission appear  in all copies and in
     13  1.1      cgd  *  supporting documentation, and that the name of BBN Corporation not  be used
     14  1.1      cgd  *  in  advertising  or  publicity pertaining  to  distribution of the software
     15  1.1      cgd  *  without specific, written  prior  permission.  BBN makes no representations
     16  1.1      cgd  *  about  the  suitability  of this software for any purposes.  It is provided
     17  1.1      cgd  *  "AS IS" without express or implied warranties.
     18  1.1      cgd  */
     19  1.1      cgd 
     20  1.1      cgd /*
     21  1.1      cgd  * Intel 82378 System I/O (SIO) Chip
     22  1.1      cgd  *
     23  1.1      cgd  * Taken from the Intel "Peripheral Components" manual, 1995 Edition.
     24  1.1      cgd  */
     25  1.1      cgd 
     26  1.1      cgd 
     27  1.1      cgd /*
     28  1.1      cgd  * Device-specific PCI Configuration Registers
     29  1.1      cgd  */
     30  1.1      cgd 
     31  1.1      cgd /*
     32  1.1      cgd  * PCI Control Registers
     33  1.1      cgd  */
     34  1.1      cgd #define	SIO_PCIREG_PCICON	0x40	/* PCI Control */
     35  1.1      cgd #define	SIO_PCIREG_PAC		0x41	/* PCI Arbiter Control */
     36  1.1      cgd #define	SIO_PCIREG_PAPC		0x42	/* PCI Arbiter Priority Control */
     37  1.1      cgd #define	SIO_PCIREG_ARBPRIX	0x43	/* PCI Arbiter Priority Control Ext. */
     38  1.1      cgd 
     39  1.1      cgd /*
     40  1.1      cgd  * Memory Chip Select Registers
     41  1.1      cgd  */
     42  1.1      cgd #define	SIO_PCIREG_MEMCSCON	0x44	/* MEMCS# Control */
     43  1.1      cgd #define	SIO_PCIREG_MEMCSBOH	0x45	/* MEMCS# Bottom of Hole */
     44  1.1      cgd #define	SIO_PCIREG_MEMCSTOH	0x46	/* MEMCS# Top of Hole */
     45  1.1      cgd #define	SIO_PCIREG_MEMCSTOM	0x47	/* MEMCS# Top of Memory */
     46  1.1      cgd 
     47  1.1      cgd #define	SIO_PCIREG_MAR1		0x54	/* MEMCS# Attribute 1 */
     48  1.1      cgd #define	SIO_PCIREG_MAR2		0x55	/* MEMCS# Attribute 2 */
     49  1.1      cgd #define	SIO_PCIREG_MAR3		0x56	/* MEMCS# Attribute 3 */
     50  1.1      cgd #define	SIO_PCIREG_DMASGRB	0x57	/* DMA Scatter/Gather Rel. Base Addr. */
     51  1.1      cgd 
     52  1.1      cgd /*
     53  1.1      cgd  * ISA Address Decoder Registers
     54  1.1      cgd  */
     55  1.1      cgd #define	SIO_PCIREG_IADCON	0x48	/* ISA Address Decoder Control */
     56  1.1      cgd #define	SIO_PCIREG_IADRBE	0x49	/* ISA Addr. Decoder ROM Block Enable */
     57  1.1      cgd #define	SIO_PCIREG_IADBOH	0x4A	/* ISA Addr. Decoder Bottom of Hole */
     58  1.1      cgd #define	SIO_PCIREG_IADTOH	0x4B	/* ISA Addr. Decoder Top of Hole */
     59  1.1      cgd 
     60  1.1      cgd /*
     61  1.1      cgd  * Clocks and Timers
     62  1.1      cgd  */
     63  1.1      cgd #define	SIO_PCIREG_ICRT		0x4C	/* ISA Controller Recovery Timer */
     64  1.1      cgd #define	SIO_PCIREG_ICD		0x4D	/* ISA Clock Divisor */
     65  1.1      cgd 
     66  1.1      cgd #define	SIO_PCIREG_		0x80	/* BIOS Timer Base Address */
     67  1.1      cgd 
     68  1.1      cgd #define	SIO_PCIREG_CTLTMRL	0xAC	/* Clock Throttle STPCLK# Low Timer */
     69  1.1      cgd #define	SIO_PCIREG_CTLTMRH	0xAE	/* Clock Throttle STPCLK# High Timer */
     70  1.1      cgd 
     71  1.1      cgd /*
     72  1.1      cgd  * Miscellaneous
     73  1.1      cgd  */
     74  1.1      cgd #define	SIO_PCIREG_UBCSA	0x4E	/* Utility Bus Chip Select A */
     75  1.1      cgd #define	SIO_PCIREG_UBCSB	0x4F	/* Utility Bus Chip Select B */
     76  1.1      cgd 
     77  1.1      cgd /*
     78  1.1      cgd  * PIRQ# Route Control
     79  1.1      cgd  */
     80  1.1      cgd #define	SIO_PCIREG_PIRQ0	0x60	/* PIRQ0 Route Control */
     81  1.1      cgd #define	SIO_PCIREG_PIRQ1	0x61	/* PIRQ1 Route Control */
     82  1.1      cgd #define	SIO_PCIREG_PIRQ2	0x62	/* PIRQ2 Route Control */
     83  1.1      cgd #define	SIO_PCIREG_PIRQ3	0x63	/* PIRQ3 Route Control */
     84  1.1      cgd #define	SIO_PCIREG_PIRQ_RTCTRL	SIO_PCIREG_PIRQ0
     85  1.1      cgd 
     86  1.3  thorpej 	/* extract the PIRQx field from 32-bit reg */
     87  1.3  thorpej #define	PIRQ_RTCTRL_PIRQx(r, p)	(((r) >> ((p) * 8)) & 0xff)
     88  1.3  thorpej 
     89  1.3  thorpej 	/* bits within each PIRQx field */
     90  1.3  thorpej #define	PIRQ_RTCTRL_NOT_ROUTED	__BIT(7)    /* 0 == interrupt routed */
     91  1.3  thorpej #define	PIRQ_RTCTRL_IRQ		__BITS(0,3) /* PIRQ routed to this ISA IRQ */
     92  1.3  thorpej 
     93  1.1      cgd /*
     94  1.1      cgd  * System Management Interrupt (SMI)
     95  1.1      cgd  */
     96  1.1      cgd #define	SIO_PCIREG_SMICNTL	0xA0	/* SMI Control */
     97  1.1      cgd #define	SIO_PCIREG_SMIEN	0xA2	/* SMI Enable */
     98  1.1      cgd #define	SIO_PCIREG_SEE		0xA4	/* System Event Enable */
     99  1.1      cgd #define	SIO_PCIREG_FTMR		0xA8	/* Fast Off Timer */
    100  1.1      cgd #define	SIO_PCIREG_SMIREQ	0xAA	/* SMI Request */
    101  1.1      cgd 
    102  1.1      cgd 
    103  1.1      cgd /*
    104  1.1      cgd  * Non-Configuration Registers
    105  1.1      cgd  */
    106  1.1      cgd 
    107  1.1      cgd /*
    108  1.1      cgd  * Control
    109  1.1      cgd  */
    110  1.1      cgd #define	SIO_REG_RSTUB		0x060	/* Reset UBus */
    111  1.1      cgd #define	SIO_REG_NMICTRL		0x061	/* NMI Status and Control */
    112  1.1      cgd #define	SIO_REG_CMOSRAM		0x070	/* CMOS RAM Address and NMI Mask */
    113  1.1      cgd #define	SIO_REG_NMIMASK		0x070	/* CMOS RAM Address and NMI Mask */
    114  1.1      cgd #define	SIO_REG_PORT92		0x092	/* Port 92 */
    115  1.1      cgd #define	SIO_REG_CPERR		0x0F0	/* Coprocessor Error */
    116  1.1      cgd 
    117  1.1      cgd /*
    118  1.1      cgd  * Interrupt
    119  1.1      cgd  */
    120  1.1      cgd #define	SIO_REG_ICU1		0x020	/* Intr. Controller #1 Control */
    121  1.1      cgd #define	SIO_REG_ICU1MASK	0x021	/* Intr. Controller #1 Mask */
    122  1.1      cgd #define	SIO_REG_ICU2		0x0A0	/* Intr. Controller #2 Control */
    123  1.1      cgd #define	SIO_REG_ICU2MASK	0x0A1	/* Intr. Controller #2 Mask */
    124  1.1      cgd #define	SIO_REG_ICU1ELC		0x4D0	/* #1's Edge/Level Control */
    125  1.1      cgd #define	SIO_REG_ICU2ELC		0x4D1	/* #2's Edge/Level Control */
    126  1.1      cgd #define	SIO_ICUSIZE		16	/* I/O Port Sizes */
    127  1.1      cgd 
    128  1.1      cgd /*
    129  1.1      cgd  * Timer
    130  1.1      cgd  */
    131  1.1      cgd /* XXX need Timer definitions */
    132  1.1      cgd 
    133  1.1      cgd /*
    134  1.1      cgd  * DMA
    135  1.1      cgd  */
    136  1.1      cgd /* XXX need DMA definitions */
    137