Repository navigation
base_fw: update mem_state_info TLV - #8871
Conversation
| #define SHIM_HSPGCTL(x) (L2HSBPM(x) + 0x0000) | ||
|
|
||
| #define LSPGCTL 0x71D80 | ||
| #define LSPGCTL0 0x71D80 |
There was a problem hiding this comment.
@dnikodem can we read this from Zephyr headers today ?
There was a problem hiding this comment.
@dnikodem sorry I mean we should use the Zephyr header for these HW specific macros (and not use any duplicated values from the SOF directory which is deprecated).
There was a problem hiding this comment.
ok, I will update this PR, thanks.
|
Added zephyrproject-rtos/zephyr#70221 - this is the first step to clean up SOF headers. |
| #endif | ||
| } | ||
| tuple_data[index++] = info.page_alloc_struct.page_alloc_count; | ||
| ptr = (uint16_t *)(tuple_data + index); |
There was a problem hiding this comment.
this of course changes the behaviour significantly. Before this commit index was incremented twice in lines 226 and 228, now it isn't any more. Is this intended? Was that a bug?
There was a problem hiding this comment.
The tuple_data should contain the correct number of LPSRAM PGCTL register values (in the same way as it is done for HPSRAM). In the previous solution, if the number of ebb_state_dword_count equaled 0, a dword was added in tuple_data with the PGCTL status value for a non-existing/not used LPSRAM bank.
Therefore, the parser that is using data from tuple_data should not expect an "extra" LSPGCTL status value in the tuple_data, and then it could misinterpret it as some other type of data or status.
There was a problem hiding this comment.
@dnikodem right, but if ebb_state_dword_count != 0? Then you'd add several register values into tuple_data without incrementing index, so after the loop you'd overwrite the first of those values... I think you actually wanted to do
for (i = 0; i < info.ebb_state_dword_count; i++) {
#ifdef INTEL_ADSP
tuple_data[index++] = LPSRAM_REGS(i)->USxPGCTL;
#else
tuple_data[index++] = 0;
#endif
}
if (info.ebb_state_dword_count)
tuple_data[index++] = info.page_alloc_struct.page_alloc_count;
a2f6588 to
749e8a4
Compare
| #endif | ||
| } | ||
| tuple_data[index++] = info.page_alloc_struct.page_alloc_count; | ||
| ptr = (uint16_t *)(tuple_data + index); |
There was a problem hiding this comment.
@dnikodem right, but if ebb_state_dword_count != 0? Then you'd add several register values into tuple_data without incrementing index, so after the loop you'd overwrite the first of those values... I think you actually wanted to do
for (i = 0; i < info.ebb_state_dword_count; i++) {
#ifdef INTEL_ADSP
tuple_data[index++] = LPSRAM_REGS(i)->USxPGCTL;
#else
tuple_data[index++] = 0;
#endif
}
if (info.ebb_state_dword_count)
tuple_data[index++] = info.page_alloc_struct.page_alloc_count;
749e8a4 to
72de4c0
Compare
correct, we need firstly zephyr part merged. |
72de4c0 to
2a9a70c
Compare
oh, yeah - this one was blocked on Zephyr PR merging (now merged). @dnikodem do we need a west update ? I think @kv2019i did a west update a few days ago so we may be good just to rebase this ? |
|
Yes, the west was updated by Kai and points on correct commit. Here is needed to rebase / resolve conflict with base_fw_platform.c file. I will do this today. |
2a9a70c to
e1c8e7d
Compare
lgirdwood
left a comment
There was a problem hiding this comment.
Just one question on ifdefs, but otherwise LGTM.
kv2019i
left a comment
There was a problem hiding this comment.
Thanks @dnikodem , this is a welcome update. Code looks good, but I think you can go a bit further and drop the ifdefs as this code is now only compiled for Intel targets that have enabled the IPC4 basefw Intel extensions (so should cover all platforms now covered by INTEL_ADSP ifdef guard).
| tuple_data[index++] = info.ebb_state_dword_count; | ||
| tuple_data[index++] = io_reg_read(LSPGCTL); | ||
| for (i = 0; i < info.ebb_state_dword_count; i++) { | ||
| #ifdef INTEL_ADSP |
This commit refactors the memory power management register access to use the HPSRAM_REGS and LPSRAM_REGS macros instead of direct io_reg_read calls. Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
e1c8e7d to
7d2af0d
Compare
kv2019i
left a comment
There was a problem hiding this comment.
Thanks, looks good now!
lgirdwood
left a comment
There was a problem hiding this comment.
Nice to remove all the old macros :)
This change improves the TLV assembly algorithm in accordance with how the part for hpsram is assembled. In the case when ebb_state_dword_count is equal to 0, we skip adding the LSPGCTL register value for lpsram.
The following PR must be merged into the Zephyr repository before we can merge this PR: