Re: PCI register questions..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 05, 2003 at 01:26:50PM +0100, Jules Bj?rn Colding wrote:
> So my "device" is the bridge - not the cr16. 

From the information you gave me I'd say so.

> I guess that I must use the pci_resource_*() functions to access the IO
> ports of the cr16 then. I know from the data sheet for the cpu (an STPC
> Atlas) that I can access the IO ports (there are two) on the cr16 at
> specific addresses (0x328 and 0x32e). But it seems that the bridge are
> wrong about these adresses. Using the pcidump sample module from "Linux
> Device Drivers, 2. edition" I get this output (irrelevant information
> removed):
> 
>  	Compulsory registers:
> Vendor id: 104a
> Device id: 0210
> I/O space enabled: y
> Memory enabled: y
> Master enabled: y

[...]

> Base Address 0: 00000000
> Base Address 0 Is I/O: n
> Base Address 0 is 64-bits: n
> Base Address 0 is below-1M: n
> Base Address 0 is prefetchable: n
> Base Address 1: 00000000
> Base Address 1 Is I/O: n
> Base Address 1 is 64-bits: n
> Base Address 1 is below-1M: n
> Base Address 1 is prefetchable: n

Pity it doesn't say how large the regions are. Use lspci -vvvxx for
more information about that. There are also no IO regions specified
over here, might be that your tool doesn't show them. Again, use lspci
-vvvxx to figure out.

> This output put the both ports at 0x0. So it seems that I should use the
> port IO function (inb(), outb() and friends) to access the cr16 at its
> known IO addresses after having completed pci_register_driver() for the
> bridge.

No, it says that the BASE address for the memory region is at 0x0, it
doesn't tell anything about the IO regions.

> > Yes. The CR16MCS9 is bolted to the PCI/ISA bridge. In order to fiddle
> > with it, you need to talk to the bridge. The bridge has a PCI ID, so
> > you can get the a struct pci_dev. (I suppose your PCI/ISA bridge is
> > something like the PLX 9080).
> 
> My vendor/device id combo says 104a/0210 which seems to imply that it
> comes from SGS Thompson and that the device itself is so rare that it
> hasn't been included in pci_ids.h.

Just define it in your module:

#ifndef PCI_DEVICE_ID_MYCARD
#define PCI_DEVICE_ID_MYCARD 0x0210
#endif

If you know what kind of card you have, send the PCI ID to the Linux
PCI maintainers (see http://pciids.sf.net/ ).


Erik

-- 
J.A.K. (Erik) Mouw
Email: J.A.K.Mouw@its.tudelft.nl  mouw@nl.linux.org

Attachment: pgp00289.pgp
Description: PGP signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux