autoconf.c revision 1.6
11.6Sgdamore/* $NetBSD: autoconf.c,v 1.6 2006/09/04 05:17:26 gdamore 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.6Sgdamore__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.6 2006/09/04 05:17:26 gdamore 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.1Sgdamore	(void)spl0();
651.1Sgdamore}
661.1Sgdamore
671.1Sgdamorevoid
681.1Sgdamorecpu_rootconf(void)
691.1Sgdamore{
701.1Sgdamore
711.1Sgdamore	setroot(booted_device, booted_partition);
721.1Sgdamore}
731.1Sgdamore
741.1Sgdamorevoid
751.1Sgdamoredevice_register(struct device *dev, void *aux)
761.1Sgdamore{
771.6Sgdamore	ar531x_device_register(dev, aux);
781.1Sgdamore}
79