2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Freescale DIU Frame Buffer device driver
6 * Authors: Hongjun Chen <hong-jun.chen@freescale.com>
7 * Paul Widmer <paul.widmer@freescale.com>
8 * Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
9 * York Sun <yorksun@freescale.com>
11 * Based on imxfb.c Copyright (C) 2004 S.Hauer, Pengutronix
13 * This program is free software; you can redistribute it and/or modify it
14 * under the terms of the GNU General Public License as published by the
15 * Free Software Foundation; either version 2 of the License, or (at your
16 * option) any later version.
20 #ifndef __FSL_DIU_FB_H__
21 #define __FSL_DIU_FB_H__
23 /* Arbitrary threshold to determine the allocation method
24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory()
26 #define MEM_ALLOC_THRESHOLD (1024*768*4+32)
27 /* Minimum value that the pixel clock can be set to in pico seconds
28 * This is determined by platform clock/3 where the minimum platform
29 * clock is 533MHz. This gives 5629 pico seconds.
31 #define MIN_PIX_CLK 5629
32 #define MAX_PIX_CLK 96096
34 #include <linux/types.h>
41 struct mfb_chroma_key
{
51 struct aoi_display_offset
{
56 #define MFB_SET_CHROMA_KEY _IOW('M', 1, struct mfb_chroma_key)
57 #define MFB_SET_BRIGHTNESS _IOW('M', 3, __u8)
59 #define MFB_SET_ALPHA 0x80014d00
60 #define MFB_GET_ALPHA 0x40014d00
61 #define MFB_SET_AOID 0x80084d04
62 #define MFB_GET_AOID 0x40084d04
63 #define MFB_SET_PIXFMT 0x80014d08
64 #define MFB_GET_PIXFMT 0x40014d08
66 #define FBIOGET_GWINFO 0x46E0
67 #define FBIOPUT_GWINFO 0x46E1
70 #include <linux/spinlock.h>
73 * These are the fields of area descriptor(in DDR memory) for every plane
76 /* Word 0(32-bit) in DDR memory */
78 /* __u16 pixel_s:2; */
79 /* __u16 pallete:1; */
81 /* __u16 green_c:2; */
83 /* __u16 alpha_c:3; */
87 __be32 pix_fmt
; /* hard coding pixel format */
89 /* Word 1(32-bit) in DDR memory */
92 /* Word 2(32-bit) in DDR memory */
93 /* __u32 delta_xs:11; */
95 /* __u32 delta_ys:11; */
97 /* __u32 g_alpha:8; */
98 __le32 src_size_g_alpha
;
100 /* Word 3(32-bit) in DDR memory */
101 /* __u32 delta_xi:11; */
103 /* __u32 delta_yi:11; */
108 /* Word 4(32-bit) in DDR memory */
109 /*__u32 offset_xi:11;
116 /* Word 5(32-bit) in DDR memory */
117 /*__u32 offset_xd:11;
124 /* Word 6(32-bit) in DDR memory */
130 /* Word 7(32-bit) in DDR memory */
137 /* Word 8(32-bit) in DDR memory */
140 /* Word 9(32-bit) in DDR memory, just for 64-bit aligned */
142 } __attribute__ ((packed
));
144 /* DIU register map */
166 } __attribute__ ((packed
));
172 __u32 mode
; /* DIU operation mode */
176 __u8 __iomem
*vaddr
; /* Virtual address */
177 dma_addr_t paddr
; /* Physical address */
183 struct diu_addr gamma
;
184 struct diu_addr pallete
;
185 struct diu_addr cursor
;
188 #define FSL_DIU_BASE_OFFSET 0x2C000 /* Offset of DIU */
189 #define INT_LCDC 64 /* DIU interrupt number */
191 #define FSL_AOI_NUM 6 /* 5 AOIs and one dummy AOI */
192 /* 1 for plane 0, 2 for plane 1&2 each */
194 /* Minimum X and Y resolutions */
198 /* HW cursor parameters */
201 /* Modes of operation of DIU */
202 #define MFB_MODE0 0 /* DIU off */
203 #define MFB_MODE1 1 /* All three planes output to display */
204 #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/
205 #define MFB_MODE3 3 /* All three planes written back to memory */
206 #define MFB_MODE4 4 /* Color bar generation */
208 /* INT_STATUS/INT_MASK field descriptions */
209 #define INT_VSYNC 0x01 /* Vsync interrupt */
210 #define INT_VSYNC_WB 0x02 /* Vsync interrupt for write back operation */
211 #define INT_UNDRUN 0x04 /* Under run exception interrupt */
212 #define INT_PARERR 0x08 /* Display parameters error interrupt */
213 #define INT_LS_BF_VS 0x10 /* Lines before vsync. interrupt */
215 /* Panels'operation modes */
216 #define MFB_TYPE_OUTPUT 0 /* Panel output to display */
217 #define MFB_TYPE_OFF 1 /* Panel off */
218 #define MFB_TYPE_WB 2 /* Panel written back to memory */
219 #define MFB_TYPE_TEST 3 /* Panel generate color bar */
221 #endif /* __KERNEL__ */
222 #endif /* __FSL_DIU_FB_H__ */