-
Notifications
You must be signed in to change notification settings - Fork 140
Support extended manifest config data for clock config #2297
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 |
|---|---|---|
|
|
@@ -294,6 +294,9 @@ const struct snd_sof_dsp_ops sof_cnl_ops = { | |
| .pre_fw_run = hda_dsp_pre_fw_run, | ||
| .post_fw_run = hda_dsp_post_fw_run, | ||
|
|
||
| /* parse platform specific extended manifest */ | ||
| .parse_platform_ext_manifest = hda_dsp_ext_man_get_cavs_config_data, | ||
|
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. Why add this parse as ops?
Collaborator
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. @xiulipan yes we will. For example, why would the IMX platforms have the LPRO config elem? 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. @ranj063 A good question here, but I think we should parse the platform manifest in one place and config them to each platform.
Collaborator
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. @xiulipan I'm afraid this is a bit wrong audience. The ABI was already added to FW with 3.17 in thesofproject/sof#2893 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. @ranj063 @fredoh9 @kv2019i My only concern here is about the generic part in |
||
|
|
||
| /* dsp core power up/down */ | ||
| .core_power_up = hda_dsp_enable_core, | ||
| .core_power_down = hda_dsp_core_reset_power_down, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ | ||
| /* | ||
| * This file is provided under a dual BSD/GPLv2 license. When using or | ||
| * redistributing this file, you may do so under either license. | ||
| * | ||
| * Copyright(c) 2020 Intel Corporation. All rights reserved. | ||
| */ | ||
|
|
||
| /* | ||
| * Intel extended manifest is a extra place to store Intel cavs specific | ||
| * metadata about firmware, for example LPRO/HPRO configuration is | ||
| * Intel cavs specific. This part of output binary is not signed. | ||
| */ | ||
|
|
||
| #ifndef __INTEL_CAVS_EXT_MANIFEST_H__ | ||
| #define __INTEL_CAVS_EXT_MANIFEST_H__ | ||
|
|
||
| #include <sound/sof/ext_manifest.h> | ||
|
|
||
| /* EXT_MAN_ELEM_PLATFORM_CONFIG_DATA elements identificators */ | ||
| enum sof_cavs_config_elem_type { | ||
fredoh9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| SOF_EXT_MAN_CAVS_CONFIG_EMPTY = 0, | ||
| SOF_EXT_MAN_CAVS_CONFIG_CAVS_LPRO = 1, | ||
| SOF_EXT_MAN_CAVS_CONFIG_OUTBOX_SIZE = 2, | ||
| SOF_EXT_MAN_CAVS_CONFIG_INBOX_SIZE = 3, | ||
| SOF_EXT_MAN_CAVS_CONFIG_LAST_ELEM, /**< keep it at the end of enum list */ | ||
| }; | ||
|
|
||
| /* EXT_MAN_ELEM_PLATFORM_CONFIG_DATA elements */ | ||
| struct sof_ext_man_cavs_config_data { | ||
| struct sof_ext_man_elem_header hdr; | ||
|
|
||
| struct sof_config_elem elems[SOF_EXT_MAN_CAVS_CONFIG_LAST_ELEM]; | ||
| } __packed; | ||
|
||
|
|
||
| #endif /* __INTEL_CAVS_EXT_MANIFEST_H__ */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ | |
| #include <sound/hdaudio_ext.h> | ||
| #include <sound/hda_register.h> | ||
| #include <sound/sof.h> | ||
| #include "ext_manifest.h" | ||
| #include "../ops.h" | ||
| #include "hda.h" | ||
|
|
||
|
|
@@ -470,3 +471,39 @@ int hda_dsp_post_fw_run(struct snd_sof_dev *sdev) | |
| /* re-enable clock gating and power gating */ | ||
| return hda_dsp_ctrl_clock_power_gating(sdev, true); | ||
| } | ||
|
|
||
| int hda_dsp_ext_man_get_cavs_config_data(struct snd_sof_dev *sdev, | ||
fredoh9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const struct sof_ext_man_elem_header *hdr) | ||
| { | ||
| const struct sof_ext_man_cavs_config_data *config_data = | ||
| container_of(hdr, struct sof_ext_man_cavs_config_data, hdr); | ||
| struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; | ||
| int i, elem_num; | ||
|
|
||
| /* calculate total number of config data elements */ | ||
| elem_num = (hdr->size - sizeof(struct sof_ext_man_elem_header)) / sizeof(struct sof_config_elem); | ||
| if (elem_num <= 0) { | ||
| dev_err(sdev->dev, "cavs config data is inconsistent: %d\n", elem_num); | ||
| return -EINVAL; | ||
| } | ||
|
|
||
| for (i = 0; i < elem_num; i++) | ||
| switch (config_data->elems[i].token) { | ||
| case SOF_EXT_MAN_CAVS_CONFIG_EMPTY: | ||
| /* skip empty token */ | ||
| break; | ||
| case SOF_EXT_MAN_CAVS_CONFIG_CAVS_LPRO: | ||
| hda->clk_config_lpro = config_data->elems[i].value; | ||
|
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. I think you would better to have some ops for the clk_config setting for each platform. |
||
| dev_dbg(sdev->dev, "FW clock config: %s\n", hda->clk_config_lpro ? "LPRO" : "HPRO"); | ||
| break; | ||
| case SOF_EXT_MAN_CAVS_CONFIG_OUTBOX_SIZE: | ||
| case SOF_EXT_MAN_CAVS_CONFIG_INBOX_SIZE: | ||
| /* This elem is supported but config data is not being used yet */ | ||
| break; | ||
| default: | ||
| dev_warn(sdev->dev, "unsupported token type: %d\n", | ||
fredoh9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| config_data->elems[i].token); | ||
fredoh9 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| return 0; | ||
| } | ||
|
Comment on lines
+475
to
+509
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. I will suggest to move this function to loader.c and only do something like Then in |
||
Uh oh!
There was an error while loading. Please reload this page.