From 5865d6a998391648e294e7a7d4670166fb810364 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Fri, 12 Jul 2002 20:17:04 +0000 Subject: support for the agp gart on various agp chipsets. only i810 driver was tested though. based on the netbsd's lkm, initially ported by hunter@dg.net.ua and later made into shape by mickey. testing by art@ and millert@ . --- sys/dev/ic/i82810reg.h | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/ic/vga.c | 14 ++------- sys/dev/ic/vgavar.h | 12 ++------ 3 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 sys/dev/ic/i82810reg.h (limited to 'sys/dev/ic') diff --git a/sys/dev/ic/i82810reg.h b/sys/dev/ic/i82810reg.h new file mode 100644 index 00000000000..b20f4e6a137 --- /dev/null +++ b/sys/dev/ic/i82810reg.h @@ -0,0 +1,82 @@ +/* $OpenBSD: i82810reg.h,v 1.1 2002/07/12 20:17:03 mickey Exp $ */ + +/* + * Copyright (c) 2000 Michael Shalayeff + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Michael Shalayeff. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* + * Intel i82810/810E memory and graphics controller + * http:// + */ + +/* Host-Hub Interface Bridge/DRAM Controller Device Registers (Device 0) */ +#define I82810_SMRAM 0x70 +#define I82810_SMRAM_GMS_DIS 0x00 +#define I82810_SMRAM_GMS_RSRVD 0x40 +#define I82810_SMRAM_GMS_512 0x80 +#define I82810_SMRAM_GMS_1024 0xc0 +#define I82810_SMRAM_USMM_DIS 0x00 +#define I82810_SMRAM_USMM_TDHE 0x10 +#define I82810_SMRAM_USMM_T5HE 0x20 +#define I82810_SMRAM_USMM_T1HE 0x30 +#define I82810_SMRAM_LSMM_DIS 0x00 +#define I82810_SMRAM_LSMM_GSM 0x04 +#define I82810_SMRAM_LSMM_CRSH 0x08 +#define I82810_SMRAM_D_LCK 0x02 +#define I82810_SMRAM_E_SMERR 0x01 +#define I82810_MISCC 0x72 +#define I82810_MISCC_GDCWS 0x0001 +#define I82810_MISCC_P_LCK 0x0008 +#define I82810_MISCC_WPTHC_NO 0x0000 +#define I82810_MISCC_WPTHC_625 0x0010 +#define I82810_MISCC_WPTHC_500 0x0020 +#define I82810_MISCC_WPTHC_375 0x0030 +#define I82810_MISCC_RPTHC_NO 0x0000 +#define I82810_MISCC_RPTHC_625 0x0040 +#define I82810_MISCC_RPTHC_500 0x0080 +#define I82810_MISCC_RPTHC_375 0x00c0 + +/* Graphics Device Registers (Device 1) */ +#define I82810_GMADR 0x10 +#define I82810_MMADR 0x14 + +#define I82810_DRT 0x3000 +#define I82810_DRT_DP 0x01 +#define I82810_DRAMCL 0x3001 +#define I82810_DRAMCL_RPT 0x01 +#define I82810_DRAMCL_RT 0x02 +#define I82810_DRAMCL_CL 0x04 +#define I82810_DRAMCL_RCO 0x08 +#define I82810_DRAMCL_PMC 0x10 +#define I82810_DRAMCH 0x3002 +#define I82810_DRAMCH_SMS 0x07 +#define I82810_DRAMCH_DRR 0x18 +#define I82810_GTT 0x10000 diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index 1dc3f035154..373226c8d09 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.29 2002/03/14 03:16:05 millert Exp $ */ +/* $OpenBSD: vga.c,v 1.30 2002/07/12 20:17:03 mickey Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /* @@ -497,7 +497,6 @@ vga_common_attach(self, iot, memt, type) bus_space_tag_t iot, memt; int type; { -#ifdef arc vga_extended_attach(self, iot, memt, type, NULL); } @@ -506,9 +505,8 @@ vga_extended_attach(self, iot, memt, type, map) struct device *self; bus_space_tag_t iot, memt; int type; - int (*map)(void *, vaddr_t, int); + paddr_t (*map)(void *, off_t, int); { -#endif /* arc */ int console; struct vga_config *vc; struct wsemuldisplaydev_attach_args aa; @@ -528,9 +526,7 @@ vga_extended_attach(self, iot, memt, type, map) vc->vc_softc = self; vc->vc_type = type; -#ifdef arc vc->vc_mmap = map; -#endif aa.console = console; aa.scrdata = (vc->hdl.vh_mono ? &vga_screenlist_mono : &vga_screenlist); @@ -628,15 +624,11 @@ vga_mmap(v, offset, prot) off_t offset; int prot; { - -#ifdef arc struct vga_config *vc = v; if (vc->vc_mmap != NULL) return (*vc->vc_mmap)(v, offset, prot); -#else - /* XXX */ -#endif + return -1; } diff --git a/sys/dev/ic/vgavar.h b/sys/dev/ic/vgavar.h index 5a5db102d10..7bac3e67bbc 100644 --- a/sys/dev/ic/vgavar.h +++ b/sys/dev/ic/vgavar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vgavar.h,v 1.7 2002/03/14 03:16:05 millert Exp $ */ +/* $OpenBSD: vgavar.h,v 1.8 2002/07/12 20:17:03 mickey Exp $ */ /* $NetBSD: vgavar.h,v 1.4 2000/06/17 07:11:50 soda Exp $ */ /* @@ -57,9 +57,7 @@ struct vga_config { void (*switchcb)(void *, int, int); void *switchcbarg; -#ifdef arc paddr_t (*vc_mmap)(void *, off_t, int); -#endif struct timeout vc_switch_timeout; }; @@ -164,14 +162,10 @@ static inline void _vga_gdc_write(vh, reg, val) int vga_common_probe(bus_space_tag_t, bus_space_tag_t); void vga_common_attach(struct device *, bus_space_tag_t, - bus_space_tag_t, int); -#ifdef arc + bus_space_tag_t, int); void vga_extended_attach(struct device *, bus_space_tag_t, - bus_space_tag_t, int, - int (*)(void *, off_t, int)); -#endif + bus_space_tag_t, int, paddr_t (*)(void *, off_t, int)); int vga_is_console(bus_space_tag_t, int); - int vga_cnattach(bus_space_tag_t, bus_space_tag_t, int, int); struct wsscreen_descr; -- cgit v1.2.3