@@ -43,8 +43,10 @@ acl_process_autorun_profiler_scan_chain(unsigned int physical_device_id,
43
43
// Version number in the top 16-bits of the 32-bit status register. Used
44
44
// to verify that the hardware and HAL have an identical view of the CSR
45
45
// address map.
46
- #define CSR_VERSION_ID_181 (3 )
47
- #define CSR_VERSION_ID (4 )
46
+ #define CSR_VERSION_ID_18_1 (3 )
47
+ #define CSR_VERSION_ID_19_1 (4 )
48
+ #define CSR_VERSION_ID_2022_3 (5 )
49
+ #define CSR_VERSION_ID CSR_VERSION_ID_2022_3
48
50
49
51
// Address map
50
52
// For unit tests to work, these defines must match those in the unit test
@@ -1137,8 +1139,8 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1137
1139
// Version is defined in upper 16-bits of the status register and cached
1138
1140
// in the kern->csr_version field. The value is cached after PLL init to
1139
1141
// avoid reading back on every kernel launch, which would add overhead.
1140
- if (kern->csr_version != CSR_VERSION_ID &&
1141
- kern->csr_version != CSR_VERSION_ID_181 ) {
1142
+ if (!( kern->csr_version >= CSR_VERSION_ID_18_1 &&
1143
+ kern->csr_version <= CSR_VERSION_ID) ) {
1142
1144
kern->io .printf (" Hardware CSR version ID differs from version expected by "
1143
1145
" software. Either:\n " );
1144
1146
kern->io .printf (" a) Ensure your compiled design was generated by the "
@@ -1185,7 +1187,7 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1185
1187
size_t image_size_static;
1186
1188
unsigned int offset;
1187
1189
acl_dev_kernel_invocation_image_181_t image_181;
1188
- if (kern->csr_version == CSR_VERSION_ID_181 ) {
1190
+ if (kern->csr_version == CSR_VERSION_ID_18_1 ) {
1189
1191
offset = (unsigned int )KERNEL_OFFSET_INVOCATION_IMAGE_181;
1190
1192
image_p = (uintptr_t )&image_181;
1191
1193
image_size_static =
@@ -1224,7 +1226,7 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1224
1226
(void *)(offset + p), pword);
1225
1227
}
1226
1228
1227
- if (kern->csr_version != CSR_VERSION_ID_181 ) {
1229
+ if (kern->csr_version != CSR_VERSION_ID_18_1 ) {
1228
1230
for (uintptr_t p = 0 ; p < image->arg_value_size ; p += sizeof (int )) {
1229
1231
unsigned int pword = *(unsigned int *)(image->arg_value + p);
1230
1232
ACL_KERNEL_IF_DEBUG_MSG_VERBOSE (
@@ -1238,7 +1240,7 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1238
1240
// it is in dynamic memory
1239
1241
acl_kernel_cra_write_block (kern, accel_id, offset, (unsigned int *)image_p,
1240
1242
image_size_static);
1241
- if (kern->csr_version != CSR_VERSION_ID_181 ) {
1243
+ if (kern->csr_version != CSR_VERSION_ID_18_1 ) {
1242
1244
acl_kernel_cra_write_block (
1243
1245
kern, accel_id, offset + (unsigned int )image_size_static,
1244
1246
(unsigned int *)image->arg_value , image->arg_value_size );
@@ -1439,7 +1441,7 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1439
1441
1440
1442
kern->last_kern_update = acl_kernel_if_get_time_us (kern);
1441
1443
1442
- if (kern->csr_version == CSR_VERSION_ID_181 ) {
1444
+ if (kern->csr_version == CSR_VERSION_ID_18_1 ) {
1443
1445
// Only expect single completion for older csr version
1444
1446
finish_counter = 1 ;
1445
1447
} else {
@@ -1470,8 +1472,10 @@ void acl_kernel_if_update_status(acl_kernel_if *kern) {
1470
1472
1471
1473
// Just clear the "done" bit. The "go" bit should already have been
1472
1474
// cleared, but this is harmless anyway.
1473
- // Since csr version 19, done bit is cleared when finish counter is read
1474
- if (kern->csr_version == CSR_VERSION_ID_181) {
1475
+ // Since csr version 19, done bit is cleared when finish counter is read.
1476
+ // Since csr version 2022.3, done bit needs to be cleared explicitly.
1477
+ if (kern->csr_version == CSR_VERSION_ID_18_1 ||
1478
+ kern->csr_version >= CSR_VERSION_ID_2022_3) {
1475
1479
unsigned int dum;
1476
1480
acl_kernel_cra_write (kern, k, KERNEL_OFFSET_CSR, 0 );
1477
1481
acl_kernel_cra_read (kern, k, KERNEL_OFFSET_CSR, &dum);
0 commit comments