Module Name: src
Committed By: macallan
Date: Fri May 4 17:17:48 UTC 2018
Modified Files:
src/sys/arch/macppc/dev: obio.c obiovar.h
Log Message:
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
To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/macppc/dev/obio.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/macppc/dev/obiovar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/macppc/dev/obio.c
diff -u src/sys/arch/macppc/dev/obio.c:1.44 src/sys/arch/macppc/dev/obio.c:1.45
--- src/sys/arch/macppc/dev/obio.c:1.44 Thu Mar 29 06:28:12 2018
+++ src/sys/arch/macppc/dev/obio.c Fri May 4 17:17:48 2018
@@ -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 se
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
Index: src/sys/arch/macppc/dev/obiovar.h
diff -u src/sys/arch/macppc/dev/obiovar.h:1.2 src/sys/arch/macppc/dev/obiovar.h:1.3
--- src/sys/arch/macppc/dev/obiovar.h:1.2 Fri Sep 26 03:40:26 2008
+++ src/sys/arch/macppc/dev/obiovar.h Fri May 4 17:17:48 2018
@@ -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