[LinuxBIOS] LinuxBIOS 'flashrom' on Geode LX + CS5536

Jordan Crouse jordan.crouse at amd.com
Tue Dec 11 17:03:59 CET 2007

On 10/12/07 16:45 +0200, Martin-Éric Racine wrote:
> Right now, we're forced to use a deprecated hack from AMD called
> gx_util.c (a non-free kernel module whose only purpose is to play with
> the MSR) to flip the register. We even ended up having to hack a
> slightly different version of this module to work with the new
> platform featuring the NOR on the LPC hub.

Then you already know what you need to do.  I have said this numerous
times, but I'll say it again.  I've seen the gx_util code - all it does
is access MSRs, access memory, and access I/O ports, all of which can be
done easily with existing interfaces.

To read (or write) a MSR:

open /dev/cpu/0/msr
fseek to the MSR address (i.e. fseek(fd, 0x1808);)
read or write 8 bytes from the file (read(fd, msr, 8))

to read (or write) to memory:
open /dev/mem
mmap the range of memory that interests you (i.e  base 0xfe00000, length
0x10000 or whatever you need)
Read and write to that memory as usual

to read (or write) to memory:

set permissions (iopl(3);)
Use userspace versions of inX and outX functions as required

Thats it - if you do these three things then you have successfully emulated
the behavior of gx_util with community friendly interfaces.  Some combination
of these will get you to where you want to be.  


Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.

More information about the coreboot mailing list