| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: vga_ofbus.c,v 1.14 2008/04/17 00:03:36 macallan Exp $ */ | | 1 | /* $NetBSD: vga_ofbus.c,v 1.15 2008/10/11 20:36:40 tsutsui Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1995, 1996 Carnegie-Mellon University. | | 4 | * Copyright (c) 1995, 1996 Carnegie-Mellon University. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Author: Chris G. Demetriou | | 7 | * Author: Chris G. Demetriou |
8 | * | | 8 | * |
9 | * Permission to use, copy, modify and distribute this software and | | 9 | * Permission to use, copy, modify and distribute this software and |
10 | * its documentation is hereby granted, provided that both the copyright | | 10 | * its documentation is hereby granted, provided that both the copyright |
11 | * notice and this permission notice appear in all copies of the | | 11 | * notice and this permission notice appear in all copies of the |
12 | * software, derivative works or modified versions, and any portions | | 12 | * software, derivative works or modified versions, and any portions |
13 | * thereof, and that both notices appear in supporting documentation. | | 13 | * thereof, and that both notices appear in supporting documentation. |
14 | * | | 14 | * |
| @@ -18,27 +18,27 @@ | | | @@ -18,27 +18,27 @@ |
18 | * | | 18 | * |
19 | * Carnegie Mellon requests users of this software to return to | | 19 | * Carnegie Mellon requests users of this software to return to |
20 | * | | 20 | * |
21 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU | | 21 | * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU |
22 | * School of Computer Science | | 22 | * School of Computer Science |
23 | * Carnegie Mellon University | | 23 | * Carnegie Mellon University |
24 | * Pittsburgh PA 15213-3890 | | 24 | * Pittsburgh PA 15213-3890 |
25 | * | | 25 | * |
26 | * any improvements or extensions that they make and grant Carnegie the | | 26 | * any improvements or extensions that they make and grant Carnegie the |
27 | * rights to redistribute these changes. | | 27 | * rights to redistribute these changes. |
28 | */ | | 28 | */ |
29 | | | 29 | |
30 | #include <sys/cdefs.h> | | 30 | #include <sys/cdefs.h> |
31 | __KERNEL_RCSID(0, "$NetBSD: vga_ofbus.c,v 1.14 2008/04/17 00:03:36 macallan Exp $"); | | 31 | __KERNEL_RCSID(0, "$NetBSD: vga_ofbus.c,v 1.15 2008/10/11 20:36:40 tsutsui Exp $"); |
32 | | | 32 | |
33 | #include <sys/param.h> | | 33 | #include <sys/param.h> |
34 | #include <sys/systm.h> | | 34 | #include <sys/systm.h> |
35 | #include <sys/kernel.h> | | 35 | #include <sys/kernel.h> |
36 | #include <sys/device.h> | | 36 | #include <sys/device.h> |
37 | #include <sys/malloc.h> | | 37 | #include <sys/malloc.h> |
38 | #include <sys/proc.h> | | 38 | #include <sys/proc.h> |
39 | #include <sys/kauth.h> | | 39 | #include <sys/kauth.h> |
40 | | | 40 | |
41 | #include <dev/isa/isavar.h> | | 41 | #include <dev/isa/isavar.h> |
42 | | | 42 | |
43 | #include <dev/ic/mc6845reg.h> | | 43 | #include <dev/ic/mc6845reg.h> |
44 | #include <dev/ic/pcdisplayvar.h> | | 44 | #include <dev/ic/pcdisplayvar.h> |
| @@ -103,34 +103,34 @@ vga_ofbus_attach(device_t parent, device | | | @@ -103,34 +103,34 @@ vga_ofbus_attach(device_t parent, device |
103 | struct ofbus_attach_args *oba = aux; | | 103 | struct ofbus_attach_args *oba = aux; |
104 | int vga_handle, i; | | 104 | int vga_handle, i; |
105 | | | 105 | |
106 | sc->sc_dev = self; | | 106 | sc->sc_dev = self; |
107 | aprint_normal("\n"); | | 107 | aprint_normal("\n"); |
108 | osc->sc_phandle = oba->oba_phandle; | | 108 | osc->sc_phandle = oba->oba_phandle; |
109 | | | 109 | |
110 | vga_handle = OF_finddevice("/vlbus/display"); | | 110 | vga_handle = OF_finddevice("/vlbus/display"); |
111 | OF_getprop(vga_handle, "reg", vga_reg, sizeof(vga_reg)); | | 111 | OF_getprop(vga_handle, "reg", vga_reg, sizeof(vga_reg)); |
112 | | | 112 | |
113 | /* for some idiotic reason we get this in the wrong byte order */ | | 113 | /* for some idiotic reason we get this in the wrong byte order */ |
114 | for (i = 0; i < 12; i++) { | | 114 | for (i = 0; i < 12; i++) { |
115 | vga_reg[i] = be32toh(vga_reg[i]); | | 115 | vga_reg[i] = be32toh(vga_reg[i]); |
116 | printf("%08x\n", vga_reg[i]); | | 116 | aprint_debug_dev(self, "vga_reg[%2d] = 0x%08x\n", |
| | | 117 | i, vga_reg[i]); |
117 | } | | 118 | } |
118 | | | 119 | |
119 | vga_common_attach(sc, &isa_io_bs_tag, &isa_mem_bs_tag, | | 120 | vga_common_attach(sc, &isa_io_bs_tag, &isa_mem_bs_tag, |
120 | WSDISPLAY_TYPE_ISAVGA, 0, &vga_ofbus_funcs); | | 121 | WSDISPLAY_TYPE_ISAVGA, 0, &vga_ofbus_funcs); |
121 | if (vga_reg[10] > 0) { | | 122 | if (vga_reg[10] > 0) { |
122 | aprint_normal("%s: aperture at 0x%08x\n", device_xname(self), | | 123 | aprint_normal_dev(self, "aperture at 0x%08x\n", vga_reg[10]); |
123 | vga_reg[10]); | | | |
124 | } | | 124 | } |
125 | } | | 125 | } |
126 | | | 126 | |
127 | int | | 127 | int |
128 | vga_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt) | | 128 | vga_ofbus_cnattach(bus_space_tag_t iot, bus_space_tag_t memt) |
129 | { | | 129 | { |
130 | int chosen_phandle; | | 130 | int chosen_phandle; |
131 | int stdout_ihandle, stdout_phandle, ret; | | 131 | int stdout_ihandle, stdout_phandle, ret; |
132 | char buf[128]; | | 132 | char buf[128]; |
133 | | | 133 | |
134 | stdout_phandle = 0; | | 134 | stdout_phandle = 0; |
135 | | | 135 | |
136 | /* | | 136 | /* |