Tue Jun 30 03:52:54 2015 UTC ()
don't map the framebuffer as cacheable


(macallan)
diff -r1.15 -r1.16 src/sys/arch/shark/ofw/igsfb_ofbus.c

cvs diff -r1.15 -r1.16 src/sys/arch/shark/ofw/igsfb_ofbus.c (expand / switch to unified diff)

--- src/sys/arch/shark/ofw/igsfb_ofbus.c 2014/01/02 19:00:39 1.15
+++ src/sys/arch/shark/ofw/igsfb_ofbus.c 2015/06/30 03:52:54 1.16
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: igsfb_ofbus.c,v 1.15 2014/01/02 19:00:39 joerg Exp $ */ 1/* $NetBSD: igsfb_ofbus.c,v 1.16 2015/06/30 03:52:54 macallan Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Michael Lorenz 4 * Copyright (c) 2006 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.
@@ -21,27 +21,27 @@ @@ -21,27 +21,27 @@
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28/* 28/*
29 * Integraphics Systems IGA 168x and CyberPro series. 29 * Integraphics Systems IGA 168x and CyberPro series.
30 * ofbus attachment for Valeriy E. Ushakov's igsfb driver 30 * ofbus attachment for Valeriy E. Ushakov's igsfb driver
31 */ 31 */
32 32
33#include <sys/cdefs.h> 33#include <sys/cdefs.h>
34__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.15 2014/01/02 19:00:39 joerg Exp $"); 34__KERNEL_RCSID(0, "$NetBSD: igsfb_ofbus.c,v 1.16 2015/06/30 03:52:54 macallan Exp $");
35 35
36#include <sys/param.h> 36#include <sys/param.h>
37#include <sys/systm.h> 37#include <sys/systm.h>
38#include <sys/kernel.h> 38#include <sys/kernel.h>
39#include <sys/device.h> 39#include <sys/device.h>
40#include <sys/malloc.h> 40#include <sys/malloc.h>
41#include <sys/buf.h> 41#include <sys/buf.h>
42#include <sys/bus.h> 42#include <sys/bus.h>
43#include <uvm/uvm.h> 43#include <uvm/uvm.h>
44 44
45#include <machine/intr.h> 45#include <machine/intr.h>
46#include <machine/ofw.h> 46#include <machine/ofw.h>
47#include <machine/pmap.h> 47#include <machine/pmap.h>
@@ -102,27 +102,27 @@ igsfb_ofbus_cnattach(bus_space_tag_t iot @@ -102,27 +102,27 @@ igsfb_ofbus_cnattach(bus_space_tag_t iot
102 return ENXIO; 102 return ENXIO;
103 if (of_compatible(igs_node, compat_strings) < 0)  103 if (of_compatible(igs_node, compat_strings) < 0)
104 return ENXIO; 104 return ENXIO;
105 105
106 /* 106 /*
107 * now we know there's a CyberPro in this machine so map it into 107 * now we know there's a CyberPro in this machine so map it into
108 * kernel space, even if it's not the console 108 * kernel space, even if it's not the console
109 */ 109 */
110 if (OF_getprop(igs_node, "reg", regs, sizeof(regs)) <= 0) 110 if (OF_getprop(igs_node, "reg", regs, sizeof(regs)) <= 0)
111 return ENXIO; 111 return ENXIO;
112 112
113 igsfb_mem_paddr = be32toh(regs[13]); 113 igsfb_mem_paddr = be32toh(regs[13]);
114 /* 4MB VRAM aperture, bufferable and cacheable */ 114 /* 4MB VRAM aperture, bufferable and cacheable */
115 igsfb_mem_vaddr = ofw_map(igsfb_mem_paddr, 0x00400000, L2_B | L2_C); 115 igsfb_mem_vaddr = ofw_map(igsfb_mem_paddr, 0x00400000, L2_B);
116 /* MMIO registers */ 116 /* MMIO registers */
117 igsfb_mmio_vaddr = ofw_map(igsfb_mem_paddr + IGS_MEM_MMIO_SELECT, 117 igsfb_mmio_vaddr = ofw_map(igsfb_mem_paddr + IGS_MEM_MMIO_SELECT,
118 0x00100000, 0); 118 0x00100000, 0);
119 119
120 memcpy(&igsfb_memt, memt, sizeof(struct bus_space)); 120 memcpy(&igsfb_memt, memt, sizeof(struct bus_space));
121 igsfb_memt.bs_cookie = (void *)igsfb_mem_vaddr; 121 igsfb_memt.bs_cookie = (void *)igsfb_mem_vaddr;
122 memcpy(&igsfb_iot, memt, sizeof(struct bus_space)); 122 memcpy(&igsfb_iot, memt, sizeof(struct bus_space));
123 igsfb_iot.bs_cookie = (void *)igsfb_mmio_vaddr; 123 igsfb_iot.bs_cookie = (void *)igsfb_mmio_vaddr;
124 124
125 /* 125 /*
126 * check if the firmware output device is indeed the CyberPro 126 * check if the firmware output device is indeed the CyberPro
127 */ 127 */
128 if ((chosen_phandle = OF_finddevice("/chosen")) == -1 || 128 if ((chosen_phandle = OF_finddevice("/chosen")) == -1 ||