The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/pci/meteor_reg.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1995 Mark Tinguely and Jim Lowe
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. All advertising materials mentioning features or use of this software
   14  *    must display the following acknowledgement:
   15  *      This product includes software developed by Mark Tinguely and Jim Lowe
   16  * 4. The name of the author may not be used to endorse or promote products 
   17  *    derived from this software without specific prior written permission.
   18  *
   19  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
   20  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   22  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
   23  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
   25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   26  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
   27  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
   28  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   29  * POSSIBILITY OF SUCH DAMAGE.
   30  *
   31  * $FreeBSD: releng/5.2/sys/pci/meteor_reg.h 59874 2000-05-01 20:32:07Z peter $
   32  */
   33 #ifndef PCI_LATENCY_TIMER
   34 #define PCI_LATENCY_TIMER               0x0c    /* pci timer register */
   35 #endif
   36 
   37 /*
   38  * Definitions for the Philips SAA7116 digital video to pci interface.
   39  */
   40 #define SAA7116_PHILIPS_ID                      0x12238086ul
   41 #define SAA7116_I2C_WRITE                       0x00
   42 #define SAA7116_I2C_READ                        0x01
   43 #define SAA7116_IIC_NEW_CYCLE                   0x1000000L
   44 #define SAA7116_IIC_DIRECT_TRANSFER_ABORTED     0x0000200L
   45 
   46 typedef volatile u_int  mreg_t;
   47 struct saa7116_regs {
   48         mreg_t  dma1e;          /* Base address for even field dma chn 1 */
   49         mreg_t  dma2e;          /* Base address for even field dma chn 2 */
   50         mreg_t  dma3e;          /* Base address for even field dma chn 3 */
   51         mreg_t  dma1o;          /* Base address for odd field dma chn 1 */
   52         mreg_t  dma2o;          /* Base address for odd field dma chn 2 */
   53         mreg_t  dma3o;          /* Base address for odd field dma chn 3 */
   54         mreg_t  stride1e;       /* Address stride for even field dma chn 1 */
   55         mreg_t  stride2e;       /* Address stride for even field dma chn 2 */
   56         mreg_t  stride3e;       /* Address stride for even field dma chn 3 */
   57         mreg_t  stride1o;       /* Address stride for odd field dma chn 1 */
   58         mreg_t  stride2o;       /* Address stride for odd field dma chn 2 */
   59         mreg_t  stride3o;       /* Address stride for odd field dma chn 3 */
   60         mreg_t  routee;         /* Route/mode even */
   61         mreg_t  routeo;         /* Route/mode odd */
   62         mreg_t  fifo_t;         /* FIFO trigger for PCI int */
   63         mreg_t  field_t;        /* Field toggle */
   64         mreg_t  cap_cntl;       /* Capture control */
   65         mreg_t  retry_wait_cnt; /* Clks for master to wait after disconnect */
   66         mreg_t  irq_stat;       /* IRQ mask and status reg */
   67         mreg_t  fme;            /* Field Mask even */
   68         mreg_t  fmo;            /* Field mask odd */
   69         mreg_t  fml;            /* Field mask length */
   70         mreg_t  fifo_t_err;     /* FIFO almost empty/almost full ptrs */
   71         mreg_t  i2c_phase;      /* i2c phase register */
   72         mreg_t  i2c_read;       /* i2c read register */
   73         mreg_t  i2c_write;      /* i2c write register */
   74         mreg_t  i2c_auto_a_e;   /* i2c auto register a, even */
   75         mreg_t  i2c_auto_b_e;   /* i2c auto register b, even */
   76         mreg_t  i2c_auto_c_e;   /* i2c auto register c, even */
   77         mreg_t  i2c_auto_d_e;   /* i2c auto register d, even */
   78         mreg_t  i2c_auto_a_o;   /* i2c auto register a, odd */
   79         mreg_t  i2c_auto_b_o;   /* i2c auto register b, odd */
   80         mreg_t  i2c_auto_c_o;   /* i2c auto register c, odd */
   81         mreg_t  i2c_auto_d_o;   /* i2c auto register d, odd */
   82         mreg_t  i2c_auto_enable;/* enable above auto registers */
   83         mreg_t  dma_end_e;      /* DMA end even (range) */
   84         mreg_t  dma_end_o;      /* DMA end odd (range) */
   85 };
   86 
   87 
   88 /*
   89  * Definitions for the Philips SAA7196 digital video decoder,
   90  * scalar, and clock generator circuit (DESCpro).
   91  */
   92 #define NUM_SAA7196_I2C_REGS    49
   93 #define SAA7196_I2C_ADDR        0x40
   94 #define SAA7196_WRITE(mtr, reg, data) \
   95         i2c_write(mtr, SAA7196_I2C_ADDR, SAA7116_I2C_WRITE, reg, data), \
   96         mtr->saa7196_i2c[reg] = data
   97 #define SAA7196_REG(mtr, reg) mtr->saa7196_i2c[reg]
   98 #define SAA7196_READ(mtr) \
   99         i2c_write(mtr, SAA7196_I2C_ADDR, SAA7116_I2C_READ, 0x0, 0x0)
  100 
  101 #define SAA7196_IDEL    0x00    /* Increment delay */
  102 #define SAA7196_HSB5    0x01    /* H-sync begin; 50 hz */
  103 #define SAA7196_HSS5    0x02    /* H-sync stop; 50 hz */
  104 #define SAA7196_HCB5    0x03    /* H-clamp begin; 50 hz */
  105 #define SAA7196_HCS5    0x04    /* H-clamp stop; 50 hz */
  106 #define SAA7196_HSP5    0x05    /* H-sync after PHI1; 50 hz */
  107 #define SAA7196_LUMC    0x06    /* Luminance control */
  108 #define SAA7196_HUEC    0x07    /* Hue control */
  109 #define SAA7196_CKTQ    0x08    /* Colour Killer Threshold QAM (PAL, NTSC) */
  110 #define SAA7196_CKTS    0x09    /* Colour Killer Threshold SECAM */
  111 #define SAA7196_PALS    0x0a    /* PAL switch sensitivity */
  112 #define SAA7196_SECAMS  0x0b    /* SECAM switch sensitivity */
  113 #define SAA7196_CGAINC  0x0c    /* Chroma gain control */
  114 #define SAA7196_STDC    0x0d    /* Standard/Mode control */
  115 #define SAA7196_IOCC    0x0e    /* I/O and Clock Control */
  116 #define SAA7196_CTRL1   0x0f    /* Control #1 */
  117 #define SAA7196_CTRL2   0x10    /* Control #2 */
  118 #define SAA7196_CGAINR  0x11    /* Chroma Gain Reference */
  119 #define SAA7196_CSAT    0x12    /* Chroma Saturation */
  120 #define SAA7196_CONT    0x13    /* Luminance Contrast */
  121 #define SAA7196_HSB6    0x14    /* H-sync begin; 60 hz */
  122 #define SAA7196_HSS6    0x15    /* H-sync stop; 60 hz */
  123 #define SAA7196_HCB6    0x16    /* H-clamp begin; 60 hz */
  124 #define SAA7196_HCS6    0x17    /* H-clamp stop; 60 hz */
  125 #define SAA7196_HSP6    0x18    /* H-sync after PHI1; 60 hz */
  126 #define SAA7196_BRIG    0x19    /* Luminance Brightness */
  127 #define SAA7196_FMTS    0x20    /* Formats and sequence */
  128 #define SAA7196_OUTPIX  0x21    /* Output data pixel/line */
  129 #define SAA7196_INPIX   0x22    /* Input data pixel/line */
  130 #define SAA7196_HWS     0x23    /* Horiz. window start */
  131 #define SAA7196_HFILT   0x24    /* Horiz. filter */
  132 #define SAA7196_OUTLINE 0x25    /* Output data lines/field */
  133 #define SAA7196_INLINE  0x26    /* Input data lines/field */
  134 #define SAA7196_VWS     0x27    /* Vertical window start */
  135 #define SAA7196_VYP     0x28    /* AFS/vertical Y processing */
  136 #define SAA7196_VBS     0x29    /* Vertical Bypass start */
  137 #define SAA7196_VBCNT   0x2a    /* Vertical Bypass count */
  138 #define SAA7196_VBP     0x2b    /* veritcal Bypass Polarity */
  139 #define SAA7196_VLOW    0x2c    /* Colour-keying lower V limit */
  140 #define SAA7196_VHIGH   0x2d    /* Colour-keying upper V limit */
  141 #define SAA7196_ULOW    0x2e    /* Colour-keying lower U limit */
  142 #define SAA7196_UHIGH   0x2f    /* Colour-keying upper U limit */
  143 #define SAA7196_DPATH   0x30    /* Data path setting  */
  144 
  145 /*
  146  * Defines for the PCF8574.
  147  */
  148 #define NUM_PCF8574_I2C_REGS    2
  149 #define PCF8574_CTRL_I2C_ADDR   0x70
  150 #define PCF8574_DATA_I2C_ADDR   0x72
  151 #define PCF8574_CTRL_WRITE(mtr, data) \
  152         i2c_write(mtr,  PCF8574_CTRL_I2C_ADDR, SAA7116_I2C_WRITE, data, data), \
  153         mtr->pcf_i2c[0] = data
  154 #define PCF8574_DATA_WRITE(mtr, data) \
  155         i2c_write(mtr,  PCF8574_DATA_I2C_ADDR, SAA7116_I2C_WRITE, data, data), \
  156         mtr->pcf_i2c[1] = data
  157 #define PCF8574_CTRL_REG(mtr) mtr->pcf_i2c[0]
  158 #define PCF8574_DATA_REG(mtr) mtr->pcf_i2c[1]
  159 
  160 
  161 /*
  162  * Defines for the BT254.
  163  */
  164 #define NUM_BT254_REGS  7
  165 
  166 #define BT254_COMMAND   0
  167 #define BT254_IOUT1     1
  168 #define BT254_IOUT2     2
  169 #define BT254_IOUT3     3
  170 #define BT254_IOUT4     4
  171 #define BT254_IOUT5     5
  172 #define BT254_IOUT6     6
  173 
  174 /*
  175  * Meteor info structure, one per meteor card installed.
  176  */
  177 typedef struct meteor_softc {
  178     struct saa7116_regs *base;  /* saa7116 register virtual address */
  179     vm_offset_t phys_base;      /* saa7116 register physical address */
  180     pcici_t     tag;            /* PCI tag, for doing PCI commands */
  181     vm_offset_t bigbuf;         /* buffer that holds the captured image */
  182     int         alloc_pages;    /* number of pages in bigbuf */
  183     struct proc *proc;          /* process to receive raised signal */
  184     int         signal;         /* signal to send to process */
  185 #define METEOR_SIG_MODE_MASK    0xffff0000
  186 #define METEOR_SIG_FIELD_MODE   0x00010000
  187 #define METEOR_SIG_FRAME_MODE   0x00000000
  188     struct meteor_mem *mem;     /* used to control sync. multi-frame output */
  189     u_long      synch_wait;     /* wait for free buffer before continuing */
  190     short       current;        /* frame number in buffer (1-frames) */
  191     short       rows;           /* number of rows in a frame */
  192     short       cols;           /* number of columns in a frame */
  193     short       depth;          /* number of byte per pixel */
  194     short       frames;         /* number of frames allocated */
  195     int         frame_size;     /* number of bytes in a frame */
  196     u_long      fifo_errors;    /* number of fifo capture errors since open */
  197     u_long      dma_errors;     /* number of DMA capture errors since open */
  198     u_long      frames_captured;/* number of frames captured since open */
  199     u_long      even_fields_captured; /* number of even fields captured */
  200     u_long      odd_fields_captured; /* number of odd fields captured */
  201     u_long      range_enable;   /* enable range checking ?? */
  202     unsigned    flags;
  203 #define METEOR_INITALIZED       0x00000001
  204 #define METEOR_OPEN             0x00000002 
  205 #define METEOR_MMAP             0x00000004
  206 #define METEOR_INTR             0x00000008
  207 #define METEOR_READ             0x00000010      /* XXX never gets referenced */
  208 #define METEOR_SINGLE           0x00000020      /* get single frame */
  209 #define METEOR_CONTIN           0x00000040      /* continuously get frames */
  210 #define METEOR_SYNCAP           0x00000080      /* synchronously get frames */
  211 #define METEOR_CAP_MASK         0x000000f0
  212 #define METEOR_NTSC             0x00000100
  213 #define METEOR_PAL              0x00000200
  214 #define METEOR_SECAM            0x00000400
  215 #define METEOR_AUTOMODE         0x00000800
  216 #define METEOR_FORM_MASK        0x00000f00
  217 #define METEOR_DEV0             0x00001000
  218 #define METEOR_DEV1             0x00002000
  219 #define METEOR_DEV2             0x00004000
  220 #define METEOR_DEV3             0x00008000
  221 #define METEOR_DEV_SVIDEO       0x00006000
  222 #define METEOR_DEV_RGB          0x0000a000
  223 #define METEOR_DEV_MASK         0x0000f000
  224 #define METEOR_RGB16            0x00010000
  225 #define METEOR_RGB24            0x00020000
  226 #define METEOR_YUV_PACKED       0x00040000
  227 #define METEOR_YUV_PLANAR       0x00080000
  228 #define METEOR_WANT_EVEN        0x00100000      /* want even frame */
  229 #define METEOR_WANT_ODD         0x00200000      /* want odd frame */
  230 #define METEOR_WANT_MASK        0x00300000
  231 #define METEOR_ONLY_EVEN_FIELDS 0x01000000
  232 #define METEOR_ONLY_ODD_FIELDS  0x02000000
  233 #define METEOR_ONLY_FIELDS_MASK 0x03000000
  234 #define METEOR_YUV_422          0x04000000
  235 #define METEOR_OUTPUT_FMT_MASK  0x040f0000
  236 #define METEOR_WANT_TS          0x08000000      /* time-stamp a frame */
  237 #define METEOR_RGB              0x20000000      /* meteor rgb unit */
  238 #define METEOR_FIELD_MODE       0x80000000
  239     u_char      saa7196_i2c[NUM_SAA7196_I2C_REGS]; /* saa7196 register values */
  240     u_char      pcf_i2c[NUM_PCF8574_I2C_REGS];  /* PCF8574 register values */
  241     u_char      bt254_reg[NUM_BT254_REGS];      /* BT254 register values */
  242     u_short     fps;            /* frames per second */
  243 #ifdef METEOR_TEST_VIDEO
  244     struct meteor_video video;
  245 #endif
  246 } meteor_reg_t;

Cache object: 82762f6b94dc15fb4a70f093892f6b27


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.