Skip to content

Commit 011529f

Browse files
kwachowsjlawryno
authored andcommitted
accel/ivpu: Implement D0i2 disable test mode
Add power_profile firmware boot param and set it to 0 by default which is default FW power profile. Implement IVPU_TEST_MODE_D0I2_DISABLE which is used for setting power profile boot param value to 1 which prevents NPU from entering d0i2 power state. Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Signed-off-by: Karol Wachowski <karol.wachowski@intel.com> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250204084622.2422544-7-jacek.lawrynowicz@linux.intel.com
1 parent 55e856c commit 011529f

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ struct ivpu_wa_table {
111111
bool disable_clock_relinquish;
112112
bool disable_d0i3_msg;
113113
bool wp0_during_power_up;
114+
bool disable_d0i2;
114115
};
115116

116117
struct ivpu_hw_info;
@@ -208,6 +209,7 @@ extern bool ivpu_force_snoop;
208209
#define IVPU_TEST_MODE_TURBO BIT(9)
209210
#define IVPU_TEST_MODE_CLK_RELINQ_DISABLE BIT(10)
210211
#define IVPU_TEST_MODE_CLK_RELINQ_ENABLE BIT(11)
212+
#define IVPU_TEST_MODE_D0I2_DISABLE BIT(12)
211213
extern int ivpu_test_mode;
212214

213215
struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);

drivers/accel/ivpu/ivpu_fw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,8 @@ static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_
534534
boot_params->d0i3_entry_vpu_ts);
535535
ivpu_dbg(vdev, FW_BOOT, "boot_params.system_time_us = %llu\n",
536536
boot_params->system_time_us);
537+
ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = %u\n",
538+
boot_params->power_profile);
537539
}
538540

539541
void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params *boot_params)
@@ -634,6 +636,8 @@ void ivpu_fw_boot_params_setup(struct ivpu_device *vdev, struct vpu_boot_params
634636
boot_params->d0i3_delayed_entry = 1;
635637
boot_params->d0i3_residency_time_us = 0;
636638
boot_params->d0i3_entry_vpu_ts = 0;
639+
if (IVPU_WA(disable_d0i2))
640+
boot_params->power_profile = 1;
637641

638642
boot_params->system_time_us = ktime_to_us(ktime_get_real());
639643
wmb(); /* Flush WC buffers after writing bootparams */

drivers/accel/ivpu/ivpu_hw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ static void wa_init(struct ivpu_device *vdev)
7777
if (ivpu_hw_ip_gen(vdev) == IVPU_HW_IP_37XX)
7878
vdev->wa.wp0_during_power_up = true;
7979

80+
if (ivpu_test_mode & IVPU_TEST_MODE_D0I2_DISABLE)
81+
vdev->wa.disable_d0i2 = true;
82+
8083
IVPU_PRINT_WA(punit_disabled);
8184
IVPU_PRINT_WA(clear_runtime_mem);
8285
IVPU_PRINT_WA(interrupt_clear_with_0);
8386
IVPU_PRINT_WA(disable_clock_relinquish);
8487
IVPU_PRINT_WA(wp0_during_power_up);
88+
IVPU_PRINT_WA(disable_d0i2);
8589
}
8690

8791
static void timeouts_init(struct ivpu_device *vdev)

0 commit comments

Comments
 (0)