147178Sdfr/*- 247178Sdfr * Copyright (c) 1990 The Regents of the University of California. 347178Sdfr * All rights reserved. 447178Sdfr * 547178Sdfr * This code is derived from software contributed to Berkeley by 647178Sdfr * William Jolitz. 747178Sdfr * 847178Sdfr * Redistribution and use in source and binary forms, with or without 947178Sdfr * modification, are permitted provided that the following conditions 1047178Sdfr * are met: 1147178Sdfr * 1. Redistributions of source code must retain the above copyright 1247178Sdfr * notice, this list of conditions and the following disclaimer. 1347178Sdfr * 2. Redistributions in binary form must reproduce the above copyright 1447178Sdfr * notice, this list of conditions and the following disclaimer in the 1547178Sdfr * documentation and/or other materials provided with the distribution. 1647178Sdfr * 3. All advertising materials mentioning features or use of this software 1747178Sdfr * must display the following acknowledgement: 1847178Sdfr * This product includes software developed by the University of 1947178Sdfr * California, Berkeley and its contributors. 2047178Sdfr * 4. Neither the name of the University nor the names of its contributors 2147178Sdfr * may be used to endorse or promote products derived from this software 2247178Sdfr * without specific prior written permission. 2347178Sdfr * 2447178Sdfr * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2547178Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2650477Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2747178Sdfr * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2847178Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2947178Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 3047178Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 3147178Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3247178Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3347178Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3447178Sdfr * SUCH DAMAGE. 3547398Sdfr * 3647178Sdfr * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 3747178Sdfr * from: FreeBSD: src/sys/i386/i386/autoconf.c,v 1.156 3847178Sdfr */ 3947178Sdfr 4047178Sdfr/* 4147398Sdfr * Setup the system to run on the current machine. 4247578Sdfr * 4347178Sdfr * Configure() is called at boot time and initializes the vba 4447178Sdfr * device tables and the memory controller monitoring. Available 4547178Sdfr * devices are determined (from possibilities mentioned in ioconf.c), 4647178Sdfr * and the drivers are initialized. 4747178Sdfr */ 4847178Sdfr 4947178Sdfr#include <sys/cdefs.h> 5047578Sdfr__FBSDID("$FreeBSD$"); 5147178Sdfr 5247578Sdfr#include <sys/param.h> 5347578Sdfr#include <sys/systm.h> 5447578Sdfr#include <sys/bus.h> 5547178Sdfr#include <sys/conf.h> 5647178Sdfr#include <sys/disklabel.h> 5747178Sdfr#include <sys/reboot.h> 5847398Sdfr#include <sys/kernel.h> 5947398Sdfr#include <sys/malloc.h> 6049048Syokota#include <sys/mount.h> 6149048Syokota#include <sys/cons.h> 6252174Sdfr 6347178Sdfrstatic void configure_first (void *); 6447398Sdfrstatic void configure (void *); 6547398Sdfrstatic void configure_final (void *); 6649048Syokota 6749048SyokotaSYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL); 6852174Sdfr/* SI_ORDER_SECOND is hookable */ 6947178SdfrSYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL); 7049048Syokota/* SI_ORDER_MIDDLE is hookable */ 7152174SdfrSYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL); 7247178Sdfr 7353585Sgallatindevice_t nexus_dev; 7452174Sdfr 7547178Sdfr 7647178Sdfr/* 7751052Sdfr * Determine i/o configuration for a machine. 7847178Sdfr */ 7947178Sdfrstatic void 8047178Sdfrconfigure_first(void *dummy) 8147178Sdfr{ 8247178Sdfr 8347178Sdfr device_add_child(root_bus, "nexus", 0); 8447178Sdfr} 8547178Sdfr 8647178Sdfrstatic void 8747178Sdfrconfigure(void *dummy) 8847178Sdfr{ 8947178Sdfr 9047178Sdfr root_bus_configure(); 9147178Sdfr} 9247178Sdfr 9347178Sdfrstatic void 9447178Sdfrconfigure_final(void *dummy) 9547178Sdfr{ 9647178Sdfr 9747178Sdfr cninit_finish(); 9847178Sdfr cold = 0; 9947178Sdfr} 10047178Sdfr