-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SKIP SOF-TEST] native loadable up-down-mixer take 2 #8210
[SKIP SOF-TEST] native loadable up-down-mixer take 2 #8210
Conversation
@@ -463,6 +495,3 @@ static struct module_interface up_down_mixer_interface = { | |||
.reset = up_down_mixer_reset, | |||
.free = up_down_mixer_free | |||
}; | |||
|
|||
DECLARE_MODULE_ADAPTER(up_down_mixer_interface, up_down_mixer_comp_uuid, up_down_mixer_comp_tr); | |||
SOF_MODULE_INIT(up_down_mixer, sys_comp_module_up_down_mixer_interface_init); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to have ability to use module in 2 ways - as a loadable OR as a built-in
It may be a kConfig option
quick suggestion (may be incorrect syntax, just a rough example):
choice
prompt "up down mixer module"
config NO_UP_DOWN_MIXER
bool "up down mixer not available"
config BUILT_IN_UP_DOWN_MIXER
bool "up down mixer as a bullt in module"
config LOADABLE_IN_UP_DOWN_MIXER
bool "up down mixer as a loadable module"
endchoice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux Kconfig uses a tristate variable for modules
y
= builtin
n
= not built
m
= module
We shoudl do the same to simplify our Kconfigs.
zephyr/CMakeLists.txt
Outdated
@@ -497,30 +512,6 @@ zephyr_library_sources_ifdef(CONFIG_SAMPLE_KEYPHRASE | |||
${SOF_SAMPLES_PATH}/audio/detect_test.c | |||
) | |||
|
|||
if(CONFIG_IPC_MAJOR_3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conversion of a specific module to loadable should be in separate commit than the loadable module infrastructure
.affinity_mask = 1, | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DITTO
* \brief Type definition of the package entry point. | ||
* \note internal purpose. | ||
*/ | ||
typedef int (ModulePackageEntryPoint)(uint32_t costam); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
english please ;)
DEFINE_MODULE_PACKAGE_ENTRY_POINT(MODULE) | ||
|
||
/* | ||
* #define DECLARE_LOADABLE_MODULE(MODULE, MODULE_FACTORY) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why commeted out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
during development we decided to drop that header file.
struct sof_module_api_build_info udm_build_info __attribute__((section(".buildinfo"))) = { | ||
ADSP_BUILD_INFO_FORMAT, | ||
{ | ||
((0x3FF & 5) << 20) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prepare a macro for those shifts
zephyr/CMakeLists.txt
Outdated
# Create Trace realtive file paths | ||
sof_append_relative_path_definitions(modules_sof) | ||
|
||
|
||
# Compile up_down_mixer as loadable module | ||
sof_loadable_library(udm ${SOF_AUDIO_PATH}/up_down_mixer/up_down_mixer.toml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more meaningful name (updwmix) instead of udm
} | ||
}; | ||
|
||
extern struct module_interface up_down_mixer_interface; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this forward really needed? Maybe move declaration of sof_module_api_build_info to the end of the file?
.type = { .load_type = SOF_MAN_MOD_TYPE_MODULE, | ||
.domain_ll = 1 }, | ||
.affinity_mask = 1, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
@@ -8,7 +8,8 @@ | |||
#ifndef _LOADABLE_PROCESSING_MODULE_H_ | |||
#define _LOADABLE_PROCESSING_MODULE_H_ | |||
|
|||
#include <sof/audio/module_adapter/iadk/adsp_stddef.h> | |||
#include <sof/audio/module_adapter/iadk/adsp_stddef.h> | |||
#include <sof/audio/module_adapter/library/module_api_ver.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't look right. You haven't changed anything in the header, so there's no reason why it now need that additional header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks but I'm pretty sure the plan for /lib/firmare/intel/sof/
is to use --use-platform-subdir
like this:
sof/scripts/xtensa-build-zephyr.py --use-platform-subdir mtl
build-sof-staging
|-- sof
| +-- mtl
| |-- community
| | +-- sof-mtl.ri sha256=401e8360bd1a...
| |-- sof-mtl.ldc sha256=516ad1320ec8...
| |-- loadable_module1.ri
| |-- loadable_module2.ri
| +-- loadable_module3.ri
EDIT: maybe --use-platform-subdir
should be ON by default?
The 'base fw' and loadable modules can be signed with different keys, so we absolutely do not want them to land in the same directory - the loadable modules MUST be in a key-specific directory. |
@plbossart you're referring to I was talking about They're not mutually exclusive. In any case we need a tiny bit of plain english documentation to be reviewed and approved first, we don't want people to have to search and read python or kernel code[*] to try and fail to guess the This can be as simple as 1-2 pages with the output of a sample "tree" command with a few plain English words around it. Let's stop making the same mistake over and over again:
[*] from @plbossart https://github.com/thesofproject/linux/blob/topic/sof-dev/sound/soc/sof/intel/pci-mtl.c#L39 |
I appreciate your engagement but this is still a draft. |
Thank you @kv2019i ! So according to that sof-docs PR, the path for loadable modules is: |
/*! | ||
* \def STR(s) | ||
* intermediate macro for Stringification | ||
* \note internal purpose only. Consider to use XSTR(s) for Stringification. | ||
*/ | ||
#define STR(s) #s | ||
/*! | ||
* \def XSTR(s) | ||
* Stringification macro | ||
*/ | ||
#define XSTR(s) STR(s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to be careful here as I would imagine these common macros should come from Zephyr.
* \note internal purpose. | ||
*/ | ||
#define DEFINE_MODULE_PACKAGE_ENTRY_POINT(MODULE) \ | ||
volatile sof_module_api_build_info MODULE_PACKAGE_ENTRY_BUILD_INFO_NAME(MODULE) BUILD_INFO_SECTION = \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this need to be volatile ?
@@ -0,0 +1,86 @@ | |||
version = [3, 0] | |||
|
|||
[adsp] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw, @aiChaoSONG is looking at having an #include <platform.toml>
for all the non module stuff. This will help simplify
@@ -463,6 +495,3 @@ static struct module_interface up_down_mixer_interface = { | |||
.reset = up_down_mixer_reset, | |||
.free = up_down_mixer_free | |||
}; | |||
|
|||
DECLARE_MODULE_ADAPTER(up_down_mixer_interface, up_down_mixer_comp_uuid, up_down_mixer_comp_tr); | |||
SOF_MODULE_INIT(up_down_mixer, sys_comp_module_up_down_mixer_interface_init); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux Kconfig uses a tristate variable for modules
y
= builtin
n
= not built
m
= module
We shoudl do the same to simplify our Kconfigs.
Added toml file to enable building up down mixer as loadable module. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Updated zephyr revision to the top of 006 branch Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
updated zephyr to mtl-006 updated rimage to mtl-006
c662f6d
to
58c0bdf
Compare
58c0bdf
to
223cb55
Compare
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
223cb55
to
69925ce
Compare
This is second approach to native sof loadable modules. This time are used zephyr's linker scripts to create separate archive for modules and put them into specific for module sections. After that cmake files, using objcopy put code for up-down-mixer to udm.mod file which is being sign by rimage.
Full process of building module is automated and run by python building scripts:
xtensa-build-zephyr.py -u mtl -k ../keys/<used_key_for_project>