Module Name:    src
Committed By:   matt
Date:           Wed Jan 20 20:48:12 UTC 2010

Modified Files:
        src/sys/arch/mips/conf [matt-nb5-mips64]: files.rmixl
        src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_com.c rmixl_cpu.c
            rmixl_cpucore.c rmixl_cpunode.c rmixl_obio.c

Log Message:
cleanup attachments so that other mips cpus can use the same scheme.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/sys/arch/mips/conf/files.rmixl
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/sys/arch/mips/rmi/rmixl_com.c
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/sys/arch/mips/rmi/rmixl_cpu.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/arch/mips/rmi/rmixl_cpucore.c \
    src/sys/arch/mips/rmi/rmixl_cpunode.c
cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/sys/arch/mips/rmi/rmixl_obio.c

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/mips/conf/files.rmixl
diff -u src/sys/arch/mips/conf/files.rmixl:1.1.2.8 src/sys/arch/mips/conf/files.rmixl:1.1.2.9
--- src/sys/arch/mips/conf/files.rmixl:1.1.2.8	Sat Jan 16 23:50:04 2010
+++ src/sys/arch/mips/conf/files.rmixl	Wed Jan 20 20:48:12 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rmixl,v 1.1.2.8 2010/01/16 23:50:04 cliff Exp $
+#	$NetBSD: files.rmixl,v 1.1.2.9 2010/01/20 20:48:12 matt Exp $
 #
 # Configuration info for RMI XLP, XLR, XLS
 #
@@ -9,34 +9,34 @@
 
 # node is parent of one or more core
 device	cpunode { [ core = -1] }
-attach	cpunode at mainbus
-file	arch/mips/rmi/rmixl_cpunode.c		cpunode
+attach	cpunode at mainbus with cpunode_rmixl
+file	arch/mips/rmi/rmixl_cpunode.c		cpunode_rmixl
 
 # core is parent of one or more cpu
 device	cpucore { [ thread = -1] }
-attach	cpucore at cpunode
-file	arch/mips/rmi/rmixl_cpucore.c		cpucore
+attach	cpucore at cpunode with cpucore_rmixl
+file	arch/mips/rmi/rmixl_cpucore.c		cpucore_rmixl
 
 # each cpu is a RMI 'thread' or 'vCPU'
 device	cpu
-attach	cpu at cpucore
-file	arch/mips/rmi/rmixl_cpu.c		cpu
+attach	cpu at cpucore with cpu_rmixl
+file	arch/mips/rmi/rmixl_cpu.c		cpu_rmixl
 
 # OBIO: offsets are from System Bridge Controller base
 define obio { [addr=-1], [size=0], [intr=-1], [mult=1] }
 device	obio: obio
-attach	obio at cpunode
-file	arch/mips/rmi/rmixl_obio.c		obio needs-count
-file    arch/mips/rmi/rmixl_obio_eb_space.c	obio
-file    arch/mips/rmi/rmixl_obio_el_space.c	obio
+attach	obio at cpunode with obio_rmixl
+file	arch/mips/rmi/rmixl_obio.c		obio_rmixl
+file    arch/mips/rmi/rmixl_obio_eb_space.c	obio_rmixl
+file    arch/mips/rmi/rmixl_obio_el_space.c	obio_rmixl
 file    arch/mips/rmi/rmixl_pcie_cfg_space.c	pci
 file    arch/mips/rmi/rmixl_pcie_ecfg_space.c	pci
 file    arch/mips/rmi/rmixl_pcie_io_space.c	pci
 file    arch/mips/rmi/rmixl_pcie_mem_space.c	pci
 
 # NS16550 compatible serial ports
-attach com at obio with rmixl_com
-file	arch/mips/rmi/rmixl_com.c		rmixl_com
+attach com at obio with com_rmixl
+file	arch/mips/rmi/rmixl_com.c		com_rmixl
 defparam opt_com.h				CONSADDR CONSFREQ CONSPEED CONMODE
 
 # PCI

Index: src/sys/arch/mips/rmi/rmixl_com.c
diff -u src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.9 src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.10
--- src/sys/arch/mips/rmi/rmixl_com.c:1.1.2.9	Mon Dec 14 07:18:55 2009
+++ src/sys/arch/mips/rmi/rmixl_com.c	Wed Jan 20 20:48:12 2010
@@ -1,4 +1,4 @@
-/* $Id: rmixl_com.c,v 1.1.2.9 2009/12/14 07:18:55 cliff Exp $ */
+/* $Id: rmixl_com.c,v 1.1.2.10 2010/01/20 20:48:12 matt Exp $ */
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
  * Copyright (c) 2006 Garrett D'Amore.
@@ -101,7 +101,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_com.c,v 1.1.2.9 2009/12/14 07:18:55 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_com.c,v 1.1.2.10 2010/01/20 20:48:12 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -133,14 +133,14 @@
 static int rmixl_com_match(device_t, cfdata_t , void *);
 static void rmixl_com_attach(device_t, device_t, void *);
 
-CFATTACH_DECL_NEW(rmixl_com, sizeof(struct rmixl_com_softc),
+CFATTACH_DECL_NEW(com_rmixl, sizeof(struct rmixl_com_softc),
     rmixl_com_match, rmixl_com_attach, NULL, NULL);
 
 #ifndef	COM_REGMAP
 #error	COM_REGMAP not defined!
 #endif
 
-volatile uint32_t *com0addr = (uint32_t *)
+volatile int32_t *com0addr = (int32_t *)
 	MIPS_PHYS_TO_KSEG1(RMIXL_IO_DEV_PBASE + RMIXL_IO_DEV_UART_1);
 
 extern int comcnfreq;

Index: src/sys/arch/mips/rmi/rmixl_cpu.c
diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.1 src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.2
--- src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.1	Sat Jan 16 23:47:30 2010
+++ src/sys/arch/mips/rmi/rmixl_cpu.c	Wed Jan 20 20:48:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpu.c,v 1.1.2.1 2010/01/16 23:47:30 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpu.c,v 1.1.2.2 2010/01/20 20:48:12 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,25 +38,29 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.1.2.1 2010/01/16 23:47:30 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_cpu.c,v 1.1.2.2 2010/01/20 20:48:12 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
 #include <sys/systm.h>
 #include <sys/cpu.h>
+#include <mips/rmi/rmixlvar.h>
 #include <mips/rmi/rmixl_cpucorevar.h>
 
-static int	cpu_match(device_t, cfdata_t, void *);
-static void	cpu_attach(device_t, device_t, void *);
+static int	cpu_rmixl_match(device_t, cfdata_t, void *);
+static void	cpu_rmixl_attach(device_t, device_t, void *);
 
-CFATTACH_DECL_NEW(cpu, 0, cpu_match, cpu_attach, NULL, NULL);
+CFATTACH_DECL_NEW(cpu_rmixl, 0, cpu_rmixl_match, cpu_rmixl_attach, NULL, NULL);
 
 static int
-cpu_match(device_t parent, cfdata_t cf, void *aux)
+cpu_rmixl_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct cpucore_attach_args *ca = aux;
 	int thread = cf->cf_loc[CPUCORECF_THREAD];
 
+	if (!cpu_rmixl(mips_options.mips_cpu))
+		return 0;
+
 	if (strncmp(ca->ca_name, cf->cf_name, strlen(cf->cf_name)) == 0
 #ifndef MULTIPROCESSOR
 	    && ca->ca_thread == 0
@@ -68,7 +72,7 @@
 }
 
 static void
-cpu_attach(device_t parent, device_t self, void *aux)
+cpu_rmixl_attach(device_t parent, device_t self, void *aux)
 {
 	struct cpucore_attach_args *ca = aux;
 	if (ca->ca_thread == 0 && ca->ca_core == 0) {

Index: src/sys/arch/mips/rmi/rmixl_cpucore.c
diff -u src/sys/arch/mips/rmi/rmixl_cpucore.c:1.1.2.2 src/sys/arch/mips/rmi/rmixl_cpucore.c:1.1.2.3
--- src/sys/arch/mips/rmi/rmixl_cpucore.c:1.1.2.2	Wed Jan 20 09:04:35 2010
+++ src/sys/arch/mips/rmi/rmixl_cpucore.c	Wed Jan 20 20:48:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpucore.c,v 1.1.2.2 2010/01/20 09:04:35 matt Exp $	*/
+/*	$NetBSD: rmixl_cpucore.c,v 1.1.2.3 2010/01/20 20:48:12 matt Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,28 +38,32 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_cpucore.c,v 1.1.2.2 2010/01/20 09:04:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_cpucore.c,v 1.1.2.3 2010/01/20 20:48:12 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
 #include <sys/systm.h>
 #include <sys/cpu.h>
+#include <mips/rmi/rmixlvar.h>
 #include <mips/rmi/rmixl_cpunodevar.h>
 #include <mips/rmi/rmixl_cpucorevar.h>
 
-static int	cpucore_match(device_t, cfdata_t, void *);
-static void	cpucore_attach(device_t, device_t, void *);
-static int	cpucore_print(void *, const char *);
+static int	cpucore_rmixl_match(device_t, cfdata_t, void *);
+static void	cpucore_rmixl_attach(device_t, device_t, void *);
+static int	cpucore_rmixl_print(void *, const char *);
 
-CFATTACH_DECL_NEW(cpucore, sizeof(struct cpucore_softc),
-	cpucore_match, cpucore_attach, NULL, NULL);
+CFATTACH_DECL_NEW(cpucore_rmixl, sizeof(struct cpucore_softc),
+	cpucore_rmixl_match, cpucore_rmixl_attach, NULL, NULL);
 
 static int
-cpucore_match(device_t parent, cfdata_t cf, void *aux)
+cpucore_rmixl_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct cpunode_attach_args *na = aux;
 	int core = cf->cf_loc[CPUNODECF_CORE];
 
+	if (!cpu_rmixl(mips_options.mips_cpu))
+		return 0;
+
 	if (strncmp(na->na_name, cf->cf_name, strlen(cf->cf_name)) == 0
 #ifndef MULTIPROCESSOR
 	    && na->na_core == 0
@@ -71,7 +75,7 @@
 }
 
 static void
-cpucore_attach(device_t parent, device_t self, void *aux)
+cpucore_rmixl_attach(device_t parent, device_t self, void *aux)
 {
 	struct cpucore_softc * const sc = device_private(self);
 	struct cpunode_attach_args *na = aux;
@@ -102,12 +106,12 @@
 		ca.ca_name = "cpu";
 		ca.ca_thread = i;
 		ca.ca_core = sc->sc_core;
-		config_found(self, &ca, cpucore_print);
+		config_found(self, &ca, cpucore_rmixl_print);
 	}
 }
 
 static int
-cpucore_print(void *aux, const char *pnp)
+cpucore_rmixl_print(void *aux, const char *pnp)
 {
 	struct cpucore_attach_args *ca = aux;
 
Index: src/sys/arch/mips/rmi/rmixl_cpunode.c
diff -u src/sys/arch/mips/rmi/rmixl_cpunode.c:1.1.2.2 src/sys/arch/mips/rmi/rmixl_cpunode.c:1.1.2.3
--- src/sys/arch/mips/rmi/rmixl_cpunode.c:1.1.2.2	Wed Jan 20 09:04:35 2010
+++ src/sys/arch/mips/rmi/rmixl_cpunode.c	Wed Jan 20 20:48:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpunode.c,v 1.1.2.2 2010/01/20 09:04:35 matt Exp $	*/
+/*	$NetBSD: rmixl_cpunode.c,v 1.1.2.3 2010/01/20 20:48:12 matt Exp $	*/
 
 /*
  * Copyright (c) 1994,1995 Mark Brinicombe.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_cpunode.c,v 1.1.2.2 2010/01/20 09:04:35 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_cpunode.c,v 1.1.2.3 2010/01/20 20:48:12 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -52,22 +52,28 @@
 #include <sys/device.h>
 
 #include <evbmips/rmixl/autoconf.h>
+
+#include <mips/rmi/rmixlvar.h>
 #include <mips/rmi/rmixl_cpunodevar.h>
+
 #include <machine/bus.h>
 #include "locators.h"
 
-static int  cpunode_match(device_t,  cfdata_t, void *);
-static void cpunode_attach(device_t,  device_t,  void *);
-static int  cpunode_print_core(void *, const char *);
+static int  cpunode_rmixl_match(device_t, cfdata_t, void *);
+static void cpunode_rmixl_attach(device_t, device_t, void *);
+static int  cpunode_rmixl_print(void *, const char *);
 
-CFATTACH_DECL_NEW(cpunode, sizeof(struct cpunode_softc),
-	cpunode_match, cpunode_attach, NULL, NULL);
+CFATTACH_DECL_NEW(cpunode_rmixl, sizeof(struct cpunode_softc),
+	cpunode_rmixl_match, cpunode_rmixl_attach, NULL, NULL);
 
 static int
-cpunode_match(device_t parent, cfdata_t cf, void *aux)
+cpunode_rmixl_match(device_t parent, cfdata_t cf, void *aux)
 {
 	struct mainbus_attach_args *ma = aux;
 
+	if (!cpu_rmixl(mips_options.mips_cpu))
+		return 0;
+
 	/* XXX for now attach one node only */
 	if (ma->ma_node != 0)
 		return 0;
@@ -76,7 +82,7 @@
 }
 
 static void
-cpunode_attach(device_t parent, device_t self, void *aux)
+cpunode_rmixl_attach(device_t parent, device_t self, void *aux)
 {
 	u_int sz;
 	u_int ncores;
@@ -119,7 +125,7 @@
 		na.na_name = "cpucore";
 		na.na_node = ma->ma_node;
 		na.na_core = i;
-		config_found(self, &na, cpunode_print_core);
+		config_found(self, &na, cpunode_rmixl_print);
 	}
 
 	/*
@@ -130,7 +136,7 @@
 }
 
 static int
-cpunode_print_core(void *aux, const char *pnp)
+cpunode_rmixl_print(void *aux, const char *pnp)
 {
 	struct cpunode_attach_args *na = aux;
 

Index: src/sys/arch/mips/rmi/rmixl_obio.c
diff -u src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.11 src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.12
--- src/sys/arch/mips/rmi/rmixl_obio.c:1.1.2.11	Wed Jan 13 09:43:31 2010
+++ src/sys/arch/mips/rmi/rmixl_obio.c	Wed Jan 20 20:48:12 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_obio.c,v 1.1.2.11 2010/01/13 09:43:31 cliff Exp $	*/
+/*	$NetBSD: rmixl_obio.c,v 1.1.2.12 2010/01/20 20:48:12 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rmixl_obio.c,v 1.1.2.11 2010/01/13 09:43:31 cliff Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rmixl_obio.c,v 1.1.2.12 2010/01/20 20:48:12 matt Exp $");
 
 #include "locators.h"
 #include "obio.h"
@@ -65,8 +65,8 @@
 #include <evbmips/rmixl/autoconf.h>
 
 #ifdef OBIO_DEBUG
-int obio_debug = OBIO_DEBUG;
-# define DPRINTF(x)	do { if (obio_debug) printf x ; } while (0)
+int obio_rmixl_debug = OBIO_DEBUG;
+# define DPRINTF(x)	do { if (obio_rmixl_debug) printf x ; } while (0)
 #else
 # define DPRINTF(x)
 #endif
@@ -80,7 +80,7 @@
 static int  rmixl_addr_error_intr(void *);
 
 
-CFATTACH_DECL_NEW(obio, sizeof(struct obio_softc),
+CFATTACH_DECL_NEW(obio_rmixl, sizeof(struct obio_softc),
     obio_match, obio_attach, NULL, NULL);
 
 int obio_found;

Reply via email to