Skip to content

Commit bdb5afe

Browse files
committed
ext_manifest: Add UUID dictionary
Such a dictionary will be used in kernel code to translate UUID value to memory address used in DSP in runtime. Translation will be used for the process component creation and runtime trace filtering. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
1 parent 0a3b13f commit bdb5afe

File tree

4 files changed

+40
-0
lines changed

4 files changed

+40
-0
lines changed

src/include/kernel/ext_manifest.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,16 @@ struct ext_man_probe_support {
5353
struct sof_ipc_probe_support probe;
5454
} __packed;
5555

56+
/* UUID dictionary */
57+
struct ext_man_uuid_dict_elem {
58+
uint32_t addr;
59+
uint8_t uuid[16];
60+
} __packed;
61+
62+
struct ext_man_uuid_dict {
63+
struct ext_man_elem_header hdr;
64+
/* filled in rimage by uuid_section content */
65+
struct ext_man_uuid_dict_elem entries[];
66+
} __packed;
67+
5668
#endif /* __KERNEL_EXT_MANIFEST_H__ */

src/include/sof/lib/uuid.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define __SOF_LIB_UUID_H__
1010

1111
#include <sof/common.h>
12+
#include <kernel/ext_manifest.h>
1213

1314
/** \addtogroup uuid_api UUID API
1415
* UUID API specification.
@@ -78,6 +79,17 @@ struct sof_uuid {
7879
.d = {vd0, vd1, vd2, vd3, vd4, vd5, vd6, vd7}}, \
7980
sizeof(entity_name), \
8081
entity_name \
82+
}; \
83+
__section(".fw_metadata_uuid_dict") \
84+
static const struct ext_man_uuid_dict_elem \
85+
ext_man_uuid_ ## uuid_name = { \
86+
.addr = (uint32_t)&uuid_name, \
87+
.uuid = { (va) & 0xFF, ((va) >> 8) & 0xFF, \
88+
((va) >> 16) & 0xFF, ((va) >> 24) & 0xFF, \
89+
(vb) & 0xFF, ((vb) >> 8) & 0xFF, \
90+
(vc) & 0xFF, ((vc) >> 8) & 0xFF, \
91+
(vd0), (vd1), (vd2), (vd3), \
92+
(vd4), (vd5), (vd6), (vd7) } \
8193
}
8294

8395
/** \brief Creates local unique 32-bit representation of UUID structure.

src/init/ext_manifest.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,14 @@ const struct ext_man_probe_support ext_man_probe
7070
#endif
7171
},
7272
};
73+
74+
/*
75+
* this element size will be updated by rimage,
76+
* so size shouldn't be aligned yet.
77+
* List of entries will be fetched from `fw_metadata_uuid_dict` section.
78+
*/
79+
const struct ext_man_uuid_dict ext_man_uuid_header
80+
__aligned(EXT_MAN_ALIGN) __section(".fw_metadata") = {
81+
.hdr.type = EXT_MAN_ELEM_UUID_DICT,
82+
.hdr.elem_size = sizeof(struct ext_man_uuid_dict),
83+
};

src/platform/cannonlake/cannonlake.x.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,9 @@ SECTIONS
568568
KEEP (*(.fw_metadata))
569569
. = ALIGN(_EXT_MAN_ALIGN_);
570570
} >fw_metadata_seg :metadata_entries_phdr
571+
572+
.fw_metadata_uuid_dict (COPY) : ALIGN(1024)
573+
{
574+
KEEP (*(.fw_metadata_uuid_dict))
575+
} >fw_metadata_seg :metadata_entries_phdr
571576
}

0 commit comments

Comments
 (0)