2005-03-09 17:02:55

by Alan

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Maw, 2005-03-08 at 17:39, Linux Kernel Mailing List wrote:
> ChangeSet 1.2088, 2005/03/08 09:39:30-08:00, [email protected]
>
> [PATCH] Support for GEODE CPUs
>

This patch is also incorrect.

> 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


2005-03-09 17:35:23

by Lennart Sorensen

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Wed, Mar 09, 2005 at 05:01:09PM +0000, Alan Cox wrote:
[snip]
> 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

2005-03-09 22:05:50

by Alan

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Mer, 2005-03-09 at 17:33, Lennart Sorensen wrote:
> 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

2005-03-09 23:29:10

by David Vrabel

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

Alan Cox wrote:
>
> 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?

> - 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

2005-03-10 00:12:17

by Alan

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Mer, 2005-03-09 at 23:26, David Vrabel wrote:
> Alan Cox wrote:
> > - 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

> > - 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.

2005-03-09 23:05:14

by Lennart Sorensen

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Wed, Mar 09, 2005 at 09:59:26PM +0000, Alan Cox wrote:
> 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.

> 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.

> - 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).

> - 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.

> 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

2005-03-11 01:43:09

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs


So.. did we end up deciding that the Geode patch should be reverted
wholesale?

2005-03-11 11:05:17

by Alan

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Gwe, 2005-03-11 at 01:42, Andrew Morton wrote:
> 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)

2005-03-11 14:14:40

by Lennart Sorensen

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

On Fri, Mar 11, 2005 at 11:02:33AM +0000, Alan Cox wrote:
> 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

2005-03-21 23:42:51

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

Alan Cox <[email protected]> wrote:
>
> On Gwe, 2005-03-11 at 01:42, Andrew Morton wrote:
> > 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.

2005-03-22 01:15:28

by Kianusch Sayah Karadji

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

Hi!

On Mon, 21 Mar 2005, Andrew Morton wrote:

>> 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.


Attachments:
geode.patch.2.6.11 (3.68 kB)
geode.patch.2.6.11

2005-03-22 07:13:56

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

Kianusch Sayah Karadji <[email protected]> wrote:
>
> On Mon, 21 Mar 2005, Andrew Morton wrote:
>
> >> 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.

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.



diff -puN arch/i386/Kconfig~x86-geode-support-fixes arch/i386/Kconfig
--- 25/arch/i386/Kconfig~x86-geode-support-fixes 2005-03-21 23:09:34.000000000 -0800
+++ 25-akpm/arch/i386/Kconfig 2005-03-21 23:09:53.000000000 -0800
@@ -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
diff -puN arch/i386/Makefile~x86-geode-support-fixes arch/i386/Makefile
--- 25/arch/i386/Makefile~x86-geode-support-fixes 2005-03-21 23:09:34.000000000 -0800
+++ 25-akpm/arch/i386/Makefile 2005-03-21 23:09:53.000000000 -0800
@@ -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
#
diff -puN include/asm-i386/module.h~x86-geode-support-fixes include/asm-i386/module.h
--- 25/include/asm-i386/module.h~x86-geode-support-fixes 2005-03-21 23:09:34.000000000 -0800
+++ 25-akpm/include/asm-i386/module.h 2005-03-21 23:09:53.000000000 -0800
@@ -52,8 +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 "
+#elif CONFIG_MGEODEGX1
+#define MODULE_PROC_FAMILY "GEODEGX1 "
#else
#error unknown processor family
#endif
_

2005-03-22 08:02:25

by Kianusch Sayah Karadji

[permalink] [raw]
Subject: Re: [PATCH] Support for GEODE CPUs

Hi!

On Mon, 21 Mar 2005, Andrew Morton wrote:

> 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

Signed-off-by: Kianusch Sayah Karadji <[email protected]>

---

diff -puN arch/i386/Kconfig~x86-geode-support-fixes arch/i386/Kconfig
--- 25/arch/i386/Kconfig~x86-geode-support-fixes 2005-03-21 23:09:34.000000000 -0800
+++ 25-akpm/arch/i386/Kconfig 2005-03-21 23:09:53.000000000 -0800
@@ -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
diff -puN arch/i386/Makefile~x86-geode-support-fixes arch/i386/Makefile
--- 25/arch/i386/Makefile~x86-geode-support-fixes 2005-03-21 23:09:34.000000000 -0800
+++ 25-akpm/arch/i386/Makefile 2005-03-21 23:09:53.000000000 -0800
@@ -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
#
diff -puN include/asm-i386/module.h~x86-geode-support-fixes include/asm-i386/module.h
--- 25/include/asm-i386/module.h~x86-geode-support-fixes 2005-03-21 23:09:34.000000000 -0800
+++ 25-akpm/include/asm-i386/module.h 2005-03-21 23:09:53.000000000 -0800
@@ -52,8 +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 "
+#elif CONFIG_MGEODEGX1
+#define MODULE_PROC_FAMILY "GEODEGX1 "
#else
#error unknown processor family
#endif
_