
From: Kianusch Sayah Karadji <kianusch@sk-tech.net>

Those CPU's are found mostly in embedded systems ...  one of the most
prominent Hardware using GEODE CPU is probably soekris net4801
(http://www.soekris.com).

This patch has been on my homepage
(http://www.sk-tech.net/support/soekris.html) for quite a time - but I've
been asked several time to have it included in the main kernel.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/arch/i386/Kconfig         |   18 +++++++++++++-----
 25-akpm/arch/i386/Makefile        |    5 +++++
 25-akpm/include/asm-i386/module.h |    2 ++
 3 files changed, 20 insertions(+), 5 deletions(-)

diff -puN arch/i386/Kconfig~support-for-geode-cpus arch/i386/Kconfig
--- 25/arch/i386/Kconfig~support-for-geode-cpus	2005-02-27 14:58:29.000000000 -0800
+++ 25-akpm/arch/i386/Kconfig	2005-02-27 14:58:29.000000000 -0800
@@ -183,6 +183,7 @@ config M386
 	  - "Winchip-C6" for original IDT Winchip.
 	  - "Winchip-2" for IDT Winchip 2.
 	  - "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
+	  - "MediaGX/Geode" for Cyrix MediaGX aka Geode.
 	  - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
 	  - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
 
@@ -310,6 +311,13 @@ config MWINCHIP3D
 	  stores for this CPU, which can increase performance of some
 	  operations.
 
+config MGEODE
+	bool "MediaGX/Geode"
+	help
+	  Select this for a Cyrix MediaGX aka Geode chip. Linux and GCC
+          treat this chip as a 586TSC with some extended instructions
+          and alignment reqirements.
+
 config MCYRIXIII
 	bool "CyrixIII/VIA-C3"
 	help
@@ -360,7 +368,7 @@ config X86_L1_CACHE_SHIFT
 	int
 	default "7" if MPENTIUM4 || X86_GENERIC
 	default "4" if X86_ELAN || M486 || M386
-	default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2
+	default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE
 	default "6" if MK7 || MK8 || MPENTIUMM
 
 config RWSEM_GENERIC_SPINLOCK
@@ -379,7 +387,7 @@ config GENERIC_CALIBRATE_DELAY
 
 config X86_PPRO_FENCE
 	bool
-	depends on M686 || M586MMX || M586TSC || M586 || M486 || M386
+	depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODE
 	default y
 
 config X86_F00F_BUG
@@ -409,7 +417,7 @@ config X86_POPAD_OK
 
 config X86_ALIGNMENT_16
 	bool
-	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2
+	depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODE
 	default y
 
 config X86_GOOD_APIC
@@ -434,7 +442,7 @@ config X86_USE_3DNOW
 
 config X86_OOSTORE
 	bool
-	depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
+	depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MGEODE) && MTRR
 	default y
 
 config HPET_TIMER
@@ -570,7 +578,7 @@ config X86_IO_APIC
 
 config X86_TSC
 	bool
-	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2) && !X86_NUMAQ
+	depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODE) && !X86_NUMAQ
 	default y
 
 config X86_MCE
diff -puN arch/i386/Makefile~support-for-geode-cpus arch/i386/Makefile
--- 25/arch/i386/Makefile~support-for-geode-cpus	2005-02-27 14:58:29.000000000 -0800
+++ 25-akpm/arch/i386/Makefile	2005-02-27 14:58:29.000000000 -0800
@@ -14,6 +14,8 @@
 # 19990713  Artur Skawina <skawina@geocities.com>
 #           Added '-march' and '-mpreferred-stack-boundary' support
 #
+#           Kianusch Sayah Karadji <kianusch@sk-tech.net>
+#           Added support for GEODE CPU
 
 LDFLAGS		:= -m elf_i386
 OBJCOPYFLAGS	:= -O binary -R .note -R .comment -S
@@ -52,6 +54,9 @@ cflags-$(CONFIG_MVIAC3_2)	+= $(call cc-o
 # AMD Elan support
 cflags-$(CONFIG_X86_ELAN)	+= -march=i486
 
+# MediaGX aka Geode support
+cflags-$(CONFIG_MGEODE)		+= $(call cc-option,-march=pentium-mmx,-march=i586)
+
 # -mregparm=3 works ok on gcc-3.0 and later
 #
 GCC_VERSION			:= $(call cc-version)
diff -puN include/asm-i386/module.h~support-for-geode-cpus include/asm-i386/module.h
--- 25/include/asm-i386/module.h~support-for-geode-cpus	2005-02-27 14:58:29.000000000 -0800
+++ 25-akpm/include/asm-i386/module.h	2005-02-27 14:58:29.000000000 -0800
@@ -52,6 +52,8 @@ struct mod_arch_specific
 #define MODULE_PROC_FAMILY "CYRIXIII "
 #elif defined CONFIG_MVIAC3_2
 #define MODULE_PROC_FAMILY "VIAC3-2 "
+#elif CONFIG_MGEODE
+#define MODULE_PROC_FAMILY "GEODE "
 #else
 #error unknown processor family
 #endif
_
