Page MenuHomeFreeBSD

Add support for NEW_PCIB to the arm64 picb drivers
ClosedPublic

Authored by andrew on May 19 2016, 2:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 7, 10:15 PM
Unknown Object (File)
Sun, Jan 5, 8:04 AM
Unknown Object (File)
Nov 24 2024, 8:15 AM
Unknown Object (File)
Nov 17 2024, 10:59 AM
Unknown Object (File)
Nov 11 2024, 12:09 PM
Unknown Object (File)
Oct 19 2024, 9:47 PM
Unknown Object (File)
Sep 30 2024, 10:59 AM
Unknown Object (File)
Sep 29 2024, 2:40 AM
Subscribers

Details

Summary

Handle PCI_RES_BUS on the Generic and ThunderX PCIe drivers.

This adds pci_alloc_domain() to allocate domain IDs when they are not
available from FDT/ACPI.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3824
Build 3867: arc lint + arc unit

Event Timeline

andrew retitled this revision from to Add support for NEW_PCIB to the arm64 picb drivers.
andrew updated this object.
andrew edited the test plan for this revision. (Show Details)
andrew added reviewers: jhb, rstone.
andrew added a subscriber: emaste.

Hmm, pci_alloc_domain() seems dubious? Do you actually have multiple domains vs just having everything in a single domain? (All the x86 boxes are currently single-domain so just use a domain of 0, though ACPI supports multiple domains via _SEG and MCFG.) Presumably if there were multiple PCI domains / segments FDT would need to identify the domain the way ACPI does via _SEG?

sys/arm64/cavium/thunder_pcie_pem.c
790

Can this ever attach to a device whose FDT entry might have a domain configured?

sys/dev/pci/pci_host_generic.c
191

Seems like this should be checking the "linux,pci-domain" property and only using pci_alloc_domain() if that isn't present?

sys/dev/pci/pci_subr.c
299 ↗(On Diff #16565)

Maybe 'e.g. by ACPI or FDT'? To me using "on" here means that "ACPI or FDT" are examples of platforms where the firmware doesn't provide domain numbers, but that seems reverse to what you mean. Also, s/profided/provided/. Also, other comments in here use a double space after the end of a sentence.

Actually, 'sc->ecam' seems to be the PCI domain. It is what the drivers already return for the PCIB_IVAR_DOMAIN ivar, and looking at how it is constructed on arm64, it is effectively the upper N bits of the memory address for each PCI config access beyond the bus number (which is basically what a PCI domain means).

andrew edited edge metadata.

Use the ecam id

jhb edited edge metadata.
This revision is now accepted and ready to land.May 19 2016, 5:13 PM
This revision was automatically updated to reflect the committed changes.