162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci#ifndef __LINUX_FBIO_H
362306a36Sopenharmony_ci#define __LINUX_FBIO_H
462306a36Sopenharmony_ci
562306a36Sopenharmony_ci#include <uapi/asm/fbio.h>
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#define FBIOPUTCMAP_SPARC _IOW('F', 3, struct fbcmap)
862306a36Sopenharmony_ci#define FBIOGETCMAP_SPARC _IOW('F', 4, struct fbcmap)
962306a36Sopenharmony_ci/* Addresses on the fd of a cgsix that are mappable */
1062306a36Sopenharmony_ci#define CG6_FBC    0x70000000
1162306a36Sopenharmony_ci#define CG6_TEC    0x70001000
1262306a36Sopenharmony_ci#define CG6_BTREGS 0x70002000
1362306a36Sopenharmony_ci#define CG6_FHC    0x70004000
1462306a36Sopenharmony_ci#define CG6_THC    0x70005000
1562306a36Sopenharmony_ci#define CG6_ROM    0x70006000
1662306a36Sopenharmony_ci#define CG6_RAM    0x70016000
1762306a36Sopenharmony_ci#define CG6_DHC    0x80000000
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define CG3_MMAP_OFFSET 0x4000000
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci/* Addresses on the fd of a tcx that are mappable */
2262306a36Sopenharmony_ci#define TCX_RAM8BIT   		0x00000000
2362306a36Sopenharmony_ci#define TCX_RAM24BIT   		0x01000000
2462306a36Sopenharmony_ci#define TCX_UNK3   		0x10000000
2562306a36Sopenharmony_ci#define TCX_UNK4   		0x20000000
2662306a36Sopenharmony_ci#define TCX_CONTROLPLANE   	0x28000000
2762306a36Sopenharmony_ci#define TCX_UNK6   		0x30000000
2862306a36Sopenharmony_ci#define TCX_UNK7   		0x38000000
2962306a36Sopenharmony_ci#define TCX_TEC    		0x70000000
3062306a36Sopenharmony_ci#define TCX_BTREGS 		0x70002000
3162306a36Sopenharmony_ci#define TCX_THC    		0x70004000
3262306a36Sopenharmony_ci#define TCX_DHC    		0x70008000
3362306a36Sopenharmony_ci#define TCX_ALT	   		0x7000a000
3462306a36Sopenharmony_ci#define TCX_SYNC   		0x7000e000
3562306a36Sopenharmony_ci#define TCX_UNK2    		0x70010000
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci/* CG14 definitions */
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* Offsets into the OBIO space: */
4062306a36Sopenharmony_ci#define CG14_REGS        0       /* registers */
4162306a36Sopenharmony_ci#define CG14_CURSORREGS  0x1000  /* cursor registers */
4262306a36Sopenharmony_ci#define CG14_DACREGS     0x2000  /* DAC registers */
4362306a36Sopenharmony_ci#define CG14_XLUT        0x3000  /* X Look Up Table -- ??? */
4462306a36Sopenharmony_ci#define CG14_CLUT1       0x4000  /* Color Look Up Table */
4562306a36Sopenharmony_ci#define CG14_CLUT2       0x5000  /* Color Look Up Table */
4662306a36Sopenharmony_ci#define CG14_CLUT3       0x6000  /* Color Look Up Table */
4762306a36Sopenharmony_ci#define CG14_AUTO	 0xf000
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_cistruct  fbcmap32 {
5062306a36Sopenharmony_ci	int             index;          /* first element (0 origin) */
5162306a36Sopenharmony_ci	int             count;
5262306a36Sopenharmony_ci	u32		red;
5362306a36Sopenharmony_ci	u32		green;
5462306a36Sopenharmony_ci	u32		blue;
5562306a36Sopenharmony_ci};
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci#define FBIOPUTCMAP32	_IOW('F', 3, struct fbcmap32)
5862306a36Sopenharmony_ci#define FBIOGETCMAP32	_IOW('F', 4, struct fbcmap32)
5962306a36Sopenharmony_ci
6062306a36Sopenharmony_cistruct fbcursor32 {
6162306a36Sopenharmony_ci	short set;		/* what to set, choose from the list above */
6262306a36Sopenharmony_ci	short enable;		/* cursor on/off */
6362306a36Sopenharmony_ci	struct fbcurpos pos;	/* cursor position */
6462306a36Sopenharmony_ci	struct fbcurpos hot;	/* cursor hot spot */
6562306a36Sopenharmony_ci	struct fbcmap32 cmap;	/* color map info */
6662306a36Sopenharmony_ci	struct fbcurpos size;	/* cursor bit map size */
6762306a36Sopenharmony_ci	u32	image;		/* cursor image bits */
6862306a36Sopenharmony_ci	u32	mask;		/* cursor mask bits */
6962306a36Sopenharmony_ci};
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define FBIOSCURSOR32	_IOW('F', 24, struct fbcursor32)
7262306a36Sopenharmony_ci#define FBIOGCURSOR32	_IOW('F', 25, struct fbcursor32)
7362306a36Sopenharmony_ci#endif /* __LINUX_FBIO_H */
74