[LinuxBIOS] m57sli-s4 and i2c

Ward Vandewege ward at gnu.org
Fri Apr 27 22:51:58 CEST 2007


Hi ST,

On Fri, Apr 27, 2007 at 10:32:43PM +0200, ST wrote:
> Thanks for your updated build description on the wiki. I think there is a list 
> of build instructions on the list, where your description is not linked?
> http://www.linuxbios.org/Documentation#How-To.27s

Right, I've added it.

> Also the description of the filo payload still postulates that filo doesn't 
> load sata disks. Which it does according to your build instructions.

It most certainly does. I've fixed the FILO page.

> I know i am a little biased... :-) but i think my proposed solution has some 
> advantages over desoldering the flashrom. First desoldering with a heat gun 
> poses the risk that you simple blow some of the tiny resistors away and 
> second it is pretty easy to switch between the two flashroms which is quite 
> neat in comparing register settings...

Yes, absolutely. Your solution is better.

> > How would I read those registers from userspace? I've looked around with
> > Google, but I can't seem to find an answer. I presume lspci is out, since
> > the superio hangs off the isa bus.
> I think thats inb for byte access and inw for word access (16 bit). You need 
> to be root to do this though. The addresses can be taken right from the 
> datasheet.

Right - I thought I could do this by dumping /dev/ports, but I can only see 4
(the superio EC controller lives at 0x290, with a control register at 0x295
and a data register at 0x296):

00000200  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*
00000290  ff ff ff ff 32 0a 32 32  ff ff ff ff ff ff ff ff
000002a0  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff
*

So then I thought I needed to do what was described in the datasheet: write
the index that I want to read out to the control register, and read the data
from the data register:

  #!/usr/bin/perl

  sub io_read {
    my $offset = shift;
    open(TMP,'/dev/port');
    seek(TMP,0x295,0);
    write(TMP,$offset,1);
    seek(TMP,0x296, 0);
    read(TMP,$tmp,1);
    close(TMP);
    printf("0x%02x\n",$tmp);
    return $tmp;
  }

  io_read(0x14);

I'm obviously doing something wrong because I get 0x0 back, for any index,
when running under LinuxBIOS, and 0x2 when running under the proprietary
BIOS.

Thanks,
Ward.

-- 
Ward Vandewege <ward at fsf.org>
Free Software Foundation - Senior System Administrator




More information about the coreboot mailing list