autoconf.c revision 1.11
11.11Smlelstv/* $NetBSD: autoconf.c,v 1.11 2012/07/29 18:05:41 mlelstv 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 *
191.1Sgdamore * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
201.1Sgdamore * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
211.1Sgdamore * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
221.1Sgdamore * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
231.1Sgdamore * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
241.1Sgdamore * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
251.1Sgdamore * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
261.1Sgdamore * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
271.1Sgdamore * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
281.1Sgdamore * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
291.1Sgdamore * POSSIBILITY OF SUCH DAMAGE.
301.1Sgdamore */
311.1Sgdamore
321.1Sgdamore#include <sys/cdefs.h>
331.11Smlelstv__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.11 2012/07/29 18:05:41 mlelstv Exp $");
341.1Sgdamore
351.1Sgdamore#include <sys/param.h>
361.10Smatt#include <sys/bus.h>
371.1Sgdamore#include <sys/conf.h>
381.8Sad#include <sys/device.h>
391.10Smatt#include <sys/systm.h>
401.1Sgdamore
411.10Smatt#include <mips/atheros/include/platform.h>
421.1Sgdamore#include <mips/atheros/include/arbusvar.h>
431.1Sgdamore
441.1Sgdamore/*
451.1Sgdamore * Configure all devices on system
461.1Sgdamore */
471.1Sgdamorevoid
481.1Sgdamorecpu_configure(void)
491.1Sgdamore{
501.1Sgdamore
511.1Sgdamore	intr_init();
521.1Sgdamore
531.1Sgdamore	/* Kick off autoconfiguration. */
541.1Sgdamore	(void)splhigh();
551.1Sgdamore	if (config_rootfound("mainbus", NULL) == NULL)
561.1Sgdamore		panic("no mainbus found");
571.7Stsutsui
581.7Stsutsui	/*
591.7Stsutsui	 * Hardware interrupts will be enabled in
601.7Stsutsui	 * sys/arch/mips/mips/mips3_clockintr.c:mips3_initclocks()
611.7Stsutsui	 * to avoid hardclock(9) by CPU INT5 before softclockintr is
621.7Stsutsui	 * initialized in initclocks().
631.7Stsutsui	 */
641.1Sgdamore}
651.1Sgdamore
661.1Sgdamorevoid
671.1Sgdamorecpu_rootconf(void)
681.1Sgdamore{
691.1Sgdamore
701.11Smlelstv	rootconf();
711.1Sgdamore}
721.1Sgdamore
731.1Sgdamorevoid
741.10Smattdevice_register(device_t dev, void *aux)
751.1Sgdamore{
761.10Smatt	(*platformsw->apsw_device_register)(dev, aux);
771.1Sgdamore}
78