FreeBSD Bugzilla – Attachment 37655 Details for
Bug 59854
[agp] [panic] System panics when AMD 762 AGP is loaded
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
agp-amd.diff
agp-amd.diff (text/x-patch), 1.54 KB, created by
Eric Anholt
on 2004-08-21 09:02:02 UTC
(
hide
)
Description:
agp-amd.diff
Filename:
MIME Type:
Creator:
Eric Anholt
Created:
2004-08-21 09:02:02 UTC
Size:
1.54 KB
patch
obsolete
>Index: agp_amd.c >=================================================================== >RCS file: /home/ncvs/src/sys/pci/agp_amd.c,v >retrieving revision 1.21 >diff -u -u -r1.21 agp_amd.c >--- agp_amd.c 16 Aug 2004 12:23:53 -0000 1.21 >+++ agp_amd.c 21 Aug 2004 07:48:31 -0000 >@@ -269,6 +269,12 @@ > /* Enable the TLB and flush */ > WRITE2(AGP_AMD751_STATUS, > READ2(AGP_AMD751_STATUS) | AGP_AMD751_STATUS_GCE); >+ >+ /* Setting bit 0 is required for the size to be valid. */ >+ pci_write_config(dev, >+ AGP_AMD751_APCTRL, >+ pci_read_config(dev, AGP_AMD751_APCTRL, 1) | 1, 1); >+ > AGP_FLUSH_TLB(dev); > > return 0; >@@ -313,7 +319,7 @@ > /* > * The aperture size is equal to 32M<<vas. > */ >- vas = (pci_read_config(dev, AGP_AMD751_APCTRL, 1) & 0x06) >> 1; >+ vas = (pci_read_config(dev, AGP_AMD751_APCTRL, 1) & 0x0e) >> 1; > return (32*1024*1024) << vas; > } > >@@ -321,6 +327,7 @@ > agp_amd_set_aperture(device_t dev, u_int32_t aperture) > { > int vas; >+ u_int32_t apctrl; > > /* > * Check for a power of two and make sure its within the >@@ -331,15 +338,15 @@ > || aperture > 2U*1024*1024*1024) > return EINVAL; > >- vas = ffs(aperture / 32*1024*1024) - 1; >+ vas = ffs(aperture / (32*1024*1024)) - 1; > > /* > * While the size register is bits 1-3 of APCTRL, bit 0 must be > * set for the size value to be 'valid' > */ >+ apctrl = pci_read_config(dev, AGP_AMD751_APCTRL, 1); > pci_write_config(dev, AGP_AMD751_APCTRL, >- (((pci_read_config(dev, AGP_AMD751_APCTRL, 1) & ~0x06) >- | ((vas << 1) | 1))), 1); >+ (apctrl & ~0x0e) | (vas << 1) | 1, 1); > > return 0; > }
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 59854
: 37655