Hi Ward,
I don't think that my little "quickie" deserves so much consideration, but I
will post it, hopping that it could be usefull for someone..
Btw you have to do first a "setpci -s 00:01.1 64.l" to retrieve the base
address of the SYSCTRL register table. Use this value as a parameter for my
program to dump the io configuration (the gpio registers seem to start @ offset
0xc0 into this table..)
Hope this helps,
Florentin
Quoting Ward Vandewege <[EMAIL PROTECTED]>:
> Hey Florentin,
>
> Fascinating!
>
> On Fri, Oct 05, 2007 at 03:00:15PM +0200, [EMAIL PROTECTED] wrote:
> > - 3) Btw I figured out that registers of the "IO control unit" of mcp55
> can be
> > mapped into the IO space by writting into the SYSCTRL_REG of the 00:01.1
> pci
> > device integrated into the SB. Indeed by using this value as a base (under
> > Linux, this register holds the value 0x1400) one can access the GPIO
> registers
> > of MCP55 (beginning @ the 0xc0 offset? maybe..) These are 8 bit registers
> > apparently..
> > - 4) After booting with the proprietary Award bios, I dumped this table
> under
> > Linux (with a simple custom utility that I wrote for this purpose..). I
> dumped
> > 256 bytes from 0x1400.
>
> Would you mind sharing this utility with the list? It could be a very handy
> debugging tool.
>
> Thanks,
> Ward.
>
> --
> Ward Vandewege <[EMAIL PROTECTED]>
> Free Software Foundation - Senior System Administrator
>
#include <unistd.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/io.h>
int main(int argc, char *argv[])
{
unsigned int io_addr, io_val;
int result, i;
if (argc!=2) {
printf ("usage : %s <io_addr>\n", argv[0]);
return -1;
}
io_addr = strtol (argv[1], 0, 0);
result = iopl(3);
if (result!=0) {
perror ("iopl:");
return (-1);
}
for (i=0; i<0x100; i++) {
io_val = inb(io_addr);
printf(" %.8x : %.8x\n", io_addr, io_val);
io_addr++;
}
return 0;
}
--
linuxbios mailing list
[email protected]
http://www.linuxbios.org/mailman/listinfo/linuxbios