0001 ================================
0002 Driver for EP93xx LCD controller
0003 ================================
0004
0005 The EP93xx LCD controller can drive both standard desktop monitors and
0006 embedded LCD displays. If you have a standard desktop monitor then you
0007 can use the standard Linux video mode database. In your board file::
0008
0009 static struct ep93xxfb_mach_info some_board_fb_info = {
0010 .num_modes = EP93XXFB_USE_MODEDB,
0011 .bpp = 16,
0012 };
0013
0014 If you have an embedded LCD display then you need to define a video
0015 mode for it as follows::
0016
0017 static struct fb_videomode some_board_video_modes[] = {
0018 {
0019 .name = "some_lcd_name",
0020 /* Pixel clock, porches, etc */
0021 },
0022 };
0023
0024 Note that the pixel clock value is in pico-seconds. You can use the
0025 KHZ2PICOS macro to convert the pixel clock value. Most other values
0026 are in pixel clocks. See Documentation/fb/framebuffer.rst for further
0027 details.
0028
0029 The ep93xxfb_mach_info structure for your board should look like the
0030 following::
0031
0032 static struct ep93xxfb_mach_info some_board_fb_info = {
0033 .num_modes = ARRAY_SIZE(some_board_video_modes),
0034 .modes = some_board_video_modes,
0035 .default_mode = &some_board_video_modes[0],
0036 .bpp = 16,
0037 };
0038
0039 The framebuffer device can be registered by adding the following to
0040 your board initialisation function::
0041
0042 ep93xx_register_fb(&some_board_fb_info);
0043
0044 =====================
0045 Video Attribute Flags
0046 =====================
0047
0048 The ep93xxfb_mach_info structure has a flags field which can be used
0049 to configure the controller. The video attributes flags are fully
0050 documented in section 7 of the EP93xx users' guide. The following
0051 flags are available:
0052
0053 =============================== ==========================================
0054 EP93XXFB_PCLK_FALLING Clock data on the falling edge of the
0055 pixel clock. The default is to clock
0056 data on the rising edge.
0057
0058 EP93XXFB_SYNC_BLANK_HIGH Blank signal is active high. By
0059 default the blank signal is active low.
0060
0061 EP93XXFB_SYNC_HORIZ_HIGH Horizontal sync is active high. By
0062 default the horizontal sync is active low.
0063
0064 EP93XXFB_SYNC_VERT_HIGH Vertical sync is active high. By
0065 default the vertical sync is active high.
0066 =============================== ==========================================
0067
0068 The physical address of the framebuffer can be controlled using the
0069 following flags:
0070
0071 =============================== ======================================
0072 EP93XXFB_USE_SDCSN0 Use SDCSn[0] for the framebuffer. This
0073 is the default setting.
0074
0075 EP93XXFB_USE_SDCSN1 Use SDCSn[1] for the framebuffer.
0076
0077 EP93XXFB_USE_SDCSN2 Use SDCSn[2] for the framebuffer.
0078
0079 EP93XXFB_USE_SDCSN3 Use SDCSn[3] for the framebuffer.
0080 =============================== ======================================
0081
0082 ==================
0083 Platform callbacks
0084 ==================
0085
0086 The EP93xx framebuffer driver supports three optional platform
0087 callbacks: setup, teardown and blank. The setup and teardown functions
0088 are called when the framebuffer driver is installed and removed
0089 respectively. The blank function is called whenever the display is
0090 blanked or unblanked.
0091
0092 The setup and teardown devices pass the platform_device structure as
0093 an argument. The fb_info and ep93xxfb_mach_info structures can be
0094 obtained as follows::
0095
0096 static int some_board_fb_setup(struct platform_device *pdev)
0097 {
0098 struct ep93xxfb_mach_info *mach_info = pdev->dev.platform_data;
0099 struct fb_info *fb_info = platform_get_drvdata(pdev);
0100
0101 /* Board specific framebuffer setup */
0102 }
0103
0104 ======================
0105 Setting the video mode
0106 ======================
0107
0108 The video mode is set using the following syntax::
0109
0110 video=XRESxYRES[-BPP][@REFRESH]
0111
0112 If the EP93xx video driver is built-in then the video mode is set on
0113 the Linux kernel command line, for example::
0114
0115 video=ep93xx-fb:800x600-16@60
0116
0117 If the EP93xx video driver is built as a module then the video mode is
0118 set when the module is installed::
0119
0120 modprobe ep93xx-fb video=320x240
0121
0122 ==============
0123 Screenpage bug
0124 ==============
0125
0126 At least on the EP9315 there is a silicon bug which causes bit 27 of
0127 the VIDSCRNPAGE (framebuffer physical offset) to be tied low. There is
0128 an unofficial errata for this bug at::
0129
0130 https://marc.info/?l=linux-arm-kernel&m=110061245502000&w=2
0131
0132 By default the EP93xx framebuffer driver checks if the allocated physical
0133 address has bit 27 set. If it does, then the memory is freed and an
0134 error is returned. The check can be disabled by adding the following
0135 option when loading the driver::
0136
0137 ep93xx-fb.check_screenpage_bug=0
0138
0139 In some cases it may be possible to reconfigure your SDRAM layout to
0140 avoid this bug. See section 13 of the EP93xx users' guide for details.