Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/hpcmips Bivideo utilize platid mechanisum for probing.
details: https://anonhg.NetBSD.org/src/rev/fb9ab4edfd37
branches: trunk
changeset: 483539:fb9ab4edfd37
user: takemura <takemura%NetBSD.org@localhost>
date: Sun Mar 12 11:46:44 2000 +0000
description:
Bivideo utilize platid mechanisum for probing.
diffstat:
sys/arch/hpcmips/dev/bivideo.c | 13 +++++++++++--
sys/arch/hpcmips/hpcmips/mainbus.c | 21 +++++++++++----------
2 files changed, 22 insertions(+), 12 deletions(-)
diffs (90 lines):
diff -r 8ea4ec84ac41 -r fb9ab4edfd37 sys/arch/hpcmips/dev/bivideo.c
--- a/sys/arch/hpcmips/dev/bivideo.c Sun Mar 12 11:31:53 2000 +0000
+++ b/sys/arch/hpcmips/dev/bivideo.c Sun Mar 12 11:46:44 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bivideo.c,v 1.1 2000/03/12 05:04:45 takemura Exp $ */
+/* $NetBSD: bivideo.c,v 1.2 2000/03/12 11:46:44 takemura Exp $ */
/*-
* Copyright (c) 1999
@@ -37,7 +37,7 @@
static const char _copyright[] __attribute__ ((unused)) =
"Copyright (c) 1999 Shin Takemura. All rights reserved.";
static const char _rcsid[] __attribute__ ((unused)) =
- "$Id: bivideo.c,v 1.1 2000/03/12 05:04:45 takemura Exp $";
+ "$Id: bivideo.c,v 1.2 2000/03/12 11:46:44 takemura Exp $";
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,6 +53,8 @@
#include <machine/bus.h>
#include <machine/autoconf.h>
#include <machine/bootinfo.h>
+#include <machine/platid.h>
+#include <machine/platid_mask.h>
#include <arch/hpcmips/dev/hpcfbvar.h>
#include <arch/hpcmips/dev/hpcfbio.h>
@@ -100,6 +102,13 @@
if (strcmp(ma->ma_name, match->cf_driver->cd_name))
return 0;
+ /*
+ * Platforms which have TX CPU don't need this device.
+ */
+ if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX) == 0) {
+ return 0;
+ }
+
return (1);
}
diff -r 8ea4ec84ac41 -r fb9ab4edfd37 sys/arch/hpcmips/hpcmips/mainbus.c
--- a/sys/arch/hpcmips/hpcmips/mainbus.c Sun Mar 12 11:31:53 2000 +0000
+++ b/sys/arch/hpcmips/hpcmips/mainbus.c Sun Mar 12 11:46:44 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mainbus.c,v 1.3 2000/03/12 05:04:47 takemura Exp $ */
+/* $NetBSD: mainbus.c,v 1.4 2000/03/12 11:46:45 takemura Exp $ */
/*-
* Copyright (c) 1999
@@ -101,8 +101,12 @@
struct device *self;
void *aux;
{
+ int i;
register struct device *mb = self;
struct mainbus_attach_args ma;
+ char *devnames[] = {
+ "txsim", "bivideo", "vrip",
+ };
printf("\n");
@@ -113,20 +117,17 @@
#if defined VR41X1 && defined TX39XX
#error misconfiguration
#elif defined VR41X1
- /* Attach frame buffer */
- ma.ma_name = "bivideo";
- config_found(mb, &ma, mbprint);
-
- /* Attach Vr41x1 integrated peripherals (if configured). */
- ma.ma_name = "vrip";
if (!system_bus_iot)
mb_bus_space_init();
hpcmips_init_bus_space_extent(system_bus_iot); /* Now prepare extent */
ma.ma_iot = system_bus_iot;
-#elif defined TX39XX
- ma.ma_name = "txsim";
#endif
- config_found(mb, &ma, mbprint);
+
+ /* Attach devices */
+ for (i = 0; i < sizeof(devnames)/sizeof(*devnames); i++) {
+ ma.ma_name = devnames[i];
+ config_found(mb, &ma, mbprint);
+ }
}
Home |
Main Index |
Thread Index |
Old Index