1254885Sdumbbell/*
2254885Sdumbbell * Copyright 2010 Advanced Micro Devices, Inc.
3254885Sdumbbell *
4254885Sdumbbell * Permission is hereby granted, free of charge, to any person obtaining a
5254885Sdumbbell * copy of this software and associated documentation files (the "Software"),
6254885Sdumbbell * to deal in the Software without restriction, including without limitation
7254885Sdumbbell * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8254885Sdumbbell * and/or sell copies of the Software, and to permit persons to whom the
9254885Sdumbbell * Software is furnished to do so, subject to the following conditions:
10254885Sdumbbell *
11254885Sdumbbell * The above copyright notice and this permission notice shall be included in
12254885Sdumbbell * all copies or substantial portions of the Software.
13254885Sdumbbell *
14254885Sdumbbell * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15254885Sdumbbell * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16254885Sdumbbell * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17254885Sdumbbell * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18254885Sdumbbell * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19254885Sdumbbell * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20254885Sdumbbell * OTHER DEALINGS IN THE SOFTWARE.
21254885Sdumbbell *
22254885Sdumbbell * Authors: Alex Deucher
23254885Sdumbbell */
24254885Sdumbbell#ifndef __SI_REG_H__
25254885Sdumbbell#define __SI_REG_H__
26254885Sdumbbell
27254885Sdumbbell#include <sys/cdefs.h>
28254885Sdumbbell__FBSDID("$FreeBSD$");
29254885Sdumbbell
30254885Sdumbbell/* SI */
31254885Sdumbbell#define SI_DC_GPIO_HPD_MASK                      0x65b0
32254885Sdumbbell#define SI_DC_GPIO_HPD_A                         0x65b4
33254885Sdumbbell#define SI_DC_GPIO_HPD_EN                        0x65b8
34254885Sdumbbell#define SI_DC_GPIO_HPD_Y                         0x65bc
35254885Sdumbbell
36254885Sdumbbell#define SI_GRPH_CONTROL                          0x6804
37254885Sdumbbell#       define SI_GRPH_DEPTH(x)                  (((x) & 0x3) << 0)
38254885Sdumbbell#       define SI_GRPH_DEPTH_8BPP                0
39254885Sdumbbell#       define SI_GRPH_DEPTH_16BPP               1
40254885Sdumbbell#       define SI_GRPH_DEPTH_32BPP               2
41254885Sdumbbell#       define SI_GRPH_NUM_BANKS(x)              (((x) & 0x3) << 2)
42254885Sdumbbell#       define SI_ADDR_SURF_2_BANK               0
43254885Sdumbbell#       define SI_ADDR_SURF_4_BANK               1
44254885Sdumbbell#       define SI_ADDR_SURF_8_BANK               2
45254885Sdumbbell#       define SI_ADDR_SURF_16_BANK              3
46254885Sdumbbell#       define SI_GRPH_Z(x)                      (((x) & 0x3) << 4)
47254885Sdumbbell#       define SI_GRPH_BANK_WIDTH(x)             (((x) & 0x3) << 6)
48254885Sdumbbell#       define SI_ADDR_SURF_BANK_WIDTH_1         0
49254885Sdumbbell#       define SI_ADDR_SURF_BANK_WIDTH_2         1
50254885Sdumbbell#       define SI_ADDR_SURF_BANK_WIDTH_4         2
51254885Sdumbbell#       define SI_ADDR_SURF_BANK_WIDTH_8         3
52254885Sdumbbell#       define SI_GRPH_FORMAT(x)                 (((x) & 0x7) << 8)
53254885Sdumbbell/* 8 BPP */
54254885Sdumbbell#       define SI_GRPH_FORMAT_INDEXED            0
55254885Sdumbbell/* 16 BPP */
56254885Sdumbbell#       define SI_GRPH_FORMAT_ARGB1555           0
57254885Sdumbbell#       define SI_GRPH_FORMAT_ARGB565            1
58254885Sdumbbell#       define SI_GRPH_FORMAT_ARGB4444           2
59254885Sdumbbell#       define SI_GRPH_FORMAT_AI88               3
60254885Sdumbbell#       define SI_GRPH_FORMAT_MONO16             4
61254885Sdumbbell#       define SI_GRPH_FORMAT_BGRA5551           5
62254885Sdumbbell/* 32 BPP */
63254885Sdumbbell#       define SI_GRPH_FORMAT_ARGB8888           0
64254885Sdumbbell#       define SI_GRPH_FORMAT_ARGB2101010        1
65254885Sdumbbell#       define SI_GRPH_FORMAT_32BPP_DIG          2
66254885Sdumbbell#       define SI_GRPH_FORMAT_8B_ARGB2101010     3
67254885Sdumbbell#       define SI_GRPH_FORMAT_BGRA1010102        4
68254885Sdumbbell#       define SI_GRPH_FORMAT_8B_BGRA1010102     5
69254885Sdumbbell#       define SI_GRPH_FORMAT_RGB111110          6
70254885Sdumbbell#       define SI_GRPH_FORMAT_BGR101111          7
71254885Sdumbbell#       define SI_GRPH_BANK_HEIGHT(x)            (((x) & 0x3) << 11)
72254885Sdumbbell#       define SI_ADDR_SURF_BANK_HEIGHT_1        0
73254885Sdumbbell#       define SI_ADDR_SURF_BANK_HEIGHT_2        1
74254885Sdumbbell#       define SI_ADDR_SURF_BANK_HEIGHT_4        2
75254885Sdumbbell#       define SI_ADDR_SURF_BANK_HEIGHT_8        3
76254885Sdumbbell#       define SI_GRPH_TILE_SPLIT(x)             (((x) & 0x7) << 13)
77254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_64B       0
78254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_128B      1
79254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_256B      2
80254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_512B      3
81254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_1KB       4
82254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_2KB       5
83254885Sdumbbell#       define SI_ADDR_SURF_TILE_SPLIT_4KB       6
84254885Sdumbbell#       define SI_GRPH_MACRO_TILE_ASPECT(x)      (((x) & 0x3) << 18)
85254885Sdumbbell#       define SI_ADDR_SURF_MACRO_TILE_ASPECT_1  0
86254885Sdumbbell#       define SI_ADDR_SURF_MACRO_TILE_ASPECT_2  1
87254885Sdumbbell#       define SI_ADDR_SURF_MACRO_TILE_ASPECT_4  2
88254885Sdumbbell#       define SI_ADDR_SURF_MACRO_TILE_ASPECT_8  3
89254885Sdumbbell#       define SI_GRPH_ARRAY_MODE(x)             (((x) & 0x7) << 20)
90254885Sdumbbell#       define SI_GRPH_ARRAY_LINEAR_GENERAL      0
91254885Sdumbbell#       define SI_GRPH_ARRAY_LINEAR_ALIGNED      1
92254885Sdumbbell#       define SI_GRPH_ARRAY_1D_TILED_THIN1      2
93254885Sdumbbell#       define SI_GRPH_ARRAY_2D_TILED_THIN1      4
94254885Sdumbbell#       define SI_GRPH_PIPE_CONFIG(x)		 (((x) & 0x1f) << 24)
95254885Sdumbbell#       define SI_ADDR_SURF_P2			 0
96254885Sdumbbell#       define SI_ADDR_SURF_P4_8x16		 4
97254885Sdumbbell#       define SI_ADDR_SURF_P4_16x16		 5
98254885Sdumbbell#       define SI_ADDR_SURF_P4_16x32		 6
99254885Sdumbbell#       define SI_ADDR_SURF_P4_32x32		 7
100254885Sdumbbell#       define SI_ADDR_SURF_P8_16x16_8x16	 8
101254885Sdumbbell#       define SI_ADDR_SURF_P8_16x32_8x16	 9
102254885Sdumbbell#       define SI_ADDR_SURF_P8_32x32_8x16	 10
103254885Sdumbbell#       define SI_ADDR_SURF_P8_16x32_16x16	 11
104254885Sdumbbell#       define SI_ADDR_SURF_P8_32x32_16x16	 12
105254885Sdumbbell#       define SI_ADDR_SURF_P8_32x32_16x32	 13
106254885Sdumbbell#       define SI_ADDR_SURF_P8_32x64_32x32	 14
107254885Sdumbbell
108254885Sdumbbell#endif
109