From c5dfd66fb4ee77dfccff6458f7533c75ee24cdc0 Mon Sep 17 00:00:00 2001 From: zbb Date: Tue, 21 Jul 2015 17:14:24 +0000 Subject: [PATCH] Add some more explanation to r285752 Add brief commentary to vendor-specific devid function in ITS and remove redundant spaces by the way. Obtained from: Semihalf Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/gic_v3_its.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/arm64/arm64/gic_v3_its.c b/sys/arm64/arm64/gic_v3_its.c index 2697c7db92e0..274a6aa2c230 100644 --- a/sys/arm64/arm64/gic_v3_its.c +++ b/sys/arm64/arm64/gic_v3_its.c @@ -1423,20 +1423,24 @@ its_get_devid_thunder(device_t pci_dev) bsf); /* PEM otherwise */ } else { - /* PEM number is equal to domain */ + /* PEM (PCIe MAC/root complex) number is equal to domain */ pem = pci_get_domain(pci_dev); - /* Hardcode appropriate PEM numbers */ - if (pem < 3 ) + /* + * Set appropriate device ID (passed by the HW along with + * the transaction to memory) for different root complex + * numbers using hard-coded domain portion for each group. + */ + if (pem < 3) return ((0x1 << PCI_RID_DOMAIN_SHIFT) | bsf); - if (pem < 6 ) + if (pem < 6) return ((0x3 << PCI_RID_DOMAIN_SHIFT) | bsf); - if (pem < 9 ) + if (pem < 9) return ((0x9 << PCI_RID_DOMAIN_SHIFT) | bsf); - if (pem < 12 ) + if (pem < 12) return ((0xB << PCI_RID_DOMAIN_SHIFT) | bsf); }