]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/video/offb.c
xen: Enable console tty by default in domU if it's not a dummy
[linux-2.6-omap-h63xx.git] / drivers / video / offb.c
index 3cf603c0127f9b2af92a7efae3642212a12b1c97..d7b3dcc0dc4388bb18d2614bd17efe4d9c2ea69e 100644 (file)
@@ -248,7 +248,7 @@ static void __iomem *offb_map_reg(struct device_node *np, int index,
 static void __init offb_init_fb(const char *name, const char *full_name,
                                int width, int height, int depth,
                                int pitch, unsigned long address,
-                               struct device_node *dp)
+                               int foreign_endian, struct device_node *dp)
 {
        unsigned long res_size = pitch * height * (depth + 7) / 8;
        struct offb_par *par = &default_par;
@@ -271,7 +271,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                return;
        }
 
-       size = sizeof(struct fb_info) + sizeof(u32) * 17;
+       size = sizeof(struct fb_info) + sizeof(u32) * 16;
 
        info = kmalloc(size, GFP_ATOMIC);
        
@@ -322,8 +322,8 @@ static void __init offb_init_fb(const char *name, const char *full_name,
                            ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
                        par->cmap_data = par->cmap_adr + 1;
                        par->cmap_type = cmap_m64;
-               } else if (dp && (device_is_compatible(dp, "pci1014,b7") ||
-                                 device_is_compatible(dp, "pci1014,21c"))) {
+               } else if (dp && (of_device_is_compatible(dp, "pci1014,b7") ||
+                                 of_device_is_compatible(dp, "pci1014,21c"))) {
                        par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
                        if (par->cmap_adr)
                                par->cmap_type = cmap_gxt2000;
@@ -397,7 +397,7 @@ static void __init offb_init_fb(const char *name, const char *full_name,
        info->screen_base = ioremap(address, fix->smem_len);
        info->par = par;
        info->pseudo_palette = (void *) (info + 1);
-       info->flags = FBINFO_DEFAULT;
+       info->flags = FBINFO_DEFAULT | foreign_endian;
 
        fb_alloc_cmap(&info->cmap, 256, 0);
 
@@ -424,6 +424,15 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
        u64 rstart, address = OF_BAD_ADDR;
        const u32 *pp, *addrp, *up;
        u64 asize;
+       int foreign_endian = 0;
+
+#ifdef __BIG_ENDIAN
+       if (of_get_property(dp, "little-endian", NULL))
+               foreign_endian = FBINFO_FOREIGN_ENDIAN;
+#else
+       if (of_get_property(dp, "big-endian", NULL))
+               foreign_endian = FBINFO_FOREIGN_ENDIAN;
+#endif
 
        pp = of_get_property(dp, "linux,bootx-depth", &len);
        if (pp == NULL)
@@ -509,7 +518,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
                offb_init_fb(no_real_node ? "bootx" : dp->name,
                             no_real_node ? "display" : dp->full_name,
                             width, height, depth, pitch, address,
-                            no_real_node ? NULL : dp);
+                            foreign_endian, no_real_node ? NULL : dp);
        }
 }