vino.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /*
  2. * Driver for the VINO (Video In No Out) system found in SGI Indys.
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License version 2 as published by the Free Software Foundation.
  6. *
  7. * Copyright (C) 1999 Ulf Karlsson <ulfc@bun.falkenberg.se>
  8. * Copyright (C) 2003 Ladislav Michl <ladis@linux-mips.org>
  9. */
  10. #ifndef _VINO_H_
  11. #define _VINO_H_
  12. #define VINO_BASE 0x00080000 /* Vino is in the EISA address space,
  13. * but it is not an EISA bus card */
  14. #define VINO_PAGE_SIZE 4096
  15. struct sgi_vino_channel {
  16. u32 _pad_alpha;
  17. volatile u32 alpha;
  18. #define VINO_CLIP_X(x) ((x) & 0x3ff) /* bits 0:9 */
  19. #define VINO_CLIP_ODD(x) (((x) & 0x1ff) << 10) /* bits 10:18 */
  20. #define VINO_CLIP_EVEN(x) (((x) & 0x1ff) << 19) /* bits 19:27 */
  21. u32 _pad_clip_start;
  22. volatile u32 clip_start;
  23. u32 _pad_clip_end;
  24. volatile u32 clip_end;
  25. #define VINO_FRAMERT_FULL 0xfff
  26. #define VINO_FRAMERT_PAL (1<<0) /* 0=NTSC 1=PAL */
  27. #define VINO_FRAMERT_RT(x) (((x) & 0xfff) << 1) /* bits 1:12 */
  28. u32 _pad_frame_rate;
  29. volatile u32 frame_rate;
  30. u32 _pad_field_counter;
  31. volatile u32 field_counter;
  32. u32 _pad_line_size;
  33. volatile u32 line_size;
  34. u32 _pad_line_count;
  35. volatile u32 line_count;
  36. u32 _pad_page_index;
  37. volatile u32 page_index;
  38. u32 _pad_next_4_desc;
  39. volatile u32 next_4_desc;
  40. u32 _pad_start_desc_tbl;
  41. volatile u32 start_desc_tbl;
  42. #define VINO_DESC_JUMP (1<<30)
  43. #define VINO_DESC_STOP (1<<31)
  44. #define VINO_DESC_VALID (1<<32)
  45. u32 _pad_desc_0;
  46. volatile u32 desc_0;
  47. u32 _pad_desc_1;
  48. volatile u32 desc_1;
  49. u32 _pad_desc_2;
  50. volatile u32 desc_2;
  51. u32 _pad_Bdesc_3;
  52. volatile u32 desc_3;
  53. u32 _pad_fifo_thres;
  54. volatile u32 fifo_thres;
  55. u32 _pad_fifo_read;
  56. volatile u32 fifo_read;
  57. u32 _pad_fifo_write;
  58. volatile u32 fifo_write;
  59. };
  60. struct sgi_vino {
  61. #define VINO_CHIP_ID 0xb
  62. #define VINO_REV_NUM(x) ((x) & 0x0f)
  63. #define VINO_ID_VALUE(x) (((x) & 0xf0) >> 4)
  64. u32 _pad_rev_id;
  65. volatile u32 rev_id;
  66. #define VINO_CTRL_LITTLE_ENDIAN (1<<0)
  67. #define VINO_CTRL_A_EOF_INT (1<<1) /* Field transferred int */
  68. #define VINO_CTRL_A_FIFO_INT (1<<2) /* FIFO overflow int */
  69. #define VINO_CTRL_A_EOD_INT (1<<3) /* End of desc table int */
  70. #define VINO_CTRL_A_INT (VINO_CTRL_A_EOF_INT | \
  71. VINO_CTRL_A_FIFO_INT | \
  72. VINO_CTRL_A_EOD_INT)
  73. #define VINO_CTRL_B_EOF_INT (1<<4) /* Field transferred int */
  74. #define VINO_CTRL_B_FIFO_INT (1<<5) /* FIFO overflow int */
  75. #define VINO_CTRL_B_EOD_INT (1<<6) /* End of desc table int */
  76. #define VINO_CTRL_B_INT (VINO_CTRL_B_EOF_INT | \
  77. VINO_CTRL_B_FIFO_INT | \
  78. VINO_CTRL_B_EOD_INT)
  79. #define VINO_CTRL_A_DMA_ENBL (1<<7)
  80. #define VINO_CTRL_A_INTERLEAVE_ENBL (1<<8)
  81. #define VINO_CTRL_A_SYNC_ENBL (1<<9)
  82. #define VINO_CTRL_A_SELECT (1<<10) /* 1=D1 0=Philips */
  83. #define VINO_CTRL_A_RGB (1<<11) /* 1=RGB 0=YUV */
  84. #define VINO_CTRL_A_LUMA_ONLY (1<<12)
  85. #define VINO_CTRL_A_DEC_ENBL (1<<13) /* Decimation */
  86. #define VINO_CTRL_A_DEC_SCALE_MASK 0x1c000 /* bits 14:17 */
  87. #define VINO_CTRL_A_DEC_SCALE_SHIFT (14)
  88. #define VINO_CTRL_A_DEC_HOR_ONLY (1<<17) /* Horizontal only */
  89. #define VINO_CTRL_A_DITHER (1<<18) /* 24 -> 8 bit dither */
  90. #define VINO_CTRL_B_DMA_ENBL (1<<19)
  91. #define VINO_CTRL_B_INTERLEAVE_ENBL (1<<20)
  92. #define VINO_CTRL_B_SYNC_ENBL (1<<21)
  93. #define VINO_CTRL_B_SELECT (1<<22) /* 1=D1 0=Philips */
  94. #define VINO_CTRL_B_RGB (1<<23) /* 1=RGB 0=YUV */
  95. #define VINO_CTRL_B_LUMA_ONLY (1<<24)
  96. #define VINO_CTRL_B_DEC_ENBL (1<<25) /* Decimation */
  97. #define VINO_CTRL_B_DEC_SCALE_MASK 0x1c000000 /* bits 26:28 */
  98. #define VINO_CTRL_B_DEC_SCALE_SHIFT (26)
  99. #define VINO_CTRL_B_DEC_HOR_ONLY (1<<29) /* Decimation horizontal only */
  100. #define VINO_CTRL_B_DITHER (1<<30) /* ChanB 24 -> 8 bit dither */
  101. u32 _pad_control;
  102. volatile u32 control;
  103. #define VINO_INTSTAT_A_EOF (1<<0) /* Field transferred int */
  104. #define VINO_INTSTAT_A_FIFO (1<<1) /* FIFO overflow int */
  105. #define VINO_INTSTAT_A_EOD (1<<2) /* End of desc table int */
  106. #define VINO_INTSTAT_A (VINO_INTSTAT_A_EOF | \
  107. VINO_INTSTAT_A_FIFO | \
  108. VINO_INTSTAT_A_EOD)
  109. #define VINO_INTSTAT_B_EOF (1<<3) /* Field transferred int */
  110. #define VINO_INTSTAT_B_FIFO (1<<4) /* FIFO overflow int */
  111. #define VINO_INTSTAT_B_EOD (1<<5) /* End of desc table int */
  112. #define VINO_INTSTAT_B (VINO_INTSTAT_B_EOF | \
  113. VINO_INTSTAT_B_FIFO | \
  114. VINO_INTSTAT_B_EOD)
  115. u32 _pad_intr_status;
  116. volatile u32 intr_status;
  117. u32 _pad_i2c_control;
  118. volatile u32 i2c_control;
  119. u32 _pad_i2c_data;
  120. volatile u32 i2c_data;
  121. struct sgi_vino_channel a;
  122. struct sgi_vino_channel b;
  123. };
  124. #endif