diff options
author | Evan Quan <evan.quan@amd.com> | 2017-12-24 21:21:12 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-03-21 15:36:55 -0400 |
commit | 3503d588e72fae1ef2f1d5a6fa9f86da85cf1e85 (patch) | |
tree | b43cbd1153c46e3e0b06a3832111fbaefe4f2f67 | |
parent | c042c9b434a44db6ad869223a0f46c51a63ebb5f (diff) |
drm/amd/powerplay: update ppatomfwctl (v2)
Add new get_smc_dpm_information api to fetch the smu dpm
info from the vbios.
v2: deal with updated table format.
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c | 87 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h | 65 |
2 files changed, 152 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c index 560c1c159fcc..55f9b30513ff 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c | |||
@@ -532,6 +532,7 @@ int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, | |||
532 | boot_values->usVddci = info->bootup_vddci_mv; | 532 | boot_values->usVddci = info->bootup_vddci_mv; |
533 | boot_values->usMvddc = info->bootup_mvddc_mv; | 533 | boot_values->usMvddc = info->bootup_mvddc_mv; |
534 | boot_values->usVddGfx = info->bootup_vddgfx_mv; | 534 | boot_values->usVddGfx = info->bootup_vddgfx_mv; |
535 | boot_values->ucCoolingID = info->coolingsolution_id; | ||
535 | boot_values->ulSocClk = 0; | 536 | boot_values->ulSocClk = 0; |
536 | boot_values->ulDCEFClk = 0; | 537 | boot_values->ulDCEFClk = 0; |
537 | 538 | ||
@@ -543,3 +544,89 @@ int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, | |||
543 | 544 | ||
544 | return 0; | 545 | return 0; |
545 | } | 546 | } |
547 | |||
548 | int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr, | ||
549 | struct pp_atomfwctrl_smc_dpm_parameters *param) | ||
550 | { | ||
551 | struct atom_smc_dpm_info_v4_1 *info; | ||
552 | uint16_t ix; | ||
553 | |||
554 | ix = GetIndexIntoMasterDataTable(smc_dpm_info); | ||
555 | info = (struct atom_smc_dpm_info_v4_1 *) | ||
556 | cgs_atom_get_data_table(hwmgr->device, | ||
557 | ix, NULL, NULL, NULL); | ||
558 | if (!info) { | ||
559 | pr_info("Error retrieving BIOS Table Address!"); | ||
560 | return -EINVAL; | ||
561 | } | ||
562 | |||
563 | param->liquid1_i2c_address = info->liquid1_i2c_address; | ||
564 | param->liquid2_i2c_address = info->liquid2_i2c_address; | ||
565 | param->vr_i2c_address = info->vr_i2c_address; | ||
566 | param->plx_i2c_address = info->plx_i2c_address; | ||
567 | |||
568 | param->liquid_i2c_linescl = info->liquid_i2c_linescl; | ||
569 | param->liquid_i2c_linesda = info->liquid_i2c_linesda; | ||
570 | param->vr_i2c_linescl = info->vr_i2c_linescl; | ||
571 | param->vr_i2c_linesda = info->vr_i2c_linesda; | ||
572 | |||
573 | param->plx_i2c_linescl = info->plx_i2c_linescl; | ||
574 | param->plx_i2c_linesda = info->plx_i2c_linesda; | ||
575 | param->vrsensorpresent = info->vrsensorpresent; | ||
576 | param->liquidsensorpresent = info->liquidsensorpresent; | ||
577 | |||
578 | param->maxvoltagestepgfx = info->maxvoltagestepgfx; | ||
579 | param->maxvoltagestepsoc = info->maxvoltagestepsoc; | ||
580 | |||
581 | param->vddgfxvrmapping = info->vddgfxvrmapping; | ||
582 | param->vddsocvrmapping = info->vddsocvrmapping; | ||
583 | param->vddmem0vrmapping = info->vddmem0vrmapping; | ||
584 | param->vddmem1vrmapping = info->vddmem1vrmapping; | ||
585 | |||
586 | param->gfxulvphasesheddingmask = info->gfxulvphasesheddingmask; | ||
587 | param->soculvphasesheddingmask = info->soculvphasesheddingmask; | ||
588 | |||
589 | param->gfxmaxcurrent = info->gfxmaxcurrent; | ||
590 | param->gfxoffset = info->gfxoffset; | ||
591 | param->padding_telemetrygfx = info->padding_telemetrygfx; | ||
592 | |||
593 | param->socmaxcurrent = info->socmaxcurrent; | ||
594 | param->socoffset = info->socoffset; | ||
595 | param->padding_telemetrysoc = info->padding_telemetrysoc; | ||
596 | |||
597 | param->mem0maxcurrent = info->mem0maxcurrent; | ||
598 | param->mem0offset = info->mem0offset; | ||
599 | param->padding_telemetrymem0 = info->padding_telemetrymem0; | ||
600 | |||
601 | param->mem1maxcurrent = info->mem1maxcurrent; | ||
602 | param->mem1offset = info->mem1offset; | ||
603 | param->padding_telemetrymem1 = info->padding_telemetrymem1; | ||
604 | |||
605 | param->acdcgpio = info->acdcgpio; | ||
606 | param->acdcpolarity = info->acdcpolarity; | ||
607 | param->vr0hotgpio = info->vr0hotgpio; | ||
608 | param->vr0hotpolarity = info->vr0hotpolarity; | ||
609 | |||
610 | param->vr1hotgpio = info->vr1hotgpio; | ||
611 | param->vr1hotpolarity = info->vr1hotpolarity; | ||
612 | param->padding1 = info->padding1; | ||
613 | param->padding2 = info->padding2; | ||
614 | |||
615 | param->ledpin0 = info->ledpin0; | ||
616 | param->ledpin1 = info->ledpin1; | ||
617 | param->ledpin2 = info->ledpin2; | ||
618 | |||
619 | param->gfxclkspreadenabled = info->gfxclkspreadenabled; | ||
620 | param->gfxclkspreadpercent = info->gfxclkspreadpercent; | ||
621 | param->gfxclkspreadfreq = info->gfxclkspreadfreq; | ||
622 | |||
623 | param->uclkspreadenabled = info->uclkspreadenabled; | ||
624 | param->uclkspreadpercent = info->uclkspreadpercent; | ||
625 | param->uclkspreadfreq = info->uclkspreadfreq; | ||
626 | |||
627 | param->socclkspreadenabled = info->socclkspreadenabled; | ||
628 | param->socclkspreadpercent = info->socclkspreadpercent; | ||
629 | param->socclkspreadfreq = info->socclkspreadfreq; | ||
630 | |||
631 | return 0; | ||
632 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h index 8e6b1f0ddebc..a957d8f08029 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h | |||
@@ -140,6 +140,69 @@ struct pp_atomfwctrl_bios_boot_up_values { | |||
140 | uint16_t usVddci; | 140 | uint16_t usVddci; |
141 | uint16_t usMvddc; | 141 | uint16_t usMvddc; |
142 | uint16_t usVddGfx; | 142 | uint16_t usVddGfx; |
143 | uint8_t ucCoolingID; | ||
144 | }; | ||
145 | |||
146 | struct pp_atomfwctrl_smc_dpm_parameters | ||
147 | { | ||
148 | uint8_t liquid1_i2c_address; | ||
149 | uint8_t liquid2_i2c_address; | ||
150 | uint8_t vr_i2c_address; | ||
151 | uint8_t plx_i2c_address; | ||
152 | uint8_t liquid_i2c_linescl; | ||
153 | uint8_t liquid_i2c_linesda; | ||
154 | uint8_t vr_i2c_linescl; | ||
155 | uint8_t vr_i2c_linesda; | ||
156 | uint8_t plx_i2c_linescl; | ||
157 | uint8_t plx_i2c_linesda; | ||
158 | uint8_t vrsensorpresent; | ||
159 | uint8_t liquidsensorpresent; | ||
160 | uint16_t maxvoltagestepgfx; | ||
161 | uint16_t maxvoltagestepsoc; | ||
162 | uint8_t vddgfxvrmapping; | ||
163 | uint8_t vddsocvrmapping; | ||
164 | uint8_t vddmem0vrmapping; | ||
165 | uint8_t vddmem1vrmapping; | ||
166 | uint8_t gfxulvphasesheddingmask; | ||
167 | uint8_t soculvphasesheddingmask; | ||
168 | |||
169 | uint16_t gfxmaxcurrent; | ||
170 | uint8_t gfxoffset; | ||
171 | uint8_t padding_telemetrygfx; | ||
172 | uint16_t socmaxcurrent; | ||
173 | uint8_t socoffset; | ||
174 | uint8_t padding_telemetrysoc; | ||
175 | uint16_t mem0maxcurrent; | ||
176 | uint8_t mem0offset; | ||
177 | uint8_t padding_telemetrymem0; | ||
178 | uint16_t mem1maxcurrent; | ||
179 | uint8_t mem1offset; | ||
180 | uint8_t padding_telemetrymem1; | ||
181 | |||
182 | uint8_t acdcgpio; | ||
183 | uint8_t acdcpolarity; | ||
184 | uint8_t vr0hotgpio; | ||
185 | uint8_t vr0hotpolarity; | ||
186 | uint8_t vr1hotgpio; | ||
187 | uint8_t vr1hotpolarity; | ||
188 | uint8_t padding1; | ||
189 | uint8_t padding2; | ||
190 | |||
191 | uint8_t ledpin0; | ||
192 | uint8_t ledpin1; | ||
193 | uint8_t ledpin2; | ||
194 | |||
195 | uint8_t gfxclkspreadenabled; | ||
196 | uint8_t gfxclkspreadpercent; | ||
197 | uint16_t gfxclkspreadfreq; | ||
198 | |||
199 | uint8_t uclkspreadenabled; | ||
200 | uint8_t uclkspreadpercent; | ||
201 | uint16_t uclkspreadfreq; | ||
202 | |||
203 | uint8_t socclkspreadenabled; | ||
204 | uint8_t socclkspreadpercent; | ||
205 | uint16_t socclkspreadfreq; | ||
143 | }; | 206 | }; |
144 | 207 | ||
145 | int pp_atomfwctrl_get_gpu_pll_dividers_vega10(struct pp_hwmgr *hwmgr, | 208 | int pp_atomfwctrl_get_gpu_pll_dividers_vega10(struct pp_hwmgr *hwmgr, |
@@ -161,6 +224,8 @@ int pp_atomfwctrl_get_gpio_information(struct pp_hwmgr *hwmgr, | |||
161 | 224 | ||
162 | int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, | 225 | int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr, |
163 | struct pp_atomfwctrl_bios_boot_up_values *boot_values); | 226 | struct pp_atomfwctrl_bios_boot_up_values *boot_values); |
227 | int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr, | ||
228 | struct pp_atomfwctrl_smc_dpm_parameters *param); | ||
164 | 229 | ||
165 | #endif | 230 | #endif |
166 | 231 | ||