linux-mips
[Top] [All Lists]

PCI driver problem

To: linux-mips@linux-mips.org
Subject: PCI driver problem
From: JinuM <jinum@esntechnologies.co.in>
Date: Thu, 4 Sep 2003 14:38:12 +0530
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Hi All,

I am moving onto MIPS from x86. I am facing a few problems using the base
address register of my PCI device on my MIPS.

i have a PCI card and i have written a simple driver for it on my x86
system. I dont follow the "pci_register_driver()" routine, instead i do a
"register_chrdrv()" in my "init_module()". 

In the my "open" call back routine, i do a 
****dev=pci_find_device(MY_VEN_ID,MY_DEV_ID,NULL);
then follow it by 
****mystruct->ioaddr=pci_resource_start(dev,0);
i do a ioremap n get my remapped address 
****mystruct->reioaddr = ioremap(mystruct->ioaddr,someLen);

ofcourse i do all the error checks after the function calls.

now in my open callback routine for testing i do a 

outl(0x42, mystruct->reioaddr+LED_OFFSET)

this puts OFF the LED on my card.

The above steps work well with my x86 system and the LED does go OFF. But
the same code doesnot work on my MIPS. Is there a difference in the way i
should use my base address register or do my IO(out(s) and in(s)). I guess
MIPS doesnot support I/O mapped devices, but i think in and out on MIPS take
care of converting the access.

Its to be noted that my PCI configuration space also differs. I get 0x0006
from my PCI command register in G4 where as on x86 i have 0x0107. Is this
because IO based accessing is not enabled on MIPS?

do i need to do a pci_enable_device(dev) after my pci_find_device()????? I
tried this but it dint work. 

can anyone please help me figure out the problem? 

thanx for your time!
-Jinu


<Prev in Thread] Current Thread [Next in Thread>
  • PCI driver problem, JinuM <=