Lines Matching +full:0 +full:xe
62 * struct xe_hwmon - xe hwmon data structure
65 /** @hwmon_dev: hwmon device for xe */
67 /** @xe: Xe device */
68 struct xe_device *xe; member
84 struct xe_device *xe = hwmon->xe; in xe_hwmon_get_reg() local
88 if (xe->info.platform == XE_BATTLEMAGE) { in xe_hwmon_get_reg()
93 } else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) { in xe_hwmon_get_reg()
95 } else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG)) { in xe_hwmon_get_reg()
100 if (xe->info.platform == XE_BATTLEMAGE) in xe_hwmon_get_reg()
102 else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) in xe_hwmon_get_reg()
104 else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG)) in xe_hwmon_get_reg()
108 if (xe->info.platform == XE_BATTLEMAGE) in xe_hwmon_get_reg()
110 else if (xe->info.platform == XE_PVC) in xe_hwmon_get_reg()
112 else if (xe->info.platform == XE_DG2) in xe_hwmon_get_reg()
116 if (xe->info.platform == XE_DG2 && channel == CHANNEL_PKG) in xe_hwmon_get_reg()
120 if (xe->info.platform == XE_BATTLEMAGE) { in xe_hwmon_get_reg()
125 } else if (xe->info.platform == XE_PVC && channel == CHANNEL_PKG) { in xe_hwmon_get_reg()
127 } else if ((xe->info.platform == XE_DG2) && (channel == CHANNEL_PKG)) { in xe_hwmon_get_reg()
132 drm_warn(&xe->drm, "Unknown xe hwmon reg id: %d\n", hwmon_reg); in xe_hwmon_get_reg()
136 return XE_REG(0); in xe_hwmon_get_reg()
139 #define PL1_DISABLE 0
150 struct xe_device *xe = hwmon->xe; in xe_hwmon_power_max_read() local
152 struct xe_gt *mmio = xe_root_mmio_gt(xe); in xe_hwmon_power_max_read()
162 drm_warn(&xe->drm, "pkg_power_sku invalid\n"); in xe_hwmon_power_max_read()
163 *value = 0; in xe_hwmon_power_max_read()
193 struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); in xe_hwmon_power_max_write()
194 int ret = 0; in xe_hwmon_power_max_write()
204 reg_val = xe_mmio_rmw32(mmio, rapl_limit, PKG_PWR_LIM_1_EN, 0); in xe_hwmon_power_max_write()
207 drm_warn(&hwmon->xe->drm, "PL1 disable is not supported!\n"); in xe_hwmon_power_max_write()
225 struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); in xe_hwmon_power_rated_max_read()
262 struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); in xe_hwmon_energy_get()
285 struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); in xe_hwmon_power_max_interval_show()
290 xe_pm_runtime_get(hwmon->xe); in xe_hwmon_power_max_interval_show()
298 xe_pm_runtime_put(hwmon->xe); in xe_hwmon_power_max_interval_show()
326 struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); in xe_hwmon_power_max_interval_store()
333 ret = kstrtoul(buf, 0, &val); in xe_hwmon_power_max_interval_store()
338 * Max HW supported tau in '1.x * power(2,y)' format, x = 0, y = 0x12. in xe_hwmon_power_max_interval_store()
339 * The hwmon->scl_shift_time default of 0xa results in a max tau of 256 seconds. in xe_hwmon_power_max_interval_store()
346 #define PKG_MAX_WIN_DEFAULT 0x12ull in xe_hwmon_power_max_interval_store()
370 y = 0; in xe_hwmon_power_max_interval_store()
371 x = 0; in xe_hwmon_power_max_interval_store()
379 xe_pm_runtime_get(hwmon->xe); in xe_hwmon_power_max_interval_store()
388 xe_pm_runtime_put(hwmon->xe); in xe_hwmon_power_max_interval_store()
412 int ret = 0; in xe_hwmon_attributes_visible()
414 xe_pm_runtime_get(hwmon->xe); in xe_hwmon_attributes_visible()
416 ret = xe_reg_is_valid(xe_hwmon_get_reg(hwmon, REG_PKG_RAPL_LIMIT, index)) ? attr->mode : 0; in xe_hwmon_attributes_visible()
418 xe_pm_runtime_put(hwmon->xe); in xe_hwmon_attributes_visible()
445 struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe); in xe_hwmon_pcode_read_i1()
448 if (hwmon->xe->info.platform == XE_DG2) in xe_hwmon_pcode_read_i1()
452 POWER_SETUP_SUBCOMMAND_READ_I1, 0), in xe_hwmon_pcode_read_i1()
458 struct xe_tile *root_tile = xe_device_get_root_tile(hwmon->xe); in xe_hwmon_pcode_write_i1()
461 POWER_SETUP_SUBCOMMAND_WRITE_I1, 0), in xe_hwmon_pcode_write_i1()
501 struct xe_gt *mmio = xe_root_mmio_gt(hwmon->xe); in xe_hwmon_get_voltage()
517 channel)) ? 0664 : 0; in xe_hwmon_power_is_visible()
520 channel)) ? 0444 : 0; in xe_hwmon_power_is_visible()
524 !(uval & POWER_SETUP_I1_WATTS)) ? 0 : 0644; in xe_hwmon_power_is_visible()
528 channel)) ? 0444 : 0; in xe_hwmon_power_is_visible()
530 return 0; in xe_hwmon_power_is_visible()
532 return 0; in xe_hwmon_power_is_visible()
541 return 0; in xe_hwmon_power_read()
544 return 0; in xe_hwmon_power_read()
572 return 0; in xe_hwmon_curr_is_visible()
577 (uval & POWER_SETUP_I1_WATTS)) ? 0 : 0644; in xe_hwmon_curr_is_visible()
580 (uval & POWER_SETUP_I1_WATTS)) ? 0 : 0444; in xe_hwmon_curr_is_visible()
583 return 0; in xe_hwmon_curr_is_visible()
585 return 0; in xe_hwmon_curr_is_visible()
617 channel)) ? 0444 : 0; in xe_hwmon_in_is_visible()
619 return 0; in xe_hwmon_in_is_visible()
629 return 0; in xe_hwmon_in_read()
642 channel)) ? 0444 : 0; in xe_hwmon_energy_is_visible()
644 return 0; in xe_hwmon_energy_is_visible()
654 return 0; in xe_hwmon_energy_read()
667 xe_pm_runtime_get(hwmon->xe); in xe_hwmon_is_visible()
683 ret = 0; in xe_hwmon_is_visible()
687 xe_pm_runtime_put(hwmon->xe); in xe_hwmon_is_visible()
699 xe_pm_runtime_get(hwmon->xe); in xe_hwmon_read()
719 xe_pm_runtime_put(hwmon->xe); in xe_hwmon_read()
731 xe_pm_runtime_get(hwmon->xe); in xe_hwmon_write()
745 xe_pm_runtime_put(hwmon->xe); in xe_hwmon_write()
763 return 0; in xe_hwmon_read_label()
782 xe_hwmon_get_preregistration_info(struct xe_device *xe) in xe_hwmon_get_preregistration_info() argument
784 struct xe_gt *mmio = xe_root_mmio_gt(xe); in xe_hwmon_get_preregistration_info()
785 struct xe_hwmon *hwmon = xe->hwmon; in xe_hwmon_get_preregistration_info()
787 u64 val_sku_unit = 0; in xe_hwmon_get_preregistration_info()
795 pkg_power_sku_unit = xe_hwmon_get_reg(hwmon, REG_PKG_POWER_SKU_UNIT, 0); in xe_hwmon_get_preregistration_info()
807 for (channel = 0; channel < CHANNEL_MAX; channel++) in xe_hwmon_get_preregistration_info()
819 void xe_hwmon_register(struct xe_device *xe) in xe_hwmon_register() argument
821 struct device *dev = xe->drm.dev; in xe_hwmon_register()
825 if (!IS_DGFX(xe)) in xe_hwmon_register()
829 if (IS_SRIOV_VF(xe)) in xe_hwmon_register()
836 xe->hwmon = hwmon; in xe_hwmon_register()
843 hwmon->xe = xe; in xe_hwmon_register()
845 xe_hwmon_get_preregistration_info(xe); in xe_hwmon_register()
847 drm_dbg(&xe->drm, "Register xe hwmon interface\n"); in xe_hwmon_register()
850 hwmon->hwmon_dev = devm_hwmon_device_register_with_info(dev, "xe", hwmon, in xe_hwmon_register()
855 drm_warn(&xe->drm, "Failed to register xe hwmon (%pe)\n", hwmon->hwmon_dev); in xe_hwmon_register()
856 xe->hwmon = NULL; in xe_hwmon_register()