1129198Scognet/*- 2129198Scognet * Copyright (c) 1990 The Regents of the University of California. 3129198Scognet * All rights reserved. 4129198Scognet * 5129198Scognet * This code is derived from software contributed to Berkeley by 6129198Scognet * William Jolitz. 7129198Scognet * 8129198Scognet * Redistribution and use in source and binary forms, with or without 9129198Scognet * modification, are permitted provided that the following conditions 10129198Scognet * are met: 11129198Scognet * 1. Redistributions of source code must retain the above copyright 12129198Scognet * notice, this list of conditions and the following disclaimer. 13129198Scognet * 2. Redistributions in binary form must reproduce the above copyright 14129198Scognet * notice, this list of conditions and the following disclaimer in the 15129198Scognet * documentation and/or other materials provided with the distribution. 16129198Scognet * 3. All advertising materials mentioning features or use of this software 17129198Scognet * must display the following acknowledgement: 18129198Scognet * This product includes software developed by the University of 19129198Scognet * California, Berkeley and its contributors. 20129198Scognet * 4. Neither the name of the University nor the names of its contributors 21129198Scognet * may be used to endorse or promote products derived from this software 22129198Scognet * without specific prior written permission. 23129198Scognet * 24129198Scognet * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25129198Scognet * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26129198Scognet * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27129198Scognet * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28129198Scognet * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29129198Scognet * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30129198Scognet * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31129198Scognet * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32129198Scognet * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33129198Scognet * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34129198Scognet * SUCH DAMAGE. 35129198Scognet * 36129198Scognet * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 37129198Scognet * from: FreeBSD: src/sys/i386/i386/autoconf.c,v 1.156 38129198Scognet */ 39129198Scognet 40129198Scognet/* 41129198Scognet * Setup the system to run on the current machine. 42129198Scognet * 43129198Scognet * Configure() is called at boot time and initializes the vba 44129198Scognet * device tables and the memory controller monitoring. Available 45129198Scognet * devices are determined (from possibilities mentioned in ioconf.c), 46129198Scognet * and the drivers are initialized. 47129198Scognet */ 48129198Scognet 49129198Scognet#include <sys/cdefs.h> 50129198Scognet__FBSDID("$FreeBSD$"); 51129198Scognet 52129198Scognet#include <sys/param.h> 53129198Scognet#include <sys/systm.h> 54129198Scognet#include <sys/bus.h> 55129198Scognet#include <sys/conf.h> 56129198Scognet#include <sys/disklabel.h> 57129198Scognet#include <sys/reboot.h> 58129198Scognet#include <sys/kernel.h> 59129198Scognet#include <sys/malloc.h> 60129198Scognet#include <sys/mount.h> 61129198Scognet#include <sys/cons.h> 62129198Scognet 63129198Scognetstatic void configure_first (void *); 64129198Scognetstatic void configure (void *); 65129198Scognetstatic void configure_final (void *); 66129198Scognet 67129198ScognetSYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL); 68129198Scognet/* SI_ORDER_SECOND is hookable */ 69129198ScognetSYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL); 70129198Scognet/* SI_ORDER_MIDDLE is hookable */ 71129198ScognetSYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL); 72129198Scognet 73129198Scognetdevice_t nexus_dev; 74129198Scognet 75129198Scognet 76129198Scognet/* 77129198Scognet * Determine i/o configuration for a machine. 78129198Scognet */ 79129198Scognetstatic void 80129198Scognetconfigure_first(void *dummy) 81129198Scognet{ 82146794Smarcel 83146794Smarcel device_add_child(root_bus, "nexus", 0); 84129198Scognet} 85129198Scognet 86129198Scognetstatic void 87129198Scognetconfigure(void *dummy) 88129198Scognet{ 89146794Smarcel 90129198Scognet root_bus_configure(); 91129198Scognet} 92129198Scognet 93129198Scognetstatic void 94129198Scognetconfigure_final(void *dummy) 95129198Scognet{ 96146790Smarcel 97283337Sandrew enable_interrupts(PSR_I | PSR_F); 98146790Smarcel cninit_finish(); 99146790Smarcel cold = 0; 100129198Scognet} 101