Lines Matching +full:ati +full:- +full:base
2 * linux/drivers/video/offb.c -- Open Firmware based frame buffer device
40 cmap_simple, /* ATI Mach64 */
41 cmap_r128, /* ATI Rage128 */
42 cmap_M3A, /* ATI Rage Mobility M3 Head A */
43 cmap_M3B, /* ATI Rage Mobility M3 Head B */
44 cmap_radeon, /* ATI Radeon */
46 cmap_avivo, /* ATI R5xx */
99 struct offb_par *par = (struct offb_par *) info->par; in offb_setcolreg()
101 if (info->fix.visual == FB_VISUAL_TRUECOLOR) { in offb_setcolreg()
102 u32 *pal = info->pseudo_palette; in offb_setcolreg()
103 u32 cr = red >> (16 - info->var.red.length); in offb_setcolreg()
104 u32 cg = green >> (16 - info->var.green.length); in offb_setcolreg()
105 u32 cb = blue >> (16 - info->var.blue.length); in offb_setcolreg()
109 return -EINVAL; in offb_setcolreg()
111 value = (cr << info->var.red.offset) | in offb_setcolreg()
112 (cg << info->var.green.offset) | in offb_setcolreg()
113 (cb << info->var.blue.offset); in offb_setcolreg()
114 if (info->var.transp.length > 0) { in offb_setcolreg()
115 u32 mask = (1 << info->var.transp.length) - 1; in offb_setcolreg()
116 mask <<= info->var.transp.offset; in offb_setcolreg()
124 return -EINVAL; in offb_setcolreg()
130 if (!par->cmap_adr) in offb_setcolreg()
133 switch (par->cmap_type) { in offb_setcolreg()
135 writeb(regno, par->cmap_adr); in offb_setcolreg()
136 writeb(red, par->cmap_data); in offb_setcolreg()
137 writeb(green, par->cmap_data); in offb_setcolreg()
138 writeb(blue, par->cmap_data); in offb_setcolreg()
142 out_le32(par->cmap_adr + 0x58, in offb_setcolreg()
143 in_le32(par->cmap_adr + 0x58) & ~0x20); in offb_setcolreg()
147 out_8(par->cmap_adr + 0xb0, regno); in offb_setcolreg()
148 out_le32(par->cmap_adr + 0xb4, in offb_setcolreg()
153 out_le32(par->cmap_adr + 0x58, in offb_setcolreg()
154 in_le32(par->cmap_adr + 0x58) | 0x20); in offb_setcolreg()
156 out_8(par->cmap_adr + 0xb0, regno); in offb_setcolreg()
157 out_le32(par->cmap_adr + 0xb4, (red << 16 | green << 8 | blue)); in offb_setcolreg()
161 out_8(par->cmap_adr + 0xb0, regno); in offb_setcolreg()
162 out_le32(par->cmap_adr + 0xb4, (red << 16 | green << 8 | blue)); in offb_setcolreg()
165 out_le32(((unsigned __iomem *) par->cmap_adr) + regno, in offb_setcolreg()
170 writel(1, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); in offb_setcolreg()
171 writeb(regno, par->cmap_adr + AVIVO_DC_LUT_RW_INDEX); in offb_setcolreg()
173 par->cmap_adr + AVIVO_DC_LUT_30_COLOR); in offb_setcolreg()
174 writel(0, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); in offb_setcolreg()
175 writeb(regno, par->cmap_adr + AVIVO_DC_LUT_RW_INDEX); in offb_setcolreg()
177 par->cmap_adr + AVIVO_DC_LUT_30_COLOR); in offb_setcolreg()
190 struct offb_par *par = (struct offb_par *) info->par; in offb_blank()
193 if (!par->cmap_adr) in offb_blank()
196 if (!par->blanked) in offb_blank()
200 par->blanked = blank; in offb_blank()
204 switch (par->cmap_type) { in offb_blank()
206 writeb(i, par->cmap_adr); in offb_blank()
208 writeb(0, par->cmap_data); in offb_blank()
212 out_le32(par->cmap_adr + 0x58, in offb_blank()
213 in_le32(par->cmap_adr + 0x58) & ~0x20); in offb_blank()
217 out_8(par->cmap_adr + 0xb0, i); in offb_blank()
218 out_le32(par->cmap_adr + 0xb4, 0); in offb_blank()
222 out_le32(par->cmap_adr + 0x58, in offb_blank()
223 in_le32(par->cmap_adr + 0x58) | 0x20); in offb_blank()
225 out_8(par->cmap_adr + 0xb0, i); in offb_blank()
226 out_le32(par->cmap_adr + 0xb4, 0); in offb_blank()
229 out_8(par->cmap_adr + 0xb0, i); in offb_blank()
230 out_le32(par->cmap_adr + 0xb4, 0); in offb_blank()
233 out_le32(((unsigned __iomem *) par->cmap_adr) + i, in offb_blank()
237 writel(1, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); in offb_blank()
238 writeb(i, par->cmap_adr + AVIVO_DC_LUT_RW_INDEX); in offb_blank()
239 writel(0, par->cmap_adr + AVIVO_DC_LUT_30_COLOR); in offb_blank()
240 writel(0, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); in offb_blank()
241 writeb(i, par->cmap_adr + AVIVO_DC_LUT_RW_INDEX); in offb_blank()
242 writel(0, par->cmap_adr + AVIVO_DC_LUT_30_COLOR); in offb_blank()
246 fb_set_cmap(&info->cmap, info); in offb_blank()
252 struct offb_par *par = (struct offb_par *) info->par; in offb_set_par()
255 if (par->cmap_type == cmap_avivo) { in offb_set_par()
256 writel(0, par->cmap_adr + AVIVO_DC_LUTA_CONTROL); in offb_set_par()
257 writel(0, par->cmap_adr + AVIVO_DC_LUTA_BLACK_OFFSET_BLUE); in offb_set_par()
258 writel(0, par->cmap_adr + AVIVO_DC_LUTA_BLACK_OFFSET_GREEN); in offb_set_par()
259 writel(0, par->cmap_adr + AVIVO_DC_LUTA_BLACK_OFFSET_RED); in offb_set_par()
260 writel(0x0000ffff, par->cmap_adr + AVIVO_DC_LUTA_WHITE_OFFSET_BLUE); in offb_set_par()
261 writel(0x0000ffff, par->cmap_adr + AVIVO_DC_LUTA_WHITE_OFFSET_GREEN); in offb_set_par()
262 writel(0x0000ffff, par->cmap_adr + AVIVO_DC_LUTA_WHITE_OFFSET_RED); in offb_set_par()
263 writel(0, par->cmap_adr + AVIVO_DC_LUTB_CONTROL); in offb_set_par()
264 writel(0, par->cmap_adr + AVIVO_DC_LUTB_BLACK_OFFSET_BLUE); in offb_set_par()
265 writel(0, par->cmap_adr + AVIVO_DC_LUTB_BLACK_OFFSET_GREEN); in offb_set_par()
266 writel(0, par->cmap_adr + AVIVO_DC_LUTB_BLACK_OFFSET_RED); in offb_set_par()
267 writel(0x0000ffff, par->cmap_adr + AVIVO_DC_LUTB_WHITE_OFFSET_BLUE); in offb_set_par()
268 writel(0x0000ffff, par->cmap_adr + AVIVO_DC_LUTB_WHITE_OFFSET_GREEN); in offb_set_par()
269 writel(0x0000ffff, par->cmap_adr + AVIVO_DC_LUTB_WHITE_OFFSET_RED); in offb_set_par()
270 writel(1, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); in offb_set_par()
271 writel(0, par->cmap_adr + AVIVO_DC_LUT_RW_MODE); in offb_set_par()
272 writel(0x0000003f, par->cmap_adr + AVIVO_DC_LUT_WRITE_EN_MASK); in offb_set_par()
273 writel(0, par->cmap_adr + AVIVO_DC_LUT_RW_SELECT); in offb_set_par()
274 writel(0, par->cmap_adr + AVIVO_DC_LUT_RW_MODE); in offb_set_par()
275 writel(0x0000003f, par->cmap_adr + AVIVO_DC_LUT_WRITE_EN_MASK); in offb_set_par()
282 if (info->screen_base) in offb_destroy()
283 iounmap(info->screen_base); in offb_destroy()
284 release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size); in offb_destroy()
285 fb_dealloc_cmap(&info->cmap); in offb_destroy()
325 struct offb_par *par = (struct offb_par *) info->par; in offb_init_palette_hacks()
328 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); in offb_init_palette_hacks()
329 if (par->cmap_adr) in offb_init_palette_hacks()
330 par->cmap_type = cmap_r128; in offb_init_palette_hacks()
333 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); in offb_init_palette_hacks()
334 if (par->cmap_adr) in offb_init_palette_hacks()
335 par->cmap_type = cmap_M3A; in offb_init_palette_hacks()
337 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff); in offb_init_palette_hacks()
338 if (par->cmap_adr) in offb_init_palette_hacks()
339 par->cmap_type = cmap_M3B; in offb_init_palette_hacks()
341 par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff); in offb_init_palette_hacks()
342 if (par->cmap_adr) in offb_init_palette_hacks()
343 par->cmap_type = cmap_radeon; in offb_init_palette_hacks()
345 unsigned long base = address & 0xff000000UL; in offb_init_palette_hacks() local
346 par->cmap_adr = in offb_init_palette_hacks()
347 ioremap(base + 0x7ff000, 0x1000) + 0xcc0; in offb_init_palette_hacks()
348 par->cmap_data = par->cmap_adr + 1; in offb_init_palette_hacks()
349 par->cmap_type = cmap_simple; in offb_init_palette_hacks()
352 par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000); in offb_init_palette_hacks()
353 if (par->cmap_adr) in offb_init_palette_hacks()
354 par->cmap_type = cmap_gxt2000; in offb_init_palette_hacks()
355 } else if (of_node_name_prefix(dp, "vga,Display-")) { in offb_init_palette_hacks()
359 vid = of_get_property(pciparent, "vendor-id", NULL); in offb_init_palette_hacks()
360 did = of_get_property(pciparent, "device-id", NULL); in offb_init_palette_hacks()
365 par->cmap_adr = offb_map_reg(pciparent, 2, 0, 0x10000); in offb_init_palette_hacks()
366 if (par->cmap_adr) in offb_init_palette_hacks()
367 par->cmap_type = cmap_avivo; in offb_init_palette_hacks()
370 } else if (dp && of_device_is_compatible(dp, "qemu,std-vga")) { in offb_init_palette_hacks()
378 par->cmap_adr = ioremap(io_addr + 0x3c8, 2); in offb_init_palette_hacks()
379 if (par->cmap_adr) { in offb_init_palette_hacks()
380 par->cmap_type = cmap_simple; in offb_init_palette_hacks()
381 par->cmap_data = par->cmap_adr + 1; in offb_init_palette_hacks()
385 info->fix.visual = (par->cmap_type != cmap_unknown) ? in offb_init_palette_hacks()
420 fix = &info->fix; in offb_init_fb()
421 var = &info->var; in offb_init_fb()
422 info->par = par; in offb_init_fb()
425 strcpy(fix->id, "OFfb "); in offb_init_fb()
426 strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb ")); in offb_init_fb()
427 fix->id[sizeof(fix->id) - 1] = '\0'; in offb_init_fb()
429 snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp); in offb_init_fb()
432 var->xres = var->xres_virtual = width; in offb_init_fb()
433 var->yres = var->yres_virtual = height; in offb_init_fb()
434 fix->line_length = pitch; in offb_init_fb()
436 fix->smem_start = address; in offb_init_fb()
437 fix->smem_len = pitch * height; in offb_init_fb()
438 fix->type = FB_TYPE_PACKED_PIXELS; in offb_init_fb()
439 fix->type_aux = 0; in offb_init_fb()
441 par->cmap_type = cmap_unknown; in offb_init_fb()
445 fix->visual = FB_VISUAL_TRUECOLOR; in offb_init_fb()
447 var->xoffset = var->yoffset = 0; in offb_init_fb()
450 var->bits_per_pixel = 8; in offb_init_fb()
451 var->red.offset = 0; in offb_init_fb()
452 var->red.length = 8; in offb_init_fb()
453 var->green.offset = 0; in offb_init_fb()
454 var->green.length = 8; in offb_init_fb()
455 var->blue.offset = 0; in offb_init_fb()
456 var->blue.length = 8; in offb_init_fb()
457 var->transp.offset = 0; in offb_init_fb()
458 var->transp.length = 0; in offb_init_fb()
461 var->bits_per_pixel = 16; in offb_init_fb()
462 var->red.offset = 10; in offb_init_fb()
463 var->red.length = 5; in offb_init_fb()
464 var->green.offset = 5; in offb_init_fb()
465 var->green.length = 5; in offb_init_fb()
466 var->blue.offset = 0; in offb_init_fb()
467 var->blue.length = 5; in offb_init_fb()
468 var->transp.offset = 0; in offb_init_fb()
469 var->transp.length = 0; in offb_init_fb()
472 var->bits_per_pixel = 16; in offb_init_fb()
473 var->red.offset = 11; in offb_init_fb()
474 var->red.length = 5; in offb_init_fb()
475 var->green.offset = 5; in offb_init_fb()
476 var->green.length = 6; in offb_init_fb()
477 var->blue.offset = 0; in offb_init_fb()
478 var->blue.length = 5; in offb_init_fb()
479 var->transp.offset = 0; in offb_init_fb()
480 var->transp.length = 0; in offb_init_fb()
483 var->bits_per_pixel = 32; in offb_init_fb()
484 var->red.offset = 16; in offb_init_fb()
485 var->red.length = 8; in offb_init_fb()
486 var->green.offset = 8; in offb_init_fb()
487 var->green.length = 8; in offb_init_fb()
488 var->blue.offset = 0; in offb_init_fb()
489 var->blue.length = 8; in offb_init_fb()
490 var->transp.offset = 24; in offb_init_fb()
491 var->transp.length = 8; in offb_init_fb()
494 var->red.msb_right = var->green.msb_right = var->blue.msb_right = in offb_init_fb()
495 var->transp.msb_right = 0; in offb_init_fb()
496 var->grayscale = 0; in offb_init_fb()
497 var->nonstd = 0; in offb_init_fb()
498 var->activate = 0; in offb_init_fb()
499 var->height = var->width = -1; in offb_init_fb()
500 var->pixclock = 10000; in offb_init_fb()
501 var->left_margin = var->right_margin = 16; in offb_init_fb()
502 var->upper_margin = var->lower_margin = 16; in offb_init_fb()
503 var->hsync_len = var->vsync_len = 8; in offb_init_fb()
504 var->sync = 0; in offb_init_fb()
505 var->vmode = FB_VMODE_NONINTERLACED; in offb_init_fb()
508 info->apertures = alloc_apertures(1); in offb_init_fb()
509 if (!info->apertures) in offb_init_fb()
511 info->apertures->ranges[0].base = address; in offb_init_fb()
512 info->apertures->ranges[0].size = fix->smem_len; in offb_init_fb()
514 info->fbops = &offb_ops; in offb_init_fb()
515 info->screen_base = ioremap(address, fix->smem_len); in offb_init_fb()
516 info->pseudo_palette = (void *) (info + 1); in offb_init_fb()
517 info->flags = FBINFO_DEFAULT | FBINFO_MISC_FIRMWARE | foreign_endian; in offb_init_fb()
519 fb_alloc_cmap(&info->cmap, 256, 0); in offb_init_fb()
528 fb_dealloc_cmap(&info->cmap); in offb_init_fb()
529 iounmap(info->screen_base); in offb_init_fb()
531 iounmap(par->cmap_adr); in offb_init_fb()
532 par->cmap_adr = NULL; in offb_init_fb()
550 if (of_get_property(dp, "little-endian", NULL)) in offb_init_nodriver()
553 if (of_get_property(dp, "big-endian", NULL)) in offb_init_nodriver()
557 pp = of_get_property(dp, "linux,bootx-depth", &len); in offb_init_nodriver()
563 pp = of_get_property(dp, "linux,bootx-width", &len); in offb_init_nodriver()
569 pp = of_get_property(dp, "linux,bootx-height", &len); in offb_init_nodriver()
575 pp = of_get_property(dp, "linux,bootx-linebytes", &len); in offb_init_nodriver()
595 up = of_get_property(dp, "linux,bootx-addr", &len); in offb_init_nodriver()
640 vidp = of_get_property(dp, "vendor-id", NULL); in offb_init_nodriver()
641 didp = of_get_property(dp, "device-id", NULL); in offb_init_nodriver()
664 return -ENODEV; in offb_init()
667 if (of_get_property(of_chosen, "linux,bootx-noscreen", NULL) != NULL) { in offb_init()
679 of_get_property(dp, "linux,boot-display", NULL)) { in offb_init()