autoconf.c revision 103597
178342Sbenno/*- 278342Sbenno * Copyright (c) 1998 Doug Rabson 378342Sbenno * All rights reserved. 478342Sbenno * 578342Sbenno * Redistribution and use in source and binary forms, with or without 678342Sbenno * modification, are permitted provided that the following conditions 778342Sbenno * are met: 878342Sbenno * 1. Redistributions of source code must retain the above copyright 978342Sbenno * notice, this list of conditions and the following disclaimer. 1078342Sbenno * 2. Redistributions in binary form must reproduce the above copyright 1178342Sbenno * notice, this list of conditions and the following disclaimer in the 1278342Sbenno * documentation and/or other materials provided with the distribution. 1378342Sbenno * 1478342Sbenno * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1578342Sbenno * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1678342Sbenno * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1778342Sbenno * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1878342Sbenno * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1978342Sbenno * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2078342Sbenno * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2178342Sbenno * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2278342Sbenno * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2378342Sbenno * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2478342Sbenno * SUCH DAMAGE. 2578342Sbenno */ 2678342Sbenno 2778342Sbenno#ifndef lint 2878342Sbennostatic const char rcsid[] = 2978342Sbenno "$FreeBSD: head/sys/powerpc/powerpc/autoconf.c 103597 2002-09-19 04:28:45Z grehan $"; 3078342Sbenno#endif 3178342Sbenno 3278342Sbenno#include "opt_bootp.h" 3378342Sbenno#include "opt_nfs.h" 3478342Sbenno#include "opt_nfsroot.h" 3578342Sbenno 3678342Sbenno#include <sys/param.h> 3778342Sbenno#include <sys/systm.h> 3878342Sbenno#include <sys/bus.h> 3978342Sbenno#include <sys/cons.h> 40103597Sgrehan#include <sys/kernel.h> 4178342Sbenno 4292842Salfredstatic void configure(void *); 4378342SbennoSYSINIT(configure, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL) 4499034Sbenno#ifdef NFS_ROOT 4599034SbennoSYSINIT(cpu_rootconf, SI_SUB_ROOT_CONF, SI_ORDER_FIRST, cpu_rootconf, NULL) 4678342Sbenno 4799034Sbenno#ifndef BOOTP_NFSROOT 4899034Sbenno#error "NFS_ROOT support not implemented for the non-BOOTP_NFSROOT case" 4999034Sbenno#endif 5099034Sbenno 5199034Sbennoextern void bootpc_init(void); 5299034Sbenno 5399034Sbennovoid 5499034Sbennocpu_rootconf() 5599034Sbenno{ 5699034Sbenno 5799034Sbenno bootpc_init(); 5899034Sbenno rootdevnames[0] = "nfs:"; 5999034Sbenno} 6099034Sbenno#endif 6199034Sbenno 6278342Sbenno/* 6378342Sbenno * Determine i/o configuration for a machine. 6478342Sbenno */ 6578342Sbennostatic void 6678342Sbennoconfigure(void *dummy) 6778342Sbenno{ 6884855Smp device_add_child(root_bus, "nexus", 0); 6984855Smp 7084855Smp root_bus_configure(); 7184855Smp 72103597Sgrehan /* 73103597Sgrehan * Enable device interrupts 74103597Sgrehan */ 75103597Sgrehan mtmsr(mfmsr() | PSL_EE | PSL_RI); 76103597Sgrehan 77103597Sgrehan cold = 0; 7878342Sbenno} 79