xref: /netbsd-src/sys/arch/evbppc/virtex/autoconf.c (revision 2685996b0ecfa62e9cdfc698150a0a79d02d2e7f)
1*2685996bSthorpej /*	$NetBSD: autoconf.c,v 1.7 2021/04/24 23:36:36 thorpej Exp $ */
2e388b581Sfreza 
3e388b581Sfreza /*
4e388b581Sfreza  * Copyright (c) 2006 Jachym Holecek
5e388b581Sfreza  * All rights reserved.
6e388b581Sfreza  *
7e388b581Sfreza  * Written for DFC Design, s.r.o.
8e388b581Sfreza  *
9e388b581Sfreza  * Redistribution and use in source and binary forms, with or without
10e388b581Sfreza  * modification, are permitted provided that the following conditions
11e388b581Sfreza  * are met:
12e388b581Sfreza  *
13e388b581Sfreza  * 1. Redistributions of source code must retain the above copyright
14e388b581Sfreza  *    notice, this list of conditions and the following disclaimer.
15e388b581Sfreza  *
16e388b581Sfreza  * 2. Redistributions in binary form must reproduce the above copyright
17e388b581Sfreza  *    notice, this list of conditions and the following disclaimer in the
18e388b581Sfreza  *    documentation and/or other materials provided with the distribution.
19e388b581Sfreza  *
20e388b581Sfreza  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21e388b581Sfreza  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22e388b581Sfreza  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23e388b581Sfreza  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24e388b581Sfreza  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25e388b581Sfreza  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26e388b581Sfreza  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27e388b581Sfreza  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28e388b581Sfreza  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29e388b581Sfreza  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30e388b581Sfreza  */
31e388b581Sfreza 
32e388b581Sfreza /*
33e388b581Sfreza  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
34e388b581Sfreza  * Copyright (C) 1995, 1996 TooLs GmbH.
35e388b581Sfreza  * All rights reserved.
36e388b581Sfreza  *
37e388b581Sfreza  * Redistribution and use in source and binary forms, with or without
38e388b581Sfreza  * modification, are permitted provided that the following conditions
39e388b581Sfreza  * are met:
40e388b581Sfreza  * 1. Redistributions of source code must retain the above copyright
41e388b581Sfreza  *    notice, this list of conditions and the following disclaimer.
42e388b581Sfreza  * 2. Redistributions in binary form must reproduce the above copyright
43e388b581Sfreza  *    notice, this list of conditions and the following disclaimer in the
44e388b581Sfreza  *    documentation and/or other materials provided with the distribution.
45e388b581Sfreza  * 3. All advertising materials mentioning features or use of this software
46e388b581Sfreza  *    must display the following acknowledgement:
47e388b581Sfreza  *	This product includes software developed by TooLs GmbH.
48e388b581Sfreza  * 4. The name of TooLs GmbH may not be used to endorse or promote products
49e388b581Sfreza  *    derived from this software without specific prior written permission.
50e388b581Sfreza  *
51e388b581Sfreza  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
52e388b581Sfreza  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
53e388b581Sfreza  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
54e388b581Sfreza  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55e388b581Sfreza  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
56e388b581Sfreza  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
57e388b581Sfreza  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
58e388b581Sfreza  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
59e388b581Sfreza  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
60e388b581Sfreza  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61e388b581Sfreza  */
62e388b581Sfreza 
63e388b581Sfreza #include <sys/cdefs.h>
64*2685996bSthorpej __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.7 2021/04/24 23:36:36 thorpej Exp $");
65e388b581Sfreza 
66e388b581Sfreza #include <sys/param.h>
67e388b581Sfreza #include <sys/conf.h>
6851a2be50Smatt #include <sys/cpu.h>
6951a2be50Smatt #include <sys/device_if.h>
70e388b581Sfreza #include <sys/systm.h>
71e388b581Sfreza 
72b105a186Skiyohara #include <powerpc/ibm4xx/spr.h>
7351a2be50Smatt 
7451a2be50Smatt #include <powerpc/ibm4xx/cpu.h>
75e388b581Sfreza #include <powerpc/ibm4xx/dev/plbvar.h>
76e388b581Sfreza 
77e388b581Sfreza 
78e388b581Sfreza /* List of port-specific devices to attach to the processor local bus. */
790ded96f5Srin static struct plb_dev local_plb_devs [] = {
80b105a186Skiyohara 	{ XILVIRTEX, "xcvbus" },
81b105a186Skiyohara 	{ 0, NULL }
82e388b581Sfreza };
83e388b581Sfreza 
84e388b581Sfreza /*
85e388b581Sfreza  * Determine device configuration for a machine.
86e388b581Sfreza  */
87e388b581Sfreza void
cpu_configure(void)88e388b581Sfreza cpu_configure(void)
89e388b581Sfreza {
90e388b581Sfreza 	intr_init();
91e388b581Sfreza 	calc_delayconst();
92e388b581Sfreza 
93*2685996bSthorpej 	if (config_rootfound("plb", __UNCONST(&local_plb_devs)) == NULL)
94e388b581Sfreza 		panic("configure: plb not configured");
95e388b581Sfreza 
96e388b581Sfreza 	(void)spl0();
97e388b581Sfreza }
98e388b581Sfreza 
99e388b581Sfreza /*
100e388b581Sfreza  * Setup root device, configure swap area.
101e388b581Sfreza  */
102e388b581Sfreza void
cpu_rootconf(void)103e388b581Sfreza cpu_rootconf(void)
104e388b581Sfreza {
1058ce44338Smlelstv 	rootconf();
106e388b581Sfreza }
107