autoconf.c (49679) | autoconf.c (50184) |
---|---|
1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR 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 * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 | 1/*- 2 * Copyright (c) 1990 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * William Jolitz. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR 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 * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 |
37 * $Id: autoconf.c,v 1.131 1999/08/09 10:34:40 phk Exp $ | 37 * $Id: autoconf.c,v 1.132 1999/08/13 10:29:16 phk Exp $ |
38 */ 39 40/* 41 * Setup the system to run on the current machine. 42 * 43 * Configure() is called at boot time and initializes the vba 44 * device tables and the memory controller monitoring. Available 45 * devices are determined (from possibilities mentioned in ioconf.c), --- 21 unchanged lines hidden (view full) --- 67 68#include <machine/bootinfo.h> 69#include <machine/ipl.h> 70#include <machine/md_var.h> 71#ifdef APIC_IO 72#include <machine/smp.h> 73#endif /* APIC_IO */ 74 | 38 */ 39 40/* 41 * Setup the system to run on the current machine. 42 * 43 * Configure() is called at boot time and initializes the vba 44 * device tables and the memory controller monitoring. Available 45 * devices are determined (from possibilities mentioned in ioconf.c), --- 21 unchanged lines hidden (view full) --- 67 68#include <machine/bootinfo.h> 69#include <machine/ipl.h> 70#include <machine/md_var.h> 71#ifdef APIC_IO 72#include <machine/smp.h> 73#endif /* APIC_IO */ 74 |
75#include <i386/isa/icu.h> 76 | |
77#include "pnp.h" 78#if NPNP > 0 | 75#include "pnp.h" 76#if NPNP > 0 |
79#include <i386/isa/isa_device.h> | |
80#include <i386/isa/pnp.h> 81#endif 82 | 77#include <i386/isa/pnp.h> 78#endif 79 |
83#include "eisa.h" 84#if NEISA > 0 85#include <i386/eisa/eisaconf.h> 86#endif 87 88#include "pci.h" 89#if NPCI > 0 90#include <pci/pcivar.h> 91#endif 92 93#include "isa.h" 94#if NISA > 0 | |
95device_t isa_bus_device = 0; | 80device_t isa_bus_device = 0; |
96#endif | |
97 98static void configure_first __P((void *)); 99static void configure __P((void *)); 100static void configure_final __P((void *)); 101 102static void configure_finish __P((void)); 103static void configure_start __P((void)); 104#if defined(FFS) || defined(FFS_ROOT) --- 96 unchanged lines hidden (view full) --- 201 configure_start(); /* DDB hook? */ 202} 203 204static void 205configure(dummy) 206 void *dummy; 207{ 208 | 81 82static void configure_first __P((void *)); 83static void configure __P((void *)); 84static void configure_final __P((void *)); 85 86static void configure_finish __P((void)); 87static void configure_start __P((void)); 88#if defined(FFS) || defined(FFS_ROOT) --- 96 unchanged lines hidden (view full) --- 185 configure_start(); /* DDB hook? */ 186} 187 188static void 189configure(dummy) 190 void *dummy; 191{ 192 |
209 /* Allow all routines to decide for themselves if they want intrs */ | |
210 /* | 193 /* |
211 * XXX Since this cannot be achieved on all architectures, we should 212 * XXX go back to disabling all interrupts until configuration is 213 * XXX completed and switch any devices that rely on the current 214 * XXX behavior to no longer rely on interrupts or to register an 215 * XXX interrupt_driven_config_hook for the task. | 194 * Activate the ICU's. Note that we are explicitly at splhigh() 195 * at present as we have no way to disable stray PCI level triggered 196 * interrupts until the devices have had a driver attached. This 197 * is particularly a problem when the interrupts are shared. For 198 * example, if IRQ 10 is shared between a disk and network device 199 * and the disk device generates an interrupt, if we "activate" 200 * IRQ 10 when the network driver is set up, then we will get 201 * recursive interrupt 10's as nothing will know how to turn off 202 * the disk device's interrupt. 203 * 204 * Having the ICU's active means we can probe interrupt routing to 205 * see if a device causes the corresponding pending bit to be set. 206 * 207 * This is all rather inconvenient. |
216 */ | 208 */ |
217 /* 218 * XXX The above is wrong, because we're implicitly at splhigh(), 219 * XXX and should stay there, so enabling interrupts in the CPU 220 * XXX and the ICU at most gives pending interrupts which just get 221 * XXX in the way. 222 */ | |
223#ifdef APIC_IO 224 bsp_apic_configure(); 225 enable_intr(); 226#else 227 enable_intr(); 228 INTREN(IRQ_SLAVE); 229#endif /* APIC_IO */ 230 | 209#ifdef APIC_IO 210 bsp_apic_configure(); 211 enable_intr(); 212#else 213 enable_intr(); 214 INTREN(IRQ_SLAVE); 215#endif /* APIC_IO */ 216 |
231#if NPNP > 0 232 pnp_configure(); 233#endif 234 | |
235 /* nexus0 is the top of the i386 device tree */ 236 device_add_child(root_bus, "nexus", 0, 0); 237 238 /* initialize new bus architecture */ 239 root_bus_configure(); 240 | 217 /* nexus0 is the top of the i386 device tree */ 218 device_add_child(root_bus, "nexus", 0, 0); 219 220 /* initialize new bus architecture */ 221 root_bus_configure(); 222 |
241#if NISA > 0 | 223#if NPNP > 0 224 /* Activate PNP. If no drivers are found, let ISA probe them.. */ 225 pnp_configure(); 226#endif 227 228 /* 229 * Explicitly probe and attach ISA last. The isa bus saves 230 * it's device node at attach time for us here. 231 */ |
242 if (isa_bus_device) 243 bus_generic_attach(isa_bus_device); | 232 if (isa_bus_device) 233 bus_generic_attach(isa_bus_device); |
244#endif | |
245 246 /* 247 * Now we're ready to handle (pending) interrupts. 248 * XXX this is slightly misplaced. 249 */ 250 spl0(); 251 252 /* --- 315 unchanged lines hidden --- | 234 235 /* 236 * Now we're ready to handle (pending) interrupts. 237 * XXX this is slightly misplaced. 238 */ 239 spl0(); 240 241 /* --- 315 unchanged lines hidden --- |