19 #include <asm/div64.h>
20 #include <asm/delay.h>
27 static u8 gx1_read_conf_reg(
u8 reg)
43 spin_unlock_irqrestore(&gx1_conf_reg_lock, flags);
50 return (gx1_read_conf_reg(
CONFIG_GCR) & 0x03) << 30;
58 unsigned dram_size = 0, fb_base;
68 for (d = 0; d < 2; d++) {
78 return dram_size - fb_base;
84 u32 gcfg, tcfg, ocfg, dclk_div,
val;
85 int hactive, hblankstart, hsyncstart, hsyncend, hblankend, htotal;
86 int vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal;
139 writel(((info->
var.xres * info->
var.bits_per_pixel/8) >> 3) + 2,
151 hactive = info->
var.xres;
152 hblankstart = hactive;
153 hsyncstart = hblankstart + info->
var.right_margin;
154 hsyncend = hsyncstart + info->
var.hsync_len;
155 hblankend = hsyncend + info->
var.left_margin;
158 vactive = info->
var.yres;
159 vblankstart = vactive;
160 vsyncstart = vblankstart + info->
var.lower_margin;
161 vsyncend = vsyncstart + info->
var.vsync_len;
162 vblankend = vsyncend + info->
var.upper_margin;
165 val = (hactive - 1) | ((htotal - 1) << 16);
167 val = (hblankstart - 1) | ((hblankend - 1) << 16);
169 val = (hsyncstart - 1) | ((hsyncend - 1) << 16);
172 val = (vactive - 1) | ((vtotal - 1) << 16);
174 val = (vblankstart - 1) | ((vblankend - 1) << 16);
176 val = (vsyncstart - 1) | ((vsyncend - 1) << 16);
178 val = (vsyncstart - 2) | ((vsyncend - 2) << 16);
187 par->
vid_ops->configure_display(info);
196 static void gx1_set_hw_palette_reg(
struct fb_info *info,
unsigned regno,
203 val = (red << 2) & 0x3f000;
204 val |= (green >> 4) & 0x00fc0;
205 val |= (blue >> 10) & 0x0003f;
212 .set_mode = gx1_set_mode,
213 .set_palette_reg = gx1_set_hw_palette_reg,