]> xenbits.xensource.com Git - people/liuw/freebsd.git/commitdiff
Fix bus numbering in ThunderX ITS quirk
authorzbb <zbb@FreeBSD.org>
Sun, 25 Oct 2015 23:27:08 +0000 (23:27 +0000)
committerzbb <zbb@FreeBSD.org>
Sun, 25 Oct 2015 23:27:08 +0000 (23:27 +0000)
Internal busses (thus ECAM access) should be mapped to
all values from 0 to 143.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D3753

sys/arm64/arm64/gic_v3_its.c

index cb8a4887e90b1c48ee04a9d78a70767ef5479055..e4d2de925f48574f3c8e08fb15c52a4e21b92383 100644 (file)
@@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$");
 #include "gic_v3_reg.h"
 #include "gic_v3_var.h"
 
+#define        GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET        144
+
 #include "pic_if.h"
 
 /* Device and PIC methods */
@@ -1475,8 +1477,8 @@ its_get_devid_thunder(device_t pci_dev)
        bsf = PCI_RID(pci_get_bus(pci_dev), pci_get_slot(pci_dev),
            pci_get_function(pci_dev));
 
-       /* ECAM is on bus=0 */
-       if (bus == 0) {
+       /* Check if accessing internal PCIe (low bus numbers) */
+       if (bus < GIC_V3_ITS_QUIRK_THUNDERX_PEM_BUS_OFFSET) {
                return ((pci_get_domain(pci_dev) << PCI_RID_DOMAIN_SHIFT) |
                    bsf);
        /* PEM otherwise */