Disp_B3.h
上传用户:xmyjxjd
上传日期:2013-05-04
资源大小:1517k
文件大小:41k
开发平台:

C/C++

  1. ///////////////////////////////////////////////////////////////////
  2. // Definitions for Display Port
  3. #define SINGLE_PORT         0x00    // Single port (Single pixel output)
  4. #define DOUBLE_PORT         0x04    // Double port (Double pixel output)
  5. #define DISPLAY_PORT        DOUBLE_PORT
  6. ///////////////////////////////////////////////////////////////////
  7. // Definitions for Display Color
  8. #define DISP_18BIT          0x10    // 18-bit RGB output
  9. #define DISP_24BIT          0x00    // 24-bit RGB output 
  10. #define DISP_BIT            DISP_18BIT
  11. ///////////////////////////////////////////////////////////////////
  12. // Definitions for Display Timing Feature
  13. #define MASK_FIRST_DHS      0x80    // Mask 1st DHS
  14. #define NO_MASKING          0x00    // No masking 
  15. #define DHS_MASK            NO_MASKING    
  16. ///////////////////////////////////////////////////////////////////
  17. // Definitions for Display Signal
  18. #define DISP_INV            0x0C    // DVS : neg , DHS : neg , DEN : pos
  19. #define DCLK_INV            0x08    // DCLK : pos
  20. #define DCLK_DELAY          0x01    // 1.0ns delay for DCLK
  21. ///////////////////////////////////////////////////////////////////
  22. //Definitions for display port control
  23. #define DISP_EO_SWAP        0x20
  24. #define DISP_RB_SWAP        0x00//0x10
  25. #define DISP_ML_SWAP        0x00//0x08
  26. ///////////////////////////////////////////////////////////////////
  27. // Definitions for Display Settings
  28. #define MAX_DCLK            138     // Maximum display clock(MHz) that panel can support
  29. #define MAX_RATE            86      // Maximum display refresh rate in Hz that panel can support
  30. #define DH_ACT_STA_POS      0x0020  // DH_ACT_STA_POS should be as small as possible !!!
  31. #define DH_ACT_END_POS      0x0520
  32. #define DV_ACT_STA_POS      0x000c  // DV_ACT_STA_POS should be as small as possible !!!
  33. #define DV_ACT_END_POS      0x040c
  34. #define DISP_WID            (DH_ACT_END_POS - DH_ACT_STA_POS)   // 0x0500 = 1280 pixels
  35. #define DISP_LEN            (DV_ACT_END_POS - DV_ACT_STA_POS)   // 0x0400 = 1024 lines
  36. #define STD_DH_TOTAL        0x0580  // Standard display clock number in one display horizontal line
  37. #define STD_DV_TOTAL        0x0480  // Standard display horizontal line in one display frame
  38. #define STD_HSYNC_WIDTH     0x10    // Display HSYNC clock width
  39. #define STD_VSYNC_LENGTH    0x03    // Display VSYNC line length
  40. #define MIN_DV_TOTAL        0x0410  // Minimum VSYNC that panel can support
  41. #define MIN_LAST_DHT        0       // Must set to 0 if you don't care last-line length
  42. #define VIDEO_ML_DHT        0       // Minimum last-line length for video
  43. #define USER_MODE_NCODE     20      // NEVER change this setting !!!
  44. #define DISP_ALIGN          0       // 0-Left alignment, 1-Right alignment
  45. #define AUTO_SWITCH        0x60      // Auto Switch to freerun mode
  46. /*
  47. ///////////////////////////////////////////////////////////////////
  48. // Definitions for RTD3001
  49. #define All_LINE_BUF        0x02    // Turn on all line buffers
  50. #define REQ_DELAY           0x40    // 0.5ns delay for request
  51. #define V_MAC_DELAY         0x10    // 0.5ns delay for Vertical MAC
  52. #define H_MAC_DELAY         0x04    // 0.5ns delay for Horizontal MAC
  53. #define DCLK_DELAY          0x01    // 1.0ns delay for DCLK
  54. #define HINIT_COEFF         0x00    // Horizontal initial coefficient = 0xc000
  55. #define REQMODE_00B         0x00    // Imporved mode 1 : REG[28]-bit3 = 0
  56. #define REQMODE_01B         0x80    // Imporved mode 1 : REG[31]-bit7 = 1
  57. #define ODDCTRL_VGA         0x38    // REG[31]-bit5  : Odd signal for V inital toggle. (0 : inverse)
  58.                                     // REG[31]-bit4  : Odd signal to control FS_DELAY_FINE_TUNING. (0 : enable)
  59.                                     // REG[31]-bit3  : Odd signal to enable FS_DELAY_FINE_TUNING. (1 : inverse)
  60. #define ODDCTRL_VIDEO       0x28
  61. */
  62. //---------------------------------- 1280x1024 ---------------------------------
  63. ///////////////////////////////////////////////////////////////////////////
  64. #ifdef __MAIN__
  65. unsigned char code RTD_PWUP_INI[]   =
  66.     5,      Y_INC,  HOSTCTRL_02,        0x42,0x00,
  67.     4,      N_INC,  TC_ADDR_PORT_95,    0x00,
  68.     7,      N_INC,  TC_DATA_PORT_96,    0x00,0x00,0x00,0x00,
  69.     9,      Y_INC,  GP1_ODOCTRL_F6,     0x00,0x00,0x00,0x00,0x00,0x00,
  70.     6,      Y_INC,  IRQ_CTRL1_0E,       0x00,0x80,0x00,
  71.     4,      N_INC,  INT_FLD_DETECT_14,  0x00,
  72.     25, Y_INC, DH_TOTAL_22, 0x08,0x00,0x02,0x04,0x00,0x04,0x00,0x06,0x00,0x06,0x00,
  73. 0x06,0x00,0x01,0x02,0x00,0x02,0x00,0x04,0x00,0x04,0x00,
  74.     6,      Y_INC,  YUV2RGB_39,         0x00,0x00,0x00,
  75.     
  76.     5,      Y_INC,  DUTY_FINE_TUNE_3E,  0xc0,0x0e,          // For improving display speed
  77.     
  78.     4,      N_INC,  MEAS_HS_LATCH_4E,   0x00,
  79.     5,      Y_INC,  CLAMP_55,           0x04,0x10,
  80.     4,      N_INC,  COLOR_CTRL_5D,      0x03,
  81.     4,      N_INC,  OP_CRC_CTRL_68,     0x88,               // For improving display speed
  82. //    6,      Y_INC,  PATTERN_GEN_6C,     0x00,0x83 | DISP_EO_SWAP | DISP_RB_SWAP | DISP_ML_SWAP,0x00,
  83.     6,      Y_INC,  PATTERN_GEN_6C,     0x00,0x33,0x00,
  84.     4,      N_INC,  SD_CTRL_70,         0x00,
  85.     6,      Y_INC,  IVS_DELAY_8C,       0x00,0x00,0x00,
  86. //--------------------------------------------------------------------
  87. // For RSDS TCON START
  88. //--------------------------------------------------------------------
  89. 5,      Y_INC,  TC_ADDR_PORT_95,    0x20,0x0c,  // FXDIO TCON3
  90.     5,      Y_INC,  TC_ADDR_PORT_95,    0x21,0x40,
  91.     5,      Y_INC,  TC_ADDR_PORT_95,    0x22,0x0c,
  92.     5,      Y_INC,  TC_ADDR_PORT_95,    0x23,0xa0,
  93.     5,      Y_INC,  TC_ADDR_PORT_95,    0x24,0x22,
  94.     5,      Y_INC,  TC_ADDR_PORT_95,    0x25,0xa1,
  95.     5,      Y_INC,  TC_ADDR_PORT_95,    0x26,0x80,    
  96.     5,      Y_INC,  TC_ADDR_PORT_95,    0x28,0x0c,  // XSTB TCON4
  97.     5,      Y_INC,  TC_ADDR_PORT_95,    0x29,0x40,
  98.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2A,0X0c,
  99.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2B,0x35,
  100.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2C,0x22,
  101.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2D,0xac,
  102.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2E,0x80,    
  103. 5,      Y_INC,  TC_ADDR_PORT_95,    0x60,0x0c,   // YOE TCON11 
  104.     5,      Y_INC,  TC_ADDR_PORT_95,    0x61,0x40, 
  105.     5,      Y_INC,  TC_ADDR_PORT_95,    0x62,0x0c,
  106.     5,      Y_INC,  TC_ADDR_PORT_95,    0x63,0x94,
  107.     5,      Y_INC,  TC_ADDR_PORT_95,    0x64,0x52,
  108.     5,      Y_INC,  TC_ADDR_PORT_95,    0x65,0x14,
  109.     5,      Y_INC,  TC_ADDR_PORT_95,    0x66,0xc0,    
  110. 5,      Y_INC,  TC_ADDR_PORT_95,    0x08,0x0c,  // BXDIO TCON0
  111.     5,      Y_INC,  TC_ADDR_PORT_95,    0x09,0x40,
  112.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0A,0x0c,
  113.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0B,0x9f,
  114.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0C,0x22,
  115.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0D,0xa9,
  116.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0E,0x80,    
  117. 5,      Y_INC,  TC_ADDR_PORT_95,    0x58,0x0c, // YDIO TCON10
  118.     5,      Y_INC,  TC_ADDR_PORT_95,    0x59,0x00,
  119.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5A,0x0e,
  120.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5B,0xd0,
  121.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5C,0x33,
  122.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5D,0xd7,
  123.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5E,0x88,    
  124. 5,      Y_INC,  TC_ADDR_PORT_95,    0x30,0x0c,  // YCLK TCON5
  125.     5,      Y_INC,  TC_ADDR_PORT_95,    0x31,0x40,
  126.     5,      Y_INC,  TC_ADDR_PORT_95,    0x32,0X0c,
  127.     5,      Y_INC,  TC_ADDR_PORT_95,    0x33,0xF4,
  128.     5,      Y_INC,  TC_ADDR_PORT_95,    0x34,0x21,
  129.     5,      Y_INC,  TC_ADDR_PORT_95,    0x35,0x94,
  130.     5,      Y_INC,  TC_ADDR_PORT_95,    0x36,0x80,    
  131. //#if(ANTI_FLICKER)
  132. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x38,0x0c,   // POL TCON6
  133. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x39,0x40,
  134. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x3a,0x0E,
  135. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x3b,0x00,
  136. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x3c,0x00,
  137. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x3d,0x01,
  138. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x3e,0x88,    
  139.   
  140. 5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON7
  141.     5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  142.     5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0D,
  143.     5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  144.     5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  145.     5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  146.     5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x8C,    
  147. //#else
  148. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON7
  149. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  150. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0D,
  151. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  152. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  153. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  154. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x88,    
  155. //#endif
  156. /*
  157. 5,      Y_INC,  TC_ADDR_PORT_95,    0x20,0x0c,  // FXDIO TCON3
  158.     5,      Y_INC,  TC_ADDR_PORT_95,    0x21,0x40,
  159.     5,      Y_INC,  TC_ADDR_PORT_95,    0x22,0x0c,
  160.     5,      Y_INC,  TC_ADDR_PORT_95,    0x23,0xa0,
  161.     5,      Y_INC,  TC_ADDR_PORT_95,    0x24,0x22,
  162.     5,      Y_INC,  TC_ADDR_PORT_95,    0x25,0xa1,
  163.     5,      Y_INC,  TC_ADDR_PORT_95,    0x26,0x80,    
  164.   5,      Y_INC,  TC_ADDR_PORT_95,    0x28,0x0c,  // XSTB TCON4
  165.     5,      Y_INC,  TC_ADDR_PORT_95,    0x29,0x40,
  166.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2A,0X0c,
  167.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2B,0x35,
  168.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2C,0x22,
  169.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2D,0xac,
  170.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2E,0x80,    
  171. 5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,  // POL TCON7
  172.     5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  173.     5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0d,
  174.     5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  175.     5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  176.     5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  177.     5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x88,    
  178. 5,      Y_INC,  TC_ADDR_PORT_95,    0x08,0x0c,  // BXDIO TCON0
  179.     5,      Y_INC,  TC_ADDR_PORT_95,    0x09,0x40,
  180.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0A,0x0c,
  181.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0B,0x9f,
  182.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0C,0x22,
  183.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0D,0xa9,
  184.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0E,0x80,    
  185. 5,      Y_INC,  TC_ADDR_PORT_95,    0x58,0x0d,   // YDIO TCON10
  186.     5,      Y_INC,  TC_ADDR_PORT_95,    0x59,0x00,
  187.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5A,0x0f,
  188.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5B,0xd0,
  189.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5C,0x33,
  190.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5D,0xd7,
  191.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5E,0x88,    
  192. 5,      Y_INC,  TC_ADDR_PORT_95,    0x30,0x0c,    // YCLK TCON5
  193.     5,      Y_INC,  TC_ADDR_PORT_95,    0x31,0x40,
  194.     5,      Y_INC,  TC_ADDR_PORT_95,    0x32,0X0c,
  195.     5,      Y_INC,  TC_ADDR_PORT_95,    0x33,0xF4,
  196.     5,      Y_INC,  TC_ADDR_PORT_95,    0x34,0x21,
  197.     5,      Y_INC,  TC_ADDR_PORT_95,    0x35,0x94,
  198.     5,      Y_INC,  TC_ADDR_PORT_95,    0x36,0x80,    
  199. 5,      Y_INC,  TC_ADDR_PORT_95,    0x60,0x0c,   // YOE TCON11 
  200.     5,      Y_INC,  TC_ADDR_PORT_95,    0x61,0x40, 
  201.     5,      Y_INC,  TC_ADDR_PORT_95,    0x62,0x0c,
  202.     5,      Y_INC,  TC_ADDR_PORT_95,    0x63,0x94,
  203.     5,      Y_INC,  TC_ADDR_PORT_95,    0x64,0x52,
  204.     5,      Y_INC,  TC_ADDR_PORT_95,    0x65,0x14,
  205.     5,      Y_INC,  TC_ADDR_PORT_95,    0x66,0x80,  
  206. */
  207. /*
  208. 5,      Y_INC,  TC_ADDR_PORT_95,    0x20,0x0c,  // FXDIO TCON3
  209.     5,      Y_INC,  TC_ADDR_PORT_95,    0x21,0x40,
  210.     5,      Y_INC,  TC_ADDR_PORT_95,    0x22,0x0c,
  211.     5,      Y_INC,  TC_ADDR_PORT_95,    0x23,0xa0,
  212.     5,      Y_INC,  TC_ADDR_PORT_95,    0x24,0x22,
  213.     5,      Y_INC,  TC_ADDR_PORT_95,    0x25,0xa1,
  214.     5,      Y_INC,  TC_ADDR_PORT_95,    0x26,0x80,    
  215.     5,      Y_INC,  TC_ADDR_PORT_95,    0x28,0x0c,  // XSTB TCON4
  216.     5,      Y_INC,  TC_ADDR_PORT_95,    0x29,0x40,
  217.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2A,0X0c,
  218.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2B,0x35,
  219.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2C,0x22,
  220.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2D,0xac,
  221.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2E,0x80,    
  222. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON7
  223. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  224. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0D,
  225. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  226. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  227. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  228. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x88,    
  229. 5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON7
  230.     5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  231.     5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0D,
  232.     5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  233.     5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  234.     5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  235.     5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x8C,    
  236. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON6
  237. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  238. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0E,
  239. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  240. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  241. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  242. //    5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x88,    
  243. 5,      Y_INC,  TC_ADDR_PORT_95,    0x08,0x0c,  // BXDIO TCON0
  244.     5,      Y_INC,  TC_ADDR_PORT_95,    0x09,0x40,
  245.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0A,0x0c,
  246.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0B,0x9f,
  247.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0C,0x22,
  248.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0D,0xa9,
  249.     5,      Y_INC,  TC_ADDR_PORT_95,    0x0E,0x80,    
  250. 5,      Y_INC,  TC_ADDR_PORT_95,    0x30,0x0c,  // YCLK TCON5
  251.     5,      Y_INC,  TC_ADDR_PORT_95,    0x31,0x40,
  252.     5,      Y_INC,  TC_ADDR_PORT_95,    0x32,0X0c,
  253.     5,      Y_INC,  TC_ADDR_PORT_95,    0x33,0xF4,
  254.     5,      Y_INC,  TC_ADDR_PORT_95,    0x34,0x21,
  255.     5,      Y_INC,  TC_ADDR_PORT_95,    0x35,0x94,
  256.     5,      Y_INC,  TC_ADDR_PORT_95,    0x36,0x80,  
  257. 5,      Y_INC,  TC_ADDR_PORT_95,    0x58,0x0c, // YDIO TCON10
  258.     5,      Y_INC,  TC_ADDR_PORT_95,    0x59,0x00,
  259.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5a,0x0e,
  260.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5b,0xd0,
  261.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5c,0x33,
  262.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5d,0xd7,
  263.     5,      Y_INC,  TC_ADDR_PORT_95,    0x5e,0x88,    
  264. 5,      Y_INC,  TC_ADDR_PORT_95,    0x60,0x0c,   // YOE TCON11
  265.     5,      Y_INC,  TC_ADDR_PORT_95,    0x61,0x40, 
  266.     5,      Y_INC,  TC_ADDR_PORT_95,    0x62,0x0c,
  267.     5,      Y_INC,  TC_ADDR_PORT_95,    0x63,0x94,
  268.     5,      Y_INC,  TC_ADDR_PORT_95,    0x64,0x52,
  269.     5,      Y_INC,  TC_ADDR_PORT_95,    0x65,0x14,
  270.     5,      Y_INC,  TC_ADDR_PORT_95,    0x66,0x80, 
  271. 5,      Y_INC,  TC_ADDR_PORT_95,    0x60,0x0c,   // YOE TCON11
  272.     5,      Y_INC,  TC_ADDR_PORT_95,    0x61,0x40, 
  273.     5,      Y_INC,  TC_ADDR_PORT_95,    0x62,0x0c,
  274.     5,      Y_INC,  TC_ADDR_PORT_95,    0x63,0x94,
  275.     5,      Y_INC,  TC_ADDR_PORT_95,    0x64,0x52,
  276.     5,      Y_INC,  TC_ADDR_PORT_95,    0x65,0x14,
  277.     5,      Y_INC,  TC_ADDR_PORT_95,    0x66,0xc0,    
  278. */
  279. /*
  280. 5,      Y_INC,  TC_ADDR_PORT_95,    0x10,0x0c,  // FXDIO TCON1
  281.     5,      Y_INC,  TC_ADDR_PORT_95,    0x11,0x40,
  282.     5,      Y_INC,  TC_ADDR_PORT_95,    0x12,0x0c,
  283.     5,      Y_INC,  TC_ADDR_PORT_95,    0x13,0xa0,
  284.     5,      Y_INC,  TC_ADDR_PORT_95,    0x14,0x22,
  285.     5,      Y_INC,  TC_ADDR_PORT_95,    0x15,0xa1,
  286.     5,      Y_INC,  TC_ADDR_PORT_95,    0x16,0x80,    
  287.     5,      Y_INC,  TC_ADDR_PORT_95,    0x18,0x0c,  // XSTB TCON2
  288.     5,      Y_INC,  TC_ADDR_PORT_95,    0x19,0x40,
  289.     5,      Y_INC,  TC_ADDR_PORT_95,    0x1A,0X0c,
  290.     5,      Y_INC,  TC_ADDR_PORT_95,    0x1B,0x35,
  291.     5,      Y_INC,  TC_ADDR_PORT_95,    0x1C,0x22,
  292.     5,      Y_INC,  TC_ADDR_PORT_95,    0x1D,0xac,
  293.     5,      Y_INC,  TC_ADDR_PORT_95,    0x1E,0x80,    
  294. 5,      Y_INC,  TC_ADDR_PORT_95,    0x20,0x0c,   // YOE TCON3 
  295.     5,      Y_INC,  TC_ADDR_PORT_95,    0x21,0x40, 
  296.     5,      Y_INC,  TC_ADDR_PORT_95,    0x22,0x0c,
  297.     5,      Y_INC,  TC_ADDR_PORT_95,    0x23,0x94,
  298.     5,      Y_INC,  TC_ADDR_PORT_95,    0x24,0x52,
  299.     5,      Y_INC,  TC_ADDR_PORT_95,    0x25,0x14,
  300.     5,      Y_INC,  TC_ADDR_PORT_95,    0x26,0xc0,    
  301. 5,      Y_INC,  TC_ADDR_PORT_95,    0x28,0x0c,  // BXDIO TCON4
  302.     5,      Y_INC,  TC_ADDR_PORT_95,    0x29,0x40,
  303.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2A,0x0c,
  304.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2B,0x9f,
  305.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2C,0x22,
  306.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2D,0xa9,
  307.     5,      Y_INC,  TC_ADDR_PORT_95,    0x2E,0x80,    
  308. 5,      Y_INC,  TC_ADDR_PORT_95,    0x50,0x0c, // YDIO TCON9
  309.     5,      Y_INC,  TC_ADDR_PORT_95,    0x51,0x00,
  310.     5,      Y_INC,  TC_ADDR_PORT_95,    0x52,0x0e,
  311.     5,      Y_INC,  TC_ADDR_PORT_95,    0x53,0xd0,
  312.     5,      Y_INC,  TC_ADDR_PORT_95,    0x54,0x33,
  313.     5,      Y_INC,  TC_ADDR_PORT_95,    0x55,0xd7,
  314.     5,      Y_INC,  TC_ADDR_PORT_95,    0x56,0x88,    
  315. 5,      Y_INC,  TC_ADDR_PORT_95,    0x30,0x0c,  // YCLK TCON5
  316.     5,      Y_INC,  TC_ADDR_PORT_95,    0x31,0x40,
  317.     5,      Y_INC,  TC_ADDR_PORT_95,    0x32,0X0c,
  318.     5,      Y_INC,  TC_ADDR_PORT_95,    0x33,0xF4,
  319.     5,      Y_INC,  TC_ADDR_PORT_95,    0x34,0x21,
  320.     5,      Y_INC,  TC_ADDR_PORT_95,    0x35,0x94,
  321.     5,      Y_INC,  TC_ADDR_PORT_95,    0x36,0x80,    
  322. #if(ANTI_FLICKER)
  323.     5,      Y_INC,  TC_ADDR_PORT_95,    0x38,0x0c,   // POL TCON6
  324.     5,      Y_INC,  TC_ADDR_PORT_95,    0x39,0x40,
  325.     5,      Y_INC,  TC_ADDR_PORT_95,    0x3a,0x0E,
  326.     5,      Y_INC,  TC_ADDR_PORT_95,    0x3b,0x00,
  327.     5,      Y_INC,  TC_ADDR_PORT_95,    0x3c,0x00,
  328.     5,      Y_INC,  TC_ADDR_PORT_95,    0x3d,0x01,
  329.     5,      Y_INC,  TC_ADDR_PORT_95,    0x3e,0x88,    
  330.   
  331. 5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON7
  332.     5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  333.     5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0D,
  334.     5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  335.     5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  336.     5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  337.     5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x8C,    
  338. #else
  339.     5,      Y_INC,  TC_ADDR_PORT_95,    0x40,0x0c,   // POL TCON7
  340.     5,      Y_INC,  TC_ADDR_PORT_95,    0x41,0x40,
  341.     5,      Y_INC,  TC_ADDR_PORT_95,    0x42,0x0D,
  342.     5,      Y_INC,  TC_ADDR_PORT_95,    0x43,0x00,
  343.     5,      Y_INC,  TC_ADDR_PORT_95,    0x44,0x00,
  344.     5,      Y_INC,  TC_ADDR_PORT_95,    0x45,0x01,
  345.     5,      Y_INC,  TC_ADDR_PORT_95,    0x46,0x88,    
  346. #endif
  347. */
  348. //---------------------------------------------------------------
  349. // For RSDS TCON END
  350. //---------------------------------------------------------------
  351.     7,      Y_INC,  PLL_DIV_CTRL0_C8,   0x04,0x00,0x20,0x18,
  352.  
  353.     8,      Y_INC,  DPLL_CTRL_D0,       0x10,0xa2,0x52,0x2f,0x06,   // DCLK=100MHz
  354.     13,     Y_INC,  PLL1_CTRL_D6,       0xf2,0x11,0x00,0x7f,0x30,0x0a,0x04,0x3f,0xff,0x81,
  355.     //4,      N_INC,  ADC_CTRL_E6,        0xb0,
  356.     4,      N_INC,  ADC_CTRL_E6,        0x40,
  357.     4,      N_INC,  DV_BKGD_STA_31,     0x60,
  358.     3,      ADC_FRAME_MODULE_EB,        0x06,
  359.     9,      Y_INC,  TMDS_OUTPUT_ENA_A0, 0x0f, 0xef,0x8b,0x26,0x35,0x2f,
  360.     0
  361. };
  362. unsigned char code RTD_DDC_TABLE[]  =
  363. {
  364.     5,      Y_INC,  DDC_ENABLE_FC,      0x00,0x00,  // Disable the DDC channel of VGA
  365.     131,    N_INC,  DDC_ACCESS_P_FE,    0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
  366.                                         0x4a,0x8b,0x00,0x00,0x01,0x01,0x01,0x01,
  367.                                         0x1e,0x0c,0x01,0x01,0x0e,0x24,0x1b,0x78,
  368.                                         0xe8,0x8a,0x01,0x9a,0x58,0x52,0x8b,0x28,
  369.                                         0x1e,0x50,0x54,0xff,0xff,0x80,0x61,0x40,
  370.                                         0x61,0x4f,0x61,0x59,0x71,0x4f,0x81,0x40,
  371.                                         0x81,0x59,0x81,0x99,0xa9,0x40,0x00,0x00,
  372.                                         0x00,0xfc,0x00,0x31,0x37,0x27,0x27,0x20,
  373.                                         0x4c,0x43,0x44,0x0a,0x20,0x20,0x20,0x20,
  374.                                         0x00,0x00,0x00,0xfc,0x00,0x4d,0x6f,0x6e,
  375.                                         0x69,0x74,0x6f,0x72,0x0a,0x20,0x20,0x20,
  376.                                         0x20,0x20,0x00,0x00,0x00,0xfd,0x00,0x2b,
  377.                                         0x55,0x14,0x5c,0x0e,0x00,0x0a,0x20,0x20,
  378.                                         0x20,0x20,0x20,0x20,0x00,0x00,0x00,0xff,
  379.                                         0x00,0x30,0x30,0x30,0x30,0x30,0x31,0x0a,
  380.                                         0x20,0x20,0x20,0x20,0x20,0x20,0x00,0xbd,
  381.     4,  N_INC,  DDC_ENABLE_FC,          0x05,       // Enable the DDC channel of VGA
  382.     
  383. #if(TMDS_ENABLE)
  384.     5,      Y_INC,  DDC_ENABLE_BC,      0x00,0x00,  // Disable the DDC channel  of DVI
  385.     131,    N_INC,  DDC_ACCESS_PORT_BE, 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00,
  386.                                         0x26,0xCD,0x68,0x46,0x00,0x00,0x00,0x00,
  387.                                         0x23,0x0c,0x01,0x03,0x81,0x24,0x1D,0x78,
  388.                                         0xeF,0x0D,0xC2,0xa0,0x57,0x47,0x98,0x27,                                        
  389.                                         0x12,0x48,0x4F,0xBF,0xEF,0x00,0x81,0x80,
  390.                                         0x81,0x8F,0x61,0x40,0x61,0x59,0x45,0x40,
  391.                                         0x45,0x59,0x31,0x40,0x31,0x59,0xBC,0x34,
  392.                                         0x00,0x98,0x51,0x00,0x2A,0x40,0x10,0x90,
  393.                                         0x13,0x00,0x68,0x22,0x11,0x00,0x00,0x1e,
  394.                                         0x00,0x00,0x00,0xFF,0x00,0x30,0x0A,0x20,
  395.                                         0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
  396.                                         0x20,0x20,0x00,0x00,0x00,0xFC,0x00,0x41,
  397.                                         0x53,0x34,0x36,0x33,0x37,0x20,0x20,0x20,
  398.                                         0x20,0x20,0x20,0x20,0x00,0x00,0x00,0xFD,
  399.                                         0x00,0x38,0x55,0x18,0x50,0x0E,0x00,0x0A,
  400.    0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x06,
  401.     4,  N_INC,  DDC_ENABLE_BC,          0x05,       // Enable the DDC channel of DVI
  402. #endif
  403.     0
  404. };
  405. unsigned char code RTD_IO_INI[]  =
  406. {
  407.     4,      N_INC,  TC_ADDR_PORT_95,    0x00,
  408.     7,      N_INC,  TC_DATA_PORT_96,    0x00,0x10,0x11,0x08,
  409. #if((OUTPUT_BUS == LVDS_TYPE) || (OUTPUT_BUS == TTL_TYPE))
  410. #if(LVDS_MAP1 == LVDS_MAP)
  411.     8,      Y_INC,  LVDS_CTRL0_C0,      0x00,0xa3,0x22,0x80,0x80,
  412. #else
  413.     8,      Y_INC,  LVDS_CTRL0_C0,      0x00,0xa3,0x23,0x80,0x80,
  414. #endif
  415. #else  
  416. 5, Y_INC, 0x57,0xa0,0x04,
  417.     4,      N_INC,  TC_ADDR_PORT_95,    0x00,
  418. //7,      N_INC,  TC_DATA_PORT_96,    0xa2,0x60,0x63,0x9a, //enable global tcon
  419.     7,      N_INC,  TC_DATA_PORT_96,    0xa2,0x40,0x43,0x89, //enable global tcon
  420.     4,      N_INC,  TC_ADDR_PORT_95,    0x00,
  421.     4,      N_INC,  TC_DATA_PORT_96,    0xc2, 
  422. //#if(ANTI_FLICKER)
  423. //    5,      Y_INC,  ANTI_FLICKER_TH1_5B,0x08,0xa5,
  424.     5,      Y_INC,  0x5B,0x08,0xa5,
  425. //#endif
  426. #endif
  427.     0
  428. };
  429. // Be Careful !!
  430. // Display window setting in FreeV[] MUST follow the definition of
  431. // 1. DISP_WID and DISP_LEN
  432. // 2. DH_ACT_STA_POS and DH_ACT_END_POS
  433. // 3. DV_ACT_STA_POS and DV_ACT_END_POS
  434. // 4. Background window must be the same as active window.
  435. unsigned char code FreeV[]  =
  436. {
  437. #if (SPREAD_SPECTRUM)
  438.     4,  N_INC,  DPLL_CTRL_D0,       0x09,                                           // Enable DCLK
  439. #else
  440.     4,  N_INC,  DPLL_CTRL_D0,       0x11,                                           // Enable DCLK
  441. #endif
  442.     27, Y_INC,  VDIS_CTRL_20,       0x20 | DISP_BIT | DISPLAY_PORT,                 // Disable display timing
  443.                                     DISP_INV,
  444.                                     (STD_DH_TOTAL & 0xff), (STD_DH_TOTAL >> 8),     // DH_TOTAL
  445.                                     STD_HSYNC_WIDTH,                                // DH_HS_END
  446.                                     (DH_ACT_STA_POS & 0xff), (DH_ACT_STA_POS >> 8), // DH_BKGD_STA
  447.                                     (DH_ACT_STA_POS & 0xff), (DH_ACT_STA_POS >> 8), // DH_ACT_STA
  448.                                     (DH_ACT_END_POS & 0xff), (DH_ACT_END_POS >> 8), // DH_ACT_END
  449.                                     (DH_ACT_END_POS & 0xff), (DH_ACT_END_POS >> 8), // DH_BKGD_END
  450.                                     (STD_DV_TOTAL & 0xff), (STD_DV_TOTAL >> 8),     // DV_TOTAL
  451.                                     STD_VSYNC_LENGTH,                               // DV_VS_END
  452.                                     (DV_ACT_STA_POS & 0xff), (DV_ACT_STA_POS >> 8) | AUTO_SWITCH, // DV_BKGD_STA
  453.                                     (DV_ACT_STA_POS & 0xff), (DV_ACT_STA_POS >> 8), // DV_ACT_STA
  454.                                     (DV_ACT_END_POS & 0xff), (DV_ACT_END_POS >> 8), // DV_ACT_END
  455.                                     (DV_ACT_END_POS & 0xff), (DV_ACT_END_POS >> 8), // DV_BKGD_END
  456.     4,  N_INC,  VDIS_CTRL_20,       0x23 | DISP_BIT | DISPLAY_PORT,                 // Enable free-run background
  457.     // Force display timing start
  458.     6,  Y_INC,  YUV2RGB_39,         0x00, 0x20 | DCLK_DELAY, 0x04 | DCLK_INV,
  459.     4,  N_INC,  DIS_TIMING0_3A,     0x00 | DCLK_DELAY,
  460.     4,  N_INC,  INT_FLD_DETECT_14,  0x00,
  461.     5,  Y_INC,  IVS_DELAY_8C,       0x00, 0x00,
  462. 4,  N_INC,  SCALE_CTRL_15,      0x00,
  463.     4,  N_INC,  FILTER_CTRL0_1B,    0xc4,
  464.     0
  465. };
  466. unsigned char code OSD_PWUP_INI[]   =
  467. {
  468.     5,  Y_INC,  OSD_ROW_90,     0xaf,0x0f,
  469.     6,  N_INC,  OSD_DATA_92,    0x2c,0xf0,0xf0,
  470.     5,  Y_INC,  OSD_ROW_90,     0xaf,0x19,
  471.     5,  N_INC,  OSD_DATA_92,    0x00,0x88,
  472.     5,  Y_INC,  OSD_ROW_90,     0xaf,0x1c,  //set the window3 & window4 offset = 0
  473.     5,  N_INC,  OSD_DATA_92,    0x80,0x80,
  474.     0
  475. };
  476. ///////////////////////////////////////////////////////////////////////////
  477. //VGA mode detect range
  478. unsigned int code VGA_Mode[][6] =
  479. {
  480. //      HF_min, HF_max, VL_min, VL_max, HF_std, VS+1
  481.     {   0,      0,      0,      0,      0,      0       }, //00:No Signal
  482.     {   764,    806,    620,    636,    781,    2+1     }, //01:VGA [640/720]*350*50Hz
  483.     {   764,    806,    620,    636,    781,    2+1     }, //02:VGA [640/720]*400*50Hz
  484.     {   764,    806,    516,    532,    781,    2+1     }, //03:VGA [640/720]*350*60Hz
  485.     {   764,    806,    516,    532,    781,    2+1     }, //04:VGA [640/720]*400*60Hz
  486.     {   969,    1021,   431,    447,    990,    8+1     }, //05:640*400*56hz
  487.     {   768,    810,    440,    456,    785,    2+1     }, //06:640*350*70hz
  488.     {   764,    806,    440,    456,    781,    2+1     }, //07:720*350*70hz
  489.     {   764,    806,    440,    456,    781,    2+1     }, //08:640*400*70hz
  490.     {   764,    806,    440,    456,    781,    2+1     }, //09:700*400*70hz
  491.     {   635,    670,    436,    452,    649,    3+1     }, //10:640*350*85hz
  492.     {   635,    670,    436,    452,    649,    3+1     }, //11:640*400*85hz
  493.     {   634,    669,    437,    453,    648,    3+1     }, //12:720*400*85hz
  494.     {   764,    806,    620,    636,    781,    2+1     }, //13:640*480*50hz
  495.     {   764,    806,    516,    532,    781,    2+1     }, //14:640*480*60hz
  496.     {   687,    724,    516,    532,    702,    3+1     }, //15:640*480*66hz
  497.     {   635,    670,    511,    527,    649,    3+1     }, //16:640*480*72hz
  498.     {   641,    676,    495,    507,    655,    3+1     }, //17:640*480*75hz
  499.     {   556,    586,    500,    516,    568,    3+1     }, //18:640*480*85hz
  500.     {   684,    721,    616,    632,    699,    2+1     }, //19:800*600*56hz
  501.     {   635,    670,    619,    635,    649,    4+1     }, //20:800*600*60hz
  502.     {   492,    519,    721,    737,    503,    6+1     }, //21:800*600*66hz
  503.     {   500,    527,    657,    673,    511,    6+1     }, //22:800*600*72hz
  504.     {   513,    541,    616,    632,    524,    3+1     }, //23:800*600*75hz
  505.     {   448,    473,    622,    638,    458,    3+1     }, //24:800*600*85hz
  506.     {   483,    510,    658,    674,    494,    3+1     }, //25:832*624*75hz
  507.     {   497,    524,    797,    813,    508,    6+1     }, //26:1024*768*60hz
  508.     {   493,    520,    810,    826,    504,    6+1     }, //27:1024*768*59hz
  509.     {   445,    470,    807,    823,    455,    4+1     }, //28:1024*768*66hz
  510.     {   428,    449,    797,    813,    435,    6+1     }, //29:1024*768*70hz
  511.     {   399,    421,    795,    811,    408,    3+1     }, //30:1024*768*74hz
  512.     {   400,    422,    791,    807,    409,    3+1     }, //31:1024*768*75hz
  513.     {   350,    370,    799,    815,    358,    3+1     }, //32:1024*768*85hz
  514.     {   339,    358,    834,    850,    347,    8+1     }, //33:1024*800*84hz
  515.     {   356,    376,    891,    907,    364,    3+1     }, //34:1152*864*75hz
  516.     {   350,    370,    906,    922,    358,    3+1     }, //35:1152*870*75hz
  517.     {   389,    411,    928,    944,    398,    4+1     }, //36:1152*900*66hz
  518.     {   335,    354,    934,    950,    343,    8+1     }, //37:1152*900*76hz
  519.     {   401,    423,    991,    1007,   410,    3+1     }, //38:1280*960*60hz
  520.     {   280,    295,    1002,   1018,   286,    3+1     }, //39:1280*960*85hz
  521.     {   376,    396,    1057,   1073,   384,    3+1     }, //40:1280*1024*60hz
  522.     {   312,    329,    1060,   1076,   319,    3+1     }, //41:1280*1024*72hz
  523.     {   296,    313,    1057,   1073,   303,    8+1     }, //42:1280*1024*76hz
  524.     {   300,    317,    1057,   1073,   307,    3+1     }, //43:1280*1024*75hz
  525.     {   264,    279,    1063,   1079,   270,    3+1     }, //44:1280*1024*85hz
  526.     {   321,    339,    1241,   1257,   328,    3+1     }, //45:1600*1200*60hz
  527.     {   0,      0,      0,      0,      0,      0       }, //46:Mode reserved 00
  528.     {   0,      0,      0,      0,      0,      0       }, //47:Mode reserved 01
  529.     {   0,      0,      0,      0,      0,      0       }, //48:Mode reserved 02
  530.     {   0,      0,      0,      0,      0,      0       }, //49:Mode reserved 03
  531.     {   642,    1230,   418,    497,    0,      2+1     }, //50:NewMode720x400
  532.     {   535,    1025,   498,    637,    0,      2+1     }, //51:NewMode640x480
  533.     {   428,    820,    618,    785,    0,      2+1     }, //52:NewMode800x600
  534.     {   334,    641,    786,    881,    0,      2+1     }, //53:NewMode1024x768
  535.     {   297,    570,    882,    917,    0,      2+1     }, //54:NewMode1152x864
  536.     {   285,    547,    918,    977,    0,      2+1     }, //55:NewMode1152x900
  537.     {   267,    513,    978,    1041,   0,      2+1     }, //56:NewMode1280x960
  538.     {   251,    481,    1042,   1217,   0,      2+1     }, //57:NewMode1280x1024
  539.     {   292,    559,    1218,   1328,   0,      2+1     }, //58:NewMode1600x1200
  540. };
  541. unsigned int code Mode_Preset[][5]   =
  542. {
  543.     //  DH_TOTAL    DH_ACT_WID  DV_ACT_LEN      DCLK_M/N    IVS_DELAY
  544.     {   1408,       1280,       1024,           0,          0       }, //00:No Signal
  545.     //  VGA confused mode
  546.     {   1408,       1280,       1024,           0,          63      }, //01:VGA [640/720]*350*50Hz
  547.     {   1408,       1280,       1024,           0,          31      }, //02:VGA [640/720]*400*50Hz
  548.     {   1408,       1280,       1024,           0,          63      }, //03:VGA [640/720]*350*60Hz
  549.     {   1408,       1280,       1024,           0,          31      }, //04:VGA [640/720]*400*60Hz
  550.     //  Standard mode
  551.     {   1408,       1280,       1024,           0,          7       }, //05:640*400*56hz
  552.     {   1408,       1280,       1024,           0,          7       }, //06:640*350*70hz
  553.     {   1408,       1280,       1024,           0,          7       }, //07:720*350*70hz
  554.     {   1408,       1280,       1024,           0,          7       }, //08:640*400*70hz
  555.     {   1408,       1280,       1024,           0,          7       }, //09:700*400*70hz
  556.     {   1408,       1280,       896,            0,          7       }, //10:640*350*85hz
  557.     {   1408,       1280,       1024,           0,          7       }, //11:640*400*85hz
  558.     {   1408,       1280,       1024,           0,          7       }, //12:720*400*85hz
  559.     {   1408,       1280,       1024,           0,          31      }, //13:640*480*50hz
  560.     {   1408,       1280,       1024,           0,          7       }, //14:640*480*60hz
  561.     {   1408,       1280,       1024,           0,          7       }, //15:640*480*66hz
  562.     {   1408,       1280,       1024,           0,          7       }, //16:640*480*72hz
  563.     {   1408,       1280,       1024,           0,          3       }, //17:640*480*75hz
  564.     {   1408,       1280,       1024,           0,          7       }, //18:640*480*85hz
  565.     {   1408,       1280,       1024,           0,          3       }, //19:800*600*56hz
  566.     {   1408,       1280,       1024,           0,          7       }, //20:800*600*60hz
  567.     {   1408,       1280,       1024,           0,          7       }, //21:800*600*66hz
  568.     {   1408,       1280,       1024,           0,          7       }, //22:800*600*72hz
  569.     {   1408,       1280,       1024,           0,          3       }, //23:800*600*75hz
  570.     {   1408,       1280,       1024,           0,          7       }, //24:800*600*85hz
  571.     {   1408,       1280,       1024,           0,          7       }, //25:832*624*75hz
  572.     {   1424,       1280,       1024,           0,          7       }, //26:1024*768*60hz
  573.     {   1424,       1280,       1024,           0,          7       }, //27:1024*768*59hz
  574.     {   1408,       1280,       1024,           0,          7       }, //28:1024*768*66hz
  575.     {   1408,       1280,       1024,           0,          7       }, //29:1024*768*70hz
  576.     {   1408,       1280,       1024,           0,          7       }, //30:1024*768*74hz
  577.     {   1408,       1280,       1024,           0,          7       }, //31:1024*768*75hz
  578.     {   1408,       1280,       1024,           0,          7       }, //32:1024*768*85hz
  579.     {   1408,       1280,       1024,           0,          7       }, //33:1024*800*84hz
  580.     {   1408,       1280,       1024,           0,          7       }, //34:1152*864*75hz
  581.     {   1408,       1280,       1024,           0,          7       }, //35:1152*870*75hz
  582.     {   1408,       1280,       1024,           0,          7       }, //36:1152*900*66hz
  583.     {   1408,       1280,       1024,           0,          7       }, //37:1152*900*76hz
  584.     {   1408,       1280,       1024,           0,          7       }, //38:1280*960*60hz
  585.     {   1408,       1280,       1024,           0,          7       }, //39:1280*960*85hz
  586.     {   1408,       1280,       1024,           0,          7       }, //40:1280*1024*60hz
  587.     {   1408,       1280,       1024,           0,          7       }, //41:1280*1024*72hz
  588.     {   1408,       1280,       1024,           0,          7       }, //42:1280*1024*76hz
  589.     {   1408,       1280,       1024,           0,          7       }, //43:1280*1024*75hz
  590.     {   1408,       1280,       1024,           0,          7       }, //44:1280*1024*85hz
  591.     {   1408,       1280,       1024,           0,          7       }, //45:1600*1200*60hz
  592.     //  Reserved mode
  593.     {   1408,       1280,       1024,           0,          0       }, //46:Mode reserved 00
  594.     {   1408,       1280,       1024,           0,          0       }, //47:Mode reserved 01
  595.     {   1408,       1280,       1024,           0,          0       }, //48:Mode reserved 02
  596.     {   1408,       1280,       1024,           0,          0       }, //49:Mode reserved 03
  597.     //  Unknown user mode
  598.     {   1408,       1280,       1024,           0,          3       }, //50:NewMode720x400
  599.     {   1408,       1280,       1024,           0,          3       }, //51:NewMode640x480
  600.     {   1408,       1280,       1024,           0,          3       }, //52:NewMode800x600
  601.     {   1408,       1280,       1024,           0,          3       }, //53:NewMode1024x768
  602.     {   1408,       1280,       1024,           0,          3       }, //54:NewMode1152x864
  603.     {   1408,       1280,       1024,           0,          3       }, //55:NewMode1152x900
  604.     {   1408,       1280,       1024,           0,          3       }, //56:NewMode1280x960
  605.     {   1408,       1280,       1024,           0,          3       }, //57:NewMode1280x1024
  606.     {   1408,       1280,       1024,           0,          3       }, //58:NewMode1600x1200
  607.     
  608.     //  Safe display mode
  609.     {   1408,       1280,       1024,           0,          3       }, //59:Undefined SU mode
  610.     {   1408,       1280,       1024,           0,          3       }, //60:Undefined SD mode
  611. };
  612. ///////////////////////////////////////////////////////////////////////////////
  613. //Video Setting
  614. #if (VIDEO_CHIP == VDC_NONE)
  615. // No Video Decoder
  616. unsigned char code RTD_VIDEO_60[]   = { 0 };
  617. unsigned char code RTD_VIDEO_50[]   = { 0 };
  618. #else
  619. #if (VIDEO_CHIP == VDC_SAA7114 || VIDEO_CHIP == VDC_SAA7115 || VIDEO_CHIP == VDC_SAA7118)
  620. #define H_60    0x91//0x70    // For SAA7114/7118
  621. #define H_50    0x91//0x7c    // For SAA7114/7118
  622. #else
  623. #define H_60    0x56    // For SAA7111A
  624. #define H_50    0x5e    // For SAA7111A
  625. #endif
  626. unsigned char code RTD_VIDEO_60[]   =
  627. {
  628.     11, Y_INC,  IPH_ACT_STA_06,     H_60, 0x00, 0xb8, 0x02,
  629.                                     0x14, 0x00, 0xed, 0x00,
  630.     10, Y_INC,  INT_FLD_DETECT_14,  0x14, 0x03, 0x33, 0x8b, 0x40, 0x3b, 0x30,
  631.     4,  N_INC,  FS_FT_DELAY_1E,     0x1a,
  632.     
  633.     7,  Y_INC,  DRW_BSU_40,         0xb8, 0x02, 0xed, 0x00,
  634.     4,  N_INC,  OP_CRC_CTRL_68,     0x48,
  635.     4,  N_INC,  SD_CTRL_70,         0x00 | VIDEO_ICLK_DELAY,
  636.     5,  Y_INC,  IVS_DELAY_8C,       0x00, 0x00,
  637. #if (SPREAD_SPECTRUM)
  638.     8,  Y_INC,  DPLL_CTRL_D0,       0x09, 0x9a, 0x52, 0x0a, 0xf7,
  639. #else    
  640.     8,  Y_INC,  DPLL_CTRL_D0,       0x11, 0x9a, 0x52, 0x2f, 0x06,
  641. #endif
  642. //  6,  Y_INC,  DPLL_CTRL_D0,       0x11, 0x44, 0x47,
  643.     29, Y_INC,  VDIS_CTRL_20,       0x28 | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  644.                                     DISP_INV,
  645.                                     0x7c, 0x05,
  646.                                     0x10,
  647.                                     0x20, 0x00,
  648.                                     0x20, 0x00,
  649.                                     0x20, 0x05,
  650.                                     0x20, 0x05,
  651.                                     0x80, 0x04,
  652.                                     0x03,
  653.                                     0x0f, 0x00,
  654.                                     0x0f, 0x00,
  655.                                     0x0f, 0x04,
  656.                                     0x0f, 0x04,
  657.                                     0x13, 0x20,
  658.     4,  N_INC,  VDIS_CTRL_20,       0x2b | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  659.     5,  Y_INC,  VGIP_CTRL_04,       0x0d, 0x00 | VIDEO_LATCH,
  660.     0
  661. };
  662. unsigned char code RTD_VIDEO_50[]=
  663. {
  664.     11, Y_INC,  IPH_ACT_STA_06,     H_50, 0x00, 0xb8, 0x02,
  665.                                     0x18, 0x00, 0x1a, 0x01,
  666.     10, Y_INC,  INT_FLD_DETECT_14,  0x14, 0x03, 0x33, 0x8b, 0x80, 0x46, 0x30,
  667.     4,  N_INC,  FS_FT_DELAY_1E,     0x1a,
  668.     
  669.     7,  Y_INC,  DRW_BSU_40,         0xb8, 0x02, 0x1a, 0x01,
  670.     4,  N_INC,  OP_CRC_CTRL_68,     0x48,
  671.     4,  N_INC,  SD_CTRL_70,         0x00 | VIDEO_ICLK_DELAY,
  672.     5,  Y_INC,  IVS_DELAY_8C,       0x00, 0x00,
  673. #if (SPREAD_SPECTRUM)
  674.     8,  Y_INC,  DPLL_CTRL_D0,       0x09, 0x82, 0x52, 0x0b, 0xf7,
  675. #else    
  676.     8,  Y_INC,  DPLL_CTRL_D0,       0x11, 0x82, 0x52, 0x2f, 0x06,
  677. #endif
  678. //  6,  Y_INC,  DPLL_CTRL_D0,       0x11, 0x75, 0x07,
  679.     29, Y_INC,  VDIS_CTRL_20,       0x28 | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  680.                                     DISP_INV,
  681.                                     0x96, 0x05,
  682.                                     0x10,
  683.                                     0x20, 0x00,
  684.                                     0x20, 0x00,
  685.                                     0x20, 0x05,
  686.                                     0x20, 0x05,
  687.                                     0x80, 0x04,
  688.                                     0x03,
  689.                                     0x0d, 0x00,
  690.                                     0x0d, 0x00,
  691.                                     0x0d, 0x04,
  692.                                     0x0d, 0x04,
  693.                                     0x17, 0x20,
  694.     4,  N_INC,  VDIS_CTRL_20,       0x2b | DISP_BIT | DISPLAY_PORT | DHS_MASK,
  695.     5,  Y_INC,  VGIP_CTRL_04,       0x0d, 0x00 | VIDEO_LATCH,
  696.     0
  697. };
  698. #endif
  699. #else 
  700. extern unsigned char code RTD_PWUP_INI[];
  701. extern unsigned char code RTD_DDC_TABLE[];
  702. extern unsigned char code RTD_IO_INI[];
  703. extern unsigned char code FreeV[];
  704. extern unsigned char code OSD_PWUP_INI[];
  705. extern unsigned int code VGA_Mode[][6];
  706. extern unsigned int code Mode_Preset[][5];
  707. extern unsigned char code RTD_VIDEO_60[];
  708. extern unsigned char code RTD_VIDEO_50[];
  709. #endif