s3c2410fb-regs-lcd.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2003 Simtec Electronics <[email protected]>
  4. * http://www.simtec.co.uk/products/SWLINUX/
  5. */
  6. #ifndef ___ASM_ARCH_REGS_LCD_H
  7. #define ___ASM_ARCH_REGS_LCD_H
  8. /*
  9. * a couple of values are used as platform data in
  10. * include/linux/platform_data/fb-s3c2410.h and not
  11. * duplicated here.
  12. */
  13. #include <linux/platform_data/fb-s3c2410.h>
  14. #define S3C2410_LCDREG(x) (x)
  15. /* LCD control registers */
  16. #define S3C2410_LCDCON1 S3C2410_LCDREG(0x00)
  17. #define S3C2410_LCDCON2 S3C2410_LCDREG(0x04)
  18. #define S3C2410_LCDCON3 S3C2410_LCDREG(0x08)
  19. #define S3C2410_LCDCON4 S3C2410_LCDREG(0x0C)
  20. #define S3C2410_LCDCON5 S3C2410_LCDREG(0x10)
  21. #define S3C2410_LCDCON1_CLKVAL(x) ((x) << 8)
  22. #define S3C2410_LCDCON1_MMODE (1<<7)
  23. #define S3C2410_LCDCON1_DSCAN4 (0<<5)
  24. #define S3C2410_LCDCON1_STN4 (1<<5)
  25. #define S3C2410_LCDCON1_STN8 (2<<5)
  26. #define S3C2410_LCDCON1_TFT (3<<5)
  27. #define S3C2410_LCDCON1_STN1BPP (0<<1)
  28. #define S3C2410_LCDCON1_STN2GREY (1<<1)
  29. #define S3C2410_LCDCON1_STN4GREY (2<<1)
  30. #define S3C2410_LCDCON1_STN8BPP (3<<1)
  31. #define S3C2410_LCDCON1_STN12BPP (4<<1)
  32. #define S3C2410_LCDCON1_ENVID (1)
  33. #define S3C2410_LCDCON1_MODEMASK 0x1E
  34. #define S3C2410_LCDCON2_VBPD(x) ((x) << 24)
  35. #define S3C2410_LCDCON2_LINEVAL(x) ((x) << 14)
  36. #define S3C2410_LCDCON2_VFPD(x) ((x) << 6)
  37. #define S3C2410_LCDCON2_VSPW(x) ((x) << 0)
  38. #define S3C2410_LCDCON2_GET_VBPD(x) ( ((x) >> 24) & 0xFF)
  39. #define S3C2410_LCDCON2_GET_VFPD(x) ( ((x) >> 6) & 0xFF)
  40. #define S3C2410_LCDCON2_GET_VSPW(x) ( ((x) >> 0) & 0x3F)
  41. #define S3C2410_LCDCON3_HBPD(x) ((x) << 19)
  42. #define S3C2410_LCDCON3_WDLY(x) ((x) << 19)
  43. #define S3C2410_LCDCON3_HOZVAL(x) ((x) << 8)
  44. #define S3C2410_LCDCON3_HFPD(x) ((x) << 0)
  45. #define S3C2410_LCDCON3_LINEBLANK(x)((x) << 0)
  46. #define S3C2410_LCDCON3_GET_HBPD(x) ( ((x) >> 19) & 0x7F)
  47. #define S3C2410_LCDCON3_GET_HFPD(x) ( ((x) >> 0) & 0xFF)
  48. /* LDCCON4 changes for STN mode on the S3C2412 */
  49. #define S3C2410_LCDCON4_MVAL(x) ((x) << 8)
  50. #define S3C2410_LCDCON4_HSPW(x) ((x) << 0)
  51. #define S3C2410_LCDCON4_WLH(x) ((x) << 0)
  52. #define S3C2410_LCDCON4_GET_HSPW(x) ( ((x) >> 0) & 0xFF)
  53. /* framebuffer start addressed */
  54. #define S3C2410_LCDSADDR1 S3C2410_LCDREG(0x14)
  55. #define S3C2410_LCDSADDR2 S3C2410_LCDREG(0x18)
  56. #define S3C2410_LCDSADDR3 S3C2410_LCDREG(0x1C)
  57. #define S3C2410_LCDBANK(x) ((x) << 21)
  58. #define S3C2410_LCDBASEU(x) (x)
  59. #define S3C2410_OFFSIZE(x) ((x) << 11)
  60. #define S3C2410_PAGEWIDTH(x) (x)
  61. /* colour lookup and miscellaneous controls */
  62. #define S3C2410_REDLUT S3C2410_LCDREG(0x20)
  63. #define S3C2410_GREENLUT S3C2410_LCDREG(0x24)
  64. #define S3C2410_BLUELUT S3C2410_LCDREG(0x28)
  65. #define S3C2410_DITHMODE S3C2410_LCDREG(0x4C)
  66. #define S3C2410_TPAL S3C2410_LCDREG(0x50)
  67. #define S3C2410_TPAL_EN (1<<24)
  68. /* interrupt info */
  69. #define S3C2410_LCDINTPND S3C2410_LCDREG(0x54)
  70. #define S3C2410_LCDSRCPND S3C2410_LCDREG(0x58)
  71. #define S3C2410_LCDINTMSK S3C2410_LCDREG(0x5C)
  72. #define S3C2410_LCDINT_FIWSEL (1<<2)
  73. #define S3C2410_LCDINT_FRSYNC (1<<1)
  74. #define S3C2410_LCDINT_FICNT (1<<0)
  75. /* s3c2442 extra stn registers */
  76. #define S3C2442_REDLUT S3C2410_LCDREG(0x20)
  77. #define S3C2442_GREENLUT S3C2410_LCDREG(0x24)
  78. #define S3C2442_BLUELUT S3C2410_LCDREG(0x28)
  79. #define S3C2442_DITHMODE S3C2410_LCDREG(0x20)
  80. #define S3C2410_LPCSEL S3C2410_LCDREG(0x60)
  81. #define S3C2410_TFTPAL(x) S3C2410_LCDREG((0x400 + (x)*4))
  82. /* S3C2412 registers */
  83. #define S3C2412_TPAL S3C2410_LCDREG(0x20)
  84. #define S3C2412_LCDINTPND S3C2410_LCDREG(0x24)
  85. #define S3C2412_LCDSRCPND S3C2410_LCDREG(0x28)
  86. #define S3C2412_LCDINTMSK S3C2410_LCDREG(0x2C)
  87. #define S3C2412_TCONSEL S3C2410_LCDREG(0x30)
  88. #define S3C2412_LCDCON6 S3C2410_LCDREG(0x34)
  89. #define S3C2412_LCDCON7 S3C2410_LCDREG(0x38)
  90. #define S3C2412_LCDCON8 S3C2410_LCDREG(0x3C)
  91. #define S3C2412_LCDCON9 S3C2410_LCDREG(0x40)
  92. #define S3C2412_REDLUT(x) S3C2410_LCDREG(0x44 + ((x)*4))
  93. #define S3C2412_GREENLUT(x) S3C2410_LCDREG(0x60 + ((x)*4))
  94. #define S3C2412_BLUELUT(x) S3C2410_LCDREG(0x98 + ((x)*4))
  95. #define S3C2412_FRCPAT(x) S3C2410_LCDREG(0xB4 + ((x)*4))
  96. /* general registers */
  97. /* base of the LCD registers, where INTPND, INTSRC and then INTMSK
  98. * are available. */
  99. #define S3C2410_LCDINTBASE S3C2410_LCDREG(0x54)
  100. #define S3C2412_LCDINTBASE S3C2410_LCDREG(0x24)
  101. #define S3C24XX_LCDINTPND (0x00)
  102. #define S3C24XX_LCDSRCPND (0x04)
  103. #define S3C24XX_LCDINTMSK (0x08)
  104. #endif /* ___ASM_ARCH_REGS_LCD_H */