[BNX2]: Enable DMA on 5709.
[safe/jmp/linux-2.6] / drivers / video / cyber2000fb.c
index 8b1b7c6..7a6eeda 100644 (file)
  * (which, incidentally, is about the same saving as a 2.5in hard disk
  * entering standby mode.)
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/mm.h>
-#include <linux/tty.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/fb.h>
@@ -50,7 +48,6 @@
 #include <linux/init.h>
 
 #include <asm/io.h>
-#include <asm/irq.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -90,6 +87,8 @@ struct cfb_info {
         */
        u_char                  ramdac_ctrl;
        u_char                  ramdac_powerdown;
+
+       u32                     pseudo_palette[16];
 };
 
 static char *default_font = "Acorn8x8";
@@ -1062,7 +1061,6 @@ static struct fb_ops cyber2000fb_ops = {
        .fb_fillrect    = cyber2000fb_fillrect,
        .fb_copyarea    = cyber2000fb_copyarea,
        .fb_imageblit   = cyber2000fb_imageblit,
-       .fb_cursor      = soft_cursor,
        .fb_sync        = cyber2000fb_sync,
 };
 
@@ -1223,9 +1221,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
 {
        struct cfb_info *cfb;
 
-       cfb = kmalloc(sizeof(struct cfb_info) +
-                      sizeof(u32) * 16, GFP_KERNEL);
-
+       cfb = kmalloc(sizeof(struct cfb_info), GFP_KERNEL);
        if (!cfb)
                return NULL;
 
@@ -1281,7 +1277,7 @@ cyberpro_alloc_fb_info(unsigned int id, char *name)
 
        cfb->fb.fbops           = &cyber2000fb_ops;
        cfb->fb.flags           = FBINFO_DEFAULT | FBINFO_HWACCEL_YPAN;
-       cfb->fb.pseudo_palette  = (void *)(cfb + 1);
+       cfb->fb.pseudo_palette  = cfb->pseudo_palette;
 
        fb_alloc_cmap(&cfb->fb.cmap, NR_PALETTE, 0);
 
@@ -1513,7 +1509,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
         * I/O cycles storing into a reserved memory space at
         * physical address 0x3000000
         */
-       unsigned char *iop;
+       unsigned char __iomem *iop;
 
        iop = ioremap(0x3000000, 0x5000);
        if (iop == NULL) {
@@ -1527,7 +1523,7 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
        writeb(EXT_BIU_MISC, iop + 0x3ce);
        writeb(EXT_BIU_MISC_LIN_ENABLE, iop + 0x3cf);
 
-       iounmap((void *)iop);
+       iounmap(iop);
 #else
        /*
         * Most other machine types are "normal", so
@@ -1543,16 +1539,21 @@ static int cyberpro_pci_enable_mmio(struct cfb_info *cfb)
        /*
         * Allow the CyberPro to accept PCI burst accesses
         */
-       val = cyber2000_grphr(EXT_BUS_CTL, cfb);
-       if (!(val & EXT_BUS_CTL_PCIBURST_WRITE)) {
-               printk(KERN_INFO "%s: enabling PCI bursts\n", cfb->fb.fix.id);
+       if (cfb->id == ID_CYBERPRO_2010) {
+               printk(KERN_INFO "%s: NOT enabling PCI bursts\n", cfb->fb.fix.id);
+       } else {
+               val = cyber2000_grphr(EXT_BUS_CTL, cfb);
+               if (!(val & EXT_BUS_CTL_PCIBURST_WRITE)) {
+                       printk(KERN_INFO "%s: enabling PCI bursts\n",
+                               cfb->fb.fix.id);
 
-               val |= EXT_BUS_CTL_PCIBURST_WRITE;
+                       val |= EXT_BUS_CTL_PCIBURST_WRITE;
 
-               if (cfb->id == ID_CYBERPRO_5000)
-                       val |= EXT_BUS_CTL_PCIBURST_READ;
+                       if (cfb->id == ID_CYBERPRO_5000)
+                               val |= EXT_BUS_CTL_PCIBURST_READ;
 
-               cyber2000_grphw(EXT_BUS_CTL, val, cfb);
+                       cyber2000_grphw(EXT_BUS_CTL, val, cfb);
+               }
        }
 
        return 0;