Re: [PATCH 01/11] accel/ivpu: Update FW API

2023-10-30 Thread Jeffrey Hugo

On 10/28/2023 1:59 AM, Stanislaw Gruszka wrote:

Hi

On Fri, Oct 27, 2023 at 08:37:39AM -0600, Jeffrey Hugo wrote:

On 10/25/2023 3:43 AM, Stanislaw Gruszka wrote:

From: Krystian Pradzynski 

Bump boot API to 4.20
Bump JSM API to 3.15

Signed-off-by: Krystian Pradzynski 
Reviewed-by: Stanislaw Gruszka 
Signed-off-by: Stanislaw Gruszka 
---



   /*
@@ -89,6 +98,14 @@ enum VPU_BOOT_L2_CACHE_CFG_TYPE {
VPU_BOOT_L2_CACHE_CFG_NUM = 2
   };
+/** VPU MCA ECC signalling mode. By default, no signalling is used */


This does not look like valid kernel-doc.  Maybe you wanted "/*" instead?


+enum VPU_BOOT_MCA_ECC_SIGNAL_TYPE {
+   VPU_BOOT_MCA_ECC_NONE = 0,
+   VPU_BOOT_MCA_ECC_CORR = 1,
+   VPU_BOOT_MCA_ECC_FATAL = 2,
+   VPU_BOOT_MCA_ECC_BOTH = 3


Personal preference, but having the "=" and the interget values all line up
vetrically would make this a bit more plesant to look at.


This file came from FW and I'm reluctant to make any changes here, even
formatting. I'll ask if in the future we can get some improvements of
formatting done by scripts or if FW can change their files.


Fair enough.  I do remember you mentioning some of the headers coming 
from FW.


-Jeff


Re: [PATCH 01/11] accel/ivpu: Update FW API

2023-10-28 Thread Stanislaw Gruszka
Hi

On Fri, Oct 27, 2023 at 08:37:39AM -0600, Jeffrey Hugo wrote:
> On 10/25/2023 3:43 AM, Stanislaw Gruszka wrote:
> > From: Krystian Pradzynski 
> > 
> > Bump boot API to 4.20
> > Bump JSM API to 3.15
> > 
> > Signed-off-by: Krystian Pradzynski 
> > Reviewed-by: Stanislaw Gruszka 
> > Signed-off-by: Stanislaw Gruszka 
> > ---

> >   /*
> > @@ -89,6 +98,14 @@ enum VPU_BOOT_L2_CACHE_CFG_TYPE {
> > VPU_BOOT_L2_CACHE_CFG_NUM = 2
> >   };
> > +/** VPU MCA ECC signalling mode. By default, no signalling is used */
> 
> This does not look like valid kernel-doc.  Maybe you wanted "/*" instead?
> 
> > +enum VPU_BOOT_MCA_ECC_SIGNAL_TYPE {
> > +   VPU_BOOT_MCA_ECC_NONE = 0,
> > +   VPU_BOOT_MCA_ECC_CORR = 1,
> > +   VPU_BOOT_MCA_ECC_FATAL = 2,
> > +   VPU_BOOT_MCA_ECC_BOTH = 3
> 
> Personal preference, but having the "=" and the interget values all line up
> vetrically would make this a bit more plesant to look at.

This file came from FW and I'm reluctant to make any changes here, even
formatting. I'll ask if in the future we can get some improvements of
formatting done by scripts or if FW can change their files.

Regards
Stanislaw


Re: [PATCH 01/11] accel/ivpu: Update FW API

2023-10-27 Thread Jeffrey Hugo

On 10/25/2023 3:43 AM, Stanislaw Gruszka wrote:

From: Krystian Pradzynski 

Bump boot API to 4.20
Bump JSM API to 3.15

Signed-off-by: Krystian Pradzynski 
Reviewed-by: Stanislaw Gruszka 
Signed-off-by: Stanislaw Gruszka 
---
  drivers/accel/ivpu/ivpu_jsm_msg.c |  17 ++
  drivers/accel/ivpu/vpu_boot_api.h |  90 -
  drivers/accel/ivpu/vpu_jsm_api.h  | 309 --
  3 files changed, 392 insertions(+), 24 deletions(-)

diff --git a/drivers/accel/ivpu/ivpu_jsm_msg.c 
b/drivers/accel/ivpu/ivpu_jsm_msg.c
index 0c2fe7142024..35a689475c68 100644
--- a/drivers/accel/ivpu/ivpu_jsm_msg.c
+++ b/drivers/accel/ivpu/ivpu_jsm_msg.c
@@ -36,6 +36,17 @@ const char *ivpu_jsm_msg_type_to_str(enum vpu_ipc_msg_type 
type)
IVPU_CASE_TO_STR(VPU_JSM_MSG_DESTROY_CMD_QUEUE);
IVPU_CASE_TO_STR(VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES);
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_REGISTER_DB);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_CMDQ);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SUSPEND_CMDQ);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_CMDQ_RSP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SUSPEND_CMDQ_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SET_SCHEDULING_LOG);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SET_SCHEDULING_LOG_RSP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SCHEDULING_LOG_NOTIFICATION);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_ENGINE_RESUME);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_ENGINE_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_STATE_DUMP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_STATE_DUMP_RSP);
IVPU_CASE_TO_STR(VPU_JSM_MSG_BLOB_DEINIT);
IVPU_CASE_TO_STR(VPU_JSM_MSG_DYNDBG_CONTROL);
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)
IVPU_CASE_TO_STR(VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES_RSP);
IVPU_CASE_TO_STR(VPU_JSM_MSG_BLOB_DEINIT_DONE);
IVPU_CASE_TO_STR(VPU_JSM_MSG_DYNDBG_CONTROL_RSP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_PWR_D0I3_ENTER);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_PWR_D0I3_ENTER_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_ENABLE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_ENABLE_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_DISABLE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_DISABLE_DONE);
}
#undef IVPU_CASE_TO_STR
  
diff --git a/drivers/accel/ivpu/vpu_boot_api.h b/drivers/accel/ivpu/vpu_boot_api.h

index 6b71be92ba65..04c954258563 100644
--- a/drivers/accel/ivpu/vpu_boot_api.h
+++ b/drivers/accel/ivpu/vpu_boot_api.h
@@ -11,7 +11,10 @@
   *  The bellow values will be used to construct the version info this way:
   *  fw_bin_header->api_version[VPU_BOOT_API_VER_ID] = (VPU_BOOT_API_VER_MAJOR 
<< 16) |
   *  VPU_BOOT_API_VER_MINOR;
- *  VPU_BOOT_API_VER_PATCH will be ignored. KMD and compatibility is not 
affected if this changes.
+ *  VPU_BOOT_API_VER_PATCH will be ignored. KMD and compatibility is not 
affected if this changes
+ *  This information is collected by using 
vpuip_2/application/vpuFirmware/make_std_fw_image.py
+ *  If a header is missing this info we ignore the header, if a header is 
missing or contains
+ *  partial info a build error will be generated.
   */
  
  /*

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

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

   * Index in the API version table
@@ -63,6 +66,12 @@ struct vpu_firmware_header {
/* Size of memory require for firmware execution */
u32 runtime_size;
u32 shave_nn_fw_size;
+   /* Size of primary preemption buffer. */
+   u32 preemption_buffer_1_size;
+   /* Size of secondary preemption buffer. */
+   u32 preemption_buffer_2_size;
+   /* Space reserved for future preemption-related fields. */
+   u32 preemption_reserved[6];
  };
  
  /*

@@ -89,6 +98,14 @@ enum VPU_BOOT_L2_CACHE_CFG_TYPE {
VPU_BOOT_L2_CACHE_CFG_NUM = 2
  };
  
+/** VPU MCA ECC signalling mode. By default, no signalling is used */


This does not look like valid kernel-doc.  Maybe you wanted "/*" instead?


+enum VPU_BOOT_MCA_ECC_SIGNAL_TYPE {
+   VPU_BOOT_MCA_ECC_NONE = 0,
+   VPU_BOOT_MCA_ECC_CORR = 1,
+   VPU_BOOT_MCA_ECC_FATAL = 2,
+   VPU_BOOT_MCA_ECC_BOTH = 3


Personal preference, but having the "=" and the interget values all line 
up vetrically would make this a bit more plesant to look at.



+};
+
  /**
   * Logging destinations.
   *
@@ -131,9 +148,11 @@ enum vpu_trace_destination {
  #define VPU_TRACE_PROC_BIT_ACT_SHV_3 22
  #define VPU_TRACE_PROC_NO_OF_HW_DEVS 23
  
-/* KMB HW component IDs are sequential, so define first and last IDs. */

-#define 

[PATCH 01/11] accel/ivpu: Update FW API

2023-10-25 Thread Stanislaw Gruszka
From: Krystian Pradzynski 

Bump boot API to 4.20
Bump JSM API to 3.15

Signed-off-by: Krystian Pradzynski 
Reviewed-by: Stanislaw Gruszka 
Signed-off-by: Stanislaw Gruszka 
---
 drivers/accel/ivpu/ivpu_jsm_msg.c |  17 ++
 drivers/accel/ivpu/vpu_boot_api.h |  90 -
 drivers/accel/ivpu/vpu_jsm_api.h  | 309 --
 3 files changed, 392 insertions(+), 24 deletions(-)

diff --git a/drivers/accel/ivpu/ivpu_jsm_msg.c 
b/drivers/accel/ivpu/ivpu_jsm_msg.c
index 0c2fe7142024..35a689475c68 100644
--- a/drivers/accel/ivpu/ivpu_jsm_msg.c
+++ b/drivers/accel/ivpu/ivpu_jsm_msg.c
@@ -36,6 +36,17 @@ const char *ivpu_jsm_msg_type_to_str(enum vpu_ipc_msg_type 
type)
IVPU_CASE_TO_STR(VPU_JSM_MSG_DESTROY_CMD_QUEUE);
IVPU_CASE_TO_STR(VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES);
IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_REGISTER_DB);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_CMDQ);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SUSPEND_CMDQ);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_CMDQ_RSP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SUSPEND_CMDQ_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SET_SCHEDULING_LOG);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SET_SCHEDULING_LOG_RSP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_SCHEDULING_LOG_NOTIFICATION);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_ENGINE_RESUME);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_HWS_RESUME_ENGINE_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_STATE_DUMP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_STATE_DUMP_RSP);
IVPU_CASE_TO_STR(VPU_JSM_MSG_BLOB_DEINIT);
IVPU_CASE_TO_STR(VPU_JSM_MSG_DYNDBG_CONTROL);
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)
IVPU_CASE_TO_STR(VPU_JSM_MSG_SET_CONTEXT_SCHED_PROPERTIES_RSP);
IVPU_CASE_TO_STR(VPU_JSM_MSG_BLOB_DEINIT_DONE);
IVPU_CASE_TO_STR(VPU_JSM_MSG_DYNDBG_CONTROL_RSP);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_PWR_D0I3_ENTER);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_PWR_D0I3_ENTER_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_ENABLE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_ENABLE_DONE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_DISABLE);
+   IVPU_CASE_TO_STR(VPU_JSM_MSG_DCT_DISABLE_DONE);
}
#undef IVPU_CASE_TO_STR
 
diff --git a/drivers/accel/ivpu/vpu_boot_api.h 
b/drivers/accel/ivpu/vpu_boot_api.h
index 6b71be92ba65..04c954258563 100644
--- a/drivers/accel/ivpu/vpu_boot_api.h
+++ b/drivers/accel/ivpu/vpu_boot_api.h
@@ -11,7 +11,10 @@
  *  The bellow values will be used to construct the version info this way:
  *  fw_bin_header->api_version[VPU_BOOT_API_VER_ID] = (VPU_BOOT_API_VER_MAJOR 
<< 16) |
  *  VPU_BOOT_API_VER_MINOR;
- *  VPU_BOOT_API_VER_PATCH will be ignored. KMD and compatibility is not 
affected if this changes.
+ *  VPU_BOOT_API_VER_PATCH will be ignored. KMD and compatibility is not 
affected if this changes
+ *  This information is collected by using 
vpuip_2/application/vpuFirmware/make_std_fw_image.py
+ *  If a header is missing this info we ignore the header, if a header is 
missing or contains
+ *  partial info a build error will be generated.
  */
 
 /*
@@ -24,12 +27,12 @@
  * Minor version changes when API backward compatibility is preserved.
  * Resets to 0 if Major version is incremented.
  */
-#define VPU_BOOT_API_VER_MINOR 12
+#define VPU_BOOT_API_VER_MINOR 20
 
 /*
  * API header changed (field names, documentation, formatting) but API itself 
has not been changed
  */
-#define VPU_BOOT_API_VER_PATCH 2
+#define VPU_BOOT_API_VER_PATCH 4
 
 /*
  * Index in the API version table
@@ -63,6 +66,12 @@ struct vpu_firmware_header {
/* Size of memory require for firmware execution */
u32 runtime_size;
u32 shave_nn_fw_size;
+   /* Size of primary preemption buffer. */
+   u32 preemption_buffer_1_size;
+   /* Size of secondary preemption buffer. */
+   u32 preemption_buffer_2_size;
+   /* Space reserved for future preemption-related fields. */
+   u32 preemption_reserved[6];
 };
 
 /*
@@ -89,6 +98,14 @@ enum VPU_BOOT_L2_CACHE_CFG_TYPE {
VPU_BOOT_L2_CACHE_CFG_NUM = 2
 };
 
+/** VPU MCA ECC signalling mode. By default, no signalling is used */
+enum VPU_BOOT_MCA_ECC_SIGNAL_TYPE {
+   VPU_BOOT_MCA_ECC_NONE = 0,
+   VPU_BOOT_MCA_ECC_CORR = 1,
+   VPU_BOOT_MCA_ECC_FATAL = 2,
+   VPU_BOOT_MCA_ECC_BOTH = 3
+};
+
 /**
  * Logging destinations.
  *
@@ -131,9 +148,11 @@ enum vpu_trace_destination {
 #define VPU_TRACE_PROC_BIT_ACT_SHV_3 22
 #define VPU_TRACE_PROC_NO_OF_HW_DEVS 23
 
-/* KMB HW component IDs are sequential, so define first and last IDs. */
-#define VPU_TRACE_PROC_BIT_KMB_FIRST VPU_TRACE_PROC_BIT_LRT
-#define VPU_TRACE_PROC_BIT_KMB_LAST  VPU_TRACE_PROC_BIT_SHV_15
+/* VPU 30xx HW component IDs are sequential, so define first and last IDs. */
+#define VPU_TRACE_PROC_BIT_30XX_FIRST VPU_TRACE_PROC_BIT_LRT
+#define VPU_TRACE_PROC_BIT_30XX_LAST