Home | History | Annotate | Line # | Download | only in dev
omrasopsvar.h revision 1.3.20.1
      1  1.3.20.1   martin /* $NetBSD: omrasopsvar.h,v 1.3.20.1 2020/04/13 08:03:56 martin 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.20.1   martin #include <machine/board.h>
     24  1.3.20.1   martin 
     25  1.3.20.1   martin #define OMFB_PLANEMASK	BMAP_BMSEL	/* BMSEL register */
     26  1.3.20.1   martin #define OMFB_FB_WADDR	(BMAP_BMP + 8)	/* common plane */
     27  1.3.20.1   martin #define OMFB_FB_RADDR	(BMAP_BMAP0 + 8)/* plane #0 */
     28  1.3.20.1   martin #define OMFB_ROPFUNC	BMAP_FN		/* common ROP function */
     29       1.3  tsutsui 
     30       1.3  tsutsui /*
     31       1.3  tsutsui  * Helper macros
     32       1.3  tsutsui  */
     33       1.3  tsutsui #define W(addr)  ((uint32_t *)(addr))
     34       1.3  tsutsui #define R(addr)  ((uint32_t *)((uint8_t *)(addr) +  0x40000))
     35       1.3  tsutsui #define P0(addr) ((uint32_t *)((uint8_t *)(addr) +  0x40000))
     36       1.3  tsutsui #define P1(addr) ((uint32_t *)((uint8_t *)(addr) +  0x80000))
     37       1.3  tsutsui #define P2(addr) ((uint32_t *)((uint8_t *)(addr) +  0xC0000))
     38       1.3  tsutsui #define P3(addr) ((uint32_t *)((uint8_t *)(addr) + 0x100000))
     39       1.3  tsutsui 
     40       1.3  tsutsui /*
     41       1.3  tsutsui  * ROP function
     42       1.1  tsutsui  *
     43  1.3.20.1   martin  * LUNA's frame buffer uses Hitachi HM53462 video RAM, which has raster
     44       1.3  tsutsui  * (logic) operation, or ROP, function.  To use ROP function on LUNA, write
     45       1.3  tsutsui  * a 32bit `mask' value to the specified address corresponding to each ROP
     46       1.3  tsutsui  * logic.
     47       1.1  tsutsui  *
     48       1.3  tsutsui  * D: the data writing to the video RAM
     49       1.3  tsutsui  * M: the data already stored on the video RAM
     50       1.1  tsutsui  */
     51       1.1  tsutsui 
     52       1.3  tsutsui /* operation		index	the video RAM contents will be */
     53       1.3  tsutsui #define ROP_ZERO	 0	/* all 0	*/
     54       1.3  tsutsui #define ROP_AND1	 1	/* D & M	*/
     55       1.3  tsutsui #define ROP_AND2	 2	/* ~D & M	*/
     56       1.3  tsutsui /* Not used on LUNA	 3			*/
     57       1.3  tsutsui #define ROP_AND3	 4	/* D & ~M	*/
     58       1.3  tsutsui #define ROP_THROUGH	 5	/* D		*/
     59       1.3  tsutsui #define ROP_EOR		 6	/* (~D & M) | (D & ~M)	*/
     60       1.3  tsutsui #define ROP_OR1		 7	/* D | M	*/
     61       1.3  tsutsui #define ROP_NOR		 8	/* ~D | ~M	*/
     62       1.3  tsutsui #define ROP_ENOR	 9	/* (D & M) | (~D & ~M)	*/
     63       1.3  tsutsui #define ROP_INV1	10	/* ~D		*/
     64       1.3  tsutsui #define ROP_OR2		11	/* ~D | M	*/
     65       1.3  tsutsui #define ROP_INV2	12	/* ~M		*/
     66       1.3  tsutsui #define ROP_OR3		13	/* D | ~M	*/
     67       1.3  tsutsui #define ROP_NAND	14	/* ~D | ~M	*/
     68       1.3  tsutsui #define ROP_ONE		15	/* all 1	*/
     69       1.3  tsutsui 
     70       1.2  tsutsui int omrasops1_init(struct rasops_info *, int, int);
     71       1.2  tsutsui int omrasops4_init(struct rasops_info *, int, int);
     72