Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 367
Add dummy Loadable smart amp support#8580
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
Merged
lgirdwood
merged 5 commits into
thesofproject:main
from
RanderWang:loadable_smart_amplifierDec 15, 2023
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
af8766b
loadable module: don't define PHDR twice
lyakh 5f3d492
module: fix firmware compilation for loadable modules
lyakh 22c398c
module-adapter: allow multiple processing modes to be implemented
lyakh efff75d
dummy-smart-amp: use sink & source buffer
RanderWang 694aa9e
lmdk: add dummy loadable smart amp support
RanderWang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| cmake_minimum_required(VERSION 3.20) | ||
| set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../../cmake/xtensa-toolchain.cmake") | ||
| project(smart_amp_test) | ||
| macro(is_zephyr ret) | ||
| if(CONFIG_ZEPHYR_SOF_MODULE) | ||
| set(${ret} TRUE) | ||
| else() | ||
| set(${ret} FALSE) | ||
| endif() | ||
| endmacro() | ||
| # list of modules to be built and included into this loadable library | ||
| set(MODULES_LIST smart_amp_test) | ||
| # toml file for rimage to generate manifets | ||
| set(TOML "${CMAKE_CURRENT_LIST_DIR}/smart_amp_test.toml") | ||
| # TODO: Move it somewhere??? | ||
| add_definitions(-DMAJOR_IADSP_API_VERSION=5) | ||
| add_definitions(-DMIDDLE_IADSP_API_VERSION=0) | ||
| add_definitions(-DMINOR_IADSP_API_VERSION=0) | ||
| include(../../cmake/build.cmake) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| version = [3, 0] | ||
| [adsp] | ||
| name = "mtl" | ||
| image_size = "0x2C0000" # (22) bank * 128KB | ||
| alias_mask = "0xE0000000" | ||
| [[adsp.mem_zone]] | ||
| type = "ROM" | ||
| base = "0x1FF80000" | ||
| size = "0x400" | ||
| [[adsp.mem_zone]] | ||
| type = "IMR" | ||
| base = "0xA104A000" | ||
| size = "0x2000" | ||
| [[adsp.mem_zone]] | ||
| type = "SRAM" | ||
| base = "0xa00f0000" | ||
| size = "0x100000" | ||
| [[adsp.mem_alias]] | ||
| type = "uncached" | ||
| base = "0x40000000" | ||
| [[adsp.mem_alias]] | ||
| type = "cached" | ||
| base = "0xA0000000" | ||
| [cse] | ||
| partition_name = "ADSP" | ||
| [[cse.entry]] | ||
| name = "ADSP.man" | ||
| offset = "0x5c" | ||
| length = "0x464" | ||
| [[cse.entry]] | ||
| name = "ADSP.met" | ||
| offset = "0x4c0" | ||
| length = "0x70" | ||
| [[cse.entry]] | ||
| name = "ADSP" | ||
| offset = "0x540" | ||
| length = "0x0" # calculated by rimage | ||
| [css] | ||
| [signed_pkg] | ||
| name = "ADSP" | ||
| [[signed_pkg.module]] | ||
| name = "ADSP.met" | ||
| [adsp_file] | ||
| [[adsp_file.comp]] | ||
| base_offset = "0x2000" | ||
| [fw_desc.header] | ||
| name = "ADSPFW" | ||
| load_offset = "0x40000" | ||
| [module] | ||
| count = 1 | ||
| [[module.entry]] | ||
| name = "SMATEST" | ||
| uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" | ||
| affinity_mask = "0x1" | ||
| instance_count = "1" | ||
| domain_types = "0" | ||
| load_type = "0" | ||
| init_config = "1" | ||
| module_type = "0xD" | ||
| auto_start = "0" | ||
| sched_caps = [1, 0x00008000] | ||
| # pin = [dir, type, sample rate, size, container, channel-cfg] | ||
| pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, | ||
| 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, | ||
| 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] | ||
| # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] | ||
| mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| target_sources(smart_amp_test PRIVATE ${SOF_BASE}/src/samples/audio/smart_amp_test_ipc4.c) | ||
| set_target_properties(smart_amp_test PROPERTIES | ||
| HPSRAM_ADDR "0xa06c1000" | ||
| ) | ||
| target_compile_definitions(smart_amp_test PRIVATE | ||
| __SOF_MODULE_SERVICE_BUILD__=1 | ||
| CONFIG_XTENSA=1 | ||
| CONFIG_IPC_MAJOR_4=1 | ||
| ) | ||
| target_include_directories(smart_amp_test PRIVATE "${SOF_BASE}/src/include") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -142,10 +142,22 @@ static int modules_init(struct processing_module *mod) | ||
| struct module_interface *mod_in = | ||
| (struct module_interface *)md->module_adapter; | ||
| /* The order of preference */ | ||
| if (mod_in->process) | ||
| mod->proc_type = MODULE_PROCESS_TYPE_SOURCE_SINK; | ||
| else if (mod_in->process_audio_stream) | ||
| mod->proc_type = MODULE_PROCESS_TYPE_STREAM; | ||
| else if (mod_in->process_raw_data) | ||
| mod->proc_type = MODULE_PROCESS_TYPE_RAW; | ||
| else | ||
| return -EINVAL; | ||
| ret = mod_in->init(mod); | ||
| } else { | ||
| mod->proc_type = MODULE_PROCESS_TYPE_RAW; | ||
| ret = iadk_wrapper_init(md->module_adapter); | ||
| } | ||
| return ret; | ||
| } | ||
| @@ -174,7 +186,7 @@ static int modules_prepare(struct processing_module *mod, | ||
| struct module_interface *mod_in = | ||
| (struct module_interface *)mod->priv.module_adapter; | ||
| ret = mod_in->prepare(mod, NULL, 0, NULL, 0); | ||
| ret = mod_in->prepare(mod, sources, num_of_sources, sinks, num_of_sinks); | ||
RanderWang marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| } else { | ||
| ret = iadk_wrapper_prepare(mod->priv.module_adapter); | ||
| } | ||
| @@ -195,18 +207,45 @@ static int modules_init_process(struct processing_module *mod) | ||
| return 0; | ||
| } | ||
| static int modules_process(struct processing_module *mod, | ||
| struct sof_source **sources, int num_of_sources, | ||
| struct sof_sink **sinks, int num_of_sinks) | ||
| { | ||
| if (!mod->is_native_sof) | ||
| return -EOPNOTSUPP; | ||
| struct module_interface *mod_in = (struct module_interface *)mod->priv.module_adapter; | ||
| return mod_in->process(mod, sources, num_of_sources, sinks, num_of_sinks); | ||
| } | ||
| static int modules_process_audio_stream(struct processing_module *mod, | ||
| struct input_stream_buffer *input_buffers, | ||
| int num_input_buffers, | ||
| struct output_stream_buffer *output_buffers, | ||
| int num_output_buffers) | ||
| { | ||
| if (!mod->is_native_sof) | ||
| return -EOPNOTSUPP; | ||
| struct module_interface *mod_in = (struct module_interface *)mod->priv.module_adapter; | ||
| return mod_in->process_audio_stream(mod, input_buffers, num_input_buffers, | ||
| output_buffers, num_output_buffers); | ||
| } | ||
| /* | ||
| * \brief modules_process. | ||
| * \brief modules_process_raw. | ||
| * \param[in] mod - processing module pointer. | ||
| * | ||
| * \return: zero on success | ||
| * error code on failure | ||
| */ | ||
| static int modules_process(struct processing_module *mod, | ||
| struct input_stream_buffer *input_buffers, | ||
| int num_input_buffers, | ||
| struct output_stream_buffer *output_buffers, | ||
| int num_output_buffers) | ||
| static int modules_process_raw(struct processing_module *mod, | ||
| struct input_stream_buffer *input_buffers, | ||
| int num_input_buffers, | ||
| struct output_stream_buffer *output_buffers, | ||
| int num_output_buffers) | ||
| { | ||
| struct comp_dev *dev = mod->dev; | ||
| struct module_data *md = &mod->priv; | ||
| @@ -384,7 +423,9 @@ static int modules_reset(struct processing_module *mod) | ||
| static const struct module_interface interface = { | ||
| .init = modules_init, | ||
| .prepare = modules_prepare, | ||
| .process_raw_data = modules_process, | ||
| .process_raw_data = modules_process_raw, | ||
| .process = modules_process, | ||
| .process_audio_stream = modules_process_audio_stream, | ||
| .set_processing_mode = modules_set_processing_mode, | ||
| .get_processing_mode = modules_get_processing_mode, | ||
| .set_configuration = modules_set_configuration, | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.