smiLynxEM.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /*
  2. * (C) Copyright 1997-2002 ELTEC Elektronik AG
  3. * Frank Gottschling <fgottschling@eltec.de>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. /*
  24. * smiLynxEM.h
  25. * Silicon Motion graphic interface for sm810/sm710/sm712 accelerator
  26. *
  27. *
  28. * modification history
  29. * --------------------
  30. * 04-18-2002 Rewritten for U-Boot <fgottschling@eltec.de>.
  31. */
  32. #ifndef _SMI_LYNX_EM_H_
  33. #define _SMI_LYNX_EM_H_
  34. /*
  35. * SMI 710/712 have 4MB internal RAM; SMI 810 2MB internal + 2MB external
  36. */
  37. #define VIDEO_MEM_SIZE 0x400000
  38. /*
  39. * Supported video modes for SMI Lynx E/EM/EM+
  40. */
  41. #define VIDEO_MODES 7
  42. #define DUAL_800_600 0 /* SMI710:VGA1:75Hz (pitch=1600) */
  43. /* VGA2:60/120Hz (pitch=1600) */
  44. /* SMI810:VGA1:75Hz (pitch=1600) */
  45. /* VGA2:75Hz (pitch=1600) */
  46. #define DUAL_1024_768 1 /* VGA1:75Hz VGA2:73Hz (pitch=2048) */
  47. #define SINGLE_800_600 2 /* VGA1:75Hz (pitch=800) */
  48. #define SINGLE_1024_768 3 /* VGA1:75Hz (pitch=1024) */
  49. #define SINGLE_1280_1024 4 /* VGA1:75Hz (pitch=1280) */
  50. #define TV_MODE_CCIR 5 /* VGA1:50Hz (h=720;v=576;pitch=720) */
  51. #define TV_MODE_EIA 6 /* VGA1:60Hz (h=720;v=484;pitch=720) */
  52. /*
  53. * ISA mapped regs
  54. */
  55. #define SMI_INDX_C4 (pGD->isaBase + 0x03c4) /* index reg */
  56. #define SMI_DATA_C5 (pGD->isaBase + 0x03c5) /* data reg */
  57. #define SMI_INDX_D4 (pGD->isaBase + 0x03d4) /* index reg */
  58. #define SMI_DATA_D5 (pGD->isaBase + 0x03d5) /* data reg */
  59. #define SMI_INDX_CE (pGD->isaBase + 0x03ce) /* index reg */
  60. #define SMI_DATA_CF (pGD->isaBase + 0x03cf) /* data reg */
  61. #define SMI_LOCK_REG (pGD->isaBase + 0x03c3) /* unlock/lock ext crt reg */
  62. #define SMI_MISC_REG (pGD->isaBase + 0x03c2) /* misc reg */
  63. #define SMI_LUT_MASK (pGD->isaBase + 0x03c6) /* lut mask reg */
  64. #define SMI_LUT_START (pGD->isaBase + 0x03c8) /* lut start index */
  65. #define SMI_LUT_RGB (pGD->isaBase + 0x03c9) /* lut colors auto incr.*/
  66. /*
  67. * Video processor control
  68. */
  69. typedef struct {
  70. unsigned int control;
  71. unsigned int colorKey;
  72. unsigned int colorKeyMask;
  73. unsigned int start;
  74. unsigned short offset;
  75. unsigned short width;
  76. unsigned int fifoPrio;
  77. unsigned int fifoERL;
  78. unsigned int YUVtoRGB;
  79. } SmiVideoProc;
  80. /*
  81. * Video window control
  82. */
  83. typedef struct {
  84. unsigned short top;
  85. unsigned short left;
  86. unsigned short bottom;
  87. unsigned short right;
  88. unsigned int srcStart;
  89. unsigned short width;
  90. unsigned short offset;
  91. unsigned char hStretch;
  92. unsigned char vStretch;
  93. } SmiVideoWin;
  94. /*
  95. * Capture port control
  96. */
  97. typedef struct {
  98. unsigned int control;
  99. unsigned short topClip;
  100. unsigned short leftClip;
  101. unsigned short srcHeight;
  102. unsigned short srcWidth;
  103. unsigned int srcBufStart1;
  104. unsigned int srcBufStart2;
  105. unsigned short srcOffset;
  106. unsigned short fifoControl;
  107. } SmiCapturePort;
  108. /******************************************************************************/
  109. /* Export Graphic Driver Control */
  110. /******************************************************************************/
  111. typedef struct {
  112. unsigned int isaBase;
  113. unsigned int pciBase;
  114. unsigned int dprBase;
  115. unsigned int vprBase;
  116. unsigned int cprBase;
  117. unsigned int frameAdrs;
  118. unsigned int memSize;
  119. unsigned int mode;
  120. unsigned int gdfIndex;
  121. unsigned int gdfBytesPP;
  122. unsigned int fg;
  123. unsigned int bg;
  124. unsigned int plnSizeX;
  125. unsigned int plnSizeY;
  126. unsigned int winSizeX;
  127. unsigned int winSizeY;
  128. char modeIdent[80];
  129. } GraphicDevice;
  130. extern GraphicDevice smi;
  131. /******************************************************************************/
  132. /* Export Graphic Functions */
  133. /******************************************************************************/
  134. void *video_hw_init (void); /* returns GraphicDevice struct or NULL */
  135. void video_hw_bitblt (
  136. unsigned int bpp, /* bytes per pixel */
  137. unsigned int src_x, /* source pos x */
  138. unsigned int src_y, /* source pos y */
  139. unsigned int dst_x, /* dest pos x */
  140. unsigned int dst_y, /* dest pos y */
  141. unsigned int dim_x, /* frame width */
  142. unsigned int dim_y /* frame height */
  143. );
  144. void video_hw_rectfill (
  145. unsigned int bpp, /* bytes per pixel */
  146. unsigned int dst_x, /* dest pos x */
  147. unsigned int dst_y, /* dest pos y */
  148. unsigned int dim_x, /* frame width */
  149. unsigned int dim_y, /* frame height */
  150. unsigned int color /* fill color */
  151. );
  152. void video_set_lut (
  153. unsigned int index, /* color number */
  154. unsigned char r, /* red */
  155. unsigned char g, /* green */
  156. unsigned char b /* blue */
  157. );
  158. #endif /*_SMI_LYNX_EM_H_ */