Need to activate L2 cache on a Celeron A..
Hi, guys,
I need some help on activating an 128 KB L2 cache on a Celeron A processor. The processor is part of a Powerleap Pro/II cpu upgrade pkg. Unfortunately on power up the cache is disabled (32kb L1 only). This was true when I was running Win98, and is still true now, as shown by executing "leafpad \proc\cpuinfo" in my new Zenwalk install. However, in Win98, Powerleap provided a program to enable the L2cache and I had it run on Win98 startup. But no sucg program exists for Linux, at least not from Powerleap directly.
However, a patch has been written to perform the L2 cache enabling in Linux. It works with version 2.2 kernel and was written by Peter Schneider 01/21/00.
Here is the code:
L2enabler_v1.txt version 1.0
#define MODULE
#define __KERNEL__
#include <linux/module.h>
#include <asm/system.h> /* cli(), *_flags */
static inline void disable_cache(void)
{
asm volatile (
"movl %%cr0, %%eax\n\t"
"orl $0x40000000, %%eax\n\t"
"movl %%eax, %%cr0\n\t"
:
:
:"memory", "cc", "eax");
}
/* ... */
static inline void enable_cache(void)
{
asm volatile (
"movl %%cr0, %%eax\n\t"
"andl $0xbfffffff, %%eax\n\t"
"movl %%eax, %%cr0"
:
:
:"memory", "cc", "eax");
}
int init_module(void)
{
unsigned long flags;
printk ("<1>L2Enabler: Will enable L2 cache on a Celeron\n");
save_flags(flags);
cli ();
//Disable L1 Cache
__asm__ ("wbinvd");
disable_cache ();
__asm__ ("wbinvd");
//Read L2 Cache MSR
__asm__ ("mov $0x11E, %ecx");
__asm__ ("rdmsr");
//Enable it
__asm__ ("or $0x00040101, %eax");
//Write to L2 Cache MSR
__asm__ ("mov $0x11E, %ecx");
__asm__ ("wrmsr");
//Enable L1 Cache
__asm__ ("wbinvd");
enable_cache();
__asm__ ("wbinvd");
//__asm__ ("invd");
restore_flags(flags);
printk ("<1>Done enabling L2 cache\n");
return 0;
}
void cleanup_module (void)
{
printk ("<1>Goodbye from the L2Enabler\n");
}
What I need to know is whather this is still valid for the current kernel version, and, if so, how would the "patching" be done?
Thanks for any help you might be able to provide.
Steve
Last edited by TheNobes; 02-18-2006 at 12:16 PM.
|