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
23 changes: 15 additions & 8 deletions smex/ldc.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 <kernel/abi.h>
#include <kernel/ext_manifest.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -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;

Expand All @@ -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.
Expand All @@ -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;
}
Expand Down
10 changes: 0 additions & 10 deletions src/include/kernel/ext_manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@
#include <rimage/sof/kernel/ext_manifest.h>
#include <stdint.h>

/* 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 */
Expand Down
2 changes: 2 additions & 0 deletions src/include/sof/compiler_attributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
#define __aligned(x) __attribute__((__aligned__(x)))

#define __section(x) __attribute__((section(x)))

#define __unused __attribute__((unused))
4 changes: 0 additions & 4 deletions src/include/sof/fw-ready-metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,4 @@

#include <ipc/info.h>

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;

#endif /* __IPC_FW_READY_METADATA_H__ */
21 changes: 0 additions & 21 deletions src/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +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
cc_version.c
probe_support.c
user_abi_version.c)

target_link_libraries(data_structs sof_options)
target_link_libraries(sof_static_libraries INTERFACE data_structs)
37 changes: 0 additions & 37 deletions src/ipc/cc_version.c

This file was deleted.

23 changes: 0 additions & 23 deletions src/ipc/probe_support.c

This file was deleted.

18 changes: 0 additions & 18 deletions src/ipc/user_abi_version.c

This file was deleted.

130 changes: 56 additions & 74 deletions src/platform/baytrail/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
{
.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,
.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_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 */
Expand All @@ -151,27 +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, &sram_window,
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;

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);
Expand Down
Loading