xref: /rk3399_rockchip-uboot/drivers/video/videomodes.h (revision a5dbdc81ea70daa04e49eb0004a0441131a029c6)
1352d2591SJean-Christophe PLAGNIOL-VILLARD /*
2352d2591SJean-Christophe PLAGNIOL-VILLARD  * (C) Copyright 2004
3352d2591SJean-Christophe PLAGNIOL-VILLARD  * Pierre Aubert, Staubli Faverges , <p.aubert@staubli.com>
4352d2591SJean-Christophe PLAGNIOL-VILLARD  *
5352d2591SJean-Christophe PLAGNIOL-VILLARD  * See file CREDITS for list of people who contributed to this
6352d2591SJean-Christophe PLAGNIOL-VILLARD  * project.
7352d2591SJean-Christophe PLAGNIOL-VILLARD  *
8352d2591SJean-Christophe PLAGNIOL-VILLARD  * This program is free software; you can redistribute it and/or
9352d2591SJean-Christophe PLAGNIOL-VILLARD  * modify it under the terms of the GNU General Public License as
10352d2591SJean-Christophe PLAGNIOL-VILLARD  * published by the Free Software Foundation; either version 2 of
11352d2591SJean-Christophe PLAGNIOL-VILLARD  * the License, or (at your option) any later version.
12352d2591SJean-Christophe PLAGNIOL-VILLARD  *
13352d2591SJean-Christophe PLAGNIOL-VILLARD  * This program is distributed in the hope that it will be useful,
14352d2591SJean-Christophe PLAGNIOL-VILLARD  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15352d2591SJean-Christophe PLAGNIOL-VILLARD  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the
16352d2591SJean-Christophe PLAGNIOL-VILLARD  * GNU General Public License for more details.
17352d2591SJean-Christophe PLAGNIOL-VILLARD  *
18352d2591SJean-Christophe PLAGNIOL-VILLARD  * You should have received a copy of the GNU General Public License
19352d2591SJean-Christophe PLAGNIOL-VILLARD  * along with this program; if not, write to the Free Software
20352d2591SJean-Christophe PLAGNIOL-VILLARD  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21352d2591SJean-Christophe PLAGNIOL-VILLARD  * MA 02111-1307 USA
22352d2591SJean-Christophe PLAGNIOL-VILLARD  */
23352d2591SJean-Christophe PLAGNIOL-VILLARD 
24352d2591SJean-Christophe PLAGNIOL-VILLARD 
256d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #ifndef CONFIG_SYS_DEFAULT_VIDEO_MODE
266d0f6bcfSJean-Christophe PLAGNIOL-VILLARD #define CONFIG_SYS_DEFAULT_VIDEO_MODE	0x301
27352d2591SJean-Christophe PLAGNIOL-VILLARD #endif
28352d2591SJean-Christophe PLAGNIOL-VILLARD 
29352d2591SJean-Christophe PLAGNIOL-VILLARD /* Some mode definitions */
30352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_SYNC_HOR_HIGH_ACT	1	/* horizontal sync high active	*/
31352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_SYNC_VERT_HIGH_ACT	2	/* vertical sync high active	*/
32352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_SYNC_EXT		4	/* external sync		*/
33352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_SYNC_COMP_HIGH_ACT	8	/* composite sync high active	*/
34352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_SYNC_BROADCAST	16	/* broadcast video timings	*/
35352d2591SJean-Christophe PLAGNIOL-VILLARD 					/* vtotal = 144d/288n/576i => PAL  */
36352d2591SJean-Christophe PLAGNIOL-VILLARD 					/* vtotal = 121d/242n/484i => NTSC */
37352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_SYNC_ON_GREEN	32	/* sync on green */
38352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_NONINTERLACED	0	/* non interlaced */
39352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_INTERLACED	1	/* interlaced	*/
40352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_DOUBLE		2	/* double scan */
41352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_MASK		255
42352d2591SJean-Christophe PLAGNIOL-VILLARD 
43352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_YWRAP		256	/* ywrap instead of panning	*/
44352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_SMOOTH_XPAN	512	/* smooth xpan possible (internally used) */
45352d2591SJean-Christophe PLAGNIOL-VILLARD #define FB_VMODE_CONUPDATE	512	/* don't update x/yoffset	*/
46352d2591SJean-Christophe PLAGNIOL-VILLARD 
47352d2591SJean-Christophe PLAGNIOL-VILLARD 
48352d2591SJean-Christophe PLAGNIOL-VILLARD /******************************************************************
49352d2591SJean-Christophe PLAGNIOL-VILLARD  * Resolution Struct
50352d2591SJean-Christophe PLAGNIOL-VILLARD  ******************************************************************/
51352d2591SJean-Christophe PLAGNIOL-VILLARD struct ctfb_res_modes {
52352d2591SJean-Christophe PLAGNIOL-VILLARD 	int xres;		/* visible resolution		*/
53352d2591SJean-Christophe PLAGNIOL-VILLARD 	int yres;
54352d2591SJean-Christophe PLAGNIOL-VILLARD 	/* Timing: All values in pixclocks, except pixclock (of course) */
55352d2591SJean-Christophe PLAGNIOL-VILLARD 	int pixclock;		/* pixel clock in ps (pico seconds) */
56352d2591SJean-Christophe PLAGNIOL-VILLARD 	int left_margin;	/* time from sync to picture	*/
57352d2591SJean-Christophe PLAGNIOL-VILLARD 	int right_margin;	/* time from picture to sync	*/
58352d2591SJean-Christophe PLAGNIOL-VILLARD 	int upper_margin;	/* time from sync to picture	*/
59352d2591SJean-Christophe PLAGNIOL-VILLARD 	int lower_margin;
60352d2591SJean-Christophe PLAGNIOL-VILLARD 	int hsync_len;		/* length of horizontal sync	*/
61352d2591SJean-Christophe PLAGNIOL-VILLARD 	int vsync_len;		/* length of vertical sync	*/
62352d2591SJean-Christophe PLAGNIOL-VILLARD 	int sync;		/* see FB_SYNC_*		*/
63352d2591SJean-Christophe PLAGNIOL-VILLARD 	int vmode;		/* see FB_VMODE_*		*/
64352d2591SJean-Christophe PLAGNIOL-VILLARD };
65352d2591SJean-Christophe PLAGNIOL-VILLARD 
66352d2591SJean-Christophe PLAGNIOL-VILLARD /******************************************************************
67352d2591SJean-Christophe PLAGNIOL-VILLARD  * Vesa Mode Struct
68352d2591SJean-Christophe PLAGNIOL-VILLARD  ******************************************************************/
69352d2591SJean-Christophe PLAGNIOL-VILLARD struct ctfb_vesa_modes {
70352d2591SJean-Christophe PLAGNIOL-VILLARD 	int vesanr;		/* Vesa number as in LILO (VESA Nr + 0x200} */
71352d2591SJean-Christophe PLAGNIOL-VILLARD 	int resindex;		/* index to resolution struct */
72352d2591SJean-Christophe PLAGNIOL-VILLARD 	int bits_per_pixel;	/* bpp */
73352d2591SJean-Christophe PLAGNIOL-VILLARD };
74352d2591SJean-Christophe PLAGNIOL-VILLARD 
75352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODE_640x480	0
76352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODE_800x600	1
77352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODE_1024x768	2
78352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODE_960_720	3
79352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODE_1152x864	4
80352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODE_1280x1024	5
81352d2591SJean-Christophe PLAGNIOL-VILLARD #define RES_MODES_COUNT		6
82352d2591SJean-Christophe PLAGNIOL-VILLARD 
83352d2591SJean-Christophe PLAGNIOL-VILLARD #define VESA_MODES_COUNT 19
84352d2591SJean-Christophe PLAGNIOL-VILLARD 
85352d2591SJean-Christophe PLAGNIOL-VILLARD extern const struct ctfb_vesa_modes vesa_modes[];
86352d2591SJean-Christophe PLAGNIOL-VILLARD extern const struct ctfb_res_modes res_mode_init[];
87352d2591SJean-Christophe PLAGNIOL-VILLARD 
88352d2591SJean-Christophe PLAGNIOL-VILLARD int video_get_params (struct ctfb_res_modes *pPar, char *penv);
89*a5dbdc81STimur Tabi 
90*a5dbdc81STimur Tabi int video_get_video_mode(unsigned int *xres, unsigned int *yres,
91*a5dbdc81STimur Tabi 	unsigned int *depth, unsigned int *freq, const char **options);
92