Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/mvme68k Nuke __BROKEN_DK_ESTABLISH, and add __HAVE_...
details: https://anonhg.NetBSD.org/src/rev/54d7cb110cf2
branches: trunk
changeset: 495290:54d7cb110cf2
user: scw <scw%NetBSD.org@localhost>
date: Tue Jul 25 20:52:27 2000 +0000
description:
Nuke __BROKEN_DK_ESTABLISH, and add __HAVE_DEVICE_REGISTER.
diffstat:
sys/arch/mvme68k/dev/if_ie.c | 6 +-
sys/arch/mvme68k/dev/if_le.c | 6 +-
sys/arch/mvme68k/dev/ncrsc_pcctwo.c | 14 +---
sys/arch/mvme68k/dev/pcctworeg.h | 6 +-
sys/arch/mvme68k/dev/wdsc.c | 10 +--
sys/arch/mvme68k/include/types.h | 4 +-
sys/arch/mvme68k/mvme68k/autoconf.c | 119 +++++++++++++++++++++++++++++++++++-
sys/arch/mvme68k/mvme68k/disksubr.c | 40 +-----------
8 files changed, 127 insertions(+), 78 deletions(-)
diffs (truncated from 338 to 300 lines):
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/dev/if_ie.c
--- a/sys/arch/mvme68k/dev/if_ie.c Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/dev/if_ie.c Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ie.c,v 1.5 2000/06/29 08:04:03 mrg Exp $ */
+/* $NetBSD: if_ie.c,v 1.6 2000/07/25 20:52:27 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -338,10 +338,6 @@
/* Attach the MI back-end */
i82586_attach(sc, "onboard", ethaddr, NULL, 0, 0);
- /* Are we the boot device? */
- if (PCCTWO_PADDR(pa->pa_offset) == bootaddr)
- booted_device = self;
-
/* Finally, hook the hardware interrupt */
pcc2_reg_write(sys_pcctwo, PCC2REG_ETH_ICSR, 0);
pcctwointr_establish(PCCTWOV_LANC_IRQ, i82586_intr, pa->pa_ipl, sc);
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/dev/if_le.c
--- a/sys/arch/mvme68k/dev/if_le.c Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/dev/if_le.c Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_le.c,v 1.21 2000/03/18 22:33:03 scw Exp $ */
+/* $NetBSD: if_le.c,v 1.22 2000/07/25 20:52:27 scw Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -224,10 +224,6 @@
am7990_config(&lsc->sc_am7990);
- /* Are we the boot device? */
- if (PCC_PADDR(pa->pa_offset) == bootaddr)
- booted_device = self;
-
pccintr_establish(PCCV_LE, am7990_intr, pa->pa_ipl, sc);
pcc_reg_write(sys_pcc, PCCREG_LANCE_INTR_CTRL,
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/dev/ncrsc_pcctwo.c
--- a/sys/arch/mvme68k/dev/ncrsc_pcctwo.c Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/dev/ncrsc_pcctwo.c Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ncrsc_pcctwo.c,v 1.4 2000/03/18 22:33:03 scw Exp $ */
+/* $NetBSD: ncrsc_pcctwo.c,v 1.5 2000/07/25 20:52:28 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -122,7 +122,6 @@
struct siop_softc *sc;
bus_space_handle_t bush;
int clk, ctest7;
- int tmp;
pa = (struct pcctwo_attach_args *) args;
sc = (struct siop_softc *) self;
@@ -174,18 +173,7 @@
pcc2_reg_write(sys_pcctwo, PCC2REG_SCSI_ICSR,
pa->pa_ipl | PCCTWO_ICR_IEN);
- /*
- * Attach all scsi units on us, watching for boot device
- * (see dk_establish).
- */
- tmp = bootpart;
-
- if (PCCTWO_PADDR(pa->pa_offset) != bootaddr)
- bootpart = -1; /* Invalid flag to dk_establish */
-
(void) config_found(self, &sc->sc_link, scsiprint);
-
- bootpart = tmp; /* Restore old value */
}
static int
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/dev/pcctworeg.h
--- a/sys/arch/mvme68k/dev/pcctworeg.h Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/dev/pcctworeg.h Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pcctworeg.h,v 1.4 2000/03/18 22:33:03 scw Exp $ */
+/* $NetBSD: pcctworeg.h,v 1.5 2000/07/25 20:52:28 scw Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -45,6 +45,8 @@
/*
* Offsets to the various devices which hang off the PCCChip2.
+ * Note that these are offsets from the base of the PCCChip2's
+ * own registers.
*/
#define PCCTWO_REG_OFF 0x00000 /* Offset of PCCChip2's own registers */
#define PCCTWO_LPT_OFF 0x00000 /* Offset of parallel port registers */
@@ -60,7 +62,7 @@
* (The physical address of the boot device's registers are passed in
* from the Boot ROM)
*/
-#define PCCTWO_PADDR(off) ((void *)(0xfff40000u + (off)))
+#define PCCTWO_PADDR(off) ((void *)(0xfff42000u + (off)))
/*
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/dev/wdsc.c
--- a/sys/arch/mvme68k/dev/wdsc.c Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/dev/wdsc.c Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wdsc.c,v 1.17 2000/03/18 22:33:05 scw Exp $ */
+/* $NetBSD: wdsc.c,v 1.18 2000/07/25 20:52:29 scw Exp $ */
/*
* Copyright (c) 1996 Steve Woodford
@@ -173,15 +173,7 @@
pcc_reg_write(sys_pcc, PCCREG_SCSI_INTR_CTRL,
sc->sc_ipl | PCC_IENABLE | PCC_ICLEAR);
- /*
- * Attach all scsi units on us, watching for boot device
- * (see dk_establish).
- */
- tmp = bootpart;
- if (PCC_PADDR(pa->pa_offset) != bootaddr)
- bootpart = -1; /* invalid flag to dk_establish */
(void)config_found(dp, &sc->sc_link, scsiprint);
- bootpart = tmp; /* restore old value */
}
/*
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/include/types.h
--- a/sys/arch/mvme68k/include/types.h Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/include/types.h Tue Jul 25 20:52:27 2000 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: types.h,v 1.6 2000/07/23 20:51:18 scw Exp $ */
+/* $NetBSD: types.h,v 1.7 2000/07/25 20:52:30 scw Exp $ */
#ifndef _MACHINE_TYPES_H_
#define _MACHINE_TYPES_H_
#include <m68k/types.h>
-#define __BROKEN_DK_ESTABLISH
+#define __HAVE_DEVICE_REGISTER
#endif
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/mvme68k/autoconf.c
--- a/sys/arch/mvme68k/mvme68k/autoconf.c Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/mvme68k/autoconf.c Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.25 2000/07/20 20:40:39 scw Exp $ */
+/* $NetBSD: autoconf.c,v 1.26 2000/07/25 20:52:30 scw Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -63,6 +63,17 @@
#include <machine/autoconf.h>
#include <machine/pte.h>
+#include <dev/scsipi/scsi_all.h>
+#include <dev/scsipi/scsipi_all.h>
+#include <dev/scsipi/scsiconf.h>
+
+#ifdef MVME147
+#include <mvme68k/dev/pccreg.h>
+#endif
+#if defined(MVME167) || defined(MVME177)
+#include <mvme68k/dev/pcctworeg.h>
+#endif
+
struct device *booted_device; /* boot device */
@@ -85,8 +96,110 @@
cpu_rootconf()
{
- printf("boot device: %s\n",
+ printf("boot device: %s",
(booted_device) ? booted_device->dv_xname : "<unknown>");
- setroot(booted_device, 0);
+ if (bootpart)
+ printf(" (partition %d)\n", bootpart);
+ else
+ printf("\n");
+
+ setroot(booted_device, bootpart);
}
+
+void
+device_register(dev, aux)
+ struct device *dev;
+ void *aux;
+{
+ static struct device *controller;
+ static int foundboot;
+ struct device *parent;
+ struct cfdriver *cd;
+
+ if (foundboot)
+ return;
+
+ parent = dev->dv_parent;
+ cd = dev->dv_cfdata->cf_driver;
+
+ if (controller == NULL && parent) {
+ struct cfdriver *pcd = parent->dv_cfdata->cf_driver;
+
+ switch (machineid) {
+#ifdef MVME147
+ case MVME_147:
+ /*
+ * We currently only support booting from the 147's
+ * onboard scsi and ethernet. So ensure this
+ * device's parent is the PCC driver.
+ */
+ if (strcmp(pcd->cd_name, "pcc"))
+ return;
+
+ if (bootaddr == PCC_PADDR(PCC_WDSC_OFF) &&
+ strcmp(cd->cd_name, "wdsc") == 0) {
+ controller = dev;
+ return;
+ }
+
+ if (bootaddr == PCC_PADDR(PCC_LE_OFF) &&
+ strcmp(cd->cd_name, "le") == 0) {
+ booted_device = dev;
+ foundboot = 1;
+ return;
+ }
+
+ break;
+#endif /* MVME_147 */
+
+#if defined(MVME167) || defined(MVME177)
+ case MVME_167:
+ case MVME_177:
+ /*
+ * We currently only support booting from the 167's
+ * onboard scsi and ethernet. So ensure this
+ * device's parent is the PCCTWO driver.
+ */
+ if (strcmp(pcd->cd_name, "pcctwo"))
+ return;
+
+ if (bootaddr == PCCTWO_PADDR(PCCTWO_NCRSC_OFF) &&
+ strcmp(cd->cd_name, "ncrsc") == 0) {
+ controller = dev;
+ return;
+ }
+
+ if (bootaddr == PCCTWO_PADDR(PCCTWO_IE_OFF) &&
+ strcmp(cd->cd_name, "ie") == 0) {
+ booted_device = dev;
+ foundboot = 1;
+ return;
+ }
+
+ break;
+#endif /* MVME_167 || MVME_177 */
+
+ default:
+ break;
+ }
+
+ return;
+ }
+
+ /*
+ * Find out which device on the scsibus we booted from
+ */
+ if (strcmp(cd->cd_name, "sd") == 0 ||
+ strcmp(cd->cd_name, "cd") == 0 ||
+ strcmp(cd->cd_name, "st") == 0) {
+ struct scsipibus_attach_args *sa = aux;
+
+ if (parent->dv_parent != controller ||
+ bootdevlun != sa->sa_sc_link->scsipi_scsi.target)
+ return;
+
+ booted_device = dev;
+ foundboot = 1;
+ }
+}
diff -r 892d27fe9010 -r 54d7cb110cf2 sys/arch/mvme68k/mvme68k/disksubr.c
--- a/sys/arch/mvme68k/mvme68k/disksubr.c Tue Jul 25 20:48:19 2000 +0000
+++ b/sys/arch/mvme68k/mvme68k/disksubr.c Tue Jul 25 20:52:27 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.18 2000/03/18 22:33:06 scw Exp $ */
+/* $NetBSD: disksubr.c,v 1.19 2000/07/25 20:52:31 scw Exp $ */
/*
* Copyright (c) 1995 Dale Rahn.
@@ -58,44 +58,6 @@
static void printclp __P((struct cpu_disklabel *clp, char *str));
#endif
-void
-dk_establish(dk, dev)
- struct disk *dk;
Home |
Main Index |
Thread Index |
Old Index