From 5fa6380fdaba558f76c2faef0ca8eb8b63181cfc Mon Sep 17 00:00:00 2001 From: macallan Date: Fri, 4 May 2018 17:17:48 +0000 Subject: 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 --- sys/arch/macppc/dev/obio.c | 15 ++++++++++++--- sys/arch/macppc/dev/obiovar.h | 3 ++- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'sys/arch/macppc/dev') 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 -__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 #include @@ -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 -__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 -- cgit