Skip to content
6 changes: 6 additions & 0 deletions rimage/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ static int elf_read_sections(struct image *image, struct module *module,

module->logs_index = -EINVAL;

fprintf(stdout, "info: ignore .static_uuids section for bootloader module\n");
module->uids_index = -EINVAL;

fprintf(stdout, "info: ignore .fw_ready"
" section for bootloader module\n");

Expand All @@ -94,6 +97,9 @@ static int elf_read_sections(struct image *image, struct module *module,
module->logs_index = elf_find_section(image, module,
".static_log_entries");

module->uids_index = elf_find_section(image, module,
".static_uuid_entries");

module->fw_ready_index = elf_find_section(image, module,
".fw_ready");
if (module->fw_ready_index < 0)
Expand Down
10 changes: 10 additions & 0 deletions rimage/file_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
#define SND_SOF_LOGS_SIG_SIZE 4
#define SND_SOF_LOGS_SIG "Logs"

#define SND_SOF_UIDS_SIG_SIZE 4
#define SND_SOF_UIDS_SIG "Uids"

/*
* Logs dictionary file header.
*/
Expand All @@ -28,4 +31,11 @@ struct snd_sof_logs_header {
uint32_t data_offset; /* offset to first entry in this file */
struct sof_ipc_fw_version version;
};

struct snd_sof_uids_header {
unsigned char sig[SND_SOF_UIDS_SIG_SIZE]; /* "Uids" */
uint32_t base_address;
uint32_t data_length;
uint32_t data_offset;
};
#endif
67 changes: 65 additions & 2 deletions rimage/file_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ static int simple_write_firmware(struct image *image)
return 0;
}

int write_logs_dictionary(struct image *image)
static int write_logs_dictionary(struct image *image)
{
struct snd_sof_logs_header header;
int i, ret = 0;
Expand Down Expand Up @@ -497,7 +497,7 @@ int write_logs_dictionary(struct image *image)

fprintf(stdout, "logs dictionary: size %u\n",
header.data_length + header.data_offset);
fprintf(stdout, "including fw version of size: %lu\n\n",
fprintf(stdout, "including fw version of size: %lu\n",
(unsigned long)sizeof(header.version));
}
}
Expand All @@ -508,6 +508,69 @@ int write_logs_dictionary(struct image *image)
return ret;
}

static int write_uids_dictionary(struct image *image)
{
struct snd_sof_uids_header header;
Elf32_Shdr *section;
int i, ret = 0;
void *buffer = NULL;

memcpy(header.sig, SND_SOF_UIDS_SIG, SND_SOF_UIDS_SIG_SIZE);
header.data_offset = sizeof(struct snd_sof_uids_header);

for (i = 0; i < image->num_modules; i++) {
struct module *module = &image->module[i];

if (module->uids_index <= 0)
continue;
section = &module->section[module->uids_index];

header.base_address = section->vaddr;
header.data_length = section->size;

fwrite(&header, sizeof(struct snd_sof_uids_header), 1,
image->ldc_out_fd);

buffer = calloc(1, section->size);
if (!buffer)
return -ENOMEM;
fseek(module->fd, section->off, SEEK_SET);
if (fread(buffer, 1, section->size, module->fd) !=
section->size) {
fprintf(stderr, "error: can't read uids section %d\n",
-errno);
ret = -errno;
goto out;
}
if (fwrite(buffer, 1, section->size, image->ldc_out_fd) !=
section->size) {
fprintf(stderr, "error: cant't write section %d\n",
-errno);
ret = -errno;
goto out;
}
fprintf(stdout, "uids dictionary: size %u\n",
header.data_length + header.data_offset);
}
out:
free(buffer);
return ret;
}

int write_dictionaries(struct image *image)
{
int ret = 0;

ret = write_logs_dictionary(image);
if (ret)
goto out;

ret = write_uids_dictionary(image);

out:
return ret;
}

const struct adsp machine_byt = {
.name = "byt",
.mem_zones = {
Expand Down
2 changes: 1 addition & 1 deletion rimage/rimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ int main(int argc, char *argv[])
ret = -EINVAL;
goto out;
}
ret = write_logs_dictionary(&image);
ret = write_dictionaries(&image);
out:
/* close files */
if (image.out_fd)
Expand Down
3 changes: 2 additions & 1 deletion rimage/rimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ struct module {
int fw_size;
int bss_index;
int logs_index;
int uids_index;
int fw_ready_index;

/* sizes do not include any gaps */
Expand Down Expand Up @@ -151,7 +152,7 @@ struct adsp {
int exec_boot_ldr;
};

int write_logs_dictionary(struct image *image);
int write_dictionaries(struct image *image);

void module_sha256_create(struct image *image);
void module_sha_update(struct image *image, uint8_t *data, size_t bytes);
Expand Down
6 changes: 6 additions & 0 deletions src/audio/asrc/asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sof/drivers/ipc.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/math/numbers.h>
#include <sof/trace/trace.h>
#include <sof/common.h>
Expand Down Expand Up @@ -45,6 +46,10 @@ typedef void (*asrc_proc_func)(struct comp_dev *dev,

static const struct comp_driver comp_asrc;

/* c8ec72f6-8526-4faf-9d39-a23d0b541de2 */
DECLARE_SOF_UUID("asrc", asrc_uuid, 0xc8ec72f6, 0x8526, 0x4faf,
0x9d, 0x39, 0xa2, 0x3d, 0x0b, 0x54, 0x1d, 0xe2);

/* asrc component private data */
struct comp_data {
struct asrc_farrow *asrc_obj; /* ASRC core data */
Expand Down Expand Up @@ -892,6 +897,7 @@ static int asrc_reset(struct comp_dev *dev)

static const struct comp_driver comp_asrc = {
.type = SOF_COMP_ASRC,
.uid = SOF_UUID(asrc_uuid),
.ops = {
.new = asrc_new,
.free = asrc_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <sof/lib/dma.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/string.h>
#include <sof/trace/trace.h>
Expand All @@ -34,6 +35,10 @@

static const struct comp_driver comp_dai;

/* c2b00d27-ffbc-4150-a51a-245c79c5e54b */
DECLARE_SOF_UUID("dai", dai_comp_uuid, 0xc2b00d27, 0xffbc, 0x4150,
0xa5, 0x1a, 0x24, 0x5c, 0x79, 0xc5, 0xe5, 0x4b);

struct dai_data {
/* local DMA config */
struct dma_chan_data *chan;
Expand Down Expand Up @@ -878,6 +883,7 @@ static int dai_ts_get(struct comp_dev *dev, struct timestamp_data *tsd)

static const struct comp_driver comp_dai = {
.type = SOF_COMP_DAI,
.uid = SOF_UUID(dai_comp_uuid),
.ops = {
.new = dai_new,
.free = dai_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/detect_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <sof/lib/wait.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/math/numbers.h>
#include <sof/string.h>
Expand Down Expand Up @@ -49,6 +50,10 @@

static const struct comp_driver comp_keyword;

/* eba8d51f-7827-47b5-82ee-de6e7743af67 */
DECLARE_SOF_UUID("kd-test", keyword_uuid, 0xeba8d51f, 0x7827, 0x47b5,
0x82, 0xee, 0xde, 0x6e, 0x77, 0x43, 0xaf, 0x67);

struct model_data {
uint32_t data_size;
void *data;
Expand Down Expand Up @@ -782,6 +787,7 @@ static int test_keyword_prepare(struct comp_dev *dev)

static const struct comp_driver comp_keyword = {
.type = SOF_COMP_KEYWORD_DETECT,
.uid = SOF_UUID(keyword_uuid),
.ops = {
.new = test_keyword_new,
.free = test_keyword_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/eq_fir/eq_fir.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sof/drivers/ipc.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/platform.h>
#include <sof/string.h>
Expand Down Expand Up @@ -43,6 +44,10 @@

static const struct comp_driver comp_eq_fir;

/* 43a90ce7-f3a5-41df-ac06-ba98651ae6a3 */
DECLARE_SOF_UUID("eq-fir", eq_fir_uuid, 0x43a90ce7, 0xf3a5, 0x41df,
0xac, 0x06, 0xba, 0x98, 0x65, 0x1a, 0xe6, 0xa3);

/* src component private data */
struct comp_data {
struct fir_state_32x16 fir[PLATFORM_MAX_CHANNELS]; /**< filters state */
Expand Down Expand Up @@ -842,6 +847,7 @@ static int eq_fir_reset(struct comp_dev *dev)

static const struct comp_driver comp_eq_fir = {
.type = SOF_COMP_EQ_FIR,
.uid = SOF_UUID(eq_fir_uuid),
.ops = {
.new = eq_fir_new,
.free = eq_fir_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/eq_iir/eq_iir.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <sof/drivers/ipc.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/platform.h>
#include <sof/string.h>
Expand All @@ -32,6 +33,10 @@

static const struct comp_driver comp_eq_iir;

/* 5150c0e6-27f9-4ec8-8351-c705b642d12f */
DECLARE_SOF_UUID("eq-iir", eq_iir_uuid, 0x5150c0e6, 0x27f9, 0x4ec8,
0x83, 0x51, 0xc7, 0x05, 0xb6, 0x42, 0xd1, 0x2f);

/* IIR component private data */
struct comp_data {
struct iir_state_df2t iir[PLATFORM_MAX_CHANNELS]; /**< filters state */
Expand Down Expand Up @@ -937,6 +942,7 @@ static int eq_iir_reset(struct comp_dev *dev)

static const struct comp_driver comp_eq_iir = {
.type = SOF_COMP_EQ_IIR,
.uid = SOF_UUID(eq_iir_uuid),
.ops = {
.new = eq_iir_new,
.free = eq_iir_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <sof/lib/mailbox.h>
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/math/numbers.h>
#include <sof/string.h>
Expand All @@ -31,6 +32,10 @@

static const struct comp_driver comp_host;

/* 8b9d100c-6d78-418f-90a3-e0e805d0852b */
DECLARE_SOF_UUID("host", host_uuid, 0x8b9d100c, 0x6d78, 0x418f,
0x90, 0xa3, 0xe0, 0xe8, 0x05, 0xd0, 0x85, 0x2b);

/**
* \brief Host buffer info.
*/
Expand Down Expand Up @@ -819,6 +824,7 @@ static int host_set_attribute(struct comp_dev *dev, uint32_t type,

static const struct comp_driver comp_host = {
.type = SOF_COMP_HOST,
.uid = SOF_UUID(host_uuid),
.ops = {
.new = host_new,
.free = host_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/kpb.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <sof/lib/memory.h>
#include <sof/lib/notifier.h>
#include <sof/lib/pm_runtime.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/math/numbers.h>
#include <sof/platform.h>
Expand All @@ -45,6 +46,10 @@

static const struct comp_driver comp_kpb;

/* d8218443-5ff3-4a4c-b388-6cfe07b9562e */
DECLARE_SOF_UUID("kpb", kpb_uuid, 0xd8218443, 0x5ff3, 0x4a4c,
0xb3, 0x88, 0x6c, 0xfe, 0x07, 0xb9, 0x56, 0x2e);

/* KPB private data, runtime data */
struct comp_data {
uint64_t state_log; /**< keeps record of KPB recent states */
Expand Down Expand Up @@ -1527,6 +1532,7 @@ static inline void kpb_change_state(struct comp_data *kpb,

static const struct comp_driver comp_kpb = {
.type = SOF_COMP_KPB,
.uid = SOF_UUID(kpb_uuid),
.ops = {
.new = kpb_new,
.free = kpb_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/mixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sof/drivers/ipc.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/math/numbers.h>
#include <sof/platform.h>
Expand All @@ -29,6 +30,10 @@

static const struct comp_driver comp_mixer;

/* bc06c037-12aa-417c-9a97-89282e321a76 */
DECLARE_SOF_UUID("mixer", mixer_uuid, 0xbc06c037, 0x12aa, 0x417c,
0x9a, 0x97, 0x89, 0x28, 0x2e, 0x32, 0x1a, 0x76);

/* mixer component private data */
struct mixer_data {
void (*mix_func)(struct comp_dev *dev, struct audio_stream *sink,
Expand Down Expand Up @@ -436,6 +441,7 @@ static int mixer_prepare(struct comp_dev *dev)

static const struct comp_driver comp_mixer = {
.type = SOF_COMP_MIXER,
.uid = SOF_UUID(mixer_uuid),
.ops = {
.new = mixer_new,
.free = mixer_free,
Expand Down
6 changes: 6 additions & 0 deletions src/audio/mux/mux.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sof/drivers/ipc.h>
#include <sof/lib/alloc.h>
#include <sof/lib/memory.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
#include <sof/math/numbers.h>
#include <sof/platform.h>
Expand All @@ -31,6 +32,10 @@

static const struct comp_driver comp_mux;

/* c4b26868-1430-470e-a089-15d1c77f851a */
DECLARE_SOF_UUID("mux", mux_uuid, 0xc4b26868, 0x1430, 0x470e,
0xa0, 0x89, 0x15, 0xd1, 0xc7, 0x7f, 0x85, 0x1a);

static int mux_set_values(struct comp_dev *dev, struct comp_data *cd,
struct sof_mux_config *cfg)
{
Expand Down Expand Up @@ -502,6 +507,7 @@ static SHARED_DATA struct comp_driver_info comp_mux_info = {

static const struct comp_driver comp_demux = {
.type = SOF_COMP_DEMUX,
.uid = SOF_UUID(mux_uuid),
.ops = {
.new = mux_new,
.free = mux_free,
Expand Down
Loading