Skip to content

IMR restore feature implementation - #4320

Merged
lgirdwood merged 5 commits into
thesofproject:mainfrom
keyonjie:imr_restore
Jun 16, 2021
Merged

lgirdwood merged 5 commits into
thesofproject:mainfrom
keyonjie:imr_restore

Conversation

@keyonjie

@keyonjie keyonjie commented Jun 9, 2021

Copy link
Copy Markdown
Contributor

This series will implement the IMR restoring feature from the FW side.

We still need the host Linux driver side change to enable this feature, but the implementation here is backward compatible.

Next:
add information to FW_READY message to inform host if IMR restore feature is supported, then the Linux driver can decide to enable it or not.

@keyonjie keyonjie changed the title Imr restore feature implementation IMR restore feature implementation Jun 9, 2021
@keyonjie

keyonjie commented Jun 9, 2021

Copy link
Copy Markdown
Contributor Author

mark it as draft and I will fix test_bench issue later.

@keyonjie
keyonjie marked this pull request as draft June 9, 2021 09:51
@keyonjie keyonjie changed the title IMR restore feature implementation [RFC] IMR restore feature implementation Jun 9, 2021

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's missing a function. Lets also use the SOF cache APIs (so its easier to move to Zephyr).
@andyross fyi - once this is working we will need to copy to Zephyr.

Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
@keyonjie
keyonjie force-pushed the imr_restore branch 2 times, most recently from 9d78545 to 6fa9019 Compare June 10, 2021 08:32
@keyonjie
keyonjie marked this pull request as ready for review June 10, 2021 09:17
@keyonjie
keyonjie requested a review from a team as a code owner June 10, 2021 09:17
@keyonjie keyonjie changed the title [RFC] IMR restore feature implementation IMR restore feature implementation Jun 10, 2021
@keyonjie
keyonjie requested a review from lgirdwood June 10, 2021 09:17
@keyonjie

Copy link
Copy Markdown
Contributor Author

The corresponding Linux PR here: thesofproject/linux#2989, though it is backward compatible so the 2 PRs can be merged separately.

@keyonjie

keyonjie commented Jun 10, 2021 •

Copy link
Copy Markdown
Contributor Author

This simply series implement the IMR restoring feature from the FW side.

It is verified on cAVS platforms.

After switching to IMR restoring, the resuming boot time is decreased significantly:

@lgirdwood lgirdwood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost good to merge. Good work !

Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/ipc/ipc3/handler.c Resolved
Comment thread src/include/ipc/info.h Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/include/sof/debug/debug.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the host decide what happens, is there a way for the host to tell the DSP to skip the status save in IMR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the host decide what happens, is there a way for the host to tell the DSP to skip the status save in IMR?

Just keep today's flow on the host side, the sending of the FW_PURGE IPC will make the DSP to skip it.

Comment thread src/include/ipc/info.h Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/platform/intel/cavs/platform.c Resolved
Comment thread src/include/ipc/info.h Resolved

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obligatory ABI process note. If everybody agreed, we can make an exception, but I want to ensure we make an explicit choice about it.

Comment thread src/include/ipc/info.h Resolved
keyonjie added 5 commits June 15, 2021 16:46
Add a platform_context_save() routine to all platforms, which can be used
to perform any platform specific stuff during suspending the DSPs.

Initialize all these routines to be do nothing.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Use the unified macro IMR_BOOT_LDR_TEXT_ENTRY_BASE for the boot loader
text entry.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
To enable the feature that resuming from IMR, we need to configure IMR
layout with correct magic number and IMR restore vector, in the
platform_context_save() routine.

This is harmless even the driver want to re-downloading FW at resuming
stage, sending the FW_PURGE IPC from the host side will ask the ROM code
to omit these IMR restoring stuff.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Invoke platform_context_save() routine to perform platform specific
suspending stuff, before handling the CTX_SAVE IPC.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
Add flag SOF_IPC_INFO_D3_PERSISTENT to inform host driver if the IMR
restore feature is supported to the fw_ready message, then the host
driver can decide whether to choose it or not.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
@keyonjie

Copy link
Copy Markdown
Contributor Author

@lgirdwood @kv2019i @plbossart flag naming updated, ABI minor version bumped, please help to review.

Comment thread src/platform/intel/cavs/platform.c Resolved
@lgirdwood

Copy link
Copy Markdown
Member

Obligatory ABI process note. If everybody agreed, we can make an exception, but I want to ensure we make an explicit choice about it.

This is worth a discussion at next TSC. We are not changing the structure or the usage of the structure members, but are adding a value/bit (could also apply to enum) to an existing "flags" member. Anyway I've added to ABI.

@lgirdwood lgirdwood added the ABI ABI change involved label Jun 15, 2021
@lgirdwood lgirdwood added this to the ABI-3.19 milestone Jun 15, 2021
@lgirdwood

Copy link
Copy Markdown
Member

@keyonjie can you link kernel PR in here too.

@keyonjie

Copy link
Copy Markdown
Contributor Author

@keyonjie can you link kernel PR in here too.

sure, as mentioned above, the corresponding Linux PR here: thesofproject/linux#2989.

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now!

@lgirdwood
lgirdwood merged commit f79bbb2 into thesofproject:main Jun 16, 2021
@plbossart

Copy link
Copy Markdown
Member

@lgirdwood this PR does not work as is with the matching PR thesofproject/linux#2989

We may have to revert and retest separately. Testing at the firmware level only did not show any problems, the change of flows only happens when the kernel decides to not reboot the DSP.

We need to be more careful for stuff like this, e.g. by asking for a dedicated test with the two changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ABI ABI change involved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants