Home | History | Annotate | Line # | Download | only in ic
stivar.h revision 1.8
      1  1.8  tsutsui /*	$NetBSD: stivar.h,v 1.8 2014/04/20 04:12:54 tsutsui Exp $	*/
      2  1.1    jkunz 
      3  1.6    skrll /*	$OpenBSD: stivar.h,v 1.24 2009/02/06 22:51:04 miod Exp $	*/
      4  1.1    jkunz 
      5  1.1    jkunz /*
      6  1.1    jkunz  * Copyright (c) 2000-2003 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_STIVAR_H_
     32  1.1    jkunz #define _IC_STIVAR_H_
     33  1.1    jkunz 
     34  1.6    skrll struct sti_softc;
     35  1.6    skrll 
     36  1.6    skrll /*
     37  1.6    skrll  * STI ROM information - one per device
     38  1.6    skrll  */
     39  1.6    skrll struct sti_rom {
     40  1.6    skrll 	struct sti_softc	*rom_softc;	/* backpointer to device */
     41  1.6    skrll 	int			 rom_devtype;
     42  1.6    skrll 
     43  1.6    skrll 	bus_space_tag_t		 iot, memt;	/* XXX iot unused */
     44  1.6    skrll 	bus_space_handle_t	 romh;
     45  1.6    skrll 	bus_addr_t		*bases;
     46  1.6    skrll 
     47  1.6    skrll 	struct sti_dd		 rom_dd;	/* in word format */
     48  1.6    skrll 
     49  1.6    skrll 	vaddr_t			 rom_code;
     50  1.6    skrll 	sti_init_t		 init;
     51  1.6    skrll 	sti_mgmt_t		 mgmt;
     52  1.6    skrll 	sti_unpmv_t		 unpmv;
     53  1.6    skrll 	sti_blkmv_t		 blkmv;
     54  1.6    skrll 	sti_test_t		 test;
     55  1.6    skrll 	sti_exhdl_t		 exhdl;
     56  1.6    skrll 	sti_inqconf_t		 inqconf;
     57  1.6    skrll 	sti_scment_t		 scment;
     58  1.6    skrll 	sti_dmac_t		 dmac;
     59  1.6    skrll 	sti_flowc_t		 flowc;
     60  1.6    skrll 	sti_utiming_t		 utiming;
     61  1.6    skrll 	sti_pmgr_t		 pmgr;
     62  1.6    skrll 	sti_util_t		 util;
     63  1.6    skrll };
     64  1.6    skrll 
     65  1.6    skrll /*
     66  1.6    skrll  * STI screen information - one per head
     67  1.6    skrll  */
     68  1.6    skrll struct sti_screen {
     69  1.6    skrll 	struct sti_rom		*scr_rom;
     70  1.6    skrll 
     71  1.6    skrll #ifdef notyet
     72  1.6    skrll 	u_int			 scr_flags;
     73  1.6    skrll #endif
     74  1.6    skrll 
     75  1.6    skrll 	int			 scr_bpp;
     76  1.6    skrll 
     77  1.6    skrll 	struct sti_font		 scr_curfont;
     78  1.6    skrll 	struct sti_cfg		 scr_cfg;
     79  1.6    skrll 	struct sti_ecfg		 scr_ecfg;
     80  1.6    skrll 	char			 name[STI_DEVNAME_LEN];
     81  1.6    skrll 
     82  1.6    skrll 	void			*scr_romfont;	/* ROM font copy in memory... */
     83  1.6    skrll 	u_int			 scr_fontmaxcol;/* ...or in off-screen area */
     84  1.6    skrll 	u_int			 scr_fontbase;
     85  1.6    skrll 
     86  1.6    skrll 	uint8_t			 scr_rcmap[STI_NCMAP],
     87  1.6    skrll 				 scr_gcmap[STI_NCMAP],
     88  1.6    skrll 				 scr_bcmap[STI_NCMAP];
     89  1.6    skrll 
     90  1.6    skrll 	uint16_t		 fbheight, fbwidth;
     91  1.6    skrll 	uint16_t		 oheight, owidth;	/* offscreen size */
     92  1.6    skrll 	bus_addr_t		 fbaddr;
     93  1.6    skrll 	bus_size_t		 fblen;
     94  1.6    skrll 
     95  1.6    skrll 	/* wsdisplay information */
     96  1.6    skrll 	int			 scr_nscreens;
     97  1.6    skrll 	u_int			 scr_wsmode;
     98  1.6    skrll 	struct	wsscreen_descr	 scr_wsd;
     99  1.7     matt 	const struct wsscreen_descr	*scr_scrlist[1];
    100  1.6    skrll 	struct	wsscreen_list	 scr_screenlist;
    101  1.6    skrll };
    102  1.6    skrll 
    103  1.6    skrll /*
    104  1.6    skrll  * STI Device state
    105  1.6    skrll  */
    106  1.1    jkunz struct sti_softc {
    107  1.3    skrll 	device_t sc_dev;
    108  1.6    skrll #if notyet
    109  1.1    jkunz 	void *sc_ih;
    110  1.6    skrll #endif
    111  1.1    jkunz 
    112  1.6    skrll 	u_int			sc_flags;
    113  1.6    skrll #define	STI_CONSOLE	0x0001	/* first head is console... */
    114  1.6    skrll #define	STI_ATTACHED	0x0002	/* ... and wsdisplay_cnattach() has been done */
    115  1.6    skrll #define	STI_ROM_ENABLED	0x0004	/* PCI ROM is enabled */
    116  1.6    skrll 
    117  1.6    skrll 	bus_addr_t		bases[STI_REGION_MAX];
    118  1.6    skrll 	struct sti_rom		*sc_rom;
    119  1.6    skrll 	struct sti_screen	*sc_scr;
    120  1.6    skrll 
    121  1.6    skrll 	/* optional, required for PCI */
    122  1.6    skrll 	void			(*sc_enable_rom)(struct sti_softc *);
    123  1.6    skrll 	void			(*sc_disable_rom)(struct sti_softc *);
    124  1.1    jkunz };
    125  1.1    jkunz 
    126  1.6    skrll int	sti_attach_common(struct sti_softc *, bus_space_tag_t, bus_space_tag_t,
    127  1.6    skrll 	    bus_space_handle_t, u_int);
    128  1.6    skrll int	sti_cnattach(struct sti_rom *, struct sti_screen *, bus_space_tag_t,
    129  1.6    skrll 	    bus_addr_t *, u_int);
    130  1.6    skrll void	sti_describe(struct sti_softc *);
    131  1.6    skrll void	sti_end_attach(struct sti_softc *);
    132  1.6    skrll u_int	sti_rom_size(bus_space_tag_t, bus_space_handle_t);
    133  1.1    jkunz 
    134  1.8  tsutsui int	sti_cnattach(struct sti_rom *, struct sti_screen *, bus_space_tag_t,
    135  1.8  tsutsui 	    bus_addr_t *, u_int);
    136  1.8  tsutsui 
    137  1.1    jkunz #endif /* _IC_STIVAR_H_ */
    138