summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/pci/pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/sys/dev/pci/pci.c')
-rw-r--r--freebsd/sys/dev/pci/pci.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/freebsd/sys/dev/pci/pci.c b/freebsd/sys/dev/pci/pci.c
index 586efc3d..f1501208 100644
--- a/freebsd/sys/dev/pci/pci.c
+++ b/freebsd/sys/dev/pci/pci.c
@@ -108,8 +108,6 @@ static void pci_assign_interrupt(device_t bus, device_t dev,
static int pci_add_map(device_t bus, device_t dev, int reg,
struct resource_list *rl, int force, int prefetch);
static int pci_probe(device_t dev);
-static int pci_attach(device_t dev);
-static int pci_detach(device_t dev);
static void pci_load_vendor_data(void);
static int pci_describe_parse_line(char **ptr, int *vendor,
int *device, char **desc);
@@ -250,6 +248,7 @@ struct pci_quirk {
#define PCI_QUIRK_UNMAP_REG 4 /* Ignore PCI map register */
#define PCI_QUIRK_DISABLE_MSIX 5 /* MSI-X doesn't work */
#define PCI_QUIRK_MSI_INTX_BUG 6 /* PCIM_CMD_INTxDIS disables MSI */
+#define PCI_QUIRK_REALLOC_BAR 7 /* Can't allocate memory at the default address */
int arg1;
int arg2;
};
@@ -331,6 +330,12 @@ static const struct pci_quirk pci_quirks[] = {
{ 0x167814e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715 */
{ 0x167914e4, PCI_QUIRK_MSI_INTX_BUG, 0, 0 }, /* BCM5715S */
+ /*
+ * HPE Gen 10 VGA has a memory range that can't be allocated in the
+ * expected place.
+ */
+ { 0x98741002, PCI_QUIRK_REALLOC_BAR, 0, 0 },
+
{ 0 }
};
@@ -3311,7 +3316,9 @@ pci_add_map(device_t bus, device_t dev, int reg, struct resource_list *rl,
*/
res = resource_list_reserve(rl, bus, dev, type, &reg, start, end, count,
flags);
- if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0)) {
+ if ((pci_do_realloc_bars
+ || pci_has_quirk(pci_get_devid(dev), PCI_QUIRK_REALLOC_BAR))
+ && res == NULL && (start != 0 || end != ~0)) {
/*
* If the allocation fails, try to allocate a resource for
* this BAR using any available range. The firmware felt
@@ -4404,7 +4411,7 @@ pci_attach_common(device_t dev)
return (0);
}
-static int
+int
pci_attach(device_t dev)
{
int busno, domain, error;
@@ -4425,7 +4432,7 @@ pci_attach(device_t dev)
return (bus_generic_attach(dev));
}
-static int
+int
pci_detach(device_t dev)
{
#ifdef PCI_RES_BUS