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$
2766458Sdfr */
2866458Sdfr
2971785Speter#include "opt_isa.h"
3066458Sdfr
3166458Sdfr#include <sys/param.h>
3266458Sdfr#include <sys/systm.h>
3366458Sdfr#include <sys/conf.h>
3466458Sdfr#include <sys/reboot.h>
3566458Sdfr#include <sys/kernel.h>
3666458Sdfr#include <sys/mount.h>
3766458Sdfr#include <sys/sysctl.h>
3866458Sdfr#include <sys/bus.h>
3966458Sdfr#include <sys/cons.h>
4066458Sdfr
41205713Smarcel#include <machine/intr.h>
4266458Sdfr#include <machine/md_var.h>
4366458Sdfr
44143796Siedowsestatic void	configure_first(void *);
4592843Salfredstatic void	configure(void *);
46143796Siedowsestatic void	configure_final(void *);
4766458Sdfr
48143796SiedowseSYSINIT(configure1, SI_SUB_CONFIGURE, SI_ORDER_FIRST, configure_first, NULL);
49143796Siedowse/* SI_ORDER_SECOND is hookable */
50143796SiedowseSYSINIT(configure2, SI_SUB_CONFIGURE, SI_ORDER_THIRD, configure, NULL);
51143796Siedowse/* SI_ORDER_MIDDLE is hookable */
52143796SiedowseSYSINIT(configure3, SI_SUB_CONFIGURE, SI_ORDER_ANY, configure_final, NULL);
53143796Siedowse
5471785Speter#ifdef DEV_ISA
5566458Sdfr#include <isa/isavar.h>
5666458Sdfrdevice_t isa_bus_device = 0;
5766458Sdfr#endif
5866458Sdfr
5966458Sdfr/*
6066458Sdfr * Determine i/o configuration for a machine.
6166458Sdfr */
6266458Sdfrstatic void
63143796Siedowseconfigure_first(void *dummy)
64143796Siedowse{
65146794Smarcel
66146794Smarcel	device_add_child(root_bus, "nexus", 0);
67143796Siedowse}
68143796Siedowse
69143796Siedowsestatic void
7066458Sdfrconfigure(void *dummy)
7166458Sdfr{
72146791Smarcel
7366458Sdfr	root_bus_configure();
7466458Sdfr
7566458Sdfr	/*
7666458Sdfr	 * Probe ISA devices after everything.
7766458Sdfr	 */
7871785Speter#ifdef DEV_ISA
7966458Sdfr	if (isa_bus_device)
8066458Sdfr		isa_probe_children(isa_bus_device);
8166458Sdfr#endif
82143796Siedowse}
8366458Sdfr
84143796Siedowsestatic void
85143796Siedowseconfigure_final(void *dummy)
86143796Siedowse{
87143796Siedowse
88205713Smarcel	cninit_finish();
8966458Sdfr
90205726Smarcel	ia64_enable_intr();
91205713Smarcel
9266458Sdfr	cold = 0;
9366458Sdfr}
94