autoconf.c revision 103597
1246149Ssjg/*-
2246149Ssjg * Copyright (c) 1998 Doug Rabson
3246149Ssjg * All rights reserved.
4246149Ssjg *
5246149Ssjg * Redistribution and use in source and binary forms, with or without
6246149Ssjg * modification, are permitted provided that the following conditions
7246149Ssjg * are met:
8246149Ssjg * 1. Redistributions of source code must retain the above copyright
9246149Ssjg *    notice, this list of conditions and the following disclaimer.
10246149Ssjg * 2. Redistributions in binary form must reproduce the above copyright
11246149Ssjg *    notice, this list of conditions and the following disclaimer in the
12300313Ssjg *    documentation and/or other materials provided with the distribution.
13246149Ssjg *
14246149Ssjg * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15246149Ssjg * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16246149Ssjg * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17246149Ssjg * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18246149Ssjg * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19246149Ssjg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20246149Ssjg * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21246149Ssjg * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22246149Ssjg * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23246149Ssjg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24246149Ssjg * SUCH DAMAGE.
25246149Ssjg */
26246149Ssjg
27246149Ssjg#ifndef lint
28246149Ssjgstatic const char rcsid[] =
29246149Ssjg  "$FreeBSD: head/sys/powerpc/powerpc/autoconf.c 103597 2002-09-19 04:28:45Z grehan $";
30246149Ssjg#endif
31246149Ssjg
32246149Ssjg#include "opt_bootp.h"
33246149Ssjg#include "opt_nfs.h"
34246149Ssjg#include "opt_nfsroot.h"
35246149Ssjg
36246149Ssjg#include <sys/param.h>
37246149Ssjg#include <sys/systm.h>
38246149Ssjg#include <sys/bus.h>
39246149Ssjg#include <sys/cons.h>
40246149Ssjg#include <sys/kernel.h>
41246149Ssjg
42246149Ssjgstatic void	configure(void *);
43246149SsjgSYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
44246149Ssjg#ifdef	NFS_ROOT
45246149SsjgSYSINIT(cpu_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, cpu_rootconf, NULL)
46246149Ssjg
47246149Ssjg#ifndef	BOOTP_NFSROOT
48246149Ssjg#error	"NFS_ROOT support not implemented for the non-BOOTP_NFSROOT case"
49246149Ssjg#endif
50246149Ssjg
51246149Ssjgextern void	bootpc_init(void);
52246149Ssjg
53246149Ssjgvoid
54246149Ssjgcpu_rootconf()
55246149Ssjg{
56246149Ssjg
57246149Ssjg	bootpc_init();
58246149Ssjg	rootdevnames[0] = "nfs:";
59246149Ssjg}
60246149Ssjg#endif
61246149Ssjg
62246149Ssjg/*
63246149Ssjg * Determine i/o configuration for a machine.
64246149Ssjg */
65246149Ssjgstatic void
66246149Ssjgconfigure(void *dummy)
67246149Ssjg{
68246149Ssjg	device_add_child(root_bus, "nexus", 0);
69246149Ssjg
70246149Ssjg	root_bus_configure();
71246149Ssjg
72246149Ssjg	/*
73246149Ssjg	 * Enable device interrupts
74246149Ssjg	 */
75246149Ssjg	mtmsr(mfmsr() | PSL_EE | PSL_RI);
76246149Ssjg
77246149Ssjg	cold = 0;
78246149Ssjg}
79246149Ssjg