Level 2 cache activation code?

Denis Dowling dpd at alphalink.com.au
Sun Nov 30 18:51:00 CET 2003


Hi Svante,

----- Original Message ----- 
From: "Svante Signell" <svante.signell at telia.com>
To: "ron minnich" <rminnich at lanl.gov>
Cc: "Takeshi Sone" <ts1 at tsn.or.jp>; <linuxbios at clustermatic.org>
Sent: Monday, December 01, 2003 10:14 AM
Subject: Re: Level 2 cache activation code?


>
> I have now made a small kernel module based on l2_cache.c giving the
> following output:
>
> Nov 30 17:46:56 cl-dual kernel: Configuring L2 cache...CPU signature of
> 6b0 so no L2 cache configuration
> Nov 30 17:46:56 cl-dual kernel: Enable Cache
> Nov 30 17:46:56 cl-dual kernel: done.
> Nov 30 17:46:56 cl-dual kernel:  cache_on  installed
>
> No speed-up seen. Extremely slow as before. Any hints? mtrr is OK, I
> believe. Is it the microcode??
>
> The processor is an 1.3GHz Celeron Tualatin, with CPUID: 6b0. According
> to the code in l2_cache.c newer CPUs than Coppermine (680) does not need
> the L2 setup code. Is this the case?

This was based on the assumption that all CPU from the coppermine forward
had the cache integrated onto the CPU die. Is this the case with your CPU.
Is it just a single large CPU on the slot1 pcb or does there look to be
cache chips mounted on the board as well?

> if (signature < 0x630 || signature >= 0x680) {
>   printk_debug("CPU signature of %x so no L2 cache configuration\n",
> signature);
>   goto done;

You could always just drop this test and see what happens later. If the CPU
does have external cache chips then this code might just work in
initiallising the cache.
>
> I few questions:
> 1. Does a kernel module have to be a standalone object without linking
> stage?

Yes just an object file compiled with the correct module flags.

> 2. How to add libraries to link with, if unresolved externals show up.

They should not. It is possible to add libraries but generally it is simpler
to keep all of the module code in the one file. Modules can reference other
modules if required. The depmod program will then load all required modules.

> 3. How to create a kernel module consisting of more than one object
> file. Now I include the needed source files into the main one.

Generally this is the easiest way to test this.

> 4. The cflags used are:
> CFLAGS = -D__KERNEL__ -DMODULE -I ./include -I$/usr/src/linux/include -I
> /usr/src/kernel-headers-2.4.22-1 -O2 -Wall -g

Have a look at a normal kernel compile and compare these arguments against
what is used for the other modules.

> 5. My module code looks like:
> cat cache_on.c
>
> #include <linux/module.h>
> #include <linux/kernel.h>
> (#include source files and other header files)
>
> #define PFX " cache_on "
>
> int init_module(void)
> {
>  p6_configure_l2_cache();
>  printk(KERN_INFO PFX " installed \n");
>  return 0;
> }
>
> void cleanup_module(void)
> {
>  printk(KERN_INFO PFX " removed\n");
> }

Looks fine. Turn on as much debugging in the l2_cache code as possible and
post to me and I will decode. Need to be able to see all of the printk_debug
messages.

Regards,
Denis





More information about the coreboot mailing list