accel/ivpu: Implement D0i2 disable test mode
authorKarol Wachowski <karol.wachowski@intel.com>
Tue, 4 Feb 2025 08:46:22 +0000 (09:46 +0100)
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Mon, 10 Feb 2025 09:45:43 +0000 (10:45 +0100)
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
drivers/accel/ivpu/ivpu_drv.h
drivers/accel/ivpu/ivpu_fw.c
drivers/accel/ivpu/ivpu_hw.c

index 73d808068c8b7bcd1ffada717be1351714e5afa9..92753effb1c9966289f26f2183d77d61753f2b7f 100644 (file)
@@ -111,6 +111,7 @@ struct ivpu_wa_table {
        bool disable_clock_relinquish;
        bool disable_d0i3_msg;
        bool wp0_during_power_up;
+       bool disable_d0i2;
 };
 
 struct ivpu_hw_info;
@@ -208,6 +209,7 @@ extern bool ivpu_force_snoop;
 #define IVPU_TEST_MODE_TURBO             BIT(9)
 #define IVPU_TEST_MODE_CLK_RELINQ_DISABLE BIT(10)
 #define IVPU_TEST_MODE_CLK_RELINQ_ENABLE  BIT(11)
+#define IVPU_TEST_MODE_D0I2_DISABLE       BIT(12)
 extern int ivpu_test_mode;
 
 struct ivpu_file_priv *ivpu_file_priv_get(struct ivpu_file_priv *file_priv);
index cfe8f79ec5a6fa326275706ea14c11a9773d0764..7a1bb92d8c8161e238b824e9835f6662e93986de 100644 (file)
@@ -534,6 +534,8 @@ static void ivpu_fw_boot_params_print(struct ivpu_device *vdev, struct vpu_boot_
                 boot_params->d0i3_entry_vpu_ts);
        ivpu_dbg(vdev, FW_BOOT, "boot_params.system_time_us = %llu\n",
                 boot_params->system_time_us);
+       ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = %u\n",
+                boot_params->power_profile);
 }
 
 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
                boot_params->d0i3_delayed_entry = 1;
        boot_params->d0i3_residency_time_us = 0;
        boot_params->d0i3_entry_vpu_ts = 0;
+       if (IVPU_WA(disable_d0i2))
+               boot_params->power_profile = 1;
 
        boot_params->system_time_us = ktime_to_us(ktime_get_real());
        wmb(); /* Flush WC buffers after writing bootparams */
index 4d9f30e3b505dc192bb8b7d1eaa25485701f91ea..ec9a3629da3a924f81b282727882bd3bcedf59cf 100644 (file)
@@ -77,11 +77,15 @@ static void wa_init(struct ivpu_device *vdev)
        if (ivpu_hw_ip_gen(vdev) == IVPU_HW_IP_37XX)
                vdev->wa.wp0_during_power_up = true;
 
+       if (ivpu_test_mode & IVPU_TEST_MODE_D0I2_DISABLE)
+               vdev->wa.disable_d0i2 = true;
+
        IVPU_PRINT_WA(punit_disabled);
        IVPU_PRINT_WA(clear_runtime_mem);
        IVPU_PRINT_WA(interrupt_clear_with_0);
        IVPU_PRINT_WA(disable_clock_relinquish);
        IVPU_PRINT_WA(wp0_during_power_up);
+       IVPU_PRINT_WA(disable_d0i2);
 }
 
 static void timeouts_init(struct ivpu_device *vdev)