1178825Sdfr/*	$NetBSD: obs266_autoconf.c,v 1.6 2011/06/18 06:44:26 matt Exp $	*/
2178825Sdfr
3178825Sdfr/*
4178825Sdfr * Copyright 2004 Shigeyuki Fukushima.
5233294Sstas * All rights reserved.
6178825Sdfr *
7233294Sstas * Written by Shigeyuki Fukushima for The NetBSD Project.
8178825Sdfr *
9178825Sdfr * Redistribution and use in source and binary forms, with or without
10178825Sdfr * modification, are permitted provided that the following conditions
11178825Sdfr * are met:
12178825Sdfr * 1. Redistributions of source code must retain the above copyright
13178825Sdfr *    notice, this list of conditions and the following disclaimer.
14178825Sdfr * 2. Redistributions in binary form must reproduce the above
15178825Sdfr *    copyright notice, this list of conditions and the following
16178825Sdfr *    disclaimer in the documentation and/or other materials provided
17 *    with the distribution.
18 * 3. The name of the author may not be used to endorse or promote
19 *    products derived from this software without specific prior
20 *    written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
28 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
32 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
33 * DAMAGE.
34 */
35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: obs266_autoconf.c,v 1.6 2011/06/18 06:44:26 matt Exp $");
37
38#include <sys/systm.h>
39#include <sys/device.h>
40#include <sys/cpu.h>
41
42#include <machine/obs266.h>
43
44#include <powerpc/ibm4xx/cpu.h>
45#include <powerpc/ibm4xx/dcr4xx.h>
46
47#include <dev/ic/comreg.h>
48
49/*
50 * Determine device configuration for a machine.
51 */
52void
53cpu_configure(void)
54{
55
56	intr_init();
57	calc_delayconst();
58
59	/* Make sure that timers run at CPU frequency */
60	mtdcr(DCR_CPC0_CR1, mfdcr(DCR_CPC0_CR1) & ~CPC0_CR1_CETE);
61
62	if (config_rootfound("plb", NULL) == NULL)
63		panic("configure: mainbus not configured");
64
65	(void)spl0();
66}
67
68void
69device_register(device_t dev, void *aux)
70{
71
72	obs405_device_register(dev, aux, OBS266_COM_FREQ);
73}
74