summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>2008-01-07 05:54:05 +0100
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>2008-01-07 05:54:37 +0100
commitde522ae742bd058780135eb21fe287e9a9dc263a (patch)
tree73469afa5ec0532fbe5c1fe6e49b623051f284b2
parentbd5d760a105e0a7aec00791d397511a0f7bc27ea (diff)
Nouveau: move PPC bios copy to firstopen.
-rw-r--r--shared-core/nouveau_state.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c
index 16c86494..0695754b 100644
--- a/shared-core/nouveau_state.c
+++ b/shared-core/nouveau_state.c
@@ -287,5 +287,2 @@ nouveau_card_init(struct drm_device *dev)
int ret;
-#if defined(__powerpc__)
- struct device_node *dn;
-#endif
@@ -297,39 +294,2 @@ nouveau_card_init(struct drm_device *dev)
- /* Map any PCI resources we need on the card */
- ret = nouveau_init_card_mappings(dev);
- if (ret) return ret;
-
-#if defined(__powerpc__)
- /* Put the card in BE mode if it's not */
- if (NV_READ(NV03_PMC_BOOT_1))
- NV_WRITE(NV03_PMC_BOOT_1,0x00000001);
-
- DRM_MEMORYBARRIER();
-#endif
-
-#if defined(__linux__) && defined(__powerpc__)
- /* if we have an OF card, copy vbios to RAMIN */
- dn = pci_device_to_OF_node(dev->pdev);
- if (dn)
- {
- int size;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
- const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size);
-#else
- const uint32_t *bios = get_property(dn, "NVDA,BMP", &size);
-#endif
- if (bios)
- {
- int i;
- for(i=0;i<size;i+=4)
- NV_WI32(i, bios[i/4]);
- DRM_INFO("OF bios successfully copied (%d bytes)\n",size);
- }
- else
- DRM_INFO("Unable to get the OF bios\n");
- }
- else
- DRM_INFO("Unable to get the OF node\n");
-#endif
-
/* Determine exact chipset we're running on */
@@ -453,2 +413,42 @@ int nouveau_firstopen(struct drm_device *dev)
{
+#if defined(__powerpc__)
+ struct device_node *dn;
+#endif
+ int ret;
+ /* Map any PCI resources we need on the card */
+ ret = nouveau_init_card_mappings(dev);
+ if (ret) return ret;
+
+#if defined(__powerpc__)
+ /* Put the card in BE mode if it's not */
+ if (NV_READ(NV03_PMC_BOOT_1))
+ NV_WRITE(NV03_PMC_BOOT_1,0x00000001);
+
+ DRM_MEMORYBARRIER();
+#endif
+
+#if defined(__linux__) && defined(__powerpc__)
+ /* if we have an OF card, copy vbios to RAMIN */
+ dn = pci_device_to_OF_node(dev->pdev);
+ if (dn)
+ {
+ int size;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
+ const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size);
+#else
+ const uint32_t *bios = get_property(dn, "NVDA,BMP", &size);
+#endif
+ if (bios)
+ {
+ int i;
+ for(i=0;i<size;i+=4)
+ NV_WI32(i, bios[i/4]);
+ DRM_INFO("OF bios successfully copied (%d bytes)\n",size);
+ }
+ else
+ DRM_INFO("Unable to get the OF bios\n");
+ }
+ else
+ DRM_INFO("Unable to get the OF node\n");
+#endif
return 0;