summaryrefslogtreecommitdiff
path: root/board/freescale/common/fsl_diu_fb.c
diff options
context:
space:
mode:
authorAnatolij Gustschin <agust@denx.de>2010-09-24 01:06:37 +0200
committerAnatolij Gustschin <agust@denx.de>2010-09-25 13:10:03 +0200
commit9e70d1378c7f41d1aa9ffc5429d810330c194949 (patch)
tree9c136a9549b0032ba80e82f49cfe3e60b6401655 /board/freescale/common/fsl_diu_fb.c
parent6aa3d3bfaa986f1aff5e21a9b9f68d087715b1a9 (diff)
downloadu-boot-imx-9e70d1378c7f41d1aa9ffc5429d810330c194949.zip
u-boot-imx-9e70d1378c7f41d1aa9ffc5429d810330c194949.tar.gz
u-boot-imx-9e70d1378c7f41d1aa9ffc5429d810330c194949.tar.bz2
fsl_diu_fb: further refactoring of FSL DIU code
Move common code to the fsl_diu_fb.c file and remove obsolete code from board files (aria, mpc8610hpcd and pdm360ng). Move fsl_diu_fb.h file to the include directory. Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'board/freescale/common/fsl_diu_fb.c')
-rw-r--r--board/freescale/common/fsl_diu_fb.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/board/freescale/common/fsl_diu_fb.c b/board/freescale/common/fsl_diu_fb.c
index 394b71f..35ed938 100644
--- a/board/freescale/common/fsl_diu_fb.c
+++ b/board/freescale/common/fsl_diu_fb.c
@@ -28,7 +28,7 @@
#include <malloc.h>
#include <asm/io.h>
-#include "fsl_diu_fb.h"
+#include <fsl_diu_fb.h>
struct fb_videomode {
const char *name; /* optional */
@@ -472,3 +472,42 @@ static int allocate_buf(struct diu_addr *buf, u32 size, u32 bytes_align)
buf->offset = 0;
return 0;
}
+
+#if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
+#include <stdio_dev.h>
+#include <video_fb.h>
+/*
+ * The Graphic Device
+ */
+static GraphicDevice ctfb;
+
+void *video_hw_init(void)
+{
+ struct fb_info *info;
+
+ if (platform_diu_init(&ctfb.winSizeX, &ctfb.winSizeY) < 0)
+ return NULL;
+
+ /* fill in Graphic device struct */
+ sprintf(ctfb.modeIdent, "%ix%ix%i %ikHz %iHz",
+ ctfb.winSizeX, ctfb.winSizeY, 32, 64, 60);
+
+ ctfb.frameAdrs = (unsigned int)fsl_fb_open(&info);
+ ctfb.plnSizeX = ctfb.winSizeX;
+ ctfb.plnSizeY = ctfb.winSizeY;
+
+ ctfb.gdfBytesPP = 4;
+ ctfb.gdfIndex = GDF_32BIT_X888RGB;
+
+ ctfb.isaBase = 0;
+ ctfb.pciBase = 0;
+ ctfb.memSize = info->screen_size;
+
+ /* Cursor Start Address */
+ ctfb.dprBase = 0;
+ ctfb.vprBase = 0;
+ ctfb.cprBase = 0;
+
+ return &ctfb;
+}
+#endif /* defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE) */