Subject: port-evbppc/23985: implement fb_mmap() on explora451
To: None <gnats-bugs@gnats.netbsd.org>
From: None <daver@tombstone.localnet.gomerbud.com>
List: netbsd-bugs
Date: 01/04/2004 19:09:46
>Number:         23985
>Category:       port-evbppc
>Synopsis:       implement fb_mmap() on explora451
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-evbppc-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 05 03:10:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     David P. Reese Jr.
>Release:        NetBSD 1.6ZF
>Organization:
   David P. Reese, Jr.                                  daver at gomerbud.com
                                               http://www.gomerbud.com/daver/
>Environment:
	
	
System: NetBSD tombstone.localnet.gomerbud.com 1.6ZF NetBSD 1.6ZF (TOMBSTONE) #2: Sun Dec 14 21:29:33 PST 2003 daver@tombstone.localnet.gomerbud.com:/usr/src/sys/arch/i386/compile/TOMBSTONE i386
Architecture: i386
Machine: i386
>Description:
	On the explora451, you cannot mmap() /dev/ttyE0 because fb_mmap()
	is not implemented.
>How-To-Repeat:
	
>Fix:
Index: evbppc/explora/dev/fb_elb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/explora/dev/fb_elb.c,v
retrieving revision 1.3
diff -u -u -r1.3 fb_elb.c
--- evbppc/explora/dev/fb_elb.c	2003/07/15 01:37:37	1.3
+++ evbppc/explora/dev/fb_elb.c	2004/01/05 03:03:50
@@ -235,7 +235,13 @@
 static paddr_t
 fb_mmap(void *v, off_t offset, int prot)
 {
-	return -1;
+	struct fb_elb_softc *sc = v;
+
+	if (offset < 0 || offset >= SIZE_FB)
+		return -1;
+
+	return bus_space_mmap(sc->sc_fb->fb_iot, BASE_FB, offset, prot,
+	    BUS_SPACE_MAP_LINEAR);
 }
 
 static int
>Release-Note:
>Audit-Trail:
>Unformatted: