autoconf.c revision 143796
166458Sdfr/*- 266458Sdfr * Copyright (c) 1998 Doug Rabson 366458Sdfr * All rights reserved. 466458Sdfr * 566458Sdfr * Redistribution and use in source and binary forms, with or without 666458Sdfr * modification, are permitted provided that the following conditions 766458Sdfr * are met: 866458Sdfr * 1. Redistributions of source code must retain the above copyright 966458Sdfr * notice, this list of conditions and the following disclaimer. 1066458Sdfr * 2. Redistributions in binary form must reproduce the above copyright 1166458Sdfr * notice, this list of conditions and the following disclaimer in the 1266458Sdfr * documentation and/or other materials provided with the distribution. 1366458Sdfr * 1466458Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1566458Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1666458Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1766458Sdfr * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1866458Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1966458Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2066458Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2166458Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2266458Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2366458Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2466458Sdfr * SUCH DAMAGE. 2566458Sdfr * 2666458Sdfr * $FreeBSD: head/sys/ia64/ia64/autoconf.c 143796 2005-03-18 09:45:43Z iedowse $ 2766458Sdfr */ 2866458Sdfr 29131840Sbrian#include "opt_bootp.h" 3071785Speter#include "opt_isa.h" 3166458Sdfr 3266458Sdfr#include <sys/param.h> 3366458Sdfr#include <sys/systm.h> 3466458Sdfr#include <sys/conf.h> 3566458Sdfr#include <sys/reboot.h> 3666458Sdfr#include <sys/kernel.h> 3766458Sdfr#include <sys/mount.h> 3866458Sdfr#include <sys/sysctl.h> 3966458Sdfr#include <sys/bus.h> 4066458Sdfr#include <sys/cons.h> 4166458Sdfr 4266458Sdfr#include <machine/md_var.h> 4366458Sdfr#include <machine/bootinfo.h> 4466458Sdfr 4566458Sdfr#include <cam/cam.h> 4666458Sdfr#include <cam/cam_ccb.h> 4766458Sdfr#include <cam/cam_sim.h> 4866458Sdfr#include <cam/cam_periph.h> 4966458Sdfr#include <cam/cam_xpt_sim.h> 5066458Sdfr#include <cam/cam_debug.h> 5166458Sdfr 52143796Siedowsestatic void configure_first(void *); 5392843Salfredstatic void configure(void *); 54143796Siedowsestatic void configure_final(void *); 5566458Sdfr 56143796SiedowseSYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL); 57143796Siedowse/* SI_ORDER_SECOND is hookable */ 58143796SiedowseSYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL); 59143796Siedowse/* SI_ORDER_MIDDLE is hookable */ 60143796SiedowseSYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL); 61143796Siedowse 62131840Sbrian#ifdef BOOTP 6393997Smarcelvoid bootpc_init(void); 64131840Sbrian#endif 6593997Smarcel 6671785Speter#ifdef DEV_ISA 6766458Sdfr#include <isa/isavar.h> 6866458Sdfrdevice_t isa_bus_device = 0; 6966458Sdfr#endif 7066458Sdfr 7166458Sdfr/* 7266458Sdfr * Determine i/o configuration for a machine. 7366458Sdfr */ 7466458Sdfrstatic void 75143796Siedowseconfigure_first(void *dummy) 76143796Siedowse{ 77143796Siedowse} 78143796Siedowse 79143796Siedowsestatic void 8066458Sdfrconfigure(void *dummy) 8166458Sdfr{ 8266458Sdfr device_add_child(root_bus, "nexus", 0); 8366458Sdfr 8466458Sdfr root_bus_configure(); 8566458Sdfr 8666458Sdfr /* 8766458Sdfr * Probe ISA devices after everything. 8866458Sdfr */ 8971785Speter#ifdef DEV_ISA 9066458Sdfr if (isa_bus_device) 9166458Sdfr isa_probe_children(isa_bus_device); 9266458Sdfr#endif 93143796Siedowse} 9466458Sdfr 95143796Siedowsestatic void 96143796Siedowseconfigure_final(void *dummy) 97143796Siedowse{ 98143796Siedowse 9966458Sdfr /* 10066458Sdfr * Now we're ready to handle (pending) interrupts. 10166458Sdfr * XXX this is slightly misplaced. 10266458Sdfr */ 10367032Sdfr enable_intr(); 10466458Sdfr 10566458Sdfr cold = 0; 10666458Sdfr} 107