diff --git a/src/include/kernel/ext_manifest.h b/src/include/kernel/ext_manifest.h index 521119ca00fc..bec0644089bc 100644 --- a/src/include/kernel/ext_manifest.h +++ b/src/include/kernel/ext_manifest.h @@ -51,8 +51,21 @@ enum ext_man_elem_type { EXT_MAN_ELEM_CC_VERSION = SOF_IPC_EXT_CC_INFO, EXT_MAN_ELEM_PROBE_INFO = SOF_IPC_EXT_PROBE_INFO, EXT_MAN_ELEM_DBG_ABI = SOF_IPC_EXT_USER_ABI_INFO, + EXT_MAN_ELEM_CONFIG_DATA = 5, + EXT_MAN_ELEM_PLATFORM_CONFIG_DATA = 6, }; +/* EXT_MAN_ELEM_CONFIG_DATA elements identificators */ +enum config_elem_type { + EXT_MAN_CONFIG_IPC_MSG_SIZE = 1, + EXT_MAN_CONFIG_LAST_ELEM, /**< keep it at the end of enum list */ +}; + +struct config_elem { + uint32_t token; + uint32_t value; +} __packed; + /* FW version */ struct ext_man_fw_version { struct ext_man_elem_header hdr; @@ -87,4 +100,11 @@ struct ext_man_dbg_abi { struct sof_ipc_user_abi_version dbg_abi; } __packed; +/* EXT_MAN_ELEM_CONFIG_DATA elements */ +struct ext_man_config_data { + struct ext_man_elem_header hdr; + + struct config_elem elems[EXT_MAN_CONFIG_LAST_ELEM]; +} __packed; + #endif /* __KERNEL_EXT_MANIFEST_H__ */ diff --git a/src/init/ext_manifest.c b/src/init/ext_manifest.c index 7a95d4143969..4e1453c67cd3 100644 --- a/src/init/ext_manifest.c +++ b/src/init/ext_manifest.c @@ -83,3 +83,13 @@ const struct ext_man_dbg_abi ext_man_dbg_info .abi_dbg_version = SOF_ABI_DBG_VERSION, }, }; + +const struct ext_man_config_data ext_man_config + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") = { + .hdr.type = EXT_MAN_ELEM_CONFIG_DATA, + .hdr.elem_size = ALIGN_UP(sizeof(struct ext_man_config_data), + EXT_MAN_ALIGN), + .elems = { + {EXT_MAN_CONFIG_IPC_MSG_SIZE, SOF_IPC_MSG_MAX_SIZE}, + }, +}; diff --git a/src/platform/intel/cavs/CMakeLists.txt b/src/platform/intel/cavs/CMakeLists.txt index d6eb2ca44961..cdfc1619a53e 100644 --- a/src/platform/intel/cavs/CMakeLists.txt +++ b/src/platform/intel/cavs/CMakeLists.txt @@ -28,3 +28,10 @@ endif() add_local_sources(sof platform.c) target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/intel/cavs/include) + +add_library(cavs_ext_manifest STATIC "") +add_local_sources(cavs_ext_manifest ext_manifest.c) +sof_append_relative_path_definitions(cavs_ext_manifest) + +target_link_libraries(cavs_ext_manifest sof_options) +target_link_libraries(sof_static_libraries INTERFACE cavs_ext_manifest) diff --git a/src/platform/intel/cavs/ext_manifest.c b/src/platform/intel/cavs/ext_manifest.c new file mode 100644 index 000000000000..65b7f6b1bec1 --- /dev/null +++ b/src/platform/intel/cavs/ext_manifest.c @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2020 Intel Corporation. All rights reserved. +// +// Author: Adrian Bonislawski +// + +#include +#include +#include +#include + +const struct ext_man_cavs_config_data ext_man_cavs_config + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") = { + .hdr.type = EXT_MAN_ELEM_PLATFORM_CONFIG_DATA, + .hdr.elem_size = ALIGN_UP(sizeof(struct ext_man_cavs_config_data), + EXT_MAN_ALIGN), + .elems = { +#if CONFIG_CAVS_LPRO + {EXT_MAN_CAVS_CONFIG_LPRO, CONFIG_CAVS_LPRO}, +#endif + {EXT_MAN_CAVS_CONFIG_OUTBOX_SIZE, SRAM_OUTBOX_SIZE}, + {EXT_MAN_CAVS_CONFIG_INBOX_SIZE, SRAM_INBOX_SIZE}, + }, +}; diff --git a/src/platform/intel/cavs/include/cavs/ext_manifest.h b/src/platform/intel/cavs/include/cavs/ext_manifest.h new file mode 100644 index 000000000000..305b29463273 --- /dev/null +++ b/src/platform/intel/cavs/include/cavs/ext_manifest.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Adrian Bonislawski + */ + +#ifndef __CAVS_EXT_MANIFEST_H__ +#define __CAVS_EXT_MANIFEST_H__ + +#include + +/* EXT_MAN_ELEM_PLATFORM_CONFIG_DATA elements identificators */ +enum cavs_config_elem_type { + EXT_MAN_CAVS_CONFIG_LPRO = 1, + EXT_MAN_CAVS_CONFIG_OUTBOX_SIZE, + EXT_MAN_CAVS_CONFIG_INBOX_SIZE, + EXT_MAN_CAVS_CONFIG_LAST_ELEM, /**< keep it at the end of enum list */ +}; + +/* EXT_MAN_ELEM_PLATFORM_CONFIG_DATA elements */ +struct ext_man_cavs_config_data { + struct ext_man_elem_header hdr; + + struct config_elem elems[EXT_MAN_CAVS_CONFIG_LAST_ELEM]; +} __packed; + +#endif /* __KERNEL_EXT_MANIFEST_H__ */