FreeBSD Bugzilla – Attachment 100459 Details for
Bug 139743
[ichsmb] [patch] ichsmb driver doesn't detects SMB bus on Asus P4B533/P4PE motherboards
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.78 KB, created by
Alexander
on 2009-10-19 06:00:10 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Alexander
Created:
2009-10-19 06:00:10 UTC
Size:
2.78 KB
patch
obsolete
>diff -ur /usr/src/sys/dev/pci.old/pci.c /usr/src/sys/dev/pci/pci.c >--- /usr/src/sys/dev/pci.old/pci.c 2009-04-15 09:14:26.000000000 +0600 >+++ /usr/src/sys/dev/pci/pci.c 2009-10-13 08:41:43.000000000 +0600 >@@ -112,6 +112,9 @@ > static void pci_resume_msi(device_t dev); > static void pci_resume_msix(device_t dev); > >+static void pci_fix_asus_smbus(device_t dev); >+ >+ > static device_method_t pci_methods[] = { > /* Device interface */ > DEVMETHOD(device_probe, pci_probe), >@@ -179,16 +182,22 @@ > int type; > #define PCI_QUIRK_MAP_REG 1 /* PCI map register in weird place */ > #define PCI_QUIRK_DISABLE_MSI 2 /* MSI/MSI-X doesn't work */ >+#define PCI_QUIRK_FIXUP_ROUTINE 4 /* PCI needs a fix to continue */ > int arg1; > int arg2; >+ void (*fixup_func)(device_t dev); > }; > > struct pci_quirk pci_quirks[] = { > /* The Intel 82371AB and 82443MX has a map register at offset 0x90. */ >- { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0 }, >- { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0 }, >+ { 0x71138086, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, >+ { 0x719b8086, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, > /* As does the Serverworks OSB4 (the SMBus mapping register) */ >- { 0x02001166, PCI_QUIRK_MAP_REG, 0x90, 0 }, >+ { 0x02001166, PCI_QUIRK_MAP_REG, 0x90, 0, NULL }, >+ >+ /* The ASUS P4B-motherboards needs a hack to enable the Intel 801SMBus */ >+ { 0x24408086, PCI_QUIRK_FIXUP_ROUTINE, 0, 0, &pci_fix_asus_smbus }, >+ { 0x24C08086, PCI_QUIRK_FIXUP_ROUTINE, 0, 0, &pci_fix_asus_smbus }, > > /* > * MSI doesn't work with the ServerWorks CNB20-HE Host Bridge >@@ -395,6 +404,26 @@ > cfg->hdrtype = 1; > } > >+/* asus p4b/p4pe hack */ >+static void >+pci_fix_asus_smbus(device_t dev) >+{ >+ int pmccfg; >+ >+ /* read subsystem vendor-id */ >+ pmccfg = pci_read_config(dev, 0xF2, 2); >+ printf(" [-] pmccfg: %.4x\n",pmccfg); >+ if( pmccfg & 0x8 ){ >+ pmccfg &= ~0x8; >+ pci_write_config(dev, 0xF2, pmccfg, 2); >+ pmccfg = pci_read_config(dev, 0xF2, 2); >+ if( pmccfg & 0x8 ) >+ printf("Could not enable Intel 801SMBus!\n"); >+ else >+ printf("Enabled Intel 801SMBus\n"); >+ } >+} >+ > /* extract header type specific config data */ > > static void >@@ -2555,10 +2584,12 @@ > * Add additional, quirked resources. > */ > for (q = &pci_quirks[0]; q->devid; q++) { >- if (q->devid == ((cfg->device << 16) | cfg->vendor) >- && q->type == PCI_QUIRK_MAP_REG) >- pci_add_map(pcib, bus, dev, b, s, f, q->arg1, rl, >- force, 0); >+ if (q->devid == ((cfg->device << 16) | cfg->vendor) ){ >+ if( q->type == PCI_QUIRK_MAP_REG ) >+ pci_add_map(pcib, bus, dev, b, s, f, q->arg1, rl, force, 0); >+ else if( q->type == PCI_QUIRK_FIXUP_ROUTINE ) >+ q->fixup_func(dev); >+ } > } > > if (cfg->intpin > 0 && PCI_INTERRUPT_VALID(cfg->intline)) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139743
: 100459 |
144548
|
161560
|
176126
|
184971
|
194974
|
201473
|
227466
|
235345
|
242021