From 6e0794b5607506e26dcfe64815fdb243529b7728 Mon Sep 17 00:00:00 2001 From: uch Date: Sun, 17 Feb 2002 20:59:33 +0000 Subject: [PATCH] To determine CPU architecture and product, add cpu_arch and cpu_prduct variables. these are initialized by sh_cpu_init()@sh3/sh3_machdep.c (see sh3/include/cputypes.h for detail.) add "options SH3" for SH3 kernel config file. --- sys/arch/evbsh3/conf/COMPUTEXEVB | 3 +- sys/arch/evbsh3/conf/CQREEKSH3 | 3 +- sys/arch/hpcsh/conf/GENERIC | 9 ++- sys/arch/hpcsh/conf/HP620LX | 5 +- sys/arch/hpcsh/conf/HPW650PA | 5 +- sys/arch/hpcsh/conf/JORNADA690 | 7 +-- sys/arch/mmeye/conf/GENERIC | 5 +- sys/arch/mmeye/conf/MMEYE | 3 +- sys/arch/mmeye/conf/MMTA | 3 +- sys/arch/mmeye/conf/MMTAICE | 3 +- sys/arch/mmeye/conf/MMTANEW | 3 +- sys/arch/mmeye/conf/MMTAROMNEW | 3 +- sys/arch/sh3/include/cputypes.h | 95 ++++++++++++++++++-------------- 13 files changed, 80 insertions(+), 67 deletions(-) diff --git a/sys/arch/evbsh3/conf/COMPUTEXEVB b/sys/arch/evbsh3/conf/COMPUTEXEVB index d2cbddcb33d6..b710b31bf695 100644 --- a/sys/arch/evbsh3/conf/COMPUTEXEVB +++ b/sys/arch/evbsh3/conf/COMPUTEXEVB @@ -1,4 +1,4 @@ -# $NetBSD: COMPUTEXEVB,v 1.13 2002/01/27 13:23:15 jdolecek Exp $ +# $NetBSD: COMPUTEXEVB,v 1.14 2002/02/17 20:59:35 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -17,6 +17,7 @@ options MINIROOTSIZE=3074 # size of memory disk, in blocks maxusers 32 # estimated number of users # CPU support. At least one is REQUIRED. +options SH3 options SH7709A,SH7709A_BROKEN_IPR # 100MHz options PCLOCK=25000000 # 25.000MHz options IOM_ROM_BEGIN=0x00000000 diff --git a/sys/arch/evbsh3/conf/CQREEKSH3 b/sys/arch/evbsh3/conf/CQREEKSH3 index 261b099d5182..00948bd78e7f 100644 --- a/sys/arch/evbsh3/conf/CQREEKSH3 +++ b/sys/arch/evbsh3/conf/CQREEKSH3 @@ -1,4 +1,4 @@ -# $NetBSD: CQREEKSH3,v 1.14 2002/01/27 13:23:15 jdolecek Exp $ +# $NetBSD: CQREEKSH3,v 1.15 2002/02/17 20:59:35 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -19,6 +19,7 @@ options ROMIMAGE maxusers 32 # estimated number of users # CPU support. At least one is REQUIRED. +options SH3 options SH7708 # 100MHz options PCLOCK=15000000 # 15.000MHz options IOM_ROM_BEGIN=0x00000000 diff --git a/sys/arch/hpcsh/conf/GENERIC b/sys/arch/hpcsh/conf/GENERIC index 73752092b24f..a69292dfefb6 100644 --- a/sys/arch/hpcsh/conf/GENERIC +++ b/sys/arch/hpcsh/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.18 2002/02/11 17:18:35 uch Exp $ +# $NetBSD: GENERIC,v 1.19 2002/02/17 20:59:35 uch Exp $ # # GENERIC machine description file # @@ -30,12 +30,11 @@ options KLOADER_DEBUG #options HD64461VIDEO_DEBUG #options HD64461PCMCIA_DEBUG -options SH7709A # 133MHz -options SH7709A_BROKEN_IPR +options SH3 options DDB # in-kernel debugger -#options DIAGNOSTIC # extra kernel debugging checks -#options DEBUG # extra kernel debugging support +options DIAGNOSTIC # extra kernel debugging checks +options DEBUG # extra kernel debugging support options KTRACE # system call tracing support options MSGBUFSIZE=65534 diff --git a/sys/arch/hpcsh/conf/HP620LX b/sys/arch/hpcsh/conf/HP620LX index ce23d438240b..7e397df8383b 100644 --- a/sys/arch/hpcsh/conf/HP620LX +++ b/sys/arch/hpcsh/conf/HP620LX @@ -1,4 +1,4 @@ -# $NetBSD: HP620LX,v 1.7 2002/01/27 13:23:17 jdolecek Exp $ +# $NetBSD: HP620LX,v 1.8 2002/02/17 20:59:36 uch Exp $ # # HP620LX # @@ -7,8 +7,7 @@ include "arch/hpcsh/conf/std.hpcsh" maxusers 32 # estimated number of users -options SH7709A # 133MHz -options SH7709A_BROKEN_IPR +options SH3 options PCLOCK=18432000 # 18MHz options DDB # in-kernel debugger diff --git a/sys/arch/hpcsh/conf/HPW650PA b/sys/arch/hpcsh/conf/HPW650PA index 6ddeb3e0515f..762fe1836204 100644 --- a/sys/arch/hpcsh/conf/HPW650PA +++ b/sys/arch/hpcsh/conf/HPW650PA @@ -1,4 +1,4 @@ -# $NetBSD: HPW650PA,v 1.2 2002/02/13 16:25:35 uch Exp $ +# $NetBSD: HPW650PA,v 1.3 2002/02/17 20:59:36 uch Exp $ # # HITACHI PERSONA HPW650PA # @@ -10,8 +10,7 @@ maxusers 32 # estimated number of users options KLOADER_KERNEL_PATH="\"/netbsd\"" options KLOADER_DEBUG -options SH7750 -options SH4 +options SH4 options INTERRUPT_MONITOR options HPC_DEBUG_LCD diff --git a/sys/arch/hpcsh/conf/JORNADA690 b/sys/arch/hpcsh/conf/JORNADA690 index 6d748cd71744..5e2ae2276bd0 100644 --- a/sys/arch/hpcsh/conf/JORNADA690 +++ b/sys/arch/hpcsh/conf/JORNADA690 @@ -1,4 +1,4 @@ -# $NetBSD: JORNADA690,v 1.14 2002/02/11 17:18:35 uch Exp $ +# $NetBSD: JORNADA690,v 1.15 2002/02/17 20:59:36 uch Exp $ # # JORNADA690 uch's Jornada 690 # @@ -7,10 +7,7 @@ include "arch/hpcsh/conf/std.hpcsh" maxusers 32 # estimated number of users -options KLOADER_KERNEL_PATH="\"/netbsd\"" - -options SH7709A # 133MHz -options SH7709A_BROKEN_IPR +options SH3 options PCLOCK=22000000 # 22MHz options DDB # in-kernel debugger diff --git a/sys/arch/mmeye/conf/GENERIC b/sys/arch/mmeye/conf/GENERIC index 7d7ea83d4534..3e44b04f16e4 100644 --- a/sys/arch/mmeye/conf/GENERIC +++ b/sys/arch/mmeye/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.32 2002/01/27 13:23:21 jdolecek Exp $ +# $NetBSD: GENERIC,v 1.33 2002/02/17 20:59:36 uch Exp $ # # GENERIC machine description file # @@ -20,11 +20,12 @@ include "arch/mmeye/conf/std.mmeye" -#ident "GENERIC-$Revision: 1.32 $" +#ident "GENERIC-$Revision: 1.33 $" maxusers 16 # estimated number of users # CPU support +options SH3 options SH7708R # 100MHz options MMEYE options MMEYE_NEW_INT diff --git a/sys/arch/mmeye/conf/MMEYE b/sys/arch/mmeye/conf/MMEYE index 457ef9a6bdf7..4a6a95376b3d 100644 --- a/sys/arch/mmeye/conf/MMEYE +++ b/sys/arch/mmeye/conf/MMEYE @@ -1,4 +1,4 @@ -# $NetBSD: MMEYE,v 1.9 2002/01/27 13:23:21 jdolecek Exp $ +# $NetBSD: MMEYE,v 1.10 2002/02/17 20:59:37 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -8,6 +8,7 @@ include "arch/mmeye/conf/std.mmeye" maxusers 16 # estimated number of users # CPU support +options SH3 options SH7708R # 100MHz options MMEYE options MMEYE_NEW_INT diff --git a/sys/arch/mmeye/conf/MMTA b/sys/arch/mmeye/conf/MMTA index a57d97c576ad..6263f51fe93a 100644 --- a/sys/arch/mmeye/conf/MMTA +++ b/sys/arch/mmeye/conf/MMTA @@ -1,4 +1,4 @@ -# $NetBSD: MMTA,v 1.11 2002/02/10 17:37:00 wiz Exp $ +# $NetBSD: MMTA,v 1.12 2002/02/17 20:59:37 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -14,6 +14,7 @@ include "arch/mmeye/conf/std.mmeye" maxusers 32 # estimated number of users # Standard system options +options SH3 options SH7708R # 100MHz options PCLOCK=33330000 # 33.33MHz options INITTODR_ALWAYS_USE_RTC diff --git a/sys/arch/mmeye/conf/MMTAICE b/sys/arch/mmeye/conf/MMTAICE index feb89b82731d..e00349ac1ebd 100644 --- a/sys/arch/mmeye/conf/MMTAICE +++ b/sys/arch/mmeye/conf/MMTAICE @@ -1,4 +1,4 @@ -# $NetBSD: MMTAICE,v 1.10 2002/02/10 17:37:00 wiz Exp $ +# $NetBSD: MMTAICE,v 1.11 2002/02/17 20:59:37 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -17,6 +17,7 @@ maxusers 32 # estimated number of users #options I386_CPU #options I486_CPU #options I586_CPU +options SH3 options SH7708 # 60MHz #options SH7708R # 100MHz #options I686_CPU diff --git a/sys/arch/mmeye/conf/MMTANEW b/sys/arch/mmeye/conf/MMTANEW index 38a6a16129c2..d208dd3e2ee8 100644 --- a/sys/arch/mmeye/conf/MMTANEW +++ b/sys/arch/mmeye/conf/MMTANEW @@ -1,4 +1,4 @@ -# $NetBSD: MMTANEW,v 1.10 2002/02/10 17:37:00 wiz Exp $ +# $NetBSD: MMTANEW,v 1.11 2002/02/17 20:59:37 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -14,6 +14,7 @@ include "arch/mmeye/conf/std.mmeye" maxusers 32 # estimated number of users # Standard system options +options SH3 options SH7708R # 100MHz options PCLOCK=33330000 # 33.33MHz options MMEYE_NEW_INT diff --git a/sys/arch/mmeye/conf/MMTAROMNEW b/sys/arch/mmeye/conf/MMTAROMNEW index c0803e361c89..752b61e76275 100644 --- a/sys/arch/mmeye/conf/MMTAROMNEW +++ b/sys/arch/mmeye/conf/MMTAROMNEW @@ -1,4 +1,4 @@ -# $NetBSD: MMTAROMNEW,v 1.10 2002/02/10 17:37:01 wiz Exp $ +# $NetBSD: MMTAROMNEW,v 1.11 2002/02/17 20:59:37 uch Exp $ # # GENERIC -- everything that's currently supported # @@ -15,6 +15,7 @@ options ROMIMAGE maxusers 32 # estimated number of users +options SH3 options PCLOCK=33330000 # 33.33MHz options MMEYE_NEW_INT #options MMEYE_NO_CACHE diff --git a/sys/arch/sh3/include/cputypes.h b/sys/arch/sh3/include/cputypes.h index 818e68760cba..cb12039bff3b 100644 --- a/sys/arch/sh3/include/cputypes.h +++ b/sys/arch/sh3/include/cputypes.h @@ -1,7 +1,7 @@ -/* $NetBSD: cputypes.h,v 1.1 1999/09/13 10:31:16 itojun Exp $ */ +/* $NetBSD: cputypes.h,v 1.2 2002/02/17 20:59:33 uch Exp $ */ -/* - * Copyright (c) 1993 Christopher G. Demetriou +/*- + * Copyright (c) 2002 The NetBSD Foundation, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -12,49 +12,60 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. */ -/* - * Classes of Processor. CPU identification code depends on - * this starting at 0, and having an increment of one. - */ +#ifndef _SH3_CPUTYPES_H_ +#define _SH3_CPUTYPES_H_ +#ifdef _KERNEL -#define CPUCLASS_SH3 0 +#define CPU_ARCH_SH3 3 +#define CPU_ARCH_SH4 4 -/* - * Kinds of Processor. Only the first 1 are used, as they are processors - * that might not have a cpuid instruction. - */ +#define CPU_PRODUCT_UNKNOWN 0 +/* SH3 series */ +#define CPU_PRODUCT_7708 1 +#define CPU_PRODUCT_7708S 2 +#define CPU_PRODUCT_7708R 3 +#define CPU_PRODUCT_7709 4 +#define CPU_PRODUCT_7709A 5 +/* SH4 series */ +#define CPU_PRODUCT_7750 6 +#define CPU_PRODUCT_7750S 7 -#define CPU_SH3 0 /* Hitachi SH3 */ - -/* - * CPU vendors - */ - -#define CPUVENDOR_UNKNOWN -1 -#define CPUVENDOR_HITACHI 0 - -/* - * Some other defines, dealing with values returned by cpuid. - */ - -#if 0 -#define CPU_MAXMODEL 15 /* Models within family range 0-15 */ -#define CPU_DEFMODEL 16 /* Value for unknown model -> default */ -#define CPU_MINFAMILY 4 /* Lowest that cpuid can return (486) */ -#define CPU_MAXFAMILY 6 /* Highest we know (686) */ +#ifndef _LOCORE +extern int cpu_arch; +extern int cpu_product; +#if defined(SH3) && defined(SH4) +#define CPU_IS_SH3 (cpu_arch == CPU_ARCH_SH3) +#define CPU_IS_SH4 (cpu_arch == CPU_ARCH_SH4) +#elif defined(SH3) +#define CPU_IS_SH3 1 +#define CPU_IS_SH4 0 +#elif defined(SH4) +#define CPU_IS_SH3 0 +#define CPU_IS_SH4 1 +#else +#error "define SH3 and/or SH4" #endif +#endif /* !_LOCORE */ +#endif /* _KERNEL */ +#endif /* !_SH3_CPUTYPES_H_ */