summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/dev
diff options
context:
space:
mode:
authormacallan <macallan@NetBSD.org>2018-05-04 17:17:48 +0000
committermacallan <macallan@NetBSD.org>2018-05-04 17:17:48 +0000
commit5fa6380fdaba558f76c2faef0ca8eb8b63181cfc (patch)
tree3821c4a63e9e7155bf8d853fba93d85fd6ba3b3a /sys/arch/macppc/dev
parentf255930e3260e9df49e99d533f047203c912d5f4 (diff)
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 (limited to 'sys/arch/macppc/dev')
-rw-r--r--sys/arch/macppc/dev/obio.c15
-rw-r--r--sys/arch/macppc/dev/obiovar.h3
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/arch/macppc/dev/obio.c b/sys/arch/macppc/dev/obio.c
index dcadbf2ad2b..4ba68544dc1 100644
--- a/sys/arch/macppc/dev/obio.c
+++ b/sys/arch/macppc/dev/obio.c
@@ -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 @@ obio_attach(device_t parent, device_t self, void *aux)
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 @@ uint8_t obio_read_1(int offset)
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 --git a/sys/arch/macppc/dev/obiovar.h b/sys/arch/macppc/dev/obiovar.h
index d766904614a..7bcb8f1d6bd 100644
--- a/sys/arch/macppc/dev/obiovar.h
+++ b/sys/arch/macppc/dev/obiovar.h
@@ -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_4(int, uint32_t);
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