mesa-drm/shared-core/nv04_mc.c
Stuart Bennett 71adbfc874 [PATCH] nouveau: reset AGP on init for < nv40
This is necessary for AGP to work after running bios init scripts on nv3x, and
is seen in mmio traces of all cards (nv04-nv4x)

I'm not making the equivalent change to nv40_mc.c, as early cards (6200, 6800gt)
use the 0x000018XX PBUS and later cards use the 0x000880XX PBUS and I don't know
the effects of using the wrong one
2008-01-04 05:08:15 +01:00

35 lines
868 B
C

#include "drmP.h"
#include "drm.h"
#include "nouveau_drv.h"
#include "nouveau_drm.h"
int
nv04_mc_init(struct drm_device *dev)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
uint32_t saved_pci_nv_1, saved_pci_nv_19;
saved_pci_nv_1 = NV_READ(NV04_PBUS_PCI_NV_1);
saved_pci_nv_19 = NV_READ(NV04_PBUS_PCI_NV_19);
/* clear busmaster bit */
NV_WRITE(NV04_PBUS_PCI_NV_1, saved_pci_nv_1 & ~(0x00000001 << 2));
/* clear SBA, AGP and FW bits */
NV_WRITE(NV04_PBUS_PCI_NV_19, saved_pci_nv_19 & 0xfffff00f);
/* Power up everything, resetting each individual unit will
* be done later if needed.
*/
NV_WRITE(NV03_PMC_ENABLE, 0xFFFFFFFF);
/* and restore (gives effect of resetting AGP) */
NV_WRITE(NV04_PBUS_PCI_NV_19, saved_pci_nv_19);
NV_WRITE(NV04_PBUS_PCI_NV_1, saved_pci_nv_1);
return 0;
}
void
nv04_mc_takedown(struct drm_device *dev)
{
}