18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright 2011 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 */
238c2ecf20Sopenharmony_ci#ifndef RV730_H
248c2ecf20Sopenharmony_ci#define RV730_H
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#define	CG_SPLL_FUNC_CNTL				0x600
278c2ecf20Sopenharmony_ci#define		SPLL_RESET				(1 << 0)
288c2ecf20Sopenharmony_ci#define		SPLL_SLEEP				(1 << 1)
298c2ecf20Sopenharmony_ci#define		SPLL_DIVEN				(1 << 2)
308c2ecf20Sopenharmony_ci#define		SPLL_BYPASS_EN				(1 << 3)
318c2ecf20Sopenharmony_ci#define		SPLL_REF_DIV(x)				((x) << 4)
328c2ecf20Sopenharmony_ci#define		SPLL_REF_DIV_MASK			(0x3f << 4)
338c2ecf20Sopenharmony_ci#define		SPLL_HILEN(x)				((x) << 12)
348c2ecf20Sopenharmony_ci#define		SPLL_HILEN_MASK				(0xf << 12)
358c2ecf20Sopenharmony_ci#define		SPLL_LOLEN(x)				((x) << 16)
368c2ecf20Sopenharmony_ci#define		SPLL_LOLEN_MASK				(0xf << 16)
378c2ecf20Sopenharmony_ci#define	CG_SPLL_FUNC_CNTL_2				0x604
388c2ecf20Sopenharmony_ci#define		SCLK_MUX_SEL(x)				((x) << 0)
398c2ecf20Sopenharmony_ci#define		SCLK_MUX_SEL_MASK			(0x1ff << 0)
408c2ecf20Sopenharmony_ci#define	CG_SPLL_FUNC_CNTL_3				0x608
418c2ecf20Sopenharmony_ci#define		SPLL_FB_DIV(x)				((x) << 0)
428c2ecf20Sopenharmony_ci#define		SPLL_FB_DIV_MASK			(0x3ffffff << 0)
438c2ecf20Sopenharmony_ci#define		SPLL_DITHEN				(1 << 28)
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci#define	CG_MPLL_FUNC_CNTL				0x624
468c2ecf20Sopenharmony_ci#define		MPLL_RESET				(1 << 0)
478c2ecf20Sopenharmony_ci#define		MPLL_SLEEP				(1 << 1)
488c2ecf20Sopenharmony_ci#define		MPLL_DIVEN				(1 << 2)
498c2ecf20Sopenharmony_ci#define		MPLL_BYPASS_EN				(1 << 3)
508c2ecf20Sopenharmony_ci#define		MPLL_REF_DIV(x)				((x) << 4)
518c2ecf20Sopenharmony_ci#define		MPLL_REF_DIV_MASK			(0x3f << 4)
528c2ecf20Sopenharmony_ci#define		MPLL_HILEN(x)				((x) << 12)
538c2ecf20Sopenharmony_ci#define		MPLL_HILEN_MASK				(0xf << 12)
548c2ecf20Sopenharmony_ci#define		MPLL_LOLEN(x)				((x) << 16)
558c2ecf20Sopenharmony_ci#define		MPLL_LOLEN_MASK				(0xf << 16)
568c2ecf20Sopenharmony_ci#define	CG_MPLL_FUNC_CNTL_2				0x628
578c2ecf20Sopenharmony_ci#define		MCLK_MUX_SEL(x)				((x) << 0)
588c2ecf20Sopenharmony_ci#define		MCLK_MUX_SEL_MASK			(0x1ff << 0)
598c2ecf20Sopenharmony_ci#define	CG_MPLL_FUNC_CNTL_3				0x62c
608c2ecf20Sopenharmony_ci#define		MPLL_FB_DIV(x)				((x) << 0)
618c2ecf20Sopenharmony_ci#define		MPLL_FB_DIV_MASK			(0x3ffffff << 0)
628c2ecf20Sopenharmony_ci#define		MPLL_DITHEN				(1 << 28)
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#define	CG_TCI_MPLL_SPREAD_SPECTRUM			0x634
658c2ecf20Sopenharmony_ci#define	CG_TCI_MPLL_SPREAD_SPECTRUM_2			0x638
668c2ecf20Sopenharmony_ci#define GENERAL_PWRMGT                                  0x63c
678c2ecf20Sopenharmony_ci#       define GLOBAL_PWRMGT_EN                         (1 << 0)
688c2ecf20Sopenharmony_ci#       define STATIC_PM_EN                             (1 << 1)
698c2ecf20Sopenharmony_ci#       define THERMAL_PROTECTION_DIS                   (1 << 2)
708c2ecf20Sopenharmony_ci#       define THERMAL_PROTECTION_TYPE                  (1 << 3)
718c2ecf20Sopenharmony_ci#       define ENABLE_GEN2PCIE                          (1 << 4)
728c2ecf20Sopenharmony_ci#       define ENABLE_GEN2XSP                           (1 << 5)
738c2ecf20Sopenharmony_ci#       define SW_SMIO_INDEX(x)                         ((x) << 6)
748c2ecf20Sopenharmony_ci#       define SW_SMIO_INDEX_MASK                       (3 << 6)
758c2ecf20Sopenharmony_ci#       define LOW_VOLT_D2_ACPI                         (1 << 8)
768c2ecf20Sopenharmony_ci#       define LOW_VOLT_D3_ACPI                         (1 << 9)
778c2ecf20Sopenharmony_ci#       define VOLT_PWRMGT_EN                           (1 << 10)
788c2ecf20Sopenharmony_ci#       define BACKBIAS_PAD_EN                          (1 << 18)
798c2ecf20Sopenharmony_ci#       define BACKBIAS_VALUE                           (1 << 19)
808c2ecf20Sopenharmony_ci#       define DYN_SPREAD_SPECTRUM_EN                   (1 << 23)
818c2ecf20Sopenharmony_ci#       define AC_DC_SW                                 (1 << 24)
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#define SCLK_PWRMGT_CNTL                                  0x644
848c2ecf20Sopenharmony_ci#       define SCLK_PWRMGT_OFF                            (1 << 0)
858c2ecf20Sopenharmony_ci#       define SCLK_LOW_D1                                (1 << 1)
868c2ecf20Sopenharmony_ci#       define FIR_RESET                                  (1 << 4)
878c2ecf20Sopenharmony_ci#       define FIR_FORCE_TREND_SEL                        (1 << 5)
888c2ecf20Sopenharmony_ci#       define FIR_TREND_MODE                             (1 << 6)
898c2ecf20Sopenharmony_ci#       define DYN_GFX_CLK_OFF_EN                         (1 << 7)
908c2ecf20Sopenharmony_ci#       define GFX_CLK_FORCE_ON                           (1 << 8)
918c2ecf20Sopenharmony_ci#       define GFX_CLK_REQUEST_OFF                        (1 << 9)
928c2ecf20Sopenharmony_ci#       define GFX_CLK_FORCE_OFF                          (1 << 10)
938c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D1                        (1 << 11)
948c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D2                        (1 << 12)
958c2ecf20Sopenharmony_ci#       define GFX_CLK_OFF_ACPI_D3                        (1 << 13)
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci#define	TCI_MCLK_PWRMGT_CNTL				0x648
988c2ecf20Sopenharmony_ci#       define MPLL_PWRMGT_OFF                          (1 << 5)
998c2ecf20Sopenharmony_ci#       define DLL_READY                                (1 << 6)
1008c2ecf20Sopenharmony_ci#       define MC_INT_CNTL                              (1 << 7)
1018c2ecf20Sopenharmony_ci#       define MRDCKA_SLEEP                             (1 << 8)
1028c2ecf20Sopenharmony_ci#       define MRDCKB_SLEEP                             (1 << 9)
1038c2ecf20Sopenharmony_ci#       define MRDCKC_SLEEP                             (1 << 10)
1048c2ecf20Sopenharmony_ci#       define MRDCKD_SLEEP                             (1 << 11)
1058c2ecf20Sopenharmony_ci#       define MRDCKE_SLEEP                             (1 << 12)
1068c2ecf20Sopenharmony_ci#       define MRDCKF_SLEEP                             (1 << 13)
1078c2ecf20Sopenharmony_ci#       define MRDCKG_SLEEP                             (1 << 14)
1088c2ecf20Sopenharmony_ci#       define MRDCKH_SLEEP                             (1 << 15)
1098c2ecf20Sopenharmony_ci#       define MRDCKA_RESET                             (1 << 16)
1108c2ecf20Sopenharmony_ci#       define MRDCKB_RESET                             (1 << 17)
1118c2ecf20Sopenharmony_ci#       define MRDCKC_RESET                             (1 << 18)
1128c2ecf20Sopenharmony_ci#       define MRDCKD_RESET                             (1 << 19)
1138c2ecf20Sopenharmony_ci#       define MRDCKE_RESET                             (1 << 20)
1148c2ecf20Sopenharmony_ci#       define MRDCKF_RESET                             (1 << 21)
1158c2ecf20Sopenharmony_ci#       define MRDCKG_RESET                             (1 << 22)
1168c2ecf20Sopenharmony_ci#       define MRDCKH_RESET                             (1 << 23)
1178c2ecf20Sopenharmony_ci#       define DLL_READY_READ                           (1 << 24)
1188c2ecf20Sopenharmony_ci#       define USE_DISPLAY_GAP                          (1 << 25)
1198c2ecf20Sopenharmony_ci#       define USE_DISPLAY_URGENT_NORMAL                (1 << 26)
1208c2ecf20Sopenharmony_ci#       define MPLL_TURNOFF_D2                          (1 << 28)
1218c2ecf20Sopenharmony_ci#define	TCI_DLL_CNTL					0x64c
1228c2ecf20Sopenharmony_ci
1238c2ecf20Sopenharmony_ci#define	CG_PG_CNTL					0x858
1248c2ecf20Sopenharmony_ci#       define PWRGATE_ENABLE                           (1 << 0)
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci#define	CG_AT				                0x6d4
1278c2ecf20Sopenharmony_ci#define		CG_R(x)					((x) << 0)
1288c2ecf20Sopenharmony_ci#define		CG_R_MASK				(0xffff << 0)
1298c2ecf20Sopenharmony_ci#define		CG_L(x)					((x) << 16)
1308c2ecf20Sopenharmony_ci#define		CG_L_MASK				(0xffff << 16)
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define	CG_SPLL_SPREAD_SPECTRUM				0x790
1338c2ecf20Sopenharmony_ci#define		SSEN					(1 << 0)
1348c2ecf20Sopenharmony_ci#define		CLK_S(x)				((x) << 4)
1358c2ecf20Sopenharmony_ci#define		CLK_S_MASK				(0xfff << 4)
1368c2ecf20Sopenharmony_ci#define	CG_SPLL_SPREAD_SPECTRUM_2			0x794
1378c2ecf20Sopenharmony_ci#define		CLK_V(x)				((x) << 0)
1388c2ecf20Sopenharmony_ci#define		CLK_V_MASK				(0x3ffffff << 0)
1398c2ecf20Sopenharmony_ci
1408c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING				0x2774
1418c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING2				0x2778
1428c2ecf20Sopenharmony_ci
1438c2ecf20Sopenharmony_ci#define	MC_ARB_RFSH_RATE				0x27b0
1448c2ecf20Sopenharmony_ci#define		POWERMODE0(x)				((x) << 0)
1458c2ecf20Sopenharmony_ci#define		POWERMODE0_MASK				(0xff << 0)
1468c2ecf20Sopenharmony_ci#define		POWERMODE1(x)				((x) << 8)
1478c2ecf20Sopenharmony_ci#define		POWERMODE1_MASK				(0xff << 8)
1488c2ecf20Sopenharmony_ci#define		POWERMODE2(x)				((x) << 16)
1498c2ecf20Sopenharmony_ci#define		POWERMODE2_MASK				(0xff << 16)
1508c2ecf20Sopenharmony_ci#define		POWERMODE3(x)				((x) << 24)
1518c2ecf20Sopenharmony_ci#define		POWERMODE3_MASK				(0xff << 24)
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING_1				0x27f0
1548c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING_2				0x27f4
1558c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING_3				0x27f8
1568c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING2_1				0x27fc
1578c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING2_2				0x2800
1588c2ecf20Sopenharmony_ci#define	MC_ARB_DRAM_TIMING2_3				0x2804
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci#define	MC4_IO_DQ_PAD_CNTL_D0_I0			0x2978
1618c2ecf20Sopenharmony_ci#define	MC4_IO_DQ_PAD_CNTL_D0_I1			0x297c
1628c2ecf20Sopenharmony_ci#define	MC4_IO_QS_PAD_CNTL_D0_I0			0x2980
1638c2ecf20Sopenharmony_ci#define	MC4_IO_QS_PAD_CNTL_D0_I1			0x2984
1648c2ecf20Sopenharmony_ci
1658c2ecf20Sopenharmony_ci#endif
166