From f24a98501d63ceaa55dd4ed4031cee3e1512c59d Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 6 Oct 2020 12:25:43 +0200 Subject: [PATCH 1/4] ipc: Remove cc_version from mailbox This information is already provided by extended manifest, so there is no need to double it in runtime code. It allows to save 92 bytes from .DATA and 128 bytes from .TEXT for cnl platform. Signed-off-by: Karol Trzcinski --- src/include/sof/fw-ready-metadata.h | 1 - src/ipc/CMakeLists.txt | 1 - src/ipc/cc_version.c | 37 ----------------------------- src/platform/baytrail/platform.c | 5 ---- src/platform/haswell/platform.c | 5 ---- src/platform/imx8/platform.c | 5 ---- src/platform/imx8m/platform.c | 5 ---- src/platform/intel/cavs/platform.c | 5 ---- zephyr/CMakeLists.txt | 2 -- 9 files changed, 66 deletions(-) delete mode 100644 src/ipc/cc_version.c diff --git a/src/include/sof/fw-ready-metadata.h b/src/include/sof/fw-ready-metadata.h index 87888c148b57..b118d4b10402 100644 --- a/src/include/sof/fw-ready-metadata.h +++ b/src/include/sof/fw-ready-metadata.h @@ -10,7 +10,6 @@ #include -extern const struct sof_ipc_cc_version cc_version; extern const struct sof_ipc_probe_support probe_support; extern const struct sof_ipc_user_abi_version user_abi_version; diff --git a/src/ipc/CMakeLists.txt b/src/ipc/CMakeLists.txt index af027dad42f2..eea27121cdb3 100644 --- a/src/ipc/CMakeLists.txt +++ b/src/ipc/CMakeLists.txt @@ -36,7 +36,6 @@ set_property(TARGET data_structs APPEND CC_OPTIMIZE_FLAGS="-${optimization_flag}") add_local_sources(data_structs - cc_version.c probe_support.c user_abi_version.c) diff --git a/src/ipc/cc_version.c b/src/ipc/cc_version.c deleted file mode 100644 index cdb40c80dfca..000000000000 --- a/src/ipc/cc_version.c +++ /dev/null @@ -1,37 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2019 Intel Corporation. All rights reserved. -// -// Author: Karol Trzcinski - -#include -#include -#include -#include - -/* copy CC_NAME to const arrays during compilation time */ -#define CC_NAME_COPY(field) \ - field = CC_NAME "\0" - -/* copy CC_OPTIM to const arrays during compilation time */ -#define CC_OPTIM_COPY(field) \ - field = CC_OPTIMIZE_FLAGS "\0" - -/* copy CC_DESC to arrays during compilation time */ -#define CC_DESC_COPY(field) \ - field = CC_DESC "\0" - -const struct sof_ipc_cc_version cc_version - __section(".fw_ready_metadata") = { - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_cc_version), - .type = SOF_IPC_EXT_CC_INFO, - }, - .micro = CC_MICRO, - .minor = CC_MINOR, - .major = CC_MAJOR, - CC_NAME_COPY(.name), - CC_OPTIM_COPY(.optim), - CC_DESC_COPY(.desc), -}; diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c index 2fe97f7f5e1e..30b6edc76b36 100644 --- a/src/platform/baytrail/platform.c +++ b/src/platform/baytrail/platform.c @@ -161,11 +161,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - /* 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); mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; diff --git a/src/platform/haswell/platform.c b/src/platform/haswell/platform.c index b1135285796c..72e61f00a856 100644 --- a/src/platform/haswell/platform.c +++ b/src/platform/haswell/platform.c @@ -142,11 +142,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - /* 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); mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; diff --git a/src/platform/imx8/platform.c b/src/platform/imx8/platform.c index 7bc372a0f3e2..78e3e6d1cfea 100644 --- a/src/platform/imx8/platform.c +++ b/src/platform/imx8/platform.c @@ -140,11 +140,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - /* 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); mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; diff --git a/src/platform/imx8m/platform.c b/src/platform/imx8m/platform.c index d9ad3cdf351c..f4e7e90d8fc3 100644 --- a/src/platform/imx8m/platform.c +++ b/src/platform/imx8m/platform.c @@ -139,11 +139,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - /* 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); mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index 651d82bc1e6c..ed75cdb5086a 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -308,11 +308,6 @@ int platform_boot_complete(uint32_t boot_message) mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; #endif - /* 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); mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index ef3c6fc9d8c5..25c728ba4f01 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -340,9 +340,7 @@ zephyr_library_sources( ${SOF_IPC_PATH}/ipc.c ${SOF_IPC_PATH}/handler.c ${SOF_IPC_PATH}/probe_support.c - ${SOF_IPC_PATH}/user_abi_version.c ${SOF_IPC_PATH}/ipc-host-ptable.c - ${SOF_IPC_PATH}/cc_version.c ${SOF_SRC_PATH}/spinlock.c # SOF math utilities From 757519cf7dbe9d4402d6f4f2d57194f772a8b203 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 6 Oct 2020 12:44:36 +0200 Subject: [PATCH 2/4] ipc: Remove probe_support from mailbox This information is already provided by extended manifest, so there is no need to double it in runtime code. It allows to save 28 bytes from .DATA and 128 bytes from .TEXT for cnl platform. Signed-off-by: Karol Trzcinski --- src/include/sof/fw-ready-metadata.h | 1 - src/ipc/CMakeLists.txt | 1 - src/ipc/probe_support.c | 23 ----------------------- src/platform/baytrail/platform.c | 4 ---- src/platform/haswell/platform.c | 4 ---- src/platform/imx8/platform.c | 4 ---- src/platform/imx8m/platform.c | 4 ---- src/platform/intel/cavs/platform.c | 4 ---- zephyr/CMakeLists.txt | 1 - 9 files changed, 46 deletions(-) delete mode 100644 src/ipc/probe_support.c diff --git a/src/include/sof/fw-ready-metadata.h b/src/include/sof/fw-ready-metadata.h index b118d4b10402..7173690a624e 100644 --- a/src/include/sof/fw-ready-metadata.h +++ b/src/include/sof/fw-ready-metadata.h @@ -10,7 +10,6 @@ #include -extern const struct sof_ipc_probe_support probe_support; extern const struct sof_ipc_user_abi_version user_abi_version; #endif /* __IPC_FW_READY_METADATA_H__ */ diff --git a/src/ipc/CMakeLists.txt b/src/ipc/CMakeLists.txt index eea27121cdb3..c6187b248b11 100644 --- a/src/ipc/CMakeLists.txt +++ b/src/ipc/CMakeLists.txt @@ -36,7 +36,6 @@ set_property(TARGET data_structs APPEND CC_OPTIMIZE_FLAGS="-${optimization_flag}") add_local_sources(data_structs - probe_support.c user_abi_version.c) target_link_libraries(data_structs sof_options) diff --git a/src/ipc/probe_support.c b/src/ipc/probe_support.c deleted file mode 100644 index 2f27015d4cec..000000000000 --- a/src/ipc/probe_support.c +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2020 Intel Corporation. All rights reserved. -// -// Author: Artur Kloniecki - -#include -#include -#include - - -const struct sof_ipc_probe_support probe_support - __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 -}; diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c index 30b6edc76b36..bce58d998202 100644 --- a/src/platform/baytrail/platform.c +++ b/src/platform/baytrail/platform.c @@ -161,10 +161,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &probe_support, - probe_support.ext_hdr.hdr.size); - mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/haswell/platform.c b/src/platform/haswell/platform.c index 72e61f00a856..9013a2d1b06d 100644 --- a/src/platform/haswell/platform.c +++ b/src/platform/haswell/platform.c @@ -142,10 +142,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &probe_support, - probe_support.ext_hdr.hdr.size); - mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/imx8/platform.c b/src/platform/imx8/platform.c index 78e3e6d1cfea..f8c75e7a4ee0 100644 --- a/src/platform/imx8/platform.c +++ b/src/platform/imx8/platform.c @@ -140,10 +140,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &probe_support, - probe_support.ext_hdr.hdr.size); - mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/imx8m/platform.c b/src/platform/imx8m/platform.c index f4e7e90d8fc3..054daae21bac 100644 --- a/src/platform/imx8m/platform.c +++ b/src/platform/imx8m/platform.c @@ -139,10 +139,6 @@ int platform_boot_complete(uint32_t boot_message) sram_window.ext_hdr.hdr.size); mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &probe_support, - probe_support.ext_hdr.hdr.size); - mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index ed75cdb5086a..03dba6d0d6c6 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -308,10 +308,6 @@ int platform_boot_complete(uint32_t boot_message) mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; #endif - mailbox_dspbox_write(mb_offset, &probe_support, - probe_support.ext_hdr.hdr.size); - mb_offset = mb_offset + probe_support.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 25c728ba4f01..0fb771d25810 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -339,7 +339,6 @@ zephyr_library_sources( ${SOF_IPC_PATH}/dma-copy.c ${SOF_IPC_PATH}/ipc.c ${SOF_IPC_PATH}/handler.c - ${SOF_IPC_PATH}/probe_support.c ${SOF_IPC_PATH}/ipc-host-ptable.c ${SOF_SRC_PATH}/spinlock.c From 91ceb000614a942bd4fff3444cf54754eb16ebbb Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 6 Oct 2020 13:02:38 +0200 Subject: [PATCH 3/4] ipc: Remove sram_window from mailbox This information is already provided by extended manifest, so there is no need to double it in runtime code. It allows to save 400 bytes from data .DATA and 64 bytes from .TEXT for cnl platform. EXT_MAP_PORT() macro is no longer needed. Created __unused macro in compiler_attributes.h as compiler attributes shouldn't be used directly, to allow easy compiler change. Signed-off-by: Karol Trzcinski --- src/include/kernel/ext_manifest.h | 10 -- src/include/sof/compiler_attributes.h | 2 + src/platform/baytrail/platform.c | 114 +++++++++++----------- src/platform/haswell/platform.c | 114 +++++++++++----------- src/platform/imx8/platform.c | 116 +++++++++++------------ src/platform/imx8m/platform.c | 114 +++++++++++----------- src/platform/intel/cavs/platform.c | 130 ++++++++++++-------------- 7 files changed, 285 insertions(+), 315 deletions(-) diff --git a/src/include/kernel/ext_manifest.h b/src/include/kernel/ext_manifest.h index 70cb14dd5587..4963428733ae 100644 --- a/src/include/kernel/ext_manifest.h +++ b/src/include/kernel/ext_manifest.h @@ -32,16 +32,6 @@ #include #include -/* Macro used to creeate copy of some structure in extended manifest */ -#define EXT_MAN_PORT(XENUM, XSIZE, IPC_ELEM, XNAME, IPC_NAME, CONTENT) \ - XNAME __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") \ - __attribute__ ((unused)) = { \ - .hdr.type = XENUM, \ - .hdr.elem_size = ALIGN_UP(XSIZE, EXT_MAN_ALIGN), \ - .IPC_ELEM = { CONTENT } \ - }; \ - IPC_NAME = { CONTENT } - /* Now define extended manifest elements */ /* Extended manifest elements identificators */ diff --git a/src/include/sof/compiler_attributes.h b/src/include/sof/compiler_attributes.h index d600831a911f..3533856c2bc4 100644 --- a/src/include/sof/compiler_attributes.h +++ b/src/include/sof/compiler_attributes.h @@ -14,3 +14,5 @@ #define __aligned(x) __attribute__((__aligned__(x))) #define __section(x) __attribute__((section(x))) + +#define __unused __attribute__((unused)) diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c index bce58d998202..c01d4790eef3 100644 --- a/src/platform/baytrail/platform.c +++ b/src/platform/baytrail/platform.c @@ -79,65 +79,65 @@ static const struct sof_ipc_fw_ready ready #define NUM_BYT_WINDOWS 6 -EXT_MAN_PORT( - EXT_MAN_ELEM_WINDOW, - sizeof(struct ext_man_windows), - window, - static const struct ext_man_windows xsram_window, - static const struct sof_ipc_window sram_window - __section(".fw_ready_metadata"), - _META_EXPAND( - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_window), - .type = SOF_IPC_EXT_WINDOW, +const struct ext_man_windows xsram_window + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = { + .hdr = { + .type = EXT_MAN_ELEM_WINDOW, + .elem_size = ALIGN_UP(sizeof(struct ext_man_windows), EXT_MAN_ALIGN), }, - .num_windows = NUM_BYT_WINDOWS, - .window = { - { - .type = SOF_IPC_REGION_UPBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DSPBOX_SIZE, - .offset = MAILBOX_DSPBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DOWNBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_HOSTBOX_SIZE, - .offset = MAILBOX_HOSTBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DEBUG, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DEBUG_SIZE, - .offset = MAILBOX_DEBUG_OFFSET, - }, - { - .type = SOF_IPC_REGION_TRACE, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_TRACE_SIZE, - .offset = MAILBOX_TRACE_OFFSET, + .window = { + .ext_hdr = { + .hdr.cmd = SOF_IPC_FW_READY, + .hdr.size = sizeof(struct sof_ipc_window), + .type = SOF_IPC_EXT_WINDOW, }, - { - .type = SOF_IPC_REGION_STREAM, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_STREAM_SIZE, - .offset = MAILBOX_STREAM_OFFSET, - }, - { - .type = SOF_IPC_REGION_EXCEPTION, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_EXCEPTION_SIZE, - .offset = MAILBOX_EXCEPTION_OFFSET, + .num_windows = NUM_BYT_WINDOWS, + .window = { + { + .type = SOF_IPC_REGION_UPBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DSPBOX_SIZE, + .offset = MAILBOX_DSPBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DOWNBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_HOSTBOX_SIZE, + .offset = MAILBOX_HOSTBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DEBUG, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DEBUG_SIZE, + .offset = MAILBOX_DEBUG_OFFSET, + }, + { + .type = SOF_IPC_REGION_TRACE, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_TRACE_SIZE, + .offset = MAILBOX_TRACE_OFFSET, + }, + { + .type = SOF_IPC_REGION_STREAM, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_STREAM_SIZE, + .offset = MAILBOX_STREAM_OFFSET, + }, + { + .type = SOF_IPC_REGION_EXCEPTION, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_EXCEPTION_SIZE, + .offset = MAILBOX_EXCEPTION_OFFSET, + }, }, }, -)); +}; static SHARED_DATA struct timer timer = { .id = TIMER3, /* external timer */ @@ -157,10 +157,6 @@ int platform_boot_complete(uint32_t boot_message) mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); mb_offset = mb_offset + sizeof(ready); - mailbox_dspbox_write(mb_offset, &sram_window, - sram_window.ext_hdr.hdr.size); - mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/haswell/platform.c b/src/platform/haswell/platform.c index 9013a2d1b06d..e58a6bb2ce02 100644 --- a/src/platform/haswell/platform.c +++ b/src/platform/haswell/platform.c @@ -65,65 +65,65 @@ static const struct sof_ipc_fw_ready ready #define NUM_HSW_WINDOWS 6 -EXT_MAN_PORT( - EXT_MAN_ELEM_WINDOW, - sizeof(struct ext_man_windows), - window, - static const struct ext_man_windows xsram_window, - static const struct sof_ipc_window sram_window - __section(".fw_ready_metadata"), - _META_EXPAND( - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_window), - .type = SOF_IPC_EXT_WINDOW, +const struct ext_man_windows xsram_window + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = { + .hdr = { + .type = EXT_MAN_ELEM_WINDOW, + .elem_size = ALIGN_UP(sizeof(struct ext_man_windows), EXT_MAN_ALIGN), }, - .num_windows = NUM_HSW_WINDOWS, - .window = { - { - .type = SOF_IPC_REGION_UPBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DSPBOX_SIZE, - .offset = MAILBOX_DSPBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DOWNBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_HOSTBOX_SIZE, - .offset = MAILBOX_HOSTBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DEBUG, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DEBUG_SIZE, - .offset = MAILBOX_DEBUG_OFFSET, - }, - { - .type = SOF_IPC_REGION_TRACE, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_TRACE_SIZE, - .offset = MAILBOX_TRACE_OFFSET, + .window = { + .ext_hdr = { + .hdr.cmd = SOF_IPC_FW_READY, + .hdr.size = sizeof(struct sof_ipc_window), + .type = SOF_IPC_EXT_WINDOW, }, - { - .type = SOF_IPC_REGION_STREAM, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_STREAM_SIZE, - .offset = MAILBOX_STREAM_OFFSET, - }, - { - .type = SOF_IPC_REGION_EXCEPTION, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_EXCEPTION_SIZE, - .offset = MAILBOX_EXCEPTION_OFFSET, + .num_windows = NUM_HSW_WINDOWS, + .window = { + { + .type = SOF_IPC_REGION_UPBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DSPBOX_SIZE, + .offset = MAILBOX_DSPBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DOWNBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_HOSTBOX_SIZE, + .offset = MAILBOX_HOSTBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DEBUG, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DEBUG_SIZE, + .offset = MAILBOX_DEBUG_OFFSET, + }, + { + .type = SOF_IPC_REGION_TRACE, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_TRACE_SIZE, + .offset = MAILBOX_TRACE_OFFSET, + }, + { + .type = SOF_IPC_REGION_STREAM, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_STREAM_SIZE, + .offset = MAILBOX_STREAM_OFFSET, + }, + { + .type = SOF_IPC_REGION_EXCEPTION, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_EXCEPTION_SIZE, + .offset = MAILBOX_EXCEPTION_OFFSET, + }, }, }, -)); +}; SHARED_DATA struct timer timer = { .id = TIMER1, /* internal timer */ @@ -138,10 +138,6 @@ int platform_boot_complete(uint32_t boot_message) mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); mb_offset = mb_offset + sizeof(ready); - mailbox_dspbox_write(mb_offset, &sram_window, - sram_window.ext_hdr.hdr.size); - mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/imx8/platform.c b/src/platform/imx8/platform.c index f8c75e7a4ee0..66c18f244b57 100644 --- a/src/platform/imx8/platform.c +++ b/src/platform/imx8/platform.c @@ -64,65 +64,65 @@ static const struct sof_ipc_fw_ready ready #define NUM_IMX_WINDOWS 6 -EXT_MAN_PORT( - EXT_MAN_ELEM_WINDOW, - sizeof(struct ext_man_windows), - window, - static const struct ext_man_windows xsram_window, - static const struct sof_ipc_window sram_window - __section(".fw_ready_metadata"), - _META_EXPAND( - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_window), - .type = SOF_IPC_EXT_WINDOW, +const struct ext_man_windows xsram_window + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = { + .hdr = { + .type = EXT_MAN_ELEM_WINDOW, + .elem_size = ALIGN_UP(sizeof(struct ext_man_windows), EXT_MAN_ALIGN), }, - .num_windows = NUM_IMX_WINDOWS, - .window = { - { - .type = SOF_IPC_REGION_UPBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DSPBOX_SIZE, - .offset = MAILBOX_DSPBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DOWNBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_HOSTBOX_SIZE, - .offset = MAILBOX_HOSTBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DEBUG, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DEBUG_SIZE, - .offset = MAILBOX_DEBUG_OFFSET, - }, - { - .type = SOF_IPC_REGION_TRACE, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_TRACE_SIZE, - .offset = MAILBOX_TRACE_OFFSET, + .window = { + .ext_hdr = { + .hdr.cmd = SOF_IPC_FW_READY, + .hdr.size = sizeof(struct sof_ipc_window), + .type = SOF_IPC_EXT_WINDOW, }, - { - .type = SOF_IPC_REGION_STREAM, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_STREAM_SIZE, - .offset = MAILBOX_STREAM_OFFSET, + .num_windows = NUM_IMX_WINDOWS, + .window = { + { + .type = SOF_IPC_REGION_UPBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DSPBOX_SIZE, + .offset = MAILBOX_DSPBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DOWNBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_HOSTBOX_SIZE, + .offset = MAILBOX_HOSTBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DEBUG, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DEBUG_SIZE, + .offset = MAILBOX_DEBUG_OFFSET, + }, + { + .type = SOF_IPC_REGION_TRACE, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_TRACE_SIZE, + .offset = MAILBOX_TRACE_OFFSET, + }, + { + .type = SOF_IPC_REGION_STREAM, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_STREAM_SIZE, + .offset = MAILBOX_STREAM_OFFSET, + }, + { + .type = SOF_IPC_REGION_EXCEPTION, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_EXCEPTION_SIZE, + .offset = MAILBOX_EXCEPTION_OFFSET, + }, }, - { - .type = SOF_IPC_REGION_EXCEPTION, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_EXCEPTION_SIZE, - .offset = MAILBOX_EXCEPTION_OFFSET, - }, - }, -)); + } +}; SHARED_DATA struct timer timer = { .id = TIMER0, /* internal timer */ @@ -136,10 +136,6 @@ int platform_boot_complete(uint32_t boot_message) mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); mb_offset = mb_offset + sizeof(ready); - mailbox_dspbox_write(mb_offset, &sram_window, - sram_window.ext_hdr.hdr.size); - mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/imx8m/platform.c b/src/platform/imx8m/platform.c index 054daae21bac..aae8e0829542 100644 --- a/src/platform/imx8m/platform.c +++ b/src/platform/imx8m/platform.c @@ -63,65 +63,65 @@ static const struct sof_ipc_fw_ready ready #define NUM_IMX_WINDOWS 6 -EXT_MAN_PORT( - EXT_MAN_ELEM_WINDOW, - sizeof(struct ext_man_windows), - window, - static const struct ext_man_windows xsram_window, - static const struct sof_ipc_window sram_window - __section(".fw_ready_metadata"), - _META_EXPAND( - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_window), - .type = SOF_IPC_EXT_WINDOW, +const struct ext_man_windows xsram_window + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = { + .hdr = { + .type = EXT_MAN_ELEM_WINDOW, + .elem_size = ALIGN_UP(sizeof(struct ext_man_windows), EXT_MAN_ALIGN), }, - .num_windows = NUM_IMX_WINDOWS, - .window = { - { - .type = SOF_IPC_REGION_UPBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DSPBOX_SIZE, - .offset = MAILBOX_DSPBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DOWNBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_HOSTBOX_SIZE, - .offset = MAILBOX_HOSTBOX_OFFSET, - }, - { - .type = SOF_IPC_REGION_DEBUG, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DEBUG_SIZE, - .offset = MAILBOX_DEBUG_OFFSET, - }, - { - .type = SOF_IPC_REGION_TRACE, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_TRACE_SIZE, - .offset = MAILBOX_TRACE_OFFSET, + .window = { + .ext_hdr = { + .hdr.cmd = SOF_IPC_FW_READY, + .hdr.size = sizeof(struct sof_ipc_window), + .type = SOF_IPC_EXT_WINDOW, }, - { - .type = SOF_IPC_REGION_STREAM, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_STREAM_SIZE, - .offset = MAILBOX_STREAM_OFFSET, - }, - { - .type = SOF_IPC_REGION_EXCEPTION, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_EXCEPTION_SIZE, - .offset = MAILBOX_EXCEPTION_OFFSET, + .num_windows = NUM_IMX_WINDOWS, + .window = { + { + .type = SOF_IPC_REGION_UPBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DSPBOX_SIZE, + .offset = MAILBOX_DSPBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DOWNBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_HOSTBOX_SIZE, + .offset = MAILBOX_HOSTBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DEBUG, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DEBUG_SIZE, + .offset = MAILBOX_DEBUG_OFFSET, + }, + { + .type = SOF_IPC_REGION_TRACE, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_TRACE_SIZE, + .offset = MAILBOX_TRACE_OFFSET, + }, + { + .type = SOF_IPC_REGION_STREAM, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_STREAM_SIZE, + .offset = MAILBOX_STREAM_OFFSET, + }, + { + .type = SOF_IPC_REGION_EXCEPTION, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_EXCEPTION_SIZE, + .offset = MAILBOX_EXCEPTION_OFFSET, + }, }, }, -)); +}; SHARED_DATA struct timer timer = { .id = TIMER0, /* internal timer */ @@ -135,10 +135,6 @@ int platform_boot_complete(uint32_t boot_message) mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); mb_offset = mb_offset + sizeof(ready); - mailbox_dspbox_write(mb_offset, &sram_window, - sram_window.ext_hdr.hdr.size); - mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index 03dba6d0d6c6..4584ab79742e 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -78,72 +78,72 @@ static const struct sof_ipc_fw_ready ready #define NUM_WINDOWS 7 -EXT_MAN_PORT( - EXT_MAN_ELEM_WINDOW, - sizeof(struct ext_man_windows), - window, - static const struct ext_man_windows xsram_window, - static const struct sof_ipc_window sram_window - __section(".fw_ready_metadata"), - _META_EXPAND( - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_window), - .type = SOF_IPC_EXT_WINDOW, +const struct ext_man_windows xsram_window + __aligned(EXT_MAN_ALIGN) __section(".fw_metadata") __unused = { + .hdr = { + .type = EXT_MAN_ELEM_WINDOW, + .elem_size = ALIGN_UP(sizeof(struct ext_man_windows), EXT_MAN_ALIGN), }, - .num_windows = NUM_WINDOWS, - .window = { - { - .type = SOF_IPC_REGION_REGS, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_SW_REG_SIZE, - .offset = 0, - }, - { - .type = SOF_IPC_REGION_UPBOX, - .id = 0, /* map to host window 0 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DSPBOX_SIZE, - .offset = MAILBOX_SW_REG_SIZE, - }, - { - .type = SOF_IPC_REGION_DOWNBOX, - .id = 1, /* map to host window 1 */ - .flags = 0, // TODO: set later - .size = MAILBOX_HOSTBOX_SIZE, - .offset = 0, - }, - { - .type = SOF_IPC_REGION_DEBUG, - .id = 2, /* map to host window 2 */ - .flags = 0, // TODO: set later - .size = MAILBOX_DEBUG_SIZE, - .offset = 0, - }, - { - .type = SOF_IPC_REGION_EXCEPTION, - .id = 2, /* map to host window 2 */ - .flags = 0, // TODO: set later - .size = MAILBOX_EXCEPTION_SIZE, - .offset = MAILBOX_EXCEPTION_OFFSET, + .window = { + .ext_hdr = { + .hdr.cmd = SOF_IPC_FW_READY, + .hdr.size = sizeof(struct sof_ipc_window), + .type = SOF_IPC_EXT_WINDOW, }, - { - .type = SOF_IPC_REGION_STREAM, - .id = 2, /* map to host window 2 */ - .flags = 0, // TODO: set later - .size = MAILBOX_STREAM_SIZE, - .offset = MAILBOX_STREAM_OFFSET, - }, - { - .type = SOF_IPC_REGION_TRACE, - .id = 3, /* map to host window 3 */ - .flags = 0, // TODO: set later - .size = MAILBOX_TRACE_SIZE, - .offset = 0, + .num_windows = NUM_WINDOWS, + .window = { + { + .type = SOF_IPC_REGION_REGS, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_SW_REG_SIZE, + .offset = 0, + }, + { + .type = SOF_IPC_REGION_UPBOX, + .id = 0, /* map to host window 0 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DSPBOX_SIZE, + .offset = MAILBOX_SW_REG_SIZE, + }, + { + .type = SOF_IPC_REGION_DOWNBOX, + .id = 1, /* map to host window 1 */ + .flags = 0, // TODO: set later + .size = MAILBOX_HOSTBOX_SIZE, + .offset = 0, + }, + { + .type = SOF_IPC_REGION_DEBUG, + .id = 2, /* map to host window 2 */ + .flags = 0, // TODO: set later + .size = MAILBOX_DEBUG_SIZE, + .offset = 0, + }, + { + .type = SOF_IPC_REGION_EXCEPTION, + .id = 2, /* map to host window 2 */ + .flags = 0, // TODO: set later + .size = MAILBOX_EXCEPTION_SIZE, + .offset = MAILBOX_EXCEPTION_OFFSET, + }, + { + .type = SOF_IPC_REGION_STREAM, + .id = 2, /* map to host window 2 */ + .flags = 0, // TODO: set later + .size = MAILBOX_STREAM_SIZE, + .offset = MAILBOX_STREAM_OFFSET, + }, + { + .type = SOF_IPC_REGION_TRACE, + .id = 3, /* map to host window 3 */ + .flags = 0, // TODO: set later + .size = MAILBOX_TRACE_SIZE, + .offset = 0, + }, }, }, -)); +}; #endif #if CONFIG_CANNONLAKE || CONFIG_ICELAKE || CONFIG_TIGERLAKE @@ -302,12 +302,6 @@ int platform_boot_complete(uint32_t boot_message) mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); mb_offset = mb_offset + sizeof(ready); -#if CONFIG_MEM_WND - mailbox_dspbox_write(mb_offset, &sram_window, - sram_window.ext_hdr.hdr.size); - mb_offset = mb_offset + sram_window.ext_hdr.hdr.size; -#endif - mailbox_dspbox_write(mb_offset, &user_abi_version, user_abi_version.ext_hdr.hdr.size); From 47b4cc5963da135fd307d346d385cdc55e6db27b Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 6 Oct 2020 13:19:30 +0200 Subject: [PATCH 4/4] ipc: Remove user_abi_version from mailbox This information is already provided by extended manifest, so there is no need to double it in runtime code. It allows to save 16 bytes from .DATA and 128 bytes from .TEXT for cnl platform. `data_structs` library from src/ipc/CMakeLists.txt is no longer needed. Moreover empty library may lead to cmake fail. SMEX needs little update, to read DBG_ABI from .fw_metadata section instead of .fw_ready. Signed-off-by: Karol Trzcinski --- smex/ldc.c | 23 +++++++++++++++-------- src/include/sof/fw-ready-metadata.h | 2 -- src/ipc/CMakeLists.txt | 19 ------------------- src/ipc/user_abi_version.c | 18 ------------------ src/platform/baytrail/platform.c | 7 +------ src/platform/haswell/platform.c | 7 +------ src/platform/imx8/platform.c | 8 +------- src/platform/imx8m/platform.c | 8 +------- src/platform/intel/cavs/platform.c | 8 +------- 9 files changed, 20 insertions(+), 80 deletions(-) delete mode 100644 src/ipc/user_abi_version.c diff --git a/smex/ldc.c b/smex/ldc.c index b9fdf888c01b..fc98f7073402 100644 --- a/smex/ldc.c +++ b/smex/ldc.c @@ -5,6 +5,7 @@ // Author: Karol Trzcinski #include +#include #include #include #include @@ -16,7 +17,7 @@ static int fw_version_copy(const struct elf_module *src, struct snd_sof_logs_header *header) { - struct sof_ipc_ext_data_hdr *ext_hdr = NULL; + struct ext_man_elem_header *ext_hdr = NULL; void *buffer = NULL; int section_size; @@ -28,6 +29,7 @@ static int fw_version_copy(const struct elf_module *src, memcpy(&header->version, &((struct sof_ipc_fw_ready *)buffer)->version, sizeof(header->version)); + free(buffer); /* fw_ready structure contains main (primarily kernel) * ABI version. @@ -42,25 +44,30 @@ static int fw_version_copy(const struct elf_module *src, * * skip the base fw-ready record and begin from the first extension. */ - ext_hdr = buffer + ((struct sof_ipc_fw_ready *)buffer)->hdr.size; + section_size = elf_read_section(src, ".fw_metadata", NULL, &buffer); + + if (section_size < 0) + return section_size; + + ext_hdr = (struct ext_man_elem_header *)buffer; while ((uintptr_t)ext_hdr < (uintptr_t)buffer + section_size) { - if (ext_hdr->type == SOF_IPC_EXT_USER_ABI_INFO) { + if (ext_hdr->type == EXT_MAN_ELEM_DBG_ABI) { header->version.abi_version = - ((struct sof_ipc_user_abi_version *) - ext_hdr)->abi_dbg_version; + ((struct ext_man_dbg_abi *) + ext_hdr)->dbg_abi.abi_dbg_version; break; } //move to the next entry - ext_hdr = (struct sof_ipc_ext_data_hdr *) - ((uint8_t *)ext_hdr + ext_hdr->hdr.size); + ext_hdr = (struct ext_man_elem_header *) + ((uint8_t *)ext_hdr + ext_hdr->elem_size); } + free(buffer); fprintf(stdout, "fw abi dbg version:\t%d:%d:%d\n", SOF_ABI_VERSION_MAJOR(header->version.abi_version), SOF_ABI_VERSION_MINOR(header->version.abi_version), SOF_ABI_VERSION_PATCH(header->version.abi_version)); - free(buffer); return 0; } diff --git a/src/include/sof/fw-ready-metadata.h b/src/include/sof/fw-ready-metadata.h index 7173690a624e..ff7c6929c60f 100644 --- a/src/include/sof/fw-ready-metadata.h +++ b/src/include/sof/fw-ready-metadata.h @@ -10,6 +10,4 @@ #include -extern const struct sof_ipc_user_abi_version user_abi_version; - #endif /* __IPC_FW_READY_METADATA_H__ */ diff --git a/src/ipc/CMakeLists.txt b/src/ipc/CMakeLists.txt index c6187b248b11..2eadf98e8a15 100644 --- a/src/ipc/CMakeLists.txt +++ b/src/ipc/CMakeLists.txt @@ -21,22 +21,3 @@ if (CONFIG_HOST_PTABLE) add_local_sources(sof ipc-host-ptable.c) endif() - -add_library(data_structs STATIC "") - -# define compiler version -set_property(TARGET data_structs APPEND - PROPERTY COMPILE_DEFINITIONS - XCC_TOOLS_VERSION="${XCC_TOOLS_VERSION}") - -# and optimization settings -get_optimization_flag(optimization_flag) -set_property(TARGET data_structs APPEND - PROPERTY COMPILE_DEFINITIONS - CC_OPTIMIZE_FLAGS="-${optimization_flag}") - -add_local_sources(data_structs - user_abi_version.c) - -target_link_libraries(data_structs sof_options) -target_link_libraries(sof_static_libraries INTERFACE data_structs) diff --git a/src/ipc/user_abi_version.c b/src/ipc/user_abi_version.c deleted file mode 100644 index b63c1ea66c37..000000000000 --- a/src/ipc/user_abi_version.c +++ /dev/null @@ -1,18 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2020 Intel Corporation. All rights reserved. -// -// Author: Marcin Maka - -#include -#include - -const struct sof_ipc_user_abi_version user_abi_version - __attribute__((section(".fw_ready_metadata"))) = { - .ext_hdr = { - .hdr.cmd = SOF_IPC_FW_READY, - .hdr.size = sizeof(struct sof_ipc_user_abi_version), - .type = SOF_IPC_EXT_USER_ABI_INFO, - }, - .abi_dbg_version = SOF_ABI_DBG_VERSION, -}; diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c index c01d4790eef3..e04888fbb433 100644 --- a/src/platform/baytrail/platform.c +++ b/src/platform/baytrail/platform.c @@ -151,14 +151,9 @@ static SHARED_DATA struct timer arch_timer = { int platform_boot_complete(uint32_t boot_message) { - uint32_t mb_offset = 0; uint64_t outbox = MAILBOX_HOST_OFFSET >> 3; - mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); - mb_offset = mb_offset + sizeof(ready); - - mailbox_dspbox_write(mb_offset, &user_abi_version, - user_abi_version.ext_hdr.hdr.size); + mailbox_dspbox_write(0, &ready, sizeof(ready)); /* now interrupt host to tell it we are done booting */ shim_write(SHIM_IPCDL, SOF_IPC_FW_READY | outbox); diff --git a/src/platform/haswell/platform.c b/src/platform/haswell/platform.c index e58a6bb2ce02..47f43a5c32b9 100644 --- a/src/platform/haswell/platform.c +++ b/src/platform/haswell/platform.c @@ -132,14 +132,9 @@ SHARED_DATA struct timer timer = { int platform_boot_complete(uint32_t boot_message) { - uint32_t mb_offset = 0; uint32_t outbox = MAILBOX_HOST_OFFSET >> 3; - mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); - mb_offset = mb_offset + sizeof(ready); - - mailbox_dspbox_write(mb_offset, &user_abi_version, - user_abi_version.ext_hdr.hdr.size); + mailbox_dspbox_write(0, &ready, sizeof(ready)); /* now interrupt host to tell it we are done booting */ shim_write(SHIM_IPCD, outbox | SHIM_IPCD_BUSY); diff --git a/src/platform/imx8/platform.c b/src/platform/imx8/platform.c index 66c18f244b57..67f4f0ef8834 100644 --- a/src/platform/imx8/platform.c +++ b/src/platform/imx8/platform.c @@ -131,13 +131,7 @@ SHARED_DATA struct timer timer = { int platform_boot_complete(uint32_t boot_message) { - uint32_t mb_offset = 0; - - mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); - mb_offset = mb_offset + sizeof(ready); - - mailbox_dspbox_write(mb_offset, &user_abi_version, - user_abi_version.ext_hdr.hdr.size); + mailbox_dspbox_write(0, &ready, sizeof(ready)); /* now interrupt host to tell it we are done booting */ imx_mu_xcr_rmw(IMX_MU_xCR_GIRn(1), 0); diff --git a/src/platform/imx8m/platform.c b/src/platform/imx8m/platform.c index aae8e0829542..349baabedb72 100644 --- a/src/platform/imx8m/platform.c +++ b/src/platform/imx8m/platform.c @@ -130,13 +130,7 @@ SHARED_DATA struct timer timer = { int platform_boot_complete(uint32_t boot_message) { - uint32_t mb_offset = 0; - - mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); - mb_offset = mb_offset + sizeof(ready); - - mailbox_dspbox_write(mb_offset, &user_abi_version, - user_abi_version.ext_hdr.hdr.size); + mailbox_dspbox_write(0, &ready, sizeof(ready)); /* now interrupt host to tell it we are done booting */ imx_mu_xcr_rmw(IMX_MU_xCR_GIRn(1), 0); diff --git a/src/platform/intel/cavs/platform.c b/src/platform/intel/cavs/platform.c index 4584ab79742e..29cf850e3b6c 100644 --- a/src/platform/intel/cavs/platform.c +++ b/src/platform/intel/cavs/platform.c @@ -292,18 +292,12 @@ int platform_boot_complete(uint32_t boot_message) int platform_boot_complete(uint32_t boot_message) { - uint32_t mb_offset = 0; - #if CONFIG_TIGERLAKE && !CONFIG_CAVS_LPRO_ONLY /* TGL specific HW recommended flow */ pm_runtime_get(PM_RUNTIME_DSP, PWRD_BY_HPRO | (PLATFORM_CORE_COUNT - 1)); #endif - mailbox_dspbox_write(mb_offset, &ready, sizeof(ready)); - mb_offset = mb_offset + sizeof(ready); - - mailbox_dspbox_write(mb_offset, &user_abi_version, - user_abi_version.ext_hdr.hdr.size); + mailbox_dspbox_write(0, &ready, sizeof(ready)); /* tell host we are ready */ #if CAVS_VERSION == CAVS_VERSION_1_5