Tue May 26 03:32:51 2009 UTC ()
use BUS_SPACE_MAP_LARGE


(macallan)
diff -r1.18 -r1.19 src/sys/dev/sbus/agten.c
diff -r1.28 -r1.29 src/sys/dev/sbus/cgsix_sbus.c
diff -r1.29 -r1.30 src/sys/dev/sbus/zx.c

cvs diff -r1.18 -r1.19 src/sys/dev/sbus/agten.c (expand / switch to unified diff)

--- src/sys/dev/sbus/agten.c 2009/05/12 13:20:05 1.18
+++ src/sys/dev/sbus/agten.c 2009/05/26 03:32:51 1.19
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: agten.c,v 1.18 2009/05/12 13:20:05 cegger Exp $ */ 1/* $NetBSD: agten.c,v 1.19 2009/05/26 03:32:51 macallan Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 Michael Lorenz 4 * Copyright (c) 2007 Michael Lorenz
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.18 2009/05/12 13:20:05 cegger Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.19 2009/05/26 03:32:51 macallan Exp $");
31 31
32/* 32/*
33 * a driver for the Fujitsu AG-10e SBus framebuffer 33 * a driver for the Fujitsu AG-10e SBus framebuffer
34 * 34 *
35 * this thing is Frankenstein's Monster among graphics boards. 35 * this thing is Frankenstein's Monster among graphics boards.
36 * it contains three graphics chips: 36 * it contains three graphics chips:
37 * a GLint - 24bit stuff, double-buffered 37 * a GLint - 24bit stuff, double-buffered
38 * an Imagine 128 which provides an 8bit overlay 38 * an Imagine 128 which provides an 8bit overlay
39 * a Weitek P9100 which provides WIDs 39 * a Weitek P9100 which provides WIDs
40 * so here we need to mess only with the P9100 and the I128 - for X we just 40 * so here we need to mess only with the P9100 and the I128 - for X we just
41 * hide the overlay and let the Xserver mess with the GLint 41 * hide the overlay and let the Xserver mess with the GLint
42 */ 42 */
43 43
@@ -235,29 +235,30 @@ agten_attach(device_t parent, device_t d @@ -235,29 +235,30 @@ agten_attach(device_t parent, device_t d
235 sc->sc_screenlist = (struct wsscreen_list){1, sc->sc_screens}; 235 sc->sc_screenlist = (struct wsscreen_list){1, sc->sc_screens};
236 sc->sc_mode = WSDISPLAYIO_MODE_EMUL; 236 sc->sc_mode = WSDISPLAYIO_MODE_EMUL;
237 sc->sc_fb_is_open = 0; 237 sc->sc_fb_is_open = 0;
238 sc->sc_video = -1; 238 sc->sc_video = -1;
239 sc->sc_bustag = sa->sa_bustag; 239 sc->sc_bustag = sa->sa_bustag;
240 240
241 sc->sc_width = prom_getpropint(node, "ffb_width", 1152); 241 sc->sc_width = prom_getpropint(node, "ffb_width", 1152);
242 sc->sc_height = prom_getpropint(node, "ffb_height", 900); 242 sc->sc_height = prom_getpropint(node, "ffb_height", 900);
243 sc->sc_depth = prom_getpropint(node, "ffb_depth", 8); 243 sc->sc_depth = prom_getpropint(node, "ffb_depth", 8);
244 sc->sc_stride = sc->sc_width * (sc->sc_depth >> 3); 244 sc->sc_stride = sc->sc_width * (sc->sc_depth >> 3);
245 245
246 reg = prom_getpropint(node, "i128_fb_physaddr", -1); 246 reg = prom_getpropint(node, "i128_fb_physaddr", -1);
247 sc->sc_i128_fbsz = prom_getpropint(node, "i128_fb_size", -1); 247 sc->sc_i128_fbsz = prom_getpropint(node, "i128_fb_size", -1);
248 if (sparc_bus_map_large(sc->sc_bustag, 248 if (sbus_bus_map(sc->sc_bustag,
249 sa->sa_reg[0].oa_space, sa->sa_reg[0].oa_base + reg, 249 sa->sa_reg[0].oa_space, sa->sa_reg[0].oa_base + reg,
250 sc->sc_stride * sc->sc_height, BUS_SPACE_MAP_LINEAR,  250 sc->sc_stride * sc->sc_height,
 251 BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_LARGE,
251 &sc->sc_i128_fbh) != 0) { 252 &sc->sc_i128_fbh) != 0) {
252 253
253 aprint_error_dev(dev, "unable to map the framebuffer\n"); 254 aprint_error_dev(dev, "unable to map the framebuffer\n");
254 return; 255 return;
255 } 256 }
256 fb->fb_pixels = bus_space_vaddr(sc->sc_bustag, sc->sc_i128_fbh); 257 fb->fb_pixels = bus_space_vaddr(sc->sc_bustag, sc->sc_i128_fbh);
257 258
258 reg = prom_getpropint(node, "i128_reg_physaddr", -1); 259 reg = prom_getpropint(node, "i128_reg_physaddr", -1);
259 if (sbus_bus_map(sc->sc_bustag, 260 if (sbus_bus_map(sc->sc_bustag,
260 sa->sa_reg[0].oa_space, sa->sa_reg[0].oa_base + reg, 261 sa->sa_reg[0].oa_space, sa->sa_reg[0].oa_base + reg,
261 0x10000, 0, &sc->sc_i128_regh) != 0) { 262 0x10000, 0, &sc->sc_i128_regh) != 0) {
262 263
263 aprint_error_dev(dev, "unable to map I128 registers\n"); 264 aprint_error_dev(dev, "unable to map I128 registers\n");

cvs diff -r1.28 -r1.29 src/sys/dev/sbus/cgsix_sbus.c (expand / switch to unified diff)

--- src/sys/dev/sbus/cgsix_sbus.c 2009/05/12 13:20:05 1.28
+++ src/sys/dev/sbus/cgsix_sbus.c 2009/05/26 03:32:51 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cgsix_sbus.c,v 1.28 2009/05/12 13:20:05 cegger Exp $ */ 1/* $NetBSD: cgsix_sbus.c,v 1.29 2009/05/26 03:32:51 macallan Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Paul Kranenburg. 8 * by Paul Kranenburg.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * color display (cgsix) driver; Sbus bus front-end. 33 * color display (cgsix) driver; Sbus bus front-end.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: cgsix_sbus.c,v 1.28 2009/05/12 13:20:05 cegger Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: cgsix_sbus.c,v 1.29 2009/05/26 03:32:51 macallan Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/systm.h> 40#include <sys/systm.h>
41#include <sys/buf.h> 41#include <sys/buf.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/ioctl.h> 43#include <sys/ioctl.h>
44#include <sys/malloc.h> 44#include <sys/malloc.h>
45#include <sys/mman.h> 45#include <sys/mman.h>
46#include <sys/tty.h> 46#include <sys/tty.h>
47#include <sys/conf.h> 47#include <sys/conf.h>
48 48
49#ifdef DEBUG 49#ifdef DEBUG
50#include <sys/proc.h> 50#include <sys/proc.h>
@@ -176,21 +176,22 @@ cgsixattach(device_t parent, device_t se @@ -176,21 +176,22 @@ cgsixattach(device_t parent, device_t se
176 name = prom_getpropstring(node, "model"); 176 name = prom_getpropstring(node, "model");
177 177
178 isconsole = fb_is_console(node); 178 isconsole = fb_is_console(node);
179 179
180 /* 180 /*
181 * we need the address of the framebuffer, no matter if we're console or 181 * we need the address of the framebuffer, no matter if we're console or
182 * not. 182 * not.
183 */ 183 */
184 sc->sc_ramsize = prom_getpropint(node, "fbmapped", 1024 * 1024); 184 sc->sc_ramsize = prom_getpropint(node, "fbmapped", 1024 * 1024);
185 if (sbus_bus_map(sa->sa_bustag, 185 if (sbus_bus_map(sa->sa_bustag,
186 sa->sa_slot, 186 sa->sa_slot,
187 sa->sa_offset + CGSIX_RAM_OFFSET, 187 sa->sa_offset + CGSIX_RAM_OFFSET,
188 sc->sc_ramsize, 188 sc->sc_ramsize,
189 BUS_SPACE_MAP_LINEAR, &bh) != 0) { 189 BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_LARGE,
 190 &bh) != 0) {
190 aprint_error_dev(self, "cannot map pixels\n"); 191 aprint_error_dev(self, "cannot map pixels\n");
191 return; 192 return;
192 } 193 }
193 sc->sc_fb.fb_pixels = (void *)bus_space_vaddr(sa->sa_bustag, bh); 194 sc->sc_fb.fb_pixels = (void *)bus_space_vaddr(sa->sa_bustag, bh);
194 195
195 cg6attach(sc, name, isconsole); 196 cg6attach(sc, name, isconsole);
196} 197}

cvs diff -r1.29 -r1.30 src/sys/dev/sbus/zx.c (expand / switch to unified diff)

--- src/sys/dev/sbus/zx.c 2009/05/12 13:20:06 1.29
+++ src/sys/dev/sbus/zx.c 2009/05/26 03:32:51 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: zx.c,v 1.29 2009/05/12 13:20:06 cegger Exp $ */ 1/* $NetBSD: zx.c,v 1.30 2009/05/26 03:32:51 macallan Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -35,27 +35,27 @@ @@ -35,27 +35,27 @@
35 * drivers were used as "living documentation" when writing this; thanks 35 * drivers were used as "living documentation" when writing this; thanks
36 * to the authors. 36 * to the authors.
37 * 37 *
38 * Issues (which can be solved with wscons, happily enough): 38 * Issues (which can be solved with wscons, happily enough):
39 * 39 *
40 * o There is lots of unnecessary mucking about rasops in here, primarily 40 * o There is lots of unnecessary mucking about rasops in here, primarily
41 * to appease the sparc fb code. 41 * to appease the sparc fb code.
42 * 42 *
43 * o RASTERCONSOLE is required. X needs the board set up correctly, and 43 * o RASTERCONSOLE is required. X needs the board set up correctly, and
44 * that's difficult to reconcile with using the PROM for output. 44 * that's difficult to reconcile with using the PROM for output.
45 */ 45 */
46 46
47#include <sys/cdefs.h> 47#include <sys/cdefs.h>
48__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.29 2009/05/12 13:20:06 cegger Exp $"); 48__KERNEL_RCSID(0, "$NetBSD: zx.c,v 1.30 2009/05/26 03:32:51 macallan Exp $");
49 49
50#include <sys/param.h> 50#include <sys/param.h>
51#include <sys/systm.h> 51#include <sys/systm.h>
52#include <sys/device.h> 52#include <sys/device.h>
53#include <sys/ioctl.h> 53#include <sys/ioctl.h>
54#include <sys/malloc.h> 54#include <sys/malloc.h>
55#include <sys/mman.h> 55#include <sys/mman.h>
56#include <sys/tty.h> 56#include <sys/tty.h>
57#include <sys/conf.h> 57#include <sys/conf.h>
58#include <sys/syslog.h> 58#include <sys/syslog.h>
59#include <sys/buf.h> 59#include <sys/buf.h>
60 60
61#include <sys/bus.h> 61#include <sys/bus.h>
@@ -219,28 +219,28 @@ zx_attach(device_t parent, device_t self @@ -219,28 +219,28 @@ zx_attach(device_t parent, device_t self
219 unsigned long defattr; 219 unsigned long defattr;
220#endif 220#endif
221 int isconsole, width, height; 221 int isconsole, width, height;
222 222
223 sc = device_private(self); 223 sc = device_private(self);
224 sc->sc_dv = self; 224 sc->sc_dv = self;
225 225
226 sa = args; 226 sa = args;
227 fb = &sc->sc_fb; 227 fb = &sc->sc_fb;
228 bt = sa->sa_bustag; 228 bt = sa->sa_bustag;
229 sc->sc_bt = bt; 229 sc->sc_bt = bt;
230 sc->sc_paddr = sbus_bus_addr(bt, sa->sa_slot, sa->sa_offset); 230 sc->sc_paddr = sbus_bus_addr(bt, sa->sa_slot, sa->sa_offset);
231 231
232 if (sparc_bus_map_large(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_SS0, 232 if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_SS0,
233 0x800000, BUS_SPACE_MAP_LINEAR, &bh) != 0) { 233 0x800000, BUS_SPACE_MAP_LINEAR | BUS_SPACE_MAP_LARGE, &bh) != 0) {
234 aprint_error_dev(self, "can't map bits\n"); 234 aprint_error_dev(self, "can't map bits\n");
235 return; 235 return;
236 } 236 }
237 fb->fb_pixels = (void *)bus_space_vaddr(bt, bh); 237 fb->fb_pixels = (void *)bus_space_vaddr(bt, bh);
238 sc->sc_pixels = (u_int32_t *)fb->fb_pixels; 238 sc->sc_pixels = (u_int32_t *)fb->fb_pixels;
239 239
240 if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_LC_SS0_USR, 240 if (sbus_bus_map(bt, sa->sa_slot, sa->sa_offset + ZX_OFF_LC_SS0_USR,
241 PAGE_SIZE, BUS_SPACE_MAP_LINEAR, &bh) != 0) { 241 PAGE_SIZE, BUS_SPACE_MAP_LINEAR, &bh) != 0) {
242 aprint_error_dev(self, "can't map zc\n"); 242 aprint_error_dev(self, "can't map zc\n");
243 return; 243 return;
244 } 244 }
245 245
246 sc->sc_bhzc = bh; 246 sc->sc_bhzc = bh;