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