Home | History | Annotate | Line # | Download | only in pci
agpreg.h revision 1.2
      1  1.2   scw /*	$NetBSD: agpreg.h,v 1.2 2002/12/13 11:32:51 scw Exp $	*/
      2  1.1  fvdl 
      3  1.1  fvdl /*-
      4  1.1  fvdl  * Copyright (c) 2000 Doug Rabson
      5  1.1  fvdl  * All rights reserved.
      6  1.1  fvdl  *
      7  1.1  fvdl  * Redistribution and use in source and binary forms, with or without
      8  1.1  fvdl  * modification, are permitted provided that the following conditions
      9  1.1  fvdl  * are met:
     10  1.1  fvdl  * 1. Redistributions of source code must retain the above copyright
     11  1.1  fvdl  *    notice, this list of conditions and the following disclaimer.
     12  1.1  fvdl  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1  fvdl  *    notice, this list of conditions and the following disclaimer in the
     14  1.1  fvdl  *    documentation and/or other materials provided with the distribution.
     15  1.1  fvdl  *
     16  1.1  fvdl  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     17  1.1  fvdl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     18  1.1  fvdl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     19  1.1  fvdl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     20  1.1  fvdl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     21  1.1  fvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     22  1.1  fvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23  1.1  fvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     24  1.1  fvdl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     25  1.1  fvdl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     26  1.1  fvdl  * SUCH DAMAGE.
     27  1.1  fvdl  *
     28  1.1  fvdl  *	$FreeBSD: src/sys/pci/agpreg.h,v 1.3 2000/07/12 10:13:04 dfr Exp $
     29  1.1  fvdl  */
     30  1.1  fvdl 
     31  1.1  fvdl #ifndef _PCI_AGPREG_H_
     32  1.1  fvdl #define _PCI_AGPREG_H_
     33  1.1  fvdl 
     34  1.1  fvdl /*
     35  1.1  fvdl  * Offsets for various AGP configuration registers.
     36  1.1  fvdl  */
     37  1.1  fvdl #define AGP_APBASE		0x10
     38  1.1  fvdl 
     39  1.1  fvdl /*
     40  1.1  fvdl  * Offsets from the AGP Capability pointer.
     41  1.1  fvdl  */
     42  1.1  fvdl #define AGP_CAPID		0x02
     43  1.1  fvdl #define AGP_CAPID_GET_MAJOR(x)		(((x) & 0x00f00000U) >> 20)
     44  1.1  fvdl #define AGP_CAPID_GET_MINOR(x)		(((x) & 0x000f0000U) >> 16)
     45  1.1  fvdl #define AGP_CAPID_GET_NEXT_PTR(x)	(((x) & 0x0000ff00U) >> 8)
     46  1.1  fvdl #define AGP_CAPID_GET_CAP_ID(x)		(((x) & 0x000000ffU) >> 0)
     47  1.1  fvdl 
     48  1.1  fvdl #define AGP_STATUS		0x4
     49  1.1  fvdl #define AGP_COMMAND		0x8
     50  1.1  fvdl 
     51  1.1  fvdl /*
     52  1.1  fvdl  * Config offsets for Intel AGP chipsets.
     53  1.1  fvdl  */
     54  1.1  fvdl #define AGP_INTEL_NBXCFG	0x50
     55  1.1  fvdl #define AGP_INTEL_STS		0x90
     56  1.1  fvdl #define AGP_INTEL_AGPCTRL	0xb0
     57  1.1  fvdl #define AGP_INTEL_APSIZE	0xb4
     58  1.1  fvdl #define AGP_INTEL_ATTBASE	0xb8
     59  1.1  fvdl 
     60  1.1  fvdl /*
     61  1.1  fvdl  * Config offsets for VIA AGP chipsets.
     62  1.1  fvdl  */
     63  1.1  fvdl #define AGP_VIA_GARTCTRL	0x80
     64  1.1  fvdl #define AGP_VIA_APSIZE		0x84
     65  1.1  fvdl #define AGP_VIA_ATTBASE		0x88
     66  1.1  fvdl 
     67  1.1  fvdl /*
     68  1.1  fvdl  * Config offsets for SiS AGP chipsets.
     69  1.1  fvdl  */
     70  1.1  fvdl #define AGP_SIS_ATTBASE		0x90
     71  1.1  fvdl #define AGP_SIS_WINCTRL		0x94
     72  1.1  fvdl #define AGP_SIS_TLBCTRL		0x97
     73  1.1  fvdl #define AGP_SIS_TLBFLUSH	0x98
     74  1.1  fvdl 
     75  1.1  fvdl /*
     76  1.1  fvdl  * Config offsets for Ali AGP chipsets.
     77  1.1  fvdl  */
     78  1.1  fvdl #define AGP_ALI_AGPCTRL		0xb8
     79  1.1  fvdl #define AGP_ALI_ATTBASE		0xbc
     80  1.1  fvdl #define AGP_ALI_TLBCTRL		0xc0
     81  1.1  fvdl 
     82  1.1  fvdl /*
     83  1.1  fvdl  * Config offsets for the AMD 751 chipset.
     84  1.1  fvdl  */
     85  1.1  fvdl #define AGP_AMD751_REGISTERS	0x14
     86  1.1  fvdl #define AGP_AMD751_APCTRL	0xac
     87  1.1  fvdl #define AGP_AMD751_MODECTRL	0xb0
     88  1.1  fvdl #define AGP_AMD751_MODECTRL_SYNEN	0x80
     89  1.1  fvdl #define AGP_AMD751_MODECTRL2	0xb2
     90  1.1  fvdl #define AGP_AMD751_MODECTRL2_G1LM	0x01
     91  1.1  fvdl #define AGP_AMD751_MODECTRL2_GPDCE	0x02
     92  1.1  fvdl #define AGP_AMD751_MODECTRL2_NGSE	0x08
     93  1.1  fvdl 
     94  1.1  fvdl /*
     95  1.1  fvdl  * Memory mapped register offsets for AMD 751 chipset.
     96  1.1  fvdl  */
     97  1.1  fvdl #define AGP_AMD751_CAPS		0x00
     98  1.1  fvdl #define AGP_AMD751_CAPS_EHI		0x0800
     99  1.1  fvdl #define AGP_AMD751_CAPS_P2P		0x0400
    100  1.1  fvdl #define AGP_AMD751_CAPS_MPC		0x0200
    101  1.1  fvdl #define AGP_AMD751_CAPS_VBE		0x0100
    102  1.1  fvdl #define AGP_AMD751_CAPS_REV		0x00ff
    103  1.1  fvdl #define AGP_AMD751_STATUS	0x02
    104  1.1  fvdl #define AGP_AMD751_STATUS_P2PS		0x0800
    105  1.1  fvdl #define AGP_AMD751_STATUS_GCS		0x0400
    106  1.1  fvdl #define AGP_AMD751_STATUS_MPS		0x0200
    107  1.1  fvdl #define AGP_AMD751_STATUS_VBES		0x0100
    108  1.1  fvdl #define AGP_AMD751_STATUS_P2PE		0x0008
    109  1.1  fvdl #define AGP_AMD751_STATUS_GCE		0x0004
    110  1.1  fvdl #define AGP_AMD751_STATUS_VBEE		0x0001
    111  1.1  fvdl #define AGP_AMD751_ATTBASE	0x04
    112  1.1  fvdl #define AGP_AMD751_TLBCTRL	0x0c
    113  1.1  fvdl 
    114  1.1  fvdl /*
    115  1.1  fvdl  * Config registers for i810 device 0
    116  1.1  fvdl  */
    117  1.1  fvdl #define AGP_I810_SMRAM		0x70
    118  1.1  fvdl #define AGP_I810_SMRAM_GMS		0xc0
    119  1.1  fvdl #define AGP_I810_SMRAM_GMS_DISABLED	0x00
    120  1.1  fvdl #define AGP_I810_SMRAM_GMS_ENABLED_0	0x40
    121  1.1  fvdl #define AGP_I810_SMRAM_GMS_ENABLED_512	0x80
    122  1.1  fvdl #define AGP_I810_SMRAM_GMS_ENABLED_1024	0xc0
    123  1.1  fvdl #define AGP_I810_MISCC		0x72
    124  1.1  fvdl #define	AGP_I810_MISCC_WINSIZE		0x0001
    125  1.1  fvdl #define AGP_I810_MISCC_WINSIZE_64	0x0000
    126  1.1  fvdl #define AGP_I810_MISCC_WINSIZE_32	0x0001
    127  1.1  fvdl #define AGP_I810_MISCC_PLCK		0x0008
    128  1.1  fvdl #define AGP_I810_MISCC_PLCK_UNLOCKED	0x0000
    129  1.1  fvdl #define AGP_I810_MISCC_PLCK_LOCKED	0x0008
    130  1.1  fvdl #define AGP_I810_MISCC_WPTC		0x0030
    131  1.1  fvdl #define AGP_I810_MISCC_WPTC_NOLIMIT	0x0000
    132  1.1  fvdl #define AGP_I810_MISCC_WPTC_62		0x0010
    133  1.1  fvdl #define AGP_I810_MISCC_WPTC_50		0x0020
    134  1.1  fvdl #define	AGP_I810_MISCC_WPTC_37		0x0030
    135  1.1  fvdl #define AGP_I810_MISCC_RPTC		0x00c0
    136  1.1  fvdl #define AGP_I810_MISCC_RPTC_NOLIMIT	0x0000
    137  1.1  fvdl #define AGP_I810_MISCC_RPTC_62		0x0040
    138  1.1  fvdl #define AGP_I810_MISCC_RPTC_50		0x0080
    139  1.1  fvdl #define AGP_I810_MISCC_RPTC_37		0x00c0
    140  1.1  fvdl 
    141  1.1  fvdl /*
    142  1.1  fvdl  * Config registers for i810 device 1
    143  1.1  fvdl  */
    144  1.1  fvdl #define AGP_I810_GMADR		0x10
    145  1.1  fvdl #define AGP_I810_MMADR		0x14
    146  1.1  fvdl 
    147  1.1  fvdl /*
    148  1.1  fvdl  * Memory mapped register offsets for i810 chipset.
    149  1.1  fvdl  */
    150  1.1  fvdl #define AGP_I810_PGTBL_CTL	0x2020
    151  1.1  fvdl #define AGP_I810_DRT		0x3000
    152  1.1  fvdl #define AGP_I810_DRT_UNPOPULATED 0x00
    153  1.1  fvdl #define AGP_I810_DRT_POPULATED	0x01
    154  1.1  fvdl #define AGP_I810_GTT		0x10000
    155  1.2   scw 
    156  1.2   scw /*
    157  1.2   scw  * Config registers for i830MG device 0
    158  1.2   scw  */
    159  1.2   scw #define AGP_I830_GCC0			0x50
    160  1.2   scw #define AGP_I830_GCC1			0x52
    161  1.2   scw #define AGP_I830_GCC1_DEV2		0x08
    162  1.2   scw #define AGP_I830_GCC1_DEV2_ENABLED	0x00
    163  1.2   scw #define AGP_I830_GCC1_DEV2_DISABLED	0x08
    164  1.2   scw #define AGP_I830_GCC1_GMS		0x70
    165  1.2   scw #define AGP_I830_GCC1_GMS_STOLEN_512	0x20
    166  1.2   scw #define AGP_I830_GCC1_GMS_STOLEN_1024	0x30
    167  1.2   scw #define AGP_I830_GCC1_GMS_STOLEN_8192	0x40
    168  1.2   scw #define AGP_I830_GCC1_GMASIZE		0x01
    169  1.2   scw #define AGP_I830_GCC1_GMASIZE_64	0x01
    170  1.2   scw #define AGP_I830_GCC1_GMASIZE_128	0x00
    171  1.1  fvdl 
    172  1.1  fvdl #endif /* !_PCI_AGPREG_H_ */
    173