agpreg.h revision 61501
161452Sdfr/*-
261452Sdfr * Copyright (c) 2000 Doug Rabson
361452Sdfr * All rights reserved.
461452Sdfr *
561452Sdfr * Redistribution and use in source and binary forms, with or without
661452Sdfr * modification, are permitted provided that the following conditions
761452Sdfr * are met:
861452Sdfr * 1. Redistributions of source code must retain the above copyright
961452Sdfr *    notice, this list of conditions and the following disclaimer.
1061452Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1161452Sdfr *    notice, this list of conditions and the following disclaimer in the
1261452Sdfr *    documentation and/or other materials provided with the distribution.
1361452Sdfr *
1461452Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1561452Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1661452Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1761452Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1861452Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1961452Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2061452Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2161452Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2261452Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2361452Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2461452Sdfr * SUCH DAMAGE.
2561452Sdfr *
2661452Sdfr *	$FreeBSD: head/sys/dev/agp/agpreg.h 61501 2000-06-10 17:44:53Z dfr $
2761452Sdfr */
2861452Sdfr
2961452Sdfr#ifndef _PCI_AGPREG_H_
3061452Sdfr#define _PCI_AGPREG_H_
3161452Sdfr
3261452Sdfr/*
3361452Sdfr * Offsets for various AGP configuration registers.
3461452Sdfr */
3561452Sdfr#define AGP_APBASE		0x10
3661452Sdfr#define AGP_CAPPTR		0x34
3761452Sdfr
3861452Sdfr/*
3961452Sdfr * Offsets from the AGP Capability pointer.
4061452Sdfr */
4161452Sdfr#define AGP_CAPID		0x0
4261452Sdfr#define AGP_CAPID_GET_MAJOR(x)		(((x) & 0x00f00000U) >> 20)
4361452Sdfr#define AGP_CAPID_GET_MINOR(x)		(((x) & 0x000f0000U) >> 16)
4461452Sdfr#define AGP_CAPID_GET_NEXT_PTR(x)	(((x) & 0x0000ff00U) >> 8)
4561452Sdfr#define AGP_CAPID_GET_CAP_ID(x)		(((x) & 0x000000ffU) >> 0)
4661452Sdfr
4761452Sdfr#define AGP_STATUS		0x4
4861452Sdfr#define AGP_COMMAND		0x8
4961452Sdfr
5061452Sdfr/*
5161452Sdfr * Config offsets for Intel AGP chipsets.
5261452Sdfr */
5361452Sdfr#define AGP_INTEL_NBXCFG	0x50
5461452Sdfr#define AGP_INTEL_ERRSTS	0x91
5561452Sdfr#define AGP_INTEL_AGPCTRL	0xb0
5661452Sdfr#define AGP_INTEL_APSIZE	0xb4
5761452Sdfr#define AGP_INTEL_ATTBASE	0xb8
5861452Sdfr
5961452Sdfr/*
6061452Sdfr * Config offsets for VIA AGP chipsets.
6161452Sdfr */
6261452Sdfr#define AGP_VIA_GARTCTRL	0x80
6361452Sdfr#define AGP_VIA_APSIZE		0x84
6461452Sdfr#define AGP_VIA_ATTBASE		0x88
6561452Sdfr
6661452Sdfr/*
6761452Sdfr * Config offsets for SiS AGP chipsets.
6861452Sdfr */
6961452Sdfr#define AGP_SIS_ATTBASE		0x90
7061452Sdfr#define AGP_SIS_WINCTRL		0x94
7161452Sdfr#define AGP_SIS_TLBCTRL		0x97
7261452Sdfr#define AGP_SIS_TLBFLUSH	0x98
7361452Sdfr
7461452Sdfr/*
7561452Sdfr * Config offsets for Ali AGP chipsets.
7661452Sdfr */
7761452Sdfr#define AGP_ALI_AGPCTRL		0xb8
7861452Sdfr#define AGP_ALI_ATTBASE		0xbc
7961452Sdfr#define AGP_ALI_TLBCTRL		0xc0
8061452Sdfr
8161452Sdfr/*
8261452Sdfr * Config offsets for the AMD 751 chipset.
8361452Sdfr */
8461452Sdfr#define AGP_AMD751_REGISTERS	0x14
8561452Sdfr#define AGP_AMD751_APCTRL	0xac
8661452Sdfr#define AGP_AMD751_MODECTRL	0xb0
8761501Sdfr#define AGP_AMD751_MODECTRL_SYNEN	0x80
8861501Sdfr#define AGP_AMD751_MODECTRL2	0xb2
8961501Sdfr#define AGP_AMD751_MODECTRL2_G1LM	0x01
9061501Sdfr#define AGP_AMD751_MODECTRL2_GPDCE	0x02
9161501Sdfr#define AGP_AMD751_MODECTRL2_NGSE	0x08
9261452Sdfr
9361452Sdfr/*
9461452Sdfr * Memory mapped register offsets for AMD 751 chipset.
9561452Sdfr */
9661452Sdfr#define AGP_AMD751_CAPS		0x00
9761452Sdfr#define AGP_AMD751_CAPS_EHI		0x0800
9861452Sdfr#define AGP_AMD751_CAPS_P2P		0x0400
9961452Sdfr#define AGP_AMD751_CAPS_MPC		0x0200
10061452Sdfr#define AGP_AMD751_CAPS_VBE		0x0100
10161452Sdfr#define AGP_AMD751_CAPS_REV		0x00ff
10261452Sdfr#define AGP_AMD751_STATUS	0x02
10361452Sdfr#define AGP_AMD751_STATUS_P2PS		0x0800
10461452Sdfr#define AGP_AMD751_STATUS_GCS		0x0400
10561452Sdfr#define AGP_AMD751_STATUS_MPS		0x0200
10661452Sdfr#define AGP_AMD751_STATUS_VBES		0x0100
10761452Sdfr#define AGP_AMD751_STATUS_P2PE		0x0008
10861452Sdfr#define AGP_AMD751_STATUS_GCE		0x0004
10961452Sdfr#define AGP_AMD751_STATUS_VBEE		0x0001
11061452Sdfr#define AGP_AMD751_ATTBASE	0x04
11161452Sdfr#define AGP_AMD751_TLBCTRL	0x0c
11261452Sdfr
11361452Sdfr
11461452Sdfr#endif /* !_PCI_AGPREG_H_ */
115