autoconf.c revision 205726
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 205726 2010-03-27 05:40:50Z marcel $
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
42205713Smarcel#include <machine/bootinfo.h>
43205713Smarcel#include <machine/intr.h>
4466458Sdfr#include <machine/md_var.h>
4566458Sdfr
46143796Siedowsestatic void	configure_first(void *);
4792843Salfredstatic void	configure(void *);
48143796Siedowsestatic void	configure_final(void *);
4966458Sdfr
50143796SiedowseSYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
51143796Siedowse/* SI_ORDER_SECOND is hookable */
52143796SiedowseSYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
53143796Siedowse/* SI_ORDER_MIDDLE is hookable */
54143796SiedowseSYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
55143796Siedowse
56131840Sbrian#ifdef BOOTP
5793997Smarcelvoid bootpc_init(void);
58131840Sbrian#endif
5993997Smarcel
6071785Speter#ifdef DEV_ISA
6166458Sdfr#include <isa/isavar.h>
6266458Sdfrdevice_t isa_bus_device = 0;
6366458Sdfr#endif
6466458Sdfr
6566458Sdfr/*
6666458Sdfr * Determine i/o configuration for a machine.
6766458Sdfr */
6866458Sdfrstatic void
69143796Siedowseconfigure_first(void *dummy)
70143796Siedowse{
71146794Smarcel
72146794Smarcel	device_add_child(root_bus, "nexus", 0);
73143796Siedowse}
74143796Siedowse
75143796Siedowsestatic void
7666458Sdfrconfigure(void *dummy)
7766458Sdfr{
78146791Smarcel
7966458Sdfr	root_bus_configure();
8066458Sdfr
8166458Sdfr	/*
8266458Sdfr	 * Probe ISA devices after everything.
8366458Sdfr	 */
8471785Speter#ifdef DEV_ISA
8566458Sdfr	if (isa_bus_device)
8666458Sdfr		isa_probe_children(isa_bus_device);
8766458Sdfr#endif
88143796Siedowse}
8966458Sdfr
90143796Siedowsestatic void
91143796Siedowseconfigure_final(void *dummy)
92143796Siedowse{
93143796Siedowse
94205713Smarcel	cninit_finish();
9566458Sdfr
96205726Smarcel	ia64_enable_intr();
97205713Smarcel
9866458Sdfr	cold = 0;
9966458Sdfr}
100