From 1b5f52b3c36548b54b12abea1bd9881660a12153 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Wed, 12 Feb 2003 18:39:22 -0800 Subject: [PATCH] [PATCH] VIA C3 Nehemiah support. The new C3s won't boot a C3 kernel as they dropped 3dnow support in favour of SSE. It now also has cmov though and can be scheduled as a 686 CPU. I've a patch for gcc pending inclusion that adds the -march=c3-2 option. --- arch/i386/Kconfig | 23 +++++++++++++++++------ arch/i386/Makefile | 1 + arch/i386/kernel/cpu/centaur.c | 2 ++ include/asm-i386/module.h | 2 ++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index a30ca5258dae..c0652a981423 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -136,6 +136,7 @@ config M386 - "Winchip-2" for IDT Winchip 2. - "Winchip-2A" for IDT Winchips with 3dNow! capabilities. - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3. + - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above). If you don't know what to do, choose "386". @@ -174,7 +175,7 @@ config M686 against the f00f bug found in earlier Pentiums. config MPENTIUMII - bool "Pentium-II/Celeron(pre-Coppermine)" + bool "Pentium-II/Celeron(pre-Coppermine)" help Select this for Intel chips based on the Pentium-II and pre-Coppermine Celeron core. This option enables an unaligned @@ -260,6 +261,16 @@ config MCYRIXIII treat this chip as a generic 586. Whilst the CPU is 686 class, it lacks the cmov extension which gcc assumes is present when generating 686 code. + Note, that Nehemiah (Model 9) and above will not boot with this + kernel due to them lacking the 3dnow instructions used in earlier + incarnations of the CPU. + +config MVIAC3_2 + bool "VIA C3-2 (Nehemiah)" + help + Select this for a VIA C3 "Nehemiah". Selecting this enables usage of SSE + and tells gcc to treat the CPU as a 686. + Note, this kernel will not boot on older (pre model 9) C3s. endchoice @@ -278,8 +289,8 @@ config X86_XADD config X86_L1_CACHE_SHIFT int - default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 default "4" if MELAN || M486 || M386 + default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 default "6" if MK7 || MK8 default "7" if MPENTIUM4 @@ -325,12 +336,12 @@ config X86_POPAD_OK config X86_ALIGNMENT_16 bool - depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 default y config X86_TSC bool - depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 + depends on MWINCHIP3D || MWINCHIP2 || MCRUSOE || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 default y config X86_GOOD_APIC @@ -345,7 +356,7 @@ config X86_INTEL_USERCOPY config X86_USE_PPRO_CHECKSUM bool - depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8 + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 default y config X86_USE_3DNOW @@ -360,7 +371,7 @@ config X86_OOSTORE config X86_PREFETCH bool - depends on MPENTIUMIII || MPENTIUM4 + depends on MPENTIUMIII || MPENTIUM4 || MVIAC3_2 default y config X86_SSE2 diff --git a/arch/i386/Makefile b/arch/i386/Makefile index f3dc1e4c4e4f..eb8d0601de4f 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -46,6 +46,7 @@ cflags-$(CONFIG_MWINCHIP3D) += -march=i586 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-march=c3,-march=i486) # The alignment flags change with gcc 3.2 cflags-$(CONFIG_MCYRIXIII) += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) +cflags-$(CONFIG_MVIAC3_2) += $(call check_gcc,-march=c3-2,-march=i686) CFLAGS += $(cflags-y) diff --git a/arch/i386/kernel/cpu/centaur.c b/arch/i386/kernel/cpu/centaur.c index 5ac69d51ef21..5d6e84590b22 100644 --- a/arch/i386/kernel/cpu/centaur.c +++ b/arch/i386/kernel/cpu/centaur.c @@ -395,6 +395,8 @@ static void __init init_centaur(struct cpuinfo_x86 *c) set_bit(X86_FEATURE_CX8, c->x86_capability); set_bit(X86_FEATURE_3DNOW, c->x86_capability); + case 9: /* Nehemiah */ + default: get_model_name(c); display_cacheinfo(c); break; diff --git a/include/asm-i386/module.h b/include/asm-i386/module.h index 0accded7894d..ccc0dd076d05 100644 --- a/include/asm-i386/module.h +++ b/include/asm-i386/module.h @@ -46,6 +46,8 @@ struct mod_arch_specific #define MODULE_PROC_FAMILY "WINCHIP3D " #elif CONFIG_MCYRIXIII #define MODULE_PROC_FAMILY "CYRIXIII " +#elif CONFIG_MVIAC3_2 +#define MODULE_PROC_FAMILY "VIAC3-2 " #else #error unknown processor family #endif -- 2.39.5