ep93xx-fb.rst 4.5 KB

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