18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2012 Advanced Micro Devices, Inc.
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
58c2ecf20Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
68c2ecf20Sopenharmony_ci * to deal in the Software without restriction, including without limitation
78c2ecf20Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
88c2ecf20Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
98c2ecf20Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci * The above copyright notice and this permission notice shall be included in
128c2ecf20Sopenharmony_ci * all copies or substantial portions of the Software.
138c2ecf20Sopenharmony_ci *
148c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158c2ecf20Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168c2ecf20Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
178c2ecf20Sopenharmony_ci * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
188c2ecf20Sopenharmony_ci * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
198c2ecf20Sopenharmony_ci * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
208c2ecf20Sopenharmony_ci * OTHER DEALINGS IN THE SOFTWARE.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci * Authors: Alex Deucher
238c2ecf20Sopenharmony_ci */
248c2ecf20Sopenharmony_ci#ifndef _SUMOD_H_
258c2ecf20Sopenharmony_ci#define _SUMOD_H_
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* pm registers */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* rcu */
308c2ecf20Sopenharmony_ci#define RCU_FW_VERSION                                  0x30c
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_SEQ0                             0x408
338c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_SEQ1                             0x40c
348c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_CNTL                             0x410
358c2ecf20Sopenharmony_ci#       define PWR_GATING_EN                            (1 << 0)
368c2ecf20Sopenharmony_ci#       define RSVD_MASK                                (0x3 << 1)
378c2ecf20Sopenharmony_ci#       define PCV(x)                                   ((x) << 3)
388c2ecf20Sopenharmony_ci#       define PCV_MASK                                 (0x1f << 3)
398c2ecf20Sopenharmony_ci#       define PCV_SHIFT                                3
408c2ecf20Sopenharmony_ci#       define PCP(x)                                   ((x) << 8)
418c2ecf20Sopenharmony_ci#       define PCP_MASK                                 (0xf << 8)
428c2ecf20Sopenharmony_ci#       define PCP_SHIFT                                8
438c2ecf20Sopenharmony_ci#       define RPW(x)                                   ((x) << 16)
448c2ecf20Sopenharmony_ci#       define RPW_MASK                                 (0xf << 16)
458c2ecf20Sopenharmony_ci#       define RPW_SHIFT                                16
468c2ecf20Sopenharmony_ci#       define ID(x)                                    ((x) << 24)
478c2ecf20Sopenharmony_ci#       define ID_MASK                                  (0xf << 24)
488c2ecf20Sopenharmony_ci#       define ID_SHIFT                                 24
498c2ecf20Sopenharmony_ci#       define PGS(x)                                   ((x) << 28)
508c2ecf20Sopenharmony_ci#       define PGS_MASK                                 (0xf << 28)
518c2ecf20Sopenharmony_ci#       define PGS_SHIFT                                28
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#define RCU_ALTVDDNB_NOTIFY                             0x430
548c2ecf20Sopenharmony_ci#define RCU_LCLK_SCALING_CNTL                           0x434
558c2ecf20Sopenharmony_ci#       define LCLK_SCALING_EN                          (1 << 0)
568c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TYPE                        (1 << 1)
578c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TIMER_PRESCALER(x)          ((x) << 4)
588c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TIMER_PRESCALER_MASK        (0xf << 4)
598c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TIMER_PRESCALER_SHIFT       4
608c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TIMER_PERIOD(x)             ((x) << 16)
618c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TIMER_PERIOD_MASK           (0xf << 16)
628c2ecf20Sopenharmony_ci#       define LCLK_SCALING_TIMER_PERIOD_SHIFT          16
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_CNTL_2                           0x4a0
658c2ecf20Sopenharmony_ci#       define MPPU(x)                                  ((x) << 0)
668c2ecf20Sopenharmony_ci#       define MPPU_MASK                                (0xffff << 0)
678c2ecf20Sopenharmony_ci#       define MPPU_SHIFT                               0
688c2ecf20Sopenharmony_ci#       define MPPD(x)                                  ((x) << 16)
698c2ecf20Sopenharmony_ci#       define MPPD_MASK                                (0xffff << 16)
708c2ecf20Sopenharmony_ci#       define MPPD_SHIFT                               16
718c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_CNTL_3                           0x4a4
728c2ecf20Sopenharmony_ci#       define DPPU(x)                                  ((x) << 0)
738c2ecf20Sopenharmony_ci#       define DPPU_MASK                                (0xffff << 0)
748c2ecf20Sopenharmony_ci#       define DPPU_SHIFT                               0
758c2ecf20Sopenharmony_ci#       define DPPD(x)                                  ((x) << 16)
768c2ecf20Sopenharmony_ci#       define DPPD_MASK                                (0xffff << 16)
778c2ecf20Sopenharmony_ci#       define DPPD_SHIFT                               16
788c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_CNTL_4                           0x4a8
798c2ecf20Sopenharmony_ci#       define RT(x)                                    ((x) << 0)
808c2ecf20Sopenharmony_ci#       define RT_MASK                                  (0xffff << 0)
818c2ecf20Sopenharmony_ci#       define RT_SHIFT                                 0
828c2ecf20Sopenharmony_ci#       define IT(x)                                    ((x) << 16)
838c2ecf20Sopenharmony_ci#       define IT_MASK                                  (0xffff << 16)
848c2ecf20Sopenharmony_ci#       define IT_SHIFT                                 16
858c2ecf20Sopenharmony_ci
868c2ecf20Sopenharmony_ci/* yes these two have the same address */
878c2ecf20Sopenharmony_ci#define RCU_PWR_GATING_CNTL_5                           0x504
888c2ecf20Sopenharmony_ci#define RCU_GPU_BOOST_DISABLE                           0x508
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci#define MCU_M3ARB_INDEX                                 0x504
918c2ecf20Sopenharmony_ci#define MCU_M3ARB_PARAMS                                0x508
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci#define RCU_GNB_PWR_REP_TIMER_CNTL                      0x50C
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define RCU_SclkDpmTdpLimit01                           0x514
968c2ecf20Sopenharmony_ci#define RCU_SclkDpmTdpLimit23                           0x518
978c2ecf20Sopenharmony_ci#define RCU_SclkDpmTdpLimit47                           0x51C
988c2ecf20Sopenharmony_ci#define RCU_SclkDpmTdpLimitPG                           0x520
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#define GNB_TDP_LIMIT                                   0x540
1018c2ecf20Sopenharmony_ci#define RCU_BOOST_MARGIN                                0x544
1028c2ecf20Sopenharmony_ci#define RCU_THROTTLE_MARGIN                             0x548
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci#define SMU_PCIE_PG_ARGS                                0x58C
1058c2ecf20Sopenharmony_ci#define SMU_PCIE_PG_ARGS_2                              0x598
1068c2ecf20Sopenharmony_ci#define SMU_PCIE_PG_ARGS_3                              0x59C
1078c2ecf20Sopenharmony_ci
1088c2ecf20Sopenharmony_ci/* mmio */
1098c2ecf20Sopenharmony_ci#define RCU_STATUS                                      0x11c
1108c2ecf20Sopenharmony_ci#       define GMC_PWR_GATER_BUSY                       (1 << 8)
1118c2ecf20Sopenharmony_ci#       define GFX_PWR_GATER_BUSY                       (1 << 9)
1128c2ecf20Sopenharmony_ci#       define UVD_PWR_GATER_BUSY                       (1 << 10)
1138c2ecf20Sopenharmony_ci#       define PCIE_PWR_GATER_BUSY                      (1 << 11)
1148c2ecf20Sopenharmony_ci#       define GMC_PWR_GATER_STATE                      (1 << 12)
1158c2ecf20Sopenharmony_ci#       define GFX_PWR_GATER_STATE                      (1 << 13)
1168c2ecf20Sopenharmony_ci#       define UVD_PWR_GATER_STATE                      (1 << 14)
1178c2ecf20Sopenharmony_ci#       define PCIE_PWR_GATER_STATE                     (1 << 15)
1188c2ecf20Sopenharmony_ci#       define GFX1_PWR_GATER_BUSY                      (1 << 16)
1198c2ecf20Sopenharmony_ci#       define GFX2_PWR_GATER_BUSY                      (1 << 17)
1208c2ecf20Sopenharmony_ci#       define GFX1_PWR_GATER_STATE                     (1 << 18)
1218c2ecf20Sopenharmony_ci#       define GFX2_PWR_GATER_STATE                     (1 << 19)
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define GFX_INT_REQ                                     0x120
1248c2ecf20Sopenharmony_ci#       define INT_REQ                                  (1 << 0)
1258c2ecf20Sopenharmony_ci#       define SERV_INDEX(x)                            ((x) << 1)
1268c2ecf20Sopenharmony_ci#       define SERV_INDEX_MASK                          (0xff << 1)
1278c2ecf20Sopenharmony_ci#       define SERV_INDEX_SHIFT                         1
1288c2ecf20Sopenharmony_ci#define GFX_INT_STATUS                                  0x124
1298c2ecf20Sopenharmony_ci#       define INT_ACK                                  (1 << 0)
1308c2ecf20Sopenharmony_ci#       define INT_DONE                                 (1 << 1)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define CG_SCLK_CNTL                                    0x600
1338c2ecf20Sopenharmony_ci#       define SCLK_DIVIDER(x)                          ((x) << 0)
1348c2ecf20Sopenharmony_ci#       define SCLK_DIVIDER_MASK                        (0x7f << 0)
1358c2ecf20Sopenharmony_ci#       define SCLK_DIVIDER_SHIFT                       0
1368c2ecf20Sopenharmony_ci#define CG_SCLK_STATUS                                  0x604
1378c2ecf20Sopenharmony_ci#       define SCLK_OVERCLK_DETECT                      (1 << 2)
1388c2ecf20Sopenharmony_ci
1398c2ecf20Sopenharmony_ci#define CG_DCLK_CNTL                                    0x610
1408c2ecf20Sopenharmony_ci#       define DCLK_DIVIDER_MASK                        0x7f
1418c2ecf20Sopenharmony_ci#       define DCLK_DIR_CNTL_EN                         (1 << 8)
1428c2ecf20Sopenharmony_ci#define CG_DCLK_STATUS                                  0x614
1438c2ecf20Sopenharmony_ci#       define DCLK_STATUS                              (1 << 0)
1448c2ecf20Sopenharmony_ci#define CG_VCLK_CNTL                                    0x618
1458c2ecf20Sopenharmony_ci#       define VCLK_DIVIDER_MASK                        0x7f
1468c2ecf20Sopenharmony_ci#       define VCLK_DIR_CNTL_EN                         (1 << 8)
1478c2ecf20Sopenharmony_ci#define CG_VCLK_STATUS                                  0x61c
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci#define GENERAL_PWRMGT                                  0x63c
1508c2ecf20Sopenharmony_ci#       define STATIC_PM_EN                             (1 << 1)
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci#define SCLK_PWRMGT_CNTL                                0x644
1538c2ecf20Sopenharmony_ci#       define SCLK_PWRMGT_OFF                          (1 << 0)
1548c2ecf20Sopenharmony_ci#       define SCLK_LOW_D1                              (1 << 1)
1558c2ecf20Sopenharmony_ci#       define FIR_RESET                                (1 << 4)
1568c2ecf20Sopenharmony_ci#       define FIR_FORCE_TREND_SEL                      (1 << 5)
1578c2ecf20Sopenharmony_ci#       define FIR_TREND_MODE                           (1 << 6)
1588c2ecf20Sopenharmony_ci#       define DYN_GFX_CLK_OFF_EN                       (1 << 7)
1598c2ecf20Sopenharmony_ci#       define GFX_CLK_FORCE_ON                         (1 << 8)
1608c2ecf20Sopenharmony_ci#       define GFX_CLK_REQUEST_OFF                      (1 << 9)
1618c2ecf20Sopenharmony_ci#       define GFX_CLK_FORCE_OFF                        (1 << 10)
1628c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D1                      (1 << 11)
1638c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D2                      (1 << 12)
1648c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D3                      (1 << 13)
1658c2ecf20Sopenharmony_ci#       define GFX_VOLTAGE_CHANGE_EN                    (1 << 16)
1668c2ecf20Sopenharmony_ci#       define GFX_VOLTAGE_CHANGE_MODE                  (1 << 17)
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci#define TARGET_AND_CURRENT_PROFILE_INDEX                0x66c
1698c2ecf20Sopenharmony_ci#       define TARG_SCLK_INDEX(x)                       ((x) << 6)
1708c2ecf20Sopenharmony_ci#       define TARG_SCLK_INDEX_MASK                     (0x7 << 6)
1718c2ecf20Sopenharmony_ci#       define TARG_SCLK_INDEX_SHIFT                    6
1728c2ecf20Sopenharmony_ci#       define CURR_SCLK_INDEX(x)                       ((x) << 9)
1738c2ecf20Sopenharmony_ci#       define CURR_SCLK_INDEX_MASK                     (0x7 << 9)
1748c2ecf20Sopenharmony_ci#       define CURR_SCLK_INDEX_SHIFT                    9
1758c2ecf20Sopenharmony_ci#       define TARG_INDEX(x)                            ((x) << 12)
1768c2ecf20Sopenharmony_ci#       define TARG_INDEX_MASK                          (0x7 << 12)
1778c2ecf20Sopenharmony_ci#       define TARG_INDEX_SHIFT                         12
1788c2ecf20Sopenharmony_ci#       define CURR_INDEX(x)                            ((x) << 15)
1798c2ecf20Sopenharmony_ci#       define CURR_INDEX_MASK                          (0x7 << 15)
1808c2ecf20Sopenharmony_ci#       define CURR_INDEX_SHIFT                         15
1818c2ecf20Sopenharmony_ci
1828c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL                                0x684
1838c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_0_DIV(x)                     ((x) << 0)
1848c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_0_DIV_MASK                   (0x7f << 0)
1858c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_0_DIV_SHIFT                  0
1868c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_0_VLD                        (1 << 7)
1878c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_1_DIV(x)                     ((x) << 8)
1888c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_1_DIV_MASK                   (0x7f << 8)
1898c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_1_DIV_SHIFT                  8
1908c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_1_VLD                        (1 << 15)
1918c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_2_DIV(x)                     ((x) << 16)
1928c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_2_DIV_MASK                   (0x7f << 16)
1938c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_2_DIV_SHIFT                  16
1948c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_2_VLD                        (1 << 23)
1958c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_3_DIV(x)                     ((x) << 24)
1968c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_3_DIV_MASK                   (0x7f << 24)
1978c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_3_DIV_SHIFT                  24
1988c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_3_VLD                        (1 << 31)
1998c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL_2                              0x688
2008c2ecf20Sopenharmony_ci#define CG_GCOOR                                        0x68c
2018c2ecf20Sopenharmony_ci#       define PHC(x)                                   ((x) << 0)
2028c2ecf20Sopenharmony_ci#       define PHC_MASK                                 (0x1f << 0)
2038c2ecf20Sopenharmony_ci#       define PHC_SHIFT                                0
2048c2ecf20Sopenharmony_ci#       define SDC(x)                                   ((x) << 9)
2058c2ecf20Sopenharmony_ci#       define SDC_MASK                                 (0x3ff << 9)
2068c2ecf20Sopenharmony_ci#       define SDC_SHIFT                                9
2078c2ecf20Sopenharmony_ci#       define SU(x)                                    ((x) << 23)
2088c2ecf20Sopenharmony_ci#       define SU_MASK                                  (0xf << 23)
2098c2ecf20Sopenharmony_ci#       define SU_SHIFT                                 23
2108c2ecf20Sopenharmony_ci#       define DIV_ID(x)                                ((x) << 28)
2118c2ecf20Sopenharmony_ci#       define DIV_ID_MASK                              (0x7 << 28)
2128c2ecf20Sopenharmony_ci#       define DIV_ID_SHIFT                             28
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci#define CG_FTV                                          0x690
2158c2ecf20Sopenharmony_ci#define CG_FFCT_0                                       0x694
2168c2ecf20Sopenharmony_ci#       define UTC_0(x)                                 ((x) << 0)
2178c2ecf20Sopenharmony_ci#       define UTC_0_MASK                               (0x3ff << 0)
2188c2ecf20Sopenharmony_ci#       define UTC_0_SHIFT                              0
2198c2ecf20Sopenharmony_ci#       define DTC_0(x)                                 ((x) << 10)
2208c2ecf20Sopenharmony_ci#       define DTC_0_MASK                               (0x3ff << 10)
2218c2ecf20Sopenharmony_ci#       define DTC_0_SHIFT                              10
2228c2ecf20Sopenharmony_ci
2238c2ecf20Sopenharmony_ci#define CG_GIT                                          0x6d8
2248c2ecf20Sopenharmony_ci#       define CG_GICST(x)                              ((x) << 0)
2258c2ecf20Sopenharmony_ci#       define CG_GICST_MASK                            (0xffff << 0)
2268c2ecf20Sopenharmony_ci#       define CG_GICST_SHIFT                           0
2278c2ecf20Sopenharmony_ci#       define CG_GIPOT(x)                              ((x) << 16)
2288c2ecf20Sopenharmony_ci#       define CG_GIPOT_MASK                            (0xffff << 16)
2298c2ecf20Sopenharmony_ci#       define CG_GIPOT_SHIFT                           16
2308c2ecf20Sopenharmony_ci
2318c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL_3                              0x6e0
2328c2ecf20Sopenharmony_ci#       define FORCE_SCLK_STATE(x)                      ((x) << 0)
2338c2ecf20Sopenharmony_ci#       define FORCE_SCLK_STATE_MASK                    (0x7 << 0)
2348c2ecf20Sopenharmony_ci#       define FORCE_SCLK_STATE_SHIFT                   0
2358c2ecf20Sopenharmony_ci#       define FORCE_SCLK_STATE_EN                      (1 << 3)
2368c2ecf20Sopenharmony_ci#       define GNB_TT(x)                                ((x) << 8)
2378c2ecf20Sopenharmony_ci#       define GNB_TT_MASK                              (0xff << 8)
2388c2ecf20Sopenharmony_ci#       define GNB_TT_SHIFT                             8
2398c2ecf20Sopenharmony_ci#       define GNB_THERMTHRO_MASK                       (1 << 16)
2408c2ecf20Sopenharmony_ci#       define CNB_THERMTHRO_MASK_SCLK                  (1 << 17)
2418c2ecf20Sopenharmony_ci#       define DPM_SCLK_ENABLE                          (1 << 18)
2428c2ecf20Sopenharmony_ci#       define GNB_SLOW_FSTATE_0_MASK                   (1 << 23)
2438c2ecf20Sopenharmony_ci#       define GNB_SLOW_FSTATE_0_SHIFT                  23
2448c2ecf20Sopenharmony_ci#       define FORCE_NB_PSTATE_1                        (1 << 31)
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci#define CG_SSP                                          0x6e8
2478c2ecf20Sopenharmony_ci#       define SST(x)                                   ((x) << 0)
2488c2ecf20Sopenharmony_ci#       define SST_MASK                                 (0xffff << 0)
2498c2ecf20Sopenharmony_ci#       define SST_SHIFT                                0
2508c2ecf20Sopenharmony_ci#       define SSTU(x)                                  ((x) << 16)
2518c2ecf20Sopenharmony_ci#       define SSTU_MASK                                (0xffff << 16)
2528c2ecf20Sopenharmony_ci#       define SSTU_SHIFT                               16
2538c2ecf20Sopenharmony_ci
2548c2ecf20Sopenharmony_ci#define CG_ACPI_CNTL                                    0x70c
2558c2ecf20Sopenharmony_ci#       define SCLK_ACPI_DIV(x)                         ((x) << 0)
2568c2ecf20Sopenharmony_ci#       define SCLK_ACPI_DIV_MASK                       (0x7f << 0)
2578c2ecf20Sopenharmony_ci#       define SCLK_ACPI_DIV_SHIFT                      0
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL_4                              0x71c
2608c2ecf20Sopenharmony_ci#       define DC_HDC(x)                                ((x) << 14)
2618c2ecf20Sopenharmony_ci#       define DC_HDC_MASK                              (0x3fff << 14)
2628c2ecf20Sopenharmony_ci#       define DC_HDC_SHIFT                             14
2638c2ecf20Sopenharmony_ci#       define DC_HU(x)                                 ((x) << 28)
2648c2ecf20Sopenharmony_ci#       define DC_HU_MASK                               (0xf << 28)
2658c2ecf20Sopenharmony_ci#       define DC_HU_SHIFT                              28
2668c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL_5                              0x720
2678c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_BOOTUP(x)                    ((x) << 0)
2688c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_BOOTUP_MASK                  (0x7 << 0)
2698c2ecf20Sopenharmony_ci#       define SCLK_FSTATE_BOOTUP_SHIFT                 0
2708c2ecf20Sopenharmony_ci#       define TT_TP(x)                                 ((x) << 3)
2718c2ecf20Sopenharmony_ci#       define TT_TP_MASK                               (0xffff << 3)
2728c2ecf20Sopenharmony_ci#       define TT_TP_SHIFT                              3
2738c2ecf20Sopenharmony_ci#       define TT_TU(x)                                 ((x) << 19)
2748c2ecf20Sopenharmony_ci#       define TT_TU_MASK                               (0xff << 19)
2758c2ecf20Sopenharmony_ci#       define TT_TU_SHIFT                              19
2768c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL_6                              0x724
2778c2ecf20Sopenharmony_ci#define CG_AT_0                                         0x728
2788c2ecf20Sopenharmony_ci#       define CG_R(x)                                  ((x) << 0)
2798c2ecf20Sopenharmony_ci#       define CG_R_MASK                                (0xffff << 0)
2808c2ecf20Sopenharmony_ci#       define CG_R_SHIFT                               0
2818c2ecf20Sopenharmony_ci#       define CG_L(x)                                  ((x) << 16)
2828c2ecf20Sopenharmony_ci#       define CG_L_MASK                                (0xffff << 16)
2838c2ecf20Sopenharmony_ci#       define CG_L_SHIFT                               16
2848c2ecf20Sopenharmony_ci#define CG_AT_1                                         0x72c
2858c2ecf20Sopenharmony_ci#define CG_AT_2                                         0x730
2868c2ecf20Sopenharmony_ci#define	CG_THERMAL_INT					0x734
2878c2ecf20Sopenharmony_ci#define		DIG_THERM_INTH(x)			((x) << 8)
2888c2ecf20Sopenharmony_ci#define		DIG_THERM_INTH_MASK			0x0000FF00
2898c2ecf20Sopenharmony_ci#define		DIG_THERM_INTH_SHIFT			8
2908c2ecf20Sopenharmony_ci#define		DIG_THERM_INTL(x)			((x) << 16)
2918c2ecf20Sopenharmony_ci#define		DIG_THERM_INTL_MASK			0x00FF0000
2928c2ecf20Sopenharmony_ci#define		DIG_THERM_INTL_SHIFT			16
2938c2ecf20Sopenharmony_ci#define 	THERM_INT_MASK_HIGH			(1 << 24)
2948c2ecf20Sopenharmony_ci#define 	THERM_INT_MASK_LOW			(1 << 25)
2958c2ecf20Sopenharmony_ci#define CG_AT_3                                         0x738
2968c2ecf20Sopenharmony_ci#define CG_AT_4                                         0x73c
2978c2ecf20Sopenharmony_ci#define CG_AT_5                                         0x740
2988c2ecf20Sopenharmony_ci#define CG_AT_6                                         0x744
2998c2ecf20Sopenharmony_ci#define CG_AT_7                                         0x748
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci#define CG_BSP_0                                        0x750
3028c2ecf20Sopenharmony_ci#       define BSP(x)                                   ((x) << 0)
3038c2ecf20Sopenharmony_ci#       define BSP_MASK                                 (0xffff << 0)
3048c2ecf20Sopenharmony_ci#       define BSP_SHIFT                                0
3058c2ecf20Sopenharmony_ci#       define BSU(x)                                   ((x) << 16)
3068c2ecf20Sopenharmony_ci#       define BSU_MASK                                 (0xf << 16)
3078c2ecf20Sopenharmony_ci#       define BSU_SHIFT                                16
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_ci#define CG_CG_VOLTAGE_CNTL                              0x770
3108c2ecf20Sopenharmony_ci#       define REQ                                      (1 << 0)
3118c2ecf20Sopenharmony_ci#       define LEVEL(x)                                 ((x) << 1)
3128c2ecf20Sopenharmony_ci#       define LEVEL_MASK                               (0x3 << 1)
3138c2ecf20Sopenharmony_ci#       define LEVEL_SHIFT                              1
3148c2ecf20Sopenharmony_ci#       define CG_VOLTAGE_EN                            (1 << 3)
3158c2ecf20Sopenharmony_ci#       define FORCE                                    (1 << 4)
3168c2ecf20Sopenharmony_ci#       define PERIOD(x)                                ((x) << 8)
3178c2ecf20Sopenharmony_ci#       define PERIOD_MASK                              (0xffff << 8)
3188c2ecf20Sopenharmony_ci#       define PERIOD_SHIFT                             8
3198c2ecf20Sopenharmony_ci#       define UNIT(x)                                  ((x) << 24)
3208c2ecf20Sopenharmony_ci#       define UNIT_MASK                                (0xf << 24)
3218c2ecf20Sopenharmony_ci#       define UNIT_SHIFT                               24
3228c2ecf20Sopenharmony_ci
3238c2ecf20Sopenharmony_ci#define CG_ACPI_VOLTAGE_CNTL                            0x780
3248c2ecf20Sopenharmony_ci#       define ACPI_VOLTAGE_EN                          (1 << 8)
3258c2ecf20Sopenharmony_ci
3268c2ecf20Sopenharmony_ci#define CG_DPM_VOLTAGE_CNTL                             0x788
3278c2ecf20Sopenharmony_ci#       define DPM_STATE0_LEVEL_MASK                    (0x3 << 0)
3288c2ecf20Sopenharmony_ci#       define DPM_STATE0_LEVEL_SHIFT                   0
3298c2ecf20Sopenharmony_ci#       define DPM_VOLTAGE_EN                           (1 << 16)
3308c2ecf20Sopenharmony_ci
3318c2ecf20Sopenharmony_ci#define CG_PWR_GATING_CNTL                              0x7ac
3328c2ecf20Sopenharmony_ci#       define DYN_PWR_DOWN_EN                          (1 << 0)
3338c2ecf20Sopenharmony_ci#       define ACPI_PWR_DOWN_EN                         (1 << 1)
3348c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_PWR_DOWN_EN                  (1 << 2)
3358c2ecf20Sopenharmony_ci#       define IOC_DISGPU_PWR_DOWN_EN                   (1 << 3)
3368c2ecf20Sopenharmony_ci#       define FORCE_POWR_ON                            (1 << 4)
3378c2ecf20Sopenharmony_ci#       define PGP(x)                                   ((x) << 8)
3388c2ecf20Sopenharmony_ci#       define PGP_MASK                                 (0xffff << 8)
3398c2ecf20Sopenharmony_ci#       define PGP_SHIFT                                8
3408c2ecf20Sopenharmony_ci#       define PGU(x)                                   ((x) << 24)
3418c2ecf20Sopenharmony_ci#       define PGU_MASK                                 (0xf << 24)
3428c2ecf20Sopenharmony_ci#       define PGU_SHIFT                                24
3438c2ecf20Sopenharmony_ci
3448c2ecf20Sopenharmony_ci#define CG_CGTT_LOCAL_0                                 0x7d0
3458c2ecf20Sopenharmony_ci#define CG_CGTT_LOCAL_1                                 0x7d4
3468c2ecf20Sopenharmony_ci
3478c2ecf20Sopenharmony_ci#define DEEP_SLEEP_CNTL                                 0x818
3488c2ecf20Sopenharmony_ci#       define R_DIS                                    (1 << 3)
3498c2ecf20Sopenharmony_ci#       define HS(x)                                    ((x) << 4)
3508c2ecf20Sopenharmony_ci#       define HS_MASK                                  (0xfff << 4)
3518c2ecf20Sopenharmony_ci#       define HS_SHIFT                                 4
3528c2ecf20Sopenharmony_ci#       define ENABLE_DS                                (1 << 31)
3538c2ecf20Sopenharmony_ci#define DEEP_SLEEP_CNTL2                                0x81c
3548c2ecf20Sopenharmony_ci#       define LB_UFP_EN                                (1 << 0)
3558c2ecf20Sopenharmony_ci#       define INOUT_C(x)                               ((x) << 4)
3568c2ecf20Sopenharmony_ci#       define INOUT_C_MASK                             (0xff << 4)
3578c2ecf20Sopenharmony_ci#       define INOUT_C_SHIFT                            4
3588c2ecf20Sopenharmony_ci
3598c2ecf20Sopenharmony_ci#define CG_SCRATCH2                                     0x824
3608c2ecf20Sopenharmony_ci
3618c2ecf20Sopenharmony_ci#define CG_SCLK_DPM_CTRL_11                             0x830
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci#define HW_REV   					0x5564
3648c2ecf20Sopenharmony_ci#       define ATI_REV_ID_MASK                          (0xf << 28)
3658c2ecf20Sopenharmony_ci#       define ATI_REV_ID_SHIFT                         28
3668c2ecf20Sopenharmony_ci/* 0 = A0, 1 = A1, 2 = B0, 3 = C0, etc. */
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci#define DOUT_SCRATCH3   				0x611c
3698c2ecf20Sopenharmony_ci
3708c2ecf20Sopenharmony_ci#define GB_ADDR_CONFIG  				0x98f8
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_ci#endif
373