17 #include <linux/module.h>
19 #include <linux/kernel.h>
20 #include <linux/errno.h>
21 #include <linux/string.h>
34 #define G364_MEM_BASE 0xe4400000
35 #define G364_PORT_BASE 0xe4000000
36 #define ID_REG 0xe4000000
37 #define BOOT_REG 0xe4080000
38 #define TIMING_REG 0xe4080108
39 #define DISPLAY_REG 0xe4080118
40 #define VDISPLAY_REG 0xe4080150
41 #define MASK_REG 0xe4080200
42 #define CTLA_REG 0xe4080300
43 #define CURS_TOGGLE 0x800000
44 #define BIT_PER_PIX 0x700000
45 #define DELAY_SAMPLE 0x080000
46 #define PORT_INTER 0x040000
47 #define PIX_PIPE_DEL 0x030000
48 #define PIX_PIPE_DEL2 0x008000
49 #define TR_CYCLE_TOG 0x004000
50 #define VRAM_ADR_INC 0x003000
51 #define BLANK_OFF 0x000800
52 #define FORCE_BLANK 0x000400
53 #define BLK_FUN_SWTCH 0x000200
54 #define BLANK_IO 0x000100
55 #define BLANK_LEVEL 0x000080
56 #define A_VID_FORM 0x000040
57 #define D_SYNC_FORM 0x000020
58 #define FRAME_FLY_PAT 0x000010
59 #define OP_MODE 0x000008
60 #define INTL_STAND 0x000004
61 #define SCRN_FORM 0x000002
62 #define ENABLE_VTG 0x000001
63 #define TOP_REG 0xe4080400
64 #define CURS_PAL_REG 0xe4080508
65 #define CHKSUM_REG 0xe4080600
66 #define CURS_POS_REG 0xe4080638
67 #define CLR_PAL_REG 0xe4080800
68 #define CURS_PAT_REG 0xe4081000
69 #define MON_ID_REG 0xe4100000
70 #define RESET_REG 0xe4180000
76 .smem_start = 0x40000000,
112 static int g364fb_blank(
int blank,
struct fb_info *
info);
114 static struct fb_ops g364fb_ops = {
116 .fb_setcolreg = g364fb_setcolreg,
117 .fb_pan_display = g364fb_pan_display,
118 .fb_blank = g364fb_blank,
122 .fb_cursor = g364fb_cursor,
137 ((
x * fontwidth(
p)) << 12) | ((
y * fontheight(
p)) -
163 static int g364fb_blank(
int blank,
struct fb_info *info)
178 volatile unsigned int *
ptr = (
volatile unsigned int *)
CLR_PAL_REG;
187 ptr[regno << 1] = (red << 16) | (green << 8) |
blue;
197 volatile unsigned int *pal_ptr =
199 volatile unsigned int *curs_pal_ptr =
211 (*((
volatile unsigned int *)
DISPLAY_REG) & 0x00ffffff) * 4;
213 (*((
volatile unsigned int *)
VDISPLAY_REG) & 0x00ffffff) / 2;
217 curs_pal_ptr[0] |= 0x00ffffff;
218 curs_pal_ptr[2] |= 0x00ffffff;
219 curs_pal_ptr[4] |= 0x00ffffff;
224 for (i = 0; i < 512; i++)
233 fb_var.xres_virtual = fbvar.xres;
234 fb_fix.line_length = (xres / 8) * fb_var.bits_per_pixel;
235 fb_fix.smem_start = 0x40000000;
238 fb_fix.smem_len = (1 << (mem * 2)) * 512 * 1024;
239 fb_var.yres_virtual = fb_fix.smem_len / fb_var.xres;