xref: /netbsd-src/sys/arch/rs6000/rs6000/cpu.c (revision d6c3db715ead39a9c7f8c8b67adccd230972adf9)
1*d6c3db71Sdyoung /*	$NetBSD: cpu.c,v 1.4 2011/07/18 17:26:56 dyoung Exp $	*/
268fe5b6fSgarbled 
368fe5b6fSgarbled /*-
468fe5b6fSgarbled  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
568fe5b6fSgarbled  * All rights reserved.
668fe5b6fSgarbled  *
768fe5b6fSgarbled  * This code is derived from software contributed to The NetBSD Foundation
868fe5b6fSgarbled  * by NONAKA Kimihiro.
968fe5b6fSgarbled  *
1068fe5b6fSgarbled  * Redistribution and use in source and binary forms, with or without
1168fe5b6fSgarbled  * modification, are permitted provided that the following conditions
1268fe5b6fSgarbled  * are met:
1368fe5b6fSgarbled  * 1. Redistributions of source code must retain the above copyright
1468fe5b6fSgarbled  *    notice, this list of conditions and the following disclaimer.
1568fe5b6fSgarbled  * 2. Redistributions in binary form must reproduce the above copyright
1668fe5b6fSgarbled  *    notice, this list of conditions and the following disclaimer in the
1768fe5b6fSgarbled  *    documentation and/or other materials provided with the distribution.
1868fe5b6fSgarbled  *
1968fe5b6fSgarbled  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2068fe5b6fSgarbled  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2168fe5b6fSgarbled  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2268fe5b6fSgarbled  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2368fe5b6fSgarbled  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2468fe5b6fSgarbled  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2568fe5b6fSgarbled  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2668fe5b6fSgarbled  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2768fe5b6fSgarbled  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2868fe5b6fSgarbled  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2968fe5b6fSgarbled  * POSSIBILITY OF SUCH DAMAGE.
3068fe5b6fSgarbled  */
3168fe5b6fSgarbled 
3268fe5b6fSgarbled #include <sys/cdefs.h>
33*d6c3db71Sdyoung __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.4 2011/07/18 17:26:56 dyoung Exp $");
3468fe5b6fSgarbled 
3568fe5b6fSgarbled #include <sys/param.h>
3668fe5b6fSgarbled #include <sys/systm.h>
3768fe5b6fSgarbled #include <sys/device.h>
38*d6c3db71Sdyoung #include <sys/bus.h>
3968fe5b6fSgarbled 
4068fe5b6fSgarbled #include <machine/autoconf.h>
4168fe5b6fSgarbled #include <machine/cpu.h>
4268fe5b6fSgarbled 
43612b7ee5Smatt int cpumatch(device_t, cfdata_t, void *);
44612b7ee5Smatt void cpuattach(device_t, device_t, void *);
4568fe5b6fSgarbled 
46612b7ee5Smatt CFATTACH_DECL_NEW(cpu, 0,
4768fe5b6fSgarbled     cpumatch, cpuattach, NULL, NULL);
4868fe5b6fSgarbled 
4968fe5b6fSgarbled extern struct cfdriver cpu_cd;
5068fe5b6fSgarbled 
5168fe5b6fSgarbled int
cpumatch(device_t parent,cfdata_t cfdata,void * aux)52612b7ee5Smatt cpumatch(device_t parent, cfdata_t cfdata, void *aux)
5368fe5b6fSgarbled {
5468fe5b6fSgarbled 	struct confargs *ca = aux;
5568fe5b6fSgarbled 
5668fe5b6fSgarbled 	if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
5768fe5b6fSgarbled 		return (0);
5868fe5b6fSgarbled 	if (cpu_info[0].ci_dev != NULL)
5968fe5b6fSgarbled 		return (0);
6068fe5b6fSgarbled 	return (1);
6168fe5b6fSgarbled }
6268fe5b6fSgarbled 
6368fe5b6fSgarbled void
cpuattach(device_t parent,device_t self,void * aux)64612b7ee5Smatt cpuattach(device_t parent, device_t self, void *aux)
6568fe5b6fSgarbled {
6668fe5b6fSgarbled 	struct cpu_info *ci;
6768fe5b6fSgarbled 
6868fe5b6fSgarbled 	ci = cpu_attach_common(self, 0);
6968fe5b6fSgarbled 	if (ci == NULL)
7068fe5b6fSgarbled 		return;
7168fe5b6fSgarbled 
7268fe5b6fSgarbled /*	cpu_setup_prep_generic(self);*/
7368fe5b6fSgarbled }
74