autoconf.c revision 1.7
11.7Stsutsui/* $NetBSD: autoconf.c,v 1.7 2006/11/17 21:01:03 tsutsui Exp $ */ 21.1Sgdamore 31.1Sgdamore/*- 41.1Sgdamore * Copyright (c) 2001 The NetBSD Foundation, Inc. 51.1Sgdamore * All rights reserved. 61.1Sgdamore * 71.1Sgdamore * This code is derived from software contributed to The NetBSD Foundation 81.1Sgdamore * by Jason R. Thorpe. 91.1Sgdamore * 101.1Sgdamore * Redistribution and use in source and binary forms, with or without 111.1Sgdamore * modification, are permitted provided that the following conditions 121.1Sgdamore * are met: 131.1Sgdamore * 1. Redistributions of source code must retain the above copyright 141.1Sgdamore * notice, this list of conditions and the following disclaimer. 151.1Sgdamore * 2. Redistributions in binary form must reproduce the above copyright 161.1Sgdamore * notice, this list of conditions and the following disclaimer in the 171.1Sgdamore * documentation and/or other materials provided with the distribution. 181.1Sgdamore * 3. All advertising materials mentioning features or use of this software 191.1Sgdamore * must display the following acknowledgement: 201.1Sgdamore * This product includes software developed by the NetBSD 211.1Sgdamore * Foundation, Inc. and its contributors. 221.1Sgdamore * 4. Neither the name of The NetBSD Foundation nor the names of its 231.1Sgdamore * contributors may be used to endorse or promote products derived 241.1Sgdamore * from this software without specific prior written permission. 251.1Sgdamore * 261.1Sgdamore * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 271.1Sgdamore * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 281.1Sgdamore * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 291.1Sgdamore * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 301.1Sgdamore * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 311.1Sgdamore * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 321.1Sgdamore * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 331.1Sgdamore * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 341.1Sgdamore * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 351.1Sgdamore * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 361.1Sgdamore * POSSIBILITY OF SUCH DAMAGE. 371.1Sgdamore */ 381.1Sgdamore 391.1Sgdamore#include <sys/cdefs.h> 401.7Stsutsui__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.7 2006/11/17 21:01:03 tsutsui Exp $"); 411.1Sgdamore 421.1Sgdamore#include <sys/param.h> 431.1Sgdamore#include <sys/systm.h> 441.1Sgdamore#include <sys/conf.h> 451.1Sgdamore 461.1Sgdamore#include <machine/bus.h> 471.1Sgdamore 481.1Sgdamore#include <mips/atheros/include/ar531xvar.h> 491.1Sgdamore#include <mips/atheros/include/arbusvar.h> 501.1Sgdamore 511.1Sgdamore/* 521.1Sgdamore * Configure all devices on system 531.1Sgdamore */ 541.1Sgdamorevoid 551.1Sgdamorecpu_configure(void) 561.1Sgdamore{ 571.1Sgdamore 581.1Sgdamore intr_init(); 591.1Sgdamore 601.1Sgdamore /* Kick off autoconfiguration. */ 611.1Sgdamore (void)splhigh(); 621.1Sgdamore if (config_rootfound("mainbus", NULL) == NULL) 631.1Sgdamore panic("no mainbus found"); 641.7Stsutsui 651.7Stsutsui /* 661.7Stsutsui * Hardware interrupts will be enabled in 671.7Stsutsui * sys/arch/mips/mips/mips3_clockintr.c:mips3_initclocks() 681.7Stsutsui * to avoid hardclock(9) by CPU INT5 before softclockintr is 691.7Stsutsui * initialized in initclocks(). 701.7Stsutsui */ 711.1Sgdamore} 721.1Sgdamore 731.1Sgdamorevoid 741.1Sgdamorecpu_rootconf(void) 751.1Sgdamore{ 761.1Sgdamore 771.1Sgdamore setroot(booted_device, booted_partition); 781.1Sgdamore} 791.1Sgdamore 801.1Sgdamorevoid 811.1Sgdamoredevice_register(struct device *dev, void *aux) 821.1Sgdamore{ 831.6Sgdamore ar531x_device_register(dev, aux); 841.1Sgdamore} 85