nouveau: Copy the PPC bios to RAMIN on init, that lets us do proper output detection...
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>
Thu, 15 Nov 2007 02:43:22 +0000 (03:43 +0100)
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>
Thu, 15 Nov 2007 02:44:01 +0000 (03:44 +0100)
shared-core/nouveau_state.c

index 35042cd..57ae924 100644 (file)
@@ -285,6 +285,9 @@ nouveau_card_init(struct drm_device *dev)
        struct drm_nouveau_private *dev_priv = dev->dev_private;
        struct nouveau_engine *engine;
        int ret;
+#if defined(__powerpc__)
+       struct device_node *dn;
+#endif
 
        DRM_DEBUG("prev state = %d\n", dev_priv->init_state);
 
@@ -304,6 +307,22 @@ nouveau_card_init(struct drm_device *dev)
        DRM_MEMORYBARRIER();
 #endif
 
+#if defined(__powerpc__)
+       /* if we have an OF card, copy vbios to RAMIN */
+       dn = pci_device_to_OF_node(dev->pdev);
+       if (dn)
+       {
+               int size; 
+               const uint32_t *bios = of_get_property(dn, "NVDA,BMP", &size);
+               if (bios)
+               {
+                       int i;
+                       for(i=0;i<size;i+=4)
+                               NV_WI32(i, bios[i/4]);
+               }
+       }
+#endif
+
        /* Determine exact chipset we're running on */
        if (dev_priv->card_type < NV_10)
                dev_priv->chipset = dev_priv->card_type;