blob: 1dd67f4688c751bee9f97725b8ac1abd1d4fccc6 [file] [log] [blame]
Ryan Mallon88017bda2009-09-22 16:47:09 -07001================================
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
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -03007can use the standard Linux video mode database. In your board file::
Ryan Mallon88017bda2009-09-22 16:47:09 -07008
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
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030015mode for it as follows::
Ryan Mallon88017bda2009-09-22 16:47:09 -070016
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
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030026are in pixel clocks. See Documentation/fb/framebuffer.rst for further
Ryan Mallon88017bda2009-09-22 16:47:09 -070027details.
28
29The ep93xxfb_mach_info structure for your board should look like the
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030030following::
Ryan Mallon88017bda2009-09-22 16:47:09 -070031
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
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030040your board initialisation function::
Ryan Mallon88017bda2009-09-22 16:47:09 -070041
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
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030053=============================== ==========================================
Ryan Mallon88017bda2009-09-22 16:47:09 -070054EP93XXFB_PCLK_FALLING Clock data on the falling edge of the
55 pixel clock. The default is to clock
56 data on the rising edge.
57
58EP93XXFB_SYNC_BLANK_HIGH Blank signal is active high. By
59 default the blank signal is active low.
60
61EP93XXFB_SYNC_HORIZ_HIGH Horizontal sync is active high. By
62 default the horizontal sync is active low.
63
64EP93XXFB_SYNC_VERT_HIGH Vertical sync is active high. By
65 default the vertical sync is active high.
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030066=============================== ==========================================
Ryan Mallon88017bda2009-09-22 16:47:09 -070067
68The physical address of the framebuffer can be controlled using the
69following flags:
70
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030071=============================== ======================================
Ryan Mallon88017bda2009-09-22 16:47:09 -070072EP93XXFB_USE_SDCSN0 Use SDCSn[0] for the framebuffer. This
73 is the default setting.
74
75EP93XXFB_USE_SDCSN1 Use SDCSn[1] for the framebuffer.
76
77EP93XXFB_USE_SDCSN2 Use SDCSn[2] for the framebuffer.
78
79EP93XXFB_USE_SDCSN3 Use SDCSn[3] for the framebuffer.
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030080=============================== ======================================
Ryan Mallon88017bda2009-09-22 16:47:09 -070081
82==================
83Platform callbacks
84==================
85
86The EP93xx framebuffer driver supports three optional platform
87callbacks: setup, teardown and blank. The setup and teardown functions
88are called when the framebuffer driver is installed and removed
89respectively. The blank function is called whenever the display is
90blanked or unblanked.
91
92The setup and teardown devices pass the platform_device structure as
93an argument. The fb_info and ep93xxfb_mach_info structures can be
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -030094obtained as follows::
Ryan Mallon88017bda2009-09-22 16:47:09 -070095
96 static int some_board_fb_setup(struct platform_device *pdev)
97 {
98 struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data;
99 struct fb_info *fb_info = platform_get_drvdata(pdev);
100
101 /* Board specific framebuffer setup */
102 }
103
104======================
105Setting the video mode
106======================
107
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -0300108The video mode is set using the following syntax::
Ryan Mallon88017bda2009-09-22 16:47:09 -0700109
110 video=XRESxYRES[-BPP][@REFRESH]
111
112If the EP93xx video driver is built-in then the video mode is set on
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -0300113the Linux kernel command line, for example::
Ryan Mallon88017bda2009-09-22 16:47:09 -0700114
115 video=ep93xx-fb:800x600-16@60
116
117If the EP93xx video driver is built as a module then the video mode is
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -0300118set when the module is installed::
Ryan Mallon88017bda2009-09-22 16:47:09 -0700119
120 modprobe ep93xx-fb video=320x240
121
122==============
123Screenpage bug
124==============
125
126At least on the EP9315 there is a silicon bug which causes bit 27 of
127the VIDSCRNPAGE (framebuffer physical offset) to be tied low. There is
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -0300128an unofficial errata for this bug at::
129
Alexander A. Klimov7c7b2a32020-07-19 22:37:14 +0200130 https://marc.info/?l=linux-arm-kernel&m=110061245502000&w=2
Ryan Mallon88017bda2009-09-22 16:47:09 -0700131
132By default the EP93xx framebuffer driver checks if the allocated physical
133address has bit 27 set. If it does, then the memory is freed and an
134error is returned. The check can be disabled by adding the following
Mauro Carvalho Chehabab42b812019-06-12 14:52:45 -0300135option when loading the driver::
Ryan Mallon88017bda2009-09-22 16:47:09 -0700136
137 ep93xx-fb.check_screenpage_bug=0
138
139In some cases it may be possible to reconfigure your SDRAM layout to
140avoid this bug. See section 13 of the EP93xx users' guide for details.