I really screwed up that merge somehow
[profile/ivi/libdrm.git] / shared-core / nv04_mc.c
1 #include "drmP.h"
2 #include "drm.h"
3 #include "nouveau_drv.h"
4 #include "nouveau_drm.h"
5
6 int
7 nv04_mc_init(struct drm_device *dev)
8 {
9         struct drm_nouveau_private *dev_priv = dev->dev_private;
10         uint32_t saved_pci_nv_1, saved_pci_nv_19;
11
12         saved_pci_nv_1 = NV_READ(NV04_PBUS_PCI_NV_1);
13         saved_pci_nv_19 = NV_READ(NV04_PBUS_PCI_NV_19);
14
15         /* clear busmaster bit */
16         NV_WRITE(NV04_PBUS_PCI_NV_1, saved_pci_nv_1 & ~(0x00000001 << 2));
17         /* clear SBA and AGP bits */
18         NV_WRITE(NV04_PBUS_PCI_NV_19, saved_pci_nv_19 & 0xfffff0ff);
19
20         /* Power up everything, resetting each individual unit will
21          * be done later if needed.
22          */
23         NV_WRITE(NV03_PMC_ENABLE, 0xFFFFFFFF);
24
25         /* and restore (gives effect of resetting AGP) */
26         NV_WRITE(NV04_PBUS_PCI_NV_19, saved_pci_nv_19);
27         NV_WRITE(NV04_PBUS_PCI_NV_1, saved_pci_nv_1);
28
29         return 0;
30 }
31
32 void
33 nv04_mc_takedown(struct drm_device *dev)
34 {
35 }