1================================
2Driver for EP93xx LCD controller
3================================
4
5The EP93xx LCD controller can drive both standard desktop monitors and
6embedded LCD displays. If you have a standard desktop monitor then you
7can use the standard Linux video mode database. In your board file:
8
9	static struct ep93xxfb_mach_info some_board_fb_info = {
10		.num_modes	= EP93XXFB_USE_MODEDB,
11		.bpp		= 16,
12	};
13
14If you have an embedded LCD display then you need to define a video
15mode for it as follows:
16
17	static struct fb_videomode some_board_video_modes[] = {
18		{
19			.name		= "some_lcd_name",
20			/* Pixel clock, porches, etc */
21		},
22	};
23
24Note that the pixel clock value is in pico-seconds. You can use the
25KHZ2PICOS macro to convert the pixel clock value. Most other values
26are in pixel clocks. See Documentation/fb/framebuffer.txt for further
27details.
28
29The ep93xxfb_mach_info structure for your board should look like the
30following:
31
32	static struct ep93xxfb_mach_info some_board_fb_info = {
33		.num_modes	= ARRAY_SIZE(some_board_video_modes),
34		.modes		= some_board_video_modes,
35		.default_mode	= &some_board_video_modes[0],
36		.bpp		= 16,
37	};
38
39The framebuffer device can be registered by adding the following to
40your board initialisation function:
41
42	ep93xx_register_fb(&some_board_fb_info);
43
44=====================
45Video Attribute Flags
46=====================
47
48The ep93xxfb_mach_info structure has a flags field which can be used
49to configure the controller. The video attributes flags are fully
50documented in section 7 of the EP93xx users' guide. The following
51flags are available:
52
53EP93XXFB_PCLK_FALLING		Clock data on the falling edge of the
54				pixel clock. The default is to clock
55				data on the rising edge.
56
57EP93XXFB_SYNC_BLANK_HIGH	Blank signal is active high. By
58				default the blank signal is active low.
59
60EP93XXFB_SYNC_HORIZ_HIGH	Horizontal sync is active high. By
61				default the horizontal sync is active low.
62
63EP93XXFB_SYNC_VERT_HIGH		Vertical sync is active high. By
64				default the vertical sync is active high.
65
66The physical address of the framebuffer can be controlled using the
67following flags:
68
69EP93XXFB_USE_SDCSN0		Use SDCSn[0] for the framebuffer. This
70				is the default setting.
71
72EP93XXFB_USE_SDCSN1		Use SDCSn[1] for the framebuffer.
73
74EP93XXFB_USE_SDCSN2		Use SDCSn[2] for the framebuffer.
75
76EP93XXFB_USE_SDCSN3		Use SDCSn[3] for the framebuffer.
77
78==================
79Platform callbacks
80==================
81
82The EP93xx framebuffer driver supports three optional platform
83callbacks: setup, teardown and blank. The setup and teardown functions
84are called when the framebuffer driver is installed and removed
85respectively. The blank function is called whenever the display is
86blanked or unblanked.
87
88The setup and teardown devices pass the platform_device structure as
89an argument. The fb_info and ep93xxfb_mach_info structures can be
90obtained as follows:
91
92	static int some_board_fb_setup(struct platform_device *pdev)
93	{
94		struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data;
95		struct fb_info *fb_info = platform_get_drvdata(pdev);
96
97		/* Board specific framebuffer setup */
98	}
99
100======================
101Setting the video mode
102======================
103
104The video mode is set using the following syntax:
105
106	video=XRESxYRES[-BPP][@REFRESH]
107
108If the EP93xx video driver is built-in then the video mode is set on
109the Linux kernel command line, for example:
110
111	video=ep93xx-fb:800x600-16@60
112
113If the EP93xx video driver is built as a module then the video mode is
114set when the module is installed:
115
116	modprobe ep93xx-fb video=320x240
117
118==============
119Screenpage bug
120==============
121
122At least on the EP9315 there is a silicon bug which causes bit 27 of
123the VIDSCRNPAGE (framebuffer physical offset) to be tied low. There is
124an unofficial errata for this bug at:
125	http://marc.info/?l=linux-arm-kernel&m=110061245502000&w=2
126
127By default the EP93xx framebuffer driver checks if the allocated physical
128address has bit 27 set. If it does, then the memory is freed and an
129error is returned. The check can be disabled by adding the following
130option when loading the driver:
131
132      ep93xx-fb.check_screenpage_bug=0
133
134In some cases it may be possible to reconfigure your SDRAM layout to
135avoid this bug. See section 13 of the EP93xx users' guide for details.
136