Skip to content

Commit 8c63b47

Browse files
Krystian Pradzynskisgruszka
authored andcommitted
accel/ivpu: Update FW API
Bump boot API to 4.20 Bump JSM API to 3.15 Signed-off-by: Krystian Pradzynski <[email protected]> Reviewed-by: Stanislaw Gruszka <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 1470acb commit 8c63b47

File tree

3 files changed

+392
-24
lines changed

3 files changed

+392
-24
lines changed

drivers/accel/ivpu/ivpu_jsm_msg.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ const char *ivpu_jsm_msg_type_to_str(enum vpu_ipc_msg_type type)
3636
IVPU_CASE_TO_STR(VPU_JSM_MSG_DESTROY_CMD_QUEUE);
3737
IVPU_CASE_TO_STR(VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES);
3838
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_REGISTER_DB);
39+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_CMDQ);
40+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SUSPEND_CMDQ);
41+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_CMDQ_RSP);
42+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SUSPEND_CMDQ_DONE);
43+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SET_SCHEDULING_LOG);
44+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SET_SCHEDULING_LOG_RSP);
45+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SCHEDULING_LOG_NOTIFICATION);
46+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_ENGINE_RESUME);
47+
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_ENGINE_DONE);
48+
IVPU_CASE_TO_STR(VPU_JSM_MSG_STATE_DUMP);
49+
IVPU_CASE_TO_STR(VPU_JSM_MSG_STATE_DUMP_RSP);
3950
IVPU_CASE_TO_STR(VPU_JSM_MSG_BLOB_DEINIT);
4051
IVPU_CASE_TO_STR(VPU_JSM_MSG_DYNDBG_CONTROL);
4152
IVPU_CASE_TO_STR(VPU_JSM_MSG_JOB_DONE);
@@ -65,6 +76,12 @@ const char *ivpu_jsm_msg_type_to_str(enum vpu_ipc_msg_type type)
6576
IVPU_CASE_TO_STR(VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES_RSP);
6677
IVPU_CASE_TO_STR(VPU_JSM_MSG_BLOB_DEINIT_DONE);
6778
IVPU_CASE_TO_STR(VPU_JSM_MSG_DYNDBG_CONTROL_RSP);
79+
IVPU_CASE_TO_STR(VPU_JSM_MSG_PWR_D0I3_ENTER);
80+
IVPU_CASE_TO_STR(VPU_JSM_MSG_PWR_D0I3_ENTER_DONE);
81+
IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_ENABLE);
82+
IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_ENABLE_DONE);
83+
IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_DISABLE);
84+
IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_DISABLE_DONE);
6885
}
6986
#undef IVPU_CASE_TO_STR
7087

drivers/accel/ivpu/vpu_boot_api.h

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
* The bellow values will be used to construct the version info this way:
1212
* fw_bin_header->api_version[VPU_BOOT_API_VER_ID] = (VPU_BOOT_API_VER_MAJOR << 16) |
1313
* VPU_BOOT_API_VER_MINOR;
14-
* VPU_BOOT_API_VER_PATCH will be ignored. KMD and compatibility is not affected if this changes.
14+
* VPU_BOOT_API_VER_PATCH will be ignored. KMD and compatibility is not affected if this changes
15+
* This information is collected by using vpuip_2/application/vpuFirmware/make_std_fw_image.py
16+
* If a header is missing this info we ignore the header, if a header is missing or contains
17+
* partial info a build error will be generated.
1518
*/
1619

1720
/*
@@ -24,12 +27,12 @@
2427
* Minor version changes when API backward compatibility is preserved.
2528
* Resets to 0 if Major version is incremented.
2629
*/
27-
#define VPU_BOOT_API_VER_MINOR 12
30+
#define VPU_BOOT_API_VER_MINOR 20
2831

2932
/*
3033
* API header changed (field names, documentation, formatting) but API itself has not been changed
3134
*/
32-
#define VPU_BOOT_API_VER_PATCH 2
35+
#define VPU_BOOT_API_VER_PATCH 4
3336

3437
/*
3538
* Index in the API version table
@@ -63,6 +66,12 @@ struct vpu_firmware_header {
6366
/* Size of memory require for firmware execution */
6467
u32 runtime_size;
6568
u32 shave_nn_fw_size;
69+
/* Size of primary preemption buffer. */
70+
u32 preemption_buffer_1_size;
71+
/* Size of secondary preemption buffer. */
72+
u32 preemption_buffer_2_size;
73+
/* Space reserved for future preemption-related fields. */
74+
u32 preemption_reserved[6];
6675
};
6776

6877
/*
@@ -89,6 +98,14 @@ enum VPU_BOOT_L2_CACHE_CFG_TYPE {
8998
VPU_BOOT_L2_CACHE_CFG_NUM = 2
9099
};
91100

101+
/** VPU MCA ECC signalling mode. By default, no signalling is used */
102+
enum VPU_BOOT_MCA_ECC_SIGNAL_TYPE {
103+
VPU_BOOT_MCA_ECC_NONE = 0,
104+
VPU_BOOT_MCA_ECC_CORR = 1,
105+
VPU_BOOT_MCA_ECC_FATAL = 2,
106+
VPU_BOOT_MCA_ECC_BOTH = 3
107+
};
108+
92109
/**
93110
* Logging destinations.
94111
*
@@ -131,9 +148,11 @@ enum vpu_trace_destination {
131148
#define VPU_TRACE_PROC_BIT_ACT_SHV_3 22
132149
#define VPU_TRACE_PROC_NO_OF_HW_DEVS 23
133150

134-
/* KMB HW component IDs are sequential, so define first and last IDs. */
135-
#define VPU_TRACE_PROC_BIT_KMB_FIRST VPU_TRACE_PROC_BIT_LRT
136-
#define VPU_TRACE_PROC_BIT_KMB_LAST VPU_TRACE_PROC_BIT_SHV_15
151+
/* VPU 30xx HW component IDs are sequential, so define first and last IDs. */
152+
#define VPU_TRACE_PROC_BIT_30XX_FIRST VPU_TRACE_PROC_BIT_LRT
153+
#define VPU_TRACE_PROC_BIT_30XX_LAST VPU_TRACE_PROC_BIT_SHV_15
154+
#define VPU_TRACE_PROC_BIT_KMB_FIRST VPU_TRACE_PROC_BIT_30XX_FIRST
155+
#define VPU_TRACE_PROC_BIT_KMB_LAST VPU_TRACE_PROC_BIT_30XX_LAST
137156

138157
struct vpu_boot_l2_cache_config {
139158
u8 use;
@@ -148,6 +167,25 @@ struct vpu_warm_boot_section {
148167
u32 is_clear_op;
149168
};
150169

170+
/*
171+
* When HW scheduling mode is enabled, a present period is defined.
172+
* It will be used by VPU to swap between normal and focus priorities
173+
* to prevent starving of normal priority band (when implemented).
174+
* Host must provide a valid value at boot time in
175+
* `vpu_focus_present_timer_ms`. If the value provided by the host is not within the
176+
* defined range a default value will be used. Here we define the min. and max.
177+
* allowed values and the and default value of the present period. Units are milliseconds.
178+
*/
179+
#define VPU_PRESENT_CALL_PERIOD_MS_DEFAULT 50
180+
#define VPU_PRESENT_CALL_PERIOD_MS_MIN 16
181+
#define VPU_PRESENT_CALL_PERIOD_MS_MAX 10000
182+
183+
/**
184+
* Macros to enable various operation modes within the VPU.
185+
* To be defined as part of 32 bit mask.
186+
*/
187+
#define VPU_OP_MODE_SURVIVABILITY 0x1
188+
151189
struct vpu_boot_params {
152190
u32 magic;
153191
u32 vpu_id;
@@ -218,6 +256,7 @@ struct vpu_boot_params {
218256
* the threshold will not be logged); applies to every enabled logging
219257
* destination and loggable HW component. See 'mvLog_t' enum for acceptable
220258
* values.
259+
* TODO: EISW-33556: Move log level definition (mvLog_t) to this file.
221260
*/
222261
u32 default_trace_level;
223262
u32 boot_type;
@@ -249,7 +288,36 @@ struct vpu_boot_params {
249288
u32 temp_sensor_period_ms;
250289
/** PLL ratio for efficient clock frequency */
251290
u32 pn_freq_pll_ratio;
252-
u32 pad4[28];
291+
/** DVFS Mode: Default: 0, Max Performance: 1, On Demand: 2, Power Save: 3 */
292+
u32 dvfs_mode;
293+
/**
294+
* Depending on DVFS Mode:
295+
* On-demand: Default if 0.
296+
* Bit 0-7 - uint8_t: Highest residency percent
297+
* Bit 8-15 - uint8_t: High residency percent
298+
* Bit 16-23 - uint8_t: Low residency percent
299+
* Bit 24-31 - uint8_t: Lowest residency percent
300+
* Bit 32-35 - unsigned 4b: PLL Ratio increase amount on highest residency
301+
* Bit 36-39 - unsigned 4b: PLL Ratio increase amount on high residency
302+
* Bit 40-43 - unsigned 4b: PLL Ratio decrease amount on low residency
303+
* Bit 44-47 - unsigned 4b: PLL Ratio decrease amount on lowest frequency
304+
* Bit 48-55 - uint8_t: Period (ms) for residency decisions
305+
* Bit 56-63 - uint8_t: Averaging windows (as multiples of period. Max: 30 decimal)
306+
* Power Save/Max Performance: Unused
307+
*/
308+
u64 dvfs_param;
309+
/**
310+
* D0i3 delayed entry
311+
* Bit0: Disable CPU state save on D0i2 entry flow.
312+
* 0: Every D0i2 entry saves state. Save state IPC message ignored.
313+
* 1: IPC message required to save state on D0i3 entry flow.
314+
*/
315+
u32 d0i3_delayed_entry;
316+
/* Time spent by VPU in D0i3 state */
317+
u64 d0i3_residency_time_us;
318+
/* Value of VPU perf counter at the time of entering D0i3 state . */
319+
u64 d0i3_entry_vpu_ts;
320+
u32 pad4[20];
253321
/* Warm boot information: 0x400 - 0x43F */
254322
u32 warm_boot_sections_count;
255323
u32 warm_boot_start_address_reference;
@@ -274,8 +342,12 @@ struct vpu_boot_params {
274342
u32 vpu_scheduling_mode;
275343
/* Present call period in milliseconds. */
276344
u32 vpu_focus_present_timer_ms;
277-
/* Unused/reserved: 0x478 - 0xFFF */
278-
u32 pad6[738];
345+
/* VPU ECC Signaling */
346+
u32 vpu_uses_ecc_mca_signal;
347+
/* Values defined by VPU_OP_MODE* macros */
348+
u32 vpu_operation_mode;
349+
/* Unused/reserved: 0x480 - 0xFFF */
350+
u32 pad6[736];
279351
};
280352

281353
/*

0 commit comments

Comments
 (0)