All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 38/42] drm/amd/powerplay: update ppatomfwctl (v2)
Date: Wed, 21 Mar 2018 08:46:35 -0500	[thread overview]
Message-ID: <20180321134639.18782-38-alexander.deucher@amd.com> (raw)
In-Reply-To: <20180321134639.18782-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>

From: Evan Quan <evan.quan@amd.com>

Add new get_smc_dpm_information api to fetch the smu dpm
info from the vbios.

v2: deal with updated table format.

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>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c | 87 ++++++++++++++++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.h | 65 ++++++++++++++++
 2 files changed, 152 insertions(+)

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,
 	boot_values->usVddci    = info->bootup_vddci_mv;
 	boot_values->usMvddc    = info->bootup_mvddc_mv;
 	boot_values->usVddGfx   = info->bootup_vddgfx_mv;
+	boot_values->ucCoolingID = info->coolingsolution_id;
 	boot_values->ulSocClk   = 0;
 	boot_values->ulDCEFClk   = 0;
 
@@ -543,3 +544,89 @@ int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr,
 
 	return 0;
 }
+
+int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr,
+		struct pp_atomfwctrl_smc_dpm_parameters *param)
+{
+	struct atom_smc_dpm_info_v4_1 *info;
+	uint16_t ix;
+
+	ix = GetIndexIntoMasterDataTable(smc_dpm_info);
+	info = (struct atom_smc_dpm_info_v4_1 *)
+		cgs_atom_get_data_table(hwmgr->device,
+				ix, NULL, NULL, NULL);
+	if (!info) {
+		pr_info("Error retrieving BIOS Table Address!");
+		return -EINVAL;
+	}
+
+	param->liquid1_i2c_address = info->liquid1_i2c_address;
+	param->liquid2_i2c_address = info->liquid2_i2c_address;
+	param->vr_i2c_address = info->vr_i2c_address;
+	param->plx_i2c_address = info->plx_i2c_address;
+
+	param->liquid_i2c_linescl = info->liquid_i2c_linescl;
+	param->liquid_i2c_linesda = info->liquid_i2c_linesda;
+	param->vr_i2c_linescl = info->vr_i2c_linescl;
+	param->vr_i2c_linesda = info->vr_i2c_linesda;
+
+	param->plx_i2c_linescl = info->plx_i2c_linescl;
+	param->plx_i2c_linesda = info->plx_i2c_linesda;
+	param->vrsensorpresent = info->vrsensorpresent;
+	param->liquidsensorpresent = info->liquidsensorpresent;
+
+	param->maxvoltagestepgfx = info->maxvoltagestepgfx;
+	param->maxvoltagestepsoc = info->maxvoltagestepsoc;
+
+	param->vddgfxvrmapping = info->vddgfxvrmapping;
+	param->vddsocvrmapping = info->vddsocvrmapping;
+	param->vddmem0vrmapping = info->vddmem0vrmapping;
+	param->vddmem1vrmapping = info->vddmem1vrmapping;
+
+	param->gfxulvphasesheddingmask = info->gfxulvphasesheddingmask;
+	param->soculvphasesheddingmask = info->soculvphasesheddingmask;
+
+	param->gfxmaxcurrent = info->gfxmaxcurrent;
+	param->gfxoffset = info->gfxoffset;
+	param->padding_telemetrygfx = info->padding_telemetrygfx;
+
+	param->socmaxcurrent = info->socmaxcurrent;
+	param->socoffset = info->socoffset;
+	param->padding_telemetrysoc = info->padding_telemetrysoc;
+
+	param->mem0maxcurrent = info->mem0maxcurrent;
+	param->mem0offset = info->mem0offset;
+	param->padding_telemetrymem0 = info->padding_telemetrymem0;
+
+	param->mem1maxcurrent = info->mem1maxcurrent;
+	param->mem1offset = info->mem1offset;
+	param->padding_telemetrymem1 = info->padding_telemetrymem1;
+
+	param->acdcgpio = info->acdcgpio;
+	param->acdcpolarity = info->acdcpolarity;
+	param->vr0hotgpio = info->vr0hotgpio;
+	param->vr0hotpolarity = info->vr0hotpolarity;
+
+	param->vr1hotgpio = info->vr1hotgpio;
+	param->vr1hotpolarity = info->vr1hotpolarity;
+	param->padding1 = info->padding1;
+	param->padding2 = info->padding2;
+
+	param->ledpin0 = info->ledpin0;
+	param->ledpin1 = info->ledpin1;
+	param->ledpin2 = info->ledpin2;
+
+	param->gfxclkspreadenabled = info->gfxclkspreadenabled;
+	param->gfxclkspreadpercent = info->gfxclkspreadpercent;
+	param->gfxclkspreadfreq = info->gfxclkspreadfreq;
+
+	param->uclkspreadenabled = info->uclkspreadenabled;
+	param->uclkspreadpercent = info->uclkspreadpercent;
+	param->uclkspreadfreq = info->uclkspreadfreq;
+
+	param->socclkspreadenabled = info->socclkspreadenabled;
+	param->socclkspreadpercent = info->socclkspreadpercent;
+	param->socclkspreadfreq = info->socclkspreadfreq;
+
+	return 0;
+}
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 {
 	uint16_t   usVddci;
 	uint16_t   usMvddc;
 	uint16_t   usVddGfx;
+	uint8_t    ucCoolingID;
+};
+
+struct pp_atomfwctrl_smc_dpm_parameters
+{
+  uint8_t  liquid1_i2c_address;
+  uint8_t  liquid2_i2c_address;
+  uint8_t  vr_i2c_address;
+  uint8_t  plx_i2c_address;
+  uint8_t  liquid_i2c_linescl;
+  uint8_t  liquid_i2c_linesda;
+  uint8_t  vr_i2c_linescl;
+  uint8_t  vr_i2c_linesda;
+  uint8_t  plx_i2c_linescl;
+  uint8_t  plx_i2c_linesda;
+  uint8_t  vrsensorpresent;
+  uint8_t  liquidsensorpresent;
+  uint16_t maxvoltagestepgfx;
+  uint16_t maxvoltagestepsoc;
+  uint8_t  vddgfxvrmapping;
+  uint8_t  vddsocvrmapping;
+  uint8_t  vddmem0vrmapping;
+  uint8_t  vddmem1vrmapping;
+  uint8_t  gfxulvphasesheddingmask;
+  uint8_t  soculvphasesheddingmask;
+
+  uint16_t gfxmaxcurrent;
+  uint8_t  gfxoffset;
+  uint8_t  padding_telemetrygfx;
+  uint16_t socmaxcurrent;
+  uint8_t  socoffset;
+  uint8_t  padding_telemetrysoc;
+  uint16_t mem0maxcurrent;
+  uint8_t  mem0offset;
+  uint8_t  padding_telemetrymem0;
+  uint16_t mem1maxcurrent;
+  uint8_t  mem1offset;
+  uint8_t  padding_telemetrymem1;
+
+  uint8_t  acdcgpio;
+  uint8_t  acdcpolarity;
+  uint8_t  vr0hotgpio;
+  uint8_t  vr0hotpolarity;
+  uint8_t  vr1hotgpio;
+  uint8_t  vr1hotpolarity;
+  uint8_t  padding1;
+  uint8_t  padding2;
+
+  uint8_t  ledpin0;
+  uint8_t  ledpin1;
+  uint8_t  ledpin2;
+
+  uint8_t  gfxclkspreadenabled;
+  uint8_t  gfxclkspreadpercent;
+  uint16_t gfxclkspreadfreq;
+
+  uint8_t  uclkspreadenabled;
+  uint8_t  uclkspreadpercent;
+  uint16_t uclkspreadfreq;
+
+  uint8_t socclkspreadenabled;
+  uint8_t socclkspreadpercent;
+  uint16_t socclkspreadfreq;
 };
 
 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,
 
 int pp_atomfwctrl_get_vbios_bootup_values(struct pp_hwmgr *hwmgr,
 			struct pp_atomfwctrl_bios_boot_up_values *boot_values);
+int pp_atomfwctrl_get_smc_dpm_information(struct pp_hwmgr *hwmgr,
+			struct pp_atomfwctrl_smc_dpm_parameters *param);
 
 #endif
 
-- 
2.13.6

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-03-21 13:46 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-21 13:45 [PATCH 00/42] Add vega12 support Alex Deucher
     [not found] ` <20180321134639.18782-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-21 13:45   ` [PATCH 02/42] drm/amdgpu: add vega12 to asic_type enum Alex Deucher
2018-03-21 13:46   ` [PATCH 03/42] drm/amdgpu: add gpu_info firmware for vega12 Alex Deucher
2018-03-21 13:46   ` [PATCH 04/42] drm/amdgpu: set asic family and ip blocks " Alex Deucher
2018-03-21 13:46   ` [PATCH 05/42] drm/amdgpu: vega12 to smu firmware Alex Deucher
2018-03-21 13:46   ` [PATCH 06/42] drm/amdgpu/psp: initial vega12 support Alex Deucher
2018-03-21 13:46   ` [PATCH 07/42] drm/amdgpu: initilize vega12 psp firmwares Alex Deucher
2018-03-21 13:46   ` [PATCH 08/42] drm/amdgpu: add vega12 ucode loading method Alex Deucher
2018-03-21 13:46   ` [PATCH 09/42] drm/amdgpu: specify vega12 uvd firmware Alex Deucher
2018-03-21 13:46   ` [PATCH 10/42] drm/amdgpu: specify vega12 vce firmware Alex Deucher
2018-03-21 13:46   ` [PATCH 11/42] drm/amdgpu/virtual_dce: add vega12 support Alex Deucher
2018-03-21 13:46   ` [PATCH 12/42] drm/amd/display/dm: " Alex Deucher
2018-03-21 13:46   ` [PATCH 13/42] drm/amd/display: Add bios firmware info version for VG12 Alex Deucher
     [not found]     ` <20180321134639.18782-13-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-22 14:14       ` Harry Wentland
2018-03-21 13:46   ` [PATCH 14/42] drm/amdgpu: add vega12 to dc support check Alex Deucher
2018-03-21 13:46   ` [PATCH 15/42] drm/amdgpu/gmc9: add vega12 support Alex Deucher
2018-03-21 13:46   ` [PATCH 16/42] drm/amdgpu/gmc9: fix vega12's athub&mmhub golden setting Alex Deucher
     [not found]     ` <20180321134639.18782-16-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2018-03-21 14:19       ` Christian König
     [not found]         ` <10d031de-ed8a-2091-bedd-b7a540c118f7-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-03-21 14:44           ` Alex Deucher
2018-03-21 13:46   ` [PATCH 17/42] drm/amdgpu/mmhub: add clockgating support for vega12 Alex Deucher
2018-03-21 13:46   ` [PATCH 18/42] drm/amdgpu/sdma4: specify vega12 firmware Alex Deucher
2018-03-21 13:46   ` [PATCH 19/42] drm/amdgpu/sdma4: Add placeholder for vega12 golden settings Alex Deucher
2018-03-21 13:46   ` [PATCH 20/42] drm/amdgpu/sdma4: add clockgating support for vega12 Alex Deucher
2018-03-21 13:46   ` [PATCH 21/42] drm/amdgpu/sdma4: add sdma4_0_1 support for vega12 (v3) Alex Deucher
2018-03-21 13:46   ` [PATCH 22/42] drm/amdgpu/sdma4: Update vega12 sdma golden setting Alex Deucher
2018-03-21 13:46   ` [PATCH 23/42] drm/amdgpu/gfx9: add support for vega12 firmware Alex Deucher
2018-03-21 13:46   ` [PATCH 24/42] drm/amdgpu/gfx9: Add placeholder for vega12 golden settings Alex Deucher
2018-03-21 13:46   ` [PATCH 25/42] drm/amdgpu/gfx9: add gfx config for vega12 Alex Deucher
2018-03-21 13:46   ` [PATCH 26/42] drm/amdgpu/gfx9: add support " Alex Deucher
2018-03-21 13:46   ` [PATCH 27/42] drm/amdgpu/gfx9: add clockgating " Alex Deucher
2018-03-21 13:46   ` [PATCH 28/42] drm/amdgpu/gfx9: add golden setting for vega12 (v3) Alex Deucher
2018-03-21 13:46   ` [PATCH 29/42] drm/amdgpu/soc15: add support for vega12 Alex Deucher
2018-03-21 13:46   ` [PATCH 30/42] drm/amdgpu/soc15: update vega12 cg_flags Alex Deucher
2018-03-21 13:46   ` [PATCH 31/42] drm/amd/soc15: Add external_rev_id for vega12 Alex Deucher
2018-03-21 13:46   ` [PATCH 32/42] drm/amdgpu/soc15: initialize reg base " Alex Deucher
2018-03-21 13:46   ` [PATCH 33/42] drm/amd/powerplay: add vega12_inc.h Alex Deucher
2018-03-21 13:46   ` [PATCH 34/42] drm/amd/powerplay: update atomfirmware.h (v2) Alex Deucher
2018-03-21 13:46   ` [PATCH 35/42] drm/amd/powerplay: add new smu9_driver_if.h for vega12 (v2) Alex Deucher
2018-03-21 13:46   ` [PATCH 36/42] drm/amd/powerplay: add vega12_ppsmc.h Alex Deucher
2018-03-21 13:46   ` [PATCH 37/42] drm/amd/powerplay: add vega12_pptable.h Alex Deucher
2018-03-21 13:46   ` Alex Deucher [this message]
2018-03-21 13:46   ` [PATCH 39/42] drm/amd/powerplay: add new pp_psm infrastructure for vega12 (v2) Alex Deucher
2018-03-21 13:46   ` [PATCH 40/42] drm/amd/powerplay: add the smu manager for vega12 (v4) Alex Deucher
2018-03-21 13:46   ` [PATCH 41/42] drm/amd/powerplay: add the hw " Alex Deucher
2018-03-21 13:46   ` [PATCH 42/42] drm/amdgpu: add vega12 pci ids (v2) Alex Deucher
2018-03-21 14:24   ` [PATCH 00/42] Add vega12 support Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180321134639.18782-38-alexander.deucher@amd.com \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=evan.quan-5C7GfCeVMHo@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.