Lines 112-117
Link Here
|
112 |
static void pci_resume_msi(device_t dev); |
112 |
static void pci_resume_msi(device_t dev); |
113 |
static void pci_resume_msix(device_t dev); |
113 |
static void pci_resume_msix(device_t dev); |
114 |
|
114 |
|
|
|
115 |
static void pci_fix_asus_smbus(device_t dev); |
116 |
|
117 |
|
115 |
static device_method_t pci_methods[] = { |
118 |
static device_method_t pci_methods[] = { |
116 |
/* Device interface */ |
119 |
/* Device interface */ |
117 |
DEVMETHOD(device_probe, pci_probe), |
120 |
DEVMETHOD(device_probe, pci_probe), |
Lines 179-194
Link Here
|
179 |
int type; |
182 |
int type; |
180 |
#define PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ |
183 |
#define PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ |
181 |
#define PCI_QUIRK_DISABLE_MSI 2 /* MSI/MSI-X doesn't work */ |
184 |
#define PCI_QUIRK_DISABLE_MSI 2 /* MSI/MSI-X doesn't work */ |
|
|
185 |
#define PCI_QUIRK_FIXUP_ROUTINE 4 /* PCI needs a fix to continue */ |
182 |
int arg1; |
186 |
int arg1; |
183 |
int arg2; |
187 |
int arg2; |
|
|
188 |
void (*fixup_func)(device_t dev); |
184 |
}; |
189 |
}; |
185 |
|
190 |
|
186 |
struct pci_quirk pci_quirks[] = { |
191 |
struct pci_quirk pci_quirks[] = { |
187 |
/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ |
192 |
/* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ |
188 |
{ 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, |
193 |
{ 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, |
189 |
{ 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, |
194 |
{ 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, |
190 |
/* As does the Serverworks OSB4 (the SMBus mapping register) */ |
195 |
/* As does the Serverworks OSB4 (the SMBus mapping register) */ |
191 |
{ 0x02001166, PCI_QUIRK_MAP_REG, 0x90, 0 }, |
196 |
{ 0x02001166, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, |
|
|
197 |
|
198 |
/* The ASUS P4B-motherboards needs a hack to enable the Intel 801SMBus */ |
199 |
{ 0x24408086, PCI_QUIRK_FIXUP_ROUTINE, 0, 0, &pci_fix_asus_smbus }, |
200 |
{ 0x24C08086, PCI_QUIRK_FIXUP_ROUTINE, 0, 0, &pci_fix_asus_smbus }, |
192 |
|
201 |
|
193 |
/* |
202 |
/* |
194 |
* MSI doesn't work with the ServerWorks CNB20-HE Host Bridge |
203 |
* MSI doesn't work with the ServerWorks CNB20-HE Host Bridge |
Lines 395-400
Link Here
|
395 |
cfg->hdrtype = 1; |
404 |
cfg->hdrtype = 1; |
396 |
} |
405 |
} |
397 |
|
406 |
|
|
|
407 |
/* asus p4b/p4pe hack */ |
408 |
static void |
409 |
pci_fix_asus_smbus(device_t dev) |
410 |
{ |
411 |
int pmccfg; |
412 |
|
413 |
/* read subsystem vendor-id */ |
414 |
pmccfg = pci_read_config(dev, 0xF2, 2); |
415 |
printf(" [-] pmccfg: %.4x\n",pmccfg); |
416 |
if( pmccfg & 0x8 ){ |
417 |
pmccfg &= ~0x8; |
418 |
pci_write_config(dev, 0xF2, pmccfg, 2); |
419 |
pmccfg = pci_read_config(dev, 0xF2, 2); |
420 |
if( pmccfg & 0x8 ) |
421 |
printf("Could not enable Intel 801SMBus!\n"); |
422 |
else |
423 |
printf("Enabled Intel 801SMBus\n"); |
424 |
} |
425 |
} |
426 |
|
398 |
/* extract header type specific config data */ |
427 |
/* extract header type specific config data */ |
399 |
|
428 |
|
400 |
static void |
429 |
static void |
Lines 2555-2564
Link Here
|
2555 |
* Add additional, quirked resources. |
2584 |
* Add additional, quirked resources. |
2556 |
*/ |
2585 |
*/ |
2557 |
for (q = &pci_quirks[0]; q->devid; q++) { |
2586 |
for (q = &pci_quirks[0]; q->devid; q++) { |
2558 |
if (q->devid == ((cfg->device << 16) | cfg->vendor) |
2587 |
if (q->devid == ((cfg->device << 16) | cfg->vendor) ){ |
2559 |
&& q->type == PCI_QUIRK_MAP_REG) |
2588 |
if( q->type == PCI_QUIRK_MAP_REG ) |
2560 |
pci_add_map(pcib, bus, dev, b, s, f, q->arg1, rl, |
2589 |
pci_add_map(pcib, bus, dev, b, s, f, q->arg1, rl, force, 0); |
2561 |
force, 0); |
2590 |
else if( q->type == PCI_QUIRK_FIXUP_ROUTINE ) |
|
|
2591 |
q->fixup_func(dev); |
2592 |
} |
2562 |
} |
2593 |
} |
2563 |
|
2594 |
|
2564 |
if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { |
2595 |
if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) { |