mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-08-31 05:40:36 +00:00
drm/xe/hwmon: Add HWMON support for BMG
Add HWMON support for BMG. Exposing the pkg power, current, energy info. Signed-off-by: Karthik Poosa <karthik.poosa@intel.com> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://lore.kernel.org/r/20240523144351.4040131-2-balasubramani.vivekanandan@intel.com Signed-off-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240529050758.442056-2-balasubramani.vivekanandan@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
dac81a9adb
commit
e90f7a58e6
@ -18,4 +18,9 @@
|
|||||||
#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
|
#define PVC_GT0_PLATFORM_ENERGY_STATUS XE_REG(0x28106c)
|
||||||
#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
|
#define PVC_GT0_PACKAGE_POWER_SKU XE_REG(0x281080)
|
||||||
|
|
||||||
|
#define BMG_PACKAGE_POWER_SKU XE_REG(0x138098)
|
||||||
|
#define BMG_PACKAGE_POWER_SKU_UNIT XE_REG(0x1380dc)
|
||||||
|
#define BMG_PACKAGE_ENERGY_STATUS XE_REG(0x138120)
|
||||||
|
#define BMG_PACKAGE_RAPL_LIMIT XE_REG(0x138440)
|
||||||
|
|
||||||
#endif /* _XE_PCODE_REGS_H_ */
|
#endif /* _XE_PCODE_REGS_H_ */
|
||||||
|
@ -86,19 +86,25 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg
|
|||||||
|
|
||||||
switch (hwmon_reg) {
|
switch (hwmon_reg) {
|
||||||
case REG_PKG_RAPL_LIMIT:
|
case REG_PKG_RAPL_LIMIT:
|
||||||
if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
|
if (xe->info.platform == XE_BATTLEMAGE && channel == CHANNEL_PKG)
|
||||||
|
return BMG_PACKAGE_RAPL_LIMIT;
|
||||||
|
else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
|
||||||
return PVC_GT0_PACKAGE_RAPL_LIMIT;
|
return PVC_GT0_PACKAGE_RAPL_LIMIT;
|
||||||
else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
|
else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
|
||||||
return PCU_CR_PACKAGE_RAPL_LIMIT;
|
return PCU_CR_PACKAGE_RAPL_LIMIT;
|
||||||
break;
|
break;
|
||||||
case REG_PKG_POWER_SKU:
|
case REG_PKG_POWER_SKU:
|
||||||
if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
|
if (xe->info.platform == XE_BATTLEMAGE)
|
||||||
|
return BMG_PACKAGE_POWER_SKU;
|
||||||
|
else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
|
||||||
return PVC_GT0_PACKAGE_POWER_SKU;
|
return PVC_GT0_PACKAGE_POWER_SKU;
|
||||||
else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
|
else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
|
||||||
return PCU_CR_PACKAGE_POWER_SKU;
|
return PCU_CR_PACKAGE_POWER_SKU;
|
||||||
break;
|
break;
|
||||||
case REG_PKG_POWER_SKU_UNIT:
|
case REG_PKG_POWER_SKU_UNIT:
|
||||||
if (xe->info.platform == XE_PVC)
|
if (xe->info.platform == XE_BATTLEMAGE)
|
||||||
|
return BMG_PACKAGE_POWER_SKU_UNIT;
|
||||||
|
else if (xe->info.platform == XE_PVC)
|
||||||
return PVC_GT0_PACKAGE_POWER_SKU_UNIT;
|
return PVC_GT0_PACKAGE_POWER_SKU_UNIT;
|
||||||
else if (xe->info.platform == XE_DG2)
|
else if (xe->info.platform == XE_DG2)
|
||||||
return PCU_CR_PACKAGE_POWER_SKU_UNIT;
|
return PCU_CR_PACKAGE_POWER_SKU_UNIT;
|
||||||
@ -108,7 +114,9 @@ static struct xe_reg xe_hwmon_get_reg(struct xe_hwmon *hwmon, enum xe_hwmon_reg
|
|||||||
return GT_PERF_STATUS;
|
return GT_PERF_STATUS;
|
||||||
break;
|
break;
|
||||||
case REG_PKG_ENERGY_STATUS:
|
case REG_PKG_ENERGY_STATUS:
|
||||||
if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
|
if (xe->info.platform == XE_BATTLEMAGE && channel == CHANNEL_PKG)
|
||||||
|
return BMG_PACKAGE_ENERGY_STATUS;
|
||||||
|
else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG)
|
||||||
return PVC_GT0_PLATFORM_ENERGY_STATUS;
|
return PVC_GT0_PLATFORM_ENERGY_STATUS;
|
||||||
else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
|
else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG))
|
||||||
return PCU_CR_PACKAGE_ENERGY_STATUS;
|
return PCU_CR_PACKAGE_ENERGY_STATUS;
|
||||||
|
Loading…
Reference in New Issue
Block a user