From a4c49cdc530046ded7a9fbfe9e13eab10d3973c7 Mon Sep 17 00:00:00 2001 From: Kurt Mahan Date: Thu, 10 Jul 2008 19:19:29 -0600 Subject: [PATCH] Add PCI Video SM712. LTIBName: m547x-8x-pci-video-sm712 Signed-off-by: Kurt Mahan Signed-off-by: Shrek Wu --- drivers/video/Kconfig | 10 + drivers/video/Makefile | 1 + drivers/video/cfbimgblt.c | 8 +- drivers/video/console/bitblit.c | 12 + drivers/video/console/fbcon.c | 7 +- drivers/video/smifb.c | 949 +++++++++++++++++++++++++++++++++++++++ drivers/video/smifb.h | 149 ++++++ include/linux/fb.h | 13 +- 8 files changed, 1142 insertions(+), 7 deletions(-) create mode 100644 drivers/video/smifb.c create mode 100644 drivers/video/smifb.h --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -201,6 +201,16 @@ config FB_TILEBLITTING comment "Frame buffer hardware drivers" depends on FB +config FB_SMI + tristate "SiliconMotion Lynx support" + depends on FB && PCI + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + ---help--- + This enables support for the Silicon Motion Lynx family of graphic + chips. It has been tested on ColdFire. + config FB_CIRRUS tristate "Cirrus Logic support" depends on FB && (ZORRO || PCI) --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -28,6 +28,7 @@ obj-$(CONFIG_FB_DDC) += fb_ddc obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o # Hardware specific drivers go first +obj-$(CONFIG_FB_SMI) += smifb.o obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o obj-$(CONFIG_FB_ARC) += arcfb.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o --- a/drivers/video/cfbimgblt.c +++ b/drivers/video/cfbimgblt.c @@ -44,12 +44,12 @@ #endif static const u32 cfb_tab8[] = { -#if defined(__BIG_ENDIAN) +#if defined(__BIG_ENDIAN) && !defined(CONFIG_COLDFIRE) 0x00000000,0x000000ff,0x0000ff00,0x0000ffff, 0x00ff0000,0x00ff00ff,0x00ffff00,0x00ffffff, 0xff000000,0xff0000ff,0xff00ff00,0xff00ffff, 0xffff0000,0xffff00ff,0xffffff00,0xffffffff -#elif defined(__LITTLE_ENDIAN) +#elif defined(__LITTLE_ENDIAN) || defined(CONFIG_COLDFIRE) 0x00000000,0xff000000,0x00ff0000,0xffff0000, 0x0000ff00,0xff00ff00,0x00ffff00,0xffffff00, 0x000000ff,0xff0000ff,0x00ff00ff,0xffff00ff, @@ -60,9 +60,9 @@ static const u32 cfb_tab8[] = { }; static const u32 cfb_tab16[] = { -#if defined(__BIG_ENDIAN) +#if defined(__BIG_ENDIAN) && !defined(CONFIG_COLDFIRE) 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff -#elif defined(__LITTLE_ENDIAN) +#elif defined(__LITTLE_ENDIAN) || defined(CONFIG_COLDFIRE) 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff #else #error FIXME: No endianness?? --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c @@ -78,7 +78,11 @@ static inline void bit_putcs_aligned(str u32 d_pitch, u32 s_pitch, u32 cellsize, struct fb_image *image, u8 *buf, u8 *dst) { +#ifndef CONFIG_COLDFIRE u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; +#else + u32 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; +#endif u32 idx = vc->vc_font.width >> 3; u8 *src; @@ -111,7 +115,11 @@ static inline void bit_putcs_unaligned(s struct fb_image *image, u8 *buf, u8 *dst) { +#ifndef CONFIG_COLDFIRE u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; +#else + u32 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; +#endif u32 shift_low = 0, mod = vc->vc_font.width % 8; u32 shift_high = 8; u32 idx = vc->vc_font.width >> 3; @@ -238,7 +246,11 @@ static void bit_cursor(struct vc_data *v { struct fb_cursor cursor; struct fbcon_ops *ops = info->fbcon_par; +#ifndef CONFIG_COLDFIRE unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; +#else + unsigned long charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; +#endif int w = (vc->vc_font.width + 7) >> 3, c; int y = real_y(ops->p, vc->vc_y); int attribute, use_sw = (vc->vc_cursor_type & 0x10); --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -2679,8 +2679,11 @@ static int fbcon_set_palette(struct vc_d { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; int i, j, k, depth; - u8 val; - +#ifndef CONFIG_COLDFIRE + u8 val; +#else + u32 val; +#endif if (fbcon_is_inactive(vc, info)) return -EINVAL; --- /dev/null +++ b/drivers/video/smifb.c @@ -0,0 +1,949 @@ +/*************************************************************************** + smifb.c - Silicon Motion, Inc. LynxEM+ frame buffer device + ------------------- + begin : Thu Aug 9 2001 + copyright : (C) 2001 by Szu-Tao Huang + email : johuang@siliconmotion.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "console/fbcon.h" + +/* +#include