This adds a pcib interface for use by interrupt controllers that
need to translate the pci rid. The translation could be based on
the 'msi-map' OFW property, a similar ACPI option, or hard-coded
for hardware lacking the above options.
Details
I've booted on a pass 1.1 and 2.0 ThunderX
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 3697 Build 3740: arc lint + arc unit
Event Timeline
The other odd thing is that pcib_get_rid() doesn't include the domain, but this does. That inconsistency is odd.
I would almost prefer fixing pcib_get_rid() so it took an enum for "rid type" (and fixing it to return errno while at it).
sys/dev/pci/pci_host_generic.c | ||
---|---|---|
717 | In general this file seems poorly named. It doesn't seem very "generic" at all but is very OFW specific. It seems like it belongs in sys/dev/ofw? | |
sys/dev/pci/pci_pci.c | ||
2559 | Note that if a device doesn't implement a KOBJ method, the default function chosen (kobj_error_method) returns ENXIO (6). If you are adding a new method for which there is not a default implementation, it's a good idea for its API to return an errno value instead of a direct value to avoid nasty surprises in the future when ENXIO gets interpreted as a valid value. *sigh* It seems that pcib_get_rid() already implemented this mistake which is unfortunate. |
Except the nit with ENXIO, everything else looks fine. I like this change.
sys/dev/pci/pci_host_generic.c | ||
---|---|---|
717 | I'm planning to split this file to generic and OFW parts (like it was done in ThunderX driver after this file was originally copied from there), once we finish integration of other amrv8/PCIe stuff. |
sys/dev/ofw/ofw_bus_subr.c | ||
---|---|---|
413–414 | This should be OF_getencprop |