autoconf.c revision 83651
1251886Speter/*-
2251886Speter * Copyright (c) 1998 Doug Rabson
3251886Speter * All rights reserved.
4251886Speter *
5251886Speter * Redistribution and use in source and binary forms, with or without
6251886Speter * modification, are permitted provided that the following conditions
7251886Speter * are met:
8251886Speter * 1. Redistributions of source code must retain the above copyright
9251886Speter *    notice, this list of conditions and the following disclaimer.
10251886Speter * 2. Redistributions in binary form must reproduce the above copyright
11251886Speter *    notice, this list of conditions and the following disclaimer in the
12251886Speter *    documentation and/or other materials provided with the distribution.
13251886Speter *
14251886Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15251886Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16251886Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17251886Speter * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18251886Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19251886Speter * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20251886Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21251886Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22251886Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23251886Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24251886Speter * SUCH DAMAGE.
25251886Speter */
26251886Speter
27251886Speter#ifndef lint
28251886Speterstatic const char rcsid[] =
29251886Speter  "$FreeBSD: head/sys/powerpc/powerpc/autoconf.c 83651 2001-09-18 23:32:09Z peter $";
30251886Speter#endif
31251886Speter
32251886Speter#include "opt_bootp.h"
33251886Speter#include "opt_nfs.h"
34251886Speter#include "opt_nfsroot.h"
35251886Speter
36251886Speter#include <sys/param.h>
37251886Speter#include <sys/systm.h>
38251886Speter#include <sys/conf.h>
39251886Speter#include <sys/disklabel.h>
40251886Speter#include <sys/diskslice.h> /* for BASE_SLICE, MAX_SLICES */
41251886Speter#include <sys/ipl.h>
42251886Speter#include <sys/reboot.h>
43251886Speter#include <sys/kernel.h>
44251886Speter#include <sys/mount.h>
45251886Speter#include <sys/sysctl.h>
46251886Speter#include <sys/bus.h>
47251886Speter#include <sys/devicestat.h>
48251886Speter#include <sys/cons.h>
49251886Speter
50251886Speter#include <machine/md_var.h>
51251886Speter#include <machine/bootinfo.h>
52251886Speter#include <machine/trap.h>
53251886Speter
54251886Speter#include <cam/cam.h>
55251886Speter#include <cam/cam_ccb.h>
56251886Speter#include <cam/cam_sim.h>
57251886Speter#include <cam/cam_periph.h>
58251886Speter#include <cam/cam_xpt_sim.h>
59251886Speter#include <cam/cam_debug.h>
60251886Speter
61251886Speterstatic void	configure __P((void *));
62251886SpeterSYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL)
63251886Speter
64251886Speterdev_t	rootdev = NODEV;
65251886Speterdev_t	dumpdev = NODEV;
66251886Speter
67251886Speter/*
68251886Speter * Determine i/o configuration for a machine.
69251886Speter */
70251886Speterstatic void
71251886Speterconfigure(void *dummy)
72251886Speter{
73251886Speter	unsigned int	msr;
74251886Speter
75251886Speter	cold = 0;
76251886Speter
77251886Speter	msr = mfmsr();
78251886Speter	msr = PSL_EE|PSL_FP|PSL_ME|PSL_IR|PSL_DR|PSL_RI;
79251886Speter	mtmsr(msr);
80251886Speter	msr = mfmsr();
81251886Speter}
82251886Speter