regs-lcd.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /* arch/arm/mach-s3c2410/include/mach/regs-lcd.h
  2. *
  3. * Copyright (c) 2003 Simtec Electronics <linux@simtec.co.uk>
  4. * http://www.simtec.co.uk/products/SWLINUX/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef ___ASM_ARCH_REGS_LCD_H
  11. #define ___ASM_ARCH_REGS_LCD_H
  12. #define S3C2410_LCDREG(x) (x)
  13. /* LCD control registers */
  14. #define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
  15. #define S3C2410_LCDCON2 S3C2410_LCDREG(0x04)
  16. #define S3C2410_LCDCON3 S3C2410_LCDREG(0x08)
  17. #define S3C2410_LCDCON4 S3C2410_LCDREG(0x0C)
  18. #define S3C2410_LCDCON5 S3C2410_LCDREG(0x10)
  19. #define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8)
  20. #define S3C2410_LCDCON1_MMODE (1<<7)
  21. #define S3C2410_LCDCON1_DSCAN4 (0<<5)
  22. #define S3C2410_LCDCON1_STN4 (1<<5)
  23. #define S3C2410_LCDCON1_STN8 (2<<5)
  24. #define S3C2410_LCDCON1_TFT (3<<5)
  25. #define S3C2410_LCDCON1_STN1BPP (0<<1)
  26. #define S3C2410_LCDCON1_STN2GREY (1<<1)
  27. #define S3C2410_LCDCON1_STN4GREY (2<<1)
  28. #define S3C2410_LCDCON1_STN8BPP (3<<1)
  29. #define S3C2410_LCDCON1_STN12BPP (4<<1)
  30. #define S3C2410_LCDCON1_TFT1BPP (8<<1)
  31. #define S3C2410_LCDCON1_TFT2BPP (9<<1)
  32. #define S3C2410_LCDCON1_TFT4BPP (10<<1)
  33. #define S3C2410_LCDCON1_TFT8BPP (11<<1)
  34. #define S3C2410_LCDCON1_TFT16BPP (12<<1)
  35. #define S3C2410_LCDCON1_TFT24BPP (13<<1)
  36. #define S3C2410_LCDCON1_ENVID (1)
  37. #define S3C2410_LCDCON1_MODEMASK 0x1E
  38. #define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
  39. #define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
  40. #define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
  41. #define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
  42. #define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF)
  43. #define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF)
  44. #define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F)
  45. #define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
  46. #define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
  47. #define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
  48. #define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
  49. #define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
  50. #define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
  51. #define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF)
  52. /* LDCCON4 changes for STN mode on the S3C2412 */
  53. #define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
  54. #define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
  55. #define S3C2410_LCDCON4_WLH(x) ((x) << 0)
  56. #define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF)
  57. #define S3C2410_LCDCON5_BPP24BL (1<<12)
  58. #define S3C2410_LCDCON5_FRM565 (1<<11)
  59. #define S3C2410_LCDCON5_INVVCLK (1<<10)
  60. #define S3C2410_LCDCON5_INVVLINE (1<<9)
  61. #define S3C2410_LCDCON5_INVVFRAME (1<<8)
  62. #define S3C2410_LCDCON5_INVVD (1<<7)
  63. #define S3C2410_LCDCON5_INVVDEN (1<<6)
  64. #define S3C2410_LCDCON5_INVPWREN (1<<5)
  65. #define S3C2410_LCDCON5_INVLEND (1<<4)
  66. #define S3C2410_LCDCON5_PWREN (1<<3)
  67. #define S3C2410_LCDCON5_ENLEND (1<<2)
  68. #define S3C2410_LCDCON5_BSWP (1<<1)
  69. #define S3C2410_LCDCON5_HWSWP (1<<0)
  70. /* framebuffer start addressed */
  71. #define S3C2410_LCDSADDR1 S3C2410_LCDREG(0x14)
  72. #define S3C2410_LCDSADDR2 S3C2410_LCDREG(0x18)
  73. #define S3C2410_LCDSADDR3 S3C2410_LCDREG(0x1C)
  74. #define S3C2410_LCDBANK(x) ((x) << 21)
  75. #define S3C2410_LCDBASEU(x) (x)
  76. #define S3C2410_OFFSIZE(x) ((x) << 11)
  77. #define S3C2410_PAGEWIDTH(x) (x)
  78. /* colour lookup and miscellaneous controls */
  79. #define S3C2410_REDLUT S3C2410_LCDREG(0x20)
  80. #define S3C2410_GREENLUT S3C2410_LCDREG(0x24)
  81. #define S3C2410_BLUELUT S3C2410_LCDREG(0x28)
  82. #define S3C2410_DITHMODE S3C2410_LCDREG(0x4C)
  83. #define S3C2410_TPAL S3C2410_LCDREG(0x50)
  84. #define S3C2410_TPAL_EN (1<<24)
  85. /* interrupt info */
  86. #define S3C2410_LCDINTPND S3C2410_LCDREG(0x54)
  87. #define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58)
  88. #define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C)
  89. #define S3C2410_LCDINT_FIWSEL (1<<2)
  90. #define S3C2410_LCDINT_FRSYNC (1<<1)
  91. #define S3C2410_LCDINT_FICNT (1<<0)
  92. /* s3c2442 extra stn registers */
  93. #define S3C2442_REDLUT S3C2410_LCDREG(0x20)
  94. #define S3C2442_GREENLUT S3C2410_LCDREG(0x24)
  95. #define S3C2442_BLUELUT S3C2410_LCDREG(0x28)
  96. #define S3C2442_DITHMODE S3C2410_LCDREG(0x20)
  97. #define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
  98. #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
  99. /* S3C2412 registers */
  100. #define S3C2412_TPAL S3C2410_LCDREG(0x20)
  101. #define S3C2412_LCDINTPND S3C2410_LCDREG(0x24)
  102. #define S3C2412_LCDSRCPND S3C2410_LCDREG(0x28)
  103. #define S3C2412_LCDINTMSK S3C2410_LCDREG(0x2C)
  104. #define S3C2412_TCONSEL S3C2410_LCDREG(0x30)
  105. #define S3C2412_LCDCON6 S3C2410_LCDREG(0x34)
  106. #define S3C2412_LCDCON7 S3C2410_LCDREG(0x38)
  107. #define S3C2412_LCDCON8 S3C2410_LCDREG(0x3C)
  108. #define S3C2412_LCDCON9 S3C2410_LCDREG(0x40)
  109. #define S3C2412_REDLUT(x) S3C2410_LCDREG(0x44 + ((x)*4))
  110. #define S3C2412_GREENLUT(x) S3C2410_LCDREG(0x60 + ((x)*4))
  111. #define S3C2412_BLUELUT(x) S3C2410_LCDREG(0x98 + ((x)*4))
  112. #define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4))
  113. /* general registers */
  114. /* base of the LCD registers, where INTPND, INTSRC and then INTMSK
  115. * are available. */
  116. #define S3C2410_LCDINTBASE S3C2410_LCDREG(0x54)
  117. #define S3C2412_LCDINTBASE S3C2410_LCDREG(0x24)
  118. #define S3C24XX_LCDINTPND (0x00)
  119. #define S3C24XX_LCDSRCPND (0x04)
  120. #define S3C24XX_LCDINTMSK (0x08)
  121. #endif /* ___ASM_ARCH_REGS_LCD_H */