Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/footbridge Implement footbridge_io_bs_mmap.



details:   https://anonhg.NetBSD.org/src/rev/23f8b1618bba
branches:  trunk
changeset: 758866:23f8b1618bba
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Nov 18 18:12:23 2010 +0000

description:
Implement footbridge_io_bs_mmap.

diffstat:

 sys/arch/arm/footbridge/footbridge_io.c |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r 55e431c80e2c -r 23f8b1618bba sys/arch/arm/footbridge/footbridge_io.c
--- a/sys/arch/arm/footbridge/footbridge_io.c   Thu Nov 18 18:06:21 2010 +0000
+++ b/sys/arch/arm/footbridge/footbridge_io.c   Thu Nov 18 18:12:23 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: footbridge_io.c,v 1.17 2010/11/18 18:06:21 skrll Exp $ */
+/*     $NetBSD: footbridge_io.c,v 1.18 2010/11/18 18:12:23 skrll Exp $ */
 
 /*
  * Copyright (c) 1997 Causality Limited
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: footbridge_io.c,v 1.17 2010/11/18 18:06:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: footbridge_io.c,v 1.18 2010/11/18 18:12:23 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -56,6 +56,7 @@
 bs_protos(bs_notimpl);
 bs_map_proto(footbridge_mem);
 bs_unmap_proto(footbridge_mem);
+bs_mmap_proto(footbridge_io);
 bs_mmap_proto(footbridge_mem);
 
 /* Declare the footbridge bus space tag */
@@ -143,6 +144,7 @@
 {
        *t = footbridge_bs_tag;
        t->bs_cookie = cookie;
+       t->bs_mmap = footbridge_io_bs_mmap;
 }
 
 void footbridge_create_mem_bs_tag(t, cookie)
@@ -304,6 +306,25 @@
 
 
 paddr_t
+footbridge_io_bs_mmap(void *t, bus_addr_t addr, off_t offset,
+                      int prot, int flags)
+{
+       paddr_t pa;
+
+       /* allow mapping of IO space */
+       if (addr >= DC21285_PCI_IO_SIZE ||
+           addr >= DC21285_PCI_IO_SIZE - offset ||
+           offset < 0 ||
+           offset >= DC21285_PCI_IO_SIZE)
+               return -1;
+
+       pa = PCI_MAGIC_IO_RANGE + addr + offset;
+
+       return arm_btop(pa);
+}
+
+
+paddr_t
 footbridge_mem_bs_mmap(void *t, bus_addr_t addr, off_t offset,
                       int prot, int flags)
 {



Home | Main Index | Thread Index | Old Index