From 54b7e575273631aa18bb1fc685230164e13ce332 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Tue, 11 Aug 2020 18:05:31 +0200 Subject: [PATCH 1/2] ext_manifest: add simple config data element with IPC_MSG_SIZE To avoid lots of single value structures this will introduce config data element which will contain several simple token/value pairs At initial version it will contain IPC_MSG_SIZE elem which will inform kernel about maximum IPC msg size Signed-off-by: Adrian Bonislawski --- src/include/kernel/ext_manifest.h | 19 +++++++++++++++++++ src/init/ext_manifest.c | 10 ++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/include/kernel/ext_manifest.h b/src/include/kernel/ext_manifest.h index 521119ca00fc..ecf0f3f563bb 100644 --- a/src/include/kernel/ext_manifest.h +++ b/src/include/kernel/ext_manifest.h @@ -51,8 +51,20 @@ 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_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 +99,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}, + }, +}; From 07775daa3183a6ac0889ccbc3090d731505072f7 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Tue, 11 Aug 2020 19:51:00 +0200 Subject: [PATCH 2/2] ext_manifest: add platform-specific config elem At initial version it will add CAVS_LPRO for CAVS platforms, OUTBOX_SIZE and INBOX_SIZE Signed-off-by: Adrian Bonislawski --- src/include/kernel/ext_manifest.h | 1 + src/platform/intel/cavs/CMakeLists.txt | 7 +++++ src/platform/intel/cavs/ext_manifest.c | 25 +++++++++++++++++ .../intel/cavs/include/cavs/ext_manifest.h | 28 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/platform/intel/cavs/ext_manifest.c create mode 100644 src/platform/intel/cavs/include/cavs/ext_manifest.h diff --git a/src/include/kernel/ext_manifest.h b/src/include/kernel/ext_manifest.h index ecf0f3f563bb..bec0644089bc 100644 --- a/src/include/kernel/ext_manifest.h +++ b/src/include/kernel/ext_manifest.h @@ -52,6 +52,7 @@ enum ext_man_elem_type { 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 */ 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__ */