Home | History | Annotate | Line # | Download | only in dev
omrasopsvar.h revision 1.3
      1  1.3  tsutsui /* $NetBSD: omrasopsvar.h,v 1.3 2014/10/04 16:58:17 tsutsui Exp $ */
      2  1.3  tsutsui /*
      3  1.3  tsutsui  * Copyright (c) 2013 Kenji Aoyama
      4  1.3  tsutsui  *
      5  1.3  tsutsui  * Permission to use, copy, modify, and distribute this software for any
      6  1.3  tsutsui  * purpose with or without fee is hereby granted, provided that the above
      7  1.3  tsutsui  * copyright notice and this permission notice appear in all copies.
      8  1.3  tsutsui  *
      9  1.3  tsutsui  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     10  1.3  tsutsui  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     11  1.3  tsutsui  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     12  1.3  tsutsui  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     13  1.3  tsutsui  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     14  1.3  tsutsui  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     15  1.3  tsutsui  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     16  1.3  tsutsui  */
     17  1.3  tsutsui 
     18  1.3  tsutsui /*
     19  1.3  tsutsui  * Base addresses of LUNA's frame buffer
     20  1.3  tsutsui  * XXX: We consider only 1bpp and 4bpp for now
     21  1.3  tsutsui  */
     22  1.1  tsutsui 
     23  1.3  tsutsui #define OMFB_PLANEMASK	0xB1040000	/* BMSEL register */
     24  1.3  tsutsui #define OMFB_FB_WADDR	0xB1080008	/* common plane */
     25  1.3  tsutsui #define OMFB_FB_RADDR	0xB10C0008	/* plane #0 */
     26  1.3  tsutsui #define OMFB_ROPFUNC	0xB12C0000	/* common ROP function */
     27  1.3  tsutsui 
     28  1.3  tsutsui /*
     29  1.3  tsutsui  * Helper macros
     30  1.3  tsutsui  */
     31  1.3  tsutsui #define W(addr)  ((uint32_t *)(addr))
     32  1.3  tsutsui #define R(addr)  ((uint32_t *)((uint8_t *)(addr) +  0x40000))
     33  1.3  tsutsui #define P0(addr) ((uint32_t *)((uint8_t *)(addr) +  0x40000))
     34  1.3  tsutsui #define P1(addr) ((uint32_t *)((uint8_t *)(addr) +  0x80000))
     35  1.3  tsutsui #define P2(addr) ((uint32_t *)((uint8_t *)(addr) +  0xC0000))
     36  1.3  tsutsui #define P3(addr) ((uint32_t *)((uint8_t *)(addr) + 0x100000))
     37  1.3  tsutsui 
     38  1.3  tsutsui /*
     39  1.3  tsutsui  * ROP function
     40  1.1  tsutsui  *
     41  1.3  tsutsui  * LUNA's frame buffer uses Hitach HM53462 video RAM, which has raster
     42  1.3  tsutsui  * (logic) operation, or ROP, function.  To use ROP function on LUNA, write
     43  1.3  tsutsui  * a 32bit `mask' value to the specified address corresponding to each ROP
     44  1.3  tsutsui  * logic.
     45  1.1  tsutsui  *
     46  1.3  tsutsui  * D: the data writing to the video RAM
     47  1.3  tsutsui  * M: the data already stored on the video RAM
     48  1.1  tsutsui  */
     49  1.1  tsutsui 
     50  1.3  tsutsui /* operation		index	the video RAM contents will be */
     51  1.3  tsutsui #define ROP_ZERO	 0	/* all 0	*/
     52  1.3  tsutsui #define ROP_AND1	 1	/* D & M	*/
     53  1.3  tsutsui #define ROP_AND2	 2	/* ~D & M	*/
     54  1.3  tsutsui /* Not used on LUNA	 3			*/
     55  1.3  tsutsui #define ROP_AND3	 4	/* D & ~M	*/
     56  1.3  tsutsui #define ROP_THROUGH	 5	/* D		*/
     57  1.3  tsutsui #define ROP_EOR		 6	/* (~D & M) | (D & ~M)	*/
     58  1.3  tsutsui #define ROP_OR1		 7	/* D | M	*/
     59  1.3  tsutsui #define ROP_NOR		 8	/* ~D | ~M	*/
     60  1.3  tsutsui #define ROP_ENOR	 9	/* (D & M) | (~D & ~M)	*/
     61  1.3  tsutsui #define ROP_INV1	10	/* ~D		*/
     62  1.3  tsutsui #define ROP_OR2		11	/* ~D | M	*/
     63  1.3  tsutsui #define ROP_INV2	12	/* ~M		*/
     64  1.3  tsutsui #define ROP_OR3		13	/* D | ~M	*/
     65  1.3  tsutsui #define ROP_NAND	14	/* ~D | ~M	*/
     66  1.3  tsutsui #define ROP_ONE		15	/* all 1	*/
     67  1.3  tsutsui 
     68  1.2  tsutsui int omrasops1_init(struct rasops_info *, int, int);
     69  1.2  tsutsui int omrasops4_init(struct rasops_info *, int, int);
     70