Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/macppc/dev map 64KB register space on G5, provide f...



details:   https://anonhg.NetBSD.org/src/rev/25e6aa81aa0e
branches:  trunk
changeset: 361603:25e6aa81aa0e
user:      macallan <macallan%NetBSD.org@localhost>
date:      Fri May 04 17:17:48 2018 +0000

description:
map 64KB register space on G5, provide function to bus_space_subregion()
from this area so we don't run into mapping conflicts on G5
Not really relevant on 32bit where we BAT-map everything

diffstat:

 sys/arch/macppc/dev/obio.c    |  15 ++++++++++++---
 sys/arch/macppc/dev/obiovar.h |   3 ++-
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 7fae7f03f0df -r 25e6aa81aa0e sys/arch/macppc/dev/obio.c
--- a/sys/arch/macppc/dev/obio.c        Fri May 04 17:15:23 2018 +0000
+++ b/sys/arch/macppc/dev/obio.c        Fri May 04 17:17:48 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: obio.c,v 1.44 2018/03/29 06:28:12 macallan Exp $       */
+/*     $NetBSD: obio.c,v 1.45 2018/05/04 17:17:48 macallan Exp $       */
 
 /*-
  * Copyright (C) 1998  Internet Research Institute, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.44 2018/03/29 06:28:12 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.45 2018/05/04 17:17:48 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -162,7 +162,7 @@
        case PCI_PRODUCT_APPLE_K2:
        case PCI_PRODUCT_APPLE_SHASTA:
                node = OF_finddevice("mac-io");
-               map_size = 0x8000;
+               map_size = 0x10000;
                break;
 
        default:
@@ -337,6 +337,15 @@
        return bus_space_read_1(obio0->sc_tag, obio0->sc_bh, offset);
 }
 
+int
+obio_space_map(bus_addr_t addr, bus_size_t size, bus_space_handle_t *bh)
+{
+       if (obio0 == NULL)
+               return 0xff;
+       return bus_space_subregion(obio0->sc_tag, obio0->sc_bh,
+           addr & 0xfffff, size, bh);
+}
+       
 #ifdef OBIO_SPEED_CONTROL
 
 static void
diff -r 7fae7f03f0df -r 25e6aa81aa0e sys/arch/macppc/dev/obiovar.h
--- a/sys/arch/macppc/dev/obiovar.h     Fri May 04 17:15:23 2018 +0000
+++ b/sys/arch/macppc/dev/obiovar.h     Fri May 04 17:17:48 2018 +0000
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obiovar.h,v 1.2 2008/09/26 03:40:26 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obiovar.h,v 1.3 2018/05/04 17:17:48 macallan Exp $");
 
 #ifndef OBIOVAR_H
 #define OBIOVAR_H
@@ -41,6 +41,7 @@
 void obio_write_1(int, uint8_t);
 uint32_t obio_read_4(int);
 uint8_t obio_read_1(int);
+int obio_space_map(bus_addr_t, bus_size_t, bus_space_handle_t *);
 
 /* some common offsets */
 #define HEATHROW_FCR   0x38



Home | Main Index | Thread Index | Old Index