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 __RS780_DPM_H__ 248c2ecf20Sopenharmony_ci#define __RS780_DPM_H__ 258c2ecf20Sopenharmony_ci 268c2ecf20Sopenharmony_cienum rs780_vddc_level { 278c2ecf20Sopenharmony_ci RS780_VDDC_LEVEL_UNKNOWN = 0, 288c2ecf20Sopenharmony_ci RS780_VDDC_LEVEL_LOW = 1, 298c2ecf20Sopenharmony_ci RS780_VDDC_LEVEL_HIGH = 2, 308c2ecf20Sopenharmony_ci}; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_cistruct igp_power_info { 338c2ecf20Sopenharmony_ci /* flags */ 348c2ecf20Sopenharmony_ci bool invert_pwm_required; 358c2ecf20Sopenharmony_ci bool pwm_voltage_control; 368c2ecf20Sopenharmony_ci bool voltage_control; 378c2ecf20Sopenharmony_ci bool gfx_clock_gating; 388c2ecf20Sopenharmony_ci /* stored values */ 398c2ecf20Sopenharmony_ci u32 system_config; 408c2ecf20Sopenharmony_ci u32 bootup_uma_clk; 418c2ecf20Sopenharmony_ci u16 max_voltage; 428c2ecf20Sopenharmony_ci u16 min_voltage; 438c2ecf20Sopenharmony_ci u16 boot_voltage; 448c2ecf20Sopenharmony_ci u16 inter_voltage_low; 458c2ecf20Sopenharmony_ci u16 inter_voltage_high; 468c2ecf20Sopenharmony_ci u16 num_of_cycles_in_period; 478c2ecf20Sopenharmony_ci /* variable */ 488c2ecf20Sopenharmony_ci int crtc_id; 498c2ecf20Sopenharmony_ci int refresh_rate; 508c2ecf20Sopenharmony_ci}; 518c2ecf20Sopenharmony_ci 528c2ecf20Sopenharmony_cistruct igp_ps { 538c2ecf20Sopenharmony_ci enum rs780_vddc_level min_voltage; 548c2ecf20Sopenharmony_ci enum rs780_vddc_level max_voltage; 558c2ecf20Sopenharmony_ci u32 sclk_low; 568c2ecf20Sopenharmony_ci u32 sclk_high; 578c2ecf20Sopenharmony_ci u32 flags; 588c2ecf20Sopenharmony_ci}; 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define RS780_CGFTV_DFLT 0x0303000f 618c2ecf20Sopenharmony_ci#define RS780_FBDIVTIMERVAL_DFLT 0x2710 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#define RS780_FVTHROTUTC0_DFLT 0x04010040 648c2ecf20Sopenharmony_ci#define RS780_FVTHROTUTC1_DFLT 0x04010040 658c2ecf20Sopenharmony_ci#define RS780_FVTHROTUTC2_DFLT 0x04010040 668c2ecf20Sopenharmony_ci#define RS780_FVTHROTUTC3_DFLT 0x04010040 678c2ecf20Sopenharmony_ci#define RS780_FVTHROTUTC4_DFLT 0x04010040 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define RS780_FVTHROTDTC0_DFLT 0x04010040 708c2ecf20Sopenharmony_ci#define RS780_FVTHROTDTC1_DFLT 0x04010040 718c2ecf20Sopenharmony_ci#define RS780_FVTHROTDTC2_DFLT 0x04010040 728c2ecf20Sopenharmony_ci#define RS780_FVTHROTDTC3_DFLT 0x04010040 738c2ecf20Sopenharmony_ci#define RS780_FVTHROTDTC4_DFLT 0x04010040 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci#define RS780_FVTHROTFBUSREG0_DFLT 0x00001001 768c2ecf20Sopenharmony_ci#define RS780_FVTHROTFBUSREG1_DFLT 0x00002002 778c2ecf20Sopenharmony_ci#define RS780_FVTHROTFBDSREG0_DFLT 0x00004001 788c2ecf20Sopenharmony_ci#define RS780_FVTHROTFBDSREG1_DFLT 0x00020010 798c2ecf20Sopenharmony_ci 808c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMUSREG0_DFLT 0x00002001 818c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMUSREG1_DFLT 0x00004003 828c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMDSREG0_DFLT 0x00002001 838c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMDSREG1_DFLT 0x00004003 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMFBDIVRANGEREG0_DFLT 0x37 868c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMFBDIVRANGEREG1_DFLT 0x4b 878c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMFBDIVRANGEREG2_DFLT 0x8b 888c2ecf20Sopenharmony_ci 898c2ecf20Sopenharmony_ci#define RS780D_FVTHROTPWMFBDIVRANGEREG0_DFLT 0x8b 908c2ecf20Sopenharmony_ci#define RS780D_FVTHROTPWMFBDIVRANGEREG1_DFLT 0x8c 918c2ecf20Sopenharmony_ci#define RS780D_FVTHROTPWMFBDIVRANGEREG2_DFLT 0xb5 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define RS880D_FVTHROTPWMFBDIVRANGEREG0_DFLT 0x8d 948c2ecf20Sopenharmony_ci#define RS880D_FVTHROTPWMFBDIVRANGEREG1_DFLT 0x8e 958c2ecf20Sopenharmony_ci#define RS880D_FVTHROTPWMFBDIVRANGEREG2_DFLT 0xBa 968c2ecf20Sopenharmony_ci 978c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMRANGE0_GPIO_DFLT 0x1a 988c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMRANGE1_GPIO_DFLT 0x1a 998c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMRANGE2_GPIO_DFLT 0x0 1008c2ecf20Sopenharmony_ci#define RS780_FVTHROTPWMRANGE3_GPIO_DFLT 0x0 1018c2ecf20Sopenharmony_ci 1028c2ecf20Sopenharmony_ci#define RS780_SLOWCLKFEEDBACKDIV_DFLT 110 1038c2ecf20Sopenharmony_ci 1048c2ecf20Sopenharmony_ci#define RS780_CGCLKGATING_DFLT 0x0000E204 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci#define RS780_DEFAULT_VCLK_FREQ 53300 /* 10 khz */ 1078c2ecf20Sopenharmony_ci#define RS780_DEFAULT_DCLK_FREQ 40000 /* 10 khz */ 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci#endif 110