1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_FBIO_H
3#define __LINUX_FBIO_H
4
5#include <uapi/asm/fbio.h>
6
7#define FBIOPUTCMAP_SPARC _IOW('F', 3, struct fbcmap)
8#define FBIOGETCMAP_SPARC _IOW('F', 4, struct fbcmap)
9/* Addresses on the fd of a cgsix that are mappable */
10#define CG6_FBC    0x70000000
11#define CG6_TEC    0x70001000
12#define CG6_BTREGS 0x70002000
13#define CG6_FHC    0x70004000
14#define CG6_THC    0x70005000
15#define CG6_ROM    0x70006000
16#define CG6_RAM    0x70016000
17#define CG6_DHC    0x80000000
18
19#define CG3_MMAP_OFFSET 0x4000000
20
21/* Addresses on the fd of a tcx that are mappable */
22#define TCX_RAM8BIT   		0x00000000
23#define TCX_RAM24BIT   		0x01000000
24#define TCX_UNK3   		0x10000000
25#define TCX_UNK4   		0x20000000
26#define TCX_CONTROLPLANE   	0x28000000
27#define TCX_UNK6   		0x30000000
28#define TCX_UNK7   		0x38000000
29#define TCX_TEC    		0x70000000
30#define TCX_BTREGS 		0x70002000
31#define TCX_THC    		0x70004000
32#define TCX_DHC    		0x70008000
33#define TCX_ALT	   		0x7000a000
34#define TCX_SYNC   		0x7000e000
35#define TCX_UNK2    		0x70010000
36
37/* CG14 definitions */
38
39/* Offsets into the OBIO space: */
40#define CG14_REGS        0       /* registers */
41#define CG14_CURSORREGS  0x1000  /* cursor registers */
42#define CG14_DACREGS     0x2000  /* DAC registers */
43#define CG14_XLUT        0x3000  /* X Look Up Table -- ??? */
44#define CG14_CLUT1       0x4000  /* Color Look Up Table */
45#define CG14_CLUT2       0x5000  /* Color Look Up Table */
46#define CG14_CLUT3       0x6000  /* Color Look Up Table */
47#define CG14_AUTO	 0xf000
48
49struct  fbcmap32 {
50	int             index;          /* first element (0 origin) */
51	int             count;
52	u32		red;
53	u32		green;
54	u32		blue;
55};
56
57#define FBIOPUTCMAP32	_IOW('F', 3, struct fbcmap32)
58#define FBIOGETCMAP32	_IOW('F', 4, struct fbcmap32)
59
60struct fbcursor32 {
61	short set;		/* what to set, choose from the list above */
62	short enable;		/* cursor on/off */
63	struct fbcurpos pos;	/* cursor position */
64	struct fbcurpos hot;	/* cursor hot spot */
65	struct fbcmap32 cmap;	/* color map info */
66	struct fbcurpos size;	/* cursor bit map size */
67	u32	image;		/* cursor image bits */
68	u32	mask;		/* cursor mask bits */
69};
70
71#define FBIOSCURSOR32	_IOW('F', 24, struct fbcursor32)
72#define FBIOGCURSOR32	_IOW('F', 25, struct fbcursor32)
73#endif /* __LINUX_FBIO_H */
74