提交 2abba66e 编写于 作者: A Alex Deucher

drm/radeon: update radeon_atombios_get_default_voltages for mvdd

Add a way to look up the bootup mvdd.  Required for DPM on SI.
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 4489cd62
...@@ -3800,8 +3800,8 @@ static void ni_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -3800,8 +3800,8 @@ static void ni_parse_pplib_clock_info(struct radeon_device *rdev,
/* patch up boot state */ /* patch up boot state */
if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT) { if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT) {
u16 vddc, vddci; u16 vddc, vddci, mvdd;
radeon_atombios_get_default_voltages(rdev, &vddc, &vddci); radeon_atombios_get_default_voltages(rdev, &vddc, &vddci, &mvdd);
pl->mclk = rdev->clock.default_mclk; pl->mclk = rdev->clock.default_mclk;
pl->sclk = rdev->clock.default_sclk; pl->sclk = rdev->clock.default_sclk;
pl->vddc = vddc; pl->vddc = vddc;
......
...@@ -2270,7 +2270,7 @@ static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *r ...@@ -2270,7 +2270,7 @@ static void radeon_atombios_add_pplib_thermal_controller(struct radeon_device *r
} }
void radeon_atombios_get_default_voltages(struct radeon_device *rdev, void radeon_atombios_get_default_voltages(struct radeon_device *rdev,
u16 *vddc, u16 *vddci) u16 *vddc, u16 *vddci, u16 *mvdd)
{ {
struct radeon_mode_info *mode_info = &rdev->mode_info; struct radeon_mode_info *mode_info = &rdev->mode_info;
int index = GetIndexIntoMasterTable(DATA, FirmwareInfo); int index = GetIndexIntoMasterTable(DATA, FirmwareInfo);
...@@ -2280,6 +2280,7 @@ void radeon_atombios_get_default_voltages(struct radeon_device *rdev, ...@@ -2280,6 +2280,7 @@ void radeon_atombios_get_default_voltages(struct radeon_device *rdev,
*vddc = 0; *vddc = 0;
*vddci = 0; *vddci = 0;
*mvdd = 0;
if (atom_parse_data_header(mode_info->atom_context, index, NULL, if (atom_parse_data_header(mode_info->atom_context, index, NULL,
&frev, &crev, &data_offset)) { &frev, &crev, &data_offset)) {
...@@ -2287,8 +2288,10 @@ void radeon_atombios_get_default_voltages(struct radeon_device *rdev, ...@@ -2287,8 +2288,10 @@ void radeon_atombios_get_default_voltages(struct radeon_device *rdev,
(union firmware_info *)(mode_info->atom_context->bios + (union firmware_info *)(mode_info->atom_context->bios +
data_offset); data_offset);
*vddc = le16_to_cpu(firmware_info->info_14.usBootUpVDDCVoltage); *vddc = le16_to_cpu(firmware_info->info_14.usBootUpVDDCVoltage);
if ((frev == 2) && (crev >= 2)) if ((frev == 2) && (crev >= 2)) {
*vddci = le16_to_cpu(firmware_info->info_22.usBootUpVDDCIVoltage); *vddci = le16_to_cpu(firmware_info->info_22.usBootUpVDDCIVoltage);
*mvdd = le16_to_cpu(firmware_info->info_22.usBootUpMVDDCVoltage);
}
} }
} }
...@@ -2299,9 +2302,9 @@ static void radeon_atombios_parse_pplib_non_clock_info(struct radeon_device *rde ...@@ -2299,9 +2302,9 @@ static void radeon_atombios_parse_pplib_non_clock_info(struct radeon_device *rde
int j; int j;
u32 misc = le32_to_cpu(non_clock_info->ulCapsAndSettings); u32 misc = le32_to_cpu(non_clock_info->ulCapsAndSettings);
u32 misc2 = le16_to_cpu(non_clock_info->usClassification); u32 misc2 = le16_to_cpu(non_clock_info->usClassification);
u16 vddc, vddci; u16 vddc, vddci, mvdd;
radeon_atombios_get_default_voltages(rdev, &vddc, &vddci); radeon_atombios_get_default_voltages(rdev, &vddc, &vddci, &mvdd);
rdev->pm.power_state[state_index].misc = misc; rdev->pm.power_state[state_index].misc = misc;
rdev->pm.power_state[state_index].misc2 = misc2; rdev->pm.power_state[state_index].misc2 = misc2;
......
...@@ -610,7 +610,7 @@ radeon_combios_get_tv_info(struct radeon_device *rdev); ...@@ -610,7 +610,7 @@ radeon_combios_get_tv_info(struct radeon_device *rdev);
extern enum radeon_tv_std extern enum radeon_tv_std
radeon_atombios_get_tv_info(struct radeon_device *rdev); radeon_atombios_get_tv_info(struct radeon_device *rdev);
extern void radeon_atombios_get_default_voltages(struct radeon_device *rdev, extern void radeon_atombios_get_default_voltages(struct radeon_device *rdev,
u16 *vddc, u16 *vddci); u16 *vddc, u16 *vddci, u16 *mvdd);
extern struct drm_connector * extern struct drm_connector *
radeon_get_connector_for_encoder(struct drm_encoder *encoder); radeon_get_connector_for_encoder(struct drm_encoder *encoder);
......
...@@ -1821,8 +1821,8 @@ static void rv6xx_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -1821,8 +1821,8 @@ static void rv6xx_parse_pplib_clock_info(struct radeon_device *rdev,
/* patch up boot state */ /* patch up boot state */
if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT) { if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT) {
u16 vddc, vddci; u16 vddc, vddci, mvdd;
radeon_atombios_get_default_voltages(rdev, &vddc, &vddci); radeon_atombios_get_default_voltages(rdev, &vddc, &vddci, &mvdd);
pl->mclk = rdev->clock.default_mclk; pl->mclk = rdev->clock.default_mclk;
pl->sclk = rdev->clock.default_sclk; pl->sclk = rdev->clock.default_sclk;
pl->vddc = vddc; pl->vddc = vddc;
......
...@@ -2175,8 +2175,8 @@ static void rv7xx_parse_pplib_clock_info(struct radeon_device *rdev, ...@@ -2175,8 +2175,8 @@ static void rv7xx_parse_pplib_clock_info(struct radeon_device *rdev,
/* patch up boot state */ /* patch up boot state */
if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT) { if (rps->class & ATOM_PPLIB_CLASSIFICATION_BOOT) {
u16 vddc, vddci; u16 vddc, vddci, mvdd;
radeon_atombios_get_default_voltages(rdev, &vddc, &vddci); radeon_atombios_get_default_voltages(rdev, &vddc, &vddci, &mvdd);
pl->mclk = rdev->clock.default_mclk; pl->mclk = rdev->clock.default_mclk;
pl->sclk = rdev->clock.default_sclk; pl->sclk = rdev->clock.default_sclk;
pl->vddc = vddc; pl->vddc = vddc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册