Skip to content
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

Include window offset info in data section when building binaries for AMD platforms ACP_6_3 and ACP_7_0. #9707

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/acp_6_3_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ CONFIG_COMP_TDFB=n
#CONFIG_COMP_MUX=n
CONFIG_COMP_SEL=n
CONFIG_COMP_MIXER=n
CONFIG_AMD_BINARY_BUILD=y
1 change: 1 addition & 0 deletions src/arch/xtensa/configs/acp_7_0_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ CONFIG_COMP_TDFB=n
#CONFIG_COMP_MUX=n
CONFIG_COMP_SEL=n
CONFIG_COMP_MIXER=n
CONFIG_AMD_BINARY_BUILD=n
2 changes: 2 additions & 0 deletions src/drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ rsource "imx/Kconfig"

rsource "mediatek/Kconfig"

rsource "amd/Kconfig"

config DUMMY_DMA
bool "Dummy DMA (software DMA driver)"
default n
Expand Down
7 changes: 7 additions & 0 deletions src/drivers/amd/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

config AMD_BINARY_BUILD
bool
default n
help
Select this if the platform need firmware binaries.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, not sure I understand the comment correctly. What's the alternative? What does CONFIG_AMD_BINARY_BUILD=n mean? No firmware binaries needed? But SOF is providing such a firmware "binary?" Or do you mean additional binary-only firmware parts?

Copy link
Member Author

@saisurya-ch saisurya-ch Dec 6, 2024

Choose a reason for hiding this comment

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

We meant to include the xsram_window in the data section using this config.

By default, xsram_window is present in the .fw_metadata section of rimage. But in a few scenarios, we need this data to be present in the data section of rimage.
We meant binary because, we like to parse few sections of the built rimage and make our own binaries in few cases, for which we need xsram_window to be present in data section rather than the fw_metadata section.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@saisurya-ch maybe you could add a bit of information here in an incremental PR, if I were building SOF for AMD, I wouldn't be sure whether I need this option

7 changes: 7 additions & 0 deletions src/platform/amd/acp_6_3/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@ static const struct sof_ipc_fw_ready ready
#define NUM_ACP_WINDOWS 6

const struct ext_man_windows xsram_window
#ifdef CONFIG_AMD_BINARY_BUILD
__aligned(EXT_MAN_ALIGN) __unused = {
#else
__aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = {
#endif
.hdr = {
.type = EXT_MAN_ELEM_WINDOW,
.elem_size = ALIGN_UP_COMPILE(sizeof(struct ext_man_windows), EXT_MAN_ALIGN),
Expand Down Expand Up @@ -189,6 +193,9 @@ int platform_boot_complete(uint32_t boot_message)
volatile acp_scratch_mem_config_t *pscratch_mem_cfg =
(volatile acp_scratch_mem_config_t *)(PU_SCRATCH_REG_BASE + SCRATCH_REG_OFFSET);
mailbox_dspbox_write(0, &ready, sizeof(ready));
#ifdef CONFIG_AMD_BINARY_BUILD
mailbox_dspbox_write(sizeof(ready), &xsram_window.window, sizeof(xsram_window.window));
#endif
pscratch_mem_cfg->acp_dsp_msg_write = 1;
acp_dsp_to_host_intr_trig();
/* Configures the trigger bit in ACP_DSP_SW_INTR_TRIG register */
Expand Down
7 changes: 7 additions & 0 deletions src/platform/amd/acp_7_0/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ static const struct sof_ipc_fw_ready ready
#define NUM_ACP_WINDOWS 6

const struct ext_man_windows xsram_window
#ifdef CONFIG_AMD_BINARY_BUILD
__aligned(EXT_MAN_ALIGN) __unused = {
#else
__aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = {
#endif
.hdr = {
.type = EXT_MAN_ELEM_WINDOW,
.elem_size = ALIGN_UP_COMPILE(sizeof(struct ext_man_windows), EXT_MAN_ALIGN),
Expand Down Expand Up @@ -188,6 +192,9 @@ int platform_boot_complete(uint32_t boot_message)
volatile acp_scratch_mem_config_t *pscratch_mem_cfg =
(volatile acp_scratch_mem_config_t *)(PU_SCRATCH_REG_BASE + SCRATCH_REG_OFFSET);
mailbox_dspbox_write(0, &ready, sizeof(ready));
#ifdef CONFIG_AMD_BINARY_BUILD
mailbox_dspbox_write(sizeof(ready), &xsram_window.window, sizeof(xsram_window.window));
#endif
pscratch_mem_cfg->acp_dsp_msg_write = 1;
acp_dsp_to_host_intr_trig();
/* Configures the trigger bit in ACP_DSP_SW_INTR_TRIG register */
Expand Down
Loading