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)
Dec 20 2023, 12:06 AM
Unknown Object (File)
Nov 20 2023, 11:41 PM
Unknown Object (File)
Nov 19 2023, 7:21 PM
Unknown Object (File)
Nov 14 2023, 3:37 PM
Unknown Object (File)
Nov 9 2023, 1:23 PM
Unknown Object (File)
Nov 7 2023, 2:27 PM
Unknown Object (File)
Nov 5 2023, 7:59 PM
Unknown Object (File)
Nov 2 2023, 6:28 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 Not Applicable
Unit
Tests Not Applicable

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
792 ↗(On Diff #16565)

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

sys/dev/pci/pci_host_generic.c
191 ↗(On Diff #16565)

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.