Subject: Re: Changing ibm4xx device tree.
To: Simon Burge <simonb@wasabisystems.com>
From: Shigeyuki Fukushima <shige@netbsd.org>
List: port-powerpc
Date: 05/06/2006 02:15:39
This is a multi-part message in MIME format.
--------------050905060808040203050003
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Simon Burge wrote:
>> [ what hangs of what discussion ]
> Pretty much agree with all you say here.

If it is reasonable that plb is a root device,
how about a patch attached with this mail?
  - source diff
  - powerpc/include/ibm4xx/ibm405gpr.h
  - powerpc/ibm4xx/ibm405gpr.c
  - powerpc/ibm4xx/ibm4xx.h


Anyway, I want to do something better about the following matters:

1. flexible configure about cpu(machine)-dependent devices.
2. don't want to insert per-cpu include-file declarations
   in ibm4xx/dev/plb.c and ibm4xx/dev/opb.c, and so on.

   Is it practical that there are many #include directives
   for all supported cpu in plb.c, opb.c, and so on.
   Such as:

   #include <powerpc/ibm4xx/ibm405gp.h>
   #include <powerpc/ibm4xx/ibm405gpr.h>
   #include <powerpc/ibm4xx/ibm405cr.h>
   #include <powerpc/ibm4xx/ibm405ep.h>
   #include <powerpc/ibm4xx/ibm440gp.h>
   #include <powerpc/ibm4xx/ibm440gx.h>
   #include <powerpc/ibm4xx/ibm440gr.h>
      :

-- 
Kind Regards,
--- shige
Shigeyuki Fukushima <shige@{FreeBSD,jp.FreeBSD,NetBSD}.org>

--------------050905060808040203050003
Content-Type: text/plain;
 name="ibm405gpr.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ibm405gpr.c"

/* $NetBSD$ */

/*
 * Copyright (c) 2006 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed
 * to The NetBSD Foundation, Inc.
 * by Shigeyuki Fukushima.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by the NetBSD
 *      Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD$");

#include <sys/param.h>

#include <machine/cpu.h>

#include <powerpc/ibm4xx/ibm405gpr.h>
#include <powerpc/ibm4xx/ibm4xx.h>
#include <powerpc/ibm4xx/dev/plbvar.h>
#include <powerpc/ibm4xx/dev/opbvar.h>

struct opb_dev ibm405gpr_opb_devices[] = {
	{ "com",     0, UART0_BASE, {  0, -1, -1, -1, -1, -1, -1, -1 }, NULL },
	{ "com",     1, UART1_BASE, {  1, -1, -1, -1, -1, -1, -1, -1 }, NULL },
	{ "emac",    0, EMAC0_BASE, {  9, 10, 11, 12, 13, 14, 15, -1 }, NULL },
	{ "opbgpio", 0, GPIO0_BASE, { -1, -1, -1, -1, -1, -1, -1, -1 }, NULL },
	{ "gpiic",   0, IIC0_BASE,  {  2, -1, -1, -1, -1, -1, -1, -1 }, NULL },
	{ "wdog",    0, -1,         { -1, -1, -1, -1, -1, -1, -1, -1 }, NULL },
	{ NULL }
};

struct opb_bus_space ibm405gpr_opb_bus_space = {
	UART0_BASE,
	UART0_BASE + 0xffff,
};

struct plb_dev ibm405gpr_plb_devices[] = {
	{ "cpu",   0,  -1, NULL },
	{ "ecc",   0,  16, NULL },
	{ "opb",   0,  -1, &ibm405gpr_opb_devices },
	{ "pchb",  0,  -1, NULL },
	{ NULL }
};

struct ibm4xx_cpudev ibm405gpr_cpu = {
	"IBM PPC405GPr",
	PVR_405GPR,
	&ibm405gpr_plb_devices,
};

struct opb_bus_space *
opb_get_bus_space_cpu(void)
{

	return &ibm405gpr_opb_bus_space;
}

--------------050905060808040203050003
Content-Type: text/plain;
 name="ibm4xx.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ibm4xx.h"

/* $NetBSD$ */

/*
 * Copyright (c) 2006 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed
 * to The NetBSD Foundation, Inc.
 * by Shigeyuki Fukushima.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by the NetBSD
 *      Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _POWERPC_IBM4XX_IBM4XX_H_
#define _POWERPC_IBM4XX_IBM4XX_H_

struct ibm4xx_cpudev {
	const char		*name;		/* CPU name */
	int 			pvr;		/* Processor Version Number */
	void			*arg;		/* root devices args */
};

#endif	/* _POWERPC_IBM4XX_IBM4XX_H_ */

--------------050905060808040203050003
Content-Type: text/plain;
 name="ibm405gpr.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ibm405gpr.h"

/* $NetBSD$ */

/*
 * Copyright 2001 Wasabi Systems, Inc.
 * All rights reserved.
 *
 * Written by Simon Burge and Eduardo Horvath for Wasabi Systems, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed for the NetBSD Project by
 *      Wasabi Systems, Inc.
 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
 *    or promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _POWERPC_IBM4XX_IBM405GP_H_
#define _POWERPC_IBM4XX_IBM405GP_H_

#ifdef _KERNEL

/*
 * Memory and PCI addresses
 */



/*
 * On-chip Peripheral Device Addresses
 */

#define	UART0_BASE		0xef600300
#define	UART1_BASE		0xef600400
#define	IIC0_BASE		0xef600500
#define	OPBA0_BASE		0xef600600
#define	GPIO0_BASE		0xef600700
#define	EMAC0_BASE		0xef600800


#ifndef _LOCORE

#include <powerpc/ibm4xx/ibm4xx.h>
extern struct ibm4xx_cpudev ibm405gpr_cpu;

#endif	/* !_LOCORE */

#endif	/* _KERNEL */

#endif	/* !_POWERPC_IBM4XX_IBM405GP_H_ */

--------------050905060808040203050003
Content-Type: text/plain;
 name="diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="diff"

? powerpc/ibm4xx/ibm405gpr.c
? powerpc/ibm4xx/ibm4xx.h
? powerpc/include/ibm4xx/ibm405gpr.h
Index: powerpc/ibm4xx/dev/opb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/dev/opb.c,v
retrieving revision 1.23
diff -u -r1.23 opb.c
--- powerpc/ibm4xx/dev/opb.c	13 Mar 2006 15:31:11 -0000	1.23
+++ powerpc/ibm4xx/dev/opb.c	5 May 2006 17:00:27 -0000
@@ -78,45 +78,7 @@
 #include <powerpc/spr.h>
 #include <powerpc/ibm4xx/dev/opbvar.h>
 #include <powerpc/ibm4xx/dev/plbvar.h>
-#include <powerpc/ibm4xx/ibm405gp.h>
 
-/*
- * The devices on the On-chip Peripheral Bus to the 405GP CPU.
- */
-const struct opb_dev {
-	int pvr;
-	const char *name;
-	bus_addr_t addr;
-	int instance;
-	int irq;
-} opb_devs [] = {
-	/* IBM405GP */
-	{ IBM405GP,	"com",	IBM405GP_UART0_BASE,	 0, 0 },
-	{ IBM405GP,	"com",	IBM405GP_UART1_BASE,	 1, 1 },
-	{ IBM405GP,	"emac",	IBM405GP_EMAC0_BASE,	 0, 9 }, /* XXX: really irq 9..15 */
-	{ IBM405GP,	"opbgpio",	IBM405GP_GPIO0_BASE,	0, -1 },
-	{ IBM405GP,	"gpiic",IBM405GP_IIC0_BASE,	0,  2 },
-	{ IBM405GP,	"wdog",	-1,	        	0, -1 },
-
-	/* IBM405GPR */
-	{ IBM405GPR,	"com",	IBM405GP_UART0_BASE,	 0, 0 },
-	{ IBM405GPR,	"com",	IBM405GP_UART1_BASE,	 1, 1 },
-	{ IBM405GPR,	"emac",	IBM405GP_EMAC0_BASE,	 0, 9 }, /* XXX: really irq 9..15 */
-	{ IBM405GPR,	"opbgpio",	IBM405GP_GPIO0_BASE,	0, -1 },
-	{ IBM405GPR,	"gpiic",IBM405GP_IIC0_BASE,	0, 2 },
-	{ IBM405GPR,	"wdog",	-1,	        	0, -1 },
-	{ 0,		 NULL }
-};
-
-const struct opb_limit {
-	int pvr;
-	bus_addr_t base;
-	bus_addr_t limit;
-} opb_limits[] = {
-	{ IBM405GP,	IBM405GP_UART0_BASE,	IBM405GP_UART0_BASE + 0xfff },
-	{ IBM405GPR,	IBM405GP_UART0_BASE,	IBM405GP_UART0_BASE + 0xfff },
-	{ 0,		0,			0 }
-};
 
 static int	opb_match(struct device *, struct cfdata *, void *);
 static void	opb_attach(struct device *, struct device *, void *);
@@ -128,8 +90,7 @@
     opb_match, opb_attach, NULL, NULL);
 
 static struct powerpc_bus_space opb_tag = {
-	_BUS_SPACE_BIG_ENDIAN|_BUS_SPACE_MEM_TYPE,
-	0x0, IBM405GP_UART0_BASE, 0x1000
+	_BUS_SPACE_BIG_ENDIAN|_BUS_SPACE_MEM_TYPE, 0x0
 };
 static char ex_storage[EXTENT_FIXED_STORAGE_SIZE(8)]
     __attribute__((aligned(8)));
@@ -170,27 +131,27 @@
 opb_attach(struct device *parent, struct device *self, void *aux)
 {
 	struct plb_attach_args *paa = aux;
+	struct opb_dev *opb_devs = (struct opb_dev *)(paa->arg);
 	struct opb_attach_args oaa;
 	bus_space_tag_t tag;
-	int i, pvr;
 
 	printf("\n");
-	pvr = mfpvr() >> 16;
 
 	tag = opb_get_bus_space_tag();
 
-	for (i = 0; opb_devs[i].name != NULL; i++) {
-		if (opb_devs[i].pvr != pvr)
-			continue;
-		oaa.opb_name = opb_devs[i].name;
-		oaa.opb_addr = opb_devs[i].addr;
-		oaa.opb_instance = opb_devs[i].instance;
-		oaa.opb_irq = opb_devs[i].irq;
+	while (opb_devs && opb_devs->name != NULL) {
+		oaa.opb_name = opb_devs->name;
+		oaa.opb_addr = opb_devs->addr;
+		oaa.opb_instance = opb_devs->instance;
+		oaa.opb_irq = opb_devs->irq[0];
+		oaa.opb_arg = opb_devs->arg;
 		oaa.opb_bt = tag;
 		oaa.opb_dmat = paa->plb_dmat;
 
 		(void) config_found_sm_loc(self, "opb", NULL, &oaa, opb_print,
 					   opb_submatch);
+
+		opb_devs++;
 	}
 }
 
@@ -213,18 +174,14 @@
 bus_space_tag_t
 opb_get_bus_space_tag(void)
 {
-	int i, pvr;
 
 	if (!opb_tag_init_done) {
-		pvr = mfpvr() >> 16;
+		struct opb_bus_space *obs;
 
-		for (i = 0; opb_limits[i].pvr && opb_limits[i].pvr != pvr; i++)
-			;
-		if (opb_limits[i].pvr == 0)
-			panic("opb_get_bus_space_tag: no limits for this CPU!");
+		obs = opb_get_bus_space_cpu();
 
-		opb_tag.pbs_base = opb_limits[i].base;
-		opb_tag.pbs_limit = opb_limits[i].limit;
+		opb_tag.pbs_base = obs->bs_base;
+		opb_tag.pbs_limit = obs->bs_limit;
 
 		if (bus_space_init(&opb_tag, "opbtag",
 		    ex_storage, sizeof(ex_storage)))
Index: powerpc/ibm4xx/dev/opbvar.h
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/dev/opbvar.h,v
retrieving revision 1.4
diff -u -r1.4 opbvar.h
--- powerpc/ibm4xx/dev/opbvar.h	21 Feb 2006 04:25:29 -0000	1.4
+++ powerpc/ibm4xx/dev/opbvar.h	5 May 2006 17:00:27 -0000
@@ -35,16 +35,38 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _POWERPC_IBM4XX_DEV_OPBVAR_H_
+#define _POWERPC_IBM4XX_DEV_OPBVAR_H_
+
 #include <machine/bus.h>
 
+struct opb_dev {
+	const char	*name;
+	int		instance;
+	bus_addr_t	addr;
+	int		irq[8];
+	void		*arg;
+};
+
+struct opb_bus_space {
+	bus_addr_t	bs_base;
+	bus_addr_t	bs_limit;
+};
+
 struct opb_attach_args {
-	const char *opb_name;
-	int opb_instance;
-	u_long opb_addr;
-	int opb_irq;
-	bus_space_tag_t opb_bt;		/* Bus space tag */
-	bus_dma_tag_t opb_dmat;		/* DMA tag */
+	const char	*opb_name;
+	int		opb_instance;
+	u_long		opb_addr;
+	int		opb_irq;
+	bus_space_tag_t	opb_bt;		/* Bus space tag */
+	bus_dma_tag_t	opb_dmat;	/* DMA tag */
+	void		*opb_arg;
 };
 
 /* For use before opb_attach() is called */
 extern bus_space_tag_t opb_get_bus_space_tag(void);
+
+/* Implemented at per-cpu module */
+extern struct opb_bus_space *opb_get_bus_space_cpu(void);
+
+#endif	/* _POWERPC_IBM4XX_DEV_OPBVAR_H_ */
Index: powerpc/ibm4xx/dev/plb.c
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/dev/plb.c,v
retrieving revision 1.14
diff -u -r1.14 plb.c
--- powerpc/ibm4xx/dev/plb.c	11 Dec 2005 12:18:42 -0000	1.14
+++ powerpc/ibm4xx/dev/plb.c	5 May 2006 17:00:27 -0000
@@ -80,18 +80,7 @@
 #include <machine/bus.h>
 
 #include <powerpc/ibm4xx/dev/plbvar.h>
-#include <powerpc/ibm4xx/ibm405gp.h>
 
-/*
- * The devices that attach to the processor local bus on the 405GP CPU.
- */
-const struct plb_dev plb_devs [] = {
-	{ "cpu", },
-	{ "ecc", },
-	{ "opb", },
-	{ "pchb", },
-	{ NULL }
-};
 
 static int	plb_match(struct device *, struct cfdata *, void *);
 static void	plb_attach(struct device *, struct device *, void *);
@@ -129,7 +118,7 @@
 plb_match(struct device *parent, struct cfdata *cf, void *aux)
 {
 
-	return (1);
+	return 1;
 }
 
 /*
@@ -140,22 +129,14 @@
 {
 	struct plb_attach_args paa;
 	struct plb_dev *local_plb_devs = aux;
-	int i;
 
 	printf("\n");
 
-	for (i = 0; plb_devs[i].plb_name != NULL; i++) {
-		paa.plb_name = plb_devs[i].plb_name;
-		paa.plb_dmat = &ibm4xx_default_bus_dma_tag;
-		paa.plb_irq = PLBCF_IRQ_DEFAULT;
-
-		(void) config_found_ia(self, "plb", &paa, plb_print);
-	}
-
 	while (local_plb_devs && local_plb_devs->plb_name != NULL) {
 		paa.plb_name = local_plb_devs->plb_name;
 		paa.plb_dmat = &ibm4xx_default_bus_dma_tag;
 		paa.plb_irq = PLBCF_IRQ_DEFAULT;
+		paa.arg = local_plb_devs->arg;
 
 		(void) config_found_ia(self, "plb", &paa, plb_print);
 		local_plb_devs++;
@@ -172,5 +153,5 @@
 	if (paa->plb_irq != PLBCF_IRQ_DEFAULT)
 		aprint_normal(" irq %d", paa->plb_irq);
 
-	return (UNCONF);
+	return UNCONF;
 }
Index: powerpc/ibm4xx/dev/plbvar.h
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/ibm4xx/dev/plbvar.h,v
retrieving revision 1.4
diff -u -r1.4 plbvar.h
--- powerpc/ibm4xx/dev/plbvar.h	11 Dec 2005 12:18:42 -0000	1.4
+++ powerpc/ibm4xx/dev/plbvar.h	5 May 2006 17:00:27 -0000
@@ -35,14 +35,23 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef _POWERPC_IBM4XX_DEV_PLBVAR_H_
+#define _POWERPC_IBM4XX_DEV_PLBVAR_H_
+
 #include <machine/bus.h>
 
 struct plb_dev {
-        const char *plb_name;
+        const char	*plb_name;
+	int		instance;
+	int		irq;
+	void		*arg;
 };
 
 struct plb_attach_args {
-	const char *plb_name;
-	bus_dma_tag_t plb_dmat;	/* DMA tag */
-	int plb_irq;
+	const char	*plb_name;
+	bus_dma_tag_t	plb_dmat;	/* DMA tag */
+	int		plb_irq;
+	void		*arg;
 };
+
+#endif	/* _POWERPC_IBM4XX_DEV_PLBVAR_H_ */
Index: evbppc/conf/files.obs405
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/conf/files.obs405,v
retrieving revision 1.15
diff -u -r1.15 files.obs405
--- evbppc/conf/files.obs405	13 Mar 2006 16:20:58 -0000	1.15
+++ evbppc/conf/files.obs405	5 May 2006 17:00:27 -0000
@@ -2,8 +2,8 @@
 #
 # obs405-specific configuration info
 
+file	arch/powerpc/ibm4xx/ibm405gpr.c
 file	arch/powerpc/ibm4xx/ibm4xx_autoconf.c
-file	arch/powerpc/ibm4xx/ibm4xxgpx_autoconf.c
 file	arch/powerpc/ibm4xx/ibm40x_machdep.c
 file	arch/powerpc/ibm4xx/ibm4xx_machdep.c
 file	arch/powerpc/ibm4xx/intr.c
Index: evbppc/obs405/obs266_autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/evbppc/obs405/obs266_autoconf.c,v
retrieving revision 1.2
diff -u -r1.2 obs266_autoconf.c
--- evbppc/obs405/obs266_autoconf.c	11 Dec 2005 12:17:12 -0000	1.2
+++ evbppc/obs405/obs266_autoconf.c	5 May 2006 17:00:27 -0000
@@ -40,6 +40,37 @@
 
 #include <machine/obs266.h>
 
+#include <powerpc/ibm4xx/ibm405gpr.h>
+#include <powerpc/ibm4xx/dcr405gp.h>
+
+
+/*
+ * Determine device configuration for a machine.
+ */
+void
+cpu_configure(void)
+{
+
+	intr_init();
+	calc_delayconst();
+
+	/* Make sure that timers run at CPU frequency */
+	mtdcr(DCR_CPC0_CR1, mfdcr(DCR_CPC0_CR1) & ~CPC0_CR1_CETE);
+
+	if (config_rootfound("plb", ibm405gpr_cpu.arg) == NULL)
+		panic("configure: mainbus not configured");
+
+	printf("biomask %x netmask %x ttymask %x\n", (u_short)imask[IPL_BIO],
+		(u_short)imask[IPL_NET], (u_short)imask[IPL_TTY]);
+
+	(void)spl0();
+
+	/*
+	 * Now allow hardware interrupts.
+	 */
+	__asm volatile ("wrteei 1");
+}
+
 void device_register(struct device *dev, void *aux)
 {
 

--------------050905060808040203050003--