Home | History | Annotate | Line # | Download | only in ic
stireg.h revision 1.4
      1  1.4  skrll /*	$NetBSD: stireg.h,v 1.4 2010/11/01 06:41:50 skrll Exp $	*/
      2  1.1  jkunz 
      3  1.1  jkunz /*	$OpenBSD: stireg.h,v 1.8 2003/08/19 02:52:38 mickey Exp $	*/
      4  1.1  jkunz 
      5  1.1  jkunz /*
      6  1.1  jkunz  * Copyright (c) 2000 Michael Shalayeff
      7  1.1  jkunz  * All rights reserved.
      8  1.1  jkunz  *
      9  1.1  jkunz  * Redistribution and use in source and binary forms, with or without
     10  1.1  jkunz  * modification, are permitted provided that the following conditions
     11  1.1  jkunz  * are met:
     12  1.1  jkunz  * 1. Redistributions of source code must retain the above copyright
     13  1.1  jkunz  *    notice, this list of conditions and the following disclaimer.
     14  1.1  jkunz  * 2. Redistributions in binary form must reproduce the above copyright
     15  1.1  jkunz  *    notice, this list of conditions and the following disclaimer in the
     16  1.1  jkunz  *    documentation and/or other materials provided with the distribution.
     17  1.1  jkunz  *
     18  1.1  jkunz  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  1.1  jkunz  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  1.1  jkunz  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  1.1  jkunz  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
     22  1.1  jkunz  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     23  1.1  jkunz  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     24  1.1  jkunz  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     25  1.1  jkunz  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     26  1.1  jkunz  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     27  1.1  jkunz  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
     28  1.1  jkunz  * THE POSSIBILITY OF SUCH DAMAGE.
     29  1.1  jkunz  */
     30  1.1  jkunz 
     31  1.1  jkunz #ifndef _IC_STIREG_H_
     32  1.1  jkunz #define _IC_STIREG_H_
     33  1.1  jkunz 
     34  1.1  jkunz /* #define	STIDEBUG */
     35  1.1  jkunz 
     36  1.1  jkunz #define	STI_REGION_MAX	8
     37  1.1  jkunz #define	STI_MONITOR_MAX	256
     38  1.1  jkunz #define	STI_DEVNAME_LEN	32
     39  1.1  jkunz #define	STI_NCMAP	256
     40  1.1  jkunz 
     41  1.1  jkunz /* code ROM definitions */
     42  1.1  jkunz #define	STI_BEGIN	0
     43  1.1  jkunz #define	STI_INIT_GRAPH	0
     44  1.1  jkunz #define	STI_STATE_MGMT	1
     45  1.1  jkunz #define	STI_FONT_UNPMV	2
     46  1.1  jkunz #define	STI_BLOCK_MOVE	3
     47  1.1  jkunz #define	STI_SELF_TEST	4
     48  1.1  jkunz #define	STI_EXCEP_HDLR	5
     49  1.1  jkunz #define	STI_INQ_CONF	6
     50  1.1  jkunz #define	STI_SCM_ENT	7
     51  1.1  jkunz #define	STI_DMA_CTRL	8
     52  1.1  jkunz #define	STI_FLOW_CTRL	9
     53  1.1  jkunz #define	STI_UTIMING	10
     54  1.1  jkunz #define	STI_PROC_MGR	11
     55  1.1  jkunz #define	STI_UTIL	12
     56  1.1  jkunz #define	STI_END		13
     57  1.1  jkunz #define	STI_CODECNT	16
     58  1.1  jkunz 
     59  1.1  jkunz /* sti returns */
     60  1.1  jkunz #define	STI_OK		0
     61  1.1  jkunz #define	STI_FAIL	-1
     62  1.1  jkunz #define	STI_NRDY	1
     63  1.1  jkunz 
     64  1.1  jkunz /* sti errno */
     65  1.1  jkunz #define	STI_NOERRNO		0	/* no error */
     66  1.1  jkunz #define	STI_BADREENTLVL		1	/* bad reentry level */
     67  1.1  jkunz #define	STI_NOREGIONSDEF	2	/* region table is not setup */
     68  1.1  jkunz #define	STI_ILLNPLANES		3	/* invalid num of text planes */
     69  1.1  jkunz #define	STI_ILLINDEX		4	/* invalid fond index */
     70  1.1  jkunz #define	STI_ILLLOC		5	/* invalid font location */
     71  1.1  jkunz #define	STI_ILLCOLOUR		6	/* invalid colour */
     72  1.1  jkunz #define	STI_ILLBLKMVFROM	7	/* invalid from in blkmv */
     73  1.1  jkunz #define	STI_ILLBLKMVTO		8	/* invalid to in blkmv */
     74  1.1  jkunz #define	STI_ILLBLKMVSIZE	9	/* invalid siz in blkmv */
     75  1.1  jkunz #define	STI_BEIUNSUPP		10	/* bus error ints unsupported */
     76  1.1  jkunz #define	STI_UNXPBE		11	/* unexpected bus error */
     77  1.1  jkunz #define	STI_UNXHWF		12	/* unexpected hardware failure */
     78  1.1  jkunz #define	STI_NEGCFG		13	/* no ext global config struct */
     79  1.1  jkunz #define	STI_NEIG		14	/* no ext init struct */
     80  1.1  jkunz #define	STI_ILLSCME		15	/* invalid set cmap entry */
     81  1.1  jkunz #define	STI_ILLCMVAL		16	/* invalid cmap value */
     82  1.1  jkunz #define	STI_NORESMEM		17	/* no requested global memory */
     83  1.1  jkunz #define	STI_RESMEMCORR		18	/* reserved memory corrupted */
     84  1.1  jkunz #define	STI_ILLNTBLKMV		19	/* invalid non-text blkmv */
     85  1.1  jkunz #define	STI_ILLMONITOR		20	/* monitor selection is out of range */
     86  1.1  jkunz #define	STI_ILLEXCADDR		21	/* invalid excpt handler addr */
     87  1.1  jkunz #define	STI_ILLEXCFLAGS		22	/* invalid excpt handler flags */
     88  1.1  jkunz #define	STI_NOEHE		23	/* no ext exhdl struct */
     89  1.1  jkunz #define	STI_NOINQCE		24	/* no ext inq cfg struct */
     90  1.1  jkunz #define	STI_ILLRGNPTR		25	/* invalid region pointer */
     91  1.1  jkunz #define	STI_ILLUTLOP		26	/* invalid util opcode */
     92  1.1  jkunz #define	STI_UNKNOWN		250	/* unknown error */
     93  1.1  jkunz #define	STI_NOCFGPTR		251	/* no config ptr defined */
     94  1.1  jkunz #define	STI_NOFLPTR		252	/* no flag ptr defined */
     95  1.1  jkunz #define	STI_NOINPTR		253	/* no in ptr defined */
     96  1.1  jkunz #define	STI_NOOUTPTR		254	/* no way you can get it */
     97  1.1  jkunz #define	STI_NOLOCK		255	/* kernel dishonour graphics lock */
     98  1.1  jkunz 
     99  1.1  jkunz /* colours */
    100  1.1  jkunz #define	STI_COLOUR_BLACK	0
    101  1.1  jkunz #define	STI_COLOUR_WHITE	1
    102  1.1  jkunz #define	STI_COLOUR_RED		2
    103  1.1  jkunz #define	STI_COLOUR_YELLOW	3
    104  1.1  jkunz #define	STI_COLOUR_GREEN	4
    105  1.1  jkunz #define	STI_COLOUR_CYAN		5
    106  1.1  jkunz #define	STI_COLOUR_BLUE		6
    107  1.1  jkunz #define	STI_COLOUR_MAGENTA	7
    108  1.1  jkunz 
    109  1.1  jkunz #pragma pack(1)
    110  1.1  jkunz 
    111  1.1  jkunz 	/* LSB high */
    112  1.1  jkunz struct	sti_dd {
    113  1.4  skrll 	uint32_t	dd_type;	/* 0x00 device type */
    114  1.1  jkunz #define	STI_DEVTYPE1	1
    115  1.1  jkunz #define	STI_DEVTYPE4	3
    116  1.4  skrll 	uint8_t		dd_unused;
    117  1.4  skrll 	uint8_t		dd_nmon;	/* 0x05 number monitor rates */
    118  1.4  skrll 	uint8_t		dd_grrev;	/* 0x06 global rom revision */
    119  1.4  skrll 	uint8_t		dd_lrrev;	/* 0x07 local rom revision */
    120  1.4  skrll 	uint8_t		dd_grid[8];	/* 0x08 graphics id */
    121  1.1  jkunz #define STI_DEV4_DD_GRID	0x08	/* offset for STI_DEVTYPE4 */
    122  1.1  jkunz #define STI_DEV1_DD_GRID	0x10	/* offset for STI_DEVTYPE1 */
    123  1.4  skrll 	uint32_t	dd_fntaddr;	/* 0x10 font start address */
    124  1.4  skrll 	uint32_t	dd_maxst;	/* 0x14 max state storage */
    125  1.4  skrll 	uint32_t	dd_romend;	/* 0x18 rom last address */
    126  1.1  jkunz #define STI_DEV4_DD_ROMEND	0x18	/* offset for STI_DEVTYPE4 */
    127  1.1  jkunz #define STI_DEV1_DD_ROMEND	0x50	/* offset for STI_DEVTYPE1 */
    128  1.4  skrll 	uint32_t	dd_reglst;	/* 0x1c device region list */
    129  1.4  skrll 	uint16_t	dd_maxreent;	/* 0x20 max reent storage */
    130  1.4  skrll 	uint16_t	dd_maxtimo;	/* 0x22 max execution timeout .1 sec */
    131  1.4  skrll 	uint32_t	dd_montbl;	/* 0x24 mon table address, array of
    132  1.1  jkunz 						names num of dd_nmon */
    133  1.4  skrll 	uint32_t	dd_udaddr;	/* 0x28 user data address */
    134  1.4  skrll 	uint32_t	dd_stimemreq;	/* 0x2c sti memory request */
    135  1.4  skrll 	uint32_t	dd_udsize;	/* 0x30 user data size */
    136  1.4  skrll 	uint16_t	dd_pwruse;	/* 0x34 power usage */
    137  1.4  skrll 	uint8_t		dd_bussup;	/* 0x36 bus support */
    138  1.1  jkunz #define	STI_BUSSUPPORT_GSCINTL	0x01	/*	supports pulling INTL for int */
    139  1.1  jkunz #define	STI_BUSSUPPORT_GSC15X	0x02	/*	supports GSC 1.5X */
    140  1.1  jkunz #define	STI_BUSSUPPORT_GSC2X	0x04	/*	supports GSC 2.X */
    141  1.1  jkunz #define	STI_BUSSUPPORT_PCIIOEIM	0x08	/*	will use directed int */
    142  1.1  jkunz #define	STI_BUSSUPPORT_PCISTD	0x10	/*	will use std PCI int */
    143  1.1  jkunz #define	STI_BUSSUPPORT_ILOCK	0x20	/*	supports implicit locking */
    144  1.1  jkunz #define	STI_BUSSUPPORT_ROMMAP	0x40	/*	rom is only in pci erom space */
    145  1.1  jkunz #define	STI_BUSSUPPORT_2DECODE	0x80	/*	single address decoder */
    146  1.4  skrll 	uint8_t		dd_ebussup;	/* 0x37 extended bus support */
    147  1.1  jkunz #define	STI_EBUSSUPPORT_DMA	0x01	/*	supports dma */
    148  1.1  jkunz #define	STI_EBUSSUPPORT_PIOLOCK	0x02	/*	no implicit locking for dma */
    149  1.4  skrll 	uint8_t		dd_altcodet;	/* 0x38 alternate code type */
    150  1.1  jkunz #define	STI_ALTCODE_UNKNOWN	0x00
    151  1.1  jkunz #define	STI_ALTCODE_PA64	0x01	/*	alt code is in pa64 */
    152  1.4  skrll 	uint8_t		dd_eddst[3];	/* 0x39 extended DD struct */
    153  1.4  skrll 	uint32_t	dd_cfbaddr;	/* 0x3c CFB address, location of
    154  1.1  jkunz 						X11 driver to be used for
    155  1.1  jkunz 						servers w/o accel */
    156  1.4  skrll 	uint32_t	dd_pacode[16];	/* 0x40 routines for pa-risc */
    157  1.4  skrll 	uint32_t	dd_altcode[16];	/* 0x80 routines for m68k/i386 */
    158  1.1  jkunz };
    159  1.1  jkunz 
    160  1.1  jkunz /* after the last region there is one indirect list ptr */
    161  1.1  jkunz struct sti_region {
    162  1.1  jkunz 	u_int	offset  :14;	/* page offset dev io space relative */
    163  1.1  jkunz 	u_int	sys_only: 1;	/* whether allow user access */
    164  1.1  jkunz 	u_int	cache   : 1;	/* map in cache */
    165  1.1  jkunz 	u_int	btlb    : 1;	/* should use BTLB if available */
    166  1.1  jkunz 	u_int	last    : 1;	/* last region in the list */
    167  1.1  jkunz 	u_int	length  :14;	/* size in pages */
    168  1.1  jkunz };
    169  1.1  jkunz 
    170  1.1  jkunz struct sti_font {
    171  1.4  skrll 	uint16_t	first;
    172  1.4  skrll 	uint16_t	last;
    173  1.4  skrll 	uint8_t		width;
    174  1.4  skrll 	uint8_t		height;
    175  1.4  skrll 	uint8_t		type;
    176  1.1  jkunz #define	STI_FONT_HPROMAN8	1
    177  1.1  jkunz #define	STI_FONT_KANA8		2
    178  1.4  skrll 	uint8_t		bpc;
    179  1.4  skrll 	uint32_t	next;
    180  1.4  skrll 	uint8_t		uheight;
    181  1.4  skrll 	uint8_t		uoffset;
    182  1.4  skrll 	uint8_t		unused[2];
    183  1.1  jkunz };
    184  1.1  jkunz 
    185  1.1  jkunz struct sti_fontcfg {
    186  1.4  skrll 	uint16_t	first;
    187  1.4  skrll 	uint16_t	last;
    188  1.4  skrll 	uint8_t		width;
    189  1.4  skrll 	uint8_t		height;
    190  1.4  skrll 	uint8_t		type;
    191  1.4  skrll 	uint8_t		bpc;
    192  1.4  skrll 	uint8_t		uheight;
    193  1.4  skrll 	uint8_t		uoffset;
    194  1.1  jkunz };
    195  1.1  jkunz 
    196  1.1  jkunz typedef struct sti_ecfg {
    197  1.4  skrll 	uint8_t		current_monitor;
    198  1.4  skrll 	uint8_t		uf_boot;
    199  1.4  skrll 	uint16_t	power;		/* power dissipation Watts */
    200  1.4  skrll 	uint32_t	freq_ref;
    201  1.4  skrll 	uint32_t	*addr;		/* memory block of size dd_stimemreq */
    202  1.1  jkunz 	void		*future;
    203  1.1  jkunz } *sti_ecfg_t;
    204  1.1  jkunz 
    205  1.1  jkunz typedef struct sti_cfg {
    206  1.4  skrll 	uint32_t	text_planes;
    207  1.4  skrll 	uint16_t	scr_width;
    208  1.4  skrll 	uint16_t	scr_height;
    209  1.4  skrll 	uint16_t	oscr_width;
    210  1.4  skrll 	uint16_t	oscr_height;
    211  1.4  skrll 	uint16_t	fb_width;
    212  1.4  skrll 	uint16_t	fb_height;
    213  1.4  skrll 	uint32_t	regions[STI_REGION_MAX];
    214  1.4  skrll 	uint32_t	reent_level;
    215  1.4  skrll 	uint32_t	*save_addr;
    216  1.1  jkunz 	sti_ecfg_t	ext_cfg;
    217  1.1  jkunz } *sti_cfg_t;
    218  1.1  jkunz 
    219  1.1  jkunz 
    220  1.1  jkunz /* routine types */
    221  1.1  jkunz #define	STI_DEP(n) \
    222  1.1  jkunz 	typedef int (*sti_##n##_t)( \
    223  1.1  jkunz 	  sti_##n##flags_t, sti_##n##in_t, sti_##n##out_t, sti_cfg_t);
    224  1.1  jkunz 
    225  1.1  jkunz typedef struct sti_initflags {
    226  1.4  skrll 	uint32_t	flags;
    227  1.1  jkunz #define	STI_INITF_WAIT	0x80000000
    228  1.1  jkunz #define	STI_INITF_RESET	0x40000000
    229  1.1  jkunz #define	STI_INITF_TEXT	0x20000000
    230  1.1  jkunz #define	STI_INITF_NTEXT	0x10000000
    231  1.1  jkunz #define	STI_INITF_CLEAR	0x08000000
    232  1.1  jkunz #define	STI_INITF_CMB	0x04000000	/* non-text planes cmap black */
    233  1.1  jkunz #define	STI_INITF_EBET	0x02000000	/* enable bus error timer */
    234  1.1  jkunz #define	STI_INITF_EBETI	0x01000000	/* enable bus error timer interrupt */
    235  1.1  jkunz #define	STI_INITF_PTS	0x00800000	/* preserve text settings */
    236  1.1  jkunz #define	STI_INITF_PNTS	0x00400000	/* preserve non-text settings */
    237  1.1  jkunz #define	STI_INITF_PBET	0x00200000	/* preserve BET settings */
    238  1.1  jkunz #define	STI_INITF_PBETI	0x00100000	/* preserve BETI settings */
    239  1.1  jkunz #define	STI_INITF_ICMT	0x00080000	/* init cmap for text planes */
    240  1.1  jkunz #define	STI_INITF_SCMT	0x00040000	/* change current monitor type */
    241  1.1  jkunz #define	STI_INITF_RIE	0x00020000	/* retain int enables */
    242  1.1  jkunz 	void *future;
    243  1.1  jkunz } *sti_initflags_t;
    244  1.1  jkunz 
    245  1.1  jkunz typedef struct sti_einitin {
    246  1.4  skrll 	uint8_t		mon_type;
    247  1.4  skrll 	uint8_t		pad;
    248  1.4  skrll 	uint16_t	inflight;	/* possible on pci */
    249  1.1  jkunz 	void		*future;
    250  1.1  jkunz } *sti_einitin_t;
    251  1.1  jkunz 
    252  1.1  jkunz typedef struct sti_initin {
    253  1.4  skrll 	uint32_t	text_planes;	/* number of planes for text */
    254  1.1  jkunz 	sti_einitin_t	ext_in;
    255  1.1  jkunz } *sti_initin_t;
    256  1.1  jkunz 
    257  1.1  jkunz typedef struct sti_initout {
    258  1.1  jkunz 	int32_t		errno;
    259  1.4  skrll 	uint32_t	text_planes;	/* number of planes used for text */
    260  1.1  jkunz 	void		*future;
    261  1.1  jkunz } *sti_initout_t;
    262  1.1  jkunz 
    263  1.1  jkunz STI_DEP(init);
    264  1.1  jkunz 
    265  1.1  jkunz typedef struct sti_mgmtflags {
    266  1.4  skrll 	uint32_t	flags;
    267  1.1  jkunz #define	STI_MGMTF_WAIT	0x80000000
    268  1.1  jkunz #define	STI_MGMTF_SAVE	0x40000000
    269  1.1  jkunz #define	STI_MGMTF_RALL	0x20000000	/* restore all display planes */
    270  1.1  jkunz 	void *future;
    271  1.1  jkunz } *sti_mgmtflags_t;
    272  1.1  jkunz 
    273  1.1  jkunz typedef struct sti_mgmtin {
    274  1.1  jkunz 	void	*addr;
    275  1.1  jkunz 	void	*future;
    276  1.1  jkunz } *sti_mgmtin_t;
    277  1.1  jkunz 
    278  1.1  jkunz typedef struct sti_mgmtout {
    279  1.1  jkunz 	int32_t		errno;
    280  1.1  jkunz 	void		*future;
    281  1.1  jkunz } *sti_mgmtout_t;
    282  1.1  jkunz 
    283  1.1  jkunz STI_DEP(mgmt);
    284  1.1  jkunz 
    285  1.1  jkunz typedef struct sti_unpmvflags {
    286  1.4  skrll 	uint32_t	flags;
    287  1.1  jkunz #define	STI_UNPMVF_WAIT	0x80000000
    288  1.1  jkunz #define	STI_UNPMVF_NTXT	0x40000000	/* intp non-text planes */
    289  1.1  jkunz 	void		*future;
    290  1.1  jkunz } *sti_unpmvflags_t;
    291  1.1  jkunz 
    292  1.1  jkunz typedef struct sti_unpmvin {
    293  1.4  skrll 	uint32_t	*font_addr;	/* font */
    294  1.4  skrll 	uint16_t	index;		/* character index in the font */
    295  1.4  skrll 	uint8_t		fg_colour;
    296  1.4  skrll 	uint8_t		bg_colour;
    297  1.4  skrll 	uint16_t	x, y;
    298  1.1  jkunz 	void		*future;
    299  1.1  jkunz } *sti_unpmvin_t;
    300  1.1  jkunz 
    301  1.1  jkunz typedef struct sti_unpmvout {
    302  1.4  skrll 	uint32_t	errno;
    303  1.1  jkunz 	void		*future;
    304  1.1  jkunz } *sti_unpmvout_t;
    305  1.1  jkunz 
    306  1.1  jkunz STI_DEP(unpmv);
    307  1.1  jkunz 
    308  1.1  jkunz typedef struct sti_blkmvflags {
    309  1.4  skrll 	uint32_t	flags;
    310  1.1  jkunz #define	STI_BLKMVF_WAIT	0x80000000
    311  1.1  jkunz #define	STI_BLKMVF_COLR	0x40000000	/* change colour on move */
    312  1.1  jkunz #define	STI_BLKMVF_CLR	0x20000000	/* clear on move */
    313  1.1  jkunz #define	STI_BLKMVF_NTXT	0x10000000	/* move in non-text planes */
    314  1.1  jkunz 	void		*future;
    315  1.1  jkunz } *sti_blkmvflags_t;
    316  1.1  jkunz 
    317  1.1  jkunz typedef struct sti_blkmvin {
    318  1.4  skrll 	uint8_t		fg_colour;
    319  1.4  skrll 	uint8_t		bg_colour;
    320  1.4  skrll 	uint16_t	srcx, srcy, dstx, dsty;
    321  1.4  skrll 	uint16_t	width, height;
    322  1.4  skrll 	uint16_t	pad;
    323  1.1  jkunz 	void		*future;
    324  1.1  jkunz } *sti_blkmvin_t;
    325  1.1  jkunz 
    326  1.1  jkunz typedef struct sti_blkmvout {
    327  1.4  skrll 	uint32_t	errno;
    328  1.1  jkunz 	void		*future;
    329  1.1  jkunz } *sti_blkmvout_t;
    330  1.1  jkunz 
    331  1.1  jkunz STI_DEP(blkmv);
    332  1.1  jkunz 
    333  1.1  jkunz typedef struct sti_testflags {
    334  1.4  skrll 	uint32_t	flags;
    335  1.1  jkunz #define	STI_TESTF_WAIT	0x80000000
    336  1.1  jkunz #define	STI_TESTF_ETST	0x40000000
    337  1.1  jkunz 	void		*future;
    338  1.1  jkunz } *sti_testflags_t;
    339  1.1  jkunz 
    340  1.1  jkunz typedef struct sti_testin {
    341  1.1  jkunz 	void		*future;
    342  1.1  jkunz } *sti_testin_t;
    343  1.1  jkunz 
    344  1.1  jkunz typedef struct sti_testout {
    345  1.4  skrll 	uint32_t	errno;
    346  1.4  skrll 	uint32_t	result;
    347  1.1  jkunz 	void		*future;
    348  1.1  jkunz } *sti_testout_t;
    349  1.1  jkunz 
    350  1.1  jkunz STI_DEP(test);
    351  1.1  jkunz 
    352  1.1  jkunz typedef struct sti_exhdlflags {
    353  1.4  skrll 	uint32_t	flags;
    354  1.1  jkunz #define	STI_EXHDLF_WAIT	0x80000000
    355  1.1  jkunz #define	STI_EXHDLF_CINT	0x40000000	/* clear int */
    356  1.1  jkunz #define	STI_EXHDLF_CBE	0x20000000	/* clear BE */
    357  1.1  jkunz #define	STI_EXHDLF_PINT	0x10000000	/* preserve int */
    358  1.1  jkunz #define	STI_EXHDLF_RINT	0x08000000	/* restore int */
    359  1.1  jkunz #define	STI_EXHDLF_WEIM	0x04000000	/* write eim w/ sti_eexhdlin */
    360  1.1  jkunz #define	STI_EXHDLF_REIM	0x02000000	/* read eim to sti_eexhdlout */
    361  1.1  jkunz #define	STI_EXHDLF_GIE	0x01000000	/* global int enable */
    362  1.1  jkunz #define	STI_EXHDLF_PGIE	0x00800000
    363  1.1  jkunz #define	STI_EXHDLF_WIEM	0x00400000
    364  1.1  jkunz #define	STI_EXHDLF_EIEM	0x00200000
    365  1.1  jkunz #define	STI_EXHDLF_BIC	0x00100000	/* begin int cycle */
    366  1.1  jkunz #define	STI_EXHDLF_EIC	0x00080000	/* end int cycle */
    367  1.1  jkunz #define	STI_EXHDLF_RIE	0x00040000	/* reset do not clear int enables */
    368  1.1  jkunz 	void		*future;
    369  1.1  jkunz } *sti_exhdlflags_t;
    370  1.1  jkunz 
    371  1.1  jkunz typedef struct sti_eexhdlin {
    372  1.4  skrll 	uint32_t	eim_addr;
    373  1.4  skrll 	uint32_t	eim_data;
    374  1.4  skrll 	uint32_t	iem;		/* enable mask */
    375  1.4  skrll 	uint32_t	icm;		/* clear mask */
    376  1.1  jkunz 	void		*future;
    377  1.1  jkunz } *sti_eexhdlin_t;
    378  1.1  jkunz 
    379  1.1  jkunz typedef struct sti_exhdlint {
    380  1.4  skrll 	uint32_t	flags;
    381  1.1  jkunz #define	STI_EXHDLINT_BET	0x80000000	/* bus error timer */
    382  1.1  jkunz #define	STI_EXHDLINT_HW		0x40000000	/* high water */
    383  1.1  jkunz #define	STI_EXHDLINT_LW		0x20000000	/* low water */
    384  1.1  jkunz #define	STI_EXHDLINT_TM		0x10000000	/* texture map */
    385  1.1  jkunz #define	STI_EXHDLINT_VB		0x08000000	/* vertical blank */
    386  1.1  jkunz #define	STI_EXHDLINT_UDC	0x04000000	/* unbuffered dma complete */
    387  1.1  jkunz #define	STI_EXHDLINT_BDC	0x02000000	/* buffered dma complete */
    388  1.1  jkunz #define	STI_EXHDLINT_UDPC	0x01000000	/* unbuf priv dma complete */
    389  1.1  jkunz #define	STI_EXHDLINT_BDPC	0x00800000	/* buffered priv dma complete */
    390  1.1  jkunz } *sti_exhdlint_t;
    391  1.1  jkunz 
    392  1.1  jkunz typedef struct sti_exhdlin {
    393  1.1  jkunz 	sti_exhdlint_t	addr;
    394  1.1  jkunz 	sti_eexhdlin_t	ext;
    395  1.1  jkunz } *sti_exhdlin_t;
    396  1.1  jkunz 
    397  1.1  jkunz typedef struct sti_eexhdlout {
    398  1.4  skrll 	uint32_t	eim_addr;
    399  1.4  skrll 	uint32_t	eim_data;
    400  1.4  skrll 	uint32_t	iem;		/* enable mask */
    401  1.4  skrll 	uint32_t	icm;		/* clear mask */
    402  1.1  jkunz 	void		*future;
    403  1.1  jkunz } *sti_eexhdlout_t;
    404  1.1  jkunz 
    405  1.1  jkunz typedef struct sti_exhdlout {
    406  1.4  skrll 	uint32_t	errno;
    407  1.4  skrll 	uint32_t	flags;
    408  1.1  jkunz #define	STI_EXHDLO_BE	0x80000000	/* BE was intercepted */
    409  1.1  jkunz #define	STI_EXHDLO_IP	0x40000000	/* there is int pending */
    410  1.1  jkunz #define	STI_EXHDLO_IE	0x20000000	/* global enable set */
    411  1.1  jkunz 	sti_eexhdlout_t	ext;
    412  1.1  jkunz } *sti_exhdlout_t;
    413  1.1  jkunz 
    414  1.1  jkunz STI_DEP(exhdl);
    415  1.1  jkunz 
    416  1.1  jkunz typedef struct sti_inqconfflags {
    417  1.4  skrll 	uint32_t	flags;
    418  1.1  jkunz #define	STI_INQCONFF_WAIT	0x80000000
    419  1.1  jkunz 	void		*future;
    420  1.1  jkunz } *sti_inqconfflags_t;
    421  1.1  jkunz 
    422  1.1  jkunz typedef struct sti_inqconfin {
    423  1.1  jkunz 	void	*future;
    424  1.1  jkunz } *sti_inqconfin_t;
    425  1.1  jkunz 
    426  1.1  jkunz typedef struct sti_einqconfout {
    427  1.4  skrll 	uint32_t	crt_config[3];
    428  1.4  skrll 	uint32_t	crt_hw[3];
    429  1.1  jkunz 	void		*future;
    430  1.1  jkunz } *sti_einqconfout_t;
    431  1.1  jkunz 
    432  1.1  jkunz typedef struct sti_inqconfout {
    433  1.4  skrll 	uint32_t	errno;
    434  1.4  skrll 	uint16_t	width, height, owidth, oheight, fbwidth, fbheight;
    435  1.4  skrll 	uint32_t	bpp;	/* bits per pixel */
    436  1.4  skrll 	uint32_t	bppu;	/* accessible bpp */
    437  1.4  skrll 	uint32_t	planes;
    438  1.4  skrll 	uint8_t		name[STI_DEVNAME_LEN];
    439  1.4  skrll 	uint32_t	attributes;
    440  1.1  jkunz #define	STI_INQCONF_Y2X		0x0001	/* pixel is higher tan wider */
    441  1.1  jkunz #define	STI_INQCONF_HWBLKMV	0x0002	/* hw blkmv is present */
    442  1.1  jkunz #define	STI_INQCONF_AHW		0x0004	/* adv hw accel */
    443  1.1  jkunz #define	STI_INQCONF_INT		0x0008	/* can interrupt */
    444  1.1  jkunz #define	STI_INQCONF_GONOFF	0x0010	/* supports on/off */
    445  1.1  jkunz #define	STI_INQCONF_AONOFF	0x0020	/* supports alpha on/off */
    446  1.1  jkunz #define	STI_INQCONF_VARY	0x0040	/* variable fb height */
    447  1.1  jkunz #define	STI_INQCONF_ODDBYTES	0x0080	/* use only odd fb bytes */
    448  1.1  jkunz #define	STI_INQCONF_FLUSH	0x0100	/* fb cache requires flushing */
    449  1.1  jkunz #define	STI_INQCONF_DMA		0x0200	/* supports dma */
    450  1.1  jkunz #define	STI_INQCONF_VDMA	0x0400	/* supports vdma */
    451  1.1  jkunz #define	STI_INQCONF_YUV1	0x2000	/* supports YUV type 1 */
    452  1.1  jkunz #define	STI_INQCONF_YUV2	0x4000	/* supports YUV type 2 */
    453  1.1  jkunz #define	STI_INQCONF_BITS \
    454  1.1  jkunz     "\020\001y2x\002hwblkmv\003ahw\004int\005gonoff\006aonoff\007vary"\
    455  1.1  jkunz     "\010oddb\011flush\012dma\013vdma\016yuv1\017yuv2"
    456  1.1  jkunz 	sti_einqconfout_t ext;
    457  1.1  jkunz } *sti_inqconfout_t;
    458  1.1  jkunz 
    459  1.1  jkunz STI_DEP(inqconf);
    460  1.1  jkunz 
    461  1.1  jkunz typedef struct sti_scmentflags {
    462  1.4  skrll 	uint32_t	flags;
    463  1.1  jkunz #define	STI_SCMENTF_WAIT	0x80000000
    464  1.1  jkunz 	void		*future;
    465  1.1  jkunz } *sti_scmentflags_t;
    466  1.1  jkunz 
    467  1.1  jkunz typedef struct sti_scmentin {
    468  1.4  skrll 	uint32_t	entry;
    469  1.4  skrll 	uint32_t	value;
    470  1.1  jkunz 	void		*future;
    471  1.1  jkunz } *sti_scmentin_t;
    472  1.1  jkunz 
    473  1.1  jkunz typedef struct sti_scmentout {
    474  1.4  skrll 	uint32_t	errno;
    475  1.1  jkunz 	void		*future;
    476  1.1  jkunz } *sti_scmentout_t;
    477  1.1  jkunz 
    478  1.1  jkunz STI_DEP(scment);
    479  1.1  jkunz 
    480  1.1  jkunz typedef struct sti_dmacflags {
    481  1.4  skrll 	uint32_t	flags;
    482  1.1  jkunz #define	STI_DMACF_WAIT	0x80000000
    483  1.1  jkunz #define	STI_DMACF_PRIV	0x40000000	/* priv dma */
    484  1.1  jkunz #define	STI_DMACF_DIS	0x20000000	/* disable */
    485  1.1  jkunz #define	STI_DMACF_BUF	0x10000000	/* buffered */
    486  1.1  jkunz #define	STI_DMACF_MRK	0x08000000	/* write a marker */
    487  1.1  jkunz #define	STI_DMACF_ABRT	0x04000000	/* abort dma xfer */
    488  1.1  jkunz 	void		*future;
    489  1.1  jkunz } *sti_dmacflags_t;
    490  1.1  jkunz 
    491  1.1  jkunz typedef struct sti_dmacin {
    492  1.4  skrll 	uint32_t	pa_upper;
    493  1.4  skrll 	uint32_t	pa_lower;
    494  1.4  skrll 	uint32_t	len;
    495  1.4  skrll 	uint32_t	mrk_data;
    496  1.4  skrll 	uint32_t	mrk_off;
    497  1.1  jkunz 	void		*future;
    498  1.1  jkunz } *sti_dmacin_t;
    499  1.1  jkunz 
    500  1.1  jkunz typedef struct sti_dmacout {
    501  1.4  skrll 	uint32_t	errno;
    502  1.1  jkunz 	void		*future;
    503  1.1  jkunz } *sti_dmacout_t;
    504  1.1  jkunz 
    505  1.1  jkunz STI_DEP(dmac);
    506  1.1  jkunz 
    507  1.1  jkunz typedef struct sti_flowcflags {
    508  1.4  skrll 	uint32_t	flags;
    509  1.1  jkunz #define	STI_FLOWCF_WAIT	0x80000000
    510  1.1  jkunz #define	STI_FLOWCF_CHW	0x40000000	/* check high water */
    511  1.1  jkunz #define	STI_FLOWCF_WHW	0x20000000	/* write high water */
    512  1.1  jkunz #define	STI_FLOWCF_WLW	0x10000000	/* write low water */
    513  1.1  jkunz #define	STI_FLOWCF_PCSE	0x08000000	/* preserve cse */
    514  1.1  jkunz #define	STI_FLOWCF_CSE	0x04000000
    515  1.1  jkunz #define	STI_FLOWCF_CSWF	0x02000000	/* cs write fine */
    516  1.1  jkunz #define	STI_FLOWCF_CSWC	0x01000000	/* cs write coarse */
    517  1.1  jkunz #define	STI_FLOWCF_CSWQ	0x00800000	/* cs write fifo */
    518  1.1  jkunz 	void		*future;
    519  1.1  jkunz } *sti_flowcflags_t;
    520  1.1  jkunz 
    521  1.1  jkunz typedef struct sti_flowcin {
    522  1.4  skrll 	uint32_t	retry;
    523  1.4  skrll 	uint32_t	bufz;
    524  1.4  skrll 	uint32_t	hwcnt;
    525  1.4  skrll 	uint32_t	lwcnt;
    526  1.4  skrll 	uint32_t	csfv;	/* cs fine value */
    527  1.4  skrll 	uint32_t	cscv;	/* cs coarse value */
    528  1.4  skrll 	uint32_t	csqc;	/* cs fifo count */
    529  1.1  jkunz 	void		*future;
    530  1.1  jkunz } *sti_flowcin_t;
    531  1.1  jkunz 
    532  1.1  jkunz typedef struct sti_flowcout {
    533  1.4  skrll 	uint32_t	errno;
    534  1.4  skrll 	uint32_t	retry_result;
    535  1.4  skrll 	uint32_t	fifo_size;
    536  1.1  jkunz 	void		*future;
    537  1.1  jkunz } *sti_flowcout_t;
    538  1.1  jkunz 
    539  1.1  jkunz STI_DEP(flowc);
    540  1.1  jkunz 
    541  1.1  jkunz typedef struct sti_utimingflags {
    542  1.4  skrll 	uint32_t	flags;
    543  1.1  jkunz #define	STI_UTIMF_WAIT	0x80000000
    544  1.1  jkunz #define	STI_UTIMF_HKS	0x40000000	/* has kbuf_size */
    545  1.1  jkunz 	void		*future;
    546  1.1  jkunz } *sti_utimingflags_t;
    547  1.1  jkunz 
    548  1.1  jkunz typedef struct sti_utimingin {
    549  1.1  jkunz 	void		*data;
    550  1.1  jkunz 	void		*kbuf;
    551  1.1  jkunz 	void		*future;
    552  1.1  jkunz } *sti_utimingin_t;
    553  1.1  jkunz 
    554  1.1  jkunz typedef struct sti_utimingout {
    555  1.4  skrll 	uint32_t	errno;
    556  1.4  skrll 	uint32_t	kbuf_size;	/* buffer required size */
    557  1.1  jkunz 	void		*future;
    558  1.1  jkunz } *sti_utimingout_t;
    559  1.1  jkunz 
    560  1.1  jkunz STI_DEP(utiming);
    561  1.1  jkunz 
    562  1.1  jkunz typedef struct sti_pmgrflags {
    563  1.4  skrll 	uint32_t	flags;
    564  1.1  jkunz #define	STI_UTIMF_WAIT	0x80000000
    565  1.1  jkunz #define	STI_UTIMOP_CLEANUP	0x00000000
    566  1.1  jkunz #define	STI_UTIMOP_BAC		0x10000000
    567  1.1  jkunz #define	STI_UTIMF_CRIT	0x04000000
    568  1.1  jkunz #define	STI_UTIMF_BUFF	0x02000000
    569  1.1  jkunz #define	STI_UTIMF_IBUFF	0x01000000
    570  1.1  jkunz 	void		*future;
    571  1.1  jkunz } *sti_pmgrflags_t;
    572  1.1  jkunz 
    573  1.1  jkunz typedef struct sti_pmgrin {
    574  1.4  skrll 	uint32_t	reserved[4];
    575  1.1  jkunz 	void		*future;
    576  1.1  jkunz } *sti_pmgrin_t;
    577  1.1  jkunz 
    578  1.1  jkunz typedef struct sti_pmgrout {
    579  1.1  jkunz 	int32_t		errno;
    580  1.1  jkunz 	void		*future;
    581  1.1  jkunz } *sti_pmgrout_t;
    582  1.1  jkunz 
    583  1.1  jkunz STI_DEP(pmgr);
    584  1.1  jkunz 
    585  1.1  jkunz typedef struct sti_utilflags {
    586  1.4  skrll 	uint32_t	flags;
    587  1.1  jkunz #define	STI_UTILF_ROOT	0x80000000	/* was called as root */
    588  1.1  jkunz 	void		*future;
    589  1.1  jkunz } *sti_utilflags_t;
    590  1.1  jkunz 
    591  1.1  jkunz typedef struct sti_utilin {
    592  1.4  skrll 	uint32_t	in_size;
    593  1.4  skrll 	uint32_t	out_size;
    594  1.4  skrll 	uint8_t		*buf;
    595  1.1  jkunz } *sti_utilin_t;
    596  1.1  jkunz 
    597  1.1  jkunz typedef struct sti_utilout {
    598  1.1  jkunz 	int32_t		errno;
    599  1.1  jkunz 	void		*future;
    600  1.1  jkunz } *sti_utilout_t;
    601  1.1  jkunz 
    602  1.1  jkunz STI_DEP(util);
    603  1.1  jkunz 
    604  1.1  jkunz #pragma pack()
    605  1.1  jkunz 
    606  1.1  jkunz #endif /* _IC_STIREG_H_ */
    607