18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2008 Advanced Micro Devices, Inc.
38c2ecf20Sopenharmony_ci * Copyright 2008 Red Hat Inc.
48c2ecf20Sopenharmony_ci * Copyright 2009 Jerome Glisse.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
78c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
88c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
98c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
108c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
118c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
128c2ecf20Sopenharmony_ci *
138c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
148c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
158c2ecf20Sopenharmony_ci *
168c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
178c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
188c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
198c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
208c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
218c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
228c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
238c2ecf20Sopenharmony_ci *
248c2ecf20Sopenharmony_ci * Authors: Dave Airlie
258c2ecf20Sopenharmony_ci *          Alex Deucher
268c2ecf20Sopenharmony_ci *          Jerome Glisse
278c2ecf20Sopenharmony_ci */
288c2ecf20Sopenharmony_ci#ifndef __RS400D_H__
298c2ecf20Sopenharmony_ci#define __RS400D_H__
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci/* Registers */
328c2ecf20Sopenharmony_ci#define R_000148_MC_FB_LOCATION                      0x000148
338c2ecf20Sopenharmony_ci#define   S_000148_MC_FB_START(x)                      (((x) & 0xFFFF) << 0)
348c2ecf20Sopenharmony_ci#define   G_000148_MC_FB_START(x)                      (((x) >> 0) & 0xFFFF)
358c2ecf20Sopenharmony_ci#define   C_000148_MC_FB_START                         0xFFFF0000
368c2ecf20Sopenharmony_ci#define   S_000148_MC_FB_TOP(x)                        (((x) & 0xFFFF) << 16)
378c2ecf20Sopenharmony_ci#define   G_000148_MC_FB_TOP(x)                        (((x) >> 16) & 0xFFFF)
388c2ecf20Sopenharmony_ci#define   C_000148_MC_FB_TOP                           0x0000FFFF
398c2ecf20Sopenharmony_ci#define R_00015C_NB_TOM                              0x00015C
408c2ecf20Sopenharmony_ci#define   S_00015C_MC_FB_START(x)                      (((x) & 0xFFFF) << 0)
418c2ecf20Sopenharmony_ci#define   G_00015C_MC_FB_START(x)                      (((x) >> 0) & 0xFFFF)
428c2ecf20Sopenharmony_ci#define   C_00015C_MC_FB_START                         0xFFFF0000
438c2ecf20Sopenharmony_ci#define   S_00015C_MC_FB_TOP(x)                        (((x) & 0xFFFF) << 16)
448c2ecf20Sopenharmony_ci#define   G_00015C_MC_FB_TOP(x)                        (((x) >> 16) & 0xFFFF)
458c2ecf20Sopenharmony_ci#define   C_00015C_MC_FB_TOP                           0x0000FFFF
468c2ecf20Sopenharmony_ci#define R_0007C0_CP_STAT                             0x0007C0
478c2ecf20Sopenharmony_ci#define   S_0007C0_MRU_BUSY(x)                         (((x) & 0x1) << 0)
488c2ecf20Sopenharmony_ci#define   G_0007C0_MRU_BUSY(x)                         (((x) >> 0) & 0x1)
498c2ecf20Sopenharmony_ci#define   C_0007C0_MRU_BUSY                            0xFFFFFFFE
508c2ecf20Sopenharmony_ci#define   S_0007C0_MWU_BUSY(x)                         (((x) & 0x1) << 1)
518c2ecf20Sopenharmony_ci#define   G_0007C0_MWU_BUSY(x)                         (((x) >> 1) & 0x1)
528c2ecf20Sopenharmony_ci#define   C_0007C0_MWU_BUSY                            0xFFFFFFFD
538c2ecf20Sopenharmony_ci#define   S_0007C0_RSIU_BUSY(x)                        (((x) & 0x1) << 2)
548c2ecf20Sopenharmony_ci#define   G_0007C0_RSIU_BUSY(x)                        (((x) >> 2) & 0x1)
558c2ecf20Sopenharmony_ci#define   C_0007C0_RSIU_BUSY                           0xFFFFFFFB
568c2ecf20Sopenharmony_ci#define   S_0007C0_RCIU_BUSY(x)                        (((x) & 0x1) << 3)
578c2ecf20Sopenharmony_ci#define   G_0007C0_RCIU_BUSY(x)                        (((x) >> 3) & 0x1)
588c2ecf20Sopenharmony_ci#define   C_0007C0_RCIU_BUSY                           0xFFFFFFF7
598c2ecf20Sopenharmony_ci#define   S_0007C0_CSF_PRIMARY_BUSY(x)                 (((x) & 0x1) << 9)
608c2ecf20Sopenharmony_ci#define   G_0007C0_CSF_PRIMARY_BUSY(x)                 (((x) >> 9) & 0x1)
618c2ecf20Sopenharmony_ci#define   C_0007C0_CSF_PRIMARY_BUSY                    0xFFFFFDFF
628c2ecf20Sopenharmony_ci#define   S_0007C0_CSF_INDIRECT_BUSY(x)                (((x) & 0x1) << 10)
638c2ecf20Sopenharmony_ci#define   G_0007C0_CSF_INDIRECT_BUSY(x)                (((x) >> 10) & 0x1)
648c2ecf20Sopenharmony_ci#define   C_0007C0_CSF_INDIRECT_BUSY                   0xFFFFFBFF
658c2ecf20Sopenharmony_ci#define   S_0007C0_CSQ_PRIMARY_BUSY(x)                 (((x) & 0x1) << 11)
668c2ecf20Sopenharmony_ci#define   G_0007C0_CSQ_PRIMARY_BUSY(x)                 (((x) >> 11) & 0x1)
678c2ecf20Sopenharmony_ci#define   C_0007C0_CSQ_PRIMARY_BUSY                    0xFFFFF7FF
688c2ecf20Sopenharmony_ci#define   S_0007C0_CSQ_INDIRECT_BUSY(x)                (((x) & 0x1) << 12)
698c2ecf20Sopenharmony_ci#define   G_0007C0_CSQ_INDIRECT_BUSY(x)                (((x) >> 12) & 0x1)
708c2ecf20Sopenharmony_ci#define   C_0007C0_CSQ_INDIRECT_BUSY                   0xFFFFEFFF
718c2ecf20Sopenharmony_ci#define   S_0007C0_CSI_BUSY(x)                         (((x) & 0x1) << 13)
728c2ecf20Sopenharmony_ci#define   G_0007C0_CSI_BUSY(x)                         (((x) >> 13) & 0x1)
738c2ecf20Sopenharmony_ci#define   C_0007C0_CSI_BUSY                            0xFFFFDFFF
748c2ecf20Sopenharmony_ci#define   S_0007C0_CSF_INDIRECT2_BUSY(x)               (((x) & 0x1) << 14)
758c2ecf20Sopenharmony_ci#define   G_0007C0_CSF_INDIRECT2_BUSY(x)               (((x) >> 14) & 0x1)
768c2ecf20Sopenharmony_ci#define   C_0007C0_CSF_INDIRECT2_BUSY                  0xFFFFBFFF
778c2ecf20Sopenharmony_ci#define   S_0007C0_CSQ_INDIRECT2_BUSY(x)               (((x) & 0x1) << 15)
788c2ecf20Sopenharmony_ci#define   G_0007C0_CSQ_INDIRECT2_BUSY(x)               (((x) >> 15) & 0x1)
798c2ecf20Sopenharmony_ci#define   C_0007C0_CSQ_INDIRECT2_BUSY                  0xFFFF7FFF
808c2ecf20Sopenharmony_ci#define   S_0007C0_GUIDMA_BUSY(x)                      (((x) & 0x1) << 28)
818c2ecf20Sopenharmony_ci#define   G_0007C0_GUIDMA_BUSY(x)                      (((x) >> 28) & 0x1)
828c2ecf20Sopenharmony_ci#define   C_0007C0_GUIDMA_BUSY                         0xEFFFFFFF
838c2ecf20Sopenharmony_ci#define   S_0007C0_VIDDMA_BUSY(x)                      (((x) & 0x1) << 29)
848c2ecf20Sopenharmony_ci#define   G_0007C0_VIDDMA_BUSY(x)                      (((x) >> 29) & 0x1)
858c2ecf20Sopenharmony_ci#define   C_0007C0_VIDDMA_BUSY                         0xDFFFFFFF
868c2ecf20Sopenharmony_ci#define   S_0007C0_CMDSTRM_BUSY(x)                     (((x) & 0x1) << 30)
878c2ecf20Sopenharmony_ci#define   G_0007C0_CMDSTRM_BUSY(x)                     (((x) >> 30) & 0x1)
888c2ecf20Sopenharmony_ci#define   C_0007C0_CMDSTRM_BUSY                        0xBFFFFFFF
898c2ecf20Sopenharmony_ci#define   S_0007C0_CP_BUSY(x)                          (((x) & 0x1) << 31)
908c2ecf20Sopenharmony_ci#define   G_0007C0_CP_BUSY(x)                          (((x) >> 31) & 0x1)
918c2ecf20Sopenharmony_ci#define   C_0007C0_CP_BUSY                             0x7FFFFFFF
928c2ecf20Sopenharmony_ci#define R_000E40_RBBM_STATUS                         0x000E40
938c2ecf20Sopenharmony_ci#define   S_000E40_CMDFIFO_AVAIL(x)                    (((x) & 0x7F) << 0)
948c2ecf20Sopenharmony_ci#define   G_000E40_CMDFIFO_AVAIL(x)                    (((x) >> 0) & 0x7F)
958c2ecf20Sopenharmony_ci#define   C_000E40_CMDFIFO_AVAIL                       0xFFFFFF80
968c2ecf20Sopenharmony_ci#define   S_000E40_HIRQ_ON_RBB(x)                      (((x) & 0x1) << 8)
978c2ecf20Sopenharmony_ci#define   G_000E40_HIRQ_ON_RBB(x)                      (((x) >> 8) & 0x1)
988c2ecf20Sopenharmony_ci#define   C_000E40_HIRQ_ON_RBB                         0xFFFFFEFF
998c2ecf20Sopenharmony_ci#define   S_000E40_CPRQ_ON_RBB(x)                      (((x) & 0x1) << 9)
1008c2ecf20Sopenharmony_ci#define   G_000E40_CPRQ_ON_RBB(x)                      (((x) >> 9) & 0x1)
1018c2ecf20Sopenharmony_ci#define   C_000E40_CPRQ_ON_RBB                         0xFFFFFDFF
1028c2ecf20Sopenharmony_ci#define   S_000E40_CFRQ_ON_RBB(x)                      (((x) & 0x1) << 10)
1038c2ecf20Sopenharmony_ci#define   G_000E40_CFRQ_ON_RBB(x)                      (((x) >> 10) & 0x1)
1048c2ecf20Sopenharmony_ci#define   C_000E40_CFRQ_ON_RBB                         0xFFFFFBFF
1058c2ecf20Sopenharmony_ci#define   S_000E40_HIRQ_IN_RTBUF(x)                    (((x) & 0x1) << 11)
1068c2ecf20Sopenharmony_ci#define   G_000E40_HIRQ_IN_RTBUF(x)                    (((x) >> 11) & 0x1)
1078c2ecf20Sopenharmony_ci#define   C_000E40_HIRQ_IN_RTBUF                       0xFFFFF7FF
1088c2ecf20Sopenharmony_ci#define   S_000E40_CPRQ_IN_RTBUF(x)                    (((x) & 0x1) << 12)
1098c2ecf20Sopenharmony_ci#define   G_000E40_CPRQ_IN_RTBUF(x)                    (((x) >> 12) & 0x1)
1108c2ecf20Sopenharmony_ci#define   C_000E40_CPRQ_IN_RTBUF                       0xFFFFEFFF
1118c2ecf20Sopenharmony_ci#define   S_000E40_CFRQ_IN_RTBUF(x)                    (((x) & 0x1) << 13)
1128c2ecf20Sopenharmony_ci#define   G_000E40_CFRQ_IN_RTBUF(x)                    (((x) >> 13) & 0x1)
1138c2ecf20Sopenharmony_ci#define   C_000E40_CFRQ_IN_RTBUF                       0xFFFFDFFF
1148c2ecf20Sopenharmony_ci#define   S_000E40_CF_PIPE_BUSY(x)                     (((x) & 0x1) << 14)
1158c2ecf20Sopenharmony_ci#define   G_000E40_CF_PIPE_BUSY(x)                     (((x) >> 14) & 0x1)
1168c2ecf20Sopenharmony_ci#define   C_000E40_CF_PIPE_BUSY                        0xFFFFBFFF
1178c2ecf20Sopenharmony_ci#define   S_000E40_ENG_EV_BUSY(x)                      (((x) & 0x1) << 15)
1188c2ecf20Sopenharmony_ci#define   G_000E40_ENG_EV_BUSY(x)                      (((x) >> 15) & 0x1)
1198c2ecf20Sopenharmony_ci#define   C_000E40_ENG_EV_BUSY                         0xFFFF7FFF
1208c2ecf20Sopenharmony_ci#define   S_000E40_CP_CMDSTRM_BUSY(x)                  (((x) & 0x1) << 16)
1218c2ecf20Sopenharmony_ci#define   G_000E40_CP_CMDSTRM_BUSY(x)                  (((x) >> 16) & 0x1)
1228c2ecf20Sopenharmony_ci#define   C_000E40_CP_CMDSTRM_BUSY                     0xFFFEFFFF
1238c2ecf20Sopenharmony_ci#define   S_000E40_E2_BUSY(x)                          (((x) & 0x1) << 17)
1248c2ecf20Sopenharmony_ci#define   G_000E40_E2_BUSY(x)                          (((x) >> 17) & 0x1)
1258c2ecf20Sopenharmony_ci#define   C_000E40_E2_BUSY                             0xFFFDFFFF
1268c2ecf20Sopenharmony_ci#define   S_000E40_RB2D_BUSY(x)                        (((x) & 0x1) << 18)
1278c2ecf20Sopenharmony_ci#define   G_000E40_RB2D_BUSY(x)                        (((x) >> 18) & 0x1)
1288c2ecf20Sopenharmony_ci#define   C_000E40_RB2D_BUSY                           0xFFFBFFFF
1298c2ecf20Sopenharmony_ci#define   S_000E40_RB3D_BUSY(x)                        (((x) & 0x1) << 19)
1308c2ecf20Sopenharmony_ci#define   G_000E40_RB3D_BUSY(x)                        (((x) >> 19) & 0x1)
1318c2ecf20Sopenharmony_ci#define   C_000E40_RB3D_BUSY                           0xFFF7FFFF
1328c2ecf20Sopenharmony_ci#define   S_000E40_VAP_BUSY(x)                         (((x) & 0x1) << 20)
1338c2ecf20Sopenharmony_ci#define   G_000E40_VAP_BUSY(x)                         (((x) >> 20) & 0x1)
1348c2ecf20Sopenharmony_ci#define   C_000E40_VAP_BUSY                            0xFFEFFFFF
1358c2ecf20Sopenharmony_ci#define   S_000E40_RE_BUSY(x)                          (((x) & 0x1) << 21)
1368c2ecf20Sopenharmony_ci#define   G_000E40_RE_BUSY(x)                          (((x) >> 21) & 0x1)
1378c2ecf20Sopenharmony_ci#define   C_000E40_RE_BUSY                             0xFFDFFFFF
1388c2ecf20Sopenharmony_ci#define   S_000E40_TAM_BUSY(x)                         (((x) & 0x1) << 22)
1398c2ecf20Sopenharmony_ci#define   G_000E40_TAM_BUSY(x)                         (((x) >> 22) & 0x1)
1408c2ecf20Sopenharmony_ci#define   C_000E40_TAM_BUSY                            0xFFBFFFFF
1418c2ecf20Sopenharmony_ci#define   S_000E40_TDM_BUSY(x)                         (((x) & 0x1) << 23)
1428c2ecf20Sopenharmony_ci#define   G_000E40_TDM_BUSY(x)                         (((x) >> 23) & 0x1)
1438c2ecf20Sopenharmony_ci#define   C_000E40_TDM_BUSY                            0xFF7FFFFF
1448c2ecf20Sopenharmony_ci#define   S_000E40_PB_BUSY(x)                          (((x) & 0x1) << 24)
1458c2ecf20Sopenharmony_ci#define   G_000E40_PB_BUSY(x)                          (((x) >> 24) & 0x1)
1468c2ecf20Sopenharmony_ci#define   C_000E40_PB_BUSY                             0xFEFFFFFF
1478c2ecf20Sopenharmony_ci#define   S_000E40_TIM_BUSY(x)                         (((x) & 0x1) << 25)
1488c2ecf20Sopenharmony_ci#define   G_000E40_TIM_BUSY(x)                         (((x) >> 25) & 0x1)
1498c2ecf20Sopenharmony_ci#define   C_000E40_TIM_BUSY                            0xFDFFFFFF
1508c2ecf20Sopenharmony_ci#define   S_000E40_GA_BUSY(x)                          (((x) & 0x1) << 26)
1518c2ecf20Sopenharmony_ci#define   G_000E40_GA_BUSY(x)                          (((x) >> 26) & 0x1)
1528c2ecf20Sopenharmony_ci#define   C_000E40_GA_BUSY                             0xFBFFFFFF
1538c2ecf20Sopenharmony_ci#define   S_000E40_CBA2D_BUSY(x)                       (((x) & 0x1) << 27)
1548c2ecf20Sopenharmony_ci#define   G_000E40_CBA2D_BUSY(x)                       (((x) >> 27) & 0x1)
1558c2ecf20Sopenharmony_ci#define   C_000E40_CBA2D_BUSY                          0xF7FFFFFF
1568c2ecf20Sopenharmony_ci#define   S_000E40_GUI_ACTIVE(x)                       (((x) & 0x1) << 31)
1578c2ecf20Sopenharmony_ci#define   G_000E40_GUI_ACTIVE(x)                       (((x) >> 31) & 0x1)
1588c2ecf20Sopenharmony_ci#define   C_000E40_GUI_ACTIVE                          0x7FFFFFFF
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#endif
161