[LinuxBIOS] CAR for Geode GX1 / GX2
Juergen Beisert
juergen127 at kreuzholzen.de
Tue May 8 09:29:29 CEST 2007
Marc,
On Monday 07 May 2007 21:37, Marc Jones wrote:
> This looks like a good example of scratchpad setup. The only part I
> thought missing is the size setting of the GCR register.
To be complete, here comes the missed function.
/*
* set_scratch_pad_size - configure a new size
* @info: hardware info
* @size: new size in bytes
*
* Note: Call this function with the lock held!
* Note: Called with size = 0 will disable the scratch pad ram
*/
static void set_scratch_pad_size(struct geode_gx1_info * info,u32 size)
{
u8 ccr3,new_size;
ccr3 = getCx86(CX86_CCR3);
setCx86(CX86_CCR3, (ccr3 & 0x0F) | 0x10); /* enable MAPEN */
new_size=getCx86(CX86_GCR) & 0x03;
switch (size) {
case 0:
break;
case 2048:
new_size |= 0x04;
break;
case 3072:
new_size |= 0x08;
break;
default:
new_size |= 0x0C;
break;
}
setCx86(CX86_GCR,new_size); /* setup the new size */
setCx86(CX86_CCR3, ccr3);
}
Juergen
More information about the coreboot
mailing list