@@ -45,7 +45,8 @@ acl_process_autorun_profiler_scan_chain(unsigned int physical_device_id,
45
45
// address map.
46
46
#define CSR_VERSION_ID_18_1 (3 )
47
47
#define CSR_VERSION_ID_19_1 (4 )
48
- #define CSR_VERSION_ID CSR_VERSION_ID_19_1
48
+ #define CSR_VERSION_ID_23_1 (5 )
49
+ #define CSR_VERSION_ID CSR_VERSION_ID_23_1
49
50
50
51
// Address map
51
52
// For unit tests to work, these defines must match those in the unit test
@@ -67,19 +68,21 @@ acl_process_autorun_profiler_scan_chain(unsigned int physical_device_id,
67
68
68
69
// Byte offsets into the CRA:
69
70
#define KERNEL_OFFSET_CSR 0
70
- #define KERNEL_OFFSET_PRINTF_BUFFER_SIZE 0x4
71
- #define KERNEL_OFFSET_CSR_PROFILE_CTRL 0xC
72
- #define KERNEL_OFFSET_CSR_PROFILE_DATA 0x10
73
- #define KERNEL_OFFSET_CSR_PROFILE_START_CYCLE 0x18
74
- #define KERNEL_OFFSET_CSR_PROFILE_STOP_CYCLE 0x20
75
- #define KERNEL_OFFSET_FINISH_COUNTER 0x28
76
- #define KERNEL_OFFSET_INVOCATION_IMAGE 0x30
71
+ #define KERNEL_OFFSET_BUSY_NULL 0x4 // 4
72
+ #define KERNEL_OFFSET_START_REG 0x8 // 8
73
+ #define KERNEL_OFFSET_PRINTF_BUFFER_SIZE 0xC // 12
74
+ #define KERNEL_OFFSET_CSR_PROFILE_CTRL 0x14 // 20
75
+ #define KERNEL_OFFSET_CSR_PROFILE_DATA 0x18 // 24
76
+ #define KERNEL_OFFSET_CSR_PROFILE_START_CYCLE 0x20 // 32
77
+ #define KERNEL_OFFSET_CSR_PROFILE_STOP_CYCLE 0x28 // 40
78
+ #define KERNEL_OFFSET_FINISH_COUNTER 0x30 // 48
79
+ #define KERNEL_OFFSET_INVOCATION_IMAGE 0x38 // 56
77
80
78
81
// Backwards compatibility with CSR_VERSION_ID 3
79
82
#define KERNEL_OFFSET_INVOCATION_IMAGE_181 0x28
80
83
81
84
// Bit positions
82
- #define KERNEL_CSR_GO 0
85
+ #define KERNEL_CSR_START 0
83
86
#define KERNEL_CSR_DONE 1
84
87
#define KERNEL_CSR_STALLED 3
85
88
#define KERNEL_CSR_UNSTALL 4
@@ -1279,11 +1282,15 @@ void acl_kernel_if_launch_kernel_on_custom_sof(
1279
1282
return ;
1280
1283
}
1281
1284
1282
- unsigned int new_csr = 0 ;
1283
- acl_kernel_cra_read (kern, accel_id, KERNEL_OFFSET_CSR, &new_csr);
1284
- ACL_KERNEL_SET_BIT (new_csr, KERNEL_CSR_GO);
1285
- acl_kernel_cra_write (kern, accel_id, KERNEL_OFFSET_CSR, new_csr);
1286
-
1285
+ // backwards compatibility for version prior to 2023.1
1286
+ if (kern->csr_version < CSR_VERSION_ID) {
1287
+ unsigned int new_csr = 0 ;
1288
+ acl_kernel_cra_read (kern, accel_id, KERNEL_OFFSET_CSR, &new_csr);
1289
+ ACL_KERNEL_SET_BIT (new_csr, KERNEL_CSR_START);
1290
+ acl_kernel_cra_write (kern, accel_id, KERNEL_OFFSET_CSR, new_csr);
1291
+ } else {
1292
+ acl_kernel_cra_write (kern, accel_id, KERNEL_OFFSET_START_REG, 1 );
1293
+ }
1287
1294
// IRQ handler takes care of the completion event through
1288
1295
// acl_kernel_if_update_status()
1289
1296
}
0 commit comments