1 /* $NetBSD: autoconf.c,v 1.13 2023/12/20 15:29:05 thorpej Exp $ */
2
3 /*
4 * Copyright (c) 1994-1998 Mark Brinicombe.
5 * Copyright (c) 1994 Brini.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Mark Brinicombe for
19 * the NetBSD project.
20 * 4. The name of the company nor the name of the author may be used to
21 * endorse or promote products derived from this software without specific
22 * prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
25 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27 * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * RiscBSD kernel project
37 *
38 * autoconf.c
39 *
40 * Autoconfiguration functions
41 *
42 * Created : 08/10/94
43 */
44
45 #include <sys/cdefs.h>
46 __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.13 2023/12/20 15:29:05 thorpej Exp $");
47
48 #include "opt_md.h"
49
50 #include <sys/param.h>
51 #include <sys/systm.h>
52 #include <sys/reboot.h>
53 #include <sys/disklabel.h>
54 #include <sys/device.h>
55 #include <sys/conf.h>
56 #include <sys/kernel.h>
57 #include <machine/bootconfig.h>
58 #include <machine/intr.h>
59
60 #include "isa.h"
61
62 extern int footbridge_imask[NIPL];
63
64 void isa_intr_init (void);
65
66 /*
67 * Set up the root device from the boot args
68 */
69 void
cpu_rootconf(void)70 cpu_rootconf(void)
71 {
72 printf("boot device: %s\n",
73 booted_device != NULL ? device_xname(booted_device) : "<unknown>");
74 rootconf();
75 }
76
77
78 /*
79 * void cpu_configure()
80 *
81 * Configure all the root devices
82 * The root devices are expected to configure their own children
83 */
84 void
cpu_configure(void)85 cpu_configure(void)
86 {
87 /*
88 * Since various PCI interrupts could be routed via the ICU
89 * (for PCI devices in the bridge) we need to set up the ICU
90 * now so that these interrupts can be established correctly
91 * i.e. This is a hack.
92 */
93 isa_intr_init();
94
95 config_rootfound("mainbus", NULL);
96
97 #if defined(DEBUG)
98 /* Debugging information */
99 printf("ipl_bio=%08x ipl_net=%08x ipl_tty=%08x ipl_vm=%08x\n",
100 footbridge_imask[IPL_BIO], footbridge_imask[IPL_NET],
101 footbridge_imask[IPL_TTY], footbridge_imask[IPL_VM]);
102
103 printf("ipl_audio=%08x ipl_imp=%08x ipl_high=%08x ipl_serial=%08x\n",
104 footbridge_imask[IPL_AUDIO], footbridge_imask[IPL_CLOCK],
105 footbridge_imask[IPL_HIGH], footbridge_imask[IPL_SERIAL]);
106 #endif /* defined(DEBUG) */
107
108 /* Time to start taking interrupts so lets open the flood gates .... */
109 (void)spl0();
110 }
111
112 void
device_register(device_t dev,void * aux)113 device_register(device_t dev, void *aux)
114 {
115 }
116 /* End of autoconf.c */
117