Re: bus device driver




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.

My device decodes one ram address range (16MB) and gives me
one interrupt line.
As my sub-devices operate on partial address areas my idea was to
let them all call bus_alloc_resource() with the same rid parameter (= BAR selector)
and different offsets. So the bookkeeping should be done by the pci driver, right?

_______________________________________________
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: [PATCH 1/4 v2] PCI: introduce new base functions
    ... parameter will be used by the SR-IOV code. ... * @dev: the PCI device ... * @resno: the resource number ... * Returns BAR position in config space, or 0 if the BAR is invalid. ...
    (Linux-Kernel)
  • Re: Loading drivers via kldload
    ... The following are pure speculations, I'd rather let David speak, but just in case; ... This makes only if the BAR has sane values. ... some junk that duplicates other PCI device, ... allocated resource. ...
    (freebsd-current)
  • Re: Loading drivers via kldload
    ... The following are pure speculations, I'd rather let David speak, but just in case; ... This makes only if the BAR has sane values. ... some junk that duplicates other PCI device, ... allocated resource. ...
    (freebsd-current)
  • Re: [PATCH 3/4] x86: ioremap: remove physical address warning message
    ... , H. Peter Anvin wrote: ... if 64-bit BAR is assigned to a PCI device and its device ... I can see dropping the WARN_ON_ONCEthough. ...
    (Linux-Kernel)
  • Re: [PATCH]PCI:disable resource decode in PCI BAR detection
    ... If it chokes on the BAR disabled, how doesn't it choke on the BAR being moved to a different location, which is unavoidable during probing? ... Windows 98 doesn't, it says. ... Well, unfortunately, the second one isn't possible to meet given that we have boards with the MMCONFIG up there, so disabling the decode is the only thing we can do. ... from the root bus by AGP or PCI-E bridge. ...
    (Linux-Kernel)