Re: bus device driver



On Tuesday 14 July 2009 3:08:40 am Norbert Koch wrote:

John Baldwin schrieb:
On Monday 13 July 2009 10:05:15 am Norbert Koch wrote:

Hello.

I just started to write a device
driver for a multi-function pci card.
This card replaces a number of
independant isa hardware devices.
This pci card contains memory, i/o
and interrupt sources.
I want my device driver to
serve as a bus driver between
the pci driver and the specific
device drivers.

Do I need more than the following (see below)?
Do I have to do any bookkeeping for allocated resources?


How do the child devices receive resources? Do they suballocate regions
from
BARs in the PCI device or is your device a subtractive bridge that will
forward requests for ISA ranges and your devices all use ISA ranges?


I am not quite sure that I understand what you mean. What is the difference?
My old device drivers were isa based. We had all our resources in the
15-16M isa hole.
So I want to change them to just allocate resources from the pci bus
through the bus device driver.
I thought it would be sufficient to just forward *_alloc_resource calls
directly to the pci driver.
Clearly, my drivers will have to know that they are just forwarded
through to pci
and have to know what sub-resources to allocate.

From a hardware perspective, how do your devices know which addresses to
decode? Do they consume subranges of BARs or are they assigned fixed
addresses somehow? Do they have programmable decoders of some sort
themselves? If you wish to have the PCI bus assign you resources then that
implies that your PCI device has a BAR and that you want to request resources
for that BAR and then hand out subranges of that to your children. If that
is the case, then you will need to allocate the resources for the BAR for the
PCI device from the PCI bus. Then your bus driver for the PCI device will
need to suballoc from that BAR to your children devices.

--
John Baldwin
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out"
    ... 2.6.23-rc1 I have trouble with my network connection. ... # Bus options (PCI, PCMCIA, EISA, MCA, ISA) ... # PCCARD support ... # Generic Driver Options ...
    (Linux-Kernel)
  • IDE:PORTS ALREADY IN USE | USB: irq 11: nobody cared! | loop pcmcia_core.ko which needs pcmcia_core.
    ... VP_IDE: IDE controller at PCI slot 0000:00:11.1 ... USB no longer working. ... irq 11: nobody cared! ... 15 nodes reported by PnP BIOS; 15 recorded by driver ...
    (Linux-Kernel)
  • only a single core (out of 8) initialized
    ... this is 2.6.30-rc7 with a patch added to debug a nv sata driver incompatibility with the Intel SSDs on a tyan motherboard ... kernel direct mapping tables up to d7fd0000 @ 10000-16000 ... Allocating PCI resources starting at f1000000 ... CPU: L2 Cache: 1024K ...
    (Linux-Kernel)
  • 2.6.15-rc5-mm2 does not boot on AMD64 with sata_sil
    ... Using ACPI for IRQ routing ... Uniform CD-ROM driver Revision: 3.20 ... Using ACPI for SMP configuration information Allocating PCI resources starting at e2000000 Checking aperture... ... Real Time Clock Driver v1.12 hw_random: AMD768 system management I/O registers at 0x8000. ...
    (Linux-Kernel)
  • kernel error
    ... but USB mouse is detected ... card driver dont work correctly) ... Failure registering Root Plug module with the kernel ... PCI: MCFG area at f0000000 reserved in E820 ...
    (Linux-Kernel)