Skip to content
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
12 changes: 11 additions & 1 deletion src/include/ipc/info.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum sof_ipc_ext_data {
SOF_IPC_EXT_DMA_BUFFER = 0,
SOF_IPC_EXT_WINDOW,
SOF_IPC_EXT_CC_INFO,
SOF_IPC_EXT_PROBE_INFO,
};

/* FW version - SOF_IPC_GLB_VERSION */
Expand Down Expand Up @@ -139,6 +140,15 @@ struct sof_ipc_cc_version {
char desc[]; /* null terminated compiler description */
} __attribute__((packed));

extern const struct sof_ipc_cc_version cc_version;
/* extended data: Probe setup */
struct sof_ipc_probe_support {
struct sof_ipc_ext_data_hdr ext_hdr;

uint32_t probe_points_max;
uint32_t injection_dmas_max;

/* reserved for future use */
uint32_t reserved[2];
} __attribute__((packed));

#endif /* __IPC_INFO_H__ */
16 changes: 16 additions & 0 deletions src/include/sof/fw-ready-metadata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright(c) 2020 Intel Corporation. All rights reserved.
*
* Author: Artur Kloniecki <arturx.kloniecki@linux.intel.com>
*/

#ifndef __IPC_FW_READY_METADATA_H__
#define __IPC_FW_READY_METADATA_H__

#include <ipc/info.h>

extern const struct sof_ipc_cc_version cc_version;
extern const struct sof_ipc_probe_support probe_support;

#endif /* __IPC_FW_READY_METADATA_H__ */
5 changes: 4 additions & 1 deletion src/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ set_property(TARGET data_structs APPEND
PROPERTY COMPILE_DEFINITIONS
CC_OPTIMIZE_FLAGS="${optimization_flag}")

add_local_sources(data_structs cc_version.c)
add_local_sources(data_structs
cc_version.c
probe_support.c)

target_link_libraries(data_structs sof_options)
target_link_libraries(sof_static_libraries INTERFACE data_structs)
4 changes: 3 additions & 1 deletion src/ipc/cc_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com>

#include <ipc/info.h>
#include <sof/fw-ready-metadata.h>
#include <sof/common.h>
#include <sof/compiler_info.h>

Expand All @@ -18,7 +19,8 @@
field = CC_OPTIMIZE_FLAGS, \
field[ARRAY_SIZE(((struct sof_ipc_cc_version *)(0))->optim) - 1] = 0

const struct sof_ipc_cc_version cc_version = {
const struct sof_ipc_cc_version cc_version
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_cc_version)
Expand Down
22 changes: 22 additions & 0 deletions src/ipc/probe_support.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2020 Intel Corporation. All rights reserved.
//
// Author: Artur Kloniecki <arturx.kloniecki@linux.intel.com>

#include <ipc/info.h>
#include <sof/fw-ready-metadata.h>
#include <config.h>

const struct sof_ipc_probe_support probe_support
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_probe_support),
.type = SOF_IPC_EXT_PROBE_INFO,
},
#if CONFIG_PROBE
.probe_points_max = CONFIG_PROBE_POINTS_MAX,
.injection_dmas_max = CONFIG_PROBE_DMA_MAX
#endif
};
1 change: 1 addition & 0 deletions src/platform/apollolake/apollolake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_fw :sof_fw_phdr

.bss (NOLOAD) : ALIGN(4096)
Expand Down
1 change: 1 addition & 0 deletions src/platform/baytrail/baytrail.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -537,5 +537,6 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_data :sof_data_phdr
}
8 changes: 7 additions & 1 deletion src/platform/baytrail/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <sof/drivers/ipc.h>
#include <sof/drivers/pmc.h>
#include <sof/drivers/timer.h>
#include <sof/fw-ready-metadata.h>
#include <sof/lib/agent.h>
#include <sof/lib/alloc.h>
#include <sof/lib/clk.h>
Expand Down Expand Up @@ -65,7 +66,8 @@ static const struct sof_ipc_fw_ready ready
};

#define NUM_BYT_WINDOWS 6
static const struct sof_ipc_window sram_window = {
static const struct sof_ipc_window sram_window
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_window) +
Expand Down Expand Up @@ -139,6 +141,10 @@ int platform_boot_complete(uint32_t boot_message)
/* variable length compiler description is a last field of cc_version */
mailbox_dspbox_write(mb_offset, &cc_version,
cc_version.ext_hdr.hdr.size);
mb_offset = mb_offset + cc_version.ext_hdr.hdr.size;

mailbox_dspbox_write(mb_offset, &probe_support,
probe_support.ext_hdr.hdr.size);

/* now interrupt host to tell it we are done booting */
shim_write(SHIM_IPCDL, SOF_IPC_FW_READY | outbox);
Expand Down
1 change: 1 addition & 0 deletions src/platform/cannonlake/cannonlake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_fw :sof_fw_phdr

.bss (NOLOAD) : ALIGN(4096)
Expand Down
1 change: 1 addition & 0 deletions src/platform/haswell/haswell.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -562,5 +562,6 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_data :sof_data_phdr
}
8 changes: 7 additions & 1 deletion src/platform/haswell/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sof/drivers/interrupt.h>
#include <sof/drivers/ipc.h>
#include <sof/drivers/timer.h>
#include <sof/fw-ready-metadata.h>
#include <sof/lib/agent.h>
#include <sof/lib/alloc.h>
#include <sof/lib/clk.h>
Expand Down Expand Up @@ -61,7 +62,8 @@ static const struct sof_ipc_fw_ready ready
};

#define NUM_HSW_WINDOWS 6
static const struct sof_ipc_window sram_window = {
static const struct sof_ipc_window sram_window
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_window) +
Expand Down Expand Up @@ -135,6 +137,10 @@ int platform_boot_complete(uint32_t boot_message)
/* variable length compiler description is a last field of cc_version */
mailbox_dspbox_write(mb_offset, &cc_version,
cc_version.ext_hdr.hdr.size);
mb_offset = mb_offset + cc_version.ext_hdr.hdr.size;

mailbox_dspbox_write(mb_offset, &probe_support,
probe_support.ext_hdr.hdr.size);

/* now interrupt host to tell it we are done booting */
shim_write(SHIM_IPCD, outbox | SHIM_IPCD_BUSY);
Expand Down
1 change: 1 addition & 0 deletions src/platform/icelake/icelake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_fw :sof_fw_phdr

.bss (NOLOAD) : ALIGN(4096)
Expand Down
1 change: 1 addition & 0 deletions src/platform/imx8/imx8.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -501,5 +501,6 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_sdram0 :sof_sdram0_phdr
}
8 changes: 7 additions & 1 deletion src/platform/imx8/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sof/drivers/ipc.h>
#include <sof/drivers/mu.h>
#include <sof/drivers/timer.h>
#include <sof/fw-ready-metadata.h>
#include <sof/lib/agent.h>
#include <sof/lib/clk.h>
#include <sof/lib/cpu.h>
Expand Down Expand Up @@ -60,7 +61,8 @@ static const struct sof_ipc_fw_ready ready

#define NUM_IMX_WINDOWS 6

static const struct sof_ipc_window sram_window = {
static const struct sof_ipc_window sram_window
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_window) +
Expand Down Expand Up @@ -133,6 +135,10 @@ int platform_boot_complete(uint32_t boot_message)
/* variable length compiler description is a last field of cc_version */
mailbox_dspbox_write(mb_offset, &cc_version,
cc_version.ext_hdr.hdr.size);
mb_offset = mb_offset + cc_version.ext_hdr.hdr.size;

mailbox_dspbox_write(mb_offset, &probe_support,
probe_support.ext_hdr.hdr.size);

/* now interrupt host to tell it we are done booting */
imx_mu_xcr_rmw(IMX_MU_xCR_GIRn(1), 0);
Expand Down
1 change: 1 addition & 0 deletions src/platform/imx8m/imx8m.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -501,5 +501,6 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_sdram0 :sof_sdram0_phdr
}
8 changes: 7 additions & 1 deletion src/platform/imx8m/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sof/drivers/ipc.h>
#include <sof/drivers/mu.h>
#include <sof/drivers/timer.h>
#include <sof/fw-ready-metadata.h>
#include <sof/lib/agent.h>
#include <sof/lib/clk.h>
#include <sof/lib/cpu.h>
Expand Down Expand Up @@ -59,7 +60,8 @@ static const struct sof_ipc_fw_ready ready

#define NUM_IMX_WINDOWS 6

static const struct sof_ipc_window sram_window = {
static const struct sof_ipc_window sram_window
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_window) +
Expand Down Expand Up @@ -132,6 +134,10 @@ int platform_boot_complete(uint32_t boot_message)
/* variable length compiler description is a last field of cc_version */
mailbox_dspbox_write(mb_offset, &cc_version,
cc_version.ext_hdr.hdr.size);
mb_offset = mb_offset + cc_version.ext_hdr.hdr.size;

mailbox_dspbox_write(mb_offset, &probe_support,
probe_support.ext_hdr.hdr.size);

/* now interrupt host to tell it we are done booting */
imx_mu_xcr_rmw(IMX_MU_xCR_GIRn(1), 0);
Expand Down
8 changes: 7 additions & 1 deletion src/platform/intel/cavs/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sof/drivers/interrupt.h>
#include <sof/drivers/ipc.h>
#include <sof/drivers/timer.h>
#include <sof/fw-ready-metadata.h>
#include <sof/lib/agent.h>
#include <sof/lib/alloc.h>
#include <sof/lib/cache.h>
Expand Down Expand Up @@ -75,7 +76,8 @@ static const struct sof_ipc_fw_ready ready

#define NUM_WINDOWS 7

static const struct sof_ipc_window sram_window = {
static const struct sof_ipc_window sram_window
__attribute__((section(".fw_ready_metadata"))) = {
.ext_hdr = {
.hdr.cmd = SOF_IPC_FW_READY,
.hdr.size = sizeof(struct sof_ipc_window) +
Expand Down Expand Up @@ -300,6 +302,10 @@ int platform_boot_complete(uint32_t boot_message)
/* variable length compiler description is a last field of cc_version */
mailbox_dspbox_write(mb_offset, &cc_version,
cc_version.ext_hdr.hdr.size);
mb_offset = mb_offset + cc_version.ext_hdr.hdr.size;

mailbox_dspbox_write(mb_offset, &probe_support,
probe_support.ext_hdr.hdr.size);

/* tell host we are ready */
#if CAVS_VERSION == CAVS_VERSION_1_5
Expand Down
1 change: 1 addition & 0 deletions src/platform/suecreek/suecreek.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_fw :sof_fw_phdr

.bss (NOLOAD) : ALIGN(4096)
Expand Down
1 change: 1 addition & 0 deletions src/platform/tigerlake/tigerlake.x.in
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ SECTIONS
.fw_ready : ALIGN(4)
{
KEEP (*(.fw_ready))
KEEP (*(.fw_ready_metadata))
} >sof_fw :sof_fw_phdr

.bss (NOLOAD) : ALIGN(4096)
Expand Down