sunxi_debereg.h revision 1.1 1 /* $NetBSD: sunxi_debereg.h,v 1.1 2018/04/03 12:52:16 bouyer Exp $ */
2
3 /*-
4 * Copyright (c) 2013 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas of 3am Software Foundry.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #define SUNXI_DEBE_MODCTL_REG 0x0800
33 #define SUNXI_DEBE_BACKCOLOR_REG 0x0804
34 #define SUNXI_DEBE_DISSIZE_REG 0x0808
35 #define SUNXI_DEBE_LAYSIZE_REG 0x0810
36 #define SUNXI_DEBE_LAYCOOR_REG 0x0820
37 #define SUNXI_DEBE_LAYLINEWIDTH_REG 0x0840
38 #define SUNXI_DEBE_LAYFB_L32ADD_REG 0x0850
39 #define SUNXI_DEBE_LAYFB_H4ADD_REG 0x0860
40 #define SUNXI_DEBE_REGBUFFCTL_REG 0x0870
41 #define SUNXI_DEBE_CKMAX_REG 0x0880
42 #define SUNXI_DEBE_CKMIN_REG 0x0884
43 #define SUNXI_DEBE_CKCFG_REG 0x0888
44 #define SUNXI_DEBE_ATTCTL0_REG 0x0890
45 #define SUNXI_DEBE_ATTCTL1_REG 0x08A0
46 #define SUNXI_DEBE_HWCCTL_REG 0x08D8
47 #define SUNXI_DEBE_HWCFBCTL_REG 0x08E0
48 #define SUNXI_DEBE_WBCTL_REG 0x08F0
49 #define SUNXI_DEBE_WBADD_REG 0x08F4
50 #define SUNXI_DEBE_WBLINEWIDTH_REG 0x08F8
51 #define SUNXI_DEBE_IYUVCTL_REG 0x0920
52 #define SUNXI_DEBE_IYUVADD_REG 0x0930
53 #define SUNXI_DEBE_IYUVLINEWIDTH_REG 0x0940
54 #define SUNXI_DEBE_YGCOEF_REG 0x0950
55 #define SUNXI_DEBE_YGCONS_REG 0x095C
56 #define SUNXI_DEBE_URCOEF_REG 0x0960
57 #define SUNXI_DEBE_URCONS_REG 0x096C
58 #define SUNXI_DEBE_VBCOEF_REG 0x0970
59 #define SUNXI_DEBE_VBCONS_REG 0x097C
60 #define SUNXI_DEBE_OCCTL_REG 0x09C0
61 #define SUNXI_DEBE_OCRCOEF_REG 0x09D0
62 #define SUNXI_DEBE_OCRCONS_REG 0x09DC
63 #define SUNXI_DEBE_OCGCOEF_REG 0x09E0
64 #define SUNXI_DEBE_OCGCONS_REG 0x09EC
65 #define SUNXI_DEBE_OCBCOEF_REG 0x09F0
66 #define SUNXI_DEBE_OCBCONS_REG 0x09FC
67 #define SUNXI_DEBE_HWC_PATTERN_BLOCK 0x4800
68 #define SUNXI_DEBE_HWC_PALETTE_TABLE 0x4C00
69
70 #define SUNXI_DEBE_MODCTL_LINE_SEL __BIT(29)
71 #define SUNXI_DEBE_MODCTL_ITLMOD_EN __BIT(28)
72 #define SUNXI_DEBE_MODCTL_OUT_SEL __BITS(22,20)
73 #define SUNXI_DEBE_MODCTL_OUT_SEL_LCD0 0
74 #define SUNXI_DEBE_MODCTL_OUT_SEL_LCD1 1
75 #define SUNXI_DEBE_MODCTL_OUT_SEL_FE0 6
76 #define SUNXI_DEBE_MODCTL_OUT_SEL_FE1 7
77 #define SUNXI_DEBE_MODCTL_OSCA_EN __BIT(17)
78 #define SUNXI_DEBE_MODCTL_HWC_EN __BIT(16)
79 #define SUNXI_DEBE_MODCTL_LAY3_EN __BIT(11)
80 #define SUNXI_DEBE_MODCTL_LAY2_EN __BIT(10)
81 #define SUNXI_DEBE_MODCTL_LAY1_EN __BIT(9)
82 #define SUNXI_DEBE_MODCTL_LAY0_EN __BIT(8)
83 #define SUNXI_DEBE_MODCTL_START_CTL __BIT(1)
84 #define SUNXI_DEBE_MODCTL_EN __BIT(0)
85
86 #define SUNXI_DEBE_ATTCTL0_LAY_GLBALPHA __BITS(31,24)
87 #define SUNXI_DEBE_ATTCTL0_LAY_WORKMOD __BITS(23,22)
88 #define SUNXI_DEBE_ATTCTL0_PREMUL __BIT(21,20)
89 #define SUNXI_DEBE_ATTCTL0_CKEN __BITS(19,18)
90 #define SUNXI_DEBE_ATTCTL0_LAY_PIPESEL __BIT(15)
91 #define SUNXI_DEBE_ATTCTL0_LAY_PRISEL __BITS(11,10)
92 #define SUNXI_DEBE_ATTCTL0_LAY_VDOSEL __BIT(4)
93 #define SUNXI_DEBE_ATTCTL0_LAY_YUVEN __BIT(2)
94 #define SUNXI_DEBE_ATTCTL0_LAY_VDOEN __BIT(1)
95 #define SUNXI_DEBE_ATTCTL0_LAY_GLBALPHAEN __BIT(0)
96
97 #define SUNXI_DEBE_ATTCTL1_LAY_HSCAFCT __BITS(15,14)
98 #define SUNXI_DEBE_ATTCTL1_LAY_WSCAFCT __BITS(13,12)
99 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT __BITS(11,8)
100 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_MONO_1BPP 0
101 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_MONO_2BPP 1
102 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_MONO_4BPP 2
103 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_MONO_8BPP 3
104 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_RGB655 4
105 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_RGB565 5
106 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_RGB556 6
107 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_ARGB1555 7
108 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_RGBA5551 8
109 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_XRGB8888 9
110 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_ARGB8888 10
111 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_RGB888 11
112 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_ARGB4444 12
113 #define SUNXI_DEBE_ATTCTL1_LAY_FBFMT_RGBA4444 13
114 #define SUNXI_DEBE_ATTCTL1_LAY_BRSWAPEN __BIT(2)
115 #define SUNXI_DEBE_ATTCTL1_LAY_FBPS __BITS(1,0)
116 #define SUNXI_DEBE_ATTCTL1_LAY_FBPS_32BPP_ARGB 0
117 #define SUNXI_DEBE_ATTCTL1_LAY_FBPS_32BPP_BGRA 2
118
119 #define SUNXI_DEBE_REGBUFFCTL_REGAUTOLOAD_DIS __BIT(1)
120 #define SUNXI_DEBE_REGBUFFCTL_REGLOADCTL __BIT(0)
121
122 #define SUNXI_DEBE_HWCCTL_YCOOR __BITS(31,16)
123 #define SUNXI_DEBE_HWCCTL_XCOOR __BITS(15,0)
124
125 #define SUNXI_DEBE_HWCFBCTL_YCOOROFF __BITS(31,24)
126 #define SUNXI_DEBE_HWCFBCTL_XCOOROFF __BITS(23,16)
127 #define SUNXI_DEBE_HWCFBCTL_YSIZE __BITS(5,4)
128 #define SUNXI_DEBE_HWCFBCTL_YSIZE_32 0
129 #define SUNXI_DEBE_HWCFBCTL_YSIZE_64 1
130 #define SUNXI_DEBE_HWCFBCTL_XSIZE __BITS(3,2)
131 #define SUNXI_DEBE_HWCFBCTL_XSIZE_32 0
132 #define SUNXI_DEBE_HWCFBCTL_XSIZE_64 1
133 #define SUNXI_DEBE_HWCFBCTL_FBFMT __BITS(1,0)
134 #define SUNXI_DEBE_HWCFBCTL_FBFMT_1BPP 0
135 #define SUNXI_DEBE_HWCFBCTL_FBFMT_2BPP 1
136 #define SUNXI_DEBE_HWCFBCTL_FBFMT_4BPP 2
137 #define SUNXI_DEBE_HWCFBCTL_FBFMT_8BPP 3
138
139