Support for GEODE CPUs
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Linux Kernel Mailing List
ChangeSet 1.2088, 2005/03/08 09:39:30-08:00, [email protected]
[PATCH] Support for GEODE CPUs
This patch is also incorrect.
Quoted 3 lines
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.
And I have each time pointed out it is wrong over time because
a) "Geode" (Geode GX) runs -m486 code faster than -m586
b) "Geode" as a name also includes AMD Athlon "Geode NX" processors
c) Geode GX does not need OOSTORE because the processor manages DMA snooping in hardware.
Linus please drop this patch.
Alan
On Wed, Mar 09, 2005 at 05:01:09PM +0000, Alan Cox wrote:
[snip]
Quoted 6 lines
And I have each time pointed out it is wrong over time because
a) "Geode" (Geode GX) runs -m486 code faster than -m586
b) "Geode" as a name also includes AMD Athlon "Geode NX" processors
c) Geode GX does not need OOSTORE because the processor manages DMA snooping in hardware.
It even looks to me like the Geode GX1 (SCx200 family) is a Cyrix MediaGX design, the Geode GX2 (Geode GX [email protected] and company) I suspect is an AMD k6 based design (given the 400Mhz speed, and the inclusion of 3Dnow and MMX), and of course the Geode NX is athlon based.
Now if the Geode GX1 in fact runs faster optimized for 486 rather than 586 (I have been running one as 586tsc since it had mmx and tsc in its feature list), then I think I will be recompiling my kernel to see if I can't make this 266MHz GX1 run almost as fast as a 400MHz PXA255 (arm). Right now it has somewhat lower ethernet bandwidth than the arm.
Len Sorensen
Quoted 5 lines · Lennart Sorensen
Now if the Geode GX1 in fact runs faster optimized for 486 rather than 586 (I have been running one as 586tsc since it had mmx and tsc in its feature list), then I think I will be recompiling my kernel to see if I can't make this 266MHz GX1 run almost as fast as a 400MHz PXA255 (arm). Right now it has somewhat lower ethernet bandwidth than the arm.
If you build 486 it will still use the TSC because it is available (The PIT is buggy but the kernel knows about that anyway and handles it).
There are a few Geode tricks to know for performance
- Turn off the video
- If you can't turn it off use solid areas of colour to speed the system up (The hardware uses RLE encoding to reduce ram fetch bandwidth)
- Remember the cache is only 16K (12K when running X11 as 4K is borrowed for the blitter)
- The onboard audio is a software SB emulation on older GX. It burns CPU.
Also avoid touching various legacy registers as much as possible, many cause BIOS traps in SMM emulation code. The list I have is NDA but you can use rdtsc/inb or outb/rdtsc to work out which 8)
Alan
Quoted 2 lines · Alan Cox
If you build 486 it will still use the TSC because it is available (The PIT is buggy but the kernel knows about that anyway and handles it).
Hmm, I thought that was the whole point of the different cpu type choices in the kernel. Then again the MTRR is still available with a 386 kernel on a newer cpu as far as I remember, so I guess I will try a 486 optimized kernel next.
Quoted 3 lines
There are a few Geode tricks to know for performance
- Turn off the video
That is the plan long term, although the BIOS's serial console doesn't seem to work well with grub at least on minicom. I think switching to lilo may help that.
Quoted 4 lines
- If you can't turn it off use solid areas of colour to speed the system up (The hardware uses RLE encoding to reduce ram fetch bandwidth)
- Remember the cache is only 16K (12K when running X11 as 4K is borrowed for the blitter)
Even more reason to keep the video off (I think it steals some system ram when on as well).
Quoted 2 lines
- The onboard audio is a software SB emulation on older GX. It burns CPU.
I have audio disabled since I have no need for it.
Quoted 3 lines
Also avoid touching various legacy registers as much as possible, many cause BIOS traps in SMM emulation code. The list I have is NDA but you can use rdtsc/inb or outb/rdtsc to work out which 8)
Only PCI and LPC devices in use, so I don't think I will be poking any legacy registers directly, although I have no idea if the kernel would be poking any of them as part of running the drivers. Hopefully not.
Thanks for the information.
Len Sorensen
Quoted 5 lines · Alan Cox
There are a few Geode tricks to know for performance
- If you can't turn it off use solid areas of colour to speed the system up (The hardware uses RLE encoding to reduce ram fetch bandwidth)
How much of a difference does the compression make to performance?
Quoted 2 lines
- The onboard audio is a software SB emulation on older GX. It burns CPU.
Presumably one could write a native audio driver that didn't use the soundblaster emulation?
David Vrabel
Quoted 5 lines · David Vrabel
Quoted 2 lines · Alan Cox
- If you can't turn it off use solid areas of colour to speed the system up (The hardware uses RLE encoding to reduce ram fetch bandwidth)
How much of a difference does the compression make to performance?
Depends on the resolution but a display that is mostly solid can drop to 1/10th of a fancy background for memory fetch cost. Big deal on 66MHz SDRAM
Quoted 5 lines
Quoted 2 lines
- The onboard audio is a software SB emulation on older GX. It burns CPU.
Presumably one could write a native audio driver that didn't use the soundblaster emulation?
The newer ones have native audio, the older ones you could but it would be hard as the native audio is chip dependant, undocumented and the IRQ it raises is hard coded to the SMI/SMM line.
So.. did we end up deciding that the Geode patch should be reverted wholesale?
Quoted 2 lines · Andrew Morton
So.. did we end up deciding that the Geode patch should be reverted wholesale?
Either revert it or make it Geode GX and correct the options set. I've no problem with a Geode option that sets the right options 8)
Quoted 2 lines · Alan Cox
Either revert it or make it Geode GX and correct the options set. I've no problem with a Geode option that sets the right options 8)
Maybe it should say GX1 unless someone is sure the GX1 and GX2 (now GX [email protected] it seems) like the same optimizations. The SCx200 could go in the help text to clarify that those too are GX1 based.
Len Sorensen
Quoted 7 lines · Alan Cox
Quoted 2 lines · Andrew Morton
So.. did we end up deciding that the Geode patch should be reverted wholesale?
Either revert it or make it Geode GX and correct the options set. I've no problem with a Geode option that sets the right options 8)
Two weeks, no patch. It looks like we'll be reverting it.
Hi!
Quoted 3 lines · Andrew Morton
Quoted 1 line
Either revert it or make it Geode GX and correct the options set. I've no problem with a Geode option that sets the right options 8)
Two weeks, no patch. It looks like we'll be reverting it.
I somehow missed the thread in the list discussing the neccesary changes.
Anyway here's a new patch (this time for 2.6.11).
I changed the whole thing from "Geode GX" to "Geode GX1", and made the adjustments Alan suggested.
Regards
Kianusch
BTW.: I wish everybody - celebrating "new year" (NowRouz) these days - a happy and peaceful new year - and everybody else a wonderful spring quinox.
arch/i386/Kconfig +10 -4
@@ -183,6 +183,7 @@ - "Winchip-C6" for original IDT Winchip. - "Winchip-2" for IDT Winchip 2. - "Winchip-2A" for IDT Winchips with 3dNow! capabilities. + - "GeodeGX1" for Geode GX1 (Cyrix MediaGX). - "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,11 @@ stores for this CPU, which can increase performance of some operations. +config MGEODEGX1 + bool "GeodeGX1" + help + Select this for a Geode GX1 (Cyrix MediaGX) chip. + config MCYRIXIII bool "CyrixIII/VIA-C3" help
@@ -360,7 +366,7 @@ 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 || MGEODEGX1 default "6" if MK7 || MK8 || MPENTIUMM config RWSEM_GENERIC_SPINLOCK
@@ -379,7 +385,7 @@ config X86_PPRO_FENCE bool - depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 + depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 default y config X86_F00F_BUG
@@ -409,7 +415,7 @@ 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 || MGEODEGX1 default y config X86_GOOD_APIC
@@ -570,7 +576,7 @@ 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 || MGEODEGX1) && !X86_NUMAQ default y config X86_MCE
arch/i386/Makefile +5 -0
@@ -14,6 +14,8 @@ # 19990713 Artur Skawina <[email protected]> # Added '-march' and '-mpreferred-stack-boundary' support # +# 20050320 Kianusch Sayah Karadji <[email protected]> +# Added support for GEODE CPU LDFLAGS := -m elf_i386 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
@@ -51,6 +53,9 @@ # AMD Elan support cflags-$(CONFIG_X86_ELAN) += -march=i486 + +# Geode GX1 support +cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486) # -mregparm=3 works ok on gcc-3.0 and later #
include/asm-i386/module.h +2 -0
@@ -52,6 +52,8 @@#define MODULE_PROC_FAMILY "CYRIXIII "#elif definedCONFIG_MVIAC3_2 #define MODULE_PROC_FAMILY "VIAC3-2 " +#elif CONFIG_MGEODEGX1 +#define MODULE_PROC_FAMILY "GEODEGX1 "#else #error unknown processor family#endif
Quoted 6 lines · Kianusch Sayah Karadji
Quoted 3 lines · Andrew Morton
Quoted 2 lines
Either revert it or make it Geode GX and correct the options set. I've no problem with a Geode option that sets the right options 8)
Quoted 8 lines
Quoted 1 line
Two weeks, no patch. It looks like we'll be reverting it.
I somehow missed the thread in the list discussing the neccesary changes.
Anyway here's a new patch (this time for 2.6.11).
I changed the whole thing from "Geode GX" to "Geode GX1", and made the adjustments Alan suggested.
The original patch was already applied, so I made an incremental update. Please double-check it.
Sometime, could you send me a little description of what the patch does ("the adjustments Alan suggested") so Linus knows what we're doing to his kernel? And a Signed-off-by: line too, please.
arch/i386/Kconfig renamed from arch/i386/Kconfig~x86-geode-support-fixes +9 -11
@@ -187,7 +187,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. + - "GeodeGX1" for Geode GX1 (Cyrix MediaGX). - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3. - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
@@ -315,12 +315,10 @@ config MWINCHIP3D stores for this CPU, which can increase performance of some operations. -config MGEODE - bool "MediaGX/Geode" +config MGEODEGX1 + bool "GeodeGX1" 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. + Select this for a Geode GX1 (Cyrix MediaGX) chip. config MCYRIXIII bool "CyrixIII/VIA-C3"
@@ -372,7 +370,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 || MGEODE + default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1 default "6" if MK7 || MK8 || MPENTIUMM config RWSEM_GENERIC_SPINLOCK
@@ -391,7 +389,7 @@ config GENERIC_CALIBRATE_DELAY config X86_PPRO_FENCE bool - depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODE + depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 default y config X86_F00F_BUG
@@ -421,7 +419,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 || MGEODE + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1 default y config X86_GOOD_APIC
@@ -446,7 +444,7 @@ config X86_USE_3DNOW config X86_OOSTORE bool - depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MGEODE) && MTRR + depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR default y config HPET_TIMER
@@ -582,7 +580,7 @@ config X86_VISWS_APIC config X86_TSC bool - depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODE) && !X86_NUMAQ + depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ default y config X86_MCE
arch/i386/Makefile renamed from arch/i386/Makefile~x86-geode-support-fixes +3 -3
@@ -14,7 +14,7 @@ # 19990713 Artur Skawina <[email protected]> # Added '-march' and '-mpreferred-stack-boundary' support # -# Kianusch Sayah Karadji <[email protected]> +# 20050320 Kianusch Sayah Karadji <[email protected]> # Added support for GEODE CPU LDFLAGS := -m elf_i386
@@ -54,8 +54,8 @@ 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) +# Geode GX1 support +cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486) # -mregparm=3 works ok on gcc-3.0 and later #
include/asm-i386/module.h renamed from include/asm-i386/module.h~x86-geode-support-fixes +2 -2
@@ -52,8 +52,8 @@ struct mod_arch_specific#define MODULE_PROC_FAMILY "CYRIXIII "#elif definedCONFIG_MVIAC3_2 #define MODULE_PROC_FAMILY "VIAC3-2 " -#elif CONFIG_MGEODE -#define MODULE_PROC_FAMILY "GEODE " +#elif CONFIG_MGEODEGX1 +#define MODULE_PROC_FAMILY "GEODEGX1 "#else #error unknown processor family#endif
_
Hi!
Quoted 3 lines · Andrew Morton
The original patch was already applied, so I made an incremental update. Please double-check it.
Sometime, could you send me a little description of what the patch does ("the adjustments Alan suggested") so Linus knows what we're doing to his kernel? And a Signed-off-by: line too, please.
Changed Name/defines from "Geode GX" to "Geode GX1" for clarification
Dropped "-march=i586" in favor of "-march=i486"
Dopped X86_OOSTORE support for Geode GX1
---
arch/i386/Kconfig renamed from arch/i386/Kconfig~x86-geode-support-fixes +9 -11
@@ -187,7 +187,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. + - "GeodeGX1" for Geode GX1 (Cyrix MediaGX). - "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3. - "VIA C3-2 for VIA C3-2 "Nehemiah" (model 9 and above).
@@ -315,12 +315,10 @@ config MWINCHIP3D stores for this CPU, which can increase performance of some operations. -config MGEODE - bool "MediaGX/Geode" +config MGEODEGX1 + bool "GeodeGX1" 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. + Select this for a Geode GX1 (Cyrix MediaGX) chip. config MCYRIXIII bool "CyrixIII/VIA-C3"
@@ -372,7 +370,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 || MGEODE + default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODEGX1 default "6" if MK7 || MK8 || MPENTIUMM config RWSEM_GENERIC_SPINLOCK
@@ -391,7 +389,7 @@ config GENERIC_CALIBRATE_DELAY config X86_PPRO_FENCE bool - depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODE + depends on M686 || M586MMX || M586TSC || M586 || M486 || M386 || MGEODEGX1 default y config X86_F00F_BUG
@@ -421,7 +419,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 || MGEODE + depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1 default y config X86_GOOD_APIC
@@ -446,7 +444,7 @@ config X86_USE_3DNOW config X86_OOSTORE bool - depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MGEODE) && MTRR + depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR default y config HPET_TIMER
@@ -582,7 +580,7 @@ config X86_VISWS_APIC config X86_TSC bool - depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODE) && !X86_NUMAQ + depends on (MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MGEODEGX1) && !X86_NUMAQ default y config X86_MCE
arch/i386/Makefile renamed from arch/i386/Makefile~x86-geode-support-fixes +3 -3
@@ -14,7 +14,7 @@ # 19990713 Artur Skawina <[email protected]> # Added '-march' and '-mpreferred-stack-boundary' support # -# Kianusch Sayah Karadji <[email protected]> +# 20050320 Kianusch Sayah Karadji <[email protected]> # Added support for GEODE CPU LDFLAGS := -m elf_i386
@@ -54,8 +54,8 @@ 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) +# Geode GX1 support +cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486) # -mregparm=3 works ok on gcc-3.0 and later #
include/asm-i386/module.h renamed from include/asm-i386/module.h~x86-geode-support-fixes +2 -2
@@ -52,8 +52,8 @@ struct mod_arch_specific#define MODULE_PROC_FAMILY "CYRIXIII "#elif definedCONFIG_MVIAC3_2 #define MODULE_PROC_FAMILY "VIAC3-2 " -#elif CONFIG_MGEODE -#define MODULE_PROC_FAMILY "GEODE " +#elif CONFIG_MGEODEGX1 +#define MODULE_PROC_FAMILY "GEODEGX1 "#else #error unknown processor family#endif
_