Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/vax/uba Add code to probe the Q-bus/Unibus for memo...
details: https://anonhg.NetBSD.org/src/rev/8bede88829e8
branches: trunk
changeset: 339210:8bede88829e8
user: matt <matt%NetBSD.org@localhost>
date: Sun Jul 05 03:03:00 2015 +0000
description:
Add code to probe the Q-bus/Unibus for memory. (From Charles Dickman)
diffstat:
sys/arch/vax/uba/uba_mainbus.c | 45 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 43 insertions(+), 2 deletions(-)
diffs (80 lines):
diff -r 79bfd232d6f6 -r 8bede88829e8 sys/arch/vax/uba/uba_mainbus.c
--- a/sys/arch/vax/uba/uba_mainbus.c Sun Jul 05 02:10:53 2015 +0000
+++ b/sys/arch/vax/uba/uba_mainbus.c Sun Jul 05 03:03:00 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uba_mainbus.c,v 1.10 2010/12/14 23:38:30 matt Exp $ */
+/* $NetBSD: uba_mainbus.c,v 1.11 2015/07/05 03:03:00 matt Exp $ */
/*
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uba_mainbus.c,v 1.10 2010/12/14 23:38:30 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uba_mainbus.c,v 1.11 2015/07/05 03:03:00 matt Exp $");
#define _VAX_BUS_DMA_PRIVATE
@@ -91,6 +91,7 @@
/* Some Qbus-specific defines */
#define QBASIZE (8192 * VAX_NBPG)
#define QBAMAP 0x20088000
+#define QBAMEM 0x30000000
#define QIOPAGE 0x20000000
/*
@@ -121,6 +122,12 @@
{
struct mainbus_attach_args * const ma = aux;
struct uba_vsoftc * const sc = device_private(self);
+ paddr_t paddr;
+ vaddr_t vaddr;
+ int *mapp;
+ int pgnum;
+ //int val;
+ int start;
aprint_normal(": Q22\n");
@@ -140,6 +147,40 @@
sc->uv_addr = QBAMAP; /* Physical address of map registers */
uba_dma_init(sc);
+
+ mapp = (int *)vax_map_physmem(QBAMAP, QBASIZE/VAX_NBPG);
+ //val = 0;
+
+ for (paddr = QBAMEM, pgnum = 0, start = -1;
+ paddr < QBAMEM + QBASIZE - 8192;
+ paddr += VAX_NBPG, pgnum += 1) {
+ //val = mapp[pgnum];
+ mapp[pgnum] = 0;
+ vaddr = vax_map_physmem(paddr, 1);
+ if (badaddr((void *)vaddr, 2) == 0) {
+ if (start < 0)
+ start = pgnum;
+ } else if (start >= 0) {
+ aprint_normal("sgmap exclusion at %#x - %#x\n",
+ start*VAX_NBPG, pgnum*VAX_NBPG - 1);
+ vax_sgmap_resserve(start*VAX_NBPG,
+ (pgnum - start)*VAX_NBPG, &sc->uv_sgmap);
+ start = -1;
+ }
+ vax_unmap_physmem(vaddr, 1);
+ //mapp[pgnum] = val;
+ }
+ vax_unmap_physmem((vaddr_t)mapp, QBASIZE/VAX_NBPG);
+ if (start >= 0) {
+ aprint_normal("sgmap exclusion at %#x - %#x\n",
+ start*VAX_NBPG, pgnum*VAX_NBPG - 1);
+ vax_sgmap_reserve(start*VAX_NBPG, (pgnum - start)*VAX_NBPG,
+ &sc->uv_sgmap);
+ }
+
+ /* reserve I/O space within Qbus */
+ vax_sgmap_reserve(0x3fe000, 0x400000 - 0x3fe000, &sc->uv_sgmap);
+
uba_attach(&sc->uv_sc, QIOPAGE);
}
Home |
Main Index |
Thread Index |
Old Index