Skip to content

Conversation

@RanderWang
Copy link
Collaborator

The module id of basefw is zero. Driver get & set global
states by this id, such as platform info, memory inf, hw
info, power info.

This patch add limited support of features in basefw module.

Signed-off-by: Rander Wang rander.wang@intel.com

Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity, what is basefw? Can you add some details in the commit message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure. There are three types of elf binary in SOF: boot_loader, basefw (built from all sof entities selected in kconfig) and external libraries (developed by 3rd party, may be close source). Rimage packs boot_loader and basefw into sof-xxx.ri

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

ABI needs packed and aligned. Open on the data whether it's manifest or not ?

Copy link
Member

Choose a reason for hiding this comment

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

Is this part of the extended manifest ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no, it is part of base fw.

Copy link
Collaborator Author

@RanderWang RanderWang Sep 28, 2021

Choose a reason for hiding this comment

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

the comments for IPC4_MEMORY_RECLAIMED_FW_CFG is "Indicates whether legacy DMA memory is managed by FW". A little confusing. In my opinion, the legacy DMA should be GPDMA on BDW and BYT to transfer data between host and dsp.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also checked other items and manifest. these items are not included by manifest.

Copy link
Member

Choose a reason for hiding this comment

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

ok, so it's sent to host upon boot ? This is probably not a good use of memory, but this can be optimised via ipc tuples later on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, host query these values upon boot. Some items are read from hw registers, so we can't set them in manifest. We can store these tuples in dynamic memory and free it when get function return since get function is a low-frequency case.

Copy link
Member

Choose a reason for hiding this comment

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

ok, this should be in short term.

@lgirdwood lgirdwood added the ABI ABI change involved label Sep 27, 2021
@RanderWang RanderWang changed the title ipc4: add basefw component support ipc4: add get &set large config support Sep 28, 2021
Copy link
Member

Choose a reason for hiding this comment

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

ok, so it's sent to host upon boot ? This is probably not a good use of memory, but this can be optimised via ipc tuples later on.

@RanderWang RanderWang force-pushed the basefw_ipc4 branch 4 times, most recently from 672ff94 to e7dcaf8 Compare September 30, 2021 06:02
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

All the IPC ABI structs need to be packed and aligned of 4 bytes.

@RanderWang
Copy link
Collaborator Author

thanks, updated

Copy link
Member

Choose a reason for hiding this comment

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

bitfields in IPC definition, who thought that was a good idea? Not portable!

Copy link
Member

Choose a reason for hiding this comment

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

agree, however we have already stated this is not portable. We can address this with ipc-tuples in the future.

@RanderWang RanderWang force-pushed the basefw_ipc4 branch 2 times, most recently from 4faab3c to e71e88e Compare October 12, 2021 07:04
The module id of basefw is zero. Driver get & set global
states by this id, such as platform info, memory inf, hw
info, power info.

There are three types of elf binary built by SOF: boot_loader,
basefw which is built from all sof entities selected in kconfig
and external libraries developed by 3rd party and may be close-source.
Rimage packs boot_loader and basefw into sof-xxx.ri.

This patch adds limited support of features in basefw module and more
features will be added in future.

Signed-off-by: Rander Wang <rander.wang@intel.com>
@RanderWang
Copy link
Collaborator Author

updated, thanks!

Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

I think we just need that comments for the error flow and a statement about the portability of the bitfields (if not already in the header)

@RanderWang
Copy link
Collaborator Author

updated, thanks!

Get_large_config is used for driver to query module information
and set_large_config is used to change module config dynamically

Signed-off-by: Rander Wang <rander.wang@intel.com>
Ipc4 checks manifest in fw binary, so it needs to
use header files in rimage

Signed-off-by: Rander Wang <rander.wang@intel.com>
@lgirdwood
Copy link
Member

BYT test looks like script failure, but unrelated to this PR.

@lgirdwood lgirdwood merged commit cbf5aa6 into thesofproject:main Oct 14, 2021

/* skip basefw of module 0 in manifest */
mod = (struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(module_id));
mod = (struct sof_man_module *)((char *)desc + SOF_MAN_MODULE_OFFSET(entry_index));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will IPC4 ever be used with Zephyr? Zephyr CI does not have rimage right now.

Should these definitions be copied to src/platform/intel/cavs/include/cavs/ext_manifest.h ?

Will the kernel too? Are they part of the IPC?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IPC4 is not used by Zephyr currently. They are part of manifest in FW image in memory, not ext manifest.

Copy link
Collaborator

@marc-hb marc-hb Oct 15, 2021

Choose a reason for hiding this comment

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

Thanks @ranj063 for answering my question offline. IPC4 will be the default for some future platforms Zephyr or not. Zephyr has no effect on that decision / timeline. This means SOF will have a harder dependency on rimage than now and it will have to be mirrored by Zephyr. Right now only the main SOF ELF file does not depend on it, only the boot_module and base_module builds depend on rimage.

If rimage becomes a harder SOF dependency then it means sof/src/include/kernel/ext_manifest.h can probably be deleted at that time?

cc: @dbaluta

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.

5 participants