xref: /linux/drivers/gpu/drm/radeon/si_reg.h (revision e5451c8f8330e03ad3cfa16048b4daf961af434f)
182d118efSAlex Deucher /*
282d118efSAlex Deucher  * Copyright 2010 Advanced Micro Devices, Inc.
382d118efSAlex Deucher  *
482d118efSAlex Deucher  * Permission is hereby granted, free of charge, to any person obtaining a
582d118efSAlex Deucher  * copy of this software and associated documentation files (the "Software"),
682d118efSAlex Deucher  * to deal in the Software without restriction, including without limitation
782d118efSAlex Deucher  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
882d118efSAlex Deucher  * and/or sell copies of the Software, and to permit persons to whom the
982d118efSAlex Deucher  * Software is furnished to do so, subject to the following conditions:
1082d118efSAlex Deucher  *
1182d118efSAlex Deucher  * The above copyright notice and this permission notice shall be included in
1282d118efSAlex Deucher  * all copies or substantial portions of the Software.
1382d118efSAlex Deucher  *
1482d118efSAlex Deucher  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1582d118efSAlex Deucher  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1682d118efSAlex Deucher  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1782d118efSAlex Deucher  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
1882d118efSAlex Deucher  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
1982d118efSAlex Deucher  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2082d118efSAlex Deucher  * OTHER DEALINGS IN THE SOFTWARE.
2182d118efSAlex Deucher  *
2282d118efSAlex Deucher  * Authors: Alex Deucher
2382d118efSAlex Deucher  */
2482d118efSAlex Deucher #ifndef __SI_REG_H__
2582d118efSAlex Deucher #define __SI_REG_H__
2682d118efSAlex Deucher 
2782d118efSAlex Deucher /* SI */
2882d118efSAlex Deucher #define SI_DC_GPIO_HPD_MASK                      0x65b0
2982d118efSAlex Deucher #define SI_DC_GPIO_HPD_A                         0x65b4
3082d118efSAlex Deucher #define SI_DC_GPIO_HPD_EN                        0x65b8
3182d118efSAlex Deucher #define SI_DC_GPIO_HPD_Y                         0x65bc
3282d118efSAlex Deucher 
33*b7019b2fSAlex Deucher #define SI_GRPH_CONTROL                          0x6804
34*b7019b2fSAlex Deucher #       define SI_GRPH_DEPTH(x)                  (((x) & 0x3) << 0)
35*b7019b2fSAlex Deucher #       define SI_GRPH_DEPTH_8BPP                0
36*b7019b2fSAlex Deucher #       define SI_GRPH_DEPTH_16BPP               1
37*b7019b2fSAlex Deucher #       define SI_GRPH_DEPTH_32BPP               2
38*b7019b2fSAlex Deucher #       define SI_GRPH_NUM_BANKS(x)              (((x) & 0x3) << 2)
39*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_2_BANK               0
40*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_4_BANK               1
41*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_8_BANK               2
42*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_16_BANK              3
43*b7019b2fSAlex Deucher #       define SI_GRPH_Z(x)                      (((x) & 0x3) << 4)
44*b7019b2fSAlex Deucher #       define SI_GRPH_BANK_WIDTH(x)             (((x) & 0x3) << 6)
45*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_WIDTH_1         0
46*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_WIDTH_2         1
47*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_WIDTH_4         2
48*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_WIDTH_8         3
49*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT(x)                 (((x) & 0x7) << 8)
50*b7019b2fSAlex Deucher /* 8 BPP */
51*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_INDEXED            0
52*b7019b2fSAlex Deucher /* 16 BPP */
53*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_ARGB1555           0
54*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_ARGB565            1
55*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_ARGB4444           2
56*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_AI88               3
57*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_MONO16             4
58*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_BGRA5551           5
59*b7019b2fSAlex Deucher /* 32 BPP */
60*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_ARGB8888           0
61*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_ARGB2101010        1
62*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_32BPP_DIG          2
63*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_8B_ARGB2101010     3
64*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_BGRA1010102        4
65*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_8B_BGRA1010102     5
66*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_RGB111110          6
67*b7019b2fSAlex Deucher #       define SI_GRPH_FORMAT_BGR101111          7
68*b7019b2fSAlex Deucher #       define SI_GRPH_BANK_HEIGHT(x)            (((x) & 0x3) << 11)
69*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_HEIGHT_1        0
70*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_HEIGHT_2        1
71*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_HEIGHT_4        2
72*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_BANK_HEIGHT_8        3
73*b7019b2fSAlex Deucher #       define SI_GRPH_TILE_SPLIT(x)             (((x) & 0x7) << 13)
74*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_64B       0
75*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_128B      1
76*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_256B      2
77*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_512B      3
78*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_1KB       4
79*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_2KB       5
80*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_TILE_SPLIT_4KB       6
81*b7019b2fSAlex Deucher #       define SI_GRPH_MACRO_TILE_ASPECT(x)      (((x) & 0x3) << 18)
82*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_MACRO_TILE_ASPECT_1  0
83*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_MACRO_TILE_ASPECT_2  1
84*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_MACRO_TILE_ASPECT_4  2
85*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_MACRO_TILE_ASPECT_8  3
86*b7019b2fSAlex Deucher #       define SI_GRPH_ARRAY_MODE(x)             (((x) & 0x7) << 20)
87*b7019b2fSAlex Deucher #       define SI_GRPH_ARRAY_LINEAR_GENERAL      0
88*b7019b2fSAlex Deucher #       define SI_GRPH_ARRAY_LINEAR_ALIGNED      1
89*b7019b2fSAlex Deucher #       define SI_GRPH_ARRAY_1D_TILED_THIN1      2
90*b7019b2fSAlex Deucher #       define SI_GRPH_ARRAY_2D_TILED_THIN1      4
91*b7019b2fSAlex Deucher #       define SI_GRPH_PIPE_CONFIG(x)		 (((x) & 0x1f) << 24)
92*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P2			 0
93*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P4_8x16		 4
94*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P4_16x16		 5
95*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P4_16x32		 6
96*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P4_32x32		 7
97*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_16x16_8x16	 8
98*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_16x32_8x16	 9
99*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_32x32_8x16	 10
100*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_16x32_16x16	 11
101*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_32x32_16x16	 12
102*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_32x32_16x32	 13
103*b7019b2fSAlex Deucher #       define SI_ADDR_SURF_P8_32x64_32x32	 14
104*b7019b2fSAlex Deucher 
10582d118efSAlex Deucher #endif
106