-
Notifications
You must be signed in to change notification settings - Fork 350
ams: Add initial AMS implementation #6343
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
| // | ||
| // Copyright(c) 2023 Intel Corporation. All rights reserved. | ||
| // | ||
| // Author: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> | ||
|
|
||
| /** | ||
| * \file | ||
| * \brief Xtensa Asynchronous Messaging Service implementation file | ||
| * \authors Krzysztof Frydryk <krzysztofx.frydryk@intel.com> | ||
| */ | ||
|
|
||
| #include <sof/lib/cpu.h> | ||
| #include <sof/lib/ams.h> | ||
| #include <xtos-structs.h> | ||
|
|
||
| static struct async_message_service *host_ams; | ||
|
|
||
| struct async_message_service **arch_ams_get(void) | ||
| { | ||
| return &host_ams; | ||
| } | ||
|
aborisovich marked this conversation as resolved.
Outdated
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| // SPDX-License-Identifier: BSD-3-Clause | ||
| // | ||
| // Copyright(c) 2023 Intel Corporation. All rights reserved. | ||
| // | ||
| // Author: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> | ||
|
|
||
| /** | ||
| * \file | ||
| * \brief Xtensa Asynchronous Messaging Service implementation file | ||
| * \authors Krzysztof Frydryk <krzysztofx.frydryk@intel.com> | ||
| */ | ||
|
|
||
| #include <sof/lib/cpu.h> | ||
| #include <sof/lib/ams.h> | ||
| #include <xtos-structs.h> | ||
|
|
||
| struct async_message_service **arch_ams_get(void) | ||
| { | ||
| #if CONFIG_AMS | ||
| struct core_context *ctx = (struct core_context *)cpu_read_threadptr(); | ||
|
|
||
| return &ctx->ams; | ||
| #else | ||
| return NULL; | ||
| #endif | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ | |
| #include <ipc/topology.h> | ||
| #include <errno.h> | ||
| #include <stdint.h> | ||
| #include <sof/lib/ams.h> | ||
|
|
||
| LOG_MODULE_REGISTER(idc, CONFIG_SOF_LOG_LEVEL); | ||
|
|
||
|
|
@@ -274,6 +275,15 @@ static void idc_prepare_d0ix(void) | |
| platform_pm_runtime_prepare_d0ix_en(cpu_get_id()); | ||
| } | ||
|
|
||
| static void idc_process_async_msg(uint32_t slot) | ||
| { | ||
| #if CONFIG_AMS | ||
| process_incoming_message(slot); | ||
| #else | ||
| tr_err(&idc_tr, "idc_cmd(): AMS not enabled"); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't this be a one-time log, this could swamp the logs with repeated 'AMS not enabled"
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not really, this should not happen when ams is used correctly. If only ams interface functions are used without CONFIG_AMS, than this will never be called. Nevertheless such case should be reported when looking at idc layer separately. |
||
| #endif | ||
| } | ||
|
|
||
| /** | ||
| * \brief Handle IDC secondary core crashed message. | ||
| * \param[in] header IDC message header | ||
|
|
@@ -335,6 +345,9 @@ void idc_cmd(struct idc_msg *msg) | |
| case iTS(IDC_MSG_SECONDARY_CORE_CRASHED): | ||
| idc_secondary_core_crashed(msg->header); | ||
| break; | ||
| case iTS(IDC_MSG_AMS): | ||
| idc_process_async_msg(IDC_HEADER_TO_AMS_SLOT_MASK(msg->header)); | ||
| break; | ||
| default: | ||
| tr_err(&idc_tr, "idc_cmd(): invalid msg->header = %u", | ||
| msg->header); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.