Commit 391d815f authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k update (part 40)

Sun-3/3x frame buffer device updates
  - Fix breakage from recent fbdev changes
  - Add support for CG3 graphics on Sun-3/3x
parent fb42ac9d
...@@ -108,6 +108,7 @@ if [ "$CONFIG_FB" = "y" ]; then ...@@ -108,6 +108,7 @@ if [ "$CONFIG_FB" = "y" ]; then
bool ' Sun3 framebuffer support' CONFIG_FB_SUN3 bool ' Sun3 framebuffer support' CONFIG_FB_SUN3
if [ "$CONFIG_FB_SUN3" != "n" ]; then if [ "$CONFIG_FB_SUN3" != "n" ]; then
bool ' BWtwo support' CONFIG_FB_BWTWO bool ' BWtwo support' CONFIG_FB_BWTWO
bool ' CGthree support' CONFIG_FB_CGTHREE
bool ' CGsix (GX,TurboGX) support' CONFIG_FB_CGSIX bool ' CGsix (GX,TurboGX) support' CONFIG_FB_CGSIX
fi fi
fi fi
......
...@@ -48,6 +48,13 @@ ...@@ -48,6 +48,13 @@
#ifdef CONFIG_SUN3 #ifdef CONFIG_SUN3
#include <asm/oplib.h> #include <asm/oplib.h>
#include <asm/machines.h>
#include <asm/idprom.h>
#define CGFOUR_OBMEM_ADDR 0x1f300000
#define BWTWO_OBMEM_ADDR 0x1f000000
#define BWTWO_OBMEM50_ADDR 0x00100000
#endif #endif
#ifdef CONFIG_SUN3X #ifdef CONFIG_SUN3X
#include <asm/sun3x.h> #include <asm/sun3x.h>
...@@ -59,12 +66,14 @@ ...@@ -59,12 +66,14 @@
#define CURSOR_SHAPE 1 #define CURSOR_SHAPE 1
#define CURSOR_BLINK 2 #define CURSOR_BLINK 2
#define mymemset(x,y) memset(x,0,y)
/* /*
* Interface used by the world * Interface used by the world
*/ */
int sun3fb_init(void); int sun3fb_init(void);
int sun3fb_setup(char *options); void sun3fb_setup(char *options);
static char fontname[40] __initdata = { 0 }; static char fontname[40] __initdata = { 0 };
static int curblink __initdata = 1; static int curblink __initdata = 1;
...@@ -114,6 +123,8 @@ static void sun3fb_clear_margin(struct display *p, int s) ...@@ -114,6 +123,8 @@ static void sun3fb_clear_margin(struct display *p, int s)
{ {
struct fb_info_sbusfb *fb = sbusfbinfod(p); struct fb_info_sbusfb *fb = sbusfbinfod(p);
return;
if (fb->switch_from_graph) if (fb->switch_from_graph)
(*fb->switch_from_graph)(fb); (*fb->switch_from_graph)(fb);
if (fb->fill) { if (fb->fill) {
...@@ -352,7 +363,7 @@ void __init sun3fb_setup(char *options) ...@@ -352,7 +363,7 @@ void __init sun3fb_setup(char *options)
p++; p++;
} }
return 0; return;
} }
static int sun3fbcon_switch(int con, struct fb_info *info) static int sun3fbcon_switch(int con, struct fb_info *info)
...@@ -408,6 +419,7 @@ static int sun3fb_blank(int blank, struct fb_info *info) ...@@ -408,6 +419,7 @@ static int sun3fb_blank(int blank, struct fb_info *info)
return fb->blank(fb); return fb->blank(fb);
else if (!blank && fb->unblank) else if (!blank && fb->unblank)
return fb->unblank(fb); return fb->unblank(fb);
return 0;
} }
/* /*
...@@ -505,7 +517,7 @@ void sun3fb_palette(int enter) ...@@ -505,7 +517,7 @@ void sun3fb_palette(int enter)
*/ */
static int __init sun3fb_init_fb(int fbtype, unsigned long addr) static int __init sun3fb_init_fb(int fbtype, unsigned long addr)
{ {
static struct linux_sbus_device sdb; static struct sbus_dev sdb;
struct fb_fix_screeninfo *fix; struct fb_fix_screeninfo *fix;
struct fb_var_screeninfo *var; struct fb_var_screeninfo *var;
struct display *disp; struct display *disp;
...@@ -535,9 +547,11 @@ static int __init sun3fb_init_fb(int fbtype, unsigned long addr) ...@@ -535,9 +547,11 @@ static int __init sun3fb_init_fb(int fbtype, unsigned long addr)
type->fb_depth = depth = (fbtype == FBTYPE_SUN2BW) ? 1 : 8; type->fb_depth = depth = (fbtype == FBTYPE_SUN2BW) ? 1 : 8;
linebytes = w * depth / 8; linebytes = w * depth / 8;
type->fb_size = PAGE_ALIGN((linebytes) * h); type->fb_size = PAGE_ALIGN((linebytes) * h);
/*
fb->x_margin = (w & 7) / 2; fb->x_margin = (w & 7) / 2;
fb->y_margin = (h & 15) / 2; fb->y_margin = (h & 15) / 2;
*/
fb->x_margin = fb->y_margin = 0;
var->xres_virtual = w; var->xres_virtual = w;
var->yres_virtual = h; var->yres_virtual = h;
...@@ -581,9 +595,15 @@ static int __init sun3fb_init_fb(int fbtype, unsigned long addr) ...@@ -581,9 +595,15 @@ static int __init sun3fb_init_fb(int fbtype, unsigned long addr)
#ifdef CONFIG_FB_BWTWO #ifdef CONFIG_FB_BWTWO
case FBTYPE_SUN2BW: case FBTYPE_SUN2BW:
p = bwtwofb_init(fb); break; p = bwtwofb_init(fb); break;
#endif
#ifdef CONFIG_FB_CGTHREE
case FBTYPE_SUN4COLOR:
case FBTYPE_SUN3COLOR:
type->fb_size = 0x100000;
p = cgthreefb_init(fb); break;
#endif #endif
} }
fix->smem_start = fb->info.screen_base; fix->smem_start = (unsigned long)fb->info.screen_base; // FIXME
if (!p) { if (!p) {
kfree(fb); kfree(fb);
...@@ -638,17 +658,25 @@ int __init sun3fb_init(void) ...@@ -638,17 +658,25 @@ int __init sun3fb_init(void)
unsigned long addr; unsigned long addr;
char p4id; char p4id;
if (!con_is_present()) return; if (!con_is_present()) return -ENODEV;
printk("sun3fb_init()\n");
#ifdef CONFIG_SUN3 #ifdef CONFIG_SUN3
addr = 0xfe20000;
switch(*(romvec->pv_fbtype)) switch(*(romvec->pv_fbtype))
{ {
case FBTYPE_SUN2BW: case FBTYPE_SUN2BW:
addr = 0xfe20000;
return sun3fb_init_fb(FBTYPE_SUN2BW, addr); return sun3fb_init_fb(FBTYPE_SUN2BW, addr);
case FBTYPE_SUN3COLOR: case FBTYPE_SUN3COLOR:
printk("cg3 detected but not supported\n"); case FBTYPE_SUN4COLOR:
return -EINVAL; if(idprom->id_machtype != (SM_SUN3|SM_3_60)) {
printk("sun3fb: cgthree/four only supported on 3/60\n");
return -ENODEV;
}
addr = CGFOUR_OBMEM_ADDR;
return sun3fb_init_fb(*(romvec->pv_fbtype), addr);
default:
printk("sun3fb: unsupported framebuffer\n");
return -ENODEV;
} }
#else #else
addr = SUN3X_VIDEO_BASE; addr = SUN3X_VIDEO_BASE;
...@@ -660,16 +688,18 @@ int __init sun3fb_init(void) ...@@ -660,16 +688,18 @@ int __init sun3fb_init(void)
return sun3fb_init_fb(FBTYPE_SUN2BW, addr); return sun3fb_init_fb(FBTYPE_SUN2BW, addr);
#if 0 /* not yet */ #if 0 /* not yet */
case 0x40: case 0x40:
sun3fb_init_fb(FBTYPE_SUN4COLOR, addr); return sun3fb_init_fb(FBTYPE_SUN4COLOR, addr);
break; break;
case 0x45: case 0x45:
sun3fb_init_fb(FBTYPE_SUN8COLOR, addr); return sun3fb_init_fb(FBTYPE_SUN8COLOR, addr);
break; break;
#endif #endif
case 0x60: case 0x60:
return sun3fb_init_fb(FBTYPE_SUNFAST_COLOR, addr); return sun3fb_init_fb(FBTYPE_SUNFAST_COLOR, addr);
} }
#endif #endif
return -ENODEV;
} }
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment