regs-fb-v4.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /* arch/arm/plat-samsung/include/plat/regs-fb-v4.h
  2. *
  3. * Copyright 2008 Openmoko, Inc.
  4. * Copyright 2008 Simtec Electronics
  5. * http://armlinux.simtec.co.uk/
  6. * Ben Dooks <ben@simtec.co.uk>
  7. *
  8. * S3C64XX - new-style framebuffer register definitions
  9. *
  10. * This is the register set for the new style framebuffer interface
  11. * found from the S3C2443 onwards and specifically the S3C64XX series
  12. * S3C6400 and S3C6410.
  13. *
  14. * The file contains the cpu specific items which change between whichever
  15. * architecture is selected. See <plat/regs-fb.h> for the core definitions
  16. * that are the same.
  17. *
  18. * This program is free software; you can redistribute it and/or modify
  19. * it under the terms of the GNU General Public License version 2 as
  20. * published by the Free Software Foundation.
  21. */
  22. /* include the core definitions here, in case we really do need to
  23. * override them at a later date.
  24. */
  25. #include <plat/regs-fb.h>
  26. #define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
  27. #define VIDCON1_FSTATUS_EVEN (1 << 15)
  28. /* Video timing controls */
  29. #define VIDTCON0 (0x10)
  30. #define VIDTCON1 (0x14)
  31. #define VIDTCON2 (0x18)
  32. /* Window position controls */
  33. #define WINCON(_win) (0x20 + ((_win) * 4))
  34. /* OSD1 and OSD4 do not have register D */
  35. #define VIDOSD_BASE (0x40)
  36. #define VIDINTCON0 (0x130)
  37. /* WINCONx */
  38. #define WINCONx_CSCWIDTH_MASK (0x3 << 26)
  39. #define WINCONx_CSCWIDTH_SHIFT (26)
  40. #define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
  41. #define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
  42. #define WINCONx_ENLOCAL (1 << 22)
  43. #define WINCONx_BUFSTATUS (1 << 21)
  44. #define WINCONx_BUFSEL (1 << 20)
  45. #define WINCONx_BUFAUTOEN (1 << 19)
  46. #define WINCONx_YCbCr (1 << 13)
  47. #define WINCON1_LOCALSEL_CAMIF (1 << 23)
  48. #define WINCON2_LOCALSEL_CAMIF (1 << 23)
  49. #define WINCON2_BLD_PIX (1 << 6)
  50. #define WINCON2_ALPHA_SEL (1 << 1)
  51. #define WINCON2_BPPMODE_MASK (0xf << 2)
  52. #define WINCON2_BPPMODE_SHIFT (2)
  53. #define WINCON2_BPPMODE_1BPP (0x0 << 2)
  54. #define WINCON2_BPPMODE_2BPP (0x1 << 2)
  55. #define WINCON2_BPPMODE_4BPP (0x2 << 2)
  56. #define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
  57. #define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
  58. #define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
  59. #define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
  60. #define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
  61. #define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
  62. #define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
  63. #define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
  64. #define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
  65. #define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
  66. #define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
  67. #define WINCON3_BLD_PIX (1 << 6)
  68. #define WINCON3_ALPHA_SEL (1 << 1)
  69. #define WINCON3_BPPMODE_MASK (0xf << 2)
  70. #define WINCON3_BPPMODE_SHIFT (2)
  71. #define WINCON3_BPPMODE_1BPP (0x0 << 2)
  72. #define WINCON3_BPPMODE_2BPP (0x1 << 2)
  73. #define WINCON3_BPPMODE_4BPP (0x2 << 2)
  74. #define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
  75. #define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
  76. #define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
  77. #define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
  78. #define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
  79. #define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
  80. #define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
  81. #define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
  82. #define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
  83. #define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
  84. #define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
  85. #define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
  86. #define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
  87. #define DITHMODE (0x170)
  88. #define WINxMAP(_win) (0x180 + ((_win) * 4))
  89. #define DITHMODE_R_POS_MASK (0x3 << 5)
  90. #define DITHMODE_R_POS_SHIFT (5)
  91. #define DITHMODE_R_POS_8BIT (0x0 << 5)
  92. #define DITHMODE_R_POS_6BIT (0x1 << 5)
  93. #define DITHMODE_R_POS_5BIT (0x2 << 5)
  94. #define DITHMODE_G_POS_MASK (0x3 << 3)
  95. #define DITHMODE_G_POS_SHIFT (3)
  96. #define DITHMODE_G_POS_8BIT (0x0 << 3)
  97. #define DITHMODE_G_POS_6BIT (0x1 << 3)
  98. #define DITHMODE_G_POS_5BIT (0x2 << 3)
  99. #define DITHMODE_B_POS_MASK (0x3 << 1)
  100. #define DITHMODE_B_POS_SHIFT (1)
  101. #define DITHMODE_B_POS_8BIT (0x0 << 1)
  102. #define DITHMODE_B_POS_6BIT (0x1 << 1)
  103. #define DITHMODE_B_POS_5BIT (0x2 << 1)
  104. #define DITHMODE_DITH_EN (1 << 0)
  105. #define WPALCON (0x1A0)
  106. /* Palette control */
  107. /* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L),
  108. * but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */
  109. #define WPALCON_W4PAL_16BPP_A555 (1 << 8)
  110. #define WPALCON_W3PAL_16BPP_A555 (1 << 7)
  111. #define WPALCON_W2PAL_16BPP_A555 (1 << 6)
  112. /* Notes on per-window bpp settings
  113. *
  114. * Value Win0 Win1 Win2 Win3 Win 4
  115. * 0000 1(P) 1(P) 1(P) 1(P) 1(P)
  116. * 0001 2(P) 2(P) 2(P) 2(P) 2(P)
  117. * 0010 4(P) 4(P) 4(P) 4(P) -none-
  118. * 0011 8(P) 8(P) -none- -none- -none-
  119. * 0100 -none- 8(A232) 8(A232) -none- -none-
  120. * 0101 16(565) 16(565) 16(565) 16(565) 16(565)
  121. * 0110 -none- 16(A555) 16(A555) 16(A555) 16(A555)
  122. * 0111 16(I555) 16(I565) 16(I555) 16(I555) 16(I555)
  123. * 1000 18(666) 18(666) 18(666) 18(666) 18(666)
  124. * 1001 -none- 18(A665) 18(A665) 18(A665) 16(A665)
  125. * 1010 -none- 19(A666) 19(A666) 19(A666) 19(A666)
  126. * 1011 24(888) 24(888) 24(888) 24(888) 24(888)
  127. * 1100 -none- 24(A887) 24(A887) 24(A887) 24(A887)
  128. * 1101 -none- 25(A888) 25(A888) 25(A888) 25(A888)
  129. * 1110 -none- -none- -none- -none- -none-
  130. * 1111 -none- -none- -none- -none- -none-
  131. */