From a01016f945e67900313c85ca3ba16dc6feb84e78 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 11 Nov 2019 13:50:00 +0000 Subject: [PATCH 001/639] Initial commit --- LICENSE | 29 +++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000000..2ab88408298f --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2019, Sound Open Firmware +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 000000000000..c5c67ede5194 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# rimage +DSP firmware image creation and signing tool From b537522a6501f0f7249f26c24eb1a4d8679f4bf1 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 13 Feb 2018 20:29:40 +0000 Subject: [PATCH 002/639] rimage: import rimage image creation and signing tool rimage is being moved from tools repo to sof repo since there is now a cyclic dependency between both repos and sof needs rimage for it's build. Signed-off-by: Liam Girdwood --- rimage/Makefile.am | 25 ++ rimage/cse.c | 45 ++++ rimage/cse.h | 42 ++++ rimage/css.c | 70 ++++++ rimage/css.h | 69 ++++++ rimage/elf.c | 535 +++++++++++++++++++++++++++++++++++++++++++ rimage/file_format.h | 117 ++++++++++ rimage/file_simple.c | 311 +++++++++++++++++++++++++ rimage/hash.c | 72 ++++++ rimage/man_apl.c | 144 ++++++++++++ rimage/man_cnl.c | 143 ++++++++++++ rimage/manifest.c | 528 ++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.h | 90 ++++++++ rimage/pkcs1_5.c | 142 ++++++++++++ rimage/plat_auth.c | 50 ++++ rimage/plat_auth.h | 92 ++++++++ rimage/rimage.c | 136 +++++++++++ rimage/rimage.h | 170 ++++++++++++++ 18 files changed, 2781 insertions(+) create mode 100644 rimage/Makefile.am create mode 100644 rimage/cse.c create mode 100644 rimage/cse.h create mode 100644 rimage/css.c create mode 100644 rimage/css.h create mode 100644 rimage/elf.c create mode 100644 rimage/file_format.h create mode 100644 rimage/file_simple.c create mode 100644 rimage/hash.c create mode 100644 rimage/man_apl.c create mode 100644 rimage/man_cnl.c create mode 100644 rimage/manifest.c create mode 100644 rimage/manifest.h create mode 100644 rimage/pkcs1_5.c create mode 100644 rimage/plat_auth.c create mode 100644 rimage/plat_auth.h create mode 100644 rimage/rimage.c create mode 100644 rimage/rimage.h diff --git a/rimage/Makefile.am b/rimage/Makefile.am new file mode 100644 index 000000000000..467bfe638b50 --- /dev/null +++ b/rimage/Makefile.am @@ -0,0 +1,25 @@ +SUBDIRS=keys + +bin_PROGRAMS = rimage + +noinst_HEADERS = \ + rimage.h \ + css.h \ + cse.h \ + plat_auth.h \ + manifest.h \ + file_format.h + +rimage_SOURCES = \ + file_simple.c \ + man_apl.c \ + man_cnl.c \ + cse.c \ + css.c \ + plat_auth.c \ + hash.c \ + pkcs1_5.c \ + manifest.c \ + elf.c \ + rimage.c + diff --git a/rimage/cse.c b/rimage/cse.c new file mode 100644 index 000000000000..b5604153f120 --- /dev/null +++ b/rimage/cse.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include "rimage.h" +#include "cse.h" +#include "manifest.h" + +void ri_cse_create(struct image *image) +{ + struct CsePartitionDirHeader *cse_hdr = image->fw_image; + struct sof_man_adsp_meta_file_ext *meta = image->fw_image + + MAN_META_EXT_OFFSET; + struct CsePartitionDirEntry *cse_entry = + image->fw_image + sizeof(*cse_hdr); + uint8_t csum = 0, *val = image->fw_image; + int i, size; + + fprintf(stdout, " cse: completing CSE manifest\n"); + + cse_entry[2].length = meta->comp_desc[0].limit_offset - + MAN_DESC_OFFSET; + + /* calculate checksum using BSD algo */ + size = sizeof(*cse_hdr) + sizeof(*cse_entry) * MAN_CSE_PARTS; + for (i = 0; i < size; i++) { + if (i == 11) + continue; + csum += val[i]; + } + cse_hdr->checksum = 0x100 - csum; +} diff --git a/rimage/cse.h b/rimage/cse.h new file mode 100644 index 000000000000..28650dadec2b --- /dev/null +++ b/rimage/cse.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CSE_H__ +#define __CSE_H__ + +#include + +struct image; + +#define CSE_HEADER_MAKER 0x44504324 /* "DPC$" */ + +struct CsePartitionDirHeader { + uint32_t header_marker; + uint32_t nb_entries; + uint8_t header_version; + uint8_t entry_version; + uint8_t header_length; + uint8_t checksum; + uint8_t partition_name[4]; +} __attribute__((packed)); + +struct CsePartitionDirEntry { + uint8_t entry_name[12]; + uint32_t offset; + uint32_t length; + uint32_t reserved; +} __attribute__((packed)); + +void ri_cse_create(struct image *image); + +#endif diff --git a/rimage/css.c b/rimage/css.c new file mode 100644 index 000000000000..bc69cf10b55e --- /dev/null +++ b/rimage/css.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include "rimage.h" +#include "css.h" +#include "manifest.h" + +void ri_css_hdr_create(struct image *image) +{ + struct css_header *css = image->fw_image + MAN_CSS_HDR_OFFSET; + struct tm *date; + struct timeval tv; + int val; + + fprintf(stdout, " cse: completing CSS manifest\n"); + + /* get local time and date */ + gettimeofday(&tv, NULL); + date = localtime(&tv.tv_sec); + date->tm_year += 1900; + fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", + date->tm_year, date->tm_mon, date->tm_mday); + + /* year yYyy */ + val = date->tm_year / 1000; + css->date |= val << 28; + date->tm_year -= val * 1000; + /* year yyYy */ + val = date->tm_year / 100; + css->date |= val << 24; + date->tm_year -= val * 100; + /* year yyyY */ + val = date->tm_year / 10; + css->date |= val << 20; + date->tm_year -= val * 10; + /* year Yyyy */ + val = date->tm_year; + css->date |= val << 16; + + /* month Mm - for some reason month starts at 0 */ + val = ++date->tm_mon / 10; + css->date |= val << 12; + date->tm_mon -= (val * 10); + /* month mM */ + val = date->tm_mon; + css->date |= val << 8; + + /* Day Dd */ + val = date->tm_mday / 10; + css->date |= val << 4; + date->tm_mday -= (val * 10); + /* Day dD */ + val = date->tm_mday; + css->date |= val << 0; +} diff --git a/rimage/css.h b/rimage/css.h new file mode 100644 index 000000000000..0516f531ba9a --- /dev/null +++ b/rimage/css.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __CSS_H__ +#define __CSS_H__ + +#include + +struct image; + +#define MAN_CSS_MOD_TYPE 4 +#define MAN_CSS_HDR_SIZE 161 /* in words */ +#define MAN_CSS_HDR_VERSION 0x10000 +#define MAN_CSS_MOD_VENDOR 0x8086 +#define MAN_CSS_HDR_ID {'$', 'M', 'N', '2'} + +#define MAN_CSS_KEY_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) +#define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) +#define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) +#define MAN_CSS_MAN_SIZE \ + (sizeof(struct fw_image_manifest) >> 2) + +/* + * RSA Key and Crypto + */ +#define MAN_RSA_KEY_MODULUS_LEN 256 +#define MAN_RSA_KEY_EXPONENT_LEN 4 +#define MAN_RSA_SIGNATURE_LEN 256 + +struct fw_version { + uint16_t major_version; + uint16_t minor_version; + uint16_t hotfix_version; + uint16_t build_version; +} __attribute__((packed)); + +struct css_header { + uint32_t header_type; + uint32_t header_len; + uint32_t header_version; + uint32_t reserved0; /* must be 0x0 */ + uint32_t module_vendor; + uint32_t date; + uint32_t size; + uint8_t header_id[4]; + uint32_t padding; /* must be 0x0 */ + struct fw_version version; + uint32_t svn; + uint32_t reserved1[18]; /* must be 0x0 */ + uint32_t modulus_size; + uint32_t exponent_size; + uint8_t modulus[MAN_RSA_KEY_MODULUS_LEN]; + uint8_t exponent[MAN_RSA_KEY_EXPONENT_LEN]; + uint8_t signature[MAN_RSA_SIGNATURE_LEN]; +} __attribute__((packed)); + +void ri_css_hdr_create(struct image *image); + +#endif diff --git a/rimage/elf.c b/rimage/elf.c new file mode 100644 index 000000000000..672d6e3997bc --- /dev/null +++ b/rimage/elf.c @@ -0,0 +1,535 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include "rimage.h" +#include "cse.h" +#include "manifest.h" + +static int elf_read_sections(struct image *image, struct module *module) +{ + Elf32_Ehdr *hdr = &module->hdr; + Elf32_Shdr *section = module->section; + size_t count; + int i, ret; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int man_section_idx; + + /* read in section header */ + ret = fseek(module->fd, hdr->e_shoff, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to %s section header %d\n", + module->elf_file, ret); + return ret; + } + + /* allocate space for each section header */ + section = calloc(sizeof(Elf32_Shdr), hdr->e_shnum); + if (section == NULL) + return -ENOMEM; + module->section = section; + + /* read in sections */ + count = fread(section, sizeof(Elf32_Shdr), hdr->e_shnum, module->fd); + if (count != hdr->e_shnum) { + fprintf(stderr, "error: failed to read %s section header %d\n", + module->elf_file, -errno); + return -errno; + } + + /* find manifest module data */ + man_section_idx = elf_find_section(image, module, ".bss"); + if (man_section_idx < 0) { + return -EINVAL; + } + module->bss_index = man_section_idx; + + fprintf(stdout, " BSS module metadata section at index %d\n", + man_section_idx); + + /* parse each section */ + for (i = 0; i < hdr->e_shnum; i++) { + + /* only write valid sections */ + if (!(section[i].sh_flags & valid)) + continue; + + switch (section[i].sh_type) { + case SHT_NOBITS: + /* bss */ + module->bss_size += section[i].sh_size; + module->num_bss++; + break; + case SHT_PROGBITS: + /* text or data */ + module->fw_size += section[i].sh_size; + + if (section[i].sh_flags & SHF_EXECINSTR) + module->text_size += section[i].sh_size; + else + module->data_size += section[i].sh_size; + break; + default: + continue; + } + + module->num_sections++; + + if (!image->verbose) + continue; + + fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_type); + fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_flags); + fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_addr); + fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_offset); + fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_size); + fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, + i, section[i].sh_link); + fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, + i, section[i].sh_info); + } + + return 0; +} + +static int elf_read_programs(struct image *image, struct module *module) +{ + Elf32_Ehdr *hdr = &module->hdr; + Elf32_Phdr *prg = module->prg; + size_t count; + int i, ret; + + /* read in program header */ + ret = fseek(module->fd, hdr->e_phoff, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: cant seek to %s program header %d\n", + module->elf_file, ret); + return ret; + } + + /* allocate space for programs */ + prg = calloc(sizeof(Elf32_Phdr), hdr->e_phnum); + if (prg == NULL) + return -ENOMEM; + module->prg = prg; + + /* read in programs */ + count = fread(prg, sizeof(Elf32_Phdr), hdr->e_phnum, module->fd); + if (count != hdr->e_phnum) { + fprintf(stderr, "error: failed to read %s program header %d\n", + module->elf_file, -errno); + return -errno; + } + + /* check each program */ + for (i = 0; i < hdr->e_phnum; i++) { + + if (prg[i].p_filesz == 0) + continue; + + if (!image->verbose) + continue; + + fprintf(stdout, "%s program-%d: \ttype\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_type); + fprintf(stdout, "%s program-%d: \toffset\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_offset); + fprintf(stdout, "%s program-%d: \tvaddr\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_vaddr); + fprintf(stdout, "%s program-%d: \tpaddr\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_paddr); + fprintf(stdout, "%s program-%d: \tfsize\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_filesz); + fprintf(stdout, "%s program-%d: \tmsize\t 0x%8.8x\n", + module->elf_file, i, prg[i].p_memsz); + fprintf(stdout, "%s program-%d: \tflags\t 0x%8.8x\n\n", + module->elf_file, i, prg[i].p_flags); + } + + return 0; +} + +static int elf_read_hdr(struct image *image, struct module *module) +{ + Elf32_Ehdr *hdr = &module->hdr; + size_t count; + + /* read in elf header */ + count = fread(hdr, sizeof(*hdr), 1, module->fd); + if (count != 1) { + fprintf(stderr, "error: failed to read %s elf header %d\n", + module->elf_file, -errno); + return -errno; + } + + if (!image->verbose) + return 0; + + fprintf(stdout, "%s elf: \tentry point\t 0x%8.8x\n", + module->elf_file, hdr->e_entry); + fprintf(stdout, "%s elf: \tprogram offset\t 0x%8.8x\n", + module->elf_file, hdr->e_phoff); + fprintf(stdout, "%s elf: \tsection offset\t 0x%8.8x\n", + module->elf_file, hdr->e_shoff); + fprintf(stdout, "%s elf: \tprogram size\t 0x%8.8x\n", + module->elf_file, hdr->e_phentsize); + fprintf(stdout, "%s elf: \tprogram count\t 0x%8.8x\n", + module->elf_file, hdr->e_phnum); + fprintf(stdout, "%s elf: \tsection size\t 0x%8.8x\n", + module->elf_file, hdr->e_shentsize); + fprintf(stdout, "%s elf: \tsection count\t 0x%8.8x\n", + module->elf_file, hdr->e_shnum); + fprintf(stdout, "%s elf: \tstring index\t 0x%8.8x\n\n", + module->elf_file, hdr->e_shstrndx); + + return 0; +} + +int elf_is_rom(struct image *image, Elf32_Shdr *section) +{ + uint32_t start, end; + + start = section->sh_addr; + end = section->sh_addr + section->sh_size; + + if (start < image->adsp->rom_base || + start > image->adsp->rom_base + image->adsp->rom_size) + return 0; + if (end < image->adsp->rom_base || + end > image->adsp->rom_base + image->adsp->rom_size) + return 0; + return 1; +} + +static void elf_module_size(struct image *image, struct module *module, + Elf32_Shdr *section, int index) +{ + switch (section->sh_type) { + case SHT_PROGBITS: + /* text or data */ + if (section->sh_flags & SHF_EXECINSTR) { + /* text */ + if (module->text_start > section->sh_addr) + module->text_start = section->sh_addr; + if (module->text_end < section->sh_addr + section->sh_size) + module->text_end = section->sh_addr + section->sh_size; + + fprintf(stdout, "\tTEXT\n"); + } else { + /* initialized data, also calc the writable sections */ + if (module->data_start > section->sh_addr) + module->data_start = section->sh_addr; + if (module->data_end < section->sh_addr + section->sh_size) + module->data_end = section->sh_addr + section->sh_size; + + fprintf(stdout, "\tDATA\n"); + } + break; + case SHT_NOBITS: + /* bss */ + if (index == module->bss_index) { + /* updated the .bss segment */ + module->bss_start = section->sh_addr; + module->bss_end = section->sh_addr + section->sh_size; + fprintf(stdout, "\tBSS\n"); + } else { + fprintf(stdout, "\tHEAP\n"); + } + break; + default: + break; + } +} + +static void elf_module_limits(struct image *image, struct module *module) +{ + Elf32_Shdr *section; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int i; + + module->text_start = module->data_start = module->bss_start = 0xffffffff; + module->text_end = module->data_end = module->bss_end = 0; + + fprintf(stdout, " Found %d sections, listing valid sections......\n", + module->hdr.e_shnum); + + fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\n"); + + /* iterate all sections and get size of segments */ + for (i = 0; i < module->hdr.e_shnum; i++) { + + section = &module->section[i]; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + if (elf_is_rom(image, section)) + continue; + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, + section->sh_addr, section->sh_addr + section->sh_size, + section->sh_size); + + /* text or data section */ + elf_module_size(image, module, section, i); + + } + + fprintf(stdout, "\n"); +} + +/* make sure no section overlap from any modules */ +int elf_validate_section(struct image *image, struct module *module, + Elf32_Shdr *section) +{ + struct module *m; + Elf32_Shdr *s; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int i, j; + + /* for each module */ + for (i = 0; i < image->num_modules; i++) { + m = &image->module[i]; + + if (m == module) + continue; + + /* for each section */ + for (j = 0; j < m->hdr.e_shnum; j++) { + s = &m->section[j]; + + if (s == section) + continue; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + /* is section non overlapping ? */ + if (section->sh_addr >= s->sh_addr && + section->sh_addr + section->sh_size <= + s->sh_addr + s->sh_size) { + goto err; + } + } + } + + return 0; + +err: + fprintf(stderr, "error: section overlap between %s and %s\n", + module->elf_file, m->elf_file); + fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", + section->sh_addr, section->sh_addr + section->sh_size, + s->sh_addr, s->sh_addr + s->sh_size); + return -EINVAL; +} + +/* make sure no section overlaps from any modules */ +int elf_validate_modules(struct image *image) +{ + struct module *module; + Elf32_Shdr *section; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int i, j, ret; + + /* for each module */ + for (i = 0; i < image->num_modules; i++) { + module = &image->module[i]; + + /* for each section */ + for (j = 0; j < module->hdr.e_shnum; j++) { + section = &module->section[j]; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + /* is section non overlapping ? */ + ret = elf_validate_section(image, module, section); + if (ret < 0) + return ret; + } + } + + return 0; +} + +int elf_find_section(struct image *image, struct module *module, + const char *name) +{ + Elf32_Ehdr *hdr = &module->hdr; + Elf32_Shdr *section, *s; + char *buffer; + size_t count; + int ret, i; + + section = &module->section[hdr->e_shstrndx]; + + /* alloc data data */ + buffer = calloc(1, section->sh_size); + if (buffer == NULL) + return -ENOMEM; + + /* read in section string data */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: cant seek to string section %d\n", ret); + goto out; + } + + count = fread(buffer, 1, section->sh_size, module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: can't read string section %d\n", -errno); + ret = -errno; + goto out; + } + + /* find section with name */ + for (i = 0; i < hdr->e_shnum; i++) { + s = &module->section[i]; + if (!strcmp(name, buffer + s->sh_name)) { + ret = i; + goto out; + } + } + + fprintf(stderr, "error: can't find section %s in module %s\n", name, + module->elf_file); + ret = -EINVAL; + +out: + free(buffer); + return ret; +} + +int elf_parse_module(struct image *image, int module_index, const char *name) +{ + struct module *module; + uint32_t rem; + int ret = 0; + + /* validate module index */ + if (module_index >= MAX_MODULES) { + fprintf(stderr, "error: too any modules\n"); + return -EINVAL; + } + + module = &image->module[module_index]; + + /* open the elf input file */ + module->fd = fopen(name, "r"); + if (module->fd == NULL) { + fprintf(stderr, "error: unable to open %s for reading %d\n", + name, errno); + return -EINVAL; + } + module->elf_file = name; + + /* read in elf header */ + ret = elf_read_hdr(image, module); + if (ret < 0) + goto hdr_err; + + /* read in programs */ + ret = elf_read_programs(image, module); + if (ret < 0) { + fprintf(stderr, "error: failed to read program sections %d\n", + ret); + goto hdr_err; + } + + /* read sections */ + ret = elf_read_sections(image, module); + if (ret < 0) { + fprintf(stderr, "error: failed to read base sections %d\n", + ret); + goto sec_err; + } + + /* check limits */ + elf_module_limits(image, module); + + elf_find_section(image, module, ""); + + fprintf(stdout, " module: input size %d (0x%x) bytes %d sections\n", + module->fw_size, module->fw_size, module->num_sections); + fprintf(stdout, " module: text %d (0x%x) bytes\n" + " data %d (0x%x) bytes\n" + " bss %d (0x%x) bytes\n\n", + module->text_size, module->text_size, + module->data_size, module->data_size, + module->bss_size, module->bss_size); + + /* file sizes round up to nearest page */ + module->text_file_size = module->text_end - module->text_start; + rem = module->text_file_size % MAN_PAGE_SIZE; + if (rem) + module->text_file_size += MAN_PAGE_SIZE - rem; + + + /* apply any base FW fixups */ + if (image->adsp->base_fw_text_size_fixup && + module->text_start == image->adsp->sram_base) { + module->text_file_size += image->adsp->base_fw_text_size_fixup; + } + + /* data section */ + module->data_file_size = module->data_end - module->data_start; + rem = module->data_file_size % MAN_PAGE_SIZE; + if (rem) + module->data_file_size += MAN_PAGE_SIZE - rem; + + /* bss section */ + module->bss_file_size = module->bss_end - module->bss_start; + rem = module->bss_file_size % MAN_PAGE_SIZE; + if (rem) + module->bss_file_size += MAN_PAGE_SIZE - rem; + + return 0; + +sec_err: + free(module->prg); +hdr_err: + fclose(module->fd); + + return ret; +} + +void elf_free_module(struct image *image, int module_index) +{ + struct module *module = &image->module[module_index]; + + free(module->prg); + free(module->section); + fclose(module->fd); +} diff --git a/rimage/file_format.h b/rimage/file_format.h new file mode 100644 index 000000000000..15302589cc40 --- /dev/null +++ b/rimage/file_format.h @@ -0,0 +1,117 @@ +/* + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + * The full GNU General Public License is included in this distribution + * in the file called LICENSE.GPL. + * + * BSD LICENSE + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Liam Girdwood + */ + + +/* + * Firmware file format . + */ + +#ifndef __INCLUDE_UAPI_SOF_FW_H__ +#define __INCLUDE_UAPI_SOF_FW_H__ + +#define SND_SOF_FW_SIG_SIZE 4 +#define SND_SOF_FW_ABI 1 +#define SND_SOF_FW_SIG "Reef" + +/* + * Firmware module is made up of 1 . N blocks of different types. The + * Block header is used to determine where and how block is to be copied in the + * DSP/host memory space. + */ +enum snd_sof_fw_blk_type { + SOF_BLK_IMAGE = 0, /* whole image - parsed by ROMs */ + SOF_BLK_TEXT = 1, + SOF_BLK_DATA = 2, + SOF_BLK_CACHE = 3, + SOF_BLK_REGS = 4, + SOF_BLK_SIG = 5, + SOF_BLK_ROM = 6, + /* add new block types here */ +}; + +struct snd_sof_blk_hdr { + enum snd_sof_fw_blk_type type; + uint32_t size; /* bytes minus this header */ + uint32_t offset; /* offset from base */ +} __attribute__((packed)); + +/* + * Firmware file is made up of 1 .. N different modules types. The module + * type is used to determine how to load and parse the module. + */ +enum snd_sof_fw_mod_type { + SOF_FW_BASE = 0, /* base firmware image */ + SOF_FW_MODULE = 1, /* firmware module */ +}; + +struct snd_sof_mod_hdr { + enum snd_sof_fw_mod_type type; + uint32_t size; /* bytes minus this header */ + uint32_t num_blocks; /* number of blocks */ +} __attribute__((packed)); + +/* + * Firmware file header. + */ +struct snd_sof_fw_header { + unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */ + uint32_t file_size; /* size of file minus this header */ + uint32_t num_modules; /* number of modules */ + uint32_t abi; /* version of header format */ +} __attribute__((packed)); + +#endif diff --git a/rimage/file_simple.c b/rimage/file_simple.c new file mode 100644 index 000000000000..dcf0d5b241b4 --- /dev/null +++ b/rimage/file_simple.c @@ -0,0 +1,311 @@ +/* + * ELF to firmware image creator. + * + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + + +#include +#include +#include +#include +#include + +#include "rimage.h" +#include "file_format.h" + +#define BYT_IRAM_BASE 0xff2c0000 +#define BYT_IRAM_HOST_OFFSET 0x0C0000 +#define BYT_IRAM_SIZE (80 * 1024) +#define BYT_DRAM_BASE 0xff300000 +#define BYT_DRAM_HOST_OFFSET 0x100000 +#define BYT_DRAM_SIZE (160 * 1024) + +#define HSW_IRAM_BASE 0x00000000 +#define HSW_IRAM_HOST_OFFSET 0x00080000 +#define HSW_IRAM_SIZE (384 * 1024) +#define HSW_DRAM_BASE 0x00400000 +#define HSW_DRAM_HOST_OFFSET 0x00000000 +#define HSW_DRAM_SIZE (512 * 1024) + +#define BDW_IRAM_BASE 0x00000000 +#define BDW_IRAM_HOST_OFFSET 0x000A0000 +#define BDW_IRAM_SIZE (320 * 1024) +#define BDW_DRAM_BASE 0x00400000 +#define BDW_DRAM_HOST_OFFSET 0x00000000 +#define BDW_DRAM_SIZE (640 * 1024) + +static int is_iram(struct image *image, Elf32_Shdr *section) +{ + const struct adsp *adsp = image->adsp; + uint32_t start, end; + + start = section->sh_addr; + end = section->sh_addr + section->sh_size; + + if (start < adsp->iram_base) + return 0; + if (start >= adsp->iram_base + adsp->iram_size) + return 0; + if (end > adsp->iram_base + adsp->iram_size) + return 0; + return 1; +} + +static int is_dram(struct image *image, Elf32_Shdr *section) +{ + const struct adsp *adsp = image->adsp; + uint32_t start, end; + + start = section->sh_addr; + end = section->sh_addr + section->sh_size; + + if (start < adsp->dram_base) + return 0; + if (start >= adsp->dram_base + adsp->dram_size) + return 0; + if (end > adsp->dram_base + adsp->dram_size) + return 0; + return 1; +} + +static int block_idx; + +static int write_block(struct image *image, struct module *module, + Elf32_Shdr *section) +{ + const struct adsp *adsp = image->adsp; + struct snd_sof_blk_hdr block; + size_t count; + void *buffer; + int ret; + + block.size = section->sh_size; + + if (is_iram(image, section)) { + block.type = SOF_BLK_TEXT; + block.offset = section->sh_addr - adsp->iram_base + + adsp->host_iram_offset; + } else if (is_dram(image, section)) { + block.type = SOF_BLK_DATA; + block.offset = section->sh_addr - adsp->dram_base + + adsp->host_dram_offset; + } else { + fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", + section->sh_addr, section->sh_size); + return -EINVAL; + } + + /* write header */ + count = fwrite(&block, sizeof(block), 1, image->out_fd); + if (count != 1) + return -errno; + + /* alloc data data */ + buffer = calloc(1, section->sh_size); + if (buffer == NULL) + return -ENOMEM; + + /* read in section data */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: cant seek to section %d\n", ret); + goto out; + } + count = fread(buffer, 1, section->sh_size, module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: cant read section %d\n", -errno); + ret = -errno; + goto out; + } + + /* write out section data */ + count = fwrite(buffer, 1, section->sh_size, image->out_fd); + if (count != section->sh_size) { + fprintf(stderr, "error: cant write section %d\n", -errno); + fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", + section->sh_offset, section->sh_size, section->sh_addr); + ret = -errno; + goto out; + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, + section->sh_addr, section->sh_size, ftell(image->out_fd), + block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + +out: + free(buffer); + return ret; +} + +static int simple_write_module(struct image *image, struct module *module) +{ + struct snd_sof_mod_hdr hdr; + Elf32_Shdr *section; + size_t count; + int i, err; + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + + hdr.num_blocks = module->num_sections - module->num_bss; + hdr.size = module->text_size + module->data_size + + sizeof(struct snd_sof_blk_hdr) * hdr.num_blocks; + hdr.type = SOF_FW_BASE; + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write section header %d\n", + -errno); + return -errno; + } + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); + + for (i = 0; i < module->hdr.e_shnum; i++) { + + section = &module->section[i]; + + /* only write valid sections */ + if (!(module->section[i].sh_flags & valid)) + continue; + + /* dont write bss */ + if (section->sh_type == SHT_NOBITS) + continue; + + err = write_block(image, module, section); + if (err < 0) { + fprintf(stderr, "error: failed to write section #%d\n", i); + return err; + } + } + + fprintf(stdout, "\n"); + return 0; +} + +/* used by others */ +static int simple_write_firmware(struct image *image) +{ + struct snd_sof_fw_header hdr; + struct module *module; + size_t count; + int i, ret; + + memcpy(hdr.sig, SND_SOF_FW_SIG, SND_SOF_FW_SIG_SIZE); + + hdr.num_modules = image->num_modules; + hdr.abi = SND_SOF_FW_ABI; + hdr.file_size = 0; + + for (i = 0; i < image->num_modules; i++) { + module = &image->module[i]; + module->fw_size += sizeof(struct snd_sof_blk_hdr) * + (module->num_sections - module->num_bss); + module->fw_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; + hdr.file_size += module->fw_size; + } + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) + return -errno; + + for (i = 0; i < image->num_modules; i++) { + module = &image->module[i]; + + fprintf(stdout, "writing module %d %s\n", i, module->elf_file); + + ret = simple_write_module(image, module); + if (ret < 0) { + fprintf(stderr, "error: failed to write module %d\n", + i); + return ret; + } + } + + fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", + hdr.file_size + sizeof(hdr), hdr.file_size + sizeof(hdr), + hdr.num_modules); + + return 0; +} + +const struct adsp machine_byt = { + .name = "byt", + .iram_base = BYT_IRAM_BASE, + .iram_size = BYT_IRAM_SIZE, + .host_iram_offset = BYT_IRAM_HOST_OFFSET, + .dram_base = BYT_DRAM_BASE, + .dram_size = BYT_DRAM_SIZE, + .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .machine_id = MACHINE_BAYTRAIL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_cht = { + .name = "cht", + .iram_base = BYT_IRAM_BASE, + .iram_size = BYT_IRAM_SIZE, + .host_iram_offset = BYT_IRAM_HOST_OFFSET, + .dram_base = BYT_DRAM_BASE, + .dram_size = BYT_DRAM_SIZE, + .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .machine_id = MACHINE_CHERRYTRAIL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_bsw = { + .name = "bsw", + .iram_base = BYT_IRAM_BASE, + .iram_size = BYT_IRAM_SIZE, + .host_iram_offset = BYT_IRAM_HOST_OFFSET, + .dram_base = BYT_DRAM_BASE, + .dram_size = BYT_DRAM_SIZE, + .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .machine_id = MACHINE_BRASWELL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_hsw = { + .name = "hsw", + .iram_base = HSW_IRAM_BASE, + .iram_size = HSW_IRAM_SIZE, + .host_iram_offset = HSW_IRAM_HOST_OFFSET, + .dram_base = HSW_DRAM_BASE, + .dram_size = HSW_DRAM_SIZE, + .host_dram_offset = HSW_DRAM_HOST_OFFSET, + .machine_id = MACHINE_HASWELL, + .write_firmware = simple_write_firmware, +}; + +const struct adsp machine_bdw = { + .name = "bdw", + .iram_base = BDW_IRAM_BASE, + .iram_size = BDW_IRAM_SIZE, + .host_iram_offset = BDW_IRAM_HOST_OFFSET, + .dram_base = BDW_DRAM_BASE, + .dram_size = BDW_DRAM_SIZE, + .host_dram_offset = BDW_DRAM_HOST_OFFSET, + .machine_id = MACHINE_BROADWELL, + .write_firmware = simple_write_firmware, +}; diff --git a/rimage/hash.c b/rimage/hash.c new file mode 100644 index 000000000000..d586e07fc1b6 --- /dev/null +++ b/rimage/hash.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "rimage.h" +#include "file_format.h" +#include "manifest.h" + +#define DEBUG_HASH 0 + +void module_sha256_create(struct image *image) +{ + image->md = EVP_sha256(); + image->mdctx = EVP_MD_CTX_create(); + + EVP_DigestInit_ex(image->mdctx, image->md, NULL); +} + +void module_sha256_update(struct image *image, uint8_t *data, size_t bytes) +{ + EVP_DigestUpdate(image->mdctx, data, bytes); +} + +void module_sha256_complete(struct image *image, uint8_t *hash) +{ + unsigned char md_value[EVP_MAX_MD_SIZE]; + unsigned int md_len; +#if DEBUG_HASH + int i; +#endif + EVP_DigestFinal_ex(image->mdctx, md_value, &md_len); + EVP_MD_CTX_destroy(image->mdctx); + + memcpy(hash, md_value, md_len); +#if DEBUG_HASH + fprintf(stdout, "Module digest is: "); + for (i = 0; i < md_len; i++) + fprintf(stdout, "%02x", md_value[i]); + fprintf(stdout, "\n"); +#endif +} + +void ri_hash(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) +{ + module_sha256_create(image); + module_sha256_update(image, image->fw_image + offset, size); + module_sha256_complete(image, hash); +} diff --git a/rimage/man_apl.c b/rimage/man_apl.c new file mode 100644 index 000000000000..7b32ea1c3887 --- /dev/null +++ b/rimage/man_apl.c @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" + +/* hard coded atm - will pass this in from cmd line and git */ +#define MAN_FW_HDR_VERSION_MAJOR 9 +#define MAN_FW_HDR_VERSION_MINOR 22 +#define MAN_FW_HDR_VERSION_HOTFIX 1 +#define MAN_FW_HDR_VERSION_BUILD 0x7da + +/* manifest template */ +struct fw_image_manifest apl_manifest = { + + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .checksum = 0, + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET, + .length = sizeof(struct sof_man_adsp_meta_file_ext), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .imr_type = 3, + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + .load_offset = MAN_DESC_OFFSET, + }, + }, +}; diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c new file mode 100644 index 000000000000..2aec2a723d79 --- /dev/null +++ b/rimage/man_cnl.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" + +/* hard coded atm - will pass this in from cmd line and git */ +#define MAN_FW_HDR_VERSION_MAJOR 10 +#define MAN_FW_HDR_VERSION_MINOR 23 +#define MAN_FW_HDR_VERSION_HOTFIX 0 +#define MAN_FW_HDR_VERSION_BUILD 0x2a4 + +/* manifest template */ +struct fw_image_manifest cnl_manifest = { + + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET, + .length = sizeof(struct sof_man_adsp_meta_file_ext), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .imr_type = 3, + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = MAN_FW_HDR_VERSION_MAJOR, + .minor_version = MAN_FW_HDR_VERSION_MINOR, + .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, + .build_version = MAN_FW_HDR_VERSION_BUILD, + .load_offset = 0x30000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c new file mode 100644 index 000000000000..a4780b780118 --- /dev/null +++ b/rimage/manifest.c @@ -0,0 +1,528 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + + +#include +#include +#include +#include +#include +#include +#include + +#include "uapi/manifest.h" +#include "rimage.h" +#include "file_format.h" +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" + +static int man_open_rom_file(struct image *image) +{ + sprintf(image->out_rom_file, "%s.rom", image->out_file); + unlink(image->out_rom_file); + + /* allocate ROM image */ + image->rom_image = calloc(image->adsp->rom_size, 1); + if (image->rom_image == NULL) + return -ENOMEM; + + /* open ROM outfile for writing */ + image->out_rom_fd = fopen(image->out_rom_file, "w"); + if (image->out_rom_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_rom_file, errno); + } + + return 0; +} + +static int man_open_manifest_file(struct image *image) +{ + /* open manifest outfile for writing */ + sprintf(image->out_man_file, "%s.met", image->out_file); + unlink(image->out_man_file); + + image->out_man_fd = fopen(image->out_man_file, "w"); + if (image->out_man_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_man_file, errno); + } + + return 0; +} + +static int man_init_image(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (image->fw_image == NULL) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man, + sizeof(struct fw_image_manifest)); + + return 0; +} + +/* we should call this after all segments size set up via iterate */ +static uint32_t elf_to_file_offset(struct image *image, + struct module *module, struct sof_man_module *man_module, + Elf32_Shdr *section) +{ + uint32_t elf_addr = section->sh_addr, file_offset = 0; + + if (section->sh_type == SHT_PROGBITS) { + if (section->sh_flags & SHF_EXECINSTR) { + /* text segment */ + file_offset = elf_addr - module->text_start + + module->foffset; + } else { + /* rodata segment, append to text segment */ + file_offset = elf_addr - module->data_start + + module->foffset + module->text_file_size; + + } + } else if (section->sh_type == SHT_NOBITS) { + /* bss segment */ + file_offset = 0; + } + + return file_offset; +} + +/* write SRAM sections */ +static int man_copy_sram(struct image *image, Elf32_Shdr *section, + struct module *module, struct sof_man_module *man_module, + int section_idx) +{ + uint32_t offset = elf_to_file_offset(image, module, + man_module, section); + uint32_t end = offset + section->sh_size; + int seg_type = -1; + void *buffer = image->fw_image + offset; + size_t count; + + switch (section->sh_type) { + case SHT_PROGBITS: + /* text or data */ + if (section->sh_flags & SHF_EXECINSTR) + seg_type = SOF_MAN_SEGMENT_TEXT; + else + seg_type = SOF_MAN_SEGMENT_RODATA; + break; + case SHT_NOBITS: + seg_type = SOF_MAN_SEGMENT_BSS; + default: + return 0; + } + + /* file_offset for segment should not be 0s, we set it to + * the smallest offset of its modules ATM. + */ + if (man_module->segment[seg_type].file_offset > offset || + man_module->segment[seg_type].file_offset == 0) + man_module->segment[seg_type].file_offset = offset; + + count = fread(buffer, 1, section->sh_size, module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: cant read section %d\n", -errno); + return -errno; + } + + /* get module end offset ? */ + if (end > image->image_end) + image->image_end = end; + + fprintf(stdout, "\t%d\t0x%x\t0x%x\t0x%x\t%s\n", section_idx, + section->sh_addr, section->sh_size, offset, + seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); + + return 0; +} + +static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, + struct module *module, struct sof_man_module *man_module, int idx) +{ + int ret; + + /* seek to ELF section */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to section %d\n", ret); + return ret; + } + + /* write data to DRAM or ROM image */ + if (!elf_is_rom(image, section)) + return man_copy_sram(image, section, module, man_module, idx); + + return 0; +} + +static int man_get_module_manifest(struct image *image, struct module *module, + struct sof_man_module *man_module) +{ + Elf32_Shdr *section; + struct sof_man_segment_desc *segment; + struct sof_man_module sof_mod; + size_t count; + int ret, man_section_idx; + + fprintf(stdout, "Module Write: %s\n", module->elf_file); + + /* find manifest module data */ + man_section_idx = elf_find_section(image, module, ".module"); + if (man_section_idx < 0) { + return -EINVAL; + } + + fprintf(stdout, " Manifest module metadata section at index %d\n", + man_section_idx); + section = &module->section[man_section_idx]; + + /* load in manifest data */ + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to section %d\n", ret); + return ret; + } + count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); + if (count != sizeof(sof_mod)) { + fprintf(stderr, "error: can't read section %d\n", -errno); + return -errno; + } + + /* configure man_module with sofmod data */ + memcpy(man_module->struct_id, "$AME", 4); + man_module->entry_point = sof_mod.entry_point; + memcpy(man_module->name, sof_mod.name, SOF_MAN_MOD_NAME_LEN); + memcpy(man_module->uuid, sof_mod.uuid, 16); + man_module->affinity_mask = sof_mod.affinity_mask; + man_module->type.auto_start = sof_mod.type.auto_start; + man_module->type.domain_dp = sof_mod.type.domain_dp; + man_module->type.domain_ll = sof_mod.type.domain_ll; + man_module->type.load_type = sof_mod.type.load_type; + + /* text segment */ + segment = &man_module->segment[SOF_MAN_SEGMENT_TEXT]; + segment->flags.r.contents = 1; + segment->flags.r.alloc = 1; + segment->flags.r.load = 1; + segment->flags.r.readonly = 1; + segment->flags.r.code = 1; + + /* data segment */ + segment = &man_module->segment[SOF_MAN_SEGMENT_RODATA]; + segment->flags.r.contents = 1; + segment->flags.r.alloc = 1; + segment->flags.r.load = 1; + segment->flags.r.readonly = 1; + segment->flags.r.data = 1; + segment->flags.r.type = 1; + + /* bss segment */ + segment = &man_module->segment[SOF_MAN_SEGMENT_BSS]; + segment->flags.r.alloc = 1; + segment->flags.r.type = 2; + + fprintf(stdout, " Entry point 0x%8.8x\n", man_module->entry_point); + + return 0; +} + +static int man_module_create(struct image *image, struct module *module, + struct sof_man_module *man_module) +{ + /* create module and segments */ + uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + Elf32_Shdr *section; + int i, err; + unsigned int pages; + + image->image_end = 0; + + err = man_get_module_manifest(image, module, man_module); + if (err < 0) + return err; + + /* stack size ??? convert sizes to PAGES */ + man_module->instance_bss_size = 1; + + /* max number of instances of this module ?? */ + man_module->instance_max_count = 1; + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%x\t0x%x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%x\t0x%x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%x\t0x%x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + /* main module */ + /* text section is first */ + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = + module->foffset; + man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = + module->text_start; + + /* calculates those padding 0s by the start of next segment */ + pages = module->text_file_size / MAN_PAGE_SIZE; + if (module->text_file_size % MAN_PAGE_SIZE) + pages += 1; + + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = pages; + + /* data section */ + man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = + module->data_start; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = + module->foffset + module->text_file_size; + pages = module->data_file_size / MAN_PAGE_SIZE; + if (module->data_file_size % MAN_PAGE_SIZE) + pages += 1; + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + + /* bss is last */ + man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = module->bss_start; + pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; + if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) + pages += 1; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; + + fprintf(stdout, "\tNo\tAddress\t\tSize\tFile\tType\n"); + + /* find all sections and copy to corresponding segments */ + for (i = 0; i < module->hdr.e_shnum; i++) { + + section = &module->section[i]; + + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; + + if (section->sh_size == 0) + continue; + + /* text or data section */ + if (!elf_is_rom(image, section)) + err = man_copy_elf_section(image, section, module, + man_module, i); + + if (err < 0) { + fprintf(stderr, "error: failed to write section #%d\n", i); + return err; + } + } + fprintf(stdout, "\n"); + + /* round module end upto nearest page */ + if (image->image_end % MAN_PAGE_SIZE) { + image->image_end = (image->image_end / MAN_PAGE_SIZE) + 1; + image->image_end *= MAN_PAGE_SIZE; + } + + fprintf(stdout, " Total pages text %d data %d bss %d module file limit: 0x%x\n\n", + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length, + image->image_end); + return 0; +} + +static int man_write_fw_mod(struct image *image) +{ + int count; + + /* write ROM - for VM use only */ + count = fwrite(image->rom_image, image->adsp->rom_size, 1, + image->out_rom_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write rom %s %d\n", + image->out_rom_file, -errno); + return -errno; + } + fclose(image->out_rom_fd); + + /* write manifest and signed image */ + count = fwrite(image->fw_image, + image->image_end, + 1, image->out_fd); + + /* did the image write succeed ? */ + if (count != 1) { + fprintf(stderr, "error: failed to write signed firmware %s %d\n", + image->out_file, -errno); + return -errno; + } + + return 0; +} + +/* used by others */ +static int man_write_fw(struct image *image) +{ + struct sof_man_fw_desc *desc; + struct fw_image_manifest *m; + struct module *module; + struct sof_man_module *man_module; + uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; + int ret, i; + + /* init image */ + ret = man_init_image(image); + if (ret < 0) + goto err; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + for (i = 0; i < image->num_modules; i++) { + + man_module = sof_man_get_module(desc, i); + module = &image->module[i]; + + /* set module file offset */ + if (i == 0) { + module->foffset = FILE_TEXT_OFFSET; + } else { + module->foffset = image->image_end; + } + + ret = man_module_create(image, module, man_module); + if (ret < 0) + goto err; + } + + fprintf(stdout, "Firmware completing manifest\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image); + ri_plat_ext_data_create(image); + ri_css_hdr_create(image); + ri_cse_create(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + for (i = 0; i < image->num_modules; i++) { + + module = &image->module[i]; + man_module = sof_man_get_module(desc, i); + + ri_hash(image, man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, + (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE, man_module->hash); + } + + /* calculate hash for ADSP meta data extension - 0x480 to end */ + ri_hash(image, MAN_FW_DESC_OFFSET, image->image_end + - MAN_FW_DESC_OFFSET, m->adsp_file_ext.comp_desc[0].hash); + + /* calculate hash for platform auth data - repeated in hash 2 and 4 */ + ri_hash(image, MAN_META_EXT_OFFSET, + sizeof(struct sof_man_adsp_meta_file_ext), hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { + m->signed_pkg.module[0].hash[i] = + m->partition_info.module[0].hash[i] = + hash[SOF_MAN_MOD_SHA256_LEN - 1 - i]; + } + + /* sign manifest */ + ret = ri_manifest_sign(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} + +#define ADSP_APL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_APL_DSP_ROM_SIZE 0x00002000 +#define APL_DSP_BASE_ENTRY 0xa000a000 + +#define ADSP_CNL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_CNL_DSP_ROM_SIZE 0x00002000 +#define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 +#define CNL_DSP_HP_BASE_ENTRY 0xbe040000 + +/* list of supported adsp */ +const struct adsp machine_apl = { + .name = "apl", + .rom_base = ADSP_APL_DSP_ROM_BASE, + .rom_size = ADSP_APL_DSP_ROM_SIZE, + .sram_base = APL_DSP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_APOLLOLAKE, + .write_firmware = man_write_fw, + .man = &apl_manifest, + .base_fw_text_size_fixup = 0xa000, +}; + +const struct adsp machine_cnl = { + .name = "cnl", + .rom_base = ADSP_CNL_DSP_ROM_BASE, + .rom_size = ADSP_CNL_DSP_ROM_SIZE, + .imr_base = CNL_DSP_IMR_BASE_ENTRY, + .imr_size = 0x100000, + .sram_base = CNL_DSP_HP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_CANNONLAKE, + .write_firmware = man_write_fw, + .man = &cnl_manifest, +}; diff --git a/rimage/manifest.h b/rimage/manifest.h new file mode 100644 index 000000000000..ca951321f3a9 --- /dev/null +++ b/rimage/manifest.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __MANIFEST_H__ +#define __MANIFEST_H__ + +#include +#include "uapi/manifest.h" +#include "css.h" +#include "cse.h" +#include "plat_auth.h" + +#define MAN_PAGE_SIZE 4096 + +/* start offset for base FW module */ +#define FILE_TEXT_OFFSET 0x8000 + +/* + * CSE values for CNL + */ +#define MAN_CSE_PARTS 3 + + +#define MAN_CSE_HDR_OFFSET 0 +#define MAN_CSE_PADDING_SIZE 0x30 +#define MAN_EXT_PADDING 0x20 +#define MAN_DESC_OFFSET 0x2000 + +#define MAN_CSS_HDR_OFFSET \ + (MAN_CSE_HDR_OFFSET + \ + sizeof(struct CsePartitionDirHeader) + \ + MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) + +#define MAN_SIG_PKG_OFFSET \ + (MAN_CSS_HDR_OFFSET + \ + sizeof(struct css_header)) + +#define MAN_PART_INFO_OFFSET \ + (MAN_SIG_PKG_OFFSET + \ + sizeof(struct signed_pkg_info_ext)) + +#define MAN_META_EXT_OFFSET \ + (MAN_SIG_PKG_OFFSET + \ + sizeof(struct signed_pkg_info_ext) + \ + sizeof(struct partition_info_ext) + \ + MAN_CSE_PADDING_SIZE) + +#define MAN_FW_DESC_OFFSET \ + (MAN_META_EXT_OFFSET + \ + sizeof(struct sof_man_adsp_meta_file_ext) + \ + MAN_EXT_PADDING) + +#define MAN_DESC_PADDING_SIZE \ + (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET) + +/* + * Firmware manifest header. + */ +struct fw_image_manifest { + /* MEU tool needs these sections to be 0s */ + struct CsePartitionDirHeader cse_partition_dir_header; + struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; + struct css_header css; + struct signed_pkg_info_ext signed_pkg; + struct partition_info_ext partition_info; + uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; + struct sof_man_adsp_meta_file_ext adsp_file_ext; + + /* reserved / pading at end of ext data - all 0s*/ + uint8_t reserved[MAN_EXT_PADDING]; + + /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ + uint8_t padding[MAN_DESC_PADDING_SIZE]; + + struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ +} __attribute__((packed)); + +extern struct fw_image_manifest apl_manifest; +extern struct fw_image_manifest cnl_manifest; +#endif diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c new file mode 100644 index 000000000000..64a4b250015b --- /dev/null +++ b/rimage/pkcs1_5.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "config.h" +#include "rimage.h" +#include "css.h" +#include "manifest.h" + +#define DEBUG_PKCS 0 + +static void bytes_swap(uint8_t *ptr, uint32_t size) +{ + uint8_t tmp; + uint32_t index; + + for (index = 0; index < (size / 2); index++) { + tmp = ptr[index]; + ptr[index] = ptr[size - 1 - index]; + ptr[size - 1 - index] = tmp; + } +} + +/* + * RSA signature of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). +*/ + +int pkcs_sign(struct image *image, struct fw_image_manifest *man, + void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* create new key */ + privkey = EVP_PKEY_new(); + if (privkey == NULL) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + if (image->key_name == NULL) { + sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); + image->key_name = path; + } + + fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); + fp = fopen(image->key_name, "r"); + if (fp == NULL) { + fprintf(stderr, "error: can't open file %s %d\n", path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha256_update(image, ptr1, size1); + module_sha256_update(image, ptr2, size2); + module_sha256_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css.signature, + &siglen, priv_rsa); + if (ret < 0) + fprintf(stderr, "error: failed to sign manifest\n"); + + /* copy public key modulus and exponent to manifest */ + BN_bn2bin(priv_rsa->n, mod); + BN_bn2bin(priv_rsa->e, (unsigned char *)man->css.exponent); + + /* modulus is reveresd */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) + man->css.modulus[i] = mod[MAN_RSA_KEY_MODULUS_LEN - (1 + i)]; + + /* signature is reveresd, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + EVP_PKEY_free(privkey); + return ret; +} + +int ri_manifest_sign(struct image *image) +{ + struct fw_image_manifest *man = image->fw_image; + + pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET, + sizeof(struct css_header) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN), + (void *)man + MAN_SIG_PKG_OFFSET, + (man->css.size - man->css.header_len) * sizeof(uint32_t)); + return 0; +} diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c new file mode 100644 index 000000000000..21c7138cfbb1 --- /dev/null +++ b/rimage/plat_auth.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +#include "rimage.h" +#include "manifest.h" +#include "plat_auth.h" + +void ri_adsp_meta_data_create(struct image *image) +{ + struct sof_man_adsp_meta_file_ext *meta = + image->fw_image + MAN_META_EXT_OFFSET; + + fprintf(stdout, " meta: completing ADSP manifest\n"); + + meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET + image->image_end + - MAN_FW_DESC_OFFSET; + + fprintf(stdout, " meta: limit is 0x%x\n", + meta->comp_desc[0].limit_offset); + /* now hash the AdspFwBinaryDesc -> EOF */ +} + +void ri_plat_ext_data_create(struct image *image) +{ + struct partition_info_ext *part = image->fw_image + MAN_PART_INFO_OFFSET; + struct sof_man_adsp_meta_file_ext *meta = + image->fw_image + MAN_META_EXT_OFFSET; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET; + + fprintf(stdout, " auth: completing authentication manifest\n"); + + part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + part->length += MAN_PAGE_SIZE - (part->length % MAN_PAGE_SIZE); + + /* do this here atm */ + desc->header.preload_page_count = part->length / MAN_PAGE_SIZE; +} diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h new file mode 100644 index 000000000000..135f2d1ce07c --- /dev/null +++ b/rimage/plat_auth.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __PLAT_AUTH_H__ +#define __PLAT_AUTH_H__ + +#include + +struct image; + +#define PLAT_AUTH_SHA256_LEN 32 +#define PLAT_AUTH_NAME_LEN 12 +#define PLAT_AUTH_PADDING 48 /* pad at end of struct */ + +#define SIGN_PKG_EXT_TYPE 15 +#define SIGN_PKG_NUM_MODULE 1 + +struct signed_pkg_info_module { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t hash_algo; + uint16_t hash_size; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA256_LEN]; +} __attribute__((packed)); + +struct signed_pkg_info_ext { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; + uint32_t vcn; + uint8_t bitmap[16]; + uint32_t svn; + uint8_t fw_type; + uint8_t fw_sub_type; + uint8_t reserved[14]; /* must be 0 */ + + /* variable length of modules */ + struct signed_pkg_info_module module[SIGN_PKG_NUM_MODULE]; +} __attribute__((packed)); + + +#define PART_INFO_EXT_TYPE 3 +#define PART_INFO_NUM_MODULE 1 + +struct partition_info_module { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t reserved[3]; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA256_LEN]; +} __attribute__((packed)); + +struct partition_info_ext { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; /* "ADSP" */ + uint32_t length; + uint8_t hash[PLAT_AUTH_SHA256_LEN]; + + uint32_t vcn; + uint32_t part_version; + uint32_t fmt_version; + uint32_t instance_id; + uint32_t part_flags; + uint8_t reserved[20]; /* must be 0 */ + + /* variable length of modules */ + struct partition_info_module module[PART_INFO_NUM_MODULE]; +} __attribute__((packed)); + + +#define PLAT_AUTH_SIZE \ + (sizeof(struct partition_info_ext) + \ + sizeof(struct signed_pkg_info_ext)) + +void ri_adsp_meta_data_create(struct image *image); +void ri_plat_ext_data_create(struct image *image); + +#endif diff --git a/rimage/rimage.c b/rimage/rimage.c new file mode 100644 index 000000000000..322820b02612 --- /dev/null +++ b/rimage/rimage.c @@ -0,0 +1,136 @@ +/* + * ELF to firmware image creator. + * + * Copyright (c) 2015, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include +#include +#include +#include +#include + +#include "rimage.h" +#include "file_format.h" +#include "manifest.h" + +static const struct adsp *machine[] = { + &machine_byt, + &machine_cht, + &machine_bsw, + &machine_hsw, + &machine_bdw, + &machine_apl, + &machine_cnl, +}; + +static void usage(char *name) +{ + fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", name); + fprintf(stdout, "\t -v enable verbose output\n"); + exit(0); +} + +int main(int argc, char *argv[]) +{ + struct image image; + const char *mach = NULL; + int opt, ret, i, elf_argc = 0; + + memset(&image, 0, sizeof(image)); + + while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:")) != -1) { + switch (opt) { + case 'o': + image.out_file = optarg; + break; + case 'm': + mach = optarg; + break; + case 'v': + image.verbose = 1; + break; + case 's': + image.dump_sections = 1; + break; + case 'a': + image.abi = atoi(optarg); + break; + case 'k': + image.key_name = optarg; + break; + case 'h': + usage(argv[0]); + break; + default: + break; + } + } + + elf_argc = optind; + + /* make sure we have an outfile and machine */ + if (image.out_file == NULL || mach == NULL) + usage(argv[0]); + + + /* find machine */ + for (i = 0; i < ARRAY_SIZE(machine); i++) { + if (!strcmp(mach, machine[i]->name)) { + image.adsp = machine[i]; + goto found; + } + } + fprintf(stderr, "error: machine %s not found\n", mach); + fprintf(stderr, "error: available machines "); + for (i = 0; i < ARRAY_SIZE(machine); i++) + fprintf(stderr, "%s, ", machine[i]->name); + fprintf(stderr, "\n"); + + return -EINVAL; + +found: + + /* parse input ELF files */ + image.num_modules = argc - elf_argc; + for (i = elf_argc; i < argc; i++) { + fprintf(stdout, "\nModule Reading %s\n", argv[i]); + ret = elf_parse_module(&image, i - elf_argc, argv[i]); + if (ret < 0) + goto out; + } + + /* validate all modules */ + ret = elf_validate_modules(&image); + if (ret < 0) + goto out; + + /* open outfile for writing */ + unlink(image.out_file); + image.out_fd = fopen(image.out_file, "w"); + if (image.out_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image.out_file, errno); + ret = -EINVAL; + goto out; + } + + /* process and write output */ + ret = image.adsp->write_firmware(&image); +out: + /* close files */ + if (image.out_fd) + fclose(image.out_fd); + + + return ret; +} diff --git a/rimage/rimage.h b/rimage/rimage.h new file mode 100644 index 000000000000..4e387e9ff72c --- /dev/null +++ b/rimage/rimage.h @@ -0,0 +1,170 @@ +/* + * ELF to firmware image creator. + * + * Copyright (c) 2015-2018 Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#ifndef __RIMAGE_H__ +#define __RIMAGE_H__ + +#include +#include +#include + +#include +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) +#define MAX_MODULES 32 + +struct adsp; +struct manifest; +struct man_module; + +/* list of supported targets */ +enum machine_id { + MACHINE_BAYTRAIL = 0, + MACHINE_CHERRYTRAIL, + MACHINE_BRASWELL, + MACHINE_HASWELL, + MACHINE_BROADWELL, + MACHINE_APOLLOLAKE, + MACHINE_CANNONLAKE, + MACHINE_MAX +}; + +/* + * ELF module data + */ +struct module { + const char *elf_file; + FILE *fd; + + Elf32_Ehdr hdr; + Elf32_Shdr *section; + Elf32_Phdr *prg; + + uint32_t text_start; + uint32_t text_end; + uint32_t data_start; + uint32_t data_end; + uint32_t bss_start; + uint32_t bss_end; + uint32_t foffset; + + int num_sections; + int num_bss; + int fw_size; + int bss_index; + + /* sizes do not include any gaps */ + int bss_size; + int text_size; + int data_size; + + /* sizes do include gaps to nearest page */ + int bss_file_size; + int text_file_size; + int data_file_size; +}; + +/* + * Firmware image context. + */ +struct image { + + const char *out_file; + FILE *out_fd; + void *pos; + + const struct adsp *adsp; + int abi; + int verbose; + int num_modules; + struct module module[MAX_MODULES]; + uint32_t image_end;/* module end, equal to output image size */ + int dump_sections; + + /* SHA 256 */ + const char *key_name; + EVP_MD_CTX *mdctx; + const EVP_MD *md; + + /* file IO */ + void *fw_image; + void *rom_image; + FILE *out_rom_fd; + FILE *out_man_fd; + FILE *out_unsigned_fd; + char out_rom_file[256]; + char out_man_file[256]; + char out_unsigned_file[256]; +}; + +/* + * Audio DSP descriptor and operations. + */ +struct adsp { + const char *name; + uint32_t iram_base; + uint32_t iram_size; + uint32_t dram_base; + uint32_t dram_size; + uint32_t sram_base; + uint32_t sram_size; + uint32_t host_iram_offset; + uint32_t host_dram_offset; + uint32_t rom_base; + uint32_t rom_size; + uint32_t imr_base; + uint32_t imr_size; + + uint32_t image_size; + uint32_t dram_offset; + + enum machine_id machine_id; + int (*write_firmware)(struct image *image); + struct fw_image_manifest *man; + + /* fixups */ + uint32_t base_fw_text_size_fixup; /* added to BASEFW text size */ +}; + +void module_sha256_create(struct image *image); +void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); +void module_sha256_complete(struct image *image, uint8_t *hash); +int ri_manifest_sign(struct image *image); +void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); + +int pkcs_sign(struct image *image, struct fw_image_manifest *man, + void *ptr1, unsigned size1, void *ptr2, unsigned size2); + +int elf_parse_module(struct image *image, int module_index, const char *name); +void elf_free_module(struct image *image, int module_index); +int elf_is_rom(struct image *image, Elf32_Shdr *section); +int elf_validate_modules(struct image *image); +int elf_find_section(struct image *image, struct module *module, + const char *name); +int elf_validate_section(struct image *image, struct module *module, + Elf32_Shdr *section); + +/* supported machines */ +extern const struct adsp machine_byt; +extern const struct adsp machine_cht; +extern const struct adsp machine_bsw; +extern const struct adsp machine_hsw; +extern const struct adsp machine_bdw; +extern const struct adsp machine_apl; +extern const struct adsp machine_cnl; + +#endif From 5f7a3a3a6606cd74a2a4ccd1a0455e75caf05805 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Wed, 21 Feb 2018 10:40:42 +0000 Subject: [PATCH 003/639] rimage: elf: validate module sections internally. Make sure we validate all module sections against each other. Signed-off-by: Liam Girdwood --- rimage/elf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 672d6e3997bc..3f00f1da68e3 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -314,9 +314,6 @@ int elf_validate_section(struct image *image, struct module *module, for (i = 0; i < image->num_modules; i++) { m = &image->module[i]; - if (m == module) - continue; - /* for each section */ for (j = 0; j < m->hdr.e_shnum; j++) { s = &m->section[j]; From 3d247c1094c51a8206db46bf7ec63c1ea5c16644 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 22 Feb 2018 15:40:25 +0000 Subject: [PATCH 004/639] rimage: fix elf section collision detection. Section end was not checked. Now fixed. Added more error output to identify. Signed-off-by: Liam Girdwood --- rimage/elf.c | 21 ++++++++++++++------- rimage/rimage.h | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 3f00f1da68e3..b96222b94964 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -303,7 +303,7 @@ static void elf_module_limits(struct image *image, struct module *module) /* make sure no section overlap from any modules */ int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section) + Elf32_Shdr *section, int index) { struct module *m; Elf32_Shdr *s; @@ -322,14 +322,21 @@ int elf_validate_section(struct image *image, struct module *module, continue; /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(s->sh_flags & valid)) continue; - if (section->sh_size == 0) + if (s->sh_size == 0) continue; - /* is section non overlapping ? */ + /* is section start non overlapping ? */ if (section->sh_addr >= s->sh_addr && + section->sh_addr < + s->sh_addr + s->sh_size) { + goto err; + } + + /* is section end non overlapping ? */ + if (section->sh_addr + section->sh_size > s->sh_addr && section->sh_addr + section->sh_size <= s->sh_addr + s->sh_size) { goto err; @@ -340,8 +347,8 @@ int elf_validate_section(struct image *image, struct module *module, return 0; err: - fprintf(stderr, "error: section overlap between %s and %s\n", - module->elf_file, m->elf_file); + fprintf(stderr, "error: section overlap between %s:%d and %s:%d\n", + module->elf_file, index, m->elf_file, j); fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", section->sh_addr, section->sh_addr + section->sh_size, s->sh_addr, s->sh_addr + s->sh_size); @@ -372,7 +379,7 @@ int elf_validate_modules(struct image *image) continue; /* is section non overlapping ? */ - ret = elf_validate_section(image, module, section); + ret = elf_validate_section(image, module, section, j); if (ret < 0) return ret; } diff --git a/rimage/rimage.h b/rimage/rimage.h index 4e387e9ff72c..adcb8c552d88 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -156,7 +156,7 @@ int elf_validate_modules(struct image *image); int elf_find_section(struct image *image, struct module *module, const char *name); int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section); + Elf32_Shdr *section, int index); /* supported machines */ extern const struct adsp machine_byt; From c5bd37f42899a2d4576f2d6cf5d585e527c0c76a Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 23 Feb 2018 01:40:19 +0800 Subject: [PATCH 005/639] rimage: add unsigned firmware support Add unsigned firmware support, that can directly use the FW or sign it with other tools. Signed-off-by: Pan Xiuli --- rimage/manifest.c | 58 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index a4780b780118..2b7e07fd27cf 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -51,6 +51,21 @@ static int man_open_rom_file(struct image *image) return 0; } +static int man_open_unsigned_file(struct image *image) +{ + sprintf(image->out_unsigned_file, "%s.uns", image->out_file); + unlink(image->out_unsigned_file); + + /* open unsigned FW outfile for writing */ + image->out_unsigned_fd = fopen(image->out_unsigned_file, "w"); + if (image->out_unsigned_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_unsigned_file, errno); + } + + return 0; +} + static int man_open_manifest_file(struct image *image) { /* open manifest outfile for writing */ @@ -351,6 +366,39 @@ static int man_module_create(struct image *image, struct module *module, return 0; } +static int man_write_unsigned_mod(struct image *image) +{ + int count; + + /* write metadata file for unsigned FW */ + count = fwrite(image->fw_image + MAN_META_EXT_OFFSET, + sizeof(struct sof_man_adsp_meta_file_ext), 1, + image->out_man_fd); + + /* did the metadata/manifest write succeed ? */ + if (count != 1) { + fprintf(stderr, "error: failed to write meta %s %d\n", + image->out_man_file, -errno); + return -errno; + } + fclose(image->out_man_fd); + + /* now prepare the unsigned rimage */ + count = fwrite(image->fw_image + MAN_FW_DESC_OFFSET, + image->image_end - MAN_FW_DESC_OFFSET, + 1, image->out_unsigned_fd); + + /* did the unsigned FW write succeed ? */ + if (count != 1) { + fprintf(stderr, "error: failed to write firmware %s %d\n", + image->out_unsigned_file, -errno); + return -errno; + } + fclose(image->out_unsigned_fd); + + return 0; +} + static int man_write_fw_mod(struct image *image) { int count; @@ -400,6 +448,11 @@ static int man_write_fw(struct image *image) if (ret < 0) goto err; + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + /* create the manifest */ ret = man_open_manifest_file(image); if (ret < 0) @@ -477,6 +530,11 @@ static int man_write_fw(struct image *image) if (ret < 0) goto err; + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image); + if (ret < 0) + goto err; + fprintf(stdout, "Firmware manifest and signing completed !\n"); return 0; From 9b0ead72d3115c5de66648917ea402e4654e179c Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 27 Feb 2018 16:35:10 +0000 Subject: [PATCH 006/639] rimage: validate manifest segments make sure no manifest segments collide with each other and fail if they do. Signed-off-by: Liam Girdwood --- rimage/manifest.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 2b7e07fd27cf..b9848d04dd9e 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -260,6 +260,62 @@ static int man_get_module_manifest(struct image *image, struct module *module, return 0; } +static inline const char *segment_name(int i) +{ + switch (i) { + case SOF_MAN_SEGMENT_TEXT: + return "TEXT"; + case SOF_MAN_SEGMENT_RODATA: + return "DATA"; + case SOF_MAN_SEGMENT_BSS: + return "BSS"; + default: + return "NONE"; + } +} + +/* make sure no segments collide */ +static int man_module_validate(struct sof_man_module *man_module) +{ + uint32_t istart, iend; + uint32_t jstart, jend; + int i, j; + + for (i = 0; i < 3; i++) { + + istart = man_module->segment[i].v_base_addr; + iend = istart + man_module->segment[i].flags.r.length * + MAN_PAGE_SIZE; + + for (j = 0; j < 3; j++) { + + /* don't validate segment against itself */ + if (i == j) + continue; + + jstart = man_module->segment[j].v_base_addr; + jend = jstart + man_module->segment[j].flags.r.length * + MAN_PAGE_SIZE; + + if (jstart > istart && jstart < iend) + goto err; + + if (jend > istart && jend < iend) + goto err; + } + } + + /* success, no overlapping segments */ + return 0; + +err: + fprintf(stderr, "error: segment %s [0x%8.8x:0x%8.8x] overlaps", + segment_name(i), istart, iend); + fprintf(stderr, " with %s [0x%8.8x:0x%8.8x]\n", + segment_name(j), jstart, jend); + return -EINVAL; +} + static int man_module_create(struct image *image, struct module *module, struct sof_man_module *man_module) { @@ -328,6 +384,10 @@ static int man_module_create(struct image *image, struct module *module, fprintf(stdout, "\tNo\tAddress\t\tSize\tFile\tType\n"); + /* validate segments */ + if (man_module_validate(man_module) < 0) + return -EINVAL; + /* find all sections and copy to corresponding segments */ for (i = 0; i < module->hdr.e_shnum; i++) { From b54a48d177e38ca742f89c711993b13456890dc7 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 2 Mar 2018 15:55:27 +0800 Subject: [PATCH 007/639] rimage: read the fixup text size form ELF The actual text size will change and the hard code base_fw_text_size_fixup could not fit the changing size. We should get the fixup size from the module info just from the memory mapping. Signed-off-by: Pan Xiuli --- rimage/elf.c | 7 ------- rimage/manifest.c | 17 ++++++++++++++--- rimage/rimage.h | 4 +--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index b96222b94964..78f6d57dca84 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -500,13 +500,6 @@ int elf_parse_module(struct image *image, int module_index, const char *name) if (rem) module->text_file_size += MAN_PAGE_SIZE - rem; - - /* apply any base FW fixups */ - if (image->adsp->base_fw_text_size_fixup && - module->text_start == image->adsp->sram_base) { - module->text_file_size += image->adsp->base_fw_text_size_fixup; - } - /* data section */ module->data_file_size = module->data_end - module->data_start; rem = module->data_file_size % MAN_PAGE_SIZE; diff --git a/rimage/manifest.c b/rimage/manifest.c index b9848d04dd9e..337f82a409f9 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -109,7 +109,7 @@ static uint32_t elf_to_file_offset(struct image *image, } else { /* rodata segment, append to text segment */ file_offset = elf_addr - module->data_start + - module->foffset + module->text_file_size; + module->foffset + module->text_fixup_size; } } else if (section->sh_type == SHT_NOBITS) { @@ -233,6 +233,9 @@ static int man_get_module_manifest(struct image *image, struct module *module, man_module->type.domain_ll = sof_mod.type.domain_ll; man_module->type.load_type = sof_mod.type.load_type; + /* read out text_fixup_size from memory mapping */ + module->text_fixup_size = sof_mod.text_size; + /* text segment */ segment = &man_module->segment[SOF_MAN_SEGMENT_TEXT]; segment->flags.r.contents = 1; @@ -361,13 +364,22 @@ static int man_module_create(struct image *image, struct module *module, if (module->text_file_size % MAN_PAGE_SIZE) pages += 1; + if (module->text_fixup_size == 0) + module->text_fixup_size = module->text_file_size; + + /* check if text_file_size is bigger then text_fixup_size */ + if (module->text_file_size > module->text_fixup_size) { + fprintf(stderr, "error: too small text size assigned!\n"); + return -EINVAL; + } + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = pages; /* data section */ man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = module->data_start; man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = - module->foffset + module->text_file_size; + module->foffset + module->text_fixup_size; pages = module->data_file_size / MAN_PAGE_SIZE; if (module->data_file_size % MAN_PAGE_SIZE) pages += 1; @@ -627,7 +639,6 @@ const struct adsp machine_apl = { .machine_id = MACHINE_APOLLOLAKE, .write_firmware = man_write_fw, .man = &apl_manifest, - .base_fw_text_size_fixup = 0xa000, }; const struct adsp machine_cnl = { diff --git a/rimage/rimage.h b/rimage/rimage.h index adcb8c552d88..654ba90fca32 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -75,6 +75,7 @@ struct module { /* sizes do include gaps to nearest page */ int bss_file_size; int text_file_size; + int text_fixup_size; int data_file_size; }; @@ -135,9 +136,6 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); struct fw_image_manifest *man; - - /* fixups */ - uint32_t base_fw_text_size_fixup; /* added to BASEFW text size */ }; void module_sha256_create(struct image *image); From 8ce5f8efa6d39b651dee936e3d5a5dee497ec691 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 19 Mar 2018 08:34:52 +0000 Subject: [PATCH 008/639] rimage: manifest: Move text offset into non immutable ROM structure. text_offset was added to an immutable ROM structure that would break some tools and cause instability. Fix this by creating a new structure for rimage manifest data that can be modified without breaking the ROM ABI. Signed-off-by: Liam Girdwood --- rimage/manifest.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 337f82a409f9..243c194fb636 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -194,7 +194,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, { Elf32_Shdr *section; struct sof_man_segment_desc *segment; - struct sof_man_module sof_mod; + struct sof_man_module_manifest sof_mod; size_t count; int ret, man_section_idx; @@ -224,14 +224,14 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* configure man_module with sofmod data */ memcpy(man_module->struct_id, "$AME", 4); - man_module->entry_point = sof_mod.entry_point; - memcpy(man_module->name, sof_mod.name, SOF_MAN_MOD_NAME_LEN); - memcpy(man_module->uuid, sof_mod.uuid, 16); - man_module->affinity_mask = sof_mod.affinity_mask; - man_module->type.auto_start = sof_mod.type.auto_start; - man_module->type.domain_dp = sof_mod.type.domain_dp; - man_module->type.domain_ll = sof_mod.type.domain_ll; - man_module->type.load_type = sof_mod.type.load_type; + man_module->entry_point = sof_mod.module.entry_point; + memcpy(man_module->name, sof_mod.module.name, SOF_MAN_MOD_NAME_LEN); + memcpy(man_module->uuid, sof_mod.module.uuid, 16); + man_module->affinity_mask = sof_mod.module.affinity_mask; + man_module->type.auto_start = sof_mod.module.type.auto_start; + man_module->type.domain_dp = sof_mod.module.type.domain_dp; + man_module->type.domain_ll = sof_mod.module.type.domain_ll; + man_module->type.load_type = sof_mod.module.type.load_type; /* read out text_fixup_size from memory mapping */ module->text_fixup_size = sof_mod.text_size; From 273f73fc5cc09bf66aefdaa05e8e0ad23c6a0957 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 30 Mar 2018 14:44:17 +0100 Subject: [PATCH 009/639] cnl: core: Add support for xcc xcc has more strict rules than gcc: - Add missing sections to linker scripts - Fix compile warnings - Extend memory enabling timeout to infinite (too small delay for xcc) Signed-off-by: Tomasz Lauda # Conflicts: # src/platform/apollolake/platform.c # src/platform/cannonlake/platform.c --- rimage/manifest.c | 9 ++++++++- rimage/manifest.h | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 243c194fb636..f3f856004239 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -211,11 +211,18 @@ static int man_get_module_manifest(struct image *image, struct module *module, section = &module->section[man_section_idx]; /* load in manifest data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + /* module built using xcc has preceding bytes */ + if (section->sh_size > sizeof(sof_mod)) + ret = fseek(module->fd, + section->sh_offset + XCC_MOD_OFFSET, SEEK_SET); + else + ret = fseek(module->fd, section->sh_offset, SEEK_SET); + if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); return ret; } + count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); if (count != sizeof(sof_mod)) { fprintf(stderr, "error: can't read section %d\n", -errno); diff --git a/rimage/manifest.h b/rimage/manifest.h index ca951321f3a9..8d1d3d2cae01 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -22,6 +22,9 @@ #define MAN_PAGE_SIZE 4096 +/* start offset for modules built using xcc */ +#define XCC_MOD_OFFSET 0x8 + /* start offset for base FW module */ #define FILE_TEXT_OFFSET 0x8000 From 269a477b63e52206f927415a01976a998355cb13 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 6 Apr 2018 21:16:12 +0100 Subject: [PATCH 010/639] rimage: display ELF section names. Display the name of each ELF section to aid build and debug. Signed-off-by: Liam Girdwood --- rimage/elf.c | 36 +++++++++++++++++++++++++++++++----- rimage/rimage.h | 1 + 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 78f6d57dca84..b1a1861b7a87 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -51,6 +51,29 @@ static int elf_read_sections(struct image *image, struct module *module) return -errno; } + /* read in strings */ + module->strings = calloc(1, section[hdr->e_shstrndx].sh_size); + if (!module->strings) { + fprintf(stderr, "error: failed %s to read ELF strings for %d\n", + module->elf_file, -errno); + return -errno; + } + + ret = fseek(module->fd, section[hdr->e_shstrndx].sh_offset, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to %s stringss %d\n", + module->elf_file, ret); + return ret; + } + + count = fread(module->strings, 1, section[hdr->e_shstrndx].sh_size, + module->fd); + if (count != section[hdr->e_shstrndx].sh_size) { + fprintf(stderr, "error: failed to read %s strings %d\n", + module->elf_file, -errno); + return -errno; + } + /* find manifest module data */ man_section_idx = elf_find_section(image, module, ".bss"); if (man_section_idx < 0) { @@ -233,7 +256,7 @@ static void elf_module_size(struct image *image, struct module *module, if (module->text_end < section->sh_addr + section->sh_size) module->text_end = section->sh_addr + section->sh_size; - fprintf(stdout, "\tTEXT\n"); + fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ if (module->data_start > section->sh_addr) @@ -241,7 +264,7 @@ static void elf_module_size(struct image *image, struct module *module, if (module->data_end < section->sh_addr + section->sh_size) module->data_end = section->sh_addr + section->sh_size; - fprintf(stdout, "\tDATA\n"); + fprintf(stdout, "\tDATA\t"); } break; case SHT_NOBITS: @@ -250,9 +273,9 @@ static void elf_module_size(struct image *image, struct module *module, /* updated the .bss segment */ module->bss_start = section->sh_addr; module->bss_end = section->sh_addr + section->sh_size; - fprintf(stdout, "\tBSS\n"); + fprintf(stdout, "\tBSS\t"); } else { - fprintf(stdout, "\tHEAP\n"); + fprintf(stdout, "\tHEAP\t"); } break; default: @@ -272,7 +295,7 @@ static void elf_module_limits(struct image *image, struct module *module) fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.e_shnum); - fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\n"); + fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\tName\n"); /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.e_shnum; i++) { @@ -296,6 +319,8 @@ static void elf_module_limits(struct image *image, struct module *module) /* text or data section */ elf_module_size(image, module, section, i); + /* section name */ + fprintf(stdout, "%s\n", module->strings + section->sh_name); } fprintf(stdout, "\n"); @@ -528,5 +553,6 @@ void elf_free_module(struct image *image, int module_index) free(module->prg); free(module->section); + free(module->strings); fclose(module->fd); } diff --git a/rimage/rimage.h b/rimage/rimage.h index 654ba90fca32..8b46766d4cdf 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -53,6 +53,7 @@ struct module { Elf32_Ehdr hdr; Elf32_Shdr *section; Elf32_Phdr *prg; + char *strings; uint32_t text_start; uint32_t text_end; From 0f3b39954bf13fad32741bb4694c43349c7c92a3 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sun, 8 Apr 2018 16:32:57 +0100 Subject: [PATCH 011/639] rimage: fix formatting and alignment of manifest section printf Signed-off-by: Liam Girdwood --- rimage/manifest.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index f3f856004239..87f80d7c8719 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -163,7 +163,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, if (end > image->image_end) image->image_end = end; - fprintf(stdout, "\t%d\t0x%x\t0x%x\t0x%x\t%s\n", section_idx, + fprintf(stdout, "\t%d\t0x%x\t0x%x\t\t0x%x\t%s\n", section_idx, section->sh_addr, section->sh_size, offset, seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); @@ -349,15 +349,15 @@ static int man_module_create(struct image *image, struct module *module, fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - fprintf(stdout, "\n\tTEXT\t0x%x\t0x%x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%x\t0x%x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%x\t0x%x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); /* main module */ /* text section is first */ @@ -401,7 +401,7 @@ static int man_module_create(struct image *image, struct module *module, pages += 1; man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; - fprintf(stdout, "\tNo\tAddress\t\tSize\tFile\tType\n"); + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); /* validate segments */ if (man_module_validate(man_module) < 0) From 8d8de881f9c501fb9cffc6d4e41aac180eb2d44a Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 12 Apr 2018 21:07:35 +0100 Subject: [PATCH 012/639] rimage: add support to build and sign runtime modules Currently rimage only supports building ELF images with know TEXT, DATA and BSS addresses. This patch adds support to build runtime relocatable modules that can be loaded linked into the base SOF FW at runtime. Signed-off-by: Liam Girdwood --- rimage/elf.c | 72 ++++++++++++++++++++++++++++---- rimage/file_simple.c | 97 +++++++++++++++++++++++++++++++++++++++++++- rimage/manifest.c | 97 +++++++++++++++++++++++++++++++++++++++++++- rimage/rimage.c | 9 +++- rimage/rimage.h | 4 ++ 5 files changed, 266 insertions(+), 13 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index b1a1861b7a87..6c7e3dae3db1 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -283,6 +283,42 @@ static void elf_module_size(struct image *image, struct module *module, } } +static void elf_module_size_reloc(struct image *image, struct module *module, + Elf32_Shdr *section, int index) +{ + switch (section->sh_type) { + case SHT_PROGBITS: + /* text or data */ + if (section->sh_flags & SHF_EXECINSTR) { + /* text */ + module->text_start = 0; + module->text_end += section->sh_size; + + fprintf(stdout, "\tTEXT\t"); + } else { + /* initialized data, also calc the writable sections */ + module->data_start = 0; + module->data_end += section->sh_size; + + fprintf(stdout, "\tDATA\t"); + } + break; + case SHT_NOBITS: + /* bss */ + if (index == module->bss_index) { + /* updated the .bss segment */ + module->bss_start = section->sh_addr; + module->bss_end = section->sh_addr + section->sh_size; + fprintf(stdout, "\tBSS\t"); + } else { + fprintf(stdout, "\tHEAP\t"); + } + break; + default: + break; + } +} + static void elf_module_limits(struct image *image, struct module *module) { Elf32_Shdr *section; @@ -302,22 +338,29 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; - /* only check valid sections */ - if (!(section->sh_flags & valid)) - continue; + /* module bss can sometimes be missed */ + if (i != module->bss_index) { - if (section->sh_size == 0) - continue; + /* only check valid sections */ + if (!(section->sh_flags & valid)) + continue; - if (elf_is_rom(image, section)) - continue; + if (section->sh_size == 0) + continue; + + if (elf_is_rom(image, section)) + continue; + } fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, section->sh_addr, section->sh_addr + section->sh_size, section->sh_size); /* text or data section */ - elf_module_size(image, module, section, i); + if (image->reloc) + elf_module_size_reloc(image, module, section, i); + else + elf_module_size(image, module, section, i); /* section name */ fprintf(stdout, "%s\n", module->strings + section->sh_name); @@ -388,6 +431,10 @@ int elf_validate_modules(struct image *image) uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i, j, ret; + /* relocatable modules have no physical addresses until runtime */ + if (image->reloc) + return 0; + /* for each module */ for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; @@ -484,6 +531,15 @@ int elf_parse_module(struct image *image, int module_index, const char *name) } module->elf_file = name; + /* get file size */ + ret = fseek(module->fd, 0, SEEK_END); + if (ret < 0) + goto hdr_err; + module->file_size = ftell(module->fd); + ret = fseek(module->fd, 0, SEEK_SET); + if (ret < 0) + goto hdr_err; + /* read in elf header */ ret = elf_read_hdr(image, module); if (ret < 0) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index dcf0d5b241b4..a9f22d046432 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -204,6 +204,98 @@ static int simple_write_module(struct image *image, struct module *module) return 0; } +static int write_block_reloc(struct image *image, struct module *module) +{ + struct snd_sof_blk_hdr block; + size_t count; + void *buffer; + int ret; + + block.size = module->file_size; + block.type = SOF_BLK_DATA; + block.offset = 0; + + /* write header */ + count = fwrite(&block, sizeof(block), 1, image->out_fd); + if (count != 1) + return -errno; + + /* alloc data data */ + buffer = calloc(1, module->file_size); + if (!buffer) + return -ENOMEM; + + /* read in section data */ + ret = fseek(module->fd, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: can't seek to section %d\n", ret); + goto out; + } + count = fread(buffer, 1, module->file_size, module->fd); + if (count != module->file_size) { + fprintf(stderr, "error: can't read section %d\n", -errno); + ret = -errno; + goto out; + } + + /* write out section data */ + count = fwrite(buffer, 1, module->file_size, image->out_fd); + if (count != module->file_size) { + fprintf(stderr, "error: can't write section %d\n", -errno); + ret = -errno; + goto out; + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, + 0, module->file_size, ftell(image->out_fd), + block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + +out: + free(buffer); + return ret; +} + +static int simple_write_module_reloc(struct image *image, struct module *module) +{ + struct snd_sof_mod_hdr hdr; + size_t count; + int i, err; + + hdr.num_blocks = 1; + hdr.size = module->text_size + module->data_size; + hdr.type = SOF_FW_BASE; // module + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write section header %d\n", + -errno); + return -errno; + } + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); + + err = write_block_reloc(image, module); + if (err < 0) { + fprintf(stderr, "error: failed to write section #%d\n", i); + return err; + } + + fprintf(stdout, "\n"); + return 0; +} + /* used by others */ static int simple_write_firmware(struct image *image) { @@ -235,7 +327,10 @@ static int simple_write_firmware(struct image *image) fprintf(stdout, "writing module %d %s\n", i, module->elf_file); - ret = simple_write_module(image, module); + if (image->reloc) + ret = simple_write_module_reloc(image, module); + else + ret = simple_write_module(image, module); if (ret < 0) { fprintf(stderr, "error: failed to write module %d\n", i); diff --git a/rimage/manifest.c b/rimage/manifest.c index 87f80d7c8719..6bb4ad3f203c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -403,7 +403,6 @@ static int man_module_create(struct image *image, struct module *module, fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); - /* validate segments */ if (man_module_validate(man_module) < 0) return -EINVAL; @@ -445,6 +444,96 @@ static int man_module_create(struct image *image, struct module *module, return 0; } +static int man_module_create_reloc(struct image *image, struct module *module, + struct sof_man_module *man_module) +{ + /* create module and segments */ + int err; + unsigned int pages; + void *buffer = image->fw_image + module->foffset; + size_t count; + + image->image_end = 0; + + err = man_get_module_manifest(image, module, man_module); + if (err < 0) + return err; + + /* stack size ??? convert sizes to PAGES */ + man_module->instance_bss_size = 1; + + /* max number of instances of this module ?? */ + man_module->instance_max_count = 1; + + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text_start, module->text_end, + module->text_end - module->text_start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data_start, module->data_end, + module->data_end - module->data_start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); + + /* main module */ + /* text section is first */ + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = + module->foffset; + man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = 0; + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = 0; + + /* data section */ + man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = 0; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = + module->foffset; + pages = module->data_file_size / MAN_PAGE_SIZE; + if (module->data_file_size % MAN_PAGE_SIZE) + pages += 1; + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + + /* bss is last */ + man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = 0; + + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); + + /* seek to beginning of file */ + err = fseek(module->fd, 0, SEEK_SET); + if (err < 0) { + fprintf(stderr, "error: can't seek to section %d\n", err); + return err; + } + + count = fread(buffer, 1, module->file_size, module->fd); + if (count != module->file_size) { + fprintf(stderr, "error: can't read section %d\n", -errno); + return -errno; + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x\t%s\n", 0, + 0, module->file_size, 0, "DATA"); + + fprintf(stdout, "\n"); + image->image_end = module->foffset + module->file_size; + + /* round module end up to nearest page */ + if (image->image_end % MAN_PAGE_SIZE) { + image->image_end = (image->image_end / MAN_PAGE_SIZE) + 1; + image->image_end *= MAN_PAGE_SIZE; + } + + fprintf(stdout, " Total pages text %d data %d bss %d module file limit: 0x%x\n\n", + man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length, + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length, + image->image_end); + return 0; +} + static int man_write_unsigned_mod(struct image *image) { int count; @@ -555,7 +644,11 @@ static int man_write_fw(struct image *image) module->foffset = image->image_end; } - ret = man_module_create(image, module, man_module); + if (image->reloc) + ret = man_module_create_reloc(image, module, + man_module); + else + ret = man_module_create(image, module, man_module); if (ret < 0) goto err; } diff --git a/rimage/rimage.c b/rimage/rimage.c index 322820b02612..cc0a6101c44d 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -35,8 +35,10 @@ static const struct adsp *machine[] = { static void usage(char *name) { - fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", name); + fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", + name); fprintf(stdout, "\t -v enable verbose output\n"); + fprintf(stdout, "\t -r enable relocatable ELF files\n"); exit(0); } @@ -48,7 +50,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:r")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -68,6 +70,9 @@ int main(int argc, char *argv[]) case 'k': image.key_name = optarg; break; + case 'r': + image.reloc = 1; + break; case 'h': usage(argv[0]); break; diff --git a/rimage/rimage.h b/rimage/rimage.h index 8b46766d4cdf..888e7e8e781a 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -78,6 +78,9 @@ struct module { int text_file_size; int text_fixup_size; int data_file_size; + + /* total file size */ + int file_size; }; /* @@ -92,6 +95,7 @@ struct image { const struct adsp *adsp; int abi; int verbose; + int reloc; /* ELF data is relocatable */ int num_modules; struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ From b199485177fa6f55d85b757073832a732523bc82 Mon Sep 17 00:00:00 2001 From: Yan Wang Date: Mon, 16 Apr 2018 16:24:30 +0800 Subject: [PATCH 013/639] FIX: Remove unused variable. The variable "i" shouldn't be used. Signed-off-by: Yan Wang --- rimage/file_simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index a9f22d046432..4068734ea1cc 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -259,7 +259,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) { struct snd_sof_mod_hdr hdr; size_t count; - int i, err; + int err; hdr.num_blocks = 1; hdr.size = module->text_size + module->data_size; @@ -288,7 +288,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) err = write_block_reloc(image, module); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", err); return err; } From 8aedb1c3e7aeb3193b48ba8f6354f31435bc6105 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Thu, 10 May 2018 21:31:01 +0100 Subject: [PATCH 014/639] rimage: openssl: fix build for openssl 1.1.0 Openssl 1.1.0 is latest stable version with minor API differences. Signed-off-by: Liam Girdwood --- rimage/hash.c | 4 ++-- rimage/pkcs1_5.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/rimage/hash.c b/rimage/hash.c index d586e07fc1b6..2905d893d4ae 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -35,7 +35,7 @@ void module_sha256_create(struct image *image) { image->md = EVP_sha256(); - image->mdctx = EVP_MD_CTX_create(); + image->mdctx = EVP_MD_CTX_new(); EVP_DigestInit_ex(image->mdctx, image->md, NULL); } @@ -53,7 +53,7 @@ void module_sha256_complete(struct image *image, uint8_t *hash) int i; #endif EVP_DigestFinal_ex(image->mdctx, md_value, &md_len); - EVP_MD_CTX_destroy(image->mdctx); + EVP_MD_CTX_free(image->mdctx); memcpy(hash, md_value, md_len); #if DEBUG_HASH diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 64a4b250015b..7df531bffdee 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -56,6 +57,7 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, RSA *priv_rsa = NULL; EVP_PKEY *privkey; FILE *fp; + const BIGNUM *n, *e, *d; unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; @@ -114,8 +116,9 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, fprintf(stderr, "error: failed to sign manifest\n"); /* copy public key modulus and exponent to manifest */ - BN_bn2bin(priv_rsa->n, mod); - BN_bn2bin(priv_rsa->e, (unsigned char *)man->css.exponent); + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css.exponent); /* modulus is reveresd */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) From 3530b55759f0c915ba5f950890ec1030de48daa6 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 11 May 2018 15:55:39 +0800 Subject: [PATCH 015/639] rimage: fix wrong error message If keyname can not be open, error message should output keyname insert of tmp path. Signed-off-by: Pan Xiuli --- rimage/pkcs1_5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 7df531bffdee..0c91df0391d1 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -82,7 +82,8 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); fp = fopen(image->key_name, "r"); if (fp == NULL) { - fprintf(stderr, "error: can't open file %s %d\n", path, -errno); + fprintf(stderr, "error: can't open file %s %d\n", + image->key_name, -errno); return -errno; } PEM_read_PrivateKey(fp, &privkey, NULL, NULL); From 82f6d74ee3b42e62a3003936d707759e982d231a Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 11 May 2018 15:55:40 +0800 Subject: [PATCH 016/639] rimage: add error handler for localtime call Signed-off-by: Pan Xiuli --- rimage/css.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rimage/css.c b/rimage/css.c index bc69cf10b55e..79b5acead7ae 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -32,6 +32,12 @@ void ri_css_hdr_create(struct image *image) /* get local time and date */ gettimeofday(&tv, NULL); date = localtime(&tv.tv_sec); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + date->tm_year += 1900; fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", date->tm_year, date->tm_mon, date->tm_mday); From 82f6bfba4ef87fa56833f3e7b16c4caa3b367659 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Mon, 14 May 2018 14:03:52 +0800 Subject: [PATCH 017/639] rimage: openssl: add compatibility for openssl 1.1.0 Add compatibility support for openssl 1.0.2 support alongsid with openssl 1.1.0 References: https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes Compatibility Layer Signed-off-by: Pan Xiuli --- rimage/hash.c | 26 ++++++++++++++++++++++++++ rimage/pkcs1_5.c | 16 ++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/rimage/hash.c b/rimage/hash.c index 2905d893d4ae..73b6d72dfab2 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -30,6 +30,32 @@ #include "file_format.h" #include "manifest.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +void EVP_MD_CTX_free(EVP_MD_CTX *ctx); +EVP_MD_CTX *EVP_MD_CTX_new(void); + +static void *OPENSSL_zalloc(size_t num) +{ + void *ret = OPENSSL_malloc(num); + + if (ret != NULL) + memset(ret, 0, num); + return ret; +} + +EVP_MD_CTX *EVP_MD_CTX_new(void) +{ + return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); +} + +void EVP_MD_CTX_free(EVP_MD_CTX *ctx) +{ + EVP_MD_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} +#endif + + #define DEBUG_HASH 0 void module_sha256_create(struct image *image) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 0c91df0391d1..d80cf8d57f73 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -30,6 +30,22 @@ #include "css.h" #include "manifest.h" +#if OPENSSL_VERSION_NUMBER < 0x10100000L +void RSA_get0_key(const RSA *r, + const BIGNUM **n, const BIGNUM **e, const BIGNUM **d); + +void RSA_get0_key(const RSA *r, + const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) +{ + if (n != NULL) + *n = r->n; + if (e != NULL) + *e = r->e; + if (d != NULL) + *d = r->d; +} +#endif + #define DEBUG_PKCS 0 static void bytes_swap(uint8_t *ptr, uint32_t size) From 220a74308d7fb8661a4186913aedf345235d8c1a Mon Sep 17 00:00:00 2001 From: Marcin Maka Date: Tue, 22 May 2018 17:07:40 +0100 Subject: [PATCH 018/639] Removing unneeded XTOS sections from boot_ldr and main fw. Signed-off-by: Marcin Maka --- rimage/elf.c | 10 +++++++--- rimage/manifest.c | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 6c7e3dae3db1..4efed7a02150 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -77,9 +77,12 @@ static int elf_read_sections(struct image *image, struct module *module) /* find manifest module data */ man_section_idx = elf_find_section(image, module, ".bss"); if (man_section_idx < 0) { - return -EINVAL; + /* no bss - it is OK for boot_ldr */ + module->bss_start = 0; + module->bss_end = 0; + } else { + module->bss_index = man_section_idx; } - module->bss_index = man_section_idx; fprintf(stdout, " BSS module metadata section at index %d\n", man_section_idx); @@ -325,7 +328,8 @@ static void elf_module_limits(struct image *image, struct module *module) uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i; - module->text_start = module->data_start = module->bss_start = 0xffffffff; + module->text_start = module->data_start = 0xffffffff; + module->bss_start = 0; module->text_end = module->data_end = module->bss_end = 0; fprintf(stdout, " Found %d sections, listing valid sections......\n", diff --git a/rimage/manifest.c b/rimage/manifest.c index 6bb4ad3f203c..257aa0d3ab50 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -400,6 +400,11 @@ static int man_module_create(struct image *image, struct module *module, if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) pages += 1; man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; + if (pages == 0) { + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.ul = 0; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.type = + SOF_MAN_SEGMENT_EMPTY; + } fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); From d99e6d53c1c60e7a1f1dbe9659de532c6570b933 Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Mon, 4 Jun 2018 12:03:41 +0100 Subject: [PATCH 019/639] rimage: add correct FW version to binary Now correct FW version is included into binary. Signed-off-by: Tomasz Lauda --- rimage/man_apl.c | 24 ++++++++++-------------- rimage/man_cnl.c | 24 ++++++++++-------------- 2 files changed, 20 insertions(+), 28 deletions(-) diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 7b32ea1c3887..efe8583738d6 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -15,12 +15,8 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" - -/* hard coded atm - will pass this in from cmd line and git */ -#define MAN_FW_HDR_VERSION_MAJOR 9 -#define MAN_FW_HDR_VERSION_MINOR 22 -#define MAN_FW_HDR_VERSION_HOTFIX 1 -#define MAN_FW_HDR_VERSION_BUILD 0x7da +#include +#include /* manifest template */ struct fw_image_manifest apl_manifest = { @@ -65,10 +61,10 @@ struct fw_image_manifest apl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -134,10 +130,10 @@ struct fw_image_manifest apl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, .load_offset = MAN_DESC_OFFSET, }, }, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 2aec2a723d79..5ce8c9d63b84 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -15,12 +15,8 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" - -/* hard coded atm - will pass this in from cmd line and git */ -#define MAN_FW_HDR_VERSION_MAJOR 10 -#define MAN_FW_HDR_VERSION_MINOR 23 -#define MAN_FW_HDR_VERSION_HOTFIX 0 -#define MAN_FW_HDR_VERSION_BUILD 0x2a4 +#include +#include /* manifest template */ struct fw_image_manifest cnl_manifest = { @@ -64,10 +60,10 @@ struct fw_image_manifest cnl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -133,10 +129,10 @@ struct fw_image_manifest cnl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = MAN_FW_HDR_VERSION_MAJOR, - .minor_version = MAN_FW_HDR_VERSION_MINOR, - .hotfix_version = MAN_FW_HDR_VERSION_HOTFIX, - .build_version = MAN_FW_HDR_VERSION_BUILD, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, .load_offset = 0x30000, }, }, From 81eba29a2fcd3a28e0d61aaf448290b74002441c Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Mon, 4 Jun 2018 12:03:42 +0100 Subject: [PATCH 020/639] rimage: add support for automatic MEU signing This patch allows rimage to sign FW binaries using MEU tool. Paths to MEU and private key have to be provided during config step. Signed-off-by: Tomasz Lauda --- rimage/manifest.c | 172 +++++++++++++++++++++++++++++++++++---------- rimage/plat_auth.c | 7 +- rimage/plat_auth.h | 3 +- rimage/rimage.c | 10 ++- rimage/rimage.h | 3 +- 5 files changed, 149 insertions(+), 46 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 257aa0d3ab50..b758717b5348 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -539,12 +539,13 @@ static int man_module_create_reloc(struct image *image, struct module *module, return 0; } -static int man_write_unsigned_mod(struct image *image) +static int man_write_unsigned_mod(struct image *image, int meta_start_offset, + int meta_end_offset) { int count; /* write metadata file for unsigned FW */ - count = fwrite(image->fw_image + MAN_META_EXT_OFFSET, + count = fwrite(image->fw_image + meta_start_offset, sizeof(struct sof_man_adsp_meta_file_ext), 1, image->out_man_fd); @@ -557,8 +558,8 @@ static int man_write_unsigned_mod(struct image *image) fclose(image->out_man_fd); /* now prepare the unsigned rimage */ - count = fwrite(image->fw_image + MAN_FW_DESC_OFFSET, - image->image_end - MAN_FW_DESC_OFFSET, + count = fwrite(image->fw_image + meta_end_offset, + image->image_end - meta_end_offset, 1, image->out_unsigned_fd); /* did the unsigned FW write succeed ? */ @@ -601,13 +602,59 @@ static int man_write_fw_mod(struct image *image) return 0; } +static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc) +{ + struct module *module; + struct sof_man_module *man_module; + int err; + int i; + + for (i = 0; i < image->num_modules; i++) { + man_module = sof_man_get_module(desc, i); + module = &image->module[i]; + + /* set module file offset */ + if (i == 0) + module->foffset = FILE_TEXT_OFFSET; + else + module->foffset = image->image_end; + + if (image->reloc) + err = man_module_create_reloc(image, module, + man_module); + else + err = man_module_create(image, module, man_module); + + if (err < 0) + return err; + } + + return 0; +} + +static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) +{ + struct sof_man_module *man_module; + int i; + + for (i = 0; i < image->num_modules; i++) { + man_module = sof_man_get_module(desc, i); + + ri_hash(image, + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, + (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE, man_module->hash); + } + + return 0; +} + /* used by others */ static int man_write_fw(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest *m; - struct module *module; - struct sof_man_module *man_module; uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; int ret, i; @@ -637,31 +684,13 @@ static int man_write_fw(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - for (i = 0; i < image->num_modules; i++) { - - man_module = sof_man_get_module(desc, i); - module = &image->module[i]; - - /* set module file offset */ - if (i == 0) { - module->foffset = FILE_TEXT_OFFSET; - } else { - module->foffset = image->image_end; - } - - if (image->reloc) - ret = man_module_create_reloc(image, module, - man_module); - else - ret = man_module_create(image, module, man_module); - if (ret < 0) - goto err; - } + man_create_modules(image, desc); fprintf(stdout, "Firmware completing manifest\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image); + ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET, + MAN_FW_DESC_OFFSET); ri_plat_ext_data_create(image); ri_css_hdr_create(image); ri_cse_create(image); @@ -671,16 +700,7 @@ static int man_write_fw(struct image *image) desc->header.preload_page_count); /* calculate hash for each module */ - for (i = 0; i < image->num_modules; i++) { - - module = &image->module[i]; - man_module = sof_man_get_module(desc, i); - - ri_hash(image, man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, - (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * - MAN_PAGE_SIZE, man_module->hash); - } + man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ ri_hash(image, MAN_FW_DESC_OFFSET, image->image_end @@ -708,7 +728,8 @@ static int man_write_fw(struct image *image) goto err; /* write the unsigned files*/ - ret = man_write_unsigned_mod(image); + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET, + MAN_FW_DESC_OFFSET); if (ret < 0) goto err; @@ -723,6 +744,79 @@ static int man_write_fw(struct image *image) return ret; } +/* used to sign with MEU */ +static int man_write_fw_meu(struct image *image) +{ + const int meta_start_offset = image->meu_offset - + sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext *meta; + struct sof_man_fw_desc *desc; + uint32_t preload_size; + int ret; + + /* allocate image */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (image->fw_image == NULL) { + ret = -ENOMEM; + goto err; + } + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + meta = image->fw_image + meta_start_offset; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* copy data */ + memcpy(meta, &image->adsp->man->adsp_file_ext, + sizeof(struct sof_man_adsp_meta_file_ext)); + memcpy(desc, &image->adsp->man->desc, + sizeof(struct sof_man_fw_desc)); + + /* create each module */ + desc->header.num_module_entries = image->num_modules; + man_create_modules(image, desc); + + fprintf(stdout, "Firmware completing manifest\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + + /* write preload page count */ + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash for ADSP meta data extension */ + ri_hash(image, image->meu_offset, image->image_end - + image->meu_offset, meta->comp_desc[0].hash); + + /* write the unsigned files */ + ret = man_write_unsigned_mod(image, meta_start_offset, + image->meu_offset); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest completed!\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + #define ADSP_APL_DSP_ROM_BASE 0xBEFE0000 #define ADSP_APL_DSP_ROM_SIZE 0x00002000 #define APL_DSP_BASE_ENTRY 0xa000a000 @@ -743,6 +837,7 @@ const struct adsp machine_apl = { .dram_offset = 0, .machine_id = MACHINE_APOLLOLAKE, .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, .man = &apl_manifest, }; @@ -758,5 +853,6 @@ const struct adsp machine_cnl = { .dram_offset = 0, .machine_id = MACHINE_CANNONLAKE, .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, .man = &cnl_manifest, }; diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 21c7138cfbb1..2fd62aa0aa5f 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -18,15 +18,16 @@ #include "manifest.h" #include "plat_auth.h" -void ri_adsp_meta_data_create(struct image *image) +void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, + int meta_end_offset) { struct sof_man_adsp_meta_file_ext *meta = - image->fw_image + MAN_META_EXT_OFFSET; + image->fw_image + meta_start_offset; fprintf(stdout, " meta: completing ADSP manifest\n"); meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET + image->image_end - - MAN_FW_DESC_OFFSET; + - meta_end_offset; fprintf(stdout, " meta: limit is 0x%x\n", meta->comp_desc[0].limit_offset); diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h index 135f2d1ce07c..253a78bf40a3 100644 --- a/rimage/plat_auth.h +++ b/rimage/plat_auth.h @@ -86,7 +86,8 @@ struct partition_info_ext { (sizeof(struct partition_info_ext) + \ sizeof(struct signed_pkg_info_ext)) -void ri_adsp_meta_data_create(struct image *image); +void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, + int meta_end_offset); void ri_plat_ext_data_create(struct image *image); #endif diff --git a/rimage/rimage.c b/rimage/rimage.c index cc0a6101c44d..e8b9dc8e733f 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -39,6 +39,7 @@ static void usage(char *name) name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); + fprintf(stdout, "\t -s MEU signing offset\n"); exit(0); } @@ -50,7 +51,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:m:vba:sk:l:r")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:vba:s:k:l:r")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -62,7 +63,7 @@ int main(int argc, char *argv[]) image.verbose = 1; break; case 's': - image.dump_sections = 1; + image.meu_offset = atoi(optarg); break; case 'a': image.abi = atoi(optarg); @@ -130,7 +131,10 @@ int main(int argc, char *argv[]) } /* process and write output */ - ret = image.adsp->write_firmware(&image); + if (image.meu_offset) + ret = image.adsp->write_firmware_meu(&image); + else + ret = image.adsp->write_firmware(&image); out: /* close files */ if (image.out_fd) diff --git a/rimage/rimage.h b/rimage/rimage.h index 888e7e8e781a..3398ece5cd13 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -99,7 +99,7 @@ struct image { int num_modules; struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ - int dump_sections; + int meu_offset; /* SHA 256 */ const char *key_name; @@ -140,6 +140,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); + int (*write_firmware_meu)(struct image *image); struct fw_image_manifest *man; }; From c91c6f98c6c0f9330cdcb602ca58fac89168c457 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 29 Jun 2018 15:47:38 +0800 Subject: [PATCH 021/639] rimage: fix function returns address of local variable bug path may return out the function from rimage->key_name. Switch the usage for local variable to avoid this bug. Signed-off-by: Pan Xiuli --- rimage/pkcs1_5.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d80cf8d57f73..9b6598494702 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -90,16 +90,16 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, return -ENOMEM; /* load in RSA private key from PEM file */ - if (image->key_name == NULL) { + if (!image->key_name) sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); - image->key_name = path; - } + else + strcpy(path, image->key_name); - fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); - fp = fopen(image->key_name, "r"); + fprintf(stdout, " pkcs: signing with key %s\n", path); + fp = fopen(path, "r"); if (fp == NULL) { fprintf(stderr, "error: can't open file %s %d\n", - image->key_name, -errno); + path, -errno); return -errno; } PEM_read_PrivateKey(fp, &privkey, NULL, NULL); From 513c47fd8c25b2830260baf4129b5f328e059a32 Mon Sep 17 00:00:00 2001 From: Zhang Keqiao Date: Mon, 2 Jul 2018 14:00:40 +0800 Subject: [PATCH 022/639] rimage: adding an include for all gcc version build Signed-off-by: Zhang Keqiao --- rimage/pkcs1_5.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 9b6598494702..92535942c972 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "config.h" #include "rimage.h" From 4e9ef2347451b66cd80605cb90b3426c7d01c0b3 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 31 Aug 2018 15:19:33 +0200 Subject: [PATCH 023/639] icl: initial support Added icelake platform to platforms. Updated rimage to support icelake. Updated autoconf and automake files. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 24 +++++++++++++++++++++++- rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index b758717b5348..5ea712e8816a 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2018, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -12,6 +12,7 @@ * * Author: Liam Girdwood * Keyon Jie + * Janusz Jankowski */ @@ -826,6 +827,11 @@ static int man_write_fw_meu(struct image *image) #define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 #define CNL_DSP_HP_BASE_ENTRY 0xbe040000 +#define ADSP_ICL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_ICL_DSP_ROM_SIZE 0x00002000 +#define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 +#define ICL_DSP_HP_BASE_ENTRY 0xbe040000 + /* list of supported adsp */ const struct adsp machine_apl = { .name = "apl", @@ -856,3 +862,19 @@ const struct adsp machine_cnl = { .write_firmware_meu = man_write_fw_meu, .man = &cnl_manifest, }; + +const struct adsp machine_icl = { + .name = "icl", + .rom_base = ADSP_ICL_DSP_ROM_BASE, + .rom_size = ADSP_ICL_DSP_ROM_SIZE, + .imr_base = ICL_DSP_IMR_BASE_ENTRY, + .imr_size = 0x100000, + .sram_base = ICL_DSP_HP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_ICELAKE, + .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, + .man = &cnl_manifest, // use the same as CNL +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index e8b9dc8e733f..f7dd1949f3d0 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -31,6 +31,7 @@ static const struct adsp *machine[] = { &machine_bdw, &machine_apl, &machine_cnl, + &machine_icl, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 3398ece5cd13..f63404242c3c 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -40,6 +40,7 @@ enum machine_id { MACHINE_BROADWELL, MACHINE_APOLLOLAKE, MACHINE_CANNONLAKE, + MACHINE_ICELAKE, MACHINE_MAX }; @@ -170,5 +171,6 @@ extern const struct adsp machine_hsw; extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; +extern const struct adsp machine_icl; #endif From fd628ec368cd6f5ed6be0c6abb39f5dd985593b5 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 11 Sep 2018 10:40:53 +0200 Subject: [PATCH 024/639] autoconf: optional implicit-fallthrough Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 5ea712e8816a..dc883cc2faaa 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -143,6 +143,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, break; case SHT_NOBITS: seg_type = SOF_MAN_SEGMENT_BSS; + /* FALLTHRU */ default: return 0; } From 202c655364bf60232fd3df5be24ac8dfdf6fa3a8 Mon Sep 17 00:00:00 2001 From: ArturX Kloniecki Date: Tue, 25 Sep 2018 15:19:25 +0200 Subject: [PATCH 025/639] debugability: rimage: extract .static_log_entries from elf .static_log_entries section is extracted to logs dictionary to remove xtensa toolchain dependency from logs parser. Signed-off-by: ArturX Kloniecki --- rimage/elf.c | 11 ++++++++- rimage/file_format.h | 12 ++++++++++ rimage/file_simple.c | 54 ++++++++++++++++++++++++++++++++++++++++++++ rimage/rimage.c | 20 +++++++++++++++- rimage/rimage.h | 5 ++++ 5 files changed, 100 insertions(+), 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 4efed7a02150..6e9bd31a25e3 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -87,6 +87,12 @@ static int elf_read_sections(struct image *image, struct module *module) fprintf(stdout, " BSS module metadata section at index %d\n", man_section_idx); + /* find log entries section */ + module->logs_index = elf_find_section(image, module, + ".static_log_entries"); + fprintf(stdout, " static log entries section at index %d\n", + module->logs_index); + /* parse each section */ for (i = 0; i < hdr->e_shnum; i++) { @@ -281,6 +287,9 @@ static void elf_module_size(struct image *image, struct module *module, fprintf(stdout, "\tHEAP\t"); } break; + case SHT_NOTE: + fprintf(stdout, "\tNOTE\t"); + break; default: break; } @@ -343,7 +352,7 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; /* module bss can sometimes be missed */ - if (i != module->bss_index) { + if (i != module->bss_index && i != module->logs_index) { /* only check valid sections */ if (!(section->sh_flags & valid)) diff --git a/rimage/file_format.h b/rimage/file_format.h index 15302589cc40..ddc07c27a9b2 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -67,6 +67,9 @@ #define SND_SOF_FW_ABI 1 #define SND_SOF_FW_SIG "Reef" +#define SND_SOF_LOGS_SIG_SIZE 4 +#define SND_SOF_LOGS_SIG "Logs" + /* * Firmware module is made up of 1 . N blocks of different types. The * Block header is used to determine where and how block is to be copied in the @@ -114,4 +117,13 @@ struct snd_sof_fw_header { uint32_t abi; /* version of header format */ } __attribute__((packed)); +/* + * Logs dictionary file header. + */ +struct snd_sof_logs_header { + unsigned char sig[SND_SOF_LOGS_SIG_SIZE]; /* "Logs" */ + uint32_t base_address; /* address of log entries section */ + uint32_t data_length; /* amount of bytes following this header */ + uint32_t data_offset; /* offset to first entry in this file */ +}; #endif diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 4068734ea1cc..13f517a495c6 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -345,6 +345,60 @@ static int simple_write_firmware(struct image *image) return 0; } +int write_logs_dictionary(struct image *image) +{ + struct snd_sof_logs_header header; + int i, ret = 0; + void *buffer = NULL; + + memcpy(header.sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE); + header.data_offset = sizeof(struct snd_sof_logs_header); + + for (i = 0; i < image->num_modules; i++) { + struct module *module = &image->module[i]; + + if (module->logs_index > 0) { + Elf32_Shdr *section = &module->section[module->logs_index]; + + header.base_address = section->sh_addr; + header.data_length = section->sh_size; + + fwrite(&header, sizeof(struct snd_sof_logs_header), 1, + image->ldc_out_fd); + + buffer = calloc(1, section->sh_size); + if (!buffer) + return -ENOMEM; + + fseek(module->fd, section->sh_offset, SEEK_SET); + size_t count = fread(buffer, 1, section->sh_size, + module->fd); + if (count != section->sh_size) { + fprintf(stderr, "error: can't read section %d\n", + -errno); + ret = -errno; + goto out; + } + count = fwrite(buffer, 1, section->sh_size, + image->ldc_out_fd); + if (count != section->sh_size) { + fprintf(stderr, "error: can't write section %d\n", + -errno); + ret = -errno; + goto out; + } + + fprintf(stdout, "logs dictionary: size %d\n\n", + header.data_length + header.data_offset); + } + } +out: + if (buffer) + free(buffer); + + return ret; +} + const struct adsp machine_byt = { .name = "byt", .iram_base = BYT_IRAM_BASE, diff --git a/rimage/rimage.c b/rimage/rimage.c index f7dd1949f3d0..b67819646a3f 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -41,6 +41,7 @@ static void usage(char *name) fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); + fprintf(stdout, "\t -p log dictionary outfile\n"); exit(0); } @@ -52,11 +53,14 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:m:vba:s:k:l:r")) != -1) { + while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:r")) != -1) { switch (opt) { case 'o': image.out_file = optarg; break; + case 'p': + image.ldc_out_file = optarg; + break; case 'm': mach = optarg; break; @@ -89,6 +93,8 @@ int main(int argc, char *argv[]) if (image.out_file == NULL || mach == NULL) usage(argv[0]); + if (image.ldc_out_file == NULL) + image.ldc_out_file = "out.ldc"; /* find machine */ for (i = 0; i < ARRAY_SIZE(machine); i++) { @@ -136,11 +142,23 @@ int main(int argc, char *argv[]) ret = image.adsp->write_firmware_meu(&image); else ret = image.adsp->write_firmware(&image); + + unlink(image.ldc_out_file); + image.ldc_out_fd = fopen(image.ldc_out_file, "w"); + if (image.ldc_out_fd == NULL) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image.ldc_out_file, errno); + ret = -EINVAL; + goto out; + } + ret = write_logs_dictionary(&image); out: /* close files */ if (image.out_fd) fclose(image.out_fd); + if (image.ldc_out_fd) + fclose(image.ldc_out_fd); return ret; } diff --git a/rimage/rimage.h b/rimage/rimage.h index f63404242c3c..4aeae29d3c5f 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -68,6 +68,7 @@ struct module { int num_bss; int fw_size; int bss_index; + int logs_index; /* sizes do not include any gaps */ int bss_size; @@ -90,7 +91,9 @@ struct module { struct image { const char *out_file; + const char *ldc_out_file; FILE *out_fd; + FILE *ldc_out_fd; void *pos; const struct adsp *adsp; @@ -145,6 +148,8 @@ struct adsp { struct fw_image_manifest *man; }; +int write_logs_dictionary(struct image *image); + void module_sha256_create(struct image *image); void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); From 15d5a9545b2bb0b7f74f524a7b6260d05050cad9 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 28 Sep 2018 15:48:29 +0100 Subject: [PATCH 026/639] rimage: add initial support for sue creek. Build tested. Signed-off-by: Liam Girdwood --- rimage/manifest.c | 21 +++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 24 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index dc883cc2faaa..d988f16be4c1 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -828,6 +828,11 @@ static int man_write_fw_meu(struct image *image) #define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 #define CNL_DSP_HP_BASE_ENTRY 0xbe040000 +#define ADSP_SUE_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_SUE_DSP_ROM_SIZE 0x00002000 +#define SUE_DSP_IMR_BASE_ENTRY 0xb0038000 +#define SUE_DSP_HP_BASE_ENTRY 0xbe000000 + #define ADSP_ICL_DSP_ROM_BASE 0xBEFE0000 #define ADSP_ICL_DSP_ROM_SIZE 0x00002000 #define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 @@ -879,3 +884,19 @@ const struct adsp machine_icl = { .write_firmware_meu = man_write_fw_meu, .man = &cnl_manifest, // use the same as CNL }; + +const struct adsp machine_sue = { + .name = "sue", + .rom_base = ADSP_SUE_DSP_ROM_BASE, + .rom_size = ADSP_SUE_DSP_ROM_SIZE, + .imr_base = SUE_DSP_IMR_BASE_ENTRY, + .imr_size = 0x100000, + .sram_base = SUE_DSP_HP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_SUECREEK, + .write_firmware = man_write_fw, + .write_firmware_meu = man_write_fw_meu, + .man = &cnl_manifest, +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index b67819646a3f..e5affadebbac 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -32,6 +32,7 @@ static const struct adsp *machine[] = { &machine_apl, &machine_cnl, &machine_icl, + &machine_sue, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 4aeae29d3c5f..3ee8940905a1 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -41,6 +41,7 @@ enum machine_id { MACHINE_APOLLOLAKE, MACHINE_CANNONLAKE, MACHINE_ICELAKE, + MACHINE_SUECREEK, MACHINE_MAX }; @@ -177,5 +178,6 @@ extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; +extern const struct adsp machine_sue; #endif From 458272942242691dcfffe439c8499982f94139d3 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 15 Oct 2018 13:47:08 +0800 Subject: [PATCH 027/639] rimage: rename the old css_header and fw_image_manifest rename css_header to css_header_v1_8 rename fw_image_manifest to fw_image_manifest_v1_8 Signed-off-by: Zhu Yingjiang --- rimage/css.c | 2 +- rimage/css.h | 4 ++-- rimage/man_apl.c | 4 ++-- rimage/man_cnl.c | 4 ++-- rimage/manifest.c | 4 ++-- rimage/manifest.h | 10 +++++----- rimage/pkcs1_5.c | 8 ++++---- rimage/rimage.h | 6 +++--- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rimage/css.c b/rimage/css.c index 79b5acead7ae..9f5db485e1c1 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -22,7 +22,7 @@ void ri_css_hdr_create(struct image *image) { - struct css_header *css = image->fw_image + MAN_CSS_HDR_OFFSET; + struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; struct timeval tv; int val; diff --git a/rimage/css.h b/rimage/css.h index 0516f531ba9a..b8f39ad9a1da 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -28,7 +28,7 @@ struct image; #define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE \ - (sizeof(struct fw_image_manifest) >> 2) + (sizeof(struct fw_image_manifest_v1_8) >> 2) /* * RSA Key and Crypto @@ -44,7 +44,7 @@ struct fw_version { uint16_t build_version; } __attribute__((packed)); -struct css_header { +struct css_header_v1_8 { uint32_t header_type; uint32_t header_len; uint32_t header_version; diff --git a/rimage/man_apl.c b/rimage/man_apl.c index efe8583738d6..2cd998297f3b 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -19,7 +19,7 @@ #include /* manifest template */ -struct fw_image_manifest apl_manifest = { +struct fw_image_manifest_v1_8 apl_manifest = { .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, @@ -36,7 +36,7 @@ struct fw_image_manifest apl_manifest = { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header) + + .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 5ce8c9d63b84..6dc37900ec84 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -19,7 +19,7 @@ #include /* manifest template */ -struct fw_image_manifest cnl_manifest = { +struct fw_image_manifest_v1_8 cnl_manifest = { .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, @@ -35,7 +35,7 @@ struct fw_image_manifest cnl_manifest = { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header) + + .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ diff --git a/rimage/manifest.c b/rimage/manifest.c index d988f16be4c1..629be790f941 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -90,7 +90,7 @@ static int man_init_image(struct image *image) return -ENOMEM; memcpy(image->fw_image, image->adsp->man, - sizeof(struct fw_image_manifest)); + sizeof(struct fw_image_manifest_v1_8)); return 0; } @@ -656,7 +656,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) static int man_write_fw(struct image *image) { struct sof_man_fw_desc *desc; - struct fw_image_manifest *m; + struct fw_image_manifest_v1_8 *m; uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; int ret, i; diff --git a/rimage/manifest.h b/rimage/manifest.h index 8d1d3d2cae01..ce3f7fa5a83b 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -46,7 +46,7 @@ #define MAN_SIG_PKG_OFFSET \ (MAN_CSS_HDR_OFFSET + \ - sizeof(struct css_header)) + sizeof(struct css_header_v1_8)) #define MAN_PART_INFO_OFFSET \ (MAN_SIG_PKG_OFFSET + \ @@ -69,11 +69,11 @@ /* * Firmware manifest header. */ -struct fw_image_manifest { +struct fw_image_manifest_v1_8 { /* MEU tool needs these sections to be 0s */ struct CsePartitionDirHeader cse_partition_dir_header; struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; - struct css_header css; + struct css_header_v1_8 css; struct signed_pkg_info_ext signed_pkg; struct partition_info_ext partition_info; uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; @@ -88,6 +88,6 @@ struct fw_image_manifest { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); -extern struct fw_image_manifest apl_manifest; -extern struct fw_image_manifest cnl_manifest; +extern struct fw_image_manifest_v1_8 apl_manifest; +extern struct fw_image_manifest_v1_8 cnl_manifest; #endif diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 92535942c972..ec6b9265226b 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,8 +68,8 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign(struct image *image, struct fw_image_manifest *man, - void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) +int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -151,10 +151,10 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, int ri_manifest_sign(struct image *image) { - struct fw_image_manifest *man = image->fw_image; + struct fw_image_manifest_v1_8 *man = image->fw_image; pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET, - sizeof(struct css_header) - + sizeof(struct css_header_v1_8) - (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + MAN_RSA_SIGNATURE_LEN), (void *)man + MAN_SIG_PKG_OFFSET, diff --git a/rimage/rimage.h b/rimage/rimage.h index 3ee8940905a1..bd1e03180a61 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -146,7 +146,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); - struct fw_image_manifest *man; + struct fw_image_manifest_v1_8 *man; }; int write_logs_dictionary(struct image *image); @@ -157,8 +157,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash); int ri_manifest_sign(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); -int pkcs_sign(struct image *image, struct fw_image_manifest *man, - void *ptr1, unsigned size1, void *ptr2, unsigned size2); +int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); From 2d9af17a90d7be2b2e963f2f04505342065a8e03 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Thu, 18 Oct 2018 14:21:04 +0800 Subject: [PATCH 028/639] rimage: modify the API to version 1.8 change the define to 1.8 modify the API name to 1.8 Signed-off-by: Zhu Yingjiang --- rimage/cse.c | 2 +- rimage/css.c | 4 ++-- rimage/css.h | 4 ++-- rimage/man_apl.c | 6 ++--- rimage/man_cnl.c | 6 ++--- rimage/manifest.c | 58 +++++++++++++++++++++++----------------------- rimage/manifest.h | 24 +++++++++---------- rimage/pkcs1_5.c | 20 +++++++++------- rimage/plat_auth.c | 5 ++-- rimage/rimage.h | 9 +++---- 10 files changed, 71 insertions(+), 67 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index b5604153f120..8bc1c30afa47 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -23,7 +23,7 @@ void ri_cse_create(struct image *image) { struct CsePartitionDirHeader *cse_hdr = image->fw_image; struct sof_man_adsp_meta_file_ext *meta = image->fw_image + - MAN_META_EXT_OFFSET; + MAN_META_EXT_OFFSET_V1_8; struct CsePartitionDirEntry *cse_entry = image->fw_image + sizeof(*cse_hdr); uint8_t csum = 0, *val = image->fw_image; diff --git a/rimage/css.c b/rimage/css.c index 9f5db485e1c1..6c87025a0293 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -20,9 +20,9 @@ #include "css.h" #include "manifest.h" -void ri_css_hdr_create(struct image *image) +void ri_css_hdr_create_v1_8(struct image *image) { - struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; + struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET_V1_8; struct tm *date; struct timeval tv; int val; diff --git a/rimage/css.h b/rimage/css.h index b8f39ad9a1da..eb910d42d3fb 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -27,7 +27,7 @@ struct image; #define MAN_CSS_KEY_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) -#define MAN_CSS_MAN_SIZE \ +#define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) /* @@ -64,6 +64,6 @@ struct css_header_v1_8 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); -void ri_css_hdr_create(struct image *image); +void ri_css_hdr_create_v1_8(struct image *image); #endif diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 2cd998297f3b..201e4361f3d8 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -35,18 +35,18 @@ struct fw_image_manifest_v1_8 apl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, + .offset = MAN_CSS_HDR_OFFSET_V1_8, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET, + .offset = MAN_META_EXT_OFFSET_V1_8, .length = sizeof(struct sof_man_adsp_meta_file_ext), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET, + .offset = MAN_FW_DESC_OFFSET_V1_8, .length = 0, /* calculated by rimage - */ }, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 6dc37900ec84..575b260a1857 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -34,18 +34,18 @@ struct fw_image_manifest_v1_8 cnl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, + .offset = MAN_CSS_HDR_OFFSET_V1_8, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET, + .offset = MAN_META_EXT_OFFSET_V1_8, .length = sizeof(struct sof_man_adsp_meta_file_ext), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET, + .offset = MAN_FW_DESC_OFFSET_V1_8, .length = 0, /* calculated by rimage - */ }, diff --git a/rimage/manifest.c b/rimage/manifest.c index 629be790f941..f5225628f520 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -82,15 +82,15 @@ static int man_open_manifest_file(struct image *image) return 0; } -static int man_init_image(struct image *image) +static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ image->fw_image = calloc(image->adsp->image_size, 1); if (image->fw_image == NULL) return -ENOMEM; - memcpy(image->fw_image, image->adsp->man, - sizeof(struct fw_image_manifest_v1_8)); + memcpy(image->fw_image, image->adsp->man_v1_8, + sizeof(struct fw_image_manifest_v1_8)); return 0; } @@ -653,7 +653,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) } /* used by others */ -static int man_write_fw(struct image *image) +static int man_write_fw_v1_8(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_8 *m; @@ -661,7 +661,7 @@ static int man_write_fw(struct image *image) int ret, i; /* init image */ - ret = man_init_image(image); + ret = man_init_image_v1_8(image); if (ret < 0) goto err; @@ -691,10 +691,10 @@ static int man_write_fw(struct image *image) fprintf(stdout, "Firmware completing manifest\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET, - MAN_FW_DESC_OFFSET); + ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); - ri_css_hdr_create(image); + ri_css_hdr_create_v1_8(image); ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", @@ -705,11 +705,11 @@ static int man_write_fw(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ - ri_hash(image, MAN_FW_DESC_OFFSET, image->image_end - - MAN_FW_DESC_OFFSET, m->adsp_file_ext.comp_desc[0].hash); + ri_hash(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end + - MAN_FW_DESC_OFFSET_V1_8, m->adsp_file_ext.comp_desc[0].hash); /* calculate hash for platform auth data - repeated in hash 2 and 4 */ - ri_hash(image, MAN_META_EXT_OFFSET, + ri_hash(image, MAN_META_EXT_OFFSET_V1_8, sizeof(struct sof_man_adsp_meta_file_ext), hash); /* hash values in reverse order */ @@ -720,7 +720,7 @@ static int man_write_fw(struct image *image) } /* sign manifest */ - ret = ri_manifest_sign(image); + ret = ri_manifest_sign_v1_8(image); if (ret < 0) goto err; @@ -730,8 +730,8 @@ static int man_write_fw(struct image *image) goto err; /* write the unsigned files*/ - ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET, - MAN_FW_DESC_OFFSET); + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); if (ret < 0) goto err; @@ -747,7 +747,7 @@ static int man_write_fw(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu(struct image *image) +static int man_write_fw_meu_v1_8(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; @@ -778,9 +778,9 @@ static int man_write_fw_meu(struct image *image) desc = image->fw_image + MAN_DESC_OFFSET; /* copy data */ - memcpy(meta, &image->adsp->man->adsp_file_ext, + memcpy(meta, &image->adsp->man_v1_8->adsp_file_ext, sizeof(struct sof_man_adsp_meta_file_ext)); - memcpy(desc, &image->adsp->man->desc, + memcpy(desc, &image->adsp->man_v1_8->desc, sizeof(struct sof_man_fw_desc)); /* create each module */ @@ -848,9 +848,9 @@ const struct adsp machine_apl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_APOLLOLAKE, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &apl_manifest, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &apl_manifest, }; const struct adsp machine_cnl = { @@ -864,9 +864,9 @@ const struct adsp machine_cnl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_CANNONLAKE, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &cnl_manifest, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, }; const struct adsp machine_icl = { @@ -880,9 +880,9 @@ const struct adsp machine_icl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_ICELAKE, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &cnl_manifest, // use the same as CNL + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, // use the same as CNL }; const struct adsp machine_sue = { @@ -896,7 +896,7 @@ const struct adsp machine_sue = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SUECREEK, - .write_firmware = man_write_fw, - .write_firmware_meu = man_write_fw_meu, - .man = &cnl_manifest, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, }; diff --git a/rimage/manifest.h b/rimage/manifest.h index ce3f7fa5a83b..da03d9a71345 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -39,32 +39,32 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET 0x2000 -#define MAN_CSS_HDR_OFFSET \ +#define MAN_CSS_HDR_OFFSET_V1_8 \ (MAN_CSE_HDR_OFFSET + \ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) -#define MAN_SIG_PKG_OFFSET \ - (MAN_CSS_HDR_OFFSET + \ +#define MAN_SIG_PKG_OFFSET_V1_8 \ + (MAN_CSS_HDR_OFFSET_V1_8 + \ sizeof(struct css_header_v1_8)) -#define MAN_PART_INFO_OFFSET \ - (MAN_SIG_PKG_OFFSET + \ +#define MAN_PART_INFO_OFFSET_V1_8 \ + (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext)) -#define MAN_META_EXT_OFFSET \ - (MAN_SIG_PKG_OFFSET + \ +#define MAN_META_EXT_OFFSET_V1_8 \ + (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext) + \ sizeof(struct partition_info_ext) + \ MAN_CSE_PADDING_SIZE) -#define MAN_FW_DESC_OFFSET \ - (MAN_META_EXT_OFFSET + \ +#define MAN_FW_DESC_OFFSET_V1_8 \ + (MAN_META_EXT_OFFSET_V1_8 + \ sizeof(struct sof_man_adsp_meta_file_ext) + \ MAN_EXT_PADDING) -#define MAN_DESC_PADDING_SIZE \ - (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET) +#define MAN_DESC_PADDING_SIZE_V1_8 \ + (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) /* * Firmware manifest header. @@ -83,7 +83,7 @@ struct fw_image_manifest_v1_8 { uint8_t reserved[MAN_EXT_PADDING]; /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ - uint8_t padding[MAN_DESC_PADDING_SIZE]; + uint8_t padding[MAN_DESC_PADDING_SIZE_V1_8]; struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index ec6b9265226b..1483f0e6e388 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,8 +68,9 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) +int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -149,15 +150,16 @@ int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, return ret; } -int ri_manifest_sign(struct image *image) +int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; - pkcs_sign(image, man, (void *)man + MAN_CSS_HDR_OFFSET, - sizeof(struct css_header_v1_8) - - (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + - MAN_RSA_SIGNATURE_LEN), - (void *)man + MAN_SIG_PKG_OFFSET, - (man->css.size - man->css.header_len) * sizeof(uint32_t)); + pkcs_sign_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET_V1_8, + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN), + (void *)man + MAN_SIG_PKG_OFFSET_V1_8, + (man->css.size - man->css.header_len) + * sizeof(uint32_t)); return 0; } diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 2fd62aa0aa5f..48484bfd1959 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -36,9 +36,10 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, void ri_plat_ext_data_create(struct image *image) { - struct partition_info_ext *part = image->fw_image + MAN_PART_INFO_OFFSET; + struct partition_info_ext *part = image->fw_image + + MAN_PART_INFO_OFFSET_V1_8; struct sof_man_adsp_meta_file_ext *meta = - image->fw_image + MAN_META_EXT_OFFSET; + image->fw_image + MAN_META_EXT_OFFSET_V1_8; struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET; fprintf(stdout, " auth: completing authentication manifest\n"); diff --git a/rimage/rimage.h b/rimage/rimage.h index bd1e03180a61..b3ca3bbe73d5 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -146,7 +146,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); - struct fw_image_manifest_v1_8 *man; + struct fw_image_manifest_v1_8 *man_v1_8; }; int write_logs_dictionary(struct image *image); @@ -154,11 +154,12 @@ int write_logs_dictionary(struct image *image); void module_sha256_create(struct image *image); void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); -int ri_manifest_sign(struct image *image); +int ri_manifest_sign_v1_8(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); -int pkcs_sign(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); From 75b6586f99d3e5fe32443817718fcd0900fd0b05 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Thu, 18 Oct 2018 14:39:36 +0800 Subject: [PATCH 029/639] rimage: add firmware 1.5 manifest header add manifest for skylake/kabylake, version 1.5 Signed-off-by: Zhu Yingjiang --- rimage/css.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rimage/css.h b/rimage/css.h index eb910d42d3fb..77597d1272d1 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -64,6 +64,23 @@ struct css_header_v1_8 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); +struct css_header_v1_5 { + uint32_t module_type; + uint32_t header_len; + uint32_t header_version; + uint32_t reserved0; /* must be 0x0 */ + uint32_t module_vendor; + uint32_t date; + uint32_t size; + uint32_t key_size; + uint32_t modulus_size; + uint32_t exponent_size; + uint32_t reserved[22]; + uint8_t modulus[MAN_RSA_KEY_MODULUS_LEN]; + uint8_t exponent[MAN_RSA_KEY_EXPONENT_LEN]; + uint8_t signature[MAN_RSA_SIGNATURE_LEN]; +} __attribute__((packed)); + void ri_css_hdr_create_v1_8(struct image *image); #endif From dd81092b6e0c001c02e1c8e7bd5650c84955795d Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 15 Oct 2018 14:21:38 +0800 Subject: [PATCH 030/639] rimage: add firmware 1.5 manifest binary descryptor add the 1.5 version manifest, for skylake and kabylake Signed-off-by: Zhu Yingjiang --- rimage/manifest.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rimage/manifest.h b/rimage/manifest.h index da03d9a71345..418d96d64cb7 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -90,4 +90,11 @@ struct fw_image_manifest_v1_8 { extern struct fw_image_manifest_v1_8 apl_manifest; extern struct fw_image_manifest_v1_8 cnl_manifest; + +struct fw_image_manifest_v1_5 { + struct css_header_v1_5 header; + struct sof_man_fw_desc adsp_fw_bin_desc; +} __attribute__((packed)); + +extern struct fw_image_manifest_v1_5 skl_manifest; #endif From f76b24ba0a368681dd567e530ae02729bbffbdd5 Mon Sep 17 00:00:00 2001 From: ArturX Kloniecki Date: Mon, 29 Oct 2018 12:55:23 +0100 Subject: [PATCH 031/639] rimage: debugability: include fw_version in .ldc file Extract fw_version from fw_ready section of elf and include it in header of .ldc file to allow verification by sof-logger. Signed-off-by: ArturX Kloniecki --- rimage/elf.c | 13 +++++++++---- rimage/file_format.h | 5 +++++ rimage/file_simple.c | 38 ++++++++++++++++++++++++++++++++++++-- rimage/rimage.h | 1 + 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 6e9bd31a25e3..e2c6e8ff8257 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -87,11 +87,15 @@ static int elf_read_sections(struct image *image, struct module *module) fprintf(stdout, " BSS module metadata section at index %d\n", man_section_idx); - /* find log entries section */ - module->logs_index = elf_find_section(image, module, - ".static_log_entries"); + /* find log entries and fw ready sections */ + module->logs_index = elf_find_section(image, module, + ".static_log_entries"); fprintf(stdout, " static log entries section at index %d\n", module->logs_index); + module->fw_ready_index = elf_find_section(image, module, + ".fw_ready"); + fprintf(stdout, " fw ready section at index %d\n", + module->fw_ready_index); /* parse each section */ for (i = 0; i < hdr->e_shnum; i++) { @@ -352,7 +356,8 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; /* module bss can sometimes be missed */ - if (i != module->bss_index && i != module->logs_index) { + if (i != module->bss_index && i != module->logs_index && + i != module->fw_ready_index) { /* only check valid sections */ if (!(section->sh_flags & valid)) diff --git a/rimage/file_format.h b/rimage/file_format.h index ddc07c27a9b2..935df3dc7923 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -63,6 +63,10 @@ #ifndef __INCLUDE_UAPI_SOF_FW_H__ #define __INCLUDE_UAPI_SOF_FW_H__ +/* Skip inclusion of which causes errors */ +#define __INCLUDE_IO__ +#include + #define SND_SOF_FW_SIG_SIZE 4 #define SND_SOF_FW_ABI 1 #define SND_SOF_FW_SIG "Reef" @@ -125,5 +129,6 @@ struct snd_sof_logs_header { uint32_t base_address; /* address of log entries section */ uint32_t data_length; /* amount of bytes following this header */ uint32_t data_offset; /* offset to first entry in this file */ + struct sof_ipc_fw_version version; }; #endif diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 13f517a495c6..c88676c4e5cf 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -357,6 +357,37 @@ int write_logs_dictionary(struct image *image) for (i = 0; i < image->num_modules; i++) { struct module *module = &image->module[i]; + /* extract fw_version from fw_ready message located + * in .fw_ready section + */ + if (module->fw_ready_index > 0) { + Elf32_Shdr *section = + &module->section[module->fw_ready_index]; + + buffer = calloc(1, sizeof(struct sof_ipc_fw_ready)); + if (!buffer) + return -ENOMEM; + + fseek(module->fd, section->sh_offset, SEEK_SET); + size_t count = fread(buffer, 1, + sizeof(struct sof_ipc_fw_ready), module->fd); + + if (count != sizeof(struct sof_ipc_fw_ready)) { + fprintf(stderr, + "error: can't read ready section %d\n", + -errno); + ret = -errno; + goto out; + } + + memcpy(&header.version, + &((struct sof_ipc_fw_ready *)buffer)->version, + sizeof(header.version)); + + free(buffer); + buffer = NULL; + } + if (module->logs_index > 0) { Elf32_Shdr *section = &module->section[module->logs_index]; @@ -374,7 +405,8 @@ int write_logs_dictionary(struct image *image) size_t count = fread(buffer, 1, section->sh_size, module->fd); if (count != section->sh_size) { - fprintf(stderr, "error: can't read section %d\n", + fprintf(stderr, + "error: can't read logs section %d\n", -errno); ret = -errno; goto out; @@ -388,8 +420,10 @@ int write_logs_dictionary(struct image *image) goto out; } - fprintf(stdout, "logs dictionary: size %d\n\n", + fprintf(stdout, "logs dictionary: size %u\n", header.data_length + header.data_offset); + fprintf(stdout, "including fw version of size: %lu\n\n", + sizeof(header.version)); } } out: diff --git a/rimage/rimage.h b/rimage/rimage.h index b3ca3bbe73d5..6752005a0e1c 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -70,6 +70,7 @@ struct module { int fw_size; int bss_index; int logs_index; + int fw_ready_index; /* sizes do not include any gaps */ int bss_size; From fb5e8ac792fb8b25ae10b01147c7cb20d5831bb9 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:19:49 +0800 Subject: [PATCH 032/639] rimage: manifest: rename old manifest to 1.8 rename old API and comments print info to 1.8, as for add 1.5 manifest. Signed-off-by: Zhu Yingjiang --- rimage/manifest.c | 4 ++-- rimage/manifest.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index f5225628f520..8e9e8359006c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -688,7 +688,7 @@ static int man_write_fw_v1_8(struct image *image) m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc); - fprintf(stdout, "Firmware completing manifest\n"); + fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, @@ -787,7 +787,7 @@ static int man_write_fw_meu_v1_8(struct image *image) desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc); - fprintf(stdout, "Firmware completing manifest\n"); + fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); diff --git a/rimage/manifest.h b/rimage/manifest.h index 418d96d64cb7..29f598fcc65f 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -67,7 +67,7 @@ (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) /* - * Firmware manifest header. + * Firmware manifest header V1.8 used on APL onwards */ struct fw_image_manifest_v1_8 { /* MEU tool needs these sections to be 0s */ From 75533a65b5cf39fbe9f28e6080696b30e99ba2b6 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:31:43 +0800 Subject: [PATCH 033/639] rimage: manifest: add 1.5 manifest define add 1.5 manifest structure define, macro define, KBL and SKL 1.5 manifest defines Signed-off-by: Zhu Yingjiang --- rimage/css.h | 3 +++ rimage/man_kbl.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.h | 8 +++++-- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 rimage/man_kbl.c diff --git a/rimage/css.h b/rimage/css.h index 77597d1272d1..13135c55edbb 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -18,6 +18,7 @@ struct image; +#define MAN_CSS_LT_MODULE_TYPE 0x00000006 #define MAN_CSS_MOD_TYPE 4 #define MAN_CSS_HDR_SIZE 161 /* in words */ #define MAN_CSS_HDR_VERSION 0x10000 @@ -29,6 +30,8 @@ struct image; #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) +#define MAN_CSS_MAN_SIZE_V1_5 \ + (sizeof(struct fw_image_manifest_v1_5) >> 2) /* * RSA Key and Crypto diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c new file mode 100644 index 000000000000..5e614f5514f7 --- /dev/null +++ b/rimage/man_kbl.c @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include +#include + +#define KBL_HARDWARE_BUFFER_BASE 0xBE500000 +#define KBL_HARDWARE_BUFFER_LEN 0x4A000 + +/* manifest template */ +struct fw_image_manifest_v1_5 kbl_manifest = { + .css_header = { + .module_type = MAN_CSS_LT_MODULE_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 0x800, + .key_size = MAN_CSS_KEY_SIZE, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + /* size in pages from $CPD */ + .preload_page_count = 0, + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0, + .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, + .hw_buf_length = KBL_HARDWARE_BUFFER_LEN + }, + }, +}; diff --git a/rimage/manifest.h b/rimage/manifest.h index 29f598fcc65f..4c53a69a0e04 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -91,10 +91,14 @@ struct fw_image_manifest_v1_8 { extern struct fw_image_manifest_v1_8 apl_manifest; extern struct fw_image_manifest_v1_8 cnl_manifest; +/* + * Firmware manifest header V1.5 used on SKL and KBL + */ struct fw_image_manifest_v1_5 { - struct css_header_v1_5 header; - struct sof_man_fw_desc adsp_fw_bin_desc; + struct css_header_v1_5 css_header; + struct sof_man_fw_desc desc; } __attribute__((packed)); extern struct fw_image_manifest_v1_5 skl_manifest; +extern struct fw_image_manifest_v1_5 kbl_manifest; #endif From 91b917916fa3aa7cb447b54b0656b0d4c7b72263 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:43:16 +0800 Subject: [PATCH 034/639] rimage: manifest: add manifest APIs add the 1.5 manifest operation APIs Signed-off-by: Zhu Yingjiang --- rimage/manifest.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 8e9e8359006c..8f87aeb21323 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -82,6 +82,19 @@ static int man_open_manifest_file(struct image *image) return 0; } +static int man_init_image_v1_5(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man_v1_5, + sizeof(struct fw_image_manifest_v1_5)); + + return 0; +} + static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ @@ -652,6 +665,84 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) return 0; } +/* used by others */ +static int man_write_fw_v1_5(struct image *image) +{ + struct sof_man_fw_desc *desc; + struct fw_image_manifest_v1_5 *m; + int ret; + + /* init image */ + ret = man_init_image_v1_5(image); + if (ret < 0) + goto err; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + man_create_modules(image, desc); + + fprintf(stdout, "Firmware completing manifest v1.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); + ri_plat_ext_data_create(image); + ri_css_hdr_create_v1_8(image); + ri_cse_create(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* sign manifest */ + ret = ri_manifest_sign_v1_5(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} + /* used by others */ static int man_write_fw_v1_8(struct image *image) { @@ -746,6 +837,77 @@ static int man_write_fw_v1_8(struct image *image) return ret; } +/* used to sign with MEU */ +static int man_write_fw_meu_v1_5(struct image *image) +{ + const int meta_start_offset = image->meu_offset - + sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext *meta; + struct sof_man_fw_desc *desc; + uint32_t preload_size; + int ret; + + /* allocate image */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) { + ret = -ENOMEM; + goto err; + } + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + meta = image->fw_image + meta_start_offset; + desc = image->fw_image + MAN_DESC_OFFSET; + + /* copy data */ + memcpy(desc, &image->adsp->man_v1_5->desc, + sizeof(struct sof_man_fw_desc)); + + /* create each module */ + desc->header.num_module_entries = image->num_modules; + man_create_modules(image, desc); + + fprintf(stdout, "Firmware completing manifest v1.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + + /* write preload page count */ + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash for ADSP meta data extension */ + ri_hash(image, image->meu_offset, image->image_end - + image->meu_offset, meta->comp_desc[0].hash); + + /* write the unsigned files */ + ret = man_write_unsigned_mod(image, meta_start_offset, + image->meu_offset); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest completed!\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + /* used to sign with MEU */ static int man_write_fw_meu_v1_8(struct image *image) { From 641fab27c768dd7612ce357949de03618cd6950f Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:52:21 +0800 Subject: [PATCH 035/639] rimage: add 1.5 rimage defines add 1.5 rimage defines for skl and kbl Signed-off-by: Zhu Yingjiang --- rimage/manifest.c | 28 ++++++++++++++++++++++++++++ rimage/rimage.c | 2 ++ rimage/rimage.h | 6 ++++++ 3 files changed, 36 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 8f87aeb21323..6e7ff9bbe371 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1015,6 +1015,34 @@ const struct adsp machine_apl = { .man_v1_8 = &apl_manifest, }; +const struct adsp machine_kbl = { + .name = "kbl", + .rom_base = ADSP_APL_DSP_ROM_BASE, + .rom_size = ADSP_APL_DSP_ROM_SIZE, + .sram_base = APL_DSP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_KABYLAKE, + .write_firmware = man_write_fw_v1_5, + .write_firmware_meu = man_write_fw_meu_v1_5, + .man_v1_5 = &kbl_manifest, +}; + +const struct adsp machine_skl = { + .name = "skl", + .rom_base = ADSP_APL_DSP_ROM_BASE, + .rom_size = ADSP_APL_DSP_ROM_SIZE, + .sram_base = APL_DSP_BASE_ENTRY, + .sram_size = 0x100000, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_SKYLAKE, + .write_firmware = man_write_fw_v1_5, + .write_firmware_meu = man_write_fw_meu_v1_5, + .man_v1_5 = &kbl_manifest, +}; + const struct adsp machine_cnl = { .name = "cnl", .rom_base = ADSP_CNL_DSP_ROM_BASE, diff --git a/rimage/rimage.c b/rimage/rimage.c index e5affadebbac..ae0299b707aa 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -33,6 +33,8 @@ static const struct adsp *machine[] = { &machine_cnl, &machine_icl, &machine_sue, + &machine_kbl, + &machine_skl, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 6752005a0e1c..f843992ca251 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -39,6 +39,8 @@ enum machine_id { MACHINE_HASWELL, MACHINE_BROADWELL, MACHINE_APOLLOLAKE, + MACHINE_KABYLAKE, + MACHINE_SKYLAKE, MACHINE_CANNONLAKE, MACHINE_ICELAKE, MACHINE_SUECREEK, @@ -148,6 +150,7 @@ struct adsp { int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); struct fw_image_manifest_v1_8 *man_v1_8; + struct fw_image_manifest_v1_5 *man_v1_5; }; int write_logs_dictionary(struct image *image); @@ -181,5 +184,8 @@ extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; extern const struct adsp machine_sue; +extern const struct adsp machine_skl; +extern const struct adsp machine_kbl; + #endif From ccdfa7972d8da9d489720fbaebc39eee84ef6ce8 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 16:57:47 +0800 Subject: [PATCH 036/639] rimage: add 1.5 rimage package API add API for making 1.5 rimage binary Signed-off-by: Zhu Yingjiang --- rimage/pkcs1_5.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++ rimage/rimage.h | 3 ++ 2 files changed, 103 insertions(+) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 1483f0e6e388..d78210968810 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,6 +68,97 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ +int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + + const BIGNUM *n, *e, *d; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1); +#endif + + /* create new key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + if (!image->key_name) + sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); + else + strcpy(path, image->key_name); + + fprintf(stdout, " pkcs: signing with key %s\n", path); + fp = fopen(path, "r"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha256_update(image, ptr1, size1); + module_sha256_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css_header.signature, + &siglen, priv_rsa); + if (ret < 0) + fprintf(stderr, "error: failed to sign manifest\n"); + + /* copy public key modulus and exponent to manifest */ + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css_header.exponent); + + /* modulus is reveresd */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) + man->css_header.modulus[i] + = mod[MAN_RSA_KEY_MODULUS_LEN - (1 + i)]; + + /* signature is reveresd, swap it */ + bytes_swap(man->css_header.signature, + sizeof(man->css_header.signature)); + + EVP_PKEY_free(privkey); + return ret; +} + +/* + * RSA signature of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) @@ -150,6 +241,15 @@ int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, return ret; } +int ri_manifest_sign_v1_5(struct image *image) +{ + struct fw_image_manifest_v1_5 *man = image->fw_image; + + pkcs_sign_v1_5(image, man, (void *)man + MAN_CSS_MAN_SIZE_V1_5, + image->image_end - sizeof(*man)); + return 0; +} + int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; diff --git a/rimage/rimage.h b/rimage/rimage.h index f843992ca251..a1c7d464832e 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -158,9 +158,12 @@ int write_logs_dictionary(struct image *image); void module_sha256_create(struct image *image); void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); +int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); +int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1); int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); From 5674674a48163351d5377cb0f5e2595065d3f806 Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Mon, 5 Nov 2018 17:11:46 +0800 Subject: [PATCH 037/639] rimage: add build scripts to build 1.5 image add to build scripts and Makefiles to build firmware binary for kbl and skl Signed-off-by: Zhu Yingjiang --- rimage/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/rimage/Makefile.am b/rimage/Makefile.am index 467bfe638b50..fb0bf700da6d 100644 --- a/rimage/Makefile.am +++ b/rimage/Makefile.am @@ -14,6 +14,7 @@ rimage_SOURCES = \ file_simple.c \ man_apl.c \ man_cnl.c \ + man_kbl.c \ cse.c \ css.c \ plat_auth.c \ From 864cc7ef4d4b4a879de157155949f75434837bfd Mon Sep 17 00:00:00 2001 From: Zhu Yingjiang Date: Thu, 8 Nov 2018 18:30:03 +0800 Subject: [PATCH 038/639] change the 1.8 and 1.5 header defines add comments and change the 1.5 1.8 header defines Signed-off-by: Zhu Yingjiang --- rimage/css.c | 4 ++-- rimage/css.h | 2 +- rimage/man_apl.c | 2 +- rimage/man_cnl.c | 2 +- rimage/man_kbl.c | 7 ++++++- rimage/manifest.c | 32 ++++++++++++++++++-------------- rimage/manifest.h | 23 +++++++++++++++++++++-- rimage/pkcs1_5.c | 32 ++++++++++++++++++-------------- rimage/rimage.h | 12 +++++++----- 9 files changed, 75 insertions(+), 41 deletions(-) diff --git a/rimage/css.c b/rimage/css.c index 6c87025a0293..9f5db485e1c1 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -20,9 +20,9 @@ #include "css.h" #include "manifest.h" -void ri_css_hdr_create_v1_8(struct image *image) +void ri_css_hdr_create(struct image *image) { - struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET_V1_8; + struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; struct timeval tv; int val; diff --git a/rimage/css.h b/rimage/css.h index 13135c55edbb..b87d613dcf3f 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -84,6 +84,6 @@ struct css_header_v1_5 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); -void ri_css_hdr_create_v1_8(struct image *image); +void ri_css_hdr_create(struct image *image); #endif diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 201e4361f3d8..7ad330f6cf02 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -35,7 +35,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET_V1_8, + .offset = MAN_CSS_HDR_OFFSET, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 575b260a1857..64d6424b01db 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -34,7 +34,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { { /* CssHeader + platformFirmwareAuthenticationExtension - padding */ .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET_V1_8, + .offset = MAN_CSS_HDR_OFFSET, .length = sizeof(struct css_header_v1_8) + PLAT_AUTH_SIZE, }, diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c index 5e614f5514f7..4d5f5464dfe4 100644 --- a/rimage/man_kbl.c +++ b/rimage/man_kbl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Intel Corporation. + * Copyright (c) 2018, Intel Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -18,6 +18,11 @@ #include #include +/* + * TODO: check if all platform for 1.5 are the same base and length. + * if yes, define it as HARDWARE_BUFFER_BASE_V1_5, HARDWARE_BUFFER_LEN_v1_5 + * if not, define a platform specific base and length. + */ #define KBL_HARDWARE_BUFFER_BASE 0xBE500000 #define KBL_HARDWARE_BUFFER_LEN 0x4A000 diff --git a/rimage/manifest.c b/rimage/manifest.c index 6e7ff9bbe371..49dc36a78ff2 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -703,11 +703,7 @@ static int man_write_fw_v1_5(struct image *image) fprintf(stdout, "Firmware completing manifest v1.5\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); - ri_plat_ext_data_create(image); - ri_css_hdr_create_v1_8(image); - ri_cse_create(image); + ri_css_hdr_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, @@ -727,8 +723,8 @@ static int man_write_fw_v1_5(struct image *image) goto err; /* write the unsigned files*/ - ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_5, + MAN_FW_DESC_OFFSET_V1_5); if (ret < 0) goto err; @@ -785,7 +781,7 @@ static int man_write_fw_v1_8(struct image *image) ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); - ri_css_hdr_create_v1_8(image); + ri_css_hdr_create(image); ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", @@ -985,6 +981,14 @@ static int man_write_fw_meu_v1_8(struct image *image) #define ADSP_APL_DSP_ROM_SIZE 0x00002000 #define APL_DSP_BASE_ENTRY 0xa000a000 +#define ADSP_KBL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_KBL_DSP_ROM_SIZE 0x00002000 +#define KBL_DSP_BASE_ENTRY 0xa000a000 + +#define ADSP_SKL_DSP_ROM_BASE 0xBEFE0000 +#define ADSP_SKL_DSP_ROM_SIZE 0x00002000 +#define SKL_DSP_BASE_ENTRY 0xa000a000 + #define ADSP_CNL_DSP_ROM_BASE 0xBEFE0000 #define ADSP_CNL_DSP_ROM_SIZE 0x00002000 #define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 @@ -1017,9 +1021,9 @@ const struct adsp machine_apl = { const struct adsp machine_kbl = { .name = "kbl", - .rom_base = ADSP_APL_DSP_ROM_BASE, - .rom_size = ADSP_APL_DSP_ROM_SIZE, - .sram_base = APL_DSP_BASE_ENTRY, + .rom_base = ADSP_KBL_DSP_ROM_BASE, + .rom_size = ADSP_KBL_DSP_ROM_SIZE, + .sram_base = KBL_DSP_BASE_ENTRY, .sram_size = 0x100000, .image_size = 0x100000, .dram_offset = 0, @@ -1031,9 +1035,9 @@ const struct adsp machine_kbl = { const struct adsp machine_skl = { .name = "skl", - .rom_base = ADSP_APL_DSP_ROM_BASE, - .rom_size = ADSP_APL_DSP_ROM_SIZE, - .sram_base = APL_DSP_BASE_ENTRY, + .rom_base = ADSP_SKL_DSP_ROM_BASE, + .rom_size = ADSP_SKL_DSP_ROM_SIZE, + .sram_base = SKL_DSP_BASE_ENTRY, .sram_size = 0x100000, .image_size = 0x100000, .dram_offset = 0, diff --git a/rimage/manifest.h b/rimage/manifest.h index 4c53a69a0e04..c57bcb0ebc2c 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -39,13 +39,13 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET 0x2000 -#define MAN_CSS_HDR_OFFSET_V1_8 \ +#define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) #define MAN_SIG_PKG_OFFSET_V1_8 \ - (MAN_CSS_HDR_OFFSET_V1_8 + \ + (MAN_CSS_HDR_OFFSET + \ sizeof(struct css_header_v1_8)) #define MAN_PART_INFO_OFFSET_V1_8 \ @@ -66,6 +66,21 @@ #define MAN_DESC_PADDING_SIZE_V1_8 \ (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) +#define MAN_SIG_PKG_OFFSET_V1_5 \ + (MAN_CSS_HDR_OFFSET + \ + sizeof(struct css_header_v1_5)) + +#define MAN_META_EXT_OFFSET_V1_5 \ + (MAN_SIG_PKG_OFFSET_V1_5 + \ + sizeof(struct signed_pkg_info_ext) + \ + sizeof(struct partition_info_ext) + \ + MAN_CSE_PADDING_SIZE) + +#define MAN_FW_DESC_OFFSET_V1_5 \ + (MAN_META_EXT_OFFSET_V1_5 + \ + sizeof(struct sof_man_adsp_meta_file_ext) + \ + MAN_EXT_PADDING) + /* * Firmware manifest header V1.8 used on APL onwards */ @@ -99,6 +114,10 @@ struct fw_image_manifest_v1_5 { struct sof_man_fw_desc desc; } __attribute__((packed)); +/* + * TODO: verify if we need platform specific manifest, or just + * define manifest_v1_5 and manifest_v1_8. + */ extern struct fw_image_manifest_v1_5 skl_manifest; extern struct fw_image_manifest_v1_5 kbl_manifest; #endif diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d78210968810..309d3b472888 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -68,8 +68,9 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, - void *ptr1, unsigned int size1) +int pkcs_v1_5_sign_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -159,9 +160,10 @@ int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, * manifest header (Public Key, Exponent and Signature). */ -int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2) +int pkcs_v1_5_sign_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) { RSA *priv_rsa = NULL; EVP_PKEY *privkey; @@ -245,8 +247,9 @@ int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; - pkcs_sign_v1_5(image, man, (void *)man + MAN_CSS_MAN_SIZE_V1_5, - image->image_end - sizeof(*man)); + pkcs_v1_5_sign_man_v1_5(image, man, + (void *)man + MAN_CSS_MAN_SIZE_V1_5, + image->image_end - sizeof(*man)); return 0; } @@ -254,12 +257,13 @@ int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; - pkcs_sign_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET_V1_8, - sizeof(struct css_header_v1_8) - - (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + - MAN_RSA_SIGNATURE_LEN), - (void *)man + MAN_SIG_PKG_OFFSET_V1_8, - (man->css.size - man->css.header_len) - * sizeof(uint32_t)); + pkcs_v1_5_sign_man_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET, + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN), + (void *)man + MAN_SIG_PKG_OFFSET_V1_8, + (man->css.size - man->css.header_len) + * sizeof(uint32_t)); return 0; } diff --git a/rimage/rimage.h b/rimage/rimage.h index a1c7d464832e..a9a161cdc9fe 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -162,11 +162,13 @@ int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); -int pkcs_sign_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, - void *ptr1, unsigned int size1); -int pkcs_sign_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2); +int pkcs_v1_5_sign_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1); +int pkcs_v1_5_sign_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); From f5711ff689647e55b2ad5633f81980647bb06c6b Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Mon, 5 Nov 2018 21:42:58 +0000 Subject: [PATCH 039/639] uapi: split ipc.h and abi.h into small files. Split the larger ABI files into smaller more manageable chunks. Also split by end user into IPC and user space ABIs. Signed-off-by: Liam Girdwood --- rimage/file_format.h | 4 +--- rimage/manifest.c | 3 ++- rimage/manifest.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 935df3dc7923..58e5b117d312 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -63,9 +63,7 @@ #ifndef __INCLUDE_UAPI_SOF_FW_H__ #define __INCLUDE_UAPI_SOF_FW_H__ -/* Skip inclusion of which causes errors */ -#define __INCLUDE_IO__ -#include +#include #define SND_SOF_FW_SIG_SIZE 4 #define SND_SOF_FW_ABI 1 diff --git a/rimage/manifest.c b/rimage/manifest.c index 49dc36a78ff2..9837ac1b932a 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -24,7 +24,8 @@ #include #include -#include "uapi/manifest.h" +#include + #include "rimage.h" #include "file_format.h" #include "css.h" diff --git a/rimage/manifest.h b/rimage/manifest.h index c57bcb0ebc2c..072b5a05a6a9 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -15,7 +15,7 @@ #define __MANIFEST_H__ #include -#include "uapi/manifest.h" +#include #include "css.h" #include "cse.h" #include "plat_auth.h" From 2a7f0c0de43770c3c049b17610fe687c1be41cc9 Mon Sep 17 00:00:00 2001 From: Tomasz Lauda Date: Wed, 28 Nov 2018 12:35:57 +0100 Subject: [PATCH 040/639] rimage: fix possible buffer overflow Fixes possible buffer overflow with strcpy. Signed-off-by: Tomasz Lauda --- rimage/pkcs1_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 309d3b472888..a6f8fbf545e3 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -97,7 +97,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, if (!image->key_name) sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); else - strcpy(path, image->key_name); + strncpy(path, image->key_name, 256); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "r"); From 6847abad748582bc8bad74c82e82088e1e905aa1 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Sat, 24 Nov 2018 15:33:59 +0000 Subject: [PATCH 041/639] rimage: make sure cavs1.5 manifest uses correct file offsets. cavs1.5 manifest file structure and offsets are different than cavs version 1.8 Signed-off-by: Liam Girdwood --- rimage/cse.c | 4 ++-- rimage/man_apl.c | 4 ++-- rimage/man_cnl.c | 2 +- rimage/manifest.c | 29 +++++++++++++++-------------- rimage/manifest.h | 8 +++++--- rimage/plat_auth.c | 8 ++++---- 6 files changed, 29 insertions(+), 26 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index 8bc1c30afa47..cdfbc87e6088 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -29,10 +29,10 @@ void ri_cse_create(struct image *image) uint8_t csum = 0, *val = image->fw_image; int i, size; - fprintf(stdout, " cse: completing CSE manifest\n"); + fprintf(stdout, " cse: completing CSE V1.8 manifest\n"); cse_entry[2].length = meta->comp_desc[0].limit_offset - - MAN_DESC_OFFSET; + MAN_DESC_OFFSET_V1_8; /* calculate checksum using BSD algo */ size = sizeof(*cse_hdr) + sizeof(*cse_entry) * MAN_CSE_PARTS; diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 7ad330f6cf02..76082dd9111f 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -114,7 +114,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { .imr_type = 3, .comp_desc[0] = { .version = 0, - .base_offset = MAN_DESC_OFFSET, + .base_offset = MAN_DESC_OFFSET_V1_8, .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ }, @@ -134,7 +134,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { .minor_version = SOF_MINOR, .hotfix_version = 0, .build_version = SOF_BUILD, - .load_offset = MAN_DESC_OFFSET, + .load_offset = MAN_DESC_OFFSET_V1_8, }, }, }; diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 64d6424b01db..5e3480d1ef3d 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -113,7 +113,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .imr_type = 3, .comp_desc[0] = { .version = 0, - .base_offset = MAN_DESC_OFFSET, + .base_offset = MAN_DESC_OFFSET_V1_8, .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ }, diff --git a/rimage/manifest.c b/rimage/manifest.c index 9837ac1b932a..bab31909f9da 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -618,7 +618,8 @@ static int man_write_fw_mod(struct image *image) return 0; } -static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc) +static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, + int file_text_offset) { struct module *module; struct sof_man_module *man_module; @@ -631,7 +632,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc) /* set module file offset */ if (i == 0) - module->foffset = FILE_TEXT_OFFSET; + module->foffset = file_text_offset; else module->foffset = image->image_end; @@ -695,11 +696,11 @@ static int man_write_fw_v1_5(struct image *image) /* create the module */ m = image->fw_image; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_5; /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -707,7 +708,7 @@ static int man_write_fw_v1_5(struct image *image) ri_css_hdr_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + FILE_TEXT_OFFSET_V1_5 - MAN_DESC_OFFSET_V1_5 + image->image_end, desc->header.preload_page_count); /* calculate hash for each module */ @@ -770,11 +771,11 @@ static int man_write_fw_v1_8(struct image *image) /* create the module */ m = image->fw_image; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -786,7 +787,7 @@ static int man_write_fw_v1_8(struct image *image) ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET - MAN_DESC_OFFSET + image->image_end, + FILE_TEXT_OFFSET_V1_8 - MAN_DESC_OFFSET_V1_8 + image->image_end, desc->header.preload_page_count); /* calculate hash for each module */ @@ -863,7 +864,7 @@ static int man_write_fw_meu_v1_5(struct image *image) /* create the module */ meta = image->fw_image + meta_start_offset; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_5; /* copy data */ memcpy(desc, &image->adsp->man_v1_5->desc, @@ -871,7 +872,7 @@ static int man_write_fw_meu_v1_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -879,7 +880,7 @@ static int man_write_fw_meu_v1_5(struct image *image) ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); /* write preload page count */ - preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_5; preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; @@ -934,7 +935,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* create the module */ meta = image->fw_image + meta_start_offset; - desc = image->fw_image + MAN_DESC_OFFSET; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; /* copy data */ memcpy(meta, &image->adsp->man_v1_8->adsp_file_ext, @@ -944,7 +945,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc); + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -952,7 +953,7 @@ static int man_write_fw_meu_v1_8(struct image *image) ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); /* write preload page count */ - preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; diff --git a/rimage/manifest.h b/rimage/manifest.h index 072b5a05a6a9..7a4d118cd23f 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -26,7 +26,8 @@ #define XCC_MOD_OFFSET 0x8 /* start offset for base FW module */ -#define FILE_TEXT_OFFSET 0x8000 +#define FILE_TEXT_OFFSET_V1_8 0x8000 +#define FILE_TEXT_OFFSET_V1_5 0x2000 /* * CSE values for CNL @@ -37,7 +38,8 @@ #define MAN_CSE_HDR_OFFSET 0 #define MAN_CSE_PADDING_SIZE 0x30 #define MAN_EXT_PADDING 0x20 -#define MAN_DESC_OFFSET 0x2000 +#define MAN_DESC_OFFSET_V1_8 0x2000 +#define MAN_DESC_OFFSET_V1_5 0x284 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ @@ -64,7 +66,7 @@ MAN_EXT_PADDING) #define MAN_DESC_PADDING_SIZE_V1_8 \ - (MAN_DESC_OFFSET - MAN_FW_DESC_OFFSET_V1_8) + (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V1_8) #define MAN_SIG_PKG_OFFSET_V1_5 \ (MAN_CSS_HDR_OFFSET + \ diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 48484bfd1959..522732c24c59 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -26,8 +26,8 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, fprintf(stdout, " meta: completing ADSP manifest\n"); - meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET + image->image_end - - meta_end_offset; + meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET_V1_8 + + image->image_end - meta_end_offset; fprintf(stdout, " meta: limit is 0x%x\n", meta->comp_desc[0].limit_offset); @@ -40,11 +40,11 @@ void ri_plat_ext_data_create(struct image *image) + MAN_PART_INFO_OFFSET_V1_8; struct sof_man_adsp_meta_file_ext *meta = image->fw_image + MAN_META_EXT_OFFSET_V1_8; - struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; fprintf(stdout, " auth: completing authentication manifest\n"); - part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET; + part->length = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; part->length += MAN_PAGE_SIZE - (part->length % MAN_PAGE_SIZE); /* do this here atm */ From 90d75018d3ada02cd97976f9258c6a5449d8abff Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Fri, 30 Nov 2018 16:06:30 +0000 Subject: [PATCH 042/639] rimage: Add support for Sue creek WiP. Signed-off-by: Liam Girdwood --- rimage/Makefile.am | 1 + rimage/css.c | 57 +++++++++++++++++++- rimage/css.h | 3 +- rimage/man_sue.c | 39 ++++++++++++++ rimage/manifest.c | 129 ++++++++++++++++++++++++++++++++++++++------- rimage/manifest.h | 7 +++ rimage/rimage.h | 5 ++ 7 files changed, 220 insertions(+), 21 deletions(-) create mode 100644 rimage/man_sue.c diff --git a/rimage/Makefile.am b/rimage/Makefile.am index fb0bf700da6d..5af59059b7f3 100644 --- a/rimage/Makefile.am +++ b/rimage/Makefile.am @@ -15,6 +15,7 @@ rimage_SOURCES = \ man_apl.c \ man_cnl.c \ man_kbl.c \ + man_sue.c \ cse.c \ css.c \ plat_auth.c \ diff --git a/rimage/css.c b/rimage/css.c index 9f5db485e1c1..d76316891848 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -20,7 +20,7 @@ #include "css.h" #include "manifest.h" -void ri_css_hdr_create(struct image *image) +void ri_css_v1_8_hdr_create(struct image *image) { struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; @@ -74,3 +74,58 @@ void ri_css_hdr_create(struct image *image) val = date->tm_mday; css->date |= val << 0; } + +void ri_css_v1_5_hdr_create(struct image *image) +{ + struct css_header_v1_5 *css = image->fw_image; + struct tm *date; + struct timeval tv; + int val; + + fprintf(stdout, " cse: completing CSS manifest\n"); + + /* get local time and date */ + gettimeofday(&tv, NULL); + date = localtime(&tv.tv_sec); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + + date->tm_year += 1900; + fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", + date->tm_year, date->tm_mon, date->tm_mday); + + /* year yYyy */ + val = date->tm_year / 1000; + css->date |= val << 28; + date->tm_year -= val * 1000; + /* year yyYy */ + val = date->tm_year / 100; + css->date |= val << 24; + date->tm_year -= val * 100; + /* year yyyY */ + val = date->tm_year / 10; + css->date |= val << 20; + date->tm_year -= val * 10; + /* year Yyyy */ + val = date->tm_year; + css->date |= val << 16; + + /* month Mm - for some reason month starts at 0 */ + val = ++date->tm_mon / 10; + css->date |= val << 12; + date->tm_mon -= (val * 10); + /* month mM */ + val = date->tm_mon; + css->date |= val << 8; + + /* Day Dd */ + val = date->tm_mday / 10; + css->date |= val << 4; + date->tm_mday -= (val * 10); + /* Day dD */ + val = date->tm_mday; + css->date |= val << 0; +} diff --git a/rimage/css.h b/rimage/css.h index b87d613dcf3f..a1237dbe5af1 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -84,6 +84,7 @@ struct css_header_v1_5 { uint8_t signature[MAN_RSA_SIGNATURE_LEN]; } __attribute__((packed)); -void ri_css_hdr_create(struct image *image); +void ri_css_v1_8_hdr_create(struct image *image); +void ri_css_v1_5_hdr_create(struct image *image); #endif diff --git a/rimage/man_sue.c b/rimage/man_sue.c new file mode 100644 index 000000000000..2f3ce4abfbc1 --- /dev/null +++ b/rimage/man_sue.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2017, Intel Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include +#include + +/* manifest template */ +struct fw_image_manifest_v1_5_sue sue_manifest = { + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0x2000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c index bab31909f9da..17cab87ee0e0 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -96,6 +96,21 @@ static int man_init_image_v1_5(struct image *image) return 0; } +static int man_init_image_v1_5_sue(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + /* copy 1.5 sue manifest */ + memcpy(image->fw_image + MAN_DESC_OFFSET_V1_5_SUE, + image->adsp->man_v1_5_sue, + sizeof(struct fw_image_manifest_v1_5_sue)); + + return 0; +} + static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ @@ -451,12 +466,19 @@ static int man_module_create(struct image *image, struct module *module, } fprintf(stdout, "\n"); + /* no need to update end for exec headers */ + if (module->exec_header) { + image->image_end = FILE_TEXT_OFFSET_V1_5_SUE; + goto out; + } + /* round module end upto nearest page */ if (image->image_end % MAN_PAGE_SIZE) { image->image_end = (image->image_end / MAN_PAGE_SIZE) + 1; image->image_end *= MAN_PAGE_SIZE; } +out: fprintf(stdout, " Total pages text %d data %d bss %d module file limit: 0x%x\n\n", man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length, man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length, @@ -593,16 +615,6 @@ static int man_write_fw_mod(struct image *image) { int count; - /* write ROM - for VM use only */ - count = fwrite(image->rom_image, image->adsp->rom_size, 1, - image->out_rom_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write rom %s %d\n", - image->out_rom_file, -errno); - return -errno; - } - fclose(image->out_rom_fd); - /* write manifest and signed image */ count = fwrite(image->fw_image, image->image_end, @@ -624,13 +636,33 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, struct module *module; struct sof_man_module *man_module; int err; - int i; + int i = 0, offset = 0; - for (i = 0; i < image->num_modules; i++) { - man_module = sof_man_get_module(desc, i); - module = &image->module[i]; + /* if first module is executable then write before manifest */ + if (image->adsp->exec_boot_ldr) { + man_module = sof_man_get_module(desc, 0); + module = &image->module[0]; + + fprintf(stdout, "Module: %s used as executable header\n", + module->elf_file); + module->exec_header = 1; /* set module file offset */ + module->foffset = 0; + + err = man_module_create(image, module, man_module); + if (err < 0) + return err; + + /* setup man_modules for missing exec loader module */ + i = 1; + offset = 1; + } + + for (; i < image->num_modules; i++) { + man_module = sof_man_get_module(desc, i - offset); + module = &image->module[i]; + if (i == 0) module->foffset = file_text_offset; else @@ -657,6 +689,12 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) for (i = 0; i < image->num_modules; i++) { man_module = sof_man_get_module(desc, i); + if (image->adsp->exec_boot_ldr && i == 0) { + fprintf(stdout, " module: no need to hash %s\n as its exec header\n", + man_module->name); + continue; + } + ri_hash(image, man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + @@ -705,7 +743,7 @@ static int man_write_fw_v1_5(struct image *image) fprintf(stdout, "Firmware completing manifest v1.5\n"); /* create structures from end of file to start of file */ - ri_css_hdr_create(image); + ri_css_v1_5_hdr_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", FILE_TEXT_OFFSET_V1_5 - MAN_DESC_OFFSET_V1_5 + image->image_end, @@ -741,6 +779,58 @@ static int man_write_fw_v1_5(struct image *image) return ret; } +/* used by others */ +static int man_write_fw_v1_5_sue(struct image *image) +{ + struct fw_image_manifest_v1_5_sue *m; + uint32_t preload_size; + int ret; + + /* init image */ + ret = man_init_image_v1_5_sue(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image + MAN_DESC_OFFSET_V1_5_SUE; + + /* create each module - subtract the boot loader exec header */ + m->desc.header.num_module_entries = image->num_modules - 1; + man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); + fprintf(stdout, "Firmware completing manifest v1.5\n"); + + /* write preload page count */ + preload_size = image->image_end - MAN_DESC_OFFSET_V1_5_SUE; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + m->desc.header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + image->image_end, + m->desc.header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, &m->desc); + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) { + goto err; + } + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + /* used by others */ static int man_write_fw_v1_8(struct image *image) { @@ -783,7 +873,7 @@ static int man_write_fw_v1_8(struct image *image) ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); - ri_css_hdr_create(image); + ri_css_v1_8_hdr_create(image); ri_cse_create(image); fprintf(stdout, "Firmware file size 0x%x page count %d\n", @@ -1092,7 +1182,8 @@ const struct adsp machine_sue = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SUECREEK, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, + .write_firmware = man_write_fw_v1_5_sue, + .write_firmware_meu = man_write_fw_v1_5_sue, + .man_v1_5_sue = &sue_manifest, + .exec_boot_ldr = 1, }; diff --git a/rimage/manifest.h b/rimage/manifest.h index 7a4d118cd23f..d06c0b11ceb2 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -28,6 +28,7 @@ /* start offset for base FW module */ #define FILE_TEXT_OFFSET_V1_8 0x8000 #define FILE_TEXT_OFFSET_V1_5 0x2000 +#define FILE_TEXT_OFFSET_V1_5_SUE 0xA000 /* * CSE values for CNL @@ -40,6 +41,7 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET_V1_8 0x2000 #define MAN_DESC_OFFSET_V1_5 0x284 +#define MAN_DESC_OFFSET_V1_5_SUE 0x4000 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ @@ -116,10 +118,15 @@ struct fw_image_manifest_v1_5 { struct sof_man_fw_desc desc; } __attribute__((packed)); +struct fw_image_manifest_v1_5_sue { + struct sof_man_fw_desc desc; +} __attribute__((packed)); + /* * TODO: verify if we need platform specific manifest, or just * define manifest_v1_5 and manifest_v1_8. */ extern struct fw_image_manifest_v1_5 skl_manifest; extern struct fw_image_manifest_v1_5 kbl_manifest; +extern struct fw_image_manifest_v1_5_sue sue_manifest; #endif diff --git a/rimage/rimage.h b/rimage/rimage.h index a9a161cdc9fe..2c06f740ccfe 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -87,6 +87,9 @@ struct module { /* total file size */ int file_size; + + /* executable header module */ + int exec_header; }; /* @@ -151,6 +154,8 @@ struct adsp { int (*write_firmware_meu)(struct image *image); struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; + struct fw_image_manifest_v1_5_sue *man_v1_5_sue; + int exec_boot_ldr; }; int write_logs_dictionary(struct image *image); From 52b17106c91d3b6e0c0073337ac5f9f5a7d011cb Mon Sep 17 00:00:00 2001 From: Bard liao Date: Mon, 24 Dec 2018 01:26:51 +0800 Subject: [PATCH 043/639] rimage: make block divisible by 4 Add pandding to each block if the block size is not divisible by 4. Which can avoid unaligned memory accesses. Signed-off-by: Bard liao --- rimage/file_simple.c | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index c88676c4e5cf..b69bd8e52d6b 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -85,11 +85,17 @@ static int write_block(struct image *image, struct module *module, { const struct adsp *adsp = image->adsp; struct snd_sof_blk_hdr block; + uint32_t padding = 0; size_t count; void *buffer; int ret; block.size = section->sh_size; + if (block.size % 4) { + /* make block.size divisible by 4 to avoid unaligned accesses */ + padding = 4 - (block.size % 4); + block.size += padding; + } if (is_iram(image, section)) { block.type = SOF_BLK_TEXT; @@ -129,8 +135,8 @@ static int write_block(struct image *image, struct module *module, } /* write out section data */ - count = fwrite(buffer, 1, section->sh_size, image->out_fd); - if (count != section->sh_size) { + count = fwrite(buffer, 1, block.size, image->out_fd); + if (count != block.size) { fprintf(stderr, "error: cant write section %d\n", -errno); fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", section->sh_offset, section->sh_size, section->sh_addr); @@ -144,6 +150,10 @@ static int write_block(struct image *image, struct module *module, out: free(buffer); + /* return padding size */ + if (ret >= 0) + return padding; + return ret; } @@ -154,12 +164,16 @@ static int simple_write_module(struct image *image, struct module *module) size_t count; int i, err; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int ptr_hdr, ptr_cur; + uint32_t padding = 0; hdr.num_blocks = module->num_sections - module->num_bss; hdr.size = module->text_size + module->data_size + sizeof(struct snd_sof_blk_hdr) * hdr.num_blocks; hdr.type = SOF_FW_BASE; + /* Get the pointer of writing hdr */ + ptr_hdr = ftell(image->out_fd); count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) { fprintf(stderr, "error: failed to write section header %d\n", @@ -198,10 +212,25 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stderr, "error: failed to write section #%d\n", i); return err; } + /* write_block will return padding size */ + padding += err; } + hdr.size += padding; + /* Record current pointer, will set it back after overwriting hdr */ + ptr_cur = ftell(image->out_fd); + /* overwrite hdr */ + fseek(image->out_fd, ptr_hdr, SEEK_SET); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) { + fprintf(stderr, "error: failed to write section header %d\n", + -errno); + return -errno; + } + fseek(image->out_fd, ptr_cur, SEEK_SET); fprintf(stdout, "\n"); - return 0; + /* return padding size */ + return padding; } static int write_block_reloc(struct image *image, struct module *module) @@ -336,7 +365,14 @@ static int simple_write_firmware(struct image *image) i); return ret; } + /* add padding size */ + hdr.file_size += ret; } + /* overwrite hdr */ + fseek(image->out_fd, 0, SEEK_SET); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); + if (count != 1) + return -errno; fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", hdr.file_size + sizeof(hdr), hdr.file_size + sizeof(hdr), From 93b0d29571c2db3086f1d0b47d3440f1addb8838 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 11 Jan 2019 21:07:45 +0100 Subject: [PATCH 044/639] rimage: remove config.h dependency man_* files don't need it pkcs can use PEM_KEY_PREFIX from passed in defines Signed-off-by: Janusz Jankowski --- rimage/man_apl.c | 1 - rimage/man_cnl.c | 1 - rimage/man_kbl.c | 1 - rimage/man_sue.c | 1 - rimage/pkcs1_5.c | 1 - 5 files changed, 5 deletions(-) diff --git a/rimage/man_apl.c b/rimage/man_apl.c index 76082dd9111f..f7f1d25f3a13 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* manifest template */ diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 5e3480d1ef3d..7142fd26386a 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* manifest template */ diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c index 4d5f5464dfe4..5fd16f8c3d24 100644 --- a/rimage/man_kbl.c +++ b/rimage/man_kbl.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* diff --git a/rimage/man_sue.c b/rimage/man_sue.c index 2f3ce4abfbc1..741fd0b26a04 100644 --- a/rimage/man_sue.c +++ b/rimage/man_sue.c @@ -15,7 +15,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include #include /* manifest template */ diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index a6f8fbf545e3..adee7a9b3221 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -26,7 +26,6 @@ #include #include -#include "config.h" #include "rimage.h" #include "css.h" #include "manifest.h" From 4e3ead009638bbba2eea801cd6c8f77e908c7eed Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 11 Jan 2019 21:24:02 +0100 Subject: [PATCH 045/639] cmake: add rimage build Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 rimage/CMakeLists.txt diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt new file mode 100644 index 000000000000..940c9f513bfc --- /dev/null +++ b/rimage/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 3.10) + +project(SOF_RIMAGE C) + +set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") + +if(NOT DEFINED VERSION_H_PATH) + message(FATAL_ERROR + " Please specify version.h path.\n" + " Example: cmake -DVERSION_H_PATH=${VERSION_H_PATH} ...\n" +) +endif() + +if(NOT DEFINED PEM_KEY_PREFIX) + set(PEM_KEY_PREFIX "/usr/local/share/rimage") +endif() + +get_filename_component(VERSION_H_DIRECTORY ${VERSION_H_PATH} DIRECTORY) + +add_executable(rimage + file_simple.c + man_apl.c + man_cnl.c + man_kbl.c + man_sue.c + cse.c + css.c + plat_auth.c + hash.c + pkcs1_5.c + manifest.c + elf.c + rimage.c +) + +target_compile_options(rimage PRIVATE + -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 +) + +target_compile_definitions(rimage PRIVATE + PEM_KEY_PREFIX="${PEM_KEY_PREFIX}" +) + +target_link_libraries(rimage PRIVATE "-lcrypto") + +target_include_directories(rimage PRIVATE + "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" + "${VERSION_H_DIRECTORY}" +) From cd6f24a01591993165091a0191a558d5c841d33e Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 15 Jan 2019 22:16:23 +0100 Subject: [PATCH 046/639] buildsystem: remove autotools from sof This commit doesn't touch tools buildsystem. Signed-off-by: Janusz Jankowski --- rimage/Makefile.am | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 rimage/Makefile.am diff --git a/rimage/Makefile.am b/rimage/Makefile.am deleted file mode 100644 index 5af59059b7f3..000000000000 --- a/rimage/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -SUBDIRS=keys - -bin_PROGRAMS = rimage - -noinst_HEADERS = \ - rimage.h \ - css.h \ - cse.h \ - plat_auth.h \ - manifest.h \ - file_format.h - -rimage_SOURCES = \ - file_simple.c \ - man_apl.c \ - man_cnl.c \ - man_kbl.c \ - man_sue.c \ - cse.c \ - css.c \ - plat_auth.c \ - hash.c \ - pkcs1_5.c \ - manifest.c \ - elf.c \ - rimage.c - From cf665a03ec4ec60dd2fd233b3589d0aa48642fad Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 28 Jan 2019 14:06:14 +0200 Subject: [PATCH 047/639] rimage: Use fw.h instead of duplicating the code This is very useful when updating one of the types in UAPI because with the current implementation one needs to be careful to also update file_format.h Signed-off-by: Daniel Baluta --- rimage/file_format.h | 52 +------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 58e5b117d312..681bd5c25ff7 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -64,61 +64,11 @@ #define __INCLUDE_UAPI_SOF_FW_H__ #include - -#define SND_SOF_FW_SIG_SIZE 4 -#define SND_SOF_FW_ABI 1 -#define SND_SOF_FW_SIG "Reef" +#include #define SND_SOF_LOGS_SIG_SIZE 4 #define SND_SOF_LOGS_SIG "Logs" -/* - * Firmware module is made up of 1 . N blocks of different types. The - * Block header is used to determine where and how block is to be copied in the - * DSP/host memory space. - */ -enum snd_sof_fw_blk_type { - SOF_BLK_IMAGE = 0, /* whole image - parsed by ROMs */ - SOF_BLK_TEXT = 1, - SOF_BLK_DATA = 2, - SOF_BLK_CACHE = 3, - SOF_BLK_REGS = 4, - SOF_BLK_SIG = 5, - SOF_BLK_ROM = 6, - /* add new block types here */ -}; - -struct snd_sof_blk_hdr { - enum snd_sof_fw_blk_type type; - uint32_t size; /* bytes minus this header */ - uint32_t offset; /* offset from base */ -} __attribute__((packed)); - -/* - * Firmware file is made up of 1 .. N different modules types. The module - * type is used to determine how to load and parse the module. - */ -enum snd_sof_fw_mod_type { - SOF_FW_BASE = 0, /* base firmware image */ - SOF_FW_MODULE = 1, /* firmware module */ -}; - -struct snd_sof_mod_hdr { - enum snd_sof_fw_mod_type type; - uint32_t size; /* bytes minus this header */ - uint32_t num_blocks; /* number of blocks */ -} __attribute__((packed)); - -/* - * Firmware file header. - */ -struct snd_sof_fw_header { - unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */ - uint32_t file_size; /* size of file minus this header */ - uint32_t num_modules; /* number of modules */ - uint32_t abi; /* version of header format */ -} __attribute__((packed)); - /* * Logs dictionary file header. */ From 139c3b4c88370b7e0c7d302df5e21026e529c790 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 28 Jan 2019 14:10:34 +0200 Subject: [PATCH 048/639] rimage: Fix file_format.h include guard This is most likely due to copy/paste. Signed-off-by: Daniel Baluta --- rimage/file_format.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 681bd5c25ff7..2ffdf0c68c61 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -60,8 +60,8 @@ * Firmware file format . */ -#ifndef __INCLUDE_UAPI_SOF_FW_H__ -#define __INCLUDE_UAPI_SOF_FW_H__ +#ifndef __INCLUDE_FILE_FORMAT_H__ +#define __INCLUDE_FILE_FORMAT_H__ #include #include From 5c7e400a409ffd752ceb0e456f61231bea135f6e Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 06:43:09 +0100 Subject: [PATCH 049/639] rimage: import elf.h Signed-off-by: Janusz Jankowski --- rimage/elf.h | 961 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 961 insertions(+) create mode 100644 rimage/elf.h diff --git a/rimage/elf.h b/rimage/elf.h new file mode 100644 index 000000000000..d4f3955c2528 --- /dev/null +++ b/rimage/elf.h @@ -0,0 +1,961 @@ +/* + * Derived from: + * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ + * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ + * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ + * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ + * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ + * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ + * + * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. + * Copyright (c) 2001 David E. O'Brien + * Portions Copyright 2009 The Go Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +/* + * ELF definitions that are independent of architecture or word size. + */ + +/* + * Note header. The ".note" section contains an array of notes. Each + * begins with this header, aligned to a word boundary. Immediately + * following the note header is n_namesz bytes of name, padded to the + * next word boundary. Then comes n_descsz bytes of descriptor, again + * padded to a word boundary. The values of n_namesz and n_descsz do + * not include the padding. + */ + +typedef unsigned __int64 uint64; +typedef unsigned __int32 uint32; +typedef unsigned __int16 uint16; +typedef unsigned __int8 uint8; + +typedef __int64 int64; +typedef __int32 int32; +typedef __int16 int16; +typedef __int8 int8; + + +typedef struct { + uint32 n_namesz; /* Length of name. */ + uint32 n_descsz; /* Length of descriptor. */ + uint32 n_type; /* Type of this note. */ +} Elf_Note; + +/* Indexes into the e_ident array. Keep synced with + http://www.sco.com/developer/gabi/ch4.eheader.html */ +#define EI_MAG0 0 /* Magic number, byte 0. */ +#define EI_MAG1 1 /* Magic number, byte 1. */ +#define EI_MAG2 2 /* Magic number, byte 2. */ +#define EI_MAG3 3 /* Magic number, byte 3. */ +#define EI_CLASS 4 /* Class of machine. */ +#define EI_DATA 5 /* Data format. */ +#define EI_VERSION 6 /* ELF format version. */ +#define EI_OSABI 7 /* Operating system / ABI identification */ +#define EI_ABIVERSION 8 /* ABI version */ +#define OLD_EI_BRAND 8 /* Start of architecture identification. */ +#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */ +#define EI_NIDENT 16 /* Size of e_ident array. */ + +/* Values for the magic number bytes. */ +#define ELFMAG0 0x7f +#define ELFMAG1 'E' +#define ELFMAG2 'L' +#define ELFMAG3 'F' +#define ELFMAG "\177ELF" /* magic string */ +#define SELFMAG 4 /* magic string size */ + +/* Values for e_ident[EI_VERSION] and e_version. */ +#define EV_NONE 0 +#define EV_CURRENT 1 + +/* Values for e_ident[EI_CLASS]. */ +#define ELFCLASSNONE 0 /* Unknown class. */ +#define ELFCLASS32 1 /* 32-bit architecture. */ +#define ELFCLASS64 2 /* 64-bit architecture. */ + +/* Values for e_ident[EI_DATA]. */ +#define ELFDATANONE 0 /* Unknown data format. */ +#define ELFDATA2LSB 1 /* 2's complement little-endian. */ +#define ELFDATA2MSB 2 /* 2's complement big-endian. */ + +/* Values for e_ident[EI_OSABI]. */ +#define ELFOSABI_NONE 0 /* UNIX System V ABI */ +#define ELFOSABI_HPUX 1 /* HP-UX operating system */ +#define ELFOSABI_NETBSD 2 /* NetBSD */ +#define ELFOSABI_LINUX 3 /* GNU/Linux */ +#define ELFOSABI_HURD 4 /* GNU/Hurd */ +#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */ +#define ELFOSABI_SOLARIS 6 /* Solaris */ +#define ELFOSABI_AIX 7 /* AIX */ +#define ELFOSABI_IRIX 8 /* IRIX */ +#define ELFOSABI_FREEBSD 9 /* FreeBSD */ +#define ELFOSABI_TRU64 10 /* TRU64 UNIX */ +#define ELFOSABI_MODESTO 11 /* Novell Modesto */ +#define ELFOSABI_OPENBSD 12 /* OpenBSD */ +#define ELFOSABI_OPENVMS 13 /* Open VMS */ +#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */ +#define ELFOSABI_ARM 97 /* ARM */ +#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ + +#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */ +#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */ + +/* e_ident */ +#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ + (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ + (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ + (ehdr).e_ident[EI_MAG3] == ELFMAG3) + +/* Values for e_type. */ +#define ET_NONE 0 /* Unknown type. */ +#define ET_REL 1 /* Relocatable. */ +#define ET_EXEC 2 /* Executable. */ +#define ET_DYN 3 /* Shared object. */ +#define ET_CORE 4 /* Core file. */ +#define ET_LOOS 0xfe00 /* First operating system specific. */ +#define ET_HIOS 0xfeff /* Last operating system-specific. */ +#define ET_LOPROC 0xff00 /* First processor-specific. */ +#define ET_HIPROC 0xffff /* Last processor-specific. */ + +/* Values for e_machine. */ +#define EM_NONE 0 /* Unknown machine. */ +#define EM_M32 1 /* AT&T WE32100. */ +#define EM_SPARC 2 /* Sun SPARC. */ +#define EM_386 3 /* Intel i386. */ +#define EM_68K 4 /* Motorola 68000. */ +#define EM_88K 5 /* Motorola 88000. */ +#define EM_860 7 /* Intel i860. */ +#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */ +#define EM_S370 9 /* IBM System/370. */ +#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */ +#define EM_PARISC 15 /* HP PA-RISC. */ +#define EM_VPP500 17 /* Fujitsu VPP500. */ +#define EM_SPARC32PLUS 18 /* SPARC v8plus. */ +#define EM_960 19 /* Intel 80960. */ +#define EM_PPC 20 /* PowerPC 32-bit. */ +#define EM_PPC64 21 /* PowerPC 64-bit. */ +#define EM_S390 22 /* IBM System/390. */ +#define EM_V800 36 /* NEC V800. */ +#define EM_FR20 37 /* Fujitsu FR20. */ +#define EM_RH32 38 /* TRW RH-32. */ +#define EM_RCE 39 /* Motorola RCE. */ +#define EM_ARM 40 /* ARM. */ +#define EM_SH 42 /* Hitachi SH. */ +#define EM_SPARCV9 43 /* SPARC v9 64-bit. */ +#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */ +#define EM_ARC 45 /* Argonaut RISC Core. */ +#define EM_H8_300 46 /* Hitachi H8/300. */ +#define EM_H8_300H 47 /* Hitachi H8/300H. */ +#define EM_H8S 48 /* Hitachi H8S. */ +#define EM_H8_500 49 /* Hitachi H8/500. */ +#define EM_IA_64 50 /* Intel IA-64 Processor. */ +#define EM_MIPS_X 51 /* Stanford MIPS-X. */ +#define EM_COLDFIRE 52 /* Motorola ColdFire. */ +#define EM_68HC12 53 /* Motorola M68HC12. */ +#define EM_MMA 54 /* Fujitsu MMA. */ +#define EM_PCP 55 /* Siemens PCP. */ +#define EM_NCPU 56 /* Sony nCPU. */ +#define EM_NDR1 57 /* Denso NDR1 microprocessor. */ +#define EM_STARCORE 58 /* Motorola Star*Core processor. */ +#define EM_ME16 59 /* Toyota ME16 processor. */ +#define EM_ST100 60 /* STMicroelectronics ST100 processor. */ +#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */ +#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */ + +/* Non-standard or deprecated. */ +#define EM_486 6 /* Intel i486. */ +#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ +#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */ +#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */ + +/* Special section indexes. */ +#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */ +#define SHN_LORESERVE 0xff00 /* First of reserved range. */ +#define SHN_LOPROC 0xff00 /* First processor-specific. */ +#define SHN_HIPROC 0xff1f /* Last processor-specific. */ +#define SHN_LOOS 0xff20 /* First operating system-specific. */ +#define SHN_HIOS 0xff3f /* Last operating system-specific. */ +#define SHN_ABS 0xfff1 /* Absolute values. */ +#define SHN_COMMON 0xfff2 /* Common data. */ +#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */ +#define SHN_HIRESERVE 0xffff /* Last of reserved range. */ + +/* sh_type */ +#define SHT_NULL 0 /* inactive */ +#define SHT_PROGBITS 1 /* program defined information */ +#define SHT_SYMTAB 2 /* symbol table section */ +#define SHT_STRTAB 3 /* string table section */ +#define SHT_RELA 4 /* relocation section with addends */ +#define SHT_HASH 5 /* symbol hash table section */ +#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_NOTE 7 /* note section */ +#define SHT_NOBITS 8 /* no space section */ +#define SHT_REL 9 /* relocation section - no addends */ +#define SHT_SHLIB 10 /* reserved - purpose unknown */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ +#define SHT_FINI_ARRAY 15 /* Termination function pointers. */ +#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ +#define SHT_GROUP 17 /* Section group. */ +#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */ +#define SHT_LOOS 0x60000000 /* First of OS specific semantics */ +#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */ +#define SHT_GNU_VERDEF 0x6ffffffd +#define SHT_GNU_VERNEED 0x6ffffffe +#define SHT_GNU_VERSYM 0x6fffffff +#define SHT_LOPROC 0x70000000 /* reserved range for processor */ +#define SHT_HIPROC 0x7fffffff /* specific section header types */ +#define SHT_LOUSER 0x80000000 /* reserved range for application */ +#define SHT_HIUSER 0xffffffff /* specific indexes */ + +/* Flags for sh_flags. */ +#define SHF_WRITE 0x1 /* Section contains writable data. */ +#define SHF_ALLOC 0x2 /* Section occupies memory. */ +#define SHF_EXECINSTR 0x4 /* Section contains instructions. */ +#define SHF_MERGE 0x10 /* Section may be merged. */ +#define SHF_STRINGS 0x20 /* Section contains strings. */ +#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */ +#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */ +#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */ +#define SHF_GROUP 0x200 /* Member of section group. */ +#define SHF_TLS 0x400 /* Section contains TLS data. */ +#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */ +#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */ + +/* Values for p_type. */ +#define PT_NULL 0 /* Unused entry. */ +#define PT_LOAD 1 /* Loadable segment. */ +#define PT_DYNAMIC 2 /* Dynamic linking information segment. */ +#define PT_INTERP 3 /* Pathname of interpreter. */ +#define PT_NOTE 4 /* Auxiliary information. */ +#define PT_SHLIB 5 /* Reserved (not used). */ +#define PT_PHDR 6 /* Location of program header itself. */ +#define PT_TLS 7 /* Thread local storage segment */ +#define PT_LOOS 0x60000000 /* First OS-specific. */ +#define PT_HIOS 0x6fffffff /* Last OS-specific. */ +#define PT_LOPROC 0x70000000 /* First processor-specific type. */ +#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */ +#define PT_GNU_STACK 0x6474e551 +#define PT_PAX_FLAGS 0x65041580 + +/* Values for p_flags. */ +#define PF_X 0x1 /* Executable. */ +#define PF_W 0x2 /* Writable. */ +#define PF_R 0x4 /* Readable. */ +#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */ +#define PF_MASKPROC 0xf0000000 /* Processor-specific. */ + +/* Values for d_tag. */ +#define DT_NULL 0 /* Terminating entry. */ +/* String table offset of a needed shared library. */ +#define DT_NEEDED 1 +#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */ +#define DT_PLTGOT 3 /* Processor-dependent address. */ +#define DT_HASH 4 /* Address of symbol hash table. */ +#define DT_STRTAB 5 /* Address of string table. */ +#define DT_SYMTAB 6 /* Address of symbol table. */ +#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */ +#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */ +#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */ +#define DT_STRSZ 10 /* Size of string table. */ +#define DT_SYMENT 11 /* Size of each symbol table entry. */ +#define DT_INIT 12 /* Address of initialization function. */ +#define DT_FINI 13 /* Address of finalization function. */ +/* String table offset of shared object name. */ +#define DT_SONAME 14 +#define DT_RPATH 15 /* String table offset of library path. [sup] */ +#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */ +#define DT_REL 17 /* Address of ElfNN_Rel relocations. */ +#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */ +#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */ +#define DT_PLTREL 20 /* Type of relocation used for PLT. */ +#define DT_DEBUG 21 /* Reserved (not used). */ +/* Indicates there may be relocations in non-writable segments. [sup] */ +#define DT_TEXTREL 22 +#define DT_JMPREL 23 /* Address of PLT relocations. */ +#define DT_BIND_NOW 24 /* [sup] */ +/* Address of the array of pointers to initialization functions */ +#define DT_INIT_ARRAY 25 +/* Address of the array of pointers to termination functions */ +#define DT_FINI_ARRAY 26 +/* Size in bytes of the array of initialization functions. */ +#define DT_INIT_ARRAYSZ 27 +/* Size in bytes of the array of terminationfunctions. */ +#define DT_FINI_ARRAYSZ 28 +/* String table offset of a null-terminated library search path string. */ +#define DT_RUNPATH 29 +#define DT_FLAGS 30 /* Object specific flag values. */ +/* Values greater than or equal to DT_ENCODING and less than + DT_LOOS follow the rules for the interpretation of the d_un + union as follows: even == 'd_ptr', even == 'd_val' or none */ +#define DT_ENCODING 32 +/* Address of the array of pointers to pre-initialization functions. */ +#define DT_PREINIT_ARRAY 32 +/* Size in bytes of the array of pre-initialization functions. */ +#define DT_PREINIT_ARRAYSZ 33 +#define DT_LOOS 0x6000000d /* First OS-specific */ +#define DT_HIOS 0x6ffff000 /* Last OS-specific */ +#define DT_LOPROC 0x70000000 /* First processor-specific type. */ +#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */ + +#define DT_VERNEED 0x6ffffffe +#define DT_VERNEEDNUM 0x6fffffff +#define DT_VERSYM 0x6ffffff0 + +/* Values for DT_FLAGS */ +/* Indicates that the object being loaded may make reference to + the $ORIGIN substitution string */ +#define DF_ORIGIN 0x0001 +#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */ +/* Indicates there may be relocations in non-writable segments. */ +#define DF_TEXTREL 0x0004 +/* Indicates that the dynamic linker should process all + relocations for the object containing this entry before + transferring control to the program. */ +#define DF_BIND_NOW 0x0008 +/* Indicates that the shared object or executable contains code + using a static thread-local storage scheme. */ +#define DF_STATIC_TLS 0x0010 + +/* Values for n_type. Used in core files. */ +#define NT_PRSTATUS 1 /* Process status. */ +#define NT_FPREGSET 2 /* Floating point registers. */ +#define NT_PRPSINFO 3 /* Process state info. */ + +/* Symbol Binding - ELFNN_ST_BIND - st_info */ +#define STB_LOCAL 0 /* Local symbol */ +#define STB_GLOBAL 1 /* Global symbol */ +#define STB_WEAK 2 /* like global - lower precedence */ +#define STB_LOOS 10 /* Reserved range for operating system */ +#define STB_HIOS 12 /* specific semantics. */ +#define STB_LOPROC 13 /* reserved range for processor */ +#define STB_HIPROC 15 /* specific semantics. */ + +/* Symbol type - ELFNN_ST_TYPE - st_info */ +#define STT_NOTYPE 0 /* Unspecified type. */ +#define STT_OBJECT 1 /* Data object. */ +#define STT_FUNC 2 /* Function. */ +#define STT_SECTION 3 /* Section. */ +#define STT_FILE 4 /* Source file. */ +#define STT_COMMON 5 /* Uninitialized common block. */ +#define STT_TLS 6 /* TLS object. */ +#define STT_LOOS 10 /* Reserved range for operating system */ +#define STT_HIOS 12 /* specific semantics. */ +#define STT_LOPROC 13 /* reserved range for processor */ +#define STT_HIPROC 15 /* specific semantics. */ + +/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */ +#define STV_DEFAULT 0x0 /* Default visibility (see binding). */ +#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */ +#define STV_HIDDEN 0x2 /* Not visible. */ +#define STV_PROTECTED 0x3 /* Visible but not preemptible. */ + +/* Special symbol table indexes. */ +#define STN_UNDEF 0 /* Undefined symbol index. */ + +/* + * ELF definitions common to all 32-bit architectures. + */ + +typedef uint32 Elf32_Addr; +typedef uint16 Elf32_Half; +typedef uint32 Elf32_Off; +typedef int32 Elf32_Sword; +typedef uint32 Elf32_Word; + +typedef Elf32_Word Elf32_Hashelt; + +/* Non-standard class-dependent datatype used for abstraction. */ +typedef Elf32_Word Elf32_Size; +typedef Elf32_Sword Elf32_Ssize; + +/* + * ELF header. + */ + +typedef struct { + unsigned char ident[EI_NIDENT]; /* File identification. */ + Elf32_Half type; /* File type. */ + Elf32_Half machine; /* Machine architecture. */ + Elf32_Word version; /* ELF format version. */ + Elf32_Addr entry; /* Entry point. */ + Elf32_Off phoff; /* Program header file offset. */ + Elf32_Off shoff; /* Section header file offset. */ + Elf32_Word flags; /* Architecture-specific flags. */ + Elf32_Half ehsize; /* Size of ELF header in bytes. */ + Elf32_Half phentsize; /* Size of program header entry. */ + Elf32_Half phnum; /* Number of program header entries. */ + Elf32_Half shentsize; /* Size of section header entry. */ + Elf32_Half shnum; /* Number of section header entries. */ + Elf32_Half shstrndx; /* Section name strings section. */ +} Elf32_Ehdr; + +/* + * Section header. + */ + +typedef struct { + Elf32_Word name; /* Section name (index into the + section header string table). */ + Elf32_Word type; /* Section type. */ + Elf32_Word flags; /* Section flags. */ + Elf32_Addr vaddr; /* Address in memory image. */ + Elf32_Off off; /* Offset in file. */ + Elf32_Word size; /* Size in bytes. */ + Elf32_Word link; /* Index of a related section. */ + Elf32_Word info; /* Depends on section type. */ + Elf32_Word addralign; /* Alignment in bytes. */ + Elf32_Word entsize; /* Size of each entry in section. */ +} Elf32_Shdr; + +/* + * Program header. + */ + +typedef struct { + Elf32_Word type; /* Entry type. */ + Elf32_Off off; /* File offset of contents. */ + Elf32_Addr vaddr; /* Virtual address in memory image. */ + Elf32_Addr paddr; /* Physical address (not used). */ + Elf32_Word filesz; /* Size of contents in file. */ + Elf32_Word memsz; /* Size of contents in memory. */ + Elf32_Word flags; /* Access permission flags. */ + Elf32_Word align; /* Alignment in memory and file. */ +} Elf32_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf32_Sword d_tag; /* Entry type. */ + union { + Elf32_Word d_val; /* Integer value. */ + Elf32_Addr d_ptr; /* Address value. */ + } d_un; +} Elf32_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf32_Addr off; /* Location to be relocated. */ + Elf32_Word info; /* Relocation type and symbol index. */ +} Elf32_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf32_Addr off; /* Location to be relocated. */ + Elf32_Word info; /* Relocation type and symbol index. */ + Elf32_Sword addend; /* Addend. */ +} Elf32_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((unsigned char)(info)) + +/* Macro for constructing r_info from field values. */ +#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type)) + +/* + * Relocation types. + */ + +#define R_X86_64_NONE 0 /* No relocation. */ +#define R_X86_64_64 1 /* Add 64 bit symbol value. */ +#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */ +#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */ +#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */ +#define R_X86_64_COPY 5 /* Copy data from shared object. */ +#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */ +#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */ +#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */ +#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */ +#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */ +#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */ +#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */ +#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */ +#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ +#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */ +#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */ +#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */ +#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */ +#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ +#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */ +#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */ + +#define R_X86_64_COUNT 24 /* Count of defined relocation types. */ + + +#define R_ALPHA_NONE 0 /* No reloc */ +#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ +#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ +#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ +#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ +#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ +#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ +#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ +#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ +#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ +#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ +#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ +#define R_ALPHA_OP_PUSH 12 /* OP stack push */ +#define R_ALPHA_OP_STORE 13 /* OP stack pop and store */ +#define R_ALPHA_OP_PSUB 14 /* OP stack subtract */ +#define R_ALPHA_OP_PRSHIFT 15 /* OP stack right shift */ +#define R_ALPHA_GPVALUE 16 +#define R_ALPHA_GPRELHIGH 17 +#define R_ALPHA_GPRELLOW 18 +#define R_ALPHA_IMMED_GP_16 19 +#define R_ALPHA_IMMED_GP_HI32 20 +#define R_ALPHA_IMMED_SCN_HI32 21 +#define R_ALPHA_IMMED_BR_HI32 22 +#define R_ALPHA_IMMED_LO32 23 +#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ +#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ +#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ +#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ + +#define R_ALPHA_COUNT 28 + + +#define R_ARM_NONE 0 /* No relocation. */ +#define R_ARM_PC24 1 +#define R_ARM_ABS32 2 +#define R_ARM_REL32 3 +#define R_ARM_PC13 4 +#define R_ARM_ABS16 5 +#define R_ARM_ABS12 6 +#define R_ARM_THM_ABS5 7 +#define R_ARM_ABS8 8 +#define R_ARM_SBREL32 9 +#define R_ARM_THM_PC22 10 +#define R_ARM_THM_PC8 11 +#define R_ARM_AMP_VCALL9 12 +#define R_ARM_SWI24 13 +#define R_ARM_THM_SWI8 14 +#define R_ARM_XPC25 15 +#define R_ARM_THM_XPC22 16 +#define R_ARM_COPY 20 /* Copy data from shared object. */ +#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */ +#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */ +#define R_ARM_RELATIVE 23 /* Add load address of shared object. */ +#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */ +#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */ +#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */ +#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */ +#define R_ARM_CALL 28 +#define R_ARM_JUMP24 29 +#define R_ARM_V4BX 40 +#define R_ARM_GOT_PREL 96 +#define R_ARM_GNU_VTENTRY 100 +#define R_ARM_GNU_VTINHERIT 101 +#define R_ARM_TLS_IE32 107 +#define R_ARM_TLS_LE32 108 +#define R_ARM_RSBREL32 250 +#define R_ARM_THM_RPC22 251 +#define R_ARM_RREL32 252 +#define R_ARM_RABS32 253 +#define R_ARM_RPC24 254 +#define R_ARM_RBASE 255 + +#define R_ARM_COUNT 38 /* Count of defined relocation types. */ + + +#define R_386_NONE 0 /* No relocation. */ +#define R_386_32 1 /* Add symbol value. */ +#define R_386_PC32 2 /* Add PC-relative symbol value. */ +#define R_386_GOT32 3 /* Add PC-relative GOT offset. */ +#define R_386_PLT32 4 /* Add PC-relative PLT offset. */ +#define R_386_COPY 5 /* Copy data from shared object. */ +#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */ +#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */ +#define R_386_RELATIVE 8 /* Add load address of shared object. */ +#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */ +#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */ +#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */ +#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */ +#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */ +#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */ +#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */ +#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */ +#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */ +#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */ +#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */ +#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */ +#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */ +#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */ +#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */ +#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */ +#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */ +#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */ +#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */ + +#define R_386_COUNT 38 /* Count of defined relocation types. */ + +#define R_PPC_NONE 0 /* No relocation. */ +#define R_PPC_ADDR32 1 +#define R_PPC_ADDR24 2 +#define R_PPC_ADDR16 3 +#define R_PPC_ADDR16_LO 4 +#define R_PPC_ADDR16_HI 5 +#define R_PPC_ADDR16_HA 6 +#define R_PPC_ADDR14 7 +#define R_PPC_ADDR14_BRTAKEN 8 +#define R_PPC_ADDR14_BRNTAKEN 9 +#define R_PPC_REL24 10 +#define R_PPC_REL14 11 +#define R_PPC_REL14_BRTAKEN 12 +#define R_PPC_REL14_BRNTAKEN 13 +#define R_PPC_GOT16 14 +#define R_PPC_GOT16_LO 15 +#define R_PPC_GOT16_HI 16 +#define R_PPC_GOT16_HA 17 +#define R_PPC_PLTREL24 18 +#define R_PPC_COPY 19 +#define R_PPC_GLOB_DAT 20 +#define R_PPC_JMP_SLOT 21 +#define R_PPC_RELATIVE 22 +#define R_PPC_LOCAL24PC 23 +#define R_PPC_UADDR32 24 +#define R_PPC_UADDR16 25 +#define R_PPC_REL32 26 +#define R_PPC_PLT32 27 +#define R_PPC_PLTREL32 28 +#define R_PPC_PLT16_LO 29 +#define R_PPC_PLT16_HI 30 +#define R_PPC_PLT16_HA 31 +#define R_PPC_SDAREL16 32 +#define R_PPC_SECTOFF 33 +#define R_PPC_SECTOFF_LO 34 +#define R_PPC_SECTOFF_HI 35 +#define R_PPC_SECTOFF_HA 36 + +#define R_PPC_COUNT 37 /* Count of defined relocation types. */ + +#define R_PPC_TLS 67 +#define R_PPC_DTPMOD32 68 +#define R_PPC_TPREL16 69 +#define R_PPC_TPREL16_LO 70 +#define R_PPC_TPREL16_HI 71 +#define R_PPC_TPREL16_HA 72 +#define R_PPC_TPREL32 73 +#define R_PPC_DTPREL16 74 +#define R_PPC_DTPREL16_LO 75 +#define R_PPC_DTPREL16_HI 76 +#define R_PPC_DTPREL16_HA 77 +#define R_PPC_DTPREL32 78 +#define R_PPC_GOT_TLSGD16 79 +#define R_PPC_GOT_TLSGD16_LO 80 +#define R_PPC_GOT_TLSGD16_HI 81 +#define R_PPC_GOT_TLSGD16_HA 82 +#define R_PPC_GOT_TLSLD16 83 +#define R_PPC_GOT_TLSLD16_LO 84 +#define R_PPC_GOT_TLSLD16_HI 85 +#define R_PPC_GOT_TLSLD16_HA 86 +#define R_PPC_GOT_TPREL16 87 +#define R_PPC_GOT_TPREL16_LO 88 +#define R_PPC_GOT_TPREL16_HI 89 +#define R_PPC_GOT_TPREL16_HA 90 + +#define R_PPC_EMB_NADDR32 101 +#define R_PPC_EMB_NADDR16 102 +#define R_PPC_EMB_NADDR16_LO 103 +#define R_PPC_EMB_NADDR16_HI 104 +#define R_PPC_EMB_NADDR16_HA 105 +#define R_PPC_EMB_SDAI16 106 +#define R_PPC_EMB_SDA2I16 107 +#define R_PPC_EMB_SDA2REL 108 +#define R_PPC_EMB_SDA21 109 +#define R_PPC_EMB_MRKREF 110 +#define R_PPC_EMB_RELSEC16 111 +#define R_PPC_EMB_RELST_LO 112 +#define R_PPC_EMB_RELST_HI 113 +#define R_PPC_EMB_RELST_HA 114 +#define R_PPC_EMB_BIT_FLD 115 +#define R_PPC_EMB_RELSDA 116 + + /* Count of defined relocation types. */ +#define R_PPC_EMB_COUNT (R_PPC_EMB_RELSDA - R_PPC_EMB_NADDR32 + 1) + + +#define R_SPARC_NONE 0 +#define R_SPARC_8 1 +#define R_SPARC_16 2 +#define R_SPARC_32 3 +#define R_SPARC_DISP8 4 +#define R_SPARC_DISP16 5 +#define R_SPARC_DISP32 6 +#define R_SPARC_WDISP30 7 +#define R_SPARC_WDISP22 8 +#define R_SPARC_HI22 9 +#define R_SPARC_22 10 +#define R_SPARC_13 11 +#define R_SPARC_LO10 12 +#define R_SPARC_GOT10 13 +#define R_SPARC_GOT13 14 +#define R_SPARC_GOT22 15 +#define R_SPARC_PC10 16 +#define R_SPARC_PC22 17 +#define R_SPARC_WPLT30 18 +#define R_SPARC_COPY 19 +#define R_SPARC_GLOB_DAT 20 +#define R_SPARC_JMP_SLOT 21 +#define R_SPARC_RELATIVE 22 +#define R_SPARC_UA32 23 +#define R_SPARC_PLT32 24 +#define R_SPARC_HIPLT22 25 +#define R_SPARC_LOPLT10 26 +#define R_SPARC_PCPLT32 27 +#define R_SPARC_PCPLT22 28 +#define R_SPARC_PCPLT10 29 +#define R_SPARC_10 30 +#define R_SPARC_11 31 +#define R_SPARC_64 32 +#define R_SPARC_OLO10 33 +#define R_SPARC_HH22 34 +#define R_SPARC_HM10 35 +#define R_SPARC_LM22 36 +#define R_SPARC_PC_HH22 37 +#define R_SPARC_PC_HM10 38 +#define R_SPARC_PC_LM22 39 +#define R_SPARC_WDISP16 40 +#define R_SPARC_WDISP19 41 +#define R_SPARC_GLOB_JMP 42 +#define R_SPARC_7 43 +#define R_SPARC_5 44 +#define R_SPARC_6 45 +#define R_SPARC_DISP64 46 +#define R_SPARC_PLT64 47 +#define R_SPARC_HIX22 48 +#define R_SPARC_LOX10 49 +#define R_SPARC_H44 50 +#define R_SPARC_M44 51 +#define R_SPARC_L44 52 +#define R_SPARC_REGISTER 53 +#define R_SPARC_UA64 54 +#define R_SPARC_UA16 55 + + +/* + * Magic number for the elf trampoline, chosen wisely to be an immediate + * value. + */ +#define ARM_MAGIC_TRAMP_NUMBER 0x5c000003 + + +/* + * Symbol table entries. + */ + +typedef struct { + Elf32_Word name; /* String table index of name. */ + Elf32_Addr value; /* Symbol value. */ + Elf32_Word size; /* Size of associated object. */ + unsigned char info; /* Type and binding information. */ + unsigned char other; /* Reserved (not used). */ + Elf32_Half shndx; /* Section index of symbol. */ +} Elf32_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF32_ST_BIND(info) ((info) >> 4) +#define ELF32_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +/* Macro for accessing the fields of st_other. */ +#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3) + +/* + * ELF definitions common to all 64-bit architectures. + */ + +typedef uint64 Elf64_Addr; +typedef uint16 Elf64_Half; +typedef uint64 Elf64_Off; +typedef int32 Elf64_Sword; +typedef int64 Elf64_Sxword; +typedef uint32 Elf64_Word; +typedef uint64 Elf64_Xword; + +/* + * Types of dynamic symbol hash table bucket and chain elements. + * + * This is inconsistent among 64 bit architectures, so a machine dependent + * typedef is required. + */ + +#ifdef __alpha__ +typedef Elf64_Off Elf64_Hashelt; +#else +typedef Elf64_Word Elf64_Hashelt; +#endif + +/* Non-standard class-dependent datatype used for abstraction. */ +typedef Elf64_Xword Elf64_Size; +typedef Elf64_Sxword Elf64_Ssize; + +/* + * ELF header. + */ + +typedef struct { + unsigned char ident[EI_NIDENT]; /* File identification. */ + Elf64_Half type; /* File type. */ + Elf64_Half machine; /* Machine architecture. */ + Elf64_Word version; /* ELF format version. */ + Elf64_Addr entry; /* Entry point. */ + Elf64_Off phoff; /* Program header file offset. */ + Elf64_Off shoff; /* Section header file offset. */ + Elf64_Word flags; /* Architecture-specific flags. */ + Elf64_Half ehsize; /* Size of ELF header in bytes. */ + Elf64_Half phentsize; /* Size of program header entry. */ + Elf64_Half phnum; /* Number of program header entries. */ + Elf64_Half shentsize; /* Size of section header entry. */ + Elf64_Half shnum; /* Number of section header entries. */ + Elf64_Half shstrndx; /* Section name strings section. */ +} Elf64_Ehdr; + +/* + * Section header. + */ + +typedef struct Elf64_Shdr Elf64_Shdr; +struct Elf64_Shdr { + Elf64_Word name; /* Section name (index into the + section header string table). */ + Elf64_Word type; /* Section type. */ + Elf64_Xword flags; /* Section flags. */ + Elf64_Addr addr; /* Address in memory image. */ + Elf64_Off off; /* Offset in file. */ + Elf64_Xword size; /* Size in bytes. */ + Elf64_Word link; /* Index of a related section. */ + Elf64_Word info; /* Depends on section type. */ + Elf64_Xword addralign; /* Alignment in bytes. */ + Elf64_Xword entsize; /* Size of each entry in section. */ +}; + +/* + * Program header. + */ + +typedef struct { + Elf64_Word type; /* Entry type. */ + Elf64_Word flags; /* Access permission flags. */ + Elf64_Off off; /* File offset of contents. */ + Elf64_Addr vaddr; /* Virtual address in memory image. */ + Elf64_Addr paddr; /* Physical address (not used). */ + Elf64_Xword filesz; /* Size of contents in file. */ + Elf64_Xword memsz; /* Size of contents in memory. */ + Elf64_Xword align; /* Alignment in memory and file. */ +} Elf64_Phdr; + +/* + * Dynamic structure. The ".dynamic" section contains an array of them. + */ + +typedef struct { + Elf64_Sxword d_tag; /* Entry type. */ + union { + Elf64_Xword d_val; /* Integer value. */ + Elf64_Addr d_ptr; /* Address value. */ + } d_un; +} Elf64_Dyn; + +/* + * Relocation entries. + */ + +/* Relocations that don't need an addend field. */ +typedef struct { + Elf64_Addr off; /* Location to be relocated. */ + Elf64_Xword info; /* Relocation type and symbol index. */ +} Elf64_Rel; + +/* Relocations that need an addend field. */ +typedef struct { + Elf64_Addr off; /* Location to be relocated. */ + Elf64_Xword info; /* Relocation type and symbol index. */ + Elf64_Sxword addend; /* Addend. */ +} Elf64_Rela; + +/* Macros for accessing the fields of r_info. */ +#define ELF64_R_SYM(info) ((info) >> 32) +#define ELF64_R_TYPE(info) ((info) & 0xffffffffL) + +/* Macro for constructing r_info from field values. */ +#define ELF64_R_INFO(sym, type) ((((uint64)(sym)) << 32) + (((uint64)(type)) & 0xffffffffULL)) + +/* + * Symbol table entries. + */ + +typedef struct { + Elf64_Word name; /* String table index of name. */ + unsigned char info; /* Type and binding information. */ + unsigned char other; /* Reserved (not used). */ + Elf64_Half shndx; /* Section index of symbol. */ + Elf64_Addr value; /* Symbol value. */ + Elf64_Xword size; /* Size of associated object. */ +} Elf64_Sym; + +/* Macros for accessing the fields of st_info. */ +#define ELF64_ST_BIND(info) ((info) >> 4) +#define ELF64_ST_TYPE(info) ((info) & 0xf) + +/* Macro for constructing st_info from field values. */ +#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +/* Macro for accessing the fields of st_other. */ +#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3) + +/* + * Go linker interface + */ + +#define ELF64HDRSIZE 64 +#define ELF64PHDRSIZE 56 +#define ELF64SHDRSIZE 64 +#define ELF64RELSIZE 16 +#define ELF64RELASIZE 24 +#define ELF64SYMSIZE sizeof(Elf64_Sym) + +#define ELF32HDRSIZE sizeof(Elf32_Ehdr) +#define ELF32PHDRSIZE sizeof(Elf32_Phdr) +#define ELF32SHDRSIZE sizeof(Elf32_Shdr) +#define ELF32SYMSIZE sizeof(Elf32_Sym) +#define ELF32RELSIZE 8 \ No newline at end of file From c80037bbab880d7cfb63f3e411ff3f3fc61c2962 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 06:47:11 +0100 Subject: [PATCH 050/639] rimage: elf.h: use stdint --- rimage/elf.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/rimage/elf.h b/rimage/elf.h index d4f3955c2528..aae7d92bc078 100644 --- a/rimage/elf.h +++ b/rimage/elf.h @@ -50,15 +50,17 @@ * not include the padding. */ -typedef unsigned __int64 uint64; -typedef unsigned __int32 uint32; -typedef unsigned __int16 uint16; -typedef unsigned __int8 uint8; +#include -typedef __int64 int64; -typedef __int32 int32; -typedef __int16 int16; -typedef __int8 int8; +typedef uint64_t uint64; +typedef uint32_t uint32; +typedef uint16_t uint16; +typedef uint8_t uint8; + +typedef int64_t int64; +typedef int32_t int32; +typedef int16_t int16; +typedef int8_t int8; typedef struct { @@ -958,4 +960,4 @@ typedef struct { #define ELF32PHDRSIZE sizeof(Elf32_Phdr) #define ELF32SHDRSIZE sizeof(Elf32_Shdr) #define ELF32SYMSIZE sizeof(Elf32_Sym) -#define ELF32RELSIZE 8 \ No newline at end of file +#define ELF32RELSIZE 8 From 552fc49e0f18993f1df242c8fea5bd1f01236b49 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 06:52:35 +0100 Subject: [PATCH 051/639] rimage: use local elf.h Signed-off-by: Janusz Jankowski --- rimage/elf.c | 184 +++++++++++++++++++++---------------------- rimage/file_simple.c | 52 ++++++------ rimage/manifest.c | 34 ++++---- rimage/rimage.h | 3 +- 4 files changed, 137 insertions(+), 136 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index e2c6e8ff8257..2eec2c048dfe 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -30,7 +30,7 @@ static int elf_read_sections(struct image *image, struct module *module) int man_section_idx; /* read in section header */ - ret = fseek(module->fd, hdr->e_shoff, SEEK_SET); + ret = fseek(module->fd, hdr->shoff, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to %s section header %d\n", module->elf_file, ret); @@ -38,37 +38,37 @@ static int elf_read_sections(struct image *image, struct module *module) } /* allocate space for each section header */ - section = calloc(sizeof(Elf32_Shdr), hdr->e_shnum); + section = calloc(sizeof(Elf32_Shdr), hdr->shnum); if (section == NULL) return -ENOMEM; module->section = section; /* read in sections */ - count = fread(section, sizeof(Elf32_Shdr), hdr->e_shnum, module->fd); - if (count != hdr->e_shnum) { + count = fread(section, sizeof(Elf32_Shdr), hdr->shnum, module->fd); + if (count != hdr->shnum) { fprintf(stderr, "error: failed to read %s section header %d\n", module->elf_file, -errno); return -errno; } /* read in strings */ - module->strings = calloc(1, section[hdr->e_shstrndx].sh_size); + module->strings = calloc(1, section[hdr->shstrndx].size); if (!module->strings) { fprintf(stderr, "error: failed %s to read ELF strings for %d\n", module->elf_file, -errno); return -errno; } - ret = fseek(module->fd, section[hdr->e_shstrndx].sh_offset, SEEK_SET); + ret = fseek(module->fd, section[hdr->shstrndx].off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to %s stringss %d\n", module->elf_file, ret); return ret; } - count = fread(module->strings, 1, section[hdr->e_shstrndx].sh_size, + count = fread(module->strings, 1, section[hdr->shstrndx].size, module->fd); - if (count != section[hdr->e_shstrndx].sh_size) { + if (count != section[hdr->shstrndx].size) { fprintf(stderr, "error: failed to read %s strings %d\n", module->elf_file, -errno); return -errno; @@ -98,26 +98,26 @@ static int elf_read_sections(struct image *image, struct module *module) module->fw_ready_index); /* parse each section */ - for (i = 0; i < hdr->e_shnum; i++) { + for (i = 0; i < hdr->shnum; i++) { /* only write valid sections */ - if (!(section[i].sh_flags & valid)) + if (!(section[i].flags & valid)) continue; - switch (section[i].sh_type) { + switch (section[i].type) { case SHT_NOBITS: /* bss */ - module->bss_size += section[i].sh_size; + module->bss_size += section[i].size; module->num_bss++; break; case SHT_PROGBITS: /* text or data */ - module->fw_size += section[i].sh_size; + module->fw_size += section[i].size; - if (section[i].sh_flags & SHF_EXECINSTR) - module->text_size += section[i].sh_size; + if (section[i].flags & SHF_EXECINSTR) + module->text_size += section[i].size; else - module->data_size += section[i].sh_size; + module->data_size += section[i].size; break; default: continue; @@ -129,19 +129,19 @@ static int elf_read_sections(struct image *image, struct module *module) continue; fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_type); + i, section[i].type); fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_flags); + i, section[i].flags); fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_addr); + i, section[i].vaddr); fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_offset); + i, section[i].off); fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_size); + i, section[i].size); fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, - i, section[i].sh_link); + i, section[i].link); fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, - i, section[i].sh_info); + i, section[i].info); } return 0; @@ -155,7 +155,7 @@ static int elf_read_programs(struct image *image, struct module *module) int i, ret; /* read in program header */ - ret = fseek(module->fd, hdr->e_phoff, SEEK_SET); + ret = fseek(module->fd, hdr->phoff, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to %s program header %d\n", module->elf_file, ret); @@ -163,42 +163,42 @@ static int elf_read_programs(struct image *image, struct module *module) } /* allocate space for programs */ - prg = calloc(sizeof(Elf32_Phdr), hdr->e_phnum); + prg = calloc(sizeof(Elf32_Phdr), hdr->phnum); if (prg == NULL) return -ENOMEM; module->prg = prg; /* read in programs */ - count = fread(prg, sizeof(Elf32_Phdr), hdr->e_phnum, module->fd); - if (count != hdr->e_phnum) { + count = fread(prg, sizeof(Elf32_Phdr), hdr->phnum, module->fd); + if (count != hdr->phnum) { fprintf(stderr, "error: failed to read %s program header %d\n", module->elf_file, -errno); return -errno; } /* check each program */ - for (i = 0; i < hdr->e_phnum; i++) { + for (i = 0; i < hdr->phnum; i++) { - if (prg[i].p_filesz == 0) + if (prg[i].filesz == 0) continue; if (!image->verbose) continue; fprintf(stdout, "%s program-%d: \ttype\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_type); + module->elf_file, i, prg[i].type); fprintf(stdout, "%s program-%d: \toffset\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_offset); + module->elf_file, i, prg[i].off); fprintf(stdout, "%s program-%d: \tvaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_vaddr); + module->elf_file, i, prg[i].vaddr); fprintf(stdout, "%s program-%d: \tpaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_paddr); + module->elf_file, i, prg[i].paddr); fprintf(stdout, "%s program-%d: \tfsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_filesz); + module->elf_file, i, prg[i].filesz); fprintf(stdout, "%s program-%d: \tmsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].p_memsz); + module->elf_file, i, prg[i].memsz); fprintf(stdout, "%s program-%d: \tflags\t 0x%8.8x\n\n", - module->elf_file, i, prg[i].p_flags); + module->elf_file, i, prg[i].flags); } return 0; @@ -221,21 +221,21 @@ static int elf_read_hdr(struct image *image, struct module *module) return 0; fprintf(stdout, "%s elf: \tentry point\t 0x%8.8x\n", - module->elf_file, hdr->e_entry); + module->elf_file, hdr->entry); fprintf(stdout, "%s elf: \tprogram offset\t 0x%8.8x\n", - module->elf_file, hdr->e_phoff); + module->elf_file, hdr->phoff); fprintf(stdout, "%s elf: \tsection offset\t 0x%8.8x\n", - module->elf_file, hdr->e_shoff); + module->elf_file, hdr->shoff); fprintf(stdout, "%s elf: \tprogram size\t 0x%8.8x\n", - module->elf_file, hdr->e_phentsize); + module->elf_file, hdr->phentsize); fprintf(stdout, "%s elf: \tprogram count\t 0x%8.8x\n", - module->elf_file, hdr->e_phnum); + module->elf_file, hdr->phnum); fprintf(stdout, "%s elf: \tsection size\t 0x%8.8x\n", - module->elf_file, hdr->e_shentsize); + module->elf_file, hdr->shentsize); fprintf(stdout, "%s elf: \tsection count\t 0x%8.8x\n", - module->elf_file, hdr->e_shnum); + module->elf_file, hdr->shnum); fprintf(stdout, "%s elf: \tstring index\t 0x%8.8x\n\n", - module->elf_file, hdr->e_shstrndx); + module->elf_file, hdr->shstrndx); return 0; } @@ -244,8 +244,8 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) { uint32_t start, end; - start = section->sh_addr; - end = section->sh_addr + section->sh_size; + start = section->vaddr; + end = section->vaddr + section->size; if (start < image->adsp->rom_base || start > image->adsp->rom_base + image->adsp->rom_size) @@ -259,23 +259,23 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) static void elf_module_size(struct image *image, struct module *module, Elf32_Shdr *section, int index) { - switch (section->sh_type) { + switch (section->type) { case SHT_PROGBITS: /* text or data */ - if (section->sh_flags & SHF_EXECINSTR) { + if (section->flags & SHF_EXECINSTR) { /* text */ - if (module->text_start > section->sh_addr) - module->text_start = section->sh_addr; - if (module->text_end < section->sh_addr + section->sh_size) - module->text_end = section->sh_addr + section->sh_size; + if (module->text_start > section->vaddr) + module->text_start = section->vaddr; + if (module->text_end < section->vaddr + section->size) + module->text_end = section->vaddr + section->size; fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ - if (module->data_start > section->sh_addr) - module->data_start = section->sh_addr; - if (module->data_end < section->sh_addr + section->sh_size) - module->data_end = section->sh_addr + section->sh_size; + if (module->data_start > section->vaddr) + module->data_start = section->vaddr; + if (module->data_end < section->vaddr + section->size) + module->data_end = section->vaddr + section->size; fprintf(stdout, "\tDATA\t"); } @@ -284,8 +284,8 @@ static void elf_module_size(struct image *image, struct module *module, /* bss */ if (index == module->bss_index) { /* updated the .bss segment */ - module->bss_start = section->sh_addr; - module->bss_end = section->sh_addr + section->sh_size; + module->bss_start = section->vaddr; + module->bss_end = section->vaddr + section->size; fprintf(stdout, "\tBSS\t"); } else { fprintf(stdout, "\tHEAP\t"); @@ -302,19 +302,19 @@ static void elf_module_size(struct image *image, struct module *module, static void elf_module_size_reloc(struct image *image, struct module *module, Elf32_Shdr *section, int index) { - switch (section->sh_type) { + switch (section->type) { case SHT_PROGBITS: /* text or data */ - if (section->sh_flags & SHF_EXECINSTR) { + if (section->flags & SHF_EXECINSTR) { /* text */ module->text_start = 0; - module->text_end += section->sh_size; + module->text_end += section->size; fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ module->data_start = 0; - module->data_end += section->sh_size; + module->data_end += section->size; fprintf(stdout, "\tDATA\t"); } @@ -323,8 +323,8 @@ static void elf_module_size_reloc(struct image *image, struct module *module, /* bss */ if (index == module->bss_index) { /* updated the .bss segment */ - module->bss_start = section->sh_addr; - module->bss_end = section->sh_addr + section->sh_size; + module->bss_start = section->vaddr; + module->bss_end = section->vaddr + section->size; fprintf(stdout, "\tBSS\t"); } else { fprintf(stdout, "\tHEAP\t"); @@ -346,12 +346,12 @@ static void elf_module_limits(struct image *image, struct module *module) module->text_end = module->data_end = module->bss_end = 0; fprintf(stdout, " Found %d sections, listing valid sections......\n", - module->hdr.e_shnum); + module->hdr.shnum); fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\tName\n"); /* iterate all sections and get size of segments */ - for (i = 0; i < module->hdr.e_shnum; i++) { + for (i = 0; i < module->hdr.shnum; i++) { section = &module->section[i]; @@ -360,10 +360,10 @@ static void elf_module_limits(struct image *image, struct module *module) i != module->fw_ready_index) { /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(section->flags & valid)) continue; - if (section->sh_size == 0) + if (section->size == 0) continue; if (elf_is_rom(image, section)) @@ -371,8 +371,8 @@ static void elf_module_limits(struct image *image, struct module *module) } fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, - section->sh_addr, section->sh_addr + section->sh_size, - section->sh_size); + section->vaddr, section->vaddr + section->size, + section->size); /* text or data section */ if (image->reloc) @@ -381,7 +381,7 @@ static void elf_module_limits(struct image *image, struct module *module) elf_module_size(image, module, section, i); /* section name */ - fprintf(stdout, "%s\n", module->strings + section->sh_name); + fprintf(stdout, "%s\n", module->strings + section->name); } fprintf(stdout, "\n"); @@ -401,30 +401,30 @@ int elf_validate_section(struct image *image, struct module *module, m = &image->module[i]; /* for each section */ - for (j = 0; j < m->hdr.e_shnum; j++) { + for (j = 0; j < m->hdr.shnum; j++) { s = &m->section[j]; if (s == section) continue; /* only check valid sections */ - if (!(s->sh_flags & valid)) + if (!(s->flags & valid)) continue; - if (s->sh_size == 0) + if (s->size == 0) continue; /* is section start non overlapping ? */ - if (section->sh_addr >= s->sh_addr && - section->sh_addr < - s->sh_addr + s->sh_size) { + if (section->vaddr >= s->vaddr && + section->vaddr < + s->vaddr + s->size) { goto err; } /* is section end non overlapping ? */ - if (section->sh_addr + section->sh_size > s->sh_addr && - section->sh_addr + section->sh_size <= - s->sh_addr + s->sh_size) { + if (section->vaddr + section->size > s->vaddr && + section->vaddr + section->size <= + s->vaddr + s->size) { goto err; } } @@ -436,8 +436,8 @@ int elf_validate_section(struct image *image, struct module *module, fprintf(stderr, "error: section overlap between %s:%d and %s:%d\n", module->elf_file, index, m->elf_file, j); fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", - section->sh_addr, section->sh_addr + section->sh_size, - s->sh_addr, s->sh_addr + s->sh_size); + section->vaddr, section->vaddr + section->size, + s->vaddr, s->vaddr + s->size); return -EINVAL; } @@ -458,14 +458,14 @@ int elf_validate_modules(struct image *image) module = &image->module[i]; /* for each section */ - for (j = 0; j < module->hdr.e_shnum; j++) { + for (j = 0; j < module->hdr.shnum; j++) { section = &module->section[j]; /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(section->flags & valid)) continue; - if (section->sh_size == 0) + if (section->size == 0) continue; /* is section non overlapping ? */ @@ -487,31 +487,31 @@ int elf_find_section(struct image *image, struct module *module, size_t count; int ret, i; - section = &module->section[hdr->e_shstrndx]; + section = &module->section[hdr->shstrndx]; /* alloc data data */ - buffer = calloc(1, section->sh_size); + buffer = calloc(1, section->size); if (buffer == NULL) return -ENOMEM; /* read in section string data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to string section %d\n", ret); goto out; } - count = fread(buffer, 1, section->sh_size, module->fd); - if (count != section->sh_size) { + count = fread(buffer, 1, section->size, module->fd); + if (count != section->size) { fprintf(stderr, "error: can't read string section %d\n", -errno); ret = -errno; goto out; } /* find section with name */ - for (i = 0; i < hdr->e_shnum; i++) { + for (i = 0; i < hdr->shnum; i++) { s = &module->section[i]; - if (!strcmp(name, buffer + s->sh_name)) { + if (!strcmp(name, buffer + s->name)) { ret = i; goto out; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index b69bd8e52d6b..5d60de9bdda1 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -49,8 +49,8 @@ static int is_iram(struct image *image, Elf32_Shdr *section) const struct adsp *adsp = image->adsp; uint32_t start, end; - start = section->sh_addr; - end = section->sh_addr + section->sh_size; + start = section->vaddr; + end = section->vaddr + section->size; if (start < adsp->iram_base) return 0; @@ -66,8 +66,8 @@ static int is_dram(struct image *image, Elf32_Shdr *section) const struct adsp *adsp = image->adsp; uint32_t start, end; - start = section->sh_addr; - end = section->sh_addr + section->sh_size; + start = section->vaddr; + end = section->vaddr + section->size; if (start < adsp->dram_base) return 0; @@ -90,7 +90,7 @@ static int write_block(struct image *image, struct module *module, void *buffer; int ret; - block.size = section->sh_size; + block.size = section->size; if (block.size % 4) { /* make block.size divisible by 4 to avoid unaligned accesses */ padding = 4 - (block.size % 4); @@ -99,15 +99,15 @@ static int write_block(struct image *image, struct module *module, if (is_iram(image, section)) { block.type = SOF_BLK_TEXT; - block.offset = section->sh_addr - adsp->iram_base + block.offset = section->vaddr - adsp->iram_base + adsp->host_iram_offset; } else if (is_dram(image, section)) { block.type = SOF_BLK_DATA; - block.offset = section->sh_addr - adsp->dram_base + block.offset = section->vaddr - adsp->dram_base + adsp->host_dram_offset; } else { fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", - section->sh_addr, section->sh_size); + section->vaddr, section->size); return -EINVAL; } @@ -117,18 +117,18 @@ static int write_block(struct image *image, struct module *module, return -errno; /* alloc data data */ - buffer = calloc(1, section->sh_size); + buffer = calloc(1, section->size); if (buffer == NULL) return -ENOMEM; /* read in section data */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to section %d\n", ret); goto out; } - count = fread(buffer, 1, section->sh_size, module->fd); - if (count != section->sh_size) { + count = fread(buffer, 1, section->size, module->fd); + if (count != section->size) { fprintf(stderr, "error: cant read section %d\n", -errno); ret = -errno; goto out; @@ -139,13 +139,13 @@ static int write_block(struct image *image, struct module *module, if (count != block.size) { fprintf(stderr, "error: cant write section %d\n", -errno); fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", - section->sh_offset, section->sh_size, section->sh_addr); + section->off, section->size, section->vaddr); ret = -errno; goto out; } fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, - section->sh_addr, section->sh_size, ftell(image->out_fd), + section->vaddr, section->size, ftell(image->out_fd), block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); out: @@ -195,16 +195,16 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); - for (i = 0; i < module->hdr.e_shnum; i++) { + for (i = 0; i < module->hdr.shnum; i++) { section = &module->section[i]; /* only write valid sections */ - if (!(module->section[i].sh_flags & valid)) + if (!(module->section[i].flags & valid)) continue; /* dont write bss */ - if (section->sh_type == SHT_NOBITS) + if (section->type == SHT_NOBITS) continue; err = write_block(image, module, section); @@ -404,7 +404,7 @@ int write_logs_dictionary(struct image *image) if (!buffer) return -ENOMEM; - fseek(module->fd, section->sh_offset, SEEK_SET); + fseek(module->fd, section->off, SEEK_SET); size_t count = fread(buffer, 1, sizeof(struct sof_ipc_fw_ready), module->fd); @@ -427,29 +427,29 @@ int write_logs_dictionary(struct image *image) if (module->logs_index > 0) { Elf32_Shdr *section = &module->section[module->logs_index]; - header.base_address = section->sh_addr; - header.data_length = section->sh_size; + header.base_address = section->vaddr; + header.data_length = section->size; fwrite(&header, sizeof(struct snd_sof_logs_header), 1, image->ldc_out_fd); - buffer = calloc(1, section->sh_size); + buffer = calloc(1, section->size); if (!buffer) return -ENOMEM; - fseek(module->fd, section->sh_offset, SEEK_SET); - size_t count = fread(buffer, 1, section->sh_size, + fseek(module->fd, section->off, SEEK_SET); + size_t count = fread(buffer, 1, section->size, module->fd); - if (count != section->sh_size) { + if (count != section->size) { fprintf(stderr, "error: can't read logs section %d\n", -errno); ret = -errno; goto out; } - count = fwrite(buffer, 1, section->sh_size, + count = fwrite(buffer, 1, section->size, image->ldc_out_fd); - if (count != section->sh_size) { + if (count != section->size) { fprintf(stderr, "error: can't write section %d\n", -errno); ret = -errno; diff --git a/rimage/manifest.c b/rimage/manifest.c index 17cab87ee0e0..3d07598a3a4b 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -129,10 +129,10 @@ static uint32_t elf_to_file_offset(struct image *image, struct module *module, struct sof_man_module *man_module, Elf32_Shdr *section) { - uint32_t elf_addr = section->sh_addr, file_offset = 0; + uint32_t elf_addr = section->vaddr, file_offset = 0; - if (section->sh_type == SHT_PROGBITS) { - if (section->sh_flags & SHF_EXECINSTR) { + if (section->type == SHT_PROGBITS) { + if (section->flags & SHF_EXECINSTR) { /* text segment */ file_offset = elf_addr - module->text_start + module->foffset; @@ -142,7 +142,7 @@ static uint32_t elf_to_file_offset(struct image *image, module->foffset + module->text_fixup_size; } - } else if (section->sh_type == SHT_NOBITS) { + } else if (section->type == SHT_NOBITS) { /* bss segment */ file_offset = 0; } @@ -157,15 +157,15 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, { uint32_t offset = elf_to_file_offset(image, module, man_module, section); - uint32_t end = offset + section->sh_size; + uint32_t end = offset + section->size; int seg_type = -1; void *buffer = image->fw_image + offset; size_t count; - switch (section->sh_type) { + switch (section->type) { case SHT_PROGBITS: /* text or data */ - if (section->sh_flags & SHF_EXECINSTR) + if (section->flags & SHF_EXECINSTR) seg_type = SOF_MAN_SEGMENT_TEXT; else seg_type = SOF_MAN_SEGMENT_RODATA; @@ -184,8 +184,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, man_module->segment[seg_type].file_offset == 0) man_module->segment[seg_type].file_offset = offset; - count = fread(buffer, 1, section->sh_size, module->fd); - if (count != section->sh_size) { + count = fread(buffer, 1, section->size, module->fd); + if (count != section->size) { fprintf(stderr, "error: cant read section %d\n", -errno); return -errno; } @@ -195,7 +195,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, image->image_end = end; fprintf(stdout, "\t%d\t0x%x\t0x%x\t\t0x%x\t%s\n", section_idx, - section->sh_addr, section->sh_size, offset, + section->vaddr, section->size, offset, seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); return 0; @@ -207,7 +207,7 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, int ret; /* seek to ELF section */ - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); return ret; @@ -243,11 +243,11 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* load in manifest data */ /* module built using xcc has preceding bytes */ - if (section->sh_size > sizeof(sof_mod)) + if (section->size > sizeof(sof_mod)) ret = fseek(module->fd, - section->sh_offset + XCC_MOD_OFFSET, SEEK_SET); + section->off + XCC_MOD_OFFSET, SEEK_SET); else - ret = fseek(module->fd, section->sh_offset, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); @@ -443,15 +443,15 @@ static int man_module_create(struct image *image, struct module *module, return -EINVAL; /* find all sections and copy to corresponding segments */ - for (i = 0; i < module->hdr.e_shnum; i++) { + for (i = 0; i < module->hdr.shnum; i++) { section = &module->section[i]; /* only check valid sections */ - if (!(section->sh_flags & valid)) + if (!(section->flags & valid)) continue; - if (section->sh_size == 0) + if (section->size == 0) continue; /* text or data section */ diff --git a/rimage/rimage.h b/rimage/rimage.h index 2c06f740ccfe..4f294fc082cf 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -16,8 +16,9 @@ #ifndef __RIMAGE_H__ #define __RIMAGE_H__ +#include "elf.h" + #include -#include #include #include From 93c57421719a19dc1ce0433bd2bb3f8caeabd97a Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 07:33:30 +0100 Subject: [PATCH 052/639] rimage: fix for gcc8.1 -Wstringop-truncation Signed-off-by: Janusz Jankowski --- rimage/pkcs1_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index adee7a9b3221..670c3096a189 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -96,7 +96,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, if (!image->key_name) sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); else - strncpy(path, image->key_name, 256); + strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "r"); From e771e65125a95a8a49894e97c79341d1fe86698b Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 07:47:10 +0100 Subject: [PATCH 053/639] rimage: cast size_t to correct format types Signed-off-by: Janusz Jankowski --- rimage/file_simple.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 5d60de9bdda1..d1ff9377d5ae 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -375,8 +375,9 @@ static int simple_write_firmware(struct image *image) return -errno; fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", - hdr.file_size + sizeof(hdr), hdr.file_size + sizeof(hdr), - hdr.num_modules); + (long) (hdr.file_size + sizeof(hdr)), + (long) (hdr.file_size + sizeof(hdr)), + hdr.num_modules); return 0; } @@ -459,7 +460,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", - sizeof(header.version)); + (unsigned long) sizeof(header.version)); } } out: From 13f74da9791375d2f590e5083be661f57b874864 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 07:53:06 +0100 Subject: [PATCH 054/639] rimage: use time_t for localtime Signed-off-by: Janusz Jankowski --- rimage/css.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rimage/css.c b/rimage/css.c index d76316891848..2dafff0dea07 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -25,13 +25,15 @@ void ri_css_v1_8_hdr_create(struct image *image) struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; struct tm *date; struct timeval tv; + time_t seconds; int val; fprintf(stdout, " cse: completing CSS manifest\n"); /* get local time and date */ gettimeofday(&tv, NULL); - date = localtime(&tv.tv_sec); + seconds = tv.tv_sec; + date = localtime(&seconds); if (!date) { fprintf(stderr, "error: cant get localtime %d\n", -errno); @@ -80,13 +82,15 @@ void ri_css_v1_5_hdr_create(struct image *image) struct css_header_v1_5 *css = image->fw_image; struct tm *date; struct timeval tv; + time_t seconds; int val; fprintf(stdout, " cse: completing CSS manifest\n"); /* get local time and date */ gettimeofday(&tv, NULL); - date = localtime(&tv.tv_sec); + seconds = tv.tv_sec; + date = localtime(&seconds); if (!date) { fprintf(stderr, "error: cant get localtime %d\n", -errno); From 24259d7967953c0567696737df632a601145d2f8 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Wed, 30 Jan 2019 08:04:54 +0100 Subject: [PATCH 055/639] rimage: use fopen binary mode --- rimage/elf.c | 2 +- rimage/manifest.c | 6 +++--- rimage/pkcs1_5.c | 4 ++-- rimage/rimage.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 2eec2c048dfe..0d7830806a52 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -541,7 +541,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) module = &image->module[module_index]; /* open the elf input file */ - module->fd = fopen(name, "r"); + module->fd = fopen(name, "rb"); if (module->fd == NULL) { fprintf(stderr, "error: unable to open %s for reading %d\n", name, errno); diff --git a/rimage/manifest.c b/rimage/manifest.c index 3d07598a3a4b..33d8abf542f7 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -44,7 +44,7 @@ static int man_open_rom_file(struct image *image) return -ENOMEM; /* open ROM outfile for writing */ - image->out_rom_fd = fopen(image->out_rom_file, "w"); + image->out_rom_fd = fopen(image->out_rom_file, "wb"); if (image->out_rom_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_rom_file, errno); @@ -59,7 +59,7 @@ static int man_open_unsigned_file(struct image *image) unlink(image->out_unsigned_file); /* open unsigned FW outfile for writing */ - image->out_unsigned_fd = fopen(image->out_unsigned_file, "w"); + image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); if (image->out_unsigned_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_unsigned_file, errno); @@ -74,7 +74,7 @@ static int man_open_manifest_file(struct image *image) sprintf(image->out_man_file, "%s.met", image->out_file); unlink(image->out_man_file); - image->out_man_fd = fopen(image->out_man_file, "w"); + image->out_man_fd = fopen(image->out_man_file, "wb"); if (image->out_man_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_man_file, errno); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 670c3096a189..76d309ee5dfb 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -99,7 +99,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); - fp = fopen(path, "r"); + fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); @@ -190,7 +190,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, strcpy(path, image->key_name); fprintf(stdout, " pkcs: signing with key %s\n", path); - fp = fopen(path, "r"); + fp = fopen(path, "rb"); if (fp == NULL) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); diff --git a/rimage/rimage.c b/rimage/rimage.c index ae0299b707aa..807939b8fda0 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -132,7 +132,7 @@ int main(int argc, char *argv[]) /* open outfile for writing */ unlink(image.out_file); - image.out_fd = fopen(image.out_file, "w"); + image.out_fd = fopen(image.out_file, "wb"); if (image.out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.out_file, errno); @@ -147,7 +147,7 @@ int main(int argc, char *argv[]) ret = image.adsp->write_firmware(&image); unlink(image.ldc_out_file); - image.ldc_out_fd = fopen(image.ldc_out_file, "w"); + image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); if (image.ldc_out_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.ldc_out_file, errno); From b05f9bd3ffeb2f1185f42779db40e9b1c8700209 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 7 Jan 2019 13:44:44 +0100 Subject: [PATCH 056/639] sue: use rimage for image building Fix bugs in Sue Creek support for rimage: - use a correct manifest offset - place the image higher into RAM to avoid overwriting itself when copying the SOF proper. Signed-off-by: Guennadi Liakhovetski --- rimage/manifest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/manifest.h b/rimage/manifest.h index d06c0b11ceb2..6622f521aea5 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -41,7 +41,7 @@ #define MAN_EXT_PADDING 0x20 #define MAN_DESC_OFFSET_V1_8 0x2000 #define MAN_DESC_OFFSET_V1_5 0x284 -#define MAN_DESC_OFFSET_V1_5_SUE 0x4000 +#define MAN_DESC_OFFSET_V1_5_SUE 0x2000 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ From b65618612b1904548de76bf8564f9d27d5686f0a Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Fri, 1 Feb 2019 17:15:40 +0200 Subject: [PATCH 057/639] rimage: Refine sof fw blk type Change the name of the enums to reflect the type of memory where the given block will be loaded. DATA section is mapped to DRAM, TEXT section is mapped to SRAM. No ABI breakage. We also reserve several slots for future use. Signed-off-by: Daniel Baluta --- rimage/file_simple.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index d1ff9377d5ae..2a76bd7b48ce 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -98,11 +98,11 @@ static int write_block(struct image *image, struct module *module, } if (is_iram(image, section)) { - block.type = SOF_BLK_TEXT; + block.type = SOF_FW_BLK_TYPE_IRAM; block.offset = section->vaddr - adsp->iram_base + adsp->host_iram_offset; } else if (is_dram(image, section)) { - block.type = SOF_BLK_DATA; + block.type = SOF_FW_BLK_TYPE_DRAM; block.offset = section->vaddr - adsp->dram_base + adsp->host_dram_offset; } else { @@ -146,7 +146,7 @@ static int write_block(struct image *image, struct module *module, fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, section->vaddr, section->size, ftell(image->out_fd), - block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); out: free(buffer); @@ -241,7 +241,7 @@ static int write_block_reloc(struct image *image, struct module *module) int ret; block.size = module->file_size; - block.type = SOF_BLK_DATA; + block.type = SOF_FW_BLK_TYPE_DRAM; block.offset = 0; /* write header */ @@ -277,7 +277,7 @@ static int write_block_reloc(struct image *image, struct module *module) fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, 0, module->file_size, ftell(image->out_fd), - block.type == SOF_BLK_TEXT ? "TEXT" : "DATA"); + block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); out: free(buffer); From 42aca3d129179577b6b362e4d9a0a42e431b4f43 Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Fri, 1 Feb 2019 17:48:59 +0200 Subject: [PATCH 058/639] rimage: Describe memory as an array of zones Use new block types added to describe memory for a platform as an array of zones. The block type will be an index into the array. A memory zone is described by (base, size, host_offset). With this map we can now easily find for a given section in which memory zone it belongs. Because we have 10 zones reserved this patch will allocate extra 12 * 10 = 120 bytes that are not used yet. Signed-off-by: Daniel Baluta --- rimage/elf.c | 10 +-- rimage/file_simple.c | 144 ++++++++++++++++++++++++------------------- rimage/manifest.c | 108 ++++++++++++++++++++++---------- rimage/rimage.h | 20 +++--- 4 files changed, 171 insertions(+), 111 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 0d7830806a52..6abd23b17f5a 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -243,15 +243,17 @@ static int elf_read_hdr(struct image *image, struct module *module) int elf_is_rom(struct image *image, Elf32_Shdr *section) { uint32_t start, end; + uint32_t base, size; start = section->vaddr; end = section->vaddr + section->size; - if (start < image->adsp->rom_base || - start > image->adsp->rom_base + image->adsp->rom_size) + base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; + size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + + if (start < base || start > base + size) return 0; - if (end < image->adsp->rom_base || - end > image->adsp->rom_base + image->adsp->rom_size) + if (end < base || end > base + size) return 0; return 1; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 2a76bd7b48ce..bef7623df841 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -44,38 +44,27 @@ #define BDW_DRAM_HOST_OFFSET 0x00000000 #define BDW_DRAM_SIZE (640 * 1024) -static int is_iram(struct image *image, Elf32_Shdr *section) -{ +static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; - uint32_t start, end; + uint32_t start, end, base, size; + int i; start = section->vaddr; end = section->vaddr + section->size; - if (start < adsp->iram_base) - return 0; - if (start >= adsp->iram_base + adsp->iram_size) - return 0; - if (end > adsp->iram_base + adsp->iram_size) - return 0; - return 1; -} - -static int is_dram(struct image *image, Elf32_Shdr *section) -{ - const struct adsp *adsp = image->adsp; - uint32_t start, end; - - start = section->vaddr; - end = section->vaddr + section->size; + for (i = SOF_FW_BLK_TYPE_START; i < SOF_FW_BLK_TYPE_NUM; i++) { + base = adsp->mem_zones[i].base; + size = adsp->mem_zones[i].size; - if (start < adsp->dram_base) - return 0; - if (start >= adsp->dram_base + adsp->dram_size) - return 0; - if (end > adsp->dram_base + adsp->dram_size) - return 0; - return 1; + if (start < base) + continue; + if (start >= base + size) + continue; + if (end > base + size) + continue; + return i; + } + return SOF_FW_BLK_TYPE_INVALID; } static int block_idx; @@ -97,14 +86,11 @@ static int write_block(struct image *image, struct module *module, block.size += padding; } - if (is_iram(image, section)) { - block.type = SOF_FW_BLK_TYPE_IRAM; - block.offset = section->vaddr - adsp->iram_base - + adsp->host_iram_offset; - } else if (is_dram(image, section)) { - block.type = SOF_FW_BLK_TYPE_DRAM; - block.offset = section->vaddr - adsp->dram_base - + adsp->host_dram_offset; + ret = get_mem_zone_type(image, section); + if (ret != SOF_FW_BLK_TYPE_INVALID) { + block.type = ret; + block.offset = section->vaddr - adsp->mem_zones[ret].base + + adsp->mem_zones[ret].host_offset; } else { fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", section->vaddr, section->size); @@ -472,60 +458,90 @@ int write_logs_dictionary(struct image *image) const struct adsp machine_byt = { .name = "byt", - .iram_base = BYT_IRAM_BASE, - .iram_size = BYT_IRAM_SIZE, - .host_iram_offset = BYT_IRAM_HOST_OFFSET, - .dram_base = BYT_DRAM_BASE, - .dram_size = BYT_DRAM_SIZE, - .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BYT_IRAM_BASE, + .size = BYT_IRAM_SIZE, + .host_offset = BYT_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BYT_DRAM_BASE, + .size = BYT_DRAM_SIZE, + .host_offset = BYT_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_BAYTRAIL, .write_firmware = simple_write_firmware, }; const struct adsp machine_cht = { .name = "cht", - .iram_base = BYT_IRAM_BASE, - .iram_size = BYT_IRAM_SIZE, - .host_iram_offset = BYT_IRAM_HOST_OFFSET, - .dram_base = BYT_DRAM_BASE, - .dram_size = BYT_DRAM_SIZE, - .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BYT_IRAM_BASE, + .size = BYT_IRAM_SIZE, + .host_offset = BYT_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BYT_DRAM_BASE, + .size = BYT_DRAM_SIZE, + .host_offset = BYT_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_CHERRYTRAIL, .write_firmware = simple_write_firmware, }; const struct adsp machine_bsw = { .name = "bsw", - .iram_base = BYT_IRAM_BASE, - .iram_size = BYT_IRAM_SIZE, - .host_iram_offset = BYT_IRAM_HOST_OFFSET, - .dram_base = BYT_DRAM_BASE, - .dram_size = BYT_DRAM_SIZE, - .host_dram_offset = BYT_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BYT_IRAM_BASE, + .size = BYT_IRAM_SIZE, + .host_offset = BYT_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BYT_DRAM_BASE, + .size = BYT_DRAM_SIZE, + .host_offset = BYT_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_BRASWELL, .write_firmware = simple_write_firmware, }; const struct adsp machine_hsw = { .name = "hsw", - .iram_base = HSW_IRAM_BASE, - .iram_size = HSW_IRAM_SIZE, - .host_iram_offset = HSW_IRAM_HOST_OFFSET, - .dram_base = HSW_DRAM_BASE, - .dram_size = HSW_DRAM_SIZE, - .host_dram_offset = HSW_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = HSW_IRAM_BASE, + .size = HSW_IRAM_SIZE, + .host_offset = HSW_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = HSW_DRAM_BASE, + .size = HSW_DRAM_SIZE, + .host_offset = HSW_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_HASWELL, .write_firmware = simple_write_firmware, }; const struct adsp machine_bdw = { .name = "bdw", - .iram_base = BDW_IRAM_BASE, - .iram_size = BDW_IRAM_SIZE, - .host_iram_offset = BDW_IRAM_HOST_OFFSET, - .dram_base = BDW_DRAM_BASE, - .dram_size = BDW_DRAM_SIZE, - .host_dram_offset = BDW_DRAM_HOST_OFFSET, + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = BDW_IRAM_BASE, + .size = BDW_IRAM_SIZE, + .host_offset = BDW_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = BDW_DRAM_BASE, + .size = BDW_DRAM_SIZE, + .host_offset = BDW_DRAM_HOST_OFFSET, + }, + }, .machine_id = MACHINE_BROADWELL, .write_firmware = simple_write_firmware, }; diff --git a/rimage/manifest.c b/rimage/manifest.c index 33d8abf542f7..3ba3286dbed1 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -35,11 +35,15 @@ static int man_open_rom_file(struct image *image) { + uint32_t size; + sprintf(image->out_rom_file, "%s.rom", image->out_file); unlink(image->out_rom_file); + size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + /* allocate ROM image */ - image->rom_image = calloc(image->adsp->rom_size, 1); + image->rom_image = calloc(size, 1); if (image->rom_image == NULL) return -ENOMEM; @@ -1099,10 +1103,16 @@ static int man_write_fw_meu_v1_8(struct image *image) /* list of supported adsp */ const struct adsp machine_apl = { .name = "apl", - .rom_base = ADSP_APL_DSP_ROM_BASE, - .rom_size = ADSP_APL_DSP_ROM_SIZE, - .sram_base = APL_DSP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_APL_DSP_ROM_BASE, + .size = ADSP_APL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = APL_DSP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_APOLLOLAKE, @@ -1113,10 +1123,16 @@ const struct adsp machine_apl = { const struct adsp machine_kbl = { .name = "kbl", - .rom_base = ADSP_KBL_DSP_ROM_BASE, - .rom_size = ADSP_KBL_DSP_ROM_SIZE, - .sram_base = KBL_DSP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_KBL_DSP_ROM_BASE, + .size = ADSP_KBL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = KBL_DSP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_KABYLAKE, @@ -1127,10 +1143,16 @@ const struct adsp machine_kbl = { const struct adsp machine_skl = { .name = "skl", - .rom_base = ADSP_SKL_DSP_ROM_BASE, - .rom_size = ADSP_SKL_DSP_ROM_SIZE, - .sram_base = SKL_DSP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_SKL_DSP_ROM_BASE, + .size = ADSP_SKL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = SKL_DSP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SKYLAKE, @@ -1141,12 +1163,20 @@ const struct adsp machine_skl = { const struct adsp machine_cnl = { .name = "cnl", - .rom_base = ADSP_CNL_DSP_ROM_BASE, - .rom_size = ADSP_CNL_DSP_ROM_SIZE, - .imr_base = CNL_DSP_IMR_BASE_ENTRY, - .imr_size = 0x100000, - .sram_base = CNL_DSP_HP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_CNL_DSP_ROM_BASE, + .size = ADSP_CNL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = CNL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = CNL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_CANNONLAKE, @@ -1157,12 +1187,20 @@ const struct adsp machine_cnl = { const struct adsp machine_icl = { .name = "icl", - .rom_base = ADSP_ICL_DSP_ROM_BASE, - .rom_size = ADSP_ICL_DSP_ROM_SIZE, - .imr_base = ICL_DSP_IMR_BASE_ENTRY, - .imr_size = 0x100000, - .sram_base = ICL_DSP_HP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_ICL_DSP_ROM_BASE, + .size = ADSP_ICL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = ICL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = ICL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_ICELAKE, @@ -1173,12 +1211,20 @@ const struct adsp machine_icl = { const struct adsp machine_sue = { .name = "sue", - .rom_base = ADSP_SUE_DSP_ROM_BASE, - .rom_size = ADSP_SUE_DSP_ROM_SIZE, - .imr_base = SUE_DSP_IMR_BASE_ENTRY, - .imr_size = 0x100000, - .sram_base = SUE_DSP_HP_BASE_ENTRY, - .sram_size = 0x100000, + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_SUE_DSP_ROM_BASE, + .size = ADSP_SUE_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = SUE_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = SUE_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_SUECREEK, diff --git a/rimage/rimage.h b/rimage/rimage.h index 4f294fc082cf..1b94a861ebf8 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -24,6 +24,7 @@ #include #include #include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define MAX_MODULES 32 @@ -129,23 +130,18 @@ struct image { char out_unsigned_file[256]; }; +struct mem_zone { + uint32_t base; + uint32_t size; + uint32_t host_offset; +}; + /* * Audio DSP descriptor and operations. */ struct adsp { const char *name; - uint32_t iram_base; - uint32_t iram_size; - uint32_t dram_base; - uint32_t dram_size; - uint32_t sram_base; - uint32_t sram_size; - uint32_t host_iram_offset; - uint32_t host_dram_offset; - uint32_t rom_base; - uint32_t rom_size; - uint32_t imr_base; - uint32_t imr_size; + struct mem_zone mem_zones[SOF_FW_BLK_TYPE_NUM]; uint32_t image_size; uint32_t dram_offset; From 57d567c2e5f0ca5b99f84d03b36a0e60acd59633 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Tue, 5 Mar 2019 13:05:30 +0100 Subject: [PATCH 059/639] rimage: make a "Module reading" view similar to "Module writing" view Size column in both cases instread of Bytes and Size Hex view in both cases instead of Dec and Hex Signed-off-by: Adrian Bonislawski --- rimage/elf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 6abd23b17f5a..88698816b1df 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -350,7 +350,7 @@ static void elf_module_limits(struct image *image, struct module *module) fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.shnum); - fprintf(stdout, "\tNo\tStart\t\tEnd\t\tBytes\tType\tName\n"); + fprintf(stdout, "\tNo\tStart\t\tEnd\t\tSize\tType\tName\n"); /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.shnum; i++) { @@ -372,7 +372,7 @@ static void elf_module_limits(struct image *image, struct module *module) continue; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t%d", i, + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x", i, section->vaddr, section->vaddr + section->size, section->size); From 842b860367065ef98b0284830c41f0f2e2c5c3ef Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 12:52:50 +0200 Subject: [PATCH 060/639] rimage: Fix code alignment and indentation issues This was reported by checkpatch.pl and makes code easier to read. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 18 ++++++++--------- rimage/file_simple.c | 18 ++++++++--------- rimage/manifest.c | 47 ++++++++++++++++++++++---------------------- rimage/pkcs1_5.c | 4 ++-- rimage/plat_auth.c | 2 +- 5 files changed, 45 insertions(+), 44 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 88698816b1df..598b891e4d07 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -55,7 +55,7 @@ static int elf_read_sections(struct image *image, struct module *module) module->strings = calloc(1, section[hdr->shstrndx].size); if (!module->strings) { fprintf(stderr, "error: failed %s to read ELF strings for %d\n", - module->elf_file, -errno); + module->elf_file, -errno); return -errno; } @@ -259,7 +259,7 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) } static void elf_module_size(struct image *image, struct module *module, - Elf32_Shdr *section, int index) + Elf32_Shdr *section, int index) { switch (section->type) { case SHT_PROGBITS: @@ -391,7 +391,7 @@ static void elf_module_limits(struct image *image, struct module *module) /* make sure no section overlap from any modules */ int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section, int index) + Elf32_Shdr *section, int index) { struct module *m; Elf32_Shdr *s; @@ -418,15 +418,15 @@ int elf_validate_section(struct image *image, struct module *module, /* is section start non overlapping ? */ if (section->vaddr >= s->vaddr && - section->vaddr < - s->vaddr + s->size) { + section->vaddr < + s->vaddr + s->size) { goto err; } /* is section end non overlapping ? */ if (section->vaddr + section->size > s->vaddr && - section->vaddr + section->size <= - s->vaddr + s->size) { + section->vaddr + section->size <= + s->vaddr + s->size) { goto err; } } @@ -481,7 +481,7 @@ int elf_validate_modules(struct image *image) } int elf_find_section(struct image *image, struct module *module, - const char *name) + const char *name) { Elf32_Ehdr *hdr = &module->hdr; Elf32_Shdr *section, *s; @@ -546,7 +546,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) module->fd = fopen(name, "rb"); if (module->fd == NULL) { fprintf(stderr, "error: unable to open %s for reading %d\n", - name, errno); + name, errno); return -EINVAL; } module->elf_file = name; diff --git a/rimage/file_simple.c b/rimage/file_simple.c index bef7623df841..207b84fcc82b 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -70,7 +70,7 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { static int block_idx; static int write_block(struct image *image, struct module *module, - Elf32_Shdr *section) + Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; struct snd_sof_blk_hdr block; @@ -170,14 +170,14 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); + module->text_start, module->text_end, + module->text_end - module->text_start); fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); + module->data_start, module->data_end, + module->data_end - module->data_start); fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module->bss_start, module->bss_end, + module->bss_end - module->bss_start); fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); @@ -418,7 +418,7 @@ int write_logs_dictionary(struct image *image) header.data_length = section->size; fwrite(&header, sizeof(struct snd_sof_logs_header), 1, - image->ldc_out_fd); + image->ldc_out_fd); buffer = calloc(1, section->size); if (!buffer) @@ -435,7 +435,7 @@ int write_logs_dictionary(struct image *image) goto out; } count = fwrite(buffer, 1, section->size, - image->ldc_out_fd); + image->ldc_out_fd); if (count != section->size) { fprintf(stderr, "error: can't write section %d\n", -errno); diff --git a/rimage/manifest.c b/rimage/manifest.c index 3ba3286dbed1..f2a46bc5ea52 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -51,7 +51,7 @@ static int man_open_rom_file(struct image *image) image->out_rom_fd = fopen(image->out_rom_file, "wb"); if (image->out_rom_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_rom_file, errno); + image->out_rom_file, errno); } return 0; @@ -66,7 +66,7 @@ static int man_open_unsigned_file(struct image *image) image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); if (image->out_unsigned_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_unsigned_file, errno); + image->out_unsigned_file, errno); } return 0; @@ -81,7 +81,7 @@ static int man_open_manifest_file(struct image *image) image->out_man_fd = fopen(image->out_man_file, "wb"); if (image->out_man_fd == NULL) { fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_man_file, errno); + image->out_man_file, errno); } return 0; @@ -130,8 +130,9 @@ static int man_init_image_v1_8(struct image *image) /* we should call this after all segments size set up via iterate */ static uint32_t elf_to_file_offset(struct image *image, - struct module *module, struct sof_man_module *man_module, - Elf32_Shdr *section) + struct module *module, + struct sof_man_module *man_module, + Elf32_Shdr *section) { uint32_t elf_addr = section->vaddr, file_offset = 0; @@ -156,8 +157,9 @@ static uint32_t elf_to_file_offset(struct image *image, /* write SRAM sections */ static int man_copy_sram(struct image *image, Elf32_Shdr *section, - struct module *module, struct sof_man_module *man_module, - int section_idx) + struct module *module, + struct sof_man_module *man_module, + int section_idx) { uint32_t offset = elf_to_file_offset(image, module, man_module, section); @@ -185,7 +187,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, * the smallest offset of its modules ATM. */ if (man_module->segment[seg_type].file_offset > offset || - man_module->segment[seg_type].file_offset == 0) + man_module->segment[seg_type].file_offset == 0) man_module->segment[seg_type].file_offset = offset; count = fread(buffer, 1, section->size, module->fd); @@ -206,7 +208,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, } static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, - struct module *module, struct sof_man_module *man_module, int idx) + struct module *module, + struct sof_man_module *man_module, int idx) { int ret; @@ -225,7 +228,7 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, } static int man_get_module_manifest(struct image *image, struct module *module, - struct sof_man_module *man_module) + struct sof_man_module *man_module) { Elf32_Shdr *section; struct sof_man_segment_desc *segment; @@ -249,7 +252,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* module built using xcc has preceding bytes */ if (section->size > sizeof(sof_mod)) ret = fseek(module->fd, - section->off + XCC_MOD_OFFSET, SEEK_SET); + section->off + XCC_MOD_OFFSET, SEEK_SET); else ret = fseek(module->fd, section->off, SEEK_SET); @@ -362,7 +365,7 @@ static int man_module_validate(struct sof_man_module *man_module) } static int man_module_create(struct image *image, struct module *module, - struct sof_man_module *man_module) + struct sof_man_module *man_module) { /* create module and segments */ uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -461,7 +464,7 @@ static int man_module_create(struct image *image, struct module *module, /* text or data section */ if (!elf_is_rom(image, section)) err = man_copy_elf_section(image, section, module, - man_module, i); + man_module, i); if (err < 0) { fprintf(stderr, "error: failed to write section #%d\n", i); @@ -492,7 +495,7 @@ static int man_module_create(struct image *image, struct module *module, } static int man_module_create_reloc(struct image *image, struct module *module, - struct sof_man_module *man_module) + struct sof_man_module *man_module) { /* create module and segments */ int err; @@ -582,14 +585,14 @@ static int man_module_create_reloc(struct image *image, struct module *module, } static int man_write_unsigned_mod(struct image *image, int meta_start_offset, - int meta_end_offset) + int meta_end_offset) { int count; /* write metadata file for unsigned FW */ count = fwrite(image->fw_image + meta_start_offset, - sizeof(struct sof_man_adsp_meta_file_ext), 1, - image->out_man_fd); + sizeof(struct sof_man_adsp_meta_file_ext), 1, + image->out_man_fd); /* did the metadata/manifest write succeed ? */ if (count != 1) { @@ -601,8 +604,8 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, /* now prepare the unsigned rimage */ count = fwrite(image->fw_image + meta_end_offset, - image->image_end - meta_end_offset, - 1, image->out_unsigned_fd); + image->image_end - meta_end_offset, + 1, image->out_unsigned_fd); /* did the unsigned FW write succeed ? */ if (count != 1) { @@ -620,9 +623,7 @@ static int man_write_fw_mod(struct image *image) int count; /* write manifest and signed image */ - count = fwrite(image->fw_image, - image->image_end, - 1, image->out_fd); + count = fwrite(image->fw_image, image->image_end, 1, image->out_fd); /* did the image write succeed ? */ if (count != 1) { @@ -648,7 +649,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, module = &image->module[0]; fprintf(stdout, "Module: %s used as executable header\n", - module->elf_file); + module->elf_file); module->exec_header = 1; /* set module file offset */ diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 76d309ee5dfb..2872d3dc08d7 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -221,8 +221,8 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* sign the manifest */ ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css.signature, - &siglen, priv_rsa); + (unsigned char *)man->css.signature, + &siglen, priv_rsa); if (ret < 0) fprintf(stderr, "error: failed to sign manifest\n"); diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 522732c24c59..54061b86caa2 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -19,7 +19,7 @@ #include "plat_auth.h" void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, - int meta_end_offset) + int meta_end_offset) { struct sof_man_adsp_meta_file_ext *meta = image->fw_image + meta_start_offset; From 97ec5bac809ab55d5659d128167b83dd9f28a153 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 13:09:42 +0200 Subject: [PATCH 061/639] rimage: Remove explicit comparisons to NULL in the rimage/*.c files Comparisons to NULL are now implicit as the checkpatch.pl requires. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 8 ++++---- rimage/file_simple.c | 2 +- rimage/hash.c | 2 +- rimage/manifest.c | 12 ++++++------ rimage/pkcs1_5.c | 10 +++++----- rimage/rimage.c | 8 ++++---- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 598b891e4d07..f12808374f55 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -39,7 +39,7 @@ static int elf_read_sections(struct image *image, struct module *module) /* allocate space for each section header */ section = calloc(sizeof(Elf32_Shdr), hdr->shnum); - if (section == NULL) + if (!section) return -ENOMEM; module->section = section; @@ -164,7 +164,7 @@ static int elf_read_programs(struct image *image, struct module *module) /* allocate space for programs */ prg = calloc(sizeof(Elf32_Phdr), hdr->phnum); - if (prg == NULL) + if (!prg) return -ENOMEM; module->prg = prg; @@ -493,7 +493,7 @@ int elf_find_section(struct image *image, struct module *module, /* alloc data data */ buffer = calloc(1, section->size); - if (buffer == NULL) + if (!buffer) return -ENOMEM; /* read in section string data */ @@ -544,7 +544,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) /* open the elf input file */ module->fd = fopen(name, "rb"); - if (module->fd == NULL) { + if (!module->fd) { fprintf(stderr, "error: unable to open %s for reading %d\n", name, errno); return -EINVAL; diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 207b84fcc82b..f58f8a019020 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -104,7 +104,7 @@ static int write_block(struct image *image, struct module *module, /* alloc data data */ buffer = calloc(1, section->size); - if (buffer == NULL) + if (!buffer) return -ENOMEM; /* read in section data */ diff --git a/rimage/hash.c b/rimage/hash.c index 73b6d72dfab2..7888c72471e5 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -38,7 +38,7 @@ static void *OPENSSL_zalloc(size_t num) { void *ret = OPENSSL_malloc(num); - if (ret != NULL) + if (ret) memset(ret, 0, num); return ret; } diff --git a/rimage/manifest.c b/rimage/manifest.c index f2a46bc5ea52..53b2733a3347 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -44,12 +44,12 @@ static int man_open_rom_file(struct image *image) /* allocate ROM image */ image->rom_image = calloc(size, 1); - if (image->rom_image == NULL) + if (!image->rom_image) return -ENOMEM; /* open ROM outfile for writing */ image->out_rom_fd = fopen(image->out_rom_file, "wb"); - if (image->out_rom_fd == NULL) { + if (!image->out_rom_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_rom_file, errno); } @@ -64,7 +64,7 @@ static int man_open_unsigned_file(struct image *image) /* open unsigned FW outfile for writing */ image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); - if (image->out_unsigned_fd == NULL) { + if (!image->out_unsigned_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_unsigned_file, errno); } @@ -79,7 +79,7 @@ static int man_open_manifest_file(struct image *image) unlink(image->out_man_file); image->out_man_fd = fopen(image->out_man_file, "wb"); - if (image->out_man_fd == NULL) { + if (!image->out_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_man_file, errno); } @@ -119,7 +119,7 @@ static int man_init_image_v1_8(struct image *image) { /* allocate image and copy template manifest */ image->fw_image = calloc(image->adsp->image_size, 1); - if (image->fw_image == NULL) + if (!image->fw_image) return -ENOMEM; memcpy(image->fw_image, image->adsp->man_v1_8, @@ -1013,7 +1013,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* allocate image */ image->fw_image = calloc(image->adsp->image_size, 1); - if (image->fw_image == NULL) { + if (!image->fw_image) { ret = -ENOMEM; goto err; } diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 2872d3dc08d7..d72cc9f6f651 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -37,11 +37,11 @@ void RSA_get0_key(const RSA *r, void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { - if (n != NULL) + if (n) *n = r->n; - if (e != NULL) + if (e) *e = r->e; - if (d != NULL) + if (d) *d = r->d; } #endif @@ -180,7 +180,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* create new key */ privkey = EVP_PKEY_new(); - if (privkey == NULL) + if (!privkey) return -ENOMEM; /* load in RSA private key from PEM file */ @@ -191,7 +191,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); - if (fp == NULL) { + if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); return -errno; diff --git a/rimage/rimage.c b/rimage/rimage.c index 807939b8fda0..46e14c30977c 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -93,10 +93,10 @@ int main(int argc, char *argv[]) elf_argc = optind; /* make sure we have an outfile and machine */ - if (image.out_file == NULL || mach == NULL) + if (!image.out_file || !mach) usage(argv[0]); - if (image.ldc_out_file == NULL) + if (!image.ldc_out_file) image.ldc_out_file = "out.ldc"; /* find machine */ @@ -133,7 +133,7 @@ int main(int argc, char *argv[]) /* open outfile for writing */ unlink(image.out_file); image.out_fd = fopen(image.out_file, "wb"); - if (image.out_fd == NULL) { + if (!image.out_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.out_file, errno); ret = -EINVAL; @@ -148,7 +148,7 @@ int main(int argc, char *argv[]) unlink(image.ldc_out_file); image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); - if (image.ldc_out_fd == NULL) { + if (!image.ldc_out_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image.ldc_out_file, errno); ret = -EINVAL; From 7a802599ab83391f41ed2a30cb4fc89a8eee11a6 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 13:23:00 +0200 Subject: [PATCH 062/639] rimage: Remove blank lines before/after braces Blank lines aren't necessary after/before open or closed braces. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 4 ---- rimage/file_simple.c | 1 - rimage/man_apl.c | 2 -- rimage/man_cnl.c | 2 -- rimage/man_sue.c | 1 - rimage/manifest.c | 4 ---- 6 files changed, 14 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index f12808374f55..067e6b578ac0 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -99,7 +99,6 @@ static int elf_read_sections(struct image *image, struct module *module) /* parse each section */ for (i = 0; i < hdr->shnum; i++) { - /* only write valid sections */ if (!(section[i].flags & valid)) continue; @@ -178,7 +177,6 @@ static int elf_read_programs(struct image *image, struct module *module) /* check each program */ for (i = 0; i < hdr->phnum; i++) { - if (prg[i].filesz == 0) continue; @@ -354,13 +352,11 @@ static void elf_module_limits(struct image *image, struct module *module) /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; /* module bss can sometimes be missed */ if (i != module->bss_index && i != module->logs_index && i != module->fw_ready_index) { - /* only check valid sections */ if (!(section->flags & valid)) continue; diff --git a/rimage/file_simple.c b/rimage/file_simple.c index f58f8a019020..109d7ddd9f10 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -182,7 +182,6 @@ static int simple_write_module(struct image *image, struct module *module) fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; /* only write valid sections */ diff --git a/rimage/man_apl.c b/rimage/man_apl.c index f7f1d25f3a13..d03aa54aeb72 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -19,7 +19,6 @@ /* manifest template */ struct fw_image_manifest_v1_8 apl_manifest = { - .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, .nb_entries = MAN_CSE_PARTS, @@ -86,7 +85,6 @@ struct fw_image_manifest_v1_8 apl_manifest = { }, .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, .ext_len = sizeof(struct partition_info_ext), diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 7142fd26386a..545edb98ff47 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -19,7 +19,6 @@ /* manifest template */ struct fw_image_manifest_v1_8 cnl_manifest = { - .cse_partition_dir_header = { .header_marker = CSE_HEADER_MAKER, .nb_entries = MAN_CSE_PARTS, @@ -85,7 +84,6 @@ struct fw_image_manifest_v1_8 cnl_manifest = { }, .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, .ext_len = sizeof(struct partition_info_ext), diff --git a/rimage/man_sue.c b/rimage/man_sue.c index 741fd0b26a04..0c15157b75a3 100644 --- a/rimage/man_sue.c +++ b/rimage/man_sue.c @@ -19,7 +19,6 @@ /* manifest template */ struct fw_image_manifest_v1_5_sue sue_manifest = { - .desc = { .header = { .header_id = SOF_MAN_FW_HDR_ID, diff --git a/rimage/manifest.c b/rimage/manifest.c index 53b2733a3347..78ffd1899b0d 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -145,7 +145,6 @@ static uint32_t elf_to_file_offset(struct image *image, /* rodata segment, append to text segment */ file_offset = elf_addr - module->data_start + module->foffset + module->text_fixup_size; - } } else if (section->type == SHT_NOBITS) { /* bss segment */ @@ -330,13 +329,11 @@ static int man_module_validate(struct sof_man_module *man_module) int i, j; for (i = 0; i < 3; i++) { - istart = man_module->segment[i].v_base_addr; iend = istart + man_module->segment[i].flags.r.length * MAN_PAGE_SIZE; for (j = 0; j < 3; j++) { - /* don't validate segment against itself */ if (i == j) continue; @@ -451,7 +448,6 @@ static int man_module_create(struct image *image, struct module *module, /* find all sections and copy to corresponding segments */ for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; /* only check valid sections */ From a97804f9e9138c6d6587dcf8c2088194ccab4adb Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 14:45:39 +0200 Subject: [PATCH 063/639] rimage: Split lines over 80 characters Change long lines so they don't exceed 80 characters. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 37 ++++++++++++++++++++----------------- rimage/file_simple.c | 12 ++++++++---- rimage/hash.c | 3 ++- rimage/manifest.c | 10 ++++++---- rimage/pkcs1_5.c | 3 ++- 5 files changed, 38 insertions(+), 27 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 067e6b578ac0..45e47659fa04 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -127,20 +127,20 @@ static int elf_read_sections(struct image *image, struct module *module) if (!image->verbose) continue; - fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", module->elf_file, - i, section[i].type); - fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", module->elf_file, - i, section[i].flags); - fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", module->elf_file, - i, section[i].vaddr); - fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", module->elf_file, - i, section[i].off); - fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", module->elf_file, - i, section[i].size); - fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", module->elf_file, - i, section[i].link); - fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", module->elf_file, - i, section[i].info); + fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", + module->elf_file, i, section[i].type); + fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", + module->elf_file, i, section[i].flags); + fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", + module->elf_file, i, section[i].vaddr); + fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", + module->elf_file, i, section[i].off); + fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", + module->elf_file, i, section[i].size); + fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", + module->elf_file, i, section[i].link); + fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", + module->elf_file, i, section[i].info); } return 0; @@ -267,7 +267,8 @@ static void elf_module_size(struct image *image, struct module *module, if (module->text_start > section->vaddr) module->text_start = section->vaddr; if (module->text_end < section->vaddr + section->size) - module->text_end = section->vaddr + section->size; + module->text_end = section->vaddr + + section->size; fprintf(stdout, "\tTEXT\t"); } else { @@ -275,7 +276,8 @@ static void elf_module_size(struct image *image, struct module *module, if (module->data_start > section->vaddr) module->data_start = section->vaddr; if (module->data_end < section->vaddr + section->size) - module->data_end = section->vaddr + section->size; + module->data_end = section->vaddr + + section->size; fprintf(stdout, "\tDATA\t"); } @@ -501,7 +503,8 @@ int elf_find_section(struct image *image, struct module *module, count = fread(buffer, 1, section->size, module->fd); if (count != section->size) { - fprintf(stderr, "error: can't read string section %d\n", -errno); + fprintf(stderr, "error: can't read string section %d\n", + -errno); ret = -errno; goto out; } diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 109d7ddd9f10..d546144fb46d 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -194,7 +194,8 @@ static int simple_write_module(struct image *image, struct module *module) err = write_block(image, module, section); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", + i); return err; } /* write_block will return padding size */ @@ -328,7 +329,8 @@ static int simple_write_firmware(struct image *image) module = &image->module[i]; module->fw_size += sizeof(struct snd_sof_blk_hdr) * (module->num_sections - module->num_bss); - module->fw_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; + module->fw_size += sizeof(struct snd_sof_mod_hdr) * + hdr.num_modules; hdr.file_size += module->fw_size; } @@ -411,7 +413,8 @@ int write_logs_dictionary(struct image *image) } if (module->logs_index > 0) { - Elf32_Shdr *section = &module->section[module->logs_index]; + Elf32_Shdr *section = + &module->section[module->logs_index]; header.base_address = section->vaddr; header.data_length = section->size; @@ -436,7 +439,8 @@ int write_logs_dictionary(struct image *image) count = fwrite(buffer, 1, section->size, image->ldc_out_fd); if (count != section->size) { - fprintf(stderr, "error: can't write section %d\n", + fprintf(stderr, + "error: can't write section %d\n", -errno); ret = -errno; goto out; diff --git a/rimage/hash.c b/rimage/hash.c index 7888c72471e5..18e2d41e44d6 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -90,7 +90,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash) #endif } -void ri_hash(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) +void ri_hash(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) { module_sha256_create(image); module_sha256_update(image, image->fw_image + offset, size); diff --git a/rimage/manifest.c b/rimage/manifest.c index 78ffd1899b0d..217058080131 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -430,7 +430,8 @@ static int man_module_create(struct image *image, struct module *module, /* bss is last */ man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = module->bss_start; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = + module->bss_start; pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) pages += 1; @@ -463,7 +464,8 @@ static int man_module_create(struct image *image, struct module *module, man_module, i); if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", i); + fprintf(stderr, "error: failed to write section #%d\n", + i); return err; } } @@ -811,8 +813,8 @@ static int man_write_fw_v1_5_sue(struct image *image) m->desc.header.preload_page_count = preload_size / MAN_PAGE_SIZE; fprintf(stdout, "Firmware file size 0x%x page count %d\n", - FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + image->image_end, - m->desc.header.preload_page_count); + FILE_TEXT_OFFSET_V1_5_SUE - MAN_DESC_OFFSET_V1_5_SUE + + image->image_end, m->desc.header.preload_page_count); /* calculate hash for each module */ man_hash_modules(image, &m->desc); diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index d72cc9f6f651..23ac4b517bac 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -168,7 +168,8 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, EVP_PKEY *privkey; FILE *fp; const BIGNUM *n, *e, *d; - unsigned char digest[SHA256_DIGEST_LENGTH], mod[MAN_RSA_KEY_MODULUS_LEN]; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; int ret = -EINVAL, i; From f9556455f168dcc3d74e3dec7264215f019b5c74 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 14:52:19 +0200 Subject: [PATCH 064/639] rimage: elf: Break down multiple assignment Multiple assignment should be avoided. Signed-off-by: Diana Ungureanu --- rimage/elf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 45e47659fa04..9aeb89abf018 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -343,9 +343,12 @@ static void elf_module_limits(struct image *image, struct module *module) uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i; - module->text_start = module->data_start = 0xffffffff; + module->text_start = 0xffffffff; + module->data_start = 0xffffffff; module->bss_start = 0; - module->text_end = module->data_end = module->bss_end = 0; + module->text_end = 0; + module->data_end = 0; + module->bss_end = 0; fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.shnum); From 2861df6cadd5eb9a71aff23334d1dbe1efd0f48e Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 14:56:05 +0200 Subject: [PATCH 065/639] rimage: Remove multiple blank lines Signed-off-by: Diana Ungureanu --- rimage/file_simple.c | 1 - rimage/hash.c | 1 - rimage/manifest.c | 1 - 3 files changed, 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index d546144fb46d..97439962f677 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -13,7 +13,6 @@ * more details. */ - #include #include #include diff --git a/rimage/hash.c b/rimage/hash.c index 18e2d41e44d6..24555bf880f2 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -55,7 +55,6 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) } #endif - #define DEBUG_HASH 0 void module_sha256_create(struct image *image) diff --git a/rimage/manifest.c b/rimage/manifest.c index 217058080131..fb58a5f5dbea 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -15,7 +15,6 @@ * Janusz Jankowski */ - #include #include #include From 8902341a347d2e10268a002bfbd3bf9c70f950be Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:02:48 +0200 Subject: [PATCH 066/639] rimage: file_simple: Move open brace to next line Open brace '{' following function declaration get_mem_zone_type goes on the next line. Signed-off-by: Diana Ungureanu --- rimage/file_simple.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 97439962f677..fdeb0be54e4b 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -43,7 +43,8 @@ #define BDW_DRAM_HOST_OFFSET 0x00000000 #define BDW_DRAM_SIZE (640 * 1024) -static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { +static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) +{ const struct adsp *adsp = image->adsp; uint32_t start, end, base, size; int i; From d4949bf42f66c7f52df13fb2e4aff2d70e562f69 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:05:14 +0200 Subject: [PATCH 067/639] rimage: file_simple: Remove unnecessary spaces after cast Signed-off-by: Diana Ungureanu --- rimage/file_simple.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index fdeb0be54e4b..64bbc0c937cc 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -362,8 +362,8 @@ static int simple_write_firmware(struct image *image) return -errno; fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", - (long) (hdr.file_size + sizeof(hdr)), - (long) (hdr.file_size + sizeof(hdr)), + (long)(hdr.file_size + sizeof(hdr)), + (long)(hdr.file_size + sizeof(hdr)), hdr.num_modules); return 0; @@ -449,7 +449,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", - (unsigned long) sizeof(header.version)); + (unsigned long)sizeof(header.version)); } } out: From bb795aeb2044aaec79b061ddc282683f7f041ae8 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:09:02 +0200 Subject: [PATCH 068/639] rimage: Align block comments on each line Signed-off-by: Diana Ungureanu --- rimage/manifest.c | 4 ++-- rimage/pkcs1_5.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index fb58a5f5dbea..1841b525916d 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -182,8 +182,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, } /* file_offset for segment should not be 0s, we set it to - * the smallest offset of its modules ATM. - */ + * the smallest offset of its modules ATM. + */ if (man_module->segment[seg_type].file_offset > offset || man_module->segment[seg_type].file_offset == 0) man_module->segment[seg_type].file_offset = offset; diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 23ac4b517bac..957a160586db 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -65,7 +65,7 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) * #1-v1_5 of the entire manifest structure, including all * extensions, and excluding the last 3 fields of the * manifest header (Public Key, Exponent and Signature). -*/ + */ int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, From 30b456826a6a75f5fec0d9ca409441526fc119d7 Mon Sep 17 00:00:00 2001 From: Diana Ungureanu Date: Wed, 6 Mar 2019 15:10:23 +0200 Subject: [PATCH 069/639] rimage: manifest: Remove braces for single statement blocks Braces are unnecessary for single statement blocks. Signed-off-by: Diana Ungureanu --- rimage/manifest.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 1841b525916d..c9601c7d7c04 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -238,9 +238,8 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* find manifest module data */ man_section_idx = elf_find_section(image, module, ".module"); - if (man_section_idx < 0) { + if (man_section_idx < 0) return -EINVAL; - } fprintf(stdout, " Manifest module metadata section at index %d\n", man_section_idx); @@ -820,9 +819,8 @@ static int man_write_fw_v1_5_sue(struct image *image) /* write the firmware */ ret = man_write_fw_mod(image); - if (ret < 0) { + if (ret < 0) goto err; - } fprintf(stdout, "Firmware manifest and signing completed !\n"); return 0; From 167282bbbecc167dc8d4238fe5943a726bc9d0f9 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 11 Apr 2019 14:09:02 +0200 Subject: [PATCH 070/639] rimage: add option to set imr type Signed-off-by: Janusz Jankowski --- rimage/man_apl.c | 1 - rimage/man_cnl.c | 1 - rimage/manifest.h | 1 + rimage/rimage.c | 11 ++++++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/rimage/man_apl.c b/rimage/man_apl.c index d03aa54aeb72..ce634712cfe1 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -108,7 +108,6 @@ struct fw_image_manifest_v1_8 apl_manifest = { .adsp_file_ext = { .ext_type = 17, .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), - .imr_type = 3, .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 545edb98ff47..4bd08dff042e 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -107,7 +107,6 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .adsp_file_ext = { .ext_type = 17, .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), - .imr_type = 3, .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/manifest.h b/rimage/manifest.h index 6622f521aea5..c6624b82e982 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -42,6 +42,7 @@ #define MAN_DESC_OFFSET_V1_8 0x2000 #define MAN_DESC_OFFSET_V1_5 0x284 #define MAN_DESC_OFFSET_V1_5_SUE 0x2000 +#define MAN_DEFAULT_IMR_TYPE 3 #define MAN_CSS_HDR_OFFSET \ (MAN_CSE_HDR_OFFSET + \ diff --git a/rimage/rimage.c b/rimage/rimage.c index 46e14c30977c..8a64b421d2c3 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -45,6 +45,7 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); fprintf(stdout, "\t -p log dictionary outfile\n"); + fprintf(stdout, "\t -i set IMR type\n"); exit(0); } @@ -53,10 +54,11 @@ int main(int argc, char *argv[]) struct image image; const char *mach = NULL; int opt, ret, i, elf_argc = 0; + int imr_type = MAN_DEFAULT_IMR_TYPE; memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:r")) != -1) { + while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -82,6 +84,9 @@ int main(int argc, char *argv[]) case 'r': image.reloc = 1; break; + case 'i': + imr_type = atoi(optarg); + break; case 'h': usage(argv[0]); break; @@ -116,6 +121,10 @@ int main(int argc, char *argv[]) found: + /* set IMR Type in found machine definition */ + if (image.adsp->man_v1_8) + image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + /* parse input ELF files */ image.num_modules = argc - elf_argc; for (i = elf_argc; i < argc; i++) { From 91d1b29dc9fcccb92060f75dc1045831eb14ac21 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 14 May 2019 10:47:13 +0200 Subject: [PATCH 071/639] uapi: replace sof_man_get_module with SOF_MAN_MODULE_OFFSET Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index c9601c7d7c04..672a761b535f 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -641,7 +641,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, /* if first module is executable then write before manifest */ if (image->adsp->exec_boot_ldr) { - man_module = sof_man_get_module(desc, 0); + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(0); module = &image->module[0]; fprintf(stdout, "Module: %s used as executable header\n", @@ -661,7 +661,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, } for (; i < image->num_modules; i++) { - man_module = sof_man_get_module(desc, i - offset); + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i - offset); module = &image->module[i]; if (i == 0) @@ -688,7 +688,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) int i; for (i = 0; i < image->num_modules; i++) { - man_module = sof_man_get_module(desc, i); + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); if (image->adsp->exec_boot_ldr && i == 0) { fprintf(stdout, " module: no need to hash %s\n as its exec header\n", From a38e40057f887fa7dd3cd7e385cbd7dd6fbca9dd Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Sat, 2 Feb 2019 00:23:45 +0200 Subject: [PATCH 072/639] rimage: Add support for imx8 Signed-off-by: Daniel Baluta --- rimage/file_simple.c | 31 +++++++++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 34 insertions(+) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 64bbc0c937cc..486818288c32 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -43,6 +43,14 @@ #define BDW_DRAM_HOST_OFFSET 0x00000000 #define BDW_DRAM_SIZE (640 * 1024) +#define IMX8_IRAM_BASE 0x596f8000 +#define IMX8_IRAM_HOST_OFFSET 0x10000 +#define IMX8_IRAM_SIZE 0x800 +#define IMX8_DRAM_BASE 0x596e8000 +#define IMX8_DRAM_SIZE 0x8000 +#define IMX8_SRAM_BASE 0x92400000 +#define IMX8_SRAM_SIZE 0x800000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -548,3 +556,26 @@ const struct adsp machine_bdw = { .machine_id = MACHINE_BROADWELL, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8 = { + .name = "imx8", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8_IRAM_BASE, + .size = IMX8_IRAM_SIZE, + .host_offset = IMX8_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8_DRAM_BASE, + .size = IMX8_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8_SRAM_BASE, + .size = IMX8_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8, + .write_firmware = simple_write_firmware, +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index 8a64b421d2c3..ec0f3dbcf6d8 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -35,6 +35,7 @@ static const struct adsp *machine[] = { &machine_sue, &machine_kbl, &machine_skl, + &machine_imx8, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 1b94a861ebf8..184cadc46049 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -46,6 +46,7 @@ enum machine_id { MACHINE_CANNONLAKE, MACHINE_ICELAKE, MACHINE_SUECREEK, + MACHINE_IMX8, MACHINE_MAX }; @@ -193,6 +194,7 @@ extern const struct adsp machine_icl; extern const struct adsp machine_sue; extern const struct adsp machine_skl; extern const struct adsp machine_kbl; +extern const struct adsp machine_imx8; #endif From 9ce99db72e68d08870b3a5335815c9eb9277b7ad Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 31 May 2019 15:04:48 +0200 Subject: [PATCH 073/639] include: split uapi headers into more directories Some of interface headers are not needed by kernel, but are needed by user-space applications, so we can split them into multiple directories that indicate their purpose. Signed-off-by: Janusz Jankowski --- rimage/file_format.h | 4 ++-- rimage/manifest.c | 2 +- rimage/manifest.h | 2 +- rimage/rimage.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rimage/file_format.h b/rimage/file_format.h index 2ffdf0c68c61..7e66984ec1ea 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -63,8 +63,8 @@ #ifndef __INCLUDE_FILE_FORMAT_H__ #define __INCLUDE_FILE_FORMAT_H__ -#include -#include +#include +#include #define SND_SOF_LOGS_SIG_SIZE 4 #define SND_SOF_LOGS_SIG "Logs" diff --git a/rimage/manifest.c b/rimage/manifest.c index 672a761b535f..0ff51e169796 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include "rimage.h" #include "file_format.h" diff --git a/rimage/manifest.h b/rimage/manifest.h index c6624b82e982..7858d3199019 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -15,7 +15,7 @@ #define __MANIFEST_H__ #include -#include +#include #include "css.h" #include "cse.h" #include "plat_auth.h" diff --git a/rimage/rimage.h b/rimage/rimage.h index 184cadc46049..96d04292d8ce 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define MAX_MODULES 32 From bcf7e66f7d827906615e84ec785b03eb3747bbbf Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sat, 1 Jun 2019 17:44:07 +0200 Subject: [PATCH 074/639] rimage: add spdx identifier for elf.h Signed-off-by: Janusz Jankowski --- rimage/elf.h | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/rimage/elf.h b/rimage/elf.h index aae7d92bc078..a9a6505e7793 100644 --- a/rimage/elf.h +++ b/rimage/elf.h @@ -1,40 +1,8 @@ -/* - * Derived from: - * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ - * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ - * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ - * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ - * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ - * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ - * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ - * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ - * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ +/* SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. * Copyright (c) 2001 David E. O'Brien * Portions Copyright 2009 The Go Authors. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * */ /* From a44fb2c3d86a3061f8dbdd5efe786a2fccd88b08 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sat, 1 Jun 2019 20:01:02 +0200 Subject: [PATCH 075/639] rimage: change license to bsd Signed-off-by: Janusz Jankowski --- rimage/cse.c | 21 +++++------------- rimage/cse.h | 12 ++-------- rimage/css.c | 21 +++++------------- rimage/css.h | 12 ++-------- rimage/elf.c | 21 +++++------------- rimage/file_format.h | 53 +------------------------------------------- rimage/file_simple.c | 17 +++----------- rimage/hash.c | 21 +++++------------- rimage/man_apl.c | 15 +++---------- rimage/man_cnl.c | 15 +++---------- rimage/man_kbl.c | 15 +++---------- rimage/man_sue.c | 15 +++---------- rimage/manifest.c | 23 ++++++------------- rimage/manifest.h | 12 ++-------- rimage/pkcs1_5.c | 21 +++++------------- rimage/plat_auth.c | 21 +++++------------- rimage/plat_auth.h | 12 ++-------- rimage/rimage.c | 17 +++----------- rimage/rimage.h | 14 ++---------- 19 files changed, 72 insertions(+), 286 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index cdfbc87e6088..3524be4eae38 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include "rimage.h" diff --git a/rimage/cse.h b/rimage/cse.h index 28650dadec2b..d262fbafd481 100644 --- a/rimage/cse.h +++ b/rimage/cse.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __CSE_H__ diff --git a/rimage/css.c b/rimage/css.c index 2dafff0dea07..1e9de6d8bc86 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/css.h b/rimage/css.h index a1237dbe5af1..e322cbf68dfc 100644 --- a/rimage/css.h +++ b/rimage/css.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __CSS_H__ diff --git a/rimage/elf.c b/rimage/elf.c index 9aeb89abf018..755698dd9697 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/file_format.h b/rimage/file_format.h index 7e66984ec1ea..b0cea780d6f7 100644 --- a/rimage/file_format.h +++ b/rimage/file_format.h @@ -1,61 +1,10 @@ -/* - * This file is provided under a dual BSD/GPLv2 license. When using or - * redistributing this file, you may do so under either license. - * - * GPL LICENSE SUMMARY - * - * Copyright(c) 2017 Intel Corporation. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * The full GNU General Public License is included in this distribution - * in the file called LICENSE.GPL. - * - * BSD LICENSE +/* SPDX-License-Identifier: BSD-3-Clause * * Copyright(c) 2017 Intel Corporation. All rights reserved. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Intel Corporation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * Author: Liam Girdwood */ - /* * Firmware file format . */ diff --git a/rimage/file_simple.c b/rimage/file_simple.c index 486818288c32..be64c7d8aaa7 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -1,17 +1,6 @@ -/* - * ELF to firmware image creator. - * - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2015 Intel Corporation. All rights reserved. #include #include diff --git a/rimage/hash.c b/rimage/hash.c index 24555bf880f2..259fa7b8face 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/man_apl.c b/rimage/man_apl.c index ce634712cfe1..fb84b69b9f6c 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 4bd08dff042e..5f2c993c4a97 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/man_kbl.c b/rimage/man_kbl.c index 5fd16f8c3d24..5c37f876c71a 100644 --- a/rimage/man_kbl.c +++ b/rimage/man_kbl.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2018, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/man_sue.c b/rimage/man_sue.c index 0c15157b75a3..225ca519f4dd 100644 --- a/rimage/man_sue.c +++ b/rimage/man_sue.c @@ -1,15 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. #include "css.h" #include "cse.h" diff --git a/rimage/manifest.c b/rimage/manifest.c index 0ff51e169796..e04232c45900 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1,19 +1,10 @@ -/* - * Copyright (c) 2018, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - * Janusz Jankowski - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie +// Janusz Jankowski #include #include diff --git a/rimage/manifest.h b/rimage/manifest.h index 7858d3199019..464dfd04078b 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __MANIFEST_H__ diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 957a160586db..38bb7f5a59af 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include #include diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 54061b86caa2..56344dd5bfc4 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -1,18 +1,9 @@ -/* - * Copyright (c) 2017, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * Author: Liam Girdwood - * Keyon Jie - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood +// Keyon Jie #include "rimage.h" #include "manifest.h" diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h index 253a78bf40a3..c15d2372abb5 100644 --- a/rimage/plat_auth.h +++ b/rimage/plat_auth.h @@ -1,14 +1,6 @@ -/* - * Copyright (c) 2017, Intel Corporation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2017 Intel Corporation. All rights reserved. */ #ifndef __PLAT_AUTH_H__ diff --git a/rimage/rimage.c b/rimage/rimage.c index ec0f3dbcf6d8..f30e4749ede8 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -1,17 +1,6 @@ -/* - * ELF to firmware image creator. - * - * Copyright (c) 2015, Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - */ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2015 Intel Corporation. All rights reserved. #include #include diff --git a/rimage/rimage.h b/rimage/rimage.h index 96d04292d8ce..cf752d11548c 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -1,16 +1,6 @@ -/* - * ELF to firmware image creator. - * - * Copyright (c) 2015-2018 Intel Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. +/* SPDX-License-Identifier: BSD-3-Clause * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. + * Copyright(c) 2015-2018 Intel Corporation. All rights reserved. */ #ifndef __RIMAGE_H__ From b737019a6f746f6b2f19573411769fbc4618d1c2 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Sat, 1 Jun 2019 21:33:40 +0200 Subject: [PATCH 076/639] cmake: add spdx license identifier Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt index 940c9f513bfc..bdb01d45f0cd 100644 --- a/rimage/CMakeLists.txt +++ b/rimage/CMakeLists.txt @@ -1,3 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause + cmake_minimum_required(VERSION 3.10) project(SOF_RIMAGE C) From 865f31152a7c5b9db9dadd253a3952d746a517c3 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 6 Jun 2019 10:38:09 +0200 Subject: [PATCH 077/639] rimage: fix possible strcpy and sprintf overflows It's for preventing possible buffer overflow. Signed-off-by: Janusz Jankowski --- rimage/pkcs1_5.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 38bb7f5a59af..ea0c911df75f 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -84,10 +84,12 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) - sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); - else + if (!image->key_name) { + snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); + } else { + memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); + } fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); @@ -176,10 +178,12 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) - sprintf(path, "%s/otc_private_key.pem", PEM_KEY_PREFIX); - else - strcpy(path, image->key_name); + if (!image->key_name) { + snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); + } else { + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + } fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); From ccce0999ba18ad66972933d2912ccb7356a8ec89 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 10 Jun 2019 15:42:49 +0200 Subject: [PATCH 078/639] rimage: ignore sections not used by bootloader In case of multiple modules, rimage should not expect these sections in bootloader module: .bss, .static_log_entries .fw_ready. Signed-off-by: Janusz Jankowski --- rimage/elf.c | 56 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 755698dd9697..4db362e8e520 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -11,14 +11,14 @@ #include "cse.h" #include "manifest.h" -static int elf_read_sections(struct image *image, struct module *module) +static int elf_read_sections(struct image *image, struct module *module, + int module_index) { Elf32_Ehdr *hdr = &module->hdr; Elf32_Shdr *section = module->section; size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int man_section_idx; /* read in section header */ ret = fseek(module->fd, hdr->shoff, SEEK_SET); @@ -65,28 +65,42 @@ static int elf_read_sections(struct image *image, struct module *module) return -errno; } - /* find manifest module data */ - man_section_idx = elf_find_section(image, module, ".bss"); - if (man_section_idx < 0) { - /* no bss - it is OK for boot_ldr */ + if (image->num_modules > 1 && module_index == 0) { + /* In case of multiple modules first one should be bootloader, + * that should not have these sections. + */ + fprintf(stdout, "info: ignore .bss" + " section for bootloader module\n"); + module->bss_start = 0; module->bss_end = 0; - } else { - module->bss_index = man_section_idx; - } - fprintf(stdout, " BSS module metadata section at index %d\n", - man_section_idx); + fprintf(stdout, "info: ignore .static_log_entries" + " section for bootloader module\n"); + + module->logs_index = -EINVAL; - /* find log entries and fw ready sections */ - module->logs_index = elf_find_section(image, module, - ".static_log_entries"); - fprintf(stdout, " static log entries section at index %d\n", - module->logs_index); - module->fw_ready_index = elf_find_section(image, module, - ".fw_ready"); - fprintf(stdout, " fw ready section at index %d\n", - module->fw_ready_index); + fprintf(stdout, "info: ignore .fw_ready" + " section for bootloader module\n"); + + module->fw_ready_index = -EINVAL; + } else { + /* find manifest module data */ + module->bss_index = elf_find_section(image, module, ".bss"); + if (module->bss_index < 0) + return module->bss_index; + + /* find log entries and fw ready sections */ + module->logs_index = elf_find_section(image, module, + ".static_log_entries"); + if (module->logs_index < 0) + return module->logs_index; + + module->fw_ready_index = elf_find_section(image, module, + ".fw_ready"); + if (module->fw_ready_index < 0) + return module->fw_ready_index; + } /* parse each section */ for (i = 0; i < hdr->shnum; i++) { @@ -567,7 +581,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) } /* read sections */ - ret = elf_read_sections(image, module); + ret = elf_read_sections(image, module, module_index); if (ret < 0) { fprintf(stderr, "error: failed to read base sections %d\n", ret); From 55d795489858439561dbaf75c813529f3d0f14a4 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Wed, 19 Jun 2019 11:57:49 +0200 Subject: [PATCH 079/639] rimage: make .static_log_entries optional section Thats because this section is optional in FW, it will be created only with TRACE enabled Signed-off-by: Adrian Bonislawski --- rimage/elf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/rimage/elf.c b/rimage/elf.c index 4db362e8e520..9b6dbdd84dba 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -93,8 +93,6 @@ static int elf_read_sections(struct image *image, struct module *module, /* find log entries and fw ready sections */ module->logs_index = elf_find_section(image, module, ".static_log_entries"); - if (module->logs_index < 0) - return module->logs_index; module->fw_ready_index = elf_find_section(image, module, ".fw_ready"); From dad03fc17aa2d8d0def4f377f949d9c0eff80df3 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Wed, 19 Jun 2019 12:06:46 +0200 Subject: [PATCH 080/639] rimage: change error to warning if section not found Thats because this function is used also to find optional sections so it will be decided later (outside of this func) if this is actually error Signed-off-by: Adrian Bonislawski --- rimage/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rimage/elf.c b/rimage/elf.c index 9b6dbdd84dba..3796c9fb50d6 100644 --- a/rimage/elf.c +++ b/rimage/elf.c @@ -524,7 +524,7 @@ int elf_find_section(struct image *image, struct module *module, } } - fprintf(stderr, "error: can't find section %s in module %s\n", name, + fprintf(stderr, "warning: can't find section %s in module %s\n", name, module->elf_file); ret = -EINVAL; From 43e08a04269e00e766e5536f34d1336fc9a74755 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 23 Aug 2019 11:48:20 +0200 Subject: [PATCH 081/639] rimage: xcc module offset option This argument is needed in case of platforms that have different modules padding in xcc binaries. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 2 +- rimage/manifest.h | 2 +- rimage/rimage.c | 8 +++++++- rimage/rimage.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index e04232c45900..7e4cfbf09858 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -240,7 +240,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, /* module built using xcc has preceding bytes */ if (section->size > sizeof(sof_mod)) ret = fseek(module->fd, - section->off + XCC_MOD_OFFSET, SEEK_SET); + section->off + image->xcc_mod_offset, SEEK_SET); else ret = fseek(module->fd, section->off, SEEK_SET); diff --git a/rimage/manifest.h b/rimage/manifest.h index 464dfd04078b..e43fe524e9e3 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -15,7 +15,7 @@ #define MAN_PAGE_SIZE 4096 /* start offset for modules built using xcc */ -#define XCC_MOD_OFFSET 0x8 +#define DEFAULT_XCC_MOD_OFFSET 0x8 /* start offset for base FW module */ #define FILE_TEXT_OFFSET_V1_8 0x8000 diff --git a/rimage/rimage.c b/rimage/rimage.c index f30e4749ede8..2efbe941a0c6 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -36,6 +36,7 @@ static void usage(char *name) fprintf(stdout, "\t -s MEU signing offset\n"); fprintf(stdout, "\t -p log dictionary outfile\n"); fprintf(stdout, "\t -i set IMR type\n"); + fprintf(stdout, "\t -x set xcc module offset\n"); exit(0); } @@ -48,7 +49,9 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:")) != -1) { + image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; + + while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:x:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -77,6 +80,9 @@ int main(int argc, char *argv[]) case 'i': imr_type = atoi(optarg); break; + case 'x': + image.xcc_mod_offset = atoi(optarg); + break; case 'h': usage(argv[0]); break; diff --git a/rimage/rimage.h b/rimage/rimage.h index cf752d11548c..e33446369a18 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -104,6 +104,7 @@ struct image { struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ int meu_offset; + int xcc_mod_offset; /* SHA 256 */ const char *key_name; From 009cd503aa31bdeb5d66427e0b865550b540c8e7 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Fri, 23 Aug 2019 11:56:07 +0200 Subject: [PATCH 082/639] rimage: tgl machine definition Add support for tgl platform in rimage tool. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 29 +++++++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 32 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index 7e4cfbf09858..0e4c1474947c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1087,6 +1087,11 @@ static int man_write_fw_meu_v1_8(struct image *image) #define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 #define ICL_DSP_HP_BASE_ENTRY 0xbe040000 +#define ADSP_TGL_DSP_ROM_BASE 0x9F180000 +#define ADSP_TGL_DSP_ROM_SIZE 0x00002000 +#define TGL_DSP_IMR_BASE_ENTRY 0xb0038000 +#define TGL_DSP_HP_BASE_ENTRY 0xbe040000 + /* list of supported adsp */ const struct adsp machine_apl = { .name = "apl", @@ -1196,6 +1201,30 @@ const struct adsp machine_icl = { .man_v1_8 = &cnl_manifest, // use the same as CNL }; +const struct adsp machine_tgl = { + .name = "tgl", + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_TGL_DSP_ROM_BASE, + .size = ADSP_TGL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = TGL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = TGL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_TIGERLAKE, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, // use the same as CNL +}; + const struct adsp machine_sue = { .name = "sue", .mem_zones = { diff --git a/rimage/rimage.c b/rimage/rimage.c index 2efbe941a0c6..cec510fd6031 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -21,6 +21,7 @@ static const struct adsp *machine[] = { &machine_apl, &machine_cnl, &machine_icl, + &machine_tgl, &machine_sue, &machine_kbl, &machine_skl, diff --git a/rimage/rimage.h b/rimage/rimage.h index e33446369a18..d69c9ff6b62f 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -35,6 +35,7 @@ enum machine_id { MACHINE_SKYLAKE, MACHINE_CANNONLAKE, MACHINE_ICELAKE, + MACHINE_TIGERLAKE, MACHINE_SUECREEK, MACHINE_IMX8, MACHINE_MAX @@ -182,6 +183,7 @@ extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; +extern const struct adsp machine_tgl; extern const struct adsp machine_sue; extern const struct adsp machine_skl; extern const struct adsp machine_kbl; From b0d68a6bc626c3d56b523ae2b53e3062d5ff3deb Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 18:43:18 +0200 Subject: [PATCH 083/639] manifest: add v2.5 definitions New version of manifest introduced with TGL platform uses SHA384 for component hash. Signed-off-by: Janusz Jankowski --- rimage/cse.c | 2 +- rimage/man_apl.c | 4 ++-- rimage/man_cnl.c | 4 ++-- rimage/manifest.c | 14 +++++++------- rimage/manifest.h | 6 +++--- rimage/plat_auth.c | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/rimage/cse.c b/rimage/cse.c index 3524be4eae38..f3bea3826ae7 100644 --- a/rimage/cse.c +++ b/rimage/cse.c @@ -13,7 +13,7 @@ void ri_cse_create(struct image *image) { struct CsePartitionDirHeader *cse_hdr = image->fw_image; - struct sof_man_adsp_meta_file_ext *meta = image->fw_image + + struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + MAN_META_EXT_OFFSET_V1_8; struct CsePartitionDirEntry *cse_entry = image->fw_image + sizeof(*cse_hdr); diff --git a/rimage/man_apl.c b/rimage/man_apl.c index fb84b69b9f6c..7618fb2c576a 100644 --- a/rimage/man_apl.c +++ b/rimage/man_apl.c @@ -31,7 +31,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext), + .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", @@ -98,7 +98,7 @@ struct fw_image_manifest_v1_8 apl_manifest = { .adsp_file_ext = { .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/man_cnl.c b/rimage/man_cnl.c index 5f2c993c4a97..575c2c8e6451 100644 --- a/rimage/man_cnl.c +++ b/rimage/man_cnl.c @@ -30,7 +30,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { { /* ADSPMetadataFileExtension */ .entry_name = "cavs0015.met", .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext), + .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), }, { /* AdspFwBinaryDesc */ .entry_name = "cavs0015", @@ -97,7 +97,7 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .adsp_file_ext = { .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext), + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), .comp_desc[0] = { .version = 0, .base_offset = MAN_DESC_OFFSET_V1_8, diff --git a/rimage/manifest.c b/rimage/manifest.c index 0e4c1474947c..171e479b179c 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -578,7 +578,7 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, /* write metadata file for unsigned FW */ count = fwrite(image->fw_image + meta_start_offset, - sizeof(struct sof_man_adsp_meta_file_ext), 1, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8), 1, image->out_man_fd); /* did the metadata/manifest write succeed ? */ @@ -880,7 +880,7 @@ static int man_write_fw_v1_8(struct image *image) /* calculate hash for platform auth data - repeated in hash 2 and 4 */ ri_hash(image, MAN_META_EXT_OFFSET_V1_8, - sizeof(struct sof_man_adsp_meta_file_ext), hash); + sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); /* hash values in reverse order */ for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { @@ -920,8 +920,8 @@ static int man_write_fw_v1_8(struct image *image) static int man_write_fw_meu_v1_5(struct image *image) { const int meta_start_offset = image->meu_offset - - sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; - struct sof_man_adsp_meta_file_ext *meta; + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext_v1_8 *meta; struct sof_man_fw_desc *desc; uint32_t preload_size; int ret; @@ -991,8 +991,8 @@ static int man_write_fw_meu_v1_5(struct image *image) static int man_write_fw_meu_v1_8(struct image *image) { const int meta_start_offset = image->meu_offset - - sizeof(struct sof_man_adsp_meta_file_ext) - MAN_EXT_PADDING; - struct sof_man_adsp_meta_file_ext *meta; + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext_v1_8 *meta; struct sof_man_fw_desc *desc; uint32_t preload_size; int ret; @@ -1020,7 +1020,7 @@ static int man_write_fw_meu_v1_8(struct image *image) /* copy data */ memcpy(meta, &image->adsp->man_v1_8->adsp_file_ext, - sizeof(struct sof_man_adsp_meta_file_ext)); + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); memcpy(desc, &image->adsp->man_v1_8->desc, sizeof(struct sof_man_fw_desc)); diff --git a/rimage/manifest.h b/rimage/manifest.h index e43fe524e9e3..1096dda433f1 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -57,7 +57,7 @@ #define MAN_FW_DESC_OFFSET_V1_8 \ (MAN_META_EXT_OFFSET_V1_8 + \ - sizeof(struct sof_man_adsp_meta_file_ext) + \ + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) #define MAN_DESC_PADDING_SIZE_V1_8 \ @@ -75,7 +75,7 @@ #define MAN_FW_DESC_OFFSET_V1_5 \ (MAN_META_EXT_OFFSET_V1_5 + \ - sizeof(struct sof_man_adsp_meta_file_ext) + \ + sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) /* @@ -89,7 +89,7 @@ struct fw_image_manifest_v1_8 { struct signed_pkg_info_ext signed_pkg; struct partition_info_ext partition_info; uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; - struct sof_man_adsp_meta_file_ext adsp_file_ext; + struct sof_man_adsp_meta_file_ext_v1_8 adsp_file_ext; /* reserved / pading at end of ext data - all 0s*/ uint8_t reserved[MAN_EXT_PADDING]; diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 56344dd5bfc4..52e3efa00aca 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -12,7 +12,7 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, int meta_end_offset) { - struct sof_man_adsp_meta_file_ext *meta = + struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + meta_start_offset; fprintf(stdout, " meta: completing ADSP manifest\n"); @@ -29,7 +29,7 @@ void ri_plat_ext_data_create(struct image *image) { struct partition_info_ext *part = image->fw_image + MAN_PART_INFO_OFFSET_V1_8; - struct sof_man_adsp_meta_file_ext *meta = + struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + MAN_META_EXT_OFFSET_V1_8; struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; From 308436906489e29e499f750fcface785fd65211b Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:16:31 +0200 Subject: [PATCH 084/639] rimage: rename ri_hash We are going to have more hashing function, so they should be named after hashing algorithms. Signed-off-by: Janusz Jankowski --- rimage/hash.c | 4 ++-- rimage/manifest.c | 23 ++++++++++++----------- rimage/rimage.h | 3 ++- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/rimage/hash.c b/rimage/hash.c index 259fa7b8face..3518c9698975 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -80,8 +80,8 @@ void module_sha256_complete(struct image *image, uint8_t *hash) #endif } -void ri_hash(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash) +void ri_sha256(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) { module_sha256_create(image); module_sha256_update(image, image->fw_image + offset, size); diff --git a/rimage/manifest.c b/rimage/manifest.c index 171e479b179c..07cf05c903dc 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -687,11 +687,11 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) continue; } - ri_hash(image, - man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, - (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * - MAN_PAGE_SIZE, man_module->hash); + ri_sha256(image, + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, + (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE, man_module->hash); } return 0; @@ -875,12 +875,13 @@ static int man_write_fw_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ - ri_hash(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end - - MAN_FW_DESC_OFFSET_V1_8, m->adsp_file_ext.comp_desc[0].hash); + ri_sha256(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end + - MAN_FW_DESC_OFFSET_V1_8, + m->adsp_file_ext.comp_desc[0].hash); /* calculate hash for platform auth data - repeated in hash 2 and 4 */ - ri_hash(image, MAN_META_EXT_OFFSET_V1_8, - sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); + ri_sha256(image, MAN_META_EXT_OFFSET_V1_8, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); /* hash values in reverse order */ for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { @@ -969,7 +970,7 @@ static int man_write_fw_meu_v1_5(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_hash(image, image->meu_offset, image->image_end - + ri_sha256(image, image->meu_offset, image->image_end - image->meu_offset, meta->comp_desc[0].hash); /* write the unsigned files */ @@ -1042,7 +1043,7 @@ static int man_write_fw_meu_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_hash(image, image->meu_offset, image->image_end - + ri_sha256(image, image->meu_offset, image->image_end - image->meu_offset, meta->comp_desc[0].hash); /* write the unsigned files */ diff --git a/rimage/rimage.h b/rimage/rimage.h index d69c9ff6b62f..111b3c72fa11 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -155,7 +155,8 @@ void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); void module_sha256_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); -void ri_hash(struct image *image, unsigned offset, unsigned size, uint8_t *hash); +void ri_sha256(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash); int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, From 1fabda97befd39cfd9ff9cd162e1e4114e573412 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:24:01 +0200 Subject: [PATCH 085/639] rimage: rename module_sha functions These functions are generic and can be used for other SHA algorithms. Signed-off-by: Janusz Jankowski --- rimage/hash.c | 8 ++++---- rimage/pkcs1_5.c | 10 +++++----- rimage/rimage.h | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/rimage/hash.c b/rimage/hash.c index 3518c9698975..ab9d6fce8684 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -56,12 +56,12 @@ void module_sha256_create(struct image *image) EVP_DigestInit_ex(image->mdctx, image->md, NULL); } -void module_sha256_update(struct image *image, uint8_t *data, size_t bytes) +void module_sha_update(struct image *image, uint8_t *data, size_t bytes) { EVP_DigestUpdate(image->mdctx, data, bytes); } -void module_sha256_complete(struct image *image, uint8_t *hash) +void module_sha_complete(struct image *image, uint8_t *hash) { unsigned char md_value[EVP_MAX_MD_SIZE]; unsigned int md_len; @@ -84,6 +84,6 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) { module_sha256_create(image); - module_sha256_update(image, image->fw_image + offset, size); - module_sha256_complete(image, hash); + module_sha_update(image, image->fw_image + offset, size); + module_sha_complete(image, hash); } diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index ea0c911df75f..4da4d4877284 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -112,8 +112,8 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, /* calculate the digest */ module_sha256_create(image); - module_sha256_update(image, ptr1, size1); - module_sha256_complete(image, digest); + module_sha_update(image, ptr1, size1); + module_sha_complete(image, digest); fprintf(stdout, " pkcs: digest for manifest is "); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) @@ -206,9 +206,9 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* calculate the digest */ module_sha256_create(image); - module_sha256_update(image, ptr1, size1); - module_sha256_update(image, ptr2, size2); - module_sha256_complete(image, digest); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); fprintf(stdout, " pkcs: digest for manifest is "); for (i = 0; i < SHA256_DIGEST_LENGTH; i++) diff --git a/rimage/rimage.h b/rimage/rimage.h index 111b3c72fa11..919e4d3c62a5 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -151,8 +151,8 @@ struct adsp { int write_logs_dictionary(struct image *image); void module_sha256_create(struct image *image); -void module_sha256_update(struct image *image, uint8_t *data, size_t bytes); -void module_sha256_complete(struct image *image, uint8_t *hash); +void module_sha_update(struct image *image, uint8_t *data, size_t bytes); +void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_sha256(struct image *image, unsigned int offset, unsigned int size, From d33ced649f7e2a4fc65173a59a17963610cafadb Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:28:44 +0200 Subject: [PATCH 086/639] rimage: add SHA384 hashing Signed-off-by: Janusz Jankowski --- rimage/hash.c | 16 ++++++++++++++++ rimage/rimage.h | 4 +++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/rimage/hash.c b/rimage/hash.c index ab9d6fce8684..24d11a27b94c 100644 --- a/rimage/hash.c +++ b/rimage/hash.c @@ -87,3 +87,19 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size, module_sha_update(image, image->fw_image + offset, size); module_sha_complete(image, hash); } + +static void module_sha384_create(struct image *image) +{ + image->md = EVP_sha384(); + image->mdctx = EVP_MD_CTX_new(); + + EVP_DigestInit_ex(image->mdctx, image->md, NULL); +} + +void ri_sha384(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash) +{ + module_sha384_create(image); + module_sha_update(image, image->fw_image + offset, size); + module_sha_complete(image, hash); +} diff --git a/rimage/rimage.h b/rimage/rimage.h index 919e4d3c62a5..9e4727308dd1 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -107,7 +107,7 @@ struct image { int meu_offset; int xcc_mod_offset; - /* SHA 256 */ + /* SHA 256 & 384 */ const char *key_name; EVP_MD_CTX *mdctx; const EVP_MD *md; @@ -157,6 +157,8 @@ int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash); +void ri_sha384(struct image *image, unsigned int offset, unsigned int size, + uint8_t *hash); int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, From 3bf866a961392f4a2f69e78d92c3a2fffe1c887c Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 19:37:44 +0200 Subject: [PATCH 087/639] rimage: image manifest v2.5 Signed-off-by: Janusz Jankowski --- rimage/manifest.h | 30 ++++++++++++++++++++++++++++++ rimage/rimage.h | 1 + 2 files changed, 31 insertions(+) diff --git a/rimage/manifest.h b/rimage/manifest.h index 1096dda433f1..1f3789b8a681 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -41,6 +41,14 @@ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) +#define MAN_FW_DESC_OFFSET_V2_5 \ + (MAN_META_EXT_OFFSET_V1_8 + \ + sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ + MAN_EXT_PADDING) + +#define MAN_DESC_PADDING_SIZE_V2_5 \ + (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V2_5) + #define MAN_SIG_PKG_OFFSET_V1_8 \ (MAN_CSS_HDR_OFFSET + \ sizeof(struct css_header_v1_8)) @@ -78,6 +86,28 @@ sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) +/* + * Firmware manifest header V2.5 used on TGL onwards + */ +struct fw_image_manifest_v2_5 { + /* MEU tool needs these sections to be 0s */ + struct CsePartitionDirHeader cse_partition_dir_header; + struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; + struct css_header_v1_8 css; + struct signed_pkg_info_ext signed_pkg; + struct partition_info_ext partition_info; + uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; + struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; + + /* reserved / pading at end of ext data - all 0s*/ + uint8_t reserved[MAN_EXT_PADDING]; + + /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ + uint8_t padding[MAN_DESC_PADDING_SIZE_V2_5]; + + struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ +} __attribute__((packed)); + /* * Firmware manifest header V1.8 used on APL onwards */ diff --git a/rimage/rimage.h b/rimage/rimage.h index 9e4727308dd1..def37083df8f 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -142,6 +142,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); + struct fw_image_manifest_v2_5 *man_v2_5; struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; struct fw_image_manifest_v1_5_sue *man_v1_5_sue; From 2fd99129c337ee3ad515a531b27df0700616ef75 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 20:05:50 +0200 Subject: [PATCH 088/639] rimage: manifest v2.5 for MEU Add function writing manifest v2.5 for MEU. Signed-off-by: Janusz Jankowski --- rimage/manifest.c | 103 ++++++++++++++++++++++++++++++++++++++++----- rimage/plat_auth.c | 20 ++++++++- rimage/plat_auth.h | 6 ++- rimage/rimage.c | 3 ++ 4 files changed, 117 insertions(+), 15 deletions(-) diff --git a/rimage/manifest.c b/rimage/manifest.c index 07cf05c903dc..e9f8195161d8 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -572,13 +572,13 @@ static int man_module_create_reloc(struct image *image, struct module *module, } static int man_write_unsigned_mod(struct image *image, int meta_start_offset, - int meta_end_offset) + int meta_end_offset, size_t ext_file_size) { int count; /* write metadata file for unsigned FW */ count = fwrite(image->fw_image + meta_start_offset, - sizeof(struct sof_man_adsp_meta_file_ext_v1_8), 1, + ext_file_size, 1, image->out_man_fd); /* did the metadata/manifest write succeed ? */ @@ -756,7 +756,8 @@ static int man_write_fw_v1_5(struct image *image) /* write the unsigned files*/ ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_5, - MAN_FW_DESC_OFFSET_V1_5); + MAN_FW_DESC_OFFSET_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); if (ret < 0) goto err; @@ -861,8 +862,8 @@ static int man_write_fw_v1_8(struct image *image) fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); + ri_adsp_meta_data_create_v1_8(image, MAN_META_EXT_OFFSET_V1_8, + MAN_FW_DESC_OFFSET_V1_8); ri_plat_ext_data_create(image); ri_css_v1_8_hdr_create(image); ri_cse_create(image); @@ -902,7 +903,8 @@ static int man_write_fw_v1_8(struct image *image) /* write the unsigned files*/ ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V1_8, - MAN_FW_DESC_OFFSET_V1_8); + MAN_FW_DESC_OFFSET_V1_8, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); if (ret < 0) goto err; @@ -959,7 +961,8 @@ static int man_write_fw_meu_v1_5(struct image *image) fprintf(stdout, "Firmware completing manifest v1.5\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + ri_adsp_meta_data_create_v1_8(image, meta_start_offset, + image->meu_offset); /* write preload page count */ preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_5; @@ -975,7 +978,8 @@ static int man_write_fw_meu_v1_5(struct image *image) /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, - image->meu_offset); + image->meu_offset, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); if (ret < 0) goto err; @@ -1032,7 +1036,8 @@ static int man_write_fw_meu_v1_8(struct image *image) fprintf(stdout, "Firmware completing manifest v1.8\n"); /* create structures from end of file to start of file */ - ri_adsp_meta_data_create(image, meta_start_offset, image->meu_offset); + ri_adsp_meta_data_create_v1_8(image, meta_start_offset, + image->meu_offset); /* write preload page count */ preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; @@ -1048,7 +1053,83 @@ static int man_write_fw_meu_v1_8(struct image *image) /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, - image->meu_offset); + image->meu_offset, + sizeof(struct sof_man_adsp_meta_file_ext_v1_8)); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest completed!\n"); + return 0; + +err: + free(image->fw_image); + unlink(image->out_file); + return ret; +} + +/* used to sign with MEU */ +static int man_write_fw_meu_v2_5(struct image *image) +{ + const int meta_start_offset = image->meu_offset - + sizeof(struct sof_man_adsp_meta_file_ext_v2_5) - MAN_EXT_PADDING; + struct sof_man_adsp_meta_file_ext_v2_5 *meta; + struct sof_man_fw_desc *desc; + uint32_t preload_size; + int ret; + + /* allocate image */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) { + ret = -ENOMEM; + goto err; + } + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + meta = image->fw_image + meta_start_offset; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + + /* copy data */ + memcpy(meta, &image->adsp->man_v2_5->adsp_file_ext, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + memcpy(desc, &image->adsp->man_v2_5->desc, + sizeof(struct sof_man_fw_desc)); + + /* create each module */ + desc->header.num_module_entries = image->num_modules; + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + + fprintf(stdout, "Firmware completing manifest v2.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create_v2_5(image, meta_start_offset, + image->meu_offset); + + /* write preload page count */ + preload_size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; + preload_size += MAN_PAGE_SIZE - (preload_size % MAN_PAGE_SIZE); + desc->header.preload_page_count = preload_size / MAN_PAGE_SIZE; + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash for ADSP meta data extension */ + ri_sha384(image, image->meu_offset, image->image_end - + image->meu_offset, meta->comp_desc[0].hash); + + /* write the unsigned files */ + ret = man_write_unsigned_mod(image, meta_start_offset, + image->meu_offset, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); if (ret < 0) goto err; @@ -1222,7 +1303,7 @@ const struct adsp machine_tgl = { .dram_offset = 0, .machine_id = MACHINE_TIGERLAKE, .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, + .write_firmware_meu = man_write_fw_meu_v2_5, .man_v1_8 = &cnl_manifest, // use the same as CNL }; diff --git a/rimage/plat_auth.c b/rimage/plat_auth.c index 52e3efa00aca..e8645611f327 100644 --- a/rimage/plat_auth.c +++ b/rimage/plat_auth.c @@ -9,8 +9,8 @@ #include "manifest.h" #include "plat_auth.h" -void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, - int meta_end_offset) +void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, + int meta_end_offset) { struct sof_man_adsp_meta_file_ext_v1_8 *meta = image->fw_image + meta_start_offset; @@ -25,6 +25,22 @@ void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, /* now hash the AdspFwBinaryDesc -> EOF */ } +void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, + int meta_end_offset) +{ + struct sof_man_adsp_meta_file_ext_v2_5 *meta = + image->fw_image + meta_start_offset; + + fprintf(stdout, " meta: completing ADSP manifest\n"); + + meta->comp_desc[0].limit_offset = MAN_DESC_OFFSET_V1_8 + + image->image_end - meta_end_offset; + + fprintf(stdout, " meta: limit is 0x%x\n", + meta->comp_desc[0].limit_offset); + /* now hash the AdspFwBinaryDesc -> EOF */ +} + void ri_plat_ext_data_create(struct image *image) { struct partition_info_ext *part = image->fw_image diff --git a/rimage/plat_auth.h b/rimage/plat_auth.h index c15d2372abb5..7e94f8ae12ba 100644 --- a/rimage/plat_auth.h +++ b/rimage/plat_auth.h @@ -78,8 +78,10 @@ struct partition_info_ext { (sizeof(struct partition_info_ext) + \ sizeof(struct signed_pkg_info_ext)) -void ri_adsp_meta_data_create(struct image *image, int meta_start_offset, - int meta_end_offset); +void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, + int meta_end_offset); +void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, + int meta_end_offset); void ri_plat_ext_data_create(struct image *image); #endif diff --git a/rimage/rimage.c b/rimage/rimage.c index cec510fd6031..cff9b7aa9eb5 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -122,6 +122,9 @@ int main(int argc, char *argv[]) if (image.adsp->man_v1_8) image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + if (image.adsp->man_v2_5) + image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + /* parse input ELF files */ image.num_modules = argc - elf_argc; for (i = elf_argc; i < argc; i++) { From dd77445f018c173f0e811092d23b50cfe2d1baa1 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Mon, 30 Sep 2019 20:13:59 +0200 Subject: [PATCH 089/639] rimage: update tgl Signed-off-by: Janusz Jankowski --- rimage/CMakeLists.txt | 1 + rimage/man_tgl.c | 126 ++++++++++++++++++++++++++++++++++++++++++ rimage/manifest.c | 4 +- rimage/manifest.h | 2 + 4 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 rimage/man_tgl.c diff --git a/rimage/CMakeLists.txt b/rimage/CMakeLists.txt index bdb01d45f0cd..dc5d3ac794f8 100644 --- a/rimage/CMakeLists.txt +++ b/rimage/CMakeLists.txt @@ -25,6 +25,7 @@ add_executable(rimage man_cnl.c man_kbl.c man_sue.c + man_tgl.c cse.c css.c plat_auth.c diff --git a/rimage/man_tgl.c b/rimage/man_tgl.c new file mode 100644 index 000000000000..83877e198af7 --- /dev/null +++ b/rimage/man_tgl.c @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2019 Intel Corporation. All rights reserved. + +#include "css.h" +#include "cse.h" +#include "plat_auth.h" +#include "manifest.h" +#include + +/* manifest template */ +struct fw_image_manifest_v2_5 tgl_manifest = { + .cse_partition_dir_header = { + .header_marker = CSE_HEADER_MAKER, + .nb_entries = MAN_CSE_PARTS, + .header_version = 1, + .entry_version = 1, + .header_length = sizeof(struct CsePartitionDirHeader), + .partition_name = "ADSP", + }, + + .cse_partition_dir_entry = { + { + /* CssHeader + platformFirmwareAuthenticationExtension - padding */ + .entry_name = "ADSP.man", + .offset = MAN_CSS_HDR_OFFSET, + .length = sizeof(struct css_header_v1_8) + + PLAT_AUTH_SIZE, + }, + { /* ADSPMetadataFileExtension */ + .entry_name = "cavs0015.met", + .offset = MAN_META_EXT_OFFSET_V1_8, + .length = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + }, + { /* AdspFwBinaryDesc */ + .entry_name = "cavs0015", + .offset = MAN_FW_DESC_OFFSET_V2_5, + .length = 0, /* calculated by rimage - */ + }, + + }, + + .css = { + .header_type = MAN_CSS_MOD_TYPE, + .header_len = MAN_CSS_HDR_SIZE, + .header_version = MAN_CSS_HDR_VERSION, + .module_vendor = MAN_CSS_MOD_VENDOR, + .size = 222, + .header_id = MAN_CSS_HDR_ID, + .padding = 0, + .version = { + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + }, + .modulus_size = MAN_CSS_MOD_SIZE, + .exponent_size = MAN_CSS_EXP_SIZE, + }, + + .signed_pkg = { + .ext_type = SIGN_PKG_EXT_TYPE, + .ext_len = sizeof(struct signed_pkg_info_ext), + .name = "ADSP", + .vcn = 0, + .bitmap = {0, 0, 0, 0, 8}, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .hash_algo = 0x02, /* SHA 256 */ + .hash_size = 0x20, + }, + }, + + .partition_info = { + .ext_type = PART_INFO_EXT_TYPE, + .ext_len = sizeof(struct partition_info_ext), + + .name = "ADSP", + .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ + .part_version = 0x10000000, + .instance_id = 1, + .reserved[0 ... 19] = 0xff, + + .module[0] = { + .name = "cavs0015.met", + .meta_size = 96, + .type = 0x03, + .reserved = {0x00, 0xff, 0xff}, + }, + + }, + + .cse_padding[0 ... 47] = 0xff, + + .adsp_file_ext = { + .ext_type = 17, + .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + .comp_desc[0] = { + .version = 0, + .base_offset = MAN_DESC_OFFSET_V1_8, + .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ + }, + + }, + + .reserved[0 ... 31] = 0xff, + + .desc = { + .header = { + .header_id = SOF_MAN_FW_HDR_ID, + .header_len = sizeof(struct sof_man_fw_header), + .name = SOF_MAN_FW_HDR_NAME, + .preload_page_count = 0, /* size in pages from $CPD */ + .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, + .feature_mask = SOF_MAN_FW_HDR_FEATURES, + .major_version = SOF_MAJOR, + .minor_version = SOF_MINOR, + .hotfix_version = 0, + .build_version = SOF_BUILD, + .load_offset = 0x30000, + }, + }, +}; diff --git a/rimage/manifest.c b/rimage/manifest.c index e9f8195161d8..b4db79b0249e 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1302,9 +1302,9 @@ const struct adsp machine_tgl = { .image_size = 0x100000, .dram_offset = 0, .machine_id = MACHINE_TIGERLAKE, - .write_firmware = man_write_fw_v1_8, + .write_firmware = NULL, /* not yet implemented */ .write_firmware_meu = man_write_fw_meu_v2_5, - .man_v1_8 = &cnl_manifest, // use the same as CNL + .man_v2_5 = &tgl_manifest, }; const struct adsp machine_sue = { diff --git a/rimage/manifest.h b/rimage/manifest.h index 1f3789b8a681..32e0574e8db5 100644 --- a/rimage/manifest.h +++ b/rimage/manifest.h @@ -108,6 +108,8 @@ struct fw_image_manifest_v2_5 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); +extern struct fw_image_manifest_v2_5 tgl_manifest; + /* * Firmware manifest header V1.8 used on APL onwards */ From f3be41dc40dcd2886fc6d13b2b284ca1cee26fea Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Wed, 30 Oct 2019 12:36:46 +0800 Subject: [PATCH 090/639] rimage: add support for jsl JSL should have almost same config as ICL, but they should have different fw name. Signed-off-by: Pan Xiuli --- rimage/manifest.c | 24 ++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 1 + 3 files changed, 26 insertions(+) diff --git a/rimage/manifest.c b/rimage/manifest.c index b4db79b0249e..343a7dc59b4a 100644 --- a/rimage/manifest.c +++ b/rimage/manifest.c @@ -1283,6 +1283,30 @@ const struct adsp machine_icl = { .man_v1_8 = &cnl_manifest, // use the same as CNL }; +const struct adsp machine_jsl = { + .name = "jsl", + .mem_zones = { + [SOF_FW_BLK_TYPE_ROM] = { + .base = ADSP_ICL_DSP_ROM_BASE, + .size = ADSP_ICL_DSP_ROM_SIZE, + }, + [SOF_FW_BLK_TYPE_IMR] = { + .base = ICL_DSP_IMR_BASE_ENTRY, + .size = 0x100000, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = ICL_DSP_HP_BASE_ENTRY, + .size = 0x100000, + }, + }, + .image_size = 0x100000, + .dram_offset = 0, + .machine_id = MACHINE_ICELAKE, + .write_firmware = man_write_fw_v1_8, + .write_firmware_meu = man_write_fw_meu_v1_8, + .man_v1_8 = &cnl_manifest, // use the same as CNL +}; + const struct adsp machine_tgl = { .name = "tgl", .mem_zones = { diff --git a/rimage/rimage.c b/rimage/rimage.c index cff9b7aa9eb5..5d18b96d9569 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -21,6 +21,7 @@ static const struct adsp *machine[] = { &machine_apl, &machine_cnl, &machine_icl, + &machine_jsl, &machine_tgl, &machine_sue, &machine_kbl, diff --git a/rimage/rimage.h b/rimage/rimage.h index def37083df8f..9c3cf8e3537b 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -187,6 +187,7 @@ extern const struct adsp machine_bdw; extern const struct adsp machine_apl; extern const struct adsp machine_cnl; extern const struct adsp machine_icl; +extern const struct adsp machine_jsl; extern const struct adsp machine_tgl; extern const struct adsp machine_sue; extern const struct adsp machine_skl; From 27a9e918345f308ae9909fcc39a84137eb5d6f38 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 12 Nov 2019 09:27:14 -0800 Subject: [PATCH 091/639] Rename rimage to src and move headers into src/include/rimage This renames the rimage directory to "src". This also moves the header files into src/include/rimage. This is in preparation to allow rimage to be built outside of SOF tree, and it requires some SOF header files. Moving headers under src/include/rimage makes it obvious that these headers are for rimage. Signed-off-by: Daniel Leung --- {rimage => src}/CMakeLists.txt | 0 {rimage => src}/cse.c | 0 {rimage => src}/css.c | 0 {rimage => src}/elf.c | 0 {rimage => src}/file_simple.c | 0 {rimage => src}/hash.c | 0 {rimage => src/include/rimage}/cse.h | 0 {rimage => src/include/rimage}/css.h | 0 {rimage => src/include/rimage}/elf.h | 0 {rimage => src/include/rimage}/file_format.h | 0 {rimage => src/include/rimage}/manifest.h | 0 {rimage => src/include/rimage}/plat_auth.h | 0 {rimage => src/include/rimage}/rimage.h | 0 {rimage => src}/man_apl.c | 0 {rimage => src}/man_cnl.c | 0 {rimage => src}/man_kbl.c | 0 {rimage => src}/man_sue.c | 0 {rimage => src}/man_tgl.c | 0 {rimage => src}/manifest.c | 0 {rimage => src}/pkcs1_5.c | 0 {rimage => src}/plat_auth.c | 0 {rimage => src}/rimage.c | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename {rimage => src}/CMakeLists.txt (100%) rename {rimage => src}/cse.c (100%) rename {rimage => src}/css.c (100%) rename {rimage => src}/elf.c (100%) rename {rimage => src}/file_simple.c (100%) rename {rimage => src}/hash.c (100%) rename {rimage => src/include/rimage}/cse.h (100%) rename {rimage => src/include/rimage}/css.h (100%) rename {rimage => src/include/rimage}/elf.h (100%) rename {rimage => src/include/rimage}/file_format.h (100%) rename {rimage => src/include/rimage}/manifest.h (100%) rename {rimage => src/include/rimage}/plat_auth.h (100%) rename {rimage => src/include/rimage}/rimage.h (100%) rename {rimage => src}/man_apl.c (100%) rename {rimage => src}/man_cnl.c (100%) rename {rimage => src}/man_kbl.c (100%) rename {rimage => src}/man_sue.c (100%) rename {rimage => src}/man_tgl.c (100%) rename {rimage => src}/manifest.c (100%) rename {rimage => src}/pkcs1_5.c (100%) rename {rimage => src}/plat_auth.c (100%) rename {rimage => src}/rimage.c (100%) diff --git a/rimage/CMakeLists.txt b/src/CMakeLists.txt similarity index 100% rename from rimage/CMakeLists.txt rename to src/CMakeLists.txt diff --git a/rimage/cse.c b/src/cse.c similarity index 100% rename from rimage/cse.c rename to src/cse.c diff --git a/rimage/css.c b/src/css.c similarity index 100% rename from rimage/css.c rename to src/css.c diff --git a/rimage/elf.c b/src/elf.c similarity index 100% rename from rimage/elf.c rename to src/elf.c diff --git a/rimage/file_simple.c b/src/file_simple.c similarity index 100% rename from rimage/file_simple.c rename to src/file_simple.c diff --git a/rimage/hash.c b/src/hash.c similarity index 100% rename from rimage/hash.c rename to src/hash.c diff --git a/rimage/cse.h b/src/include/rimage/cse.h similarity index 100% rename from rimage/cse.h rename to src/include/rimage/cse.h diff --git a/rimage/css.h b/src/include/rimage/css.h similarity index 100% rename from rimage/css.h rename to src/include/rimage/css.h diff --git a/rimage/elf.h b/src/include/rimage/elf.h similarity index 100% rename from rimage/elf.h rename to src/include/rimage/elf.h diff --git a/rimage/file_format.h b/src/include/rimage/file_format.h similarity index 100% rename from rimage/file_format.h rename to src/include/rimage/file_format.h diff --git a/rimage/manifest.h b/src/include/rimage/manifest.h similarity index 100% rename from rimage/manifest.h rename to src/include/rimage/manifest.h diff --git a/rimage/plat_auth.h b/src/include/rimage/plat_auth.h similarity index 100% rename from rimage/plat_auth.h rename to src/include/rimage/plat_auth.h diff --git a/rimage/rimage.h b/src/include/rimage/rimage.h similarity index 100% rename from rimage/rimage.h rename to src/include/rimage/rimage.h diff --git a/rimage/man_apl.c b/src/man_apl.c similarity index 100% rename from rimage/man_apl.c rename to src/man_apl.c diff --git a/rimage/man_cnl.c b/src/man_cnl.c similarity index 100% rename from rimage/man_cnl.c rename to src/man_cnl.c diff --git a/rimage/man_kbl.c b/src/man_kbl.c similarity index 100% rename from rimage/man_kbl.c rename to src/man_kbl.c diff --git a/rimage/man_sue.c b/src/man_sue.c similarity index 100% rename from rimage/man_sue.c rename to src/man_sue.c diff --git a/rimage/man_tgl.c b/src/man_tgl.c similarity index 100% rename from rimage/man_tgl.c rename to src/man_tgl.c diff --git a/rimage/manifest.c b/src/manifest.c similarity index 100% rename from rimage/manifest.c rename to src/manifest.c diff --git a/rimage/pkcs1_5.c b/src/pkcs1_5.c similarity index 100% rename from rimage/pkcs1_5.c rename to src/pkcs1_5.c diff --git a/rimage/plat_auth.c b/src/plat_auth.c similarity index 100% rename from rimage/plat_auth.c rename to src/plat_auth.c diff --git a/rimage/rimage.c b/src/rimage.c similarity index 100% rename from rimage/rimage.c rename to src/rimage.c From 0b34af27fa753ec728cb6761ee771721fbf19a20 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 12 Nov 2019 09:31:42 -0800 Subject: [PATCH 092/639] Add a minimal set of necessary SOF headers These headers are required for building rimage outside of the SOF source tree as a standalone tool. Signed-off-by: Daniel Leung --- src/include/sof/ipc/header.h | 241 ++++++++++++++++++++++++++++++++ src/include/sof/ipc/info.h | 126 +++++++++++++++++ src/include/sof/ipc/stream.h | 156 +++++++++++++++++++++ src/include/sof/kernel/fw.h | 80 +++++++++++ src/include/sof/user/manifest.h | 228 ++++++++++++++++++++++++++++++ 5 files changed, 831 insertions(+) create mode 100644 src/include/sof/ipc/header.h create mode 100644 src/include/sof/ipc/info.h create mode 100644 src/include/sof/ipc/stream.h create mode 100644 src/include/sof/kernel/fw.h create mode 100644 src/include/sof/user/manifest.h diff --git a/src/include/sof/ipc/header.h b/src/include/sof/ipc/header.h new file mode 100644 index 000000000000..3726c38a78a0 --- /dev/null +++ b/src/include/sof/ipc/header.h @@ -0,0 +1,241 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/** + * \file include/ipc/header.h + * \brief IPC command header + * \author Liam Girdwood + * \author Keyon Jie + */ + +#ifndef __IPC_HEADER_H__ +#define __IPC_HEADER_H__ + +#include + +/** \addtogroup sof_uapi uAPI + * SOF uAPI specification. + * + * IPC messages have a prefixed 32 bit identifier made up as follows :- + * + * 0xGCCCNNNN where + * - G is global cmd type (4 bits) + * - C is command type (12 bits) + * - N is the ID number (16 bits) - monotonic and overflows + * + * This is sent at the start of the IPM message in the mailbox. Messages should + * not be sent in the doorbell (special exceptions for firmware). + + * @{ + */ + +/** \name Global Message - Generic + * @{ + */ + +/** Shift-left bits to extract the global cmd type */ +#define SOF_GLB_TYPE_SHIFT 28 +#define SOF_GLB_TYPE_MASK (0xf << SOF_GLB_TYPE_SHIFT) +#define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT) + +/** @} */ + +/** \name Command Message - Generic + * @{ + */ + +/** Shift-left bits to extract the command type */ +#define SOF_CMD_TYPE_SHIFT 16 +#define SOF_CMD_TYPE_MASK (0xfff << SOF_CMD_TYPE_SHIFT) +#define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT) + +/** @} */ + +/** \name Global Message Types + * @{ + */ + +#define SOF_IPC_GLB_REPLY SOF_GLB_TYPE(0x1U) +#define SOF_IPC_GLB_COMPOUND SOF_GLB_TYPE(0x2U) +#define SOF_IPC_GLB_TPLG_MSG SOF_GLB_TYPE(0x3U) +#define SOF_IPC_GLB_PM_MSG SOF_GLB_TYPE(0x4U) +#define SOF_IPC_GLB_COMP_MSG SOF_GLB_TYPE(0x5U) +#define SOF_IPC_GLB_STREAM_MSG SOF_GLB_TYPE(0x6U) +#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U) +#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U) +#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U) +#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU) +#define SOF_IPC_GLB_TEST SOF_GLB_TYPE(0xBU) + +/** @} */ + +/** \name DSP Command: Topology + * \anchor tplg_cmd_type + * @{ + */ + +#define SOF_IPC_TPLG_COMP_NEW SOF_CMD_TYPE(0x001) +#define SOF_IPC_TPLG_COMP_FREE SOF_CMD_TYPE(0x002) +#define SOF_IPC_TPLG_COMP_CONNECT SOF_CMD_TYPE(0x003) +#define SOF_IPC_TPLG_PIPE_NEW SOF_CMD_TYPE(0x010) +#define SOF_IPC_TPLG_PIPE_FREE SOF_CMD_TYPE(0x011) +#define SOF_IPC_TPLG_PIPE_CONNECT SOF_CMD_TYPE(0x012) +#define SOF_IPC_TPLG_PIPE_COMPLETE SOF_CMD_TYPE(0x013) +#define SOF_IPC_TPLG_BUFFER_NEW SOF_CMD_TYPE(0x020) +#define SOF_IPC_TPLG_BUFFER_FREE SOF_CMD_TYPE(0x021) + +/** @} */ + +/** \name DSP Command: PM + * @{ + */ + +#define SOF_IPC_PM_CTX_SAVE SOF_CMD_TYPE(0x001) +#define SOF_IPC_PM_CTX_RESTORE SOF_CMD_TYPE(0x002) +#define SOF_IPC_PM_CTX_SIZE SOF_CMD_TYPE(0x003) +#define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004) +#define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005) +#define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006) +#define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007) +#define SOF_IPC_PM_GATE SOF_CMD_TYPE(0x008) + +/** \name DSP Command: Component runtime config - multiple different types + * @{ + */ + +#define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001) +#define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002) +#define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003) +#define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004) +#define SOF_IPC_COMP_NOTIFICATION SOF_CMD_TYPE(0x005) + +/** @} */ + +/** \name DSP Command: DAI messages + * @{ + */ +#define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001) +#define SOF_IPC_DAI_LOOPBACK SOF_CMD_TYPE(0x002) + +/** @} */ + +/** \name DSP Command: Stream + * @{ + */ +#define SOF_IPC_STREAM_PCM_PARAMS SOF_CMD_TYPE(0x001) +#define SOF_IPC_STREAM_PCM_PARAMS_REPLY SOF_CMD_TYPE(0x002) +#define SOF_IPC_STREAM_PCM_FREE SOF_CMD_TYPE(0x003) +#define SOF_IPC_STREAM_TRIG_START SOF_CMD_TYPE(0x004) +#define SOF_IPC_STREAM_TRIG_STOP SOF_CMD_TYPE(0x005) +#define SOF_IPC_STREAM_TRIG_PAUSE SOF_CMD_TYPE(0x006) +#define SOF_IPC_STREAM_TRIG_RELEASE SOF_CMD_TYPE(0x007) +#define SOF_IPC_STREAM_TRIG_DRAIN SOF_CMD_TYPE(0x008) +#define SOF_IPC_STREAM_TRIG_XRUN SOF_CMD_TYPE(0x009) +#define SOF_IPC_STREAM_POSITION SOF_CMD_TYPE(0x00a) +#define SOF_IPC_STREAM_VORBIS_PARAMS SOF_CMD_TYPE(0x010) +#define SOF_IPC_STREAM_VORBIS_FREE SOF_CMD_TYPE(0x011) + +/** @} */ + +/** \name DSP Command: Trace and debug + * @{ + */ + +#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001) +#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002) +#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003) + +/** @} */ + +/** \name DSP Command: Test - Debug build only + * @{ + */ + +#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001) + +/** @} */ + +/** \name IPC Message Definitions + * @{ + */ + +/** Get message component id */ +#define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff) + +/** Maximum message size for mailbox Tx/Rx */ +#define SOF_IPC_MSG_MAX_SIZE 384 + +/** @} */ + +/** + * Structure Header - Header for all IPC structures except command structs. + * The size can be greater than the structure size and that means there is + * extended bespoke data beyond the end of the structure including variable + * arrays. + */ +struct sof_ipc_hdr { + uint32_t size; /**< size of structure */ +} __attribute__((packed)); + +/** + * Command Header - Header for all IPC commands. Identifies IPC message. + * The size can be greater than the structure size and that means there is + * extended bespoke data beyond the end of the structure including variable + * arrays. + */ +struct sof_ipc_cmd_hdr { + uint32_t size; /**< size of structure */ + uint32_t cmd; /**< SOF_IPC_GLB_ + cmd */ +} __attribute__((packed)); + +/** + * Generic reply message. Some commands override this with their own reply + * types that must include this at start. + */ +struct sof_ipc_reply { + struct sof_ipc_cmd_hdr hdr; + int32_t error; /**< negative error numbers */ +} __attribute__((packed)); + +/** + * Compound commands - SOF_IPC_GLB_COMPOUND. + * + * Compound commands are sent to the DSP as a single IPC operation. The + * commands are split into blocks and each block has a header. This header + * identifies the command type and the number of commands before the next + * header. + */ +struct sof_ipc_compound_hdr { + struct sof_ipc_cmd_hdr hdr; + uint32_t count; /**< count of 0 means end of compound sequence */ +} __attribute__((packed)); + +/** + * OOPS header architecture specific data. + */ +struct sof_ipc_dsp_oops_arch_hdr { + uint32_t arch; /* Identifier of architecture */ + uint32_t totalsize; /* Total size of oops message */ +} __attribute__((packed)); + +/** + * OOPS header platform specific data. + */ +struct sof_ipc_dsp_oops_plat_hdr { + uint32_t configidhi; /* ConfigID hi 32bits */ + uint32_t configidlo; /* ConfigID lo 32bits */ + uint32_t numaregs; /* Special regs num */ + uint32_t stackoffset; /* Offset to stack pointer from beginning of + * oops message + */ + uint32_t stackptr; /* Stack ptr */ +} __attribute__((packed)); + +/** @}*/ + +#endif /* __IPC_HEADER_H__ */ diff --git a/src/include/sof/ipc/info.h b/src/include/sof/ipc/info.h new file mode 100644 index 000000000000..d34ba914954e --- /dev/null +++ b/src/include/sof/ipc/info.h @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/** + * \file include/ipc/info.h + * \brief IPC definitions + * \author Liam Girdwood + * \author Keyon Jie + */ + +#ifndef __IPC_INFO_H__ +#define __IPC_INFO_H__ + +#include +#include +#include + +/* + * Firmware boot and version + */ + +#define SOF_IPC_MAX_ELEMS 16 + +/* + * Firmware boot info flag bits (64-bit) + */ +#define SOF_IPC_INFO_BUILD BIT(0) +#define SOF_IPC_INFO_LOCKS BIT(1) +#define SOF_IPC_INFO_LOCKSV BIT(2) +#define SOF_IPC_INFO_GDB BIT(3) + +/* extended data types that can be appended onto end of sof_ipc_fw_ready */ +enum sof_ipc_ext_data { + SOF_IPC_EXT_DMA_BUFFER = 0, + SOF_IPC_EXT_WINDOW, +}; + +/* FW version - SOF_IPC_GLB_VERSION */ +struct sof_ipc_fw_version { + struct sof_ipc_hdr hdr; + uint16_t major; + uint16_t minor; + uint16_t micro; + uint16_t build; + uint8_t date[12]; + uint8_t time[10]; + uint8_t tag[6]; + uint32_t abi_version; + + /* reserved for future use */ + uint32_t reserved[4]; +} __attribute__((packed)); + +/* FW ready Message - sent by firmware when boot has completed */ +struct sof_ipc_fw_ready { + struct sof_ipc_cmd_hdr hdr; + uint32_t dspbox_offset; /* dsp initiated IPC mailbox */ + uint32_t hostbox_offset; /* host initiated IPC mailbox */ + uint32_t dspbox_size; + uint32_t hostbox_size; + struct sof_ipc_fw_version version; + + /* Miscellaneous flags */ + uint64_t flags; + + /* reserved for future use */ + uint32_t reserved[4]; +} __attribute__((packed)); + +/* + * Extended Firmware data. All optional, depends on platform/arch. + */ +enum sof_ipc_region { + SOF_IPC_REGION_DOWNBOX = 0, + SOF_IPC_REGION_UPBOX, + SOF_IPC_REGION_TRACE, + SOF_IPC_REGION_DEBUG, + SOF_IPC_REGION_STREAM, + SOF_IPC_REGION_REGS, + SOF_IPC_REGION_EXCEPTION, +}; + +struct sof_ipc_ext_data_hdr { + struct sof_ipc_cmd_hdr hdr; + uint32_t type; /**< SOF_IPC_EXT_ */ +} __attribute__((packed)); + +struct sof_ipc_dma_buffer_elem { + struct sof_ipc_hdr hdr; + uint32_t type; /**< SOF_IPC_REGION_ */ + uint32_t id; /**< platform specific - used to map to host memory */ + struct sof_ipc_host_buffer buffer; +} __attribute__((packed)); + +/* extended data DMA buffers for IPC, trace and debug */ +struct sof_ipc_dma_buffer_data { + struct sof_ipc_ext_data_hdr ext_hdr; + uint32_t num_buffers; + + /* host files in buffer[n].buffer */ + struct sof_ipc_dma_buffer_elem buffer[]; +} __attribute__((packed)); + +struct sof_ipc_window_elem { + struct sof_ipc_hdr hdr; + uint32_t type; /**< SOF_IPC_REGION_ */ + uint32_t id; /**< platform specific - used to map to host memory */ + uint32_t flags; /**< R, W, RW, etc - to define */ + uint32_t size; /**< size of region in bytes */ + /* offset in window region as windows can be partitioned */ + uint32_t offset; +} __attribute__((packed)); + +/* extended data memory windows for IPC, trace and debug */ +struct sof_ipc_window { + struct sof_ipc_ext_data_hdr ext_hdr; + uint32_t num_windows; + struct sof_ipc_window_elem window[]; +} __attribute__((packed)); + +#endif /* __IPC_INFO_H__ */ diff --git a/src/include/sof/ipc/stream.h b/src/include/sof/ipc/stream.h new file mode 100644 index 000000000000..ba10a41f50c8 --- /dev/null +++ b/src/include/sof/ipc/stream.h @@ -0,0 +1,156 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/** + * \file include/ipc/stream.h + * \brief IPC definitions for streams. + * \author Liam Girdwood + * \author Keyon Jie + */ + +#ifndef __IPC_STREAM_H__ +#define __IPC_STREAM_H__ + +#include +#include + +/* + * Stream configuration. + */ + +#define SOF_IPC_MAX_CHANNELS 8 + +/* common sample rates for use in masks */ +#define SOF_RATE_8000 (1 << 0) /**< 8000Hz */ +#define SOF_RATE_11025 (1 << 1) /**< 11025Hz */ +#define SOF_RATE_12000 (1 << 2) /**< 12000Hz */ +#define SOF_RATE_16000 (1 << 3) /**< 16000Hz */ +#define SOF_RATE_22050 (1 << 4) /**< 22050Hz */ +#define SOF_RATE_24000 (1 << 5) /**< 24000Hz */ +#define SOF_RATE_32000 (1 << 6) /**< 32000Hz */ +#define SOF_RATE_44100 (1 << 7) /**< 44100Hz */ +#define SOF_RATE_48000 (1 << 8) /**< 48000Hz */ +#define SOF_RATE_64000 (1 << 9) /**< 64000Hz */ +#define SOF_RATE_88200 (1 << 10) /**< 88200Hz */ +#define SOF_RATE_96000 (1 << 11) /**< 96000Hz */ +#define SOF_RATE_176400 (1 << 12) /**< 176400Hz */ +#define SOF_RATE_192000 (1 << 13) /**< 192000Hz */ + +/* continuous and non-standard rates for flexibility */ +#define SOF_RATE_CONTINUOUS (1 << 30) /**< range */ +#define SOF_RATE_KNOT (1 << 31) /**< non-continuous */ + +/* generic PCM flags for runtime settings */ +#define SOF_PCM_FLAG_XRUN_STOP (1 << 0) /**< Stop on any XRUN */ + +/* stream PCM frame format */ +enum sof_ipc_frame { + SOF_IPC_FRAME_S16_LE = 0, + SOF_IPC_FRAME_S24_4LE, + SOF_IPC_FRAME_S32_LE, + SOF_IPC_FRAME_FLOAT, + /* other formats here */ +}; + +/* stream buffer format */ +enum sof_ipc_buffer_format { + SOF_IPC_BUFFER_INTERLEAVED, + SOF_IPC_BUFFER_NONINTERLEAVED, + /* other formats here */ +}; + +/* stream direction */ +enum sof_ipc_stream_direction { + SOF_IPC_STREAM_PLAYBACK = 0, + SOF_IPC_STREAM_CAPTURE, +}; + +/* stream ring info */ +struct sof_ipc_host_buffer { + struct sof_ipc_hdr hdr; + uint32_t phy_addr; + uint32_t pages; + uint32_t size; + uint32_t reserved[3]; +} __attribute__((packed)); + +struct sof_ipc_stream_params { + struct sof_ipc_hdr hdr; + struct sof_ipc_host_buffer buffer; + uint32_t direction; /**< enum sof_ipc_stream_direction */ + uint32_t frame_fmt; /**< enum sof_ipc_frame */ + uint32_t buffer_fmt; /**< enum sof_ipc_buffer_format */ + uint32_t rate; + uint16_t stream_tag; + uint16_t channels; + uint16_t sample_valid_bytes; + uint16_t sample_container_bytes; + + uint32_t host_period_bytes; + uint16_t no_stream_position; /**< 1 means don't send stream position */ + + uint16_t reserved[3]; + uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ +} __attribute__((packed)); + +/* PCM params info - SOF_IPC_STREAM_PCM_PARAMS */ +struct sof_ipc_pcm_params { + struct sof_ipc_cmd_hdr hdr; + uint32_t comp_id; + uint32_t flags; /**< generic PCM flags - SOF_PCM_FLAG_ */ + uint32_t reserved[2]; + struct sof_ipc_stream_params params; +} __attribute__((packed)); + +/* PCM params info reply - SOF_IPC_STREAM_PCM_PARAMS_REPLY */ +struct sof_ipc_pcm_params_reply { + struct sof_ipc_reply rhdr; + uint32_t comp_id; + uint32_t posn_offset; +} __attribute__((packed)); + +/* free stream - SOF_IPC_STREAM_PCM_PARAMS */ +struct sof_ipc_stream { + struct sof_ipc_cmd_hdr hdr; + uint32_t comp_id; +} __attribute__((packed)); + +/* flags indicating which time stamps are in sync with each other */ +#define SOF_TIME_HOST_SYNC (1 << 0) +#define SOF_TIME_DAI_SYNC (1 << 1) +#define SOF_TIME_WALL_SYNC (1 << 2) +#define SOF_TIME_STAMP_SYNC (1 << 3) + +/* flags indicating which time stamps are valid */ +#define SOF_TIME_HOST_VALID (1 << 8) +#define SOF_TIME_DAI_VALID (1 << 9) +#define SOF_TIME_WALL_VALID (1 << 10) +#define SOF_TIME_STAMP_VALID (1 << 11) + +/* flags indicating time stamps are 64bit else 3use low 32bit */ +#define SOF_TIME_HOST_64 (1 << 16) +#define SOF_TIME_DAI_64 (1 << 17) +#define SOF_TIME_WALL_64 (1 << 18) +#define SOF_TIME_STAMP_64 (1 << 19) + +struct sof_ipc_stream_posn { + struct sof_ipc_reply rhdr; + uint32_t comp_id; /**< host component ID */ + uint32_t flags; /**< SOF_TIME_ */ + uint32_t wallclock_hz; /**< frequency of wallclock in Hz */ + uint32_t timestamp_ns; /**< resolution of timestamp in ns */ + uint64_t host_posn; /**< host DMA position in bytes */ + uint64_t dai_posn; /**< DAI DMA position in bytes */ + uint64_t comp_posn; /**< comp position in bytes */ + uint64_t wallclock; /**< audio wall clock */ + uint64_t timestamp; /**< system time stamp */ + uint32_t xrun_comp_id; /**< comp ID of XRUN component */ + int32_t xrun_size; /**< XRUN size in bytes */ +} __attribute__((packed)); + +#endif /* __IPC_STREAM_H__ */ diff --git a/src/include/sof/kernel/fw.h b/src/include/sof/kernel/fw.h new file mode 100644 index 000000000000..2c0a123d23b7 --- /dev/null +++ b/src/include/sof/kernel/fw.h @@ -0,0 +1,80 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + * Keyon Jie + */ + +/* + * Firmware file format . + */ + +#ifndef __KERNEL_FW_H__ +#define __KERNEL_FW_H__ + +#include + +#define SND_SOF_FW_SIG_SIZE 4 +#define SND_SOF_FW_ABI 1 +#define SND_SOF_FW_SIG "Reef" + +/* + * Firmware module is made up of 1 . N blocks of different types. The + * Block header is used to determine where and how block is to be copied in the + * DSP/host memory space. + */ +enum snd_sof_fw_blk_type { + SOF_FW_BLK_TYPE_INVALID = -1, + SOF_FW_BLK_TYPE_START = 0, + SOF_FW_BLK_TYPE_RSRVD0 = SOF_FW_BLK_TYPE_START, + SOF_FW_BLK_TYPE_IRAM = 1, /* local instruction RAM */ + SOF_FW_BLK_TYPE_DRAM = 2, /* local data RAM */ + SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */ + SOF_FW_BLK_TYPE_ROM = 4, + SOF_FW_BLK_TYPE_IMR = 5, + SOF_FW_BLK_TYPE_RSRVD6 = 6, + SOF_FW_BLK_TYPE_RSRVD7 = 7, + SOF_FW_BLK_TYPE_RSRVD8 = 8, + SOF_FW_BLK_TYPE_RSRVD9 = 9, + SOF_FW_BLK_TYPE_RSRVD10 = 10, + SOF_FW_BLK_TYPE_RSRVD11 = 11, + SOF_FW_BLK_TYPE_RSRVD12 = 12, + SOF_FW_BLK_TYPE_RSRVD13 = 13, + SOF_FW_BLK_TYPE_RSRVD14 = 14, + /* use SOF_FW_BLK_TYPE_RSVRDX for new block types */ + SOF_FW_BLK_TYPE_NUM +}; + +struct snd_sof_blk_hdr { + enum snd_sof_fw_blk_type type; + uint32_t size; /* bytes minus this header */ + uint32_t offset; /* offset from base */ +} __attribute__((packed)); + +/* + * Firmware file is made up of 1 .. N different modules types. The module + * type is used to determine how to load and parse the module. + */ +enum snd_sof_fw_mod_type { + SOF_FW_BASE = 0, /* base firmware image */ + SOF_FW_MODULE = 1, /* firmware module */ +}; + +struct snd_sof_mod_hdr { + enum snd_sof_fw_mod_type type; + uint32_t size; /* bytes minus this header */ + uint32_t num_blocks; /* number of blocks */ +} __attribute__((packed)); + +/* + * Firmware file header. + */ +struct snd_sof_fw_header { + unsigned char sig[SND_SOF_FW_SIG_SIZE]; /* "Reef" */ + uint32_t file_size; /* size of file minus this header */ + uint32_t num_modules; /* number of modules */ + uint32_t abi; /* version of header format */ +} __attribute__((packed)); + +#endif /* __KERNEL_FW_H__ */ diff --git a/src/include/sof/user/manifest.h b/src/include/sof/user/manifest.h new file mode 100644 index 000000000000..bd598f907efe --- /dev/null +++ b/src/include/sof/user/manifest.h @@ -0,0 +1,228 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood + */ + +/** + * \file include/user/manifest.h + * \brief FW Image Manifest definitions. + * \author Liam Girdwood + */ + +#ifndef __USER_MANIFEST_H__ +#define __USER_MANIFEST_H__ + +#include + +/* start offset for base FW module */ +#define SOF_MAN_ELF_TEXT_OFFSET 0x2000 + +/* FW Extended Manifest Header id = $AE1 */ +#define SOF_MAN_EXT_HEADER_MAGIC 0x31454124 + +/* module type load type */ +#define SOF_MAN_MOD_TYPE_BUILTIN 0 +#define SOF_MAN_MOD_TYPE_MODULE 1 + +struct sof_man_module_type { + uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ + uint32_t auto_start:1; + uint32_t domain_ll:1; + uint32_t domain_dp:1; + uint32_t rsvd_:25; +}; + +/* segment flags.type */ +#define SOF_MAN_SEGMENT_TEXT 0 +#define SOF_MAN_SEGMENT_RODATA 1 +#define SOF_MAN_SEGMENT_DATA 1 +#define SOF_MAN_SEGMENT_BSS 2 +#define SOF_MAN_SEGMENT_EMPTY 15 + +union sof_man_segment_flags { + uint32_t ul; + struct { + uint32_t contents:1; + uint32_t alloc:1; + uint32_t load:1; + uint32_t readonly:1; + uint32_t code:1; + uint32_t data:1; + uint32_t _rsvd0:2; + uint32_t type:4; /* MAN_SEGMENT_ */ + uint32_t _rsvd1:4; + uint32_t length:16; /* of segment in pages */ + } r; +} __attribute__((packed)); + +/* + * Module segment descriptor. Used by ROM - Immutable. + */ +struct sof_man_segment_desc { + union sof_man_segment_flags flags; + uint32_t v_base_addr; + uint32_t file_offset; +} __attribute__((packed)); + +/* + * The firmware binary can be split into several modules. + */ + +#define SOF_MAN_MOD_ID_LEN 4 +#define SOF_MAN_MOD_NAME_LEN 8 +#define SOF_MAN_MOD_SHA256_LEN 32 +#define SOF_MAN_MOD_ID {'$', 'A', 'M', 'E'} + +/* + * Each module has an entry in the FW header. Used by ROM - Immutable. + */ +struct sof_man_module { + uint8_t struct_id[SOF_MAN_MOD_ID_LEN]; /* SOF_MAN_MOD_ID */ + uint8_t name[SOF_MAN_MOD_NAME_LEN]; + uint8_t uuid[16]; + struct sof_man_module_type type; + uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; + uint32_t entry_point; + uint16_t cfg_offset; + uint16_t cfg_count; + uint32_t affinity_mask; + uint16_t instance_max_count; /* max number of instances */ + uint16_t instance_bss_size; /* instance (pages) */ + struct sof_man_segment_desc segment[3]; +} __attribute__((packed)); + +/* + * Each module has a configuration in the FW header. Used by ROM - Immutable. + */ +struct sof_man_mod_config { + uint32_t par[4]; /* module parameters */ + uint32_t is_pages; /* actual size of instance .bss (pages) */ + uint32_t cps; /* cycles per second */ + uint32_t ibs; /* input buffer size (bytes) */ + uint32_t obs; /* output buffer size (bytes) */ + uint32_t module_flags; /* flags, reserved for future use */ + uint32_t cpc; /* cycles per single run */ + uint32_t obls; /* output block size, reserved for future use */ +} __attribute__((packed)); + +/* + * FW Manifest Header + */ + +#define SOF_MAN_FW_HDR_FW_NAME_LEN 8 +#define SOF_MAN_FW_HDR_ID {'$', 'A', 'M', '1'} +#define SOF_MAN_FW_HDR_NAME "ADSPFW" +#define SOF_MAN_FW_HDR_FLAGS 0x0 +#define SOF_MAN_FW_HDR_FEATURES 0x1ff + +/* + * The firmware has a standard header that is checked by the ROM on firmware + * loading. preload_page_count is used by DMA code loader and is entire + * image size on CNL. i.e. CNL: total size of the binary’s .text and .rodata + * Used by ROM - Immutable. + */ +struct sof_man_fw_header { + uint8_t header_id[4]; + uint32_t header_len; + uint8_t name[SOF_MAN_FW_HDR_FW_NAME_LEN]; + /* number of pages of preloaded image loaded by driver */ + uint32_t preload_page_count; + uint32_t fw_image_flags; + uint32_t feature_mask; + uint16_t major_version; + uint16_t minor_version; + uint16_t hotfix_version; + uint16_t build_version; + uint32_t num_module_entries; + uint32_t hw_buf_base_addr; + uint32_t hw_buf_length; + /* target address for binary loading as offset in IMR - must be == base offset */ + uint32_t load_offset; +} __attribute__((packed)); + +/* + * Firmware manifest descriptor. This can contain N modules and N module + * configs. Used by ROM - Immutable. + */ +struct sof_man_fw_desc { + struct sof_man_fw_header header; + + /* Warning - hack for module arrays. For some unknown reason the we + * have a variable size array of struct man_module followed by a + * variable size array of struct mod_config. These should have been + * merged into a variable array of a parent structure. We have to hack + * around this in many places.... + * + * struct sof_man_module man_module[]; + * struct sof_man_mod_config mod_config[]; + */ + +} __attribute__((packed)); + +#define SOF_MAN_COMP_SHA256_LEN 32 +#define SOF_MAN_COMP_SHA384_LEN 48 + +/* + * Component Descriptor for manifest v1.8. Used by ROM - Immutable. + */ +struct sof_man_component_desc_v1_8 { + uint32_t reserved[2]; /* all 0 */ + uint32_t version; + uint8_t hash[SOF_MAN_COMP_SHA256_LEN]; + uint32_t base_offset; + uint32_t limit_offset; + uint32_t attributes[4]; +} __attribute__((packed)); + +/* + * Audio DSP extended metadata for manifest v1.8. Used by ROM - Immutable. + */ +struct sof_man_adsp_meta_file_ext_v1_8 { + uint32_t ext_type; /* always 17 for ADSP extension */ + uint32_t ext_len; + uint32_t imr_type; + uint8_t reserved[16]; /* all 0 */ + struct sof_man_component_desc_v1_8 comp_desc[1]; +} __attribute__((packed)); + +/* + * Component Descriptor for manifest v2.5. Used by ROM - Immutable. + */ +struct sof_man_component_desc_v2_5 { + uint32_t reserved[2]; /* all 0 */ + uint32_t version; + uint8_t hash[SOF_MAN_COMP_SHA384_LEN]; + uint32_t base_offset; + uint32_t limit_offset; + uint32_t attributes[4]; +} __attribute__((packed)); + +/* + * Audio DSP extended metadata for manifest v2.5. Used by ROM - Immutable. + */ +struct sof_man_adsp_meta_file_ext_v2_5 { + uint32_t ext_type; /* always 17 for ADSP extension */ + uint32_t ext_len; + uint32_t imr_type; + uint8_t reserved[16]; /* all 0 */ + struct sof_man_component_desc_v2_5 comp_desc[1]; +} __attribute__((packed)); + +/* + * Module Manifest for rimage module metadata. Not used by ROM. + */ +struct sof_man_module_manifest { + struct sof_man_module module; + uint32_t text_size; +}; + +/* + * Module offset in manifest. + */ +#define SOF_MAN_MODULE_OFFSET(index) \ + (sizeof(struct sof_man_fw_header) + \ + (index) * sizeof(struct sof_man_module)) + +#endif /* __USER_MANIFEST_H__ */ From e94452934f0c7aece4981c7d7657a5bc04d2c00c Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 13:22:02 -0700 Subject: [PATCH 093/639] Do not include version.h The #define in version.h will be passed as command line argument instead, as the tool has to build on its own. Signed-off-by: Daniel Leung --- src/man_apl.c | 1 - src/man_cnl.c | 1 - src/man_kbl.c | 1 - src/man_sue.c | 1 - src/man_tgl.c | 1 - 5 files changed, 5 deletions(-) diff --git a/src/man_apl.c b/src/man_apl.c index 7618fb2c576a..b8365b4c3738 100644 --- a/src/man_apl.c +++ b/src/man_apl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v1_8 apl_manifest = { diff --git a/src/man_cnl.c b/src/man_cnl.c index 575c2c8e6451..264beaf77a86 100644 --- a/src/man_cnl.c +++ b/src/man_cnl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v1_8 cnl_manifest = { diff --git a/src/man_kbl.c b/src/man_kbl.c index 5c37f876c71a..5bd66964f203 100644 --- a/src/man_kbl.c +++ b/src/man_kbl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* * TODO: check if all platform for 1.5 are the same base and length. diff --git a/src/man_sue.c b/src/man_sue.c index 225ca519f4dd..db4bfd600235 100644 --- a/src/man_sue.c +++ b/src/man_sue.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v1_5_sue sue_manifest = { diff --git a/src/man_tgl.c b/src/man_tgl.c index 83877e198af7..6f8871ce25d2 100644 --- a/src/man_tgl.c +++ b/src/man_tgl.c @@ -6,7 +6,6 @@ #include "cse.h" #include "plat_auth.h" #include "manifest.h" -#include /* manifest template */ struct fw_image_manifest_v2_5 tgl_manifest = { From d821534fed3fac53fc8cf3ac6a7d0df8b6c40593 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 13:29:54 -0700 Subject: [PATCH 094/639] Remove PEM_KEY_PREFIX and always requires key as cmd argument This removes the macro PEM_KEY_PREFIX and make rimage to always require key to be specified in command line. Signed-off-by: Daniel Leung --- src/pkcs1_5.c | 26 ++++++++++++++------------ src/rimage.c | 6 ++++++ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 4da4d4877284..a55abb9d33c3 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -78,18 +78,19 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, ptr1 - (void *)man, size1); #endif + /* requires private key */ + if (!image->key_name) { + return -EINVAL; + } + /* create new key */ privkey = EVP_PKEY_new(); if (!privkey) return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) { - snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); - } else { - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - } + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); @@ -172,18 +173,19 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + /* create new key */ privkey = EVP_PKEY_new(); if (!privkey) return -ENOMEM; /* load in RSA private key from PEM file */ - if (!image->key_name) { - snprintf(path, sizeof(path), "%s/otc_private_key.pem", PEM_KEY_PREFIX); - } else { - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - } + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); fprintf(stdout, " pkcs: signing with key %s\n", path); fp = fopen(path, "rb"); diff --git a/src/rimage.c b/src/rimage.c index 5d18b96d9569..03e265ec6e3e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -102,6 +102,12 @@ int main(int argc, char *argv[]) if (!image.ldc_out_file) image.ldc_out_file = "out.ldc"; + /* requires private key */ + if (!image.key_name) { + fprintf(stderr, "error: requires private key\n"); + return -EINVAL; + } + /* find machine */ for (i = 0; i < ARRAY_SIZE(machine); i++) { if (!strcmp(mach, machine[i]->name)) { From 5bf839e99598712fa1f9ef18b0fc8424bbca6367 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 17:55:19 -0700 Subject: [PATCH 095/639] Make log dictionary output optional Signed-off-by: Daniel Leung --- src/file_simple.c | 7 +- src/hash.c | 1 - src/include/rimage/file_format.h | 31 ---- src/include/rimage/rimage.h | 8 +- src/include/sof/ipc/header.h | 241 ------------------------------- src/include/sof/ipc/info.h | 126 ---------------- src/include/sof/ipc/stream.h | 156 -------------------- src/manifest.c | 1 - src/rimage.c | 16 +- 9 files changed, 28 insertions(+), 559 deletions(-) delete mode 100644 src/include/rimage/file_format.h delete mode 100644 src/include/sof/ipc/header.h delete mode 100644 src/include/sof/ipc/info.h delete mode 100644 src/include/sof/ipc/stream.h diff --git a/src/file_simple.c b/src/file_simple.c index be64c7d8aaa7..8cdd05924537 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -8,8 +8,11 @@ #include #include +#ifdef HAS_FILE_FORMAT_H +#include +#endif /* HAS_FILE_FORMAT_H */ + #include "rimage.h" -#include "file_format.h" #define BYT_IRAM_BASE 0xff2c0000 #define BYT_IRAM_HOST_OFFSET 0x0C0000 @@ -366,6 +369,7 @@ static int simple_write_firmware(struct image *image) return 0; } +#ifdef HAS_FILE_FORMAT_H int write_logs_dictionary(struct image *image) { struct snd_sof_logs_header header; @@ -455,6 +459,7 @@ int write_logs_dictionary(struct image *image) return ret; } +#endif /* HAS_FILE_FORMAT_H */ const struct adsp machine_byt = { .name = "byt", diff --git a/src/hash.c b/src/hash.c index 24d11a27b94c..62c4e2f3540b 100644 --- a/src/hash.c +++ b/src/hash.c @@ -18,7 +18,6 @@ #include #include "rimage.h" -#include "file_format.h" #include "manifest.h" #if OPENSSL_VERSION_NUMBER < 0x10100000L diff --git a/src/include/rimage/file_format.h b/src/include/rimage/file_format.h deleted file mode 100644 index b0cea780d6f7..000000000000 --- a/src/include/rimage/file_format.h +++ /dev/null @@ -1,31 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2017 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - */ - -/* - * Firmware file format . - */ - -#ifndef __INCLUDE_FILE_FORMAT_H__ -#define __INCLUDE_FILE_FORMAT_H__ - -#include -#include - -#define SND_SOF_LOGS_SIG_SIZE 4 -#define SND_SOF_LOGS_SIG "Logs" - -/* - * Logs dictionary file header. - */ -struct snd_sof_logs_header { - unsigned char sig[SND_SOF_LOGS_SIG_SIZE]; /* "Logs" */ - uint32_t base_address; /* address of log entries section */ - uint32_t data_length; /* amount of bytes following this header */ - uint32_t data_offset; /* offset to first entry in this file */ - struct sof_ipc_fw_version version; -}; -#endif diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 9c3cf8e3537b..c1015256164d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -92,9 +92,13 @@ struct module { struct image { const char *out_file; - const char *ldc_out_file; FILE *out_fd; + +#ifdef HAS_FILE_FORMAT_H + const char *ldc_out_file; FILE *ldc_out_fd; +#endif /* HAS_FILE_FORMAT_H */ + void *pos; const struct adsp *adsp; @@ -149,7 +153,9 @@ struct adsp { int exec_boot_ldr; }; +#ifdef HAS_FILE_FORMAT_H int write_logs_dictionary(struct image *image); +#endif /* HAS_FILE_FORMAT_H */ void module_sha256_create(struct image *image); void module_sha_update(struct image *image, uint8_t *data, size_t bytes); diff --git a/src/include/sof/ipc/header.h b/src/include/sof/ipc/header.h deleted file mode 100644 index 3726c38a78a0..000000000000 --- a/src/include/sof/ipc/header.h +++ /dev/null @@ -1,241 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2016 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - * Keyon Jie - */ - -/** - * \file include/ipc/header.h - * \brief IPC command header - * \author Liam Girdwood - * \author Keyon Jie - */ - -#ifndef __IPC_HEADER_H__ -#define __IPC_HEADER_H__ - -#include - -/** \addtogroup sof_uapi uAPI - * SOF uAPI specification. - * - * IPC messages have a prefixed 32 bit identifier made up as follows :- - * - * 0xGCCCNNNN where - * - G is global cmd type (4 bits) - * - C is command type (12 bits) - * - N is the ID number (16 bits) - monotonic and overflows - * - * This is sent at the start of the IPM message in the mailbox. Messages should - * not be sent in the doorbell (special exceptions for firmware). - - * @{ - */ - -/** \name Global Message - Generic - * @{ - */ - -/** Shift-left bits to extract the global cmd type */ -#define SOF_GLB_TYPE_SHIFT 28 -#define SOF_GLB_TYPE_MASK (0xf << SOF_GLB_TYPE_SHIFT) -#define SOF_GLB_TYPE(x) ((x) << SOF_GLB_TYPE_SHIFT) - -/** @} */ - -/** \name Command Message - Generic - * @{ - */ - -/** Shift-left bits to extract the command type */ -#define SOF_CMD_TYPE_SHIFT 16 -#define SOF_CMD_TYPE_MASK (0xfff << SOF_CMD_TYPE_SHIFT) -#define SOF_CMD_TYPE(x) ((x) << SOF_CMD_TYPE_SHIFT) - -/** @} */ - -/** \name Global Message Types - * @{ - */ - -#define SOF_IPC_GLB_REPLY SOF_GLB_TYPE(0x1U) -#define SOF_IPC_GLB_COMPOUND SOF_GLB_TYPE(0x2U) -#define SOF_IPC_GLB_TPLG_MSG SOF_GLB_TYPE(0x3U) -#define SOF_IPC_GLB_PM_MSG SOF_GLB_TYPE(0x4U) -#define SOF_IPC_GLB_COMP_MSG SOF_GLB_TYPE(0x5U) -#define SOF_IPC_GLB_STREAM_MSG SOF_GLB_TYPE(0x6U) -#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U) -#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U) -#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U) -#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU) -#define SOF_IPC_GLB_TEST SOF_GLB_TYPE(0xBU) - -/** @} */ - -/** \name DSP Command: Topology - * \anchor tplg_cmd_type - * @{ - */ - -#define SOF_IPC_TPLG_COMP_NEW SOF_CMD_TYPE(0x001) -#define SOF_IPC_TPLG_COMP_FREE SOF_CMD_TYPE(0x002) -#define SOF_IPC_TPLG_COMP_CONNECT SOF_CMD_TYPE(0x003) -#define SOF_IPC_TPLG_PIPE_NEW SOF_CMD_TYPE(0x010) -#define SOF_IPC_TPLG_PIPE_FREE SOF_CMD_TYPE(0x011) -#define SOF_IPC_TPLG_PIPE_CONNECT SOF_CMD_TYPE(0x012) -#define SOF_IPC_TPLG_PIPE_COMPLETE SOF_CMD_TYPE(0x013) -#define SOF_IPC_TPLG_BUFFER_NEW SOF_CMD_TYPE(0x020) -#define SOF_IPC_TPLG_BUFFER_FREE SOF_CMD_TYPE(0x021) - -/** @} */ - -/** \name DSP Command: PM - * @{ - */ - -#define SOF_IPC_PM_CTX_SAVE SOF_CMD_TYPE(0x001) -#define SOF_IPC_PM_CTX_RESTORE SOF_CMD_TYPE(0x002) -#define SOF_IPC_PM_CTX_SIZE SOF_CMD_TYPE(0x003) -#define SOF_IPC_PM_CLK_SET SOF_CMD_TYPE(0x004) -#define SOF_IPC_PM_CLK_GET SOF_CMD_TYPE(0x005) -#define SOF_IPC_PM_CLK_REQ SOF_CMD_TYPE(0x006) -#define SOF_IPC_PM_CORE_ENABLE SOF_CMD_TYPE(0x007) -#define SOF_IPC_PM_GATE SOF_CMD_TYPE(0x008) - -/** \name DSP Command: Component runtime config - multiple different types - * @{ - */ - -#define SOF_IPC_COMP_SET_VALUE SOF_CMD_TYPE(0x001) -#define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002) -#define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003) -#define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004) -#define SOF_IPC_COMP_NOTIFICATION SOF_CMD_TYPE(0x005) - -/** @} */ - -/** \name DSP Command: DAI messages - * @{ - */ -#define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001) -#define SOF_IPC_DAI_LOOPBACK SOF_CMD_TYPE(0x002) - -/** @} */ - -/** \name DSP Command: Stream - * @{ - */ -#define SOF_IPC_STREAM_PCM_PARAMS SOF_CMD_TYPE(0x001) -#define SOF_IPC_STREAM_PCM_PARAMS_REPLY SOF_CMD_TYPE(0x002) -#define SOF_IPC_STREAM_PCM_FREE SOF_CMD_TYPE(0x003) -#define SOF_IPC_STREAM_TRIG_START SOF_CMD_TYPE(0x004) -#define SOF_IPC_STREAM_TRIG_STOP SOF_CMD_TYPE(0x005) -#define SOF_IPC_STREAM_TRIG_PAUSE SOF_CMD_TYPE(0x006) -#define SOF_IPC_STREAM_TRIG_RELEASE SOF_CMD_TYPE(0x007) -#define SOF_IPC_STREAM_TRIG_DRAIN SOF_CMD_TYPE(0x008) -#define SOF_IPC_STREAM_TRIG_XRUN SOF_CMD_TYPE(0x009) -#define SOF_IPC_STREAM_POSITION SOF_CMD_TYPE(0x00a) -#define SOF_IPC_STREAM_VORBIS_PARAMS SOF_CMD_TYPE(0x010) -#define SOF_IPC_STREAM_VORBIS_FREE SOF_CMD_TYPE(0x011) - -/** @} */ - -/** \name DSP Command: Trace and debug - * @{ - */ - -#define SOF_IPC_TRACE_DMA_PARAMS SOF_CMD_TYPE(0x001) -#define SOF_IPC_TRACE_DMA_POSITION SOF_CMD_TYPE(0x002) -#define SOF_IPC_TRACE_DMA_PARAMS_EXT SOF_CMD_TYPE(0x003) - -/** @} */ - -/** \name DSP Command: Test - Debug build only - * @{ - */ - -#define SOF_IPC_TEST_IPC_FLOOD SOF_CMD_TYPE(0x001) - -/** @} */ - -/** \name IPC Message Definitions - * @{ - */ - -/** Get message component id */ -#define SOF_IPC_MESSAGE_ID(x) ((x) & 0xffff) - -/** Maximum message size for mailbox Tx/Rx */ -#define SOF_IPC_MSG_MAX_SIZE 384 - -/** @} */ - -/** - * Structure Header - Header for all IPC structures except command structs. - * The size can be greater than the structure size and that means there is - * extended bespoke data beyond the end of the structure including variable - * arrays. - */ -struct sof_ipc_hdr { - uint32_t size; /**< size of structure */ -} __attribute__((packed)); - -/** - * Command Header - Header for all IPC commands. Identifies IPC message. - * The size can be greater than the structure size and that means there is - * extended bespoke data beyond the end of the structure including variable - * arrays. - */ -struct sof_ipc_cmd_hdr { - uint32_t size; /**< size of structure */ - uint32_t cmd; /**< SOF_IPC_GLB_ + cmd */ -} __attribute__((packed)); - -/** - * Generic reply message. Some commands override this with their own reply - * types that must include this at start. - */ -struct sof_ipc_reply { - struct sof_ipc_cmd_hdr hdr; - int32_t error; /**< negative error numbers */ -} __attribute__((packed)); - -/** - * Compound commands - SOF_IPC_GLB_COMPOUND. - * - * Compound commands are sent to the DSP as a single IPC operation. The - * commands are split into blocks and each block has a header. This header - * identifies the command type and the number of commands before the next - * header. - */ -struct sof_ipc_compound_hdr { - struct sof_ipc_cmd_hdr hdr; - uint32_t count; /**< count of 0 means end of compound sequence */ -} __attribute__((packed)); - -/** - * OOPS header architecture specific data. - */ -struct sof_ipc_dsp_oops_arch_hdr { - uint32_t arch; /* Identifier of architecture */ - uint32_t totalsize; /* Total size of oops message */ -} __attribute__((packed)); - -/** - * OOPS header platform specific data. - */ -struct sof_ipc_dsp_oops_plat_hdr { - uint32_t configidhi; /* ConfigID hi 32bits */ - uint32_t configidlo; /* ConfigID lo 32bits */ - uint32_t numaregs; /* Special regs num */ - uint32_t stackoffset; /* Offset to stack pointer from beginning of - * oops message - */ - uint32_t stackptr; /* Stack ptr */ -} __attribute__((packed)); - -/** @}*/ - -#endif /* __IPC_HEADER_H__ */ diff --git a/src/include/sof/ipc/info.h b/src/include/sof/ipc/info.h deleted file mode 100644 index d34ba914954e..000000000000 --- a/src/include/sof/ipc/info.h +++ /dev/null @@ -1,126 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2018 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - * Keyon Jie - */ - -/** - * \file include/ipc/info.h - * \brief IPC definitions - * \author Liam Girdwood - * \author Keyon Jie - */ - -#ifndef __IPC_INFO_H__ -#define __IPC_INFO_H__ - -#include -#include -#include - -/* - * Firmware boot and version - */ - -#define SOF_IPC_MAX_ELEMS 16 - -/* - * Firmware boot info flag bits (64-bit) - */ -#define SOF_IPC_INFO_BUILD BIT(0) -#define SOF_IPC_INFO_LOCKS BIT(1) -#define SOF_IPC_INFO_LOCKSV BIT(2) -#define SOF_IPC_INFO_GDB BIT(3) - -/* extended data types that can be appended onto end of sof_ipc_fw_ready */ -enum sof_ipc_ext_data { - SOF_IPC_EXT_DMA_BUFFER = 0, - SOF_IPC_EXT_WINDOW, -}; - -/* FW version - SOF_IPC_GLB_VERSION */ -struct sof_ipc_fw_version { - struct sof_ipc_hdr hdr; - uint16_t major; - uint16_t minor; - uint16_t micro; - uint16_t build; - uint8_t date[12]; - uint8_t time[10]; - uint8_t tag[6]; - uint32_t abi_version; - - /* reserved for future use */ - uint32_t reserved[4]; -} __attribute__((packed)); - -/* FW ready Message - sent by firmware when boot has completed */ -struct sof_ipc_fw_ready { - struct sof_ipc_cmd_hdr hdr; - uint32_t dspbox_offset; /* dsp initiated IPC mailbox */ - uint32_t hostbox_offset; /* host initiated IPC mailbox */ - uint32_t dspbox_size; - uint32_t hostbox_size; - struct sof_ipc_fw_version version; - - /* Miscellaneous flags */ - uint64_t flags; - - /* reserved for future use */ - uint32_t reserved[4]; -} __attribute__((packed)); - -/* - * Extended Firmware data. All optional, depends on platform/arch. - */ -enum sof_ipc_region { - SOF_IPC_REGION_DOWNBOX = 0, - SOF_IPC_REGION_UPBOX, - SOF_IPC_REGION_TRACE, - SOF_IPC_REGION_DEBUG, - SOF_IPC_REGION_STREAM, - SOF_IPC_REGION_REGS, - SOF_IPC_REGION_EXCEPTION, -}; - -struct sof_ipc_ext_data_hdr { - struct sof_ipc_cmd_hdr hdr; - uint32_t type; /**< SOF_IPC_EXT_ */ -} __attribute__((packed)); - -struct sof_ipc_dma_buffer_elem { - struct sof_ipc_hdr hdr; - uint32_t type; /**< SOF_IPC_REGION_ */ - uint32_t id; /**< platform specific - used to map to host memory */ - struct sof_ipc_host_buffer buffer; -} __attribute__((packed)); - -/* extended data DMA buffers for IPC, trace and debug */ -struct sof_ipc_dma_buffer_data { - struct sof_ipc_ext_data_hdr ext_hdr; - uint32_t num_buffers; - - /* host files in buffer[n].buffer */ - struct sof_ipc_dma_buffer_elem buffer[]; -} __attribute__((packed)); - -struct sof_ipc_window_elem { - struct sof_ipc_hdr hdr; - uint32_t type; /**< SOF_IPC_REGION_ */ - uint32_t id; /**< platform specific - used to map to host memory */ - uint32_t flags; /**< R, W, RW, etc - to define */ - uint32_t size; /**< size of region in bytes */ - /* offset in window region as windows can be partitioned */ - uint32_t offset; -} __attribute__((packed)); - -/* extended data memory windows for IPC, trace and debug */ -struct sof_ipc_window { - struct sof_ipc_ext_data_hdr ext_hdr; - uint32_t num_windows; - struct sof_ipc_window_elem window[]; -} __attribute__((packed)); - -#endif /* __IPC_INFO_H__ */ diff --git a/src/include/sof/ipc/stream.h b/src/include/sof/ipc/stream.h deleted file mode 100644 index ba10a41f50c8..000000000000 --- a/src/include/sof/ipc/stream.h +++ /dev/null @@ -1,156 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2018 Intel Corporation. All rights reserved. - * - * Author: Liam Girdwood - * Keyon Jie - */ - -/** - * \file include/ipc/stream.h - * \brief IPC definitions for streams. - * \author Liam Girdwood - * \author Keyon Jie - */ - -#ifndef __IPC_STREAM_H__ -#define __IPC_STREAM_H__ - -#include -#include - -/* - * Stream configuration. - */ - -#define SOF_IPC_MAX_CHANNELS 8 - -/* common sample rates for use in masks */ -#define SOF_RATE_8000 (1 << 0) /**< 8000Hz */ -#define SOF_RATE_11025 (1 << 1) /**< 11025Hz */ -#define SOF_RATE_12000 (1 << 2) /**< 12000Hz */ -#define SOF_RATE_16000 (1 << 3) /**< 16000Hz */ -#define SOF_RATE_22050 (1 << 4) /**< 22050Hz */ -#define SOF_RATE_24000 (1 << 5) /**< 24000Hz */ -#define SOF_RATE_32000 (1 << 6) /**< 32000Hz */ -#define SOF_RATE_44100 (1 << 7) /**< 44100Hz */ -#define SOF_RATE_48000 (1 << 8) /**< 48000Hz */ -#define SOF_RATE_64000 (1 << 9) /**< 64000Hz */ -#define SOF_RATE_88200 (1 << 10) /**< 88200Hz */ -#define SOF_RATE_96000 (1 << 11) /**< 96000Hz */ -#define SOF_RATE_176400 (1 << 12) /**< 176400Hz */ -#define SOF_RATE_192000 (1 << 13) /**< 192000Hz */ - -/* continuous and non-standard rates for flexibility */ -#define SOF_RATE_CONTINUOUS (1 << 30) /**< range */ -#define SOF_RATE_KNOT (1 << 31) /**< non-continuous */ - -/* generic PCM flags for runtime settings */ -#define SOF_PCM_FLAG_XRUN_STOP (1 << 0) /**< Stop on any XRUN */ - -/* stream PCM frame format */ -enum sof_ipc_frame { - SOF_IPC_FRAME_S16_LE = 0, - SOF_IPC_FRAME_S24_4LE, - SOF_IPC_FRAME_S32_LE, - SOF_IPC_FRAME_FLOAT, - /* other formats here */ -}; - -/* stream buffer format */ -enum sof_ipc_buffer_format { - SOF_IPC_BUFFER_INTERLEAVED, - SOF_IPC_BUFFER_NONINTERLEAVED, - /* other formats here */ -}; - -/* stream direction */ -enum sof_ipc_stream_direction { - SOF_IPC_STREAM_PLAYBACK = 0, - SOF_IPC_STREAM_CAPTURE, -}; - -/* stream ring info */ -struct sof_ipc_host_buffer { - struct sof_ipc_hdr hdr; - uint32_t phy_addr; - uint32_t pages; - uint32_t size; - uint32_t reserved[3]; -} __attribute__((packed)); - -struct sof_ipc_stream_params { - struct sof_ipc_hdr hdr; - struct sof_ipc_host_buffer buffer; - uint32_t direction; /**< enum sof_ipc_stream_direction */ - uint32_t frame_fmt; /**< enum sof_ipc_frame */ - uint32_t buffer_fmt; /**< enum sof_ipc_buffer_format */ - uint32_t rate; - uint16_t stream_tag; - uint16_t channels; - uint16_t sample_valid_bytes; - uint16_t sample_container_bytes; - - uint32_t host_period_bytes; - uint16_t no_stream_position; /**< 1 means don't send stream position */ - - uint16_t reserved[3]; - uint16_t chmap[SOF_IPC_MAX_CHANNELS]; /**< channel map - SOF_CHMAP_ */ -} __attribute__((packed)); - -/* PCM params info - SOF_IPC_STREAM_PCM_PARAMS */ -struct sof_ipc_pcm_params { - struct sof_ipc_cmd_hdr hdr; - uint32_t comp_id; - uint32_t flags; /**< generic PCM flags - SOF_PCM_FLAG_ */ - uint32_t reserved[2]; - struct sof_ipc_stream_params params; -} __attribute__((packed)); - -/* PCM params info reply - SOF_IPC_STREAM_PCM_PARAMS_REPLY */ -struct sof_ipc_pcm_params_reply { - struct sof_ipc_reply rhdr; - uint32_t comp_id; - uint32_t posn_offset; -} __attribute__((packed)); - -/* free stream - SOF_IPC_STREAM_PCM_PARAMS */ -struct sof_ipc_stream { - struct sof_ipc_cmd_hdr hdr; - uint32_t comp_id; -} __attribute__((packed)); - -/* flags indicating which time stamps are in sync with each other */ -#define SOF_TIME_HOST_SYNC (1 << 0) -#define SOF_TIME_DAI_SYNC (1 << 1) -#define SOF_TIME_WALL_SYNC (1 << 2) -#define SOF_TIME_STAMP_SYNC (1 << 3) - -/* flags indicating which time stamps are valid */ -#define SOF_TIME_HOST_VALID (1 << 8) -#define SOF_TIME_DAI_VALID (1 << 9) -#define SOF_TIME_WALL_VALID (1 << 10) -#define SOF_TIME_STAMP_VALID (1 << 11) - -/* flags indicating time stamps are 64bit else 3use low 32bit */ -#define SOF_TIME_HOST_64 (1 << 16) -#define SOF_TIME_DAI_64 (1 << 17) -#define SOF_TIME_WALL_64 (1 << 18) -#define SOF_TIME_STAMP_64 (1 << 19) - -struct sof_ipc_stream_posn { - struct sof_ipc_reply rhdr; - uint32_t comp_id; /**< host component ID */ - uint32_t flags; /**< SOF_TIME_ */ - uint32_t wallclock_hz; /**< frequency of wallclock in Hz */ - uint32_t timestamp_ns; /**< resolution of timestamp in ns */ - uint64_t host_posn; /**< host DMA position in bytes */ - uint64_t dai_posn; /**< DAI DMA position in bytes */ - uint64_t comp_posn; /**< comp position in bytes */ - uint64_t wallclock; /**< audio wall clock */ - uint64_t timestamp; /**< system time stamp */ - uint32_t xrun_comp_id; /**< comp ID of XRUN component */ - int32_t xrun_size; /**< XRUN size in bytes */ -} __attribute__((packed)); - -#endif /* __IPC_STREAM_H__ */ diff --git a/src/manifest.c b/src/manifest.c index 343a7dc59b4a..6ca41283615b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -17,7 +17,6 @@ #include #include "rimage.h" -#include "file_format.h" #include "css.h" #include "cse.h" #include "plat_auth.h" diff --git a/src/rimage.c b/src/rimage.c index 03e265ec6e3e..896fe1b7d268 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -9,7 +9,6 @@ #include #include "rimage.h" -#include "file_format.h" #include "manifest.h" static const struct adsp *machine[] = { @@ -36,7 +35,9 @@ static void usage(char *name) fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); +#ifdef HAS_FILE_FORMAT_H fprintf(stdout, "\t -p log dictionary outfile\n"); +#endif /* HAS_FILE_FORMAT_H */ fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); exit(0); @@ -59,7 +60,13 @@ int main(int argc, char *argv[]) image.out_file = optarg; break; case 'p': +#ifdef HAS_FILE_FORMAT_H image.ldc_out_file = optarg; +#else + fprintf(stderr, + "error: log dictionary is not supported\n"); + return -EINVAL; +#endif /* HAS_FILE_FORMAT_H */ break; case 'm': mach = optarg; @@ -99,8 +106,10 @@ int main(int argc, char *argv[]) if (!image.out_file || !mach) usage(argv[0]); +#ifdef HAS_FILE_FORMAT_H if (!image.ldc_out_file) image.ldc_out_file = "out.ldc"; +#endif /* HAS_FILE_FORMAT_H */ /* requires private key */ if (!image.key_name) { @@ -162,6 +171,7 @@ int main(int argc, char *argv[]) else ret = image.adsp->write_firmware(&image); +#ifdef HAS_FILE_FORMAT_H unlink(image.ldc_out_file); image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); if (!image.ldc_out_fd) { @@ -171,13 +181,17 @@ int main(int argc, char *argv[]) goto out; } ret = write_logs_dictionary(&image); +#endif /* HAS_FILE_FORMAT_H */ + out: /* close files */ if (image.out_fd) fclose(image.out_fd); +#ifdef HAS_FILE_FORMAT_H if (image.ldc_out_fd) fclose(image.ldc_out_fd); +#endif /* HAS_FILE_FORMAT_H */ return ret; } From 606b4f0442df7c359664e101b19b92313945302f Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 18:00:57 -0700 Subject: [PATCH 096/639] Add .gitignore Signed-off-by: Daniel Leung --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..e77279505d50 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +config.h +config.log +config.status +Makefile +stamp-h1 +.deps/ +src/*.o +src/Makefile +src/rimage From 41cba2f66316d94dc7f5af2c7c2ffe6499004caa Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Sep 2019 18:32:20 -0700 Subject: [PATCH 097/639] Take firmware version and build ID as command line arguments Since rimage is no longer built with the SOF code, the firmware version (SOF_MAJOR and SOF_MINOR) and build ID (SOF_BUILD) are no longer defined during build. So these needs to be passed as command line arguments. Signed-off-by: Daniel Leung --- src/include/rimage/rimage.h | 7 +++++++ src/man_apl.c | 12 ++++++------ src/man_cnl.c | 12 ++++++------ src/man_kbl.c | 6 +++--- src/man_sue.c | 6 +++--- src/man_tgl.c | 12 ++++++------ src/manifest.c | 18 ++++++++++++++++++ src/rimage.c | 34 +++++++++++++++++++++++++++++++++- 8 files changed, 82 insertions(+), 25 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index c1015256164d..02a840a9a62a 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -125,6 +125,13 @@ struct image { char out_rom_file[256]; char out_man_file[256]; char out_unsigned_file[256]; + + /* fw version and build id */ + char* fw_ver_string; + char* fw_ver_build_string; + uint16_t fw_ver_major; + uint16_t fw_ver_minor; + uint16_t fw_ver_build; }; struct mem_zone { diff --git a/src/man_apl.c b/src/man_apl.c index b8365b4c3738..b81bb759b8a6 100644 --- a/src/man_apl.c +++ b/src/man_apl.c @@ -49,10 +49,10 @@ struct fw_image_manifest_v1_8 apl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -116,10 +116,10 @@ struct fw_image_manifest_v1_8 apl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = MAN_DESC_OFFSET_V1_8, }, }, diff --git a/src/man_cnl.c b/src/man_cnl.c index 264beaf77a86..72ec898718aa 100644 --- a/src/man_cnl.c +++ b/src/man_cnl.c @@ -48,10 +48,10 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -115,10 +115,10 @@ struct fw_image_manifest_v1_8 cnl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0x30000, }, }, diff --git a/src/man_kbl.c b/src/man_kbl.c index 5bd66964f203..4a078e5d99e8 100644 --- a/src/man_kbl.c +++ b/src/man_kbl.c @@ -37,10 +37,10 @@ struct fw_image_manifest_v1_5 kbl_manifest = { .preload_page_count = 0, .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0, .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, .hw_buf_length = KBL_HARDWARE_BUFFER_LEN diff --git a/src/man_sue.c b/src/man_sue.c index db4bfd600235..e170d9952095 100644 --- a/src/man_sue.c +++ b/src/man_sue.c @@ -17,10 +17,10 @@ struct fw_image_manifest_v1_5_sue sue_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0x2000, }, }, diff --git a/src/man_tgl.c b/src/man_tgl.c index 6f8871ce25d2..f7c3c6f25787 100644 --- a/src/man_tgl.c +++ b/src/man_tgl.c @@ -48,10 +48,10 @@ struct fw_image_manifest_v2_5 tgl_manifest = { .header_id = MAN_CSS_HDR_ID, .padding = 0, .version = { - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, }, .modulus_size = MAN_CSS_MOD_SIZE, .exponent_size = MAN_CSS_EXP_SIZE, @@ -115,10 +115,10 @@ struct fw_image_manifest_v2_5 tgl_manifest = { .preload_page_count = 0, /* size in pages from $CPD */ .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = SOF_MAJOR, - .minor_version = SOF_MINOR, + .major_version = 0, + .minor_version = 0, .hotfix_version = 0, - .build_version = SOF_BUILD, + .build_version = 0, .load_offset = 0x30000, }, }, diff --git a/src/manifest.c b/src/manifest.c index 6ca41283615b..4c14d742cd55 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -727,6 +727,11 @@ static int man_write_fw_v1_5(struct image *image) m = image->fw_image; desc = image->fw_image + MAN_DESC_OFFSET_V1_5; + /* firmware and build version */ + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + /* create each module */ m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); @@ -791,6 +796,11 @@ static int man_write_fw_v1_5_sue(struct image *image) /* create the module */ m = image->fw_image + MAN_DESC_OFFSET_V1_5_SUE; + /* firmware and build version */ + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + /* create each module - subtract the boot loader exec header */ m->desc.header.num_module_entries = image->num_modules - 1; man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); @@ -854,6 +864,14 @@ static int man_write_fw_v1_8(struct image *image) m = image->fw_image; desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + /* firmware and build version */ + m->css.version.major_version = image->fw_ver_major; + m->css.version.minor_version = image->fw_ver_minor; + m->css.version.build_version = image->fw_ver_build; + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + /* create each module */ m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); diff --git a/src/rimage.c b/src/rimage.c index 896fe1b7d268..98f0f5cdcd99 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -40,6 +40,8 @@ static void usage(char *name) #endif /* HAS_FILE_FORMAT_H */ fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); + fprintf(stdout, "\t -f firmware version = x.y\n"); + fprintf(stdout, "\t -b build version\n"); exit(0); } @@ -54,7 +56,7 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:x:")) != -1) { + while ((opt = getopt(argc, argv, "ho:p:m:va:s:k:l:ri:x:f:b:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -92,6 +94,12 @@ int main(int argc, char *argv[]) case 'x': image.xcc_mod_offset = atoi(optarg); break; + case 'f': + image.fw_ver_string = optarg; + break; + case 'b': + image.fw_ver_build_string = optarg; + break; case 'h': usage(argv[0]); break; @@ -117,6 +125,30 @@ int main(int argc, char *argv[]) return -EINVAL; } + /* firmware version and build id */ + if (image.fw_ver_string) { + ret = sscanf(image.fw_ver_string, "%hu.%hu", + &image.fw_ver_major, + &image.fw_ver_minor); + + if (ret != 2) { + fprintf(stderr, + "error: cannot parse firmware version\n"); + return -EINVAL; + } + } + + if (image.fw_ver_build_string) { + ret = sscanf(image.fw_ver_build_string, "%hu", + &image.fw_ver_build); + + if (ret != 1) { + fprintf(stderr, + "error: cannot parse build version\n"); + return -EINVAL; + } + } + /* find machine */ for (i = 0; i < ARRAY_SIZE(machine); i++) { if (!strcmp(mach, machine[i]->name)) { From 0d33e87433865cdc84d249b5cb6633b24cf6ecfb Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Tue, 24 Sep 2019 13:28:36 -0700 Subject: [PATCH 098/639] Enable autotools to build rimage This adds the necessary configuration files to enable autotools for configure/make files generation. Signed-off-by: Daniel Leung --- Makefile.am | 6 +++++ configure.ac | 62 +++++++++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 36 ++++++++++++++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 Makefile.am create mode 100644 configure.ac create mode 100644 src/Makefile.am diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 000000000000..3d19426e7ea2 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,6 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +EXTRA_DIST = README +SUBDIRS = src diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000000..e39de6d54d37 --- /dev/null +++ b/configure.ac @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +AC_PREREQ([2.69]) +AC_INIT([rimage],[1.0]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AC_CONFIG_SRCDIR([src/rimage.c]) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile + src/Makefile]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) + +# Checks for header files. +AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INT8_T +AC_TYPE_SIZE_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_CHECK_FUNCS([gettimeofday memset]) + +# Where SOF header files are +AC_ARG_WITH(sof-source, + AS_HELP_STRING([--with-sof-source=DIR],[where the root of SOF source is]), + [ SOF_SOURCE_DIR="$with_sof_source/src" ],) +AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + AC_CHECK_HEADERS(ipc/header.h, , + [ AC_MSG_ERROR([Unable to find ipc/header.h. Aborting.]) ]) + AC_CHECK_HEADERS(ipc/info.h, , + [ AC_MSG_ERROR([Unable to find ipc/info.h. Aborting.]) ]) + AC_CHECK_HEADERS(ipc/stream.h, , + [ AC_MSG_ERROR([Unable to find ipc/stream.h. Aborting.]) ]) + AC_CHECK_HEADERS(kernel/fw.h, , + [ AC_MSG_ERROR([Unable to find kernel/fw.h. Aborting.]) ]) + AC_CHECK_HEADERS(sof/logs/file_format.h, , + [ AC_MSG_ERROR([Unable to find sof/logs/file_format.h. Aborting.]) ]) + AC_CHECK_HEADERS(user/manifest.h, , + [ AC_MSG_ERROR([Unable to find user/manifest.h. Aborting.]) ]) +fi + +# Generate outputs +AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 000000000000..3d9c75a3a5b3 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +bin_PROGRAMS = rimage + +rimage_SOURCES = \ + cse.c \ + css.c \ + elf.c \ + file_simple.c \ + hash.c \ + man_apl.c \ + man_cnl.c \ + manifest.c \ + man_kbl.c \ + man_sue.c \ + man_tgl.c \ + pkcs1_5.c \ + plat_auth.c \ + rimage.c + +if USE_PROVIDED_SOF_HEADER + PROVIDED_SOF_HEADER = -Iinclude/sof + EXTRA_SOF_MACROS = +else + EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H +endif + +rimage_CFLAGS = \ + $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ + $(EXTRA_SOF_MACROS) \ + -O2 -g -Wall -Werror -Wl,-EL \ + -Wmissing-prototypes -Wimplicit-fallthrough=3 + +rimage_LDADD = -lcrypto From f6bf4b0d72d899861c34e7d08981ec37f5421986 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 11 Nov 2019 18:10:47 -0800 Subject: [PATCH 099/639] Add files created after running autoreconf This adds the files created after running `autoreconf -i`. This allows the project to be 'configure'-d and built. Signed-off-by: Daniel Leung --- Makefile.in | 772 +++++ aclocal.m4 | 1135 +++++++ autom4te.cache/output.0 | 6178 +++++++++++++++++++++++++++++++++++++++ autom4te.cache/output.1 | 6178 +++++++++++++++++++++++++++++++++++++++ autom4te.cache/requests | 154 + autom4te.cache/traces.0 | 953 ++++++ autom4te.cache/traces.1 | 509 ++++ compile | 348 +++ config.h.in | 141 + configure | 6178 +++++++++++++++++++++++++++++++++++++++ depcomp | 791 +++++ install-sh | 518 ++++ missing | 215 ++ src/Makefile.in | 853 ++++++ 14 files changed, 24923 insertions(+) create mode 100644 Makefile.in create mode 100644 aclocal.m4 create mode 100644 autom4te.cache/output.0 create mode 100644 autom4te.cache/output.1 create mode 100644 autom4te.cache/requests create mode 100644 autom4te.cache/traces.0 create mode 100644 autom4te.cache/traces.1 create mode 100755 compile create mode 100644 config.h.in create mode 100755 configure create mode 100755 depcomp create mode 100755 install-sh create mode 100755 missing create mode 100644 src/Makefile.in diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 000000000000..59ef2e48a6ac --- /dev/null +++ b/Makefile.in @@ -0,0 +1,772 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +CSCOPE = cscope +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in compile \ + depcomp install-sh missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = README +SUBDIRS = src +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) all install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 000000000000..8c6b78f9d278 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1135 @@ +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 new file mode 100644 index 000000000000..19b6cbd5c002 --- /dev/null +++ b/autom4te.cache/output.0 @@ -0,0 +1,6178 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='rimage' +PACKAGE_TARNAME='rimage' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='rimage 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/rimage.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +USE_PROVIDED_SOF_HEADER_FALSE +USE_PROVIDED_SOF_HEADER_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_sof_source +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures rimage 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rimage 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-sof-source=DIR where the root of SOF source is + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rimage configure 1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using +@%:@ the include files in INCLUDES and setting the cache variable VAR +@%:@ accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_mongrel + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_find_intX_t LINENO BITS VAR +@%:@ ----------------------------------- +@%:@ Finds a signed integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in @%:@( + int$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_intX_t + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR +@%:@ ------------------------------------ +@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in @%:@( + uint$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_uintX_t + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +@%:@ Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='rimage' + VERSION='1.0' + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_new_ex_data (); +int +main () +{ +return CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_new_ex_data=yes +else + ac_cv_lib_crypto_CRYPTO_new_ex_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 +fi + + +# Checks for header files. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +@%:@define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_func in gettimeofday memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Where SOF header files are + +@%:@ Check whether --with-sof-source was given. +if test "${with_sof_source+set}" = set; then : + withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" +fi + + if test "x$SOF_SOURCE_DIR" = "x"; then + USE_PROVIDED_SOF_HEADER_TRUE= + USE_PROVIDED_SOF_HEADER_FALSE='#' +else + USE_PROVIDED_SOF_HEADER_TRUE='#' + USE_PROVIDED_SOF_HEADER_FALSE= +fi + + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + for ac_header in ipc/header.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_header_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_HEADER_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_info_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_INFO_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/stream.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_stream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_STREAM_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in kernel/fw.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" +if test "x$ac_cv_header_kernel_fw_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_KERNEL_FW_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in sof/logs/file_format.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" +if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in user/manifest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" +if test "x$ac_cv_header_user_manifest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_USER_MANIFEST_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 +fi + +done + +fi + +# Generate outputs +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then + as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rimage config.status 1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 new file mode 100644 index 000000000000..19b6cbd5c002 --- /dev/null +++ b/autom4te.cache/output.1 @@ -0,0 +1,6178 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. +@%:@ +@%:@ +@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +@%:@ +@%:@ +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in @%:@( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in @%:@ (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIB@&t@OBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='rimage' +PACKAGE_TARNAME='rimage' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='rimage 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/rimage.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIB@&t@OBJS +USE_PROVIDED_SOF_HEADER_FALSE +USE_PROVIDED_SOF_HEADER_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_sof_source +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures rimage 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + @<:@@S|@ac_default_prefix@:>@ + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + @<:@PREFIX@:>@ + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rimage 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-sof-source=DIR where the root of SOF source is + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rimage configure 1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +@%:@ ac_fn_c_try_compile LINENO +@%:@ -------------------------- +@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_compile + +@%:@ ac_fn_c_try_link LINENO +@%:@ ----------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_link + +@%:@ ac_fn_c_try_cpp LINENO +@%:@ ---------------------- +@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_cpp + +@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using +@%:@ the include files in INCLUDES and setting the cache variable VAR +@%:@ accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_mongrel + +@%:@ ac_fn_c_try_run LINENO +@%:@ ---------------------- +@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes +@%:@ that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} @%:@ ac_fn_c_try_run + +@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +@%:@ ------------------------------------------------------- +@%:@ Tests whether HEADER exists and can be compiled using the include files in +@%:@ INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +@%:@include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_header_compile + +@%:@ ac_fn_c_find_intX_t LINENO BITS VAR +@%:@ ----------------------------------- +@%:@ Finds a signed integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in @%:@( + int$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_intX_t + +@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES +@%:@ ------------------------------------------- +@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache +@%:@ variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_type + +@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR +@%:@ ------------------------------------ +@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR +@%:@ accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; +test_array @<:@0@:>@ = 0; +return test_array @<:@0@:>@; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in @%:@( + uint$2_t) : + eval "$3=yes" ;; @%:@( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_find_uintX_t + +@%:@ ac_fn_c_check_func LINENO FUNC VAR +@%:@ ---------------------------------- +@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} @%:@ ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in @%:@(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in @%:@(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +@%:@ Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='rimage' + VERSION='1.0' + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in @%:@( + '0:this is the am__doit target') : + case $s in @%:@( + BSD) : + am__include='.include' am__quote='"' ;; @%:@( + *) : + am__include='include' am__quote='' ;; +esac ;; @%:@( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +@%:@ Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_new_ex_data (); +int +main () +{ +return CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_new_ex_data=yes +else + ac_cv_lib_crypto_CRYPTO_new_ex_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 +fi + + +# Checks for header files. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@ifdef __STDC__ +@%:@ include +@%:@else +@%:@ include +@%:@endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +@%:@include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +@%:@define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +@%:@define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +@%:@define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "@%:@define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +@%:@define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_func in gettimeofday memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Where SOF header files are + +@%:@ Check whether --with-sof-source was given. +if test "${with_sof_source+set}" = set; then : + withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" +fi + + if test "x$SOF_SOURCE_DIR" = "x"; then + USE_PROVIDED_SOF_HEADER_TRUE= + USE_PROVIDED_SOF_HEADER_FALSE='#' +else + USE_PROVIDED_SOF_HEADER_TRUE='#' + USE_PROVIDED_SOF_HEADER_FALSE= +fi + + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + for ac_header in ipc/header.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_header_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_HEADER_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_info_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_INFO_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/stream.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_stream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_IPC_STREAM_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in kernel/fw.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" +if test "x$ac_cv_header_kernel_fw_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_KERNEL_FW_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in sof/logs/file_format.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" +if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in user/manifest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" +if test "x$ac_cv_header_user_manifest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +@%:@define HAVE_USER_MANIFEST_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 +fi + +done + +fi + +# Generate outputs +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIB@&t@OBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then + as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in @%:@( + *posix*) : + set -o posix ;; @%:@( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in @%:@( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in @%:@(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] +@%:@ ---------------------------------------- +@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are +@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the +@%:@ script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} @%:@ as_fn_error + + +@%:@ as_fn_set_status STATUS +@%:@ ----------------------- +@%:@ Set @S|@? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} @%:@ as_fn_set_status + +@%:@ as_fn_exit STATUS +@%:@ ----------------- +@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} @%:@ as_fn_exit + +@%:@ as_fn_unset VAR +@%:@ --------------- +@%:@ Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +@%:@ as_fn_append VAR VALUE +@%:@ ---------------------- +@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take +@%:@ advantage of any shell optimizations that allow amortized linear growth over +@%:@ repeated appends, instead of the typical quadratic growth present in naive +@%:@ implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +@%:@ as_fn_arith ARG... +@%:@ ------------------ +@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the +@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments +@%:@ must be portable across @S|@(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in @%:@((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +@%:@ as_fn_mkdir_p +@%:@ ------------- +@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} @%:@ as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +@%:@ as_fn_executable_p FILE +@%:@ ----------------------- +@%:@ Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} @%:@ as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rimage config.status 1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in @%:@( + *\'*) : + eval set x "$CONFIG_FILES" ;; @%:@( + *) : + set x $CONFIG_FILES ;; @%:@( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/autom4te.cache/requests b/autom4te.cache/requests new file mode 100644 index 000000000000..31d47c7b6cc0 --- /dev/null +++ b/autom4te.cache/requests @@ -0,0 +1,154 @@ +# This file was generated. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf-2.69' + ], + [ + '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', + '-', + '/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4', + '/usr/share/aclocal-1.16/amversion.m4', + '/usr/share/aclocal-1.16/auxdir.m4', + '/usr/share/aclocal-1.16/cond.m4', + '/usr/share/aclocal-1.16/depend.m4', + '/usr/share/aclocal-1.16/depout.m4', + '/usr/share/aclocal-1.16/init.m4', + '/usr/share/aclocal-1.16/install-sh.m4', + '/usr/share/aclocal-1.16/lead-dot.m4', + '/usr/share/aclocal-1.16/make.m4', + '/usr/share/aclocal-1.16/missing.m4', + '/usr/share/aclocal-1.16/options.m4', + '/usr/share/aclocal-1.16/prog-cc-c-o.m4', + '/usr/share/aclocal-1.16/runlog.m4', + '/usr/share/aclocal-1.16/sanity.m4', + '/usr/share/aclocal-1.16/silent.m4', + '/usr/share/aclocal-1.16/strip.m4', + '/usr/share/aclocal-1.16/substnot.m4', + '/usr/share/aclocal-1.16/tar.m4', + 'configure.ac' + ], + { + 'AM_PROG_INSTALL_STRIP' => 1, + '_AM_MANGLE_OPTION' => 1, + 'm4_include' => 1, + 'AM_MISSING_HAS_RUN' => 1, + '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, + 'AM_RUN_LOG' => 1, + '_AM_SET_OPTION' => 1, + 'AM_DEP_TRACK' => 1, + 'm4_pattern_allow' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'AM_MAKE_INCLUDE' => 1, + 'AM_SET_LEADING_DOT' => 1, + '_AM_PROG_CC_C_O' => 1, + 'AC_CONFIG_MACRO_DIR' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AM_SANITY_CHECK' => 1, + 'include' => 1, + '_AM_DEPENDENCIES' => 1, + 'AU_DEFUN' => 1, + 'AM_SET_DEPDIR' => 1, + 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, + 'AC_DEFUN_ONCE' => 1, + 'AM_CONDITIONAL' => 1, + '_AM_IF_OPTION' => 1, + '_AC_AM_CONFIG_HEADER_HOOK' => 1, + '_AM_CONFIG_MACRO_DIRS' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_SILENT_RULES' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_MISSING_PROG' => 1, + '_m4_warn' => 1, + '_AM_SET_OPTIONS' => 1, + '_AM_PROG_TAR' => 1, + 'AC_DEFUN' => 1, + 'AM_PROG_INSTALL_SH' => 1, + 'AM_SUBST_NOTMAKE' => 1, + 'AM_AUX_DIR_EXPAND' => 1, + 'AC_CONFIG_MACRO_DIR_TRACE' => 1, + 'm4_pattern_forbid' => 1 + } + ], 'Autom4te::Request' ), + bless( [ + '1', + 1, + [ + '/usr/share/autoconf-2.69' + ], + [ + '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.ac' + ], + { + 'AC_SUBST_TRACE' => 1, + 'AC_CANONICAL_TARGET' => 1, + 'AM_PROG_MOC' => 1, + 'AC_CONFIG_SUBDIRS' => 1, + 'AM_NLS' => 1, + 'LT_INIT' => 1, + 'AC_CANONICAL_HOST' => 1, + 'AM_PROG_AR' => 1, + '_LT_AC_TAGCONFIG' => 1, + 'AC_FC_PP_SRCEXT' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'm4_sinclude' => 1, + 'AM_XGETTEXT_OPTION' => 1, + 'AM_PROG_CXX_C_O' => 1, + 'm4_include' => 1, + 'AM_PROG_FC_C_O' => 1, + 'm4_pattern_forbid' => 1, + 'AH_OUTPUT' => 1, + 'AC_FC_PP_DEFINE' => 1, + 'AC_CONFIG_LIBOBJ_DIR' => 1, + 'AC_PROG_LIBTOOL' => 1, + '_m4_warn' => 1, + 'AC_CONFIG_AUX_DIR' => 1, + 'AM_SILENT_RULES' => 1, + 'AC_CONFIG_LINKS' => 1, + 'AC_FC_SRCEXT' => 1, + 'LT_CONFIG_LTDL_DIR' => 1, + 'AM_AUTOMAKE_VERSION' => 1, + 'AM_PATH_GUILE' => 1, + 'AC_FC_FREEFORM' => 1, + 'AM_CONDITIONAL' => 1, + 'AC_REQUIRE_AUX_FILE' => 1, + 'AC_CONFIG_FILES' => 1, + 'include' => 1, + 'AC_LIBSOURCE' => 1, + 'AM_MAKEFILE_INCLUDE' => 1, + '_AM_SUBST_NOTMAKE' => 1, + 'AM_PROG_CC_C_O' => 1, + '_AM_COND_ELSE' => 1, + 'AM_EXTRA_RECURSIVE_TARGETS' => 1, + 'AC_CANONICAL_SYSTEM' => 1, + 'AM_MAINTAINER_MODE' => 1, + '_AM_COND_ENDIF' => 1, + 'm4_pattern_allow' => 1, + 'LT_SUPPORTED_TAG' => 1, + 'AM_ENABLE_MULTILIB' => 1, + 'AM_PROG_MKDIR_P' => 1, + 'sinclude' => 1, + 'AM_PROG_F77_C_O' => 1, + 'AC_INIT' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AM_INIT_AUTOMAKE' => 1, + 'AM_POT_TOOLS' => 1, + 'AM_GNU_GETTEXT' => 1, + '_AM_MAKEFILE_INCLUDE' => 1, + 'AC_CANONICAL_BUILD' => 1, + '_AM_COND_IF' => 1, + 'AC_SUBST' => 1, + 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1 + } + ], 'Autom4te::Request' ) + ); + diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 new file mode 100644 index 000000000000..a2519bc3d938 --- /dev/null +++ b/autom4te.cache/traces.0 @@ -0,0 +1,953 @@ +m4trace:/usr/share/aclocal-1.16/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) +m4trace:/usr/share/aclocal-1.16/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) +m4trace:/usr/share/aclocal-1.16/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) +m4trace:/usr/share/aclocal-1.16/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) +m4trace:/usr/share/aclocal-1.16/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) +m4trace:/usr/share/aclocal-1.16/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) +m4trace:/usr/share/aclocal-1.16/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) +m4trace:/usr/share/aclocal-1.16/depout.m4:11: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +]) +m4trace:/usr/share/aclocal-1.16/depout.m4:62: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) +m4trace:/usr/share/aclocal-1.16/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) +m4trace:/usr/share/aclocal-1.16/init.m4:186: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) +m4trace:/usr/share/aclocal-1.16/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) +m4trace:/usr/share/aclocal-1.16/lead-dot.m4:10: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) +m4trace:/usr/share/aclocal-1.16/make.m4:13: -1- AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +m4trace:/usr/share/aclocal-1.16/make.m4:42: -1- m4_pattern_allow([^am__quote$]) +m4trace:/usr/share/aclocal-1.16/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) +m4trace:/usr/share/aclocal-1.16/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) +m4trace:/usr/share/aclocal-1.16/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/usr/share/aclocal-1.16/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) +m4trace:/usr/share/aclocal-1.16/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/usr/share/aclocal-1.16/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) +m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) +m4trace:/usr/share/aclocal-1.16/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) +m4trace:/usr/share/aclocal-1.16/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) +m4trace:/usr/share/aclocal-1.16/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) +m4trace:/usr/share/aclocal-1.16/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4trace:/usr/share/aclocal-1.16/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/usr/share/aclocal-1.16/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) +m4trace:/usr/share/aclocal-1.16/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:7: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) +m4trace:configure.ac:7: -1- _AM_AUTOCONF_VERSION([2.69]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:7: -1- _AM_SET_OPTIONS([-Wall -Werror foreign]) +m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Wall]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Wall]) +m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Werror]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Werror]) +m4trace:configure.ac:7: -1- _AM_SET_OPTION([foreign]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([foreign]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- AM_SANITY_CHECK +m4trace:configure.ac:7: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:7: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:7: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:7: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:7: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:7: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:7: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:7: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:7: -1- AM_SILENT_RULES +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:14: -1- _AM_PROG_CC_C_O +m4trace:configure.ac:14: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) +m4trace:configure.ac:14: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:14: -1- AM_SET_DEPDIR +m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:14: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:14: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:14: -1- AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:14: -1- AM_DEP_TRACK +m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) +m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) +m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) +m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) +m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) +m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) +m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) +m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) +m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) +m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) +m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) +m4trace:configure.ac:62: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:62: -1- AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 new file mode 100644 index 000000000000..43633f948703 --- /dev/null +++ b/autom4te.cache/traces.1 @@ -0,0 +1,509 @@ +m4trace:aclocal.m4:679: -1- AC_SUBST([am__quote]) +m4trace:aclocal.m4:679: -1- AC_SUBST_TRACE([am__quote]) +m4trace:aclocal.m4:679: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:6: -1- AC_INIT([rimage], [1.0]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:6: -1- AC_SUBST([SHELL]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:6: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_URL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:6: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:6: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:6: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:6: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], + ['${datarootdir}/doc/${PACKAGE_TARNAME}'], + ['${datarootdir}/doc/${PACKAGE}'])]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:6: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:6: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:6: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:6: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:6: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +@%:@undef PACKAGE_NAME]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +@%:@undef PACKAGE_TARNAME]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +@%:@undef PACKAGE_VERSION]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +@%:@undef PACKAGE_STRING]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +@%:@undef PACKAGE_BUGREPORT]) +m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) +m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ +@%:@undef PACKAGE_URL]) +m4trace:configure.ac:6: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:6: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:6: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:6: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:6: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:6: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:6: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) +m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:7: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:7: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:7: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +@%:@undef PACKAGE]) +m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:7: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +@%:@undef VERSION]) +m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:7: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:7: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:7: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:7: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:7: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:7: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:7: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:7: -1- AC_SUBST([MKDIR_P]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) +m4trace:configure.ac:7: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:7: -1- AC_SUBST([AWK]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:7: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:7: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:7: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:7: -1- AM_SILENT_RULES +m4trace:configure.ac:7: -1- AC_SUBST([AM_V]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) +m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) +m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) +m4trace:configure.ac:7: -1- AC_SUBST([AM_BACKSLASH]) +m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_BACKSLASH]) +m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) +m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) +m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h]) +m4trace:configure.ac:10: -1- AC_CONFIG_FILES([Makefile + src/Makefile]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:14: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:14: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:14: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:14: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:14: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:14: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.ac:14: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:14: -1- AC_SUBST([am__include]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:14: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:14: -1- AC_SUBST([am__nodep]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__nodep]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) +m4trace:configure.ac:14: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:17: -1- AH_OUTPUT([HAVE_LIBCRYPTO], [/* Define to 1 if you have the `crypto\' library (-lcrypto). */ +@%:@undef HAVE_LIBCRYPTO]) +m4trace:configure.ac:17: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCRYPTO]) +m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TIME_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:20: -1- AC_SUBST([CPP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:20: -1- AC_SUBST([CPP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:20: -1- AC_SUBST([GREP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:20: -1- AC_SUBST([EGREP]) +m4trace:configure.ac:20: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:20: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:20: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +@%:@undef STDC_HEADERS]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_TYPES_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SYS_STAT_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDLIB_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRING_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_MEMORY_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STRINGS_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_INTTYPES_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_STDINT_H]) +m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_UNISTD_H]) +m4trace:configure.ac:23: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler + calls it, or to nothing if \'inline\' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif]) +m4trace:configure.ac:24: -1- AC_DEFINE_TRACE_LITERAL([int16_t]) +m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) +m4trace:configure.ac:24: -1- AH_OUTPUT([int16_t], [/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef int16_t]) +m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([int32_t]) +m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) +m4trace:configure.ac:25: -1- AH_OUTPUT([int32_t], [/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef int32_t]) +m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([int64_t]) +m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) +m4trace:configure.ac:26: -1- AH_OUTPUT([int64_t], [/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef int64_t]) +m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([int8_t]) +m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) +m4trace:configure.ac:27: -1- AH_OUTPUT([int8_t], [/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +@%:@undef int8_t]) +m4trace:configure.ac:28: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:28: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ +@%:@undef size_t]) +m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([uint16_t]) +m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) +m4trace:configure.ac:29: -1- AH_OUTPUT([uint16_t], [/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint16_t]) +m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([_UINT32_T]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) +m4trace:configure.ac:30: -1- AH_OUTPUT([_UINT32_T], [/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + @%:@define below would cause a syntax error. */ +@%:@undef _UINT32_T]) +m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([uint32_t]) +m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) +m4trace:configure.ac:30: -1- AH_OUTPUT([uint32_t], [/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint32_t]) +m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([_UINT64_T]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) +m4trace:configure.ac:31: -1- AH_OUTPUT([_UINT64_T], [/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + @%:@define below would cause a syntax error. */ +@%:@undef _UINT64_T]) +m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([uint64_t]) +m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) +m4trace:configure.ac:31: -1- AH_OUTPUT([uint64_t], [/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint64_t]) +m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([_UINT8_T]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) +m4trace:configure.ac:32: -1- AH_OUTPUT([_UINT8_T], [/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + @%:@define below would cause a syntax error. */ +@%:@undef _UINT8_T]) +m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([uint8_t]) +m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) +m4trace:configure.ac:32: -1- AH_OUTPUT([uint8_t], [/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +@%:@undef uint8_t]) +m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */ +@%:@undef HAVE_GETTIMEOFDAY]) +m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ +@%:@undef HAVE_MEMSET]) +m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) +m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) +m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) +m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) +m4trace:configure.ac:47: -1- AH_OUTPUT([HAVE_IPC_HEADER_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_IPC_HEADER_H]) +m4trace:configure.ac:47: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_HEADER_H]) +m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) +m4trace:configure.ac:49: -1- AH_OUTPUT([HAVE_IPC_INFO_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_IPC_INFO_H]) +m4trace:configure.ac:49: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_INFO_H]) +m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) +m4trace:configure.ac:51: -1- AH_OUTPUT([HAVE_IPC_STREAM_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_IPC_STREAM_H]) +m4trace:configure.ac:51: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_STREAM_H]) +m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) +m4trace:configure.ac:53: -1- AH_OUTPUT([HAVE_KERNEL_FW_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_KERNEL_FW_H]) +m4trace:configure.ac:53: -1- AC_DEFINE_TRACE_LITERAL([HAVE_KERNEL_FW_H]) +m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) +m4trace:configure.ac:55: -1- AH_OUTPUT([HAVE_SOF_LOGS_FILE_FORMAT_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_SOF_LOGS_FILE_FORMAT_H]) +m4trace:configure.ac:55: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOF_LOGS_FILE_FORMAT_H]) +m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) +m4trace:configure.ac:57: -1- AH_OUTPUT([HAVE_USER_MANIFEST_H], [/* Define to 1 if you have the header file. */ +@%:@undef HAVE_USER_MANIFEST_H]) +m4trace:configure.ac:57: -1- AC_DEFINE_TRACE_LITERAL([HAVE_USER_MANIFEST_H]) +m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) +m4trace:configure.ac:62: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:62: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) +m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) +m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) +m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_build_prefix]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:62: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/compile b/compile new file mode 100755 index 000000000000..99e50524b3ba --- /dev/null +++ b/compile @@ -0,0 +1,348 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/config.h.in b/config.h.in new file mode 100644 index 000000000000..ef2c623daf43 --- /dev/null +++ b/config.h.in @@ -0,0 +1,141 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IPC_HEADER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IPC_INFO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_IPC_STREAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_KERNEL_FW_H + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#undef HAVE_LIBCRYPTO + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_SOF_LOGS_FILE_FORMAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_USER_MANIFEST_H + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef int16_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +#undef int8_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t diff --git a/configure b/configure new file mode 100755 index 000000000000..abc56f0e1ab4 --- /dev/null +++ b/configure @@ -0,0 +1,6178 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.69 for rimage 1.0. +# +# +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='rimage' +PACKAGE_TARNAME='rimage' +PACKAGE_VERSION='1.0' +PACKAGE_STRING='rimage 1.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="src/rimage.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +USE_PROVIDED_SOF_HEADER_FALSE +USE_PROVIDED_SOF_HEADER_TRUE +EGREP +GREP +CPP +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_dependency_tracking +with_sof_source +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures rimage 1.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/rimage] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of rimage 1.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-sof-source=DIR where the root of SOF source is + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +rimage configure 1.0 +generated by GNU Autoconf 2.69 + +Copyright (C) 2012 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_intX_t + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_type + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_find_uintX_t + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +am__api_version='1.16' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='rimage' + VERSION='1.0' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_files="$ac_config_files Makefile src/Makefile" + + +# Checks for programs. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +# Checks for libraries. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 +$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } +if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypto $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char CRYPTO_new_ex_data (); +int +main () +{ +return CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypto_CRYPTO_new_ex_data=yes +else + ac_cv_lib_crypto_CRYPTO_new_ex_data=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 +$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } +if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCRYPTO 1 +_ACEOF + + LIBS="-lcrypto $LIBS" + +else + as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 +fi + + +# Checks for header files. +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if ${ac_cv_c_inline+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = xyes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + + +# Checks for library functions. +for ac_func in gettimeofday memset +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# Where SOF header files are + +# Check whether --with-sof-source was given. +if test "${with_sof_source+set}" = set; then : + withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" +fi + + if test "x$SOF_SOURCE_DIR" = "x"; then + USE_PROVIDED_SOF_HEADER_TRUE= + USE_PROVIDED_SOF_HEADER_FALSE='#' +else + USE_PROVIDED_SOF_HEADER_TRUE='#' + USE_PROVIDED_SOF_HEADER_FALSE= +fi + + +if test "x$SOF_SOURCE_DIR" != "x"; then + SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" + CFLAGS="$CFLAGS $SOF_INCLUDES" + CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" + for ac_header in ipc/header.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_header_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IPC_HEADER_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/info.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_info_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IPC_INFO_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in ipc/stream.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" +if test "x$ac_cv_header_ipc_stream_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_IPC_STREAM_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in kernel/fw.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" +if test "x$ac_cv_header_kernel_fw_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_KERNEL_FW_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in sof/logs/file_format.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" +if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SOF_LOGS_FILE_FORMAT_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 +fi + +done + + for ac_header in user/manifest.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" +if test "x$ac_cv_header_user_manifest_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_USER_MANIFEST_H 1 +_ACEOF + +else + as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 +fi + +done + +fi + +# Generate outputs +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then + as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by rimage $as_me 1.0, which was +generated by GNU Autoconf 2.69. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +rimage config.status 1.0 +configured by $0, generated by GNU Autoconf 2.69, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2012 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/depcomp b/depcomp new file mode 100755 index 000000000000..65cbf7093a1e --- /dev/null +++ b/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2018 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/install-sh b/install-sh new file mode 100755 index 000000000000..8175c640fe62 --- /dev/null +++ b/install-sh @@ -0,0 +1,518 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2018-03-11.20; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/missing b/missing new file mode 100755 index 000000000000..625aeb11897a --- /dev/null +++ b/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 000000000000..3bef76b122f0 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,853 @@ +# Makefile.in generated by automake 1.16.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2018 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# SPDX-License-Identifier: BSD-3-Clause +# +# Copyright(c) 2019 Intel Corporation. All rights reserved. + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +bin_PROGRAMS = rimage$(EXEEXT) +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +PROGRAMS = $(bin_PROGRAMS) +am_rimage_OBJECTS = rimage-cse.$(OBJEXT) rimage-css.$(OBJEXT) \ + rimage-elf.$(OBJEXT) rimage-file_simple.$(OBJEXT) \ + rimage-hash.$(OBJEXT) rimage-man_apl.$(OBJEXT) \ + rimage-man_cnl.$(OBJEXT) rimage-manifest.$(OBJEXT) \ + rimage-man_kbl.$(OBJEXT) rimage-man_sue.$(OBJEXT) \ + rimage-man_tgl.$(OBJEXT) rimage-pkcs1_5.$(OBJEXT) \ + rimage-plat_auth.$(OBJEXT) rimage-rimage.$(OBJEXT) +rimage_OBJECTS = $(am_rimage_OBJECTS) +rimage_DEPENDENCIES = +rimage_LINK = $(CCLD) $(rimage_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/rimage-cse.Po \ + ./$(DEPDIR)/rimage-css.Po ./$(DEPDIR)/rimage-elf.Po \ + ./$(DEPDIR)/rimage-file_simple.Po ./$(DEPDIR)/rimage-hash.Po \ + ./$(DEPDIR)/rimage-man_apl.Po ./$(DEPDIR)/rimage-man_cnl.Po \ + ./$(DEPDIR)/rimage-man_kbl.Po ./$(DEPDIR)/rimage-man_sue.Po \ + ./$(DEPDIR)/rimage-man_tgl.Po ./$(DEPDIR)/rimage-manifest.Po \ + ./$(DEPDIR)/rimage-pkcs1_5.Po ./$(DEPDIR)/rimage-plat_auth.Po \ + ./$(DEPDIR)/rimage-rimage.Po +am__mv = mv -f +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(rimage_SOURCES) +DIST_SOURCES = $(rimage_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +rimage_SOURCES = \ + cse.c \ + css.c \ + elf.c \ + file_simple.c \ + hash.c \ + man_apl.c \ + man_cnl.c \ + manifest.c \ + man_kbl.c \ + man_sue.c \ + man_tgl.c \ + pkcs1_5.c \ + plat_auth.c \ + rimage.c + +@USE_PROVIDED_SOF_HEADER_TRUE@PROVIDED_SOF_HEADER = -Iinclude/sof +@USE_PROVIDED_SOF_HEADER_FALSE@EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H +@USE_PROVIDED_SOF_HEADER_TRUE@EXTRA_SOF_MACROS = +rimage_CFLAGS = \ + $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ + $(EXTRA_SOF_MACROS) \ + -O2 -g -Wall -Werror -Wl,-EL \ + -Wmissing-prototypes -Wimplicit-fallthrough=3 + +rimage_LDADD = -lcrypto +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +rimage$(EXEEXT): $(rimage_OBJECTS) $(rimage_DEPENDENCIES) $(EXTRA_rimage_DEPENDENCIES) + @rm -f rimage$(EXEEXT) + $(AM_V_CCLD)$(rimage_LINK) $(rimage_OBJECTS) $(rimage_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-cse.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-css.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-elf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-file_simple.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-hash.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_apl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_cnl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_kbl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_sue.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_tgl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-manifest.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-pkcs1_5.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-plat_auth.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-rimage.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +rimage-cse.o: cse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.o -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c + +rimage-cse.obj: cse.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.obj -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` + +rimage-css.o: css.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.o -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c + +rimage-css.obj: css.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.obj -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` + +rimage-elf.o: elf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.o -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c + +rimage-elf.obj: elf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.obj -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` + +rimage-file_simple.o: file_simple.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.o -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c + +rimage-file_simple.obj: file_simple.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.obj -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` + +rimage-hash.o: hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.o -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c + +rimage-hash.obj: hash.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.obj -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` + +rimage-man_apl.o: man_apl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.o -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c + +rimage-man_apl.obj: man_apl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.obj -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` + +rimage-man_cnl.o: man_cnl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.o -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c + +rimage-man_cnl.obj: man_cnl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.obj -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` + +rimage-manifest.o: manifest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.o -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c + +rimage-manifest.obj: manifest.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.obj -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` + +rimage-man_kbl.o: man_kbl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.o -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c + +rimage-man_kbl.obj: man_kbl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.obj -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` + +rimage-man_sue.o: man_sue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.o -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c + +rimage-man_sue.obj: man_sue.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.obj -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` + +rimage-man_tgl.o: man_tgl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.o -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c + +rimage-man_tgl.obj: man_tgl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.obj -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` + +rimage-pkcs1_5.o: pkcs1_5.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.o -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c + +rimage-pkcs1_5.obj: pkcs1_5.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.obj -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` + +rimage-plat_auth.o: plat_auth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.o -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c + +rimage-plat_auth.obj: plat_auth.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.obj -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` + +rimage-rimage.o: rimage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.o -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c + +rimage-rimage.obj: rimage.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.obj -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/rimage-cse.Po + -rm -f ./$(DEPDIR)/rimage-css.Po + -rm -f ./$(DEPDIR)/rimage-elf.Po + -rm -f ./$(DEPDIR)/rimage-file_simple.Po + -rm -f ./$(DEPDIR)/rimage-hash.Po + -rm -f ./$(DEPDIR)/rimage-man_apl.Po + -rm -f ./$(DEPDIR)/rimage-man_cnl.Po + -rm -f ./$(DEPDIR)/rimage-man_kbl.Po + -rm -f ./$(DEPDIR)/rimage-man_sue.Po + -rm -f ./$(DEPDIR)/rimage-man_tgl.Po + -rm -f ./$(DEPDIR)/rimage-manifest.Po + -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po + -rm -f ./$(DEPDIR)/rimage-plat_auth.Po + -rm -f ./$(DEPDIR)/rimage-rimage.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/rimage-cse.Po + -rm -f ./$(DEPDIR)/rimage-css.Po + -rm -f ./$(DEPDIR)/rimage-elf.Po + -rm -f ./$(DEPDIR)/rimage-file_simple.Po + -rm -f ./$(DEPDIR)/rimage-hash.Po + -rm -f ./$(DEPDIR)/rimage-man_apl.Po + -rm -f ./$(DEPDIR)/rimage-man_cnl.Po + -rm -f ./$(DEPDIR)/rimage-man_kbl.Po + -rm -f ./$(DEPDIR)/rimage-man_sue.Po + -rm -f ./$(DEPDIR)/rimage-man_tgl.Po + -rm -f ./$(DEPDIR)/rimage-manifest.Po + -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po + -rm -f ./$(DEPDIR)/rimage-plat_auth.Po + -rm -f ./$(DEPDIR)/rimage-rimage.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic distclean-tags \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: From f2e92812afa18ad6d369dba9bae395de2a17790d Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 11 Nov 2019 18:20:34 -0800 Subject: [PATCH 100/639] Add building instructions to README.md This adds intructions to build the rimage tool. Signed-off-by: Daniel Leung --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c5c67ede5194..4b484048dec4 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,34 @@ # rimage -DSP firmware image creation and signing tool + +`rimage` is a DSP firmware image creation and signing tool targeting +the DSP on certain Intel System-on-Chip (SoC). This is used by +the [Sound Open Firmware (SOF)](https://github.com/thesofproject/sof) +to generate binary image files. + +## Building + +The `rimage` tool can be built with or without logging dictionary +support, where such support is required to decipher the log messages +produced the the SOF firmware. + +#### Build without dictionary support: + +```shell +$ ./configure +$ make +$ make install +``` + +#### Build with dictionary support: + +To build `rimage` with dictionary support, the SOF source is required. +First, clone the SOF source tree from +[here](https://github.com/thesofproject/sof). Then, do: + +```shell +$ ./configure --with-sof-source= +$ make +$ make install +``` + +Note that creating the SOF firmware image requires dicitionary support. From 713e0f8513de42d755868f01207657e1a6fb716f Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Mon, 13 Jan 2020 20:24:31 +0200 Subject: [PATCH 101/639] rimage: Add support for i.MX8X i.MX8X is very similar with i.MX8. Memory layout is the same except IRQSTEER address. Code will be shared but there will be different firmware binaries named: * sof-imx8.ri, for i.MX8 * sof-imx8x.ri, for i.MX8X Signed-off-by: Daniel Baluta --- src/file_simple.c | 23 +++++++++++++++++++++++ src/include/rimage/rimage.h | 3 ++- src/rimage.c | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/file_simple.c b/src/file_simple.c index 8cdd05924537..7e730fde1360 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -573,3 +573,26 @@ const struct adsp machine_imx8 = { .machine_id = MACHINE_IMX8, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8x = { + .name = "imx8x", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8_IRAM_BASE, + .size = IMX8_IRAM_SIZE, + .host_offset = IMX8_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8_DRAM_BASE, + .size = IMX8_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8_SRAM_BASE, + .size = IMX8_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8X, + .write_firmware = simple_write_firmware, +}; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 02a840a9a62a..594a995f11e2 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -38,6 +38,7 @@ enum machine_id { MACHINE_TIGERLAKE, MACHINE_SUECREEK, MACHINE_IMX8, + MACHINE_IMX8X, MACHINE_MAX }; @@ -206,6 +207,6 @@ extern const struct adsp machine_sue; extern const struct adsp machine_skl; extern const struct adsp machine_kbl; extern const struct adsp machine_imx8; - +extern const struct adsp machine_imx8x; #endif diff --git a/src/rimage.c b/src/rimage.c index 98f0f5cdcd99..8e4a91398ac6 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,6 +26,7 @@ static const struct adsp *machine[] = { &machine_kbl, &machine_skl, &machine_imx8, + &machine_imx8x, }; static void usage(char *name) From 0adacd5ac25a9ab3956602fcb8e601348567668d Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 25 Mar 2020 10:40:55 -0700 Subject: [PATCH 102/639] Update source files from main SOF repo Update source files from main SOF repository @ commit 4e87899f25b0c859169c1dfd4dd9f9fd65d48ad2. Signed-off-by: Daniel Leung --- src/elf.c | 6 ++ src/file_simple.c | 198 ++++++++++++++++++++++++++++++------ src/include/rimage/rimage.h | 5 +- src/manifest.c | 3 + src/rimage.c | 3 +- 5 files changed, 184 insertions(+), 31 deletions(-) diff --git a/src/elf.c b/src/elf.c index 3796c9fb50d6..1b5420439da7 100644 --- a/src/elf.c +++ b/src/elf.c @@ -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"); @@ -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) diff --git a/src/file_simple.c b/src/file_simple.c index 7e730fde1360..419e7856da60 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -9,6 +9,7 @@ #include #ifdef HAS_FILE_FORMAT_H +#include #include #endif /* HAS_FILE_FORMAT_H */ @@ -43,6 +44,14 @@ #define IMX8_SRAM_BASE 0x92400000 #define IMX8_SRAM_SIZE 0x800000 +#define IMX8M_IRAM_BASE 0x3b6f8000 +#define IMX8M_IRAM_HOST_OFFSET 0x10000 +#define IMX8M_IRAM_SIZE 0x800 +#define IMX8M_DRAM_BASE 0x3b6e8000 +#define IMX8M_DRAM_SIZE 0x8000 +#define IMX8M_SRAM_BASE 0x92400000 +#define IMX8M_SRAM_SIZE 0x800000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -67,6 +76,75 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) return SOF_FW_BLK_TYPE_INVALID; } +#ifdef HAS_FILE_FORMAT_H +static int fw_version_copy(struct snd_sof_logs_header *header, + const struct module *module) +{ + Elf32_Shdr *section = NULL; + struct sof_ipc_ext_data_hdr *ext_hdr = NULL; + void *buffer = NULL; + + if (module->fw_ready_index <= 0) + return 0; + + section = &module->section[module->fw_ready_index]; + + buffer = calloc(1, section->size); + if (!buffer) + return -ENOMEM; + + fseek(module->fd, section->off, SEEK_SET); + size_t count = fread(buffer, 1, + section->size, module->fd); + + if (count != section->size) { + fprintf(stderr, "error: can't read ready section %d\n", -errno); + free(buffer); + return -errno; + } + + memcpy(&header->version, + &((struct sof_ipc_fw_ready *)buffer)->version, + sizeof(header->version)); + + /* fw_ready structure contains main (primarily kernel) + * ABI version. + */ + + fprintf(stdout, "fw abi main version: %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)); + + /* let's find dbg abi version, which the log client + * is interested in and override the kernel's one. + * + * skip the base fw-ready record and begin from the first extension. + */ + ext_hdr = buffer + ((struct sof_ipc_fw_ready *)buffer)->hdr.size; + while ((uintptr_t)ext_hdr < (uintptr_t)buffer + section->size) { + if (ext_hdr->type == SOF_IPC_EXT_USER_ABI_INFO) { + header->version.abi_version = + ((struct sof_ipc_user_abi_version *) + ext_hdr)->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); + } + + fprintf(stdout, "fw abi dbg version: %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; +} +#endif /* HAS_FILE_FORMAT_H */ + static int block_idx; static int write_block(struct image *image, struct module *module, @@ -370,7 +448,7 @@ static int simple_write_firmware(struct image *image) } #ifdef HAS_FILE_FORMAT_H -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; @@ -385,33 +463,9 @@ int write_logs_dictionary(struct image *image) /* extract fw_version from fw_ready message located * in .fw_ready section */ - if (module->fw_ready_index > 0) { - Elf32_Shdr *section = - &module->section[module->fw_ready_index]; - - buffer = calloc(1, sizeof(struct sof_ipc_fw_ready)); - if (!buffer) - return -ENOMEM; - - fseek(module->fd, section->off, SEEK_SET); - size_t count = fread(buffer, 1, - sizeof(struct sof_ipc_fw_ready), module->fd); - - if (count != sizeof(struct sof_ipc_fw_ready)) { - fprintf(stderr, - "error: can't read ready section %d\n", - -errno); - ret = -errno; - goto out; - } - - memcpy(&header.version, - &((struct sof_ipc_fw_ready *)buffer)->version, - sizeof(header.version)); - - free(buffer); - buffer = NULL; - } + ret = fw_version_copy(&header, module); + if (ret < 0) + goto out; if (module->logs_index > 0) { Elf32_Shdr *section = @@ -449,7 +503,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)); } } @@ -459,6 +513,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; +} #endif /* HAS_FILE_FORMAT_H */ const struct adsp machine_byt = { @@ -596,3 +713,26 @@ const struct adsp machine_imx8x = { .machine_id = MACHINE_IMX8X, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8m = { + .name = "imx8m", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8M_IRAM_BASE, + .size = IMX8M_IRAM_SIZE, + .host_offset = IMX8M_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8M_DRAM_BASE, + .size = IMX8M_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8M_SRAM_BASE, + .size = IMX8M_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8M, + .write_firmware = simple_write_firmware, +}; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 594a995f11e2..08e398b5f65e 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -39,6 +39,7 @@ enum machine_id { MACHINE_SUECREEK, MACHINE_IMX8, MACHINE_IMX8X, + MACHINE_IMX8M, MACHINE_MAX }; @@ -67,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 */ @@ -162,7 +164,7 @@ struct adsp { }; #ifdef HAS_FILE_FORMAT_H -int write_logs_dictionary(struct image *image); +int write_dictionaries(struct image *image); #endif /* HAS_FILE_FORMAT_H */ void module_sha256_create(struct image *image); @@ -208,5 +210,6 @@ extern const struct adsp machine_skl; extern const struct adsp machine_kbl; extern const struct adsp machine_imx8; extern const struct adsp machine_imx8x; +extern const struct adsp machine_imx8m; #endif diff --git a/src/manifest.c b/src/manifest.c index 4c14d742cd55..4f4ff763c02b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -41,6 +41,7 @@ static int man_open_rom_file(struct image *image) if (!image->out_rom_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_rom_file, errno); + return -errno; } return 0; @@ -56,6 +57,7 @@ static int man_open_unsigned_file(struct image *image) if (!image->out_unsigned_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_unsigned_file, errno); + return -errno; } return 0; @@ -71,6 +73,7 @@ static int man_open_manifest_file(struct image *image) if (!image->out_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", image->out_man_file, errno); + return -errno; } return 0; diff --git a/src/rimage.c b/src/rimage.c index 8e4a91398ac6..c015dc8c96f7 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -27,6 +27,7 @@ static const struct adsp *machine[] = { &machine_skl, &machine_imx8, &machine_imx8x, + &machine_imx8m, }; static void usage(char *name) @@ -213,7 +214,7 @@ int main(int argc, char *argv[]) ret = -EINVAL; goto out; } - ret = write_logs_dictionary(&image); + ret = write_dictionaries(&image); #endif /* HAS_FILE_FORMAT_H */ out: From 58acbefc8ed704c9b6a93877b6986c7f4d3cd904 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 25 Mar 2020 10:51:27 -0700 Subject: [PATCH 103/639] Remove autotools files CMake is to be used instead of autotools. So remove the autotools files. This revert commit f6bf4b0d72d899861c34e7d08981ec37f5421986 and commit 0d33e87433865cdc84d249b5cb6633b24cf6ecfb Signed-off-by: Daniel Leung --- Makefile.am | 6 - Makefile.in | 772 ----- aclocal.m4 | 1135 ------- autom4te.cache/output.0 | 6178 --------------------------------------- autom4te.cache/output.1 | 6178 --------------------------------------- autom4te.cache/requests | 154 - autom4te.cache/traces.0 | 953 ------ autom4te.cache/traces.1 | 509 ---- compile | 348 --- config.h.in | 141 - configure | 6178 --------------------------------------- configure.ac | 62 - depcomp | 791 ----- install-sh | 518 ---- missing | 215 -- src/Makefile.am | 36 - src/Makefile.in | 853 ------ 17 files changed, 25027 deletions(-) delete mode 100644 Makefile.am delete mode 100644 Makefile.in delete mode 100644 aclocal.m4 delete mode 100644 autom4te.cache/output.0 delete mode 100644 autom4te.cache/output.1 delete mode 100644 autom4te.cache/requests delete mode 100644 autom4te.cache/traces.0 delete mode 100644 autom4te.cache/traces.1 delete mode 100755 compile delete mode 100644 config.h.in delete mode 100755 configure delete mode 100644 configure.ac delete mode 100755 depcomp delete mode 100755 install-sh delete mode 100755 missing delete mode 100644 src/Makefile.am delete mode 100644 src/Makefile.in diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 3d19426e7ea2..000000000000 --- a/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -EXTRA_DIST = README -SUBDIRS = src diff --git a/Makefile.in b/Makefile.in deleted file mode 100644 index 59ef2e48a6ac..000000000000 --- a/Makefile.in +++ /dev/null @@ -1,772 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = . -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ - ctags-recursive dvi-recursive html-recursive info-recursive \ - install-data-recursive install-dvi-recursive \ - install-exec-recursive install-html-recursive \ - install-info-recursive install-pdf-recursive \ - install-ps-recursive install-recursive installcheck-recursive \ - installdirs-recursive pdf-recursive ps-recursive \ - tags-recursive uninstall-recursive -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -am__recursive_targets = \ - $(RECURSIVE_TARGETS) \ - $(RECURSIVE_CLEAN_TARGETS) \ - $(am__extra_recursive_targets) -AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope -DIST_SUBDIRS = $(SUBDIRS) -am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in compile \ - depcomp install-sh missing -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__post_remove_distdir = $(am__remove_distdir) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -DIST_TARGETS = dist-gzip -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -EXTRA_DIST = README -SUBDIRS = src -all: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @test -f $@ || rm -f stamp-h1 - @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 - -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(am__recursive_targets): - @fail=; \ - if $(am__make_keepgoing); then \ - failcom='fail=yes'; \ - else \ - failcom='exit 1'; \ - fi; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-recursive -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-recursive - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscope: cscope.files - test ! -s cscope.files \ - || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) -clean-cscope: - -rm -f cscope.files -cscope.files: clean-cscope cscopelist -cscopelist: cscopelist-recursive - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz - $(am__post_remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__post_remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__post_remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__post_remove_distdir) - -dist-tarZ: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__post_remove_distdir) - -dist-shar: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 - @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz - $(am__post_remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__post_remove_distdir) - -dist dist-all: - $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' - $(am__post_remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir) - chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build/sub \ - && ../../configure \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=../.. --prefix="$$dc_install_base" \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__post_remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: check-recursive -all-am: Makefile config.h -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-hdr distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(am__recursive_targets) all install-am install-strip - -.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am clean clean-cscope clean-generic \ - cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ - dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-generic distclean-hdr \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/aclocal.m4 b/aclocal.m4 deleted file mode 100644 index 8c6b78f9d278..000000000000 --- a/aclocal.m4 +++ /dev/null @@ -1,1135 +0,0 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically 'autoreconf'.])]) - -# Copyright (C) 2002-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to -# '$srcdir', '$srcdir/..', or '$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is '.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - - -# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES. -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking is enabled. -# This creates each '.Po' and '.Plo' makefile fragment that we'll need in -# order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. -m4_define([AC_PROG_CC], -m4_defn([AC_PROG_CC]) -[_AM_PROG_CC_C_O -]) - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) - -dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) - -# Copyright (C) 2003-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAKE_INCLUDE() -# ----------------- -# Check whether make has an 'include' directive that can support all -# the idioms we need for our automatic dependency tracking code. -AC_DEFUN([AM_MAKE_INCLUDE], -[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -AC_SUBST([am__quote])]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it is modern enough. -# If it is, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_CC_C_O -# --------------- -# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC -# to automatically call this. -AC_DEFUN([_AM_PROG_CC_C_O], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) - -# For backward compatibility. -AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_RUN_LOG(COMMAND) -# ------------------- -# Run COMMAND, save the exit status in ac_status, and log it. -# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) -AC_DEFUN([AM_RUN_LOG], -[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) - -# Copyright (C) 2009-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# ("yes" being less verbose, "no" or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor 'install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in "make install-strip", and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004-2018 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of 'v7', 'ustar', or 'pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -# -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - diff --git a/autom4te.cache/output.0 b/autom4te.cache/output.0 deleted file mode 100644 index 19b6cbd5c002..000000000000 --- a/autom4te.cache/output.0 +++ /dev/null @@ -1,6178 +0,0 @@ -@%:@! /bin/sh -@%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. -@%:@ -@%:@ -@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@%:@ -@%:@ -@%:@ This configure script is free software; the Free Software Foundation -@%:@ gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in @%:@( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIB@&t@OBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='rimage' -PACKAGE_TARNAME='rimage' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='rimage 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/rimage.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIB@&t@OBJS -USE_PROVIDED_SOF_HEADER_FALSE -USE_PROVIDED_SOF_HEADER_TRUE -EGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -with_sof_source -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures rimage 1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - @<:@@S|@ac_default_prefix@:>@ - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - @<:@PREFIX@:>@ - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of rimage 1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sof-source=DIR where the root of SOF source is - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -rimage configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -@%:@ ac_fn_c_try_compile LINENO -@%:@ -------------------------- -@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_compile - -@%:@ ac_fn_c_try_link LINENO -@%:@ ----------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_link - -@%:@ ac_fn_c_try_cpp LINENO -@%:@ ---------------------- -@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_cpp - -@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using -@%:@ the include files in INCLUDES and setting the cache variable VAR -@%:@ accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_mongrel - -@%:@ ac_fn_c_try_run LINENO -@%:@ ---------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes -@%:@ that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_run - -@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists and can be compiled using the include files in -@%:@ INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_compile - -@%:@ ac_fn_c_find_intX_t LINENO BITS VAR -@%:@ ----------------------------------- -@%:@ Finds a signed integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in @%:@( - int$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_intX_t - -@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES -@%:@ ------------------------------------------- -@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache -@%:@ variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_type - -@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR -@%:@ ------------------------------------ -@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in @%:@( - uint$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_uintX_t - -@%:@ ac_fn_c_check_func LINENO FUNC VAR -@%:@ ---------------------------------- -@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in @%:@(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in @%:@(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -@%:@ Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='rimage' - VERSION='1.0' - - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files Makefile src/Makefile" - - -# Checks for programs. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $@%:@ != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in @%:@( - '0:this is the am__doit target') : - case $s in @%:@( - BSD) : - am__include='.include' am__quote='"' ;; @%:@( - *) : - am__include='include' am__quote='' ;; -esac ;; @%:@( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -@%:@ Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -else - as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 -fi - - -# Checks for header files. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -@%:@define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -@%:@define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_func in gettimeofday memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Where SOF header files are - -@%:@ Check whether --with-sof-source was given. -if test "${with_sof_source+set}" = set; then : - withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" -fi - - if test "x$SOF_SOURCE_DIR" = "x"; then - USE_PROVIDED_SOF_HEADER_TRUE= - USE_PROVIDED_SOF_HEADER_FALSE='#' -else - USE_PROVIDED_SOF_HEADER_TRUE='#' - USE_PROVIDED_SOF_HEADER_FALSE= -fi - - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - for ac_header in ipc/header.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_header_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_HEADER_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/info.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_info_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_INFO_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/stream.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_stream_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_STREAM_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in kernel/fw.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" -if test "x$ac_cv_header_kernel_fw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_KERNEL_FW_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in sof/logs/file_format.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" -if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in user/manifest.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" -if test "x$ac_cv_header_user_manifest_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_USER_MANIFEST_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 -fi - -done - -fi - -# Generate outputs -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIB@&t@OBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then - as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -rimage config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX -@%:@@%:@ Running $as_me. @%:@@%:@ -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in @%:@( - *\'*) : - eval set x "$CONFIG_FILES" ;; @%:@( - *) : - set x $CONFIG_FILES ;; @%:@( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/autom4te.cache/output.1 b/autom4te.cache/output.1 deleted file mode 100644 index 19b6cbd5c002..000000000000 --- a/autom4te.cache/output.1 +++ /dev/null @@ -1,6178 +0,0 @@ -@%:@! /bin/sh -@%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.69 for rimage 1.0. -@%:@ -@%:@ -@%:@ Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -@%:@ -@%:@ -@%:@ This configure script is free software; the Free Software Foundation -@%:@ gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in @%:@( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in @%:@ (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIB@&t@OBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='rimage' -PACKAGE_TARNAME='rimage' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='rimage 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/rimage.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIB@&t@OBJS -USE_PROVIDED_SOF_HEADER_FALSE -USE_PROVIDED_SOF_HEADER_TRUE -EGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -with_sof_source -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures rimage 1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - @<:@@S|@ac_default_prefix@:>@ - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - @<:@PREFIX@:>@ - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root @<:@DATAROOTDIR/doc/rimage@:>@ - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of rimage 1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sof-source=DIR where the root of SOF source is - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -rimage configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -@%:@ ac_fn_c_try_compile LINENO -@%:@ -------------------------- -@%:@ Try to compile conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_compile - -@%:@ ac_fn_c_try_link LINENO -@%:@ ----------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_link - -@%:@ ac_fn_c_try_cpp LINENO -@%:@ ---------------------- -@%:@ Try to preprocess conftest.@S|@ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_cpp - -@%:@ ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists, giving a warning if it cannot be compiled using -@%:@ the include files in INCLUDES and setting the cache variable VAR -@%:@ accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_mongrel - -@%:@ ac_fn_c_try_run LINENO -@%:@ ---------------------- -@%:@ Try to link conftest.@S|@ac_ext, and return whether this succeeded. Assumes -@%:@ that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} @%:@ ac_fn_c_try_run - -@%:@ ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -@%:@ ------------------------------------------------------- -@%:@ Tests whether HEADER exists and can be compiled using the include files in -@%:@ INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -@%:@include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_header_compile - -@%:@ ac_fn_c_find_intX_t LINENO BITS VAR -@%:@ ----------------------------------- -@%:@ Finds a signed integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array @<:@1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in @%:@( - int$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_intX_t - -@%:@ ac_fn_c_check_type LINENO TYPE VAR INCLUDES -@%:@ ------------------------------------------- -@%:@ Tests whether TYPE exists after having included INCLUDES, setting cache -@%:@ variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_type - -@%:@ ac_fn_c_find_uintX_t LINENO BITS VAR -@%:@ ------------------------------------ -@%:@ Finds an unsigned integer type with width BITS, setting cache variable VAR -@%:@ accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array @<:@1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)@:>@; -test_array @<:@0@:>@ = 0; -return test_array @<:@0@:>@; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in @%:@( - uint$2_t) : - eval "$3=yes" ;; @%:@( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_find_uintX_t - -@%:@ ac_fn_c_check_func LINENO FUNC VAR -@%:@ ---------------------------------- -@%:@ Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} @%:@ ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in @%:@(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in @%:@(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -@%:@ Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='rimage' - VERSION='1.0' - - -cat >>confdefs.h <<_ACEOF -@%:@define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -@%:@define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files Makefile src/Makefile" - - -# Checks for programs. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $@%:@ != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in @%:@( - '0:this is the am__doit target') : - case $s in @%:@( - BSD) : - am__include='.include' am__quote='"' ;; @%:@( - *) : - am__include='include' am__quote='' ;; -esac ;; @%:@( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -@%:@ Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -else - as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 -fi - - -# Checks for header files. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@ifdef __STDC__ -@%:@ include -@%:@else -@%:@ include -@%:@endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -@%:@include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "@%:@define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -@%:@define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -@%:@define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -@%:@define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "@%:@define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -@%:@define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_func in gettimeofday memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -@%:@define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Where SOF header files are - -@%:@ Check whether --with-sof-source was given. -if test "${with_sof_source+set}" = set; then : - withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" -fi - - if test "x$SOF_SOURCE_DIR" = "x"; then - USE_PROVIDED_SOF_HEADER_TRUE= - USE_PROVIDED_SOF_HEADER_FALSE='#' -else - USE_PROVIDED_SOF_HEADER_TRUE='#' - USE_PROVIDED_SOF_HEADER_FALSE= -fi - - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - for ac_header in ipc/header.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_header_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_HEADER_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/info.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_info_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_INFO_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/stream.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_stream_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_IPC_STREAM_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in kernel/fw.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" -if test "x$ac_cv_header_kernel_fw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_KERNEL_FW_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in sof/logs/file_format.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" -if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_SOF_LOGS_FILE_FORMAT_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in user/manifest.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" -if test "x$ac_cv_header_user_manifest_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -@%:@define HAVE_USER_MANIFEST_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 -fi - -done - -fi - -# Generate outputs -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIB@&t@OBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then - as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in @%:@( - *posix*) : - set -o posix ;; @%:@( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in @%:@( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in @%:@(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -@%:@ as_fn_error STATUS ERROR [LINENO LOG_FD] -@%:@ ---------------------------------------- -@%:@ Output "`basename @S|@0`: error: ERROR" to stderr. If LINENO and LOG_FD are -@%:@ provided, also output the error to LOG_FD, referencing LINENO. Then exit the -@%:@ script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} @%:@ as_fn_error - - -@%:@ as_fn_set_status STATUS -@%:@ ----------------------- -@%:@ Set @S|@? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} @%:@ as_fn_set_status - -@%:@ as_fn_exit STATUS -@%:@ ----------------- -@%:@ Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} @%:@ as_fn_exit - -@%:@ as_fn_unset VAR -@%:@ --------------- -@%:@ Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -@%:@ as_fn_append VAR VALUE -@%:@ ---------------------- -@%:@ Append the text in VALUE to the end of the definition contained in VAR. Take -@%:@ advantage of any shell optimizations that allow amortized linear growth over -@%:@ repeated appends, instead of the typical quadratic growth present in naive -@%:@ implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -@%:@ as_fn_arith ARG... -@%:@ ------------------ -@%:@ Perform arithmetic evaluation on the ARGs, and store the result in the -@%:@ global @S|@as_val. Take advantage of shells that can avoid forks. The arguments -@%:@ must be portable across @S|@(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in @%:@((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -@%:@ as_fn_mkdir_p -@%:@ ------------- -@%:@ Create "@S|@as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} @%:@ as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -@%:@ as_fn_executable_p FILE -@%:@ ----------------------- -@%:@ Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} @%:@ as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -rimage config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX -@%:@@%:@ Running $as_me. @%:@@%:@ -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in @%:@( - *\'*) : - eval set x "$CONFIG_FILES" ;; @%:@( - *) : - set x $CONFIG_FILES ;; @%:@( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/autom4te.cache/requests b/autom4te.cache/requests deleted file mode 100644 index 31d47c7b6cc0..000000000000 --- a/autom4te.cache/requests +++ /dev/null @@ -1,154 +0,0 @@ -# This file was generated. -# It contains the lists of macros which have been traced. -# It can be safely removed. - -@request = ( - bless( [ - '0', - 1, - [ - '/usr/share/autoconf-2.69' - ], - [ - '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', - '-', - '/usr/share/aclocal-1.16/internal/ac-config-macro-dirs.m4', - '/usr/share/aclocal-1.16/amversion.m4', - '/usr/share/aclocal-1.16/auxdir.m4', - '/usr/share/aclocal-1.16/cond.m4', - '/usr/share/aclocal-1.16/depend.m4', - '/usr/share/aclocal-1.16/depout.m4', - '/usr/share/aclocal-1.16/init.m4', - '/usr/share/aclocal-1.16/install-sh.m4', - '/usr/share/aclocal-1.16/lead-dot.m4', - '/usr/share/aclocal-1.16/make.m4', - '/usr/share/aclocal-1.16/missing.m4', - '/usr/share/aclocal-1.16/options.m4', - '/usr/share/aclocal-1.16/prog-cc-c-o.m4', - '/usr/share/aclocal-1.16/runlog.m4', - '/usr/share/aclocal-1.16/sanity.m4', - '/usr/share/aclocal-1.16/silent.m4', - '/usr/share/aclocal-1.16/strip.m4', - '/usr/share/aclocal-1.16/substnot.m4', - '/usr/share/aclocal-1.16/tar.m4', - 'configure.ac' - ], - { - 'AM_PROG_INSTALL_STRIP' => 1, - '_AM_MANGLE_OPTION' => 1, - 'm4_include' => 1, - 'AM_MISSING_HAS_RUN' => 1, - '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, - 'AM_RUN_LOG' => 1, - '_AM_SET_OPTION' => 1, - 'AM_DEP_TRACK' => 1, - 'm4_pattern_allow' => 1, - '_AM_AUTOCONF_VERSION' => 1, - 'AM_MAKE_INCLUDE' => 1, - 'AM_SET_LEADING_DOT' => 1, - '_AM_PROG_CC_C_O' => 1, - 'AC_CONFIG_MACRO_DIR' => 1, - 'AM_PROG_CC_C_O' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AM_SANITY_CHECK' => 1, - 'include' => 1, - '_AM_DEPENDENCIES' => 1, - 'AU_DEFUN' => 1, - 'AM_SET_DEPDIR' => 1, - 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, - 'AC_DEFUN_ONCE' => 1, - 'AM_CONDITIONAL' => 1, - '_AM_IF_OPTION' => 1, - '_AC_AM_CONFIG_HEADER_HOOK' => 1, - '_AM_CONFIG_MACRO_DIRS' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AM_SILENT_RULES' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_MISSING_PROG' => 1, - '_m4_warn' => 1, - '_AM_SET_OPTIONS' => 1, - '_AM_PROG_TAR' => 1, - 'AC_DEFUN' => 1, - 'AM_PROG_INSTALL_SH' => 1, - 'AM_SUBST_NOTMAKE' => 1, - 'AM_AUX_DIR_EXPAND' => 1, - 'AC_CONFIG_MACRO_DIR_TRACE' => 1, - 'm4_pattern_forbid' => 1 - } - ], 'Autom4te::Request' ), - bless( [ - '1', - 1, - [ - '/usr/share/autoconf-2.69' - ], - [ - '/usr/share/autoconf-2.69/autoconf/autoconf.m4f', - 'aclocal.m4', - 'configure.ac' - ], - { - 'AC_SUBST_TRACE' => 1, - 'AC_CANONICAL_TARGET' => 1, - 'AM_PROG_MOC' => 1, - 'AC_CONFIG_SUBDIRS' => 1, - 'AM_NLS' => 1, - 'LT_INIT' => 1, - 'AC_CANONICAL_HOST' => 1, - 'AM_PROG_AR' => 1, - '_LT_AC_TAGCONFIG' => 1, - 'AC_FC_PP_SRCEXT' => 1, - 'AC_CONFIG_HEADERS' => 1, - 'm4_sinclude' => 1, - 'AM_XGETTEXT_OPTION' => 1, - 'AM_PROG_CXX_C_O' => 1, - 'm4_include' => 1, - 'AM_PROG_FC_C_O' => 1, - 'm4_pattern_forbid' => 1, - 'AH_OUTPUT' => 1, - 'AC_FC_PP_DEFINE' => 1, - 'AC_CONFIG_LIBOBJ_DIR' => 1, - 'AC_PROG_LIBTOOL' => 1, - '_m4_warn' => 1, - 'AC_CONFIG_AUX_DIR' => 1, - 'AM_SILENT_RULES' => 1, - 'AC_CONFIG_LINKS' => 1, - 'AC_FC_SRCEXT' => 1, - 'LT_CONFIG_LTDL_DIR' => 1, - 'AM_AUTOMAKE_VERSION' => 1, - 'AM_PATH_GUILE' => 1, - 'AC_FC_FREEFORM' => 1, - 'AM_CONDITIONAL' => 1, - 'AC_REQUIRE_AUX_FILE' => 1, - 'AC_CONFIG_FILES' => 1, - 'include' => 1, - 'AC_LIBSOURCE' => 1, - 'AM_MAKEFILE_INCLUDE' => 1, - '_AM_SUBST_NOTMAKE' => 1, - 'AM_PROG_CC_C_O' => 1, - '_AM_COND_ELSE' => 1, - 'AM_EXTRA_RECURSIVE_TARGETS' => 1, - 'AC_CANONICAL_SYSTEM' => 1, - 'AM_MAINTAINER_MODE' => 1, - '_AM_COND_ENDIF' => 1, - 'm4_pattern_allow' => 1, - 'LT_SUPPORTED_TAG' => 1, - 'AM_ENABLE_MULTILIB' => 1, - 'AM_PROG_MKDIR_P' => 1, - 'sinclude' => 1, - 'AM_PROG_F77_C_O' => 1, - 'AC_INIT' => 1, - 'AC_DEFINE_TRACE_LITERAL' => 1, - 'AM_INIT_AUTOMAKE' => 1, - 'AM_POT_TOOLS' => 1, - 'AM_GNU_GETTEXT' => 1, - '_AM_MAKEFILE_INCLUDE' => 1, - 'AC_CANONICAL_BUILD' => 1, - '_AM_COND_IF' => 1, - 'AC_SUBST' => 1, - 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1 - } - ], 'Autom4te::Request' ) - ); - diff --git a/autom4te.cache/traces.0 b/autom4te.cache/traces.0 deleted file mode 100644 index a2519bc3d938..000000000000 --- a/autom4te.cache/traces.0 +++ /dev/null @@ -1,953 +0,0 @@ -m4trace:/usr/share/aclocal-1.16/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) -m4trace:/usr/share/aclocal-1.16/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -m4trace:/usr/share/aclocal-1.16/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` -]) -m4trace:/usr/share/aclocal-1.16/cond.m4:12: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl - m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) -m4trace:/usr/share/aclocal-1.16/depend.m4:26: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], - [$1], [CXX], [depcc="$CXX" am_compiler_list=], - [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], - [$1], [UPC], [depcc="$UPC" am_compiler_list=], - [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) -m4trace:/usr/share/aclocal-1.16/depend.m4:163: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) -m4trace:/usr/share/aclocal-1.16/depend.m4:171: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl -AS_HELP_STRING( - [--enable-dependency-tracking], - [do not reject slow dependency extractors]) -AS_HELP_STRING( - [--disable-dependency-tracking], - [speeds up one-time build])]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) -m4trace:/usr/share/aclocal-1.16/depout.m4:11: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - AS_CASE([$CONFIG_FILES], - [*\'*], [eval set x "$CONFIG_FILES"], - [*], [set x $CONFIG_FILES]) - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`AS_DIRNAME(["$am_mf"])` - am_filepart=`AS_BASENAME(["$am_mf"])` - AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) || am_rc=$? - done - if test $am_rc -ne 0; then - AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking).]) - fi - AS_UNSET([am_dirpart]) - AS_UNSET([am_filepart]) - AS_UNSET([am_mf]) - AS_UNSET([am_rc]) - rm -f conftest-deps.mk -} -]) -m4trace:/usr/share/aclocal-1.16/depout.m4:62: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) -m4trace:/usr/share/aclocal-1.16/init.m4:29: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[AC_DIAGNOSE([obsolete], - [$0: two- and three-arguments forms are deprecated.]) -m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), - [ok:ok],, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -AM_MISSING_PROG([AUTOCONF], [autoconf]) -AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -AM_MISSING_PROG([AUTOHEADER], [autoheader]) -AM_MISSING_PROG([MAKEINFO], [makeinfo]) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -AC_REQUIRE([AM_SILENT_RULES])dnl -dnl The testsuite driver may need to know about EXEEXT, so add the -dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This -dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) - fi -fi -dnl The trailing newline in this macro's definition is deliberate, for -dnl backward compatibility and to allow trailing 'dnl'-style comments -dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. -]) -m4trace:/usr/share/aclocal-1.16/init.m4:186: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -m4trace:/usr/share/aclocal-1.16/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST([install_sh])]) -m4trace:/usr/share/aclocal-1.16/lead-dot.m4:10: -1- AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) -m4trace:/usr/share/aclocal-1.16/make.m4:13: -1- AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) - AS_CASE([$?:`cat confinc.out 2>/dev/null`], - ['0:this is the am__doit target'], - [AS_CASE([$s], - [BSD], [am__include='.include' am__quote='"'], - [am__include='include' am__quote=''])]) - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -AC_MSG_RESULT([${_am_result}]) -AC_SUBST([am__include])]) -m4trace:/usr/share/aclocal-1.16/make.m4:42: -1- m4_pattern_allow([^am__quote$]) -m4trace:/usr/share/aclocal-1.16/missing.m4:11: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) -m4trace:/usr/share/aclocal-1.16/missing.m4:20: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - AC_MSG_WARN(['missing' script is too old or missing]) -fi -]) -m4trace:/usr/share/aclocal-1.16/options.m4:11: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) -m4trace:/usr/share/aclocal-1.16/options.m4:17: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) -m4trace:/usr/share/aclocal-1.16/options.m4:23: -1- AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) -m4trace:/usr/share/aclocal-1.16/options.m4:29: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:12: -1- AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([compile])dnl -AC_LANG_PUSH([C])dnl -AC_CACHE_CHECK( - [whether $CC understands -c and -o together], - [am_cv_prog_cc_c_o], - [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i]) -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -AC_LANG_POP([C])]) -m4trace:/usr/share/aclocal-1.16/prog-cc-c-o.m4:47: -1- AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -m4trace:/usr/share/aclocal-1.16/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD - ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - (exit $ac_status); }]) -m4trace:/usr/share/aclocal-1.16/sanity.m4:11: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken - alias in your environment]) - fi - if test "$[2]" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT([yes]) -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi -AC_CONFIG_COMMANDS_PRE( - [AC_MSG_CHECKING([that generated files are newer than configure]) - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - AC_MSG_RESULT([done])]) -rm -f conftest.file -]) -m4trace:/usr/share/aclocal-1.16/silent.m4:12: -1- AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl -AS_HELP_STRING( - [--enable-silent-rules], - [less verbose build output (undo: "make V=1")]) -AS_HELP_STRING( - [--disable-silent-rules], - [verbose build output (undo: "make V=0")])dnl -]) -case $enable_silent_rules in @%:@ ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few 'make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) -m4trace:/usr/share/aclocal-1.16/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) -m4trace:/usr/share/aclocal-1.16/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) -m4trace:/usr/share/aclocal-1.16/substnot.m4:17: -1- AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) -m4trace:/usr/share/aclocal-1.16/tar.m4:23: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' - -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - - [m4_case([$1], - [ustar], - [# The POSIX 1988 'ustar' format is defined with fixed-size fields. - # There is notably a 21 bits limit for the UID and the GID. In fact, - # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 - # and bug#13588). - am_max_uid=2097151 # 2^21 - 1 - am_max_gid=$am_max_uid - # The $UID and $GID variables are not portable, so we need to resort - # to the POSIX-mandated id(1) utility. Errors in the 'id' calls - # below are definitely unexpected, so allow the users to see them - # (that is, avoid stderr redirection). - am_uid=`id -u || echo unknown` - am_gid=`id -g || echo unknown` - AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) - if test $am_uid -le $am_max_uid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi - AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) - if test $am_gid -le $am_max_gid; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - _am_tools=none - fi], - - [pax], - [], - - [m4_fatal([Unknown tar format])]) - - AC_MSG_CHECKING([how to create a $1 tar archive]) - - # Go ahead even if we have the value already cached. We do so because we - # need to set the values for the 'am__tar' and 'am__untar' variables. - _am_tools=${am_cv_prog_tar_$1-$_am_tools} - - for _am_tool in $_am_tools; do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works. - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi - done - rm -rf conftest.dir - - AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) - AC_MSG_RESULT([$am_cv_prog_tar_$1])]) - -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) -m4trace:configure.ac:7: -1- AM_SET_CURRENT_AUTOMAKE_VERSION -m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) -m4trace:configure.ac:7: -1- _AM_AUTOCONF_VERSION([2.69]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.ac:7: -1- _AM_SET_OPTIONS([-Wall -Werror foreign]) -m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Wall]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Wall]) -m4trace:configure.ac:7: -1- _AM_SET_OPTION([-Werror]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([-Werror]) -m4trace:configure.ac:7: -1- _AM_SET_OPTION([foreign]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([foreign]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) - AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-define]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- AM_SANITY_CHECK -m4trace:configure.ac:7: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -m4trace:configure.ac:7: -1- AM_MISSING_HAS_RUN -m4trace:configure.ac:7: -1- AM_AUX_DIR_EXPAND -m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.ac:7: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.ac:7: -1- AM_PROG_INSTALL_SH -m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.ac:7: -1- AM_PROG_INSTALL_STRIP -m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.ac:7: -1- AM_SET_LEADING_DOT -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-ustar]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([tar-pax]) -m4trace:configure.ac:7: -1- _AM_PROG_TAR([v7]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.ac:7: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES([CC])], - [m4_define([AC_PROG_CC], - m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES([CXX])], - [m4_define([AC_PROG_CXX], - m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES([OBJC])], - [m4_define([AC_PROG_OBJC], - m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], - [_AM_DEPENDENCIES([OBJCXX])], - [m4_define([AC_PROG_OBJCXX], - m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl -]) -m4trace:configure.ac:7: -2- _AM_MANGLE_OPTION([no-dependencies]) -m4trace:configure.ac:7: -1- AM_SILENT_RULES -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) -m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_V]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) -m4trace:configure.ac:7: -1- AM_SUBST_NOTMAKE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.ac:14: -1- _AM_PROG_CC_C_O -m4trace:configure.ac:14: -1- AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) -m4trace:configure.ac:14: -1- _AM_DEPENDENCIES([CC]) -m4trace:configure.ac:14: -1- AM_SET_DEPDIR -m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.ac:14: -1- AM_OUTPUT_DEPENDENCY_COMMANDS -m4trace:configure.ac:14: -1- AM_MAKE_INCLUDE -m4trace:configure.ac:14: -1- AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.ac:14: -1- AM_DEP_TRACK -m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) -m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) -m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) -m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) -m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) -m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) -m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) -m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) -m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- _AC_AM_CONFIG_HEADER_HOOK(["$ac_file"]) -m4trace:configure.ac:62: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS -m4trace:configure.ac:62: -1- AM_RUN_LOG([cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles]) diff --git a/autom4te.cache/traces.1 b/autom4te.cache/traces.1 deleted file mode 100644 index 43633f948703..000000000000 --- a/autom4te.cache/traces.1 +++ /dev/null @@ -1,509 +0,0 @@ -m4trace:aclocal.m4:679: -1- AC_SUBST([am__quote]) -m4trace:aclocal.m4:679: -1- AC_SUBST_TRACE([am__quote]) -m4trace:aclocal.m4:679: -1- m4_pattern_allow([^am__quote$]) -m4trace:configure.ac:6: -1- AC_INIT([rimage], [1.0]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.ac:6: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.ac:6: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.ac:6: -1- AC_SUBST([SHELL]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([SHELL]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.ac:6: -1- AC_SUBST([PATH_SEPARATOR]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_NAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_STRING]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- AC_SUBST([PACKAGE_URL], [m4_ifdef([AC_PACKAGE_URL], ['AC_PACKAGE_URL'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([PACKAGE_URL]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- AC_SUBST([exec_prefix], [NONE]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([exec_prefix]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.ac:6: -1- AC_SUBST([prefix], [NONE]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([prefix]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.ac:6: -1- AC_SUBST([program_transform_name], [s,x,x,]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([program_transform_name]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.ac:6: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([bindir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.ac:6: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sbindir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.ac:6: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libexecdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([datarootdir], ['${prefix}/share']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datarootdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([datadir], ['${datarootdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([datadir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.ac:6: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sysconfdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([sharedstatedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([localstatedir], ['${prefix}/var']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localstatedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([includedir], ['${prefix}/include']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([includedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([oldincludedir], ['/usr/include']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([oldincludedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], - ['${datarootdir}/doc/${PACKAGE_TARNAME}'], - ['${datarootdir}/doc/${PACKAGE}'])]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([docdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([infodir], ['${datarootdir}/info']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([infodir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.ac:6: -1- AC_SUBST([htmldir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([htmldir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.ac:6: -1- AC_SUBST([dvidir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([dvidir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.ac:6: -1- AC_SUBST([pdfdir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([pdfdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([psdir], ['${docdir}']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([psdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([libdir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.ac:6: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([localedir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.ac:6: -1- AC_SUBST([mandir], ['${datarootdir}/man']) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([mandir]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ -@%:@undef PACKAGE_NAME]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ -@%:@undef PACKAGE_TARNAME]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ -@%:@undef PACKAGE_VERSION]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ -@%:@undef PACKAGE_STRING]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ -@%:@undef PACKAGE_BUGREPORT]) -m4trace:configure.ac:6: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_URL]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^PACKAGE_URL$]) -m4trace:configure.ac:6: -1- AH_OUTPUT([PACKAGE_URL], [/* Define to the home page for this package. */ -@%:@undef PACKAGE_URL]) -m4trace:configure.ac:6: -1- AC_SUBST([DEFS]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([DEFS]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.ac:6: -1- AC_SUBST([ECHO_C]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_C]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.ac:6: -1- AC_SUBST([ECHO_N]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_N]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.ac:6: -1- AC_SUBST([ECHO_T]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([ECHO_T]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.ac:6: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:6: -1- AC_SUBST([build_alias]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([build_alias]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.ac:6: -1- AC_SUBST([host_alias]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([host_alias]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.ac:6: -1- AC_SUBST([target_alias]) -m4trace:configure.ac:6: -1- AC_SUBST_TRACE([target_alias]) -m4trace:configure.ac:6: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.ac:7: -1- AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) -m4trace:configure.ac:7: -1- AM_AUTOMAKE_VERSION([1.16.1]) -m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_PROGRAM]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_SCRIPT]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_DATA]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_DATA]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__isrc]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__isrc$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.ac:7: -1- AC_SUBST([CYGPATH_W]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([CYGPATH_W]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.ac:7: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([PACKAGE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([VERSION]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:7: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ -@%:@undef PACKAGE]) -m4trace:configure.ac:7: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:7: -1- AH_OUTPUT([VERSION], [/* Version number of package */ -@%:@undef VERSION]) -m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([missing]) -m4trace:configure.ac:7: -1- AC_SUBST([ACLOCAL]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([ACLOCAL]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.ac:7: -1- AC_SUBST([AUTOCONF]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOCONF]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.ac:7: -1- AC_SUBST([AUTOMAKE]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOMAKE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.ac:7: -1- AC_SUBST([AUTOHEADER]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AUTOHEADER]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.ac:7: -1- AC_SUBST([MAKEINFO]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MAKEINFO]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.ac:7: -1- AC_SUBST([install_sh]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([install_sh]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.ac:7: -1- AC_SUBST([STRIP]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([STRIP]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:7: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.ac:7: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:7: -1- AC_SUBST([MKDIR_P]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([MKDIR_P]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^MKDIR_P$]) -m4trace:configure.ac:7: -1- AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([mkdir_p]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.ac:7: -1- AC_SUBST([AWK]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AWK]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.ac:7: -1- AC_SUBST([SET_MAKE]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([SET_MAKE]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__leading_dot]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__leading_dot]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.ac:7: -1- AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AMTAR]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__tar]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__tar]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.ac:7: -1- AC_SUBST([am__untar]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([am__untar]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.ac:7: -1- AM_SILENT_RULES -m4trace:configure.ac:7: -1- AC_SUBST([AM_V]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_V$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_V]) -m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_V$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_DEFAULT_V]) -m4trace:configure.ac:7: -1- AC_SUBST([AM_DEFAULT_VERBOSITY]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_DEFAULT_VERBOSITY]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_DEFAULT_VERBOSITY$]) -m4trace:configure.ac:7: -1- AC_SUBST([AM_BACKSLASH]) -m4trace:configure.ac:7: -1- AC_SUBST_TRACE([AM_BACKSLASH]) -m4trace:configure.ac:7: -1- m4_pattern_allow([^AM_BACKSLASH$]) -m4trace:configure.ac:7: -1- _AM_SUBST_NOTMAKE([AM_BACKSLASH]) -m4trace:configure.ac:9: -1- AC_CONFIG_HEADERS([config.h]) -m4trace:configure.ac:10: -1- AC_CONFIG_FILES([Makefile - src/Makefile]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CFLAGS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CFLAGS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:14: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:14: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:14: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([ac_ct_CC]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([ac_ct_CC]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:14: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([EXEEXT]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.ac:14: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([OBJEXT]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.ac:14: -1- AC_REQUIRE_AUX_FILE([compile]) -m4trace:configure.ac:14: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([DEPDIR]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.ac:14: -1- AC_SUBST([am__include]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__include]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.ac:14: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.ac:14: -1- AC_SUBST([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEP_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.ac:14: -1- AC_SUBST([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.ac:14: -1- AC_SUBST([am__nodep]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__nodep]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__nodep$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__nodep]) -m4trace:configure.ac:14: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([CCDEPMODE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:14: -1- AM_CONDITIONAL([am__fastdepCC], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:14: -1- AC_SUBST([am__fastdepCC_FALSE]) -m4trace:configure.ac:14: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) -m4trace:configure.ac:14: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:14: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:17: -1- AH_OUTPUT([HAVE_LIBCRYPTO], [/* Define to 1 if you have the `crypto\' library (-lcrypto). */ -@%:@undef HAVE_LIBCRYPTO]) -m4trace:configure.ac:17: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCRYPTO]) -m4trace:configure.ac:17: -1- m4_pattern_allow([^HAVE_LIBCRYPTO$]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDINT_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDLIB_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRING_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TIME_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_UNISTD_H]) -m4trace:configure.ac:20: -1- AC_SUBST([CPP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:20: -1- AC_SUBST([CPP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:20: -1- AC_SUBST([GREP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([GREP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:20: -1- AC_SUBST([EGREP]) -m4trace:configure.ac:20: -1- AC_SUBST_TRACE([EGREP]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:20: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) -m4trace:configure.ac:20: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.ac:20: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ -@%:@undef STDC_HEADERS]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_TYPES_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SYS_STAT_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDLIB_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRING_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_MEMORY_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STRINGS_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_INTTYPES_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_STDINT_H]) -m4trace:configure.ac:20: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_UNISTD_H]) -m4trace:configure.ac:23: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler - calls it, or to nothing if \'inline\' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif]) -m4trace:configure.ac:24: -1- AC_DEFINE_TRACE_LITERAL([int16_t]) -m4trace:configure.ac:24: -1- m4_pattern_allow([^int16_t$]) -m4trace:configure.ac:24: -1- AH_OUTPUT([int16_t], [/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef int16_t]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([int32_t]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^int32_t$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([int32_t], [/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef int32_t]) -m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([int64_t]) -m4trace:configure.ac:26: -1- m4_pattern_allow([^int64_t$]) -m4trace:configure.ac:26: -1- AH_OUTPUT([int64_t], [/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef int64_t]) -m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([int8_t]) -m4trace:configure.ac:27: -1- m4_pattern_allow([^int8_t$]) -m4trace:configure.ac:27: -1- AH_OUTPUT([int8_t], [/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -@%:@undef int8_t]) -m4trace:configure.ac:28: -1- AC_DEFINE_TRACE_LITERAL([size_t]) -m4trace:configure.ac:28: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.ac:28: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ -@%:@undef size_t]) -m4trace:configure.ac:29: -1- AC_DEFINE_TRACE_LITERAL([uint16_t]) -m4trace:configure.ac:29: -1- m4_pattern_allow([^uint16_t$]) -m4trace:configure.ac:29: -1- AH_OUTPUT([uint16_t], [/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint16_t]) -m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([_UINT32_T]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^_UINT32_T$]) -m4trace:configure.ac:30: -1- AH_OUTPUT([_UINT32_T], [/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - @%:@define below would cause a syntax error. */ -@%:@undef _UINT32_T]) -m4trace:configure.ac:30: -1- AC_DEFINE_TRACE_LITERAL([uint32_t]) -m4trace:configure.ac:30: -1- m4_pattern_allow([^uint32_t$]) -m4trace:configure.ac:30: -1- AH_OUTPUT([uint32_t], [/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint32_t]) -m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([_UINT64_T]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^_UINT64_T$]) -m4trace:configure.ac:31: -1- AH_OUTPUT([_UINT64_T], [/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - @%:@define below would cause a syntax error. */ -@%:@undef _UINT64_T]) -m4trace:configure.ac:31: -1- AC_DEFINE_TRACE_LITERAL([uint64_t]) -m4trace:configure.ac:31: -1- m4_pattern_allow([^uint64_t$]) -m4trace:configure.ac:31: -1- AH_OUTPUT([uint64_t], [/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint64_t]) -m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([_UINT8_T]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^_UINT8_T$]) -m4trace:configure.ac:32: -1- AH_OUTPUT([_UINT8_T], [/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - @%:@define below would cause a syntax error. */ -@%:@undef _UINT8_T]) -m4trace:configure.ac:32: -1- AC_DEFINE_TRACE_LITERAL([uint8_t]) -m4trace:configure.ac:32: -1- m4_pattern_allow([^uint8_t$]) -m4trace:configure.ac:32: -1- AH_OUTPUT([uint8_t], [/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -@%:@undef uint8_t]) -m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the `gettimeofday\' function. */ -@%:@undef HAVE_GETTIMEOFDAY]) -m4trace:configure.ac:35: -1- AH_OUTPUT([HAVE_MEMSET], [/* Define to 1 if you have the `memset\' function. */ -@%:@undef HAVE_MEMSET]) -m4trace:configure.ac:41: -1- AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) -m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_TRUE$]) -m4trace:configure.ac:41: -1- AC_SUBST([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:41: -1- AC_SUBST_TRACE([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:41: -1- m4_pattern_allow([^USE_PROVIDED_SOF_HEADER_FALSE$]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_TRUE]) -m4trace:configure.ac:41: -1- _AM_SUBST_NOTMAKE([USE_PROVIDED_SOF_HEADER_FALSE]) -m4trace:configure.ac:47: -1- AH_OUTPUT([HAVE_IPC_HEADER_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_IPC_HEADER_H]) -m4trace:configure.ac:47: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_HEADER_H]) -m4trace:configure.ac:47: -1- m4_pattern_allow([^HAVE_IPC_HEADER_H$]) -m4trace:configure.ac:49: -1- AH_OUTPUT([HAVE_IPC_INFO_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_IPC_INFO_H]) -m4trace:configure.ac:49: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_INFO_H]) -m4trace:configure.ac:49: -1- m4_pattern_allow([^HAVE_IPC_INFO_H$]) -m4trace:configure.ac:51: -1- AH_OUTPUT([HAVE_IPC_STREAM_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_IPC_STREAM_H]) -m4trace:configure.ac:51: -1- AC_DEFINE_TRACE_LITERAL([HAVE_IPC_STREAM_H]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^HAVE_IPC_STREAM_H$]) -m4trace:configure.ac:53: -1- AH_OUTPUT([HAVE_KERNEL_FW_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_KERNEL_FW_H]) -m4trace:configure.ac:53: -1- AC_DEFINE_TRACE_LITERAL([HAVE_KERNEL_FW_H]) -m4trace:configure.ac:53: -1- m4_pattern_allow([^HAVE_KERNEL_FW_H$]) -m4trace:configure.ac:55: -1- AH_OUTPUT([HAVE_SOF_LOGS_FILE_FORMAT_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_SOF_LOGS_FILE_FORMAT_H]) -m4trace:configure.ac:55: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SOF_LOGS_FILE_FORMAT_H]) -m4trace:configure.ac:55: -1- m4_pattern_allow([^HAVE_SOF_LOGS_FILE_FORMAT_H$]) -m4trace:configure.ac:57: -1- AH_OUTPUT([HAVE_USER_MANIFEST_H], [/* Define to 1 if you have the header file. */ -@%:@undef HAVE_USER_MANIFEST_H]) -m4trace:configure.ac:57: -1- AC_DEFINE_TRACE_LITERAL([HAVE_USER_MANIFEST_H]) -m4trace:configure.ac:57: -1- m4_pattern_allow([^HAVE_USER_MANIFEST_H$]) -m4trace:configure.ac:62: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:62: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([LTLIBOBJS]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:62: -1- AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"]) -m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_TRUE$]) -m4trace:configure.ac:62: -1- AC_SUBST([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- m4_pattern_allow([^am__EXEEXT_FALSE$]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_TRUE]) -m4trace:configure.ac:62: -1- _AM_SUBST_NOTMAKE([am__EXEEXT_FALSE]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_build_prefix]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([top_srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_srcdir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([abs_top_builddir]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([INSTALL]) -m4trace:configure.ac:62: -1- AC_SUBST_TRACE([MKDIR_P]) diff --git a/compile b/compile deleted file mode 100755 index 99e50524b3ba..000000000000 --- a/compile +++ /dev/null @@ -1,348 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand '-c -o'. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -nl=' -' - -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent tools from complaining about whitespace usage. -IFS=" "" $nl" - -file_conv= - -# func_file_conv build_file lazy -# Convert a $build file to $host form and store it in $file -# Currently only supports Windows hosts. If the determined conversion -# type is listed in (the comma separated) LAZY, no conversion will -# take place. -func_file_conv () -{ - file=$1 - case $file in - / | /[!/]*) # absolute file, and not a UNC file - if test -z "$file_conv"; then - # lazily determine how to convert abs files - case `uname -s` in - MINGW*) - file_conv=mingw - ;; - CYGWIN*) - file_conv=cygwin - ;; - *) - file_conv=wine - ;; - esac - fi - case $file_conv/,$2, in - *,$file_conv,*) - ;; - mingw/*) - file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` - ;; - cygwin/*) - file=`cygpath -m "$file" || echo "$file"` - ;; - wine/*) - file=`winepath -w "$file" || echo "$file"` - ;; - esac - ;; - esac -} - -# func_cl_dashL linkdir -# Make cl look for libraries in LINKDIR -func_cl_dashL () -{ - func_file_conv "$1" - if test -z "$lib_path"; then - lib_path=$file - else - lib_path="$lib_path;$file" - fi - linker_opts="$linker_opts -LIBPATH:$file" -} - -# func_cl_dashl library -# Do a library search-path lookup for cl -func_cl_dashl () -{ - lib=$1 - found=no - save_IFS=$IFS - IFS=';' - for dir in $lib_path $LIB - do - IFS=$save_IFS - if $shared && test -f "$dir/$lib.dll.lib"; then - found=yes - lib=$dir/$lib.dll.lib - break - fi - if test -f "$dir/$lib.lib"; then - found=yes - lib=$dir/$lib.lib - break - fi - if test -f "$dir/lib$lib.a"; then - found=yes - lib=$dir/lib$lib.a - break - fi - done - IFS=$save_IFS - - if test "$found" != yes; then - lib=$lib.lib - fi -} - -# func_cl_wrapper cl arg... -# Adjust compile command to suit cl -func_cl_wrapper () -{ - # Assume a capable shell - lib_path= - shared=: - linker_opts= - for arg - do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - eat=1 - case $2 in - *.o | *.[oO][bB][jJ]) - func_file_conv "$2" - set x "$@" -Fo"$file" - shift - ;; - *) - func_file_conv "$2" - set x "$@" -Fe"$file" - shift - ;; - esac - ;; - -I) - eat=1 - func_file_conv "$2" mingw - set x "$@" -I"$file" - shift - ;; - -I*) - func_file_conv "${1#-I}" mingw - set x "$@" -I"$file" - shift - ;; - -l) - eat=1 - func_cl_dashl "$2" - set x "$@" "$lib" - shift - ;; - -l*) - func_cl_dashl "${1#-l}" - set x "$@" "$lib" - shift - ;; - -L) - eat=1 - func_cl_dashL "$2" - ;; - -L*) - func_cl_dashL "${1#-L}" - ;; - -static) - shared=false - ;; - -Wl,*) - arg=${1#-Wl,} - save_ifs="$IFS"; IFS=',' - for flag in $arg; do - IFS="$save_ifs" - linker_opts="$linker_opts $flag" - done - IFS="$save_ifs" - ;; - -Xlinker) - eat=1 - linker_opts="$linker_opts $2" - ;; - -*) - set x "$@" "$1" - shift - ;; - *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) - func_file_conv "$1" - set x "$@" -Tp"$file" - shift - ;; - *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) - func_file_conv "$1" mingw - set x "$@" "$file" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift - done - if test -n "$linker_opts"; then - linker_opts="-link$linker_opts" - fi - exec "$@" $linker_opts - exit 1 -} - -eat= - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand '-c -o'. -Remove '-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file 'INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ - icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) - func_cl_wrapper "$@" # Doesn't return... - ;; -esac - -ofile= -cfile= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as 'compile cc -o foo foo.c'. - # So we strip '-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no '-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # '.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` - -# Create the lock directory. -# Note: use '[/\\:.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - test "$cofile" = "$ofile" || mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/config.h.in b/config.h.in deleted file mode 100644 index ef2c623daf43..000000000000 --- a/config.h.in +++ /dev/null @@ -1,141 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IPC_HEADER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IPC_INFO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_IPC_STREAM_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_KERNEL_FW_H - -/* Define to 1 if you have the `crypto' library (-lcrypto). */ -#undef HAVE_LIBCRYPTO - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_SOF_LOGS_FILE_FORMAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_USER_MANIFEST_H - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Version number of package */ -#undef VERSION - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT8_T - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -#undef inline -#endif - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef int16_t - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -#undef int8_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef uint16_t - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -#undef uint8_t diff --git a/configure b/configure deleted file mode 100755 index abc56f0e1ab4..000000000000 --- a/configure +++ /dev/null @@ -1,6178 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for rimage 1.0. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='rimage' -PACKAGE_TARNAME='rimage' -PACKAGE_VERSION='1.0' -PACKAGE_STRING='rimage 1.0' -PACKAGE_BUGREPORT='' -PACKAGE_URL='' - -ac_unique_file="src/rimage.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -USE_PROVIDED_SOF_HEADER_FALSE -USE_PROVIDED_SOF_HEADER_TRUE -EGREP -GREP -CPP -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL -am__quote' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -with_sof_source -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures rimage 1.0 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/rimage] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of rimage 1.0:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: "make V=1") - --disable-silent-rules verbose build output (undo: "make V=0") - --enable-dependency-tracking - do not reject slow dependency extractors - --disable-dependency-tracking - speeds up one-time build - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-sof-source=DIR where the root of SOF source is - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -rimage configure 1.0 -generated by GNU Autoconf 2.69 - -Copyright (C) 2012 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_find_intX_t LINENO BITS VAR -# ----------------------------------- -# Finds a signed integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in #( - int$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_intX_t - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_type - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_uintX_t - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -am__api_version='1.16' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; -esac - -# Do 'set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - am_has_slept=no - for am_try in 1 2; do - echo "timestamp, slept: $am_has_slept" > conftest.file - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken - alias in your environment" "$LINENO" 5 - fi - if test "$2" = conftest.file || test $am_try -eq 2; then - break - fi - # Just in case. - sleep 1 - am_has_slept=yes - done - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -# If we didn't sleep, we still need to ensure time stamps of config.status and -# generated files are strictly newer. -am_sleep_pid= -if grep 'slept: no' conftest.file >/dev/null 2>&1; then - ( sleep 1 ) & - am_sleep_pid=$! -fi - -rm -f conftest.file - -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# Expand $ac_aux_dir to an absolute path. -am_aux_dir=`cd "$ac_aux_dir" && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --is-lightweight"; then - am_missing_run="$MISSING " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using 'strip' when the user -# run "make install-strip". However 'strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the 'STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in # ((( - yes) AM_DEFAULT_VERBOSITY=0;; - no) AM_DEFAULT_VERBOSITY=1;; - *) AM_DEFAULT_VERBOSITY=1;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='rimage' - VERSION='1.0' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# For better backward compatibility. To be removed once Automake 1.9.x -# dies out for good. For more background, see: -# -# -mkdir_p='$(MKDIR_P)' - -# We need awk for the "check" target (and possibly the TAP driver). The -# system "awk" is bad on some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - - -# We'll loop over all known methods to create a tar archive until one works. -_am_tools='gnutar pax cpio none' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# POSIX will say in a future version that running "rm -f" with no argument -# is OK; and we want to be able to make that assumption in our Makefile -# recipes. So use an aggressive probe to check that the usage we want is -# actually supported "in the wild" to an acceptable degree. -# See automake bug#10828. -# To make any issue more visible, cause the running configure to be aborted -# by default if the 'rm' program in use doesn't match our expectations; the -# user can still override this though. -if rm -f && rm -fr && rm -rf; then : OK; else - cat >&2 <<'END' -Oops! - -Your 'rm' program seems unable to run without file operands specified -on the command line, even when the '-f' option is present. This is contrary -to the behaviour of most rm programs out there, and not conforming with -the upcoming POSIX standard: - -Please tell bug-automake@gnu.org about your system, including the value -of your $PATH and any error possibly output before this message. This -can help us improve future automake versions. - -END - if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then - echo 'Configuration will proceed anyway, since you have set the' >&2 - echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 - echo >&2 - else - cat >&2 <<'END' -Aborting the configuration process, to ensure you take notice of the issue. - -You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . - -If you want to complete the configuration process using your problematic -'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM -to "yes", and re-run configure. - -END - as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 - fi -fi - - -ac_config_headers="$ac_config_headers config.h" - -ac_config_files="$ac_config_files Makefile src/Makefile" - - -# Checks for programs. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -# Checks for libraries. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CRYPTO_new_ex_data in -lcrypto" >&5 -$as_echo_n "checking for CRYPTO_new_ex_data in -lcrypto... " >&6; } -if ${ac_cv_lib_crypto_CRYPTO_new_ex_data+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypto $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char CRYPTO_new_ex_data (); -int -main () -{ -return CRYPTO_new_ex_data (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_crypto_CRYPTO_new_ex_data=yes -else - ac_cv_lib_crypto_CRYPTO_new_ex_data=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_CRYPTO_new_ex_data" >&5 -$as_echo "$ac_cv_lib_crypto_CRYPTO_new_ex_data" >&6; } -if test "x$ac_cv_lib_crypto_CRYPTO_new_ex_data" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCRYPTO 1 -_ACEOF - - LIBS="-lcrypto $LIBS" - -else - as_fn_error $? "library 'crypto' is required for OpenSSL" "$LINENO" 5 -fi - - -# Checks for header files. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in stdint.h stdlib.h string.h sys/time.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -#define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - - -# Checks for library functions. -for ac_func in gettimeofday memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Where SOF header files are - -# Check whether --with-sof-source was given. -if test "${with_sof_source+set}" = set; then : - withval=$with_sof_source; SOF_SOURCE_DIR="$with_sof_source/src" -fi - - if test "x$SOF_SOURCE_DIR" = "x"; then - USE_PROVIDED_SOF_HEADER_TRUE= - USE_PROVIDED_SOF_HEADER_FALSE='#' -else - USE_PROVIDED_SOF_HEADER_TRUE='#' - USE_PROVIDED_SOF_HEADER_FALSE= -fi - - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - for ac_header in ipc/header.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/header.h" "ac_cv_header_ipc_header_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_header_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IPC_HEADER_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/header.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/info.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/info.h" "ac_cv_header_ipc_info_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_info_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IPC_INFO_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/info.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in ipc/stream.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ipc/stream.h" "ac_cv_header_ipc_stream_h" "$ac_includes_default" -if test "x$ac_cv_header_ipc_stream_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IPC_STREAM_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find ipc/stream.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in kernel/fw.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "kernel/fw.h" "ac_cv_header_kernel_fw_h" "$ac_includes_default" -if test "x$ac_cv_header_kernel_fw_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_KERNEL_FW_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find kernel/fw.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in sof/logs/file_format.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sof/logs/file_format.h" "ac_cv_header_sof_logs_file_format_h" "$ac_includes_default" -if test "x$ac_cv_header_sof_logs_file_format_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SOF_LOGS_FILE_FORMAT_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find sof/logs/file_format.h. Aborting." "$LINENO" 5 -fi - -done - - for ac_header in user/manifest.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "user/manifest.h" "ac_cv_header_user_manifest_h" "$ac_includes_default" -if test "x$ac_cv_header_user_manifest_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_USER_MANIFEST_H 1 -_ACEOF - -else - as_fn_error $? "Unable to find user/manifest.h. Aborting." "$LINENO" 5 -fi - -done - -fi - -# Generate outputs -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } - if test -n "$am_sleep_pid"; then - # Hide warnings about reused PIDs. - wait $am_sleep_pid 2>/dev/null - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_PROVIDED_SOF_HEADER_TRUE}" && test -z "${USE_PROVIDED_SOF_HEADER_FALSE}"; then - as_fn_error $? "conditional \"USE_PROVIDED_SOF_HEADER\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -pR' - fi -else - as_ln_s='cp -pR' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by rimage $as_me 1.0, which was -generated by GNU Autoconf 2.69. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -rimage config.status 1.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2012 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Older Autoconf quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - # TODO: see whether this extra hack can be removed once we start - # requiring Autoconf 2.70 or later. - case $CONFIG_FILES in #( - *\'*) : - eval set x "$CONFIG_FILES" ;; #( - *) : - set x $CONFIG_FILES ;; #( - *) : - ;; -esac - shift - # Used to flag and report bootstrapping failures. - am_rc=0 - for am_mf - do - # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile which includes - # dependency-tracking related rules and includes. - # Grep'ing the whole file directly is not great: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ - || continue - am_dirpart=`$as_dirname -- "$am_mf" || -$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$am_mf" : 'X\(//\)[^/]' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - am_filepart=`$as_basename -- "$am_mf" || -$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ - X"$am_mf" : 'X\(//\)$' \| \ - X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { echo "$as_me:$LINENO: cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles" >&5 - (cd "$am_dirpart" \ - && sed -e '/# am--include-marker/d' "$am_filepart" \ - | $MAKE -f - am--depfiles) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } || am_rc=$? - done - if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the - '--disable-dependency-tracking' option to at least be able to build - the package (albeit without support for automatic dependency tracking). -See \`config.log' for more details" "$LINENO" 5; } - fi - { am_dirpart=; unset am_dirpart;} - { am_filepart=; unset am_filepart;} - { am_mf=; unset am_mf;} - { am_rc=; unset am_rc;} - rm -f conftest-deps.mk -} - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/configure.ac b/configure.ac deleted file mode 100644 index e39de6d54d37..000000000000 --- a/configure.ac +++ /dev/null @@ -1,62 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -AC_PREREQ([2.69]) -AC_INIT([rimage],[1.0]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -AC_CONFIG_SRCDIR([src/rimage.c]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile - src/Makefile]) - -# Checks for programs. -AC_PROG_CC - -# Checks for libraries. -AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])]) - -# Checks for header files. -AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_INLINE -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_TYPE_INT8_T -AC_TYPE_SIZE_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_UINT8_T - -# Checks for library functions. -AC_CHECK_FUNCS([gettimeofday memset]) - -# Where SOF header files are -AC_ARG_WITH(sof-source, - AS_HELP_STRING([--with-sof-source=DIR],[where the root of SOF source is]), - [ SOF_SOURCE_DIR="$with_sof_source/src" ],) -AM_CONDITIONAL([USE_PROVIDED_SOF_HEADER], [test "x$SOF_SOURCE_DIR" = "x"]) - -if test "x$SOF_SOURCE_DIR" != "x"; then - SOF_INCLUDES="-I$SOF_SOURCE_DIR/include" - CFLAGS="$CFLAGS $SOF_INCLUDES" - CPPFLAGS="$CPPFLAGS $SOF_INCLUDES" - AC_CHECK_HEADERS(ipc/header.h, , - [ AC_MSG_ERROR([Unable to find ipc/header.h. Aborting.]) ]) - AC_CHECK_HEADERS(ipc/info.h, , - [ AC_MSG_ERROR([Unable to find ipc/info.h. Aborting.]) ]) - AC_CHECK_HEADERS(ipc/stream.h, , - [ AC_MSG_ERROR([Unable to find ipc/stream.h. Aborting.]) ]) - AC_CHECK_HEADERS(kernel/fw.h, , - [ AC_MSG_ERROR([Unable to find kernel/fw.h. Aborting.]) ]) - AC_CHECK_HEADERS(sof/logs/file_format.h, , - [ AC_MSG_ERROR([Unable to find sof/logs/file_format.h. Aborting.]) ]) - AC_CHECK_HEADERS(user/manifest.h, , - [ AC_MSG_ERROR([Unable to find user/manifest.h. Aborting.]) ]) -fi - -# Generate outputs -AC_OUTPUT diff --git a/depcomp b/depcomp deleted file mode 100755 index 65cbf7093a1e..000000000000 --- a/depcomp +++ /dev/null @@ -1,791 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1999-2018 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try '$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by 'PROGRAMS ARGS'. - object Object file output by 'PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -# Get the directory component of the given path, and save it in the -# global variables '$dir'. Note that this directory component will -# be either empty or ending with a '/' character. This is deliberate. -set_dir_from () -{ - case $1 in - */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; - *) dir=;; - esac -} - -# Get the suffix-stripped basename of the given path, and save it the -# global variable '$base'. -set_base_from () -{ - base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` -} - -# If no dependency file was actually created by the compiler invocation, -# we still have to create a dummy depfile, to avoid errors with the -# Makefile "include basename.Plo" scheme. -make_dummy_depfile () -{ - echo "#dummy" > "$depfile" -} - -# Factor out some common post-processing of the generated depfile. -# Requires the auxiliary global variable '$tmpdepfile' to be set. -aix_post_process_depfile () -{ - # If the compiler actually managed to produce a dependency file, - # post-process it. - if test -f "$tmpdepfile"; then - # Each line is of the form 'foo.o: dependency.h'. - # Do two passes, one to just change these to - # $object: dependency.h - # and one to simply output - # dependency.h: - # which is needed to avoid the deleted-header problem. - { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" - sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" - } > "$depfile" - rm -f "$tmpdepfile" - else - make_dummy_depfile - fi -} - -# A tabulation character. -tab=' ' -# A newline character. -nl=' -' -# Character ranges might be problematic outside the C locale. -# These definitions help. -upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ -lower=abcdefghijklmnopqrstuvwxyz -digits=0123456789 -alpha=${upper}${lower} - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Avoid interferences from the environment. -gccflag= dashmflag= - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. - gccflag=-qmakedep=gcc,-MF - depmode=gcc -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. -## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. -## (see the conditional assignment to $gccflag above). -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). Also, it might not be -## supported by the other compilers which use the 'gcc' depmode. -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The second -e expression handles DOS-style file names with drive - # letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the "deleted header file" problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. -## Some versions of gcc put a space before the ':'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like '#:fec' to the end of the - # dependency line. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ - | tr "$nl" ' ' >> "$depfile" - echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" - ;; - -xlc) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts '$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - aix_post_process_depfile - ;; - -tcc) - # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 - # FIXME: That version still under development at the moment of writing. - # Make that this statement remains true also for stable, released - # versions. - # It will wrap lines (doesn't matter whether long or short) with a - # trailing '\', as in: - # - # foo.o : \ - # foo.c \ - # foo.h \ - # - # It will put a trailing '\' even on the last line, and will use leading - # spaces rather than leading tabs (at least since its commit 0394caf7 - # "Emit spaces for -MD"). - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. - # We have to change lines of the first kind to '$object: \'. - sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" - # And for each line of the second kind, we have to emit a 'dep.h:' - # dummy dependency, to avoid the deleted-header problem. - sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" - rm -f "$tmpdepfile" - ;; - -## The order of this option in the case statement is important, since the -## shell code in configure will try each of these formats in the order -## listed in this file. A plain '-MD' option would be understood by many -## compilers, so we must ensure this comes after the gcc and icc options. -pgcc) - # Portland's C compiler understands '-MD'. - # Will always output deps to 'file.d' where file is the root name of the - # source file under compilation, even if file resides in a subdirectory. - # The object file name does not affect the name of the '.d' file. - # pgcc 10.2 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using '\' : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - set_dir_from "$object" - # Use the source, not the object, to determine the base name, since - # that's sadly what pgcc will do too. - set_base_from "$source" - tmpdepfile=$base.d - - # For projects that build the same source file twice into different object - # files, the pgcc approach of using the *source* file root name can cause - # problems in parallel builds. Use a locking strategy to avoid stomping on - # the same $tmpdepfile. - lockdir=$base.d-lock - trap " - echo '$0: caught signal, cleaning up...' >&2 - rmdir '$lockdir' - exit 1 - " 1 2 13 15 - numtries=100 - i=$numtries - while test $i -gt 0; do - # mkdir is a portable test-and-set. - if mkdir "$lockdir" 2>/dev/null; then - # This process acquired the lock. - "$@" -MD - stat=$? - # Release the lock. - rmdir "$lockdir" - break - else - # If the lock is being held by a different process, wait - # until the winning process is done or we timeout. - while test -d "$lockdir" && test $i -gt 0; do - sleep 1 - i=`expr $i - 1` - done - fi - i=`expr $i - 1` - done - trap - 1 2 13 15 - if test $i -le 0; then - echo "$0: failed to acquire lock after $numtries attempts" >&2 - echo "$0: check lockdir '$lockdir'" >&2 - exit 1 - fi - - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - set_dir_from "$object" - set_base_from "$object" - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" - # Add 'dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - make_dummy_depfile - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in 'foo.d' instead, so we check for that too. - # Subdirectories are respected. - set_dir_from "$object" - set_base_from "$object" - - if test "$libtool" = yes; then - # Libtool generates 2 separate objects for the 2 libraries. These - # two compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir$base.o.d # libtool 1.5 - tmpdepfile2=$dir.libs/$base.o.d # Likewise. - tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -ne 0; then - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - # Same post-processing that is required for AIX mode. - aix_post_process_depfile - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test $stat -ne 0; then - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/'"$tab"'\1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/'"$tab"'/ - G - p -}' >> "$depfile" - echo >> "$depfile" # make sure the fragment doesn't end with a backslash - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for ':' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. - "$@" $dashmflag | - sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this sed invocation - # correctly. Breaking it into two sed invocations is a workaround. - tr ' ' "$nl" < "$tmpdepfile" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process the last invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed '1,2d' "$tmpdepfile" \ - | tr ' ' "$nl" \ - | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove '-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E \ - | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - | sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" - echo "$tab" >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/install-sh b/install-sh deleted file mode 100755 index 8175c640fe62..000000000000 --- a/install-sh +++ /dev/null @@ -1,518 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2018-03-11.20; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# 'make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -tab=' ' -nl=' -' -IFS=" $tab$nl" - -# Set DOITPROG to "echo" to test this script. - -doit=${DOITPROG-} -doit_exec=${doit:-exec} - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -is_target_a_directory=possibly - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) - is_target_a_directory=always - dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) is_target_a_directory=never;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -# We allow the use of options -d and -T together, by making -d -# take the precedence; this is for compatibility with GNU install. - -if test -n "$dir_arg"; then - if test -n "$dst_arg"; then - echo "$0: target directory not allowed when installing a directory." >&2 - exit 1 - fi -fi - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call 'install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - if test $# -gt 1 || test "$is_target_a_directory" = always; then - if test ! -d "$dst_arg"; then - echo "$0: $dst_arg: Is not a directory." >&2 - exit 1 - fi - fi -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for 'test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename. - if test -d "$dst"; then - if test "$is_target_a_directory" = never; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dstbase=`basename "$src"` - case $dst in - */) dst=$dst$dstbase;; - *) dst=$dst/$dstbase;; - esac - dstdir_status=0 - else - dstdir=`dirname "$dst"` - test -d "$dstdir" - dstdir_status=$? - fi - fi - - case $dstdir in - */) dstdirslash=$dstdir;; - *) dstdirslash=$dstdir/;; - esac - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - oIFS=$IFS - IFS=/ - set -f - set fnord $dstdir - shift - set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=${dstdirslash}_inst.$$_ - rmtmp=${dstdirslash}_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - set +f && - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/missing b/missing deleted file mode 100755 index 625aeb11897a..000000000000 --- a/missing +++ /dev/null @@ -1,215 +0,0 @@ -#! /bin/sh -# Common wrapper for a few potentially missing GNU programs. - -scriptversion=2018-03-07.03; # UTC - -# Copyright (C) 1996-2018 Free Software Foundation, Inc. -# Originally written by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try '$0 --help' for more information" - exit 1 -fi - -case $1 in - - --is-lightweight) - # Used by our autoconf macros to check whether the available missing - # script is modern enough. - exit 0 - ;; - - --run) - # Back-compat with the calling convention used by older automake. - shift - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due -to PROGRAM being missing or too old. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - -Supported PROGRAM values: - aclocal autoconf autoheader autom4te automake makeinfo - bison yacc flex lex help2man - -Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and -'g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: unknown '$1' option" - echo 1>&2 "Try '$0 --help' for more information" - exit 1 - ;; - -esac - -# Run the given program, remember its exit status. -"$@"; st=$? - -# If it succeeded, we are done. -test $st -eq 0 && exit 0 - -# Also exit now if we it failed (or wasn't found), and '--version' was -# passed; such an option is passed most likely to detect whether the -# program is present and works. -case $2 in --version|--help) exit $st;; esac - -# Exit code 63 means version mismatch. This often happens when the user -# tries to use an ancient version of a tool on a file that requires a -# minimum version. -if test $st -eq 63; then - msg="probably too old" -elif test $st -eq 127; then - # Program was missing. - msg="missing on your system" -else - # Program was found and executed, but failed. Give up. - exit $st -fi - -perl_URL=https://www.perl.org/ -flex_URL=https://github.com/westes/flex -gnu_software_URL=https://www.gnu.org/software - -program_details () -{ - case $1 in - aclocal|automake) - echo "The '$1' program is part of the GNU Automake package:" - echo "<$gnu_software_URL/automake>" - echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/autoconf>" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - autoconf|autom4te|autoheader) - echo "The '$1' program is part of the GNU Autoconf package:" - echo "<$gnu_software_URL/autoconf/>" - echo "It also requires GNU m4 and Perl in order to run:" - echo "<$gnu_software_URL/m4/>" - echo "<$perl_URL>" - ;; - esac -} - -give_advice () -{ - # Normalize program name to check for. - normalized_program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - - printf '%s\n' "'$1' is $msg." - - configure_deps="'configure.ac' or m4 files included by 'configure.ac'" - case $normalized_program in - autoconf*) - echo "You should only need it if you modified 'configure.ac'," - echo "or m4 files included by it." - program_details 'autoconf' - ;; - autoheader*) - echo "You should only need it if you modified 'acconfig.h' or" - echo "$configure_deps." - program_details 'autoheader' - ;; - automake*) - echo "You should only need it if you modified 'Makefile.am' or" - echo "$configure_deps." - program_details 'automake' - ;; - aclocal*) - echo "You should only need it if you modified 'acinclude.m4' or" - echo "$configure_deps." - program_details 'aclocal' - ;; - autom4te*) - echo "You might have modified some maintainer files that require" - echo "the 'autom4te' program to be rebuilt." - program_details 'autom4te' - ;; - bison*|yacc*) - echo "You should only need it if you modified a '.y' file." - echo "You may want to install the GNU Bison package:" - echo "<$gnu_software_URL/bison/>" - ;; - lex*|flex*) - echo "You should only need it if you modified a '.l' file." - echo "You may want to install the Fast Lexical Analyzer package:" - echo "<$flex_URL>" - ;; - help2man*) - echo "You should only need it if you modified a dependency" \ - "of a man page." - echo "You may want to install the GNU Help2man package:" - echo "<$gnu_software_URL/help2man/>" - ;; - makeinfo*) - echo "You should only need it if you modified a '.texi' file, or" - echo "any other file indirectly affecting the aspect of the manual." - echo "You might want to install the Texinfo package:" - echo "<$gnu_software_URL/texinfo/>" - echo "The spurious makeinfo call might also be the consequence of" - echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" - echo "want to install GNU make:" - echo "<$gnu_software_URL/make/>" - ;; - *) - echo "You might have modified some files without having the proper" - echo "tools for further handling them. Check the 'README' file, it" - echo "often tells you about the needed prerequisites for installing" - echo "this package. You may also peek at any GNU archive site, in" - echo "case some other package contains this missing '$1' program." - ;; - esac -} - -give_advice "$1" | sed -e '1s/^/WARNING: /' \ - -e '2,$s/^/ /' >&2 - -# Propagate the correct exit status (expected to be 127 for a program -# not found, 63 for a program that failed due to version mismatch). -exit $st - -# Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC0" -# time-stamp-end: "; # UTC" -# End: diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index 3d9c75a3a5b3..000000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -bin_PROGRAMS = rimage - -rimage_SOURCES = \ - cse.c \ - css.c \ - elf.c \ - file_simple.c \ - hash.c \ - man_apl.c \ - man_cnl.c \ - manifest.c \ - man_kbl.c \ - man_sue.c \ - man_tgl.c \ - pkcs1_5.c \ - plat_auth.c \ - rimage.c - -if USE_PROVIDED_SOF_HEADER - PROVIDED_SOF_HEADER = -Iinclude/sof - EXTRA_SOF_MACROS = -else - EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H -endif - -rimage_CFLAGS = \ - $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ - $(EXTRA_SOF_MACROS) \ - -O2 -g -Wall -Werror -Wl,-EL \ - -Wmissing-prototypes -Wimplicit-fallthrough=3 - -rimage_LDADD = -lcrypto diff --git a/src/Makefile.in b/src/Makefile.in deleted file mode 100644 index 3bef76b122f0..000000000000 --- a/src/Makefile.in +++ /dev/null @@ -1,853 +0,0 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2018 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -# SPDX-License-Identifier: BSD-3-Clause -# -# Copyright(c) 2019 Intel Corporation. All rights reserved. - -VPATH = @srcdir@ -am__is_gnu_make = { \ - if test -z '$(MAKELEVEL)'; then \ - false; \ - elif test -n '$(MAKE_HOST)'; then \ - true; \ - elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ - true; \ - else \ - false; \ - fi; \ -} -am__make_running_with_option = \ - case $${target_option-} in \ - ?) ;; \ - *) echo "am__make_running_with_option: internal error: invalid" \ - "target option '$${target_option-}' specified" >&2; \ - exit 1;; \ - esac; \ - has_opt=no; \ - sane_makeflags=$$MAKEFLAGS; \ - if $(am__is_gnu_make); then \ - sane_makeflags=$$MFLAGS; \ - else \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - bs=\\; \ - sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ - | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ - esac; \ - fi; \ - skip_next=no; \ - strip_trailopt () \ - { \ - flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ - }; \ - for flg in $$sane_makeflags; do \ - test $$skip_next = yes && { skip_next=no; continue; }; \ - case $$flg in \ - *=*|--*) continue;; \ - -*I) strip_trailopt 'I'; skip_next=yes;; \ - -*I?*) strip_trailopt 'I';; \ - -*O) strip_trailopt 'O'; skip_next=yes;; \ - -*O?*) strip_trailopt 'O';; \ - -*l) strip_trailopt 'l'; skip_next=yes;; \ - -*l?*) strip_trailopt 'l';; \ - -[dEDm]) skip_next=yes;; \ - -[JT]) skip_next=yes;; \ - esac; \ - case $$flg in \ - *$$target_option*) has_opt=yes; break;; \ - esac; \ - done; \ - test $$has_opt = yes -am__make_dryrun = (target_option=n; $(am__make_running_with_option)) -am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -bin_PROGRAMS = rimage$(EXEEXT) -subdir = src -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) -am_rimage_OBJECTS = rimage-cse.$(OBJEXT) rimage-css.$(OBJEXT) \ - rimage-elf.$(OBJEXT) rimage-file_simple.$(OBJEXT) \ - rimage-hash.$(OBJEXT) rimage-man_apl.$(OBJEXT) \ - rimage-man_cnl.$(OBJEXT) rimage-manifest.$(OBJEXT) \ - rimage-man_kbl.$(OBJEXT) rimage-man_sue.$(OBJEXT) \ - rimage-man_tgl.$(OBJEXT) rimage-pkcs1_5.$(OBJEXT) \ - rimage-plat_auth.$(OBJEXT) rimage-rimage.$(OBJEXT) -rimage_OBJECTS = $(am_rimage_OBJECTS) -rimage_DEPENDENCIES = -rimage_LINK = $(CCLD) $(rimage_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/rimage-cse.Po \ - ./$(DEPDIR)/rimage-css.Po ./$(DEPDIR)/rimage-elf.Po \ - ./$(DEPDIR)/rimage-file_simple.Po ./$(DEPDIR)/rimage-hash.Po \ - ./$(DEPDIR)/rimage-man_apl.Po ./$(DEPDIR)/rimage-man_cnl.Po \ - ./$(DEPDIR)/rimage-man_kbl.Po ./$(DEPDIR)/rimage-man_sue.Po \ - ./$(DEPDIR)/rimage-man_tgl.Po ./$(DEPDIR)/rimage-manifest.Po \ - ./$(DEPDIR)/rimage-pkcs1_5.Po ./$(DEPDIR)/rimage-plat_auth.Po \ - ./$(DEPDIR)/rimage-rimage.Po -am__mv = mv -f -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(rimage_SOURCES) -DIST_SOURCES = $(rimage_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) -# Read a list of newline-separated strings from the standard input, -# and print each of them once, without duplicates. Input order is -# *not* preserved. -am__uniquify_input = $(AWK) '\ - BEGIN { nonempty = 0; } \ - { items[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in items) print i; }; } \ -' -# Make sure the list of sources is unique. This is necessary because, -# e.g., the same source file might be shared among _SOURCES variables -# for different programs/libraries. -am__define_uniq_tagged_files = \ - list='$(am__tagged_files)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -GREP = @GREP@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -rimage_SOURCES = \ - cse.c \ - css.c \ - elf.c \ - file_simple.c \ - hash.c \ - man_apl.c \ - man_cnl.c \ - manifest.c \ - man_kbl.c \ - man_sue.c \ - man_tgl.c \ - pkcs1_5.c \ - plat_auth.c \ - rimage.c - -@USE_PROVIDED_SOF_HEADER_TRUE@PROVIDED_SOF_HEADER = -Iinclude/sof -@USE_PROVIDED_SOF_HEADER_FALSE@EXTRA_SOF_MACROS = -DHAS_FILE_FORMAT_H -@USE_PROVIDED_SOF_HEADER_TRUE@EXTRA_SOF_MACROS = -rimage_CFLAGS = \ - $(PROVIDED_SOF_HEADER) -Iinclude/rimage \ - $(EXTRA_SOF_MACROS) \ - -O2 -g -Wall -Werror -Wl,-EL \ - -Wmissing-prototypes -Wimplicit-fallthrough=3 - -rimage_LDADD = -lcrypto -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign src/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p \ - ; then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' \ - -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' \ - `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) - -rimage$(EXEEXT): $(rimage_OBJECTS) $(rimage_DEPENDENCIES) $(EXTRA_rimage_DEPENDENCIES) - @rm -f rimage$(EXEEXT) - $(AM_V_CCLD)$(rimage_LINK) $(rimage_OBJECTS) $(rimage_LDADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-cse.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-css.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-elf.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-file_simple.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-hash.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_apl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_cnl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_kbl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_sue.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-man_tgl.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-manifest.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-pkcs1_5.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-plat_auth.Po@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rimage-rimage.Po@am__quote@ # am--include-marker - -$(am__depfiles_remade): - @$(MKDIR_P) $(@D) - @echo '# dummy' >$@-t && $(am__mv) $@-t $@ - -am--depfiles: $(am__depfiles_remade) - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -rimage-cse.o: cse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.o -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.o `test -f 'cse.c' || echo '$(srcdir)/'`cse.c - -rimage-cse.obj: cse.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-cse.obj -MD -MP -MF $(DEPDIR)/rimage-cse.Tpo -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-cse.Tpo $(DEPDIR)/rimage-cse.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cse.c' object='rimage-cse.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-cse.obj `if test -f 'cse.c'; then $(CYGPATH_W) 'cse.c'; else $(CYGPATH_W) '$(srcdir)/cse.c'; fi` - -rimage-css.o: css.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.o -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.o `test -f 'css.c' || echo '$(srcdir)/'`css.c - -rimage-css.obj: css.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-css.obj -MD -MP -MF $(DEPDIR)/rimage-css.Tpo -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-css.Tpo $(DEPDIR)/rimage-css.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='css.c' object='rimage-css.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-css.obj `if test -f 'css.c'; then $(CYGPATH_W) 'css.c'; else $(CYGPATH_W) '$(srcdir)/css.c'; fi` - -rimage-elf.o: elf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.o -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.o `test -f 'elf.c' || echo '$(srcdir)/'`elf.c - -rimage-elf.obj: elf.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-elf.obj -MD -MP -MF $(DEPDIR)/rimage-elf.Tpo -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-elf.Tpo $(DEPDIR)/rimage-elf.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='elf.c' object='rimage-elf.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-elf.obj `if test -f 'elf.c'; then $(CYGPATH_W) 'elf.c'; else $(CYGPATH_W) '$(srcdir)/elf.c'; fi` - -rimage-file_simple.o: file_simple.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.o -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.o `test -f 'file_simple.c' || echo '$(srcdir)/'`file_simple.c - -rimage-file_simple.obj: file_simple.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-file_simple.obj -MD -MP -MF $(DEPDIR)/rimage-file_simple.Tpo -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-file_simple.Tpo $(DEPDIR)/rimage-file_simple.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='file_simple.c' object='rimage-file_simple.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-file_simple.obj `if test -f 'file_simple.c'; then $(CYGPATH_W) 'file_simple.c'; else $(CYGPATH_W) '$(srcdir)/file_simple.c'; fi` - -rimage-hash.o: hash.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.o -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.o `test -f 'hash.c' || echo '$(srcdir)/'`hash.c - -rimage-hash.obj: hash.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-hash.obj -MD -MP -MF $(DEPDIR)/rimage-hash.Tpo -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-hash.Tpo $(DEPDIR)/rimage-hash.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hash.c' object='rimage-hash.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-hash.obj `if test -f 'hash.c'; then $(CYGPATH_W) 'hash.c'; else $(CYGPATH_W) '$(srcdir)/hash.c'; fi` - -rimage-man_apl.o: man_apl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.o -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.o `test -f 'man_apl.c' || echo '$(srcdir)/'`man_apl.c - -rimage-man_apl.obj: man_apl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_apl.obj -MD -MP -MF $(DEPDIR)/rimage-man_apl.Tpo -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_apl.Tpo $(DEPDIR)/rimage-man_apl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_apl.c' object='rimage-man_apl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_apl.obj `if test -f 'man_apl.c'; then $(CYGPATH_W) 'man_apl.c'; else $(CYGPATH_W) '$(srcdir)/man_apl.c'; fi` - -rimage-man_cnl.o: man_cnl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.o -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.o `test -f 'man_cnl.c' || echo '$(srcdir)/'`man_cnl.c - -rimage-man_cnl.obj: man_cnl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_cnl.obj -MD -MP -MF $(DEPDIR)/rimage-man_cnl.Tpo -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_cnl.Tpo $(DEPDIR)/rimage-man_cnl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_cnl.c' object='rimage-man_cnl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_cnl.obj `if test -f 'man_cnl.c'; then $(CYGPATH_W) 'man_cnl.c'; else $(CYGPATH_W) '$(srcdir)/man_cnl.c'; fi` - -rimage-manifest.o: manifest.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.o -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.o `test -f 'manifest.c' || echo '$(srcdir)/'`manifest.c - -rimage-manifest.obj: manifest.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-manifest.obj -MD -MP -MF $(DEPDIR)/rimage-manifest.Tpo -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-manifest.Tpo $(DEPDIR)/rimage-manifest.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='manifest.c' object='rimage-manifest.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-manifest.obj `if test -f 'manifest.c'; then $(CYGPATH_W) 'manifest.c'; else $(CYGPATH_W) '$(srcdir)/manifest.c'; fi` - -rimage-man_kbl.o: man_kbl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.o -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.o `test -f 'man_kbl.c' || echo '$(srcdir)/'`man_kbl.c - -rimage-man_kbl.obj: man_kbl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_kbl.obj -MD -MP -MF $(DEPDIR)/rimage-man_kbl.Tpo -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_kbl.Tpo $(DEPDIR)/rimage-man_kbl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_kbl.c' object='rimage-man_kbl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_kbl.obj `if test -f 'man_kbl.c'; then $(CYGPATH_W) 'man_kbl.c'; else $(CYGPATH_W) '$(srcdir)/man_kbl.c'; fi` - -rimage-man_sue.o: man_sue.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.o -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.o `test -f 'man_sue.c' || echo '$(srcdir)/'`man_sue.c - -rimage-man_sue.obj: man_sue.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_sue.obj -MD -MP -MF $(DEPDIR)/rimage-man_sue.Tpo -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_sue.Tpo $(DEPDIR)/rimage-man_sue.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_sue.c' object='rimage-man_sue.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_sue.obj `if test -f 'man_sue.c'; then $(CYGPATH_W) 'man_sue.c'; else $(CYGPATH_W) '$(srcdir)/man_sue.c'; fi` - -rimage-man_tgl.o: man_tgl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.o -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.o `test -f 'man_tgl.c' || echo '$(srcdir)/'`man_tgl.c - -rimage-man_tgl.obj: man_tgl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-man_tgl.obj -MD -MP -MF $(DEPDIR)/rimage-man_tgl.Tpo -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-man_tgl.Tpo $(DEPDIR)/rimage-man_tgl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='man_tgl.c' object='rimage-man_tgl.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-man_tgl.obj `if test -f 'man_tgl.c'; then $(CYGPATH_W) 'man_tgl.c'; else $(CYGPATH_W) '$(srcdir)/man_tgl.c'; fi` - -rimage-pkcs1_5.o: pkcs1_5.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.o -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.o `test -f 'pkcs1_5.c' || echo '$(srcdir)/'`pkcs1_5.c - -rimage-pkcs1_5.obj: pkcs1_5.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-pkcs1_5.obj -MD -MP -MF $(DEPDIR)/rimage-pkcs1_5.Tpo -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-pkcs1_5.Tpo $(DEPDIR)/rimage-pkcs1_5.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pkcs1_5.c' object='rimage-pkcs1_5.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-pkcs1_5.obj `if test -f 'pkcs1_5.c'; then $(CYGPATH_W) 'pkcs1_5.c'; else $(CYGPATH_W) '$(srcdir)/pkcs1_5.c'; fi` - -rimage-plat_auth.o: plat_auth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.o -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.o `test -f 'plat_auth.c' || echo '$(srcdir)/'`plat_auth.c - -rimage-plat_auth.obj: plat_auth.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-plat_auth.obj -MD -MP -MF $(DEPDIR)/rimage-plat_auth.Tpo -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-plat_auth.Tpo $(DEPDIR)/rimage-plat_auth.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='plat_auth.c' object='rimage-plat_auth.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-plat_auth.obj `if test -f 'plat_auth.c'; then $(CYGPATH_W) 'plat_auth.c'; else $(CYGPATH_W) '$(srcdir)/plat_auth.c'; fi` - -rimage-rimage.o: rimage.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.o -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.o `test -f 'rimage.c' || echo '$(srcdir)/'`rimage.c - -rimage-rimage.obj: rimage.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -MT rimage-rimage.obj -MD -MP -MF $(DEPDIR)/rimage-rimage.Tpo -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/rimage-rimage.Tpo $(DEPDIR)/rimage-rimage.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rimage.c' object='rimage-rimage.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(rimage_CFLAGS) $(CFLAGS) -c -o rimage-rimage.obj `if test -f 'rimage.c'; then $(CYGPATH_W) 'rimage.c'; else $(CYGPATH_W) '$(srcdir)/rimage.c'; fi` - -ID: $(am__tagged_files) - $(am__define_uniq_tagged_files); mkid -fID $$unique -tags: tags-am -TAGS: tags - -tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - set x; \ - here=`pwd`; \ - $(am__define_uniq_tagged_files); \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: ctags-am - -CTAGS: ctags -ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) - $(am__define_uniq_tagged_files); \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-am - -cscopelist-am: $(am__tagged_files) - list='$(am__tagged_files)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) distdir-am - -distdir-am: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(PROGRAMS) -installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f ./$(DEPDIR)/rimage-cse.Po - -rm -f ./$(DEPDIR)/rimage-css.Po - -rm -f ./$(DEPDIR)/rimage-elf.Po - -rm -f ./$(DEPDIR)/rimage-file_simple.Po - -rm -f ./$(DEPDIR)/rimage-hash.Po - -rm -f ./$(DEPDIR)/rimage-man_apl.Po - -rm -f ./$(DEPDIR)/rimage-man_cnl.Po - -rm -f ./$(DEPDIR)/rimage-man_kbl.Po - -rm -f ./$(DEPDIR)/rimage-man_sue.Po - -rm -f ./$(DEPDIR)/rimage-man_tgl.Po - -rm -f ./$(DEPDIR)/rimage-manifest.Po - -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po - -rm -f ./$(DEPDIR)/rimage-plat_auth.Po - -rm -f ./$(DEPDIR)/rimage-rimage.Po - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-binPROGRAMS - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/rimage-cse.Po - -rm -f ./$(DEPDIR)/rimage-css.Po - -rm -f ./$(DEPDIR)/rimage-elf.Po - -rm -f ./$(DEPDIR)/rimage-file_simple.Po - -rm -f ./$(DEPDIR)/rimage-hash.Po - -rm -f ./$(DEPDIR)/rimage-man_apl.Po - -rm -f ./$(DEPDIR)/rimage-man_cnl.Po - -rm -f ./$(DEPDIR)/rimage-man_kbl.Po - -rm -f ./$(DEPDIR)/rimage-man_sue.Po - -rm -f ./$(DEPDIR)/rimage-man_tgl.Po - -rm -f ./$(DEPDIR)/rimage-manifest.Po - -rm -f ./$(DEPDIR)/rimage-pkcs1_5.Po - -rm -f ./$(DEPDIR)/rimage-plat_auth.Po - -rm -f ./$(DEPDIR)/rimage-rimage.Po - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-binPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ - clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ - distclean distclean-compile distclean-generic distclean-tags \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-binPROGRAMS install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ - ps ps-am tags tags-am uninstall uninstall-am \ - uninstall-binPROGRAMS - -.PRECIOUS: Makefile - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: From a2646979612efbc9e27277d7ab608ede4e6a4813 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 25 Mar 2020 10:16:03 -0700 Subject: [PATCH 104/639] Use CMake to build rimage This adds the necessary bits to allow building rimage with CMake with similar configure options as the just removed autotools files. Also update README.md for new build instructions. Signed-off-by: Daniel Leung --- .gitignore | 10 +-------- CMakeLists.txt | 50 ++++++++++++++++++++++++++++++++++++++++++++ README.md | 10 ++++++--- src/CMakeLists.txt | 52 ---------------------------------------------- 4 files changed, 58 insertions(+), 64 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 src/CMakeLists.txt diff --git a/.gitignore b/.gitignore index e77279505d50..567609b1234a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1 @@ -config.h -config.log -config.status -Makefile -stamp-h1 -.deps/ -src/*.o -src/Makefile -src/rimage +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000000..b550b4d5a582 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.10) + +project(SOF_RIMAGE C) + +add_executable(rimage + src/file_simple.c + src/man_apl.c + src/man_cnl.c + src/man_kbl.c + src/man_sue.c + src/man_tgl.c + src/cse.c + src/css.c + src/plat_auth.c + src/hash.c + src/pkcs1_5.c + src/manifest.c + src/elf.c + src/rimage.c +) + +target_compile_options(rimage PRIVATE + -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 +) + +target_link_libraries(rimage PRIVATE "-lcrypto") + +target_include_directories(rimage PRIVATE + src/include/rimage +) + +if(DEFINED SOF_SOURCE_DIR) + # Use headers from SOF_SOURCE_DIR + target_compile_definitions(rimage PRIVATE + HAS_FILE_FORMAT_H + ) + + target_include_directories(rimage PRIVATE + "${SOF_SOURCE_DIR}/src/include" + ) +else() + # Use headers provided here + target_include_directories(rimage PRIVATE + src/include/sof + ) +endif() + +install(TARGETS rimage DESTINATION bin) diff --git a/README.md b/README.md index 4b484048dec4..59b4b94c7b4b 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,14 @@ to generate binary image files. The `rimage` tool can be built with or without logging dictionary support, where such support is required to decipher the log messages -produced the the SOF firmware. +produced by the the SOF firmware. #### Build without dictionary support: ```shell -$ ./configure +$ mkdir build +$ cd build +$ cmake .. $ make $ make install ``` @@ -26,7 +28,9 @@ First, clone the SOF source tree from [here](https://github.com/thesofproject/sof). Then, do: ```shell -$ ./configure --with-sof-source= +$ mkdir build +$ cd build +$ cmake -DSOF_SOURCE_DIR= .. $ make $ make install ``` diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index dc5d3ac794f8..000000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,52 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -cmake_minimum_required(VERSION 3.10) - -project(SOF_RIMAGE C) - -set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") - -if(NOT DEFINED VERSION_H_PATH) - message(FATAL_ERROR - " Please specify version.h path.\n" - " Example: cmake -DVERSION_H_PATH=${VERSION_H_PATH} ...\n" -) -endif() - -if(NOT DEFINED PEM_KEY_PREFIX) - set(PEM_KEY_PREFIX "/usr/local/share/rimage") -endif() - -get_filename_component(VERSION_H_DIRECTORY ${VERSION_H_PATH} DIRECTORY) - -add_executable(rimage - file_simple.c - man_apl.c - man_cnl.c - man_kbl.c - man_sue.c - man_tgl.c - cse.c - css.c - plat_auth.c - hash.c - pkcs1_5.c - manifest.c - elf.c - rimage.c -) - -target_compile_options(rimage PRIVATE - -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 -) - -target_compile_definitions(rimage PRIVATE - PEM_KEY_PREFIX="${PEM_KEY_PREFIX}" -) - -target_link_libraries(rimage PRIVATE "-lcrypto") - -target_include_directories(rimage PRIVATE - "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" - "${VERSION_H_DIRECTORY}" -) From e09354a5b5a82024a6ce83e5fcd7d3c7fbf3ef2a Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 5 Apr 2020 01:45:45 -0700 Subject: [PATCH 105/639] Update rimage to remove ldc generation ability This reflects the changes on SOF project commit b3c16790cd6fae9b4ce901d7ef36b47223f96dd7. Signed-off-by: Daniel Leung --- CMakeLists.txt | 4 - src/elf.c | 28 +---- src/file_simple.c | 205 ------------------------------------ src/include/rimage/rimage.h | 13 --- src/rimage.c | 36 +------ 5 files changed, 2 insertions(+), 284 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b550b4d5a582..c91f692aeb69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,6 @@ target_include_directories(rimage PRIVATE if(DEFINED SOF_SOURCE_DIR) # Use headers from SOF_SOURCE_DIR - target_compile_definitions(rimage PRIVATE - HAS_FILE_FORMAT_H - ) - target_include_directories(rimage PRIVATE "${SOF_SOURCE_DIR}/src/include" ) diff --git a/src/elf.c b/src/elf.c index 1b5420439da7..bfed5399cb84 100644 --- a/src/elf.c +++ b/src/elf.c @@ -74,36 +74,11 @@ static int elf_read_sections(struct image *image, struct module *module, module->bss_start = 0; module->bss_end = 0; - - fprintf(stdout, "info: ignore .static_log_entries" - " section for bootloader module\n"); - - 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"); - - module->fw_ready_index = -EINVAL; } else { /* find manifest module data */ module->bss_index = elf_find_section(image, module, ".bss"); if (module->bss_index < 0) return module->bss_index; - - /* find log entries and fw ready sections */ - 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) - return module->fw_ready_index; } /* parse each section */ @@ -369,8 +344,7 @@ static void elf_module_limits(struct image *image, struct module *module) section = &module->section[i]; /* module bss can sometimes be missed */ - if (i != module->bss_index && i != module->logs_index && - i != module->fw_ready_index) { + if (i != module->bss_index) { /* only check valid sections */ if (!(section->flags & valid)) continue; diff --git a/src/file_simple.c b/src/file_simple.c index 419e7856da60..d570c5a8bad9 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -8,11 +8,6 @@ #include #include -#ifdef HAS_FILE_FORMAT_H -#include -#include -#endif /* HAS_FILE_FORMAT_H */ - #include "rimage.h" #define BYT_IRAM_BASE 0xff2c0000 @@ -76,75 +71,6 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) return SOF_FW_BLK_TYPE_INVALID; } -#ifdef HAS_FILE_FORMAT_H -static int fw_version_copy(struct snd_sof_logs_header *header, - const struct module *module) -{ - Elf32_Shdr *section = NULL; - struct sof_ipc_ext_data_hdr *ext_hdr = NULL; - void *buffer = NULL; - - if (module->fw_ready_index <= 0) - return 0; - - section = &module->section[module->fw_ready_index]; - - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - - fseek(module->fd, section->off, SEEK_SET); - size_t count = fread(buffer, 1, - section->size, module->fd); - - if (count != section->size) { - fprintf(stderr, "error: can't read ready section %d\n", -errno); - free(buffer); - return -errno; - } - - memcpy(&header->version, - &((struct sof_ipc_fw_ready *)buffer)->version, - sizeof(header->version)); - - /* fw_ready structure contains main (primarily kernel) - * ABI version. - */ - - fprintf(stdout, "fw abi main version: %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)); - - /* let's find dbg abi version, which the log client - * is interested in and override the kernel's one. - * - * skip the base fw-ready record and begin from the first extension. - */ - ext_hdr = buffer + ((struct sof_ipc_fw_ready *)buffer)->hdr.size; - while ((uintptr_t)ext_hdr < (uintptr_t)buffer + section->size) { - if (ext_hdr->type == SOF_IPC_EXT_USER_ABI_INFO) { - header->version.abi_version = - ((struct sof_ipc_user_abi_version *) - ext_hdr)->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); - } - - fprintf(stdout, "fw abi dbg version: %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; -} -#endif /* HAS_FILE_FORMAT_H */ - static int block_idx; static int write_block(struct image *image, struct module *module, @@ -447,137 +373,6 @@ static int simple_write_firmware(struct image *image) return 0; } -#ifdef HAS_FILE_FORMAT_H -static int write_logs_dictionary(struct image *image) -{ - struct snd_sof_logs_header header; - int i, ret = 0; - void *buffer = NULL; - - memcpy(header.sig, SND_SOF_LOGS_SIG, SND_SOF_LOGS_SIG_SIZE); - header.data_offset = sizeof(struct snd_sof_logs_header); - - for (i = 0; i < image->num_modules; i++) { - struct module *module = &image->module[i]; - - /* extract fw_version from fw_ready message located - * in .fw_ready section - */ - ret = fw_version_copy(&header, module); - if (ret < 0) - goto out; - - if (module->logs_index > 0) { - Elf32_Shdr *section = - &module->section[module->logs_index]; - - header.base_address = section->vaddr; - header.data_length = section->size; - - fwrite(&header, sizeof(struct snd_sof_logs_header), 1, - image->ldc_out_fd); - - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - - fseek(module->fd, section->off, SEEK_SET); - size_t count = fread(buffer, 1, section->size, - module->fd); - if (count != section->size) { - fprintf(stderr, - "error: can't read logs section %d\n", - -errno); - ret = -errno; - goto out; - } - count = fwrite(buffer, 1, section->size, - image->ldc_out_fd); - if (count != section->size) { - fprintf(stderr, - "error: can't write section %d\n", - -errno); - ret = -errno; - goto out; - } - - fprintf(stdout, "logs dictionary: size %u\n", - header.data_length + header.data_offset); - fprintf(stdout, "including fw version of size: %lu\n", - (unsigned long)sizeof(header.version)); - } - } -out: - if (buffer) - free(buffer); - - 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; -} -#endif /* HAS_FILE_FORMAT_H */ - const struct adsp machine_byt = { .name = "byt", .mem_zones = { diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 08e398b5f65e..05d1159d654d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -67,9 +67,6 @@ struct module { int num_bss; int fw_size; int bss_index; - int logs_index; - int uids_index; - int fw_ready_index; /* sizes do not include any gaps */ int bss_size; @@ -96,12 +93,6 @@ struct image { const char *out_file; FILE *out_fd; - -#ifdef HAS_FILE_FORMAT_H - const char *ldc_out_file; - FILE *ldc_out_fd; -#endif /* HAS_FILE_FORMAT_H */ - void *pos; const struct adsp *adsp; @@ -163,10 +154,6 @@ struct adsp { int exec_boot_ldr; }; -#ifdef HAS_FILE_FORMAT_H -int write_dictionaries(struct image *image); -#endif /* HAS_FILE_FORMAT_H */ - void module_sha256_create(struct image *image); void module_sha_update(struct image *image, uint8_t *data, size_t bytes); void module_sha_complete(struct image *image, uint8_t *hash); diff --git a/src/rimage.c b/src/rimage.c index c015dc8c96f7..11bee8a49257 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -37,9 +37,6 @@ static void usage(char *name) fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); -#ifdef HAS_FILE_FORMAT_H - fprintf(stdout, "\t -p log dictionary outfile\n"); -#endif /* HAS_FILE_FORMAT_H */ fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); @@ -58,20 +55,11 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:p:m:va:s:k:l:ri:x:f:b:")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; break; - case 'p': -#ifdef HAS_FILE_FORMAT_H - image.ldc_out_file = optarg; -#else - fprintf(stderr, - "error: log dictionary is not supported\n"); - return -EINVAL; -#endif /* HAS_FILE_FORMAT_H */ - break; case 'm': mach = optarg; break; @@ -116,11 +104,6 @@ int main(int argc, char *argv[]) if (!image.out_file || !mach) usage(argv[0]); -#ifdef HAS_FILE_FORMAT_H - if (!image.ldc_out_file) - image.ldc_out_file = "out.ldc"; -#endif /* HAS_FILE_FORMAT_H */ - /* requires private key */ if (!image.key_name) { fprintf(stderr, "error: requires private key\n"); @@ -205,27 +188,10 @@ int main(int argc, char *argv[]) else ret = image.adsp->write_firmware(&image); -#ifdef HAS_FILE_FORMAT_H - unlink(image.ldc_out_file); - image.ldc_out_fd = fopen(image.ldc_out_file, "wb"); - if (!image.ldc_out_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image.ldc_out_file, errno); - ret = -EINVAL; - goto out; - } - ret = write_dictionaries(&image); -#endif /* HAS_FILE_FORMAT_H */ - out: /* close files */ if (image.out_fd) fclose(image.out_fd); -#ifdef HAS_FILE_FORMAT_H - if (image.ldc_out_fd) - fclose(image.ldc_out_fd); -#endif /* HAS_FILE_FORMAT_H */ - return ret; } From ea04cb816e40a8cacf241a0ead8fc56d6a5529bb Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sun, 5 Apr 2020 02:03:14 -0700 Subject: [PATCH 106/639] Remove cmake option SOF_SOURCE_DIR Since both fw.h and manifest.h are being used in the main SOF repo and also here in the standalone rimage repo, to prevent them getting out of sync, the SOF main repo is going to use the ones coming from the rimage repo. So there is no need for the option anymore. Signed-off-by: Daniel Leung --- CMakeLists.txt | 13 +------------ README.md | 22 +--------------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c91f692aeb69..a7b29c077dad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,18 +29,7 @@ target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE src/include/rimage + src/include/sof ) -if(DEFINED SOF_SOURCE_DIR) - # Use headers from SOF_SOURCE_DIR - target_include_directories(rimage PRIVATE - "${SOF_SOURCE_DIR}/src/include" - ) -else() - # Use headers provided here - target_include_directories(rimage PRIVATE - src/include/sof - ) -endif() - install(TARGETS rimage DESTINATION bin) diff --git a/README.md b/README.md index 59b4b94c7b4b..bce02c06caa9 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,7 @@ to generate binary image files. ## Building -The `rimage` tool can be built with or without logging dictionary -support, where such support is required to decipher the log messages -produced by the the SOF firmware. - -#### Build without dictionary support: +The `rimage` tool can be built with the following commands: ```shell $ mkdir build @@ -20,19 +16,3 @@ $ cmake .. $ make $ make install ``` - -#### Build with dictionary support: - -To build `rimage` with dictionary support, the SOF source is required. -First, clone the SOF source tree from -[here](https://github.com/thesofproject/sof). Then, do: - -```shell -$ mkdir build -$ cd build -$ cmake -DSOF_SOURCE_DIR= .. -$ make -$ make install -``` - -Note that creating the SOF firmware image requires dicitionary support. From c4701c7664d4dbbdf7ba25af21ff5c09057dc1fe Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 27 Mar 2020 10:43:15 +0100 Subject: [PATCH 107/639] rimage: Align function arguments in rimage.h Code formatting should be consistent and function arguments should be aligned to opening parenthesis. Signed-off-by: Karol Trzcinski --- src/include/rimage/rimage.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 05d1159d654d..c95658394b2b 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -179,7 +179,7 @@ int elf_validate_modules(struct image *image); int elf_find_section(struct image *image, struct module *module, const char *name); int elf_validate_section(struct image *image, struct module *module, - Elf32_Shdr *section, int index); + Elf32_Shdr *section, int index); /* supported machines */ extern const struct adsp machine_byt; From e433e878656f9b549283283c03d5ae899ef77b87 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 27 Mar 2020 10:51:15 +0100 Subject: [PATCH 108/639] rimage: Remove unused 'image' argument in elf_find_section() Unused arguments shouldn't be passed to function because it makes code messy. Signed-off-by: Karol Trzcinski --- src/elf.c | 9 ++++----- src/include/rimage/rimage.h | 3 +-- src/manifest.c | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/elf.c b/src/elf.c index bfed5399cb84..35f97f21a9e8 100644 --- a/src/elf.c +++ b/src/elf.c @@ -76,7 +76,7 @@ static int elf_read_sections(struct image *image, struct module *module, module->bss_end = 0; } else { /* find manifest module data */ - module->bss_index = elf_find_section(image, module, ".bss"); + module->bss_index = elf_find_section(module, ".bss"); if (module->bss_index < 0) return module->bss_index; } @@ -464,11 +464,10 @@ int elf_validate_modules(struct image *image) return 0; } -int elf_find_section(struct image *image, struct module *module, - const char *name) +int elf_find_section(const struct module *module, const char *name) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section, *s; + const Elf32_Shdr *section, *s; char *buffer; size_t count; int ret, i; @@ -569,7 +568,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) /* check limits */ elf_module_limits(image, module); - elf_find_section(image, module, ""); + elf_find_section(module, ""); fprintf(stdout, " module: input size %d (0x%x) bytes %d sections\n", module->fw_size, module->fw_size, module->num_sections); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index c95658394b2b..e129d52de822 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -176,8 +176,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); -int elf_find_section(struct image *image, struct module *module, - const char *name); +int elf_find_section(const struct module *module, const char *name); int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); diff --git a/src/manifest.c b/src/manifest.c index 4f4ff763c02b..fd5b7997d5c1 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -230,7 +230,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, fprintf(stdout, "Module Write: %s\n", module->elf_file); /* find manifest module data */ - man_section_idx = elf_find_section(image, module, ".module"); + man_section_idx = elf_find_section(module, ".module"); if (man_section_idx < 0) return -EINVAL; From 6c4c873b9d867bbdffcfb32d827dc4ebcba87991 Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Thu, 26 Mar 2020 06:58:57 -0700 Subject: [PATCH 109/639] Match LICENSE from the main SOF repo This changes the LICENSE file to match the LICENSE file from the main SOF repo, except they entries for the kconfig scripts which are not here in this repo. Signed-off-by: Daniel Leung --- LICENSE | 114 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 91 insertions(+), 23 deletions(-) diff --git a/LICENSE b/LICENSE index 2ab88408298f..468893dff94b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,29 +1,97 @@ -BSD 3-Clause License +/* + * BSD 3 Clause + * Copyright (c) 2016, Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ -Copyright (c) 2019, Sound Open Firmware -All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +// Copyright (c) 2003-2014 Cadence Design Systems, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. +Files with 2-Clause BSD licence: -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. +src/include/rimage/elf.h -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +/* + * Derived from: + * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/sys/elf_common.h,v 1.15.8.1 2005/12/30 22:13:58 marcel Exp $ + * $FreeBSD: src/sys/alpha/include/elf.h,v 1.14 2003/09/25 01:10:22 peter Exp $ + * $FreeBSD: src/sys/amd64/include/elf.h,v 1.18 2004/08/03 08:21:48 dfr Exp $ + * $FreeBSD: src/sys/arm/include/elf.h,v 1.5.2.1 2006/06/30 21:42:52 cognet Exp $ + * $FreeBSD: src/sys/i386/include/elf.h,v 1.16 2004/08/02 19:12:17 dfr Exp $ + * $FreeBSD: src/sys/powerpc/include/elf.h,v 1.7 2004/11/02 09:47:01 ssouhlal Exp $ + * $FreeBSD: src/sys/sparc64/include/elf.h,v 1.12 2003/09/25 01:10:26 peter Exp $ + * + * Copyright (c) 1996-1998 John D. Polstra. All rights reserved. + * Copyright (c) 2001 David E. O'Brien + * Portions Copyright 2009 The Go Authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ From cc5eabb3499d0b661140d7fb1d5e63c188909c95 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 15 Apr 2020 15:29:53 +0300 Subject: [PATCH 110/639] Fix compiler errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes following error when compiling code: ... src/elf.c: In function ‘elf_find_section’: src/elf.c:469:20: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 469 | Elf32_Ehdr *hdr = &module->hdr; | ^ cc1: all warnings being treated as errors ... Signed-off-by: Andrei Emeltchenko --- src/elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elf.c b/src/elf.c index 35f97f21a9e8..c8a56d226231 100644 --- a/src/elf.c +++ b/src/elf.c @@ -466,7 +466,7 @@ int elf_validate_modules(struct image *image) int elf_find_section(const struct module *module, const char *name) { - Elf32_Ehdr *hdr = &module->hdr; + const Elf32_Ehdr *hdr = &module->hdr; const Elf32_Shdr *section, *s; char *buffer; size_t count; From ca65a442bb84a2b144438c681ef142bab04d6d75 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 15 Apr 2020 23:16:12 +0300 Subject: [PATCH 111/639] Handle missing .init_array section Fixes issue ".init_array" is not copied to ri image making it zero filled. This causes Zephyr crashing trying to execute functions from this section. Signed-off-by: Andrei Emeltchenko --- src/elf.c | 4 ++++ src/manifest.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/elf.c b/src/elf.c index c8a56d226231..dc6fd4d9c069 100644 --- a/src/elf.c +++ b/src/elf.c @@ -93,6 +93,8 @@ static int elf_read_sections(struct image *image, struct module *module, module->bss_size += section[i].size; module->num_bss++; break; + case SHT_INIT_ARRAY: + /* fall through */ case SHT_PROGBITS: /* text or data */ module->fw_size += section[i].size; @@ -244,6 +246,8 @@ static void elf_module_size(struct image *image, struct module *module, Elf32_Shdr *section, int index) { switch (section->type) { + case SHT_INIT_ARRAY: + /* fall through */ case SHT_PROGBITS: /* text or data */ if (section->flags & SHF_EXECINSTR) { diff --git a/src/manifest.c b/src/manifest.c index fd5b7997d5c1..e38b5884ec22 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -128,7 +128,7 @@ static uint32_t elf_to_file_offset(struct image *image, { uint32_t elf_addr = section->vaddr, file_offset = 0; - if (section->type == SHT_PROGBITS) { + if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) { if (section->flags & SHF_EXECINSTR) { /* text segment */ file_offset = elf_addr - module->text_start + @@ -160,6 +160,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, size_t count; switch (section->type) { + case SHT_INIT_ARRAY: + /* fall through */ case SHT_PROGBITS: /* text or data */ if (section->flags & SHF_EXECINSTR) From aecc0b51d03717d74720d84cc413e82b7dd8bea0 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Fri, 17 Apr 2020 14:14:54 +0800 Subject: [PATCH 112/639] CI: Travis: init build test for rimage Enable simple build test for rimage. Signed-off-by: Pan Xiuli --- .travis.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000000..28a7376b0af0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: c + +git: + depth: false + +services: + - docker + +jobs: + include: + - name: "Build Test" + before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof + script: + - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make' > build.sh && chmod +x build.sh + - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file From f79d8d7f1ed5d1f25102a90f63740b6bdbe6f469 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 27 Mar 2020 11:00:29 +0100 Subject: [PATCH 113/639] elf: Add function to read section content with allocation In many functions there is need to read user section content and check firmware version or write section content to some manifest or dictionary. Previously to do it, in each function was loop to search for proper section in proper module, then allocate buffer, read content and check for possible error between each step what is quite overwhelming. After change there will be one function responsible for this task. Signed-off-by: Karol Trzcinski --- src/elf.c | 46 +++++++++++++++++++++++++++++++++++++ src/include/rimage/rimage.h | 2 ++ 2 files changed, 48 insertions(+) diff --git a/src/elf.c b/src/elf.c index dc6fd4d9c069..663b2e0870e2 100644 --- a/src/elf.c +++ b/src/elf.c @@ -516,6 +516,52 @@ int elf_find_section(const struct module *module, const char *name) return ret; } +int elf_read_section(const struct image *image, const char *section_name, + const Elf32_Shdr **dst_section, void **dst_buff) +{ + const struct module *module; + const Elf32_Shdr *section; + int section_index = -1; + int read; + int i; + + /* when there is more than one module, then first one is bootloader */ + for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { + module = &image->module[i]; + section_index = elf_find_section(module, section_name); + if (section_index >= 0) + break; + } + + if (section_index < 0) { + fprintf(stderr, "error: section %s can't be found\n", + section_name); + return -EINVAL; + } + + section = &module->section[section_index]; + if (dst_section) + *dst_section = section; + + /* alloc buffer for section content */ + *dst_buff = calloc(1, section->size); + if (!*dst_buff) + return -ENOMEM; + + /* fill buffer with section content */ + fseek(module->fd, section->off, SEEK_SET); + read = fread(*dst_buff, 1, section->size, module->fd); + if (read != section->size) { + fprintf(stderr, + "error: can't read %s section %d\n", section_name, + -errno); + free(*dst_buff); + return -errno; + } + + return section->size; +} + int elf_parse_module(struct image *image, int module_index, const char *name) { struct module *module; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e129d52de822..68c14c591e19 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -177,6 +177,8 @@ void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); int elf_find_section(const struct module *module, const char *name); +int elf_read_section(const struct image *image, const char *name, + const Elf32_Shdr **dst_section, void **dst_buff); int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); From f0c6ee0f3aaf94a898bcf6fbdf8b6e054f3e03c8 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 7 Apr 2020 12:40:06 +0200 Subject: [PATCH 114/639] ext_man: Create extended manifest Extended manifest is a place to store metadata about firmware, known during compilation time - for example firmware version or used compiler. Given information are read on host side before firmware startup. This part of output binary is not signed. Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 1 + src/ext_manifest.c | 161 ++++++++++++++++++++++ src/include/rimage/rimage.h | 2 + src/include/sof/kernel/ext_manifest.h | 81 +++++++++++ src/include/sof/kernel/ext_manifest_gen.h | 34 +++++ src/rimage.c | 11 ++ 6 files changed, 290 insertions(+) create mode 100644 src/ext_manifest.c create mode 100644 src/include/sof/kernel/ext_manifest.h create mode 100644 src/include/sof/kernel/ext_manifest_gen.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a7b29c077dad..4d176dd582e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ add_executable(rimage src/hash.c src/pkcs1_5.c src/manifest.c + src/ext_manifest.c src/elf.c src/rimage.c ) diff --git a/src/ext_manifest.c b/src/ext_manifest.c new file mode 100644 index 000000000000..90604a2027b9 --- /dev/null +++ b/src/ext_manifest.c @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2020 Intel Corporation. All rights reserved. +// +// Author: Karol Trzcinski + +#include +#include +#include +#include + +#include "kernel/ext_manifest_gen.h" +#include "kernel/ext_manifest.h" +#include "rimage.h" + +const struct ext_man_header ext_man_template = { + .magic = EXT_MAN_MAGIC_NUMBER, + .header_version = EXT_MAN_VERSION, + .header_size = sizeof(struct ext_man_header), + .full_size = 0, /* runtime variable */ +}; + +static int ext_man_open_file(struct image *image) +{ + /* open extended manifest outfile for writing */ + sprintf(image->out_ext_man_file, "%s.xman", image->out_file); + unlink(image->out_ext_man_file); + + image->out_ext_man_fd = fopen(image->out_ext_man_file, "wb"); + if (!image->out_ext_man_fd) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_ext_man_file, errno); + return errno; + } + + return 0; +} + +static int ext_man_validate(uint32_t section_size, const void *section_data) +{ + uint8_t *sbuf = (uint8_t *)section_data; + struct ext_man_elem_header head; + uint32_t offset = 0; + + /* copy each head to local struct to omit memory align issues */ + while (offset < section_size) { + memcpy(&head, &sbuf[offset], sizeof(head)); + fprintf(stdout, "Extended manifest found module, type: 0x%04X size: 0x%04X (%4d) offset: 0x%04X\n", + head.type, head.elem_size, head.elem_size, offset); + if (head.elem_size == 0 || head.elem_size % EXT_MAN_ALIGN) { + fprintf(stderr, + "error: invalid extended manifest element size\n"); + return -EINVAL; + } + offset += head.elem_size; + } + + /* sum of packets size != section size */ + if (offset != section_size) { + fprintf(stderr, + "error: fw_metadata section is inconsistent, section size: 0x%04X != 0x%04X sum of packets size\n", + section_size, offset); + return -EINVAL; + } else { + return 0; + } +} + +static int ext_man_build(const struct image *image, + struct ext_man_header **dst_buff) +{ + struct ext_man_header ext_man; + const Elf32_Shdr *section; + uint8_t *buffer = NULL; + uint8_t *sec_buffer = NULL; + size_t offset; + int ret = 0; + + ret = elf_read_section(image, ".fw_metadata", §ion, + (void **)&sec_buffer); + if (ret < 0) { + fprintf(stderr, + "error: failed to read .fw_metadata section content, code %d\n", + ret); + goto out; + } + + /* fill ext_man struct, size aligned to 4 to avoid unaligned accesses */ + memcpy(&ext_man, &ext_man_template, sizeof(struct ext_man_header)); + ext_man.full_size = ext_man.header_size; + ext_man.full_size += section->size; + if (ext_man.full_size % 4) { + fprintf(stderr, + "error: extended manifest size must be aligned to 4\n"); + ret = -EINVAL; + goto out; + } + + /* alloc buffer for ext_man */ + buffer = calloc(1, ext_man.full_size); + if (!buffer) { + ret = -ENOMEM; + goto out; + } + + /* fill buffer with ext_man and section content */ + memcpy(buffer, &ext_man, ext_man.header_size); + offset = ext_man.header_size; + + memcpy(&buffer[offset],sec_buffer, section->size); + + *dst_buff = (struct ext_man_header *)buffer; + +out: + return ret; +} + +int ext_man_write(struct image *image) +{ + struct ext_man_header *ext_man = NULL; + int count; + int ret; + + ret = ext_man_open_file(image); + if (ret) + goto out; + + ret = ext_man_build(image, &ext_man); + if (ret) + goto out; + + /* validate metadata section */ + ret = ext_man_validate(ext_man->full_size - ext_man->header_size, + (char *)ext_man + ext_man->header_size); + if (ret) { + ret = -errno; + goto out; + } + + /* write extended metadata to file */ + count = fwrite(ext_man, 1, ext_man->full_size, image->out_ext_man_fd); + + if (count != ext_man->full_size) { + fprintf(stderr, + "error: can't write extended manifest to file %d\n", + -errno); + ret = -errno; + goto out; + } + + fprintf(stdout, "Extended manifest saved to file %s size 0x%04X (%d) bytes\n\n", + image->out_ext_man_file, ext_man->full_size, + ext_man->full_size); + +out: + if (ext_man) + free(ext_man); + if (image->out_ext_man_fd) + fclose(image->out_ext_man_fd); + return ret; +} diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 68c14c591e19..1f7d13fc48d2 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -115,9 +115,11 @@ struct image { void *rom_image; FILE *out_rom_fd; FILE *out_man_fd; + FILE *out_ext_man_fd; FILE *out_unsigned_fd; char out_rom_file[256]; char out_man_file[256]; + char out_ext_man_file[256]; char out_unsigned_file[256]; /* fw version and build id */ diff --git a/src/include/sof/kernel/ext_manifest.h b/src/include/sof/kernel/ext_manifest.h new file mode 100644 index 000000000000..d27bafeb50a6 --- /dev/null +++ b/src/include/sof/kernel/ext_manifest.h @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski + */ + +/* + * Extended manifest is a place to store metadata about firmware, known during + * compilation time - for example firmware version or used compiler. + * Given information are read on host side before firmware startup. + * This part of output binary is not signed. + * + * To add new content to ext_man, in firmware code define struct which starts + * with ext_man_elem_head followed by usage dependent content and place whole + * struct in "fw_metadata" section. Moreover kernel code should be modified to + * properly read new packet. + * + * Extended manifest is designed to be extensible. In header there is a field + * which describe header length, so after appending some data to header then it + * can be easily skipped by device with older version of this header. + * Unknown ext_man elements should be just skipped by host, + * to be backward compatible. Field `ext_man_elem_header.elem_size` should be + * used in such a situation. + */ + +#ifndef __KERNEL_EXT_MANIFEST_H__ +#define __KERNEL_EXT_MANIFEST_H__ + +#include + +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +/* In ASCII `XMan` */ +#define EXT_MAN_MAGIC_NUMBER 0x6e614d58 + +/* Build u32 number in format MMmmmppp */ +#define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \ + ((uint32_t)(MAJOR) << 24) | \ + ((uint32_t)(MINOR) << 12) | \ + (uint32_t)(PATH)) + +/* check extended manifest version consistency */ +#define EXT_MAN_VERSION_INCOMPATIBLE(host_ver, cli_ver) ( \ + ((host_ver) & GENMASK(31, 24)) != \ + ((cli_ver) & GENMASK(31, 24))) + +/* used extended manifest header version */ +#define EXT_MAN_VERSION EXT_MAN_BUILD_VERSION(1, 0, 0) + +/* struct size alignment for ext_man elements */ +#define EXT_MAN_ALIGN 16 + +/* extended manifest header, deleting any field breaks backward compatibility */ +struct ext_man_header { + uint32_t magic; /**< identification number, */ + /**< EXT_MAN_MAGIC_NUMBER */ + uint32_t full_size; /**< [bytes] full size of ext_man, */ + /**< (header + content + padding) */ + uint32_t header_size; /**< [bytes] makes header extensionable, */ + /**< after append new field to ext_man header */ + /**< then backward compatible won't be lost */ + uint32_t header_version; /**< value of EXT_MAN_VERSION */ + /**< not related with following content */ + + /* just after this header should be list of ext_man_elem_* elements */ +} __packed; + +/* Now define extended manifest elements */ + +/* extended manifest element header */ +struct ext_man_elem_header { + uint32_t type; /**< EXT_MAN_ELEM_* */ + uint32_t elem_size; /**< in bytes, including header size */ + + /* just after this header should be type dependent content */ +} __packed; + +#endif /* __KERNEL_EXT_MANIFEST_H__ */ diff --git a/src/include/sof/kernel/ext_manifest_gen.h b/src/include/sof/kernel/ext_manifest_gen.h new file mode 100644 index 000000000000..16bebcf87f69 --- /dev/null +++ b/src/include/sof/kernel/ext_manifest_gen.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski + */ + +/* + * Extended manifest is a place to store metadata about firmware, known during + * compilation time - for example firmware version or used compiler. + * Given information are read on host side before firmware startup. + * This part of output binary is not signed. + * + * To add new content to ext_man, in firmware code define struct which starts + * with ext_man_elem_head followed by usage dependent content and place whole + * struct in "fw_metadata" section. Moreover kernel code should be modified to + * properly read new packet. + * + * Extended manifest designed to be extensible. In header there is a field which + * describe header length, so after appending some data to header then it can be + * easily skipped by device with older version of this header. + * From other side, unknown ext_man elements should be just skipped by host, + * to be backward compatible. Field ext_man_elem_header.elem_size should be + * used in such a situation. + */ + +#ifndef __EXT_MAN_H__ +#define __EXT_MAN_H__ + +#include "rimage.h" + +int ext_man_write(struct image *image); + +#endif /* __EXT_MAN_H__ */ diff --git a/src/rimage.c b/src/rimage.c index 11bee8a49257..e2cced00ce0a 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,6 +8,7 @@ #include #include +#include "kernel/ext_manifest_gen.h" #include "rimage.h" #include "manifest.h" @@ -187,6 +188,16 @@ int main(int argc, char *argv[]) ret = image.adsp->write_firmware_meu(&image); else ret = image.adsp->write_firmware(&image); + if (ret) + goto out; + + ret = ext_man_write(&image); + if (ret < 0) { + fprintf(stderr, "warning: unable to write extended manifest, %d\n", + ret); + /* ext man is optional until FW side merge to master */ + ret = 0; + } out: /* close files */ From 6b34a04527352171325714912c0d2b63c1aec89e Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 08:46:58 +0200 Subject: [PATCH 115/639] ext_man: Move data section name to global define This name is used in different part of source code so should refer to single place instead by copied. Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 6 +++--- src/include/sof/kernel/ext_manifest_gen.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 90604a2027b9..38e0bc9e999c 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -76,12 +76,12 @@ static int ext_man_build(const struct image *image, size_t offset; int ret = 0; - ret = elf_read_section(image, ".fw_metadata", §ion, + ret = elf_read_section(image, EXT_MAN_DATA_SECTION, §ion, (void **)&sec_buffer); if (ret < 0) { fprintf(stderr, - "error: failed to read .fw_metadata section content, code %d\n", - ret); + "error: failed to read %s section content, code %d\n", + EXT_MAN_DATA_SECTION, ret); goto out; } diff --git a/src/include/sof/kernel/ext_manifest_gen.h b/src/include/sof/kernel/ext_manifest_gen.h index 16bebcf87f69..5bb8b74721de 100644 --- a/src/include/sof/kernel/ext_manifest_gen.h +++ b/src/include/sof/kernel/ext_manifest_gen.h @@ -29,6 +29,8 @@ #include "rimage.h" +#define EXT_MAN_DATA_SECTION ".fw_metadata" + int ext_man_write(struct image *image); #endif /* __EXT_MAN_H__ */ From 0fa22ac38c1aa3e592e48daee9febab25e7c9d95 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 08:57:50 +0200 Subject: [PATCH 116/639] ext_man: elf: Split module and section searching Such a solution improve code hermentization and flexibility. Also such a solution is more relevant because of focus on particular module during section reading, so there won't be possibility to implicity scan section 'A' from first module and section 'B' from second one. Signed-off-by: Karol Trzcinski --- src/elf.c | 13 ++----------- src/ext_manifest.c | 28 +++++++++++++++++++++++++--- src/include/rimage/rimage.h | 2 +- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/elf.c b/src/elf.c index 663b2e0870e2..851f60704fb1 100644 --- a/src/elf.c +++ b/src/elf.c @@ -516,23 +516,14 @@ int elf_find_section(const struct module *module, const char *name) return ret; } -int elf_read_section(const struct image *image, const char *section_name, +int elf_read_section(const struct module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { - const struct module *module; const Elf32_Shdr *section; int section_index = -1; int read; - int i; - - /* when there is more than one module, then first one is bootloader */ - for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { - module = &image->module[i]; - section_index = elf_find_section(module, section_name); - if (section_index >= 0) - break; - } + section_index = elf_find_section(module, section_name); if (section_index < 0) { fprintf(stderr, "error: section %s can't be found\n", section_name); diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 38e0bc9e999c..743814614d0b 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -36,6 +36,21 @@ static int ext_man_open_file(struct image *image) return 0; } +static const struct module *ext_man_find_module(const struct image *image) +{ + const struct module *module; + int i; + + /* when there is more than one module, then first one is bootloader */ + for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { + module = &image->module[i]; + if (elf_find_section(module, EXT_MAN_DATA_SECTION) >= 0) + return module; + } + + return NULL; +} + static int ext_man_validate(uint32_t section_size, const void *section_data) { uint8_t *sbuf = (uint8_t *)section_data; @@ -66,7 +81,7 @@ static int ext_man_validate(uint32_t section_size, const void *section_data) } } -static int ext_man_build(const struct image *image, +static int ext_man_build(const struct module *module, struct ext_man_header **dst_buff) { struct ext_man_header ext_man; @@ -76,7 +91,7 @@ static int ext_man_build(const struct image *image, size_t offset; int ret = 0; - ret = elf_read_section(image, EXT_MAN_DATA_SECTION, §ion, + ret = elf_read_section(module, EXT_MAN_DATA_SECTION, §ion, (void **)&sec_buffer); if (ret < 0) { fprintf(stderr, @@ -117,6 +132,7 @@ static int ext_man_build(const struct image *image, int ext_man_write(struct image *image) { + const struct module *module; struct ext_man_header *ext_man = NULL; int count; int ret; @@ -125,7 +141,13 @@ int ext_man_write(struct image *image) if (ret) goto out; - ret = ext_man_build(image, &ext_man); + module = ext_man_find_module(image); + if (!module) { + ret = -ECANCELED; + goto out; + } + + ret = ext_man_build(module, &ext_man); if (ret) goto out; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 1f7d13fc48d2..3eb375c7cf80 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -179,7 +179,7 @@ void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); int elf_find_section(const struct module *module, const char *name); -int elf_read_section(const struct image *image, const char *name, +int elf_read_section(const struct module *module, const char *name, const Elf32_Shdr **dst_section, void **dst_buff); int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); From 328867431ca74fa7c7101d1a5a441eea462f5f77 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 12:57:01 +0200 Subject: [PATCH 117/639] ext_man: Fix write flow when ext_man should be build elf_read_section() returns section size when everything is ok, so ret value should be reset to 0 after this function call Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 743814614d0b..b36f3d66fef6 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -99,6 +99,7 @@ static int ext_man_build(const struct module *module, EXT_MAN_DATA_SECTION, ret); goto out; } + ret = 0; /* fill ext_man struct, size aligned to 4 to avoid unaligned accesses */ memcpy(&ext_man, &ext_man_template, sizeof(struct ext_man_header)); From 76b6301e5791c485bd9e13b1e87e8fbab7f30340 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 22 Apr 2020 13:32:40 +0200 Subject: [PATCH 118/639] ext_man: Make extended manifest build optional Try to build extended manifest only when `e` flag will be set, to prevent error and warning printing during creating optional part of formware image. Signed-off-by: Karol Trzcinski --- src/rimage.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index e2cced00ce0a..1c8c228c222b 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -42,6 +42,7 @@ static void usage(char *name) fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); fprintf(stdout, "\t -b build version\n"); + fprintf(stdout, "\t -e build extended manifest\n"); exit(0); } @@ -51,12 +52,13 @@ int main(int argc, char *argv[]) const char *mach = NULL; int opt, ret, i, elf_argc = 0; int imr_type = MAN_DEFAULT_IMR_TYPE; + int use_ext_man = 0; memset(&image, 0, sizeof(image)); image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:e")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -91,6 +93,9 @@ int main(int argc, char *argv[]) case 'b': image.fw_ver_build_string = optarg; break; + case 'e': + use_ext_man = 1; + break; case 'h': usage(argv[0]); break; @@ -191,12 +196,14 @@ int main(int argc, char *argv[]) if (ret) goto out; - ret = ext_man_write(&image); - if (ret < 0) { - fprintf(stderr, "warning: unable to write extended manifest, %d\n", - ret); - /* ext man is optional until FW side merge to master */ - ret = 0; + /* build extended manifest */ + if (use_ext_man) { + ret = ext_man_write(&image); + if (ret < 0) { + fprintf(stderr, "error: unable to write extended manifest, %d\n", + ret); + goto out; + } } out: From 537255bdd0c08cb0f5792bfe3ebd0648697d96bd Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 24 Apr 2020 13:26:54 +0200 Subject: [PATCH 119/639] ext_man: Remove redundant variable assign ret variable is always set in elf_read_section(), to initial value is not important. Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index b36f3d66fef6..17758845b6b3 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -89,7 +89,7 @@ static int ext_man_build(const struct module *module, uint8_t *buffer = NULL; uint8_t *sec_buffer = NULL; size_t offset; - int ret = 0; + int ret; ret = elf_read_section(module, EXT_MAN_DATA_SECTION, §ion, (void **)&sec_buffer); From ece04f96560f3bc7790a6e113da302f071eb123d Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 30 Apr 2020 07:40:48 +0200 Subject: [PATCH 120/639] manifest: ads: meu: Fill FW version description also when MEU is used This part of binary should contain valid firmware version. Signed-off-by: Karol Trzcinski --- src/manifest.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/manifest.c b/src/manifest.c index e38b5884ec22..137268bc53ff 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -976,6 +976,11 @@ static int man_write_fw_meu_v1_5(struct image *image) memcpy(desc, &image->adsp->man_v1_5->desc, sizeof(struct sof_man_fw_desc)); + /* firmware and build version */ + desc->header.major_version = image->fw_ver_major; + desc->header.minor_version = image->fw_ver_minor; + desc->header.build_version = image->fw_ver_build; + /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); @@ -1051,6 +1056,11 @@ static int man_write_fw_meu_v1_8(struct image *image) memcpy(desc, &image->adsp->man_v1_8->desc, sizeof(struct sof_man_fw_desc)); + /* firmware and build version */ + desc->header.major_version = image->fw_ver_major; + desc->header.minor_version = image->fw_ver_minor; + desc->header.build_version = image->fw_ver_build; + /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); @@ -1126,6 +1136,11 @@ static int man_write_fw_meu_v2_5(struct image *image) memcpy(desc, &image->adsp->man_v2_5->desc, sizeof(struct sof_man_fw_desc)); + /* firmware and build version */ + desc->header.major_version = image->fw_ver_major; + desc->header.minor_version = image->fw_ver_minor; + desc->header.build_version = image->fw_ver_build; + /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); From 932478abd6b32ed0df0ed4cbcf50e05d647cc100 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 23 Mar 2020 10:14:28 +0100 Subject: [PATCH 121/639] rimage: show LMA and VMA in section view Sometimes they will be different and this will make developer aware of the differences Signed-off-by: Adrian Bonislawski --- src/elf.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/src/elf.c b/src/elf.c index 851f60704fb1..34a9aa775df2 100644 --- a/src/elf.c +++ b/src/elf.c @@ -243,7 +243,7 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) } static void elf_module_size(struct image *image, struct module *module, - Elf32_Shdr *section, int index) + Elf32_Shdr *section, uint32_t lma, int index) { switch (section->type) { case SHT_INIT_ARRAY: @@ -252,20 +252,17 @@ static void elf_module_size(struct image *image, struct module *module, /* text or data */ if (section->flags & SHF_EXECINSTR) { /* text */ - if (module->text_start > section->vaddr) - module->text_start = section->vaddr; - if (module->text_end < section->vaddr + section->size) - module->text_end = section->vaddr + - section->size; - + if (module->text_start > lma) + module->text_start = lma; + if (module->text_end < lma + section->size) + module->text_end = lma + section->size; fprintf(stdout, "\tTEXT\t"); } else { /* initialized data, also calc the writable sections */ - if (module->data_start > section->vaddr) - module->data_start = section->vaddr; - if (module->data_end < section->vaddr + section->size) - module->data_end = section->vaddr + - section->size; + if (module->data_start > lma) + module->data_start = lma; + if (module->data_end < lma + section->size) + module->data_end = lma + section->size; fprintf(stdout, "\tDATA\t"); } @@ -329,7 +326,8 @@ static void elf_module_limits(struct image *image, struct module *module) { Elf32_Shdr *section; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int i; + uint32_t section_lma; + int i, j; module->text_start = 0xffffffff; module->data_start = 0xffffffff; @@ -341,7 +339,7 @@ static void elf_module_limits(struct image *image, struct module *module) fprintf(stdout, " Found %d sections, listing valid sections......\n", module->hdr.shnum); - fprintf(stdout, "\tNo\tStart\t\tEnd\t\tSize\tType\tName\n"); + fprintf(stdout, "\tNo\tLMA\t\tVMA\t\tEnd\t\tSize\tType\tName\n"); /* iterate all sections and get size of segments */ for (i = 0; i < module->hdr.shnum; i++) { @@ -359,16 +357,24 @@ static void elf_module_limits(struct image *image, struct module *module) if (elf_is_rom(image, section)) continue; } + /* check programs to get LMA */ + section_lma = section->vaddr; + for (j = 0; j < module->hdr.phnum; j++) { + if (section->vaddr == module->prg[j].vaddr) { + section_lma = module->prg[j].paddr; + break; + } + } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x", i, - section->vaddr, section->vaddr + section->size, - section->size); + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8x\t0x%x", i, + section_lma, section->vaddr, + section->vaddr + section->size, section->size); /* text or data section */ if (image->reloc) elf_module_size_reloc(image, module, section, i); else - elf_module_size(image, module, section, i); + elf_module_size(image, module, section, section_lma, i); /* section name */ fprintf(stdout, "%s\n", module->strings + section->name); From f23b2c2d07d13b60efe881203d754475b11fbfba Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Mon, 9 Mar 2020 14:11:01 +0100 Subject: [PATCH 122/639] rimage: use lma if available some sections may use different lma than vma address, in such case rimage needs to use lma Signed-off-by: Adrian Bonislawski --- src/manifest.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/manifest.c b/src/manifest.c index 137268bc53ff..ff99af9d14b2 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -126,9 +126,16 @@ static uint32_t elf_to_file_offset(struct image *image, struct sof_man_module *man_module, Elf32_Shdr *section) { - uint32_t elf_addr = section->vaddr, file_offset = 0; + uint32_t elf_addr = section->vaddr, file_offset = 0, i; if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) { + /* check programs for lma/vma change */ + for (i = 0; i < module->hdr.phnum; i++) { + if (section->vaddr == module->prg[i].vaddr) { + elf_addr = module->prg[i].paddr; + break; + } + } if (section->flags & SHF_EXECINSTR) { /* text segment */ file_offset = elf_addr - module->text_start + From 67d09d61c8860ca4f336c5bcf7c2e201e2cc3ac3 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 13 May 2020 14:09:18 +0200 Subject: [PATCH 123/639] ext_man: Move extended manifest generator out of kernel folder Generator is part of rimage tool and there is any reference to them in kernel source code, so it should be moved out of kernel folder. Signed-off-by: Karol Trzcinski --- src/ext_manifest.c | 2 +- src/include/{sof/kernel => rimage}/ext_manifest_gen.h | 0 src/rimage.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename src/include/{sof/kernel => rimage}/ext_manifest_gen.h (100%) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 17758845b6b3..bb220ae38b49 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -9,7 +9,7 @@ #include #include -#include "kernel/ext_manifest_gen.h" +#include "ext_manifest_gen.h" #include "kernel/ext_manifest.h" #include "rimage.h" diff --git a/src/include/sof/kernel/ext_manifest_gen.h b/src/include/rimage/ext_manifest_gen.h similarity index 100% rename from src/include/sof/kernel/ext_manifest_gen.h rename to src/include/rimage/ext_manifest_gen.h diff --git a/src/rimage.c b/src/rimage.c index 1c8c228c222b..2bb0d6e77e1e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,7 +8,7 @@ #include #include -#include "kernel/ext_manifest_gen.h" +#include "ext_manifest_gen.h" #include "rimage.h" #include "manifest.h" From 116e14119331cbbd90b572e547e8d1c6feb28c9b Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 13 May 2020 15:04:48 +0200 Subject: [PATCH 124/639] headers: Move headers to rimage namespace Because there is possibility to reference headers from this repo from another one, there is a need to put every header into rimage namespace. Otherwise reference to headers from duplicated namespace (like kernel) from external repo may be ambiguous. Update guard ifdef/define/endif sequence value, to make it more unique Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 2 +- src/include/{ => rimage}/sof/kernel/ext_manifest.h | 6 +++--- src/include/{ => rimage}/sof/kernel/fw.h | 6 +++--- src/include/{ => rimage}/sof/user/manifest.h | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename src/include/{ => rimage}/sof/kernel/ext_manifest.h (95%) rename src/include/{ => rimage}/sof/kernel/fw.h (95%) rename src/include/{ => rimage}/sof/user/manifest.h (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d176dd582e4..559f9695aa7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE src/include/rimage - src/include/sof + src/include/rimage/sof ) install(TARGETS rimage DESTINATION bin) diff --git a/src/include/sof/kernel/ext_manifest.h b/src/include/rimage/sof/kernel/ext_manifest.h similarity index 95% rename from src/include/sof/kernel/ext_manifest.h rename to src/include/rimage/sof/kernel/ext_manifest.h index d27bafeb50a6..7d9b77735a11 100644 --- a/src/include/sof/kernel/ext_manifest.h +++ b/src/include/rimage/sof/kernel/ext_manifest.h @@ -24,8 +24,8 @@ * used in such a situation. */ -#ifndef __KERNEL_EXT_MANIFEST_H__ -#define __KERNEL_EXT_MANIFEST_H__ +#ifndef __RIMAGE_KERNEL_EXT_MANIFEST_H__ +#define __RIMAGE_KERNEL_EXT_MANIFEST_H__ #include @@ -78,4 +78,4 @@ struct ext_man_elem_header { /* just after this header should be type dependent content */ } __packed; -#endif /* __KERNEL_EXT_MANIFEST_H__ */ +#endif /* __RIMAGE_KERNEL_EXT_MANIFEST_H__ */ diff --git a/src/include/sof/kernel/fw.h b/src/include/rimage/sof/kernel/fw.h similarity index 95% rename from src/include/sof/kernel/fw.h rename to src/include/rimage/sof/kernel/fw.h index 2c0a123d23b7..4a733b30e272 100644 --- a/src/include/sof/kernel/fw.h +++ b/src/include/rimage/sof/kernel/fw.h @@ -10,8 +10,8 @@ * Firmware file format . */ -#ifndef __KERNEL_FW_H__ -#define __KERNEL_FW_H__ +#ifndef __RIMAGE_KERNEL_FW_H__ +#define __RIMAGE_KERNEL_FW_H__ #include @@ -77,4 +77,4 @@ struct snd_sof_fw_header { uint32_t abi; /* version of header format */ } __attribute__((packed)); -#endif /* __KERNEL_FW_H__ */ +#endif /* __RIMAGE_KERNEL_FW_H__ */ diff --git a/src/include/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h similarity index 98% rename from src/include/sof/user/manifest.h rename to src/include/rimage/sof/user/manifest.h index bd598f907efe..ec5b03e23cdf 100644 --- a/src/include/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -11,8 +11,8 @@ * \author Liam Girdwood */ -#ifndef __USER_MANIFEST_H__ -#define __USER_MANIFEST_H__ +#ifndef __RIMAGE_USER_MANIFEST_H__ +#define __RIMAGE_USER_MANIFEST_H__ #include @@ -225,4 +225,4 @@ struct sof_man_module_manifest { (sizeof(struct sof_man_fw_header) + \ (index) * sizeof(struct sof_man_module)) -#endif /* __USER_MANIFEST_H__ */ +#endif /* __RIMAGE_USER_MANIFEST_H__ */ From 9f3f2d7d714908c1f8f3f77baebe9175682f02bc Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 13 May 2020 16:03:34 +0200 Subject: [PATCH 125/639] headers: Use full path to header Path added to include should end at 'include' as usual, then it is easy to see where specific headers comes from during reading source code. It is especially important for projects composed from a few parts, like firmware, driver, build and debug tools in this project. Moreover changed "" to <> in include directives because there is specified full path to file from project include root and to be aligned with code style from firmware repository, Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 3 +-- src/cse.c | 6 +++--- src/css.c | 6 +++--- src/elf.c | 6 +++--- src/ext_manifest.c | 6 +++--- src/file_simple.c | 2 +- src/hash.c | 4 ++-- src/include/rimage/ext_manifest_gen.h | 2 +- src/include/rimage/manifest.h | 8 ++++---- src/include/rimage/rimage.h | 2 +- src/man_apl.c | 8 ++++---- src/man_cnl.c | 8 ++++---- src/man_kbl.c | 8 ++++---- src/man_sue.c | 8 ++++---- src/man_tgl.c | 8 ++++---- src/manifest.c | 12 ++++++------ src/pkcs1_5.c | 6 +++--- src/plat_auth.c | 6 +++--- src/rimage.c | 6 +++--- 19 files changed, 57 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 559f9695aa7c..fb0c5fdc8634 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,8 +29,7 @@ target_compile_options(rimage PRIVATE target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE - src/include/rimage - src/include/rimage/sof + src/include/ ) install(TARGETS rimage DESTINATION bin) diff --git a/src/cse.c b/src/cse.c index f3bea3826ae7..75f7630a65b1 100644 --- a/src/cse.c +++ b/src/cse.c @@ -6,9 +6,9 @@ // Keyon Jie #include -#include "rimage.h" -#include "cse.h" -#include "manifest.h" +#include +#include +#include void ri_cse_create(struct image *image) { diff --git a/src/css.c b/src/css.c index 1e9de6d8bc86..f2627e6f58e9 100644 --- a/src/css.c +++ b/src/css.c @@ -7,9 +7,9 @@ #include #include -#include "rimage.h" -#include "css.h" -#include "manifest.h" +#include +#include +#include void ri_css_v1_8_hdr_create(struct image *image) { diff --git a/src/elf.c b/src/elf.c index 34a9aa775df2..f53adcd75441 100644 --- a/src/elf.c +++ b/src/elf.c @@ -7,9 +7,9 @@ #include #include -#include "rimage.h" -#include "cse.h" -#include "manifest.h" +#include +#include +#include static int elf_read_sections(struct image *image, struct module *module, int module_index) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index bb220ae38b49..8f079bb9bd4b 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -9,9 +9,9 @@ #include #include -#include "ext_manifest_gen.h" -#include "kernel/ext_manifest.h" -#include "rimage.h" +#include +#include +#include const struct ext_man_header ext_man_template = { .magic = EXT_MAN_MAGIC_NUMBER, diff --git a/src/file_simple.c b/src/file_simple.c index d570c5a8bad9..1adcaa738826 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -8,7 +8,7 @@ #include #include -#include "rimage.h" +#include #define BYT_IRAM_BASE 0xff2c0000 #define BYT_IRAM_HOST_OFFSET 0x0C0000 diff --git a/src/hash.c b/src/hash.c index 62c4e2f3540b..a38e64c391ec 100644 --- a/src/hash.c +++ b/src/hash.c @@ -17,8 +17,8 @@ #include #include -#include "rimage.h" -#include "manifest.h" +#include +#include #if OPENSSL_VERSION_NUMBER < 0x10100000L void EVP_MD_CTX_free(EVP_MD_CTX *ctx); diff --git a/src/include/rimage/ext_manifest_gen.h b/src/include/rimage/ext_manifest_gen.h index 5bb8b74721de..e91ba229c1ab 100644 --- a/src/include/rimage/ext_manifest_gen.h +++ b/src/include/rimage/ext_manifest_gen.h @@ -27,7 +27,7 @@ #ifndef __EXT_MAN_H__ #define __EXT_MAN_H__ -#include "rimage.h" +#include #define EXT_MAN_DATA_SECTION ".fw_metadata" diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 32e0574e8db5..7f74b80e7d74 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -7,10 +7,10 @@ #define __MANIFEST_H__ #include -#include -#include "css.h" -#include "cse.h" -#include "plat_auth.h" +#include +#include +#include +#include #define MAN_PAGE_SIZE 4096 diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 3eb375c7cf80..04518ed5900d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) #define MAX_MODULES 32 diff --git a/src/man_apl.c b/src/man_apl.c index b81bb759b8a6..616084b5f673 100644 --- a/src/man_apl.c +++ b/src/man_apl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2017 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v1_8 apl_manifest = { diff --git a/src/man_cnl.c b/src/man_cnl.c index 72ec898718aa..cf51089d30a5 100644 --- a/src/man_cnl.c +++ b/src/man_cnl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2017 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v1_8 cnl_manifest = { diff --git a/src/man_kbl.c b/src/man_kbl.c index 4a078e5d99e8..9634e01a8167 100644 --- a/src/man_kbl.c +++ b/src/man_kbl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2018 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* * TODO: check if all platform for 1.5 are the same base and length. diff --git a/src/man_sue.c b/src/man_sue.c index e170d9952095..8c7df5a29b91 100644 --- a/src/man_sue.c +++ b/src/man_sue.c @@ -2,10 +2,10 @@ // // Copyright(c) 2017 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v1_5_sue sue_manifest = { diff --git a/src/man_tgl.c b/src/man_tgl.c index f7c3c6f25787..97ee4ed08d10 100644 --- a/src/man_tgl.c +++ b/src/man_tgl.c @@ -2,10 +2,10 @@ // // Copyright(c) 2019 Intel Corporation. All rights reserved. -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include /* manifest template */ struct fw_image_manifest_v2_5 tgl_manifest = { diff --git a/src/manifest.c b/src/manifest.c index ff99af9d14b2..6a389bad637c 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -14,13 +14,13 @@ #include #include -#include +#include -#include "rimage.h" -#include "css.h" -#include "cse.h" -#include "plat_auth.h" -#include "manifest.h" +#include +#include +#include +#include +#include static int man_open_rom_file(struct image *image) { diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index a55abb9d33c3..b4718bd0c025 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -17,9 +17,9 @@ #include #include -#include "rimage.h" -#include "css.h" -#include "manifest.h" +#include +#include +#include #if OPENSSL_VERSION_NUMBER < 0x10100000L void RSA_get0_key(const RSA *r, diff --git a/src/plat_auth.c b/src/plat_auth.c index e8645611f327..9b451798ad14 100644 --- a/src/plat_auth.c +++ b/src/plat_auth.c @@ -5,9 +5,9 @@ // Author: Liam Girdwood // Keyon Jie -#include "rimage.h" -#include "manifest.h" -#include "plat_auth.h" +#include +#include +#include void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, int meta_end_offset) diff --git a/src/rimage.c b/src/rimage.c index 2bb0d6e77e1e..5c5c15177482 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,9 +8,9 @@ #include #include -#include "ext_manifest_gen.h" -#include "rimage.h" -#include "manifest.h" +#include +#include +#include static const struct adsp *machine[] = { &machine_byt, From 4348e2a2bd6a8396a3f35bf1bf48f2662e3e73e0 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 15 Jun 2020 21:59:30 -0700 Subject: [PATCH 126/639] cmake: use CMAKE_BUILD_TYPE and default to Debug Unlike hardcoded target_compile_options(-g) can be overriden from the command line, from the parent ExternalProject_Add(CMAKE_ARGS) (tested) or from a CMake GUI (not tested). Default to Debug because the time spent running rimage is negligible compared to building the image to sign and because the time saved learning CMake when it crashes can be huge for some people. BTW -O2 -g is rarely ever useful. Signed-off-by: Marc Herbert --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb0c5fdc8634..02120515b8b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ cmake_minimum_required(VERSION 3.10) project(SOF_RIMAGE C) +if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "No CMAKE_BUILD_TYPE, defaulting to Debug") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE) +endif() + add_executable(rimage src/file_simple.c src/man_apl.c @@ -23,7 +28,7 @@ add_executable(rimage ) target_compile_options(rimage PRIVATE - -O2 -g -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 + -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 ) target_link_libraries(rimage PRIVATE "-lcrypto") From 2156dcb00d2eb05a83f351feb88e55e09bfb27fe Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Mon, 15 Jun 2020 22:28:40 -0700 Subject: [PATCH 127/639] rimage.c: add assert(image.adsp->write_firmware[_meu]) This makes the write_firmware NULL pointer added by commit dd77445f018c and corresponding crash more user-friendly. Before: Program received signal SIGSEGV, Segmentation fault. After: rimage: src/rimage.c:197: main: Assertion `image.adsp->write_firmware' failed. Signed-off-by: Marc Herbert --- src/rimage.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 5c5c15177482..31c5a3f86fc1 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -2,6 +2,7 @@ // // Copyright(c) 2015 Intel Corporation. All rights reserved. +#include #include #include #include @@ -189,10 +190,13 @@ int main(int argc, char *argv[]) } /* process and write output */ - if (image.meu_offset) + if (image.meu_offset) { + assert(image.adsp->write_firmware_meu); ret = image.adsp->write_firmware_meu(&image); - else + } else { + assert(image.adsp->write_firmware); ret = image.adsp->write_firmware(&image); + } if (ret) goto out; From 7317f2af3901991becaecaa48400611b1a532cd5 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Tue, 14 Jul 2020 13:04:20 +0200 Subject: [PATCH 128/639] manifest: set feature mask to 0xffff This feature is not used by SOF anyway and only causes FW load failures, we can set it to 0xffff so it will work for ADL+ platforms. Signed-off-by: Janusz Jankowski --- src/include/rimage/sof/user/manifest.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index ec5b03e23cdf..ccf23cf7b42f 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -115,7 +115,7 @@ struct sof_man_mod_config { #define SOF_MAN_FW_HDR_ID {'$', 'A', 'M', '1'} #define SOF_MAN_FW_HDR_NAME "ADSPFW" #define SOF_MAN_FW_HDR_FLAGS 0x0 -#define SOF_MAN_FW_HDR_FEATURES 0x1ff +#define SOF_MAN_FW_HDR_FEATURES 0xffff /* * The firmware has a standard header that is checked by the ROM on firmware From 29ed0da494841c01f03ea1b65c7c13af63cac589 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Fri, 4 Sep 2020 13:29:17 +0200 Subject: [PATCH 129/639] toml: Add TOML parsing library as git submodule TOML aims to be a minimal configuration file format that's easy to read due to obvious semantics. TOML is designed to map unambiguously to a hash table. Signed-off-by: Karol Trzcinski --- .gitmodules | 4 ++++ tomlc99 | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 tomlc99 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000000..5ade8be2a063 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "tomlc99"] + path = tomlc99 + url = https://github.com/thesofproject/tomlc99.git + branch = master diff --git a/tomlc99 b/tomlc99 new file mode 160000 index 000000000000..e3a03f5ec7d8 --- /dev/null +++ b/tomlc99 @@ -0,0 +1 @@ +Subproject commit e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 From 210009c829ddd6fe2dc180a223b6014dca4a7afe Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Mon, 7 Sep 2020 16:33:49 +0200 Subject: [PATCH 130/639] adsp: Refactor machine searching This part should be moved to separate function, to allow easily add another way of machine description. Signed-off-by: Karol Trzcinski --- src/rimage.c | 71 +++++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 31c5a3f86fc1..f3723fe05654 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -13,24 +13,6 @@ #include #include -static const struct adsp *machine[] = { - &machine_byt, - &machine_cht, - &machine_bsw, - &machine_hsw, - &machine_bdw, - &machine_apl, - &machine_cnl, - &machine_icl, - &machine_jsl, - &machine_tgl, - &machine_sue, - &machine_kbl, - &machine_skl, - &machine_imx8, - &machine_imx8x, - &machine_imx8m, -}; static void usage(char *name) { @@ -47,6 +29,40 @@ static void usage(char *name) exit(0); } +static const struct adsp *find_adsp(const char *mach) +{ + static const struct adsp *machine[] = { + &machine_byt, + &machine_cht, + &machine_bsw, + &machine_hsw, + &machine_bdw, + &machine_apl, + &machine_cnl, + &machine_icl, + &machine_jsl, + &machine_tgl, + &machine_sue, + &machine_kbl, + &machine_skl, + &machine_imx8, + &machine_imx8x, + &machine_imx8m, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(machine); i++) { + if (!strcmp(mach, machine[i]->name)) + return machine[i]; + } + fprintf(stderr, "error: machine %s not found\n", mach); + fprintf(stderr, "error: available machines "); + for (i = 0; i < ARRAY_SIZE(machine); i++) + fprintf(stderr, "%s, ", machine[i]->name); + fprintf(stderr, "\n"); + return NULL; +} + int main(int argc, char *argv[]) { struct image image; @@ -141,22 +157,9 @@ int main(int argc, char *argv[]) } } - /* find machine */ - for (i = 0; i < ARRAY_SIZE(machine); i++) { - if (!strcmp(mach, machine[i]->name)) { - image.adsp = machine[i]; - goto found; - } - } - fprintf(stderr, "error: machine %s not found\n", mach); - fprintf(stderr, "error: available machines "); - for (i = 0; i < ARRAY_SIZE(machine); i++) - fprintf(stderr, "%s, ", machine[i]->name); - fprintf(stderr, "\n"); - - return -EINVAL; - -found: + image.adsp = find_adsp(mach); + if (!image.adsp) + return -EINVAL; /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) From f654d5337d76358e4af4059bc2926b39e5a270d6 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 9 Sep 2020 08:25:51 +0200 Subject: [PATCH 131/639] manifest: Export man_write_fw_vX_Y() to global context Exported function will be used in configuration parser, to assign correct function version depending on manifest versiony Signed-off-by: Karol Trzcinski --- src/file_simple.c | 3 ++- src/include/rimage/manifest.h | 10 ++++++++++ src/manifest.c | 12 ++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/file_simple.c b/src/file_simple.c index 1adcaa738826..396c24c2bf0d 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -9,6 +9,7 @@ #include #include +#include #define BYT_IRAM_BASE 0xff2c0000 #define BYT_IRAM_HOST_OFFSET 0x0C0000 @@ -316,7 +317,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) } /* used by others */ -static int simple_write_firmware(struct image *image) +int simple_write_firmware(struct image *image) { struct snd_sof_fw_header hdr; struct module *module; diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 7f74b80e7d74..7b54bc137b66 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -154,4 +154,14 @@ struct fw_image_manifest_v1_5_sue { extern struct fw_image_manifest_v1_5 skl_manifest; extern struct fw_image_manifest_v1_5 kbl_manifest; extern struct fw_image_manifest_v1_5_sue sue_manifest; + +struct image; +int simple_write_firmware(struct image *image); +int man_write_fw_v1_5(struct image *image); +int man_write_fw_v1_5_sue(struct image *image); +int man_write_fw_v1_8(struct image *image); +int man_write_fw_meu_v1_5(struct image *image); +int man_write_fw_meu_v1_8(struct image *image); +int man_write_fw_meu_v2_5(struct image *image); + #endif diff --git a/src/manifest.c b/src/manifest.c index 6a389bad637c..1c9a2a043119 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -709,7 +709,7 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) } /* used by others */ -static int man_write_fw_v1_5(struct image *image) +int man_write_fw_v1_5(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_5 *m; @@ -789,7 +789,7 @@ static int man_write_fw_v1_5(struct image *image) } /* used by others */ -static int man_write_fw_v1_5_sue(struct image *image) +int man_write_fw_v1_5_sue(struct image *image) { struct fw_image_manifest_v1_5_sue *m; uint32_t preload_size; @@ -845,7 +845,7 @@ static int man_write_fw_v1_5_sue(struct image *image) } /* used by others */ -static int man_write_fw_v1_8(struct image *image) +int man_write_fw_v1_8(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_8 *m; @@ -949,7 +949,7 @@ static int man_write_fw_v1_8(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu_v1_5(struct image *image) +int man_write_fw_meu_v1_5(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; @@ -1027,7 +1027,7 @@ static int man_write_fw_meu_v1_5(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu_v1_8(struct image *image) +int man_write_fw_meu_v1_8(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext_v1_8) - MAN_EXT_PADDING; @@ -1107,7 +1107,7 @@ static int man_write_fw_meu_v1_8(struct image *image) } /* used to sign with MEU */ -static int man_write_fw_meu_v2_5(struct image *image) +int man_write_fw_meu_v2_5(struct image *image) { const int meta_start_offset = image->meu_offset - sizeof(struct sof_man_adsp_meta_file_ext_v2_5) - MAN_EXT_PADDING; From de1b0f7def6fce04fe5b5053c727f6fa8e62b659 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Mon, 7 Sep 2020 17:20:08 +0200 Subject: [PATCH 132/639] config: Add configuration file parsing interface This allow to add new platform with old version of rimage tool. Default values are easily to define for any fields, so fields duplication in config files should be reduced. Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 3 + src/adsp_config.c | 1573 ++++++++++++++++++++++++++++++ src/include/rimage/adsp_config.h | 9 + src/rimage.c | 41 +- 4 files changed, 1620 insertions(+), 6 deletions(-) create mode 100644 src/adsp_config.c create mode 100644 src/include/rimage/adsp_config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 02120515b8b1..078fa8d9e3ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,8 @@ add_executable(rimage src/ext_manifest.c src/elf.c src/rimage.c + src/adsp_config.c + tomlc99/toml.c ) target_compile_options(rimage PRIVATE @@ -35,6 +37,7 @@ target_link_libraries(rimage PRIVATE "-lcrypto") target_include_directories(rimage PRIVATE src/include/ + tomlc99/ ) install(TARGETS rimage DESTINATION bin) diff --git a/src/adsp_config.c b/src/adsp_config.c new file mode 100644 index 000000000000..dc0b91c931c2 --- /dev/null +++ b/src/adsp_config.c @@ -0,0 +1,1573 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2020 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski + */ + +#include "rimage/sof/user/manifest.h" +#include "rimage/adsp_config.h" +#include "rimage/plat_auth.h" +#include "rimage/manifest.h" +#include "rimage/rimage.h" +#include "rimage/cse.h" +#include "rimage/css.h" +#include "toml.h" +#include +#include +#include +#include +#include + +/* macros used to dump values after parsing */ +#define DUMP_KEY_FMT " %20s: " +#define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) +#define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) + +/** parser counter, used to assert nothing left unparsed in toml data */ +struct parse_ctx { + int key_cnt; /**< number of parsed key */ + int table_cnt; /**< number of parsed tables */ + int array_cnt; /**< number of parsed arrays */ +}; + +/** private parser error trace function */ +static void vlog_err(const char *msg, va_list vl) +{ + vfprintf(stderr, msg, vl); +} + +/** parser error trace function, error code is returned to shorten client code */ +static int log_err(int err_code, const char *msg, ...) +{ + va_list vl; + + va_start(vl, msg); + vlog_err(msg, vl); + va_end(vl); + return err_code; +} + +/** log malloc error message for given key */ +static int err_malloc(const char *key) +{ + return log_err(-ENOMEM, "error: malloc failed during parsing key '%s'\n", key); +} + +/** log key not found error */ +static int err_key_not_found(const char *key) +{ + return log_err(-ENOKEY, "error: '%s' not found\n", key); +} + +/** error during parsing key value, possible detailed message */ +static int err_key_parse(const char *key, const char *extra_msg, ...) +{ + int ret = -EBADE; + va_list vl; + + if (extra_msg) { + log_err(ret, "error: key '%s' parsing error, ", key); + va_start(vl, extra_msg); + vlog_err(extra_msg, vl); + va_end(vl); + return log_err(ret, "\n"); + } else { + return log_err(ret, "error: key '%s' parsing error\n", key); + } +} + +/** initialize parser context before parsing */ +static void parse_ctx_init(struct parse_ctx *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + +/** check nothing left unparsed in given parsing context */ +static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx) +{ + const char *key = toml_table_key(table); + int ret = 0; + + /* toml_table_key returns NULL for global context */ + if (!key) + key = "toml"; + + /* from number of parsed fields subtract fields count in given table */ + ctx->key_cnt = toml_table_nkval(table) - ctx->key_cnt; + ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; + ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; + + /* when eny field left unparsed, then raise error */ + if (ctx->key_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); + if (ctx->array_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed arrays left in '%s'\n", ctx->array_cnt, + key); + if (ctx->table_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed tables left in '%s'\n", ctx->table_cnt, + key); + return ret; +} + +/** + * Parse hex value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value + */ +static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, + const char *key, int64_t def, int *error) +{ + toml_raw_t raw; + char *temp_s; + int64_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is not build-in support for hex numbers in toml, so read then as string */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return UINT32_MAX; + } + val = strtol(temp_s, 0, 16); + free(temp_s); + /* assert parsing success and value is within uint32_t range */ + if (errno < 0) { + *error = err_key_parse(key, "can't convert hex value"); + return UINT32_MAX; + } + if (val < 0 || val > UINT32_MAX) { + *error = log_err(-ERANGE, "key %s out of uint32_t range", key); + return UINT32_MAX; + } + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse integer value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value + */ +static int parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error) +{ + toml_raw_t raw; + int64_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is build-in support for integer numbers in toml, so use lib function */ + ret = toml_rtoi(raw, &val); + if (ret < 0) { + *error = err_key_parse(key, "can't convert to integer value"); + return UINT32_MAX; + } + /* assert value is within uint32_t range */ + if (val < 0 || val > UINT32_MAX) { + *error = log_err(-ERANGE, "key %s out of uint32_t range", key); + return UINT32_MAX; + } + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse string value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst target buffer for string + * @param capacity dst buffer size + * @param error code, 0 when success + */ +static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error) +{ + toml_raw_t raw; + char *temp_s; + int len; + int ret; + + /* look for key in given table */ + raw = toml_raw_in(table, key); + if (!raw) { + *error = err_key_not_found(key); + return; + } + /* read string from toml, theres malloc inside toml_rtos() */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return; + } + + len = strlen(temp_s); + if (len > capacity) { + *error = log_err(-EINVAL, "Too long input for key '%s' (%d > %d)\n", key, len, + capacity); + free(temp_s); + return; + } + + /* copy string to dst, free allocated memory and update parsing context */ + strncpy(dst, temp_s, capacity); + free(temp_s); + ++ctx->key_cnt; + *error = 0; +} + +/* map memory zone string name to enum value */ +static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) +{ + static const struct { + const char name[32]; + enum snd_sof_fw_blk_type type; + } mem_zone_name_dict[] = { + {"START", SOF_FW_BLK_TYPE_START}, + {"IRAM", SOF_FW_BLK_TYPE_IRAM}, + {"DRAM", SOF_FW_BLK_TYPE_DRAM}, + {"SRAM", SOF_FW_BLK_TYPE_SRAM}, + {"ROM", SOF_FW_BLK_TYPE_ROM}, + {"IMR", SOF_FW_BLK_TYPE_IMR}, + {"RSRVD0", SOF_FW_BLK_TYPE_RSRVD0}, + {"RSRVD6", SOF_FW_BLK_TYPE_RSRVD6}, + {"RSRVD7", SOF_FW_BLK_TYPE_RSRVD7}, + {"RSRVD8", SOF_FW_BLK_TYPE_RSRVD8}, + {"RSRVD9", SOF_FW_BLK_TYPE_RSRVD9}, + {"RSRVD10", SOF_FW_BLK_TYPE_RSRVD10}, + {"RSRVD11", SOF_FW_BLK_TYPE_RSRVD11}, + {"RSRVD12", SOF_FW_BLK_TYPE_RSRVD12}, + {"RSRVD13", SOF_FW_BLK_TYPE_RSRVD13}, + {"RSRVD14", SOF_FW_BLK_TYPE_RSRVD14}, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(mem_zone_name_dict); ++i) { + if (!strcmp(name, mem_zone_name_dict[i].name)) + return mem_zone_name_dict[i].type; + } + return SOF_FW_BLK_TYPE_INVALID; +} + +static void dump_adsp(const struct adsp *adsp) +{ + int i; + + DUMP("\nadsp"); + DUMP_KEY("name", "'%s'", adsp->name); + DUMP_KEY("machine_id", "%d", adsp->machine_id); + DUMP_KEY("image_size", "0x%x", adsp->image_size); + DUMP_KEY("dram_offset", "0x%x", adsp->dram_offset); + DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); + for (i = 0; i < ARRAY_SIZE(adsp->mem_zones); ++i) { + DUMP_KEY("mem_zone.idx", "%d", i); + DUMP_KEY("mem_zone.size", "0x%x", adsp->mem_zones[i].size); + DUMP_KEY("mem_zone.base", "0x%x", adsp->mem_zones[i].base); + DUMP_KEY("mem_zone.host_offset", "0x%x", adsp->mem_zones[i].host_offset); + } +} + +static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct adsp *out, + bool verbose) +{ + toml_array_t *mem_zone_array; + toml_table_t *mem_zone; + struct mem_zone *zone; + struct parse_ctx ctx; + char zone_name[32]; + toml_table_t *adsp; + toml_raw_t raw; + int zone_idx; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + adsp = toml_table_in(toml, "adsp"); + if (!adsp) + return err_key_not_found("adsp"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + raw = toml_raw_in(adsp, "name"); + if (!raw) + return err_key_not_found("name"); + ++ctx.key_cnt; + + /* free(out->name) is called in adsp_free() */ + ret = toml_rtos(raw, (char **)&out->name); + if (ret < 0) + return err_key_parse("name", NULL); + + out->machine_id = parse_uint32_key(adsp, &ctx, "machine_id", -1, &ret); + if (ret < 0) + return ret; + + out->image_size = parse_uint32_hex_key(adsp, &ctx, "image_size", 0, &ret); + if (ret < 0) + return ret; + + out->dram_offset = parse_uint32_hex_key(adsp, &ctx, "dram_offset", 0, &ret); + if (ret < 0) + return ret; + + out->exec_boot_ldr = parse_uint32_key(adsp, &ctx, "exec_boot_ldr", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, 1 table should be present */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(adsp, &ctx); + if (ret < 0) + return ret; + + /* look for entry array */ + memset(out->mem_zones, 0, sizeof(out->mem_zones)); + mem_zone_array = toml_array_in(adsp, "mem_zone"); + if (!mem_zone_array) + return err_key_not_found("mem_zone"); + if (toml_array_kind(mem_zone_array) != 't' || + toml_array_nelem(mem_zone_array) > SOF_FW_BLK_TYPE_NUM) + return err_key_parse("mem_zone", "wrong array type or length > %d", + SOF_FW_BLK_TYPE_NUM); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(mem_zone_array); ++i) { + mem_zone = toml_table_at(mem_zone_array, i); + if (!mem_zone) + return err_key_parse("mem_zone", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(mem_zone, &ctx, "type", zone_name, sizeof(zone_name), &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + zone_idx = zone_name_to_idx(zone_name); + if (zone_idx < 0) + return err_key_parse("mem_zone.name", "unknown zone"); + + zone = &out->mem_zones[zone_idx]; + zone->base = parse_uint32_hex_key(mem_zone, &ctx, "base", -1, &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + zone->host_offset = parse_uint32_hex_key(mem_zone, &ctx, "host_offset", 0, + &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + zone->size = parse_uint32_hex_key(mem_zone, &ctx, "size", -1, &ret); + if (ret < 0) + return err_key_parse("mem_zone", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(mem_zone, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_adsp(out); + + /* + * values set in other places in code: + * - write_firmware + * - write_firmware_meu + * - man_vX_Y + */ + + return 0; +} + +static void dump_cse(const struct CsePartitionDirHeader *cse_header, + const struct CsePartitionDirEntry *cse_entry) +{ + int i; + + DUMP("\ncse"); + DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_KEY("header_version", "%d", cse_header->header_version); + DUMP_KEY("entry_version", "%d", cse_header->entry_version); + DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); + for (i = 0; i < cse_header->nb_entries; ++i) { + DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); + DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); + } +} + +static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, + struct CsePartitionDirHeader *hdr, struct CsePartitionDirEntry *out, + int entry_capacity, bool verbose) +{ + toml_array_t *cse_entry_array; + toml_table_t *cse_entry; + struct parse_ctx ctx; + toml_table_t *cse; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + cse = toml_table_in(toml, "cse"); + if (!cse) + return err_key_not_found("cse"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + hdr->header_marker = CSE_HEADER_MAKER; + hdr->header_length = sizeof(struct CsePartitionDirHeader); + + /* configurable fields */ + hdr->header_version = parse_uint32_key(cse, &ctx, "header_version", 1, &ret); + if (ret < 0) + return ret; + + hdr->entry_version = parse_uint32_key(cse, &ctx, "entry_version", 1, &ret); + if (ret < 0) + return ret; + + parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, + sizeof(hdr->partition_name), &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 table */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(cse, &ctx); + if (ret < 0) + return ret; + + /* entry array */ + cse_entry_array = toml_array_in(cse, "entry"); + if (!cse_entry_array) + return err_key_not_found("entry"); + if (toml_array_kind(cse_entry_array) != 't' || + toml_array_nelem(cse_entry_array) != entry_capacity) + return err_key_parse("entry", "wrong array type or length != %d", entry_capacity); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(cse_entry_array); ++i) { + cse_entry = toml_table_at(cse_entry_array, i); + if (!cse_entry) + return err_key_parse("entry", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out[i].reserved = 0; + + /* configurable fields */ + parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, + sizeof(out[i].entry_name), &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + out[i].offset = parse_uint32_hex_key(cse_entry, &ctx, "offset", -1, &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + out[i].length = parse_uint32_hex_key(cse_entry, &ctx, "length", -1, &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(cse_entry, &ctx); + if (ret < 0) + return ret; + } + + hdr->nb_entries = toml_array_nelem(cse_entry_array); + + if (verbose) + dump_cse(hdr, out); + + /* + * values set in other places in code: + * - checksum + */ + + return 0; +} + +static void dump_css_v1_5(const struct css_header_v1_5 *css) +{ + DUMP("\ncss"); + DUMP_KEY("module_type", "%d", css->module_type); + DUMP_KEY("header_len", "%d", css->header_len); + DUMP_KEY("header_version", "0x%x", css->header_version); + DUMP_KEY("module_vendor", "0x%x", css->module_vendor); + DUMP_KEY("size", "%d", css->size); + DUMP_KEY("key_size", "%d", css->key_size); + DUMP_KEY("modulus_size", "%d", css->modulus_size); + DUMP_KEY("exponent_size", "%d", css->exponent_size); +} + +static int parse_css_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct css_header_v1_5 *out, bool verbose) +{ + struct parse_ctx ctx; + toml_table_t *css; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + css = toml_table_in(toml, "css"); + if (!css) + return err_key_not_found("css"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->reserved0 = 0; + memset(out->reserved, 0, sizeof(out->reserved)); + + /* configurable fields */ + out->module_type = parse_uint32_key(css, &ctx, "module_type", MAN_CSS_LT_MODULE_TYPE, &ret); + if (ret < 0) + return ret; + + out->header_len = parse_uint32_key(css, &ctx, "header_len", MAN_CSS_HDR_SIZE, &ret); + if (ret < 0) + return ret; + + out->header_version = parse_uint32_hex_key(css, &ctx, "header_version", MAN_CSS_HDR_VERSION, + &ret); + if (ret < 0) + return ret; + out->module_vendor = parse_uint32_hex_key(css, &ctx, "module_vendor", MAN_CSS_MOD_VENDOR, + &ret); + if (ret < 0) + return ret; + + out->size = parse_uint32_key(css, &ctx, "size", 0x800, &ret); + if (ret < 0) + return ret; + + out->key_size = parse_uint32_key(css, &ctx, "key_size", MAN_CSS_KEY_SIZE, &ret); + if (ret < 0) + return ret; + + out->modulus_size = parse_uint32_key(css, &ctx, "modulus_size", MAN_CSS_MOD_SIZE, &ret); + if (ret < 0) + return ret; + + out->exponent_size = parse_uint32_key(css, &ctx, "exponent_size", MAN_CSS_EXP_SIZE, &ret); + if (ret < 0) + return ret; + + /* check everything parsed */ + ret = assert_everything_parsed(css, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_css_v1_5(out); + + /* + * values set in other places in code: + * - date + * - version + * - modulus + * - exponent + * - signature + */ + + return 0; +} + +static void dump_css_v1_8(const struct css_header_v1_8 *css) +{ + DUMP("\ncss"); + DUMP_KEY("header_type", "%d", css->header_type); + DUMP_KEY("header_len", "%d", css->header_len); + DUMP_KEY("header_version", "0x%x", css->header_version); + DUMP_KEY("module_vendor", "0x%x", css->module_vendor); + DUMP_KEY("size", "%d", css->size); + DUMP_KEY("svn", "%d", css->svn); + DUMP_KEY("modulus_size", "%d", css->modulus_size); + DUMP_KEY("exponent_size", "%d", css->exponent_size); +} + +static int parse_css_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, + struct css_header_v1_8 *out, bool verbose) +{ + static const uint8_t hdr_id[4] = MAN_CSS_HDR_ID; + struct parse_ctx ctx; + toml_table_t *css; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + css = toml_table_in(toml, "css"); + if (!css) + return err_key_not_found("css"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + memcpy(out->header_id, hdr_id, sizeof(out->header_id)); + out->padding = 0; + out->reserved0 = 0; + memset(out->reserved1, 0xff, sizeof(out->reserved1)); + + /* configurable fields */ + out->header_type = parse_uint32_key(css, &ctx, "header_type", MAN_CSS_MOD_TYPE, &ret); + if (ret < 0) + return ret; + + out->header_len = parse_uint32_key(css, &ctx, "header_len", MAN_CSS_HDR_SIZE, &ret); + if (ret < 0) + return ret; + + out->header_version = parse_uint32_hex_key(css, &ctx, "header_version", MAN_CSS_HDR_VERSION, + &ret); + if (ret < 0) + return ret; + out->module_vendor = parse_uint32_hex_key(css, &ctx, "module_vendor", MAN_CSS_MOD_VENDOR, + &ret); + if (ret < 0) + return ret; + + out->size = parse_uint32_key(css, &ctx, "size", 222, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(css, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->modulus_size = parse_uint32_key(css, &ctx, "modulus_size", MAN_CSS_MOD_SIZE, &ret); + if (ret < 0) + return ret; + + out->exponent_size = parse_uint32_key(css, &ctx, "exponent_size", MAN_CSS_EXP_SIZE, &ret); + if (ret < 0) + return ret; + + /* check everything parsed */ + ret = assert_everything_parsed(css, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_css_v1_8(out); + + /* + * values set in other places in code: + * - date + * - version + * - modulus + * - exponent + * - signature + */ + + return 0; +} + +static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) +{ + int i; + + DUMP("\nsigned_pkg"); + DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_KEY("vcn", "%d", signed_pkg->vcn); + DUMP_KEY("svn", "%d", signed_pkg->svn); + DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); + DUMP_KEY("fw_sub_type", "%d", signed_pkg->fw_sub_type); + for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) + DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); + for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { + DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); + DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); + DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); + DUMP_KEY("meta.meta_size", "%d", signed_pkg->module[i].meta_size); + } +} + +static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, + struct signed_pkg_info_ext *out, bool verbose) +{ + struct signed_pkg_info_module *mod; + toml_array_t *bitmap_array; + toml_array_t *module_array; + toml_table_t *signed_pkg; + struct parse_ctx ctx; + toml_table_t *module; + toml_raw_t raw; + int64_t temp_i; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + signed_pkg = toml_table_in(toml, "signed_pkg"); + if (!signed_pkg) + return err_key_not_found("signed_pkg"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = SIGN_PKG_EXT_TYPE; + out->ext_len = sizeof(struct signed_pkg_info_ext); + memset(out->reserved, 0, sizeof(out->reserved)); + + /* configurable fields */ + parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(signed_pkg, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(signed_pkg, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->fw_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_type", 0, &ret); + if (ret < 0) + return ret; + + out->fw_sub_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_sub_type", 0, &ret); + if (ret < 0) + return ret; + + /* bitmap array */ + bitmap_array = toml_array_in(signed_pkg, "bitmap"); + if (!bitmap_array) { + /* default value */ + memset(out->bitmap, 0, sizeof(out->bitmap)); + out->bitmap[4] = 8; + } else { + ++ctx.array_cnt; + if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || + toml_array_nelem(bitmap_array) > ARRAY_SIZE(out->bitmap)) + return err_key_parse("bitmap", "wrong array type or length > %d", + ARRAY_SIZE(out->bitmap)); + + for (i = 0; i < toml_array_nelem(bitmap_array); ++i) { + raw = toml_raw_at(bitmap_array, i); + if (!raw) + return err_key_parse("bitmap", NULL); + + ret = toml_rtoi(raw, &temp_i); + if (ret < 0 || temp_i < 0) + return err_key_parse("bitmap", "values can't be negative"); + out->bitmap[i] = temp_i; + } + } + + /* check everything parsed, expect 1 more array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(signed_pkg, &ctx); + if (ret < 0) + return ret; + + /* modules array */ + module_array = toml_array_in(signed_pkg, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) != ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length != %d", + ARRAY_SIZE(out->module)); + + /* parse modules array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_algo = parse_uint32_hex_key(module, &ctx, "hash_algo", 0x02, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_size = parse_uint32_hex_key(module, &ctx, "hash_size", 0x20, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 96, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_signed_pkg(out); + + /* + * values set in other places in code: + * - module.hash + */ + + return 0; +} + +static void dump_partition_info_ext(const struct partition_info_ext *part_info) +{ + int i; + + DUMP("\npartition_info"); + DUMP_KEY("name", "'%s'", part_info->name); + DUMP_KEY("part_version", "0x%x", part_info->part_version); + DUMP_KEY("instance_id", "%d", part_info->instance_id); + for (i = 0; i < ARRAY_SIZE(part_info->module); ++i) { + DUMP_KEY("module.name", "'%s'", part_info->module[i].name); + DUMP_KEY("module.meta_size", "0x%x", part_info->module[i].meta_size); + DUMP_KEY("module.type", "0x%x", part_info->module[i].type); + } +} + +static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx *pctx, + struct partition_info_ext *out, bool verbose) +{ + static const uint8_t module_reserved[3] = {0x00, 0xff, 0xff}; + struct partition_info_module *mod; + toml_table_t *partition_info; + toml_array_t *module_array; + toml_table_t *module; + struct parse_ctx ctx; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + partition_info = toml_table_in(toml, "partition_info"); + if (!partition_info) + return err_key_not_found("partition_info"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = PART_INFO_EXT_TYPE; + out->ext_len = sizeof(struct partition_info_ext); + memset(out->reserved, 0xff, sizeof(out->reserved)); + + /* configurable fields */ + parse_str_key(partition_info, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(partition_info, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->part_version = + parse_uint32_hex_key(partition_info, &ctx, "part_version", 0x10000000, &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_hex_key(partition_info, &ctx, "part_version", 0x10000000, &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_hex_key(partition_info, &ctx, "fmt_version", 0, &ret); + if (ret < 0) + return ret; + + out->instance_id = parse_uint32_key(partition_info, &ctx, "instance_id", 1, &ret); + if (ret < 0) + return ret; + + out->part_flags = parse_uint32_key(partition_info, &ctx, "part_flags", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(partition_info, &ctx); + if (ret < 0) + return ret; + + /* look for module array */ + module_array = toml_array_in(partition_info, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) > ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length > %d", + ARRAY_SIZE(out->module)); + + /* parse module array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + memcpy(mod->reserved, module_reserved, sizeof(mod->reserved)); + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 96, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_partition_info_ext(out); + + /* + * values set in other places in code: + * - length + * - hash + * - module.hash + */ + + return 0; +} + +static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 *adsp_file) +{ + int i; + + DUMP("\nadsp_file_ext"); + DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); + for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { + DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); + DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + } +} + +static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, + struct sof_man_adsp_meta_file_ext_v1_8 *out, bool verbose) +{ + struct sof_man_component_desc_v1_8 *desc; + toml_table_t *adsp_file_ext; + toml_array_t *comp_array; + struct parse_ctx ctx; + toml_table_t *comp; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + adsp_file_ext = toml_table_in(toml, "adsp_file"); + if (!adsp_file_ext) + return err_key_not_found("adsp_file"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non configurable flieds */ + out->ext_type = 17; /* always 17 for ADSP extension */ + out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8); + + /* configurable fields */ + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(adsp_file_ext, &ctx); + if (ret < 0) + return ret; + + /* parse comp array */ + comp_array = toml_array_in(adsp_file_ext, "comp"); + if (!comp_array) + return err_key_not_found("comp"); + if (toml_array_nelem(comp_array) != 1 || toml_array_kind(comp_array) != 't') + return err_key_parse("comp", "wrong array type or length != 1"); + + /* parse comp array elements */ + for (i = 0; i < toml_array_nelem(comp_array); ++i) { + comp = toml_table_at(comp_array, i); + if (!comp) + return err_key_parse("comp", NULL); + desc = &out->comp_desc[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + desc->limit_offset = 0; + + /* configurable fields */ + desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + desc->base_offset = parse_uint32_hex_key(comp, &ctx, "base_offset", + MAN_DESC_OFFSET_V1_8, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(comp, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_adsp_file_ext_v1_8(out); + + /* + * values set in other places in code: + * - imr_type + * - comp.limit_offset + */ + + return 0; +} + +static void dump_adsp_file_ext_v2_5(const struct sof_man_adsp_meta_file_ext_v2_5 *adsp_file) +{ + int i; + + DUMP("\nadsp_file"); + DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); + for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { + DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); + DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + } +} + +static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct sof_man_adsp_meta_file_ext_v2_5 *out, bool verbose) +{ + struct sof_man_component_desc_v2_5 *desc; + toml_table_t *adsp_file_ext; + toml_array_t *comp_array; + struct parse_ctx ctx; + toml_table_t *comp; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + adsp_file_ext = toml_table_in(toml, "adsp_file"); + if (!adsp_file_ext) + return err_key_not_found("adsp_file"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non configurable flieds */ + out->ext_type = 17; /* always 17 for ADSP extension */ + out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5); + + /* configurable fields */ + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(adsp_file_ext, &ctx); + if (ret < 0) + return ret; + + /* parse comp array */ + comp_array = toml_array_in(adsp_file_ext, "comp"); + if (!comp_array) + return err_key_not_found("comp"); + if (toml_array_nelem(comp_array) != 1 || toml_array_kind(comp_array) != 't') + return err_key_parse("comp", "wrong array type or length != 1"); + + /* parse comp array elements */ + for (i = 0; i < toml_array_nelem(comp_array); ++i) { + comp = toml_table_at(comp_array, i); + if (!comp) + return err_key_parse("comp", NULL); + desc = &out->comp_desc[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non configurable flieds */ + desc->limit_offset = 0; + + /* configurable fields */ + desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + desc->base_offset = parse_uint32_hex_key(comp, &ctx, "base_offset", 0x2000, &ret); + if (ret < 0) + return err_key_parse("comp", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(comp, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_adsp_file_ext_v2_5(out); + + /* + * values set in other places in code: + * - imr_type + * - comp.limit_offset + */ + + return 0; +} + +static void dump_fw_desc(const struct sof_man_fw_desc *fw_desc) +{ + DUMP("\nfw_desc.header"); + DUMP_KEY("header_id", "'%c%c%c%c'", fw_desc->header.header_id[0], + fw_desc->header.header_id[1], fw_desc->header.header_id[2], + fw_desc->header.header_id[3]); + DUMP_KEY("name", "'%s'", fw_desc->header.name); + DUMP_KEY("preload_page_count", "%d", fw_desc->header.preload_page_count); + DUMP_KEY("fw_image_flags", "0x%x", fw_desc->header.fw_image_flags); + DUMP_KEY("feature_mask", "0x%x", fw_desc->header.feature_mask); + DUMP_KEY("hw_buf_base_addr", "0x%x", fw_desc->header.hw_buf_base_addr); + DUMP_KEY("hw_buf_length", "0x%x", fw_desc->header.hw_buf_length); + DUMP_KEY("load_offset", "0x%x", fw_desc->header.load_offset); +} + +static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, + struct sof_man_fw_desc *out, bool verbose) +{ + static const uint8_t header_id[4] = SOF_MAN_FW_HDR_ID; + struct parse_ctx ctx; + toml_table_t *header; + toml_table_t *desc; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + desc = toml_table_in(toml, "fw_desc"); + if (!desc) + return err_key_not_found("fw_desc"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + header = toml_table_in(desc, "header"); + if (!header) + return err_key_not_found("header"); + ++ctx.table_cnt; + + /* check everything parsed */ + ret = assert_everything_parsed(desc, &ctx); + if (ret < 0) + return ret; + + /* initialize parser context for header subtable */ + parse_ctx_init(&ctx); + + /* non configurable flieds */ + memcpy(&out->header.header_id, header_id, sizeof(header_id)); + out->header.header_len = sizeof(struct sof_man_fw_header); + + /* configurable fields */ + parse_str_key(header, &ctx, "name", (char *)out->header.name, SOF_MAN_FW_HDR_FW_NAME_LEN, + &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.preload_page_count = + parse_uint32_key(header, &ctx, "preload_page_count", 0, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.fw_image_flags = + parse_uint32_hex_key(header, &ctx, "fw_image_flags", SOF_MAN_FW_HDR_FLAGS, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.feature_mask = + parse_uint32_hex_key(header, &ctx, "feature_mask", SOF_MAN_FW_HDR_FEATURES, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.hw_buf_base_addr = + parse_uint32_hex_key(header, &ctx, "hw_buf_base_addr", 0, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.hw_buf_length = parse_uint32_hex_key(header, &ctx, "hw_buf_length", 0, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + out->header.load_offset = parse_uint32_hex_key(header, &ctx, "load_offset", -1, &ret); + if (ret < 0) + return err_key_parse("header", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(header, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_fw_desc(out); + + /* + * values set in other places in code: + * - major_version + * - minor_version + * - build_version + * - num_module_entries + */ + + return 0; +} + +static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each adsp subtable, sue platform has different manifest definition */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + /* assign correct write functions */ + out->write_firmware = simple_write_firmware; + out->write_firmware_meu = NULL; + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each adsp subtable, sue platform has different manifest definition */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + if (out->machine_id == MACHINE_SUECREEK) { + /* out free is done in client code */ + out->man_v1_5_sue = malloc(sizeof(struct fw_image_manifest_v1_5_sue)); + if (!out->man_v1_5_sue) + return err_malloc("man_v1_5_sue"); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_v1_5_sue; + out->write_firmware_meu = man_write_fw_meu_v1_5; + + /* parse others sibtables */ + ret = parse_fw_desc(toml, &ctx, &out->man_v1_5_sue->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + } else { + /* out free is done in client code */ + out->man_v1_5 = malloc(sizeof(struct fw_image_manifest_v1_5)); + if (!out->man_v1_5) + return err_malloc("man_v1_5"); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_meu_v1_5; + out->write_firmware_meu = man_write_fw_meu_v1_5; + + /* parse others sibtables */ + ret = parse_css_v1_5(toml, &ctx, &out->man_v1_5->css_header, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_v1_5->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + } + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* out free is done in client code */ + out->man_v1_8 = malloc(sizeof(struct fw_image_manifest_v1_8)); + if (!out->man_v1_8) + return err_malloc("man_v1_8"); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_v1_8; + out->write_firmware_meu = man_write_fw_meu_v1_8; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each toml subtable */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + ret = parse_cse(toml, &ctx, &out->man_v1_8->cse_partition_dir_header, + out->man_v1_8->cse_partition_dir_entry, MAN_CSE_PARTS, verbose); + if (ret < 0) + return err_key_parse("cse", NULL); + + ret = parse_css_v1_8(toml, &ctx, &out->man_v1_8->css, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_signed_pkg(toml, &ctx, &out->man_v1_8->signed_pkg, verbose); + if (ret < 0) + return err_key_parse("signed_pkg", NULL); + + ret = parse_partition_info_ext(toml, &ctx, &out->man_v1_8->partition_info, verbose); + if (ret < 0) + return err_key_parse("partition_info", NULL); + + ret = parse_adsp_file_ext_v1_8(toml, &ctx, &out->man_v1_8->adsp_file_ext, verbose); + if (ret < 0) + return err_key_parse("adsp_file", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_v1_8->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + /* out free is done in client code */ + out->man_v2_5 = malloc(sizeof(struct fw_image_manifest_v2_5)); + if (!out->man_v2_5) + return err_malloc("man_v2_5"); + + /* assign correct write functions */ + out->write_firmware = NULL; + out->write_firmware_meu = man_write_fw_meu_v2_5; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each toml subtable */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + ret = parse_cse(toml, &ctx, &out->man_v2_5->cse_partition_dir_header, + out->man_v2_5->cse_partition_dir_entry, MAN_CSE_PARTS, verbose); + if (ret < 0) + return err_key_parse("cse", NULL); + + ret = parse_css_v1_8(toml, &ctx, &out->man_v2_5->css, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_signed_pkg(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); + if (ret < 0) + return err_key_parse("signed_pkg", NULL); + + ret = parse_partition_info_ext(toml, &ctx, &out->man_v2_5->partition_info, verbose); + if (ret < 0) + return err_key_parse("partition_info", NULL); + + ret = parse_adsp_file_ext_v2_5(toml, &ctx, &out->man_v2_5->adsp_file_ext, verbose); + if (ret < 0) + return err_key_parse("adsp_file", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_v2_5->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + +static inline bool check_config_version(int major, int minor, const int64_t *version) +{ + return version[0] == major && version[1] == minor; +} + +static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) +{ + int64_t manifest_version[2]; + toml_table_t *toml; + toml_array_t *arr; + toml_raw_t raw; + char errbuf[256]; + int ret; + int i; + + /* whole toml file is parsed to global toml table at once */ + toml = toml_parse_file(fd, errbuf, ARRAY_SIZE(errbuf)); + if (!toml) + return log_err(-EINVAL, "error: toml file parsing, %s\n", errbuf); + + /* check "version" key */ + arr = toml_array_in(toml, "version"); + if (!arr) + return err_key_not_found("version"); + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') { + ret = err_key_parse("version", "wrong array type or length != 2"); + goto error; + } + + /* parse "version" array elements */ + for (i = 0; i < ARRAY_SIZE(manifest_version); ++i) { + raw = toml_raw_at(arr, i); + if (ret < 0) + ret = err_key_parse("version", NULL); + ret = toml_rtoi(raw, &manifest_version[i]); + if (ret < 0) + ret = err_key_parse("version", "can't convert element to integer"); + } + + /* parsing function depends on manifest_version */ + if (check_config_version(1, 0, manifest_version)) { + ret = parse_adsp_config_v1_0(toml, out, verbose); + } else if (check_config_version(1, 5, manifest_version)) { + ret = parse_adsp_config_v1_5(toml, out, verbose); + } else if (check_config_version(1, 8, manifest_version)) { + ret = parse_adsp_config_v1_8(toml, out, verbose); + } else if (check_config_version(2, 5, manifest_version)) { + ret = parse_adsp_config_v2_5(toml, out, verbose); + } else { + ret = log_err(-EINVAL, "error: Unsupported config version %d.%d\n", + manifest_version[0], manifest_version[1]); + goto error; + } + +error: + toml_free(toml); + return ret; +} + +/* public function, fully handle parsing process */ +int adsp_parse_config(const char *file, struct adsp *out, bool verbose) +{ + FILE *fd; + int ret; + + fd = fopen(file, "r"); + if (!fd) + return log_err(-EIO, "error: can't open '%s' file\n", file); + ret = adsp_parse_config_fd(fd, out, verbose); + fclose(fd); + return ret; +} + +/* free given pointer and internally allocated memory */ +void adsp_free(struct adsp *adsp) +{ + if (!adsp) + return; + + if (adsp->man_v1_5) + free(adsp->man_v1_5); + + if (adsp->man_v1_5_sue) + free(adsp->man_v1_5_sue); + + if (adsp->man_v1_8) + free(adsp->man_v1_8); + + if (adsp->man_v2_5) + free(adsp->man_v2_5); + + if (adsp->name) + free((char *)adsp->name); + + free(adsp); +} diff --git a/src/include/rimage/adsp_config.h b/src/include/rimage/adsp_config.h new file mode 100644 index 000000000000..8b98c1cb7087 --- /dev/null +++ b/src/include/rimage/adsp_config.h @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2020 Intel Corporation. All rights reserved. + +#include +#include + +int adsp_parse_config(const char *file, struct adsp *out, bool verbose); +void adsp_free(struct adsp *adsp); diff --git a/src/rimage.c b/src/rimage.c index f3723fe05654..326994b8b28a 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -8,7 +8,9 @@ #include #include #include +#include +#include #include #include #include @@ -16,7 +18,7 @@ static void usage(char *name) { - fprintf(stdout, "%s:\t -m machine -o outfile -k [key] ELF files\n", + fprintf(stdout, "%s:\t -c adsp_desc -o outfile -k [key] ELF files\n", name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); @@ -29,6 +31,7 @@ static void usage(char *name) exit(0); } +/* deprecated, use ads_config instead for new machines */ static const struct adsp *find_adsp(const char *mach) { static const struct adsp *machine[] = { @@ -66,16 +69,19 @@ static const struct adsp *find_adsp(const char *mach) int main(int argc, char *argv[]) { struct image image; + struct adsp *heap_adsp; const char *mach = NULL; + const char *adsp_config = NULL; int opt, ret, i, elf_argc = 0; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; + bool free_adsp_config = false; memset(&image, 0, sizeof(image)); image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:e")) != -1) { + while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:ec:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -113,6 +119,9 @@ int main(int argc, char *argv[]) case 'e': use_ext_man = 1; break; + case 'c': + adsp_config = optarg; + break; case 'h': usage(argv[0]); break; @@ -124,7 +133,7 @@ int main(int argc, char *argv[]) elf_argc = optind; /* make sure we have an outfile and machine */ - if (!image.out_file || !mach) + if (!image.out_file || (!mach && !adsp_config)) usage(argv[0]); /* requires private key */ @@ -156,10 +165,26 @@ int main(int argc, char *argv[]) return -EINVAL; } } - - image.adsp = find_adsp(mach); - if (!image.adsp) + /* find machine */ + if (adsp_config) { + heap_adsp = malloc(sizeof(struct adsp)); + if (!heap_adsp) { + fprintf(stderr, "error: cannot parse build version\n"); + return -ENOMEM; + } + free_adsp_config = true; + image.adsp = heap_adsp; + ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); + if (ret < 0) + goto out; + } else if (mach) { + image.adsp = find_adsp(mach); + if (!image.adsp) + return -EINVAL; + } else { + fprintf(stderr, "error: Specify target machine\n"); return -EINVAL; + } /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) @@ -214,6 +239,10 @@ int main(int argc, char *argv[]) } out: + /* free memory */ + if (free_adsp_config) + adsp_free(heap_adsp); + /* close files */ if (image.out_fd) fclose(image.out_fd); From a94e12d7d65371a008ac269d473f371a08a80944 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 16 Sep 2020 12:34:46 +0200 Subject: [PATCH 133/639] toml: Add platform configuration files Given config files may be used as template for new platforms. Signed-off-by: Karol Trzcinski --- config/apl.toml | 50 +++++++++++++++++++++++++++++++++++++++++++ config/bdw.toml | 16 ++++++++++++++ config/bsw.toml | 16 ++++++++++++++ config/byt.toml | 16 ++++++++++++++ config/cht.toml | 16 ++++++++++++++ config/cnl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ config/hsw.toml | 16 ++++++++++++++ config/icl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ config/imx8.toml | 21 ++++++++++++++++++ config/imx8m.toml | 21 ++++++++++++++++++ config/imx8x.toml | 21 ++++++++++++++++++ config/jsl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ config/kbl.toml | 23 ++++++++++++++++++++ config/skl.toml | 23 ++++++++++++++++++++ config/sue.toml | 24 +++++++++++++++++++++ config/tgl.toml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 16 files changed, 479 insertions(+) create mode 100644 config/apl.toml create mode 100644 config/bdw.toml create mode 100644 config/bsw.toml create mode 100644 config/byt.toml create mode 100644 config/cht.toml create mode 100644 config/cnl.toml create mode 100644 config/hsw.toml create mode 100644 config/icl.toml create mode 100644 config/imx8.toml create mode 100644 config/imx8m.toml create mode 100644 config/imx8x.toml create mode 100644 config/jsl.toml create mode 100644 config/kbl.toml create mode 100644 config/skl.toml create mode 100644 config/sue.toml create mode 100644 config/tgl.toml diff --git a/config/apl.toml b/config/apl.toml new file mode 100644 index 000000000000..869b95900ccb --- /dev/null +++ b/config/apl.toml @@ -0,0 +1,50 @@ +version = [1, 8] + +[adsp] +name = "apl" +machine_id = 5 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xA000A000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x2000" diff --git a/config/bdw.toml b/config/bdw.toml new file mode 100644 index 000000000000..6cc2402a198b --- /dev/null +++ b/config/bdw.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "bdw" +machine_id = 4 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0" +size = "0x50000" +host_offset = "0x000A0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x00400000" +size = "0xA0000" +host_offset = "0x0" diff --git a/config/bsw.toml b/config/bsw.toml new file mode 100644 index 000000000000..77f2e5c3987f --- /dev/null +++ b/config/bsw.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "bsw" +machine_id = 2 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0xFF2C0000" +size = "0x14000" +host_offset = "0x0C0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xFF300000" +size = "0x28000" +host_offset = "0x100000" diff --git a/config/byt.toml b/config/byt.toml new file mode 100644 index 000000000000..8c2f27851d3e --- /dev/null +++ b/config/byt.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "byt" +machine_id = 0 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0xFF2C0000" +size = "0x14000" +host_offset = "0x0C0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xFF300000" +size = "0x28000" +host_offset = "0x100000" diff --git a/config/cht.toml b/config/cht.toml new file mode 100644 index 000000000000..7cc9142716fe --- /dev/null +++ b/config/cht.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "cht" +machine_id = 1 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0xFF2C0000" +size = "0x14000" +host_offset = "0x0C0000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xFF300000" +size = "0x28000" +host_offset = "0x100000" diff --git a/config/cnl.toml b/config/cnl.toml new file mode 100644 index 000000000000..6a3de265318c --- /dev/null +++ b/config/cnl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "cnl" +machine_id = 8 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" diff --git a/config/hsw.toml b/config/hsw.toml new file mode 100644 index 000000000000..df5e5cec189f --- /dev/null +++ b/config/hsw.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "hsw" +machine_id = 3 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0" +size = "0x60000" +host_offset = "0x80000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x00400000" +size = "0x80000" +host_offset = "0x0" diff --git a/config/icl.toml b/config/icl.toml new file mode 100644 index 000000000000..2e2e61799544 --- /dev/null +++ b/config/icl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "icl" +machine_id = 9 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" diff --git a/config/imx8.toml b/config/imx8.toml new file mode 100644 index 000000000000..69207806c8df --- /dev/null +++ b/config/imx8.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8" +machine_id = 12 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x596F8000" +size = "0x800" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x596E8000" +size = "0x8000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x92400000" +size = "0x800000" +host_offset = "0x0" diff --git a/config/imx8m.toml b/config/imx8m.toml new file mode 100644 index 000000000000..5630d94d1bea --- /dev/null +++ b/config/imx8m.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8m" +machine_id = 14 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x3b6F8000" +size = "0x800" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x3B6E8000" +size = "0x8000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x92400000" +size = "0x800000" +host_offset = "0x0" diff --git a/config/imx8x.toml b/config/imx8x.toml new file mode 100644 index 000000000000..eb4d579103db --- /dev/null +++ b/config/imx8x.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8x" +machine_id = 13 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x596F8000" +size = "0x800" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x596e8000" +size = "0x8000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x92400000" +size = "0x800000" +host_offset = "0x0" diff --git a/config/jsl.toml b/config/jsl.toml new file mode 100644 index 000000000000..0bcb2666b080 --- /dev/null +++ b/config/jsl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "jsl" +machine_id = 9 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" diff --git a/config/kbl.toml b/config/kbl.toml new file mode 100644 index 000000000000..ac82149fdf1f --- /dev/null +++ b/config/kbl.toml @@ -0,0 +1,23 @@ +version = [1, 5] + +[adsp] +name = "kbl" +machine_id = 6 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xA000A000" +size = "0x100000" + +[css] + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0" +hw_buf_base_addr = "0xBE500000" +hw_buf_length = "0x4A000" diff --git a/config/skl.toml b/config/skl.toml new file mode 100644 index 000000000000..f304a1849490 --- /dev/null +++ b/config/skl.toml @@ -0,0 +1,23 @@ +version = [1, 5] + +[adsp] +name = "skl" +machine_id = 7 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xA000A000" +size = "0x100000" + +[css] + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0" +hw_buf_base_addr = "0xBE500000" +hw_buf_length = "0x4A000" diff --git a/config/sue.toml b/config/sue.toml new file mode 100644 index 000000000000..d326d0ae7a8e --- /dev/null +++ b/config/sue.toml @@ -0,0 +1,24 @@ +version = [1, 5] + +[adsp] +name = "sue" +machine_id = 11 +image_size = "0x100000" +exec_boot_ldr = 1 + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xb0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xbe000000" +size = "0x100000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x2000" diff --git a/config/tgl.toml b/config/tgl.toml new file mode 100644 index 000000000000..dc5c760ed802 --- /dev/null +++ b/config/tgl.toml @@ -0,0 +1,54 @@ +version = [2, 5] + +[adsp] +name = "tgl" +machine_id = 10 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x490" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" From 29659081359ff305979b406c7290f800e1ea1231 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 16 Sep 2020 13:49:51 +0200 Subject: [PATCH 134/639] manifest: Remove -m option Used platform should be defined by config file, given in -c option. Double ways of defining platform may lead to missalignement, so old way should be removed. Signed-off-by: Karol Trzcinski --- CMakeLists.txt | 5 -- src/man_apl.c | 126 ----------------------------- src/man_cnl.c | 125 ----------------------------- src/man_kbl.c | 49 ----------- src/man_sue.c | 27 ------- src/man_tgl.c | 125 ----------------------------- src/manifest.c | 214 ------------------------------------------------- src/rimage.c | 73 +++-------------- 8 files changed, 11 insertions(+), 733 deletions(-) delete mode 100644 src/man_apl.c delete mode 100644 src/man_cnl.c delete mode 100644 src/man_kbl.c delete mode 100644 src/man_sue.c delete mode 100644 src/man_tgl.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 078fa8d9e3ed..b09760007629 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,11 +11,6 @@ endif() add_executable(rimage src/file_simple.c - src/man_apl.c - src/man_cnl.c - src/man_kbl.c - src/man_sue.c - src/man_tgl.c src/cse.c src/css.c src/plat_auth.c diff --git a/src/man_apl.c b/src/man_apl.c deleted file mode 100644 index 616084b5f673..000000000000 --- a/src/man_apl.c +++ /dev/null @@ -1,126 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v1_8 apl_manifest = { - .cse_partition_dir_header = { - .header_marker = CSE_HEADER_MAKER, - .nb_entries = MAN_CSE_PARTS, - .header_version = 1, - .entry_version = 1, - .header_length = sizeof(struct CsePartitionDirHeader), - .checksum = 0, - .partition_name = "ADSP", - }, - - .cse_partition_dir_entry = { - { - /* CssHeader + platformFirmwareAuthenticationExtension - padding */ - .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header_v1_8) + - PLAT_AUTH_SIZE, - }, - { /* ADSPMetadataFileExtension */ - .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - }, - { /* AdspFwBinaryDesc */ - .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET_V1_8, - .length = 0, /* calculated by rimage - */ - }, - - }, - - .css = { - .header_type = MAN_CSS_MOD_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 222, - .header_id = MAN_CSS_HDR_ID, - .padding = 0, - .version = { - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - }, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .signed_pkg = { - .ext_type = SIGN_PKG_EXT_TYPE, - .ext_len = sizeof(struct signed_pkg_info_ext), - .name = "ADSP", - .vcn = 0, - .bitmap = {0, 0, 0, 0, 8}, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .hash_algo = 0x02, /* SHA 256 */ - .hash_size = 0x20, - }, - }, - - .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, - .ext_len = sizeof(struct partition_info_ext), - - .name = "ADSP", - .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ - .part_version = 0x10000000, - .instance_id = 1, - .reserved[0 ... 19] = 0xff, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .reserved = {0x00, 0xff, 0xff}, - }, - - }, - - .cse_padding[0 ... 47] = 0xff, - - .adsp_file_ext = { - .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - .comp_desc[0] = { - .version = 0, - .base_offset = MAN_DESC_OFFSET_V1_8, - .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ - }, - - }, - - .reserved[0 ... 31] = 0xff, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = MAN_DESC_OFFSET_V1_8, - }, - }, -}; diff --git a/src/man_cnl.c b/src/man_cnl.c deleted file mode 100644 index cf51089d30a5..000000000000 --- a/src/man_cnl.c +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v1_8 cnl_manifest = { - .cse_partition_dir_header = { - .header_marker = CSE_HEADER_MAKER, - .nb_entries = MAN_CSE_PARTS, - .header_version = 1, - .entry_version = 1, - .header_length = sizeof(struct CsePartitionDirHeader), - .partition_name = "ADSP", - }, - - .cse_partition_dir_entry = { - { - /* CssHeader + platformFirmwareAuthenticationExtension - padding */ - .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header_v1_8) + - PLAT_AUTH_SIZE, - }, - { /* ADSPMetadataFileExtension */ - .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - }, - { /* AdspFwBinaryDesc */ - .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET_V1_8, - .length = 0, /* calculated by rimage - */ - }, - - }, - - .css = { - .header_type = MAN_CSS_MOD_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 222, - .header_id = MAN_CSS_HDR_ID, - .padding = 0, - .version = { - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - }, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .signed_pkg = { - .ext_type = SIGN_PKG_EXT_TYPE, - .ext_len = sizeof(struct signed_pkg_info_ext), - .name = "ADSP", - .vcn = 0, - .bitmap = {0, 0, 0, 0, 8}, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .hash_algo = 0x02, /* SHA 256 */ - .hash_size = 0x20, - }, - }, - - .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, - .ext_len = sizeof(struct partition_info_ext), - - .name = "ADSP", - .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ - .part_version = 0x10000000, - .instance_id = 1, - .reserved[0 ... 19] = 0xff, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .reserved = {0x00, 0xff, 0xff}, - }, - - }, - - .cse_padding[0 ... 47] = 0xff, - - .adsp_file_ext = { - .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8), - .comp_desc[0] = { - .version = 0, - .base_offset = MAN_DESC_OFFSET_V1_8, - .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ - }, - - }, - - .reserved[0 ... 31] = 0xff, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0x30000, - }, - }, -}; diff --git a/src/man_kbl.c b/src/man_kbl.c deleted file mode 100644 index 9634e01a8167..000000000000 --- a/src/man_kbl.c +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2018 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* - * TODO: check if all platform for 1.5 are the same base and length. - * if yes, define it as HARDWARE_BUFFER_BASE_V1_5, HARDWARE_BUFFER_LEN_v1_5 - * if not, define a platform specific base and length. - */ -#define KBL_HARDWARE_BUFFER_BASE 0xBE500000 -#define KBL_HARDWARE_BUFFER_LEN 0x4A000 - -/* manifest template */ -struct fw_image_manifest_v1_5 kbl_manifest = { - .css_header = { - .module_type = MAN_CSS_LT_MODULE_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 0x800, - .key_size = MAN_CSS_KEY_SIZE, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - /* size in pages from $CPD */ - .preload_page_count = 0, - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0, - .hw_buf_base_addr = KBL_HARDWARE_BUFFER_BASE, - .hw_buf_length = KBL_HARDWARE_BUFFER_LEN - }, - }, -}; diff --git a/src/man_sue.c b/src/man_sue.c deleted file mode 100644 index 8c7df5a29b91..000000000000 --- a/src/man_sue.c +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v1_5_sue sue_manifest = { - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0x2000, - }, - }, -}; diff --git a/src/man_tgl.c b/src/man_tgl.c deleted file mode 100644 index 97ee4ed08d10..000000000000 --- a/src/man_tgl.c +++ /dev/null @@ -1,125 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2019 Intel Corporation. All rights reserved. - -#include -#include -#include -#include - -/* manifest template */ -struct fw_image_manifest_v2_5 tgl_manifest = { - .cse_partition_dir_header = { - .header_marker = CSE_HEADER_MAKER, - .nb_entries = MAN_CSE_PARTS, - .header_version = 1, - .entry_version = 1, - .header_length = sizeof(struct CsePartitionDirHeader), - .partition_name = "ADSP", - }, - - .cse_partition_dir_entry = { - { - /* CssHeader + platformFirmwareAuthenticationExtension - padding */ - .entry_name = "ADSP.man", - .offset = MAN_CSS_HDR_OFFSET, - .length = sizeof(struct css_header_v1_8) + - PLAT_AUTH_SIZE, - }, - { /* ADSPMetadataFileExtension */ - .entry_name = "cavs0015.met", - .offset = MAN_META_EXT_OFFSET_V1_8, - .length = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), - }, - { /* AdspFwBinaryDesc */ - .entry_name = "cavs0015", - .offset = MAN_FW_DESC_OFFSET_V2_5, - .length = 0, /* calculated by rimage - */ - }, - - }, - - .css = { - .header_type = MAN_CSS_MOD_TYPE, - .header_len = MAN_CSS_HDR_SIZE, - .header_version = MAN_CSS_HDR_VERSION, - .module_vendor = MAN_CSS_MOD_VENDOR, - .size = 222, - .header_id = MAN_CSS_HDR_ID, - .padding = 0, - .version = { - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - }, - .modulus_size = MAN_CSS_MOD_SIZE, - .exponent_size = MAN_CSS_EXP_SIZE, - }, - - .signed_pkg = { - .ext_type = SIGN_PKG_EXT_TYPE, - .ext_len = sizeof(struct signed_pkg_info_ext), - .name = "ADSP", - .vcn = 0, - .bitmap = {0, 0, 0, 0, 8}, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .hash_algo = 0x02, /* SHA 256 */ - .hash_size = 0x20, - }, - }, - - .partition_info = { - .ext_type = PART_INFO_EXT_TYPE, - .ext_len = sizeof(struct partition_info_ext), - - .name = "ADSP", - .length = 0, /* calculated by rimage - rounded up to nearest PAGE */ - .part_version = 0x10000000, - .instance_id = 1, - .reserved[0 ... 19] = 0xff, - - .module[0] = { - .name = "cavs0015.met", - .meta_size = 96, - .type = 0x03, - .reserved = {0x00, 0xff, 0xff}, - }, - - }, - - .cse_padding[0 ... 47] = 0xff, - - .adsp_file_ext = { - .ext_type = 17, - .ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5), - .comp_desc[0] = { - .version = 0, - .base_offset = MAN_DESC_OFFSET_V1_8, - .limit_offset = 0, /* calculated length + MAN_DESC_OFFSET */ - }, - - }, - - .reserved[0 ... 31] = 0xff, - - .desc = { - .header = { - .header_id = SOF_MAN_FW_HDR_ID, - .header_len = sizeof(struct sof_man_fw_header), - .name = SOF_MAN_FW_HDR_NAME, - .preload_page_count = 0, /* size in pages from $CPD */ - .fw_image_flags = SOF_MAN_FW_HDR_FLAGS, - .feature_mask = SOF_MAN_FW_HDR_FEATURES, - .major_version = 0, - .minor_version = 0, - .hotfix_version = 0, - .build_version = 0, - .load_offset = 0x30000, - }, - }, -}; diff --git a/src/manifest.c b/src/manifest.c index 1c9a2a043119..d76c394154cc 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1185,217 +1185,3 @@ int man_write_fw_meu_v2_5(struct image *image) unlink(image->out_file); return ret; } - -#define ADSP_APL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_APL_DSP_ROM_SIZE 0x00002000 -#define APL_DSP_BASE_ENTRY 0xa000a000 - -#define ADSP_KBL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_KBL_DSP_ROM_SIZE 0x00002000 -#define KBL_DSP_BASE_ENTRY 0xa000a000 - -#define ADSP_SKL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_SKL_DSP_ROM_SIZE 0x00002000 -#define SKL_DSP_BASE_ENTRY 0xa000a000 - -#define ADSP_CNL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_CNL_DSP_ROM_SIZE 0x00002000 -#define CNL_DSP_IMR_BASE_ENTRY 0xb0038000 -#define CNL_DSP_HP_BASE_ENTRY 0xbe040000 - -#define ADSP_SUE_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_SUE_DSP_ROM_SIZE 0x00002000 -#define SUE_DSP_IMR_BASE_ENTRY 0xb0038000 -#define SUE_DSP_HP_BASE_ENTRY 0xbe000000 - -#define ADSP_ICL_DSP_ROM_BASE 0xBEFE0000 -#define ADSP_ICL_DSP_ROM_SIZE 0x00002000 -#define ICL_DSP_IMR_BASE_ENTRY 0xb0038000 -#define ICL_DSP_HP_BASE_ENTRY 0xbe040000 - -#define ADSP_TGL_DSP_ROM_BASE 0x9F180000 -#define ADSP_TGL_DSP_ROM_SIZE 0x00002000 -#define TGL_DSP_IMR_BASE_ENTRY 0xb0038000 -#define TGL_DSP_HP_BASE_ENTRY 0xbe040000 - -/* list of supported adsp */ -const struct adsp machine_apl = { - .name = "apl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_APL_DSP_ROM_BASE, - .size = ADSP_APL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = APL_DSP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_APOLLOLAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &apl_manifest, -}; - -const struct adsp machine_kbl = { - .name = "kbl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_KBL_DSP_ROM_BASE, - .size = ADSP_KBL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = KBL_DSP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_KABYLAKE, - .write_firmware = man_write_fw_v1_5, - .write_firmware_meu = man_write_fw_meu_v1_5, - .man_v1_5 = &kbl_manifest, -}; - -const struct adsp machine_skl = { - .name = "skl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_SKL_DSP_ROM_BASE, - .size = ADSP_SKL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = SKL_DSP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_SKYLAKE, - .write_firmware = man_write_fw_v1_5, - .write_firmware_meu = man_write_fw_meu_v1_5, - .man_v1_5 = &kbl_manifest, -}; - -const struct adsp machine_cnl = { - .name = "cnl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_CNL_DSP_ROM_BASE, - .size = ADSP_CNL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = CNL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = CNL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_CANNONLAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, -}; - -const struct adsp machine_icl = { - .name = "icl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_ICL_DSP_ROM_BASE, - .size = ADSP_ICL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = ICL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = ICL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_ICELAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, // use the same as CNL -}; - -const struct adsp machine_jsl = { - .name = "jsl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_ICL_DSP_ROM_BASE, - .size = ADSP_ICL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = ICL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = ICL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_ICELAKE, - .write_firmware = man_write_fw_v1_8, - .write_firmware_meu = man_write_fw_meu_v1_8, - .man_v1_8 = &cnl_manifest, // use the same as CNL -}; - -const struct adsp machine_tgl = { - .name = "tgl", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_TGL_DSP_ROM_BASE, - .size = ADSP_TGL_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = TGL_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = TGL_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_TIGERLAKE, - .write_firmware = NULL, /* not yet implemented */ - .write_firmware_meu = man_write_fw_meu_v2_5, - .man_v2_5 = &tgl_manifest, -}; - -const struct adsp machine_sue = { - .name = "sue", - .mem_zones = { - [SOF_FW_BLK_TYPE_ROM] = { - .base = ADSP_SUE_DSP_ROM_BASE, - .size = ADSP_SUE_DSP_ROM_SIZE, - }, - [SOF_FW_BLK_TYPE_IMR] = { - .base = SUE_DSP_IMR_BASE_ENTRY, - .size = 0x100000, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = SUE_DSP_HP_BASE_ENTRY, - .size = 0x100000, - }, - }, - .image_size = 0x100000, - .dram_offset = 0, - .machine_id = MACHINE_SUECREEK, - .write_firmware = man_write_fw_v1_5_sue, - .write_firmware_meu = man_write_fw_v1_5_sue, - .man_v1_5_sue = &sue_manifest, - .exec_boot_ldr = 1, -}; diff --git a/src/rimage.c b/src/rimage.c index 326994b8b28a..f021d3a5e6ba 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -31,64 +31,24 @@ static void usage(char *name) exit(0); } -/* deprecated, use ads_config instead for new machines */ -static const struct adsp *find_adsp(const char *mach) -{ - static const struct adsp *machine[] = { - &machine_byt, - &machine_cht, - &machine_bsw, - &machine_hsw, - &machine_bdw, - &machine_apl, - &machine_cnl, - &machine_icl, - &machine_jsl, - &machine_tgl, - &machine_sue, - &machine_kbl, - &machine_skl, - &machine_imx8, - &machine_imx8x, - &machine_imx8m, - }; - int i; - - for (i = 0; i < ARRAY_SIZE(machine); i++) { - if (!strcmp(mach, machine[i]->name)) - return machine[i]; - } - fprintf(stderr, "error: machine %s not found\n", mach); - fprintf(stderr, "error: available machines "); - for (i = 0; i < ARRAY_SIZE(machine); i++) - fprintf(stderr, "%s, ", machine[i]->name); - fprintf(stderr, "\n"); - return NULL; -} - int main(int argc, char *argv[]) { struct image image; struct adsp *heap_adsp; - const char *mach = NULL; const char *adsp_config = NULL; int opt, ret, i, elf_argc = 0; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; - bool free_adsp_config = false; memset(&image, 0, sizeof(image)); image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:m:va:s:k:l:ri:x:f:b:ec:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:l:ri:x:f:b:ec:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; break; - case 'm': - mach = optarg; - break; case 'v': image.verbose = 1; break; @@ -133,7 +93,7 @@ int main(int argc, char *argv[]) elf_argc = optind; /* make sure we have an outfile and machine */ - if (!image.out_file || (!mach && !adsp_config)) + if (!image.out_file || !adsp_config) usage(argv[0]); /* requires private key */ @@ -166,25 +126,15 @@ int main(int argc, char *argv[]) } } /* find machine */ - if (adsp_config) { - heap_adsp = malloc(sizeof(struct adsp)); - if (!heap_adsp) { - fprintf(stderr, "error: cannot parse build version\n"); - return -ENOMEM; - } - free_adsp_config = true; - image.adsp = heap_adsp; - ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); - if (ret < 0) - goto out; - } else if (mach) { - image.adsp = find_adsp(mach); - if (!image.adsp) - return -EINVAL; - } else { - fprintf(stderr, "error: Specify target machine\n"); - return -EINVAL; + heap_adsp = malloc(sizeof(struct adsp)); + if (!heap_adsp) { + fprintf(stderr, "error: cannot parse build version\n"); + return -ENOMEM; } + image.adsp = heap_adsp; + ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); + if (ret < 0) + goto out; /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) @@ -240,8 +190,7 @@ int main(int argc, char *argv[]) out: /* free memory */ - if (free_adsp_config) - adsp_free(heap_adsp); + adsp_free(heap_adsp); /* close files */ if (image.out_fd) From dab973039c36d714b69da37a5e30d198e5e0f1ab Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 11:32:42 +0200 Subject: [PATCH 135/639] toml: Add version information in verbose mode It allows to assure right version of chosen headers during reading logs in verbose mode. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index dc0b91c931c2..54a1548f8e02 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -532,7 +532,7 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, static void dump_css_v1_5(const struct css_header_v1_5 *css) { - DUMP("\ncss"); + DUMP("\ncss 1.5"); DUMP_KEY("module_type", "%d", css->module_type); DUMP_KEY("header_len", "%d", css->header_len); DUMP_KEY("header_version", "0x%x", css->header_version); @@ -617,7 +617,7 @@ static int parse_css_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, static void dump_css_v1_8(const struct css_header_v1_8 *css) { - DUMP("\ncss"); + DUMP("\ncss 1.8"); DUMP_KEY("header_type", "%d", css->header_type); DUMP_KEY("header_len", "%d", css->header_len); DUMP_KEY("header_version", "0x%x", css->header_version); @@ -994,7 +994,7 @@ static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 { int i; - DUMP("\nadsp_file_ext"); + DUMP("\nadsp_file_ext 1.8"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); @@ -1087,7 +1087,7 @@ static void dump_adsp_file_ext_v2_5(const struct sof_man_adsp_meta_file_ext_v2_5 { int i; - DUMP("\nadsp_file"); + DUMP("\nadsp_file 2.5"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); From 3169dbd40da9d1e06f8f78cd6c653aebe846222d Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 12:05:02 +0200 Subject: [PATCH 136/639] toml: Add adsp_file_ext attributes parsing This field left without possibility to set value from config file. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index 54a1548f8e02..c0c919a229bc 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -993,12 +993,15 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 *adsp_file) { int i; + int j; DUMP("\nadsp_file_ext 1.8"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + for (j = 0; j < ARRAY_SIZE(adsp_file->comp_desc->attributes); ++j) + DUMP_KEY("comp.atributes[]", "%d", adsp_file->comp_desc[i].attributes[j]); } } @@ -1006,12 +1009,16 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * struct sof_man_adsp_meta_file_ext_v1_8 *out, bool verbose) { struct sof_man_component_desc_v1_8 *desc; + toml_array_t *attributes_array; toml_table_t *adsp_file_ext; toml_array_t *comp_array; struct parse_ctx ctx; + toml_raw_t attribute; toml_table_t *comp; + int64_t temp_i; int ret; int i; + int j; /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ adsp_file_ext = toml_table_in(toml, "adsp_file"); @@ -1065,6 +1072,27 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * if (ret < 0) return err_key_parse("comp", NULL); + /* parse attributes array */ + attributes_array = toml_array_in(comp, "attributes"); + if (attributes_array) { + ++ctx.array_cnt; + if (toml_array_nelem(attributes_array) > ARRAY_SIZE(desc->attributes) || + toml_array_kind(attributes_array) != 'v' || + toml_array_type(attributes_array) != 'i') + return err_key_parse("comp.attributes", + "wrong array type or length > %d", + ARRAY_SIZE(desc->attributes)); + for (j = 0; j < toml_array_nelem(attributes_array); ++j) { + attribute = toml_raw_at(attributes_array, j); + if (!attribute) + err_key_parse("comp.attributes", NULL); + ret = toml_rtoi(attribute, &temp_i); + if (ret < 0 || temp_i < 0 || temp_i > UINT32_MAX) + err_key_parse("comp.attributes", NULL); + desc->attributes[j] = (uint32_t)temp_i; + } + } + /* check everything parsed */ ret = assert_everything_parsed(comp, &ctx); if (ret < 0) @@ -1086,12 +1114,15 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * static void dump_adsp_file_ext_v2_5(const struct sof_man_adsp_meta_file_ext_v2_5 *adsp_file) { int i; + int j; DUMP("\nadsp_file 2.5"); DUMP_KEY("imr_type", "0x%x", adsp_file->imr_type); for (i = 0; i < ARRAY_SIZE(adsp_file->comp_desc); ++i) { DUMP_KEY("comp.version", "0x%x", adsp_file->comp_desc[i].version); DUMP_KEY("comp.base_offset", "0x%x", adsp_file->comp_desc[i].base_offset); + for (j = 0; j < ARRAY_SIZE(adsp_file->comp_desc->attributes); ++j) + DUMP_KEY("comp.atributes[]", "%d", adsp_file->comp_desc[i].attributes[j]); } } @@ -1099,12 +1130,16 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * struct sof_man_adsp_meta_file_ext_v2_5 *out, bool verbose) { struct sof_man_component_desc_v2_5 *desc; + toml_array_t *attributes_array; toml_table_t *adsp_file_ext; toml_array_t *comp_array; struct parse_ctx ctx; + toml_raw_t attribute; toml_table_t *comp; + int64_t temp_i; int ret; int i; + int j; /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ adsp_file_ext = toml_table_in(toml, "adsp_file"); @@ -1157,6 +1192,27 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * if (ret < 0) return err_key_parse("comp", NULL); + /* parse attributes array */ + attributes_array = toml_array_in(comp, "attributes"); + if (attributes_array) { + ++ctx.array_cnt; + if (toml_array_nelem(attributes_array) > ARRAY_SIZE(desc->attributes) || + toml_array_kind(attributes_array) != 'v' || + toml_array_type(attributes_array) != 'i') + return err_key_parse("comp.attributes", + "wrong array type or length > %d", + ARRAY_SIZE(desc->attributes)); + for (j = 0; j < toml_array_nelem(attributes_array); ++j) { + attribute = toml_raw_at(attributes_array, j); + if (!attribute) + err_key_parse("comp.attributes", NULL); + ret = toml_rtoi(attribute, &temp_i); + if (ret < 0 || temp_i < 0 || temp_i > UINT32_MAX) + err_key_parse("comp.attributes", NULL); + desc->attributes[j] = (uint32_t)temp_i; + } + } + /* check everything parsed */ ret = assert_everything_parsed(comp, &ctx); if (ret < 0) From d3ead755c9f35c790cf6d780f89ac3661b4e1b22 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 11:23:00 +0200 Subject: [PATCH 137/639] toml: manifest: Clear manifest allocated on heap before use Memory clear allows to easily set seserved/padding fields to zero. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 22 ++++++++++++---------- src/rimage.c | 1 + 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index c0c919a229bc..02f0b2bd43dc 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -495,7 +495,6 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, parse_ctx_init(&ctx); /* non-configurable fields */ - out[i].reserved = 0; /* configurable fields */ parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, @@ -558,8 +557,6 @@ static int parse_css_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, parse_ctx_init(&ctx); /* non-configurable fields */ - out->reserved0 = 0; - memset(out->reserved, 0, sizeof(out->reserved)); /* configurable fields */ out->module_type = parse_uint32_key(css, &ctx, "module_type", MAN_CSS_LT_MODULE_TYPE, &ret); @@ -645,9 +642,6 @@ static int parse_css_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ memcpy(out->header_id, hdr_id, sizeof(out->header_id)); - out->padding = 0; - out->reserved0 = 0; - memset(out->reserved1, 0xff, sizeof(out->reserved1)); /* configurable fields */ out->header_type = parse_uint32_key(css, &ctx, "header_type", MAN_CSS_MOD_TYPE, &ret); @@ -748,7 +742,6 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ out->ext_type = SIGN_PKG_EXT_TYPE; out->ext_len = sizeof(struct signed_pkg_info_ext); - memset(out->reserved, 0, sizeof(out->reserved)); /* configurable fields */ parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); @@ -775,7 +768,6 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, bitmap_array = toml_array_in(signed_pkg, "bitmap"); if (!bitmap_array) { /* default value */ - memset(out->bitmap, 0, sizeof(out->bitmap)); out->bitmap[4] = 8; } else { ++ctx.array_cnt; @@ -1060,7 +1052,6 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * parse_ctx_init(&ctx); /* non-configurable fields */ - desc->limit_offset = 0; /* configurable fields */ desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); @@ -1181,7 +1172,6 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * parse_ctx_init(&ctx); /* non configurable flieds */ - desc->limit_offset = 0; /* configurable fields */ desc->version = parse_uint32_key(comp, &ctx, "version", 0, &ret); @@ -1380,6 +1370,9 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, if (!out->man_v1_5_sue) return err_malloc("man_v1_5_sue"); + /* clear memory */ + memset(out->man_v1_5_sue, 0, sizeof(*out->man_v1_5_sue)); + /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5_sue; out->write_firmware_meu = man_write_fw_meu_v1_5; @@ -1394,6 +1387,9 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, if (!out->man_v1_5) return err_malloc("man_v1_5"); + /* clear memory */ + memset(out->man_v1_5, 0, sizeof(*out->man_v1_5)); + /* assign correct write functions */ out->write_firmware = man_write_fw_meu_v1_5; out->write_firmware_meu = man_write_fw_meu_v1_5; @@ -1427,6 +1423,9 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, if (!out->man_v1_8) return err_malloc("man_v1_8"); + /* clear memory */ + memset(out->man_v1_8, 0, sizeof(*out->man_v1_8)); + /* assign correct write functions */ out->write_firmware = man_write_fw_v1_8; out->write_firmware_meu = man_write_fw_meu_v1_8; @@ -1484,6 +1483,9 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (!out->man_v2_5) return err_malloc("man_v2_5"); + /* clear memory */ + memset(out->man_v2_5, 0, sizeof(*out->man_v2_5)); + /* assign correct write functions */ out->write_firmware = NULL; out->write_firmware_meu = man_write_fw_meu_v2_5; diff --git a/src/rimage.c b/src/rimage.c index f021d3a5e6ba..cd3d63b09f2e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -132,6 +132,7 @@ int main(int argc, char *argv[]) return -ENOMEM; } image.adsp = heap_adsp; + memset(heap_adsp, 0, sizeof(*heap_adsp)); ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); if (ret < 0) goto out; From e9759df946f6f0352431d53aa9d990b98e1988bf Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Thu, 17 Sep 2020 23:23:32 +0200 Subject: [PATCH 138/639] toml: Fix adsp v1.5 parsing Set right write function. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 02f0b2bd43dc..559767584181 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1391,7 +1391,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, memset(out->man_v1_5, 0, sizeof(*out->man_v1_5)); /* assign correct write functions */ - out->write_firmware = man_write_fw_meu_v1_5; + out->write_firmware = man_write_fw_v1_5; out->write_firmware_meu = man_write_fw_meu_v1_5; /* parse others sibtables */ From 6dcf1b6ae8eb99e545eaf367528243136f95028e Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 10:52:08 +0200 Subject: [PATCH 139/639] toml: Use only standard error codes Error codes like ENOKEY and EBADE are not provide for all windows toolchains, so to immit possible build errors, some more standard error codes should be used. Detailed error message is printed in stderr, so end user still will be well informed about error source. Signed-off-by: Karol Trzcinski --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 559767584181..a6043834b669 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -57,13 +57,13 @@ static int err_malloc(const char *key) /** log key not found error */ static int err_key_not_found(const char *key) { - return log_err(-ENOKEY, "error: '%s' not found\n", key); + return log_err(-EINVAL, "error: '%s' not found\n", key); } /** error during parsing key value, possible detailed message */ static int err_key_parse(const char *key, const char *extra_msg, ...) { - int ret = -EBADE; + int ret = -EINVAL; va_list vl; if (extra_msg) { From 3b2398a97d731333e78dbf50cf5d68dd799900ac Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 16:15:00 +0200 Subject: [PATCH 140/639] travis: Add more warnings to make command Warnings may point some fatal error in source code. Signed-off-by: Karol Trzcinski --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 28a7376b0af0..fcf01499cd9c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ jobs: - name: "Build Test" before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make' > build.sh && chmod +x build.sh + - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file From f4e01789f055a69581aba30e1ccb86eba9c0a1af Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 16:18:48 +0200 Subject: [PATCH 141/639] travis: Treat warnings as errors Then each warning message should be addressed. Signed-off-by: Karol Trzcinski --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fcf01499cd9c..7966559120db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ jobs: - name: "Build Test" before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh + - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file From 82d4767ca5776b13f968d6f409fd407c87459d1b Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Sat, 19 Sep 2020 01:11:50 +0000 Subject: [PATCH 142/639] Stop silently discarding -l option Commit https://github.com/thesofproject/soft/commits/59d81995f6828 added an -l option (for --liam? :-) which was never implemented. Remove it because silently discarding user input is really not nice no matter how wrong it is. Signed-off-by: Marc Herbert --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index cd3d63b09f2e..04a3c4797dca 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:va:s:k:l:ri:x:f:b:ec:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; From 91bd4fe796ee725700b3cf4bed66735fc05b34bc Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 23 Sep 2020 04:54:17 +0000 Subject: [PATCH 143/639] rimage.c: print an error instead of crashing when zero ELF argument Also rename elf_argc to first_non_opt because it's a position, not a count. Signed-off-by: Marc Herbert --- src/manifest.c | 3 +++ src/rimage.c | 19 ++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index d76c394154cc..f8b1f8173058 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -6,6 +6,7 @@ // Keyon Jie // Janusz Jankowski +#include #include #include #include @@ -905,6 +906,8 @@ int man_write_fw_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension - 0x480 to end */ + /* image_end is updated every time a section is added */ + assert(image->image_end > MAN_FW_DESC_OFFSET_V1_8); ri_sha256(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end - MAN_FW_DESC_OFFSET_V1_8, m->adsp_file_ext.comp_desc[0].hash); diff --git a/src/rimage.c b/src/rimage.c index 04a3c4797dca..1ea2a7fa4c87 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) struct image image; struct adsp *heap_adsp; const char *adsp_config = NULL; - int opt, ret, i, elf_argc = 0; + int opt, ret, i, first_non_opt; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; @@ -86,11 +86,12 @@ int main(int argc, char *argv[]) usage(argv[0]); break; default: + /* getopt's default error message is good enough */ break; } } - elf_argc = optind; + first_non_opt = optind; /* make sure we have an outfile and machine */ if (!image.out_file || !adsp_config) @@ -145,10 +146,18 @@ int main(int argc, char *argv[]) image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; /* parse input ELF files */ - image.num_modules = argc - elf_argc; - for (i = elf_argc; i < argc; i++) { + image.num_modules = argc - first_non_opt; + + if (image.num_modules <= 0) { + fprintf(stderr, + "error: requires at least one ELF input module\n"); + return -EINVAL; + } + + /* getopt reorders argv[] */ + for (i = first_non_opt; i < argc; i++) { fprintf(stdout, "\nModule Reading %s\n", argv[i]); - ret = elf_parse_module(&image, i - elf_argc, argv[i]); + ret = elf_parse_module(&image, i - first_non_opt, argv[i]); if (ret < 0) goto out; } From 75f96956e05e8fe3da305e22f5b27d5bd5e5d1c5 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 23 Sep 2020 04:57:25 +0000 Subject: [PATCH 144/639] elf.c: check ELF32-LE magic number instead of crashing Passing a 64 bits ELF file by accident (for instance: '/usr/bin/openssl' while messing up the command line options) caused an interesting cascade of errors and memory corruption which are all caught in this commit. This doesn't make rimage fuzz-proof far from it; only fool-proof which is still useful. In passing add some quotes so the error message when failing to find the SHT_NULL section with an empty name is a little bit more readable. Signed-off-by: Marc Herbert --- src/elf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/elf.c b/src/elf.c index f53adcd75441..fc9232b66578 100644 --- a/src/elf.c +++ b/src/elf.c @@ -5,6 +5,7 @@ // Author: Liam Girdwood // Keyon Jie +#include #include #include #include @@ -29,7 +30,7 @@ static int elf_read_sections(struct image *image, struct module *module, } /* allocate space for each section header */ - section = calloc(sizeof(Elf32_Shdr), hdr->shnum); + section = calloc(hdr->shnum, sizeof(Elf32_Shdr)); if (!section) return -ENOMEM; module->section = section; @@ -43,6 +44,7 @@ static int elf_read_sections(struct image *image, struct module *module, } /* read in strings */ + assert(hdr->shstrndx < count); module->strings = calloc(1, section[hdr->shstrndx].size); if (!module->strings) { fprintf(stderr, "error: failed %s to read ELF strings for %d\n", @@ -201,6 +203,11 @@ static int elf_read_hdr(struct image *image, struct module *module) return -errno; } + if (strncmp((char *)hdr->ident, "\177ELF\001\001", 5)) { + fprintf(stderr, "Not a 32 bits ELF-LE file\n"); + return -EINVAL; + } + if (!image->verbose) return 0; @@ -513,8 +520,8 @@ int elf_find_section(const struct module *module, const char *name) } } - fprintf(stderr, "warning: can't find section %s in module %s\n", name, - module->elf_file); + fprintf(stderr, "warning: can't find section named '%s' in module %s\n", + name, module->elf_file); ret = -EINVAL; out: From e67d68e8e1ea34f2c434ccba21c9609fac8c5989 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 23 Sep 2020 05:03:30 +0000 Subject: [PATCH 145/639] adsp_config.c: actually check error when parsing "version" array elements Caveat: this was just reported by valgrind. I did not test any actual toml parsing error either (who tests error handling?) but this code can't be worse than the previous one. Signed-off-by: Marc Herbert --- src/adsp_config.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index a6043834b669..d2269b818a43 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1565,11 +1565,15 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) /* parse "version" array elements */ for (i = 0; i < ARRAY_SIZE(manifest_version); ++i) { raw = toml_raw_at(arr, i); - if (ret < 0) + if (raw == 0) { ret = err_key_parse("version", NULL); + goto error; + } ret = toml_rtoi(raw, &manifest_version[i]); - if (ret < 0) + if (ret < 0) { ret = err_key_parse("version", "can't convert element to integer"); + goto error; + } } /* parsing function depends on manifest_version */ From e29baaa8b9dc90fcff9b8914b1d0ac2768474b54 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Wed, 23 Sep 2020 07:59:39 +0200 Subject: [PATCH 146/639] travis: Use $(...) instead `...` in bash scripts It's encouraged to use version with $(...). Backtick command substitution `...` is legacy syntax with several issues. 1. It has a series of undefined behaviors related to quoting in POSIX. 2. It imposes a custom escaping mode with surprising results. 3. It's exceptionally hard to nest. ~https://github.com/koalaman/shellcheck/wiki/SC2006 Signed-off-by: Karol Trzcinski --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7966559120db..e266ad50ce44 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,4 @@ jobs: before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof script: - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - - docker run -i -t -v `pwd`:/home/sof/work/sof.git --user `id -u` sof ./build.sh \ No newline at end of file + - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh From fccf52133104987d9a532e6a9c332ba5c7a1bd91 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski Date: Tue, 22 Sep 2020 10:49:43 +0200 Subject: [PATCH 147/639] travis: Scan patch codestyle Checkpatch is a tool which checks patch code style alignment with Linux kernel code. By the way print short graphs of used commits, to show whats under test. Checkpatch call is precede by `set -x`, to show used arguments values, especially checked commits range. Signed-off-by: Karol Trzcinski --- .travis.yml | 7 + scripts/checkpatch.pl | 6845 ++++++++++++++++++++++++++++++ scripts/const_structs.checkpatch | 0 scripts/spelling.txt | 1254 ++++++ 4 files changed, 8106 insertions(+) create mode 100755 scripts/checkpatch.pl create mode 100644 scripts/const_structs.checkpatch create mode 100644 scripts/spelling.txt diff --git a/.travis.yml b/.travis.yml index e266ad50ce44..d89521056ee9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,10 @@ jobs: script: - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh + - name: checkpatch + before_install: + - sudo apt-get -y install codespell + script: + - git --no-pager log --oneline --graph --decorate --max-count=5 + - git --no-pager log --oneline --graph --decorate --max-count=5 "${TRAVIS_BRANCH}" + - (set -x; scripts/checkpatch.pl --no-tree --strict --codespell --no-signoff -g ${TRAVIS_COMMIT_RANGE/.../..}) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl new file mode 100755 index 000000000000..ce33a3b0ac98 --- /dev/null +++ b/scripts/checkpatch.pl @@ -0,0 +1,6845 @@ +#!/usr/bin/env perl +# SPDX-License-Identifier: GPL-2.0 +# +# (c) 2001, Dave Jones. (the file handling bit) +# (c) 2005, Joel Schopp (the ugly bit) +# (c) 2007,2008, Andy Whitcroft (new conditions, test suite) +# (c) 2008-2010 Andy Whitcroft +# (c) 2010-2018 Joe Perches + +use strict; +use warnings; +use POSIX; +use File::Basename; +use Cwd 'abs_path'; +use Term::ANSIColor qw(:constants); +use Encode qw(decode encode); + +my $P = $0; +my $D = dirname(abs_path($P)); + +my $V = '0.32'; + +use Getopt::Long qw(:config no_auto_abbrev); + +my $SOF = 1; # enables SOF-specific behaviour +my $quiet = 0; +my $tree = 1; +my $chk_signoff = 1; +my $chk_patch = 1; +my $tst_only; +my $emacs = 0; +my $terse = 0; +my $showfile = 0; +my $file = 0; +my $git = 0; +my %git_commits = (); +my $check = 0; +my $check_orig = 0; +my $summary = 1; +my $mailback = 0; +my $summary_file = 0; +my $show_types = 0; +my $list_types = 0; +my $fix = 0; +my $fix_inplace = 0; +my $root; +my %debug; +my %camelcase = (); +my %use_type = (); +my @use = (); +my %ignore_type = (); +my @ignore = (); +my $help = 0; +my $configuration_file = ".checkpatch.conf"; +my $max_line_length = 100; +my $ignore_perl_version = 0; +my $minimum_perl_version = 5.10.0; +my $min_conf_desc_length = 4; +my $spelling_file = "$D/spelling.txt"; +my $codespell = 0; +my $codespellfile = "/usr/share/codespell/dictionary.txt"; +my $conststructsfile = "$D/const_structs.checkpatch"; +my $typedefsfile = ""; +my $color = "auto"; +my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE +# git output parsing needs US English output, so first set backtick child process LANGUAGE +my $git_command ='export LANGUAGE=en_US.UTF-8; git'; + +sub help { + my ($exitcode) = @_; + + print << "EOM"; +Usage: $P [OPTION]... [FILE]... +Version: $V + +Options: + -q, --quiet quiet + --no-tree run without a kernel tree + --no-signoff do not check for 'Signed-off-by' line + --patch treat FILE as patchfile (default) + --emacs emacs compile window format + --terse one line per report + --showfile emit diffed file position, not input file position + -g, --git treat FILE as a single commit or git revision range + single git commit with: + + ^ + ~n + multiple git commits with: + .. + ... + - + git merges are ignored + -f, --file treat FILE as regular source file + --subjective, --strict enable more subjective tests + --list-types list the possible message types + --types TYPE(,TYPE2...) show only these comma separated message types + --ignore TYPE(,TYPE2...) ignore various comma separated message types + --show-types show the specific message type in the output + --max-line-length=n set the maximum line length, (default $max_line_length) + if exceeded, warn on patches + requires --strict for use with --file + --min-conf-desc-length=n set the min description length, if shorter, warn + --root=PATH PATH to the kernel tree root + --no-summary suppress the per-file summary + --mailback only produce a report in case of warnings/errors + --summary-file include the filename in summary + --debug KEY=[0|1] turn on/off debugging of KEY, where KEY is one of + 'values', 'possible', 'type', and 'attr' (default + is all off) + --test-only=WORD report only warnings/errors containing WORD + literally + --fix EXPERIMENTAL - may create horrible results + If correctable single-line errors exist, create + ".EXPERIMENTAL-checkpatch-fixes" + with potential errors corrected to the preferred + checkpatch style + --fix-inplace EXPERIMENTAL - may create horrible results + Is the same as --fix, but overwrites the input + file. It's your fault if there's no backup or git + --ignore-perl-version override checking of perl version. expect + runtime errors. + --codespell Use the codespell dictionary for spelling/typos + (default:/usr/share/codespell/dictionary.txt) + --codespellfile Use this codespell dictionary + --typedefsfile Read additional types from this file + --color[=WHEN] Use colors 'always', 'never', or only when output + is a terminal ('auto'). Default is 'auto'. + -h, --help, --version display this help and exit + +When FILE is - read standard input. +EOM + + exit($exitcode); +} + +sub uniq { + my %seen; + return grep { !$seen{$_}++ } @_; +} + +sub list_types { + my ($exitcode) = @_; + + my $count = 0; + + local $/ = undef; + + open(my $script, '<', abs_path($P)) or + die "$P: Can't read '$P' $!\n"; + + my $text = <$script>; + close($script); + + my @types = (); + # Also catch when type or level is passed through a variable + for ($text =~ /(?:(?:\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) { + push (@types, $_); + } + @types = sort(uniq(@types)); + print("#\tMessage type\n\n"); + foreach my $type (@types) { + print(++$count . "\t" . $type . "\n"); + } + + exit($exitcode); +} + +my $conf = which_conf($configuration_file); +if (-f $conf) { + my @conf_args; + open(my $conffile, '<', "$conf") + or warn "$P: Can't find a readable $configuration_file file $!\n"; + + while (<$conffile>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + $line =~ s/\s+/ /g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + + my @words = split(" ", $line); + foreach my $word (@words) { + last if ($word =~ m/^#/); + push (@conf_args, $word); + } + } + close($conffile); + unshift(@ARGV, @conf_args) if @conf_args; +} + +# Perl's Getopt::Long allows options to take optional arguments after a space. +# Prevent --color by itself from consuming other arguments +foreach (@ARGV) { + if ($_ eq "--color" || $_ eq "-color") { + $_ = "--color=$color"; + } +} + +GetOptions( + 'q|quiet+' => \$quiet, + 'tree!' => \$tree, + 'signoff!' => \$chk_signoff, + 'patch!' => \$chk_patch, + 'emacs!' => \$emacs, + 'terse!' => \$terse, + 'showfile!' => \$showfile, + 'f|file!' => \$file, + 'g|git!' => \$git, + 'subjective!' => \$check, + 'strict!' => \$check, + 'ignore=s' => \@ignore, + 'types=s' => \@use, + 'show-types!' => \$show_types, + 'list-types!' => \$list_types, + 'max-line-length=i' => \$max_line_length, + 'min-conf-desc-length=i' => \$min_conf_desc_length, + 'root=s' => \$root, + 'summary!' => \$summary, + 'mailback!' => \$mailback, + 'summary-file!' => \$summary_file, + 'fix!' => \$fix, + 'fix-inplace!' => \$fix_inplace, + 'ignore-perl-version!' => \$ignore_perl_version, + 'debug=s' => \%debug, + 'test-only=s' => \$tst_only, + 'codespell!' => \$codespell, + 'codespellfile=s' => \$codespellfile, + 'typedefsfile=s' => \$typedefsfile, + 'color=s' => \$color, + 'no-color' => \$color, #keep old behaviors of -nocolor + 'nocolor' => \$color, #keep old behaviors of -nocolor + 'h|help' => \$help, + 'version' => \$help +) or help(1); + +help(0) if ($help); + +list_types(0) if ($list_types); + +$fix = 1 if ($fix_inplace); +$check_orig = $check; + +my $exit = 0; + +my $perl_version_ok = 1; +if ($^V && $^V lt $minimum_perl_version) { + $perl_version_ok = 0; + printf "$P: requires at least perl version %vd\n", $minimum_perl_version; + exit(1) if (!$ignore_perl_version); +} + +#if no filenames are given, push '-' to read patch from stdin +if ($#ARGV < 0) { + push(@ARGV, '-'); +} + +if ($color =~ /^[01]$/) { + $color = !$color; +} elsif ($color =~ /^always$/i) { + $color = 1; +} elsif ($color =~ /^never$/i) { + $color = 0; +} elsif ($color =~ /^auto$/i) { + $color = (-t STDOUT); +} else { + die "Invalid color mode: $color\n"; +} + +sub hash_save_array_words { + my ($hashRef, $arrayRef) = @_; + + my @array = split(/,/, join(',', @$arrayRef)); + foreach my $word (@array) { + $word =~ s/\s*\n?$//g; + $word =~ s/^\s*//g; + $word =~ s/\s+/ /g; + $word =~ tr/[a-z]/[A-Z]/; + + next if ($word =~ m/^\s*#/); + next if ($word =~ m/^\s*$/); + + $hashRef->{$word}++; + } +} + +sub hash_show_words { + my ($hashRef, $prefix) = @_; + + if (keys %$hashRef) { + print "\nNOTE: $prefix message types:"; + foreach my $word (sort keys %$hashRef) { + print " $word"; + } + print "\n"; + } +} + +hash_save_array_words(\%ignore_type, \@ignore); +hash_save_array_words(\%use_type, \@use); + +my $dbg_values = 0; +my $dbg_possible = 0; +my $dbg_type = 0; +my $dbg_attr = 0; +for my $key (keys %debug) { + ## no critic + eval "\${dbg_$key} = '$debug{$key}';"; + die "$@" if ($@); +} + +my $rpt_cleaners = 0; + +if ($terse) { + $emacs = 1; + $quiet++; +} + +if ($tree) { + if (defined $root) { + if (!top_of_kernel_tree($root)) { + die "$P: $root: --root does not point at a valid tree\n"; + } + } else { + if (top_of_kernel_tree('.')) { + $root = '.'; + } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && + top_of_kernel_tree($1)) { + $root = $1; + } + } + + if (!defined $root) { + print "Must be run from the top-level dir. of a kernel tree\n"; + exit(2); + } +} + +my $emitted_corrupt = 0; + +our $Ident = qr{ + [A-Za-z_][A-Za-z\d_]* + (?:\s*\#\#\s*[A-Za-z_][A-Za-z\d_]*)* + }x; +our $Storage = qr{extern|static|asmlinkage}; +our $Sparse = qr{ + __user| + __kernel| + __force| + __iomem| + __must_check| + __kprobes| + __ref| + __refconst| + __refdata| + __rcu| + __private + }x; +our $InitAttributePrefix = qr{__(?:mem|cpu|dev|net_|)}; +our $InitAttributeData = qr{$InitAttributePrefix(?:initdata\b)}; +our $InitAttributeConst = qr{$InitAttributePrefix(?:initconst\b)}; +our $InitAttributeInit = qr{$InitAttributePrefix(?:init\b)}; +our $InitAttribute = qr{$InitAttributeData|$InitAttributeConst|$InitAttributeInit}; + +# Notes to $Attribute: +# We need \b after 'init' otherwise 'initconst' will cause a false positive in a check +our $Attribute = qr{ + const| + __percpu| + __nocast| + __safe| + __bitwise| + __packed__| + __packed2__| + __naked| + __maybe_unused| + __always_unused| + __noreturn| + __used| + __cold| + __pure| + __noclone| + __deprecated| + __read_mostly| + __ro_after_init| + __kprobes| + $InitAttribute| + ____cacheline_aligned| + ____cacheline_aligned_in_smp| + ____cacheline_internodealigned_in_smp| + __weak + }x; +our $Modifier; +our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__}; +our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; +our $Lval = qr{$Ident(?:$Member)*}; + +our $Int_type = qr{(?i)llu|ull|ll|lu|ul|l|u}; +our $Binary = qr{(?i)0b[01]+$Int_type?}; +our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; +our $Int = qr{[0-9]+$Int_type?}; +our $Octal = qr{0[0-7]+$Int_type?}; +our $String = qr{"[X\t]*"}; +our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; +our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; +our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; +our $Float = qr{$Float_hex|$Float_dec|$Float_int}; +our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; +our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; +our $Compare = qr{<=|>=|==|!=|<|(?}; +our $Arithmetic = qr{\+|-|\*|\/|%}; +our $Operators = qr{ + <=|>=|==|!=| + =>|->|<<|>>|<|>|!|~| + &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic + }x; + +our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x; + +our $BasicType; +our $NonptrType; +our $NonptrTypeMisordered; +our $NonptrTypeWithAttr; +our $Type; +our $TypeMisordered; +our $Declare; +our $DeclareMisordered; + +our $NON_ASCII_UTF8 = qr{ + [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte + | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs + | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte + | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates + | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 + | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 + | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 +}x; + +our $UTF8 = qr{ + [\x09\x0A\x0D\x20-\x7E] # ASCII + | $NON_ASCII_UTF8 +}x; + +our $typeC99Typedefs = qr{(?:__)?(?:[us]_?)?int_?(?:8|16|32|64)_t}; +our $typeOtherOSTypedefs = qr{(?x: + u_(?:char|short|int|long) | # bsd + u(?:nchar|short|int|long) # sysv +)}; +our $typeKernelTypedefs = qr{(?x: + (?:__)?(?:u|s|be|le)(?:8|16|32|64)| + atomic_t +)}; +our $typeTypedefs = qr{(?x: + $typeC99Typedefs\b| + $typeOtherOSTypedefs\b| + $typeKernelTypedefs\b +)}; + +our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; + +our $logFunctions = qr{(?x: + printk(?:_ratelimited|_once|_deferred_once|_deferred|)| + (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| + TP_printk| + WARN(?:_RATELIMIT|_ONCE|)| + panic| + MODULE_[A-Z_]+| + seq_vprintf|seq_printf|seq_puts| + trace[a-z_]+ +)}; + +our $allocFunctions = qr{(?x: + (?:(?:devm_)? + (?:kv|k|v)[czm]alloc(?:_node|_array)? | + kstrdup(?:_const)? | + kmemdup(?:_nul)?) | + (?:\w+)?alloc_skb(?:ip_align)? | + # dev_alloc_skb/netdev_alloc_skb, et al + dma_alloc_coherent +)}; + +our $signature_tags = qr{(?xi: + Signed-off-by:| + Co-developed-by:| + Acked-by:| + Tested-by:| + Reviewed-by:| + Reported-by:| + Suggested-by:| + To:| + Cc: +)}; + +our @typeListMisordered = ( + qr{char\s+(?:un)?signed}, + qr{int\s+(?:(?:un)?signed\s+)?short\s}, + qr{int\s+short(?:\s+(?:un)?signed)}, + qr{short\s+int(?:\s+(?:un)?signed)}, + qr{(?:un)?signed\s+int\s+short}, + qr{short\s+(?:un)?signed}, + qr{long\s+int\s+(?:un)?signed}, + qr{int\s+long\s+(?:un)?signed}, + qr{long\s+(?:un)?signed\s+int}, + qr{int\s+(?:un)?signed\s+long}, + qr{int\s+(?:un)?signed}, + qr{int\s+long\s+long\s+(?:un)?signed}, + qr{long\s+long\s+int\s+(?:un)?signed}, + qr{long\s+long\s+(?:un)?signed\s+int}, + qr{long\s+long\s+(?:un)?signed}, + qr{long\s+(?:un)?signed}, +); + +our @typeList = ( + qr{void}, + qr{(?:(?:un)?signed\s+)?char}, + qr{(?:(?:un)?signed\s+)?short\s+int}, + qr{(?:(?:un)?signed\s+)?short}, + qr{(?:(?:un)?signed\s+)?int}, + qr{(?:(?:un)?signed\s+)?long\s+int}, + qr{(?:(?:un)?signed\s+)?long\s+long\s+int}, + qr{(?:(?:un)?signed\s+)?long\s+long}, + qr{(?:(?:un)?signed\s+)?long}, + qr{(?:un)?signed}, + qr{float}, + qr{double}, + qr{bool}, + qr{struct\s+$Ident}, + qr{union\s+$Ident}, + qr{enum\s+$Ident}, + qr{${Ident}_t}, + qr{${Ident}_handler}, + qr{${Ident}_handler_fn}, + @typeListMisordered, +); + +our $C90_int_types = qr{(?x: + long\s+long\s+int\s+(?:un)?signed| + long\s+long\s+(?:un)?signed\s+int| + long\s+long\s+(?:un)?signed| + (?:(?:un)?signed\s+)?long\s+long\s+int| + (?:(?:un)?signed\s+)?long\s+long| + int\s+long\s+long\s+(?:un)?signed| + int\s+(?:(?:un)?signed\s+)?long\s+long| + + long\s+int\s+(?:un)?signed| + long\s+(?:un)?signed\s+int| + long\s+(?:un)?signed| + (?:(?:un)?signed\s+)?long\s+int| + (?:(?:un)?signed\s+)?long| + int\s+long\s+(?:un)?signed| + int\s+(?:(?:un)?signed\s+)?long| + + int\s+(?:un)?signed| + (?:(?:un)?signed\s+)?int +)}; + +our @typeListFile = (); +our @typeListWithAttr = ( + @typeList, + qr{struct\s+$InitAttribute\s+$Ident}, + qr{union\s+$InitAttribute\s+$Ident}, +); + +our @modifierList = ( + qr{fastcall}, +); +our @modifierListFile = (); + +our @mode_permission_funcs = ( + ["module_param", 3], + ["module_param_(?:array|named|string)", 4], + ["module_param_array_named", 5], + ["debugfs_create_(?:file|u8|u16|u32|u64|x8|x16|x32|x64|size_t|atomic_t|bool|blob|regset32|u32_array)", 2], + ["proc_create(?:_data|)", 2], + ["(?:CLASS|DEVICE|SENSOR|SENSOR_DEVICE|IIO_DEVICE)_ATTR", 2], + ["IIO_DEV_ATTR_[A-Z_]+", 1], + ["SENSOR_(?:DEVICE_|)ATTR_2", 2], + ["SENSOR_TEMPLATE(?:_2|)", 3], + ["__ATTR", 2], +); + +#Create a search pattern for all these functions to speed up a loop below +our $mode_perms_search = ""; +foreach my $entry (@mode_permission_funcs) { + $mode_perms_search .= '|' if ($mode_perms_search ne ""); + $mode_perms_search .= $entry->[0]; +} +$mode_perms_search = "(?:${mode_perms_search})"; + +our %deprecated_apis = ( + "synchronize_rcu_bh" => "synchronize_rcu", + "synchronize_rcu_bh_expedited" => "synchronize_rcu_expedited", + "call_rcu_bh" => "call_rcu", + "rcu_barrier_bh" => "rcu_barrier", + "synchronize_sched" => "synchronize_rcu", + "synchronize_sched_expedited" => "synchronize_rcu_expedited", + "call_rcu_sched" => "call_rcu", + "rcu_barrier_sched" => "rcu_barrier", + "get_state_synchronize_sched" => "get_state_synchronize_rcu", + "cond_synchronize_sched" => "cond_synchronize_rcu", +); + +#Create a search pattern for all these strings to speed up a loop below +our $deprecated_apis_search = ""; +foreach my $entry (keys %deprecated_apis) { + $deprecated_apis_search .= '|' if ($deprecated_apis_search ne ""); + $deprecated_apis_search .= $entry; +} +$deprecated_apis_search = "(?:${deprecated_apis_search})"; + +our $mode_perms_world_writable = qr{ + S_IWUGO | + S_IWOTH | + S_IRWXUGO | + S_IALLUGO | + 0[0-7][0-7][2367] +}x; + +our %mode_permission_string_types = ( + "S_IRWXU" => 0700, + "S_IRUSR" => 0400, + "S_IWUSR" => 0200, + "S_IXUSR" => 0100, + "S_IRWXG" => 0070, + "S_IRGRP" => 0040, + "S_IWGRP" => 0020, + "S_IXGRP" => 0010, + "S_IRWXO" => 0007, + "S_IROTH" => 0004, + "S_IWOTH" => 0002, + "S_IXOTH" => 0001, + "S_IRWXUGO" => 0777, + "S_IRUGO" => 0444, + "S_IWUGO" => 0222, + "S_IXUGO" => 0111, +); + +#Create a search pattern for all these strings to speed up a loop below +our $mode_perms_string_search = ""; +foreach my $entry (keys %mode_permission_string_types) { + $mode_perms_string_search .= '|' if ($mode_perms_string_search ne ""); + $mode_perms_string_search .= $entry; +} +our $single_mode_perms_string_search = "(?:${mode_perms_string_search})"; +our $multi_mode_perms_string_search = qr{ + ${single_mode_perms_string_search} + (?:\s*\|\s*${single_mode_perms_string_search})* +}x; + +sub perms_to_octal { + my ($string) = @_; + + return trim($string) if ($string =~ /^\s*0[0-7]{3,3}\s*$/); + + my $val = ""; + my $oval = ""; + my $to = 0; + my $curpos = 0; + my $lastpos = 0; + while ($string =~ /\b(($single_mode_perms_string_search)\b(?:\s*\|\s*)?\s*)/g) { + $curpos = pos($string); + my $match = $2; + my $omatch = $1; + last if ($lastpos > 0 && ($curpos - length($omatch) != $lastpos)); + $lastpos = $curpos; + $to |= $mode_permission_string_types{$match}; + $val .= '\s*\|\s*' if ($val ne ""); + $val .= $match; + $oval .= $omatch; + } + $oval =~ s/^\s*\|\s*//; + $oval =~ s/\s*\|\s*$//; + return sprintf("%04o", $to); +} + +our $allowed_asm_includes = qr{(?x: + irq| + memory| + time| + reboot +)}; +# memory.h: ARM has a custom one + +# Load common spelling mistakes and build regular expression list. +my $misspellings; +my %spelling_fix; + +if (open(my $spelling, '<', $spelling_file)) { + while (<$spelling>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + + my ($suspect, $fix) = split(/\|\|/, $line); + + $spelling_fix{$suspect} = $fix; + } + close($spelling); +} else { + warn "No typos will be found - file '$spelling_file': $!\n"; +} + +if ($codespell) { + if (open(my $spelling, '<', $codespellfile)) { + while (<$spelling>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + next if ($line =~ m/, disabled/i); + + $line =~ s/,.*$//; + + my ($suspect, $fix) = split(/->/, $line); + + $spelling_fix{$suspect} = $fix; + } + close($spelling); + } else { + warn "No codespell typos will be found - file '$codespellfile': $!\n"; + } +} + +$misspellings = join("|", sort keys %spelling_fix) if keys %spelling_fix; + +sub read_words { + my ($wordsRef, $file) = @_; + + if (open(my $words, '<', $file)) { + while (<$words>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + if ($line =~ /\s/) { + print("$file: '$line' invalid - ignored\n"); + next; + } + + $$wordsRef .= '|' if ($$wordsRef ne ""); + $$wordsRef .= $line; + } + close($file); + return 1; + } + + return 0; +} + +my $const_structs = ""; +read_words(\$const_structs, $conststructsfile) + or warn "No structs that should be const will be found - file '$conststructsfile': $!\n"; + +my $typeOtherTypedefs = ""; +if (length($typedefsfile)) { + read_words(\$typeOtherTypedefs, $typedefsfile) + or warn "No additional types will be considered - file '$typedefsfile': $!\n"; +} +$typeTypedefs .= '|' . $typeOtherTypedefs if ($typeOtherTypedefs ne ""); + +sub build_types { + my $mods = "(?x: \n" . join("|\n ", (@modifierList, @modifierListFile)) . "\n)"; + my $all = "(?x: \n" . join("|\n ", (@typeList, @typeListFile)) . "\n)"; + my $Misordered = "(?x: \n" . join("|\n ", @typeListMisordered) . "\n)"; + my $allWithAttr = "(?x: \n" . join("|\n ", @typeListWithAttr) . "\n)"; + $Modifier = qr{(?:$Attribute|$Sparse|$mods)}; + $BasicType = qr{ + (?:$typeTypedefs\b)| + (?:${all}\b) + }x; + $NonptrType = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:typeof|__typeof__)\s*\([^\)]*\)| + (?:$typeTypedefs\b)| + (?:${all}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $NonptrTypeMisordered = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:${Misordered}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $NonptrTypeWithAttr = qr{ + (?:$Modifier\s+|const\s+)* + (?: + (?:typeof|__typeof__)\s*\([^\)]*\)| + (?:$typeTypedefs\b)| + (?:${allWithAttr}\b) + ) + (?:\s+$Modifier|\s+const)* + }x; + $Type = qr{ + $NonptrType + (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)? + (?:\s+$Inline|\s+$Modifier)* + }x; + $TypeMisordered = qr{ + $NonptrTypeMisordered + (?:(?:\s|\*|\[\])+\s*const|(?:\s|\*\s*(?:const\s*)?|\[\])+|(?:\s*\[\s*\])+)? + (?:\s+$Inline|\s+$Modifier)* + }x; + $Declare = qr{(?:$Storage\s+(?:$Inline\s+)?)?$Type}; + $DeclareMisordered = qr{(?:$Storage\s+(?:$Inline\s+)?)?$TypeMisordered}; +} +build_types(); + +our $Typecast = qr{\s*(\(\s*$NonptrType\s*\)){0,1}\s*}; + +# Using $balanced_parens, $LvalOrFunc, or $FuncArg +# requires at least perl version v5.10.0 +# Any use must be runtime checked with $^V + +our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/; +our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*}; +our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)}; + +our $declaration_macros = qr{(?x: + (?:$Storage\s+)?(?:[A-Z_][A-Z0-9]*_){0,2}(?:DEFINE|DECLARE)(?:_[A-Z0-9]+){1,6}\s*\(| + (?:$Storage\s+)?[HLP]?LIST_HEAD\s*\(| + (?:$Storage\s+)?${Type}\s+uninitialized_var\s*\(| + (?:SKCIPHER_REQUEST|SHASH_DESC|AHASH_REQUEST)_ON_STACK\s*\( +)}; + +sub deparenthesize { + my ($string) = @_; + return "" if (!defined($string)); + + while ($string =~ /^\s*\(.*\)\s*$/) { + $string =~ s@^\s*\(\s*@@; + $string =~ s@\s*\)\s*$@@; + } + + $string =~ s@\s+@ @g; + + return $string; +} + +sub seed_camelcase_file { + my ($file) = @_; + + return if (!(-f $file)); + + local $/; + + open(my $include_file, '<', "$file") + or warn "$P: Can't read '$file' $!\n"; + my $text = <$include_file>; + close($include_file); + + my @lines = split('\n', $text); + + foreach my $line (@lines) { + next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/); + if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[\(\[,;]/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[;\{]/) { + $camelcase{$1} = 1; + } + } +} + +sub is_maintained_obsolete { + my ($filename) = @_; + + return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl")); + + my $status = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`; + + return $status =~ /obsolete/i; +} + +sub is_SPDX_License_valid { + my ($license) = @_; + + return 1 if (!$tree || which("python") eq "" || !(-e "$root/scripts/spdxcheck.py") || !(-e "$root/.git")); + + my $root_path = abs_path($root); + my $status = `cd "$root_path"; echo "$license" | python scripts/spdxcheck.py -`; + return 0 if ($status ne ""); + return 1; +} + +my $camelcase_seeded = 0; +sub seed_camelcase_includes { + return if ($camelcase_seeded); + + my $files; + my $camelcase_cache = ""; + my @include_files = (); + + $camelcase_seeded = 1; + + if (-e ".git") { + my $git_last_include_commit = `${git_command} log --no-merges --pretty=format:"%h%n" -1 -- include`; + chomp $git_last_include_commit; + $camelcase_cache = ".checkpatch-camelcase.git.$git_last_include_commit"; + } else { + my $last_mod_date = 0; + $files = `find $root/include -name "*.h"`; + @include_files = split('\n', $files); + foreach my $file (@include_files) { + my $date = POSIX::strftime("%Y%m%d%H%M", + localtime((stat $file)[9])); + $last_mod_date = $date if ($last_mod_date < $date); + } + $camelcase_cache = ".checkpatch-camelcase.date.$last_mod_date"; + } + + if ($camelcase_cache ne "" && -f $camelcase_cache) { + open(my $camelcase_file, '<', "$camelcase_cache") + or warn "$P: Can't read '$camelcase_cache' $!\n"; + while (<$camelcase_file>) { + chomp; + $camelcase{$_} = 1; + } + close($camelcase_file); + + return; + } + + if (-e ".git") { + $files = `${git_command} ls-files "include/*.h"`; + @include_files = split('\n', $files); + } + + foreach my $file (@include_files) { + seed_camelcase_file($file); + } + + if ($camelcase_cache ne "") { + unlink glob ".checkpatch-camelcase.*"; + open(my $camelcase_file, '>', "$camelcase_cache") + or warn "$P: Can't write '$camelcase_cache' $!\n"; + foreach (sort { lc($a) cmp lc($b) } keys(%camelcase)) { + print $camelcase_file ("$_\n"); + } + close($camelcase_file); + } +} + +sub git_commit_info { + my ($commit, $id, $desc) = @_; + + return ($id, $desc) if ((which("git") eq "") || !(-e ".git")); + + my $output = `${git_command} log --no-color --format='%H %s' -1 $commit 2>&1`; + $output =~ s/^\s*//gm; + my @lines = split("\n", $output); + + return ($id, $desc) if ($#lines < 0); + + if ($lines[0] =~ /^error: short SHA1 $commit is ambiguous/) { +# Maybe one day convert this block of bash into something that returns +# all matching commit ids, but it's very slow... +# +# echo "checking commits $1..." +# git rev-list --remotes | grep -i "^$1" | +# while read line ; do +# git log --format='%H %s' -1 $line | +# echo "commit $(cut -c 1-12,41-)" +# done + } elsif ($lines[0] =~ /^fatal: ambiguous argument '$commit': unknown revision or path not in the working tree\./) { + $id = undef; + } else { + $id = substr($lines[0], 0, 12); + $desc = substr($lines[0], 41); + } + + return ($id, $desc); +} + +$chk_signoff = 0 if ($file); + +my @rawlines = (); +my @lines = (); +my @fixed = (); +my @fixed_inserted = (); +my @fixed_deleted = (); +my $fixlinenr = -1; + +# If input is git commits, extract all commits from the commit expressions. +# For example, HEAD-3 means we need check 'HEAD, HEAD~1, HEAD~2'. +die "$P: No git repository found\n" if ($git && !-e ".git"); + +if ($git) { + my @commits = (); + foreach my $commit_expr (@ARGV) { + my $git_range; + if ($commit_expr =~ m/^(.*)-(\d+)$/) { + $git_range = "-$2 $1"; + } elsif ($commit_expr =~ m/\.\./) { + $git_range = "$commit_expr"; + } else { + $git_range = "-1 $commit_expr"; + } + my $lines = `${git_command} log --no-color --no-merges --pretty=format:'%H %s' $git_range`; + foreach my $line (split(/\n/, $lines)) { + $line =~ /^([0-9a-fA-F]{40,40}) (.*)$/; + next if (!defined($1) || !defined($2)); + my $sha1 = $1; + my $subject = $2; + unshift(@commits, $sha1); + $git_commits{$sha1} = $subject; + } + } + die "$P: no git commits after extraction!\n" if (@commits == 0); + @ARGV = @commits; +} + +my $vname; +$allow_c99_comments = !defined $ignore_type{"C99_COMMENT_TOLERANCE"}; +for my $filename (@ARGV) { + my $FILE; + if ($git) { + open($FILE, '-|', "git format-patch -M --stdout -1 $filename") || + die "$P: $filename: git format-patch failed - $!\n"; + } elsif ($file) { + open($FILE, '-|', "diff -u /dev/null $filename") || + die "$P: $filename: diff failed - $!\n"; + } elsif ($filename eq '-') { + open($FILE, '<&STDIN'); + } else { + open($FILE, '<', "$filename") || + die "$P: $filename: open failed - $!\n"; + } + if ($filename eq '-') { + $vname = 'Your patch'; + } elsif ($git) { + $vname = "Commit " . substr($filename, 0, 12) . ' ("' . $git_commits{$filename} . '")'; + } else { + $vname = $filename; + } + while (<$FILE>) { + chomp; + push(@rawlines, $_); + } + close($FILE); + + if ($#ARGV > 0 && $quiet == 0) { + print '-' x length($vname) . "\n"; + print "$vname\n"; + print '-' x length($vname) . "\n"; + } + + if (!process($filename)) { + $exit = 1; + } + @rawlines = (); + @lines = (); + @fixed = (); + @fixed_inserted = (); + @fixed_deleted = (); + $fixlinenr = -1; + @modifierListFile = (); + @typeListFile = (); + build_types(); +} + +if (!$quiet) { + hash_show_words(\%use_type, "Used"); + hash_show_words(\%ignore_type, "Ignored"); + + if (!$perl_version_ok) { + print << "EOM" + +NOTE: perl $^V is not modern enough to detect all possible issues. + An upgrade to at least perl $minimum_perl_version is suggested. +EOM + } + if ($exit) { + print << "EOM" + +NOTE: If any of the errors are false positives, please report + them to the maintainer, see CHECKPATCH in MAINTAINERS. +EOM + } +} + +exit($exit); + +sub top_of_kernel_tree { + my ($root) = @_; + + my @tree_check = ( + "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile", + "README", "Documentation", "arch", "include", "drivers", + "fs", "init", "ipc", "kernel", "lib", "scripts", + ); + + if ($SOF) { + @tree_check = ( + "LICENCE", "README.md", "rimage", "tools", + "scripts", "doc", "src", "CODEOWNERS", + "CMakeLists.txt", + ); + } + + foreach my $check (@tree_check) { + if (! -e $root . '/' . $check) { + return 0; + } + } + return 1; +} + +sub parse_email { + my ($formatted_email) = @_; + + my $name = ""; + my $address = ""; + my $comment = ""; + + if ($formatted_email =~ /^(.*)<(\S+\@\S+)>(.*)$/) { + $name = $1; + $address = $2; + $comment = $3 if defined $3; + } elsif ($formatted_email =~ /^\s*<(\S+\@\S+)>(.*)$/) { + $address = $1; + $comment = $2 if defined $2; + } elsif ($formatted_email =~ /(\S+\@\S+)(.*)$/) { + $address = $1; + $comment = $2 if defined $2; + $formatted_email =~ s/\Q$address\E.*$//; + $name = $formatted_email; + $name = trim($name); + $name =~ s/^\"|\"$//g; + # If there's a name left after stripping spaces and + # leading quotes, and the address doesn't have both + # leading and trailing angle brackets, the address + # is invalid. ie: + # "joe smith joe@smith.com" bad + # "joe smith ]+>$/) { + $name = ""; + $address = ""; + $comment = ""; + } + } + + $name = trim($name); + $name =~ s/^\"|\"$//g; + $address = trim($address); + $address =~ s/^\<|\>$//g; + + if ($name =~ /[^\w \-]/i) { ##has "must quote" chars + $name =~ s/(?"; + } + + return $formatted_email; +} + +sub which { + my ($bin) = @_; + + foreach my $path (split(/:/, $ENV{PATH})) { + if (-e "$path/$bin") { + return "$path/$bin"; + } + } + + return ""; +} + +sub which_conf { + my ($conf) = @_; + + foreach my $path (split(/:/, ".:$ENV{HOME}:.scripts")) { + if (-e "$path/$conf") { + return "$path/$conf"; + } + } + + return ""; +} + +sub expand_tabs { + my ($str) = @_; + + my $res = ''; + my $n = 0; + for my $c (split(//, $str)) { + if ($c eq "\t") { + $res .= ' '; + $n++; + for (; ($n % 8) != 0; $n++) { + $res .= ' '; + } + next; + } + $res .= $c; + $n++; + } + + return $res; +} +sub copy_spacing { + (my $res = shift) =~ tr/\t/ /c; + return $res; +} + +sub line_stats { + my ($line) = @_; + + # Drop the diff line leader and expand tabs + $line =~ s/^.//; + $line = expand_tabs($line); + + # Pick the indent from the front of the line. + my ($white) = ($line =~ /^(\s*)/); + + return (length($line), length($white)); +} + +my $sanitise_quote = ''; + +sub sanitise_line_reset { + my ($in_comment) = @_; + + if ($in_comment) { + $sanitise_quote = '*/'; + } else { + $sanitise_quote = ''; + } +} +sub sanitise_line { + my ($line) = @_; + + my $res = ''; + my $l = ''; + + my $qlen = 0; + my $off = 0; + my $c; + + # Always copy over the diff marker. + $res = substr($line, 0, 1); + + for ($off = 1; $off < length($line); $off++) { + $c = substr($line, $off, 1); + + # Comments we are whacking completely including the begin + # and end, all to $;. + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '/*') { + $sanitise_quote = '*/'; + + substr($res, $off, 2, "$;$;"); + $off++; + next; + } + if ($sanitise_quote eq '*/' && substr($line, $off, 2) eq '*/') { + $sanitise_quote = ''; + substr($res, $off, 2, "$;$;"); + $off++; + next; + } + if ($sanitise_quote eq '' && substr($line, $off, 2) eq '//') { + $sanitise_quote = '//'; + + substr($res, $off, 2, $sanitise_quote); + $off++; + next; + } + + # A \ in a string means ignore the next character. + if (($sanitise_quote eq "'" || $sanitise_quote eq '"') && + $c eq "\\") { + substr($res, $off, 2, 'XX'); + $off++; + next; + } + # Regular quotes. + if ($c eq "'" || $c eq '"') { + if ($sanitise_quote eq '') { + $sanitise_quote = $c; + + substr($res, $off, 1, $c); + next; + } elsif ($sanitise_quote eq $c) { + $sanitise_quote = ''; + } + } + + #print "c<$c> SQ<$sanitise_quote>\n"; + if ($off != 0 && $sanitise_quote eq '*/' && $c ne "\t") { + substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote eq '//' && $c ne "\t") { + substr($res, $off, 1, $;); + } elsif ($off != 0 && $sanitise_quote && $c ne "\t") { + substr($res, $off, 1, 'X'); + } else { + substr($res, $off, 1, $c); + } + } + + if ($sanitise_quote eq '//') { + $sanitise_quote = ''; + } + + # The pathname on a #include may be surrounded by '<' and '>'. + if ($res =~ /^.\s*\#\s*include\s+\<(.*)\>/) { + my $clean = 'X' x length($1); + $res =~ s@\<.*\>@<$clean>@; + + # The whole of a #error is a string. + } elsif ($res =~ /^.\s*\#\s*(?:error|warning)\s+(.*)\b/) { + my $clean = 'X' x length($1); + $res =~ s@(\#\s*(?:error|warning)\s+).*@$1$clean@; + } + + if ($allow_c99_comments && $res =~ m@(//.*$)@) { + my $match = $1; + $res =~ s/\Q$match\E/"$;" x length($match)/e; + } + + return $res; +} + +sub get_quoted_string { + my ($line, $rawline) = @_; + + return "" if (!defined($line) || !defined($rawline)); + return "" if ($line !~ m/($String)/g); + return substr($rawline, $-[0], $+[0] - $-[0]); +} + +sub ctx_statement_block { + my ($linenr, $remain, $off) = @_; + my $line = $linenr - 1; + my $blk = ''; + my $soff = $off; + my $coff = $off - 1; + my $coff_set = 0; + + my $loff = 0; + + my $type = ''; + my $level = 0; + my @stack = (); + my $p; + my $c; + my $len = 0; + + my $remainder; + while (1) { + @stack = (['', 0]) if ($#stack == -1); + + #warn "CSB: blk<$blk> remain<$remain>\n"; + # If we are about to drop off the end, pull in more + # context. + if ($off >= $len) { + for (; $remain > 0; $line++) { + last if (!defined $lines[$line]); + next if ($lines[$line] =~ /^-/); + $remain--; + $loff = $len; + $blk .= $lines[$line] . "\n"; + $len = length($blk); + $line++; + last; + } + # Bail if there is no further context. + #warn "CSB: blk<$blk> off<$off> len<$len>\n"; + if ($off >= $len) { + last; + } + if ($level == 0 && substr($blk, $off) =~ /^.\s*#\s*define/) { + $level++; + $type = '#'; + } + } + $p = $c; + $c = substr($blk, $off, 1); + $remainder = substr($blk, $off); + + #warn "CSB: c<$c> type<$type> level<$level> remainder<$remainder> coff_set<$coff_set>\n"; + + # Handle nested #if/#else. + if ($remainder =~ /^#\s*(?:ifndef|ifdef|if)\s/) { + push(@stack, [ $type, $level ]); + } elsif ($remainder =~ /^#\s*(?:else|elif)\b/) { + ($type, $level) = @{$stack[$#stack - 1]}; + } elsif ($remainder =~ /^#\s*endif\b/) { + ($type, $level) = @{pop(@stack)}; + } + + # Statement ends at the ';' or a close '}' at the + # outermost level. + if ($level == 0 && $c eq ';') { + last; + } + + # An else is really a conditional as long as its not else if + if ($level == 0 && $coff_set == 0 && + (!defined($p) || $p =~ /(?:\s|\}|\+)/) && + $remainder =~ /^(else)(?:\s|{)/ && + $remainder !~ /^else\s+if\b/) { + $coff = $off + length($1) - 1; + $coff_set = 1; + #warn "CSB: mark coff<$coff> soff<$soff> 1<$1>\n"; + #warn "[" . substr($blk, $soff, $coff - $soff + 1) . "]\n"; + } + + if (($type eq '' || $type eq '(') && $c eq '(') { + $level++; + $type = '('; + } + if ($type eq '(' && $c eq ')') { + $level--; + $type = ($level != 0)? '(' : ''; + + if ($level == 0 && $coff < $soff) { + $coff = $off; + $coff_set = 1; + #warn "CSB: mark coff<$coff>\n"; + } + } + if (($type eq '' || $type eq '{') && $c eq '{') { + $level++; + $type = '{'; + } + if ($type eq '{' && $c eq '}') { + $level--; + $type = ($level != 0)? '{' : ''; + + if ($level == 0) { + if (substr($blk, $off + 1, 1) eq ';') { + $off++; + } + last; + } + } + # Preprocessor commands end at the newline unless escaped. + if ($type eq '#' && $c eq "\n" && $p ne "\\") { + $level--; + $type = ''; + $off++; + last; + } + $off++; + } + # We are truly at the end, so shuffle to the next line. + if ($off == $len) { + $loff = $len + 1; + $line++; + $remain--; + } + + my $statement = substr($blk, $soff, $off - $soff + 1); + my $condition = substr($blk, $soff, $coff - $soff + 1); + + #warn "STATEMENT<$statement>\n"; + #warn "CONDITION<$condition>\n"; + + #print "coff<$coff> soff<$off> loff<$loff>\n"; + + return ($statement, $condition, + $line, $remain + 1, $off - $loff + 1, $level); +} + +sub statement_lines { + my ($stmt) = @_; + + # Strip the diff line prefixes and rip blank lines at start and end. + $stmt =~ s/(^|\n)./$1/g; + $stmt =~ s/^\s*//; + $stmt =~ s/\s*$//; + + my @stmt_lines = ($stmt =~ /\n/g); + + return $#stmt_lines + 2; +} + +sub statement_rawlines { + my ($stmt) = @_; + + my @stmt_lines = ($stmt =~ /\n/g); + + return $#stmt_lines + 2; +} + +sub statement_block_size { + my ($stmt) = @_; + + $stmt =~ s/(^|\n)./$1/g; + $stmt =~ s/^\s*{//; + $stmt =~ s/}\s*$//; + $stmt =~ s/^\s*//; + $stmt =~ s/\s*$//; + + my @stmt_lines = ($stmt =~ /\n/g); + my @stmt_statements = ($stmt =~ /;/g); + + my $stmt_lines = $#stmt_lines + 2; + my $stmt_statements = $#stmt_statements + 1; + + if ($stmt_lines > $stmt_statements) { + return $stmt_lines; + } else { + return $stmt_statements; + } +} + +sub ctx_statement_full { + my ($linenr, $remain, $off) = @_; + my ($statement, $condition, $level); + + my (@chunks); + + # Grab the first conditional/block pair. + ($statement, $condition, $linenr, $remain, $off, $level) = + ctx_statement_block($linenr, $remain, $off); + #print "F: c<$condition> s<$statement> remain<$remain>\n"; + push(@chunks, [ $condition, $statement ]); + if (!($remain > 0 && $condition =~ /^\s*(?:\n[+-])?\s*(?:if|else|do)\b/s)) { + return ($level, $linenr, @chunks); + } + + # Pull in the following conditional/block pairs and see if they + # could continue the statement. + for (;;) { + ($statement, $condition, $linenr, $remain, $off, $level) = + ctx_statement_block($linenr, $remain, $off); + #print "C: c<$condition> s<$statement> remain<$remain>\n"; + last if (!($remain > 0 && $condition =~ /^(?:\s*\n[+-])*\s*(?:else|do)\b/s)); + #print "C: push\n"; + push(@chunks, [ $condition, $statement ]); + } + + return ($level, $linenr, @chunks); +} + +sub ctx_block_get { + my ($linenr, $remain, $outer, $open, $close, $off) = @_; + my $line; + my $start = $linenr - 1; + my $blk = ''; + my @o; + my @c; + my @res = (); + + my $level = 0; + my @stack = ($level); + for ($line = $start; $remain > 0; $line++) { + next if ($rawlines[$line] =~ /^-/); + $remain--; + + $blk .= $rawlines[$line]; + + # Handle nested #if/#else. + if ($lines[$line] =~ /^.\s*#\s*(?:ifndef|ifdef|if)\s/) { + push(@stack, $level); + } elsif ($lines[$line] =~ /^.\s*#\s*(?:else|elif)\b/) { + $level = $stack[$#stack - 1]; + } elsif ($lines[$line] =~ /^.\s*#\s*endif\b/) { + $level = pop(@stack); + } + + foreach my $c (split(//, $lines[$line])) { + ##print "C<$c>L<$level><$open$close>O<$off>\n"; + if ($off > 0) { + $off--; + next; + } + + if ($c eq $close && $level > 0) { + $level--; + last if ($level == 0); + } elsif ($c eq $open) { + $level++; + } + } + + if (!$outer || $level <= 1) { + push(@res, $rawlines[$line]); + } + + last if ($level == 0); + } + + return ($level, @res); +} +sub ctx_block_outer { + my ($linenr, $remain) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 1, '{', '}', 0); + return @r; +} +sub ctx_block { + my ($linenr, $remain) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 0, '{', '}', 0); + return @r; +} +sub ctx_statement { + my ($linenr, $remain, $off) = @_; + + my ($level, @r) = ctx_block_get($linenr, $remain, 0, '(', ')', $off); + return @r; +} +sub ctx_block_level { + my ($linenr, $remain) = @_; + + return ctx_block_get($linenr, $remain, 0, '{', '}', 0); +} +sub ctx_statement_level { + my ($linenr, $remain, $off) = @_; + + return ctx_block_get($linenr, $remain, 0, '(', ')', $off); +} + +sub ctx_locate_comment { + my ($first_line, $end_line) = @_; + + # Catch a comment on the end of the line itself. + my ($current_comment) = ($rawlines[$end_line - 1] =~ m@.*(/\*.*\*/)\s*(?:\\\s*)?$@); + return $current_comment if (defined $current_comment); + + # Look through the context and try and figure out if there is a + # comment. + my $in_comment = 0; + $current_comment = ''; + for (my $linenr = $first_line; $linenr < $end_line; $linenr++) { + my $line = $rawlines[$linenr - 1]; + #warn " $line\n"; + if ($linenr == $first_line and $line =~ m@^.\s*\*@) { + $in_comment = 1; + } + if ($line =~ m@/\*@) { + $in_comment = 1; + } + if (!$in_comment && $current_comment ne '') { + $current_comment = ''; + } + $current_comment .= $line . "\n" if ($in_comment); + if ($line =~ m@\*/@) { + $in_comment = 0; + } + } + + chomp($current_comment); + return($current_comment); +} +sub ctx_has_comment { + my ($first_line, $end_line) = @_; + my $cmt = ctx_locate_comment($first_line, $end_line); + + ##print "LINE: $rawlines[$end_line - 1 ]\n"; + ##print "CMMT: $cmt\n"; + + return ($cmt ne ''); +} + +sub raw_line { + my ($linenr, $cnt) = @_; + + my $offset = $linenr - 1; + $cnt++; + + my $line; + while ($cnt) { + $line = $rawlines[$offset++]; + next if (defined($line) && $line =~ /^-/); + $cnt--; + } + + return $line; +} + +sub get_stat_real { + my ($linenr, $lc) = @_; + + my $stat_real = raw_line($linenr, 0); + for (my $count = $linenr + 1; $count <= $lc; $count++) { + $stat_real = $stat_real . "\n" . raw_line($count, 0); + } + + return $stat_real; +} + +sub get_stat_here { + my ($linenr, $cnt, $here) = @_; + + my $herectx = $here . "\n"; + for (my $n = 0; $n < $cnt; $n++) { + $herectx .= raw_line($linenr, $n) . "\n"; + } + + return $herectx; +} + +sub cat_vet { + my ($vet) = @_; + my ($res, $coded); + + $res = ''; + while ($vet =~ /([^[:cntrl:]]*)([[:cntrl:]]|$)/g) { + $res .= $1; + if ($2 ne '') { + $coded = sprintf("^%c", unpack('C', $2) + 64); + $res .= $coded; + } + } + $res =~ s/$/\$/; + + return $res; +} + +my $av_preprocessor = 0; +my $av_pending; +my @av_paren_type; +my $av_pend_colon; + +sub annotate_reset { + $av_preprocessor = 0; + $av_pending = '_'; + @av_paren_type = ('E'); + $av_pend_colon = 'O'; +} + +sub annotate_values { + my ($stream, $type) = @_; + + my $res; + my $var = '_' x length($stream); + my $cur = $stream; + + print "$stream\n" if ($dbg_values > 1); + + while (length($cur)) { + @av_paren_type = ('E') if ($#av_paren_type < 0); + print " <" . join('', @av_paren_type) . + "> <$type> <$av_pending>" if ($dbg_values > 1); + if ($cur =~ /^(\s+)/o) { + print "WS($1)\n" if ($dbg_values > 1); + if ($1 =~ /\n/ && $av_preprocessor) { + $type = pop(@av_paren_type); + $av_preprocessor = 0; + } + + } elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') { + print "CAST($1)\n" if ($dbg_values > 1); + push(@av_paren_type, $type); + $type = 'c'; + + } elsif ($cur =~ /^($Type)\s*(?:$Ident|,|\)|\(|\s*$)/) { + print "DECLARE($1)\n" if ($dbg_values > 1); + $type = 'T'; + + } elsif ($cur =~ /^($Modifier)\s*/) { + print "MODIFIER($1)\n" if ($dbg_values > 1); + $type = 'T'; + + } elsif ($cur =~ /^(\#\s*define\s*$Ident)(\(?)/o) { + print "DEFINE($1,$2)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + push(@av_paren_type, $type); + if ($2 ne '') { + $av_pending = 'N'; + } + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:undef\s*$Ident|include\b))/o) { + print "UNDEF($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + push(@av_paren_type, $type); + + } elsif ($cur =~ /^(\#\s*(?:ifdef|ifndef|if))/o) { + print "PRE_START($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + + push(@av_paren_type, $type); + push(@av_paren_type, $type); + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:else|elif))/o) { + print "PRE_RESTART($1)\n" if ($dbg_values > 1); + $av_preprocessor = 1; + + push(@av_paren_type, $av_paren_type[$#av_paren_type]); + + $type = 'E'; + + } elsif ($cur =~ /^(\#\s*(?:endif))/o) { + print "PRE_END($1)\n" if ($dbg_values > 1); + + $av_preprocessor = 1; + + # Assume all arms of the conditional end as this + # one does, and continue as if the #endif was not here. + pop(@av_paren_type); + push(@av_paren_type, $type); + $type = 'E'; + + } elsif ($cur =~ /^(\\\n)/o) { + print "PRECONT($1)\n" if ($dbg_values > 1); + + } elsif ($cur =~ /^(__attribute__)\s*\(?/o) { + print "ATTR($1)\n" if ($dbg_values > 1); + $av_pending = $type; + $type = 'N'; + + } elsif ($cur =~ /^(sizeof)\s*(\()?/o) { + print "SIZEOF($1)\n" if ($dbg_values > 1); + if (defined $2) { + $av_pending = 'V'; + } + $type = 'N'; + + } elsif ($cur =~ /^(if|while|for)\b/o) { + print "COND($1)\n" if ($dbg_values > 1); + $av_pending = 'E'; + $type = 'N'; + + } elsif ($cur =~/^(case)/o) { + print "CASE($1)\n" if ($dbg_values > 1); + $av_pend_colon = 'C'; + $type = 'N'; + + } elsif ($cur =~/^(return|else|goto|typeof|__typeof__)\b/o) { + print "KEYWORD($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(\()/o) { + print "PAREN('$1')\n" if ($dbg_values > 1); + push(@av_paren_type, $av_pending); + $av_pending = '_'; + $type = 'N'; + + } elsif ($cur =~ /^(\))/o) { + my $new_type = pop(@av_paren_type); + if ($new_type ne '_') { + $type = $new_type; + print "PAREN('$1') -> $type\n" + if ($dbg_values > 1); + } else { + print "PAREN('$1')\n" if ($dbg_values > 1); + } + + } elsif ($cur =~ /^($Ident)\s*\(/o) { + print "FUNC($1)\n" if ($dbg_values > 1); + $type = 'V'; + $av_pending = 'V'; + + } elsif ($cur =~ /^($Ident\s*):(?:\s*\d+\s*(,|=|;))?/) { + if (defined $2 && $type eq 'C' || $type eq 'T') { + $av_pend_colon = 'B'; + } elsif ($type eq 'E') { + $av_pend_colon = 'L'; + } + print "IDENT_COLON($1,$type>$av_pend_colon)\n" if ($dbg_values > 1); + $type = 'V'; + + } elsif ($cur =~ /^($Ident|$Constant)/o) { + print "IDENT($1)\n" if ($dbg_values > 1); + $type = 'V'; + + } elsif ($cur =~ /^($Assignment)/o) { + print "ASSIGN($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~/^(;|{|})/) { + print "END($1)\n" if ($dbg_values > 1); + $type = 'E'; + $av_pend_colon = 'O'; + + } elsif ($cur =~/^(,)/) { + print "COMMA($1)\n" if ($dbg_values > 1); + $type = 'C'; + + } elsif ($cur =~ /^(\?)/o) { + print "QUESTION($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(:)/o) { + print "COLON($1,$av_pend_colon)\n" if ($dbg_values > 1); + + substr($var, length($res), 1, $av_pend_colon); + if ($av_pend_colon eq 'C' || $av_pend_colon eq 'L') { + $type = 'E'; + } else { + $type = 'N'; + } + $av_pend_colon = 'O'; + + } elsif ($cur =~ /^(\[)/o) { + print "CLOSE($1)\n" if ($dbg_values > 1); + $type = 'N'; + + } elsif ($cur =~ /^(-(?![->])|\+(?!\+)|\*|\&\&|\&)/o) { + my $variant; + + print "OPV($1)\n" if ($dbg_values > 1); + if ($type eq 'V') { + $variant = 'B'; + } else { + $variant = 'U'; + } + + substr($var, length($res), 1, $variant); + $type = 'N'; + + } elsif ($cur =~ /^($Operators)/o) { + print "OP($1)\n" if ($dbg_values > 1); + if ($1 ne '++' && $1 ne '--') { + $type = 'N'; + } + + } elsif ($cur =~ /(^.)/o) { + print "C($1)\n" if ($dbg_values > 1); + } + if (defined $1) { + $cur = substr($cur, length($1)); + $res .= $type x length($1); + } + } + + return ($res, $var); +} + +sub possible { + my ($possible, $line) = @_; + my $notPermitted = qr{(?: + ^(?: + $Modifier| + $Storage| + $Type| + DEFINE_\S+ + )$| + ^(?: + goto| + return| + case| + else| + asm|__asm__| + do| + \#| + \#\#| + )(?:\s|$)| + ^(?:typedef|struct|enum)\b + )}x; + warn "CHECK<$possible> ($line)\n" if ($dbg_possible > 2); + if ($possible !~ $notPermitted) { + # Check for modifiers. + $possible =~ s/\s*$Storage\s*//g; + $possible =~ s/\s*$Sparse\s*//g; + if ($possible =~ /^\s*$/) { + + } elsif ($possible =~ /\s/) { + $possible =~ s/\s*$Type\s*//g; + for my $modifier (split(' ', $possible)) { + if ($modifier !~ $notPermitted) { + warn "MODIFIER: $modifier ($possible) ($line)\n" if ($dbg_possible); + push(@modifierListFile, $modifier); + } + } + + } else { + warn "POSSIBLE: $possible ($line)\n" if ($dbg_possible); + push(@typeListFile, $possible); + } + build_types(); + } else { + warn "NOTPOSS: $possible ($line)\n" if ($dbg_possible > 1); + } +} + +my $prefix = ''; + +sub show_type { + my ($type) = @_; + + $type =~ tr/[a-z]/[A-Z]/; + + return defined $use_type{$type} if (scalar keys %use_type > 0); + + return !defined $ignore_type{$type}; +} + +sub report { + my ($level, $type, $msg) = @_; + + if (!show_type($type) || + (defined $tst_only && $msg !~ /\Q$tst_only\E/)) { + return 0; + } + my $output = ''; + if ($color) { + if ($level eq 'ERROR') { + $output .= RED; + } elsif ($level eq 'WARNING') { + $output .= YELLOW; + } else { + $output .= GREEN; + } + } + $output .= $prefix . $level . ':'; + if ($show_types) { + $output .= BLUE if ($color); + $output .= "$type:"; + } + $output .= RESET if ($color); + $output .= ' ' . $msg . "\n"; + + if ($showfile) { + my @lines = split("\n", $output, -1); + splice(@lines, 1, 1); + $output = join("\n", @lines); + } + $output = (split('\n', $output))[0] . "\n" if ($terse); + + push(our @report, $output); + + return 1; +} + +sub report_dump { + our @report; +} + +sub fixup_current_range { + my ($lineRef, $offset, $length) = @_; + + if ($$lineRef =~ /^\@\@ -\d+,\d+ \+(\d+),(\d+) \@\@/) { + my $o = $1; + my $l = $2; + my $no = $o + $offset; + my $nl = $l + $length; + $$lineRef =~ s/\+$o,$l \@\@/\+$no,$nl \@\@/; + } +} + +sub fix_inserted_deleted_lines { + my ($linesRef, $insertedRef, $deletedRef) = @_; + + my $range_last_linenr = 0; + my $delta_offset = 0; + + my $old_linenr = 0; + my $new_linenr = 0; + + my $next_insert = 0; + my $next_delete = 0; + + my @lines = (); + + my $inserted = @{$insertedRef}[$next_insert++]; + my $deleted = @{$deletedRef}[$next_delete++]; + + foreach my $old_line (@{$linesRef}) { + my $save_line = 1; + my $line = $old_line; #don't modify the array + if ($line =~ /^(?:\+\+\+|\-\-\-)\s+\S+/) { #new filename + $delta_offset = 0; + } elsif ($line =~ /^\@\@ -\d+,\d+ \+\d+,\d+ \@\@/) { #new hunk + $range_last_linenr = $new_linenr; + fixup_current_range(\$line, $delta_offset, 0); + } + + while (defined($deleted) && ${$deleted}{'LINENR'} == $old_linenr) { + $deleted = @{$deletedRef}[$next_delete++]; + $save_line = 0; + fixup_current_range(\$lines[$range_last_linenr], $delta_offset--, -1); + } + + while (defined($inserted) && ${$inserted}{'LINENR'} == $old_linenr) { + push(@lines, ${$inserted}{'LINE'}); + $inserted = @{$insertedRef}[$next_insert++]; + $new_linenr++; + fixup_current_range(\$lines[$range_last_linenr], $delta_offset++, 1); + } + + if ($save_line) { + push(@lines, $line); + $new_linenr++; + } + + $old_linenr++; + } + + return @lines; +} + +sub fix_insert_line { + my ($linenr, $line) = @_; + + my $inserted = { + LINENR => $linenr, + LINE => $line, + }; + push(@fixed_inserted, $inserted); +} + +sub fix_delete_line { + my ($linenr, $line) = @_; + + my $deleted = { + LINENR => $linenr, + LINE => $line, + }; + + push(@fixed_deleted, $deleted); +} + +sub ERROR { + my ($type, $msg) = @_; + + if (report("ERROR", $type, $msg)) { + our $clean = 0; + our $cnt_error++; + return 1; + } + return 0; +} +sub WARN { + my ($type, $msg) = @_; + + if (report("WARNING", $type, $msg)) { + our $clean = 0; + our $cnt_warn++; + return 1; + } + return 0; +} +sub CHK { + my ($type, $msg) = @_; + + if ($check && report("CHECK", $type, $msg)) { + our $clean = 0; + our $cnt_chk++; + return 1; + } + return 0; +} + +sub check_absolute_file { + my ($absolute, $herecurr) = @_; + my $file = $absolute; + + ##print "absolute<$absolute>\n"; + + # See if any suffix of this path is a path within the tree. + while ($file =~ s@^[^/]*/@@) { + if (-f "$root/$file") { + ##print "file<$file>\n"; + last; + } + } + if (! -f _) { + return 0; + } + + # It is, so see if the prefix is acceptable. + my $prefix = $absolute; + substr($prefix, -length($file)) = ''; + + ##print "prefix<$prefix>\n"; + if ($prefix ne ".../") { + WARN("USE_RELATIVE_PATH", + "use relative pathname instead of absolute in changelog text\n" . $herecurr); + } +} + +sub trim { + my ($string) = @_; + + $string =~ s/^\s+|\s+$//g; + + return $string; +} + +sub ltrim { + my ($string) = @_; + + $string =~ s/^\s+//; + + return $string; +} + +sub rtrim { + my ($string) = @_; + + $string =~ s/\s+$//; + + return $string; +} + +sub string_find_replace { + my ($string, $find, $replace) = @_; + + $string =~ s/$find/$replace/g; + + return $string; +} + +sub tabify { + my ($leading) = @_; + + my $source_indent = 8; + my $max_spaces_before_tab = $source_indent - 1; + my $spaces_to_tab = " " x $source_indent; + + #convert leading spaces to tabs + 1 while $leading =~ s@^([\t]*)$spaces_to_tab@$1\t@g; + #Remove spaces before a tab + 1 while $leading =~ s@^([\t]*)( {1,$max_spaces_before_tab})\t@$1\t@g; + + return "$leading"; +} + +sub pos_last_openparen { + my ($line) = @_; + + my $pos = 0; + + my $opens = $line =~ tr/\(/\(/; + my $closes = $line =~ tr/\)/\)/; + + my $last_openparen = 0; + + if (($opens == 0) || ($closes >= $opens)) { + return -1; + } + + my $len = length($line); + + for ($pos = 0; $pos < $len; $pos++) { + my $string = substr($line, $pos); + if ($string =~ /^($FuncArg|$balanced_parens)/) { + $pos += length($1) - 1; + } elsif (substr($line, $pos, 1) eq '(') { + $last_openparen = $pos; + } elsif (index($string, '(') == -1) { + last; + } + } + + return length(expand_tabs(substr($line, 0, $last_openparen))) + 1; +} + +sub process { + my $filename = shift; + + my $linenr=0; + my $prevline=""; + my $prevrawline=""; + my $stashline=""; + my $stashrawline=""; + + my $length; + my $indent; + my $previndent=0; + my $stashindent=0; + + our $clean = 1; + my $signoff = 0; + my $author = ''; + my $authorsignoff = 0; + my $is_patch = 0; + my $is_binding_patch = -1; + my $in_header_lines = $file ? 0 : 1; + my $in_commit_log = 0; #Scanning lines before patch + my $has_commit_log = 0; #Encountered lines before patch + my $commit_log_lines = 0; #Number of commit log lines + my $commit_log_possible_stack_dump = 0; + my $commit_log_long_line = 0; + my $commit_log_has_diff = 0; + my $reported_maintainer_file = 0; + my $reported_abi_update = 0; + my $last_abi_file = ''; + my $non_utf8_charset = 0; + + my $last_blank_line = 0; + my $last_coalesced_string_linenr = -1; + + our @report = (); + our $cnt_lines = 0; + our $cnt_error = 0; + our $cnt_warn = 0; + our $cnt_chk = 0; + + # Trace the real file/line as we go. + my $realfile = ''; + my $realline = 0; + my $realcnt = 0; + my $here = ''; + my $context_function; #undef'd unless there's a known function + my $in_comment = 0; + my $comment_edge = 0; + my $first_line = 0; + my $p1_prefix = ''; + + my $prev_values = 'E'; + + # suppression flags + my %suppress_ifbraces; + my %suppress_whiletrailers; + my %suppress_export; + my $suppress_statement = 0; + + my %signatures = (); + + # Pre-scan the patch sanitizing the lines. + # Pre-scan the patch looking for any __setup documentation. + # + my @setup_docs = (); + my $setup_docs = 0; + + my $camelcase_file_seeded = 0; + + my $checklicenseline = 1; + + sanitise_line_reset(); + my $line; + foreach my $rawline (@rawlines) { + $linenr++; + $line = $rawline; + + push(@fixed, $rawline) if ($fix); + + if ($rawline=~/^\+\+\+\s+(\S+)/) { + $setup_docs = 0; + if ($1 =~ m@Documentation/admin-guide/kernel-parameters.rst$@) { + $setup_docs = 1; + } + #next; + } + if ($rawline =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@/) { + $realline=$1-1; + if (defined $2) { + $realcnt=$3+1; + } else { + $realcnt=1+1; + } + $in_comment = 0; + + # Guestimate if this is a continuing comment. Run + # the context looking for a comment "edge". If this + # edge is a close comment then we must be in a comment + # at context start. + my $edge; + my $cnt = $realcnt; + for (my $ln = $linenr + 1; $cnt > 0; $ln++) { + next if (defined $rawlines[$ln - 1] && + $rawlines[$ln - 1] =~ /^-/); + $cnt--; + #print "RAW<$rawlines[$ln - 1]>\n"; + last if (!defined $rawlines[$ln - 1]); + if ($rawlines[$ln - 1] =~ m@(/\*|\*/)@ && + $rawlines[$ln - 1] !~ m@"[^"]*(?:/\*|\*/)[^"]*"@) { + ($edge) = $1; + last; + } + } + if (defined $edge && $edge eq '*/') { + $in_comment = 1; + } + + # Guestimate if this is a continuing comment. If this + # is the start of a diff block and this line starts + # ' *' then it is very likely a comment. + if (!defined $edge && + $rawlines[$linenr] =~ m@^.\s*(?:\*\*+| \*)(?:\s|$)@) + { + $in_comment = 1; + } + + ##print "COMMENT:$in_comment edge<$edge> $rawline\n"; + sanitise_line_reset($in_comment); + + } elsif ($realcnt && $rawline =~ /^(?:\+| |$)/) { + # Standardise the strings and chars within the input to + # simplify matching -- only bother with positive lines. + $line = sanitise_line($rawline); + } + + # Check if ABI is being updated. If so, there's probably no need to + # emit the "does ABI need updating?" message on file add/move/delete + if ($SOF && + ($line =~ /\+#define SOF_ABI_MAJOR*/ || + $line =~ /\+#define SOF_ABI_MINOR*/ || + $line =~ /\+#define SOF_ABI_PATCH*/)) { + $reported_abi_update = 1; + } + + push(@lines, $line); + + if ($realcnt > 1) { + $realcnt-- if ($line =~ /^(?:\+| |$)/); + } else { + $realcnt = 0; + } + + #print "==>$rawline\n"; + #print "-->$line\n"; + + if ($setup_docs && $line =~ /^\+/) { + push(@setup_docs, $line); + } + } + + $prefix = ''; + + $realcnt = 0; + $linenr = 0; + $fixlinenr = -1; + foreach my $line (@lines) { + $linenr++; + $fixlinenr++; + my $sline = $line; #copy of $line + $sline =~ s/$;/ /g; #with comments as spaces + + my $rawline = $rawlines[$linenr - 1]; + +# check if it's a mode change, rename or start of a patch + if (!$in_commit_log && + ($line =~ /^ mode change [0-7]+ => [0-7]+ \S+\s*$/ || + ($line =~ /^rename (?:from|to) \S+\s*$/ || + $line =~ /^diff --git a\/[\w\/\.\_\-]+ b\/\S+\s*$/))) { + $is_patch = 1; + } + +#extract the line range in the file after the patch is applied + if (!$in_commit_log && + $line =~ /^\@\@ -\d+(?:,\d+)? \+(\d+)(,(\d+))? \@\@(.*)/) { + my $context = $4; + $is_patch = 1; + $first_line = $linenr + 1; + $realline=$1-1; + if (defined $2) { + $realcnt=$3+1; + } else { + $realcnt=1+1; + } + annotate_reset(); + $prev_values = 'E'; + + %suppress_ifbraces = (); + %suppress_whiletrailers = (); + %suppress_export = (); + $suppress_statement = 0; + if ($context =~ /\b(\w+)\s*\(/) { + $context_function = $1; + } else { + undef $context_function; + } + next; + +# track the line number as we move through the hunk, note that +# new versions of GNU diff omit the leading space on completely +# blank context lines so we need to count that too. + } elsif ($line =~ /^( |\+|$)/) { + $realline++; + $realcnt-- if ($realcnt != 0); + + # Measure the line length and indent. + ($length, $indent) = line_stats($rawline); + + # Track the previous line. + ($prevline, $stashline) = ($stashline, $line); + ($previndent, $stashindent) = ($stashindent, $indent); + ($prevrawline, $stashrawline) = ($stashrawline, $rawline); + + #warn "line<$line>\n"; + + } elsif ($realcnt == 1) { + $realcnt--; + } + + my $hunk_line = ($realcnt != 0); + + $here = "#$linenr: " if (!$file); + $here = "#$realline: " if ($file); + + my $found_file = 0; + # extract the filename as it passes + if ($line =~ /^diff --git.*?(\S+)$/) { + $realfile = $1; + $realfile =~ s@^([^/]*)/@@ if (!$file); + $in_commit_log = 0; + $found_file = 1; + } elsif ($line =~ /^\+\+\+\s+(\S+)/) { + $realfile = $1; + $realfile =~ s@^([^/]*)/@@ if (!$file); + $in_commit_log = 0; + + $p1_prefix = $1; + if (!$file && $tree && $p1_prefix ne '' && + -e "$root/$p1_prefix") { + WARN("PATCH_PREFIX", + "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); + } + + if ($realfile =~ m@^include/asm/@) { + ERROR("MODIFIED_INCLUDE_ASM", + "do not modify files in include/asm, change architecture specific files in include/asm-\n" . "$here$rawline\n"); + } + $found_file = 1; + } + +#make up the handle for any error we report on this line + if ($showfile) { + $prefix = "$realfile:$realline: " + } elsif ($emacs) { + if ($file) { + $prefix = "$filename:$realline: "; + } else { + $prefix = "$filename:$linenr: "; + } + } + + if ($found_file) { + if (is_maintained_obsolete($realfile)) { + WARN("OBSOLETE", + "$realfile is marked as 'obsolete' in the MAINTAINERS hierarchy. No unnecessary modifications please.\n"); + } + if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) { + $check = 1; + } else { + $check = $check_orig; + } + $checklicenseline = 1; + + if ($realfile !~ /^MAINTAINERS/) { + my $last_binding_patch = $is_binding_patch; + + $is_binding_patch = () = $realfile =~ m@^(?:Documentation/devicetree/|include/dt-bindings/)@; + + if (($last_binding_patch != -1) && + ($last_binding_patch ^ $is_binding_patch)) { + WARN("DT_SPLIT_BINDING_PATCH", + "DT binding docs and includes should be a separate patch. See: Documentation/devicetree/bindings/submitting-patches.txt\n"); + } + } + + next; + } + + $here .= "FILE: $realfile:$realline:" if ($realcnt != 0); + + my $hereline = "$here\n$rawline\n"; + my $herecurr = "$here\n$rawline\n"; + my $hereprev = "$here\n$prevrawline\n$rawline\n"; + + $cnt_lines++ if ($realcnt != 0); + +# Verify the existence of a commit log if appropriate +# 2 is used because a $signature is counted in $commit_log_lines + if ($in_commit_log) { + if ($line !~ /^\s*$/) { + $commit_log_lines++; #could be a $signature + } + } elsif ($has_commit_log && $commit_log_lines < 2) { + WARN("COMMIT_MESSAGE", + "Missing commit description - Add an appropriate one\n"); + $commit_log_lines = 2; #warn only once + } + +# Check if the commit log has what seems like a diff which can confuse patch + if ($in_commit_log && !$commit_log_has_diff && + (($line =~ m@^\s+diff\b.*a/[\w/]+@ && + $line =~ m@^\s+diff\b.*a/([\w/]+)\s+b/$1\b@) || + $line =~ m@^\s*(?:\-\-\-\s+a/|\+\+\+\s+b/)@ || + $line =~ m/^\s*\@\@ \-\d+,\d+ \+\d+,\d+ \@\@/)) { + ERROR("DIFF_IN_COMMIT_MSG", + "Avoid using diff content in the commit message - patch(1) might not work\n" . $herecurr); + $commit_log_has_diff = 1; + } + +# Check for incorrect file permissions + if ($line =~ /^new (file )?mode.*[7531]\d{0,2}$/) { + my $permhere = $here . "FILE: $realfile\n"; + if ($realfile !~ m@scripts/@ && + $realfile !~ /\.(py|pl|awk|sh)$/) { + ERROR("EXECUTE_PERMISSIONS", + "do not set execute permissions for source files\n" . $permhere); + } + } + +# Check the patch for a From: + if (decode("MIME-Header", $line) =~ /^From:\s*(.*)/) { + $author = $1; + $author = encode("utf8", $author) if ($line =~ /=\?utf-8\?/i); + $author =~ s/"//g; + } + +# Check the patch for a signoff: + if ($line =~ /^\s*signed-off-by:/i) { + $signoff++; + $in_commit_log = 0; + if ($author ne '') { + my $l = $line; + $l =~ s/"//g; + if ($l =~ /^\s*signed-off-by:\s*\Q$author\E/i) { + $authorsignoff = 1; + } + } + } + + +# Check if MAINTAINERS is being updated. If so, there's probably no need to +# emit the "does MAINTAINERS need updating?" message on file add/move/delete + if ($line =~ /^\s*MAINTAINERS\s*\|/) { + $reported_maintainer_file = 1; + } + +# Check signature styles + if (!$in_header_lines && + $line =~ /^(\s*)([a-z0-9_-]+by:|$signature_tags)(\s*)(.*)/i) { + my $space_before = $1; + my $sign_off = $2; + my $space_after = $3; + my $email = $4; + my $ucfirst_sign_off = ucfirst(lc($sign_off)); + + if ($sign_off !~ /$signature_tags/) { + WARN("BAD_SIGN_OFF", + "Non-standard signature: $sign_off\n" . $herecurr); + } + if (defined $space_before && $space_before ne "") { + if (WARN("BAD_SIGN_OFF", + "Do not use whitespace before $ucfirst_sign_off\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = + "$ucfirst_sign_off $email"; + } + } + if ($sign_off =~ /-by:$/i && $sign_off ne $ucfirst_sign_off) { + if (WARN("BAD_SIGN_OFF", + "'$ucfirst_sign_off' is the preferred signature form\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = + "$ucfirst_sign_off $email"; + } + + } + if (!defined $space_after || $space_after ne " ") { + if (WARN("BAD_SIGN_OFF", + "Use a single space after $ucfirst_sign_off\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = + "$ucfirst_sign_off $email"; + } + } + + my ($email_name, $email_address, $comment) = parse_email($email); + my $suggested_email = format_email(($email_name, $email_address)); + if ($suggested_email eq "") { + ERROR("BAD_SIGN_OFF", + "Unrecognized email address: '$email'\n" . $herecurr); + } else { + my $dequoted = $suggested_email; + $dequoted =~ s/^"//; + $dequoted =~ s/" $comment" ne $email && + "$suggested_email$comment" ne $email) { + WARN("BAD_SIGN_OFF", + "email address '$email' might be better as '$suggested_email$comment'\n" . $herecurr); + } + } + +# Check for duplicate signatures + my $sig_nospace = $line; + $sig_nospace =~ s/\s//g; + $sig_nospace = lc($sig_nospace); + if (defined $signatures{$sig_nospace}) { + WARN("BAD_SIGN_OFF", + "Duplicate signature\n" . $herecurr); + } else { + $signatures{$sig_nospace} = 1; + } + +# Check Co-developed-by: immediately followed by Signed-off-by: with same name and email + if ($sign_off =~ /^co-developed-by:$/i) { + if ($email eq $author) { + WARN("BAD_SIGN_OFF", + "Co-developed-by: should not be used to attribute nominal patch author '$author'\n" . "$here\n" . $rawline); + } + if (!defined $lines[$linenr]) { + WARN("BAD_SIGN_OFF", + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline); + } elsif ($rawlines[$linenr] !~ /^\s*signed-off-by:\s*(.*)/i) { + WARN("BAD_SIGN_OFF", + "Co-developed-by: must be immediately followed by Signed-off-by:\n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } elsif ($1 ne $email) { + WARN("BAD_SIGN_OFF", + "Co-developed-by and Signed-off-by: name/email do not match \n" . "$here\n" . $rawline . "\n" .$rawlines[$linenr]); + } + } + } + +# Check email subject for common tools that don't need to be mentioned + if ($in_header_lines && + $line =~ /^Subject:.*\b(?:checkpatch|sparse|smatch)\b[^:]/i) { + WARN("EMAIL_SUBJECT", + "A patch subject line should describe the change not the tool that found it\n" . $herecurr); + } + +# Check for unwanted Gerrit info + if ($in_commit_log && $line =~ /^\s*change-id:/i) { + ERROR("GERRIT_CHANGE_ID", + "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr); + } + +# Check if the commit log is in a possible stack dump + if ($in_commit_log && !$commit_log_possible_stack_dump && + ($line =~ /^\s*(?:WARNING:|BUG:)/ || + $line =~ /^\s*\[\s*\d+\.\d{6,6}\s*\]/ || + # timestamp + $line =~ /^\s*\[\<[0-9a-fA-F]{8,}\>\]/) || + $line =~ /^(?:\s+\w+:\s+[0-9a-fA-F]+){3,3}/ || + $line =~ /^\s*\#\d+\s*\[[0-9a-fA-F]+\]\s*\w+ at [0-9a-fA-F]+/) { + # stack dump address styles + $commit_log_possible_stack_dump = 1; + } + +# Check for line lengths > 75 in commit log, warn once + if ($in_commit_log && !$commit_log_long_line && + length($line) > 75 && + !($line =~ /^\s*[a-zA-Z0-9_\/\.]+\s+\|\s+\d+/ || + # file delta changes + $line =~ /^\s*(?:[\w\.\-]+\/)++[\w\.\-]+:/ || + # filename then : + $line =~ /^\s*(?:Fixes:|Link:)/i || + # A Fixes: or Link: line + $commit_log_possible_stack_dump)) { + WARN("COMMIT_LOG_LONG_LINE", + "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr); + $commit_log_long_line = 1; + } + +# Reset possible stack dump if a blank line is found + if ($in_commit_log && $commit_log_possible_stack_dump && + $line =~ /^\s*$/) { + $commit_log_possible_stack_dump = 0; + } + +# Check for git id commit length and improperly formed commit descriptions + if ($in_commit_log && !$commit_log_possible_stack_dump && + $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink):/i && + $line !~ /^This reverts commit [0-9a-f]{7,40}/ && + ($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i || + ($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i && + $line !~ /[\<\[][0-9a-f]{12,40}[\>\]]/i && + $line !~ /\bfixes:\s*[0-9a-f]{12,40}/i))) { + my $init_char = "c"; + my $orig_commit = ""; + my $short = 1; + my $long = 0; + my $case = 1; + my $space = 1; + my $hasdesc = 0; + my $hasparens = 0; + my $id = '0123456789ab'; + my $orig_desc = "commit description"; + my $description = ""; + + if ($line =~ /\b(c)ommit\s+([0-9a-f]{5,})\b/i) { + $init_char = $1; + $orig_commit = lc($2); + } elsif ($line =~ /\b([0-9a-f]{12,40})\b/i) { + $orig_commit = lc($1); + } + + $short = 0 if ($line =~ /\bcommit\s+[0-9a-f]{12,40}/i); + $long = 1 if ($line =~ /\bcommit\s+[0-9a-f]{41,}/i); + $space = 0 if ($line =~ /\bcommit [0-9a-f]/i); + $case = 0 if ($line =~ /\b[Cc]ommit\s+[0-9a-f]{5,40}[^A-F]/); + if ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)"\)/i) { + $orig_desc = $1; + $hasparens = 1; + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s*$/i && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^\s*\("([^"]+)"\)/) { + $orig_desc = $1; + $hasparens = 1; + } elsif ($line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("[^"]+$/i && + defined $rawlines[$linenr] && + $rawlines[$linenr] =~ /^\s*[^"]+"\)/) { + $line =~ /\bcommit\s+[0-9a-f]{5,}\s+\("([^"]+)$/i; + $orig_desc = $1; + $rawlines[$linenr] =~ /^\s*([^"]+)"\)/; + $orig_desc .= " " . $1; + $hasparens = 1; + } + + ($id, $description) = git_commit_info($orig_commit, + $id, $orig_desc); + + if (defined($id) && + ($short || $long || $space || $case || ($orig_desc ne $description) || !$hasparens)) { + ERROR("GIT_COMMIT_ID", + "Please use git commit description style 'commit <12+ chars of sha1> (\"\")' - ie: '${init_char}ommit $id (\"$description\")'\n" . $herecurr); + } + } + +# Check for added, moved or deleted files + if (!$SOF && + (!$reported_maintainer_file && !$in_commit_log && + ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ || + $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ || + ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ && + (defined($1) || defined($2)))))) { + $is_patch = 1; + $reported_maintainer_file = 1; + WARN("FILE_PATH_CHANGES", + "added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr); + } + +# Check for wrappage within a valid hunk of the file + if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) { + ERROR("CORRUPTED_PATCH", + "patch seems to be corrupt (line wrapped?)\n" . + $herecurr) if (!$emitted_corrupt++); + } + +# UTF-8 regex found at http://www.w3.org/International/questions/qa-forms-utf-8.en.php + if (($realfile =~ /^$/ || $line =~ /^\+/) && + $rawline !~ m/^$UTF8*$/) { + my ($utf8_prefix) = ($rawline =~ /^($UTF8*)/); + + my $blank = copy_spacing($rawline); + my $ptr = substr($blank, 0, length($utf8_prefix)) . "^"; + my $hereptr = "$hereline$ptr\n"; + + CHK("INVALID_UTF8", + "Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr); + } + +# Check if it's the start of a commit log +# (not a header line and we haven't seen the patch filename) + if ($in_header_lines && $realfile =~ /^$/ && + !($rawline =~ /^\s+(?:\S|$)/ || + $rawline =~ /^(?:commit\b|from\b|[\w-]+:)/i)) { + $in_header_lines = 0; + $in_commit_log = 1; + $has_commit_log = 1; + } + +# Check if there is UTF-8 in a commit log when a mail header has explicitly +# declined it, i.e defined some charset where it is missing. + if ($in_header_lines && + $rawline =~ /^Content-Type:.+charset="(.+)".*$/ && + $1 !~ /utf-8/i) { + $non_utf8_charset = 1; + } + + if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ && + $rawline =~ /$NON_ASCII_UTF8/) { + WARN("UTF8_BEFORE_PATCH", + "8-bit UTF-8 used in possible commit log\n" . $herecurr); + } + +# Check for absolute kernel paths in commit message + if ($tree && $in_commit_log) { + while ($line =~ m{(?:^|\s)(/\S*)}g) { + my $file = $1; + + if ($file =~ m{^(.*?)(?::\d+)+:?$} && + check_absolute_file($1, $herecurr)) { + # + } else { + check_absolute_file($file, $herecurr); + } + } + } + +# Check for various typo / spelling mistakes + if (defined($misspellings) && + ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { + while ($rawline =~ /(?:^|[^a-z@])($misspellings)(?:\b|$|[^a-z@])/gi) { + my $typo = $1; + my $typo_fix = $spelling_fix{lc($typo)}; + $typo_fix = ucfirst($typo_fix) if ($typo =~ /^[A-Z]/); + $typo_fix = uc($typo_fix) if ($typo =~ /^[A-Z]+$/); + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + if (&{$msg_level}("TYPO_SPELLING", + "'$typo' may be misspelled - perhaps '$typo_fix'?\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^|[^A-Za-z@])($typo)($|[^A-Za-z@])/$1$typo_fix$3/; + } + } + } + +# check for invalid commit id + if ($in_commit_log && $line =~ /(^fixes:|\bcommit)\s+([0-9a-f]{6,40})\b/i) { + my $id; + my $description; + ($id, $description) = git_commit_info($2, undef, undef); + if (!defined($id)) { + WARN("UNKNOWN_COMMIT_ID", + "Unknown commit id '$2', maybe rebased or not pulled?\n" . $herecurr); + } + } + +# ignore non-hunk lines and lines being removed + next if (!$hunk_line || $line =~ /^-/); + +#trailing whitespace + if ($line =~ /^\+.*\015/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (ERROR("DOS_LINE_ENDINGS", + "DOS line endings\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/[\s\015]+$//; + } + } elsif ($rawline =~ /^\+.*\S\s+$/ || $rawline =~ /^\+\s+$/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (ERROR("TRAILING_WHITESPACE", + "trailing whitespace\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/\s+$//; + } + + $rpt_cleaners = 1; + } + +# Check for FSF mailing addresses. + if ($rawline =~ /\bwrite to the Free/i || + $rawline =~ /\b675\s+Mass\s+Ave/i || + $rawline =~ /\b59\s+Temple\s+Pl/i || + $rawline =~ /\b51\s+Franklin\s+St/i) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + my $msg_level = \&ERROR; + $msg_level = \&CHK if ($file); + &{$msg_level}("FSF_MAILING_ADDRESS", + "Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL.\n" . $herevet) + } + +# check for Kconfig help text having a real description +# Only applies when adding the entry originally, after that we do not have +# sufficient context to determine whether it is indeed long enough. + if ($realfile =~ /Kconfig/ && + # 'choice' is usually the last thing on the line (though + # Kconfig supports named choices), so use a word boundary + # (\b) rather than a whitespace character (\s) + $line =~ /^\+\s*(?:config|menuconfig|choice)\b/) { + my $length = 0; + my $cnt = $realcnt; + my $ln = $linenr + 1; + my $f; + my $is_start = 0; + my $is_end = 0; + for (; $cnt > 0 && defined $lines[$ln - 1]; $ln++) { + $f = $lines[$ln - 1]; + $cnt-- if ($lines[$ln - 1] !~ /^-/); + $is_end = $lines[$ln - 1] =~ /^\+/; + + next if ($f =~ /^-/); + last if (!$file && $f =~ /^\@\@/); + + if ($lines[$ln - 1] =~ /^\+\s*(?:bool|tristate|prompt)\s*["']/) { + $is_start = 1; + } elsif ($lines[$ln - 1] =~ /^\+\s*(?:help|---help---)\s*$/) { + if ($lines[$ln - 1] =~ "---help---") { + WARN("CONFIG_DESCRIPTION", + "prefer 'help' over '---help---' for new help texts\n" . $herecurr); + } + $length = -1; + } + + $f =~ s/^.//; + $f =~ s/#.*//; + $f =~ s/^\s+//; + next if ($f =~ /^$/); + + # This only checks context lines in the patch + # and so hopefully shouldn't trigger false + # positives, even though some of these are + # common words in help texts + if ($f =~ /^\s*(?:config|menuconfig|choice|endchoice| + if|endif|menu|endmenu|source)\b/x) { + $is_end = 1; + last; + } + $length++; + } + if ($is_start && $is_end && $length < $min_conf_desc_length) { + WARN("CONFIG_DESCRIPTION", + "please write a paragraph that describes the config symbol fully\n" . $herecurr); + } + #print "is_start<$is_start> is_end<$is_end> length<$length>\n"; + } + +# check for MAINTAINERS entries that don't have the right form + if ($realfile =~ /^MAINTAINERS$/ && + $rawline =~ /^\+[A-Z]:/ && + $rawline !~ /^\+[A-Z]:\t\S/) { + if (WARN("MAINTAINERS_STYLE", + "MAINTAINERS entries use one tab after TYPE:\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+[A-Z]):\s*/$1:\t/; + } + } + +# discourage the use of boolean for type definition attributes of Kconfig options + if ($realfile =~ /Kconfig/ && + $line =~ /^\+\s*\bboolean\b/) { + WARN("CONFIG_TYPE_BOOLEAN", + "Use of boolean is deprecated, please use bool instead.\n" . $herecurr); + } + + if (($realfile =~ /Makefile.*/ || $realfile =~ /Kbuild.*/) && + ($line =~ /\+(EXTRA_[A-Z]+FLAGS).*/)) { + my $flag = $1; + my $replacement = { + 'EXTRA_AFLAGS' => 'asflags-y', + 'EXTRA_CFLAGS' => 'ccflags-y', + 'EXTRA_CPPFLAGS' => 'cppflags-y', + 'EXTRA_LDFLAGS' => 'ldflags-y', + }; + + WARN("DEPRECATED_VARIABLE", + "Use of $flag is deprecated, please use \`$replacement->{$flag} instead.\n" . $herecurr) if ($replacement->{$flag}); + } + +# check for DT compatible documentation + if (defined $root && + (($realfile =~ /\.dtsi?$/ && $line =~ /^\+\s*compatible\s*=\s*\"/) || + ($realfile =~ /\.[ch]$/ && $line =~ /^\+.*\.compatible\s*=\s*\"/))) { + + my @compats = $rawline =~ /\"([a-zA-Z0-9\-\,\.\+_]+)\"/g; + + my $dt_path = $root . "/Documentation/devicetree/bindings/"; + my $vp_file = $dt_path . "vendor-prefixes.yaml"; + + foreach my $compat (@compats) { + my $compat2 = $compat; + $compat2 =~ s/\,[a-zA-Z0-9]*\-/\,<\.\*>\-/; + my $compat3 = $compat; + $compat3 =~ s/\,([a-z]*)[0-9]*\-/\,$1<\.\*>\-/; + `grep -Erq "$compat|$compat2|$compat3" $dt_path`; + if ( $? >> 8 ) { + WARN("UNDOCUMENTED_DT_STRING", + "DT compatible string \"$compat\" appears un-documented -- check $dt_path\n" . $herecurr); + } + + next if $compat !~ /^([a-zA-Z0-9\-]+)\,/; + my $vendor = $1; + `grep -Eq "\\"\\^\Q$vendor\E,\\.\\*\\":" $vp_file`; + if ( $? >> 8 ) { + WARN("UNDOCUMENTED_DT_STRING", + "DT compatible string vendor \"$vendor\" appears un-documented -- check $vp_file\n" . $herecurr); + } + } + } + +# check for using SPDX license tag at beginning of files + if ($realline == $checklicenseline) { + if ($rawline =~ /^[ \+]\s*\#\!\s*\//) { + $checklicenseline = 2; + } elsif ($rawline =~ /^\+/) { + my $comment = ""; + if ($realfile =~ /\.(h|s|S)$/) { + $comment = '/*'; + } elsif ($realfile =~ /\.(c|dts|dtsi)$/) { + $comment = '//'; + } elsif (($checklicenseline == 2) || $realfile =~ /\.(sh|pl|py|awk|tc)$/) { + $comment = '#'; + } elsif ($realfile =~ /\.rst$/) { + $comment = '..'; + } + +# check SPDX comment style for .[chsS] files + if ($realfile =~ /\.[chsS]$/ && + $rawline =~ /SPDX-License-Identifier:/ && + $rawline !~ m@^\+\s*\Q$comment\E\s*@) { + WARN("SPDX_LICENSE_TAG", + "Improper SPDX comment style for '$realfile', please use '$comment' instead\n" . $herecurr); + } + + if ($comment !~ /^$/ && + $rawline !~ m@^\+\Q$comment\E SPDX-License-Identifier: @) { + WARN("SPDX_LICENSE_TAG", + "Missing or malformed SPDX-License-Identifier tag in line $checklicenseline\n" . $herecurr); + } elsif ($rawline =~ /(SPDX-License-Identifier: .*)/) { + my $spdx_license = $1; + if (!is_SPDX_License_valid($spdx_license)) { + WARN("SPDX_LICENSE_TAG", + "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); + } + } + } + } + +# check we are in a valid source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c|s|S|sh|dtsi|dts)$/); + +# check for using SPDX-License-Identifier on the wrong line number + if ($realline != $checklicenseline && + $rawline =~ /\bSPDX-License-Identifier:/ && + substr($line, @-, @+ - @-) eq "$;" x (@+ - @-)) { + WARN("SPDX_LICENSE_TAG", + "Misplaced SPDX-License-Identifier tag - use line $checklicenseline instead\n" . $herecurr); + } + +# line length limit (with some exclusions) +# +# There are a few types of lines that may extend beyond $max_line_length: +# logging functions like pr_info that end in a string +# lines with a single string +# #defines that are a single string +# lines with an RFC3986 like URL +# +# There are 3 different line length message types: +# LONG_LINE_COMMENT a comment starts before but extends beyond $max_line_length +# LONG_LINE_STRING a string starts before but extends beyond $max_line_length +# LONG_LINE all other lines longer than $max_line_length +# +# if LONG_LINE is ignored, the other 2 types are also ignored +# + + if ($line =~ /^\+/ && $length > $max_line_length) { + my $msg_type = "LONG_LINE"; + + # Check the allowed long line types first + + # logging functions that end in a string that starts + # before $max_line_length + if ($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(?:KERN_\S+\s*|[^"]*))?($String\s*(?:|,|\)\s*;)\s*)$/ && + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + $msg_type = ""; + + # lines with only strings (w/ possible termination) + # #defines with only strings + } elsif ($line =~ /^\+\s*$String\s*(?:\s*|,|\)\s*;)\s*$/ || + $line =~ /^\+\s*#\s*define\s+\w+\s+$String$/) { + $msg_type = ""; + + # More special cases + } elsif ($line =~ /^\+.*\bEFI_GUID\s*\(/ || + $line =~ /^\+\s*(?:\w+)?\s*DEFINE_PER_CPU/) { + $msg_type = ""; + + # URL ($rawline is used in case the URL is in a comment) + } elsif ($rawline =~ /^\+.*\b[a-z][\w\.\+\-]*:\/\/\S+/i) { + $msg_type = ""; + + # Otherwise set the alternate message types + + # a comment starts before $max_line_length + } elsif ($line =~ /($;[\s$;]*)$/ && + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + $msg_type = "LONG_LINE_COMMENT" + + # a quoted string starts before $max_line_length + } elsif ($sline =~ /\s*($String(?:\s*(?:\\|,\s*|\)\s*;\s*))?)$/ && + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + $msg_type = "LONG_LINE_STRING" + } + + if ($msg_type ne "" && + (show_type("LONG_LINE") || show_type($msg_type))) { + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + &{$msg_level}($msg_type, + "line length of $length exceeds $max_line_length columns\n" . $herecurr); + } + } + +# check for adding lines without a newline. + if ($line =~ /^\+/ && defined $lines[$linenr] && $lines[$linenr] =~ /^\\ No newline at end of file/) { + WARN("MISSING_EOF_NEWLINE", + "adding a line without newline at end of file\n" . $herecurr); + } + +# check we are in a valid source file C or perl if not then ignore this hunk + next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/); + +# at the beginning of a line any tabs must come first and anything +# more than 8 must use tabs. + if ($rawline =~ /^\+\s* \t\s*\S/ || + $rawline =~ /^\+\s* \s*/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + $rpt_cleaners = 1; + if (ERROR("CODE_INDENT", + "code indent should use tabs where possible\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/^\+([ \t]+)/"\+" . tabify($1)/e; + } + } + +# check for space before tabs. + if ($rawline =~ /^\+/ && $rawline =~ / \t/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (WARN("SPACE_BEFORE_TAB", + "please, no space before tabs\n" . $herevet) && + $fix) { + while ($fixed[$fixlinenr] =~ + s/(^\+.*) {8,8}\t/$1\t\t/) {} + while ($fixed[$fixlinenr] =~ + s/(^\+.*) +\t/$1\t/) {} + } + } + +# check for assignments on the start of a line + if ($sline =~ /^\+\s+($Assignment)[^=]/) { + CHK("ASSIGNMENT_CONTINUATIONS", + "Assignment operator '$1' should be on the previous line\n" . $hereprev); + } + +# check for && or || at the start of a line + if ($rawline =~ /^\+\s*(&&|\|\|)/) { + CHK("LOGICAL_CONTINUATIONS", + "Logical continuations should be on the previous line\n" . $hereprev); + } + +# check indentation starts on a tab stop + if ($perl_version_ok && + $sline =~ /^\+\t+( +)(?:$c90_Keywords\b|\{\s*$|\}\s*(?:else\b|while\b|\s*$)|$Declare\s*$Ident\s*[;=])/) { + my $indent = length($1); + if ($indent % 8) { + if (WARN("TABSTOP", + "Statements should start on a tabstop\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s@(^\+\t+) +@$1 . "\t" x ($indent/8)@e; + } + } + } + +# check multi-line statement indentation matches previous line + if ($perl_version_ok && + $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|(?:\*\s*)*$Lval\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) { + $prevline =~ /^\+(\t*)(.*)$/; + my $oldindent = $1; + my $rest = $2; + + my $pos = pos_last_openparen($rest); + if ($pos >= 0) { + $line =~ /^(\+| )([ \t]*)/; + my $newindent = $2; + + my $goodtabindent = $oldindent . + "\t" x ($pos / 8) . + " " x ($pos % 8); + my $goodspaceindent = $oldindent . " " x $pos; + + if ($newindent ne $goodtabindent && + $newindent ne $goodspaceindent) { + + if (CHK("PARENTHESIS_ALIGNMENT", + "Alignment should match open parenthesis\n" . $hereprev) && + $fix && $line =~ /^\+/) { + $fixed[$fixlinenr] =~ + s/^\+[ \t]*/\+$goodtabindent/; + } + } + } + } + +# check for space after cast like "(int) foo" or "(struct foo) bar" +# avoid checking a few false positives: +# "sizeof(<type>)" or "__alignof__(<type>)" +# function pointer declarations like "(*foo)(int) = bar;" +# structure definitions like "(struct foo) { 0 };" +# multiline macros that define functions +# known attributes or the __attribute__ keyword + if ($line =~ /^\+(.*)\(\s*$Type\s*\)([ \t]++)((?![={]|\\$|$Attribute|__attribute__))/ && + (!defined($1) || $1 !~ /\b(?:sizeof|__alignof__)\s*$/)) { + if (CHK("SPACING", + "No space is necessary after a cast\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/(\(\s*$Type\s*\))[ \t]+/$1/; + } + } + +# Block comment styles +# Networking with an initial /* + if ($realfile =~ m@^(drivers/net/|net/)@ && + $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ && + $rawline =~ /^\+[ \t]*\*/ && + $realline > 2) { + WARN("NETWORKING_BLOCK_COMMENT_STYLE", + "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev); + } + +# UAPI ABI version + if ($SOF && $realfile ne $last_abi_file && + $realfile =~ m@^(src/include/ipc/|src/include/kernel/|src/include/user/)@ && + $rawline =~ /^\+/ && + !$reported_abi_update) { + $last_abi_file = $realfile; + WARN("ABI update ??", + "Please update ABI in accordance with http://semver.org\n" . $hereprev); + } + +# Block comments use * on subsequent lines + if ($prevline =~ /$;[ \t]*$/ && #ends in comment + $prevrawline =~ /^\+.*?\/\*/ && #starting /* + $prevrawline !~ /\*\/[ \t]*$/ && #no trailing */ + $rawline =~ /^\+/ && #line is new + $rawline !~ /^\+[ \t]*\*/) { #no leading * + WARN("BLOCK_COMMENT_STYLE", + "Block comments use * on subsequent lines\n" . $hereprev); + } + +# Block comments use */ on trailing lines + if ($rawline !~ m@^\+[ \t]*\*/[ \t]*$@ && #trailing */ + $rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/ + $rawline !~ m@^\+.*\*{2,}/[ \t]*$@ && #trailing **/ + $rawline =~ m@^\+[ \t]*.+\*\/[ \t]*$@) { #non blank */ + WARN("BLOCK_COMMENT_STYLE", + "Block comments use a trailing */ on a separate line\n" . $herecurr); + } + +# Block comment * alignment + if ($prevline =~ /$;[ \t]*$/ && #ends in comment + $line =~ /^\+[ \t]*$;/ && #leading comment + $rawline =~ /^\+[ \t]*\*/ && #leading * + (($prevrawline =~ /^\+.*?\/\*/ && #leading /* + $prevrawline !~ /\*\/[ \t]*$/) || #no trailing */ + $prevrawline =~ /^\+[ \t]*\*/)) { #leading * + my $oldindent; + $prevrawline =~ m@^\+([ \t]*/?)\*@; + if (defined($1)) { + $oldindent = expand_tabs($1); + } else { + $prevrawline =~ m@^\+(.*/?)\*@; + $oldindent = expand_tabs($1); + } + $rawline =~ m@^\+([ \t]*)\*@; + my $newindent = $1; + $newindent = expand_tabs($newindent); + if (length($oldindent) ne length($newindent)) { + WARN("BLOCK_COMMENT_STYLE", + "Block comments should align the * on each line\n" . $hereprev); + } + } + +# check for missing blank lines after struct/union declarations +# with exceptions for various attributes and macros + if ($prevline =~ /^[\+ ]};?\s*$/ && + $line =~ /^\+/ && + !($line =~ /^\+\s*$/ || + $line =~ /^\+\s*EXPORT_SYMBOL/ || + $line =~ /^\+\s*MODULE_/i || + $line =~ /^\+\s*\#\s*(?:end|elif|else)/ || + $line =~ /^\+[a-z_]*init/ || + $line =~ /^\+\s*(?:static\s+)?[A-Z_]*ATTR/ || + $line =~ /^\+\s*DECLARE/ || + $line =~ /^\+\s*builtin_[\w_]*driver/ || + $line =~ /^\+\s*__setup/)) { + if (CHK("LINE_SPACING", + "Please use a blank line after function/struct/union/enum declarations\n" . $hereprev) && + $fix) { + fix_insert_line($fixlinenr, "\+"); + } + } + +# check for multiple consecutive blank lines + if ($prevline =~ /^[\+ ]\s*$/ && + $line =~ /^\+\s*$/ && + $last_blank_line != ($linenr - 1)) { + if (CHK("LINE_SPACING", + "Please don't use multiple blank lines\n" . $hereprev) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } + + $last_blank_line = $linenr; + } + +# check for missing blank lines after declarations + if ($sline =~ /^\+\s+\S/ && #Not at char 1 + # actual declarations + ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || + # function pointer declarations + $prevline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || + # foo bar; where foo is some local typedef or #define + $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || + # known declaration macros + $prevline =~ /^\+\s+$declaration_macros/) && + # for "else if" which can look like "$Ident $Ident" + !($prevline =~ /^\+\s+$c90_Keywords\b/ || + # other possible extensions of declaration lines + $prevline =~ /(?:$Compare|$Assignment|$Operators)\s*$/ || + # not starting a section or a macro "\" extended line + $prevline =~ /(?:\{\s*|\\)$/) && + # looks like a declaration + !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || + # function pointer declarations + $sline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || + # foo bar; where foo is some local typedef or #define + $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || + # known declaration macros + $sline =~ /^\+\s+$declaration_macros/ || + # start of struct or union or enum + $sline =~ /^\+\s+(?:static\s+)?(?:const\s+)?(?:union|struct|enum|typedef)\b/ || + # start or end of block or continuation of declaration + $sline =~ /^\+\s+(?:$|[\{\}\.\#\"\?\:\(\[])/ || + # bitfield continuation + $sline =~ /^\+\s+$Ident\s*:\s*\d+\s*[,;]/ || + # other possible extensions of declaration lines + $sline =~ /^\+\s+\(?\s*(?:$Compare|$Assignment|$Operators)/) && + # indentation of previous and current line are the same + (($prevline =~ /\+(\s+)\S/) && $sline =~ /^\+$1\S/)) { + if (WARN("LINE_SPACING", + "Missing a blank line after declarations\n" . $hereprev) && + $fix) { + fix_insert_line($fixlinenr, "\+"); + } + } + +# check for spaces at the beginning of a line. +# Exceptions: +# 1) within comments +# 2) indented preprocessor commands +# 3) hanging labels + if ($rawline =~ /^\+ / && $line !~ /^\+ *(?:$;|#|$Ident:)/) { + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; + if (WARN("LEADING_SPACE", + "please, no spaces at the start of a line\n" . $herevet) && + $fix) { + $fixed[$fixlinenr] =~ s/^\+([ \t]+)/"\+" . tabify($1)/e; + } + } + +# check we are in a valid C source file if not then ignore this hunk + next if ($realfile !~ /\.(h|c)$/); + +# check for unusual line ending [ or ( + if ($line =~ /^\+.*([\[\(])\s*$/) { + CHK("OPEN_ENDED_LINE", + "Lines should not end with a '$1'\n" . $herecurr); + } + +# check if this appears to be the start function declaration, save the name + if ($sline =~ /^\+\{\s*$/ && + $prevline =~ /^\+(?:(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*)?($Ident)\(/) { + $context_function = $1; + } + +# check if this appears to be the end of function declaration + if ($sline =~ /^\+\}\s*$/) { + undef $context_function; + } + +# check indentation of any line with a bare else +# (but not if it is a multiple line "if (foo) return bar; else return baz;") +# if the previous line is a break or return and is indented 1 tab more... + if ($sline =~ /^\+([\t]+)(?:}[ \t]*)?else(?:[ \t]*{)?\s*$/) { + my $tabs = length($1) + 1; + if ($prevline =~ /^\+\t{$tabs,$tabs}break\b/ || + ($prevline =~ /^\+\t{$tabs,$tabs}return\b/ && + defined $lines[$linenr] && + $lines[$linenr] !~ /^[ \+]\t{$tabs,$tabs}return/)) { + WARN("UNNECESSARY_ELSE", + "else is not generally useful after a break or return\n" . $hereprev); + } + } + +# check indentation of a line with a break; +# if the previous line is a goto or return and is indented the same # of tabs + if ($sline =~ /^\+([\t]+)break\s*;\s*$/) { + my $tabs = $1; + if ($prevline =~ /^\+$tabs(?:goto|return)\b/) { + WARN("UNNECESSARY_BREAK", + "break is not useful after a goto or return\n" . $hereprev); + } + } + +# check for RCS/CVS revision markers + if ($rawline =~ /^\+.*\$(Revision|Log|Id)(?:\$|)/) { + WARN("CVS_KEYWORD", + "CVS style keyword markers, these will _not_ be updated\n". $herecurr); + } + +# check for old HOTPLUG __dev<foo> section markings + if ($line =~ /\b(__dev(init|exit)(data|const|))\b/) { + WARN("HOTPLUG_SECTION", + "Using $1 is unnecessary\n" . $herecurr); + } + +# Check for potential 'bare' types + my ($stat, $cond, $line_nr_next, $remain_next, $off_next, + $realline_next); +#print "LINE<$line>\n"; + if ($linenr > $suppress_statement && + $realcnt && $sline =~ /.\s*\S/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0); + $stat =~ s/\n./\n /g; + $cond =~ s/\n./\n /g; + +#print "linenr<$linenr> <$stat>\n"; + # If this statement has no statement boundaries within + # it there is no point in retrying a statement scan + # until we hit end of it. + my $frag = $stat; $frag =~ s/;+\s*$//; + if ($frag !~ /(?:{|;)/) { +#print "skip<$line_nr_next>\n"; + $suppress_statement = $line_nr_next; + } + + # Find the real next line. + $realline_next = $line_nr_next; + if (defined $realline_next && + (!defined $lines[$realline_next - 1] || + substr($lines[$realline_next - 1], $off_next) =~ /^\s*$/)) { + $realline_next++; + } + + my $s = $stat; + $s =~ s/{.*$//s; + + # Ignore goto labels. + if ($s =~ /$Ident:\*$/s) { + + # Ignore functions being called + } elsif ($s =~ /^.\s*$Ident\s*\(/s) { + + } elsif ($s =~ /^.\s*else\b/s) { + + # declarations always start with types + } elsif ($prev_values eq 'E' && $s =~ /^.\s*(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?((?:\s*$Ident)+?)\b(?:\s+$Sparse)?\s*\**\s*(?:$Ident|\(\*[^\)]*\))(?:\s*$Modifier)?\s*(?:;|=|,|\()/s) { + my $type = $1; + $type =~ s/\s+/ /g; + possible($type, "A:" . $s); + + # definitions in global scope can only start with types + } elsif ($s =~ /^.(?:$Storage\s+)?(?:$Inline\s+)?(?:const\s+)?($Ident)\b\s*(?!:)/s) { + possible($1, "B:" . $s); + } + + # any (foo ... *) is a pointer cast, and foo is a type + while ($s =~ /\(($Ident)(?:\s+$Sparse)*[\s\*]+\s*\)/sg) { + possible($1, "C:" . $s); + } + + # Check for any sort of function declaration. + # int foo(something bar, other baz); + # void (*store_gdt)(x86_descr_ptr *); + if ($prev_values eq 'E' && $s =~ /^(.(?:typedef\s*)?(?:(?:$Storage|$Inline)\s*)*\s*$Type\s*(?:\b$Ident|\(\*\s*$Ident\))\s*)\(/s) { + my ($name_len) = length($1); + + my $ctx = $s; + substr($ctx, 0, $name_len + 1, ''); + $ctx =~ s/\)[^\)]*$//; + + for my $arg (split(/\s*,\s*/, $ctx)) { + if ($arg =~ /^(?:const\s+)?($Ident)(?:\s+$Sparse)*\s*\**\s*(:?\b$Ident)?$/s || $arg =~ /^($Ident)$/s) { + + possible($1, "D:" . $s); + } + } + } + + } + +# +# Checks which may be anchored in the context. +# + +# Check for switch () and associated case and default +# statements should be at the same indent. + if ($line=~/\bswitch\s*\(.*\)/) { + my $err = ''; + my $sep = ''; + my @ctx = ctx_block_outer($linenr, $realcnt); + shift(@ctx); + for my $ctx (@ctx) { + my ($clen, $cindent) = line_stats($ctx); + if ($ctx =~ /^\+\s*(case\s+|default:)/ && + $indent != $cindent) { + $err .= "$sep$ctx\n"; + $sep = ''; + } else { + $sep = "[...]\n"; + } + } + if ($err ne '') { + ERROR("SWITCH_CASE_INDENT_LEVEL", + "switch and case should be at the same indent\n$hereline$err"); + } + } + +# if/while/etc brace do not go on next line, unless defining a do while loop, +# or if that brace on the next line is for something else + if ($line =~ /(.*)\b((?:if|while|for|switch|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b|else\b)/ && $line !~ /^.\s*\#/) { + my $pre_ctx = "$1$2"; + + my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); + + if ($line =~ /^\+\t{6,}/) { + WARN("DEEP_INDENTATION", + "Too many leading tabs - consider code refactoring\n" . $herecurr); + } + + my $ctx_cnt = $realcnt - $#ctx - 1; + my $ctx = join("\n", @ctx); + + my $ctx_ln = $linenr; + my $ctx_skip = $realcnt; + + while ($ctx_skip > $ctx_cnt || ($ctx_skip == $ctx_cnt && + defined $lines[$ctx_ln - 1] && + $lines[$ctx_ln - 1] =~ /^-/)) { + ##print "SKIP<$ctx_skip> CNT<$ctx_cnt>\n"; + $ctx_skip-- if (!defined $lines[$ctx_ln - 1] || $lines[$ctx_ln - 1] !~ /^-/); + $ctx_ln++; + } + + #print "realcnt<$realcnt> ctx_cnt<$ctx_cnt>\n"; + #print "pre<$pre_ctx>\nline<$line>\nctx<$ctx>\nnext<$lines[$ctx_ln - 1]>\n"; + + if ($ctx !~ /{\s*/ && defined($lines[$ctx_ln - 1]) && $lines[$ctx_ln - 1] =~ /^\+\s*{/) { + ERROR("OPEN_BRACE", + "that open brace { should be on the previous line\n" . + "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n"); + } + if ($level == 0 && $pre_ctx !~ /}\s*while\s*\($/ && + $ctx =~ /\)\s*\;\s*$/ && + defined $lines[$ctx_ln - 1]) + { + my ($nlength, $nindent) = line_stats($lines[$ctx_ln - 1]); + if ($nindent > $indent) { + WARN("TRAILING_SEMICOLON", + "trailing semicolon indicates no statements, indent implies otherwise\n" . + "$here\n$ctx\n$rawlines[$ctx_ln - 1]\n"); + } + } + } + +# Check relative indent for conditionals and blocks. + if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0) + if (!defined $stat); + my ($s, $c) = ($stat, $cond); + + substr($s, 0, length($c), ''); + + # remove inline comments + $s =~ s/$;/ /g; + $c =~ s/$;/ /g; + + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + + # Make sure we remove the line prefixes as we have + # none on the first line, and are going to readd them + # where necessary. + $s =~ s/\n./\n/gs; + while ($s =~ /\n\s+\\\n/) { + $cond_lines += $s =~ s/\n\s+\\\n/\n/g; + } + + # We want to check the first line inside the block + # starting at the end of the conditional, so remove: + # 1) any blank line termination + # 2) any opening brace { on end of the line + # 3) any do (...) { + my $continuation = 0; + my $check = 0; + $s =~ s/^.*\bdo\b//; + $s =~ s/^\s*{//; + if ($s =~ s/^\s*\\//) { + $continuation = 1; + } + if ($s =~ s/^\s*?\n//) { + $check = 1; + $cond_lines++; + } + + # Also ignore a loop construct at the end of a + # preprocessor statement. + if (($prevline =~ /^.\s*#\s*define\s/ || + $prevline =~ /\\\s*$/) && $continuation == 0) { + $check = 0; + } + + my $cond_ptr = -1; + $continuation = 0; + while ($cond_ptr != $cond_lines) { + $cond_ptr = $cond_lines; + + # If we see an #else/#elif then the code + # is not linear. + if ($s =~ /^\s*\#\s*(?:else|elif)/) { + $check = 0; + } + + # Ignore: + # 1) blank lines, they should be at 0, + # 2) preprocessor lines, and + # 3) labels. + if ($continuation || + $s =~ /^\s*?\n/ || + $s =~ /^\s*#\s*?/ || + $s =~ /^\s*$Ident\s*:/) { + $continuation = ($s =~ /^.*?\\\n/) ? 1 : 0; + if ($s =~ s/^.*?\n//) { + $cond_lines++; + } + } + } + + my (undef, $sindent) = line_stats("+" . $s); + my $stat_real = raw_line($linenr, $cond_lines); + + # Check if either of these lines are modified, else + # this is not this patch's fault. + if (!defined($stat_real) || + $stat !~ /^\+/ && $stat_real !~ /^\+/) { + $check = 0; + } + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n"; + + if ($check && $s ne '' && + (($sindent % 8) != 0 || + ($sindent < $indent) || + ($sindent == $indent && + ($s !~ /^\s*(?:\}|\{|else\b)/)) || + ($sindent > $indent + 8))) { + WARN("SUSPECT_CODE_INDENT", + "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); + } + } + + # Track the 'values' across context and added lines. + my $opline = $line; $opline =~ s/^./ /; + my ($curr_values, $curr_vars) = + annotate_values($opline . "\n", $prev_values); + $curr_values = $prev_values . $curr_values; + if ($dbg_values) { + my $outline = $opline; $outline =~ s/\t/ /g; + print "$linenr > .$outline\n"; + print "$linenr > $curr_values\n"; + print "$linenr > $curr_vars\n"; + } + $prev_values = substr($curr_values, -1); + +#ignore lines not being added + next if ($line =~ /^[^\+]/); + +# check for dereferences that span multiple lines + if ($prevline =~ /^\+.*$Lval\s*(?:\.|->)\s*$/ && + $line =~ /^\+\s*(?!\#\s*(?!define\s+|if))\s*$Lval/) { + $prevline =~ /($Lval\s*(?:\.|->))\s*$/; + my $ref = $1; + $line =~ /^.\s*($Lval)/; + $ref .= $1; + $ref =~ s/\s//g; + WARN("MULTILINE_DEREFERENCE", + "Avoid multiple line dereference - prefer '$ref'\n" . $hereprev); + } + +# check for declarations of signed or unsigned without int + while ($line =~ m{\b($Declare)\s*(?!char\b|short\b|int\b|long\b)\s*($Ident)?\s*[=,;\[\)\(]}g) { + my $type = $1; + my $var = $2; + $var = "" if (!defined $var); + if ($type =~ /^(?:(?:$Storage|$Inline|$Attribute)\s+)*((?:un)?signed)((?:\s*\*)*)\s*$/) { + my $sign = $1; + my $pointer = $2; + + $pointer = "" if (!defined $pointer); + + if (WARN("UNSPECIFIED_INT", + "Prefer '" . trim($sign) . " int" . rtrim($pointer) . "' to bare use of '$sign" . rtrim($pointer) . "'\n" . $herecurr) && + $fix) { + my $decl = trim($sign) . " int "; + my $comp_pointer = $pointer; + $comp_pointer =~ s/\s//g; + $decl .= $comp_pointer; + $decl = rtrim($decl) if ($var eq ""); + $fixed[$fixlinenr] =~ s@\b$sign\s*\Q$pointer\E\s*$var\b@$decl$var@; + } + } + } + +# TEST: allow direct testing of the type matcher. + if ($dbg_type) { + if ($line =~ /^.\s*$Declare\s*$/) { + ERROR("TEST_TYPE", + "TEST: is type\n" . $herecurr); + } elsif ($dbg_type > 1 && $line =~ /^.+($Declare)/) { + ERROR("TEST_NOT_TYPE", + "TEST: is not type ($1 is)\n". $herecurr); + } + next; + } +# TEST: allow direct testing of the attribute matcher. + if ($dbg_attr) { + if ($line =~ /^.\s*$Modifier\s*$/) { + ERROR("TEST_ATTR", + "TEST: is attr\n" . $herecurr); + } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { + ERROR("TEST_NOT_ATTR", + "TEST: is not attr ($1 is)\n". $herecurr); + } + next; + } + +# check for initialisation to aggregates open brace on the next line + if ($line =~ /^.\s*{/ && + $prevline =~ /(?:^|[^=])=\s*$/) { + if (ERROR("OPEN_BRACE", + "that open brace { should be on the previous line\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + $fixedline =~ s/\s*=\s*$/ = {/; + fix_insert_line($fixlinenr, $fixedline); + $fixedline = $line; + $fixedline =~ s/^(.\s*)\{\s*/$1/; + fix_insert_line($fixlinenr, $fixedline); + } + } + +# +# Checks which are anchored on the added line. +# + +# check for malformed paths in #include statements (uses RAW line) + if ($rawline =~ m{^.\s*\#\s*include\s+[<"](.*)[">]}) { + my $path = $1; + if ($path =~ m{//}) { + ERROR("MALFORMED_INCLUDE", + "malformed #include filename\n" . $herecurr); + } + if ($path =~ "^uapi/" && $realfile =~ m@\binclude/uapi/@) { + ERROR("UAPI_INCLUDE", + "No #include in ...include/uapi/... should use a uapi/ path prefix\n" . $herecurr); + } + } + +# no C99 // comments + if ($line =~ m{//}) { + if (ERROR("C99_COMMENTS", + "do not use C99 // comments\n" . $herecurr) && + $fix) { + my $line = $fixed[$fixlinenr]; + if ($line =~ /\/\/(.*)$/) { + my $comment = trim($1); + $fixed[$fixlinenr] =~ s@\/\/(.*)$@/\* $comment \*/@; + } + } + } + # Remove C99 comments. + $line =~ s@//.*@@; + $opline =~ s@//.*@@; + +# EXPORT_SYMBOL should immediately follow the thing it is exporting, consider +# the whole statement. +#print "APW <$lines[$realline_next - 1]>\n"; + if (defined $realline_next && + exists $lines[$realline_next - 1] && + !defined $suppress_export{$realline_next} && + ($lines[$realline_next - 1] =~ /EXPORT_SYMBOL.*\((.*)\)/ || + $lines[$realline_next - 1] =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { + # Handle definitions which produce identifiers with + # a prefix: + # XXX(foo); + # EXPORT_SYMBOL(something_foo); + my $name = $1; + if ($stat =~ /^(?:.\s*}\s*\n)?.([A-Z_]+)\s*\(\s*($Ident)/ && + $name =~ /^${Ident}_$2/) { +#print "FOO C name<$name>\n"; + $suppress_export{$realline_next} = 1; + + } elsif ($stat !~ /(?: + \n.}\s*$| + ^.DEFINE_$Ident\(\Q$name\E\)| + ^.DECLARE_$Ident\(\Q$name\E\)| + ^.LIST_HEAD\(\Q$name\E\)| + ^.(?:$Storage\s+)?$Type\s*\(\s*\*\s*\Q$name\E\s*\)\s*\(| + \b\Q$name\E(?:\s+$Attribute)*\s*(?:;|=|\[|\() + )/x) { +#print "FOO A<$lines[$realline_next - 1]> stat<$stat> name<$name>\n"; + $suppress_export{$realline_next} = 2; + } else { + $suppress_export{$realline_next} = 1; + } + } + if (!defined $suppress_export{$linenr} && + $prevline =~ /^.\s*$/ && + ($line =~ /EXPORT_SYMBOL.*\((.*)\)/ || + $line =~ /EXPORT_UNUSED_SYMBOL.*\((.*)\)/)) { +#print "FOO B <$lines[$linenr - 1]>\n"; + $suppress_export{$linenr} = 2; + } + if (defined $suppress_export{$linenr} && + $suppress_export{$linenr} == 2) { + WARN("EXPORT_SYMBOL", + "EXPORT_SYMBOL(foo); should immediately follow its function/variable\n" . $herecurr); + } + +# check for global initialisers. + if ($line =~ /^\+$Type\s*$Ident(?:\s+$Modifier)*\s*=\s*($zero_initializer)\s*;/) { + if (ERROR("GLOBAL_INITIALISERS", + "do not initialise globals to $1\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^.$Type\s*$Ident(?:\s+$Modifier)*)\s*=\s*$zero_initializer\s*;/$1;/; + } + } +# check for static initialisers. + if ($line =~ /^\+.*\bstatic\s.*=\s*($zero_initializer)\s*;/) { + if (ERROR("INITIALISED_STATIC", + "do not initialise statics to $1\n" . + $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(\bstatic\s.*?)\s*=\s*$zero_initializer\s*;/$1;/; + } + } + +# check for misordered declarations of char/short/int/long with signed/unsigned + while ($sline =~ m{(\b$TypeMisordered\b)}g) { + my $tmp = trim($1); + WARN("MISORDERED_TYPE", + "type '$tmp' should be specified in [[un]signed] [short|int|long|long long] order\n" . $herecurr); + } + +# check for unnecessary <signed> int declarations of short/long/long long + while ($sline =~ m{\b($TypeMisordered(\s*\*)*|$C90_int_types)\b}g) { + my $type = trim($1); + next if ($type !~ /\bint\b/); + next if ($type !~ /\b(?:short|long\s+long|long)\b/); + my $new_type = $type; + $new_type =~ s/\b\s*int\s*\b/ /; + $new_type =~ s/\b\s*(?:un)?signed\b\s*/ /; + $new_type =~ s/^const\s+//; + $new_type = "unsigned $new_type" if ($type =~ /\bunsigned\b/); + $new_type = "const $new_type" if ($type =~ /^const\b/); + $new_type =~ s/\s+/ /g; + $new_type = trim($new_type); + if (WARN("UNNECESSARY_INT", + "Prefer '$new_type' over '$type' as the int is unnecessary\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b\Q$type\E\b/$new_type/; + } + } + +# check for static const char * arrays. + if ($line =~ /\bstatic\s+const\s+char\s*\*\s*(\w+)\s*\[\s*\]\s*=\s*/) { + WARN("STATIC_CONST_CHAR_ARRAY", + "static const char * array should probably be static const char * const\n" . + $herecurr); + } + +# check for initialized const char arrays that should be static const + if ($line =~ /^\+\s*const\s+(char|unsigned\s+char|_*u8|(?:[us]_)?int8_t)\s+\w+\s*\[\s*(?:\w+\s*)?\]\s*=\s*"/) { + if (WARN("STATIC_CONST_CHAR_ARRAY", + "const array should probably be static const\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(^.\s*)const\b/${1}static const/; + } + } + +# check for static char foo[] = "bar" declarations. + if ($line =~ /\bstatic\s+char\s+(\w+)\s*\[\s*\]\s*=\s*"/) { + WARN("STATIC_CONST_CHAR_ARRAY", + "static char array declaration should probably be static const char\n" . + $herecurr); + } + +# check for const <foo> const where <foo> is not a pointer or array type + if ($sline =~ /\bconst\s+($BasicType)\s+const\b/) { + my $found = $1; + if ($sline =~ /\bconst\s+\Q$found\E\s+const\b\s*\*/) { + WARN("CONST_CONST", + "'const $found const *' should probably be 'const $found * const'\n" . $herecurr); + } elsif ($sline !~ /\bconst\s+\Q$found\E\s+const\s+\w+\s*\[/) { + WARN("CONST_CONST", + "'const $found const' should probably be 'const $found'\n" . $herecurr); + } + } + +# check for non-global char *foo[] = {"bar", ...} declarations. + if ($line =~ /^.\s+(?:static\s+|const\s+)?char\s+\*\s*\w+\s*\[\s*\]\s*=\s*\{/) { + WARN("STATIC_CONST_CHAR_ARRAY", + "char * array declaration might be better as static const\n" . + $herecurr); + } + +# check for sizeof(foo)/sizeof(foo[0]) that could be ARRAY_SIZE(foo) + if ($line =~ m@\bsizeof\s*\(\s*($Lval)\s*\)@) { + my $array = $1; + if ($line =~ m@\b(sizeof\s*\(\s*\Q$array\E\s*\)\s*/\s*sizeof\s*\(\s*\Q$array\E\s*\[\s*0\s*\]\s*\))@) { + my $array_div = $1; + if (WARN("ARRAY_SIZE", + "Prefer ARRAY_SIZE($array)\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\Q$array_div\E/ARRAY_SIZE($array)/; + } + } + } + +# check for function declarations without arguments like "int foo()" + if ($line =~ /(\b$Type\s+$Ident)\s*\(\s*\)/) { + if (ERROR("FUNCTION_WITHOUT_ARGS", + "Bad function definition - $1() should probably be $1(void)\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(\b($Type)\s+($Ident))\s*\(\s*\)/$2 $3(void)/; + } + } + +# check for new typedefs, only function parameters and sparse annotations +# make sense. + if ($line =~ /\btypedef\s/ && + $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ && + $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ && + $line !~ /\b$typeTypedefs\b/ && + $line !~ /\b__bitwise\b/) { + WARN("NEW_TYPEDEFS", + "do not add new typedefs\n" . $herecurr); + } + +# * goes on variable not on type + # (char*[ const]) + while ($line =~ m{(\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\))}g) { + #print "AA<$1>\n"; + my ($ident, $from, $to) = ($1, $2, $2); + + # Should start with a space. + $to =~ s/^(\S)/ $1/; + # Should not end with a space. + $to =~ s/\s+$//; + # '*'s should not have spaces between. + while ($to =~ s/\*\s+\*/\*\*/) { + } + +## print "1: from<$from> to<$to> ident<$ident>\n"; + if ($from ne $to) { + if (ERROR("POINTER_LOCATION", + "\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr) && + $fix) { + my $sub_from = $ident; + my $sub_to = $ident; + $sub_to =~ s/\Q$from\E/$to/; + $fixed[$fixlinenr] =~ + s@\Q$sub_from\E@$sub_to@; + } + } + } + while ($line =~ m{(\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident))}g) { + #print "BB<$1>\n"; + my ($match, $from, $to, $ident) = ($1, $2, $2, $3); + + # Should start with a space. + $to =~ s/^(\S)/ $1/; + # Should not end with a space. + $to =~ s/\s+$//; + # '*'s should not have spaces between. + while ($to =~ s/\*\s+\*/\*\*/) { + } + # Modifiers should have spaces. + $to =~ s/(\b$Modifier$)/$1 /; + +## print "2: from<$from> to<$to> ident<$ident>\n"; + if ($from ne $to && $ident !~ /^$Modifier$/) { + if (ERROR("POINTER_LOCATION", + "\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr) && + $fix) { + + my $sub_from = $match; + my $sub_to = $match; + $sub_to =~ s/\Q$from\E/$to/; + $fixed[$fixlinenr] =~ + s@\Q$sub_from\E@$sub_to@; + } + } + } + +# avoid BUG() or BUG_ON() + if ($line =~ /\b(?:BUG|BUG_ON)\b/) { + my $msg_level = \&WARN; + $msg_level = \&CHK if ($file); + &{$msg_level}("AVOID_BUG", + "Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()\n" . $herecurr); + } + +# avoid LINUX_VERSION_CODE + if ($line =~ /\bLINUX_VERSION_CODE\b/) { + WARN("LINUX_VERSION_CODE", + "LINUX_VERSION_CODE should be avoided, code should be for the version to which it is merged\n" . $herecurr); + } + +# check for uses of printk_ratelimit + if ($line =~ /\bprintk_ratelimit\s*\(/) { + WARN("PRINTK_RATELIMITED", + "Prefer printk_ratelimited or pr_<level>_ratelimited to printk_ratelimit\n" . $herecurr); + } + +# printk should use KERN_* levels + if ($line =~ /\bprintk\s*\(\s*(?!KERN_[A-Z]+\b)/) { + WARN("PRINTK_WITHOUT_KERN_LEVEL", + "printk() should include KERN_<LEVEL> facility level\n" . $herecurr); + } + + if ($line =~ /\bprintk\s*\(\s*KERN_([A-Z]+)/) { + my $orig = $1; + my $level = lc($orig); + $level = "warn" if ($level eq "warning"); + my $level2 = $level; + $level2 = "dbg" if ($level eq "debug"); + WARN("PREFER_PR_LEVEL", + "Prefer [subsystem eg: netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr); + } + + if ($line =~ /\bpr_warning\s*\(/) { + if (WARN("PREFER_PR_LEVEL", + "Prefer pr_warn(... to pr_warning(...\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\bpr_warning\b/pr_warn/; + } + } + + if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) { + my $orig = $1; + my $level = lc($orig); + $level = "warn" if ($level eq "warning"); + $level = "dbg" if ($level eq "debug"); + WARN("PREFER_DEV_LEVEL", + "Prefer dev_$level(... to dev_printk(KERN_$orig, ...\n" . $herecurr); + } + +# ENOSYS means "bad syscall nr" and nothing else. This will have a small +# number of false positives, but assembly files are not checked, so at +# least the arch entry code will not trigger this warning. + if ($line =~ /\bENOSYS\b/) { + WARN("ENOSYS", + "ENOSYS means 'invalid syscall nr' and nothing else\n" . $herecurr); + } + +# function brace can't be on same line, except for #defines of do while, +# or if closed on same line + if ($perl_version_ok && + $sline =~ /$Type\s*$Ident\s*$balanced_parens\s*\{/ && + $sline !~ /\#\s*define\b.*do\s*\{/ && + $sline !~ /}/) { + if (ERROR("OPEN_BRACE", + "open brace '{' following function definitions go on the next line\n" . $herecurr) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + my $fixed_line = $rawline; + $fixed_line =~ /(^..*$Type\s*$Ident\(.*\)\s*){(.*)$/; + my $line1 = $1; + my $line2 = $2; + fix_insert_line($fixlinenr, ltrim($line1)); + fix_insert_line($fixlinenr, "\+{"); + if ($line2 !~ /^\s*$/) { + fix_insert_line($fixlinenr, "\+\t" . trim($line2)); + } + } + } + +# open braces for enum, union and struct go on the same line. + if ($line =~ /^.\s*{/ && + $prevline =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident)?\s*$/) { + if (ERROR("OPEN_BRACE", + "open brace '{' following $1 go on the same line\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = rtrim($prevrawline) . " {"; + fix_insert_line($fixlinenr, $fixedline); + $fixedline = $rawline; + $fixedline =~ s/^(.\s*)\{\s*/$1\t/; + if ($fixedline !~ /^\+\s*$/) { + fix_insert_line($fixlinenr, $fixedline); + } + } + } + +# missing space after union, struct or enum definition + if ($line =~ /^.\s*(?:typedef\s+)?(enum|union|struct)(?:\s+$Ident){1,2}[=\{]/) { + if (WARN("SPACING", + "missing space after $1 definition\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.\s*(?:typedef\s+)?(?:enum|union|struct)(?:\s+$Ident){1,2})([=\{])/$1 $2/; + } + } + +# Function pointer declarations +# check spacing between type, funcptr, and args +# canonical declaration is "type (*funcptr)(args...)" + if ($line =~ /^.\s*($Declare)\((\s*)\*(\s*)($Ident)(\s*)\)(\s*)\(/) { + my $declare = $1; + my $pre_pointer_space = $2; + my $post_pointer_space = $3; + my $funcname = $4; + my $post_funcname_space = $5; + my $pre_args_space = $6; + +# the $Declare variable will capture all spaces after the type +# so check it for a missing trailing missing space but pointer return types +# don't need a space so don't warn for those. + my $post_declare_space = ""; + if ($declare =~ /(\s+)$/) { + $post_declare_space = $1; + $declare = rtrim($declare); + } + if ($declare !~ /\*$/ && $post_declare_space =~ /^$/) { + WARN("SPACING", + "missing space after return type\n" . $herecurr); + $post_declare_space = " "; + } + +# unnecessary space "type (*funcptr)(args...)" +# This test is not currently implemented because these declarations are +# equivalent to +# int foo(int bar, ...) +# and this is form shouldn't/doesn't generate a checkpatch warning. +# +# elsif ($declare =~ /\s{2,}$/) { +# WARN("SPACING", +# "Multiple spaces after return type\n" . $herecurr); +# } + +# unnecessary space "type ( *funcptr)(args...)" + if (defined $pre_pointer_space && + $pre_pointer_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space after function pointer open parenthesis\n" . $herecurr); + } + +# unnecessary space "type (* funcptr)(args...)" + if (defined $post_pointer_space && + $post_pointer_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space before function pointer name\n" . $herecurr); + } + +# unnecessary space "type (*funcptr )(args...)" + if (defined $post_funcname_space && + $post_funcname_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space after function pointer name\n" . $herecurr); + } + +# unnecessary space "type (*funcptr) (args...)" + if (defined $pre_args_space && + $pre_args_space =~ /^\s/) { + WARN("SPACING", + "Unnecessary space before function pointer arguments\n" . $herecurr); + } + + if (show_type("SPACING") && $fix) { + $fixed[$fixlinenr] =~ + s/^(.\s*)$Declare\s*\(\s*\*\s*$Ident\s*\)\s*\(/$1 . $declare . $post_declare_space . '(*' . $funcname . ')('/ex; + } + } + +# check for spacing round square brackets; allowed: +# 1. with a type on the left -- int [] a; +# 2. at the beginning of a line for slice initialisers -- [0...10] = 5, +# 3. inside a curly brace -- = { [0...10] = 5 } + while ($line =~ /(.*?\s)\[/g) { + my ($where, $prefix) = ($-[1], $1); + if ($prefix !~ /$Type\s+$/ && + ($where != 0 || $prefix !~ /^.\s+$/) && + $prefix !~ /[{,:]\s+$/) { + if (ERROR("BRACKET_SPACE", + "space prohibited before open square bracket '['\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(\+.*?)\s+\[/$1\[/; + } + } + } + +# check for spaces between functions and their parentheses. + while ($line =~ /($Ident)\s+\(/g) { + my $name = $1; + my $ctx_before = substr($line, 0, $-[1]); + my $ctx = "$ctx_before$name"; + + # Ignore those directives where spaces _are_ permitted. + if ($name =~ /^(?: + if|for|while|switch|return|case| + volatile|__volatile__| + __attribute__|format|__extension__| + asm|__asm__)$/x) + { + # cpp #define statements have non-optional spaces, ie + # if there is a space between the name and the open + # parenthesis it is simply not a parameter group. + } elsif ($ctx_before =~ /^.\s*\#\s*define\s*$/) { + + # cpp #elif statement condition may start with a ( + } elsif ($ctx =~ /^.\s*\#\s*elif\s*$/) { + + # If this whole things ends with a type its most + # likely a typedef for a function. + } elsif ($ctx =~ /$Type$/) { + + } else { + if (WARN("SPACING", + "space prohibited between function name and open parenthesis '('\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\b$name\s+\(/$name\(/; + } + } + } + +# Check operator spacing. + if (!($line=~/\#\s*include/)) { + my $fixed_line = ""; + my $line_fixed = 0; + + my $ops = qr{ + <<=|>>=|<=|>=|==|!=| + \+=|-=|\*=|\/=|%=|\^=|\|=|&=| + =>|->|<<|>>|<|>|=|!|~| + &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|%| + \?:|\?|: + }x; + my @elements = split(/($ops|;)/, $opline); + +## print("element count: <" . $#elements . ">\n"); +## foreach my $el (@elements) { +## print("el: <$el>\n"); +## } + + my @fix_elements = (); + my $off = 0; + + foreach my $el (@elements) { + push(@fix_elements, substr($rawline, $off, length($el))); + $off += length($el); + } + + $off = 0; + + my $blank = copy_spacing($opline); + my $last_after = -1; + + for (my $n = 0; $n < $#elements; $n += 2) { + + my $good = $fix_elements[$n] . $fix_elements[$n + 1]; + +## print("n: <$n> good: <$good>\n"); + + $off += length($elements[$n]); + + # Pick up the preceding and succeeding characters. + my $ca = substr($opline, 0, $off); + my $cc = ''; + if (length($opline) >= ($off + length($elements[$n + 1]))) { + $cc = substr($opline, $off + length($elements[$n + 1])); + } + my $cb = "$ca$;$cc"; + + my $a = ''; + $a = 'V' if ($elements[$n] ne ''); + $a = 'W' if ($elements[$n] =~ /\s$/); + $a = 'C' if ($elements[$n] =~ /$;$/); + $a = 'B' if ($elements[$n] =~ /(\[|\()$/); + $a = 'O' if ($elements[$n] eq ''); + $a = 'E' if ($ca =~ /^\s*$/); + + my $op = $elements[$n + 1]; + + my $c = ''; + if (defined $elements[$n + 2]) { + $c = 'V' if ($elements[$n + 2] ne ''); + $c = 'W' if ($elements[$n + 2] =~ /^\s/); + $c = 'C' if ($elements[$n + 2] =~ /^$;/); + $c = 'B' if ($elements[$n + 2] =~ /^(\)|\]|;)/); + $c = 'O' if ($elements[$n + 2] eq ''); + $c = 'E' if ($elements[$n + 2] =~ /^\s*\\$/); + } else { + $c = 'E'; + } + + my $ctx = "${a}x${c}"; + + my $at = "(ctx:$ctx)"; + + my $ptr = substr($blank, 0, $off) . "^"; + my $hereptr = "$hereline$ptr\n"; + + # Pull out the value of this operator. + my $op_type = substr($curr_values, $off + 1, 1); + + # Get the full operator variant. + my $opv = $op . substr($curr_vars, $off, 1); + + # Ignore operators passed as parameters. + if ($op_type ne 'V' && + $ca =~ /\s$/ && $cc =~ /^\s*[,\)]/) { + +# # Ignore comments +# } elsif ($op =~ /^$;+$/) { + + # ; should have either the end of line or a space or \ after it + } elsif ($op eq ';') { + if ($ctx !~ /.x[WEBC]/ && + $cc !~ /^\\/ && $cc !~ /^;/) { + if (ERROR("SPACING", + "space required after that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]) . " "; + $line_fixed = 1; + } + } + + # // is a comment + } elsif ($op eq '//') { + + # : when part of a bitfield + } elsif ($opv eq ':B') { + # skip the bitfield test for now + + # No spaces for: + # -> + } elsif ($op eq '->') { + if ($ctx =~ /Wx.|.xW/) { + if (ERROR("SPACING", + "spaces prohibited around that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # , must not have a space before and must have a space on the right. + } elsif ($op eq ',') { + my $rtrim_before = 0; + my $space_after = 0; + if ($ctx =~ /Wx./) { + if (ERROR("SPACING", + "space prohibited before that '$op' $at\n" . $hereptr)) { + $line_fixed = 1; + $rtrim_before = 1; + } + } + if ($ctx !~ /.x[WEC]/ && $cc !~ /^}/) { + if (ERROR("SPACING", + "space required after that '$op' $at\n" . $hereptr)) { + $line_fixed = 1; + $last_after = $n; + $space_after = 1; + } + } + if ($rtrim_before || $space_after) { + if ($rtrim_before) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + } else { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]); + } + if ($space_after) { + $good .= " "; + } + } + + # '*' as part of a type definition -- reported already. + } elsif ($opv eq '*_') { + #warn "'*' is part of type\n"; + + # unary operators should have a space before and + # none after. May be left adjacent to another + # unary operator, or a cast + } elsif ($op eq '!' || $op eq '~' || + $opv eq '*U' || $opv eq '-U' || + $opv eq '&U' || $opv eq '&&U') { + if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { + if (ERROR("SPACING", + "space required before that '$op' $at\n" . $hereptr)) { + if ($n != $last_after + 2) { + $good = $fix_elements[$n] . " " . ltrim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + } + if ($op eq '*' && $cc =~/\s*$Modifier\b/) { + # A unary '*' may be const + + } elsif ($ctx =~ /.xW/) { + if (ERROR("SPACING", + "space prohibited after that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . rtrim($fix_elements[$n + 1]); + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # unary ++ and unary -- are allowed no space on one side. + } elsif ($op eq '++' or $op eq '--') { + if ($ctx !~ /[WEOBC]x[^W]/ && $ctx !~ /[^W]x[WOBEC]/) { + if (ERROR("SPACING", + "space required one side of that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]) . " "; + $line_fixed = 1; + } + } + if ($ctx =~ /Wx[BE]/ || + ($ctx =~ /Wx./ && $cc =~ /^;/)) { + if (ERROR("SPACING", + "space prohibited before that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + if ($ctx =~ /ExW/) { + if (ERROR("SPACING", + "space prohibited after that '$op' $at\n" . $hereptr)) { + $good = $fix_elements[$n] . trim($fix_elements[$n + 1]); + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # << and >> may either have or not have spaces both sides + } elsif ($op eq '<<' or $op eq '>>' or + $op eq '&' or $op eq '^' or $op eq '|' or + $op eq '+' or $op eq '-' or + $op eq '*' or $op eq '/' or + $op eq '%') + { + if ($check) { + if (defined $fix_elements[$n + 2] && $ctx !~ /[EW]x[EW]/) { + if (CHK("SPACING", + "spaces preferred around that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; + $fix_elements[$n + 2] =~ s/^\s+//; + $line_fixed = 1; + } + } elsif (!defined $fix_elements[$n + 2] && $ctx !~ /Wx[OE]/) { + if (CHK("SPACING", + "space preferred before that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + } elsif ($ctx =~ /Wx[^WCE]|[^WCE]xW/) { + if (ERROR("SPACING", + "need consistent spacing around '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + + # A colon needs no spaces before when it is + # terminating a case value or a label. + } elsif ($opv eq ':C' || $opv eq ':L') { + if ($ctx =~ /Wx./) { + if (ERROR("SPACING", + "space prohibited before that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . trim($fix_elements[$n + 1]); + $line_fixed = 1; + } + } + + # All the others need spaces both sides. + } elsif ($ctx !~ /[EWC]x[CWE]/) { + my $ok = 0; + + # Ignore email addresses <foo@bar> + if (($op eq '<' && + $cc =~ /^\S+\@\S+>/) || + ($op eq '>' && + $ca =~ /<\S+\@\S+$/)) + { + $ok = 1; + } + + # for asm volatile statements + # ignore a colon with another + # colon immediately before or after + if (($op eq ':') && + ($ca =~ /:$/ || $cc =~ /^:/)) { + $ok = 1; + } + + # messages are ERROR, but ?: are CHK + if ($ok == 0) { + my $msg_level = \&ERROR; + $msg_level = \&CHK if (($op eq '?:' || $op eq '?' || $op eq ':') && $ctx =~ /VxV/); + + if (&{$msg_level}("SPACING", + "spaces required around that '$op' $at\n" . $hereptr)) { + $good = rtrim($fix_elements[$n]) . " " . trim($fix_elements[$n + 1]) . " "; + if (defined $fix_elements[$n + 2]) { + $fix_elements[$n + 2] =~ s/^\s+//; + } + $line_fixed = 1; + } + } + } + $off += length($elements[$n + 1]); + +## print("n: <$n> GOOD: <$good>\n"); + + $fixed_line = $fixed_line . $good; + } + + if (($#elements % 2) == 0) { + $fixed_line = $fixed_line . $fix_elements[$#elements]; + } + + if ($fix && $line_fixed && $fixed_line ne $fixed[$fixlinenr]) { + $fixed[$fixlinenr] = $fixed_line; + } + + + } + +# check for whitespace before a non-naked semicolon + if ($line =~ /^\+.*\S\s+;\s*$/) { + if (WARN("SPACING", + "space prohibited before semicolon\n" . $herecurr) && + $fix) { + 1 while $fixed[$fixlinenr] =~ + s/^(\+.*\S)\s+;/$1;/; + } + } + +# check for multiple assignments + if ($line =~ /^.\s*$Lval\s*=\s*$Lval\s*=(?!=)/) { + CHK("MULTIPLE_ASSIGNMENTS", + "multiple assignments should be avoided\n" . $herecurr); + } + +## # check for multiple declarations, allowing for a function declaration +## # continuation. +## if ($line =~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Ident.*/ && +## $line !~ /^.\s*$Type\s+$Ident(?:\s*=[^,{]*)?\s*,\s*$Type\s*$Ident.*/) { +## +## # Remove any bracketed sections to ensure we do not +## # falsly report the parameters of functions. +## my $ln = $line; +## while ($ln =~ s/\([^\(\)]*\)//g) { +## } +## if ($ln =~ /,/) { +## WARN("MULTIPLE_DECLARATION", +## "declaring multiple variables together should be avoided\n" . $herecurr); +## } +## } + +#need space before brace following if, while, etc + if (($line =~ /\(.*\)\{/ && $line !~ /\($Type\)\{/) || + $line =~ /\b(?:else|do)\{/) { + if (ERROR("SPACING", + "space required before the open brace '{'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+.*(?:do|else|\)))\{/$1 {/; + } + } + +## # check for blank lines before declarations +## if ($line =~ /^.\t+$Type\s+$Ident(?:\s*=.*)?;/ && +## $prevrawline =~ /^.\s*$/) { +## WARN("SPACING", +## "No blank lines before declarations\n" . $hereprev); +## } +## + +# closing brace should have a space following it when it has anything +# on the line + if ($line =~ /}(?!(?:,|;|\)|\}))\S/) { + if (ERROR("SPACING", + "space required after that close brace '}'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/}((?!(?:,|;|\)))\S)/} $1/; + } + } + +# check spacing on square brackets + if ($line =~ /\[\s/ && $line !~ /\[\s*$/) { + if (ERROR("SPACING", + "space prohibited after that open square bracket '['\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\[\s+/\[/; + } + } + if ($line =~ /\s\]/) { + if (ERROR("SPACING", + "space prohibited before that close square bracket ']'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\s+\]/\]/; + } + } + +# check spacing on parentheses + if ($line =~ /\(\s/ && $line !~ /\(\s*(?:\\)?$/ && + $line !~ /for\s*\(\s+;/) { + if (ERROR("SPACING", + "space prohibited after that open parenthesis '('\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\(\s+/\(/; + } + } + if ($line =~ /(\s+)\)/ && $line !~ /^.\s*\)/ && + $line !~ /for\s*\(.*;\s+\)/ && + $line !~ /:\s+\)/) { + if (ERROR("SPACING", + "space prohibited before that close parenthesis ')'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\s+\)/\)/; + } + } + +# check unnecessary parentheses around addressof/dereference single $Lvals +# ie: &(foo->bar) should be &foo->bar and *(foo->bar) should be *foo->bar + + while ($line =~ /(?:[^&]&\s*|\*)\(\s*($Ident\s*(?:$Member\s*)+)\s*\)/g) { + my $var = $1; + if (CHK("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses around $var\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\(\s*\Q$var\E\s*\)/$var/; + } + } + +# check for unnecessary parentheses around function pointer uses +# ie: (foo->bar)(); should be foo->bar(); +# but not "if (foo->bar) (" to avoid some false positives + if ($line =~ /(\bif\s*|)(\(\s*$Ident\s*(?:$Member\s*)+\))[ \t]*\(/ && $1 !~ /^if/) { + my $var = $2; + if (CHK("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses around function pointer $var\n" . $herecurr) && + $fix) { + my $var2 = deparenthesize($var); + $var2 =~ s/\s//g; + $fixed[$fixlinenr] =~ s/\Q$var\E/$var2/; + } + } + +# check for unnecessary parentheses around comparisons in if uses +# when !drivers/staging or command-line uses --strict + if (($realfile !~ m@^(?:drivers/staging/)@ || $check_orig) && + $perl_version_ok && defined($stat) && + $stat =~ /(^.\s*if\s*($balanced_parens))/) { + my $if_stat = $1; + my $test = substr($2, 1, -1); + my $herectx; + while ($test =~ /(?:^|[^\w\&\!\~])+\s*\(\s*([\&\!\~]?\s*$Lval\s*(?:$Compare\s*$FuncArg)?)\s*\)/g) { + my $match = $1; + # avoid parentheses around potential macro args + next if ($match =~ /^\s*\w+\s*$/); + if (!defined($herectx)) { + $herectx = $here . "\n"; + my $cnt = statement_rawlines($if_stat); + for (my $n = 0; $n < $cnt; $n++) { + my $rl = raw_line($linenr, $n); + $herectx .= $rl . "\n"; + last if $rl =~ /^[ \+].*\{/; + } + } + CHK("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses around '$match'\n" . $herectx); + } + } + +#goto labels aren't indented, allow a single space however + if ($line=~/^.\s+[A-Za-z\d_]+:(?![0-9]+)/ and + !($line=~/^. [A-Za-z\d_]+:/) and !($line=~/^.\s+default:/)) { + if (WARN("INDENTED_LABEL", + "labels should not be indented\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.)\s+/$1/; + } + } + +# return is not a function + if (defined($stat) && $stat =~ /^.\s*return(\s*)\(/s) { + my $spacing = $1; + if ($perl_version_ok && + $stat =~ /^.\s*return\s*($balanced_parens)\s*;\s*$/) { + my $value = $1; + $value = deparenthesize($value); + if ($value =~ m/^\s*$FuncArg\s*(?:\?|$)/) { + ERROR("RETURN_PARENTHESES", + "return is not a function, parentheses are not required\n" . $herecurr); + } + } elsif ($spacing !~ /\s+/) { + ERROR("SPACING", + "space required before the open parenthesis '('\n" . $herecurr); + } + } + +# unnecessary return in a void function +# at end-of-function, with the previous line a single leading tab, then return; +# and the line before that not a goto label target like "out:" + if ($sline =~ /^[ \+]}\s*$/ && + $prevline =~ /^\+\treturn\s*;\s*$/ && + $linenr >= 3 && + $lines[$linenr - 3] =~ /^[ +]/ && + $lines[$linenr - 3] !~ /^[ +]\s*$Ident\s*:/) { + WARN("RETURN_VOID", + "void function return statements are not generally useful\n" . $hereprev); + } + +# if statements using unnecessary parentheses - ie: if ((foo == bar)) + if ($perl_version_ok && + $line =~ /\bif\s*((?:\(\s*){2,})/) { + my $openparens = $1; + my $count = $openparens =~ tr@\(@\(@; + my $msg = ""; + if ($line =~ /\bif\s*(?:\(\s*){$count,$count}$LvalOrFunc\s*($Compare)\s*$LvalOrFunc(?:\s*\)){$count,$count}/) { + my $comp = $4; #Not $1 because of $LvalOrFunc + $msg = " - maybe == should be = ?" if ($comp eq "=="); + WARN("UNNECESSARY_PARENTHESES", + "Unnecessary parentheses$msg\n" . $herecurr); + } + } + +# comparisons with a constant or upper case identifier on the left +# avoid cases like "foo + BAR < baz" +# only fix matches surrounded by parentheses to avoid incorrect +# conversions like "FOO < baz() + 5" being "misfixed" to "baz() > FOO + 5" + if ($perl_version_ok && + $line =~ /^\+(.*)\b($Constant|[A-Z_][A-Z0-9_]*)\s*($Compare)\s*($LvalOrFunc)/) { + my $lead = $1; + my $const = $2; + my $comp = $3; + my $to = $4; + my $newcomp = $comp; + if ($lead !~ /(?:$Operators|\.)\s*$/ && + $to !~ /^(?:Constant|[A-Z_][A-Z0-9_]*)$/ && + WARN("CONSTANT_COMPARISON", + "Comparisons should place the constant on the right side of the test\n" . $herecurr) && + $fix) { + if ($comp eq "<") { + $newcomp = ">"; + } elsif ($comp eq "<=") { + $newcomp = ">="; + } elsif ($comp eq ">") { + $newcomp = "<"; + } elsif ($comp eq ">=") { + $newcomp = "<="; + } + $fixed[$fixlinenr] =~ s/\(\s*\Q$const\E\s*$Compare\s*\Q$to\E\s*\)/($to $newcomp $const)/; + } + } + +# Return of what appears to be an errno should normally be negative + if ($sline =~ /\breturn(?:\s*\(+\s*|\s+)(E[A-Z]+)(?:\s*\)+\s*|\s*)[;:,]/) { + my $name = $1; + if ($name ne 'EOF' && $name ne 'ERROR') { + WARN("USE_NEGATIVE_ERRNO", + "return of an errno should typically be negative (ie: return -$1)\n" . $herecurr); + } + } + +# Need a space before open parenthesis after if, while etc + if ($line =~ /\b(if|while|for|switch)\(/) { + if (ERROR("SPACING", + "space required before the open parenthesis '('\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/\b(if|while|for|switch)\(/$1 \(/; + } + } + +# Check for illegal assignment in if conditional -- and check for trailing +# statements after the conditional. + if ($line =~ /do\s*(?!{)/) { + ($stat, $cond, $line_nr_next, $remain_next, $off_next) = + ctx_statement_block($linenr, $realcnt, 0) + if (!defined $stat); + my ($stat_next) = ctx_statement_block($line_nr_next, + $remain_next, $off_next); + $stat_next =~ s/\n./\n /g; + ##print "stat<$stat> stat_next<$stat_next>\n"; + + if ($stat_next =~ /^\s*while\b/) { + # If the statement carries leading newlines, + # then count those as offsets. + my ($whitespace) = + ($stat_next =~ /^((?:\s*\n[+-])*\s*)/s); + my $offset = + statement_rawlines($whitespace) - 1; + + $suppress_whiletrailers{$line_nr_next + + $offset} = 1; + } + } + if (!defined $suppress_whiletrailers{$linenr} && + defined($stat) && defined($cond) && + $line =~ /\b(?:if|while|for)\s*\(/ && $line !~ /^.\s*#/) { + my ($s, $c) = ($stat, $cond); + + if ($c =~ /\bif\s*\(.*[^<>!=]=[^=].*/s) { + ERROR("ASSIGN_IN_IF", + "do not use assignment in if condition\n" . $herecurr); + } + + # Find out what is on the end of the line after the + # conditional. + substr($s, 0, length($c), ''); + $s =~ s/\n.*//g; + $s =~ s/$;//g; # Remove any comments + if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && + $c !~ /}\s*while\s*/) + { + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + my $stat_real = ''; + + $stat_real = raw_line($linenr, $cond_lines) + . "\n" if ($cond_lines); + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr . $stat_real); + } + } + +# Check for bitwise tests written as boolean + if ($line =~ / + (?: + (?:\[|\(|\&\&|\|\|) + \s*0[xX][0-9]+\s* + (?:\&\&|\|\|) + | + (?:\&\&|\|\|) + \s*0[xX][0-9]+\s* + (?:\&\&|\|\||\)|\]) + )/x) + { + WARN("HEXADECIMAL_BOOLEAN_TEST", + "boolean test with hexadecimal, perhaps just 1 \& or \|?\n" . $herecurr); + } + +# if and else should not have general statements after it + if ($line =~ /^.\s*(?:}\s*)?else\b(.*)/) { + my $s = $1; + $s =~ s/$;//g; # Remove any comments + if ($s !~ /^\s*(?:\sif|(?:{|)\s*\\?\s*$)/) { + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr); + } + } +# if should not continue a brace + if ($line =~ /}\s*if\b/) { + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line (or did you mean 'else if'?)\n" . + $herecurr); + } +# case and default should not have general statements after them + if ($line =~ /^.\s*(?:case\s*.*|default\s*):/g && + $line !~ /\G(?: + (?:\s*$;*)(?:\s*{)?(?:\s*$;*)(?:\s*\\)?\s*$| + \s*return\s+ + )/xg) + { + ERROR("TRAILING_STATEMENTS", + "trailing statements should be on next line\n" . $herecurr); + } + + # Check for }<nl>else {, these must be at the same + # indent level to be relevant to each other. + if ($prevline=~/}\s*$/ and $line=~/^.\s*else\s*/ && + $previndent == $indent) { + if (ERROR("ELSE_AFTER_BRACE", + "else should follow close brace '}'\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + $fixedline =~ s/}\s*$//; + if ($fixedline !~ /^\+\s*$/) { + fix_insert_line($fixlinenr, $fixedline); + } + $fixedline = $rawline; + $fixedline =~ s/^(.\s*)else/$1} else/; + fix_insert_line($fixlinenr, $fixedline); + } + } + + if ($prevline=~/}\s*$/ and $line=~/^.\s*while\s*/ && + $previndent == $indent) { + my ($s, $c) = ctx_statement_block($linenr, $realcnt, 0); + + # Find out what is on the end of the line after the + # conditional. + substr($s, 0, length($c), ''); + $s =~ s/\n.*//g; + + if ($s =~ /^\s*;/) { + if (ERROR("WHILE_AFTER_BRACE", + "while should follow close brace '}'\n" . $hereprev) && + $fix && $prevline =~ /^\+/ && $line =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + my $trailing = $rawline; + $trailing =~ s/^\+//; + $trailing = trim($trailing); + $fixedline =~ s/}\s*$/} $trailing/; + fix_insert_line($fixlinenr, $fixedline); + } + } + } + +#Specific variable tests + while ($line =~ m{($Constant|$Lval)}g) { + my $var = $1; + +#CamelCase + if ($var !~ /^$Constant$/ && + $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && +#Ignore Page<foo> variants + $var !~ /^(?:Clear|Set|TestClear|TestSet|)Page[A-Z]/ && +#Ignore SI style variants like nS, mV and dB (ie: max_uV, regulator_min_uA_show) + $var !~ /^(?:[a-z_]*?)_?[a-z][A-Z](?:_[a-z_]+)?$/ && +#Ignore some three character SI units explicitly, like MiB and KHz + $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { + while ($var =~ m{($Ident)}g) { + my $word = $1; + next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); + if ($check) { + seed_camelcase_includes(); + if (!$file && !$camelcase_file_seeded) { + seed_camelcase_file($realfile); + $camelcase_file_seeded = 1; + } + } + if (!defined $camelcase{$word}) { + $camelcase{$word} = 1; + CHK("CAMELCASE", + "Avoid CamelCase: <$word>\n" . $herecurr); + } + } + } + } + +#no spaces allowed after \ in define + if ($line =~ /\#\s*define.*\\\s+$/) { + if (WARN("WHITESPACE_AFTER_LINE_CONTINUATION", + "Whitespace after \\ makes next lines useless\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\s+$//; + } + } + +# warn if <asm/foo.h> is #included and <linux/foo.h> is available and includes +# itself <asm/foo.h> (uses RAW line) + if ($tree && $rawline =~ m{^.\s*\#\s*include\s*\<asm\/(.*)\.h\>}) { + my $file = "$1.h"; + my $checkfile = "include/linux/$file"; + if (-f "$root/$checkfile" && + $realfile ne $checkfile && + $1 !~ /$allowed_asm_includes/) + { + my $asminclude = `grep -Ec "#include\\s+<asm/$file>" $root/$checkfile`; + if ($asminclude > 0) { + if ($realfile =~ m{^arch/}) { + CHK("ARCH_INCLUDE_LINUX", + "Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); + } else { + WARN("INCLUDE_LINUX", + "Use #include <linux/$file> instead of <asm/$file>\n" . $herecurr); + } + } + } + } + +# multi-statement macros should be enclosed in a do while loop, grab the +# first statement and ensure its the whole macro if its not enclosed +# in a known good container + if ($realfile !~ m@/vmlinux.lds.h$@ && + $line =~ /^.\s*\#\s*define\s*$Ident(\()?/) { + my $ln = $linenr; + my $cnt = $realcnt; + my ($off, $dstat, $dcond, $rest); + my $ctx = ''; + my $has_flow_statement = 0; + my $has_arg_concat = 0; + ($dstat, $dcond, $ln, $cnt, $off) = + ctx_statement_block($linenr, $realcnt, 0); + $ctx = $dstat; + #print "dstat<$dstat> dcond<$dcond> cnt<$cnt> off<$off>\n"; + #print "LINE<$lines[$ln-1]> len<" . length($lines[$ln-1]) . "\n"; + + $has_flow_statement = 1 if ($ctx =~ /\b(goto|return)\b/); + $has_arg_concat = 1 if ($ctx =~ /\#\#/ && $ctx !~ /\#\#\s*(?:__VA_ARGS__|args)\b/); + + $dstat =~ s/^.\s*\#\s*define\s+$Ident(\([^\)]*\))?\s*//; + my $define_args = $1; + my $define_stmt = $dstat; + my @def_args = (); + + if (defined $define_args && $define_args ne "") { + $define_args = substr($define_args, 1, length($define_args) - 2); + $define_args =~ s/\s*//g; + $define_args =~ s/\\\+?//g; + @def_args = split(",", $define_args); + } + + $dstat =~ s/$;//g; + $dstat =~ s/\\\n.//g; + $dstat =~ s/^\s*//s; + $dstat =~ s/\s*$//s; + + # Flatten any parentheses and braces + while ($dstat =~ s/\([^\(\)]*\)/1/ || + $dstat =~ s/\{[^\{\}]*\}/1/ || + $dstat =~ s/.\[[^\[\]]*\]/1/) + { + } + + # Flatten any obvious string concatentation. + while ($dstat =~ s/($String)\s*$Ident/$1/ || + $dstat =~ s/$Ident\s*($String)/$1/) + { + } + + # Make asm volatile uses seem like a generic function + $dstat =~ s/\b_*asm_*\s+_*volatile_*\b/asm_volatile/g; + + my $exceptions = qr{ + $Declare| + module_param_named| + MODULE_PARM_DESC| + DECLARE_PER_CPU| + DEFINE_PER_CPU| + __typeof__\(| + union| + struct| + \.$Ident\s*=\s*| + ^\"|\"$| + ^\[ + }x; + #print "REST<$rest> dstat<$dstat> ctx<$ctx>\n"; + + $ctx =~ s/\n*$//; + my $stmt_cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $stmt_cnt, $here); + + if ($dstat ne '' && + $dstat !~ /^(?:$Ident|-?$Constant),$/ && # 10, // foo(), + $dstat !~ /^(?:$Ident|-?$Constant);$/ && # foo(); + $dstat !~ /^[!~-]?(?:$Lval|$Constant)$/ && # 10 // foo() // !foo // ~foo // -foo // foo->bar // foo.bar->baz + $dstat !~ /^'X'$/ && $dstat !~ /^'XX'$/ && # character constants + $dstat !~ /$exceptions/ && + $dstat !~ /^\.$Ident\s*=/ && # .foo = + $dstat !~ /^(?:\#\s*$Ident|\#\s*$Constant)\s*$/ && # stringification #foo + $dstat !~ /^do\s*$Constant\s*while\s*$Constant;?$/ && # do {...} while (...); // do {...} while (...) + $dstat !~ /^for\s*$Constant$/ && # for (...) + $dstat !~ /^for\s*$Constant\s+(?:$Ident|-?$Constant)$/ && # for (...) bar() + $dstat !~ /^do\s*{/ && # do {... + $dstat !~ /^\(\{/ && # ({... + $ctx !~ /^.\s*#\s*define\s+TRACE_(?:SYSTEM|INCLUDE_FILE|INCLUDE_PATH)\b/) + { + if ($dstat =~ /^\s*if\b/) { + ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE", + "Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects\n" . "$herectx"); + } elsif ($dstat =~ /;/) { + ERROR("MULTISTATEMENT_MACRO_USE_DO_WHILE", + "Macros with multiple statements should be enclosed in a do - while loop\n" . "$herectx"); + } else { + ERROR("COMPLEX_MACRO", + "Macros with complex values should be enclosed in parentheses\n" . "$herectx"); + } + + } + + # Make $define_stmt single line, comment-free, etc + my @stmt_array = split('\n', $define_stmt); + my $first = 1; + $define_stmt = ""; + foreach my $l (@stmt_array) { + $l =~ s/\\$//; + if ($first) { + $define_stmt = $l; + $first = 0; + } elsif ($l =~ /^[\+ ]/) { + $define_stmt .= substr($l, 1); + } + } + $define_stmt =~ s/$;//g; + $define_stmt =~ s/\s+/ /g; + $define_stmt = trim($define_stmt); + +# check if any macro arguments are reused (ignore '...' and 'type') + foreach my $arg (@def_args) { + next if ($arg =~ /\.\.\./); + next if ($arg =~ /^type$/i); + my $tmp_stmt = $define_stmt; + $tmp_stmt =~ s/\b(sizeof|typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g; + $tmp_stmt =~ s/\#+\s*$arg\b//g; + $tmp_stmt =~ s/\b$arg\s*\#\#//g; + my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g; + if ($use_cnt > 1) { + CHK("MACRO_ARG_REUSE", + "Macro argument reuse '$arg' - possible side-effects?\n" . "$herectx"); + } +# check if any macro arguments may have other precedence issues + if ($tmp_stmt =~ m/($Operators)?\s*\b$arg\b\s*($Operators)?/m && + ((defined($1) && $1 ne ',') || + (defined($2) && $2 ne ','))) { + CHK("MACRO_ARG_PRECEDENCE", + "Macro argument '$arg' may be better as '($arg)' to avoid precedence issues\n" . "$herectx"); + } + } + +# check for macros with flow control, but without ## concatenation +# ## concatenation is commonly a macro that defines a function so ignore those + if ($has_flow_statement && !$has_arg_concat) { + my $cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("MACRO_WITH_FLOW_CONTROL", + "Macros with flow control statements should be avoided\n" . "$herectx"); + } + +# check for line continuations outside of #defines, preprocessor #, and asm + + } else { + if ($prevline !~ /^..*\\$/ && + $line !~ /^\+\s*\#.*\\$/ && # preprocessor + $line !~ /^\+.*\b(__asm__|asm)\b.*\\$/ && # asm + $line =~ /^\+.*\\$/) { + WARN("LINE_CONTINUATIONS", + "Avoid unnecessary line continuations\n" . $herecurr); + } + } + +# do {} while (0) macro tests: +# single-statement macros do not need to be enclosed in do while (0) loop, +# macro should not end with a semicolon + if ($perl_version_ok && + $realfile !~ m@/vmlinux.lds.h$@ && + $line =~ /^.\s*\#\s*define\s+$Ident(\()?/) { + my $ln = $linenr; + my $cnt = $realcnt; + my ($off, $dstat, $dcond, $rest); + my $ctx = ''; + ($dstat, $dcond, $ln, $cnt, $off) = + ctx_statement_block($linenr, $realcnt, 0); + $ctx = $dstat; + + $dstat =~ s/\\\n.//g; + $dstat =~ s/$;/ /g; + + if ($dstat =~ /^\+\s*#\s*define\s+$Ident\s*${balanced_parens}\s*do\s*{(.*)\s*}\s*while\s*\(\s*0\s*\)\s*([;\s]*)\s*$/) { + my $stmts = $2; + my $semis = $3; + + $ctx =~ s/\n*$//; + my $cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $cnt, $here); + + if (($stmts =~ tr/;/;/) == 1 && + $stmts !~ /^\s*(if|while|for|switch)\b/) { + WARN("SINGLE_STATEMENT_DO_WHILE_MACRO", + "Single statement macros should not use a do {} while (0) loop\n" . "$herectx"); + } + if (defined $semis && $semis ne "") { + WARN("DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON", + "do {} while (0) macros should not be semicolon terminated\n" . "$herectx"); + } + } elsif ($dstat =~ /^\+\s*#\s*define\s+$Ident.*;\s*$/) { + $ctx =~ s/\n*$//; + my $cnt = statement_rawlines($ctx); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("TRAILING_SEMICOLON", + "macros should not use a trailing semicolon\n" . "$herectx"); + } + } + +# check for redundant bracing round if etc + if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) { + my ($level, $endln, @chunks) = + ctx_statement_full($linenr, $realcnt, 1); + #print "chunks<$#chunks> linenr<$linenr> endln<$endln> level<$level>\n"; + #print "APW: <<$chunks[1][0]>><<$chunks[1][1]>>\n"; + if ($#chunks > 0 && $level == 0) { + my @allowed = (); + my $allow = 0; + my $seen = 0; + my $herectx = $here . "\n"; + my $ln = $linenr - 1; + for my $chunk (@chunks) { + my ($cond, $block) = @{$chunk}; + + # If the condition carries leading newlines, then count those as offsets. + my ($whitespace) = ($cond =~ /^((?:\s*\n[+-])*\s*)/s); + my $offset = statement_rawlines($whitespace) - 1; + + $allowed[$allow] = 0; + #print "COND<$cond> whitespace<$whitespace> offset<$offset>\n"; + + # We have looked at and allowed this specific line. + $suppress_ifbraces{$ln + $offset} = 1; + + $herectx .= "$rawlines[$ln + $offset]\n[...]\n"; + $ln += statement_rawlines($block) - 1; + + substr($block, 0, length($cond), ''); + + $seen++ if ($block =~ /^\s*{/); + + #print "cond<$cond> block<$block> allowed<$allowed[$allow]>\n"; + if (statement_lines($cond) > 1) { + #print "APW: ALLOWED: cond<$cond>\n"; + $allowed[$allow] = 1; + } + if ($block =~/\b(?:if|for|while)\b/) { + #print "APW: ALLOWED: block<$block>\n"; + $allowed[$allow] = 1; + } + if (statement_block_size($block) > 1) { + #print "APW: ALLOWED: lines block<$block>\n"; + $allowed[$allow] = 1; + } + $allow++; + } + if ($seen) { + my $sum_allowed = 0; + foreach (@allowed) { + $sum_allowed += $_; + } + if ($sum_allowed == 0) { + WARN("BRACES", + "braces {} are not necessary for any arm of this statement\n" . $herectx); + } elsif ($sum_allowed != $allow && + $seen != $allow) { + CHK("BRACES", + "braces {} should be used on all arms of this statement\n" . $herectx); + } + } + } + } + if (!defined $suppress_ifbraces{$linenr - 1} && + $line =~ /\b(if|while|for|else)\b/) { + my $allowed = 0; + + # Check the pre-context. + if (substr($line, 0, $-[0]) =~ /(\}\s*)$/) { + #print "APW: ALLOWED: pre<$1>\n"; + $allowed = 1; + } + + my ($level, $endln, @chunks) = + ctx_statement_full($linenr, $realcnt, $-[0]); + + # Check the condition. + my ($cond, $block) = @{$chunks[0]}; + #print "CHECKING<$linenr> cond<$cond> block<$block>\n"; + if (defined $cond) { + substr($block, 0, length($cond), ''); + } + if (statement_lines($cond) > 1) { + #print "APW: ALLOWED: cond<$cond>\n"; + $allowed = 1; + } + if ($block =~/\b(?:if|for|while)\b/) { + #print "APW: ALLOWED: block<$block>\n"; + $allowed = 1; + } + if (statement_block_size($block) > 1) { + #print "APW: ALLOWED: lines block<$block>\n"; + $allowed = 1; + } + # Check the post-context. + if (defined $chunks[1]) { + my ($cond, $block) = @{$chunks[1]}; + if (defined $cond) { + substr($block, 0, length($cond), ''); + } + if ($block =~ /^\s*\{/) { + #print "APW: ALLOWED: chunk-1 block<$block>\n"; + $allowed = 1; + } + } + if ($level == 0 && $block =~ /^\s*\{/ && !$allowed) { + my $cnt = statement_rawlines($block); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("BRACES", + "braces {} are not necessary for single statement blocks\n" . $herectx); + } + } + +# check for single line unbalanced braces + if ($sline =~ /^.\s*\}\s*else\s*$/ || + $sline =~ /^.\s*else\s*\{\s*$/) { + CHK("BRACES", "Unbalanced braces around else statement\n" . $herecurr); + } + +# check for unnecessary blank lines around braces + if (($line =~ /^.\s*}\s*$/ && $prevrawline =~ /^.\s*$/)) { + if (CHK("BRACES", + "Blank lines aren't necessary before a close brace '}'\n" . $hereprev) && + $fix && $prevrawline =~ /^\+/) { + fix_delete_line($fixlinenr - 1, $prevrawline); + } + } + if (($rawline =~ /^.\s*$/ && $prevline =~ /^..*{\s*$/)) { + if (CHK("BRACES", + "Blank lines aren't necessary after an open brace '{'\n" . $hereprev) && + $fix) { + fix_delete_line($fixlinenr, $rawline); + } + } + +# no volatiles please + my $asm_volatile = qr{\b(__asm__|asm)\s+(__volatile__|volatile)\b}; + if ($line =~ /\bvolatile\b/ && $line !~ /$asm_volatile/) { + WARN("VOLATILE", + "Use of volatile is usually wrong: see Documentation/process/volatile-considered-harmful.rst\n" . $herecurr); + } + +# Check for user-visible strings broken across lines, which breaks the ability +# to grep for the string. Make exceptions when the previous string ends in a +# newline (multiple lines in one string constant) or '\t', '\r', ';', or '{' +# (common in inline assembly) or is a octal \123 or hexadecimal \xaf value + if ($line =~ /^\+\s*$String/ && + $prevline =~ /"\s*$/ && + $prevrawline !~ /(?:\\(?:[ntr]|[0-7]{1,3}|x[0-9a-fA-F]{1,2})|;\s*|\{\s*)"\s*$/) { + if (WARN("SPLIT_STRING", + "quoted string split across lines\n" . $hereprev) && + $fix && + $prevrawline =~ /^\+.*"\s*$/ && + $last_coalesced_string_linenr != $linenr - 1) { + my $extracted_string = get_quoted_string($line, $rawline); + my $comma_close = ""; + if ($rawline =~ /\Q$extracted_string\E(\s*\)\s*;\s*$|\s*,\s*)/) { + $comma_close = $1; + } + + fix_delete_line($fixlinenr - 1, $prevrawline); + fix_delete_line($fixlinenr, $rawline); + my $fixedline = $prevrawline; + $fixedline =~ s/"\s*$//; + $fixedline .= substr($extracted_string, 1) . trim($comma_close); + fix_insert_line($fixlinenr - 1, $fixedline); + $fixedline = $rawline; + $fixedline =~ s/\Q$extracted_string\E\Q$comma_close\E//; + if ($fixedline !~ /\+\s*$/) { + fix_insert_line($fixlinenr, $fixedline); + } + $last_coalesced_string_linenr = $linenr; + } + } + +# check for missing a space in a string concatenation + if ($prevrawline =~ /[^\\]\w"$/ && $rawline =~ /^\+[\t ]+"\w/) { + WARN('MISSING_SPACE', + "break quoted strings at a space character\n" . $hereprev); + } + +# check for an embedded function name in a string when the function is known +# This does not work very well for -f --file checking as it depends on patch +# context providing the function name or a single line form for in-file +# function declarations + if (!$SOF && + $line =~ /^\+.*$String/ && + defined($context_function) && + get_quoted_string($line, $rawline) =~ /\b$context_function\b/ && + length(get_quoted_string($line, $rawline)) != (length($context_function) + 2)) { + WARN("EMBEDDED_FUNCTION_NAME", + "Prefer using '\"%s...\", __func__' to using '$context_function', this function's name, in a string\n" . $herecurr); + } + +# check for spaces before a quoted newline + if ($rawline =~ /^.*\".*\s\\n/) { + if (WARN("QUOTED_WHITESPACE_BEFORE_NEWLINE", + "unnecessary whitespace before a quoted newline\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^(\+.*\".*)\s+\\n/$1\\n/; + } + + } + +# concatenated string without spaces between elements + if ($line =~ /$String[A-Za-z0-9_]/ || $line =~ /[A-Za-z0-9_]$String/) { + if (CHK("CONCATENATED_STRING", + "Concatenated strings should use spaces between elements\n" . $herecurr) && + $fix) { + while ($line =~ /($String)/g) { + my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); + $fixed[$fixlinenr] =~ s/\Q$extracted_string\E([A-Za-z0-9_])/$extracted_string $1/; + $fixed[$fixlinenr] =~ s/([A-Za-z0-9_])\Q$extracted_string\E/$1 $extracted_string/; + } + } + } + +# uncoalesced string fragments + if ($line =~ /$String\s*"/) { + if (WARN("STRING_FRAGMENTS", + "Consecutive strings are generally better as a single string\n" . $herecurr) && + $fix) { + while ($line =~ /($String)(?=\s*")/g) { + my $extracted_string = substr($rawline, $-[0], $+[0] - $-[0]); + $fixed[$fixlinenr] =~ s/\Q$extracted_string\E\s*"/substr($extracted_string, 0, -1)/e; + } + } + } + +# check for non-standard and hex prefixed decimal printf formats + my $show_L = 1; #don't show the same defect twice + my $show_Z = 1; + while ($line =~ /(?:^|")([X\t]*)(?:"|$)/g) { + my $string = substr($rawline, $-[1], $+[1] - $-[1]); + $string =~ s/%%/__/g; + # check for %L + if ($show_L && $string =~ /%[\*\d\.\$]*L([diouxX])/) { + WARN("PRINTF_L", + "\%L$1 is non-standard C, use %ll$1\n" . $herecurr); + $show_L = 0; + } + # check for %Z + if ($show_Z && $string =~ /%[\*\d\.\$]*Z([diouxX])/) { + WARN("PRINTF_Z", + "%Z$1 is non-standard C, use %z$1\n" . $herecurr); + $show_Z = 0; + } + # check for 0x<decimal> + if ($string =~ /0x%[\*\d\.\$\Llzth]*[diou]/) { + ERROR("PRINTF_0XDECIMAL", + "Prefixing 0x with decimal output is defective\n" . $herecurr); + } + } + +# check for line continuations in quoted strings with odd counts of " + if ($rawline =~ /\\$/ && $sline =~ tr/"/"/ % 2) { + WARN("LINE_CONTINUATIONS", + "Avoid line continuations in quoted strings\n" . $herecurr); + } + +# warn about #if 0 + if ($line =~ /^.\s*\#\s*if\s+0\b/) { + WARN("IF_0", + "Consider removing the code enclosed by this #if 0 and its #endif\n" . $herecurr); + } + +# warn about #if 1 + if ($line =~ /^.\s*\#\s*if\s+1\b/) { + WARN("IF_1", + "Consider removing the #if 1 and its #endif\n" . $herecurr); + } + +# check for needless "if (<foo>) fn(<foo>)" uses + if ($prevline =~ /\bif\s*\(\s*($Lval)\s*\)/) { + my $tested = quotemeta($1); + my $expr = '\s*\(\s*' . $tested . '\s*\)\s*;'; + if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?|(?:kmem_cache|mempool|dma_pool)_destroy)$expr/) { + my $func = $1; + if (WARN('NEEDLESS_IF', + "$func(NULL) is safe and this check is probably not required\n" . $hereprev) && + $fix) { + my $do_fix = 1; + my $leading_tabs = ""; + my $new_leading_tabs = ""; + if ($lines[$linenr - 2] =~ /^\+(\t*)if\s*\(\s*$tested\s*\)\s*$/) { + $leading_tabs = $1; + } else { + $do_fix = 0; + } + if ($lines[$linenr - 1] =~ /^\+(\t+)$func\s*\(\s*$tested\s*\)\s*;\s*$/) { + $new_leading_tabs = $1; + if (length($leading_tabs) + 1 ne length($new_leading_tabs)) { + $do_fix = 0; + } + } else { + $do_fix = 0; + } + if ($do_fix) { + fix_delete_line($fixlinenr - 1, $prevrawline); + $fixed[$fixlinenr] =~ s/^\+$new_leading_tabs/\+$leading_tabs/; + } + } + } + } + +# check for unnecessary "Out of Memory" messages + if ($line =~ /^\+.*\b$logFunctions\s*\(/ && + $prevline =~ /^[ \+]\s*if\s*\(\s*(\!\s*|NULL\s*==\s*)?($Lval)(\s*==\s*NULL\s*)?\s*\)/ && + (defined $1 || defined $3) && + $linenr > 3) { + my $testval = $2; + my $testline = $lines[$linenr - 3]; + + my ($s, $c) = ctx_statement_block($linenr - 3, $realcnt, 0); +# print("line: <$line>\nprevline: <$prevline>\ns: <$s>\nc: <$c>\n\n\n"); + + if ($s =~ /(?:^|\n)[ \+]\s*(?:$Type\s*)?\Q$testval\E\s*=\s*(?:\([^\)]*\)\s*)?\s*$allocFunctions\s*\(/ && + $s !~ /\b__GFP_NOWARN\b/ ) { + WARN("OOM_MESSAGE", + "Possible unnecessary 'out of memory' message\n" . $hereprev); + } + } + +# check for logging functions with KERN_<LEVEL> + if ($line !~ /printk(?:_ratelimited|_once)?\s*\(/ && + $line =~ /\b$logFunctions\s*\(.*\b(KERN_[A-Z]+)\b/) { + my $level = $1; + if (WARN("UNNECESSARY_KERN_LEVEL", + "Possible unnecessary $level\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\s*$level\s*//; + } + } + +# check for logging continuations + if ($line =~ /\bprintk\s*\(\s*KERN_CONT\b|\bpr_cont\s*\(/) { + WARN("LOGGING_CONTINUATION", + "Avoid logging continuation uses where feasible\n" . $herecurr); + } + +# check for mask then right shift without a parentheses + if ($perl_version_ok && + $line =~ /$LvalOrFunc\s*\&\s*($LvalOrFunc)\s*>>/ && + $4 !~ /^\&/) { # $LvalOrFunc may be &foo, ignore if so + WARN("MASK_THEN_SHIFT", + "Possible precedence defect with mask then right shift - may need parentheses\n" . $herecurr); + } + +# check for pointer comparisons to NULL + if ($perl_version_ok) { + while ($line =~ /\b$LvalOrFunc\s*(==|\!=)\s*NULL\b/g) { + my $val = $1; + my $equal = "!"; + $equal = "" if ($4 eq "!="); + if (CHK("COMPARISON_TO_NULL", + "Comparison to NULL could be written \"${equal}${val}\"\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b\Q$val\E\s*(?:==|\!=)\s*NULL\b/$equal$val/; + } + } + } + +# check for bad placement of section $InitAttribute (e.g.: __initdata) + if ($line =~ /(\b$InitAttribute\b)/) { + my $attr = $1; + if ($line =~ /^\+\s*static\s+(?:const\s+)?(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Ident(?:\[[^]]*\])?)\s*[=;]/) { + my $ptr = $1; + my $var = $2; + if ((($ptr =~ /\b(union|struct)\s+$attr\b/ && + ERROR("MISPLACED_INIT", + "$attr should be placed after $var\n" . $herecurr)) || + ($ptr !~ /\b(union|struct)\s+$attr\b/ && + WARN("MISPLACED_INIT", + "$attr should be placed after $var\n" . $herecurr))) && + $fix) { + $fixed[$fixlinenr] =~ s/(\bstatic\s+(?:const\s+)?)(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Ident(?:\[[^]]*\])?)\s*([=;])\s*/"$1" . trim(string_find_replace($2, "\\s*$attr\\s*", " ")) . " " . trim(string_find_replace($3, "\\s*$attr\\s*", "")) . " $attr" . ("$4" eq ";" ? ";" : " = ")/e; + } + } + } + +# check for $InitAttributeData (ie: __initdata) with const + if ($line =~ /\bconst\b/ && $line =~ /($InitAttributeData)/) { + my $attr = $1; + $attr =~ /($InitAttributePrefix)(.*)/; + my $attr_prefix = $1; + my $attr_type = $2; + if (ERROR("INIT_ATTRIBUTE", + "Use of const init definition must use ${attr_prefix}initconst\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/$InitAttributeData/${attr_prefix}initconst/; + } + } + +# check for $InitAttributeConst (ie: __initconst) without const + if ($line !~ /\bconst\b/ && $line =~ /($InitAttributeConst)/) { + my $attr = $1; + if (ERROR("INIT_ATTRIBUTE", + "Use of $attr requires a separate use of const\n" . $herecurr) && + $fix) { + my $lead = $fixed[$fixlinenr] =~ + /(^\+\s*(?:static\s+))/; + $lead = rtrim($1); + $lead = "$lead " if ($lead !~ /^\+$/); + $lead = "${lead}const "; + $fixed[$fixlinenr] =~ s/(^\+\s*(?:static\s+))/$lead/; + } + } + +# check for __read_mostly with const non-pointer (should just be const) + if ($line =~ /\b__read_mostly\b/ && + $line =~ /($Type)\s*$Ident/ && $1 !~ /\*\s*$/ && $1 =~ /\bconst\b/) { + if (ERROR("CONST_READ_MOSTLY", + "Invalid use of __read_mostly with const type\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\s+__read_mostly\b//; + } + } + +# don't use __constant_<foo> functions outside of include/uapi/ + if ($realfile !~ m@^include/uapi/@ && + $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) { + my $constant_func = $1; + my $func = $constant_func; + $func =~ s/^__constant_//; + if (WARN("CONSTANT_CONVERSION", + "$constant_func should be $func\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b$constant_func\b/$func/g; + } + } + +# prefer usleep_range over udelay + if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { + my $delay = $1; + # ignore udelay's < 10, however + if (! ($delay < 10) ) { + CHK("USLEEP_RANGE", + "usleep_range is preferred over udelay; see Documentation/timers/timers-howto.rst\n" . $herecurr); + } + if ($delay > 2000) { + WARN("LONG_UDELAY", + "long udelay - prefer mdelay; see arch/arm/include/asm/delay.h\n" . $herecurr); + } + } + +# warn about unexpectedly long msleep's + if ($line =~ /\bmsleep\s*\((\d+)\);/) { + if ($1 < 20) { + WARN("MSLEEP", + "msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst\n" . $herecurr); + } + } + +# check for comparisons of jiffies + if ($line =~ /\bjiffies\s*$Compare|$Compare\s*jiffies\b/) { + WARN("JIFFIES_COMPARISON", + "Comparing jiffies is almost always wrong; prefer time_after, time_before and friends\n" . $herecurr); + } + +# check for comparisons of get_jiffies_64() + if ($line =~ /\bget_jiffies_64\s*\(\s*\)\s*$Compare|$Compare\s*get_jiffies_64\s*\(\s*\)/) { + WARN("JIFFIES_COMPARISON", + "Comparing get_jiffies_64() is almost always wrong; prefer time_after64, time_before64 and friends\n" . $herecurr); + } + +# warn about #ifdefs in C files +# if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) { +# print "#ifdef in C files should be avoided\n"; +# print "$herecurr"; +# $clean = 0; +# } + +# warn about spacing in #ifdefs + if ($line =~ /^.\s*\#\s*(ifdef|ifndef|elif)\s\s+/) { + if (ERROR("SPACING", + "exactly one space required after that #$1\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ + s/^(.\s*\#\s*(ifdef|ifndef|elif))\s{2,}/$1 /; + } + + } + +# check for spinlock_t definitions without a comment. + if ($line =~ /^.\s*(struct\s+mutex|spinlock_t)\s+\S+;/ || + $line =~ /^.\s*(DEFINE_MUTEX)\s*\(/) { + my $which = $1; + if (!ctx_has_comment($first_line, $linenr)) { + CHK("UNCOMMENTED_DEFINITION", + "$1 definition without comment\n" . $herecurr); + } + } +# check for memory barriers without a comment. + + my $barriers = qr{ + mb| + rmb| + wmb| + read_barrier_depends + }x; + my $barrier_stems = qr{ + mb__before_atomic| + mb__after_atomic| + store_release| + load_acquire| + store_mb| + (?:$barriers) + }x; + my $all_barriers = qr{ + (?:$barriers)| + smp_(?:$barrier_stems)| + virt_(?:$barrier_stems) + }x; + + if ($line =~ /\b(?:$all_barriers)\s*\(/) { + if (!ctx_has_comment($first_line, $linenr)) { + WARN("MEMORY_BARRIER", + "memory barrier without comment\n" . $herecurr); + } + } + + my $underscore_smp_barriers = qr{__smp_(?:$barrier_stems)}x; + + if ($realfile !~ m@^include/asm-generic/@ && + $realfile !~ m@/barrier\.h$@ && + $line =~ m/\b(?:$underscore_smp_barriers)\s*\(/ && + $line !~ m/^.\s*\#\s*define\s+(?:$underscore_smp_barriers)\s*\(/) { + WARN("MEMORY_BARRIER", + "__smp memory barriers shouldn't be used outside barrier.h and asm-generic\n" . $herecurr); + } + +# check for waitqueue_active without a comment. + if ($line =~ /\bwaitqueue_active\s*\(/) { + if (!ctx_has_comment($first_line, $linenr)) { + WARN("WAITQUEUE_ACTIVE", + "waitqueue_active without comment\n" . $herecurr); + } + } + +# check for smp_read_barrier_depends and read_barrier_depends + if (!$file && $line =~ /\b(smp_|)read_barrier_depends\s*\(/) { + WARN("READ_BARRIER_DEPENDS", + "$1read_barrier_depends should only be used in READ_ONCE or DEC Alpha code\n" . $herecurr); + } + +# check of hardware specific defines + if ($line =~ m@^.\s*\#\s*if.*\b(__i386__|__powerpc64__|__sun__|__s390x__)\b@ && $realfile !~ m@include/asm-@) { + CHK("ARCH_DEFINES", + "architecture specific defines should be avoided\n" . $herecurr); + } + +# check that the storage class is not after a type + if ($line =~ /\b($Type)\s+($Storage)\b/) { + WARN("STORAGE_CLASS", + "storage class '$2' should be located before type '$1'\n" . $herecurr); + } +# Check that the storage class is at the beginning of a declaration + if ($line =~ /\b$Storage\b/ && + $line !~ /^.\s*$Storage/ && + $line =~ /^.\s*(.+?)\$Storage\s/ && + $1 !~ /[\,\)]\s*$/) { + WARN("STORAGE_CLASS", + "storage class should be at the beginning of the declaration\n" . $herecurr); + } + +# check the location of the inline attribute, that it is between +# storage class and type. + if ($line =~ /\b$Type\s+$Inline\b/ || + $line =~ /\b$Inline\s+$Storage\b/) { + ERROR("INLINE_LOCATION", + "inline keyword should sit between storage class and type\n" . $herecurr); + } + +# Check for __inline__ and __inline, prefer inline + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b(__inline__|__inline)\b/) { + if (WARN("INLINE", + "plain inline is preferred over $1\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b(__inline__|__inline)\b/inline/; + + } + } + +# Check for __attribute__ packed, prefer __packed + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) { + WARN("PREFER_PACKED", + "__packed is preferred over __attribute__((packed))\n" . $herecurr); + } + +# Check for __attribute__ aligned, prefer __aligned + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(.*aligned/) { + WARN("PREFER_ALIGNED", + "__aligned(size) is preferred over __attribute__((aligned(size)))\n" . $herecurr); + } + +# Check for __attribute__ section, prefer __section + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(.*_*section_*\s*\(\s*("[^"]*")/) { + my $old = substr($rawline, $-[1], $+[1] - $-[1]); + my $new = substr($old, 1, -1); + if (WARN("PREFER_SECTION", + "__section($new) is preferred over __attribute__((section($old)))\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*_*section_*\s*\(\s*\Q$old\E\s*\)\s*\)\s*\)/__section($new)/; + } + } + +# Check for __attribute__ format(printf, prefer __printf + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf/) { + if (WARN("PREFER_PRINTF", + "__printf(string-index, first-to-check) is preferred over __attribute__((format(printf, string-index, first-to-check)))\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.*)\)\s*\)\s*\)/"__printf(" . trim($1) . ")"/ex; + + } + } + +# Check for __attribute__ format(scanf, prefer __scanf + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b__attribute__\s*\(\s*\(\s*format\s*\(\s*scanf\b/) { + if (WARN("PREFER_SCANF", + "__scanf(string-index, first-to-check) is preferred over __attribute__((format(scanf, string-index, first-to-check)))\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*scanf\s*,\s*(.*)\)\s*\)\s*\)/"__scanf(" . trim($1) . ")"/ex; + } + } + +# Check for __attribute__ weak, or __weak declarations (may have link issues) + if ($perl_version_ok && + $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$Attribute)?\s*;/ && + ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ || + $line =~ /\b__weak\b/)) { + ERROR("WEAK_DECLARATION", + "Using weak declarations can have unintended link defects\n" . $herecurr); + } + +# check for c99 types like uint8_t used outside of uapi/ and tools/ + if (!$SOF && + $realfile !~ m@\binclude/uapi/@ && + $realfile !~ m@\btools/@ && + $line =~ /\b($Declare)\s*$Ident\s*[=;,\[]/) { + my $type = $1; + if ($type =~ /\b($typeC99Typedefs)\b/) { + $type = $1; + my $kernel_type = 'u'; + $kernel_type = 's' if ($type =~ /^_*[si]/); + $type =~ /(\d+)/; + $kernel_type .= $1; + if (CHK("PREFER_KERNEL_TYPES", + "Prefer kernel type '$kernel_type' over '$type'\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b$type\b/$kernel_type/; + } + } + } + +# check for cast of C90 native int or longer types constants + if ($line =~ /(\(\s*$C90_int_types\s*\)\s*)($Constant)\b/) { + my $cast = $1; + my $const = $2; + if (WARN("TYPECAST_INT_CONSTANT", + "Unnecessary typecast of c90 int constant\n" . $herecurr) && + $fix) { + my $suffix = ""; + my $newconst = $const; + $newconst =~ s/${Int_type}$//; + $suffix .= 'U' if ($cast =~ /\bunsigned\b/); + if ($cast =~ /\blong\s+long\b/) { + $suffix .= 'LL'; + } elsif ($cast =~ /\blong\b/) { + $suffix .= 'L'; + } + $fixed[$fixlinenr] =~ s/\Q$cast\E$const\b/$newconst$suffix/; + } + } + +# check for sizeof(&) + if ($line =~ /\bsizeof\s*\(\s*\&/) { + WARN("SIZEOF_ADDRESS", + "sizeof(& should be avoided\n" . $herecurr); + } + +# check for sizeof without parenthesis + if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) { + if (WARN("SIZEOF_PARENTHESIS", + "sizeof $1 should be sizeof($1)\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/"sizeof(" . trim($1) . ")"/ex; + } + } + +# check for struct spinlock declarations + if ($line =~ /^.\s*\bstruct\s+spinlock\s+\w+\s*;/) { + WARN("USE_SPINLOCK_T", + "struct spinlock should be spinlock_t\n" . $herecurr); + } + +# check for seq_printf uses that could be seq_puts + if ($sline =~ /\bseq_printf\s*\(.*"\s*\)\s*;\s*$/) { + my $fmt = get_quoted_string($line, $rawline); + $fmt =~ s/%%//g; + if ($fmt !~ /%/) { + if (WARN("PREFER_SEQ_PUTS", + "Prefer seq_puts to seq_printf\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bseq_printf\b/seq_puts/; + } + } + } + +# check for memcpy uses that should be memcpy_s + if ($SOF && ($line =~ /memcpy\s*\(.*/)) { + my $fmt = get_quoted_string($line, $rawline); + $fmt =~ s/%%//g; + if ($fmt !~ /%/) { + if (WARN("PREFER_MEMCPY_S", + "Use safe version of memcpy - memcpy_s whenever possible\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/memcpy\b/memcpy_s/; + } + } + } + +# check for vsprintf extension %p<foo> misuses + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?![^\{]*\{\s*).*\b(\w+)\s*\(.*$String\s*,/s && + $1 !~ /^_*volatile_*$/) { + my $stat_real; + + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + for (my $count = $linenr; $count <= $lc; $count++) { + my $specifier; + my $extension; + my $bad_specifier = ""; + my $fmt = get_quoted_string($lines[$count - 1], raw_line($count, 0)); + $fmt =~ s/%%//g; + + while ($fmt =~ /(\%[\*\d\.]*p(\w))/g) { + $specifier = $1; + $extension = $2; + if ($extension !~ /[SsBKRraEhMmIiUDdgVCbGNOxt]/) { + $bad_specifier = $specifier; + last; + } + if ($extension eq "x" && !defined($stat_real)) { + if (!defined($stat_real)) { + $stat_real = get_stat_real($linenr, $lc); + } + WARN("VSPRINTF_SPECIFIER_PX", + "Using vsprintf specifier '\%px' potentially exposes the kernel memory layout, if you don't really need the address please consider using '\%p'.\n" . "$here\n$stat_real\n"); + } + } + if ($bad_specifier ne "") { + my $stat_real = get_stat_real($linenr, $lc); + my $ext_type = "Invalid"; + my $use = ""; + if ($bad_specifier =~ /p[Ff]/) { + $ext_type = "Deprecated"; + $use = " - use %pS instead"; + $use =~ s/pS/ps/ if ($bad_specifier =~ /pf/); + } + + WARN("VSPRINTF_POINTER_EXTENSION", + "$ext_type vsprintf pointer extension '$bad_specifier'$use\n" . "$here\n$stat_real\n"); + } + } + } + +# Check for misused memsets + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*$FuncArg\s*\)/) { + + my $ms_addr = $2; + my $ms_val = $7; + my $ms_size = $12; + + if ($ms_size =~ /^(0x|)0$/i) { + ERROR("MEMSET", + "memset to 0's uses 0 as the 2nd argument, not the 3rd\n" . "$here\n$stat\n"); + } elsif ($ms_size =~ /^(0x|)1$/i) { + WARN("MEMSET", + "single byte memset is suspicious. Swapped 2nd/3rd argument?\n" . "$here\n$stat\n"); + } + } + +# Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar) +# if ($perl_version_ok && +# defined $stat && +# $stat =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { +# if (WARN("PREFER_ETHER_ADDR_COPY", +# "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)\n" . "$here\n$stat\n") && +# $fix) { +# $fixed[$fixlinenr] =~ s/\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/ether_addr_copy($2, $7)/; +# } +# } + +# Check for memcmp(foo, bar, ETH_ALEN) that could be ether_addr_equal*(foo, bar) +# if ($perl_version_ok && +# defined $stat && +# $stat =~ /^\+(?:.*?)\bmemcmp\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { +# WARN("PREFER_ETHER_ADDR_EQUAL", +# "Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()\n" . "$here\n$stat\n") +# } + +# check for memset(foo, 0x0, ETH_ALEN) that could be eth_zero_addr +# check for memset(foo, 0xFF, ETH_ALEN) that could be eth_broadcast_addr +# if ($perl_version_ok && +# defined $stat && +# $stat =~ /^\+(?:.*?)\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { +# +# my $ms_val = $7; +# +# if ($ms_val =~ /^(?:0x|)0+$/i) { +# if (WARN("PREFER_ETH_ZERO_ADDR", +# "Prefer eth_zero_addr over memset()\n" . "$here\n$stat\n") && +# $fix) { +# $fixed[$fixlinenr] =~ s/\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*,\s*ETH_ALEN\s*\)/eth_zero_addr($2)/; +# } +# } elsif ($ms_val =~ /^(?:0xff|255)$/i) { +# if (WARN("PREFER_ETH_BROADCAST_ADDR", +# "Prefer eth_broadcast_addr() over memset()\n" . "$here\n$stat\n") && +# $fix) { +# $fixed[$fixlinenr] =~ s/\bmemset\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*,\s*ETH_ALEN\s*\)/eth_broadcast_addr($2)/; +# } +# } +# } + +# typecasts on min/max could be min_t/max_t + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?:.*?)\b(min|max)\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\)/) { + if (defined $2 || defined $7) { + my $call = $1; + my $cast1 = deparenthesize($2); + my $arg1 = $3; + my $cast2 = deparenthesize($7); + my $arg2 = $8; + my $cast; + + if ($cast1 ne "" && $cast2 ne "" && $cast1 ne $cast2) { + $cast = "$cast1 or $cast2"; + } elsif ($cast1 ne "") { + $cast = $cast1; + } else { + $cast = $cast2; + } + WARN("MINMAX", + "$call() should probably be ${call}_t($cast, $arg1, $arg2)\n" . "$here\n$stat\n"); + } + } + +# check usleep_range arguments + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+(?:.*?)\busleep_range\s*\(\s*($FuncArg)\s*,\s*($FuncArg)\s*\)/) { + my $min = $1; + my $max = $7; + if ($min eq $max) { + WARN("USLEEP_RANGE", + "usleep_range should not use min == max args; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n"); + } elsif ($min =~ /^\d+$/ && $max =~ /^\d+$/ && + $min > $max) { + WARN("USLEEP_RANGE", + "usleep_range args reversed, use min then max; see Documentation/timers/timers-howto.rst\n" . "$here\n$stat\n"); + } + } + +# check for naked sscanf + if ($perl_version_ok && + defined $stat && + $line =~ /\bsscanf\b/ && + ($stat !~ /$Ident\s*=\s*sscanf\s*$balanced_parens/ && + $stat !~ /\bsscanf\s*$balanced_parens\s*(?:$Compare)/ && + $stat !~ /(?:$Compare)\s*\bsscanf\s*$balanced_parens/)) { + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + my $stat_real = get_stat_real($linenr, $lc); + WARN("NAKED_SSCANF", + "unchecked sscanf return value\n" . "$here\n$stat_real\n"); + } + +# check for simple sscanf that should be kstrto<foo> + if ($perl_version_ok && + defined $stat && + $line =~ /\bsscanf\b/) { + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + my $stat_real = get_stat_real($linenr, $lc); + if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) { + my $format = $6; + my $count = $format =~ tr@%@%@; + if ($count == 1 && + $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) { + WARN("SSCANF_TO_KSTRTO", + "Prefer kstrto<type> to single variable sscanf\n" . "$here\n$stat_real\n"); + } + } + } + +# check for new externs in .h files. + if ($realfile =~ /\.h$/ && + $line =~ /^\+\s*(extern\s+)$Type\s*$Ident\s*\(/s) { + if (CHK("AVOID_EXTERNS", + "extern prototypes should be avoided in .h files\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(.*)\bextern\b\s*(.*)/$1$2/; + } + } + +# check for new externs in .c files. + if ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^.\s*(?:extern\s+)?$Type\s+($Ident)(\s*)\(/s) + { + my $function_name = $1; + my $paren_space = $2; + + my $s = $stat; + if (defined $cond) { + substr($s, 0, length($cond), ''); + } + if ($s =~ /^\s*;/ && + $function_name ne 'uninitialized_var') + { + WARN("AVOID_EXTERNS", + "externs should be avoided in .c files\n" . $herecurr); + } + + if ($paren_space =~ /\n/) { + WARN("FUNCTION_ARGUMENTS", + "arguments for function declarations should follow identifier\n" . $herecurr); + } + + } elsif ($realfile =~ /\.c$/ && defined $stat && + $stat =~ /^.\s*extern\s+/) + { + WARN("AVOID_EXTERNS", + "externs should be avoided in .c files\n" . $herecurr); + } + +# check for function declarations that have arguments without identifier names + if (defined $stat && + $stat =~ /^.\s*(?:extern\s+)?$Type\s*(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*\(\s*([^{]+)\s*\)\s*;/s && + $1 ne "void") { + my $args = trim($1); + while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) { + my $arg = trim($1); + if ($arg =~ /^$Type$/ && $arg !~ /enum\s+$Ident$/) { + WARN("FUNCTION_ARGUMENTS", + "function definition argument '$arg' should also have an identifier name\n" . $herecurr); + } + } + } + +# check for function definitions + if ($perl_version_ok && + defined $stat && + $stat =~ /^.\s*(?:$Storage\s+)?$Type\s*($Ident)\s*$balanced_parens\s*{/s) { + $context_function = $1; + +# check for multiline function definition with misplaced open brace + my $ok = 0; + my $cnt = statement_rawlines($stat); + my $herectx = $here . "\n"; + for (my $n = 0; $n < $cnt; $n++) { + my $rl = raw_line($linenr, $n); + $herectx .= $rl . "\n"; + $ok = 1 if ($rl =~ /^[ \+]\{/); + $ok = 1 if ($rl =~ /\{/ && $n == 0); + last if $rl =~ /^[ \+].*\{/; + } + if (!$ok) { + ERROR("OPEN_BRACE", + "open brace '{' following function definitions go on the next line\n" . $herectx); + } + } + +# checks for new __setup's + if ($rawline =~ /\b__setup\("([^"]*)"/) { + my $name = $1; + + if (!grep(/$name/, @setup_docs)) { + CHK("UNDOCUMENTED_SETUP", + "__setup appears un-documented -- check Documentation/admin-guide/kernel-parameters.rst\n" . $herecurr); + } + } + +# check for pointless casting of alloc functions + if ($line =~ /\*\s*\)\s*$allocFunctions\b/) { + WARN("UNNECESSARY_CASTS", + "unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr); + } + +# alloc style +# p = alloc(sizeof(struct foo), ...) should be p = alloc(sizeof(*p), ...) + if ($perl_version_ok && + $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*((?:kv|k|v)[mz]alloc(?:_node)?)\s*\(\s*(sizeof\s*\(\s*struct\s+$Lval\s*\))/) { + CHK("ALLOC_SIZEOF_STRUCT", + "Prefer $3(sizeof(*$1)...) over $3($4...)\n" . $herecurr); + } + +# check for k[mz]alloc with multiplies that could be kmalloc_array/kcalloc + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+\s*($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)\s*,/) { + my $oldfunc = $3; + my $a1 = $4; + my $a2 = $10; + my $newfunc = "kmalloc_array"; + $newfunc = "kcalloc" if ($oldfunc eq "kzalloc"); + my $r1 = $a1; + my $r2 = $a2; + if ($a1 =~ /^sizeof\s*\S/) { + $r1 = $a2; + $r2 = $a1; + } + if ($r1 !~ /^sizeof\b/ && $r2 =~ /^sizeof\s*\S/ && + !($r1 =~ /^$Constant$/ || $r1 =~ /^[A-Z_][A-Z0-9_]*$/)) { + my $cnt = statement_rawlines($stat); + my $herectx = get_stat_here($linenr, $cnt, $here); + + if (WARN("ALLOC_WITH_MULTIPLY", + "Prefer $newfunc over $oldfunc with multiply\n" . $herectx) && + $cnt == 1 && + $fix) { + $fixed[$fixlinenr] =~ s/\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*(k[mz]alloc)\s*\(\s*($FuncArg)\s*\*\s*($FuncArg)/$1 . ' = ' . "$newfunc(" . trim($r1) . ', ' . trim($r2)/e; + } + } + } + +# check for krealloc arg reuse + if ($perl_version_ok && + $line =~ /\b($Lval)\s*\=\s*(?:$balanced_parens)?\s*krealloc\s*\(\s*($Lval)\s*,/ && + $1 eq $3) { + WARN("KREALLOC_ARG_REUSE", + "Reusing the krealloc arg is almost always a bug\n" . $herecurr); + } + +# check for alloc argument mismatch + if ($line =~ /\b(kcalloc|kmalloc_array)\s*\(\s*sizeof\b/) { + WARN("ALLOC_ARRAY_ARGS", + "$1 uses number as first arg, sizeof is generally wrong\n" . $herecurr); + } + +# check for multiple semicolons + if ($line =~ /;\s*;\s*$/) { + if (WARN("ONE_SEMICOLON", + "Statements terminations use 1 semicolon\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/(\s*;\s*){2,}$/;/g; + } + } + +# check for #defines like: 1 << <digit> that could be BIT(digit), it is not exported to uapi + if ($realfile !~ m@^include/uapi/@ && + $line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) { + my $ull = ""; + $ull = "_ULL" if (defined($1) && $1 =~ /ll/i); + if (CHK("BIT_MACRO", + "Prefer using the BIT$ull macro\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/; + } + } + +# check for #if defined CONFIG_<FOO> || defined CONFIG_<FOO>_MODULE + if ($line =~ /^\+\s*#\s*if\s+defined(?:\s*\(?\s*|\s+)(CONFIG_[A-Z_]+)\s*\)?\s*\|\|\s*defined(?:\s*\(?\s*|\s+)\1_MODULE\s*\)?\s*$/) { + my $config = $1; + if (WARN("PREFER_IS_ENABLED", + "Prefer IS_ENABLED(<FOO>) to CONFIG_<FOO> || CONFIG_<FOO>_MODULE\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] = "\+#if IS_ENABLED($config)"; + } + } + +# check for case / default statements not preceded by break/fallthrough/switch + if ($line =~ /^.\s*(?:case\s+(?:$Ident|$Constant)\s*|default):/) { + my $has_break = 0; + my $has_statement = 0; + my $count = 0; + my $prevline = $linenr; + while ($prevline > 1 && ($file || $count < 3) && !$has_break) { + $prevline--; + my $rline = $rawlines[$prevline - 1]; + my $fline = $lines[$prevline - 1]; + last if ($fline =~ /^\@\@/); + next if ($fline =~ /^\-/); + next if ($fline =~ /^.(?:\s*(?:case\s+(?:$Ident|$Constant)[\s$;]*|default):[\s$;]*)*$/); + $has_break = 1 if ($rline =~ /fall[\s_-]*(through|thru)/i); + next if ($fline =~ /^.[\s$;]*$/); + $has_statement = 1; + $count++; + $has_break = 1 if ($fline =~ /\bswitch\b|\b(?:break\s*;[\s$;]*$|exit\s*\(\b|return\b|goto\b|continue\b)/); + } + if (!$has_break && $has_statement) { + WARN("MISSING_BREAK", + "Possible switch case/default not preceded by break or fallthrough comment\n" . $herecurr); + } + } + +# check for switch/default statements without a break; + if ($perl_version_ok && + defined $stat && + $stat =~ /^\+[$;\s]*(?:case[$;\s]+\w+[$;\s]*:[$;\s]*|)*[$;\s]*\bdefault[$;\s]*:[$;\s]*;/g) { + my $cnt = statement_rawlines($stat); + my $herectx = get_stat_here($linenr, $cnt, $here); + + WARN("DEFAULT_NO_BREAK", + "switch default: should use break\n" . $herectx); + } + +# check for gcc specific __FUNCTION__ + if ($line =~ /\b__FUNCTION__\b/) { + if (WARN("USE_FUNC", + "__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\b__FUNCTION__\b/__func__/g; + } + } + +# check for uses of __DATE__, __TIME__, __TIMESTAMP__ + while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) { + ERROR("DATE_TIME", + "Use of the '$1' macro makes the build non-deterministic\n" . $herecurr); + } + +# check for use of yield() + if ($line =~ /\byield\s*\(\s*\)/) { + WARN("YIELD", + "Using yield() is generally wrong. See yield() kernel-doc (sched/core.c)\n" . $herecurr); + } + +# check for comparisons against true and false + if ($line =~ /\+\s*(.*?)\b(true|false|$Lval)\s*(==|\!=)\s*(true|false|$Lval)\b(.*)$/i) { + my $lead = $1; + my $arg = $2; + my $test = $3; + my $otype = $4; + my $trail = $5; + my $op = "!"; + + ($arg, $otype) = ($otype, $arg) if ($arg =~ /^(?:true|false)$/i); + + my $type = lc($otype); + if ($type =~ /^(?:true|false)$/) { + if (("$test" eq "==" && "$type" eq "true") || + ("$test" eq "!=" && "$type" eq "false")) { + $op = ""; + } + + CHK("BOOL_COMPARISON", + "Using comparison to $otype is error prone\n" . $herecurr); + +## maybe suggesting a correct construct would better +## "Using comparison to $otype is error prone. Perhaps use '${lead}${op}${arg}${trail}'\n" . $herecurr); + + } + } + +# check for semaphores initialized locked + if ($line =~ /^.\s*sema_init.+,\W?0\W?\)/) { + WARN("CONSIDER_COMPLETION", + "consider using a completion\n" . $herecurr); + } + +# recommend kstrto* over simple_strto* and strict_strto* + if ($line =~ /\b((simple|strict)_(strto(l|ll|ul|ull)))\s*\(/) { + WARN("CONSIDER_KSTRTO", + "$1 is obsolete, use k$3 instead\n" . $herecurr); + } + +# check for __initcall(), use device_initcall() explicitly or more appropriate function please + if ($line =~ /^.\s*__initcall\s*\(/) { + WARN("USE_DEVICE_INITCALL", + "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr); + } + +# check for spin_is_locked(), suggest lockdep instead + if ($line =~ /\bspin_is_locked\(/) { + WARN("USE_LOCKDEP", + "Where possible, use lockdep_assert_held instead of assertions based on spin_is_locked\n" . $herecurr); + } + +# check for deprecated apis + if ($line =~ /\b($deprecated_apis_search)\b\s*\(/) { + my $deprecated_api = $1; + my $new_api = $deprecated_apis{$deprecated_api}; + WARN("DEPRECATED_API", + "Deprecated use of '$deprecated_api', prefer '$new_api' instead\n" . $herecurr); + } + +# check for various structs that are normally const (ops, kgdb, device_tree) +# and avoid what seem like struct definitions 'struct foo {' + if ($line !~ /\bconst\b/ && + $line =~ /\bstruct\s+($const_structs)\b(?!\s*\{)/) { + WARN("CONST_STRUCT", + "struct $1 should normally be const\n" . $herecurr); + } + +# use of NR_CPUS is usually wrong +# ignore definitions of NR_CPUS and usage to define arrays as likely right + if ($line =~ /\bNR_CPUS\b/ && + $line !~ /^.\s*\s*#\s*if\b.*\bNR_CPUS\b/ && + $line !~ /^.\s*\s*#\s*define\b.*\bNR_CPUS\b/ && + $line !~ /^.\s*$Declare\s.*\[[^\]]*NR_CPUS[^\]]*\]/ && + $line !~ /\[[^\]]*\.\.\.[^\]]*NR_CPUS[^\]]*\]/ && + $line !~ /\[[^\]]*NR_CPUS[^\]]*\.\.\.[^\]]*\]/) + { + WARN("NR_CPUS", + "usage of NR_CPUS is often wrong - consider using cpu_possible(), num_possible_cpus(), for_each_possible_cpu(), etc\n" . $herecurr); + } + +# Use of __ARCH_HAS_<FOO> or ARCH_HAVE_<BAR> is wrong. + if ($line =~ /\+\s*#\s*define\s+((?:__)?ARCH_(?:HAS|HAVE)\w*)\b/) { + ERROR("DEFINE_ARCH_HAS", + "#define of '$1' is wrong - use Kconfig variables or standard guards instead\n" . $herecurr); + } + +# likely/unlikely comparisons similar to "(likely(foo) > 0)" + if ($perl_version_ok && + $line =~ /\b((?:un)?likely)\s*\(\s*$FuncArg\s*\)\s*$Compare/) { + WARN("LIKELY_MISUSE", + "Using $1 should generally have parentheses around the comparison\n" . $herecurr); + } + +# nested likely/unlikely calls + if ($line =~ /\b(?:(?:un)?likely)\s*\(\s*!?\s*(IS_ERR(?:_OR_NULL|_VALUE)?|WARN)/) { + WARN("LIKELY_MISUSE", + "nested (un)?likely() calls, $1 already uses unlikely() internally\n" . $herecurr); + } + +# whine mightly about in_atomic + if ($line =~ /\bin_atomic\s*\(/) { + if ($realfile =~ m@^drivers/@) { + ERROR("IN_ATOMIC", + "do not use in_atomic in drivers\n" . $herecurr); + } elsif ($realfile !~ m@^kernel/@) { + WARN("IN_ATOMIC", + "use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); + } + } + +# check for mutex_trylock_recursive usage + if ($line =~ /mutex_trylock_recursive/) { + ERROR("LOCKING", + "recursive locking is bad, do not use this ever.\n" . $herecurr); + } + +# check for lockdep_set_novalidate_class + if ($line =~ /^.\s*lockdep_set_novalidate_class\s*\(/ || + $line =~ /__lockdep_no_validate__\s*\)/ ) { + if ($realfile !~ m@^kernel/lockdep@ && + $realfile !~ m@^include/linux/lockdep@ && + $realfile !~ m@^drivers/base/core@) { + ERROR("LOCKDEP", + "lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr); + } + } + + if ($line =~ /debugfs_create_\w+.*\b$mode_perms_world_writable\b/ || + $line =~ /DEVICE_ATTR.*\b$mode_perms_world_writable\b/) { + WARN("EXPORTED_WORLD_WRITABLE", + "Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); + } + +# check for DEVICE_ATTR uses that could be DEVICE_ATTR_<FOO> +# and whether or not function naming is typical and if +# DEVICE_ATTR permissions uses are unusual too + if ($perl_version_ok && + defined $stat && + $stat =~ /\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?\s*(\s*(?:${multi_mode_perms_string_search}|0[0-7]{3,3})\s*)\s*\)?\s*,\s*(\w+)\s*,\s*(\w+)\s*\)/) { + my $var = $1; + my $perms = $2; + my $show = $3; + my $store = $4; + my $octal_perms = perms_to_octal($perms); + if ($show =~ /^${var}_show$/ && + $store =~ /^${var}_store$/ && + $octal_perms eq "0644") { + if (WARN("DEVICE_ATTR_RW", + "Use DEVICE_ATTR_RW\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*$show\s*,\s*$store\s*\)/DEVICE_ATTR_RW(${var})/; + } + } elsif ($show =~ /^${var}_show$/ && + $store =~ /^NULL$/ && + $octal_perms eq "0444") { + if (WARN("DEVICE_ATTR_RO", + "Use DEVICE_ATTR_RO\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*$show\s*,\s*NULL\s*\)/DEVICE_ATTR_RO(${var})/; + } + } elsif ($show =~ /^NULL$/ && + $store =~ /^${var}_store$/ && + $octal_perms eq "0200") { + if (WARN("DEVICE_ATTR_WO", + "Use DEVICE_ATTR_WO\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\bDEVICE_ATTR\s*\(\s*$var\s*,\s*\Q$perms\E\s*,\s*NULL\s*,\s*$store\s*\)/DEVICE_ATTR_WO(${var})/; + } + } elsif ($octal_perms eq "0644" || + $octal_perms eq "0444" || + $octal_perms eq "0200") { + my $newshow = "$show"; + $newshow = "${var}_show" if ($show ne "NULL" && $show ne "${var}_show"); + my $newstore = $store; + $newstore = "${var}_store" if ($store ne "NULL" && $store ne "${var}_store"); + my $rename = ""; + if ($show ne $newshow) { + $rename .= " '$show' to '$newshow'"; + } + if ($store ne $newstore) { + $rename .= " '$store' to '$newstore'"; + } + WARN("DEVICE_ATTR_FUNCTIONS", + "Consider renaming function(s)$rename\n" . $herecurr); + } else { + WARN("DEVICE_ATTR_PERMS", + "DEVICE_ATTR unusual permissions '$perms' used\n" . $herecurr); + } + } + +# Mode permission misuses where it seems decimal should be octal +# This uses a shortcut match to avoid unnecessary uses of a slow foreach loop +# o Ignore module_param*(...) uses with a decimal 0 permission as that has a +# specific definition of not visible in sysfs. +# o Ignore proc_create*(...) uses with a decimal 0 permission as that means +# use the default permissions + if ($perl_version_ok && + defined $stat && + $line =~ /$mode_perms_search/) { + foreach my $entry (@mode_permission_funcs) { + my $func = $entry->[0]; + my $arg_pos = $entry->[1]; + + my $lc = $stat =~ tr@\n@@; + $lc = $lc + $linenr; + my $stat_real = get_stat_real($linenr, $lc); + + my $skip_args = ""; + if ($arg_pos > 1) { + $arg_pos--; + $skip_args = "(?:\\s*$FuncArg\\s*,\\s*){$arg_pos,$arg_pos}"; + } + my $test = "\\b$func\\s*\\(${skip_args}($FuncArg(?:\\|\\s*$FuncArg)*)\\s*[,\\)]"; + if ($stat =~ /$test/) { + my $val = $1; + $val = $6 if ($skip_args ne ""); + if (!($func =~ /^(?:module_param|proc_create)/ && $val eq "0") && + (($val =~ /^$Int$/ && $val !~ /^$Octal$/) || + ($val =~ /^$Octal$/ && length($val) ne 4))) { + ERROR("NON_OCTAL_PERMISSIONS", + "Use 4 digit octal (0777) not decimal permissions\n" . "$here\n" . $stat_real); + } + if ($val =~ /^$Octal$/ && (oct($val) & 02)) { + ERROR("EXPORTED_WORLD_WRITABLE", + "Exporting writable files is usually an error. Consider more restrictive permissions.\n" . "$here\n" . $stat_real); + } + } + } + } + +# check for uses of S_<PERMS> that could be octal for readability + while ($line =~ m{\b($multi_mode_perms_string_search)\b}g) { + my $oval = $1; + my $octal = perms_to_octal($oval); + if (WARN("SYMBOLIC_PERMS", + "Symbolic permissions '$oval' are not preferred. Consider using octal permissions '$octal'.\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/\Q$oval\E/$octal/; + } + } + +# validate content of MODULE_LICENSE against list from include/linux/module.h + if ($line =~ /\bMODULE_LICENSE\s*\(\s*($String)\s*\)/) { + my $extracted_string = get_quoted_string($line, $rawline); + my $valid_licenses = qr{ + GPL| + GPL\ v2| + GPL\ and\ additional\ rights| + Dual\ BSD/GPL| + Dual\ MIT/GPL| + Dual\ MPL/GPL| + Proprietary + }x; + if ($extracted_string !~ /^"(?:$valid_licenses)"$/x) { + WARN("MODULE_LICENSE", + "unknown module license " . $extracted_string . "\n" . $herecurr); + } + } + +# check for sysctl duplicate constants + if ($line =~ /\.extra[12]\s*=\s*&(zero|one|int_max)\b/) { + WARN("DUPLICATED_SYSCTL_CONST", + "duplicated sysctl range checking value '$1', consider using the shared one in include/linux/sysctl.h\n" . $herecurr); + } + } + + # If we have no input at all, then there is nothing to report on + # so just keep quiet. + if ($#rawlines == -1) { + exit(0); + } + + # In mailback mode only produce a report in the negative, for + # things that appear to be patches. + if ($mailback && ($clean == 1 || !$is_patch)) { + exit(0); + } + + # This is not a patch, and we are are in 'no-patch' mode so + # just keep quiet. + if (!$chk_patch && !$is_patch) { + exit(0); + } + + if (!$is_patch && $filename !~ /cover-letter\.patch$/) { + ERROR("NOT_UNIFIED_DIFF", + "Does not appear to be a unified-diff format patch\n"); + } + if ($is_patch && $has_commit_log && $chk_signoff) { + if ($signoff == 0) { + ERROR("MISSING_SIGN_OFF", + "Missing Signed-off-by: line(s)\n"); + } elsif (!$authorsignoff) { + WARN("NO_AUTHOR_SIGN_OFF", + "Missing Signed-off-by: line by nominal patch author '$author'\n"); + } + } + + print report_dump(); + if ($summary && !($clean == 1 && $quiet == 1)) { + print "$filename " if ($summary_file); + print "total: $cnt_error errors, $cnt_warn warnings, " . + (($check)? "$cnt_chk checks, " : "") . + "$cnt_lines lines checked\n"; + } + + if ($quiet == 0) { + # If there were any defects found and not already fixing them + if (!$clean and !$fix) { + print << "EOM" + +NOTE: For some of the reported defects, checkpatch may be able to + mechanically convert to the typical style using --fix or --fix-inplace. +EOM + } + # If there were whitespace errors which cleanpatch can fix + # then suggest that. + if ($rpt_cleaners) { + $rpt_cleaners = 0; + print << "EOM" + +NOTE: Whitespace errors detected. + You may wish to use scripts/cleanpatch or scripts/cleanfile +EOM + } + } + + if ($clean == 0 && $fix && + ("@rawlines" ne "@fixed" || + $#fixed_inserted >= 0 || $#fixed_deleted >= 0)) { + my $newfile = $filename; + $newfile .= ".EXPERIMENTAL-checkpatch-fixes" if (!$fix_inplace); + my $linecount = 0; + my $f; + + @fixed = fix_inserted_deleted_lines(\@fixed, \@fixed_inserted, \@fixed_deleted); + + open($f, '>', $newfile) + or die "$P: Can't open $newfile for write\n"; + foreach my $fixed_line (@fixed) { + $linecount++; + if ($file) { + if ($linecount > 3) { + $fixed_line =~ s/^\+//; + print $f $fixed_line . "\n"; + } + } else { + print $f $fixed_line . "\n"; + } + } + close($f); + + if (!$quiet) { + print << "EOM"; + +Wrote EXPERIMENTAL --fix correction(s) to '$newfile' + +Do _NOT_ trust the results written to this file. +Do _NOT_ submit these changes without inspecting them for correctness. + +This EXPERIMENTAL file is simply a convenience to help rewrite patches. +No warranties, expressed or implied... +EOM + } + } + + if ($quiet == 0) { + print "\n"; + if ($clean == 1) { + print "$vname has no obvious style problems and is ready for submission.\n"; + } else { + print "$vname has style problems, please review.\n"; + } + } + return $clean; +} diff --git a/scripts/const_structs.checkpatch b/scripts/const_structs.checkpatch new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/scripts/spelling.txt b/scripts/spelling.txt new file mode 100644 index 000000000000..9a058cff49d4 --- /dev/null +++ b/scripts/spelling.txt @@ -0,0 +1,1254 @@ +# Originally from Debian's Lintian tool. Various false positives have been +# removed, and various additions have been made as they've been discovered +# in the kernel source. +# +# License: GPLv2 +# +# The format of each line is: +# mistake||correction +# +abandonning||abandoning +abigious||ambiguous +abitrate||arbitrate +abov||above +abreviated||abbreviated +absense||absence +absolut||absolute +absoulte||absolute +acccess||access +acceess||access +acceleratoin||acceleration +accelleration||acceleration +accesing||accessing +accesnt||accent +accessable||accessible +accesss||access +accidentaly||accidentally +accidentually||accidentally +accoding||according +accomodate||accommodate +accomodates||accommodates +accordign||according +accoring||according +accout||account +accquire||acquire +accquired||acquired +accross||across +acessable||accessible +acess||access +achitecture||architecture +acient||ancient +acitions||actions +acitve||active +acknowldegement||acknowledgment +acknowledgement||acknowledgment +ackowledge||acknowledge +ackowledged||acknowledged +acording||according +activete||activate +actived||activated +actualy||actually +acumulating||accumulating +acumulator||accumulator +adapater||adapter +addional||additional +additionaly||additionally +additonal||additional +addres||address +adddress||address +addreses||addresses +addresss||address +aditional||additional +aditionally||additionally +aditionaly||additionally +adminstrative||administrative +adress||address +adresses||addresses +adviced||advised +afecting||affecting +againt||against +agaist||against +aggreataon||aggregation +aggreation||aggregation +albumns||albums +alegorical||allegorical +algined||aligned +algorith||algorithm +algorithmical||algorithmically +algoritm||algorithm +algoritms||algorithms +algorrithm||algorithm +algorritm||algorithm +aligment||alignment +alignement||alignment +allign||align +alligned||aligned +alllocate||allocate +alloated||allocated +allocatote||allocate +allocatrd||allocated +allocte||allocate +allpication||application +alocate||allocate +alogirhtms||algorithms +alogrithm||algorithm +alot||a lot +alow||allow +alows||allows +altough||although +alue||value +ambigious||ambiguous +amoung||among +amout||amount +an union||a union +an user||a user +an userspace||a userspace +an one||a one +analysator||analyzer +ang||and +anniversery||anniversary +annoucement||announcement +anomolies||anomalies +anomoly||anomaly +anway||anyway +aplication||application +appearence||appearance +applicaion||application +appliction||application +applictions||applications +applys||applies +appplications||applications +appropiate||appropriate +appropriatly||appropriately +approriate||appropriate +approriately||appropriately +apropriate||appropriate +aquainted||acquainted +aquired||acquired +aquisition||acquisition +arbitary||arbitrary +architechture||architecture +arguement||argument +arguements||arguments +aritmetic||arithmetic +arne't||aren't +arraival||arrival +artifical||artificial +artillary||artillery +asign||assign +asser||assert +assertation||assertion +assiged||assigned +assigment||assignment +assigments||assignments +assistent||assistant +assocation||association +associcated||associated +assotiated||associated +assum||assume +assumtpion||assumption +asuming||assuming +asycronous||asynchronous +asynchnous||asynchronous +atomatically||automatically +atomicly||atomically +atempt||attempt +attachement||attachment +attched||attached +attemps||attempts +attemping||attempting +attruibutes||attributes +authentification||authentication +automaticaly||automatically +automaticly||automatically +automatize||automate +automatized||automated +automatizes||automates +autonymous||autonomous +auxillary||auxiliary +auxilliary||auxiliary +avaiable||available +avaible||available +availabe||available +availabled||available +availablity||availability +availale||available +availavility||availability +availble||available +availiable||available +availible||available +avalable||available +avaliable||available +aysnc||async +backgroud||background +backword||backward +backwords||backwards +bahavior||behavior +bakup||backup +baloon||balloon +baloons||balloons +bandwith||bandwidth +banlance||balance +batery||battery +beacuse||because +becasue||because +becomming||becoming +becuase||because +beeing||being +befor||before +begining||beginning +beter||better +betweeen||between +bianries||binaries +bitmast||bitmask +boardcast||broadcast +borad||board +boundry||boundary +brievely||briefly +broadcat||broadcast +cacluated||calculated +caculation||calculation +calender||calendar +calescing||coalescing +calle||called +callibration||calibration +calucate||calculate +calulate||calculate +cancelation||cancellation +cancle||cancel +capabilites||capabilities +capabilty||capability +capabitilies||capabilities +capatibilities||capabilities +capapbilities||capabilities +carefuly||carefully +cariage||carriage +catagory||category +cehck||check +challange||challenge +challanges||challenges +chanell||channel +changable||changeable +chanined||chained +channle||channel +channnel||channel +charachter||character +charachters||characters +charactor||character +charater||character +charaters||characters +charcter||character +chcek||check +chck||check +checksuming||checksumming +childern||children +childs||children +chiled||child +chked||checked +chnage||change +chnages||changes +chnnel||channel +choosen||chosen +chouse||chose +circumvernt||circumvent +claread||cleared +clared||cleared +closeing||closing +clustred||clustered +coexistance||coexistence +collapsable||collapsible +colorfull||colorful +comand||command +comit||commit +commerical||commercial +comming||coming +comminucation||communication +commited||committed +commiting||committing +committ||commit +commoditiy||commodity +comsume||consume +comsumer||consumer +comsuming||consuming +compability||compatibility +compaibility||compatibility +compatability||compatibility +compatable||compatible +compatibiliy||compatibility +compatibilty||compatibility +compatiblity||compatibility +competion||completion +compilant||compliant +compleatly||completely +completition||completion +completly||completely +complient||compliant +componnents||components +compoment||component +compres||compress +compresion||compression +comression||compression +comunication||communication +conbination||combination +conditionaly||conditionally +conected||connected +connecetd||connected +configuartion||configuration +configuratoin||configuration +configuraton||configuration +configuretion||configuration +configutation||configuration +conider||consider +conjuction||conjunction +connectinos||connections +connnection||connection +connnections||connections +consistancy||consistency +consistant||consistent +containes||contains +containts||contains +contaisn||contains +contant||contact +contence||contents +continious||continuous +continous||continuous +continously||continuously +continueing||continuing +contraints||constraints +contol||control +contoller||controller +controled||controlled +controler||controller +controll||control +contruction||construction +contry||country +conuntry||country +convertion||conversion +convertor||converter +convienient||convenient +convinient||convenient +corected||corrected +correponding||corresponding +correponds||corresponds +correspoding||corresponding +cotrol||control +cound||could +couter||counter +coutner||counter +cryptocraphic||cryptographic +cunter||counter +curently||currently +cylic||cyclic +dafault||default +deafult||default +deamon||daemon +decompres||decompress +decription||description +dectected||detected +defailt||default +defferred||deferred +definate||definite +definately||definitely +defintion||definition +defintions||definitions +defualt||default +defult||default +deintializing||deinitializing +deintialize||deinitialize +deintialized||deinitialized +deivce||device +delared||declared +delare||declare +delares||declares +delaring||declaring +delemiter||delimiter +demodualtor||demodulator +demension||dimension +dependancies||dependencies +dependancy||dependency +dependant||dependent +depreacted||deprecated +depreacte||deprecate +desactivate||deactivate +desciptor||descriptor +desciptors||descriptors +descripton||description +descrition||description +descritptor||descriptor +desctiptor||descriptor +desriptor||descriptor +desriptors||descriptors +destionation||destination +destory||destroy +destoryed||destroyed +destorys||destroys +destroied||destroyed +detabase||database +deteced||detected +develope||develop +developement||development +developped||developed +developpement||development +developper||developer +developpment||development +deveolpment||development +devided||divided +deviece||device +diable||disable +dictionnary||dictionary +didnt||didn't +diferent||different +differrence||difference +diffrent||different +diffrentiate||differentiate +difinition||definition +dimesions||dimensions +diplay||display +direectly||directly +disassocation||disassociation +disapear||disappear +disapeared||disappeared +disappared||disappeared +disble||disable +disbled||disabled +disconnet||disconnect +discontinous||discontinuous +dispertion||dispersion +dissapears||disappears +distiction||distinction +docuentation||documentation +documantation||documentation +documentaion||documentation +documment||document +doesnt||doesn't +dorp||drop +dosen||doesn +downlad||download +downlads||downloads +druing||during +dynmaic||dynamic +easilly||easily +ecspecially||especially +edditable||editable +editting||editing +efective||effective +efficently||efficiently +ehther||ether +eigth||eight +elementry||elementary +eletronic||electronic +embeded||embedded +enabledi||enabled +enchanced||enhanced +encorporating||incorporating +encrupted||encrypted +encrypiton||encryption +encryptio||encryption +endianess||endianness +enhaced||enhanced +enlightnment||enlightenment +entrys||entries +enocded||encoded +enterily||entirely +enviroiment||environment +enviroment||environment +environement||environment +environent||environment +eqivalent||equivalent +equiped||equipped +equivelant||equivalent +equivilant||equivalent +eror||error +errorr||error +estbalishment||establishment +etsablishment||establishment +etsbalishment||establishment +excecutable||executable +exceded||exceeded +excellant||excellent +exeed||exceed +existance||existence +existant||existent +exixt||exist +exlcude||exclude +exlcusive||exclusive +exmaple||example +expecially||especially +explicite||explicit +explicitely||explicitly +explict||explicit +explictely||explicitly +explictly||explicitly +expresion||expression +exprimental||experimental +extened||extended +extensability||extensibility +extention||extension +extracter||extractor +falied||failed +faild||failed +faill||fail +failied||failed +faillure||failure +failue||failure +failuer||failure +failng||failing +faireness||fairness +falied||failed +faliure||failure +fallbck||fallback +familar||familiar +fatser||faster +feauture||feature +feautures||features +fetaure||feature +fetaures||features +fileystem||filesystem +fimware||firmware +firware||firmware +finanize||finalize +findn||find +finilizes||finalizes +finsih||finish +flusing||flushing +folloing||following +followign||following +followings||following +follwing||following +fonud||found +forseeable||foreseeable +forse||force +fortan||fortran +forwardig||forwarding +framming||framing +framwork||framework +frequncy||frequency +frome||from +fucntion||function +fuction||function +fuctions||functions +funcion||function +functionallity||functionality +functionaly||functionally +functionnality||functionality +functonality||functionality +funtion||function +funtions||functions +furthur||further +futhermore||furthermore +futrue||future +gaurenteed||guaranteed +generiously||generously +genereate||generate +genric||generic +globel||global +grabing||grabbing +grahical||graphical +grahpical||graphical +grapic||graphic +grranted||granted +guage||gauge +guarenteed||guaranteed +guarentee||guarantee +halfs||halves +hander||handler +handfull||handful +hanled||handled +happend||happened +harware||hardware +heirarchically||hierarchically +helpfull||helpful +hybernate||hibernate +hierachy||hierarchy +hierarchie||hierarchy +howver||however +hsould||should +hypervior||hypervisor +hypter||hyper +identidier||identifier +iligal||illegal +illigal||illegal +imblance||imbalance +immeadiately||immediately +immedaite||immediate +immediatelly||immediately +immediatly||immediately +immidiate||immediate +impelentation||implementation +impementated||implemented +implemantation||implementation +implemenation||implementation +implementaiton||implementation +implementated||implemented +implemention||implementation +implementd||implemented +implemetation||implementation +implemntation||implementation +implentation||implementation +implmentation||implementation +implmenting||implementing +incative||inactive +incomming||incoming +incompatabilities||incompatibilities +incompatable||incompatible +inconsistant||inconsistent +increas||increase +incremeted||incremented +incrment||increment +indendation||indentation +indended||intended +independant||independent +independantly||independently +independed||independent +indiate||indicate +indicat||indicate +inexpect||inexpected +infomation||information +informatiom||information +informations||information +informtion||information +infromation||information +ingore||ignore +inital||initial +initalized||initialized +initalised||initialized +initalise||initialize +initalize||initialize +initation||initiation +initators||initiators +initialiazation||initialization +initializiation||initialization +initialzed||initialized +initilization||initialization +initilize||initialize +inofficial||unofficial +insititute||institute +instal||install +instanciated||instantiated +inteface||interface +integreated||integrated +integrety||integrity +integrey||integrity +intendet||intended +intented||intended +interanl||internal +interchangable||interchangeable +interferring||interfering +interger||integer +intermittant||intermittent +internel||internal +interoprability||interoperability +interuupt||interrupt +interrface||interface +interrrupt||interrupt +interrup||interrupt +interrups||interrupts +interruptted||interrupted +interupted||interrupted +interupt||interrupt +intial||initial +intialisation||initialisation +intialised||initialised +intialise||initialise +intialization||initialization +intialized||initialized +intialize||initialize +intregral||integral +intrrupt||interrupt +intterrupt||interrupt +intuative||intuitive +invaid||invalid +invald||invalid +invalde||invalid +invalide||invalid +invalidiate||invalidate +invalud||invalid +invididual||individual +invokation||invocation +invokations||invocations +irrelevent||irrelevant +isnt||isn't +isssue||issue +iternations||iterations +itertation||iteration +itslef||itself +jave||java +jeffies||jiffies +juse||just +jus||just +kown||known +langage||language +langauage||language +langauge||language +langugage||language +lauch||launch +layed||laid +leightweight||lightweight +lengh||length +lenght||length +lenth||length +lesstiff||lesstif +libaries||libraries +libary||library +librairies||libraries +libraris||libraries +licenceing||licencing +loggging||logging +loggin||login +logile||logfile +loosing||losing +losted||lost +machinary||machinery +maintainance||maintenance +maintainence||maintenance +maintan||maintain +makeing||making +malplaced||misplaced +malplace||misplace +managable||manageable +managment||management +mangement||management +manoeuvering||maneuvering +mappping||mapping +mathimatical||mathematical +mathimatic||mathematic +mathimatics||mathematics +maxium||maximum +mechamism||mechanism +meetign||meeting +ment||meant +mergable||mergeable +mesage||message +messags||messages +messgaes||messages +messsage||message +messsages||messages +micropone||microphone +microprocesspr||microprocessor +milliseonds||milliseconds +minium||minimum +minimam||minimum +minumum||minimum +misalinged||misaligned +miscelleneous||miscellaneous +misformed||malformed +mispelled||misspelled +mispelt||misspelt +mising||missing +mismactch||mismatch +missmanaged||mismanaged +missmatch||mismatch +miximum||maximum +mmnemonic||mnemonic +mnay||many +modulues||modules +momery||memory +memomry||memory +monochorome||monochrome +monochromo||monochrome +monocrome||monochrome +mopdule||module +mroe||more +mulitplied||multiplied +multidimensionnal||multidimensional +multple||multiple +mumber||number +muticast||multicast +mutilcast||multicast +mutiple||multiple +mutli||multi +nams||names +navagating||navigating +nead||need +neccecary||necessary +neccesary||necessary +neccessary||necessary +necesary||necessary +neded||needed +negaive||negative +negoitation||negotiation +negotation||negotiation +nerver||never +nescessary||necessary +nessessary||necessary +noticable||noticeable +notications||notifications +notifed||notified +numebr||number +numner||number +obtaion||obtain +occassionally||occasionally +occationally||occasionally +occurance||occurrence +occurances||occurrences +occured||occurred +occurence||occurrence +occure||occurred +occured||occurred +occuring||occurring +offet||offset +omited||omitted +omiting||omitting +omitt||omit +ommiting||omitting +ommitted||omitted +onself||oneself +ony||only +operatione||operation +opertaions||operations +optionnal||optional +optmizations||optimizations +orientatied||orientated +orientied||oriented +orignal||original +otherise||otherwise +ouput||output +oustanding||outstanding +overaall||overall +overhread||overhead +overlaping||overlapping +overide||override +overrided||overridden +overriden||overridden +overun||overrun +overwritting||overwriting +overwriten||overwritten +pacakge||package +pachage||package +packacge||package +packege||package +packge||package +packtes||packets +pakage||package +pallette||palette +paln||plan +paramameters||parameters +paramaters||parameters +paramater||parameter +parametes||parameters +parametised||parametrised +paramter||parameter +paramters||parameters +particuarly||particularly +particularily||particularly +partiton||partition +pased||passed +passin||passing +pathes||paths +pecularities||peculiarities +peformance||performance +peice||piece +pendantic||pedantic +peprocessor||preprocessor +perfoming||performing +permissons||permissions +peroid||period +persistance||persistence +persistant||persistent +plalform||platform +platfrom||platform +plattform||platform +pleaes||please +ploting||plotting +plugable||pluggable +poinnter||pointer +pointeur||pointer +poiter||pointer +posible||possible +positon||position +possibilites||possibilities +powerfull||powerful +preample||preamble +preapre||prepare +preceeded||preceded +preceeding||preceding +preceed||precede +precendence||precedence +precission||precision +preemptable||preemptible +prefered||preferred +prefferably||preferably +premption||preemption +prepaired||prepared +pressre||pressure +primative||primitive +princliple||principle +priorty||priority +privilaged||privileged +privilage||privilege +priviledge||privilege +priviledges||privileges +probaly||probably +procceed||proceed +proccesors||processors +procesed||processed +proces||process +procesing||processing +processessing||processing +processess||processes +processpr||processor +processsed||processed +processsing||processing +procteted||protected +prodecure||procedure +progams||programs +progess||progress +programers||programmers +programm||program +programms||programs +progresss||progress +promiscous||promiscuous +promps||prompts +pronnounced||pronounced +prononciation||pronunciation +pronouce||pronounce +pronunce||pronounce +propery||property +propigate||propagate +propigation||propagation +propogate||propagate +prosess||process +protable||portable +protcol||protocol +protecion||protection +protocoll||protocol +promixity||proximity +psudo||pseudo +psuedo||pseudo +psychadelic||psychedelic +pwoer||power +quering||querying +randomally||randomly +raoming||roaming +reasearcher||researcher +reasearchers||researchers +reasearch||research +recepient||recipient +receving||receiving +recieved||received +recieve||receive +reciever||receiver +recieves||receives +recogniced||recognised +recognizeable||recognizable +recommanded||recommended +recyle||recycle +redircet||redirect +redirectrion||redirection +reename||rename +refcounf||refcount +refence||reference +refered||referred +referenace||reference +refering||referring +refernces||references +refernnce||reference +refrence||reference +registerd||registered +registeresd||registered +registerred||registered +registes||registers +registraration||registration +regsiter||register +regster||register +regualar||regular +reguator||regulator +regulamentations||regulations +reigstration||registration +releated||related +relevent||relevant +remoote||remote +remore||remote +removeable||removable +repectively||respectively +replacable||replaceable +replacments||replacements +replys||replies +reponse||response +representaion||representation +reqeust||request +requestied||requested +requiere||require +requirment||requirement +requred||required +requried||required +requst||request +reseting||resetting +resizeable||resizable +resouce||resource +resouces||resources +resoures||resources +responce||response +ressizes||resizes +ressource||resource +ressources||resources +retransmited||retransmitted +retreived||retrieved +retreive||retrieve +retrive||retrieve +retuned||returned +reudce||reduce +reuest||request +reuqest||request +reutnred||returned +revsion||revision +rmeoved||removed +rmeove||remove +rmeoves||removes +rountine||routine +routins||routines +rquest||request +runing||running +runned||ran +runnning||running +runtine||runtime +sacrifying||sacrificing +safly||safely +safty||safety +savable||saveable +scaned||scanned +scaning||scanning +scarch||search +seach||search +searchs||searches +secquence||sequence +secund||second +segement||segment +senarios||scenarios +sentivite||sensitive +separatly||separately +sepcify||specify +sepc||spec +seperated||separated +seperately||separately +seperate||separate +seperatly||separately +seperator||separator +sepperate||separate +sequece||sequence +sequencial||sequential +serveral||several +setts||sets +settting||setting +shotdown||shutdown +shoud||should +shouldnt||shouldn't +shoule||should +shrinked||shrunk +siginificantly||significantly +signabl||signal +similary||similarly +similiar||similar +simlar||similar +simliar||similar +simpified||simplified +singaled||signaled +singal||signal +singed||signed +sleeped||slept +softwares||software +speach||speech +specfic||specific +speciefied||specified +specifc||specific +specifed||specified +specificatin||specification +specificaton||specification +specifing||specifying +specifiying||specifying +speficied||specified +speicify||specify +speling||spelling +spinlcok||spinlock +spinock||spinlock +splitted||split +spreaded||spread +spurrious||spurious +sructure||structure +stablilization||stabilization +staically||statically +staion||station +standardss||standards +standartization||standardization +standart||standard +staticly||statically +stoped||stopped +stoppped||stopped +straming||streaming +struc||struct +structres||structures +stuct||struct +strucuture||structure +stucture||structure +sturcture||structure +subdirectoires||subdirectories +suble||subtle +substract||subtract +submition||submission +succesfully||successfully +succesful||successful +successed||succeeded +successfull||successful +successfuly||successfully +sucessfully||successfully +sucess||success +superflous||superfluous +superseeded||superseded +suplied||supplied +suported||supported +suport||support +supportet||supported +suppored||supported +supportin||supporting +suppoted||supported +suppported||supported +suppport||support +supress||suppress +surpressed||suppressed +surpresses||suppresses +susbsystem||subsystem +suspeneded||suspended +suspicously||suspiciously +swaping||swapping +switchs||switches +swith||switch +swithable||switchable +swithc||switch +swithced||switched +swithcing||switching +swithed||switched +swithing||switching +swtich||switch +symetric||symmetric +synax||syntax +synchonized||synchronized +syncronize||synchronize +syncronized||synchronized +syncronizing||synchronizing +syncronus||synchronous +syste||system +sytem||system +sythesis||synthesis +taht||that +targetted||targeted +targetting||targeting +teh||the +temorary||temporary +temproarily||temporarily +therfore||therefore +thier||their +threds||threads +threshhold||threshold +thresold||threshold +throught||through +troughput||throughput +thses||these +tiggered||triggered +tipically||typically +timout||timeout +tmis||this +torerable||tolerable +tramsmitted||transmitted +tramsmit||transmit +tranasction||transaction +tranfer||transfer +transciever||transceiver +transferd||transferred +transfered||transferred +transfering||transferring +transision||transition +transmittd||transmitted +transormed||transformed +trasfer||transfer +trasmission||transmission +treshold||threshold +trigerring||triggering +trun||turn +tunning||tuning +ture||true +tyep||type +udpate||update +uesd||used +uncommited||uncommitted +unconditionaly||unconditionally +underun||underrun +unecessary||unnecessary +unexecpted||unexpected +unexepected||unexpected +unexpcted||unexpected +unexpectd||unexpected +unexpeted||unexpected +unexpexted||unexpected +unfortunatelly||unfortunately +unifiy||unify +unintialized||uninitialized +unkmown||unknown +unknonw||unknown +unknow||unknown +unkown||unknown +unneded||unneeded +unneccecary||unnecessary +unneccesary||unnecessary +unneccessary||unnecessary +unnecesary||unnecessary +unneedingly||unnecessarily +unnsupported||unsupported +unmached||unmatched +unregester||unregister +unresgister||unregister +unrgesiter||unregister +unsinged||unsigned +unstabel||unstable +unsolicitied||unsolicited +unsuccessfull||unsuccessful +unsuported||unsupported +untill||until +unuseful||useless +upate||update +usefule||useful +usefull||useful +usege||usage +usera||users +usualy||usually +utilites||utilities +utillities||utilities +utilties||utilities +utiltity||utility +utitity||utility +utitlty||utility +vaid||valid +vaild||valid +valide||valid +variantions||variations +varible||variable +varient||variant +vaule||value +verbse||verbose +verisons||versions +verison||version +verson||version +vicefersa||vice-versa +virtal||virtual +virtaul||virtual +virtiual||virtual +visiters||visitors +vitual||virtual +wakeus||wakeups +wating||waiting +wiat||wait +wether||whether +whataver||whatever +whcih||which +whenver||whenever +wheter||whether +whe||when +wierd||weird +wiil||will +wirte||write +withing||within +wnat||want +workarould||workaround +writeing||writing +writting||writing +zombe||zombie +zomebie||zombie From 7322c023493a2b3fe96fce16438d7dcea17f2212 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 15 Oct 2020 07:03:10 +0000 Subject: [PATCH 148/639] manifest.c: assert buffer overflow in man_copy_sram() Does not solve https://github.com/thesofproject/sof/issues/3423 but converts a buffer overflow and crash into a more usable assert. Buffer overflow found by running rimage with valgrind and the binaries provided by @singalsu Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/manifest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/manifest.c b/src/manifest.c index f8b1f8173058..237954b0560c 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -167,6 +167,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, void *buffer = image->fw_image + offset; size_t count; + assert((uint64_t)offset + section->size <= image->adsp->image_size); + switch (section->type) { case SHT_INIT_ARRAY: /* fall through */ From 86754c138941e0c43d2b0c5bbccb6e2d01baf0c7 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 15 Oct 2020 11:51:43 +0200 Subject: [PATCH 149/639] hash: Assert memory overflow during hash calculation ri_sha*() functions are often called with arguments calculated on the fly, so at list basic assertion here may save debugging time in the future. Cast size to uint64_t to properly handle nagative sizes, casted to uint32_t in argument list. Otherwise, sum size and offset may overflow uint32_t and don't trigger assert. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/hash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hash.c b/src/hash.c index a38e64c391ec..8c1117f812cb 100644 --- a/src/hash.c +++ b/src/hash.c @@ -5,6 +5,7 @@ // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> // Keyon Jie <yang.jie@linux.intel.com> +#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> @@ -82,6 +83,7 @@ void module_sha_complete(struct image *image, uint8_t *hash) void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) { + assert((uint64_t)size + offset <= image->adsp->image_size); module_sha256_create(image); module_sha_update(image, image->fw_image + offset, size); module_sha_complete(image, hash); @@ -98,6 +100,7 @@ static void module_sha384_create(struct image *image) void ri_sha384(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash) { + assert((uint64_t)size + offset <= image->adsp->image_size); module_sha384_create(image); module_sha_update(image, image->fw_image + offset, size); module_sha_complete(image, hash); From e87db0f08010a6dce3b93d6202f5a5985e40f196 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 15 Oct 2020 22:28:37 +0000 Subject: [PATCH 150/639] pkcs1_5.c: intermediate named constants in ri_manifest_sign_v1_x() As suggested by Karol in the review of the next commit. Makes the function call shorter and naming the parameters makes the code much more readable. Can help for debugging too. Absolutely zero change: the two CMAKE_BUILD_TYPE=Release rimage binaries before and after this commit are actually identical. In passing, replace void * arithmetic in that function with char *. void * arithmetic is an actually illegal gcc extension (not just "undefined"). Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index b4718bd0c025..1b653977a38c 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -244,9 +244,10 @@ int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; - pkcs_v1_5_sign_man_v1_5(image, man, - (void *)man + MAN_CSS_MAN_SIZE_V1_5, - image->image_end - sizeof(*man)); + char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; + unsigned const size1 = image->image_end - sizeof(*man); + + pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); return 0; } @@ -254,13 +255,16 @@ int ri_manifest_sign_v1_8(struct image *image) { struct fw_image_manifest_v1_8 *man = image->fw_image; - pkcs_v1_5_sign_man_v1_8(image, man, (void *)man + MAN_CSS_HDR_OFFSET, - sizeof(struct css_header_v1_8) - - (MAN_RSA_KEY_MODULUS_LEN + - MAN_RSA_KEY_EXPONENT_LEN + - MAN_RSA_SIGNATURE_LEN), - (void *)man + MAN_SIG_PKG_OFFSET_V1_8, - (man->css.size - man->css.header_len) - * sizeof(uint32_t)); + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET; + unsigned const size1 = + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V1_8; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); return 0; } From b9cf1aeb3b9530782e31d8ac0ba63a69bc709198 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 15 Oct 2020 22:41:11 +0000 Subject: [PATCH 151/639] pkcs1_5.c: don't pretend everything is fine when failing to sign Found by chance and reproduced by making a typo in the key's filename. Note there is already an (unchanged) error message: pkcs: signing with key sof/keys/otc_private_key_3k.pemX error: can't open file sof/keys/otc_private_key_3k.pemX -2 Firmware manifest and signing completed ! But now rimage does not pretend success and the build does not keep going with an unsigned image like nothing happened. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 1b653977a38c..5de82aa8597f 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -247,8 +247,7 @@ int ri_manifest_sign_v1_5(struct image *image) char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; unsigned const size1 = image->image_end - sizeof(*man); - pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); - return 0; + return pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); } int ri_manifest_sign_v1_8(struct image *image) @@ -265,6 +264,5 @@ int ri_manifest_sign_v1_8(struct image *image) unsigned const size2 = (man->css.size - man->css.header_len) * sizeof(uint32_t); - pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); - return 0; + return pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); } From c98a29da14e5f5590eb6bb150bc70fd5b4b990b3 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 15 Oct 2020 11:15:15 +0200 Subject: [PATCH 152/639] toml: Extract version parsing to separate function This task is fully separatable from adsp_parse_config_fd(), so should be done in separate function, to improve code readability. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 58 +++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index d2269b818a43..8707e055e053 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1532,6 +1532,36 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, return 0; } +/** version is stored as toml array with integer number, something like: + * "version = [1, 8]" + */ +static int parse_version(toml_table_t *toml, int64_t version[2]) +{ + toml_array_t *arr; + toml_raw_t raw; + int ret; + int i; + + /* check "version" key */ + arr = toml_array_in(toml, "version"); + if (!arr) + return err_key_not_found("version"); + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type or length != 2"); + + /* parse "version" array elements */ + for (i = 0; i < 2; ++i) { + raw = toml_raw_at(arr, i); + if (raw == 0) + return err_key_parse("version", NULL); + ret = toml_rtoi(raw, &version[i]); + if (ret < 0) + return err_key_parse("version", "can't convert element to integer"); + } + return 0; +} + static inline bool check_config_version(int major, int minor, const int64_t *version) { return version[0] == major && version[1] == minor; @@ -1541,40 +1571,18 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) { int64_t manifest_version[2]; toml_table_t *toml; - toml_array_t *arr; - toml_raw_t raw; char errbuf[256]; int ret; - int i; /* whole toml file is parsed to global toml table at once */ toml = toml_parse_file(fd, errbuf, ARRAY_SIZE(errbuf)); if (!toml) return log_err(-EINVAL, "error: toml file parsing, %s\n", errbuf); - /* check "version" key */ - arr = toml_array_in(toml, "version"); - if (!arr) - return err_key_not_found("version"); - if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || - toml_array_kind(arr) != 'v') { - ret = err_key_parse("version", "wrong array type or length != 2"); + /* manifest version is in toml root */ + ret = parse_version(toml, manifest_version); + if (ret < 0) goto error; - } - - /* parse "version" array elements */ - for (i = 0; i < ARRAY_SIZE(manifest_version); ++i) { - raw = toml_raw_at(arr, i); - if (raw == 0) { - ret = err_key_parse("version", NULL); - goto error; - } - ret = toml_rtoi(raw, &manifest_version[i]); - if (ret < 0) { - ret = err_key_parse("version", "can't convert element to integer"); - goto error; - } - } /* parsing function depends on manifest_version */ if (check_config_version(1, 0, manifest_version)) { From 8249abfa11f6552678b362820b6723ff75fedf90 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 15 Oct 2020 11:17:55 +0200 Subject: [PATCH 153/639] toml: Keep available manifest parsers in list This approach allows to easily expand parsers list in future, without harming code readability. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 8707e055e053..865a891aec3f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1562,13 +1562,35 @@ static int parse_version(toml_table_t *toml, int64_t version[2]) return 0; } -static inline bool check_config_version(int major, int minor, const int64_t *version) +struct config_parser { + int major; + int minor; + int (*parse)(const toml_table_t *toml, struct adsp *out, bool verbose); +}; + +static const struct config_parser *find_config_parser(int64_t version[2]) { - return version[0] == major && version[1] == minor; + /* list of supported configuration version with handler to parser */ + static const struct config_parser parsers[] = { + {1, 0, parse_adsp_config_v1_0}, + {1, 5, parse_adsp_config_v1_5}, + {1, 8, parse_adsp_config_v1_8}, + {2, 5, parse_adsp_config_v2_5}, + }; + int i; + + for (i = 0; i < ARRAY_SIZE(parsers); ++i) { + if (parsers[i].major == version[0] && + parsers[i].minor == version[1]) { + return &parsers[i]; + } + } + return NULL; } static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) { + const struct config_parser *parser; int64_t manifest_version[2]; toml_table_t *toml; char errbuf[256]; @@ -1584,21 +1606,16 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) if (ret < 0) goto error; - /* parsing function depends on manifest_version */ - if (check_config_version(1, 0, manifest_version)) { - ret = parse_adsp_config_v1_0(toml, out, verbose); - } else if (check_config_version(1, 5, manifest_version)) { - ret = parse_adsp_config_v1_5(toml, out, verbose); - } else if (check_config_version(1, 8, manifest_version)) { - ret = parse_adsp_config_v1_8(toml, out, verbose); - } else if (check_config_version(2, 5, manifest_version)) { - ret = parse_adsp_config_v2_5(toml, out, verbose); - } else { + /* find parser compatible with manifest version */ + parser = find_config_parser(manifest_version); + if (!parser) { ret = log_err(-EINVAL, "error: Unsupported config version %d.%d\n", manifest_version[0], manifest_version[1]); goto error; } + /* run dedicated parser */ + ret = parser->parse(toml, out, verbose); error: toml_free(toml); return ret; From 0d2af68a9e2bc8454de343722e263f9594fa9d82 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Thu, 22 Oct 2020 08:46:18 +0200 Subject: [PATCH 154/639] gitignore: Add checkpatch temporary file to gitignore Any generated file should be tracked by git to keep repositiry clean. Such an file should be added to .gitignore to reduce possibility of accidentally pushig this file to remote branches, eg. after typing `git add *` before pushing changes. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 567609b1234a..7693903fddf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ build/ +.checkpatch-camelcase.git.* From f0fa6616eac86c2385a330a4cc97411f966e57a2 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 13 Nov 2020 19:20:22 +0000 Subject: [PATCH 155/639] README: install is optional and missed "sudo". CMake 3.13 -B option. Also show useful "make help" that lists all targets. Show -B option of CMake that avoids changing the current directory to the build directory: especially inconvenient considering the recommended, CMake way to clean is to delete this directory and the recommended way to build multiple configurations is to use multiple build directories. -B was introduced in CMake 3.13 which has been released two years ago now and CMake spoils its users with a choice of ways to upgrade: https://cmake.org/download/ https://apt.kitware.com/ https://pypi.org/project/cmake/ This does _not_ imply CMakeLists.txt should drop backward compatibility with CMake < 3.13. I only think a README.md file should not keep the majority of users in the dark only for the convenience of a minority of obsolete CMake users. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bce02c06caa9..8118edeaaf4b 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,11 @@ to generate binary image files. ## Building -The `rimage` tool can be built with the following commands: +The `rimage` tool can be built with the usual CMake commands: ```shell -$ mkdir build -$ cd build -$ cmake .. -$ make -$ make install +$ cmake -B build/ +$ make -C build/ help # lists all targets +$ make -C build/ +$ sudo make -C build/ install # optional ``` From d6cf6960662f3f5b3f65e0f27d74f20de4edc41e Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 10:41:17 +0000 Subject: [PATCH 156/639] config: tgl: fix CSE offsets for TGL Now aligns with actual offsets. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- config/tgl.toml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/config/tgl.toml b/config/tgl.toml index dc5c760ed802..57a1e13f4f73 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -22,15 +22,15 @@ size = "0x100000" partition_name = "ADSP" [[cse.entry]] name = "ADSP.man" -offset = "0x58" -length = "0x378" +offset = "0x5c" +length = "0x464" [[cse.entry]] name = "cavs0015.met" -offset = "0x400" +offset = "0x4c0" length = "0x70" [[cse.entry]] name = "cavs0015" -offset = "0x490" +offset = "0x540" length = "0x0" # calculated by rimage [css] @@ -40,11 +40,6 @@ name = "ADSP" [[signed_pkg.module]] name = "cavs0015.met" -[partition_info] -name = "ADSP" -[[partition_info.module]] -name = "cavs0015.met" - [adsp_file] [[adsp_file.comp]] base_offset = "0x2000" From 48ba01ec4571658863f7585442faa84426be3319 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 10:42:42 +0000 Subject: [PATCH 157/639] css: add css header for cavs v2.5 Header contests are the same but with bigger key. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/css.c | 57 ++++++++++++++++++++++++++++++++++++++++ src/include/rimage/css.h | 26 ++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/src/css.c b/src/css.c index f2627e6f58e9..c86148b89015 100644 --- a/src/css.c +++ b/src/css.c @@ -11,6 +11,63 @@ #include <rimage/css.h> #include <rimage/manifest.h> +void ri_css_v2_5_hdr_create(struct image *image) +{ + struct css_header_v2_5 *css = image->fw_image + MAN_CSS_HDR_OFFSET_2_5; + struct tm *date; + struct timeval tv; + time_t seconds; + int val; + + fprintf(stdout, " cse: completing CSS manifest\n"); + + /* get local time and date */ + gettimeofday(&tv, NULL); + seconds = tv.tv_sec; + date = localtime(&seconds); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + + date->tm_year += 1900; + fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", + date->tm_year, date->tm_mon, date->tm_mday); + + /* year yYyy */ + val = date->tm_year / 1000; + css->date |= val << 28; + date->tm_year -= val * 1000; + /* year yyYy */ + val = date->tm_year / 100; + css->date |= val << 24; + date->tm_year -= val * 100; + /* year yyyY */ + val = date->tm_year / 10; + css->date |= val << 20; + date->tm_year -= val * 10; + /* year Yyyy */ + val = date->tm_year; + css->date |= val << 16; + + /* month Mm - for some reason month starts at 0 */ + val = ++date->tm_mon / 10; + css->date |= val << 12; + date->tm_mon -= (val * 10); + /* month mM */ + val = date->tm_mon; + css->date |= val << 8; + + /* Day Dd */ + val = date->tm_mday / 10; + css->date |= val << 4; + date->tm_mday -= (val * 10); + /* Day dD */ + val = date->tm_mday; + css->date |= val << 0; +} + void ri_css_v1_8_hdr_create(struct image *image) { struct css_header_v1_8 *css = image->fw_image + MAN_CSS_HDR_OFFSET; diff --git a/src/include/rimage/css.h b/src/include/rimage/css.h index e322cbf68dfc..6283cdaf9042 100644 --- a/src/include/rimage/css.h +++ b/src/include/rimage/css.h @@ -13,12 +13,15 @@ struct image; #define MAN_CSS_LT_MODULE_TYPE 0x00000006 #define MAN_CSS_MOD_TYPE 4 #define MAN_CSS_HDR_SIZE 161 /* in words */ +#define MAN_CSS_HDR_SIZE_2_5 225 /* in words */ #define MAN_CSS_HDR_VERSION 0x10000 +#define MAN_CSS_HDR_VERSION_2_5 0x21000 #define MAN_CSS_MOD_VENDOR 0x8086 #define MAN_CSS_HDR_ID {'$', 'M', 'N', '2'} #define MAN_CSS_KEY_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) #define MAN_CSS_MOD_SIZE (MAN_RSA_KEY_MODULUS_LEN >> 2) +#define MAN_CSS_MOD_SIZE_2_5 (MAN_RSA_KEY_MODULUS_LEN_2_5 >> 2) #define MAN_CSS_EXP_SIZE (MAN_RSA_KEY_EXPONENT_LEN >> 2) #define MAN_CSS_MAN_SIZE_V1_8 \ (sizeof(struct fw_image_manifest_v1_8) >> 2) @@ -29,8 +32,10 @@ struct image; * RSA Key and Crypto */ #define MAN_RSA_KEY_MODULUS_LEN 256 +#define MAN_RSA_KEY_MODULUS_LEN_2_5 384 #define MAN_RSA_KEY_EXPONENT_LEN 4 #define MAN_RSA_SIGNATURE_LEN 256 +#define MAN_RSA_SIGNATURE_LEN_2_5 384 struct fw_version { uint16_t major_version; @@ -39,6 +44,26 @@ struct fw_version { uint16_t build_version; } __attribute__((packed)); +struct css_header_v2_5 { + uint32_t header_type; + uint32_t header_len; + uint32_t header_version; + uint32_t reserved0; /* must be 0x1 */ + uint32_t module_vendor; + uint32_t date; + uint32_t size; + uint8_t header_id[4]; + uint32_t padding; /* must be 0x0 */ + struct fw_version version; + uint32_t svn; + uint32_t reserved1[18]; /* must be 0x0 */ + uint32_t modulus_size; + uint32_t exponent_size; + uint8_t modulus[MAN_RSA_KEY_MODULUS_LEN_2_5]; + uint8_t exponent[MAN_RSA_KEY_EXPONENT_LEN]; + uint8_t signature[MAN_RSA_SIGNATURE_LEN_2_5]; +} __attribute__((packed)); + struct css_header_v1_8 { uint32_t header_type; uint32_t header_len; @@ -78,5 +103,6 @@ struct css_header_v1_5 { void ri_css_v1_8_hdr_create(struct image *image); void ri_css_v1_5_hdr_create(struct image *image); +void ri_css_v2_5_hdr_create(struct image *image); #endif From 8478c03483396267940b90d2826858eb674fd7a9 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Mon, 26 Oct 2020 10:51:17 +0000 Subject: [PATCH 158/639] cse: add simple crc32 function to calculate the v2.5 header checksum Add simple crc32 function to calculate the checksum for v2.5 headers. Implementation is very simple using shift register as we don't require speed. Calculate the v2.5 header checksum with crc-32/iso-hdlc parameters. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/cse.c | 72 ++++++++++++++++++++++++++++++++++++++++ src/include/rimage/cse.h | 12 +++++++ 2 files changed, 84 insertions(+) diff --git a/src/cse.c b/src/cse.c index 75f7630a65b1..85554308601f 100644 --- a/src/cse.c +++ b/src/cse.c @@ -6,6 +6,7 @@ // Keyon Jie <yang.jie@linux.intel.com> #include <stdio.h> +#include <stdbool.h> #include <rimage/rimage.h> #include <rimage/cse.h> #include <rimage/manifest.h> @@ -34,3 +35,74 @@ void ri_cse_create(struct image *image) } cse_hdr->checksum = 0x100 - csum; } + +static uint32_t crc32(uint8_t *input, int size, uint32_t poly, uint32_t init, + bool rev_in, bool rev_out, uint32_t xor_out) +{ + uint32_t crc = init; + uint32_t t32; + uint8_t val; + uint8_t t8; + int i; + int j; + + for (i = 0; i < size; i++) { + val = input[i]; + if (rev_in) { + t8 = 0; + for (j = 0; j < 8; j++) { + if (val & (1 << j)) + t8 |= (uint8_t)(1 << (7 - j)); + } + val = t8; + } + crc ^= (uint32_t)(val << 24); + for (j = 0; j < 8; j++) { + if (crc & 0x80000000) + crc = (uint32_t)((crc << 1) ^ poly); + else + crc <<= 1; + } + } + + if (rev_out) { + t32 = 0; + for (i = 0; i < 32; i++) { + if (crc & (1 << i)) + t32 |= (uint32_t)(1 << (31 - i)); + } + crc = t32; + } + + return crc ^ xor_out; +} + +void ri_cse_create_v2_5(struct image *image) +{ + struct CsePartitionDirHeader_v2_5 *cse_hdr = image->fw_image; + struct sof_man_adsp_meta_file_ext_v2_5 *meta = image->fw_image + + MAN_META_EXT_OFFSET_V2_5; + struct CsePartitionDirEntry *cse_entry = + image->fw_image + sizeof(*cse_hdr); + uint8_t *val = image->fw_image; + int size; + + fprintf(stdout, " cse: completing CSE V2.5 manifest\n"); + + cse_entry[2].length = meta->comp_desc[0].limit_offset - + MAN_DESC_OFFSET_V1_8; + + /* + * calculate checksum using crc-32/iso-hdlc + * + * polynomial: 0x04c11db7 + * initial value: 0xffffffff + * reverse input: true + * reverse output: true + * xor output: 0xffffffff + */ + size = (sizeof(*cse_hdr) + (sizeof(*cse_entry) * MAN_CSE_PARTS)); + cse_hdr->checksum = crc32(val, size, 0x04c11db7, 0xffffffff, true, true, 0xffffffff); + + fprintf(stdout, " cse: cse checksum %x\n", cse_hdr->checksum); +} diff --git a/src/include/rimage/cse.h b/src/include/rimage/cse.h index d262fbafd481..6ce46561f214 100644 --- a/src/include/rimage/cse.h +++ b/src/include/rimage/cse.h @@ -22,6 +22,17 @@ struct CsePartitionDirHeader { uint8_t partition_name[4]; } __attribute__((packed)); +struct CsePartitionDirHeader_v2_5 { + uint32_t header_marker; + uint32_t nb_entries; + uint8_t header_version; + uint8_t entry_version; + uint8_t header_length; + uint8_t not_used; /* set to zero - old checksum */ + uint8_t partition_name[4]; + uint32_t checksum; /* crc32 checksum */ +} __attribute__((packed)); + struct CsePartitionDirEntry { uint8_t entry_name[12]; uint32_t offset; @@ -30,5 +41,6 @@ struct CsePartitionDirEntry { } __attribute__((packed)); void ri_cse_create(struct image *image); +void ri_cse_create_v2_5(struct image *image); #endif From 7e9952f2c8d5a4d70abd76a5c49d0bf39b6cda5f Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:23:29 +0000 Subject: [PATCH 159/639] manifest: Add cavs2.5 structures and offsets cavs2.5 has different offsets and structures. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/manifest.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 7b54bc137b66..cd44b118d953 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -41,8 +41,13 @@ sizeof(struct CsePartitionDirHeader) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) +#define MAN_CSS_HDR_OFFSET_2_5 \ + (MAN_CSE_HDR_OFFSET + \ + sizeof(struct CsePartitionDirHeader_v2_5) + \ + MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) + #define MAN_FW_DESC_OFFSET_V2_5 \ - (MAN_META_EXT_OFFSET_V1_8 + \ + (MAN_META_EXT_OFFSET_V2_5 + \ sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ MAN_EXT_PADDING) @@ -53,16 +58,30 @@ (MAN_CSS_HDR_OFFSET + \ sizeof(struct css_header_v1_8)) +#define MAN_SIG_PKG_OFFSET_V2_5 \ + (MAN_CSS_HDR_OFFSET_2_5 + \ + sizeof(struct css_header_v2_5)) + #define MAN_PART_INFO_OFFSET_V1_8 \ (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext)) +#define MAN_PART_INFO_OFFSET_V2_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_v2_5)) + #define MAN_META_EXT_OFFSET_V1_8 \ (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext) + \ sizeof(struct partition_info_ext) + \ MAN_CSE_PADDING_SIZE) +#define MAN_META_EXT_OFFSET_V2_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_v2_5) + \ + sizeof(struct info_ext_0x16) + \ + 0) + #define MAN_FW_DESC_OFFSET_V1_8 \ (MAN_META_EXT_OFFSET_V1_8 + \ sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ @@ -91,12 +110,12 @@ */ struct fw_image_manifest_v2_5 { /* MEU tool needs these sections to be 0s */ - struct CsePartitionDirHeader cse_partition_dir_header; + struct CsePartitionDirHeader_v2_5 cse_partition_dir_header; struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; - struct css_header_v1_8 css; - struct signed_pkg_info_ext signed_pkg; - struct partition_info_ext partition_info; - uint8_t cse_padding[MAN_CSE_PADDING_SIZE]; + struct css_header_v2_5 css; + struct signed_pkg_info_ext_v2_5 signed_pkg; + struct info_ext_0x16 info_0x16; + struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; /* reserved / pading at end of ext data - all 0s*/ From 0c3f8e29c5d81a572856e3957aa1006bdd648833 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:24:23 +0000 Subject: [PATCH 160/639] user: manifest: add macros for SHA385 modulus length Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/sof/user/manifest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index ccf23cf7b42f..d90014ffb198 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -73,6 +73,7 @@ struct sof_man_segment_desc { #define SOF_MAN_MOD_ID_LEN 4 #define SOF_MAN_MOD_NAME_LEN 8 #define SOF_MAN_MOD_SHA256_LEN 32 +#define SOF_MAN_MOD_SHA384_LEN 48 #define SOF_MAN_MOD_ID {'$', 'A', 'M', 'E'} /* From df204853b9e7fedea7fb0f46c2278666e95de92a Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:12:10 +0000 Subject: [PATCH 161/639] pkcs: Add PSS signing mechanism for CAVS2.5 Add RSA PSS signing support for CAVS 2.5 platforms. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/rimage.h | 4 ++ src/pkcs1_5.c | 120 ++++++++++++++++++++++++++++++++++++ 2 files changed, 124 insertions(+) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 04518ed5900d..ba35df390469 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -173,6 +173,10 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, struct fw_image_manifest_v1_8 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_v1_5_sign_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 5de82aa8597f..7e8592b0ceda 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -240,6 +240,109 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, return ret; } +/* + * RSA signature of manifest. The signature is an RSA PSS + * of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_sign_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + const BIGNUM *n, *e, *d; + unsigned char digest[SHA384_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new PSS key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: PSS signing with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, + digest, image->md, 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to sign manifest %s\n", path); + } + + /* encrypt the signature using the private key */ + ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, + (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to encrypt signature %s\n", path); + } + + /* copy public key modulus and exponent to manifest */ + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css.exponent); + + /* modulus is reversed */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) + man->css.modulus[i] = mod[MAN_RSA_KEY_MODULUS_LEN_2_5 - (1 + i)]; + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + EVP_PKEY_free(privkey); + return ret; +} + int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; @@ -266,3 +369,20 @@ int ri_manifest_sign_v1_8(struct image *image) return pkcs_v1_5_sign_man_v1_8(image, man, data1, size1, data2, size2); } + +int ri_manifest_sign_v2_5(struct image *image) +{ + struct fw_image_manifest_v2_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET_2_5; + unsigned const size1 = + sizeof(struct css_header_v2_5) - + (MAN_RSA_KEY_MODULUS_LEN_2_5 + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN_2_5); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V2_5; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_sign_man_v2_5(image, man, data1, size1, data2, size2); +} From f84676f5d9f03abee1571c08e449e4867c9b0a32 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:20:25 +0000 Subject: [PATCH 162/639] hash: make module_sha384_create non static. Used by other clients now. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/hash.c | 2 +- src/include/rimage/rimage.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hash.c b/src/hash.c index 8c1117f812cb..ff68f82f5f05 100644 --- a/src/hash.c +++ b/src/hash.c @@ -89,7 +89,7 @@ void ri_sha256(struct image *image, unsigned int offset, unsigned int size, module_sha_complete(image, hash); } -static void module_sha384_create(struct image *image) +void module_sha384_create(struct image *image) { image->md = EVP_sha384(); image->mdctx = EVP_MD_CTX_new(); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index ba35df390469..45e26b69c3f0 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -157,6 +157,7 @@ struct adsp { }; void module_sha256_create(struct image *image); +void module_sha384_create(struct image *image); void module_sha_update(struct image *image, uint8_t *data, size_t bytes); void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); From 68b3693de14c4ccd31fc2d02bca261855527da0f Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:22:42 +0000 Subject: [PATCH 163/639] plat_auth: use cavs 2.5 plat auth offsets cavs2.5 has different offsets for plat auth data. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/include/rimage/plat_auth.h | 38 ++++++++++++++++++++++++++++++++++ src/plat_auth.c | 18 ++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/src/include/rimage/plat_auth.h b/src/include/rimage/plat_auth.h index 7e94f8ae12ba..8eb3ad967a56 100644 --- a/src/include/rimage/plat_auth.h +++ b/src/include/rimage/plat_auth.h @@ -11,6 +11,7 @@ struct image; #define PLAT_AUTH_SHA256_LEN 32 +#define PLAT_AUTH_SHA384_LEN 48 #define PLAT_AUTH_NAME_LEN 12 #define PLAT_AUTH_PADDING 48 /* pad at end of struct */ @@ -26,6 +27,15 @@ struct signed_pkg_info_module { uint8_t hash[PLAT_AUTH_SHA256_LEN]; } __attribute__((packed)); +struct signed_pkg_info_module_v2_5 { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t hash_algo; + uint16_t hash_size; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA384_LEN]; +} __attribute__((packed)); + struct signed_pkg_info_ext { uint32_t ext_type; uint32_t ext_len; @@ -42,6 +52,22 @@ struct signed_pkg_info_ext { struct signed_pkg_info_module module[SIGN_PKG_NUM_MODULE]; } __attribute__((packed)); +struct signed_pkg_info_ext_v2_5 { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; + uint32_t vcn; /* 0 */ + uint8_t bitmap[16]; + uint32_t svn; + uint8_t fw_type; + uint8_t fw_sub_type; + uint8_t reserved[14]; /* must be 0 */ + + /* variable length of modules */ + struct signed_pkg_info_module_v2_5 module[SIGN_PKG_NUM_MODULE]; +} __attribute__((packed)); + #define PART_INFO_EXT_TYPE 3 #define PART_INFO_NUM_MODULE 1 @@ -73,6 +99,17 @@ struct partition_info_ext { struct partition_info_module module[PART_INFO_NUM_MODULE]; } __attribute__((packed)); +/* offset 0x458 id */ +struct info_ext_0x16 { + uint32_t ext_type; /* 0x16 */ + uint32_t ext_len; /* 0x68 */ + uint8_t name[4]; /* ADSP */ + uint32_t size; /* file size */ + uint32_t data[5]; /* 0 = 0x10000000, 0, 1, 1, 0x3003 */ + uint8_t hash[PLAT_AUTH_SHA384_LEN]; + uint32_t data1[5]; +} __attribute__((packed)); + #define PLAT_AUTH_SIZE \ (sizeof(struct partition_info_ext) + \ @@ -83,5 +120,6 @@ void ri_adsp_meta_data_create_v1_8(struct image *image, int meta_start_offset, void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, int meta_end_offset); void ri_plat_ext_data_create(struct image *image); +void ri_plat_ext_data_create_v2_5(struct image *image); #endif diff --git a/src/plat_auth.c b/src/plat_auth.c index 9b451798ad14..46a2473ae44f 100644 --- a/src/plat_auth.c +++ b/src/plat_auth.c @@ -57,3 +57,21 @@ void ri_plat_ext_data_create(struct image *image) /* do this here atm */ desc->header.preload_page_count = part->length / MAN_PAGE_SIZE; } + +void ri_plat_ext_data_create_v2_5(struct image *image) +{ + struct sof_man_adsp_meta_file_ext_v2_5 *meta = + image->fw_image + MAN_META_EXT_OFFSET_V2_5; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + struct info_ext_0x16 *ext = image->fw_image + MAN_PART_INFO_OFFSET_V2_5; + uint32_t size; + + fprintf(stdout, " auth: completing authentication manifest\n"); + + size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; + size += MAN_PAGE_SIZE - (size % MAN_PAGE_SIZE); + + /* do this here atm */ + desc->header.preload_page_count = size / MAN_PAGE_SIZE; + ext->size = image->image_end; +} From db40934e57aa80a187e611717b5b731d355bc49b Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 26 Oct 2020 11:28:12 +0000 Subject: [PATCH 164/639] cavs: add support for cavs2.5 code signing cavs 2.5 uses a larger key and the RSA signing PSS mode. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/adsp_config.c | 389 +++++++++++++++++++++++++++++++++- src/include/rimage/manifest.h | 1 + src/include/rimage/rimage.h | 1 + src/manifest.c | 123 +++++++++++ 4 files changed, 509 insertions(+), 5 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 865a891aec3f..6d1b59afe748 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -529,6 +529,118 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static void dump_cse_v2_5(const struct CsePartitionDirHeader_v2_5 *cse_header, + const struct CsePartitionDirEntry *cse_entry) +{ + int i; + + DUMP("\ncse"); + DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_KEY("header_version", "%d", cse_header->header_version); + DUMP_KEY("entry_version", "%d", cse_header->entry_version); + DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); + for (i = 0; i < cse_header->nb_entries; ++i) { + DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); + DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); + } +} + +/* TODO: fix up constants in headers for v2.5 */ +static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct CsePartitionDirHeader_v2_5 *hdr, struct CsePartitionDirEntry *out, + int entry_capacity, bool verbose) +{ + toml_array_t *cse_entry_array; + toml_table_t *cse_entry; + struct parse_ctx ctx; + toml_table_t *cse; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + cse = toml_table_in(toml, "cse"); + if (!cse) + return err_key_not_found("cse"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + hdr->header_marker = CSE_HEADER_MAKER; + hdr->header_length = sizeof(struct CsePartitionDirHeader_v2_5); + + /* configurable fields */ + hdr->header_version = parse_uint32_key(cse, &ctx, "header_version", 2, &ret); + if (ret < 0) + return ret; + + hdr->entry_version = parse_uint32_key(cse, &ctx, "entry_version", 1, &ret); + if (ret < 0) + return ret; + + parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, + sizeof(hdr->partition_name), &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 table */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(cse, &ctx); + if (ret < 0) + return ret; + + /* entry array */ + cse_entry_array = toml_array_in(cse, "entry"); + if (!cse_entry_array) + return err_key_not_found("entry"); + if (toml_array_kind(cse_entry_array) != 't' || + toml_array_nelem(cse_entry_array) != entry_capacity) + return err_key_parse("entry", "wrong array type or length != %d", entry_capacity); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(cse_entry_array); ++i) { + cse_entry = toml_table_at(cse_entry_array, i); + if (!cse_entry) + return err_key_parse("entry", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, + sizeof(out[i].entry_name), &ret); + if (ret < 0) + return err_key_parse("entry", NULL); + + out[i].offset = parse_uint32_hex_key(cse_entry, &ctx, "offset", -1, &ret); + if (ret < 0) + return err_key_parse("offset", NULL); + + out[i].length = parse_uint32_hex_key(cse_entry, &ctx, "length", -1, &ret); + if (ret < 0) + return err_key_parse("length", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(cse_entry, &ctx); + if (ret < 0) + return ret; + } + + hdr->nb_entries = toml_array_nelem(cse_entry_array); + + if (1 || verbose) + dump_cse_v2_5(hdr, out); + + /* + * values set in other places in code: + * - checksum + */ + + return 0; +} + static void dump_css_v1_5(const struct css_header_v1_5 *css) { DUMP("\ncss 1.5"); @@ -697,6 +809,96 @@ static int parse_css_v1_8(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static void dump_css_v2_5(const struct css_header_v2_5 *css) +{ + DUMP("\ncss 2.5"); + DUMP_KEY("header_type", "%d", css->header_type); + DUMP_KEY("header_len", "%d", css->header_len); + DUMP_KEY("header_version", "0x%x", css->header_version); + DUMP_KEY("module_vendor", "0x%x", css->module_vendor); + DUMP_KEY("size", "%d", css->size); + DUMP_KEY("svn", "%d", css->svn); + DUMP_KEY("modulus_size", "%d", css->modulus_size); + DUMP_KEY("exponent_size", "%d", css->exponent_size); +} + +static int parse_css_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct css_header_v2_5 *out, bool verbose) +{ + static const uint8_t hdr_id[4] = MAN_CSS_HDR_ID; + struct parse_ctx ctx; + toml_table_t *css; + int ret; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + css = toml_table_in(toml, "css"); + if (!css) + return err_key_not_found("css"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + memcpy(out->header_id, hdr_id, sizeof(out->header_id)); + + /* configurable fields */ + out->header_type = parse_uint32_key(css, &ctx, "header_type", MAN_CSS_MOD_TYPE, &ret); + if (ret < 0) + return ret; + + out->header_len = parse_uint32_key(css, &ctx, "header_len", MAN_CSS_HDR_SIZE_2_5, &ret); + if (ret < 0) + return ret; + + out->header_version = parse_uint32_hex_key(css, &ctx, "header_version", MAN_CSS_HDR_VERSION_2_5, + &ret); + if (ret < 0) + return ret; + out->module_vendor = parse_uint32_hex_key(css, &ctx, "module_vendor", MAN_CSS_MOD_VENDOR, + &ret); + if (ret < 0) + return ret; + + out->size = parse_uint32_key(css, &ctx, "size", 281, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(css, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->modulus_size = parse_uint32_key(css, &ctx, "modulus_size", MAN_CSS_MOD_SIZE_2_5, &ret); + if (ret < 0) + return ret; + + out->exponent_size = parse_uint32_key(css, &ctx, "exponent_size", MAN_CSS_EXP_SIZE, &ret); + if (ret < 0) + return ret; + + /* hardcoded to align with meu */ + out->reserved0 = 0; + out->reserved1[0] = 0xf; + out->reserved1[1] = 0x048e0000; // TODO: what is this ? + + /* check everything parsed */ + ret = assert_everything_parsed(css, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_css_v2_5(out); + + /* + * values set in other places in code: + * - date + * - version + * - modulus + * - exponent + * - signature + */ + + return 0; +} + static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) { int i; @@ -853,6 +1055,163 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_pkg) +{ + int i; + + DUMP("\nsigned_pkg"); + DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_KEY("vcn", "%d", signed_pkg->vcn); + DUMP_KEY("svn", "%d", signed_pkg->svn); + DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); + DUMP_KEY("fw_sub_type", "%d", signed_pkg->fw_sub_type); + for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) + DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); + for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { + DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); + DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); + DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); + DUMP_KEY("meta.meta_size", "%d", signed_pkg->module[i].meta_size); + } +} + +static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct signed_pkg_info_ext_v2_5 *out, bool verbose) +{ + struct signed_pkg_info_module_v2_5 *mod; + toml_array_t *bitmap_array; + toml_array_t *module_array; + toml_table_t *signed_pkg; + struct parse_ctx ctx; + toml_table_t *module; + toml_raw_t raw; + int64_t temp_i; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + signed_pkg = toml_table_in(toml, "signed_pkg"); + if (!signed_pkg) + return err_key_not_found("signed_pkg"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = SIGN_PKG_EXT_TYPE; + out->ext_len = sizeof(struct signed_pkg_info_ext_v2_5); + + /* configurable fields */ + parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(signed_pkg, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(signed_pkg, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->fw_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_type", 0, &ret); + if (ret < 0) + return ret; + + out->fw_sub_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_sub_type", 0, &ret); + if (ret < 0) + return ret; + + /* bitmap array */ + bitmap_array = toml_array_in(signed_pkg, "bitmap"); + if (!bitmap_array) { + /* default value - some use 0x10*/ + out->bitmap[4] = 0x8; + } else { + ++ctx.array_cnt; + if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || + toml_array_nelem(bitmap_array) > ARRAY_SIZE(out->bitmap)) + return err_key_parse("bitmap", "wrong array type or length > %d", + ARRAY_SIZE(out->bitmap)); + + for (i = 0; i < toml_array_nelem(bitmap_array); ++i) { + raw = toml_raw_at(bitmap_array, i); + if (!raw) + return err_key_parse("bitmap", NULL); + + ret = toml_rtoi(raw, &temp_i); + if (ret < 0 || temp_i < 0) + return err_key_parse("bitmap", "values can't be negative"); + out->bitmap[i] = temp_i; + } + } + + /* check everything parsed, expect 1 more array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(signed_pkg, &ctx); + if (ret < 0) + return ret; + + /* modules array */ + module_array = toml_array_in(signed_pkg, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) != ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length != %d", + ARRAY_SIZE(out->module)); + + /* parse modules array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_algo = parse_uint32_hex_key(module, &ctx, "hash_algo", 0x00, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_size = parse_uint32_hex_key(module, &ctx, "hash_size", 0x30, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 112, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_signed_pkg_v2_5(out); + + /* + * values set in other places in code: + * - module.hash + */ + + return 0; +} + + static void dump_partition_info_ext(const struct partition_info_ext *part_info) { int i; @@ -982,6 +1341,26 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * return 0; } +static int parse_info_ext_0x16(const toml_table_t *toml, struct parse_ctx *pctx, + struct info_ext_0x16 *out, bool verbose) +{ + /* known */ + out->ext_type = 0x16; + out->ext_len = sizeof(*out); + out->name[0] = 'A'; + out->name[1] = 'D'; + out->name[2] = 'S'; + out->name[3] = 'P'; + + /* copied from meu - unknown */ + out->data[0] = 0x10000000; + out->data[2] = 0x1; + out->data[3] = 0x0; + out->data[4] = 0x3003; + + return 0; +} + static void dump_adsp_file_ext_v1_8(const struct sof_man_adsp_meta_file_ext_v1_8 *adsp_file) { int i; @@ -1487,7 +1866,7 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, memset(out->man_v2_5, 0, sizeof(*out->man_v2_5)); /* assign correct write functions */ - out->write_firmware = NULL; + out->write_firmware = man_write_fw_v2_5; out->write_firmware_meu = man_write_fw_meu_v2_5; /* version array has already been parsed, so increment ctx.array_cnt */ @@ -1499,20 +1878,20 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("adsp", NULL); - ret = parse_cse(toml, &ctx, &out->man_v2_5->cse_partition_dir_header, + ret = parse_cse_v2_5(toml, &ctx, &out->man_v2_5->cse_partition_dir_header, out->man_v2_5->cse_partition_dir_entry, MAN_CSE_PARTS, verbose); if (ret < 0) return err_key_parse("cse", NULL); - ret = parse_css_v1_8(toml, &ctx, &out->man_v2_5->css, verbose); + ret = parse_css_v2_5(toml, &ctx, &out->man_v2_5->css, verbose); if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); + ret = parse_signed_pkg_v2_5(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); - ret = parse_partition_info_ext(toml, &ctx, &out->man_v2_5->partition_info, verbose); + ret = parse_info_ext_0x16(toml, &ctx, &out->man_v2_5->info_0x16, verbose); if (ret < 0) return err_key_parse("partition_info", NULL); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index cd44b118d953..5e13fd21cd9a 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -179,6 +179,7 @@ int simple_write_firmware(struct image *image); int man_write_fw_v1_5(struct image *image); int man_write_fw_v1_5_sue(struct image *image); int man_write_fw_v1_8(struct image *image); +int man_write_fw_v2_5(struct image *image); int man_write_fw_meu_v1_5(struct image *image); int man_write_fw_meu_v1_8(struct image *image); int man_write_fw_meu_v2_5(struct image *image); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 45e26b69c3f0..fdefc41dc100 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -162,6 +162,7 @@ void module_sha_update(struct image *image, uint8_t *data, size_t bytes); void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); +int ri_manifest_sign_v2_5(struct image *image); void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash); void ri_sha384(struct image *image, unsigned int offset, unsigned int size, diff --git a/src/manifest.c b/src/manifest.c index 237954b0560c..d586d5b25186 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -121,6 +121,19 @@ static int man_init_image_v1_8(struct image *image) return 0; } +static int man_init_image_v2_5(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man_v2_5, + sizeof(struct fw_image_manifest_v2_5)); + + return 0; +} + /* we should call this after all segments size set up via iterate */ static uint32_t elf_to_file_offset(struct image *image, struct module *module, @@ -1190,3 +1203,113 @@ int man_write_fw_meu_v2_5(struct image *image) unlink(image->out_file); return ret; } + +/* used by others */ +int man_write_fw_v2_5(struct image *image) +{ + struct sof_man_fw_desc *desc; + struct fw_image_manifest_v2_5 *m; + uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; + int ret, i; + + /* init image */ + ret = man_init_image_v2_5(image); + if (ret < 0) + goto err; + + /* use default meu offset for TGL if not provided */ + if (!image->meu_offset) + image->meu_offset = MAN_FW_DESC_OFFSET_V2_5 - 0x10; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + + /* firmware and build version */ + m->css.version.major_version = image->fw_ver_major; + m->css.version.minor_version = image->fw_ver_minor; + m->css.version.build_version = image->fw_ver_build; + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + + fprintf(stdout, "Firmware completing manifest v2.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create_v2_5(image, MAN_META_EXT_OFFSET_V2_5, + image->meu_offset); + ri_plat_ext_data_create_v2_5(image); + ri_css_v2_5_hdr_create(image); + ri_cse_create_v2_5(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET_V1_8 - MAN_DESC_OFFSET_V1_8 + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash inside ADSP meta data extension for padding to end */ + ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash); + + /* mue writes 0xff to 16 bytes of padding */ + for (i = 0; i < 16; i++) + m->reserved[i] = 0xff; + + /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ + ri_sha384(image, MAN_META_EXT_OFFSET_V2_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->signed_pkg.module[0].hash[i] = + hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } + + /* sign manifest */ + ret = ri_manifest_sign_v2_5(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_V2_5, + MAN_FW_DESC_OFFSET_V2_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} From 1c1c09ce7ee4eba8a41a2e61aba78447de07ca88 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Thu, 12 Nov 2020 22:07:53 +0000 Subject: [PATCH 165/639] manifest: cavs25: Add support for ext data type 0x16 This type was used by early versions of meu, but the hash is not used in later versions. Leave the code in in case it has to come back. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/manifest.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/manifest.c b/src/manifest.c index d586d5b25186..2ad8946b4db4 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1291,6 +1291,21 @@ int man_write_fw_v2_5(struct image *image) if (ret < 0) goto err; +#if 0 + /* calculate hash - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, image->fw_image, + sizeof(struct CsePartitionDirHeader_v2_5) + + sizeof(struct CsePartitionDirEntry) * 3); + module_sha_update(image, image->fw_image + 0x4c0, image->image_end - 0x4c0); + module_sha_complete(image, hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->info_0x16.hash[i] = + hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } +#endif /* write the firmware */ ret = man_write_fw_mod(image); if (ret < 0) From 7b7c192e70c23a6024902e6781c32fc0f058c37a Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Thu, 12 Nov 2020 22:08:49 +0000 Subject: [PATCH 166/639] verify: add signature verification support Add support to verify signatures of cavs firmware binaries. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- src/adsp_config.c | 4 + src/include/rimage/rimage.h | 18 +++ src/manifest.c | 74 +++++++++ src/pkcs1_5.c | 307 ++++++++++++++++++++++++++++++++++++ src/rimage.c | 25 ++- 5 files changed, 425 insertions(+), 3 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 6d1b59afe748..2c5669025082 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1755,6 +1755,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5_sue; out->write_firmware_meu = man_write_fw_meu_v1_5; + out->verify_firmware = ri_manifest_verify_v1_5; /* parse others sibtables */ ret = parse_fw_desc(toml, &ctx, &out->man_v1_5_sue->desc, verbose); @@ -1772,6 +1773,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v1_5; out->write_firmware_meu = man_write_fw_meu_v1_5; + out->verify_firmware = ri_manifest_verify_v1_5; /* parse others sibtables */ ret = parse_css_v1_5(toml, &ctx, &out->man_v1_5->css_header, verbose); @@ -1808,6 +1810,7 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v1_8; out->write_firmware_meu = man_write_fw_meu_v1_8; + out->verify_firmware = ri_manifest_verify_v1_8; /* version array has already been parsed, so increment ctx.array_cnt */ parse_ctx_init(&ctx); @@ -1868,6 +1871,7 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, /* assign correct write functions */ out->write_firmware = man_write_fw_v2_5; out->write_firmware_meu = man_write_fw_meu_v2_5; + out->verify_firmware = ri_manifest_verify_v2_5; /* version array has already been parsed, so increment ctx.array_cnt */ parse_ctx_init(&ctx); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index fdefc41dc100..1cb75fa707fe 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -104,6 +104,7 @@ struct image { uint32_t image_end;/* module end, equal to output image size */ int meu_offset; int xcc_mod_offset; + const char *verify_file; /* SHA 256 & 384 */ const char *key_name; @@ -149,6 +150,7 @@ struct adsp { enum machine_id machine_id; int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); + int (*verify_firmware)(struct image *image); struct fw_image_manifest_v2_5 *man_v2_5; struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; @@ -180,6 +182,22 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int verify_image(struct image *image); +int ri_manifest_verify_v1_5(struct image *image); +int ri_manifest_verify_v1_8(struct image *image); +int ri_manifest_verify_v2_5(struct image *image); +int pkcs_v1_5_verify_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1); +int pkcs_v1_5_verify_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); +int pkcs_v1_5_verify_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); + int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); diff --git a/src/manifest.c b/src/manifest.c index 2ad8946b4db4..6c781a2e7deb 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1328,3 +1328,77 @@ int man_write_fw_v2_5(struct image *image) unlink(image->out_rom_file); return ret; } + +int verify_image(struct image *image) +{ + FILE *in_file; + int ret, i; + long size; + void *buffer; + size_t read; + + /* is verify supported for target ? */ + if (!image->adsp->verify_firmware) { + fprintf(stderr, "error: verify not supported for target\n"); + return -EINVAL; + } + + /* open image for reading */ + in_file = fopen(image->verify_file, "rb"); + if (!in_file) { + fprintf(stderr, "error: unable to open %s for reading %d\n", + image->verify_file, errno); + return -errno; + } + + /* get file size */ + ret = fseek(in_file, 0, SEEK_END); + if (ret < 0) { + fprintf(stderr, "error: unable to seek eof %s for reading %d\n", + image->verify_file, errno); + return -errno; + } + size = ftell(in_file); + if (size < 0) { + fprintf(stderr, "error: unable to get file size for %s %d\n", + image->verify_file, errno); + return -errno; + } + ret = fseek(in_file, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: unable to seek %s for reading %d\n", + image->verify_file, errno); + return -errno; + } + + /* allocate buffer for parsing */ + buffer = malloc(size); + if (!buffer) { + ret = -ENOMEM; + goto out; + } + + /* find start of fw image and verify */ + read = fread(buffer, 1, size, in_file); + if (read != size) { + fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", + size, image->verify_file, errno); + ret = errno; + goto out; + } + for (i = 0; i < size; i += sizeof(uint32_t)) { + /* find CSE header marker "$CPD" */ + if (*(uint32_t *)(buffer + i) == CSE_HEADER_MAKER) { + image->fw_image = buffer + i; + ret = image->adsp->verify_firmware(image); + goto out; + } + } + + /* no header found */ + fprintf(stderr, "error: could not find valid CSE header $CPD in %s\n", + image->verify_file); +out: + fclose(in_file); + return 0; +} diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 7e8592b0ceda..b138d51c0ab0 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -386,3 +386,310 @@ int ri_manifest_sign_v2_5(struct image *image) return pkcs_v1_5_sign_man_v2_5(image, man, data1, size1, data2, size2); } + +/* + * RSA verify of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_verify_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1); +#endif + + /* requires private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: verify with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha_update(image, ptr1, size1); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reversed, swap it */ + bytes_swap(man->css_header.signature, + sizeof(man->css_header.signature)); + + /* sign the manifest */ + ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css_header.signature, + siglen, priv_rsa); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to verify manifest %s\n", path); + } else + fprintf(stdout, "pkcs: signature is valid !\n"); + + + EVP_PKEY_free(privkey); + return ret; +} + +/* + * RSA verify of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_verify_man_v1_8(struct image *image, + struct fw_image_manifest_v1_8 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: verifying with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest */ + module_sha256_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA256_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reveresd, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + /* sign the manifest */ + ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, + (unsigned char *)man->css.signature, + siglen, priv_rsa); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to verify manifest %s\n", path); + } else + fprintf(stdout, "pkcs: signature is valid !\n"); + + EVP_PKEY_free(privkey); + return ret; +} + +/* + * RSA signature of manifest. The signature is an RSA PSS + * of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_verify_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + unsigned char digest[SHA384_DIGEST_LENGTH]; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new PSS key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: PSS verify with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + /* decrypt signature */ + ret = RSA_public_decrypt(RSA_size(priv_rsa), (unsigned char *)man->css.signature, + sig, priv_rsa, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to decrypt signature %s\n", path); + } + + ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to verify manifest %s\n", path); + } else + fprintf(stdout, "pkcs: signature is valid !\n"); + + EVP_PKEY_free(privkey); + return ret; +} + +int ri_manifest_verify_v1_5(struct image *image) +{ + struct fw_image_manifest_v1_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; + unsigned const size1 = image->image_end - sizeof(*man); + + return pkcs_v1_5_verify_man_v1_5(image, man, data1, size1); +} + +int ri_manifest_verify_v1_8(struct image *image) +{ + struct fw_image_manifest_v1_8 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET; + unsigned const size1 = + sizeof(struct css_header_v1_8) - + (MAN_RSA_KEY_MODULUS_LEN + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V1_8; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_verify_man_v1_8(image, man, data1, size1, data2, size2); +} + +int ri_manifest_verify_v2_5(struct image *image) +{ + struct fw_image_manifest_v2_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET_2_5; + unsigned const size1 = + sizeof(struct css_header_v2_5) - + (MAN_RSA_KEY_MODULUS_LEN_2_5 + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN_2_5); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V2_5; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_verify_man_v2_5(image, man, data1, size1, data2, size2); +} diff --git a/src/rimage.c b/src/rimage.c index 1ea2a7fa4c87..a0e906654370 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -20,6 +20,8 @@ static void usage(char *name) { fprintf(stdout, "%s:\t -c adsp_desc -o outfile -k [key] ELF files\n", name); + fprintf(stdout, "%s:\t -c adsp_desc -y infile -k [key]\n", + name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset\n"); @@ -28,6 +30,7 @@ static void usage(char *name) fprintf(stdout, "\t -f firmware version = x.y\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); + fprintf(stdout, "\t -y verify signed file\n"); exit(0); } @@ -44,7 +47,7 @@ int main(int argc, char *argv[]) image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -82,6 +85,9 @@ int main(int argc, char *argv[]) case 'c': adsp_config = optarg; break; + case 'y': + image.verify_file = optarg; + break; case 'h': usage(argv[0]); break; @@ -93,9 +99,11 @@ int main(int argc, char *argv[]) first_non_opt = optind; - /* make sure we have an outfile and machine */ - if (!image.out_file || !adsp_config) + /* we must have config */ + if (!adsp_config) { + fprintf(stderr, "error: must have adsp desc"); usage(argv[0]); + } /* requires private key */ if (!image.key_name) { @@ -103,6 +111,11 @@ int main(int argc, char *argv[]) return -EINVAL; } + /* make sure we have an outfile if nt verifying */ + if ((!image.out_file && !image.verify_file)) + usage(argv[0]); + + /* firmware version and build id */ if (image.fw_ver_string) { ret = sscanf(image.fw_ver_string, "%hu.%hu", @@ -138,6 +151,12 @@ int main(int argc, char *argv[]) if (ret < 0) goto out; + /* verify mode ? */ + if (image.verify_file) { + ret = verify_image(&image); + goto out; + } + /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; From 2e29db45230c52291a8399dc549eb8e7d3b46de1 Mon Sep 17 00:00:00 2001 From: Pan Xiuli <xiuli.pan@linux.intel.com> Date: Fri, 4 Dec 2020 04:05:58 +0000 Subject: [PATCH 167/639] config: merge icl and jsl toml file ICL and JSL is same DSP with differnt HW config. They can share same toml file Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> --- config/jsl.toml | 55 +------------------------------------------------ 1 file changed, 1 insertion(+), 54 deletions(-) mode change 100644 => 120000 config/jsl.toml diff --git a/config/jsl.toml b/config/jsl.toml deleted file mode 100644 index 0bcb2666b080..000000000000 --- a/config/jsl.toml +++ /dev/null @@ -1,54 +0,0 @@ -version = [1, 8] - -[adsp] -name = "jsl" -machine_id = 9 -image_size = "0x100000" - -[[adsp.mem_zone]] -type = "ROM" -base = "0xBEFE0000" -size = "0x00002000" -[[adsp.mem_zone]] -type = "IMR" -base = "0xB0038000" -size = "0x100000" -[[adsp.mem_zone]] -type = "SRAM" -base = "0xBE040000" -size = "0x100000" - -[cse] -partition_name = "ADSP" -[[cse.entry]] -name = "ADSP.man" -offset = "0x58" -length = "0x378" -[[cse.entry]] -name = "cavs0015.met" -offset = "0x400" -length = "0x60" -[[cse.entry]] -name = "cavs0015" -offset = "0x480" -length = "0x0" # calculated by rimage - -[css] - -[signed_pkg] -name = "ADSP" -[[signed_pkg.module]] -name = "cavs0015.met" - -[partition_info] -name = "ADSP" -[[partition_info.module]] -name = "cavs0015.met" - -[adsp_file] -[[adsp_file.comp]] -base_offset = "0x2000" - -[fw_desc.header] -name = "ADSPFW" -load_offset = "0x30000" diff --git a/config/jsl.toml b/config/jsl.toml new file mode 120000 index 000000000000..6d3aa32fedec --- /dev/null +++ b/config/jsl.toml @@ -0,0 +1 @@ +icl.toml \ No newline at end of file From d1f91efdc1e19093df9c88f0b9779010b0177616 Mon Sep 17 00:00:00 2001 From: Pan Xiuli <xiuli.pan@linux.intel.com> Date: Fri, 4 Dec 2020 04:07:57 +0000 Subject: [PATCH 168/639] config: add tgl-h toml file to support tglh build Add tgl-h toml file to support sof-tgl-h.ri binary build Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com> --- config/tgl-h.toml | 1 + 1 file changed, 1 insertion(+) create mode 120000 config/tgl-h.toml diff --git a/config/tgl-h.toml b/config/tgl-h.toml new file mode 120000 index 000000000000..887bba2c8411 --- /dev/null +++ b/config/tgl-h.toml @@ -0,0 +1 @@ +tgl.toml \ No newline at end of file From 0dba230832122da32bc10c8267658a0544bc41d1 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 17 Dec 2020 01:55:10 +0000 Subject: [PATCH 169/639] pkcs_v1_5_sign_man_v2_5(): add "salt length" comment This comment is meant for "git grep salt", that's its main purpose. Much more obvious timestamps aside, this new code is the only non-deterministic part of rimage - learned the very hard way (OpenSSL "documentation" calls it "sLen"...) A/B testing of build system changes is much, much easier when locally and temporarily making the build 100% deterministic. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index b138d51c0ab0..0bfb901f4cbb 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -313,7 +313,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, /* sign the manifest */ ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, - digest, image->md, 32); + digest, image->md, /* salt length */ 32); if (ret <= 0) { ERR_error_string(ERR_get_error(), path); fprintf(stderr, "error: failed to sign manifest %s\n", path); From 0d641a7b05cff9a250bf14c754d970ef335e0586 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 9 Mar 2021 05:40:06 +0000 Subject: [PATCH 170/639] minor -h fix: -s meu_offset disables rimage signing It wasn't exactly obvious who does what. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index a0e906654370..0fedc6a4889d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -24,7 +24,7 @@ static void usage(char *name) name); fprintf(stdout, "\t -v enable verbose output\n"); fprintf(stdout, "\t -r enable relocatable ELF files\n"); - fprintf(stdout, "\t -s MEU signing offset\n"); + fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); From dbb49e03b9d811359f946e1a4b74c018caec95a0 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 12 Apr 2021 14:55:36 +0800 Subject: [PATCH 171/639] rimage: add cavs fw layout support Add support of cavs extended manifest and modules. Now we will have another config tgl-cavs for tgl. Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/tgl-cavs.toml | 216 +++++++++++ src/adsp_config.c | 377 +++++++++++++++++++- src/ext_manifest.c | 47 +++ src/include/rimage/cavs/cavs_ext_manifest.h | 249 +++++++++++++ src/include/rimage/ext_manifest_gen.h | 1 + src/include/rimage/rimage.h | 25 ++ src/include/rimage/sof/kernel/fw.h | 4 +- src/manifest.c | 27 ++ src/rimage.c | 6 +- 9 files changed, 947 insertions(+), 5 deletions(-) create mode 100644 config/tgl-cavs.toml create mode 100644 src/include/rimage/cavs/cavs_ext_manifest.h diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml new file mode 100644 index 000000000000..057fa6038f63 --- /dev/null +++ b/config/tgl-cavs.toml @@ -0,0 +1,216 @@ +version = [2, 5] + +[adsp] +name = "tgl" +machine_id = 10 +image_size = "0x100000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0000000" +size = "0x1000000" +[[adsp.mem_zone]] +type = "HP-SRAM" +base = "0xBE000000" +size = "0x800000" +[[adsp.mem_zone]] +type = "LP-SRAM" +base = "0xBE800000" +size = "0x40" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" + +[module] +count = 7 + [[module.entry]] + name = "BRNGUP" + uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "383B9BE2-3518-4DB0-8891-B1470A8914F8" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + diff --git a/src/adsp_config.c b/src/adsp_config.c index 2c5669025082..6a8bb4e74296 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -5,8 +5,10 @@ * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> */ +#include "rimage/sof/user/manifest.h" #include "rimage/sof/user/manifest.h" #include "rimage/adsp_config.h" +#include "rimage/ext_manifest_gen.h" #include "rimage/plat_auth.h" #include "rimage/manifest.h" #include "rimage/rimage.h" @@ -262,8 +264,8 @@ static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) {"ROM", SOF_FW_BLK_TYPE_ROM}, {"IMR", SOF_FW_BLK_TYPE_IMR}, {"RSRVD0", SOF_FW_BLK_TYPE_RSRVD0}, - {"RSRVD6", SOF_FW_BLK_TYPE_RSRVD6}, - {"RSRVD7", SOF_FW_BLK_TYPE_RSRVD7}, + {"HP-SRAM", SOF_FW_BLK_TYPE_HPSRAM}, + {"LP-SRAM", SOF_FW_BLK_TYPE_LPSRAM}, {"RSRVD8", SOF_FW_BLK_TYPE_RSRVD8}, {"RSRVD9", SOF_FW_BLK_TYPE_RSRVD9}, {"RSRVD10", SOF_FW_BLK_TYPE_RSRVD10}, @@ -1701,6 +1703,370 @@ static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } +static int parse_scheduling(const toml_table_t *mod_entry, struct parse_ctx *ctx, + struct fw_image_ext_mod_config *ext_mod_config, int *ext_length) +{ + toml_array_t *arr; + toml_raw_t raw; + int64_t val; + int ret; + + /* check "sched_caps" key */ + arr = toml_array_in(mod_entry, "sched_caps"); + if (!arr) { + ext_mod_config->header.num_scheduling_capabilities = 0; + *ext_length = 0; + return 0; + } + + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type or length != 2"); + + ctx->array_cnt++; + + raw = toml_raw_at(arr, 0); + if (raw == 0) + return err_key_parse("frame_length", NULL); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("frame_length", "can't convert element to integer"); + ext_mod_config->sched_caps.frame_length = val; + + raw = toml_raw_at(arr, 1); + if (raw == 0) + return err_key_parse("multiples_supported", NULL); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("multiples_supported", "can't convert element to integer"); + ext_mod_config->sched_caps.multiples_supported.ul = val; + + ext_mod_config->header.num_scheduling_capabilities = 1; + *ext_length = sizeof(const struct mod_scheduling_caps); + + return 0; +} + +static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx, + struct fw_image_ext_mod_config *ext_mod_config, int *ext_length) +{ + toml_array_t *arr; + toml_raw_t raw; + int64_t val; + int ret; + int i, j; + + /* check "pin" key */ + arr = toml_array_in(mod_entry, "pin"); + if (!arr) { + ext_mod_config->header.num_pin_entries = 0; + *ext_length = 0; + return 0; + } + + if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type"); + + ctx->array_cnt++; + + ext_mod_config->header.num_pin_entries = toml_array_nelem(arr) / 6; + ext_mod_config->pin_desc = calloc(sizeof(const struct fw_pin_description), + toml_array_nelem(arr) / 6); + + j = 0; + for (i = 0; ; i += 6, j++) { + raw = toml_raw_at(arr, i); + if (raw == 0) + break; + + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].caps.ul = (uint16_t)val; + + raw = toml_raw_at(arr, i + 1); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].format_type = (enum mod_stream_type)val; + + raw = toml_raw_at(arr, i + 2); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].sample_rate.ul = (uint32_t)val; + + raw = toml_raw_at(arr, i + 3); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].sample_size.ul = (uint16_t)val; + + raw = toml_raw_at(arr, i + 4); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].sample_container.ul = (uint32_t)val; + + raw = toml_raw_at(arr, i + 5); + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + ext_mod_config->pin_desc[j].ch_cfg.ul = (uint32_t)val; + } + + *ext_length = ext_mod_config->header.num_pin_entries * + sizeof(const struct fw_pin_description); + + return 0; +} + +static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx, + struct fw_image_manifest_module *modules, + struct sof_man_module *mod_man) +{ + toml_array_t *arr; + toml_raw_t raw; + int *pin_data; + int64_t val; + int ret; + int i; + + /* check "pin" key */ + arr = toml_array_in(mod_entry, "mod_cfg"); + if (!arr) { + mod_man->cfg_count = 0; + return 0; + } + + if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type"); + + ctx->array_cnt++; + + pin_data = (int *)(modules->mod_cfg + modules->mod_cfg_count); + mod_man->cfg_offset = modules->mod_cfg_count; + modules->mod_cfg_count += toml_array_nelem(arr) / 11; + mod_man->cfg_count = toml_array_nelem(arr) / 11; + + /* parse "pin" array elements */ + for (i = 0; ; ++i) { + raw = toml_raw_at(arr, i); + if (raw == 0) + break; + + ret = toml_rtoi(raw, &val); + if (ret < 0) + return err_key_parse("pin", "can't convert element to integer"); + pin_data[i] = val; + } + + return 0; +} + +static void parse_uuid(char *buf, uint8_t *uuid) +{ + struct uuid_t id; + uint32_t d[9]; + + sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], + &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); + id.d1 = (uint16_t)d[0]; + id.d2 = (uint16_t)d[1]; + id.d3 = (uint8_t)d[2]; + id.d4 = (uint8_t)d[3]; + id.d5 = (uint8_t)d[4]; + id.d6 = (uint8_t)d[5]; + id.d7 = (uint8_t)d[6]; + id.d8 = (uint8_t)d[7]; + id.d9 = (uint8_t)d[8]; + id.d10 = (uint8_t)d[9]; + + memcpy(uuid, &id, sizeof(id)); +} + +static void dump_module(struct fw_image_manifest_module *man_cavs) +{ + int i; + + DUMP("\nmodule"); + DUMP_KEY("moudle count", "%d", man_cavs->mod_man_count); + DUMP_KEY("module config count", "%d", man_cavs->mod_cfg_count); + + for (i = 0; i < man_cavs->mod_man_count; i++) { + DUMP_KEY("module name", "%s", man_cavs->mod_man[i].name); + DUMP_KEY("load type", "%d", man_cavs->mod_man[i].type.load_type); + DUMP_KEY("domain ll", "%d", man_cavs->mod_man[i].type.domain_ll); + DUMP_KEY("domain dp", "%d", man_cavs->mod_man[i].type.domain_dp); + DUMP_KEY("config count", "%d", man_cavs->mod_man[i].cfg_count); + DUMP_KEY("config offset", "%d", man_cavs->mod_man[i].cfg_offset); + } +} + +static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, + struct adsp *out, bool verbose) +{ + struct fw_image_manifest_module *modules; + toml_array_t *mod_entry_array; + toml_table_t *module; + toml_table_t *mod_entry; + struct parse_ctx ctx; + int entry_count; + int type, ext_length; + int tmp_cfg_count; + int ret, i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + module = toml_table_in(toml, "module"); + if (!module) + return 0; + + out->write_firmware_ext_man = ext_man_write_cavs_25; + + modules = calloc(sizeof(struct fw_image_manifest_module), 1); + if (!modules) + return err_malloc("man_cavs"); + out->modules = modules; + + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + entry_count = parse_uint32_key(module, &ctx, "count", 2, &ret); + if (ret < 0) + return ret; + + ctx.array_cnt += 1; + + mod_entry_array = toml_array_in(module, "entry"); + if (!mod_entry_array) + return err_key_not_found("entry"); + if (toml_array_kind(mod_entry_array) != 't' || + toml_array_nelem(mod_entry_array) != entry_count) + return err_key_parse("entry", "wrong array type or length != %d", entry_count); + + modules->mod_ext.mod_conf_count = entry_count; + modules->mod_man = calloc(sizeof(const struct sof_man_module), entry_count); + if (!modules->mod_man) + return -ENOMEM; + + modules->mod_man_count = toml_array_nelem(mod_entry_array); + + tmp_cfg_count = entry_count * 32; + modules->mod_cfg = calloc(sizeof(const struct sof_man_mod_config), tmp_cfg_count); + + /* parse entry array elements */ + for (i = 0; i < toml_array_nelem(mod_entry_array); ++i) { + struct fw_ext_mod_config_header *header; + struct sof_man_module *mod_man; + struct parse_ctx ctx_entry; + char buf[48]; + + mod_entry = toml_table_at(mod_entry_array, i); + if (!mod_entry) + return err_key_parse("entry", NULL); + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx_entry); + + mod_man = &modules->mod_man[i]; + + memcpy(mod_man->struct_id, "$AME", 4); + + /* configurable fields */ + parse_str_key(mod_entry, &ctx_entry, "name", (char *)mod_man->name, + SOF_MAN_MOD_NAME_LEN, &ret); + if (ret < 0) + return err_key_parse("name", NULL); + + parse_str_key(mod_entry, &ctx_entry, "uuid", buf, 48, &ret); + if (ret < 0) + return err_key_parse("uuid", NULL); + + parse_uuid(buf, mod_man->uuid); + + mod_man->affinity_mask = parse_uint32_hex_key(mod_entry, &ctx_entry, + "affinity_mask", 1, &ret); + if (ret < 0) + return err_key_parse("offset", NULL); + + mod_man->instance_max_count = parse_uint32_hex_key(mod_entry, &ctx_entry, + "instance_count", 1, &ret); + if (ret < 0) + return err_key_parse("length", NULL); + + type = parse_uint32_hex_key(mod_entry, &ctx_entry, "domain_types", 0, &ret); + if (ret < 0) + return err_key_parse("domain_types", NULL); + if (!type) + mod_man->type.domain_ll = 1; + else + mod_man->type.domain_dp = 1; + + mod_man->type.load_type = parse_uint32_hex_key(mod_entry, &ctx_entry, + "load_type", 1, &ret); + if (ret < 0) + return err_key_parse("load_type", NULL); + + mod_man->type.auto_start = parse_uint32_hex_key(mod_entry, &ctx_entry, + "auto_start", 1, &ret); + if (ret < 0) + return err_key_parse("auto_start", NULL); + + header = &modules->mod_ext.ext_mod_config_array[i].header; + header->version_major = 2; + header->version_minor = 5; + header->ext_module_config_length = sizeof(struct fw_ext_mod_config_header); + memcpy(header->guid, mod_man->uuid, sizeof(mod_man->uuid)); + + type = parse_uint32_hex_key(mod_entry, &ctx_entry, "module_type", 1, &ret); + if (ret < 0) + return err_key_parse("module_type", NULL); + + if (strcmp((char *)mod_man->name, "BRNGUP") && + strcmp((char *)mod_man->name, "BASEFW")) { + if (type != i - 1) { + log_err(ret, "error: invalid type %s", type); + return -EINVAL; + } + } + header->module_type = type; + + ret = parse_scheduling(mod_entry, &ctx_entry, + modules->mod_ext.ext_mod_config_array + i, &ext_length); + if (ret < 0) + return err_key_parse("schd_caps", NULL); + header->ext_module_config_length += ext_length; + + ret = parse_pin(mod_entry, &ctx_entry, modules->mod_ext.ext_mod_config_array + i, + &ext_length); + if (ret < 0) + return err_key_parse("pin", NULL); + header->ext_module_config_length += ext_length; + + ret = parse_mod_config(mod_entry, &ctx_entry, modules, mod_man); + if (ret < 0) + return err_key_parse("mod_cfg", NULL); + + if (modules->mod_cfg_count > tmp_cfg_count) + return -ENOMEM; + + /* check everything parsed */ + ret = assert_everything_parsed(mod_entry, &ctx_entry); + if (ret < 0) + return ret; + } + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + + if (verbose) + dump_module(modules); + + return 0; +} + static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, bool verbose) { @@ -1907,6 +2273,10 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("fw_desc", NULL); + ret = parse_module(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("module", NULL); + /* check everything parsed */ ret = assert_everything_parsed(toml, &ctx); if (ret < 0) @@ -2036,6 +2406,9 @@ void adsp_free(struct adsp *adsp) if (adsp->man_v2_5) free(adsp->man_v2_5); + if (adsp->modules) + free(adsp->modules); + if (adsp->name) free((char *)adsp->name); diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 8f079bb9bd4b..b389210c1f2e 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -12,6 +12,8 @@ #include <rimage/ext_manifest_gen.h> #include <rimage/sof/kernel/ext_manifest.h> #include <rimage/rimage.h> +#include <rimage/cavs/cavs_ext_manifest.h> +#include <rimage/manifest.h> const struct ext_man_header ext_man_template = { .magic = EXT_MAN_MAGIC_NUMBER, @@ -182,3 +184,48 @@ int ext_man_write(struct image *image) fclose(image->out_ext_man_fd); return ret; } + +int ext_man_write_cavs_25(struct image *image) +{ + struct fw_image_ext_module *mod_ext; + struct fw_ext_man_cavs_header header; + int pin_count; + int count, i; + int ret; + + ret = ext_man_open_file(image); + if (ret) + goto out; + + mod_ext = &image->adsp->modules->mod_ext; + count = mod_ext->mod_conf_count; + + header.version_major = mod_ext->ext_mod_config_array->header.version_major; + header.version_minor = mod_ext->ext_mod_config_array->header.version_minor; + header.num_module_entries = count; + header.id = EXTENDED_MANIFEST_MAGIC_HEADER_ID; + header.len = sizeof(const struct fw_ext_man_cavs_header); + + for (i = 0; i < count; i++) + header.len += mod_ext->ext_mod_config_array[i].header.ext_module_config_length; + fwrite(&header, 1, sizeof(header), image->out_ext_man_fd); + + for (i = 0; i < count; i++) { + fwrite(&mod_ext->ext_mod_config_array[i].header, 1, + sizeof(struct fw_ext_mod_config_header), image->out_ext_man_fd); + + if (mod_ext->ext_mod_config_array[i].header.num_scheduling_capabilities) + fwrite(&mod_ext->ext_mod_config_array[i].sched_caps, 1, + sizeof(struct mod_scheduling_caps), image->out_ext_man_fd); + + pin_count = mod_ext->ext_mod_config_array[i].header.num_pin_entries; + if (pin_count) + fwrite(mod_ext->ext_mod_config_array[i].pin_desc, pin_count, + sizeof(struct fw_pin_description), image->out_ext_man_fd); + } + +out: + if (image->out_ext_man_fd) + fclose(image->out_ext_man_fd); + return ret; +} diff --git a/src/include/rimage/cavs/cavs_ext_manifest.h b/src/include/rimage/cavs/cavs_ext_manifest.h new file mode 100644 index 000000000000..cc8fe4dc8ac0 --- /dev/null +++ b/src/include/rimage/cavs/cavs_ext_manifest.h @@ -0,0 +1,249 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2021 Intel Corporation. All rights reserved. + * + * Author: Rander Wang <rander.wang@linux.intel.com> + */ + +#ifndef __RIMAGE_CAVS_EXT_MANIFEST_H__ +#define __RIMAGE_CAVS_EXT_MANIFEST_H__ + +/* Structure of ext manifest : + * ExtendedManifestHeader + * ExtendedModuleConfig[0] + * SchedulingCapability[] + * PinDescr[] + * ExtendedModuleConfig[1] + * SchedulingCapability[] + * PinDescr[] + * ... + * ExtendedModuleConfig[N] + * SchedulingCapability[] + * PinDescr[] + */ + +/* ExtendedManifestHeader id $AE1 */ +#define EXTENDED_MANIFEST_MAGIC_HEADER_ID 0x31454124 + +#define FW_MAX_EXT_MODULE_NUM 32 + +struct uuid_t { + uint32_t d0; + uint16_t d1; + uint16_t d2; + uint8_t d3; + uint8_t d4; + uint8_t d5; + uint8_t d6; + uint8_t d7; + uint8_t d8; + uint8_t d9; + uint8_t d10; +} __attribute__((packed)); + +union mod_multiples { + uint16_t ul; + struct { + uint16_t x1 : 1; + uint16_t x2 : 1; + uint16_t x3 : 1; + uint16_t x4 : 1; + uint16_t x5 : 1; + uint16_t x6 : 1; + uint16_t x7 : 1; + uint16_t x8 : 1; + uint16_t x9 : 1; + uint16_t x10 : 1; + uint16_t x11 : 1; + uint16_t x12 : 1; + uint16_t x13 : 1; + uint16_t x14 : 1; + uint16_t x15 : 1; + uint16_t all : 1; + } r; +} __attribute__((packed)); + +struct mod_scheduling_caps { + /* scheduling period in Samples (sample groups) (note: 1 Sample = 1 sample per channel) */ + uint16_t frame_length; + union mod_multiples multiples_supported; +} __attribute__((packed)); + +enum mod_pin_direction { + pin_input = 0, + pin_output = 1 +}; + +union mod_pin_caps { + uint32_t ul; + struct { + uint16_t direction : 1; /* 0 : input; 1: output */ + uint16_t reserved0 : 15; + uint16_t reserved1 : 16; + } r; +} __attribute__((packed)); + +union mod_sample_rates { + uint32_t ul; + struct { + uint32_t freq_8000 : 1; + uint32_t freq_11025 : 1; + uint32_t freq_12000 : 1; + uint32_t freq_16000 : 1; + uint32_t freq_18900 : 1; + uint32_t freq_22050 : 1; + uint32_t freq_24000 : 1; + uint32_t freq_32000 : 1; + uint32_t freq_37800 : 1; + uint32_t freq_44100 : 1; + uint32_t freq_48000 : 1; + uint32_t freq_64000 : 1; + uint32_t freq_88200 : 1; + uint32_t freq_96000 : 1; + uint32_t freq_176400 : 1; + uint32_t freq_192000 : 1; + uint32_t reserved : 16; + } r; +} __attribute__((packed)); + +union mod_sample_sizes { + uint32_t ul; + struct { + uint16_t bits_8 : 1; + uint16_t bits_16 : 1; + uint16_t bits_24 : 1; + uint16_t bits_32 : 1; + uint16_t bits_64 : 1; + uint16_t reserved0 : 11; + uint16_t reserved1 : 16; + } r; +} __attribute__((packed)); + +union mod_sample_containers { + uint32_t ul; + struct { + uint16_t bits_8 : 1; + uint16_t bits_16 : 1; + uint16_t bits_24 : 1; + uint16_t bits_32 : 1; + uint16_t bits_64 : 1; + uint16_t reserved0 : 11; + uint16_t reserved1 : 16; + } r; +} __attribute__((packed)); + +union mod_channel_config { + uint32_t ul; + struct { + /* FRONT_CENTER */ + uint32_t channel_mono : 1; + /* FRONT_LEFT | BACK_LEFT */ + uint32_t channel_dual_mono : 1; + /* FRONT_LEFT | FRONT_RIGHT */ + uint32_t channel_stereo : 1; + /* FRONT_LEFT | FRONT_RIGHT | LOW_FREQUENCY */ + uint32_t channel_2_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER */ + uint32_t channel_3_0 : 1; + /* FRONT_LEFT | FRONT_RIGHT | BACK_LEFT | BACK_RIGHT */ + uint32_t channel_quad : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_CENTER */ + uint32_t channel_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY */ + uint32_t channel_3_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT */ + uint32_t channel_5_0 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SIDE_LEFT | SIDE_RIGHT */ + uint32_t channel_5_0_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | + * BACK_RIGHT + */ + uint32_t channel_5_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | SIDE_LEFT | + * SIDE_RIGHT + */ + uint32_t channel_5_1_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | + * FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER + */ + uint32_t channel_7_0 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | BACK_LEFT | BACK_RIGHT | + * SIDE_LEFT | SIDE_RIGHT + */ + uint32_t channel_7_0_surround : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | + * BACK_RIGHT | FRONT_LEFT_OF_CENTER | FRONT_RIGHT_OF_CENTER + */ + uint32_t channel_7_1 : 1; + /* FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | LOW_FREQUENCY | BACK_LEFT | + * BACK_RIGHT | SIDE_LEFT | SIDE_RIGHT + */ + uint32_t channel_7_1_surround : 1; + uint32_t reserved : 16; + } r; +} __attribute__((packed)); + +enum mod_stream_type { + epcm = 0, /* PCM stream */ + emp3, /* MP3 encoded stream */ + eaac, /* AAC encoded stream */ + emax_stream_type, + estream_type_invalid = 0xFF +}; + +enum mod_type { + ebasefw = 0, + emixin, + emixout, + ecopier, + epeakvol, + eupdwmix, + emux, + esrc, + ewov, + efx, + eaec, + ekpb, + emicselect, + efxf, /*i.e.SmartAmp */ + eaudclass, + efakecopier, + eiodriver, + ewhm, + egdbstub, + esensing, + emax, + einvalid = emax +} ; + +struct fw_pin_description { + union mod_pin_caps caps; + enum mod_stream_type format_type; + union mod_sample_rates sample_rate; + union mod_sample_sizes sample_size; + union mod_sample_containers sample_container; + union mod_channel_config ch_cfg; +} __attribute__((packed)); + +struct fw_ext_man_cavs_header { + uint32_t id; + uint32_t len; /* sizeof(Extend Manifest) in bytes */ + uint16_t version_major; /* Version of Extended Manifest structure */ + uint16_t version_minor; /* Version of Extended Manifest structure */ + uint32_t num_module_entries; +} __attribute__((packed)); + +struct fw_ext_mod_config_header { + uint32_t ext_module_config_length; /* sizeof(fw_ext_mod_config_header) in bytes */ + uint32_t guid[4]; /* Module GUID */ + uint16_t version_major; /* Module version */ + uint16_t version_minor; /* Module version */ + uint16_t version_hotfix; /* Module version */ + uint16_t version_build; /* Module version */ + enum mod_type module_type; + uint32_t init_settings_min_size; /* Minimum size of initialization settings (in bytes) */ + uint16_t num_scheduling_capabilities; /* number scheduling capabilities supported by the module */ + uint16_t num_pin_entries; /* Number of Pin (inputs + ouptuts) */ +} __attribute__((packed)); + +#endif diff --git a/src/include/rimage/ext_manifest_gen.h b/src/include/rimage/ext_manifest_gen.h index e91ba229c1ab..7f106834a0ca 100644 --- a/src/include/rimage/ext_manifest_gen.h +++ b/src/include/rimage/ext_manifest_gen.h @@ -32,5 +32,6 @@ #define EXT_MAN_DATA_SECTION ".fw_metadata" int ext_man_write(struct image *image); +int ext_man_write_cavs_25(struct image *image); #endif /* __EXT_MAN_H__ */ diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 1cb75fa707fe..8abb07c514c9 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -14,6 +14,7 @@ #include <openssl/conf.h> #include <openssl/evp.h> #include <openssl/err.h> +#include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/sof/kernel/fw.h> #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) @@ -137,6 +138,28 @@ struct mem_zone { uint32_t host_offset; }; +struct fw_image_ext_mod_config { + struct fw_ext_mod_config_header header; + struct mod_scheduling_caps sched_caps; + struct fw_pin_description *pin_desc; +}; + +struct fw_image_ext_module { + uint32_t mod_conf_count; + struct fw_image_ext_mod_config ext_mod_config_array[FW_MAX_EXT_MODULE_NUM]; +}; + +/* + * module manifest information defined in config file + */ +struct fw_image_manifest_module { + struct fw_image_ext_module mod_ext; + uint32_t mod_cfg_count; + struct sof_man_mod_config *mod_cfg; + uint32_t mod_man_count; + struct sof_man_module *mod_man; +}; + /* * Audio DSP descriptor and operations. */ @@ -148,6 +171,7 @@ struct adsp { uint32_t dram_offset; enum machine_id machine_id; + int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); int (*verify_firmware)(struct image *image); @@ -155,6 +179,7 @@ struct adsp { struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; struct fw_image_manifest_v1_5_sue *man_v1_5_sue; + struct fw_image_manifest_module *modules; int exec_boot_ldr; }; diff --git a/src/include/rimage/sof/kernel/fw.h b/src/include/rimage/sof/kernel/fw.h index 4a733b30e272..14c8ca0c1585 100644 --- a/src/include/rimage/sof/kernel/fw.h +++ b/src/include/rimage/sof/kernel/fw.h @@ -33,8 +33,8 @@ enum snd_sof_fw_blk_type { SOF_FW_BLK_TYPE_SRAM = 3, /* system RAM */ SOF_FW_BLK_TYPE_ROM = 4, SOF_FW_BLK_TYPE_IMR = 5, - SOF_FW_BLK_TYPE_RSRVD6 = 6, - SOF_FW_BLK_TYPE_RSRVD7 = 7, + SOF_FW_BLK_TYPE_HPSRAM = 6, + SOF_FW_BLK_TYPE_LPSRAM = 7, SOF_FW_BLK_TYPE_RSRVD8 = 8, SOF_FW_BLK_TYPE_RSRVD9 = 9, SOF_FW_BLK_TYPE_RSRVD10 = 10, diff --git a/src/manifest.c b/src/manifest.c index 6c781a2e7deb..593a17e72076 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -700,6 +700,29 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, return 0; } +static void man_create_modules_in_config(struct image *image, struct sof_man_fw_desc *desc) +{ + struct fw_image_manifest_module *modules; + struct sof_man_module *man_module; + void *cfg_start; + int i; + + modules = image->adsp->modules; + if (!modules) + return; + + /*skip bringup and base module */ + for (i = 2; i < modules->mod_man_count; i++) { + man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); + memcpy(man_module, &modules->mod_man[i], sizeof(*man_module)); + } + + cfg_start = (void *)desc + SOF_MAN_MODULE_OFFSET(i); + memcpy(cfg_start, modules->mod_cfg, modules->mod_cfg_count * sizeof(struct sof_man_mod_config)); + + desc->header.num_module_entries = modules->mod_man_count; +} + static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) { struct sof_man_module *man_module; @@ -1169,6 +1192,8 @@ int man_write_fw_meu_v2_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + /* platform config defines some modules except bringup & base modules */ + man_create_modules_in_config(image, desc); fprintf(stdout, "Firmware completing manifest v2.5\n"); @@ -1251,6 +1276,8 @@ int man_write_fw_v2_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + /* platform config defines some modules except bringup & base modules */ + man_create_modules_in_config(image, desc); fprintf(stdout, "Firmware completing manifest v2.5\n"); diff --git a/src/rimage.c b/src/rimage.c index 0fedc6a4889d..c74c462401c7 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -209,7 +209,11 @@ int main(int argc, char *argv[]) /* build extended manifest */ if (use_ext_man) { - ret = ext_man_write(&image); + if (image.adsp->write_firmware_ext_man) + ret = image.adsp->write_firmware_ext_man(&image); + else + ret = ext_man_write(&image); + if (ret < 0) { fprintf(stderr, "error: unable to write extended manifest, %d\n", ret); From 6c44aefb1f1ac3974eca40ee64fe33550f60a653 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Mon, 26 Apr 2021 12:19:54 +0200 Subject: [PATCH 172/639] ext_man: Fix memory leak after manifest build sec_buffer allocated inside elf_read_section() was not being freed before and is freed now. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/ext_manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index b389210c1f2e..cb854c5153f1 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -130,6 +130,7 @@ static int ext_man_build(const struct module *module, *dst_buff = (struct ext_man_header *)buffer; out: + free(sec_buffer); return ret; } From 994ee247e13ab2d044dae03a83aa7594b4fc6e7c Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Mon, 26 Apr 2021 12:25:20 +0200 Subject: [PATCH 173/639] ext_man: Fix code formating Function parameters should be separated by ', '. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/ext_manifest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index cb854c5153f1..be6c80daaea2 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -125,7 +125,7 @@ static int ext_man_build(const struct module *module, memcpy(buffer, &ext_man, ext_man.header_size); offset = ext_man.header_size; - memcpy(&buffer[offset],sec_buffer, section->size); + memcpy(&buffer[offset], sec_buffer, section->size); *dst_buff = (struct ext_man_header *)buffer; From 0297c671fc90c2e4aaa15fe8f050d6115cb5b124 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Wed, 5 May 2021 08:57:04 +0200 Subject: [PATCH 174/639] config: Fix 'module' parsing error messages 'key' argument must describe 'key' which triggered error message to keep stderr output helpful. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 6a8bb4e74296..354119968701 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1721,7 +1721,7 @@ static int parse_scheduling(const toml_table_t *mod_entry, struct parse_ctx *ctx if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type or length != 2"); + return err_key_parse("sched_caps", "wrong array type or length != 2"); ctx->array_cnt++; @@ -1765,7 +1765,7 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx, } if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type"); + return err_key_parse("pin", "wrong array type"); ctx->array_cnt++; @@ -1840,7 +1840,7 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx } if (toml_array_type(arr) != 'i' || toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type"); + return err_key_parse("mod_cfg", "wrong array type"); ctx->array_cnt++; @@ -1857,7 +1857,7 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx ret = toml_rtoi(raw, &val); if (ret < 0) - return err_key_parse("pin", "can't convert element to integer"); + return err_key_parse("mod_cfg", "can't convert element to integer"); pin_data[i] = val; } @@ -1987,12 +1987,12 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, mod_man->affinity_mask = parse_uint32_hex_key(mod_entry, &ctx_entry, "affinity_mask", 1, &ret); if (ret < 0) - return err_key_parse("offset", NULL); + return err_key_parse("affinity_mask", NULL); mod_man->instance_max_count = parse_uint32_hex_key(mod_entry, &ctx_entry, "instance_count", 1, &ret); if (ret < 0) - return err_key_parse("length", NULL); + return err_key_parse("instance_count", NULL); type = parse_uint32_hex_key(mod_entry, &ctx_entry, "domain_types", 0, &ret); if (ret < 0) From 8f42ee88cc113a8a270314f228014f93daa0cf0e Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 16:05:26 -0700 Subject: [PATCH 175/639] adsp_config: fix out of bounds error cppcheck find Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 354119968701..a9e33894e117 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1867,7 +1867,7 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx static void parse_uuid(char *buf, uint8_t *uuid) { struct uuid_t id; - uint32_t d[9]; + uint32_t d[10]; sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); From 1cca9bf01d11f7c9d2a46ead774e939c6dc94add Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 16:27:58 -0700 Subject: [PATCH 176/639] ext_manifest: cppcheck: refactor to silence false positive memory clearly has exit path through argument, factor out temporary variable to silence cppcheck Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/ext_manifest.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index be6c80daaea2..962415674f11 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -88,7 +88,6 @@ static int ext_man_build(const struct module *module, { struct ext_man_header ext_man; const Elf32_Shdr *section; - uint8_t *buffer = NULL; uint8_t *sec_buffer = NULL; size_t offset; int ret; @@ -114,20 +113,17 @@ static int ext_man_build(const struct module *module, goto out; } - /* alloc buffer for ext_man */ - buffer = calloc(1, ext_man.full_size); - if (!buffer) { + *dst_buff = calloc(1, ext_man.full_size); + if (!*dst_buff) { ret = -ENOMEM; goto out; } /* fill buffer with ext_man and section content */ - memcpy(buffer, &ext_man, ext_man.header_size); + memcpy(*dst_buff, &ext_man, ext_man.header_size); offset = ext_man.header_size; - memcpy(&buffer[offset], sec_buffer, section->size); - - *dst_buff = (struct ext_man_header *)buffer; + memcpy(((char *)*dst_buff) + offset, sec_buffer, section->size); out: free(sec_buffer); From 7764a8bd3162e35f8ca231373620775e164c88ed Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 16:38:14 -0700 Subject: [PATCH 177/639] manifest: close file on error found via cppcheck Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/manifest.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 593a17e72076..f29355b66dbf 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1383,19 +1383,22 @@ int verify_image(struct image *image) if (ret < 0) { fprintf(stderr, "error: unable to seek eof %s for reading %d\n", image->verify_file, errno); - return -errno; + ret = -errno; + goto out; } size = ftell(in_file); if (size < 0) { fprintf(stderr, "error: unable to get file size for %s %d\n", image->verify_file, errno); - return -errno; + ret = -errno; + goto out; } ret = fseek(in_file, 0, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: unable to seek %s for reading %d\n", image->verify_file, errno); - return -errno; + ret = -errno; + goto out; } /* allocate buffer for parsing */ From 6f45b619210b2dc1fc84baa521e2d01a6b7a485a Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 17:01:24 -0700 Subject: [PATCH 178/639] actions: add cppcheck and yamllint CI saves lives Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- .github/workflows/cppcheck.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/pull-request.yml | 25 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .github/workflows/cppcheck.yml create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/cppcheck.yml b/.github/workflows/cppcheck.yml new file mode 100644 index 000000000000..211e4004692c --- /dev/null +++ b/.github/workflows/cppcheck.yml @@ -0,0 +1,30 @@ +--- +# SPDX-License-Identifier: BSD-3-Clause +# Tools that can save round-trips to github and a lot of time: +# +# yamllint -f parsable this.yml +# pip3 install ruamel.yaml.cmd +# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml +# +# github.com also has a powerful web editor that can be used without +# committing. + +name: cppcheck + +# yamllint disable-line rule:truthy +on: [pull_request, push] + +jobs: + cppcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: {fetch-depth: 50, submodules: recursive} + + - name: apt install cppcheck + run: sudo apt update && sudo apt-get -y install cppcheck + + # TODO enable more types of checks as they are fixed + - name: run cppcheck + run: cppcheck --platform=unix32 --force --max-configs=1024 + --inconclusive --quiet --inline-suppr . diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 000000000000..b821ce4fb5f7 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,25 @@ +--- +# SPDX-License-Identifier: BSD-3-Clause +# Tools that can save round-trips to github and a lot of time: +# +# yamllint -f parsable this.yml +# pip3 install ruamel.yaml.cmd +# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml +# +# github.com also has a powerful web editor that can be used without +# committing. + +name: checkpatch + +# yamllint disable-line rule:truthy +on: [pull_request] + +jobs: + yamllint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: {fetch-depth: 50, submodules: recursive} + + - name: run yamllint + run: yamllint .github/workflows/*.yml From 5aeb95b19bba15801fef4ee37760a6e776d3bd1a Mon Sep 17 00:00:00 2001 From: Slawomir Blauciak <slawomir.blauciak@linux.intel.com> Date: Tue, 25 May 2021 16:55:10 +0200 Subject: [PATCH 179/639] sanity check allocated memory Issue detected by Klocwork Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com> --- src/adsp_config.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index a9e33894e117..5b26f4589123 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1773,6 +1773,9 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx, ext_mod_config->pin_desc = calloc(sizeof(const struct fw_pin_description), toml_array_nelem(arr) / 6); + if(!ext_mod_config->pin_desc) + return err_malloc("pin"); + j = 0; for (i = 0; ; i += 6, j++) { raw = toml_raw_at(arr, i); From 9e50a02f1b0dabd2225a791d63bd48cd61feb3c6 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 13:37:31 +0800 Subject: [PATCH 180/639] config: tgl: change image_size to the real SRAM size We have 46 bank HP and 1 bank LP SRAM on TGL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/tgl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/tgl.toml b/config/tgl.toml index 57a1e13f4f73..a095b33c59da 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,7 +3,7 @@ version = [2, 5] [adsp] name = "tgl" machine_id = 10 -image_size = "0x100000" +image_size = "0x2F0000" # (46 + 1) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 8073ea3ef93ce740b3a8a8fa617af9988c990838 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 13:48:58 +0800 Subject: [PATCH 181/639] config: tgl-h: change image_size to the real SRAM size We have 30 bank HP and 1 bank LP SRAM on TGL-H, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/tgl-h.toml | 50 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) mode change 120000 => 100644 config/tgl-h.toml diff --git a/config/tgl-h.toml b/config/tgl-h.toml deleted file mode 120000 index 887bba2c8411..000000000000 --- a/config/tgl-h.toml +++ /dev/null @@ -1 +0,0 @@ -tgl.toml \ No newline at end of file diff --git a/config/tgl-h.toml b/config/tgl-h.toml new file mode 100644 index 000000000000..b6653b2b7afd --- /dev/null +++ b/config/tgl-h.toml @@ -0,0 +1,49 @@ +version = [2, 5] + +[adsp] +name = "tgl" +machine_id = 10 +image_size = "0x1F0000" # (30 + 1) bank * 64KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" From f52a078aadf19457275db5748a2b2a542bc7bf4e Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:39:01 +0800 Subject: [PATCH 182/639] config: icl: change image_size to the real SRAM size We have 47 bank HP and 1 bank LP SRAM on ICL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/icl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/icl.toml b/config/icl.toml index 2e2e61799544..6b4dfa730748 100644 --- a/config/icl.toml +++ b/config/icl.toml @@ -3,7 +3,7 @@ version = [1, 8] [adsp] name = "icl" machine_id = 9 -image_size = "0x100000" +image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 1de9ccca3388b87caf98f4e125b3d6ff0a55fccf Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:41:49 +0800 Subject: [PATCH 183/639] config: jsl: change image_size to the real SRAM size We have 16 bank HP and 1 bank LP SRAM on JSL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/jsl.toml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) mode change 120000 => 100644 config/jsl.toml diff --git a/config/jsl.toml b/config/jsl.toml deleted file mode 120000 index 6d3aa32fedec..000000000000 --- a/config/jsl.toml +++ /dev/null @@ -1 +0,0 @@ -icl.toml \ No newline at end of file diff --git a/config/jsl.toml b/config/jsl.toml new file mode 100644 index 000000000000..cd40317b6041 --- /dev/null +++ b/config/jsl.toml @@ -0,0 +1,54 @@ +version = [1, 8] + +[adsp] +name = "icl" +machine_id = 9 +image_size = "0x110000" # (16 + 1) bank * 64KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0xBEFE0000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0038000" +size = "0x100000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xBE040000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x58" +length = "0x378" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x400" +length = "0x60" +[[cse.entry]] +name = "cavs0015" +offset = "0x480" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[partition_info] +name = "ADSP" +[[partition_info.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" From 8a2ea0044dcfd71da952ecd3ca8662c4b25dab43 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:43:46 +0800 Subject: [PATCH 184/639] config: cnl: change image_size to the real SRAM size We have 47 bank HP and 1 bank LP SRAM on CNL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/cnl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cnl.toml b/config/cnl.toml index 6a3de265318c..88b6d42e3099 100644 --- a/config/cnl.toml +++ b/config/cnl.toml @@ -3,7 +3,7 @@ version = [1, 8] [adsp] name = "cnl" machine_id = 8 -image_size = "0x100000" +image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 9a26e4558094f19f3f7becd89eb9e8a9a9dd82b9 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 2 Jul 2021 17:45:56 +0800 Subject: [PATCH 185/639] config: apl: change image_size to the real SRAM size We have 8 bank HP and 2 bank LP SRAM on APL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/apl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/apl.toml b/config/apl.toml index 869b95900ccb..9751623a2114 100644 --- a/config/apl.toml +++ b/config/apl.toml @@ -3,7 +3,7 @@ version = [1, 8] [adsp] name = "apl" machine_id = 5 -image_size = "0x100000" +image_size = "0x0A0000" # (8 + 2) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 580e4d674e06eb6d515d1479c082b46709ab743f Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Tue, 20 Jul 2021 13:36:04 +0800 Subject: [PATCH 186/639] config: tgl-cavs: change image_size to the real SRAM size Apply "config: tgl: change image_size to the real SRAM size" (9e50a02f1b) to tgl-cavs Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/tgl-cavs.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 057fa6038f63..8f5316fbb093 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -3,7 +3,7 @@ version = [2, 5] [adsp] name = "tgl" machine_id = 10 -image_size = "0x100000" +image_size = "0x2F0000" [[adsp.mem_zone]] type = "ROM" From 44b37d19a24cab75d83f99f3d9083f5574917aa3 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Wed, 21 Jul 2021 18:06:24 +0800 Subject: [PATCH 187/639] config: sue: change image_size to the real SRAM size We have 47 bank HP and 1 bank LP SRAM on Suecreek, change the toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/sue.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/sue.toml b/config/sue.toml index d326d0ae7a8e..c0c4a01fa898 100644 --- a/config/sue.toml +++ b/config/sue.toml @@ -3,7 +3,7 @@ version = [1, 5] [adsp] name = "sue" machine_id = 11 -image_size = "0x100000" +image_size = "0x300000" # (47 + 1) bank * 64KB exec_boot_ldr = 1 [[adsp.mem_zone]] From 9c9e07c6507daecca2d6923876340a1d35849925 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 23 Jul 2021 13:49:38 +0800 Subject: [PATCH 188/639] config: kbl: change image_size to the real SRAM size We have 30 bank HP and 2 bank LP SRAM on KBL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/kbl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/kbl.toml b/config/kbl.toml index ac82149fdf1f..48e47cce3a88 100644 --- a/config/kbl.toml +++ b/config/kbl.toml @@ -3,7 +3,7 @@ version = [1, 5] [adsp] name = "kbl" machine_id = 6 -image_size = "0x100000" +image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] type = "ROM" From 246ea6469abdc677b7038285654fd64fc387c5f1 Mon Sep 17 00:00:00 2001 From: Keyon Jie <yang.jie@linux.intel.com> Date: Fri, 23 Jul 2021 13:50:35 +0800 Subject: [PATCH 189/639] config: skl: change image_size to the real SRAM size We have 30 bank HP and 2 bank LP SRAM on SKL, change to toml config file to reflect that. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com> --- config/skl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/skl.toml b/config/skl.toml index f304a1849490..7bde4f8c68e8 100644 --- a/config/skl.toml +++ b/config/skl.toml @@ -3,7 +3,7 @@ version = [1, 5] [adsp] name = "skl" machine_id = 7 -image_size = "0x100000" +image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] type = "ROM" From d1553e9321a954e597b82dbe91f9387836685020 Mon Sep 17 00:00:00 2001 From: balakishorepati <87635673+balakishorepati@users.noreply.github.com> Date: Mon, 26 Jul 2021 17:06:32 +0530 Subject: [PATCH 190/639] config: add rn toml file to support renoir build Add rn toml file to support sof-rn.ri binary build Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com> Signed-off-by: balapati <balakishore.pati@amd.com> --- config/rn.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/rn.toml diff --git a/config/rn.toml b/config/rn.toml new file mode 100644 index 000000000000..f05902583f37 --- /dev/null +++ b/config/rn.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "rn" +machine_id = 14 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x20000000" +size = "0x40000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x21000000" +size = "0xE0000" +host_offset = "0x0" From b28b9939dcd73fa44a00679c95b13b51f3b32c43 Mon Sep 17 00:00:00 2001 From: sunil <sunil-kumar.dommati@amd.com> Date: Mon, 26 Jul 2021 18:51:30 +0530 Subject: [PATCH 191/639] fixing incorrect data offset in ri_manifest_sign_v1_5 --- src/pkcs1_5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 0bfb901f4cbb..966ef2222aa6 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -347,7 +347,8 @@ int ri_manifest_sign_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; - char *const data1 = (char *)man + MAN_CSS_MAN_SIZE_V1_5; + /* excluding the manifest header */ + char *const data1 = (char *)man + sizeof(struct fw_image_manifest_v1_5); unsigned const size1 = image->image_end - sizeof(*man); return pkcs_v1_5_sign_man_v1_5(image, man, data1, size1); From 9716e10a3e000aa485b37c8cfd20ce184120809b Mon Sep 17 00:00:00 2001 From: Zhang Peng <peng.zhang_8@nxp.com> Date: Mon, 12 Apr 2021 14:19:04 +0800 Subject: [PATCH 192/639] config: Add imx8ulp.toml Add imx8ulp toml file to support sof-imx8ulp.ri binary build. Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com> --- config/imx8ulp.toml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 config/imx8ulp.toml diff --git a/config/imx8ulp.toml b/config/imx8ulp.toml new file mode 100644 index 000000000000..ef4c1ad9a02c --- /dev/null +++ b/config/imx8ulp.toml @@ -0,0 +1,21 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "imx8ulp" +machine_id = 15 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x21170000" +size = "0x10000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0x21180000" +size = "0x10000" +host_offset = "0x10000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x1a000000" +size = "0x800000" +host_offset = "0x0" From aea19692251b76c66439e50f81853521a915445c Mon Sep 17 00:00:00 2001 From: Marcin Rajwa <marcin.rajwa@linux.intel.com> Date: Wed, 25 Aug 2021 11:57:41 +0200 Subject: [PATCH 193/639] adsp_config: fix potential overflow in strtol() This patch fixes the potential overflow which may happen during conversion of signed long. On a platforms where signed long is only 32 bits the address which is stored in temp_s will experience overflow. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> --- src/adsp_config.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 5b26f4589123..6bbb1273642f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -126,7 +126,7 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx { toml_raw_t raw; char *temp_s; - int64_t val; + uint32_t val; int ret; /* look for key in given table, assign def value when key not found */ @@ -145,17 +145,15 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *error = err_key_parse(key, NULL); return UINT32_MAX; } - val = strtol(temp_s, 0, 16); + val = strtoul(temp_s, 0, 16); + free(temp_s); /* assert parsing success and value is within uint32_t range */ if (errno < 0) { *error = err_key_parse(key, "can't convert hex value"); return UINT32_MAX; } - if (val < 0 || val > UINT32_MAX) { - *error = log_err(-ERANGE, "key %s out of uint32_t range", key); - return UINT32_MAX; - } + /* set success error code and increment parsed key counter */ *error = 0; ++ctx->key_cnt; From 9bf46d3fe2c69b6831c448be01703f664e17725e Mon Sep 17 00:00:00 2001 From: Allen-kh Cheng <allen-kh.cheng@mediatek.corp-partner.google.com> Date: Thu, 26 Aug 2021 19:28:16 +0800 Subject: [PATCH 194/639] rimage: Add support for mt8195 Add mt8195.toml to support sof-mt8195.ri binary build. Add mt8195 memory layout Add mt8195 machine_id Signed-off-by: YC Hung <yc.hung@mediatek.com> Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com> --- config/mt8195.toml | 16 ++++++++++++++++ src/file_simple.c | 26 ++++++++++++++++++++++++++ src/include/rimage/rimage.h | 1 + 3 files changed, 43 insertions(+) create mode 100644 config/mt8195.toml diff --git a/config/mt8195.toml b/config/mt8195.toml new file mode 100644 index 000000000000..e2678bace08d --- /dev/null +++ b/config/mt8195.toml @@ -0,0 +1,16 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "mt8195" +machine_id = 15 + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x40000000" +size = "0x00040000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60000000" +size = "0x00600000" +host_offset = "0x0" diff --git a/src/file_simple.c b/src/file_simple.c index 396c24c2bf0d..cd1fa0d27d72 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -48,6 +48,13 @@ #define IMX8M_SRAM_BASE 0x92400000 #define IMX8M_SRAM_SIZE 0x800000 +#define MT8195_IRAM_BASE 0x40000000 +#define MT8195_IRAM_HOST_OFFSET 0x00000 +#define MT8195_IRAM_SIZE 0x4000 +#define MT8195_SRAM_BASE 0x60000000 +#define MT8195_SRAM_SIZE 0x600000 +#define MT8195_SRAM_HOST_OFFSET 0x00000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -532,3 +539,22 @@ const struct adsp machine_imx8m = { .machine_id = MACHINE_IMX8M, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_mt8195= { + .name = "mt8195", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = MT8195_IRAM_BASE, + .size = MT8195_IRAM_SIZE, + .host_offset = MT8195_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = MT8195_SRAM_BASE, + .size = MT8195_SRAM_SIZE, + .host_offset = MT8195_SRAM_HOST_OFFSET, + }, + }, + .machine_id = MACHINE_MT8195, + .write_firmware = simple_write_firmware, +}; + diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 8abb07c514c9..e62adb33d519 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -41,6 +41,7 @@ enum machine_id { MACHINE_IMX8, MACHINE_IMX8X, MACHINE_IMX8M, + MACHINE_MT8195, MACHINE_MAX }; From 916fc2cd73ff95dd4f1c78e5052b7aedb8718b6f Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 11:26:31 +0200 Subject: [PATCH 195/639] config: Remove unused adsp structs After commit 2965908 "manifest: Remove -m option" those structs are unused. ADSP configuration comes from toml configuration files. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/file_simple.c | 178 ------------------------------------ src/include/rimage/rimage.h | 18 ---- 2 files changed, 196 deletions(-) diff --git a/src/file_simple.c b/src/file_simple.c index cd1fa0d27d72..43aa175c3e70 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -380,181 +380,3 @@ int simple_write_firmware(struct image *image) return 0; } - -const struct adsp machine_byt = { - .name = "byt", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BYT_IRAM_BASE, - .size = BYT_IRAM_SIZE, - .host_offset = BYT_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BYT_DRAM_BASE, - .size = BYT_DRAM_SIZE, - .host_offset = BYT_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_BAYTRAIL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_cht = { - .name = "cht", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BYT_IRAM_BASE, - .size = BYT_IRAM_SIZE, - .host_offset = BYT_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BYT_DRAM_BASE, - .size = BYT_DRAM_SIZE, - .host_offset = BYT_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_CHERRYTRAIL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_bsw = { - .name = "bsw", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BYT_IRAM_BASE, - .size = BYT_IRAM_SIZE, - .host_offset = BYT_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BYT_DRAM_BASE, - .size = BYT_DRAM_SIZE, - .host_offset = BYT_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_BRASWELL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_hsw = { - .name = "hsw", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = HSW_IRAM_BASE, - .size = HSW_IRAM_SIZE, - .host_offset = HSW_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = HSW_DRAM_BASE, - .size = HSW_DRAM_SIZE, - .host_offset = HSW_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_HASWELL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_bdw = { - .name = "bdw", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = BDW_IRAM_BASE, - .size = BDW_IRAM_SIZE, - .host_offset = BDW_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = BDW_DRAM_BASE, - .size = BDW_DRAM_SIZE, - .host_offset = BDW_DRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_BROADWELL, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_imx8 = { - .name = "imx8", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = IMX8_IRAM_BASE, - .size = IMX8_IRAM_SIZE, - .host_offset = IMX8_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = IMX8_DRAM_BASE, - .size = IMX8_DRAM_SIZE, - .host_offset = 0, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = IMX8_SRAM_BASE, - .size = IMX8_SRAM_SIZE, - .host_offset = 0, - }, - }, - .machine_id = MACHINE_IMX8, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_imx8x = { - .name = "imx8x", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = IMX8_IRAM_BASE, - .size = IMX8_IRAM_SIZE, - .host_offset = IMX8_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = IMX8_DRAM_BASE, - .size = IMX8_DRAM_SIZE, - .host_offset = 0, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = IMX8_SRAM_BASE, - .size = IMX8_SRAM_SIZE, - .host_offset = 0, - }, - }, - .machine_id = MACHINE_IMX8X, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_imx8m = { - .name = "imx8m", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = IMX8M_IRAM_BASE, - .size = IMX8M_IRAM_SIZE, - .host_offset = IMX8M_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_DRAM] = { - .base = IMX8M_DRAM_BASE, - .size = IMX8M_DRAM_SIZE, - .host_offset = 0, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = IMX8M_SRAM_BASE, - .size = IMX8M_SRAM_SIZE, - .host_offset = 0, - }, - }, - .machine_id = MACHINE_IMX8M, - .write_firmware = simple_write_firmware, -}; - -const struct adsp machine_mt8195= { - .name = "mt8195", - .mem_zones = { - [SOF_FW_BLK_TYPE_IRAM] = { - .base = MT8195_IRAM_BASE, - .size = MT8195_IRAM_SIZE, - .host_offset = MT8195_IRAM_HOST_OFFSET, - }, - [SOF_FW_BLK_TYPE_SRAM] = { - .base = MT8195_SRAM_BASE, - .size = MT8195_SRAM_SIZE, - .host_offset = MT8195_SRAM_HOST_OFFSET, - }, - }, - .machine_id = MACHINE_MT8195, - .write_firmware = simple_write_firmware, -}; - diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e62adb33d519..75ce5dd8b8c0 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -234,22 +234,4 @@ int elf_read_section(const struct module *module, const char *name, int elf_validate_section(struct image *image, struct module *module, Elf32_Shdr *section, int index); -/* supported machines */ -extern const struct adsp machine_byt; -extern const struct adsp machine_cht; -extern const struct adsp machine_bsw; -extern const struct adsp machine_hsw; -extern const struct adsp machine_bdw; -extern const struct adsp machine_apl; -extern const struct adsp machine_cnl; -extern const struct adsp machine_icl; -extern const struct adsp machine_jsl; -extern const struct adsp machine_tgl; -extern const struct adsp machine_sue; -extern const struct adsp machine_skl; -extern const struct adsp machine_kbl; -extern const struct adsp machine_imx8; -extern const struct adsp machine_imx8x; -extern const struct adsp machine_imx8m; - #endif From c4a74562544603197d644ebb35f82f2248b1b411 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 12:37:51 +0200 Subject: [PATCH 196/639] config: Remove machine_id field This enum value is used only to distinguish suecreek from other platforms, which can be done also by platform name. Manual enumeration, in separate toml files with manual synchronization in enum definition is quite error prone. After commit 9bf46d3: "rimage: Add support for mt8195" and 9716e10: "config: Add imx8ulp.toml" there are two different platform with the same enum value 15 specified, which proves such a thesis. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- config/apl.toml | 1 - config/bdw.toml | 1 - config/bsw.toml | 1 - config/byt.toml | 1 - config/cht.toml | 1 - config/cnl.toml | 1 - config/hsw.toml | 1 - config/icl.toml | 1 - config/imx8.toml | 1 - config/imx8m.toml | 1 - config/imx8ulp.toml | 1 - config/imx8x.toml | 1 - config/jsl.toml | 1 - config/kbl.toml | 1 - config/mt8195.toml | 1 - config/rn.toml | 1 - config/skl.toml | 1 - config/sue.toml | 1 - config/tgl-cavs.toml | 1 - config/tgl-h.toml | 1 - config/tgl.toml | 1 - src/adsp_config.c | 8 ++------ src/include/rimage/rimage.h | 22 ---------------------- 23 files changed, 2 insertions(+), 49 deletions(-) diff --git a/config/apl.toml b/config/apl.toml index 9751623a2114..fafd01853da7 100644 --- a/config/apl.toml +++ b/config/apl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "apl" -machine_id = 5 image_size = "0x0A0000" # (8 + 2) bank * 64KB [[adsp.mem_zone]] diff --git a/config/bdw.toml b/config/bdw.toml index 6cc2402a198b..6b642fcd882e 100644 --- a/config/bdw.toml +++ b/config/bdw.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "bdw" -machine_id = 4 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/bsw.toml b/config/bsw.toml index 77f2e5c3987f..6746ca6cff34 100644 --- a/config/bsw.toml +++ b/config/bsw.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "bsw" -machine_id = 2 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/byt.toml b/config/byt.toml index 8c2f27851d3e..4afd1c0dd523 100644 --- a/config/byt.toml +++ b/config/byt.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "byt" -machine_id = 0 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/cht.toml b/config/cht.toml index 7cc9142716fe..2ed88370d16a 100644 --- a/config/cht.toml +++ b/config/cht.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "cht" -machine_id = 1 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/cnl.toml b/config/cnl.toml index 88b6d42e3099..fae7fe80c6d1 100644 --- a/config/cnl.toml +++ b/config/cnl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "cnl" -machine_id = 8 image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/hsw.toml b/config/hsw.toml index df5e5cec189f..2f96a675b89d 100644 --- a/config/hsw.toml +++ b/config/hsw.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "hsw" -machine_id = 3 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/icl.toml b/config/icl.toml index 6b4dfa730748..20ba7765fc56 100644 --- a/config/icl.toml +++ b/config/icl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "icl" -machine_id = 9 image_size = "0x300000" # (47 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/imx8.toml b/config/imx8.toml index 69207806c8df..865be902e840 100644 --- a/config/imx8.toml +++ b/config/imx8.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8" -machine_id = 12 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/imx8m.toml b/config/imx8m.toml index 5630d94d1bea..5b7ba20870bd 100644 --- a/config/imx8m.toml +++ b/config/imx8m.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8m" -machine_id = 14 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/imx8ulp.toml b/config/imx8ulp.toml index ef4c1ad9a02c..7fd4c16a52f3 100644 --- a/config/imx8ulp.toml +++ b/config/imx8ulp.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8ulp" -machine_id = 15 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/imx8x.toml b/config/imx8x.toml index eb4d579103db..ea9059c174ae 100644 --- a/config/imx8x.toml +++ b/config/imx8x.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "imx8x" -machine_id = 13 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/jsl.toml b/config/jsl.toml index cd40317b6041..a501066a2531 100644 --- a/config/jsl.toml +++ b/config/jsl.toml @@ -2,7 +2,6 @@ version = [1, 8] [adsp] name = "icl" -machine_id = 9 image_size = "0x110000" # (16 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/kbl.toml b/config/kbl.toml index 48e47cce3a88..442c886b99ec 100644 --- a/config/kbl.toml +++ b/config/kbl.toml @@ -2,7 +2,6 @@ version = [1, 5] [adsp] name = "kbl" -machine_id = 6 image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] diff --git a/config/mt8195.toml b/config/mt8195.toml index e2678bace08d..5c8abc92557a 100644 --- a/config/mt8195.toml +++ b/config/mt8195.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "mt8195" -machine_id = 15 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/rn.toml b/config/rn.toml index f05902583f37..d4e0b34b685c 100644 --- a/config/rn.toml +++ b/config/rn.toml @@ -2,7 +2,6 @@ version = [1, 0] # use simple file write [adsp] name = "rn" -machine_id = 14 [[adsp.mem_zone]] type = "IRAM" diff --git a/config/skl.toml b/config/skl.toml index 7bde4f8c68e8..a907a121d74c 100644 --- a/config/skl.toml +++ b/config/skl.toml @@ -2,7 +2,6 @@ version = [1, 5] [adsp] name = "skl" -machine_id = 7 image_size = "0x200000" # (30 + 2) bank * 64KB [[adsp.mem_zone]] diff --git a/config/sue.toml b/config/sue.toml index c0c4a01fa898..bcf093c70fc3 100644 --- a/config/sue.toml +++ b/config/sue.toml @@ -2,7 +2,6 @@ version = [1, 5] [adsp] name = "sue" -machine_id = 11 image_size = "0x300000" # (47 + 1) bank * 64KB exec_boot_ldr = 1 diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 8f5316fbb093..62448e347d73 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -2,7 +2,6 @@ version = [2, 5] [adsp] name = "tgl" -machine_id = 10 image_size = "0x2F0000" [[adsp.mem_zone]] diff --git a/config/tgl-h.toml b/config/tgl-h.toml index b6653b2b7afd..908c3bfc8a1f 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -2,7 +2,6 @@ version = [2, 5] [adsp] name = "tgl" -machine_id = 10 image_size = "0x1F0000" # (30 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/config/tgl.toml b/config/tgl.toml index a095b33c59da..d6183faf5345 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -2,7 +2,6 @@ version = [2, 5] [adsp] name = "tgl" -machine_id = 10 image_size = "0x2F0000" # (46 + 1) bank * 64KB [[adsp.mem_zone]] diff --git a/src/adsp_config.c b/src/adsp_config.c index 6bbb1273642f..6d0346f5a16b 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -287,7 +287,6 @@ static void dump_adsp(const struct adsp *adsp) DUMP("\nadsp"); DUMP_KEY("name", "'%s'", adsp->name); - DUMP_KEY("machine_id", "%d", adsp->machine_id); DUMP_KEY("image_size", "0x%x", adsp->image_size); DUMP_KEY("dram_offset", "0x%x", adsp->dram_offset); DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); @@ -333,10 +332,6 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return err_key_parse("name", NULL); - out->machine_id = parse_uint32_key(adsp, &ctx, "machine_id", -1, &ret); - if (ret < 0) - return ret; - out->image_size = parse_uint32_hex_key(adsp, &ctx, "image_size", 0, &ret); if (ret < 0) return ret; @@ -2110,7 +2105,8 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("adsp", NULL); - if (out->machine_id == MACHINE_SUECREEK) { + /* suecreek has dedicated manifest file */ + if (!strcmp(out->name, "sue")) { /* out free is done in client code */ out->man_v1_5_sue = malloc(sizeof(struct fw_image_manifest_v1_5_sue)); if (!out->man_v1_5_sue) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 75ce5dd8b8c0..dc25eb037101 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -24,27 +24,6 @@ struct adsp; struct manifest; struct man_module; -/* list of supported targets */ -enum machine_id { - MACHINE_BAYTRAIL = 0, - MACHINE_CHERRYTRAIL, - MACHINE_BRASWELL, - MACHINE_HASWELL, - MACHINE_BROADWELL, - MACHINE_APOLLOLAKE, - MACHINE_KABYLAKE, - MACHINE_SKYLAKE, - MACHINE_CANNONLAKE, - MACHINE_ICELAKE, - MACHINE_TIGERLAKE, - MACHINE_SUECREEK, - MACHINE_IMX8, - MACHINE_IMX8X, - MACHINE_IMX8M, - MACHINE_MT8195, - MACHINE_MAX -}; - /* * ELF module data */ @@ -171,7 +150,6 @@ struct adsp { uint32_t image_size; uint32_t dram_offset; - enum machine_id machine_id; int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); From de9177b841255816f501f8ffc4853775bbeb9696 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@intel.com> Date: Tue, 31 Aug 2021 11:14:01 +0200 Subject: [PATCH 197/639] config: Adjust return type with function name Function with `parse_uint32` should return uint32_t value Signed-off-by: Karol Trzcinski <karolx.trzcinski@intel.com> --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 6d0346f5a16b..8af6c911ac9f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -169,8 +169,8 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx * @param error code, 0 when success * @return default, parsed, or UINT32_MAX value */ -static int parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - int64_t def, int *error) +static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error) { toml_raw_t raw; int64_t val; From ada30c15b5d365d621125c4b4419a8ae7fb6342f Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 18:13:53 +0200 Subject: [PATCH 198/639] config: Explicit state return value for error cases in parse_uint32_* functions Developer should know what is ther return value for error cases. Improved doxydoc may be used eg. by IDE to speed-up code development. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 8af6c911ac9f..9cd3805a40e9 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -119,7 +119,7 @@ static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx * @param key field name * @param def is default value or -1 when value don't have default value * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value + * @return default, parsed, or UINT32_MAX value for error cases */ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, int64_t def, int *error) @@ -167,7 +167,7 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx * @param key field name * @param def is default value or -1 when value don't have default value * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value + * @return default, parsed, or UINT32_MAX value for error cases */ static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, int64_t def, int *error) From 3e20076f979830e7bdf615bad7d3643680cf7398 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Tue, 31 Aug 2021 18:10:04 +0200 Subject: [PATCH 199/639] config: Return error value in parse_uint32_* functions when key is not found Return value, for error case should be unified. For those functions, default error value is UINT32_MAX. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/adsp_config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index 9cd3805a40e9..c97817716921 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -134,6 +134,7 @@ static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx if (!raw) { if (def < 0 || def > UINT32_MAX) { *error = err_key_not_found(key); + return UINT32_MAX; } else { *error = 0; return (uint32_t)def; @@ -181,6 +182,7 @@ static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ct if (!raw) { if (def < 0 || def > UINT32_MAX) { *error = err_key_not_found(key); + return UINT32_MAX; } else { *error = 0; return (uint32_t)def; From fc4d7b8519e4ca3c7cf9eb51e6ab2d8ac6ada988 Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Wed, 1 Sep 2021 08:33:33 +0200 Subject: [PATCH 200/639] rimage: Fix error message content after adsp malloc fail Message should reflect error root cause. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index c74c462401c7..b0fc9cd4dcfb 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) /* find machine */ heap_adsp = malloc(sizeof(struct adsp)); if (!heap_adsp) { - fprintf(stderr, "error: cannot parse build version\n"); + fprintf(stderr, "error: memory allocation for adsp struct failed\n"); return -ENOMEM; } image.adsp = heap_adsp; From dcfcef80cbd454eb33fdeaae2f8b600e0693238c Mon Sep 17 00:00:00 2001 From: Karol Trzcinski <karolx.trzcinski@linux.intel.com> Date: Wed, 1 Sep 2021 08:19:22 +0200 Subject: [PATCH 201/639] config: Remove unused, platform specific, memory region definitions After commit 916fc2cd73ff: "config: Remove unused adsp structs" those defines are unused. Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com> --- src/file_simple.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/src/file_simple.c b/src/file_simple.c index 43aa175c3e70..3c344968e00d 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -11,50 +11,6 @@ #include <rimage/rimage.h> #include <rimage/manifest.h> -#define BYT_IRAM_BASE 0xff2c0000 -#define BYT_IRAM_HOST_OFFSET 0x0C0000 -#define BYT_IRAM_SIZE (80 * 1024) -#define BYT_DRAM_BASE 0xff300000 -#define BYT_DRAM_HOST_OFFSET 0x100000 -#define BYT_DRAM_SIZE (160 * 1024) - -#define HSW_IRAM_BASE 0x00000000 -#define HSW_IRAM_HOST_OFFSET 0x00080000 -#define HSW_IRAM_SIZE (384 * 1024) -#define HSW_DRAM_BASE 0x00400000 -#define HSW_DRAM_HOST_OFFSET 0x00000000 -#define HSW_DRAM_SIZE (512 * 1024) - -#define BDW_IRAM_BASE 0x00000000 -#define BDW_IRAM_HOST_OFFSET 0x000A0000 -#define BDW_IRAM_SIZE (320 * 1024) -#define BDW_DRAM_BASE 0x00400000 -#define BDW_DRAM_HOST_OFFSET 0x00000000 -#define BDW_DRAM_SIZE (640 * 1024) - -#define IMX8_IRAM_BASE 0x596f8000 -#define IMX8_IRAM_HOST_OFFSET 0x10000 -#define IMX8_IRAM_SIZE 0x800 -#define IMX8_DRAM_BASE 0x596e8000 -#define IMX8_DRAM_SIZE 0x8000 -#define IMX8_SRAM_BASE 0x92400000 -#define IMX8_SRAM_SIZE 0x800000 - -#define IMX8M_IRAM_BASE 0x3b6f8000 -#define IMX8M_IRAM_HOST_OFFSET 0x10000 -#define IMX8M_IRAM_SIZE 0x800 -#define IMX8M_DRAM_BASE 0x3b6e8000 -#define IMX8M_DRAM_SIZE 0x8000 -#define IMX8M_SRAM_BASE 0x92400000 -#define IMX8M_SRAM_SIZE 0x800000 - -#define MT8195_IRAM_BASE 0x40000000 -#define MT8195_IRAM_HOST_OFFSET 0x00000 -#define MT8195_IRAM_SIZE 0x4000 -#define MT8195_SRAM_BASE 0x60000000 -#define MT8195_SRAM_SIZE 0x600000 -#define MT8195_SRAM_HOST_OFFSET 0x00000 - static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; From 4823e87f29d96f95704e2334fc2fa7b65c09a5fa Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 2 Sep 2021 21:27:43 +0000 Subject: [PATCH 202/639] pkcs: quote the name of key file when logging it This makes is more obvious when the filename is empty, which happened in bug https://github.com/thesofproject/sof/pull/4711 Also prefix identical log statements with their different __func__ names. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/pkcs1_5.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 966ef2222aa6..9b23a54db1a7 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -92,7 +92,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " pkcs: signing with key %s\n", path); + fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", @@ -187,7 +187,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " pkcs: signing with key %s\n", path); + fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", @@ -281,7 +281,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " pkcs: PSS signing with key %s\n", path); + fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", From 241af313dab49db06d6e6f0af3330f1a916de664 Mon Sep 17 00:00:00 2001 From: Marcin Rajwa <marcin.rajwa@linux.intel.com> Date: Sat, 11 Sep 2021 19:22:25 +0200 Subject: [PATCH 203/639] ext_manifest: Fix incorrect signature This patch changes the incorrect signature of extended manifest to the correct one "$AE1" Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> --- src/include/rimage/sof/kernel/ext_manifest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/rimage/sof/kernel/ext_manifest.h b/src/include/rimage/sof/kernel/ext_manifest.h index 7d9b77735a11..e415d486fafb 100644 --- a/src/include/rimage/sof/kernel/ext_manifest.h +++ b/src/include/rimage/sof/kernel/ext_manifest.h @@ -33,8 +33,8 @@ #define __packed __attribute__((packed)) #endif -/* In ASCII `XMan` */ -#define EXT_MAN_MAGIC_NUMBER 0x6e614d58 +/* In ASCII `$AE1` */ +#define EXT_MAN_MAGIC_NUMBER 0x31454124 /* Build u32 number in format MMmmmppp */ #define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \ From a9faf85fe50fb01c7aa6d86607142ed5c60936c8 Mon Sep 17 00:00:00 2001 From: Marcin Rajwa <marcin.rajwa@linux.intel.com> Date: Tue, 14 Sep 2021 09:12:49 +0200 Subject: [PATCH 204/639] remove '-x' option This patch removes the unnecessary and unscalable -x option. This option aims to add an offset to the .data section of its parent .module section. This is horrible idea because this offset will vary depend on the compiler used. It is better and much easier to just store only the .data section so the offset is always 0. Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com> --- src/include/rimage/rimage.h | 1 - src/manifest.c | 7 +------ src/rimage.c | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index dc25eb037101..e6d38ebedb10 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -84,7 +84,6 @@ struct image { struct module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ int meu_offset; - int xcc_mod_offset; const char *verify_file; /* SHA 256 & 384 */ diff --git a/src/manifest.c b/src/manifest.c index f29355b66dbf..1bf10d9b60a6 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -264,12 +264,7 @@ static int man_get_module_manifest(struct image *image, struct module *module, section = &module->section[man_section_idx]; /* load in manifest data */ - /* module built using xcc has preceding bytes */ - if (section->size > sizeof(sof_mod)) - ret = fseek(module->fd, - section->off + image->xcc_mod_offset, SEEK_SET); - else - ret = fseek(module->fd, section->off, SEEK_SET); + ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: can't seek to section %d\n", ret); diff --git a/src/rimage.c b/src/rimage.c index b0fc9cd4dcfb..e30a4092ab2f 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,7 +26,6 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); - fprintf(stdout, "\t -x set xcc module offset\n"); fprintf(stdout, "\t -f firmware version = x.y\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); @@ -45,8 +44,6 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - image.xcc_mod_offset = DEFAULT_XCC_MOD_OFFSET; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:")) != -1) { switch (opt) { case 'o': @@ -70,9 +67,6 @@ int main(int argc, char *argv[]) case 'i': imr_type = atoi(optarg); break; - case 'x': - image.xcc_mod_offset = atoi(optarg); - break; case 'f': image.fw_ver_string = optarg; break; From 6e22944e05ea7c6d6c2b61e9632bdbf017644323 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 16 Sep 2021 23:09:29 +0000 Subject: [PATCH 205/639] README.md: explain how to run SOF tests on new rimage code Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/README.md b/README.md index 8118edeaaf4b..f8d099e0bf1a 100644 --- a/README.md +++ b/README.md @@ -15,3 +15,77 @@ $ make -C build/ help # lists all targets $ make -C build/ $ sudo make -C build/ install # optional ``` + +## Testing rimage changes with SOF Continuous Integration + +This section is about leveraging SOF validation to test rimage changes +_before_ submitting them to the rimage repository. + +Nothing here is actually specific to SOF and rimage; you can apply the +same test logic to any submodule and parent on Github. In fact the same +logic applies to submodule alternatives. Github is the only requirement. + +### Get familiar with git submodules + +This is unfortunately not optional for SOF and rimage. + +For various reasons submodules seem to confuse many git users. Maybe +because the versions of the submodules are not directly visible in some +configuration file like with most alternatives? Either way, an +unfortunate prerequisite before doing any rimage work is to get familiar +with git submodules in general. As submodules are built-in there are +many resources about them on the Internet. One possible starting point +is https://git-scm.com/book/en/v2/Git-Tools-Submodules but feel free +to use any other good tutorial instead. Make sure you actually practice +a tutorial; don't just read it. Practicing on a temporary and throw-away +copy of SOF + rimage is a great idea. + +Obviously, you also need to be familiar with regular Github pull +requests. + +### Run SOF tests on unmerged rimage commits + +First, push the rimage commits you want to be tested to any branch of +your rimage fork on Github. Do _not_ submit an rimage pull request yet. + +Then, **pretend** these rimage commits have already been accepted and +merged (they have been neither) and submit to SOF a draft pull request +that updates the main SOF branch with your brand new rimage commits to +test. The only SOF commit in this SOF TEST pull request is an SOF commit +that updates the rimage pointer to the SHA of your last rimage +commit. If you're not sure how to do this then you must go back to the +previous section and practice submodules more. + +Submit this SOF pull request as a Github _draft_ so reviewers are _not_ +notified. Starting every pull request as a draft is always a good idea +but in this case this particular SOF pull request can be especially +confusing because it points at commits in a different repo and commits +that are not merged yet. So you _really_ don't want to bother busy +reviewers (here's a secret: some of the reviewers don't like submodules +either). You can freely switch back and forth between draft and ready +status and should indeed switch to draft if you forgot at submission +time but you can never "un-notify" reviewers. + +Github has very good support for submodules and will display your SOF +TEST pull request better than what the git command line can show. For +instance Github will list your rimage changes directly in the SOF Pull +Request. So if something looks unexpected on Github then it means you +did something wrong. Stop immediately (except for switching to draft if +you forgot) and ask the closest git guru for help. + +Search for "Submodule" in the build logs and make sure the last of your +new rimage commits has been checked out. + +Iterate and force-push your rimage branch and your SOF TEST pull request +until all the SOF tests pass. Then you can submit your rimage pull +request as usual. In the comments section of the rimage pull request, +point at your test results on the SOF side to impress the rimage +reviewers and get your rimage changes merged faster. + +Finally, after your rimage changes have been merged, you can if you want +submit one final SOF pull request that points to the final rimage +SHA. Or, if your rimage change is not urgently needed, you can just wait +for someone else to do it later. If you do it, copy the rimage git log +--oneline in the SOF commit message. Find some good (and less good) +rimage commit message examples at +https://github.com/thesofproject/sof/commits/main/rimage From 0d7f2d4a3428b10cdadd3f30d0bb335a8a2cf824 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 16 Sep 2021 22:44:19 +0000 Subject: [PATCH 206/639] Do not exit(0) on invalid options or parameters When some automation script gets some rimage flag wrong then rimage exits and does not run at all. In such a case we want the build to fail immediately and see the error at the bottom of the build logs and not obscured by other, consecutive failures caused by the lack of rimage output. Take control of the exit code away from usage() and give it back to main() where it belongs. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/rimage.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index e30a4092ab2f..507911ca469d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -30,7 +30,6 @@ static void usage(char *name) fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); - exit(0); } int main(int argc, char *argv[]) @@ -84,10 +83,10 @@ int main(int argc, char *argv[]) break; case 'h': usage(argv[0]); - break; + return 0; default: /* getopt's default error message is good enough */ - break; + return 1; } } @@ -95,8 +94,9 @@ int main(int argc, char *argv[]) /* we must have config */ if (!adsp_config) { - fprintf(stderr, "error: must have adsp desc"); usage(argv[0]); + fprintf(stderr, "error: must have adsp desc\n"); + return -EINVAL; } /* requires private key */ @@ -105,10 +105,11 @@ int main(int argc, char *argv[]) return -EINVAL; } - /* make sure we have an outfile if nt verifying */ - if ((!image.out_file && !image.verify_file)) + /* make sure we have an outfile if not verifying */ + if ((!image.out_file && !image.verify_file)) { usage(argv[0]); - + return -EINVAL; + } /* firmware version and build id */ if (image.fw_ver_string) { From 89600974030fcbca903894c327c3c64afcede14d Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 17 Sep 2021 17:11:08 +0000 Subject: [PATCH 207/639] Revert "ext_manifest: Fix incorrect signature" This reverts commit 241af313dab49db06d6e6f0af3330f1a916de664 so the DSP can boot again. On my APL UP2 this fixes: 10:06:38: 00:0e.0: unstall/run core: core_mask = 1 10:06:38: 00:0e.0: DSP core(s) enabled? 1 : core_mask 1 10:06:38: 00:0e.0: FW Poll Status: reg[0x4c]=0x40000000 successful 10:06:38: 00:0e.0: FW Poll Status: reg[0x4]=0x3030202 successful 10:06:38: 00:0e.0: FW Poll Status: reg[0x4]=0x1010202 successful 10:06:38: 00:0e.0: DSP core(s) enabled? 0 : core_mask 2 10:06:38: 00:0e.0: FW Poll Status: reg[0x80000]=0x5000001 successful 10:06:41: 00:0e.0: FW Poll Status: reg[0x80000]=0x80000007 timedout 10:06:41: 00:0e.0: error: cl_copy_fw: timeout HDA_DSP_SRAM_REG_ROM_STATUS read 10:06:41: 00:0e.0: FW Poll Status: reg[0x160]=0x140000 successful 10:06:41: 00:0e.0: ------------[ DSP dump start ]------------ 10:06:41: 00:0e.0: unknown ROM status value 80000007 10:06:41: 00:0e.0: error: extended rom status: 0x80000007 0x2f 0x0 0x0 \ 0x0 0x0 0x1522100 0x0 10:06:41: 00:0e.0: ------------[ DSP dump end ]------------ 10:06:41: 00:0e.0: error: load fw failed ret: -110 10:06:41: 00:0e.0: error: failed to start DSP 10:06:41: 00:0e.0: error: failed to boot DSP firmware -110 10:06:41: 00:0e.0: FW Poll Status: reg[0x4]=0x1d003c timedout 10:06:41: 00:0e.0: error: hda_dsp_core_reset_enter: timeout on \ HDA_DSP_REG_ADSPCS read 10:06:41: 00:0e.0: error: dsp core reset failed: core_mask 3 10:06:41: probe of 0000:00:0e.0 failed with error -110 Test PR https://github.com/thesofproject/sof/pull/4782 show this commit broke the DSP boot on ALL platforms https://sof-ci.01.org/sofpr/PR4782/build10387/devicetest/ ``` [ 7.798750] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: invalid firmware signature [ 7.798827] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: invalid FW header [ 7.798943] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: failed to load DSP firmware -22 [ 7.810348] kernel: sof-audio-acpi-intel-bdw INT3438:00: error: sof_probe_work failed err: -22 ``` This also broke QEMU boot on a number of platforms: BDW, BYT and CHT, see `error: invalid firmware signature` in https://sof-ci.01.org/sofpr/PR4782/build10387/boottest/ and https://github.com/thesofproject/sof/pull/4782/checks?check_run_id=3634915322 How was it tested? Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/include/rimage/sof/kernel/ext_manifest.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/rimage/sof/kernel/ext_manifest.h b/src/include/rimage/sof/kernel/ext_manifest.h index e415d486fafb..7d9b77735a11 100644 --- a/src/include/rimage/sof/kernel/ext_manifest.h +++ b/src/include/rimage/sof/kernel/ext_manifest.h @@ -33,8 +33,8 @@ #define __packed __attribute__((packed)) #endif -/* In ASCII `$AE1` */ -#define EXT_MAN_MAGIC_NUMBER 0x31454124 +/* In ASCII `XMan` */ +#define EXT_MAN_MAGIC_NUMBER 0x6e614d58 /* Build u32 number in format MMmmmppp */ #define EXT_MAN_BUILD_VERSION(MAJOR, MINOR, PATH) ( \ From c038d628048bae44040a0f86be17f101c0037570 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 21 Sep 2021 20:37:47 +0000 Subject: [PATCH 208/639] README.md: add warning that forks must be created using Github Otherwise the SHA1 is not found and the rest of the process fails. Problem discovered in https://github.com/thesofproject/sof/pull/4790#discussion_r713326709 Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8d099e0bf1a..de6556334468 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ to generate binary image files. ## Building -The `rimage` tool can be built with the usual CMake commands: +Most users don't build `rimage` directly but as an ExternalProject +defined by CMake in SOF. This being said, `rimage` can be built with the +usual CMake commands: ```shell $ cmake -B build/ @@ -48,6 +50,12 @@ requests. First, push the rimage commits you want to be tested to any branch of your rimage fork on Github. Do _not_ submit an rimage pull request yet. +Note your rimage fork must have been created using the actual "fork" +button on Github so Github is aware of the connection with the upstream +rimage repo. In the top-left corner you should see `forked from +thesofproject/rimage` under the name of your fork. If not then search +the Internet for "re-attach detached github fork". + Then, **pretend** these rimage commits have already been accepted and merged (they have been neither) and submit to SOF a draft pull request that updates the main SOF branch with your brand new rimage commits to From 0c66aa912226c4e7b9151e50a5e3a9b6abc29117 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 4 Oct 2021 18:27:30 +0000 Subject: [PATCH 209/639] css.c: add __func__ to "completing manifest" log This is useful to show which one of the 3 duplicated functions runs. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/css.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/css.c b/src/css.c index c86148b89015..92f6ea89fd93 100644 --- a/src/css.c +++ b/src/css.c @@ -19,7 +19,7 @@ void ri_css_v2_5_hdr_create(struct image *image) time_t seconds; int val; - fprintf(stdout, " cse: completing CSS manifest\n"); + fprintf(stdout, " cse: %s completing CSS manifest\n", __func__); /* get local time and date */ gettimeofday(&tv, NULL); @@ -76,7 +76,7 @@ void ri_css_v1_8_hdr_create(struct image *image) time_t seconds; int val; - fprintf(stdout, " cse: completing CSS manifest\n"); + fprintf(stdout, " cse: %s completing CSS manifest\n", __func__); /* get local time and date */ gettimeofday(&tv, NULL); @@ -133,7 +133,7 @@ void ri_css_v1_5_hdr_create(struct image *image) time_t seconds; int val; - fprintf(stdout, " cse: completing CSS manifest\n"); + fprintf(stdout, " cse: %s completing CSS manifest\n", __func__); /* get local time and date */ gettimeofday(&tv, NULL); From ecb921227e88a8797bf2f2719bcc99411b32323f Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Sun, 24 Oct 2021 08:04:42 +0000 Subject: [PATCH 210/639] cmake: drop '3' from -Wimplicit-fallthrough=3, it's the default value From the gcc documentation: '-Wimplicit-fallthrough' '-Wimplicit-fallthrough' is the same as '-Wimplicit-fallthrough=3' and '-Wno-implicit-fallthrough' is the same as '-Wimplicit-fallthrough=0'. clang supports only the number-less option. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b09760007629..29bbb456e17b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable(rimage ) target_compile_options(rimage PRIVATE - -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough=3 + -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough ) target_link_libraries(rimage PRIVATE "-lcrypto") From bcbcec79e5824d04f5eadde2f53d817fce939b19 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Sun, 24 Oct 2021 08:08:08 +0000 Subject: [PATCH 211/639] cmake: drop binutils-specific '-Wl,-EL' option Fixes clang failure: clang: error: -Wl,-EL: 'linker' input unused [-Werror,-Wunused-command-line-argument] -EL has an effect only when using OUTPUT_FORMAT or --oformat but rimage uses neither. The binaries produced by ld version 2.34 are strictly identical before and after this removal. It is not clear why -EL was ever added. It was added to src/Makefile.am by commit 0d33e8743386 and to src/CMakeLists.txt by commit 4e3ead009638 but these commits were initial additions of the entire files and they did not get into detail. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29bbb456e17b..056a92217474 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ add_executable(rimage ) target_compile_options(rimage PRIVATE - -Wall -Werror -Wl,-EL -Wmissing-prototypes -Wimplicit-fallthrough + -Wall -Werror -Wmissing-prototypes -Wimplicit-fallthrough ) target_link_libraries(rimage PRIVATE "-lcrypto") From bd51ec1aef445d8f3962d9c0cb28112717cfcc7d Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Tue, 16 Nov 2021 09:50:21 +0200 Subject: [PATCH 212/639] rimage: add functionality to resign fw image Add function to resign already signed images. This can be done with switch "q" as follows: "rimage -q sof-tgl.ri -o sof-tgl-mod.ri -c tgl.toml -k key.pem" Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/include/rimage/rimage.h | 4 ++ src/manifest.c | 124 ++++++++++++++++++++++++++++++++++++ src/pkcs1_5.c | 35 ++++++++++ src/rimage.c | 11 +++- 4 files changed, 173 insertions(+), 1 deletion(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e6d38ebedb10..e5b918e3c600 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -73,6 +73,7 @@ struct module { struct image { const char *out_file; + const char *in_file; FILE *out_fd; void *pos; @@ -201,6 +202,9 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int resign_image(struct image *image); +int get_key_size(struct image *image); + int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); diff --git a/src/manifest.c b/src/manifest.c index 1bf10d9b60a6..e682503b179b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1427,3 +1427,127 @@ int verify_image(struct image *image) fclose(in_file); return 0; } + + +int resign_image(struct image *image) +{ + int key_size, key_file_size; + size_t size, read; + FILE *in_file; + void *buffer; + int ret, i; + + /* open image for reading */ + in_file = fopen(image->in_file, "rb"); + if (!in_file) { + fprintf(stderr, "error: unable to open %s for reading %d\n", + image->in_file, errno); + return -errno; + } + + /* get file size */ + ret = fseek(in_file, 0, SEEK_END); + if (ret < 0) { + fprintf(stderr, "error: unable to seek eof %s for reading %d\n", + image->verify_file, errno); + ret = -errno; + goto out; + } + + size = ftell(in_file); + if (size < 0) { + fprintf(stderr, "error: unable to get file size for %s %d\n", + image->verify_file, errno); + ret = -errno; + goto out; + } + + ret = fseek(in_file, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: unable to seek %s for reading %d\n", + image->verify_file, errno); + ret = -errno; + goto out; + } + + /* allocate buffer for parsing */ + buffer = malloc(size); + if (!buffer) { + ret = -ENOMEM; + goto out; + } + + /* read file into buffer */ + read = fread(buffer, 1, size, in_file); + if (read != size) { + fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", + size, image->in_file, errno); + ret = errno; + goto out; + } + + fclose(in_file); + + for (i = 0; i < size; i += sizeof(uint32_t)) { + /* find CSE header marker "$CPD" */ + if (*(uint32_t *)(buffer + i) == CSE_HEADER_MAKER) { + image->fw_image = buffer + i; + break; + } + } + + if (i >= size) { + fprintf(stderr, "error: didn't found header marker %d\n", i); + ret = -EINVAL; + goto out; + } + + image->image_end = size; + + /* check that key size matches */ + if (image->adsp->man_v2_5) { + key_size = 384; + } else { + key_size = 256; + } + + key_file_size = get_key_size(image); + + if (key_file_size > key_size) { + fprintf(stderr, "error: key size %d is longer than original key %d\n", + key_file_size, key_size); + ret = -EINVAL; + goto out; + } + + /* resign */ + if (image->adsp->man_v1_5) + ret = ri_manifest_sign_v1_5(image); + else if (image->adsp->man_v1_8) + ret = ri_manifest_sign_v1_8(image); + else if (image->adsp->man_v2_5) + ret = ri_manifest_sign_v2_5(image); + else + ret = -EINVAL; + + if (ret < 0) { + fprintf(stderr, "error: unable to sign image\n"); + goto out; + } + + /* open outfile for writing */ + unlink(image->out_file); + image->out_fd = fopen(image->out_file, "wb"); + if (!image->out_fd) { + fprintf(stderr, "error: unable to open %s for writing %d\n", + image->out_file, errno); + ret = -EINVAL; + goto out; + } + + man_write_fw_mod(image); + +out: + free(buffer); + return ret; +} diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 9b23a54db1a7..c4be1856ea2e 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -694,3 +694,38 @@ int ri_manifest_verify_v2_5(struct image *image) return pkcs_v1_5_verify_man_v2_5(image, man, data1, size1, data2, size2); } + +int get_key_size(struct image *image) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + int key_length; + char path[256]; + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + key_length = RSA_size(priv_rsa); + + RSA_free(priv_rsa); + EVP_PKEY_free(privkey); + + return key_length; +} diff --git a/src/rimage.c b/src/rimage.c index 507911ca469d..67710d9f360e 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -30,6 +30,7 @@ static void usage(char *name) fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); + fprintf(stdout, "\t -q resign binary\n"); } int main(int argc, char *argv[]) @@ -43,7 +44,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:q:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -84,6 +85,9 @@ int main(int argc, char *argv[]) case 'h': usage(argv[0]); return 0; + case 'q': + image.in_file = optarg; + break; default: /* getopt's default error message is good enough */ return 1; @@ -152,6 +156,11 @@ int main(int argc, char *argv[]) goto out; } + if (image.in_file) { + fprintf(stdout, "going to re-sign\n"); + return resign_image(&image); + } + /* set IMR Type in found machine definition */ if (image.adsp->man_v1_8) image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; From 3c232422a7389c04171b38caf8263c192f9b6760 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Wed, 24 Nov 2021 15:34:46 +0200 Subject: [PATCH 213/639] rimage: refactor and add openssl 3.0 support Refactor the signing and verification functions as they have a lot of duplicated code and adding openssl 3.0 support without refactor would make things even more messy. 1) Add common "rimage_read_key" to read the key from file. 2) Variate most important functionality based on different openssl versions: - rimage_check_key - rimage_set_modexp - rimage_sign - rimage_verify - rimage_get_key_size Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/pkcs1_5.c | 740 +++++++++++++++++++++++++++++++------------------- 1 file changed, 465 insertions(+), 275 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index c4be1856ea2e..0d704e96b3de 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -13,6 +13,9 @@ #include <openssl/sha.h> #include <openssl/objects.h> #include <openssl/bn.h> +#if OPENSSL_VERSION_NUMBER >= 0x30000000L +#include <openssl/core_names.h> +#endif #include <stdio.h> #include <errno.h> #include <string.h> @@ -21,24 +24,14 @@ #include <rimage/css.h> #include <rimage/manifest.h> -#if OPENSSL_VERSION_NUMBER < 0x10100000L -void RSA_get0_key(const RSA *r, - const BIGNUM **n, const BIGNUM **e, const BIGNUM **d); - -void RSA_get0_key(const RSA *r, - const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) -{ - if (n) - *n = r->n; - if (e) - *e = r->e; - if (d) - *d = r->d; -} -#endif - #define DEBUG_PKCS 0 +enum manver { + V15 = 0, + V18 = 1, + V25 = 2 +}; + static void bytes_swap(uint8_t *ptr, uint32_t size) { uint8_t tmp; @@ -51,60 +44,423 @@ static void bytes_swap(uint8_t *ptr, uint32_t size) } } -/* - * RSA signature of manifest. The signature is an PKCS - * #1-v1_5 of the entire manifest structure, including all - * extensions, and excluding the last 3 fields of the - * manifest header (Public Key, Exponent and Signature). - */ - -int pkcs_v1_5_sign_man_v1_5(struct image *image, - struct fw_image_manifest_v1_5 *man, - void *ptr1, unsigned int size1) +static int rimage_read_key(EVP_PKEY **privkey, struct image *image) { - RSA *priv_rsa = NULL; - EVP_PKEY *privkey; - FILE *fp; - - const BIGNUM *n, *e, *d; - unsigned char digest[SHA256_DIGEST_LENGTH]; - unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; char path[256]; - int ret = -EINVAL, i; - -#if DEBUG_PKCS - fprintf(stdout, "offsets 0x%lx size 0x%x\n", - ptr1 - (void *)man, size1); -#endif + FILE *fp; /* requires private key */ if (!image->key_name) { + fprintf(stderr, "error: no private key set \n"); return -EINVAL; } /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) + *privkey = EVP_PKEY_new(); + if (!(*privkey)) return -ENOMEM; /* load in RSA private key from PEM file */ memset(path, 0, sizeof(path)); strncpy(path, image->key_name, sizeof(path) - 1); - fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); + fprintf(stdout, " %s: read key '%s'\n", __func__, path); fp = fopen(path, "rb"); if (!fp) { fprintf(stderr, "error: can't open file %s %d\n", path, -errno); return -errno; } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + PEM_read_PrivateKey(fp, privkey, NULL, NULL); fclose(fp); - /* validate RSA private key */ + return 0; +} + +/* + * Here we have different implementations of following functionality + * (based on different openssl versions): + * + * rimage_check_key + * + * rimage_set_modexp + * + * rimage_sign + * + * rimage_verify + * + * rimage_get_key_size + * +*/ + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_check_key(EVP_PKEY *privkey) +{ + RSA *priv_rsa = NULL; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + return RSA_check_key(priv_rsa); +} +#else +static int rimage_check_key(EVP_PKEY *privkey) +{ + EVP_PKEY_CTX *ctx; + int ret = 0; + + ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -EINVAL; + + ret = EVP_PKEY_private_check(ctx); + + EVP_PKEY_CTX_free(ctx); + + return ret; +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x10100000L +static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) +{ + const BIGNUM *n; + const BIGNUM *e; + const BIGNUM *d; + + *n = r->n; + *e = r->e; + *d = r->d; + + BN_bn2bin(n, mod); + BN_bn2bin(e, exp); +} +#elif OPENSSL_VERSION_NUMBER < 0x30000000L +static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) +{ + const BIGNUM *n; + const BIGNUM *e; + const BIGNUM *d; + RSA *priv_rsa = NULL; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + RSA_get0_key(priv_rsa, &n, &e, &d); + + BN_bn2bin(n, mod); + BN_bn2bin(e, exp); +} +#else +static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) +{ + BIGNUM *n = NULL; + BIGNUM *e = NULL; + + EVP_PKEY_get_bn_param(privkey, OSSL_PKEY_PARAM_RSA_N, &n); + EVP_PKEY_get_bn_param(privkey, OSSL_PKEY_PARAM_RSA_E, &e); + + BN_bn2bin(n, mod); + BN_bn2bin(e, exp); +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + RSA *priv_rsa = NULL; + int ret; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + switch (ver) { + case V15: + /* fallthrough */ + case V18: + ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + signature, &siglen, priv_rsa); + break; + case V25: + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest, image->md, + /* salt length */ 32); + if (ret > 0) + ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, signature, priv_rsa, + RSA_NO_PADDING); + break; + default: + return -EINVAL; + } + + return ret; +} +#else +static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY_CTX *ctx2 = NULL; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + size_t siglen = MAN_RSA_SIGNATURE_LEN; + size_t sig_in = MAN_RSA_SIGNATURE_LEN_2_5; + size_t sig_out = MAN_RSA_SIGNATURE_LEN_2_5; + int ret; + + ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_sign_init(ctx); + if (ret <= 0) + goto out; + + if (ver == V25) { + ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); + if (ret <= 0) { + fprintf(stderr, "error: failed to set rsa padding\n"); + goto out; + } + + ret = EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, 32); + if (ret <= 0) { + fprintf(stderr, "error: failed to set saltlen\n"); + goto out; + } + + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); + if (ret <= 0) { + fprintf(stderr, "error: failed to set signature\n"); + goto out; + } + + ret = EVP_PKEY_sign(ctx, sig, &sig_in, digest, SHA384_DIGEST_LENGTH); + if (ret <= 0) { + fprintf(stderr, "error: failed to sign manifest\n"); + goto out; + } + + /* encryption done with different context */ + ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_encrypt_init(ctx2); + if (ret <= 0) + goto out; + + ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); + if (ret <= 0) { + fprintf(stderr, "error: failed to set 0 padding \n"); + goto out; + } + + ret = EVP_PKEY_encrypt(ctx2, signature, &sig_out, sig, sig_in); + if (ret <= 0) + fprintf(stderr, "error: failed to encrypt signature\n"); + } + else { + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); + if (ret <= 0) { + fprintf(stderr, "error: failed to set signature\n"); + goto out; + } + + ret = EVP_PKEY_sign(ctx, signature, &siglen, digest, SHA256_DIGEST_LENGTH); + if (ret <= 0) + fprintf(stderr, "error: failed to sign manifest\n"); + } + +out: + EVP_PKEY_CTX_free(ctx); + if (ctx2) + EVP_PKEY_CTX_free(ctx2); + + return ret; +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + unsigned int siglen = MAN_RSA_SIGNATURE_LEN; + RSA *priv_rsa = NULL; + char err_buf[256]; + int ret; + + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + switch (ver) { + case V15: + /* fallthrough */ + case V18: + ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, signature, siglen, + priv_rsa); + + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + break; + case V25: + /* decrypt signature */ + ret = RSA_public_decrypt(RSA_size(priv_rsa), signature, sig, priv_rsa, + RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify decrypt %s\n", err_buf); + return ret; + } + + ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + break; + default: + return -EINVAL; + } + + return ret; +} +#else +static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, + unsigned char *digest, unsigned char *signature) +{ + EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY_CTX *ctx2 = NULL; + size_t siglen = MAN_RSA_SIGNATURE_LEN; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + size_t siglen25 = MAN_RSA_SIGNATURE_LEN_2_5; + char err_buf[256]; + int ret; + + ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_verify_init(ctx); + if (ret <= 0) + goto out; + + switch (ver) { + case V15: + /* fallthrough */ + case V18: + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: set signature %s\n", err_buf); + goto out; + } + + ret = EVP_PKEY_verify(ctx, signature, siglen, digest, SHA256_DIGEST_LENGTH); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + + break; + case V25: + ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); + if (ret <= 0) + goto out; + + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); + if (ret <= 0) + goto out; + + /* decrypt signature */ + ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); + if (!ctx) + return -ENOMEM; + + ret = EVP_PKEY_decrypt_init(ctx2); + if (ret <= 0) + goto out; + + ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: set padding %s\n", err_buf); + goto out; + } + + ret = EVP_PKEY_decrypt(ctx2, sig, &siglen25, signature, siglen25); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: decrypt %s\n", err_buf); + goto out; + } + + ret = EVP_PKEY_verify(ctx, sig, siglen25, digest, SHA384_DIGEST_LENGTH); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + + break; + default: + return -EINVAL; + } + +out: + EVP_PKEY_CTX_free(ctx); + if (ctx2) + EVP_PKEY_CTX_free(ctx2); + + return ret; +} +#endif + +#if OPENSSL_VERSION_NUMBER < 0x30000000L +static int rimage_get_key_size(EVP_PKEY *privkey) +{ + RSA *priv_rsa = NULL; + int key_length; + priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + key_length = RSA_size(priv_rsa); + + RSA_free(priv_rsa); + + return key_length; +} +#else +static int rimage_get_key_size(EVP_PKEY *privkey) +{ + return EVP_PKEY_get_size(privkey); +} +#endif + +/* + * RSA signature of manifest. The signature is an PKCS + * #1-v1_5 of the entire manifest structure, including all + * extensions, and excluding the last 3 fields of the + * manifest header (Public Key, Exponent and Signature). + */ + +int pkcs_v1_5_sign_man_v1_5(struct image *image, + struct fw_image_manifest_v1_5 *man, + void *ptr1, unsigned int size1) +{ + EVP_PKEY *privkey; + unsigned char digest[SHA256_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1); +#endif + + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; + + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -122,16 +478,16 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css_header.signature, - &siglen, priv_rsa); - if (ret < 0) + ret = rimage_sign(privkey, image, V15, digest, + (unsigned char *)man->css_header.signature); + + if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); + return ret; + } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css_header.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css_header.exponent); /* modulus is reveresd */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) @@ -158,14 +514,9 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - const BIGNUM *n, *e, *d; unsigned char digest[SHA256_DIGEST_LENGTH]; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -173,33 +524,12 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -218,16 +548,15 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css.signature, - &siglen, priv_rsa); - if (ret < 0) + ret = rimage_sign(privkey, image, V18, digest, + (unsigned char *)man->css.signature); + if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); + return ret; + } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css.exponent); /* modulus is reveresd */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN; i++) @@ -252,14 +581,9 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - const BIGNUM *n, *e, *d; unsigned char digest[SHA384_DIGEST_LENGTH]; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -267,33 +591,12 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new PSS key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " %s: signing with key '%s'\n", __func__, path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -312,25 +615,15 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, - digest, image->md, /* salt length */ 32); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to sign manifest %s\n", path); - } - - /* encrypt the signature using the private key */ - ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, - (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + ret = rimage_sign(privkey, image, V25, digest, + (unsigned char *)man->css.signature); if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to encrypt signature %s\n", path); + fprintf(stderr, "error: failed to sign manifest\n"); + return ret; } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css.exponent); /* modulus is reversed */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) @@ -399,12 +692,8 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, void *ptr1, unsigned int size1) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; unsigned char digest[SHA256_DIGEST_LENGTH]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -412,33 +701,12 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, ptr1 - (void *)man, size1); #endif - /* requires private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: verify with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -459,14 +727,12 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, bytes_swap(man->css_header.signature, sizeof(man->css_header.signature)); - /* sign the manifest */ - ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css_header.signature, - siglen, priv_rsa); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to verify manifest %s\n", path); - } else + /* verify */ + ret = rimage_verify(privkey, image, V15, digest, + (unsigned char *)man->css_header.signature); + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else fprintf(stdout, "pkcs: signature is valid !\n"); @@ -486,12 +752,8 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; unsigned char digest[SHA256_DIGEST_LENGTH]; - unsigned int siglen = MAN_RSA_SIGNATURE_LEN; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -499,33 +761,12 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: verifying with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -546,14 +787,12 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, /* signature is reveresd, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); - /* sign the manifest */ - ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, - (unsigned char *)man->css.signature, - siglen, priv_rsa); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to verify manifest %s\n", path); - } else + /* verify */ + ret = rimage_verify(privkey, image, V18, digest, + (unsigned char *)man->css.signature); + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else fprintf(stdout, "pkcs: signature is valid !\n"); EVP_PKEY_free(privkey); @@ -572,12 +811,8 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; unsigned char digest[SHA384_DIGEST_LENGTH]; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -585,33 +820,12 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new PSS key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: PSS verify with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -632,19 +846,13 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); - /* decrypt signature */ - ret = RSA_public_decrypt(RSA_size(priv_rsa), (unsigned char *)man->css.signature, - sig, priv_rsa, RSA_NO_PADDING); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to decrypt signature %s\n", path); - } + /* verify */ + ret = rimage_verify(privkey, image, V25, digest, + (unsigned char *)man->css.signature); - ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to verify manifest %s\n", path); - } else + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else fprintf(stdout, "pkcs: signature is valid !\n"); EVP_PKEY_free(privkey); @@ -697,35 +905,17 @@ int ri_manifest_verify_v2_5(struct image *image) int get_key_size(struct image *image) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - int key_length; - char path[256]; + int key_len; + int ret; - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; - priv_rsa = EVP_PKEY_get1_RSA(privkey); - key_length = RSA_size(priv_rsa); + key_len = rimage_get_key_size(privkey); - RSA_free(priv_rsa); EVP_PKEY_free(privkey); - return key_length; + return key_len; } From 0f64a20183a8db9bc39a4044679a51c1cc334f8f Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Wed, 1 Dec 2021 21:48:48 +0200 Subject: [PATCH 214/639] manifest: fix buffer init in resign Set buffer to NULL to prevent freeing bogus memory in error case. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/manifest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/manifest.c b/src/manifest.c index e682503b179b..3639b33a1236 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1432,9 +1432,9 @@ int verify_image(struct image *image) int resign_image(struct image *image) { int key_size, key_file_size; + void *buffer = NULL; size_t size, read; FILE *in_file; - void *buffer; int ret, i; /* open image for reading */ From 32052add9968a22d81ffecc76fe905c042fe02a3 Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Wed, 8 Dec 2021 09:39:38 -0800 Subject: [PATCH 215/639] remove x from getopt x param was removed from switch case but not from getopt. So if you use x rimage silently fails on the switch case. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index 67710d9f360e..3cf02328234f 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -44,7 +44,7 @@ int main(int argc, char *argv[]) memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:x:f:b:ec:y:q:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:")) != -1) { switch (opt) { case 'o': image.out_file = optarg; From 23a53ac8b641ca78679e81ae1bcbff6df37f9ed6 Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Tue, 11 Jan 2022 17:17:48 -0800 Subject: [PATCH 216/639] cse: fix signed integer overflow literals are signed by default, so shifting them 32 times is an overflow, found via cppcheck Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- src/cse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cse.c b/src/cse.c index 85554308601f..19561701281b 100644 --- a/src/cse.c +++ b/src/cse.c @@ -68,7 +68,7 @@ static uint32_t crc32(uint8_t *input, int size, uint32_t poly, uint32_t init, if (rev_out) { t32 = 0; for (i = 0; i < 32; i++) { - if (crc & (1 << i)) + if (crc & (1U << i)) t32 |= (uint32_t)(1 << (31 - i)); } crc = t32; From 3b4b1429b07e9da8ca5000da4f7d3ced2f39da2b Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@linux.intel.com> Date: Wed, 12 Jan 2022 08:09:05 +0200 Subject: [PATCH 217/639] rimage: fix openssl 1.0 support cppcheck gives errors from openssl 1.0 related code that has some old churn and should be fixed, so fix it. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> --- src/pkcs1_5.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 0d704e96b3de..6e3dad8db6ff 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -123,13 +123,14 @@ static int rimage_check_key(EVP_PKEY *privkey) #if OPENSSL_VERSION_NUMBER < 0x10100000L static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned char *exp) { + RSA *priv_rsa = NULL; const BIGNUM *n; const BIGNUM *e; - const BIGNUM *d; - *n = r->n; - *e = r->e; - *d = r->d; + priv_rsa = EVP_PKEY_get1_RSA(privkey); + + n = priv_rsa->n; + e = priv_rsa->e; BN_bn2bin(n, mod); BN_bn2bin(e, exp); From 8753a9e162f75e27f72fe4ae8f38243cd80da07d Mon Sep 17 00:00:00 2001 From: "Trzcinski, Karol" <karol.trzcinski@intel.com> Date: Thu, 13 Jan 2022 13:12:34 +0100 Subject: [PATCH 218/639] Remove unused declaration of global platform specific manifests Such a global variables does not exists, so should not be declared. It has been deprecated since: 2965908 (manifest: Remove -m option) Signed-off-by: Trzcinski, Karol <karol.trzcinski@intel.com> --- src/include/rimage/manifest.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 5e13fd21cd9a..0e06e8f20df2 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -127,8 +127,6 @@ struct fw_image_manifest_v2_5 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); -extern struct fw_image_manifest_v2_5 tgl_manifest; - /* * Firmware manifest header V1.8 used on APL onwards */ @@ -151,9 +149,6 @@ struct fw_image_manifest_v1_8 { struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ } __attribute__((packed)); -extern struct fw_image_manifest_v1_8 apl_manifest; -extern struct fw_image_manifest_v1_8 cnl_manifest; - /* * Firmware manifest header V1.5 used on SKL and KBL */ @@ -166,14 +161,6 @@ struct fw_image_manifest_v1_5_sue { struct sof_man_fw_desc desc; } __attribute__((packed)); -/* - * TODO: verify if we need platform specific manifest, or just - * define manifest_v1_5 and manifest_v1_8. - */ -extern struct fw_image_manifest_v1_5 skl_manifest; -extern struct fw_image_manifest_v1_5 kbl_manifest; -extern struct fw_image_manifest_v1_5_sue sue_manifest; - struct image; int simple_write_firmware(struct image *image); int man_write_fw_v1_5(struct image *image); From ce69d7bad82aa34e0db925f627daf45e275c4221 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrianx.warecki@intel.com> Date: Mon, 17 Jan 2022 10:42:58 +0100 Subject: [PATCH 219/639] adsp_config: fix invalid format specifier This patch fixes an invalid format specifier that causes a numeric value to be interpreted as a string, resulting in an Segmentation fault. Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index c97817716921..2e6f39f6b274 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2023,7 +2023,7 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (strcmp((char *)mod_man->name, "BRNGUP") && strcmp((char *)mod_man->name, "BASEFW")) { if (type != i - 1) { - log_err(ret, "error: invalid type %s", type); + log_err(ret, "error: invalid type %d", type); return -EINVAL; } } From ecb6a6693212ff8733f927e780a1d0e767183dac Mon Sep 17 00:00:00 2001 From: Andrey Borisovich <andrey.borisovich@intel.com> Date: Thu, 20 Jan 2022 15:24:06 +0100 Subject: [PATCH 220/639] Update to C99 standard to match SOF. Silenced warning generated by newest GCC compiler related to int cast of char typed values that may result in negative values. Syntax fix in linkage of crypto library to more generic approach. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 056a92217474..1607b36a8b54 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,11 +24,17 @@ add_executable(rimage tomlc99/toml.c ) +set_property(TARGET rimage PROPERTY C_STANDARD 99) + target_compile_options(rimage PRIVATE -Wall -Werror -Wmissing-prototypes -Wimplicit-fallthrough ) -target_link_libraries(rimage PRIVATE "-lcrypto") +if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 9.1) + target_compile_options(rimage PRIVATE -Wno-char-subscripts) +endif() + +target_link_libraries(rimage PRIVATE crypto) target_include_directories(rimage PRIVATE src/include/ From d855fbfe7c878999ef6bc352a5c410e454be4d59 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 26 Jan 2022 00:12:55 +0000 Subject: [PATCH 221/639] Remove unconditional "(1 || verbose)" debug hack in cavs25 This is especially a problem considering the -v option outputs non-ASCII garbage which can break some automation, see issue #86 Fixes commit db40934e57aa8 ("cavs: add support for cavs2.5 code signing") Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 2e6f39f6b274..5d5aa5a91048 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -627,7 +627,7 @@ static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, hdr->nb_entries = toml_array_nelem(cse_entry_array); - if (1 || verbose) + if (verbose) dump_cse_v2_5(hdr, out); /* From d0062122a8d966f9f9edd3d99e8d99db742fbcf0 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 26 Jan 2022 02:51:41 +0000 Subject: [PATCH 222/639] Fix confusion in headers between uint8_t arrays and strings Strings are null terminated, byte arrays not always. Fixes garbage in debug output issue #86 Add new parse_printable_key() function that takes a uint8_t * argument instead of char *. Casting the argument on almost every call was a clear indication of the problem. Add new DUMP_PRINTABLE_BYTES() to printf uint8_t arrays _and_ their _optional_ padding. No change to the .ri output, bit for bit identical. Here's an example of how the -v output is fixed: ```diff mem_zone.host_offset: 0x0 cse - partition_name: 'ADSPADSP.man' + partition_name: ADSP header_version: 1 entry_version: 1 nb_entries: 3 - entry.name: 'ADSP.man' + entry.name: ADSP.man\x00\x00\x00\x00 entry.offset: 0x58 entry.length: 0x378 - entry.name: 'cavs0015.met' + entry.name: cavs0015.met entry.offset: 0x400 entry.length: 0x60 - entry.name: 'cavs0015' + entry.name: cavs0015\x00\x00\x00\x00 entry.offset: 0x480 entry.length: 0x0 @@ -140,7 +132,7 @@ exponent_size: 1 signed_pkg - name: 'ADSP' + name: ADSP vcn: 0 svn: 0 fw_type: 0 @@ -161,17 +153,17 @@ bitmap: 0 bitmap: 0 bitmap: 0 - meta.name: 'cavs0015.met^C^B ' + meta.name: cavs0015.met meta.type: 0x3 meta.hash_algo: 0x2 meta.hash_size: 0x20 meta.meta_size: 96 partition_info - name: 'ADSP' + name: ADSP part_version: 0x10000000 instance_id: 1 - module.name: 'cavs0015.met^C' + module.name: cavs0015.met module.meta_size: 0x60 module.type: 0x3 @@ -186,7 +178,7 @@ fw_desc.header header_id: '$AM1' - name: 'ADSPFW' + name: ADSPFW\x00\x00 preload_page_count: 0 fw_image_flags: 0x0 feature_mask: 0xffff ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/adsp_config.c | 140 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 99 insertions(+), 41 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 5d5aa5a91048..cff5ba5d079c 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -20,12 +20,34 @@ #include <string.h> #include <stdio.h> #include <errno.h> +#include <ctype.h> /* macros used to dump values after parsing */ #define DUMP_KEY_FMT " %20s: " #define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) #define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) +static void print_bytes(FILE *out, const uint8_t *arr, size_t len) +{ + for (const uint8_t *pos = arr; pos < arr + len; pos++) { + char c = *pos; + + if (isprint(c)) + fputc(c, out); + else + fprintf(out, "\\x%.2x", c); + } +} + +#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) + +static void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len) +{ + printf(DUMP_KEY_FMT, name); + print_bytes(stdout, arr, len); + printf("\n"); +} + /** parser counter, used to assert nothing left unparsed in toml data */ struct parse_ctx { int key_cnt; /**< number of parsed key */ @@ -206,16 +228,20 @@ static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ct } /** - * Parse string value from key in given toml table + * Parse string value from key in given toml table to uint8_t array. The + * destination is NOT a string because it is padded with zeros if and + * only if there is some capacity left. For string destinations use + * parse_str_key(). + * * @param table toml table where key is specified * @param ctx parsing context, key counter will be incremented after successful key parse * @param key field name - * @param dst target buffer for string - * @param capacity dst buffer size + * @param dst uint8_t[] destination + * @param capacity dst array size * @param error code, 0 when success */ -static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - char *dst, int capacity, int *error) +static void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + uint8_t *dst, int capacity, int *error) { toml_raw_t raw; char *temp_s; @@ -237,19 +263,50 @@ static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, cons len = strlen(temp_s); if (len > capacity) { - *error = log_err(-EINVAL, "Too long input for key '%s' (%d > %d)\n", key, len, - capacity); + if (len > 20) { + static const char ellipsis[] = "..."; + const size_t el_len = sizeof(ellipsis); + + strncpy(temp_s + 20 - el_len, ellipsis, el_len); + } + + *error = log_err(-EINVAL, "Too long input '%s' for key '%s' (%d > %d) characters\n", + temp_s, key, len, capacity); free(temp_s); return; } - /* copy string to dst, free allocated memory and update parsing context */ - strncpy(dst, temp_s, capacity); + /* copy string to dst, pad with zeros the space left if any */ + strncpy((char *)dst, temp_s, capacity); free(temp_s); + /* update parsing context */ ++ctx->key_cnt; *error = 0; } +/** + * Parse string value from key in given toml table to given + * char[]. Destination is padded with zeros. As the only difference with + * parse_printable_key(), dst is guaranteed to be null-terminated when + * there is no error because the last destination byte is reserved for + * that. + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst char[] destination + * @param capacity dst array size including null termination. + * @param error code, 0 when success + */ +static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error) +{ + parse_printable_key(table, ctx, key, (uint8_t *)dst, capacity - 1, error); + if (*error) /* return immediately to help forensics */ + return; + dst[capacity - 1] = 0; +} + /* map memory zone string name to enum value */ static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) { @@ -380,7 +437,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a zone_idx = zone_name_to_idx(zone_name); if (zone_idx < 0) - return err_key_parse("mem_zone.name", "unknown zone"); + return err_key_parse("mem_zone.name", "unknown zone '%s'", zone_name); zone = &out->mem_zones[zone_idx]; zone->base = parse_uint32_hex_key(mem_zone, &ctx, "base", -1, &ret); @@ -421,12 +478,12 @@ static void dump_cse(const struct CsePartitionDirHeader *cse_header, int i; DUMP("\ncse"); - DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_PRINTABLE_BYTES("partition_name", cse_header->partition_name); DUMP_KEY("header_version", "%d", cse_header->header_version); DUMP_KEY("entry_version", "%d", cse_header->entry_version); DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); for (i = 0; i < cse_header->nb_entries; ++i) { - DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_PRINTABLE_BYTES("entry.name", cse_entry[i].entry_name); DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); } @@ -463,8 +520,8 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return ret; - parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, - sizeof(hdr->partition_name), &ret); + parse_printable_key(cse, &ctx, "partition_name", hdr->partition_name, + sizeof(hdr->partition_name), &ret); if (ret < 0) return ret; @@ -494,8 +551,8 @@ static int parse_cse(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ /* configurable fields */ - parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, - sizeof(out[i].entry_name), &ret); + parse_printable_key(cse_entry, &ctx, "name", out[i].entry_name, + sizeof(out[i].entry_name), &ret); if (ret < 0) return err_key_parse("entry", NULL); @@ -532,12 +589,12 @@ static void dump_cse_v2_5(const struct CsePartitionDirHeader_v2_5 *cse_header, int i; DUMP("\ncse"); - DUMP_KEY("partition_name", "'%s'", cse_header->partition_name); + DUMP_PRINTABLE_BYTES("partition_name", cse_header->partition_name); DUMP_KEY("header_version", "%d", cse_header->header_version); DUMP_KEY("entry_version", "%d", cse_header->entry_version); DUMP_KEY("nb_entries", "%d", cse_header->nb_entries); for (i = 0; i < cse_header->nb_entries; ++i) { - DUMP_KEY("entry.name", "'%s'", cse_entry[i].entry_name); + DUMP_PRINTABLE_BYTES("entry.name", cse_entry[i].entry_name); DUMP_KEY("entry.offset", "0x%x", cse_entry[i].offset); DUMP_KEY("entry.length", "0x%x", cse_entry[i].length); } @@ -575,8 +632,8 @@ static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return ret; - parse_str_key(cse, &ctx, "partition_name", (char *)hdr->partition_name, - sizeof(hdr->partition_name), &ret); + parse_printable_key(cse, &ctx, "partition_name", hdr->partition_name, + sizeof(hdr->partition_name), &ret); if (ret < 0) return ret; @@ -606,8 +663,8 @@ static int parse_cse_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ /* configurable fields */ - parse_str_key(cse_entry, &ctx, "name", (char *)out[i].entry_name, - sizeof(out[i].entry_name), &ret); + parse_printable_key(cse_entry, &ctx, "name", out[i].entry_name, + sizeof(out[i].entry_name), &ret); if (ret < 0) return err_key_parse("entry", NULL); @@ -901,7 +958,7 @@ static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) int i; DUMP("\nsigned_pkg"); - DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_PRINTABLE_BYTES("name", signed_pkg->name); DUMP_KEY("vcn", "%d", signed_pkg->vcn); DUMP_KEY("svn", "%d", signed_pkg->svn); DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); @@ -909,7 +966,7 @@ static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { - DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_PRINTABLE_BYTES("meta.name", signed_pkg->module[i].name); DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); @@ -943,7 +1000,7 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, out->ext_len = sizeof(struct signed_pkg_info_ext); /* configurable fields */ - parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(signed_pkg, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1015,7 +1072,7 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, /* non-configurable fields */ /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); @@ -1057,7 +1114,7 @@ static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_p int i; DUMP("\nsigned_pkg"); - DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_PRINTABLE_BYTES("name", signed_pkg->name); DUMP_KEY("vcn", "%d", signed_pkg->vcn); DUMP_KEY("svn", "%d", signed_pkg->svn); DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); @@ -1065,7 +1122,7 @@ static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_p for (i = 0; i < ARRAY_SIZE(signed_pkg->bitmap); ++i) DUMP_KEY("bitmap", "%d", signed_pkg->bitmap[i]); for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { - DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_PRINTABLE_BYTES("meta.name", signed_pkg->module[i].name); DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); DUMP_KEY("meta.hash_algo", "0x%x", signed_pkg->module[i].hash_algo); DUMP_KEY("meta.hash_size", "0x%x", signed_pkg->module[i].hash_size); @@ -1099,7 +1156,7 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct out->ext_len = sizeof(struct signed_pkg_info_ext_v2_5); /* configurable fields */ - parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(signed_pkg, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1171,7 +1228,7 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct /* non-configurable fields */ /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); @@ -1214,11 +1271,11 @@ static void dump_partition_info_ext(const struct partition_info_ext *part_info) int i; DUMP("\npartition_info"); - DUMP_KEY("name", "'%s'", part_info->name); + DUMP_PRINTABLE_BYTES("name", part_info->name); DUMP_KEY("part_version", "0x%x", part_info->part_version); DUMP_KEY("instance_id", "%d", part_info->instance_id); for (i = 0; i < ARRAY_SIZE(part_info->module); ++i) { - DUMP_KEY("module.name", "'%s'", part_info->module[i].name); + DUMP_PRINTABLE_BYTES("module.name", part_info->module[i].name); DUMP_KEY("module.meta_size", "0x%x", part_info->module[i].meta_size); DUMP_KEY("module.type", "0x%x", part_info->module[i].type); } @@ -1249,7 +1306,7 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * memset(out->reserved, 0xff, sizeof(out->reserved)); /* configurable fields */ - parse_str_key(partition_info, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(partition_info, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1307,7 +1364,7 @@ static int parse_partition_info_ext(const toml_table_t *toml, struct parse_ctx * memcpy(mod->reserved, module_reserved, sizeof(mod->reserved)); /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); @@ -1603,7 +1660,7 @@ static void dump_fw_desc(const struct sof_man_fw_desc *fw_desc) DUMP_KEY("header_id", "'%c%c%c%c'", fw_desc->header.header_id[0], fw_desc->header.header_id[1], fw_desc->header.header_id[2], fw_desc->header.header_id[3]); - DUMP_KEY("name", "'%s'", fw_desc->header.name); + DUMP_PRINTABLE_BYTES("name", fw_desc->header.name); DUMP_KEY("preload_page_count", "%d", fw_desc->header.preload_page_count); DUMP_KEY("fw_image_flags", "0x%x", fw_desc->header.fw_image_flags); DUMP_KEY("feature_mask", "0x%x", fw_desc->header.feature_mask); @@ -1646,8 +1703,8 @@ static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, out->header.header_len = sizeof(struct sof_man_fw_header); /* configurable fields */ - parse_str_key(header, &ctx, "name", (char *)out->header.name, SOF_MAN_FW_HDR_FW_NAME_LEN, - &ret); + parse_printable_key(header, &ctx, "name", out->header.name, sizeof(out->header.name), + &ret); if (ret < 0) return err_key_parse("header", NULL); @@ -1892,7 +1949,7 @@ static void dump_module(struct fw_image_manifest_module *man_cavs) DUMP_KEY("module config count", "%d", man_cavs->mod_cfg_count); for (i = 0; i < man_cavs->mod_man_count; i++) { - DUMP_KEY("module name", "%s", man_cavs->mod_man[i].name); + DUMP_PRINTABLE_BYTES("module name", man_cavs->mod_man[i].name); DUMP_KEY("load type", "%d", man_cavs->mod_man[i].type.load_type); DUMP_KEY("domain ll", "%d", man_cavs->mod_man[i].type.domain_ll); DUMP_KEY("domain dp", "%d", man_cavs->mod_man[i].type.domain_dp); @@ -1971,12 +2028,13 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, memcpy(mod_man->struct_id, "$AME", 4); /* configurable fields */ - parse_str_key(mod_entry, &ctx_entry, "name", (char *)mod_man->name, - SOF_MAN_MOD_NAME_LEN, &ret); + parse_printable_key(mod_entry, &ctx_entry, "name", mod_man->name, + sizeof(mod_man->name), &ret); if (ret < 0) return err_key_parse("name", NULL); - parse_str_key(mod_entry, &ctx_entry, "uuid", buf, 48, &ret); + parse_str_key(mod_entry, &ctx_entry, "uuid", buf, sizeof(buf), + &ret); if (ret < 0) return err_key_parse("uuid", NULL); From 15896419037114106b8989a096229bd0198d34ec Mon Sep 17 00:00:00 2001 From: Andrey Borisovich <andrey.borisovich@intel.com> Date: Wed, 26 Jan 2022 10:48:20 +0100 Subject: [PATCH 223/639] Fixed warning of wrong variable type in fprintf Fixed warning where variable passed to fprintf was of type size_t and fprintf expected format of long int. Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com> --- src/manifest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 3639b33a1236..cb6d70390507 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: BSD-3-Clause // -// Copyright(c) 2018 Intel Corporation. All rights reserved. +// Copyright(c) 2018-2022 Intel Corporation. All rights reserved. // // Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> // Keyon Jie <yang.jie@linux.intel.com> @@ -1480,7 +1480,7 @@ int resign_image(struct image *image) /* read file into buffer */ read = fread(buffer, 1, size, in_file); if (read != size) { - fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", + fprintf(stderr, "error: unable to read %zu bytes from %s err %d\n", size, image->in_file, errno); ret = errno; goto out; From ee5c3e1deb1436a6e52b653bb523b594511cf330 Mon Sep 17 00:00:00 2001 From: Andrey Borisovich <andrey.borisovich@intel.com> Date: Wed, 26 Jan 2022 10:52:36 +0100 Subject: [PATCH 224/639] Added handling of OpenSSL on Windows with MSYS2 Added new MSYS_INSTALL_DIR variable that points to MSYS2 installation for Windows users. It is used to include POSIX native headers from /usr/include also required openssl headers. Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com> --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1607b36a8b54..0e253d8d1b50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,27 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 9.1) target_compile_options(rimage PRIVATE -Wno-char-subscripts) endif() +# Windows builds use MSYS2 https://www.msys2.org/ to get linux tools and headers. +# MSYS_INSTALL_DIR variable points to MSYS2 installation directory. +# You may pass it as environmental or cmake configure variable. +if(${CMAKE_HOST_WIN32}) + cmake_minimum_required(VERSION 3.20) + if(DEFINED ENV{MSYS_INSTALL_DIR} AND NOT MSYS_INSTALL_DIR) + set(MSYS_INSTALL_DIR $ENV{MSYS_INSTALL_DIR}) + endif() + + if(MSYS_INSTALL_DIR) + cmake_path(IS_ABSOLUTE MSYS_INSTALL_DIR IS_MSYS_INSTALL_DIR_ABSOLUTE) + if(NOT IS_MSYS_INSTALL_DIR_ABSOLUTE) + message(FATAL_ERROR "Please provide absolute path to MSYS2 installation + setting MSYS_INSTALL_DIR env variable") + endif() + # Include standard posix headers. Requires pacman openssl-devel package. + cmake_path(APPEND MSYS_INSTALL_DIR "usr" "include" OUTPUT_VARIABLE MSYS_SYSTEM_INCLUDE_PATH) + target_include_directories(rimage PRIVATE "${MSYS_SYSTEM_INCLUDE_PATH}") + endif() +endif() + target_link_libraries(rimage PRIVATE crypto) target_include_directories(rimage PRIVATE From 05be213d46d4755ff039fe8703a16293738e226f Mon Sep 17 00:00:00 2001 From: Tinghan Shen <tinghan.shen@mediatek.com> Date: Tue, 30 Nov 2021 11:01:00 +0800 Subject: [PATCH 225/639] config: Add mt8186.toml Add mt8186.toml to support sof-mt8186.ri binary build Signed-off-by: Allen-KH Cheng <Allen-KH.Cheng@mediatek.com> Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> --- config/mt8186.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/mt8186.toml diff --git a/config/mt8186.toml b/config/mt8186.toml new file mode 100644 index 000000000000..80b011b4bfd4 --- /dev/null +++ b/config/mt8186.toml @@ -0,0 +1,15 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "mt8186" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x4e100000" +size = "0x00100000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60000000" +size = "0x00600000" +host_offset = "0x0" From 9d453321f892b7ec3f0c74d3382eaa4e674a6e6a Mon Sep 17 00:00:00 2001 From: mengdonglin <mengdong.lin@intel.com> Date: Wed, 4 May 2022 06:25:47 -0400 Subject: [PATCH 226/639] Write firmware file micro version to manifest for cAVS platforms SOF CMake can extract FW file version from latest git tag and defines SOF_MAJOR, SOF_MINOR and SOF_MICRO for 3 version fields. But rimage only gets major and minor version from SOF CMake and writes them into the standard firmware manifest header of cAVS platforms. This patch make rimage also get the micro version from SOF CMake, and write it to the unused hotfix_version field of manifest header. This update will enable sof_ri_info.py to dump entire file version from a FW binary for cAVS platforms. So we can check if a FW release candidate is built from the correct git tag. Signed-off-by: mengdonglin <mengdong.lin@intel.com> update --- src/include/rimage/rimage.h | 1 + src/manifest.c | 7 +++++++ src/rimage.c | 14 ++++++++------ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e5b918e3c600..1ce609c67127 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -109,6 +109,7 @@ struct image { char* fw_ver_build_string; uint16_t fw_ver_major; uint16_t fw_ver_minor; + uint16_t fw_ver_micro; uint16_t fw_ver_build; }; diff --git a/src/manifest.c b/src/manifest.c index cb6d70390507..d3d7f26e2f93 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -776,6 +776,7 @@ int man_write_fw_v1_5(struct image *image) /* firmware and build version */ m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ @@ -845,6 +846,7 @@ int man_write_fw_v1_5_sue(struct image *image) /* firmware and build version */ m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module - subtract the boot loader exec header */ @@ -916,6 +918,7 @@ int man_write_fw_v1_8(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ @@ -1022,6 +1025,7 @@ int man_write_fw_meu_v1_5(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1102,6 +1106,7 @@ int man_write_fw_meu_v1_8(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1182,6 +1187,7 @@ int man_write_fw_meu_v2_5(struct image *image) /* firmware and build version */ desc->header.major_version = image->fw_ver_major; desc->header.minor_version = image->fw_ver_minor; + desc->header.hotfix_version = image->fw_ver_micro; desc->header.build_version = image->fw_ver_build; /* create each module */ @@ -1266,6 +1272,7 @@ int man_write_fw_v2_5(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; /* create each module */ diff --git a/src/rimage.c b/src/rimage.c index 3cf02328234f..c7b112dcaa72 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -26,7 +26,7 @@ static void usage(char *name) fprintf(stdout, "\t -r enable relocatable ELF files\n"); fprintf(stdout, "\t -s MEU signing offset, disables rimage signing\n"); fprintf(stdout, "\t -i set IMR type\n"); - fprintf(stdout, "\t -f firmware version = x.y\n"); + fprintf(stdout, "\t -f firmware version = major.minor.micro\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); @@ -115,19 +115,21 @@ int main(int argc, char *argv[]) return -EINVAL; } - /* firmware version and build id */ + /* firmware version: major.minor.micro */ if (image.fw_ver_string) { - ret = sscanf(image.fw_ver_string, "%hu.%hu", + ret = sscanf(image.fw_ver_string, "%hu.%hu.%hu", &image.fw_ver_major, - &image.fw_ver_minor); + &image.fw_ver_minor, + &image.fw_ver_micro); - if (ret != 2) { + if (ret != 3) { fprintf(stderr, - "error: cannot parse firmware version\n"); + "error: cannot parse firmware version major.minor.micro\n"); return -EINVAL; } } + /* firmware build id */ if (image.fw_ver_build_string) { ret = sscanf(image.fw_ver_build_string, "%hu", &image.fw_ver_build); From 1b233f68bdee6de24b0447917d8d44c98970efce Mon Sep 17 00:00:00 2001 From: Balakishorepati <balaKishore.pati@amd.com> Date: Mon, 9 May 2022 21:15:52 +0530 Subject: [PATCH 227/639] config: add rmb toml file to support rembrandt build Add rmb toml file to support sof-rmb.ri binary build Signed-off-by: Balakishorepati <balaKishore.pati@amd.com> --- config/rmb.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/rmb.toml diff --git a/config/rmb.toml b/config/rmb.toml new file mode 100644 index 000000000000..7d43f3a3dc33 --- /dev/null +++ b/config/rmb.toml @@ -0,0 +1,15 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "rmb" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x7F000000" +size = "0x40000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xE0000000" +size = "0xE0000" +host_offset = "0x0" From c484d99abf89e08d702e2097a11e86d9631c7af0 Mon Sep 17 00:00:00 2001 From: bkolodzi <96577572+bkolodzi@users.noreply.github.com> Date: Thu, 20 Jan 2022 13:51:17 +0100 Subject: [PATCH 228/639] rimage: add ACE V1.5 handling Add ACE 1.5 set of functions to support v3.0 manifest Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- src/adsp_config.c | 192 ++++++++++++++++++++++++- src/cse.c | 30 ++++ src/include/rimage/cse.h | 1 + src/include/rimage/manifest.h | 41 ++++++ src/include/rimage/plat_auth.h | 30 ++++ src/include/rimage/rimage.h | 7 + src/include/rimage/sof/user/manifest.h | 2 +- src/manifest.c | 142 ++++++++++++++++++ src/pkcs1_5.c | 112 +++++++++++++++ src/plat_auth.c | 17 +++ src/rimage.c | 3 + 11 files changed, 574 insertions(+), 3 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index cff5ba5d079c..efd21e86920a 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1265,6 +1265,129 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct return 0; } +static void dump_signed_pkg_ace_v1_5(const struct signed_pkg_info_ext_ace_v1_5 *signed_pkg) +{ + int i; + + DUMP("\nsigned_pkg"); + DUMP_KEY("name", "'%s'", signed_pkg->name); + DUMP_KEY("vcn", "%d", signed_pkg->vcn); + DUMP_KEY("svn", "%d", signed_pkg->svn); + DUMP_KEY("fw_type", "%d", signed_pkg->fw_type); + DUMP_KEY("fw_sub_type", "%d", signed_pkg->fw_sub_type); + for (i = 0; i < ARRAY_SIZE(signed_pkg->module); ++i) { + DUMP_KEY("meta.name", "'%s'", signed_pkg->module[i].name); + DUMP_KEY("meta.type", "0x%x", signed_pkg->module[i].type); + } +} + +static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, + struct signed_pkg_info_ext_ace_v1_5 *out, bool verbose) +{ + struct signed_pkg_info_module_ace_v1_5 *mod; + toml_array_t *module_array; + toml_table_t *signed_pkg; + struct parse_ctx ctx; + toml_table_t *module; + int ret; + int i; + + /* look for subtable in toml, increment pctx parsed table cnt and initialize local ctx */ + signed_pkg = toml_table_in(toml, "signed_pkg"); + if (!signed_pkg) + return err_key_not_found("signed_pkg"); + ++pctx->table_cnt; + parse_ctx_init(&ctx); + + /* non-configurable fields */ + out->ext_type = SIGN_PKG_EXT_TYPE_ACE_V1_5; + out->ext_len = sizeof(struct signed_pkg_info_ext_ace_v1_5); + + /* configurable fields */ + parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + if (ret < 0) + return ret; + + out->vcn = parse_uint32_key(signed_pkg, &ctx, "vcn", 0, &ret); + if (ret < 0) + return ret; + + out->svn = parse_uint32_key(signed_pkg, &ctx, "svn", 0, &ret); + if (ret < 0) + return ret; + + out->fw_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_type", 0, &ret); + if (ret < 0) + return ret; + + out->fw_sub_type = parse_uint32_hex_key(signed_pkg, &ctx, "fw_sub_type", 0, &ret); + if (ret < 0) + return ret; + + out->partition_usage = parse_uint32_hex_key(signed_pkg, &ctx, "partition_usage", 0, &ret); + if (ret < 0) + return ret; + + /* check everything parsed, expect 1 more array */ + ctx.array_cnt += 1; + ret = assert_everything_parsed(signed_pkg, &ctx); + if (ret < 0) + return ret; + + /* modules array */ + module_array = toml_array_in(signed_pkg, "module"); + if (!module_array) + return err_key_not_found("module"); + if (toml_array_kind(module_array) != 't' || + toml_array_nelem(module_array) != ARRAY_SIZE(out->module)) + return err_key_parse("module", "wrong array type or length != %d", + ARRAY_SIZE(out->module)); + + /* parse modules array elements */ + for (i = 0; i < toml_array_nelem(module_array); ++i) { + module = toml_table_at(module_array, i); + if (!module) + return err_key_parse("module", NULL); + mod = &out->module[i]; + + /* initialize parse context for each array element */ + parse_ctx_init(&ctx); + + /* non-configurable fields */ + + /* configurable fields */ + parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->type = parse_uint32_hex_key(module, &ctx, "type", 0x03, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->hash_algo = parse_uint32_hex_key(module, &ctx, "hash_algo", 0x00, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + mod->meta_size = parse_uint32_key(module, &ctx, "meta_size", 112, &ret); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(module, &ctx); + if (ret < 0) + return ret; + } + + if (verbose) + dump_signed_pkg_ace_v1_5(out); + + /* + * values set in other places in code: + * - module.hash + */ + + return 0; +} static void dump_partition_info_ext(const struct partition_info_ext *part_info) { @@ -1664,7 +1787,7 @@ static void dump_fw_desc(const struct sof_man_fw_desc *fw_desc) DUMP_KEY("preload_page_count", "%d", fw_desc->header.preload_page_count); DUMP_KEY("fw_image_flags", "0x%x", fw_desc->header.fw_image_flags); DUMP_KEY("feature_mask", "0x%x", fw_desc->header.feature_mask); - DUMP_KEY("hw_buf_base_addr", "0x%x", fw_desc->header.hw_buf_base_addr); + DUMP_KEY("hw_buf_base_addr", "0x%x", fw_desc->header.fw_compat); DUMP_KEY("hw_buf_length", "0x%x", fw_desc->header.hw_buf_length); DUMP_KEY("load_offset", "0x%x", fw_desc->header.load_offset); } @@ -1723,7 +1846,7 @@ static int parse_fw_desc(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("header", NULL); - out->header.hw_buf_base_addr = + out->header.fw_compat = parse_uint32_hex_key(header, &ctx, "hw_buf_base_addr", 0, &ret); if (ret < 0) return err_key_parse("header", NULL); @@ -2342,6 +2465,70 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, return 0; } +static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct adsp *out, + bool verbose) +{ + struct parse_ctx ctx; + int ret; + + out->man_ace_v1_5 = malloc(sizeof(struct fw_image_manifest_ace_v1_5)); + if (!out->man_ace_v1_5) + return err_malloc("man_ace_v1_5"); + + /* clear memory */ + memset(out->man_ace_v1_5, 0, sizeof(*out->man_ace_v1_5)); + + /* assign correct write functions */ + out->write_firmware = man_write_fw_ace_v1_5; + out->write_firmware_meu = man_write_fw_meu_v2_5; + out->verify_firmware = ri_manifest_verify_v2_5; + + /* version array has already been parsed, so increment ctx.array_cnt */ + parse_ctx_init(&ctx); + ++ctx.array_cnt; + + /* parse each toml subtable */ + ret = parse_adsp(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("adsp", NULL); + + ret = parse_cse_v2_5(toml, &ctx, &out->man_ace_v1_5->cse_partition_dir_header, + out->man_ace_v1_5->cse_partition_dir_entry, 3, verbose); + if (ret < 0) + return err_key_parse("cse", NULL); + + ret = parse_css_v2_5(toml, &ctx, &out->man_ace_v1_5->css, verbose); + if (ret < 0) + return err_key_parse("css", NULL); + + ret = parse_signed_pkg_ace_v1_5(toml, &ctx, &out->man_ace_v1_5->signed_pkg, verbose); + if (ret < 0) + return err_key_parse("signed_pkg", NULL); + + ret = parse_info_ext_0x16(toml, &ctx, &out->man_ace_v1_5->info_0x16, verbose); + if (ret < 0) + return err_key_parse("partition_info", NULL); + + ret = parse_adsp_file_ext_v2_5(toml, &ctx, &out->man_ace_v1_5->adsp_file_ext, verbose); + if (ret < 0) + return err_key_parse("adsp_file", NULL); + + ret = parse_fw_desc(toml, &ctx, &out->man_ace_v1_5->desc, verbose); + if (ret < 0) + return err_key_parse("fw_desc", NULL); + + ret = parse_module(toml, &ctx, out, verbose); + if (ret < 0) + return err_key_parse("module", NULL); + + /* check everything parsed */ + ret = assert_everything_parsed(toml, &ctx); + if (ret < 0) + return ret; + + return 0; +} + /** version is stored as toml array with integer number, something like: * "version = [1, 8]" */ @@ -2386,6 +2573,7 @@ static const struct config_parser *find_config_parser(int64_t version[2]) {1, 5, parse_adsp_config_v1_5}, {1, 8, parse_adsp_config_v1_8}, {2, 5, parse_adsp_config_v2_5}, + {3, 0, parse_adsp_config_ace_v1_5}, }; int i; diff --git a/src/cse.c b/src/cse.c index 19561701281b..3c5e9c561856 100644 --- a/src/cse.c +++ b/src/cse.c @@ -106,3 +106,33 @@ void ri_cse_create_v2_5(struct image *image) fprintf(stdout, " cse: cse checksum %x\n", cse_hdr->checksum); } + +void ri_cse_create_ace_v1_5(struct image *image) +{ + struct CsePartitionDirHeader_v2_5 *cse_hdr = image->fw_image; + struct sof_man_adsp_meta_file_ext_v2_5 *meta = image->fw_image + + MAN_META_EXT_OFFSET_ACE_V1_5; + struct CsePartitionDirEntry *cse_entry = + image->fw_image + sizeof(*cse_hdr); + uint8_t *val = image->fw_image; + int size; + + fprintf(stdout, " cse: completing CSE V2.5 manifest\n"); + + cse_entry[2].length = meta->comp_desc[0].limit_offset - + MAN_DESC_OFFSET_V1_8; + + /* + * calculate checksum using crc-32/iso-hdlc + * + * polynomial: 0x04c11db7 + * initial value: 0xffffffff + * reverse input: true + * reverse output: true + * xor output: 0xffffffff + */ + size = (sizeof(*cse_hdr) + (sizeof(*cse_entry) * MAN_CSE_PARTS)); + cse_hdr->checksum = crc32(val, size, 0x04c11db7, 0xffffffff, true, true, 0xffffffff); + + fprintf(stdout, " cse: cse checksum %x\n", cse_hdr->checksum); +} diff --git a/src/include/rimage/cse.h b/src/include/rimage/cse.h index 6ce46561f214..9a14b93b99f6 100644 --- a/src/include/rimage/cse.h +++ b/src/include/rimage/cse.h @@ -42,5 +42,6 @@ struct CsePartitionDirEntry { void ri_cse_create(struct image *image); void ri_cse_create_v2_5(struct image *image); +void ri_cse_create_ace_v1_5(struct image *image); #endif diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 0e06e8f20df2..819f398b2c89 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -46,11 +46,19 @@ sizeof(struct CsePartitionDirHeader_v2_5) + \ MAN_CSE_PARTS * sizeof(struct CsePartitionDirEntry)) +#define MAN_FW_DESC_OFFSET_ACE_V1_5 \ + (MAN_META_EXT_OFFSET_ACE_V1_5 + \ + sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ + MAN_EXT_PADDING) + #define MAN_FW_DESC_OFFSET_V2_5 \ (MAN_META_EXT_OFFSET_V2_5 + \ sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ MAN_EXT_PADDING) +#define MAN_DESC_PADDING_SIZE_ACE_V1_5 \ + (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_ACE_V1_5) + #define MAN_DESC_PADDING_SIZE_V2_5 \ (MAN_DESC_OFFSET_V1_8 - MAN_FW_DESC_OFFSET_V2_5) @@ -66,6 +74,10 @@ (MAN_SIG_PKG_OFFSET_V1_8 + \ sizeof(struct signed_pkg_info_ext)) +#define MAN_PART_INFO_OFFSET_ACE_V1_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_ace_v1_5)) + #define MAN_PART_INFO_OFFSET_V2_5 \ (MAN_SIG_PKG_OFFSET_V2_5 + \ sizeof(struct signed_pkg_info_ext_v2_5)) @@ -76,6 +88,12 @@ sizeof(struct partition_info_ext) + \ MAN_CSE_PADDING_SIZE) +#define MAN_META_EXT_OFFSET_ACE_V1_5 \ + (MAN_SIG_PKG_OFFSET_V2_5 + \ + sizeof(struct signed_pkg_info_ext_ace_v1_5) + \ + sizeof(struct info_ext_0x16) + \ + 0) + #define MAN_META_EXT_OFFSET_V2_5 \ (MAN_SIG_PKG_OFFSET_V2_5 + \ sizeof(struct signed_pkg_info_ext_v2_5) + \ @@ -105,6 +123,28 @@ sizeof(struct sof_man_adsp_meta_file_ext_v1_8) + \ MAN_EXT_PADDING) +/* + * Firmware manifest header ACE V1_5 used on MTL onwards + */ +struct fw_image_manifest_ace_v1_5 { + /* MEU tool needs these sections to be 0s */ + struct CsePartitionDirHeader_v2_5 cse_partition_dir_header; + struct CsePartitionDirEntry cse_partition_dir_entry[MAN_CSE_PARTS]; + struct css_header_v2_5 css; + struct signed_pkg_info_ext_ace_v1_5 signed_pkg; + struct info_ext_0x16 info_0x16; + + struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; + + /* reserved / pading at end of ext data - all 0s*/ + uint8_t reserved[MAN_EXT_PADDING]; + + /* start of the unsigned binary for MEU input must start at MAN_DESC_OFFSET */ + uint8_t padding[MAN_DESC_PADDING_SIZE_ACE_V1_5]; + + struct sof_man_fw_desc desc; /* at offset MAN_DESC_OFFSET */ +} __attribute__((packed)); + /* * Firmware manifest header V2.5 used on TGL onwards */ @@ -167,6 +207,7 @@ int man_write_fw_v1_5(struct image *image); int man_write_fw_v1_5_sue(struct image *image); int man_write_fw_v1_8(struct image *image); int man_write_fw_v2_5(struct image *image); +int man_write_fw_ace_v1_5(struct image *image); int man_write_fw_meu_v1_5(struct image *image); int man_write_fw_meu_v1_8(struct image *image); int man_write_fw_meu_v2_5(struct image *image); diff --git a/src/include/rimage/plat_auth.h b/src/include/rimage/plat_auth.h index 8eb3ad967a56..64cdcd98db5f 100644 --- a/src/include/rimage/plat_auth.h +++ b/src/include/rimage/plat_auth.h @@ -18,6 +18,8 @@ struct image; #define SIGN_PKG_EXT_TYPE 15 #define SIGN_PKG_NUM_MODULE 1 +#define SIGN_PKG_EXT_TYPE_ACE_V1_5 0x23 + struct signed_pkg_info_module { uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ uint8_t type; @@ -68,6 +70,33 @@ struct signed_pkg_info_ext_v2_5 { struct signed_pkg_info_module_v2_5 module[SIGN_PKG_NUM_MODULE]; } __attribute__((packed)); +struct signed_pkg_info_module_ace_v1_5 { + uint8_t name[PLAT_AUTH_NAME_LEN]; /* must be padded with 0 */ + uint8_t type; + uint8_t hash_algo; + uint8_t reserved[2]; + uint32_t meta_size; + uint8_t hash[PLAT_AUTH_SHA384_LEN]; +} __attribute__((packed)); + +struct signed_pkg_info_ext_ace_v1_5 { + uint32_t ext_type; + uint32_t ext_len; + + uint8_t name[4]; + uint32_t vcn; /* 0 */ + uint32_t svn; + uint8_t partition_usage; + uint8_t reserved0; + uint8_t fw_type; + uint8_t fw_sub_type; + uint8_t number_of_modules; + uint8_t boot_strap_svn; + uint8_t reserved[14]; /* must be 0 */ + + /* variable length of modules */ + struct signed_pkg_info_module_ace_v1_5 module[SIGN_PKG_NUM_MODULE]; +} __attribute__((packed)); #define PART_INFO_EXT_TYPE 3 #define PART_INFO_NUM_MODULE 1 @@ -121,5 +150,6 @@ void ri_adsp_meta_data_create_v2_5(struct image *image, int meta_start_offset, int meta_end_offset); void ri_plat_ext_data_create(struct image *image); void ri_plat_ext_data_create_v2_5(struct image *image); +void ri_plat_ext_data_create_ace_v1_5(struct image *image); #endif diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 1ce609c67127..0f719dc5b9ed 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -155,6 +155,7 @@ struct adsp { int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); int (*verify_firmware)(struct image *image); + struct fw_image_manifest_ace_v1_5 *man_ace_v1_5; struct fw_image_manifest_v2_5 *man_v2_5; struct fw_image_manifest_v1_8 *man_v1_8; struct fw_image_manifest_v1_5 *man_v1_5; @@ -170,6 +171,8 @@ void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); int ri_manifest_sign_v2_5(struct image *image); +int ri_manifest_sign_ace_v1_5(struct image *image); + void ri_sha256(struct image *image, unsigned int offset, unsigned int size, uint8_t *hash); void ri_sha384(struct image *image, unsigned int offset, unsigned int size, @@ -186,6 +189,10 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int verify_image(struct image *image); int ri_manifest_verify_v1_5(struct image *image); diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index d90014ffb198..d7c3d3d98afa 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -137,7 +137,7 @@ struct sof_man_fw_header { uint16_t hotfix_version; uint16_t build_version; uint32_t num_module_entries; - uint32_t hw_buf_base_addr; + uint32_t fw_compat; uint32_t hw_buf_length; /* target address for binary loading as offset in IMR - must be == base offset */ uint32_t load_offset; diff --git a/src/manifest.c b/src/manifest.c index d3d7f26e2f93..7c8b46aa8c21 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1358,6 +1358,148 @@ int man_write_fw_v2_5(struct image *image) return ret; } +static int man_init_image_ace_v1_5(struct image *image) +{ + /* allocate image and copy template manifest */ + image->fw_image = calloc(image->adsp->image_size, 1); + if (!image->fw_image) + return -ENOMEM; + + memcpy(image->fw_image, image->adsp->man_ace_v1_5, + sizeof(struct fw_image_manifest_ace_v1_5)); + + return 0; +} + +int man_write_fw_ace_v1_5(struct image *image) +{ + + struct sof_man_fw_desc *desc; + struct fw_image_manifest_ace_v1_5 *m; + uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; + int ret, i; + + /* init image */ + ret = man_init_image_ace_v1_5(image); + if (ret < 0) + goto err; + + /* use default meu offset for TGL if not provided */ + if (!image->meu_offset) + image->meu_offset = MAN_FW_DESC_OFFSET_ACE_V1_5 - 0x10; + + /* open ROM image */ + ret = man_open_rom_file(image); + if (ret < 0) + goto err; + + /* open unsigned firmware */ + ret = man_open_unsigned_file(image); + if (ret < 0) + goto err; + + /* create the manifest */ + ret = man_open_manifest_file(image); + if (ret < 0) + goto err; + + /* create the module */ + m = image->fw_image; + desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + + /* firmware and build version */ + m->css.version.major_version = image->fw_ver_major; + m->css.version.minor_version = image->fw_ver_minor; + m->css.version.build_version = image->fw_ver_build; + m->desc.header.major_version = image->fw_ver_major; + m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.build_version = image->fw_ver_build; + + m->desc.header.feature_mask = 0x2; // -> should be feature mask - to fix + m->desc.header.fw_image_flags = 0x2; // -> should be feature mask - to fix + m->desc.header.fw_compat = 0x100000; // -> PUT PROPER STRUCT + + /* create each module */ + m->desc.header.num_module_entries = image->num_modules; + man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + /* platform config defines some modules except bringup & base modules */ + man_create_modules_in_config(image, desc); + + fprintf(stdout, "Firmware completing manifest v2.5\n"); + + /* create structures from end of file to start of file */ + ri_adsp_meta_data_create_v2_5(image, MAN_META_EXT_OFFSET_ACE_V1_5, + image->meu_offset); + ri_plat_ext_data_create_ace_v1_5(image); + ri_css_v2_5_hdr_create(image); + ri_cse_create_ace_v1_5(image); + + fprintf(stdout, "Firmware file size 0x%x page count %d\n", + FILE_TEXT_OFFSET_V1_8 - MAN_DESC_OFFSET_V1_8 + image->image_end, + desc->header.preload_page_count); + + /* calculate hash for each module */ + man_hash_modules(image, desc); + + /* calculate hash inside ADSP meta data extension for padding to end */ + ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash); + + /* mue writes 0xff to 16 bytes of padding */ + for (i = 0; i < 16; i++) + m->reserved[i] = 0xff; + + /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ + ri_sha384(image, MAN_META_EXT_OFFSET_ACE_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->signed_pkg.module[0].hash[i] = + hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } + + /* calculate hash - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, image->fw_image, + sizeof(struct CsePartitionDirHeader_v2_5) + + sizeof(struct CsePartitionDirEntry) * 3); + module_sha_update(image, image->fw_image + 0x4c0, image->image_end - 0x4c0); + module_sha_complete(image, hash); + + /* hash values in reverse order */ + for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { + m->info_0x16.hash[i] = hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; + } + + /* sign manifest */ + ret = ri_manifest_sign_ace_v1_5(image); + if (ret < 0) + goto err; + + /* write the firmware */ + ret = man_write_fw_mod(image); + if (ret < 0) + goto err; + + /* write the unsigned files*/ + ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_ACE_V1_5, + MAN_FW_DESC_OFFSET_ACE_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + if (ret < 0) + goto err; + + fprintf(stdout, "Firmware manifest and signing completed !\n"); + return 0; + +err: + free(image->rom_image); + free(image->fw_image); + unlink(image->out_file); + unlink(image->out_rom_file); + return ret; +} + int verify_image(struct image *image) { FILE *in_file; diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 6e3dad8db6ff..62ba0ea062b0 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -576,6 +576,101 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, * extensions, and excluding the last 3 fields of the * manifest header (Public Key, Exponent and Signature). */ +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + RSA *priv_rsa = NULL; + EVP_PKEY *privkey; + FILE *fp; + const BIGNUM *n, *e, *d; + unsigned char digest[SHA384_DIGEST_LENGTH]; + unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; + unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; + char path[256]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + /* require private key */ + if (!image->key_name) { + return -EINVAL; + } + + /* create new PSS key */ + privkey = EVP_PKEY_new(); + if (!privkey) + return -ENOMEM; + + /* load in RSA private key from PEM file */ + memset(path, 0, sizeof(path)); + strncpy(path, image->key_name, sizeof(path) - 1); + + fprintf(stdout, " pkcs: PSS signing with key %s\n", path); + fp = fopen(path, "rb"); + if (!fp) { + fprintf(stderr, "error: can't open file %s %d\n", + path, -errno); + return -errno; + } + PEM_read_PrivateKey(fp, &privkey, NULL, NULL); + fclose(fp); + + /* validate RSA private key */ + priv_rsa = EVP_PKEY_get1_RSA(privkey); + if (RSA_check_key(priv_rsa)) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* sign the manifest */ + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, + digest, image->md, /* salt length */ 32); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to sign manifest %s\n", path); + } + + /* encrypt the signature using the private key */ + ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, + (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), path); + fprintf(stderr, "error: failed to encrypt signature %s\n", path); + } + + /* copy public key modulus and exponent to manifest */ + RSA_get0_key(priv_rsa, &n, &e, &d); + BN_bn2bin(n, mod); + BN_bn2bin(e, (unsigned char *)man->css.exponent); + + /* modulus is reversed */ + for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) + man->css.modulus[i] = mod[MAN_RSA_KEY_MODULUS_LEN_2_5 - (1 + i)]; + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + EVP_PKEY_free(privkey); + return ret; +} int pkcs_v1_5_sign_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, @@ -682,6 +777,23 @@ int ri_manifest_sign_v2_5(struct image *image) return pkcs_v1_5_sign_man_v2_5(image, man, data1, size1, data2, size2); } +int ri_manifest_sign_ace_v1_5(struct image *image) +{ + struct fw_image_manifest_ace_v1_5 *man = image->fw_image; + + char *const data1 = (char *)man + MAN_CSS_HDR_OFFSET_2_5; + unsigned const size1 = + sizeof(struct css_header_v2_5) - + (MAN_RSA_KEY_MODULUS_LEN_2_5 + MAN_RSA_KEY_EXPONENT_LEN + + MAN_RSA_SIGNATURE_LEN_2_5); + + char *const data2 = (char *)man + MAN_SIG_PKG_OFFSET_V2_5; + unsigned const size2 = + (man->css.size - man->css.header_len) * sizeof(uint32_t); + + return pkcs_v1_5_sign_man_ace_v1_5(image, man, data1, size1, data2, size2); +} + /* * RSA verify of manifest. The signature is an PKCS * #1-v1_5 of the entire manifest structure, including all diff --git a/src/plat_auth.c b/src/plat_auth.c index 46a2473ae44f..321d1712d0e4 100644 --- a/src/plat_auth.c +++ b/src/plat_auth.c @@ -75,3 +75,20 @@ void ri_plat_ext_data_create_v2_5(struct image *image) desc->header.preload_page_count = size / MAN_PAGE_SIZE; ext->size = image->image_end; } + +void ri_plat_ext_data_create_ace_v1_5(struct image *image) +{ + struct sof_man_adsp_meta_file_ext_v2_5 *meta = + image->fw_image + MAN_META_EXT_OFFSET_ACE_V1_5; + struct sof_man_fw_desc *desc = image->fw_image + MAN_DESC_OFFSET_V1_8; + struct info_ext_0x16 *ext = image->fw_image + MAN_PART_INFO_OFFSET_ACE_V1_5; + uint32_t size; + + fprintf(stdout, " auth: completing authentication manifest\n"); + + size = meta->comp_desc[0].limit_offset - MAN_DESC_OFFSET_V1_8; + size += MAN_PAGE_SIZE - (size % MAN_PAGE_SIZE); + + desc->header.preload_page_count = size / MAN_PAGE_SIZE; + ext->size = image->image_end; +} diff --git a/src/rimage.c b/src/rimage.c index c7b112dcaa72..617656852c83 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -170,6 +170,9 @@ int main(int argc, char *argv[]) if (image.adsp->man_v2_5) image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + if (image.adsp->man_ace_v1_5) + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + /* parse input ELF files */ image.num_modules = argc - first_non_opt; From af947cb63dd6269e004b11b4b4cde8a7c0424a94 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Mon, 6 Dec 2021 14:20:43 +0100 Subject: [PATCH 229/639] config: Add toml config for mtl This patch will add mtl support Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 210 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 config/mtl.toml diff --git a/config/mtl.toml b/config/mtl.toml new file mode 100644 index 000000000000..1de62e5414a3 --- /dev/null +++ b/config/mtl.toml @@ -0,0 +1,210 @@ +version = [3, 0] + +[adsp] +name = "mtl" +image_size = "0x2C0000" # (22) bank * 128KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0x1FF80000" +size = "0x400" +[[adsp.mem_zone]] +type = "IMR" +base = "0xA104A000" +size = "0x2000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xa00f0000" +size = "0x100000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "ADSP.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "ADSP" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +partition_usage = "0x23" +[[signed_pkg.module]] +name = "ADSP.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x40000" + +[module] +count = 7 + [[module.entry]] + name = "BRNGUP" + uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] From fe4dcaa62c13888d4535945ef33f86629aedc430 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrianx.warecki@intel.com> Date: Fri, 11 Feb 2022 11:53:13 +0100 Subject: [PATCH 230/639] mtl: Add ASRC module to the manifest Added ASRC module to config/mtl.toml Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com> --- config/mtl.toml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 1de62e5414a3..9e94f8b60bc1 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 7 +count = 8 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -208,3 +208,35 @@ count = 7 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "ASRC" + uuid = "66B4402D-B468-42F2-81A7-B37121863DD4" + affinity_mask = "0x3" + instance_count = "2" + domain_types = "0" + + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + mod_cfg = [0, 0, 0, 0, 20480, 4065600, 24, 22, 0, 0, 0, + 1, 0, 0, 0, 20480, 5616000, 8, 25, 0, 0, 0, + 2, 0, 0, 0, 20480, 7319200, 24, 27, 0, 0, 0, + 3, 0, 0, 0, 20480, 9155300, 8, 27, 0, 0, 0, + 4, 0, 0, 0, 20480, 10972600, 48, 54, 0, 0, 0, + 5, 0, 0, 0, 20480, 12661000, 16, 36, 0, 0, 0, + 6, 0, 0, 0, 20480, 14448500, 48, 96, 0, 0, 0, + 7, 0, 0, 0, 20480, 16145000, 19, 68, 0, 0, 0, + 8, 0, 0, 0, 20480, 17861300, 45, 102, 0, 0, 0, + 9, 0, 0, 0, 20480, 21425900, 8, 36, 0, 0, 0, + 10, 0, 0, 0, 20480, 22771000, 32, 102, 0, 0, 0, + 11, 0, 0, 0, 20480, 23439000, 48, 27, 0, 0, 0, + 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, + 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, + 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] From 8ba3d17296563af5166f2f59448e9c21e11194bf Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Fri, 11 Mar 2022 14:00:30 +0100 Subject: [PATCH 231/639] adsp_config: fix name parsing error in parse_signed_pkg_ace_v1_5 Fix name parsing error in parse_signed_pkg_ace_v1_5 Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- src/adsp_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index efd21e86920a..96152e185714 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1304,7 +1304,7 @@ static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx out->ext_len = sizeof(struct signed_pkg_info_ext_ace_v1_5); /* configurable fields */ - parse_str_key(signed_pkg, &ctx, "name", (char *)out->name, sizeof(out->name), &ret); + parse_printable_key(signed_pkg, &ctx, "name", out->name, sizeof(out->name), &ret); if (ret < 0) return ret; @@ -1356,7 +1356,7 @@ static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx /* non-configurable fields */ /* configurable fields */ - parse_str_key(module, &ctx, "name", (char *)mod->name, sizeof(mod->name), &ret); + parse_printable_key(module, &ctx, "name", mod->name, sizeof(mod->name), &ret); if (ret < 0) return err_key_parse("module", NULL); From 73a9d7c897d3658486dc5cb5d69c7a587dfc042a Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Thu, 16 Jun 2022 10:00:18 +0300 Subject: [PATCH 232/639] rimage: fix openssl 3.0 support in ver25 signing Fix a misunderstanding with openssl APIs and don't "double sign" the binary. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- src/pkcs1_5.c | 55 ++++----------------------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 62ba0ea062b0..2f46f4b4f346 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -200,11 +200,8 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, unsigned char *digest, unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; - EVP_PKEY_CTX *ctx2 = NULL; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; size_t siglen = MAN_RSA_SIGNATURE_LEN; size_t sig_in = MAN_RSA_SIGNATURE_LEN_2_5; - size_t sig_out = MAN_RSA_SIGNATURE_LEN_2_5; int ret; ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); @@ -234,30 +231,11 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, goto out; } - ret = EVP_PKEY_sign(ctx, sig, &sig_in, digest, SHA384_DIGEST_LENGTH); + ret = EVP_PKEY_sign(ctx, signature, &sig_in, digest, SHA384_DIGEST_LENGTH); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); goto out; } - - /* encryption done with different context */ - ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); - if (!ctx) - return -ENOMEM; - - ret = EVP_PKEY_encrypt_init(ctx2); - if (ret <= 0) - goto out; - - ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); - if (ret <= 0) { - fprintf(stderr, "error: failed to set 0 padding \n"); - goto out; - } - - ret = EVP_PKEY_encrypt(ctx2, signature, &sig_out, sig, sig_in); - if (ret <= 0) - fprintf(stderr, "error: failed to encrypt signature\n"); } else { ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); @@ -273,8 +251,6 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, out: EVP_PKEY_CTX_free(ctx); - if (ctx2) - EVP_PKEY_CTX_free(ctx2); return ret; } @@ -331,9 +307,7 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver unsigned char *digest, unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; - EVP_PKEY_CTX *ctx2 = NULL; size_t siglen = MAN_RSA_SIGNATURE_LEN; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; size_t siglen25 = MAN_RSA_SIGNATURE_LEN_2_5; char err_buf[256]; int ret; @@ -369,34 +343,15 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver if (ret <= 0) goto out; - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); + ret = EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, 32); if (ret <= 0) goto out; - /* decrypt signature */ - ctx2 = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); - if (!ctx) - return -ENOMEM; - - ret = EVP_PKEY_decrypt_init(ctx2); + ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); if (ret <= 0) goto out; - ret = EVP_PKEY_CTX_set_rsa_padding(ctx2, RSA_NO_PADDING); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: set padding %s\n", err_buf); - goto out; - } - - ret = EVP_PKEY_decrypt(ctx2, sig, &siglen25, signature, siglen25); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: decrypt %s\n", err_buf); - goto out; - } - - ret = EVP_PKEY_verify(ctx, sig, siglen25, digest, SHA384_DIGEST_LENGTH); + ret = EVP_PKEY_verify(ctx, signature, siglen25, digest, SHA384_DIGEST_LENGTH); if (ret <= 0) { ERR_error_string(ERR_get_error(), err_buf); fprintf(stderr, "error: verify %s\n", err_buf); @@ -409,8 +364,6 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver out: EVP_PKEY_CTX_free(ctx); - if (ctx2) - EVP_PKEY_CTX_free(ctx2); return ret; } From 02abc5d342a3ee6965bdc933ea1439d85d0256da Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Thu, 16 Jun 2022 10:10:52 +0300 Subject: [PATCH 233/639] rimage: ace signing functions need openssl 3.0 guards Ace signing functions need guards for not to use deprecated openssl functions and thus fail the compilation. Openssl3 implementation needs to be done as the added stub now returns just -EINVAL. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- src/pkcs1_5.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 2f46f4b4f346..23bb0f4a6132 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -529,6 +529,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, * extensions, and excluding the last 3 fields of the * manifest header (Public Key, Exponent and Signature). */ +#if OPENSSL_VERSION_NUMBER < 0x30000000L int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, struct fw_image_manifest_ace_v1_5 *man, void *ptr1, unsigned int size1, void *ptr2, @@ -624,6 +625,15 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, EVP_PKEY_free(privkey); return ret; } +#else +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + return -EINVAL; +} +#endif int pkcs_v1_5_sign_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, From 452847ddc04ebf865e3e03926cc3298db4b66a81 Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Tue, 7 Jun 2022 12:43:02 +0200 Subject: [PATCH 234/639] mtl: Add SRC module to the manifest Added SRC module to config/mtl.toml. Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 9e94f8b60bc1..36a3b18edd95 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 8 +count = 9 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -240,3 +240,43 @@ count = 8 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + + [[module.entry]] + name = "SRC" + uuid = "E61BB28D-149A-4C1F-B709-46823EF5F5AE" + affinity_mask = "0x1" + #instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] From 12bb32712266202a39ec716e9f6a3ee2050ff9ae Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Wed, 22 Jun 2022 12:17:21 +0300 Subject: [PATCH 235/639] toml: add tgl-h config file for IPC4 tgl-h target is missing the IPC4 toml config file, so add it. tgl-h-cavs.toml is a direct copy from tgl-cavs.toml, only the image size has been changed. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- config/tgl-h-cavs.toml | 215 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 config/tgl-h-cavs.toml diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml new file mode 100644 index 000000000000..b5c55d5319fa --- /dev/null +++ b/config/tgl-h-cavs.toml @@ -0,0 +1,215 @@ +version = [2, 5] + +[adsp] +name = "tgl" +image_size = "0x1F0000" # (30 + 1) bank * 64KB + +[[adsp.mem_zone]] +type = "ROM" +base = "0x9F180000" +size = "0x00002000" +[[adsp.mem_zone]] +type = "IMR" +base = "0xB0000000" +size = "0x1000000" +[[adsp.mem_zone]] +type = "HP-SRAM" +base = "0xBE000000" +size = "0x800000" +[[adsp.mem_zone]] +type = "LP-SRAM" +base = "0xBE800000" +size = "0x40" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "cavs0015.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "cavs0015" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +[[signed_pkg.module]] +name = "cavs0015.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x30000" + +[module] +count = 7 + [[module.entry]] + name = "BRNGUP" + uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "383B9BE2-3518-4DB0-8891-B1470A8914F8" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x1ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + From 5504179137c56948abaa77ec5c137dc8cf3c336f Mon Sep 17 00:00:00 2001 From: jxstelter <Jaroslaw.Stelter@intel.com> Date: Fri, 24 Jun 2022 12:01:19 +0200 Subject: [PATCH 236/639] Add lib_code module type. External libraries can contain processing module code or common library code. Library manager need to distinguish between both type of modules for proper loading. Signed-off-by: Jaroslaw Stelter <jaroslaw.stelter@intel.com> --- src/include/rimage/sof/user/manifest.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index d7c3d3d98afa..9d410ca3cf86 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -31,7 +31,8 @@ struct sof_man_module_type { uint32_t auto_start:1; uint32_t domain_ll:1; uint32_t domain_dp:1; - uint32_t rsvd_:25; + uint32_t lib_code:1; + uint32_t rsvd_:24; }; /* segment flags.type */ From d94cfc9cc6dc2e7cd6b9fc07a6c6fc2da8717fe9 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 27 Jun 2022 15:33:35 +0800 Subject: [PATCH 237/639] mtl: add MicSel support Add MicSel config int mtl.toml Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 36a3b18edd95..babec1d72e7c 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 9 +count = 10 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -280,3 +280,22 @@ count = 9 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] From d50aefcb6375960c58c8f7ef25a05b8eabec9e28 Mon Sep 17 00:00:00 2001 From: "Dobrowolski, PawelX" <pawelx.dobrowolski@intel.com> Date: Wed, 20 Jul 2022 15:25:25 +0200 Subject: [PATCH 238/639] manifest max size for loadable modules Library manager during loading modules needs manifest max size Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com> --- src/include/rimage/manifest.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 819f398b2c89..a1c9e39ec174 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -13,6 +13,7 @@ #include <rimage/plat_auth.h> #define MAN_PAGE_SIZE 4096 +#define MAN_MAX_SIZE_V1_8 (38 * 1024) /* start offset for modules built using xcc */ #define DEFAULT_XCC_MOD_OFFSET 0x8 From 6b4848e25d8aaabdf6cd9d402db9a02e5c62ae56 Mon Sep 17 00:00:00 2001 From: Arsen Eloglian <ArsenX.Eloglian@intel.com> Date: Thu, 11 Aug 2022 11:32:48 +0200 Subject: [PATCH 239/639] mtl: Add UPDWMIX module to the manifest Added Up Down Mixer module to config/mtl.toml Increased modules count. Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com> --- config/mtl.toml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index babec1d72e7c..2ca9659c2e91 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 10 +count = 11 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -299,3 +299,28 @@ count = 10 mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "UPDWMIX" + uuid = "42F8060C-832F-4DBF-B247-51E961997B34" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "1" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xffff, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 216, 706000, 12, 16, 0, 0, 0, + 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, + 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, + 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 216, 3343000, 192, 192, 0, 0, 0, + 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, + 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] From 5b076f17384c51a0fbe4ed86fa19cbcbab33b7b6 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Tue, 30 Aug 2022 09:20:34 +0200 Subject: [PATCH 240/639] config: tgl-cavs: add probe module Add probe module to tgl-cavs config Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/tgl-cavs.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 62448e347d73..446a71255d5b 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 7 +count = 8 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -213,3 +213,17 @@ count = 7 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + From 542924d70c1715671ad8213440f01dc6dadb52e4 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Tue, 30 Aug 2022 09:24:42 +0200 Subject: [PATCH 241/639] config: tgl-h-cavs: add probe module Add probe module to tgl-h-cavs config Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/tgl-h-cavs.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index b5c55d5319fa..bb38c790e3dc 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 7 +count = 8 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -213,3 +213,17 @@ count = 7 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + From fb28357912da32d90b9fabbdfefaa28553b1d20a Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Tue, 30 Aug 2022 09:26:34 +0200 Subject: [PATCH 242/639] config: mtl: add probe module Add probe module to mtl config Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 2ca9659c2e91..54682ac9af00 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 11 +count = 12 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -324,3 +324,17 @@ count = 11 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "10" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] From a1b6e6db33abb2702a242db1c9417b9fef81bc5b Mon Sep 17 00:00:00 2001 From: Damian Nikodem <damian.nikodem@intel.com> Date: Thu, 8 Sep 2022 17:36:49 +0200 Subject: [PATCH 243/639] manifest: add fw_ver_micro to manifest Pass fw_ver_micro value to manifest. Signed-off-by: Damian Nikodem <damian.nikodem@intel.com> --- src/manifest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/manifest.c b/src/manifest.c index 7c8b46aa8c21..c7a37266f198 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1413,6 +1413,7 @@ int man_write_fw_ace_v1_5(struct image *image) m->css.version.build_version = image->fw_ver_build; m->desc.header.major_version = image->fw_ver_major; m->desc.header.minor_version = image->fw_ver_minor; + m->desc.header.hotfix_version = image->fw_ver_micro; m->desc.header.build_version = image->fw_ver_build; m->desc.header.feature_mask = 0x2; // -> should be feature mask - to fix From d957e0368b8671ca52fed422ffe9384e8f899de8 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Tue, 27 Sep 2022 08:36:00 +0300 Subject: [PATCH 244/639] rimage: make ace15 signing to support openssl3 Ace signing is currently missing openssl3 support, so let's add it. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- src/include/rimage/rimage.h | 10 ++- src/pkcs1_5.c | 148 +++++++++++++++++++----------------- 2 files changed, 85 insertions(+), 73 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 0f719dc5b9ed..e4117f3f3c6c 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -190,9 +190,9 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, - struct fw_image_manifest_ace_v1_5 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2); + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int verify_image(struct image *image); int ri_manifest_verify_v1_5(struct image *image); @@ -209,6 +209,10 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, struct fw_image_manifest_v2_5 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2); +int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2); int resign_image(struct image *image); int get_key_size(struct image *image); diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 23bb0f4a6132..2f58b8720269 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -29,7 +29,8 @@ enum manver { V15 = 0, V18 = 1, - V25 = 2 + V25 = 2, + VACE15 = 3 }; static void bytes_swap(uint8_t *ptr, uint32_t size) @@ -183,6 +184,8 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, signature, &siglen, priv_rsa); break; case V25: + /* fallthrough */ + case VACE15: ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest, image->md, /* salt length */ 32); if (ret > 0) @@ -212,7 +215,7 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, if (ret <= 0) goto out; - if (ver == V25) { + if (ver == V25 || ver == VACE15) { ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); if (ret <= 0) { fprintf(stderr, "error: failed to set rsa padding\n"); @@ -281,6 +284,8 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver } break; case V25: + /* fallthrough */ + case VACE15: /* decrypt signature */ ret = RSA_public_decrypt(RSA_size(priv_rsa), signature, sig, priv_rsa, RSA_NO_PADDING); @@ -339,6 +344,8 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver break; case V25: + /* fallthrough */ + case VACE15: ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); if (ret <= 0) goto out; @@ -523,26 +530,14 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, return ret; } -/* - * RSA signature of manifest. The signature is an RSA PSS - * of the entire manifest structure, including all - * extensions, and excluding the last 3 fields of the - * manifest header (Public Key, Exponent and Signature). - */ -#if OPENSSL_VERSION_NUMBER < 0x30000000L -int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, - struct fw_image_manifest_ace_v1_5 *man, +int pkcs_v1_5_sign_man_v2_5(struct image *image, + struct fw_image_manifest_v2_5 *man, void *ptr1, unsigned int size1, void *ptr2, unsigned int size2) { - RSA *priv_rsa = NULL; EVP_PKEY *privkey; - FILE *fp; - const BIGNUM *n, *e, *d; unsigned char digest[SHA384_DIGEST_LENGTH]; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; - unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; - char path[256]; int ret = -EINVAL, i; #if DEBUG_PKCS @@ -550,33 +545,12 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); #endif - /* require private key */ - if (!image->key_name) { - return -EINVAL; - } - - /* create new PSS key */ - privkey = EVP_PKEY_new(); - if (!privkey) - return -ENOMEM; - - /* load in RSA private key from PEM file */ - memset(path, 0, sizeof(path)); - strncpy(path, image->key_name, sizeof(path) - 1); - - fprintf(stdout, " pkcs: PSS signing with key %s\n", path); - fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } - PEM_read_PrivateKey(fp, &privkey, NULL, NULL); - fclose(fp); + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; /* validate RSA private key */ - priv_rsa = EVP_PKEY_get1_RSA(privkey); - if (RSA_check_key(priv_rsa)) { + if (rimage_check_key(privkey) > 0) { fprintf(stdout, " pkcs: RSA private key is valid.\n"); } else { fprintf(stderr, "error: validating RSA private key.\n"); @@ -595,25 +569,15 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, - digest, image->md, /* salt length */ 32); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to sign manifest %s\n", path); - } - - /* encrypt the signature using the private key */ - ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, - (unsigned char *)man->css.signature, priv_rsa, RSA_NO_PADDING); + ret = rimage_sign(privkey, image, V25, digest, + (unsigned char *)man->css.signature); if (ret <= 0) { - ERR_error_string(ERR_get_error(), path); - fprintf(stderr, "error: failed to encrypt signature %s\n", path); + fprintf(stderr, "error: failed to sign manifest\n"); + return ret; } /* copy public key modulus and exponent to manifest */ - RSA_get0_key(priv_rsa, &n, &e, &d); - BN_bn2bin(n, mod); - BN_bn2bin(e, (unsigned char *)man->css.exponent); + rimage_set_modexp(privkey, mod, (unsigned char *)man->css.exponent); /* modulus is reversed */ for (i = 0; i < MAN_RSA_KEY_MODULUS_LEN_2_5; i++) @@ -625,20 +589,11 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, EVP_PKEY_free(privkey); return ret; } -#else -int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, - struct fw_image_manifest_ace_v1_5 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2) -{ - return -EINVAL; -} -#endif -int pkcs_v1_5_sign_man_v2_5(struct image *image, - struct fw_image_manifest_v2_5 *man, - void *ptr1, unsigned int size1, void *ptr2, - unsigned int size2) +int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) { EVP_PKEY *privkey; unsigned char digest[SHA384_DIGEST_LENGTH]; @@ -674,7 +629,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, fprintf(stdout, "\n"); /* sign the manifest */ - ret = rimage_sign(privkey, image, V25, digest, + ret = rimage_sign(privkey, image, VACE15, digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); @@ -935,6 +890,59 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, return ret; } +int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, + struct fw_image_manifest_ace_v1_5 *man, + void *ptr1, unsigned int size1, void *ptr2, + unsigned int size2) +{ + EVP_PKEY *privkey; + unsigned char digest[SHA384_DIGEST_LENGTH]; + int ret = -EINVAL, i; + +#if DEBUG_PKCS + fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", + ptr1 - (void *)man, size1, ptr2 - (void *)man, size2); +#endif + + ret = rimage_read_key(&privkey, image); + if (ret < 0) + return ret; + + /* validate RSA private key */ + if (rimage_check_key(privkey) > 0) { + fprintf(stdout, " pkcs: RSA private key is valid.\n"); + } else { + fprintf(stderr, "error: validating RSA private key.\n"); + return -EINVAL; + } + + /* calculate the digest - SHA384 on CAVS2_5+ */ + module_sha384_create(image); + module_sha_update(image, ptr1, size1); + module_sha_update(image, ptr2, size2); + module_sha_complete(image, digest); + + fprintf(stdout, " pkcs: digest for manifest is "); + for (i = 0; i < SHA384_DIGEST_LENGTH; i++) + fprintf(stdout, "%02x", digest[i]); + fprintf(stdout, "\n"); + + /* signature is reversed, swap it */ + bytes_swap(man->css.signature, sizeof(man->css.signature)); + + /* verify */ + ret = rimage_verify(privkey, image, VACE15, digest, + (unsigned char *)man->css.signature); + + if (ret <= 0) + fprintf(stderr, "error: failed to verify manifest\n"); + else + fprintf(stdout, "pkcs: signature is valid !\n"); + + EVP_PKEY_free(privkey); + return ret; +} + int ri_manifest_verify_v1_5(struct image *image) { struct fw_image_manifest_v1_5 *man = image->fw_image; From dcfd11bc4d5b85d258666825c287e62df790ab5d Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Mon, 10 Oct 2022 16:11:36 +0200 Subject: [PATCH 245/639] mux: add mux cfg to list of modules No mux in the manifest Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 54682ac9af00..a9c59932eb20 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 12 +count = 13 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -338,3 +338,21 @@ count = 12 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + + [[module.entry]] + name = "MUX" + uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "1" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] \ No newline at end of file From 1f4a36e21f0002b536a4a80d58d3f82ad034f291 Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Thu, 13 Oct 2022 14:49:22 +0200 Subject: [PATCH 246/639] mux: fix module type error: invalid type /error: key 'module' parsing error Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index a9c59932eb20..3e0d3b0f5841 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -346,7 +346,7 @@ count = 13 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "0xB" + module_type = "11" auto_start = "0" sched_caps = [1, 0x00008000] From 3ee717eebc6a2a512a0216363ae77473f94532c1 Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Thu, 13 Oct 2022 15:22:09 +0200 Subject: [PATCH 247/639] probe: mtl.toml invaliv probe type error: invalid type 16error: key 'module' parsing error probe module type is 10,which is treated hexally Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 3e0d3b0f5841..1066af98c329 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -332,7 +332,7 @@ count = 13 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "10" + module_type = "0xA" auto_start = "0" sched_caps = [1, 0x00008000] @@ -346,7 +346,7 @@ count = 13 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "11" + module_type = "0xB" auto_start = "0" sched_caps = [1, 0x00008000] From 85a2d1ebc9f54afecbb16fc2c47713c6156e521b Mon Sep 17 00:00:00 2001 From: Ievgen Ganakov <ievgen.ganakov@intel.com> Date: Tue, 8 Nov 2022 08:57:10 +0100 Subject: [PATCH 248/639] config: mtl: add kd module Add KD module config Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com> --- config/mtl.toml | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 1066af98c329..5570dc810ad0 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 13 +count = 14 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -338,7 +338,7 @@ count = 13 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] - + [[module.entry]] name = "MUX" uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" @@ -354,5 +354,24 @@ count = 13 pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xC" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] \ No newline at end of file + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] From 6623073ca84dbc1e5ed7f30d9cceeb3b0161d67e Mon Sep 17 00:00:00 2001 From: Ievgen Ganakov <ievgen.ganakov@intel.com> Date: Tue, 8 Nov 2022 08:59:24 +0100 Subject: [PATCH 249/639] config: mtl: add kpb module Add KPB module config Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com> --- config/mtl.toml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 5570dc810ad0..0baff95c135a 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 14 +count = 15 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -375,3 +375,21 @@ count = 14 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xD" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] From f51ff46635ed62c6e5ac03b300eb564eb16ccf26 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 21 Nov 2022 13:50:23 +0800 Subject: [PATCH 250/639] rimage: remove incorrect module order check The original check for "i - 1 == type" is used to make sure that all modules in toml file are in order from 0 to max continuously. But the problem is that some modules are not supported now or some modules share the same module type of efx, so this check is incorrect. Signed-off-by: Rander Wang <rander.wang@intel.com> --- src/adsp_config.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 96152e185714..2f10e5c847da 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2201,13 +2201,6 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("module_type", NULL); - if (strcmp((char *)mod_man->name, "BRNGUP") && - strcmp((char *)mod_man->name, "BASEFW")) { - if (type != i - 1) { - log_err(ret, "error: invalid type %d", type); - return -EINVAL; - } - } header->module_type = type; ret = parse_scheduling(mod_entry, &ctx_entry, From fe5b959adbebaf66ba7c7c087b53412d6bea1f43 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Tue, 22 Nov 2022 14:12:33 +0800 Subject: [PATCH 251/639] rimage: correct module type Currently some module types are incorrect and it was set by the change sequence. The module type is used by windows driver not Linux driver. It is defined in the following enum definition in cavs_ext_manifest.h. UpDwMix module type is 5, Mux is 6 kpb is 11, and Selector is 12. The module ASRC, GAIN, PROBE are type of efx (9) according to spec. enum mod_type { ebasefw = 0, emixin, emixout, ecopier, epeakvol, eupdwmix, emux, esrc, ewov, efx, eaec, ekpb, emicselect, efxf, /*i.e.SmartAmp */ eaudclass, efakecopier, eiodriver, ewhm, egdbstub, esensing, emax, einvalid = emax } ; Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 0baff95c135a..6b5fa1fa9276 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -192,7 +192,7 @@ count = 15 instance_count = "40" domain_types = "0" load_type = "0" - module_type = "5" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -217,7 +217,7 @@ count = 15 domain_types = "0" load_type = "0" - module_type = "6" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -288,7 +288,7 @@ count = 15 instance_count = "8" domain_types = "0" load_type = "0" - module_type = "8" + module_type = "12" auto_start = "0" sched_caps = [1, 0x00008000] @@ -307,7 +307,7 @@ count = 15 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "9" + module_type = "5" auto_start = "0" sched_caps = [1, 0x00008000] @@ -332,7 +332,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "0xA" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -346,7 +346,7 @@ count = 15 instance_count = "15" domain_types = "0" load_type = "1" - module_type = "0xB" + module_type = "6" auto_start = "0" sched_caps = [1, 0x00008000] @@ -365,7 +365,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "1" - module_type = "0xC" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -383,7 +383,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "1" - module_type = "0xD" + module_type = "0xB" auto_start = "0" sched_caps = [1, 0x00008000] From 65f345a52e06a084192124364c563d8133d834c2 Mon Sep 17 00:00:00 2001 From: Gongjun Song <gongjun.song@intel.com> Date: Mon, 17 Oct 2022 19:01:40 +0800 Subject: [PATCH 252/639] rimage: add src support Add src's params to rimage Signed-off-by: Gongjun Song <gongjun.song@intel.com> --- config/tgl-cavs.toml | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 446a71255d5b..088271d74790 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 8 +count = 9 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -227,3 +227,42 @@ count = 8 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + [[module.entry]] + name = "SRCINTC" + uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" + affinity_mask = "0xF" + instance_count = "10" + domain_types = "1" + load_type = "0" + module_type = "0x7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x45ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] From 082b6261c9dc54d0e5587a57f67b02d3d973fc8d Mon Sep 17 00:00:00 2001 From: Tinghan Shen <tinghan.shen@mediatek.com> Date: Tue, 28 Jun 2022 12:01:06 +0800 Subject: [PATCH 253/639] config: Add mt8188.toml Add mt8188.toml to support sof-mt8188.ri binary build. Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com> --- config/mt8188.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/mt8188.toml diff --git a/config/mt8188.toml b/config/mt8188.toml new file mode 100644 index 000000000000..0dcc4b4b3244 --- /dev/null +++ b/config/mt8188.toml @@ -0,0 +1,15 @@ +version = [1, 0] # parse_adsp_config_v1_0() + +[adsp] +name = "mt8188" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x4e100000" +size = "0x00080000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60000000" +size = "0x00600000" +host_offset = "0x0" From 1c48208850c91322b033d5d59fb1a0b4e6648e20 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Thu, 8 Dec 2022 13:44:22 +0800 Subject: [PATCH 254/639] config: tgl-cavs: add smart amp test module config This patch adds module config for smart amp test module. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/tgl-cavs.toml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 088271d74790..53bef8963cf2 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 9 +count = 10 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -266,3 +266,23 @@ count = 9 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From bdba8259fe3c557bf02008b0cb51d58ecf533188 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 23 Dec 2022 12:07:04 +0100 Subject: [PATCH 255/639] Add a command line option to set an Intel-specific PV bit Add a '-p' command line flag to set Intel reserved bit in IMR area. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 1 - src/rimage.c | 21 ++++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 2f10e5c847da..25091940afbf 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -929,7 +929,6 @@ static int parse_css_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, return ret; /* hardcoded to align with meu */ - out->reserved0 = 0; out->reserved1[0] = 0xf; out->reserved1[1] = 0x048e0000; // TODO: what is this ? diff --git a/src/rimage.c b/src/rimage.c index 617656852c83..96194977c367 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -31,6 +31,7 @@ static void usage(char *name) fprintf(stdout, "\t -e build extended manifest\n"); fprintf(stdout, "\t -y verify signed file\n"); fprintf(stdout, "\t -q resign binary\n"); + fprintf(stdout, "\t -p set PV bit\n"); } int main(int argc, char *argv[]) @@ -41,10 +42,11 @@ int main(int argc, char *argv[]) int opt, ret, i, first_non_opt; int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; + unsigned int pv_bit = 0; memset(&image, 0, sizeof(image)); - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -88,6 +90,9 @@ int main(int argc, char *argv[]) case 'q': image.in_file = optarg; break; + case 'p': + pv_bit = 1; + break; default: /* getopt's default error message is good enough */ return 1; @@ -163,15 +168,21 @@ int main(int argc, char *argv[]) return resign_image(&image); } - /* set IMR Type in found machine definition */ - if (image.adsp->man_v1_8) + /* set IMR Type and the PV bit in found machine definition */ + if (image.adsp->man_v1_8) { image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v1_8->css.reserved0 = pv_bit; + } - if (image.adsp->man_v2_5) + if (image.adsp->man_v2_5) { image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v2_5->css.reserved0 = pv_bit; + } - if (image.adsp->man_ace_v1_5) + if (image.adsp->man_ace_v1_5) { image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; + } /* parse input ELF files */ image.num_modules = argc - first_non_opt; From f3eef3cfb6ffd7d519d513e9cb28b52f063aaf89 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Tue, 3 Jan 2023 10:55:39 +0100 Subject: [PATCH 256/639] Fix IMR type parsing The IMR type can be specified either in the TOML configuration file or on the command line. The command line value should override the one from the configuration file. But the current code overwrites the configuration file value with the default value even if no value has been specified on the command line, which is wrong. Fix this by using the default value when reading the configuration file and only overwriting it when the respective command line parameter is used. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 6 ++++-- src/rimage.c | 11 ++++++++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 25091940afbf..8d213e93f7cd 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1579,7 +1579,8 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8); /* configurable fields */ - out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", + MAN_DEFAULT_IMR_TYPE, &ret); if (ret < 0) return ret; @@ -1699,7 +1700,8 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5); /* configurable fields */ - out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", + MAN_DEFAULT_IMR_TYPE, &ret); if (ret < 0) return ret; diff --git a/src/rimage.c b/src/rimage.c index 96194977c367..7c985e1570e4 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; unsigned int pv_bit = 0; + bool imr_type_override = false; memset(&image, 0, sizeof(image)); @@ -68,6 +69,7 @@ int main(int argc, char *argv[]) break; case 'i': imr_type = atoi(optarg); + imr_type_override = true; break; case 'f': image.fw_ver_string = optarg; @@ -170,17 +172,20 @@ int main(int argc, char *argv[]) /* set IMR Type and the PV bit in found machine definition */ if (image.adsp->man_v1_8) { - image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; image.adsp->man_v1_8->css.reserved0 = pv_bit; } if (image.adsp->man_v2_5) { - image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; image.adsp->man_v2_5->css.reserved0 = pv_bit; } if (image.adsp->man_ace_v1_5) { - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; } From ba8534bb237881beb281c56f5d03d92fa67eb0ec Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 23 Dec 2022 16:02:33 +0100 Subject: [PATCH 257/639] Fix bitmap according to the IMR type When the IMR type is set to 4, the default bitmap field #4 must be 0x10. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 61 +++++++++++++++++++------------- src/include/rimage/adsp_config.h | 2 +- src/include/rimage/rimage.h | 4 ++- src/rimage.c | 13 +++---- 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 8d213e93f7cd..7f7fccb23146 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -974,8 +974,10 @@ static void dump_signed_pkg(const struct signed_pkg_info_ext *signed_pkg) } static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, - struct signed_pkg_info_ext *out, bool verbose) + struct image *image, bool verbose) { + struct adsp *adsp = image->adsp; + struct signed_pkg_info_ext *out = &adsp->man_v1_8->signed_pkg; struct signed_pkg_info_module *mod; toml_array_t *bitmap_array; toml_array_t *module_array; @@ -1022,8 +1024,8 @@ static int parse_signed_pkg(const toml_table_t *toml, struct parse_ctx *pctx, /* bitmap array */ bitmap_array = toml_array_in(signed_pkg, "bitmap"); if (!bitmap_array) { - /* default value */ - out->bitmap[4] = 8; + /* default value, depending on the IMR type */ + out->bitmap[4] = image->imr_type == 4 ? 0x10 : 0x8; } else { ++ctx.array_cnt; if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || @@ -1130,8 +1132,10 @@ static void dump_signed_pkg_v2_5(const struct signed_pkg_info_ext_v2_5 *signed_p } static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pctx, - struct signed_pkg_info_ext_v2_5 *out, bool verbose) + struct image *image, bool verbose) { + struct adsp *adsp = image->adsp; + struct signed_pkg_info_ext_v2_5 *out = &adsp->man_v2_5->signed_pkg; struct signed_pkg_info_module_v2_5 *mod; toml_array_t *bitmap_array; toml_array_t *module_array; @@ -1178,8 +1182,8 @@ static int parse_signed_pkg_v2_5(const toml_table_t *toml, struct parse_ctx *pct /* bitmap array */ bitmap_array = toml_array_in(signed_pkg, "bitmap"); if (!bitmap_array) { - /* default value - some use 0x10*/ - out->bitmap[4] = 0x8; + /* default value, depending on the IMR type */ + out->bitmap[4] = image->imr_type == 4 ? 0x10 : 0x8; } else { ++ctx.array_cnt; if (toml_array_kind(bitmap_array) != 'v' || toml_array_type(bitmap_array) != 'i' || @@ -1281,8 +1285,10 @@ static void dump_signed_pkg_ace_v1_5(const struct signed_pkg_info_ext_ace_v1_5 * } static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx *pctx, - struct signed_pkg_info_ext_ace_v1_5 *out, bool verbose) + struct image *image, bool verbose) { + struct adsp *adsp = image->adsp; + struct signed_pkg_info_ext_ace_v1_5 *out = &adsp->man_ace_v1_5->signed_pkg; struct signed_pkg_info_module_ace_v1_5 *mod; toml_array_t *module_array; toml_table_t *signed_pkg; @@ -2240,9 +2246,10 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, return 0; } -static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v1_0(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2267,9 +2274,10 @@ static int parse_adsp_config_v1_0(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v1_5(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2333,9 +2341,10 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v1_8(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2370,7 +2379,7 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg(toml, &ctx, &out->man_v1_8->signed_pkg, verbose); + ret = parse_signed_pkg(toml, &ctx, image, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); @@ -2394,9 +2403,10 @@ static int parse_adsp_config_v1_8(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_v2_5(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2431,7 +2441,7 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg_v2_5(toml, &ctx, &out->man_v2_5->signed_pkg, verbose); + ret = parse_signed_pkg_v2_5(toml, &ctx, image, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); @@ -2459,9 +2469,10 @@ static int parse_adsp_config_v2_5(const toml_table_t *toml, struct adsp *out, return 0; } -static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct adsp *out, - bool verbose) +static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *image) { + struct adsp *out = image->adsp; + bool verbose = image->verbose; struct parse_ctx ctx; int ret; @@ -2495,7 +2506,7 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct adsp *out if (ret < 0) return err_key_parse("css", NULL); - ret = parse_signed_pkg_ace_v1_5(toml, &ctx, &out->man_ace_v1_5->signed_pkg, verbose); + ret = parse_signed_pkg_ace_v1_5(toml, &ctx, image, verbose); if (ret < 0) return err_key_parse("signed_pkg", NULL); @@ -2556,7 +2567,7 @@ static int parse_version(toml_table_t *toml, int64_t version[2]) struct config_parser { int major; int minor; - int (*parse)(const toml_table_t *toml, struct adsp *out, bool verbose); + int (*parse)(const toml_table_t *toml, struct image *image); }; static const struct config_parser *find_config_parser(int64_t version[2]) @@ -2580,7 +2591,7 @@ static const struct config_parser *find_config_parser(int64_t version[2]) return NULL; } -static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) +static int adsp_parse_config_fd(FILE *fd, struct image *image) { const struct config_parser *parser; int64_t manifest_version[2]; @@ -2607,14 +2618,14 @@ static int adsp_parse_config_fd(FILE *fd, struct adsp *out, bool verbose) } /* run dedicated parser */ - ret = parser->parse(toml, out, verbose); + ret = parser->parse(toml, image); error: toml_free(toml); return ret; } /* public function, fully handle parsing process */ -int adsp_parse_config(const char *file, struct adsp *out, bool verbose) +int adsp_parse_config(const char *file, struct image *image) { FILE *fd; int ret; @@ -2622,7 +2633,7 @@ int adsp_parse_config(const char *file, struct adsp *out, bool verbose) fd = fopen(file, "r"); if (!fd) return log_err(-EIO, "error: can't open '%s' file\n", file); - ret = adsp_parse_config_fd(fd, out, verbose); + ret = adsp_parse_config_fd(fd, image); fclose(fd); return ret; } diff --git a/src/include/rimage/adsp_config.h b/src/include/rimage/adsp_config.h index 8b98c1cb7087..e87c78c65f91 100644 --- a/src/include/rimage/adsp_config.h +++ b/src/include/rimage/adsp_config.h @@ -5,5 +5,5 @@ #include <rimage/rimage.h> #include <stdbool.h> -int adsp_parse_config(const char *file, struct adsp *out, bool verbose); +int adsp_parse_config(const char *file, struct image *image); void adsp_free(struct adsp *adsp); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e4117f3f3c6c..22fbda730cac 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -77,7 +77,7 @@ struct image { FILE *out_fd; void *pos; - const struct adsp *adsp; + struct adsp *adsp; int abi; int verbose; int reloc; /* ELF data is relocatable */ @@ -111,6 +111,8 @@ struct image { uint16_t fw_ver_minor; uint16_t fw_ver_micro; uint16_t fw_ver_build; + + uint32_t imr_type; }; struct mem_zone { diff --git a/src/rimage.c b/src/rimage.c index 7c985e1570e4..6aa4eabea844 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -40,13 +40,14 @@ int main(int argc, char *argv[]) struct adsp *heap_adsp; const char *adsp_config = NULL; int opt, ret, i, first_non_opt; - int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; unsigned int pv_bit = 0; bool imr_type_override = false; memset(&image, 0, sizeof(image)); + image.imr_type = MAN_DEFAULT_IMR_TYPE; + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) { switch (opt) { case 'o': @@ -68,7 +69,7 @@ int main(int argc, char *argv[]) image.reloc = 1; break; case 'i': - imr_type = atoi(optarg); + image.imr_type = atoi(optarg); imr_type_override = true; break; case 'f': @@ -155,7 +156,7 @@ int main(int argc, char *argv[]) } image.adsp = heap_adsp; memset(heap_adsp, 0, sizeof(*heap_adsp)); - ret = adsp_parse_config(adsp_config, heap_adsp, image.verbose); + ret = adsp_parse_config(adsp_config, &image); if (ret < 0) goto out; @@ -173,19 +174,19 @@ int main(int argc, char *argv[]) /* set IMR Type and the PV bit in found machine definition */ if (image.adsp->man_v1_8) { if (imr_type_override) - image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v1_8->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_v1_8->css.reserved0 = pv_bit; } if (image.adsp->man_v2_5) { if (imr_type_override) - image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_v2_5->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_v2_5->css.reserved0 = pv_bit; } if (image.adsp->man_ace_v1_5) { if (imr_type_override) - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; } From bdf48ee7e63779a804f709634e68d274090f510d Mon Sep 17 00:00:00 2001 From: Jaska Uimonen <jaska.uimonen@intel.com> Date: Wed, 4 Jan 2023 21:05:31 +0200 Subject: [PATCH 258/639] config: tgl-cavs: add fir and iir eq module config This patch adds module config for fir and iir eq module. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com> --- config/tgl-cavs.toml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 53bef8963cf2..d50c46fc45af 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -52,7 +52,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 10 +count = 12 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -286,3 +286,41 @@ count = 10 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From bc7d49dcfc154996599586fffc366a7147ec804e Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Wed, 1 Feb 2023 13:04:30 +0800 Subject: [PATCH 259/639] config: align module_type with mtl for tgl and tgl-h The module_type member in module config should be assigned according to the mod_type enum. Previously, for tgl and tgl-h, it is assigned in an incremental way, which is wrong. MTL assigns module_type in the correct way, so align the module_type with mtl for tgl and tgl-h in this patch. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/tgl-cavs.toml | 6 +++--- config/tgl-h-cavs.toml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index d50c46fc45af..b787ee611ebe 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -196,7 +196,7 @@ count = 12 instance_count = "40" domain_types = "0" load_type = "0" - module_type = "5" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -220,7 +220,7 @@ count = 12 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "6" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -275,7 +275,7 @@ count = 12 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "8" + module_type = "13" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index bb38c790e3dc..31b9d913b6d5 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -196,7 +196,7 @@ count = 8 instance_count = "40" domain_types = "0" load_type = "0" - module_type = "5" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -220,7 +220,7 @@ count = 8 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "6" + module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] From 3da7739b5f0cd4e2d338910d5ac88d17babb3180 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Wed, 1 Feb 2023 13:22:48 +0800 Subject: [PATCH 260/639] config: correct module config load_type The load_type in extended manifest is used to indicate if a module is a built-in module(0) or a loadable(1) module. We don't have loadable module yet, so load_type should be zero for all modules. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/mtl.toml | 12 ++++++------ config/tgl-cavs.toml | 4 ++-- config/tgl-h-cavs.toml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 6b5fa1fa9276..23a4f02aad73 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -56,7 +56,7 @@ count = 15 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -66,7 +66,7 @@ count = 15 affinity_mask = "3" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -306,7 +306,7 @@ count = 15 affinity_mask = "0x1" instance_count = "15" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "5" auto_start = "0" sched_caps = [1, 0x00008000] @@ -345,7 +345,7 @@ count = 15 affinity_mask = "0x1" instance_count = "15" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "6" auto_start = "0" sched_caps = [1, 0x00008000] @@ -364,7 +364,7 @@ count = 15 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "9" auto_start = "0" sched_caps = [1, 0x00008000] @@ -382,7 +382,7 @@ count = 15 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0xB" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index b787ee611ebe..6fcac3dc72e7 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -59,7 +59,7 @@ count = 12 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -69,7 +69,7 @@ count = 12 affinity_mask = "3" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 31b9d913b6d5..75429596e099 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -59,7 +59,7 @@ count = 8 affinity_mask = "0x1" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" @@ -69,7 +69,7 @@ count = 8 affinity_mask = "3" instance_count = "1" domain_types = "0" - load_type = "1" + load_type = "0" module_type = "0" auto_start = "0" From 7bc3cfc946a04cbceebf7d0202a6d490c85dca72 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 31 Jan 2023 16:03:06 +0800 Subject: [PATCH 261/639] config: mtl: add smart amp test module config This patch adds smart amp test module config for mtl. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/mtl.toml | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 23a4f02aad73..a805159446a7 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -49,7 +49,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 15 +count = 16 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -393,3 +393,23 @@ count = 15 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "13" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From ec649f37d661cb2853cf9e1338cc7f853b91e36d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 27 Jan 2023 12:59:42 +0100 Subject: [PATCH 262/639] Convert all ELF addresses to cached for calculations Rimage calculates sizes of ELF sections, for which it has to use addresses from the same address space: either all cached or all uncached. The ELF image itself can contain mixed addresses. Convert all to cached for internal calculations. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/tgl-cavs.toml | 8 +++++ src/adsp_config.c | 69 ++++++++++++++++++++++++++++++------- src/elf.c | 10 ++++-- src/include/rimage/rimage.h | 4 +++ 4 files changed, 76 insertions(+), 15 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 6fcac3dc72e7..4010f685d5f5 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -21,6 +22,13 @@ type = "LP-SRAM" base = "0xBE800000" size = "0x40" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/src/adsp_config.c b/src/adsp_config.c index 7f7fccb23146..7ad3ce4dbcdb 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -122,7 +122,7 @@ static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; - /* when eny field left unparsed, then raise error */ + /* when any field left unparsed, then raise error */ if (ctx->key_cnt != 0) ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); if (ctx->array_cnt != 0) @@ -360,14 +360,15 @@ static void dump_adsp(const struct adsp *adsp) static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct adsp *out, bool verbose) { - toml_array_t *mem_zone_array; - toml_table_t *mem_zone; + toml_array_t *mem_zone_array, *alias_array; struct mem_zone *zone; struct parse_ctx ctx; - char zone_name[32]; toml_table_t *adsp; toml_raw_t raw; int zone_idx; + char a_kind; + int a_size; + bool alias_found; int ret; int i; @@ -403,25 +404,67 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - /* check everything parsed, 1 table should be present */ - ctx.array_cnt += 1; + out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", 0, &ret); + alias_found = !ret; + + /* check everything parsed, 1 or 2 tables should be present */ + ctx.array_cnt += 1 + alias_found; ret = assert_everything_parsed(adsp, &ctx); if (ret < 0) return ret; + if (alias_found) { + alias_array = toml_array_in(adsp, "mem_alias"); + if (!alias_array) + return err_key_not_found("mem_alias"); + a_kind = toml_array_kind(alias_array); + a_size = toml_array_nelem(alias_array); + if (a_kind != 't' || a_size != 2) + return err_key_parse("mem_alias", "wrong array type %c or length %d", + a_kind, a_size); + + /* retrieve "cached" and "uncached" alias base addresses */ + for (i = 0; i < a_size; ++i) { + toml_table_t *alias = toml_table_at(alias_array, i); + char alias_name[16]; + uint32_t base; + + if (!alias) + return err_key_parse("mem_alias", NULL); + + parse_str_key(alias, &ctx, "type", alias_name, sizeof(alias_name), &ret); + if (ret < 0) + return err_key_parse("mem_alias", NULL); + + base = parse_uint32_hex_key(alias, &ctx, "base", -1, &ret); + + if (!strncmp("cached", alias_name, sizeof("cached"))) + out->alias_cached = base & out->alias_mask; + else if (!strncmp("uncached", alias_name, sizeof("uncached"))) + out->alias_uncached = base & out->alias_mask; + } + } else { + /* Make uncache_to_cache() an identity transform */ + out->alias_cached = 0; + out->alias_mask = 0; + } + /* look for entry array */ memset(out->mem_zones, 0, sizeof(out->mem_zones)); mem_zone_array = toml_array_in(adsp, "mem_zone"); if (!mem_zone_array) return err_key_not_found("mem_zone"); - if (toml_array_kind(mem_zone_array) != 't' || - toml_array_nelem(mem_zone_array) > SOF_FW_BLK_TYPE_NUM) - return err_key_parse("mem_zone", "wrong array type or length > %d", - SOF_FW_BLK_TYPE_NUM); + a_kind = toml_array_kind(mem_zone_array); + a_size = toml_array_nelem(mem_zone_array); + if (a_kind != 't' || a_size > SOF_FW_BLK_TYPE_NUM) + return err_key_parse("mem_zone", "wrong array type %c or length %d", + a_kind, a_size); /* parse entry array elements */ - for (i = 0; i < toml_array_nelem(mem_zone_array); ++i) { - mem_zone = toml_table_at(mem_zone_array, i); + for (i = 0; i < a_size; ++i) { + toml_table_t *mem_zone = toml_table_at(mem_zone_array, i); + char zone_name[32]; + if (!mem_zone) return err_key_parse("mem_zone", NULL); @@ -2617,7 +2660,7 @@ static int adsp_parse_config_fd(FILE *fd, struct image *image) goto error; } - /* run dedicated parser */ + /* run dedicated toml configuration parser */ ret = parser->parse(toml, image); error: toml_free(toml); diff --git a/src/elf.c b/src/elf.c index fc9232b66578..4218c025df54 100644 --- a/src/elf.c +++ b/src/elf.c @@ -12,6 +12,11 @@ #include <rimage/cse.h> #include <rimage/manifest.h> +static unsigned long uncache_to_cache(const struct image *image, unsigned long address) +{ + return ((address & ~image->adsp->alias_mask) | image->adsp->alias_cached); +} + static int elf_read_sections(struct image *image, struct module *module, int module_index) { @@ -110,6 +115,7 @@ static int elf_read_sections(struct image *image, struct module *module, continue; } + section[i].vaddr = uncache_to_cache(image, section[i].vaddr); module->num_sections++; if (!image->verbose) @@ -367,8 +373,8 @@ static void elf_module_limits(struct image *image, struct module *module) /* check programs to get LMA */ section_lma = section->vaddr; for (j = 0; j < module->hdr.phnum; j++) { - if (section->vaddr == module->prg[j].vaddr) { - section_lma = module->prg[j].paddr; + if (section->vaddr == uncache_to_cache(image, module->prg[j].vaddr)) { + section_lma = uncache_to_cache(image, module->prg[j].paddr); break; } } diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 22fbda730cac..8c4f2e98446c 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -153,6 +153,10 @@ struct adsp { uint32_t image_size; uint32_t dram_offset; + uint32_t alias_cached; + uint32_t alias_uncached; + uint32_t alias_mask; + int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); From 15ea48177a2b4cb93eaa9858e90a4da89f9f84b1 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 8 Feb 2023 10:02:55 -0800 Subject: [PATCH 263/639] src: adsp_config: Use reserved bits for module init config Use some of the reserved bits to add a new field, init_config, in struct sof_man_module_type. This will be used to specify the type of payload that the module expects. For now, the 2 options are to have the base config only or the base config with an extension that contains the pin formats. This can be extended in the future to support additional options for modules that need more than the base config or base config + extension. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/adsp_config.c | 5 +++++ src/include/rimage/sof/user/manifest.h | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 7ad3ce4dbcdb..76de00a5428a 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2236,6 +2236,11 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, if (ret < 0) return err_key_parse("load_type", NULL); + mod_man->type.init_config = parse_uint32_hex_key(mod_entry, &ctx_entry, + "init_config", 1, &ret); + if (ret < 0) + return err_key_parse("init_config", NULL); + mod_man->type.auto_start = parse_uint32_hex_key(mod_entry, &ctx_entry, "auto_start", 1, &ret); if (ret < 0) diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index 9d410ca3cf86..e49a76f76fcb 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -26,13 +26,18 @@ #define SOF_MAN_MOD_TYPE_BUILTIN 0 #define SOF_MAN_MOD_TYPE_MODULE 1 +/* module init config */ +#define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG 0 /* Base config only */ +#define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG_WITH_EXT 1 /* Base config with extension */ + struct sof_man_module_type { uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ uint32_t auto_start:1; uint32_t domain_ll:1; uint32_t domain_dp:1; uint32_t lib_code:1; - uint32_t rsvd_:24; + uint32_t init_config:4; /* SOF_MAN_MOD_INIT_CONFIG_ */ + uint32_t rsvd_:20; }; /* segment flags.type */ From b5d762290f1aed7bb02b60dd5139169ccea09e4f Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 8 Feb 2023 10:05:51 -0800 Subject: [PATCH 264/639] config: tgl-cavs: set init_config for smart test Smart amp needs the base config extension during init. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- config/tgl-cavs.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 4010f685d5f5..8b5960d52923 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -284,6 +284,7 @@ count = 12 domain_types = "0" load_type = "0" module_type = "13" + init_config = "1" auto_start = "0" sched_caps = [1, 0x00008000] From d48ae7aadaa4806a12cc3a73b8d28ceb232911ce Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 8 Feb 2023 10:06:49 -0800 Subject: [PATCH 265/639] config: mtl: Set init_config for smart amp Smart amp needs the base config extension during module init. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- config/mtl.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mtl.toml b/config/mtl.toml index a805159446a7..758f6f34de11 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -402,6 +402,7 @@ count = 16 instance_count = "1" domain_types = "0" load_type = "0" + init_config = "1" module_type = "13" auto_start = "0" sched_caps = [1, 0x00008000] From def9d51d7d8186e8f70e5f15dbc1752cee1deb64 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Thu, 9 Feb 2023 14:49:54 +0100 Subject: [PATCH 266/639] Fix regression - make default return code an error A recent commit ec649f37d661 ("Convert all ELF addresses to cached for calculations") had a bug: it assumed a call to parse_uint32_hex_key() for an absent key would return an error by default, which isn't the case. To force it set the default return code to an error value. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 76de00a5428a..c02ea04c9458 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -404,7 +404,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", 0, &ret); + out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", -ENODATA, &ret); alias_found = !ret; /* check everything parsed, 1 or 2 tables should be present */ From 9b507ecc82d9d9db1b8d4c72809de4fc8c05d77d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Thu, 9 Feb 2023 15:45:35 +0100 Subject: [PATCH 267/639] config: set cached and uncached aliases for affected platforms Set cached and uncached address aliases for all Intel ADSP platforms, supported by Zephyr. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/mtl.toml | 8 ++++++++ config/tgl-h-cavs.toml | 8 ++++++++ config/tgl-h.toml | 8 ++++++++ config/tgl.toml | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/config/mtl.toml b/config/mtl.toml index 758f6f34de11..ee50cbfe083c 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -3,6 +3,7 @@ version = [3, 0] [adsp] name = "mtl" image_size = "0x2C0000" # (22) bank * 128KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xa00f0000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x40000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xA0000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 75429596e099..cab16a4365a8 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -21,6 +22,13 @@ type = "LP-SRAM" base = "0xBE800000" size = "0x40" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl-h.toml b/config/tgl-h.toml index 908c3bfc8a1f..997e1a832899 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl.toml b/config/tgl.toml index d6183faf5345..9a64c694c7f8 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" # (46 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] From 1e0a85b44a19db37f9dd18906091d87abd8bd5e6 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 10 Feb 2023 08:42:49 -0800 Subject: [PATCH 268/639] config:tgl/tglh: Do not set cached/uncached address aliases tgl.toml and tgl-h.toml are only used for xtos builds. Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- config/tgl-h.toml | 8 -------- config/tgl.toml | 8 -------- 2 files changed, 16 deletions(-) diff --git a/config/tgl-h.toml b/config/tgl-h.toml index 997e1a832899..908c3bfc8a1f 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -3,7 +3,6 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB -alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -18,13 +17,6 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" -[[adsp.mem_alias]] -type = "uncached" -base = "0x9E000000" -[[adsp.mem_alias]] -type = "cached" -base = "0xBE000000" - [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl.toml b/config/tgl.toml index 9a64c694c7f8..d6183faf5345 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,7 +3,6 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" # (46 + 1) bank * 64KB -alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -18,13 +17,6 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" -[[adsp.mem_alias]] -type = "uncached" -base = "0x9E000000" -[[adsp.mem_alias]] -type = "cached" -base = "0xBE000000" - [cse] partition_name = "ADSP" [[cse.entry]] From 3863e94fa5d361e434f404655dac17541dbf20c6 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Mon, 13 Feb 2023 12:29:29 +0100 Subject: [PATCH 269/639] Don't convert ROM addresses to cached aliases We don't include ROM sections into the output image. If conversion is applied to them, they end up in the SRAM address range, which then generates corrupted images. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/elf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/elf.c b/src/elf.c index 4218c025df54..9b51c5f87b08 100644 --- a/src/elf.c +++ b/src/elf.c @@ -14,7 +14,7 @@ static unsigned long uncache_to_cache(const struct image *image, unsigned long address) { - return ((address & ~image->adsp->alias_mask) | image->adsp->alias_cached); + return (address & ~image->adsp->alias_mask) | image->adsp->alias_cached; } static int elf_read_sections(struct image *image, struct module *module, @@ -25,6 +25,8 @@ static int elf_read_sections(struct image *image, struct module *module, size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + unsigned long rom_base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; + size_t rom_size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; /* read in section header */ ret = fseek(module->fd, hdr->shoff, SEEK_SET); @@ -115,7 +117,13 @@ static int elf_read_sections(struct image *image, struct module *module, continue; } - section[i].vaddr = uncache_to_cache(image, section[i].vaddr); + /* + * Don't convert ROM addresses, ROM sections aren't included in + * the output image + */ + if (section[i].vaddr < rom_base || section[i].vaddr >= rom_base + rom_size) + section[i].vaddr = uncache_to_cache(image, section[i].vaddr); + module->num_sections++; if (!image->verbose) From bf23b5ea00b6a3a1a4cb6aea14f517acd1114a8c Mon Sep 17 00:00:00 2001 From: Libin Yang <libin.yang@intel.com> Date: Thu, 2 Feb 2023 09:11:54 +0800 Subject: [PATCH 270/639] config: mtl: set KDTEST module_type to 8 KDTEST module_type should be 8 Signed-off-by: Libin Yang <libin.yang@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index ee50cbfe083c..61d9b52ddd2d 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -373,7 +373,7 @@ count = 16 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "9" + module_type = "8" auto_start = "0" sched_caps = [1, 0x00008000] From cb9c880b6e8d74c32b8fbfc2a0a6ff2b030df0e9 Mon Sep 17 00:00:00 2001 From: Libin Yang <libin.yang@intel.com> Date: Sun, 29 Jan 2023 14:19:41 +0800 Subject: [PATCH 271/639] config: tgl-cavs: add kpb, selector and kd support Add KPB, Selector and KD module config Signed-off-by: Libin Yang <libin.yang@intel.com> --- config/tgl-cavs.toml | 57 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 8b5960d52923..5b10f0869c4b 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 12 +count = 15 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -333,3 +333,58 @@ count = 12 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + module_type = "12" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] From ffd0542127bc101b8a09f09a92a9f193f2be260e Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 14 Feb 2023 15:14:19 +0800 Subject: [PATCH 272/639] adsp_config: make the default value zero for init_config The init_config is used to indicate if base config extension is used (1) or not (0). Its default value is used if not specified in module config, the default value for init_config should be zero instead of one. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- src/adsp_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index c02ea04c9458..c2970edfa348 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2237,7 +2237,7 @@ static int parse_module(const toml_table_t *toml, struct parse_ctx *pctx, return err_key_parse("load_type", NULL); mod_man->type.init_config = parse_uint32_hex_key(mod_entry, &ctx_entry, - "init_config", 1, &ret); + "init_config", 0, &ret); if (ret < 0) return err_key_parse("init_config", NULL); From d48ad6b67baf23fbbb65fa95493cac486071d8a2 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 14 Feb 2023 15:17:44 +0800 Subject: [PATCH 273/639] adsp_config: add dump for init_config This patch adds dump for init_config for debug. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- src/adsp_config.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/adsp_config.c b/src/adsp_config.c index c2970edfa348..e1f7e5ac41d9 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2124,6 +2124,7 @@ static void dump_module(struct fw_image_manifest_module *man_cavs) for (i = 0; i < man_cavs->mod_man_count; i++) { DUMP_PRINTABLE_BYTES("module name", man_cavs->mod_man[i].name); DUMP_KEY("load type", "%d", man_cavs->mod_man[i].type.load_type); + DUMP_KEY("init config", "%d", man_cavs->mod_man[i].type.init_config); DUMP_KEY("domain ll", "%d", man_cavs->mod_man[i].type.domain_ll); DUMP_KEY("domain dp", "%d", man_cavs->mod_man[i].type.domain_dp); DUMP_KEY("config count", "%d", man_cavs->mod_man[i].cfg_count); From 3aa199fb07b7d14cb31c5697ccf8b9be9c363d39 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Thu, 16 Feb 2023 17:46:38 +0800 Subject: [PATCH 274/639] config: mtl: set init_config for micsel The micsel module will use base config extension, init_config should be one for it. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- config/mtl.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/config/mtl.toml b/config/mtl.toml index 61d9b52ddd2d..8d8f63a2d2fa 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -296,6 +296,7 @@ count = 16 instance_count = "8" domain_types = "0" load_type = "0" + init_config = "1" module_type = "12" auto_start = "0" sched_caps = [1, 0x00008000] From 0931d9cc4be979142daf50793d137dedece1e885 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 16 Feb 2023 16:50:57 +0100 Subject: [PATCH 275/639] main: heap_adsp release fix In image re-signing mode or if there are no input files, the memory allocated for heap_adsp was not released. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/rimage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 6aa4eabea844..4ec34a856840 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -168,7 +168,8 @@ int main(int argc, char *argv[]) if (image.in_file) { fprintf(stdout, "going to re-sign\n"); - return resign_image(&image); + ret = resign_image(&image); + goto out; } /* set IMR Type and the PV bit in found machine definition */ @@ -196,7 +197,8 @@ int main(int argc, char *argv[]) if (image.num_modules <= 0) { fprintf(stderr, "error: requires at least one ELF input module\n"); - return -EINVAL; + ret = -EINVAL; + goto out; } /* getopt reorders argv[] */ From fed69d453f7eec28f62f4ea14bd422480c03756f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 23 Feb 2023 17:27:25 +0100 Subject: [PATCH 276/639] toml_utils: adsp_config: Moved generic parser functions to toml_utils A set of functions which make it easier to parse toml files has been separated into a new file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/adsp_config.c | 337 +------------------------------ src/include/rimage/toml_utils.h | 121 ++++++++++++ src/toml_utils.c | 341 ++++++++++++++++++++++++++++++++ 4 files changed, 464 insertions(+), 336 deletions(-) create mode 100644 src/include/rimage/toml_utils.h create mode 100644 src/toml_utils.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e253d8d1b50..3001ebc790e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,7 @@ add_executable(rimage src/ext_manifest.c src/elf.c src/rimage.c + src/toml_utils.c src/adsp_config.c tomlc99/toml.c ) diff --git a/src/adsp_config.c b/src/adsp_config.c index e1f7e5ac41d9..9c4c94c50be2 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -14,6 +14,7 @@ #include "rimage/rimage.h" #include "rimage/cse.h" #include "rimage/css.h" +#include "rimage/toml_utils.h" #include "toml.h" #include <stdbool.h> #include <stdint.h> @@ -22,291 +23,6 @@ #include <errno.h> #include <ctype.h> -/* macros used to dump values after parsing */ -#define DUMP_KEY_FMT " %20s: " -#define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) -#define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) - -static void print_bytes(FILE *out, const uint8_t *arr, size_t len) -{ - for (const uint8_t *pos = arr; pos < arr + len; pos++) { - char c = *pos; - - if (isprint(c)) - fputc(c, out); - else - fprintf(out, "\\x%.2x", c); - } -} - -#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) - -static void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len) -{ - printf(DUMP_KEY_FMT, name); - print_bytes(stdout, arr, len); - printf("\n"); -} - -/** parser counter, used to assert nothing left unparsed in toml data */ -struct parse_ctx { - int key_cnt; /**< number of parsed key */ - int table_cnt; /**< number of parsed tables */ - int array_cnt; /**< number of parsed arrays */ -}; - -/** private parser error trace function */ -static void vlog_err(const char *msg, va_list vl) -{ - vfprintf(stderr, msg, vl); -} - -/** parser error trace function, error code is returned to shorten client code */ -static int log_err(int err_code, const char *msg, ...) -{ - va_list vl; - - va_start(vl, msg); - vlog_err(msg, vl); - va_end(vl); - return err_code; -} - -/** log malloc error message for given key */ -static int err_malloc(const char *key) -{ - return log_err(-ENOMEM, "error: malloc failed during parsing key '%s'\n", key); -} - -/** log key not found error */ -static int err_key_not_found(const char *key) -{ - return log_err(-EINVAL, "error: '%s' not found\n", key); -} - -/** error during parsing key value, possible detailed message */ -static int err_key_parse(const char *key, const char *extra_msg, ...) -{ - int ret = -EINVAL; - va_list vl; - - if (extra_msg) { - log_err(ret, "error: key '%s' parsing error, ", key); - va_start(vl, extra_msg); - vlog_err(extra_msg, vl); - va_end(vl); - return log_err(ret, "\n"); - } else { - return log_err(ret, "error: key '%s' parsing error\n", key); - } -} - -/** initialize parser context before parsing */ -static void parse_ctx_init(struct parse_ctx *ctx) -{ - memset(ctx, 0, sizeof(*ctx)); -} - -/** check nothing left unparsed in given parsing context */ -static int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx) -{ - const char *key = toml_table_key(table); - int ret = 0; - - /* toml_table_key returns NULL for global context */ - if (!key) - key = "toml"; - - /* from number of parsed fields subtract fields count in given table */ - ctx->key_cnt = toml_table_nkval(table) - ctx->key_cnt; - ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; - ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; - - /* when any field left unparsed, then raise error */ - if (ctx->key_cnt != 0) - ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); - if (ctx->array_cnt != 0) - ret = log_err(-EINVAL, "error: %d unparsed arrays left in '%s'\n", ctx->array_cnt, - key); - if (ctx->table_cnt != 0) - ret = log_err(-EINVAL, "error: %d unparsed tables left in '%s'\n", ctx->table_cnt, - key); - return ret; -} - -/** - * Parse hex value from key in given toml table - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param def is default value or -1 when value don't have default value - * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value for error cases - */ -static uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, - const char *key, int64_t def, int *error) -{ - toml_raw_t raw; - char *temp_s; - uint32_t val; - int ret; - - /* look for key in given table, assign def value when key not found */ - raw = toml_raw_in(table, key); - if (!raw) { - if (def < 0 || def > UINT32_MAX) { - *error = err_key_not_found(key); - return UINT32_MAX; - } else { - *error = 0; - return (uint32_t)def; - } - } - /* there is not build-in support for hex numbers in toml, so read then as string */ - ret = toml_rtos(raw, &temp_s); - if (ret < 0) { - *error = err_key_parse(key, NULL); - return UINT32_MAX; - } - val = strtoul(temp_s, 0, 16); - - free(temp_s); - /* assert parsing success and value is within uint32_t range */ - if (errno < 0) { - *error = err_key_parse(key, "can't convert hex value"); - return UINT32_MAX; - } - - /* set success error code and increment parsed key counter */ - *error = 0; - ++ctx->key_cnt; - return (uint32_t)val; -} - -/** - * Parse integer value from key in given toml table - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param def is default value or -1 when value don't have default value - * @param error code, 0 when success - * @return default, parsed, or UINT32_MAX value for error cases - */ -static uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - int64_t def, int *error) -{ - toml_raw_t raw; - int64_t val; - int ret; - - /* look for key in given table, assign def value when key not found */ - raw = toml_raw_in(table, key); - if (!raw) { - if (def < 0 || def > UINT32_MAX) { - *error = err_key_not_found(key); - return UINT32_MAX; - } else { - *error = 0; - return (uint32_t)def; - } - } - /* there is build-in support for integer numbers in toml, so use lib function */ - ret = toml_rtoi(raw, &val); - if (ret < 0) { - *error = err_key_parse(key, "can't convert to integer value"); - return UINT32_MAX; - } - /* assert value is within uint32_t range */ - if (val < 0 || val > UINT32_MAX) { - *error = log_err(-ERANGE, "key %s out of uint32_t range", key); - return UINT32_MAX; - } - /* set success error code and increment parsed key counter */ - *error = 0; - ++ctx->key_cnt; - return (uint32_t)val; -} - -/** - * Parse string value from key in given toml table to uint8_t array. The - * destination is NOT a string because it is padded with zeros if and - * only if there is some capacity left. For string destinations use - * parse_str_key(). - * - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param dst uint8_t[] destination - * @param capacity dst array size - * @param error code, 0 when success - */ -static void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - uint8_t *dst, int capacity, int *error) -{ - toml_raw_t raw; - char *temp_s; - int len; - int ret; - - /* look for key in given table */ - raw = toml_raw_in(table, key); - if (!raw) { - *error = err_key_not_found(key); - return; - } - /* read string from toml, theres malloc inside toml_rtos() */ - ret = toml_rtos(raw, &temp_s); - if (ret < 0) { - *error = err_key_parse(key, NULL); - return; - } - - len = strlen(temp_s); - if (len > capacity) { - if (len > 20) { - static const char ellipsis[] = "..."; - const size_t el_len = sizeof(ellipsis); - - strncpy(temp_s + 20 - el_len, ellipsis, el_len); - } - - *error = log_err(-EINVAL, "Too long input '%s' for key '%s' (%d > %d) characters\n", - temp_s, key, len, capacity); - free(temp_s); - return; - } - - /* copy string to dst, pad with zeros the space left if any */ - strncpy((char *)dst, temp_s, capacity); - free(temp_s); - /* update parsing context */ - ++ctx->key_cnt; - *error = 0; -} - -/** - * Parse string value from key in given toml table to given - * char[]. Destination is padded with zeros. As the only difference with - * parse_printable_key(), dst is guaranteed to be null-terminated when - * there is no error because the last destination byte is reserved for - * that. - * - * @param table toml table where key is specified - * @param ctx parsing context, key counter will be incremented after successful key parse - * @param key field name - * @param dst char[] destination - * @param capacity dst array size including null termination. - * @param error code, 0 when success - */ -static void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, - char *dst, int capacity, int *error) -{ - parse_printable_key(table, ctx, key, (uint8_t *)dst, capacity - 1, error); - if (*error) /* return immediately to help forensics */ - return; - dst[capacity - 1] = 0; -} - /* map memory zone string name to enum value */ static enum snd_sof_fw_blk_type zone_name_to_idx(const char *name) { @@ -2092,27 +1808,6 @@ static int parse_mod_config(const toml_table_t *mod_entry, struct parse_ctx *ctx return 0; } -static void parse_uuid(char *buf, uint8_t *uuid) -{ - struct uuid_t id; - uint32_t d[10]; - - sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], - &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); - id.d1 = (uint16_t)d[0]; - id.d2 = (uint16_t)d[1]; - id.d3 = (uint8_t)d[2]; - id.d4 = (uint8_t)d[3]; - id.d5 = (uint8_t)d[4]; - id.d6 = (uint8_t)d[5]; - id.d7 = (uint8_t)d[6]; - id.d8 = (uint8_t)d[7]; - id.d9 = (uint8_t)d[8]; - id.d10 = (uint8_t)d[9]; - - memcpy(uuid, &id, sizeof(id)); -} - static void dump_module(struct fw_image_manifest_module *man_cavs) { int i; @@ -2583,36 +2278,6 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *im return 0; } -/** version is stored as toml array with integer number, something like: - * "version = [1, 8]" - */ -static int parse_version(toml_table_t *toml, int64_t version[2]) -{ - toml_array_t *arr; - toml_raw_t raw; - int ret; - int i; - - /* check "version" key */ - arr = toml_array_in(toml, "version"); - if (!arr) - return err_key_not_found("version"); - if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || - toml_array_kind(arr) != 'v') - return err_key_parse("version", "wrong array type or length != 2"); - - /* parse "version" array elements */ - for (i = 0; i < 2; ++i) { - raw = toml_raw_at(arr, i); - if (raw == 0) - return err_key_parse("version", NULL); - ret = toml_rtoi(raw, &version[i]); - if (ret < 0) - return err_key_parse("version", "can't convert element to integer"); - } - return 0; -} - struct config_parser { int major; int minor; diff --git a/src/include/rimage/toml_utils.h b/src/include/rimage/toml_utils.h new file mode 100644 index 000000000000..cd17bb4af28d --- /dev/null +++ b/src/include/rimage/toml_utils.h @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> + * Marc Herbert <marc.herbert@intel.com> + */ + +#ifndef __TOML_UTILS_H__ +#define __TOML_UTILS_H__ + +#include "toml.h" + +#include <stdint.h> +#include <stdio.h> +#include <stdarg.h> + +/** parser counter, used to assert nothing left unparsed in toml data */ +struct parse_ctx { + int key_cnt; /**< number of parsed key */ + int table_cnt; /**< number of parsed tables */ + int array_cnt; /**< number of parsed arrays */ +}; + +/* macros used to dump values after parsing */ +#define DUMP_KEY_FMT " %20s: " +#define DUMP(fmt, ...) fprintf(stdout, fmt "\n", ##__VA_ARGS__) +#define DUMP_KEY(key, fmt, ...) DUMP(DUMP_KEY_FMT fmt, key, ##__VA_ARGS__) + +void print_bytes(FILE *out, const uint8_t *arr, size_t len); + +#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) + +void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len); + +/** private parser error trace function */ +void vlog_err(const char *msg, va_list vl); + +/** parser error trace function, error code is returned to shorten client code */ +int log_err(int err_code, const char *msg, ...); + +/** log malloc error message for given key */ +int err_malloc(const char *key); + +/** log key not found error */ +int err_key_not_found(const char *key); + +/** error during parsing key value, possible detailed message */ +int err_key_parse(const char *key, const char *extra_msg, ...); + +/** initialize parser context before parsing */ +void parse_ctx_init(struct parse_ctx *ctx); + +/** check nothing left unparsed in given parsing context */ +int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx); + +/** + * Parse hex value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, + const char *key, int64_t def, int *error); + +/** + * Parse integer value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error); + +/** + * Parse string value from key in given toml table to uint8_t array. The + * destination is NOT a string because it is padded with zeros if and + * only if there is some capacity left. For string destinations use + * parse_str_key(). + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst uint8_t[] destination + * @param capacity dst array size + * @param error code, 0 when success + */ +void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + uint8_t *dst, int capacity, int *error); + +/** + * Parse string value from key in given toml table to given + * char[]. Destination is padded with zeros. As the only difference with + * parse_printable_key(), dst is guaranteed to be null-terminated when + * there is no error because the last destination byte is reserved for + * that. + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst char[] destination + * @param capacity dst array size including null termination. + * @param error code, 0 when success + */ +void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error); + +void parse_uuid(char *buf, uint8_t *uuid); + +/** version is stored as toml array with integer number, something like: + * "version = [1, 8]" + */ +int parse_version(toml_table_t *toml, int64_t version[2]); + +#endif /* __TOML_UTILS_H__ */ diff --git a/src/toml_utils.c b/src/toml_utils.c new file mode 100644 index 000000000000..85567f3d8caa --- /dev/null +++ b/src/toml_utils.c @@ -0,0 +1,341 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> + * Marc Herbert <marc.herbert@intel.com> + */ + +#include "toml.h" +#include <rimage/toml_utils.h> +#include <rimage/cavs/cavs_ext_manifest.h> + +#include <errno.h> +#include <string.h> +#include <stdlib.h> +#include <ctype.h> +#include <stdarg.h> + +void print_bytes(FILE *out, const uint8_t *arr, size_t len) +{ + for (const uint8_t *pos = arr; pos < arr + len; pos++) { + char c = *pos; + + if (isprint(c)) + fputc(c, out); + else + fprintf(out, "\\x%.2x", c); + } +} + +#define DUMP_PRINTABLE_BYTES(name, var) _dump_printable_bytes(name, var, sizeof(var)) + +void _dump_printable_bytes(const char *name, const uint8_t *arr, size_t len) +{ + printf(DUMP_KEY_FMT, name); + print_bytes(stdout, arr, len); + printf("\n"); +} + +/** private parser error trace function */ +void vlog_err(const char *msg, va_list vl) +{ + vfprintf(stderr, msg, vl); +} + +/** parser error trace function, error code is returned to shorten client code */ +int log_err(int err_code, const char *msg, ...) +{ + va_list vl; + + va_start(vl, msg); + vlog_err(msg, vl); + va_end(vl); + return err_code; +} + +/** log malloc error message for given key */ +int err_malloc(const char *key) +{ + return log_err(-ENOMEM, "error: malloc failed during parsing key '%s'\n", key); +} + +/** log key not found error */ +int err_key_not_found(const char *key) +{ + return log_err(-EINVAL, "error: '%s' not found\n", key); +} + +/** error during parsing key value, possible detailed message */ +int err_key_parse(const char *key, const char *extra_msg, ...) +{ + int ret = -EINVAL; + va_list vl; + + if (extra_msg) { + log_err(ret, "error: key '%s' parsing error, ", key); + va_start(vl, extra_msg); + vlog_err(extra_msg, vl); + va_end(vl); + return log_err(ret, "\n"); + } else { + return log_err(ret, "error: key '%s' parsing error\n", key); + } +} + +/** initialize parser context before parsing */ +void parse_ctx_init(struct parse_ctx *ctx) +{ + memset(ctx, 0, sizeof(*ctx)); +} + +/** check nothing left unparsed in given parsing context */ +int assert_everything_parsed(const toml_table_t *table, struct parse_ctx *ctx) +{ + const char *key = toml_table_key(table); + int ret = 0; + + /* toml_table_key returns NULL for global context */ + if (!key) + key = "toml"; + + /* from number of parsed fields subtract fields count in given table */ + ctx->key_cnt = toml_table_nkval(table) - ctx->key_cnt; + ctx->array_cnt = toml_table_narr(table) - ctx->array_cnt; + ctx->table_cnt = toml_table_ntab(table) - ctx->table_cnt; + + /* when any field left unparsed, then raise error */ + if (ctx->key_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed keys left in '%s'\n", ctx->key_cnt, key); + if (ctx->array_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed arrays left in '%s'\n", ctx->array_cnt, + key); + if (ctx->table_cnt != 0) + ret = log_err(-EINVAL, "error: %d unparsed tables left in '%s'\n", ctx->table_cnt, + key); + return ret; +} + +/** + * Parse hex value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, + const char *key, int64_t def, int *error) +{ + toml_raw_t raw; + char *temp_s; + uint32_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + return UINT32_MAX; + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is not build-in support for hex numbers in toml, so read then as string */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return UINT32_MAX; + } + val = strtoul(temp_s, 0, 16); + + free(temp_s); + /* assert parsing success and value is within uint32_t range */ + if (errno < 0) { + *error = err_key_parse(key, "can't convert hex value"); + return UINT32_MAX; + } + + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse integer value from key in given toml table + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param def is default value or -1 when value don't have default value + * @param error code, 0 when success + * @return default, parsed, or UINT32_MAX value for error cases + */ +uint32_t parse_uint32_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + int64_t def, int *error) +{ + toml_raw_t raw; + int64_t val; + int ret; + + /* look for key in given table, assign def value when key not found */ + raw = toml_raw_in(table, key); + if (!raw) { + if (def < 0 || def > UINT32_MAX) { + *error = err_key_not_found(key); + return UINT32_MAX; + } else { + *error = 0; + return (uint32_t)def; + } + } + /* there is build-in support for integer numbers in toml, so use lib function */ + ret = toml_rtoi(raw, &val); + if (ret < 0) { + *error = err_key_parse(key, "can't convert to integer value"); + return UINT32_MAX; + } + /* assert value is within uint32_t range */ + if (val < 0 || val > UINT32_MAX) { + *error = log_err(-ERANGE, "key %s out of uint32_t range", key); + return UINT32_MAX; + } + /* set success error code and increment parsed key counter */ + *error = 0; + ++ctx->key_cnt; + return (uint32_t)val; +} + +/** + * Parse string value from key in given toml table to uint8_t array. The + * destination is NOT a string because it is padded with zeros if and + * only if there is some capacity left. For string destinations use + * parse_str_key(). + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst uint8_t[] destination + * @param capacity dst array size + * @param error code, 0 when success + */ +void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + uint8_t *dst, int capacity, int *error) +{ + toml_raw_t raw; + char *temp_s; + int len; + int ret; + + /* look for key in given table */ + raw = toml_raw_in(table, key); + if (!raw) { + *error = err_key_not_found(key); + return; + } + /* read string from toml, theres malloc inside toml_rtos() */ + ret = toml_rtos(raw, &temp_s); + if (ret < 0) { + *error = err_key_parse(key, NULL); + return; + } + + len = strlen(temp_s); + if (len > capacity) { + if (len > 20) { + static const char ellipsis[] = "..."; + const size_t el_len = sizeof(ellipsis); + + strncpy(temp_s + 20 - el_len, ellipsis, el_len); + } + + *error = log_err(-EINVAL, "Too long input '%s' for key '%s' (%d > %d) characters\n", + temp_s, key, len, capacity); + free(temp_s); + return; + } + + /* copy string to dst, pad with zeros the space left if any */ + strncpy((char *)dst, temp_s, capacity); + free(temp_s); + /* update parsing context */ + ++ctx->key_cnt; + *error = 0; +} + +/** + * Parse string value from key in given toml table to given + * char[]. Destination is padded with zeros. As the only difference with + * parse_printable_key(), dst is guaranteed to be null-terminated when + * there is no error because the last destination byte is reserved for + * that. + * + * @param table toml table where key is specified + * @param ctx parsing context, key counter will be incremented after successful key parse + * @param key field name + * @param dst char[] destination + * @param capacity dst array size including null termination. + * @param error code, 0 when success + */ +void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, + char *dst, int capacity, int *error) +{ + parse_printable_key(table, ctx, key, (uint8_t *)dst, capacity - 1, error); + if (*error) /* return immediately to help forensics */ + return; + dst[capacity - 1] = 0; +} + +void parse_uuid(char *buf, uint8_t *uuid) +{ + struct uuid_t id; + uint32_t d[10]; + + sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], + &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); + id.d1 = (uint16_t)d[0]; + id.d2 = (uint16_t)d[1]; + id.d3 = (uint8_t)d[2]; + id.d4 = (uint8_t)d[3]; + id.d5 = (uint8_t)d[4]; + id.d6 = (uint8_t)d[5]; + id.d7 = (uint8_t)d[6]; + id.d8 = (uint8_t)d[7]; + id.d9 = (uint8_t)d[8]; + id.d10 = (uint8_t)d[9]; + + memcpy(uuid, &id, sizeof(id)); +} + +/** version is stored as toml array with integer number, something like: + * "version = [1, 8]" + */ +int parse_version(toml_table_t *toml, int64_t version[2]) +{ + toml_array_t *arr; + toml_raw_t raw; + int ret; + int i; + + /* check "version" key */ + arr = toml_array_in(toml, "version"); + if (!arr) + return err_key_not_found("version"); + if (toml_array_type(arr) != 'i' || toml_array_nelem(arr) != 2 || + toml_array_kind(arr) != 'v') + return err_key_parse("version", "wrong array type or length != 2"); + + /* parse "version" array elements */ + for (i = 0; i < 2; ++i) { + raw = toml_raw_at(arr, i); + if (raw == 0) + return err_key_parse("version", NULL); + ret = toml_rtoi(raw, &version[i]); + if (ret < 0) + return err_key_parse("version", "can't convert element to integer"); + } + return 0; +} From 055ea7eca8dce0d15026045e5551f5e8c6cb55ca Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 22 Feb 2023 18:01:27 +0100 Subject: [PATCH 277/639] file_utils: manifest: ext_manifest: Add new create_file_name function A new function create_file_name has been created that prepares the name of the output file with the given extensions. Unlike the previous solution, it checks whether the new name will fit in the output buffer. A new file_utils.c file has been prepared, into which generic functions to simplify the use of files will be moved. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/ext_manifest.c | 11 +++++++--- src/file_utils.c | 38 +++++++++++++++++++++++++++++++++ src/include/rimage/file_utils.h | 22 +++++++++++++++++++ src/manifest.c | 26 ++++++++++++++++------ 5 files changed, 88 insertions(+), 10 deletions(-) create mode 100644 src/file_utils.c create mode 100644 src/include/rimage/file_utils.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 3001ebc790e3..f43150c0d64e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ add_executable(rimage src/rimage.c src/toml_utils.c src/adsp_config.c + src/file_utils.c tomlc99/toml.c ) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 962415674f11..de920422196f 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -14,6 +14,7 @@ #include <rimage/rimage.h> #include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> const struct ext_man_header ext_man_template = { .magic = EXT_MAN_MAGIC_NUMBER, @@ -24,10 +25,14 @@ const struct ext_man_header ext_man_template = { static int ext_man_open_file(struct image *image) { - /* open extended manifest outfile for writing */ - sprintf(image->out_ext_man_file, "%s.xman", image->out_file); - unlink(image->out_ext_man_file); + int ret; + ret = create_file_name(image->out_ext_man_file, sizeof(image->out_ext_man_file), + image->out_file, "xman"); + if (ret) + return ret; + + /* open extended manifest outfile for writing */ image->out_ext_man_fd = fopen(image->out_ext_man_file, "wb"); if (!image->out_ext_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", diff --git a/src/file_utils.c b/src/file_utils.c new file mode 100644 index 000000000000..a71236cf9c5e --- /dev/null +++ b/src/file_utils.c @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018-2023 Intel Corporation. All rights reserved. +// +// Author: Adrian Warecki <adrian.warecki@intel.com> + +#include <stdio.h> +#include <unistd.h> +#include <errno.h> +#include <assert.h> + +#include <rimage/file_utils.h> + +/** + * Create new file name using output file name as template. + * @param [out] new_name char[] destination of new file name + * @param [in] name_size new file name buffer capacity + * @param [in] template_name File name used as a template for the new name + * @param [in] new_ext extension of the new file name + * @param error code, 0 when success + */ +int create_file_name(char *new_name, const size_t name_size, const char *template_name, + const char *new_ext) +{ + int len; + + assert(new_name); + + len = snprintf(new_name, name_size, "%s.%s", template_name, new_ext); + if (len >= name_size) { + fprintf(stderr, "error: output file name too long\n"); + return -ENAMETOOLONG; + } + + unlink(new_name); + + return 0; +} diff --git a/src/include/rimage/file_utils.h b/src/include/rimage/file_utils.h new file mode 100644 index 000000000000..702568044766 --- /dev/null +++ b/src/include/rimage/file_utils.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#ifndef __FILE_UTILS_H__ +#define __FILE_UTILS_H__ + +#include <stddef.h> + +/** + * Create new file name using output file name as template. + * @param [out] new_name char[] destination of new file name + * @param [in] name_size new file name buffer capacity + * @param [in] template_name File name used as a template for the new name + * @param [in] new_ext extension of the new file name + * @param error code, 0 when success + */ +int create_file_name(char *new_name, const size_t name_size, const char *template_name, + const char *new_ext); + +#endif /* __FILE_UTILS_H__ */ diff --git a/src/manifest.c b/src/manifest.c index c7a37266f198..9e985bda2685 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -22,13 +22,17 @@ #include <rimage/cse.h> #include <rimage/plat_auth.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static int man_open_rom_file(struct image *image) { uint32_t size; + int ret; - sprintf(image->out_rom_file, "%s.rom", image->out_file); - unlink(image->out_rom_file); + ret = create_file_name(image->out_rom_file, sizeof(image->out_rom_file), image->out_file, + "rom"); + if (ret) + return ret; size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; @@ -50,8 +54,12 @@ static int man_open_rom_file(struct image *image) static int man_open_unsigned_file(struct image *image) { - sprintf(image->out_unsigned_file, "%s.uns", image->out_file); - unlink(image->out_unsigned_file); + int ret; + + ret = create_file_name(image->out_unsigned_file, sizeof(image->out_unsigned_file), + image->out_file, "uns"); + if (ret) + return ret; /* open unsigned FW outfile for writing */ image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); @@ -66,10 +74,14 @@ static int man_open_unsigned_file(struct image *image) static int man_open_manifest_file(struct image *image) { - /* open manifest outfile for writing */ - sprintf(image->out_man_file, "%s.met", image->out_file); - unlink(image->out_man_file); + int ret; + ret = create_file_name(image->out_man_file, sizeof(image->out_man_file), image->out_file, + "met"); + if (ret) + return ret; + + /* open manifest outfile for writing */ image->out_man_fd = fopen(image->out_man_file, "wb"); if (!image->out_man_fd) { fprintf(stderr, "error: unable to open %s for writing %d\n", From 6a64cb9c1b607743120d543ba083ea053a055407 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 22 Feb 2023 18:17:45 +0100 Subject: [PATCH 278/639] file_utils: Add a new get_file_size function The get_file_size function allows to conveniently get the size of the file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 35 +++++++++++++++++++++++++++++++++ src/include/rimage/file_utils.h | 9 +++++++++ 2 files changed, 44 insertions(+) diff --git a/src/file_utils.c b/src/file_utils.c index a71236cf9c5e..48055840d159 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -36,3 +36,38 @@ int create_file_name(char *new_name, const size_t name_size, const char *templat return 0; } + +/** + * Get file size + * @param [in] f file handle + * @param [in] filename File name used to display the error message + * @param [out] size output for file size + * @param error code, 0 when success + */ +int get_file_size(FILE *f, const char* filename, size_t *size) +{ + int ret; + + assert(size); + + /* get file size */ + ret = fseek(f, 0, SEEK_END); + if (ret < 0) { + fprintf(stderr, "error: unable to seek eof %s %d\n", filename, errno); + return -errno; + } + + *size = ftell(f); + if (*size < 0) { + fprintf(stderr, "error: unable to get file size for %s %d\n", filename, errno); + return -errno; + } + + ret = fseek(f, 0, SEEK_SET); + if (ret < 0) { + fprintf(stderr, "error: unable to seek set %s %d\n", filename, errno); + return -errno; + } + + return 0; +} diff --git a/src/include/rimage/file_utils.h b/src/include/rimage/file_utils.h index 702568044766..2c7ef6528dd8 100644 --- a/src/include/rimage/file_utils.h +++ b/src/include/rimage/file_utils.h @@ -19,4 +19,13 @@ int create_file_name(char *new_name, const size_t name_size, const char *template_name, const char *new_ext); +/** + * Get file size + * @param [in] f file handle + * @param [in] filename File name used to display the error message + * @param [out] size output for file size + * @param error code, 0 when success + */ +int get_file_size(FILE *f, const char *filename, size_t *size); + #endif /* __FILE_UTILS_H__ */ From 98c7f7b56756527b1bd84faa95e1e3e2e4168043 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 20 Feb 2023 13:42:03 +0100 Subject: [PATCH 279/639] manifest: Use the get_file_size function Simplified retrieval of file size by using the function get_file_size. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 9e985bda2685..90f427496e83 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -1516,10 +1516,9 @@ int man_write_fw_ace_v1_5(struct image *image) int verify_image(struct image *image) { FILE *in_file; - int ret, i; - long size; + int ret; void *buffer; - size_t read; + size_t size, read, i; /* is verify supported for target ? */ if (!image->adsp->verify_firmware) { @@ -1536,25 +1535,8 @@ int verify_image(struct image *image) } /* get file size */ - ret = fseek(in_file, 0, SEEK_END); - if (ret < 0) { - fprintf(stderr, "error: unable to seek eof %s for reading %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - size = ftell(in_file); - if (size < 0) { - fprintf(stderr, "error: unable to get file size for %s %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - ret = fseek(in_file, 0, SEEK_SET); + ret = get_file_size(in_file, image->verify_file, &size); if (ret < 0) { - fprintf(stderr, "error: unable to seek %s for reading %d\n", - image->verify_file, errno); - ret = -errno; goto out; } @@ -1608,27 +1590,8 @@ int resign_image(struct image *image) } /* get file size */ - ret = fseek(in_file, 0, SEEK_END); + ret = get_file_size(in_file, image->in_file, &size); if (ret < 0) { - fprintf(stderr, "error: unable to seek eof %s for reading %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - - size = ftell(in_file); - if (size < 0) { - fprintf(stderr, "error: unable to get file size for %s %d\n", - image->verify_file, errno); - ret = -errno; - goto out; - } - - ret = fseek(in_file, 0, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: unable to seek %s for reading %d\n", - image->verify_file, errno); - ret = -errno; goto out; } From 36c0c907698aed6db3b4317ec997eb9efe3d8045 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 22 Feb 2023 18:30:59 +0100 Subject: [PATCH 280/639] elf: Use the get_file_size function Simplified retrieval of file size by using the function get_file_size. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 7 ++----- src/file_simple.c | 2 +- src/include/rimage/rimage.h | 2 +- src/manifest.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/elf.c b/src/elf.c index 9b51c5f87b08..552bc44d3c05 100644 --- a/src/elf.c +++ b/src/elf.c @@ -11,6 +11,7 @@ #include <rimage/rimage.h> #include <rimage/cse.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static unsigned long uncache_to_cache(const struct image *image, unsigned long address) { @@ -604,11 +605,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) module->elf_file = name; /* get file size */ - ret = fseek(module->fd, 0, SEEK_END); - if (ret < 0) - goto hdr_err; - module->file_size = ftell(module->fd); - ret = fseek(module->fd, 0, SEEK_SET); + ret = get_file_size(module->fd, name, &module->file_size); if (ret < 0) goto hdr_err; diff --git a/src/file_simple.c b/src/file_simple.c index 3c344968e00d..b85bbb18dadf 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -229,7 +229,7 @@ static int write_block_reloc(struct image *image, struct module *module) goto out; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%8.8lx\t%s\n", block_idx++, 0, module->file_size, ftell(image->out_fd), block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 8c4f2e98446c..0d7143941ca5 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -61,7 +61,7 @@ struct module { int data_file_size; /* total file size */ - int file_size; + size_t file_size; /* executable header module */ int exec_header; diff --git a/src/manifest.c b/src/manifest.c index 90f427496e83..3ae8efc5c68d 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -585,7 +585,7 @@ static int man_module_create_reloc(struct image *image, struct module *module, return -errno; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%x\t%s\n", 0, + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%x\t%s\n", 0, 0, module->file_size, 0, "DATA"); fprintf(stdout, "\n"); From 5ebbd6530ce79f30ca2ef2d42a4992893fa4b34f Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Fri, 24 Feb 2023 09:15:59 +0800 Subject: [PATCH 281/639] rimage: use hex number Module type is interpreted as hex number Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 4 ++-- config/tgl-cavs.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 8d8f63a2d2fa..d091df5c58fb 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -297,7 +297,7 @@ count = 16 domain_types = "0" load_type = "0" init_config = "1" - module_type = "12" + module_type = "0xC" auto_start = "0" sched_caps = [1, 0x00008000] @@ -412,7 +412,7 @@ count = 16 domain_types = "0" load_type = "0" init_config = "1" - module_type = "13" + module_type = "0xD" auto_start = "0" sched_caps = [1, 0x00008000] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 5b10f0869c4b..2125cda5ed4f 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -283,7 +283,7 @@ count = 15 instance_count = "1" domain_types = "0" load_type = "0" - module_type = "13" + module_type = "0xD" init_config = "1" auto_start = "0" sched_caps = [1, 0x00008000] @@ -377,7 +377,7 @@ count = 15 instance_count = "8" domain_types = "0" load_type = "0" - module_type = "12" + module_type = "0xC" auto_start = "0" sched_caps = [1, 0x00008000] From a4ca53c9f164501e821d396768c3df98cc5ee5fd Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 09:57:06 +0100 Subject: [PATCH 282/639] toml_utils: Adding support for decimal numbers in hex parser Modified the strtoul function parameter to automatically recognize the value format. This will avoid the situation when a decimal value is parsed as hexadecimal. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/toml_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toml_utils.c b/src/toml_utils.c index 85567f3d8caa..128286d7194b 100644 --- a/src/toml_utils.c +++ b/src/toml_utils.c @@ -150,7 +150,7 @@ uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, *error = err_key_parse(key, NULL); return UINT32_MAX; } - val = strtoul(temp_s, 0, 16); + val = strtoul(temp_s, 0, 0); free(temp_s); /* assert parsing success and value is within uint32_t range */ From 9ce1cc89881a06ae013a35f5b01799aa1812e27f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 1 Mar 2023 16:40:54 +0100 Subject: [PATCH 283/639] ext_manifest: Fix fw_ext_man_cavs_header version The version fields in the fw_ext_man_cavs_header structure describe version of the structure itself, not the image. The correct version number has been set. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/ext_manifest.c | 5 ++--- src/include/rimage/cavs/cavs_ext_manifest.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index de920422196f..6985b919c379 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -201,9 +201,8 @@ int ext_man_write_cavs_25(struct image *image) mod_ext = &image->adsp->modules->mod_ext; count = mod_ext->mod_conf_count; - - header.version_major = mod_ext->ext_mod_config_array->header.version_major; - header.version_minor = mod_ext->ext_mod_config_array->header.version_minor; + header.version_major = EXTENDED_MANIFEST_VERSION_MAJOR; + header.version_minor = EXTENDED_MANIFEST_VERSION_MINOR; header.num_module_entries = count; header.id = EXTENDED_MANIFEST_MAGIC_HEADER_ID; header.len = sizeof(const struct fw_ext_man_cavs_header); diff --git a/src/include/rimage/cavs/cavs_ext_manifest.h b/src/include/rimage/cavs/cavs_ext_manifest.h index cc8fe4dc8ac0..4002f37fddb1 100644 --- a/src/include/rimage/cavs/cavs_ext_manifest.h +++ b/src/include/rimage/cavs/cavs_ext_manifest.h @@ -24,6 +24,8 @@ /* ExtendedManifestHeader id $AE1 */ #define EXTENDED_MANIFEST_MAGIC_HEADER_ID 0x31454124 +#define EXTENDED_MANIFEST_VERSION_MAJOR 0x0001 +#define EXTENDED_MANIFEST_VERSION_MINOR 0x0000 #define FW_MAX_EXT_MODULE_NUM 32 From 93c5e8b51fb98fab822d4566458ce49a1aa97f5b Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 12:26:20 +0100 Subject: [PATCH 284/639] misc_utils: Move byte_swap function to new misc_utils.c file This function will be used in different places in the code, so I moved it to a separate file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/include/rimage/misc_utils.h | 13 +++++++++++++ src/misc_utils.c | 18 ++++++++++++++++++ src/pkcs1_5.c | 13 +------------ 4 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 src/include/rimage/misc_utils.h create mode 100644 src/misc_utils.c diff --git a/CMakeLists.txt b/CMakeLists.txt index f43150c0d64e..76ed18a3392a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ add_executable(rimage src/rimage.c src/toml_utils.c src/adsp_config.c + src/misc_utils.c src/file_utils.c tomlc99/toml.c ) diff --git a/src/include/rimage/misc_utils.h b/src/include/rimage/misc_utils.h new file mode 100644 index 000000000000..cf9353ac9d8d --- /dev/null +++ b/src/include/rimage/misc_utils.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#include <stdint.h> + +/** + * Reverses the order of bytes in the array + * @param ptr pointer to a array + * @param size of the array + */ +void bytes_swap(uint8_t *ptr, uint32_t size); diff --git a/src/misc_utils.c b/src/misc_utils.c new file mode 100644 index 000000000000..e4b5e4d4ce5c --- /dev/null +++ b/src/misc_utils.c @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2018-2023 Intel Corporation. All rights reserved. + */ + +#include <rimage/misc_utils.h> + +void bytes_swap(uint8_t *ptr, uint32_t size) +{ + uint8_t tmp; + uint32_t index; + + for (index = 0; index < (size / 2); index++) { + tmp = ptr[index]; + ptr[index] = ptr[size - 1 - index]; + ptr[size - 1 - index] = tmp; + } +} diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 2f58b8720269..c1b38e0cb030 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -23,6 +23,7 @@ #include <rimage/rimage.h> #include <rimage/css.h> #include <rimage/manifest.h> +#include <rimage/misc_utils.h> #define DEBUG_PKCS 0 @@ -33,18 +34,6 @@ enum manver { VACE15 = 3 }; -static void bytes_swap(uint8_t *ptr, uint32_t size) -{ - uint8_t tmp; - uint32_t index; - - for (index = 0; index < (size / 2); index++) { - tmp = ptr[index]; - ptr[index] = ptr[size - 1 - index]; - ptr[size - 1 - index] = tmp; - } -} - static int rimage_read_key(EVP_PKEY **privkey, struct image *image) { char path[256]; From 2bd8be35d21504bcf69dc99e10e36caecc58343e Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 09:41:47 +0100 Subject: [PATCH 285/639] hash: New hash functions Prepared a new set of functions for computing digest with error handling. The hash context has been placed into a separate structure. This allows to conveniently pass the calculated digest along with its length and used algorithm. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/hash.c | 163 ++++++++++++++++++++++++++++++++++++-- src/include/rimage/hash.h | 111 ++++++++++++++++++++++++++ 2 files changed, 266 insertions(+), 8 deletions(-) create mode 100644 src/include/rimage/hash.h diff --git a/src/hash.c b/src/hash.c index ff68f82f5f05..f6409e3cd7cc 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1,9 +1,11 @@ // SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. -// -// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> -// Keyon Jie <yang.jie@linux.intel.com> +/* + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + * Adrian Warecki <adrian.warecki@intel.com> + */ #include <assert.h> #include <stdlib.h> @@ -11,8 +13,6 @@ #include <unistd.h> #include <errno.h> #include <string.h> -#include <time.h> -#include <sys/time.h> #include <openssl/conf.h> #include <openssl/evp.h> @@ -20,6 +20,9 @@ #include <rimage/rimage.h> #include <rimage/manifest.h> +#include <rimage/hash.h> + +#define DEBUG_HASH 0 #if OPENSSL_VERSION_NUMBER < 0x10100000L void EVP_MD_CTX_free(EVP_MD_CTX *ctx); @@ -46,7 +49,151 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) } #endif -#define DEBUG_HASH 0 +static int hash_error(struct hash_context *context, int errcode, const char *msg) +{ + EVP_MD_CTX_free(context->context); + context->context = NULL; + context->state = HS_ERROR; + context->error = -errcode; + fprintf(stderr, "hash: %s\n", msg); + return context->error; +} + +int hash_init(struct hash_context *context, const EVP_MD *algo) +{ + assert(context); + assert(algo); + + context->error = 0; + context->digest_length = 0; + context->algo = algo; + + context->context = EVP_MD_CTX_new(); + if (!context->context) + return hash_error(context, ENOMEM, "Unable to allocate hash context."); + + if (!EVP_DigestInit_ex(context->context, context->algo, NULL)) { + EVP_MD_CTX_free(context->context); + return hash_error(context, ENOTRECOVERABLE, "Unable to initialize hash context."); + } + + context->state = HS_UPDATE; + return 0; +} + +int hash_sha256_init(struct hash_context *context) +{ + return hash_init(context, EVP_sha256()); +} + +int hash_sha384_init(struct hash_context *context) +{ + return hash_init(context, EVP_sha384()); +} + +int hash_update(struct hash_context *context, const void *data, size_t size) +{ + assert(context); + assert(data); + + if (context->error) + return context->error; + + assert(context->state == HS_UPDATE); + + if (!EVP_DigestUpdate(context->context, data, size)) + return hash_error(context, EINVAL, "Unable to update hash context."); + + return 0; +} + +int hash_finalize(struct hash_context *context) +{ + assert(context); + + if (context->error) + return context->error; + + assert(context->state == HS_UPDATE); + + if (!EVP_DigestFinal_ex(context->context, context->digest, &context->digest_length)) + return hash_error(context, EINVAL, "Unable to finalize hash context."); + + context->state = HS_DONE; + +#if DEBUG_HASH + fprintf(stdout, "Hash result is: "); + hash_print(context); +#endif + + EVP_MD_CTX_free(context->context); + context->context = NULL; + return 0; +} + +int hash_get_digest(struct hash_context *context, void *output, size_t output_len) +{ + assert(context); + assert(output); + + if (context->error) + return context->error; + + assert(context->state == HS_DONE); + + if (context->digest_length > output_len) + return -ENOBUFS; + + memcpy(output, context->digest, context->digest_length); + return context->digest_length; +} + +void hash_print(struct hash_context *context) +{ + unsigned int i; + + assert(context); + assert(context->state == HS_DONE); + assert(context->digest_length); + + for (i = 0; i < context->digest_length; i++) + fprintf(stdout, "%02x", context->digest[i]); + fprintf(stdout, "\n"); +} + +int hash_single(const void *data, size_t size, const EVP_MD *algo, void *output, size_t output_len) +{ + int algo_out_size; + + assert(algo); + assert(data); + assert(output); + + //algo_out_size = EVP_MD_get_size(algo); + algo_out_size = EVP_MD_size(algo); + if (algo_out_size <= 0) + return -EINVAL; + + if (output_len > algo_out_size) + return -ENOBUFS; + + if (!EVP_Digest(data, size, output, NULL, algo, NULL)) { + fprintf(stderr, "Unable to compute hash."); + return -ENOTRECOVERABLE; + } + + return 0; +} + +int hash_sha256(const void *data, size_t size, void *output, size_t output_len) +{ + return hash_single(data, size, EVP_sha256(), output, output_len); +} + +int hash_sha384(const void *data, size_t size, void *output, size_t output_len) +{ + return hash_single(data, size, EVP_sha384(), output, output_len); +} void module_sha256_create(struct image *image) { diff --git a/src/include/rimage/hash.h b/src/include/rimage/hash.h new file mode 100644 index 000000000000..47a00101af4f --- /dev/null +++ b/src/include/rimage/hash.h @@ -0,0 +1,111 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#ifndef __HASH_H__ +#define __HASH_H__ + +#include <openssl/conf.h> +#include <openssl/evp.h> +#include <openssl/err.h> + +#include <stdint.h> + +/* Hash context state used to detect invalid use of hash functions */ +enum hash_state { HS_INIT, HS_UPDATE, HS_DONE, HS_ERROR }; + +struct hash_context { + enum hash_state state; + EVP_MD_CTX *context; + const EVP_MD *algo; + uint8_t digest[EVP_MAX_MD_SIZE]; + unsigned int digest_length; + int error; +}; + +/** + * Initialize hash context with given algorithm + * @param [out]context structure storing the hash context + * @param [in]algo hash algorithm + * @return error code, 0 when success + */ +int hash_init(struct hash_context *context, const EVP_MD *algo); + +/** + * Initialize sha256 hash context + * @param [out]context structure storing the hash context + * @return error code, 0 when success + */ +int hash_sha256_init(struct hash_context *context); + +/** + * Initialize sha384 hash context + * @param [out]context structure storing the hash context + * @return error code, 0 when success + */ +int hash_sha384_init(struct hash_context *context); + +/** + * Add data to hash + * @param [in]context structure storing the hash context + * @param [in]data data to be added + * @param [in]size length of data in bytes + * @return error code, 0 when success + */ +int hash_update(struct hash_context *context, const void *data, size_t size); + +/** + * Completes the hash calculation. No more data can be added! + * @param [in]context structure storing the hash context + * @return error code, 0 when success + */ +int hash_finalize(struct hash_context *context); + +/** + * Read out computed digest. Must finalize first. + * @param [in]context structure storing the hash context + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return copied digest length, < 0 if error + */ +int hash_get_digest(struct hash_context *context, void *output, size_t output_len); + +/** + * Print digest value + * @param [in]context structure storing the hash context + */ +void hash_print(struct hash_context *context); + +/** + * Calculates hash of a single memory buffer + * @param [in]data pointer to the data to be processed + * @param [in]size length of the data to be processed + * @param [in]algo hash algorithm + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return error code, 0 when success + */ +int hash_single(const void* data, size_t size, const EVP_MD *algo, void *output, size_t output_len); + +/** + * Calculates sha256 hash of a memory buffer + * @param [in]data pointer to the data to be processed + * @param [in]size length of the data to be processed + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return error code, 0 when success + */ +int hash_sha256(const void* data, size_t size, void *output, size_t output_len); + +/** + * Calculates sha384 hash of a memory buffer + * @param [in]data pointer to the data to be processed + * @param [in]size length of the data to be processed + * @param [out]output pointer to array where place hash value + * @param [in]output_len size of the output buffer + * @return error code, 0 when success + */ +int hash_sha384(const void* data, size_t size, void *output, size_t output_len); + +#endif /* __HASH_H__ */ From d258ea23fc4d7f5e82553c2c800a7c019c0cf75e Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 09:42:01 +0100 Subject: [PATCH 286/639] manifest: pkcs1_5: Use new hash functions Switched to use new hash functions. The parameter list for the rimage_sign and rimage_verify functions has been simplified. The necessary information is now included in the hash_context structure. In addition, code fragments that may be common to different versions of the manifest have been separated. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 157 +++++++++++++++++----------- src/pkcs1_5.c | 279 +++++++++++++++++++++++-------------------------- 2 files changed, 227 insertions(+), 209 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 3ae8efc5c68d..1161e037943b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -23,6 +23,8 @@ #include <rimage/plat_auth.h> #include <rimage/manifest.h> #include <rimage/file_utils.h> +#include <rimage/misc_utils.h> +#include <rimage/hash.h> static int man_open_rom_file(struct image *image) { @@ -733,7 +735,8 @@ static void man_create_modules_in_config(struct image *image, struct sof_man_fw_ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) { struct sof_man_module *man_module; - int i; + size_t mod_offset, mod_size; + int i, ret = 0; for (i = 0; i < image->num_modules; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); @@ -744,14 +747,19 @@ static int man_hash_modules(struct image *image, struct sof_man_fw_desc *desc) continue; } - ri_sha256(image, - man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset, - (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * - MAN_PAGE_SIZE, man_module->hash); + mod_offset = man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset; + mod_size = (man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length + + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length) * + MAN_PAGE_SIZE; + + assert((mod_offset + mod_size) <= image->adsp->image_size); + + ret = hash_sha256(image->fw_image + mod_offset, mod_size, man_module->hash, sizeof(man_module->hash)); + if (ret) + break; } - return 0; + return ret; } /* used by others */ @@ -897,8 +905,7 @@ int man_write_fw_v1_8(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v1_8 *m; - uint8_t hash[SOF_MAN_MOD_SHA256_LEN]; - int ret, i; + int ret; /* init image */ ret = man_init_image_v1_8(image); @@ -956,20 +963,31 @@ int man_write_fw_v1_8(struct image *image) /* calculate hash for ADSP meta data extension - 0x480 to end */ /* image_end is updated every time a section is added */ assert(image->image_end > MAN_FW_DESC_OFFSET_V1_8); - ri_sha256(image, MAN_FW_DESC_OFFSET_V1_8, image->image_end - - MAN_FW_DESC_OFFSET_V1_8, - m->adsp_file_ext.comp_desc[0].hash); + ret = hash_sha256(image->fw_image + MAN_FW_DESC_OFFSET_V1_8, + image->image_end - MAN_FW_DESC_OFFSET_V1_8, + m->adsp_file_ext.comp_desc[0].hash, + sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) + goto err; /* calculate hash for platform auth data - repeated in hash 2 and 4 */ - ri_sha256(image, MAN_META_EXT_OFFSET_V1_8, - sizeof(struct sof_man_adsp_meta_file_ext_v1_8), hash); + assert(image->image_end > (MAN_FW_DESC_OFFSET_V1_8 + + sizeof(struct sof_man_adsp_meta_file_ext_v1_8))); + + ret = hash_sha256(image->fw_image + MAN_FW_DESC_OFFSET_V1_8, + image->image_end - MAN_FW_DESC_OFFSET_V1_8, + m->signed_pkg.module[0].hash, + sizeof(m->signed_pkg.module[0].hash)); + if (ret) + goto err; /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA256_LEN; i++) { - m->signed_pkg.module[0].hash[i] = - m->partition_info.module[0].hash[i] = - hash[SOF_MAN_MOD_SHA256_LEN - 1 - i]; - } + bytes_swap(m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + + /* Copy module hash to partition_info */ + assert(sizeof(m->partition_info.module[0].hash) == sizeof(m->signed_pkg.module[0].hash)); + memcpy(m->partition_info.module[0].hash, m->signed_pkg.module[0].hash, + sizeof(m->partition_info.module[0].hash)); /* sign manifest */ ret = ri_manifest_sign_v1_8(image); @@ -1059,8 +1077,11 @@ int man_write_fw_meu_v1_5(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_sha256(image, image->meu_offset, image->image_end - - image->meu_offset, meta->comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha256(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + meta->comp_desc[0].hash, sizeof(meta->comp_desc[0].hash)); + if (ret) + goto err; /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, @@ -1140,8 +1161,11 @@ int man_write_fw_meu_v1_8(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_sha256(image, image->meu_offset, image->image_end - - image->meu_offset, meta->comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha256(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + meta->comp_desc[0].hash, sizeof(meta->comp_desc[0].hash)); + if (ret) + goto err; /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, @@ -1223,8 +1247,11 @@ int man_write_fw_meu_v2_5(struct image *image) man_hash_modules(image, desc); /* calculate hash for ADSP meta data extension */ - ri_sha384(image, image->meu_offset, image->image_end - - image->meu_offset, meta->comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + meta->comp_desc[0].hash, sizeof(meta->comp_desc[0].hash)); + if (ret) + goto err; /* write the unsigned files */ ret = man_write_unsigned_mod(image, meta_start_offset, @@ -1247,8 +1274,7 @@ int man_write_fw_v2_5(struct image *image) { struct sof_man_fw_desc *desc; struct fw_image_manifest_v2_5 *m; - uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; - int ret, i; + int ret; /* init image */ ret = man_init_image_v2_5(image); @@ -1310,22 +1336,28 @@ int man_write_fw_v2_5(struct image *image) man_hash_modules(image, desc); /* calculate hash inside ADSP meta data extension for padding to end */ - ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, - m->adsp_file_ext.comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash, + sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) + goto err; /* mue writes 0xff to 16 bytes of padding */ - for (i = 0; i < 16; i++) - m->reserved[i] = 0xff; + memset(m->reserved, 0xff, 16); /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ - ri_sha384(image, MAN_META_EXT_OFFSET_V2_5, - sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + assert((MAN_META_EXT_OFFSET_V2_5 + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)) < + image->image_end); + + ret = hash_sha384(image->fw_image + MAN_META_EXT_OFFSET_V2_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + if (ret) + goto err; /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { - m->signed_pkg.module[0].hash[i] = - hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; - } + bytes_swap(m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); /* sign manifest */ ret = ri_manifest_sign_v2_5(image); @@ -1385,11 +1417,10 @@ static int man_init_image_ace_v1_5(struct image *image) int man_write_fw_ace_v1_5(struct image *image) { - + struct hash_context hash; struct sof_man_fw_desc *desc; struct fw_image_manifest_ace_v1_5 *m; - uint8_t hash[SOF_MAN_MOD_SHA384_LEN]; - int ret, i; + int ret; /* init image */ ret = man_init_image_ace_v1_5(image); @@ -1455,35 +1486,43 @@ int man_write_fw_ace_v1_5(struct image *image) man_hash_modules(image, desc); /* calculate hash inside ADSP meta data extension for padding to end */ - ri_sha384(image, image->meu_offset, image->image_end - image->meu_offset, - m->adsp_file_ext.comp_desc[0].hash); + assert(image->meu_offset < image->image_end); + ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + m->adsp_file_ext.comp_desc[0].hash, + sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) + goto err; /* mue writes 0xff to 16 bytes of padding */ - for (i = 0; i < 16; i++) - m->reserved[i] = 0xff; + memset(m->reserved, 0xff, 16); /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ - ri_sha384(image, MAN_META_EXT_OFFSET_ACE_V1_5, - sizeof(struct sof_man_adsp_meta_file_ext_v2_5), hash); + assert((MAN_META_EXT_OFFSET_ACE_V1_5 + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)) < + image->image_end); + + ret = hash_sha384(image->fw_image + MAN_META_EXT_OFFSET_ACE_V1_5, + sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + if (ret) + goto err; /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { - m->signed_pkg.module[0].hash[i] = - hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; - } + bytes_swap(m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); /* calculate hash - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, image->fw_image, - sizeof(struct CsePartitionDirHeader_v2_5) + - sizeof(struct CsePartitionDirEntry) * 3); - module_sha_update(image, image->fw_image + 0x4c0, image->image_end - 0x4c0); - module_sha_complete(image, hash); + hash_sha384_init(&hash); + hash_update(&hash, image->fw_image, + sizeof(struct CsePartitionDirHeader_v2_5) + + sizeof(struct CsePartitionDirEntry) * 3); + + hash_update(&hash, image->fw_image + 0x4c0, image->image_end - 0x4c0); + hash_finalize(&hash); /* hash values in reverse order */ - for (i = 0; i < SOF_MAN_MOD_SHA384_LEN; i++) { - m->info_0x16.hash[i] = hash[SOF_MAN_MOD_SHA384_LEN - 1 - i]; - } + ret = hash_get_digest(&hash, m->info_0x16.hash, sizeof(m->info_0x16.hash)); + if (ret < 0) + goto err; + bytes_swap(m->info_0x16.hash, sizeof(m->info_0x16.hash)); /* sign manifest */ ret = ri_manifest_sign_ace_v1_5(image); diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index c1b38e0cb030..4817f8beef89 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -24,6 +24,7 @@ #include <rimage/css.h> #include <rimage/manifest.h> #include <rimage/misc_utils.h> +#include <rimage/hash.h> #define DEBUG_PKCS 0 @@ -155,8 +156,8 @@ static void rimage_set_modexp(EVP_PKEY *privkey, unsigned char *mod, unsigned ch #endif #if OPENSSL_VERSION_NUMBER < 0x30000000L -static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_sign(EVP_PKEY *privkey, enum manver ver, struct hash_context *digest, + unsigned char *signature) { unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; @@ -169,13 +170,13 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, case V15: /* fallthrough */ case V18: - ret = RSA_sign(NID_sha256, digest, SHA256_DIGEST_LENGTH, + ret = RSA_sign(NID_sha256, digest->digest, digest->digest_length, signature, &siglen, priv_rsa); break; case V25: /* fallthrough */ case VACE15: - ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest, image->md, + ret = RSA_padding_add_PKCS1_PSS(priv_rsa, sig, digest->digest, digest->algo, /* salt length */ 32); if (ret > 0) ret = RSA_private_encrypt(RSA_size(priv_rsa), sig, signature, priv_rsa, @@ -188,12 +189,11 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, return ret; } #else -static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_sign(EVP_PKEY *privkey, enum manver ver, + struct hash_context *digest, unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; size_t siglen = MAN_RSA_SIGNATURE_LEN; - size_t sig_in = MAN_RSA_SIGNATURE_LEN_2_5; int ret; ctx = EVP_PKEY_CTX_new(privkey, NULL /* no engine */); @@ -217,28 +217,19 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, goto out; } - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); - if (ret <= 0) { - fprintf(stderr, "error: failed to set signature\n"); - goto out; - } + siglen = MAN_RSA_SIGNATURE_LEN_2_5; + } - ret = EVP_PKEY_sign(ctx, signature, &sig_in, digest, SHA384_DIGEST_LENGTH); - if (ret <= 0) { - fprintf(stderr, "error: failed to sign manifest\n"); - goto out; - } + ret = EVP_PKEY_CTX_set_signature_md(ctx, digest->algo); + if (ret <= 0) { + fprintf(stderr, "error: failed to set signature algorithm\n"); + goto out; } - else { - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); - if (ret <= 0) { - fprintf(stderr, "error: failed to set signature\n"); - goto out; - } - ret = EVP_PKEY_sign(ctx, signature, &siglen, digest, SHA256_DIGEST_LENGTH); - if (ret <= 0) - fprintf(stderr, "error: failed to sign manifest\n"); + ret = EVP_PKEY_sign(ctx, signature, &siglen, digest->digest, digest->digest_length); + if (ret <= 0) { + fprintf(stderr, "error: failed to sign manifest\n"); + goto out; } out: @@ -249,8 +240,8 @@ static int rimage_sign(EVP_PKEY *privkey, struct image *image, enum manver ver, #endif #if OPENSSL_VERSION_NUMBER < 0x30000000L -static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_verify(EVP_PKEY *privkey, enum manver ver, struct hash_context *digest, + unsigned char *signature) { unsigned char sig[MAN_RSA_SIGNATURE_LEN_2_5]; unsigned int siglen = MAN_RSA_SIGNATURE_LEN; @@ -264,8 +255,8 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver case V15: /* fallthrough */ case V18: - ret = RSA_verify(NID_sha256, digest, SHA256_DIGEST_LENGTH, signature, siglen, - priv_rsa); + ret = RSA_verify(NID_sha256, digest->digest, digest->digest_length, signature, + siglen, priv_rsa); if (ret <= 0) { ERR_error_string(ERR_get_error(), err_buf); @@ -284,7 +275,7 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver return ret; } - ret = RSA_verify_PKCS1_PSS(priv_rsa, digest, image->md, sig, 32); + ret = RSA_verify_PKCS1_PSS(priv_rsa, digest->digest, digest->algo, sig, 32); if (ret <= 0) { ERR_error_string(ERR_get_error(), err_buf); fprintf(stderr, "error: verify %s\n", err_buf); @@ -297,12 +288,11 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver return ret; } #else -static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver, - unsigned char *digest, unsigned char *signature) +static int rimage_verify(EVP_PKEY *privkey, enum manver ver,struct hash_context *digest, + unsigned char *signature) { EVP_PKEY_CTX *ctx = NULL; size_t siglen = MAN_RSA_SIGNATURE_LEN; - size_t siglen25 = MAN_RSA_SIGNATURE_LEN_2_5; char err_buf[256]; int ret; @@ -314,26 +304,19 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver if (ret <= 0) goto out; + ret = EVP_PKEY_CTX_set_signature_md(ctx, digest->algo); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: set signature %s\n", err_buf); + goto out; + } + switch (ver) { - case V15: - /* fallthrough */ + case V15 /* fallthrough */ case V18: - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha256()); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: set signature %s\n", err_buf); - goto out; - } - - ret = EVP_PKEY_verify(ctx, signature, siglen, digest, SHA256_DIGEST_LENGTH); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: verify %s\n", err_buf); - } - break; - case V25: - /* fallthrough */ + + case V25: /* fallthrough */ case VACE15: ret = EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_PSS_PADDING); if (ret <= 0) @@ -343,21 +326,20 @@ static int rimage_verify(EVP_PKEY *privkey, struct image *image, enum manver ver if (ret <= 0) goto out; - ret = EVP_PKEY_CTX_set_signature_md(ctx, EVP_sha384()); - if (ret <= 0) - goto out; - - ret = EVP_PKEY_verify(ctx, signature, siglen25, digest, SHA384_DIGEST_LENGTH); - if (ret <= 0) { - ERR_error_string(ERR_get_error(), err_buf); - fprintf(stderr, "error: verify %s\n", err_buf); - } - + siglen = MAN_RSA_SIGNATURE_LEN_2_5; break; default: return -EINVAL; } + ret = EVP_PKEY_verify(ctx, signature, siglen, digest->digest, digest->digest_length); + if (ret <= 0) { + ERR_error_string(ERR_get_error(), err_buf); + fprintf(stderr, "error: verify %s\n", err_buf); + } + + break; + out: EVP_PKEY_CTX_free(ctx); @@ -397,7 +379,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, void *ptr1, unsigned int size1) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; int ret = -EINVAL, i; @@ -418,22 +400,20 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, V15, digest, - (unsigned char *)man->css_header.signature); - + ret = rimage_sign(privkey, V15, &digest, (unsigned char *)man->css_header.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -448,6 +428,7 @@ int pkcs_v1_5_sign_man_v1_5(struct image *image, bytes_swap(man->css_header.signature, sizeof(man->css_header.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -465,7 +446,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN]; int ret = -EINVAL, i; @@ -487,22 +468,21 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, V18, digest, - (unsigned char *)man->css.signature); + ret = rimage_sign(privkey, V18, &digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -515,6 +495,7 @@ int pkcs_v1_5_sign_man_v1_8(struct image *image, /* signature is reveresd, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -525,7 +506,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; int ret = -EINVAL, i; @@ -547,22 +528,21 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, V25, digest, - (unsigned char *)man->css.signature); + ret = rimage_sign(privkey, V25, &digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -575,6 +555,7 @@ int pkcs_v1_5_sign_man_v2_5(struct image *image, /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -585,7 +566,7 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; + struct hash_context digest; unsigned char mod[MAN_RSA_KEY_MODULUS_LEN_2_5]; int ret = -EINVAL, i; @@ -607,22 +588,21 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* sign the manifest */ - ret = rimage_sign(privkey, image, VACE15, digest, - (unsigned char *)man->css.signature); + ret = rimage_sign(privkey, VACE15, &digest, (unsigned char *)man->css.signature); if (ret <= 0) { fprintf(stderr, "error: failed to sign manifest\n"); - return ret; + goto err; } /* copy public key modulus and exponent to manifest */ @@ -635,6 +615,7 @@ int pkcs_v1_5_sign_man_ace_v1_5(struct image *image, /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); +err: EVP_PKEY_free(privkey); return ret; } @@ -713,8 +694,8 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, void *ptr1, unsigned int size1) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x\n", @@ -734,28 +715,27 @@ int pkcs_v1_5_verify_man_v1_5(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reversed, swap it */ bytes_swap(man->css_header.signature, sizeof(man->css_header.signature)); /* verify */ - ret = rimage_verify(privkey, image, V15, digest, - (unsigned char *)man->css_header.signature); + ret = rimage_verify(privkey, V15, &digest, (unsigned char *)man->css_header.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); - +err: EVP_PKEY_free(privkey); return ret; } @@ -773,8 +753,8 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA256_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", @@ -794,27 +774,27 @@ int pkcs_v1_5_verify_man_v1_8(struct image *image, } /* calculate the digest */ - module_sha256_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha256_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA256_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reveresd, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); /* verify */ - ret = rimage_verify(privkey, image, V18, digest, - (unsigned char *)man->css.signature); + ret = rimage_verify(privkey, V18, &digest, (unsigned char *)man->css.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); +err: EVP_PKEY_free(privkey); return ret; } @@ -832,8 +812,8 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", @@ -853,28 +833,28 @@ int pkcs_v1_5_verify_man_v2_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); /* verify */ - ret = rimage_verify(privkey, image, V25, digest, - (unsigned char *)man->css.signature); + ret = rimage_verify(privkey, V25, &digest, (unsigned char *)man->css.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); +err: EVP_PKEY_free(privkey); return ret; } @@ -885,8 +865,8 @@ int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, unsigned int size2) { EVP_PKEY *privkey; - unsigned char digest[SHA384_DIGEST_LENGTH]; - int ret = -EINVAL, i; + struct hash_context digest; + int ret = -EINVAL; #if DEBUG_PKCS fprintf(stdout, "offsets 0x%lx size 0x%x offset 0x%lx size 0x%x\n", @@ -906,28 +886,27 @@ int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, } /* calculate the digest - SHA384 on CAVS2_5+ */ - module_sha384_create(image); - module_sha_update(image, ptr1, size1); - module_sha_update(image, ptr2, size2); - module_sha_complete(image, digest); + hash_sha384_init(&digest); + hash_update(&digest, ptr1, size1); + hash_update(&digest, ptr2, size2); + ret = hash_finalize(&digest); + if (ret) + goto err; fprintf(stdout, " pkcs: digest for manifest is "); - for (i = 0; i < SHA384_DIGEST_LENGTH; i++) - fprintf(stdout, "%02x", digest[i]); - fprintf(stdout, "\n"); + hash_print(&digest); /* signature is reversed, swap it */ bytes_swap(man->css.signature, sizeof(man->css.signature)); /* verify */ - ret = rimage_verify(privkey, image, VACE15, digest, - (unsigned char *)man->css.signature); - + ret = rimage_verify(privkey, VACE15, &digest, (unsigned char *)man->css.signature); if (ret <= 0) fprintf(stderr, "error: failed to verify manifest\n"); else fprintf(stdout, "pkcs: signature is valid !\n"); +err: EVP_PKEY_free(privkey); return ret; } From 6c7a1512c6bc645718da68abd889ec44e99ea3d2 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 10:52:58 +0100 Subject: [PATCH 287/639] hash: Remove old hash functions Removed currently unused functions. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/hash.c | 58 ------------------------------------- src/include/rimage/rimage.h | 9 ------ 2 files changed, 67 deletions(-) diff --git a/src/hash.c b/src/hash.c index f6409e3cd7cc..4a47730f4c99 100644 --- a/src/hash.c +++ b/src/hash.c @@ -194,61 +194,3 @@ int hash_sha384(const void *data, size_t size, void *output, size_t output_len) { return hash_single(data, size, EVP_sha384(), output, output_len); } - -void module_sha256_create(struct image *image) -{ - image->md = EVP_sha256(); - image->mdctx = EVP_MD_CTX_new(); - - EVP_DigestInit_ex(image->mdctx, image->md, NULL); -} - -void module_sha_update(struct image *image, uint8_t *data, size_t bytes) -{ - EVP_DigestUpdate(image->mdctx, data, bytes); -} - -void module_sha_complete(struct image *image, uint8_t *hash) -{ - unsigned char md_value[EVP_MAX_MD_SIZE]; - unsigned int md_len; -#if DEBUG_HASH - int i; -#endif - EVP_DigestFinal_ex(image->mdctx, md_value, &md_len); - EVP_MD_CTX_free(image->mdctx); - - memcpy(hash, md_value, md_len); -#if DEBUG_HASH - fprintf(stdout, "Module digest is: "); - for (i = 0; i < md_len; i++) - fprintf(stdout, "%02x", md_value[i]); - fprintf(stdout, "\n"); -#endif -} - -void ri_sha256(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash) -{ - assert((uint64_t)size + offset <= image->adsp->image_size); - module_sha256_create(image); - module_sha_update(image, image->fw_image + offset, size); - module_sha_complete(image, hash); -} - -void module_sha384_create(struct image *image) -{ - image->md = EVP_sha384(); - image->mdctx = EVP_MD_CTX_new(); - - EVP_DigestInit_ex(image->mdctx, image->md, NULL); -} - -void ri_sha384(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash) -{ - assert((uint64_t)size + offset <= image->adsp->image_size); - module_sha384_create(image); - module_sha_update(image, image->fw_image + offset, size); - module_sha_complete(image, hash); -} diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 0d7143941ca5..063f5ccec507 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -170,20 +170,11 @@ struct adsp { int exec_boot_ldr; }; -void module_sha256_create(struct image *image); -void module_sha384_create(struct image *image); -void module_sha_update(struct image *image, uint8_t *data, size_t bytes); -void module_sha_complete(struct image *image, uint8_t *hash); int ri_manifest_sign_v1_5(struct image *image); int ri_manifest_sign_v1_8(struct image *image); int ri_manifest_sign_v2_5(struct image *image); int ri_manifest_sign_ace_v1_5(struct image *image); -void ri_sha256(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash); -void ri_sha384(struct image *image, unsigned int offset, unsigned int size, - uint8_t *hash); - int pkcs_v1_5_sign_man_v1_5(struct image *image, struct fw_image_manifest_v1_5 *man, void *ptr1, unsigned int size1); From 6fad35625fafee5a06926c6896fa5013e6509e3c Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 27 Feb 2023 14:57:12 +0100 Subject: [PATCH 288/639] rimage: Removed hash context from image structure Fields related to hash computing have been removed from the image structure. Removed openssl headers from rimage.h, which made it necessary to add some missing includes in several files. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 2 ++ src/css.c | 1 + src/elf.c | 2 ++ src/ext_manifest.c | 1 + src/include/rimage/rimage.h | 7 +------ 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 9c4c94c50be2..4b086f4fd5f8 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -18,6 +18,8 @@ #include "toml.h" #include <stdbool.h> #include <stdint.h> +#include <stdarg.h> +#include <stdlib.h> #include <string.h> #include <stdio.h> #include <errno.h> diff --git a/src/css.c b/src/css.c index 92f6ea89fd93..631c3ee431a9 100644 --- a/src/css.c +++ b/src/css.c @@ -6,6 +6,7 @@ // Keyon Jie <yang.jie@linux.intel.com> #include <stdio.h> +#include <errno.h> #include <sys/time.h> #include <rimage/rimage.h> #include <rimage/css.h> diff --git a/src/elf.c b/src/elf.c index 552bc44d3c05..0275a194ed79 100644 --- a/src/elf.c +++ b/src/elf.c @@ -7,7 +7,9 @@ #include <assert.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <errno.h> #include <rimage/rimage.h> #include <rimage/cse.h> #include <rimage/manifest.h> diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 6985b919c379..8ed899406537 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -8,6 +8,7 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <errno.h> #include <rimage/ext_manifest_gen.h> #include <rimage/sof/kernel/ext_manifest.h> diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 063f5ccec507..692dbcdd7d28 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -11,9 +11,6 @@ #include <stdint.h> #include <stdio.h> -#include <openssl/conf.h> -#include <openssl/evp.h> -#include <openssl/err.h> #include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/sof/kernel/fw.h> @@ -87,10 +84,8 @@ struct image { int meu_offset; const char *verify_file; - /* SHA 256 & 384 */ + /* private key file name*/ const char *key_name; - EVP_MD_CTX *mdctx; - const EVP_MD *md; /* file IO */ void *fw_image; From 35bc64467a943c402022f1962e9e63a9be8f7f61 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 6 Mar 2023 10:01:24 +0800 Subject: [PATCH 289/639] mtl: add eq-iir and fir support Port from tgl-cavs.toml Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index d091df5c58fb..df541c9869a9 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 16 +count = 18 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -423,3 +423,41 @@ count = 16 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + +# mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 5bc201039d91457ad9b9068ac228e57bc2713d3b Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Mon, 6 Mar 2023 16:44:37 +0800 Subject: [PATCH 290/639] rimage: fix build error Recent changes introduce build error, fix the build error. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- src/css.c | 1 + src/pkcs1_5.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/css.c b/src/css.c index 631c3ee431a9..a69d5c80f76b 100644 --- a/src/css.c +++ b/src/css.c @@ -7,6 +7,7 @@ #include <stdio.h> #include <errno.h> +#include <time.h> #include <sys/time.h> #include <rimage/rimage.h> #include <rimage/css.h> diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index 4817f8beef89..ef0169b66e36 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -312,7 +312,7 @@ static int rimage_verify(EVP_PKEY *privkey, enum manver ver,struct hash_context } switch (ver) { - case V15 /* fallthrough */ + case V15: /* fallthrough */ case V18: break; @@ -338,8 +338,6 @@ static int rimage_verify(EVP_PKEY *privkey, enum manver ver,struct hash_context fprintf(stderr, "error: verify %s\n", err_buf); } - break; - out: EVP_PKEY_CTX_free(ctx); From d32db50b6104968e61adb2eb206f0b31e1682c18 Mon Sep 17 00:00:00 2001 From: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com> Date: Mon, 6 Mar 2023 14:05:57 +0100 Subject: [PATCH 291/639] mtl: add Aria module to extended manifest Add ARIA module to MTL extended manifest. Signed-off-by: Przemyslaw Blaszkowski <przemyslaw.blaszkowski@intel.com> --- config/mtl.toml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index df541c9869a9..a762ea7696c7 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 18 +count = 19 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -459,5 +459,30 @@ count = 18 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] -# mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] From dd15443129ba0de553627d42d4fc9dc4735cfad3 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 12:16:25 +0100 Subject: [PATCH 292/639] file_utils: Removed duplicated function descriptions Functions are already described in the header file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/file_utils.c b/src/file_utils.c index 48055840d159..6511dd90cee2 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -11,14 +11,6 @@ #include <rimage/file_utils.h> -/** - * Create new file name using output file name as template. - * @param [out] new_name char[] destination of new file name - * @param [in] name_size new file name buffer capacity - * @param [in] template_name File name used as a template for the new name - * @param [in] new_ext extension of the new file name - * @param error code, 0 when success - */ int create_file_name(char *new_name, const size_t name_size, const char *template_name, const char *new_ext) { @@ -37,13 +29,6 @@ int create_file_name(char *new_name, const size_t name_size, const char *templat return 0; } -/** - * Get file size - * @param [in] f file handle - * @param [in] filename File name used to display the error message - * @param [out] size output for file size - * @param error code, 0 when success - */ int get_file_size(FILE *f, const char* filename, size_t *size) { int ret; From 32a5388c10b5c71514c05dd4623c45a9bfe9c741 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 12:18:47 +0100 Subject: [PATCH 293/639] file_utils: Add file_error function Added a generic function that displays a file operation error message. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 30 ++++++++++++++++++------------ src/include/rimage/file_utils.h | 8 ++++++++ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/file_utils.c b/src/file_utils.c index 6511dd90cee2..c8d406d677ba 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -8,9 +8,21 @@ #include <unistd.h> #include <errno.h> #include <assert.h> +#include <string.h> #include <rimage/file_utils.h> +int file_error(const char *msg, const char *filename) +{ + int code = errno; + char sys_msg[256]; + + strerror_r(code, sys_msg, sizeof(sys_msg)); + + fprintf(stderr, "%s:\terror: %s. %s (errno = %d)\n", filename, msg, sys_msg, code); + return -code; +} + int create_file_name(char *new_name, const size_t name_size, const char *template_name, const char *new_ext) { @@ -37,22 +49,16 @@ int get_file_size(FILE *f, const char* filename, size_t *size) /* get file size */ ret = fseek(f, 0, SEEK_END); - if (ret < 0) { - fprintf(stderr, "error: unable to seek eof %s %d\n", filename, errno); - return -errno; - } + if (ret) + return file_error("unable to seek eof", filename); *size = ftell(f); - if (*size < 0) { - fprintf(stderr, "error: unable to get file size for %s %d\n", filename, errno); - return -errno; - } + if (*size < 0) + return file_error("unable to get file size", filename); ret = fseek(f, 0, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: unable to seek set %s %d\n", filename, errno); - return -errno; - } + if (ret) + return file_error("unable to seek set", filename); return 0; } diff --git a/src/include/rimage/file_utils.h b/src/include/rimage/file_utils.h index 2c7ef6528dd8..34ecc89f5bad 100644 --- a/src/include/rimage/file_utils.h +++ b/src/include/rimage/file_utils.h @@ -8,6 +8,14 @@ #include <stddef.h> +/** + * Print file operation error message + * @param [in]msg error message + * @param [in]filename File name used to display the error message + * @param error code + */ +int file_error(const char *msg, const char *filename); + /** * Create new file name using output file name as template. * @param [out] new_name char[] destination of new file name From 4aacac3460f21a65b335cbada8857f1c452947ad Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 13:37:43 +0100 Subject: [PATCH 294/639] Use file_error function to print file related errors Added error handling where it was missing. According to the documentation, the fseek function returns a non-zero value on error. The conditions for checking this value have been corrected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 4 +- src/ext_manifest.c | 50 +++++++++++++++-------- src/file_simple.c | 72 +++++++++++++++++---------------- src/manifest.c | 99 ++++++++++++++-------------------------------- src/pkcs1_5.c | 9 ++--- src/rimage.c | 5 +-- 6 files changed, 110 insertions(+), 129 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 4b086f4fd5f8..4cab5cbe489f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -15,6 +15,7 @@ #include "rimage/cse.h" #include "rimage/css.h" #include "rimage/toml_utils.h" +#include "rimage/file_utils.h" #include "toml.h" #include <stdbool.h> #include <stdint.h> @@ -2348,7 +2349,8 @@ int adsp_parse_config(const char *file, struct image *image) fd = fopen(file, "r"); if (!fd) - return log_err(-EIO, "error: can't open '%s' file\n", file); + return file_error("unable to open file for reading", file); + ret = adsp_parse_config_fd(fd, image); fclose(fd); return ret; diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 8ed899406537..e670b47825e5 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -35,11 +35,8 @@ static int ext_man_open_file(struct image *image) /* open extended manifest outfile for writing */ image->out_ext_man_fd = fopen(image->out_ext_man_file, "wb"); - if (!image->out_ext_man_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_ext_man_file, errno); - return errno; - } + if (!image->out_ext_man_fd) + return file_error("unable to open file for writing", image->out_ext_man_file); return 0; } @@ -169,10 +166,7 @@ int ext_man_write(struct image *image) count = fwrite(ext_man, 1, ext_man->full_size, image->out_ext_man_fd); if (count != ext_man->full_size) { - fprintf(stderr, - "error: can't write extended manifest to file %d\n", - -errno); - ret = -errno; + ret = file_error("can't write extended manifest", image->out_ext_man_file); goto out; } @@ -195,6 +189,7 @@ int ext_man_write_cavs_25(struct image *image) int pin_count; int count, i; int ret; + size_t write_ret; ret = ext_man_open_file(image); if (ret) @@ -213,17 +208,38 @@ int ext_man_write_cavs_25(struct image *image) fwrite(&header, 1, sizeof(header), image->out_ext_man_fd); for (i = 0; i < count; i++) { - fwrite(&mod_ext->ext_mod_config_array[i].header, 1, - sizeof(struct fw_ext_mod_config_header), image->out_ext_man_fd); + write_ret = fwrite(&mod_ext->ext_mod_config_array[i].header, + sizeof(struct fw_ext_mod_config_header), 1, + image->out_ext_man_fd); + if (write_ret != 1) { + ret = file_error("can't write fw_ext_mod_config_header", + image->out_ext_man_file); + goto out; + } - if (mod_ext->ext_mod_config_array[i].header.num_scheduling_capabilities) - fwrite(&mod_ext->ext_mod_config_array[i].sched_caps, 1, - sizeof(struct mod_scheduling_caps), image->out_ext_man_fd); + if (mod_ext->ext_mod_config_array[i].header.num_scheduling_capabilities) { + write_ret = fwrite(&mod_ext->ext_mod_config_array[i].sched_caps, + sizeof(struct mod_scheduling_caps), 1, + image->out_ext_man_fd); + if (write_ret != 1) { + ret = file_error("can't write mod_scheduling_caps", + image->out_ext_man_file); + goto out; + } + } pin_count = mod_ext->ext_mod_config_array[i].header.num_pin_entries; - if (pin_count) - fwrite(mod_ext->ext_mod_config_array[i].pin_desc, pin_count, - sizeof(struct fw_pin_description), image->out_ext_man_fd); + if (pin_count) { + write_ret = fwrite(mod_ext->ext_mod_config_array[i].pin_desc, + sizeof(struct fw_pin_description), pin_count, + image->out_ext_man_fd); + + if (write_ret != pin_count) { + ret = file_error("can't write fw_pin_description", + image->out_ext_man_file); + goto out; + } + } } out: diff --git a/src/file_simple.c b/src/file_simple.c index b85bbb18dadf..a63afa8de815 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -10,6 +10,7 @@ #include <rimage/rimage.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { @@ -68,7 +69,7 @@ static int write_block(struct image *image, struct module *module, /* write header */ count = fwrite(&block, sizeof(block), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("Write header failed", image->out_file); /* alloc data data */ buffer = calloc(1, section->size); @@ -77,24 +78,22 @@ static int write_block(struct image *image, struct module *module, /* read in section data */ ret = fseek(module->fd, section->off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: cant seek to section %d\n", ret); + if (ret) { + ret = file_error("seek to section failed", module->elf_file); goto out; } count = fread(buffer, 1, section->size, module->fd); if (count != section->size) { - fprintf(stderr, "error: cant read section %d\n", -errno); - ret = -errno; + ret = file_error("cant read section", module->elf_file); goto out; } /* write out section data */ count = fwrite(buffer, 1, block.size, image->out_fd); if (count != block.size) { - fprintf(stderr, "error: cant write section %d\n", -errno); + ret = file_error("cant write section", image->out_file); fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", section->off, section->size, section->vaddr); - ret = -errno; goto out; } @@ -128,12 +127,12 @@ static int simple_write_module(struct image *image, struct module *module) /* Get the pointer of writing hdr */ ptr_hdr = ftell(image->out_fd); + if (ptr_hdr < 0) + return file_error("cant get file position", image->out_file); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", - -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write section header", image->out_file); fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); @@ -172,15 +171,21 @@ static int simple_write_module(struct image *image, struct module *module) hdr.size += padding; /* Record current pointer, will set it back after overwriting hdr */ ptr_cur = ftell(image->out_fd); + if (ptr_cur < 0) + return file_error("cant get file position", image->out_file); + /* overwrite hdr */ - fseek(image->out_fd, ptr_hdr, SEEK_SET); + err = fseek(image->out_fd, ptr_hdr, SEEK_SET); + if (err) + return file_error("cant seek to header", image->out_file); + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", - -errno); - return -errno; - } - fseek(image->out_fd, ptr_cur, SEEK_SET); + if (count != 1) + return file_error("failed to write section header", image->out_file); + + err = fseek(image->out_fd, ptr_cur, SEEK_SET); + if (err) + return file_error("cant seek", image->out_file); fprintf(stdout, "\n"); /* return padding size */ @@ -201,7 +206,7 @@ static int write_block_reloc(struct image *image, struct module *module) /* write header */ count = fwrite(&block, sizeof(block), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("cant write header", image->out_file); /* alloc data data */ buffer = calloc(1, module->file_size); @@ -210,22 +215,20 @@ static int write_block_reloc(struct image *image, struct module *module) /* read in section data */ ret = fseek(module->fd, 0, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to section %d\n", ret); + if (ret) { + ret = file_error("can't seek to section", module->elf_file); goto out; } count = fread(buffer, 1, module->file_size, module->fd); if (count != module->file_size) { - fprintf(stderr, "error: can't read section %d\n", -errno); - ret = -errno; + ret = file_error("can't read section", module->elf_file); goto out; } /* write out section data */ count = fwrite(buffer, 1, module->file_size, image->out_fd); if (count != module->file_size) { - fprintf(stderr, "error: can't write section %d\n", -errno); - ret = -errno; + ret = file_error("can't write section", image->out_file); goto out; } @@ -249,11 +252,8 @@ static int simple_write_module_reloc(struct image *image, struct module *module) hdr.type = SOF_FW_BASE; // module count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) { - fprintf(stderr, "error: failed to write section header %d\n", - -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write section header", image->out_file); fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); @@ -304,7 +304,7 @@ int simple_write_firmware(struct image *image) count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("failed to write header", image->out_file); for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; @@ -324,10 +324,14 @@ int simple_write_firmware(struct image *image) hdr.file_size += ret; } /* overwrite hdr */ - fseek(image->out_fd, 0, SEEK_SET); + ret = fseek(image->out_fd, 0, SEEK_SET); + if (ret) + return file_error("can't seek set", image->out_file); + + count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) - return -errno; + return file_error("failed to write header", image->out_file); fprintf(stdout, "firmware: image size %ld (0x%lx) bytes %d modules\n\n", (long)(hdr.file_size + sizeof(hdr)), diff --git a/src/manifest.c b/src/manifest.c index 1161e037943b..5ce0c1d91744 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -45,11 +45,8 @@ static int man_open_rom_file(struct image *image) /* open ROM outfile for writing */ image->out_rom_fd = fopen(image->out_rom_file, "wb"); - if (!image->out_rom_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_rom_file, errno); - return -errno; - } + if (!image->out_rom_fd) + return file_error("unable to open file for writing", image->out_rom_file); return 0; } @@ -65,11 +62,8 @@ static int man_open_unsigned_file(struct image *image) /* open unsigned FW outfile for writing */ image->out_unsigned_fd = fopen(image->out_unsigned_file, "wb"); - if (!image->out_unsigned_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_unsigned_file, errno); - return -errno; - } + if (!image->out_unsigned_fd) + return file_error("unable to open file for writing", image->out_unsigned_file); return 0; } @@ -85,11 +79,8 @@ static int man_open_manifest_file(struct image *image) /* open manifest outfile for writing */ image->out_man_fd = fopen(image->out_man_file, "wb"); - if (!image->out_man_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_man_file, errno); - return -errno; - } + if (!image->out_man_fd) + return file_error("unable to open file for writing", image->out_man_file); return 0; } @@ -221,10 +212,8 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, man_module->segment[seg_type].file_offset = offset; count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) { - fprintf(stderr, "error: cant read section %d\n", -errno); - return -errno; - } + if (count != section->size) + return file_error("cant read section", module->elf_file); /* get module end offset ? */ if (end > image->image_end) @@ -245,10 +234,8 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, /* seek to ELF section */ ret = fseek(module->fd, section->off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to section %d\n", ret); - return ret; - } + if (ret) + return file_error("can't seek to section", module->elf_file); /* write data to DRAM or ROM image */ if (!elf_is_rom(image, section)) @@ -286,10 +273,8 @@ static int man_get_module_manifest(struct image *image, struct module *module, } count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); - if (count != sizeof(sof_mod)) { - fprintf(stderr, "error: can't read section %d\n", -errno); - return -errno; - } + if (count != sizeof(sof_mod)) + return file_error("can't read section", module->elf_file); /* configure man_module with sofmod data */ memcpy(man_module->struct_id, "$AME", 4); @@ -576,16 +561,12 @@ static int man_module_create_reloc(struct image *image, struct module *module, /* seek to beginning of file */ err = fseek(module->fd, 0, SEEK_SET); - if (err < 0) { - fprintf(stderr, "error: can't seek to section %d\n", err); - return err; - } + if (err) + return file_error("can't seek to section", module->elf_file); count = fread(buffer, 1, module->file_size, module->fd); - if (count != module->file_size) { - fprintf(stderr, "error: can't read section %d\n", -errno); - return -errno; - } + if (count != module->file_size) + return file_error("can't read section", module->elf_file); fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%x\t%s\n", 0, 0, module->file_size, 0, "DATA"); @@ -618,11 +599,9 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, image->out_man_fd); /* did the metadata/manifest write succeed ? */ - if (count != 1) { - fprintf(stderr, "error: failed to write meta %s %d\n", - image->out_man_file, -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write meta", image->out_man_file); + fclose(image->out_man_fd); /* now prepare the unsigned rimage */ @@ -631,11 +610,8 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, 1, image->out_unsigned_fd); /* did the unsigned FW write succeed ? */ - if (count != 1) { - fprintf(stderr, "error: failed to write firmware %s %d\n", - image->out_unsigned_file, -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write firmware", image->out_unsigned_file); fclose(image->out_unsigned_fd); return 0; @@ -649,11 +625,8 @@ static int man_write_fw_mod(struct image *image) count = fwrite(image->fw_image, image->image_end, 1, image->out_fd); /* did the image write succeed ? */ - if (count != 1) { - fprintf(stderr, "error: failed to write signed firmware %s %d\n", - image->out_file, -errno); - return -errno; - } + if (count != 1) + return file_error("failed to write signed firmware", image->out_file); return 0; } @@ -1567,11 +1540,8 @@ int verify_image(struct image *image) /* open image for reading */ in_file = fopen(image->verify_file, "rb"); - if (!in_file) { - fprintf(stderr, "error: unable to open %s for reading %d\n", - image->verify_file, errno); - return -errno; - } + if (!in_file) + return file_error("unable to open file for reading", image->verify_file); /* get file size */ ret = get_file_size(in_file, image->verify_file, &size); @@ -1589,9 +1559,7 @@ int verify_image(struct image *image) /* find start of fw image and verify */ read = fread(buffer, 1, size, in_file); if (read != size) { - fprintf(stderr, "error: unable to read %ld bytes from %s err %d\n", - size, image->verify_file, errno); - ret = errno; + ret = file_error("unable to read whole file", image->verify_file); goto out; } for (i = 0; i < size; i += sizeof(uint32_t)) { @@ -1622,11 +1590,8 @@ int resign_image(struct image *image) /* open image for reading */ in_file = fopen(image->in_file, "rb"); - if (!in_file) { - fprintf(stderr, "error: unable to open %s for reading %d\n", - image->in_file, errno); - return -errno; - } + if (!in_file) + return file_error("unable to open file for reading", image->in_file); /* get file size */ ret = get_file_size(in_file, image->in_file, &size); @@ -1644,9 +1609,7 @@ int resign_image(struct image *image) /* read file into buffer */ read = fread(buffer, 1, size, in_file); if (read != size) { - fprintf(stderr, "error: unable to read %zu bytes from %s err %d\n", - size, image->in_file, errno); - ret = errno; + ret = file_error("unable to read whole file", image->in_file); goto out; } @@ -1703,9 +1666,7 @@ int resign_image(struct image *image) unlink(image->out_file); image->out_fd = fopen(image->out_file, "wb"); if (!image->out_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image->out_file, errno); - ret = -EINVAL; + ret = file_error("unable to open file for writting", image->out_file); goto out; } diff --git a/src/pkcs1_5.c b/src/pkcs1_5.c index ef0169b66e36..de063ee03bec 100644 --- a/src/pkcs1_5.c +++ b/src/pkcs1_5.c @@ -24,6 +24,7 @@ #include <rimage/css.h> #include <rimage/manifest.h> #include <rimage/misc_utils.h> +#include <rimage/file_utils.h> #include <rimage/hash.h> #define DEBUG_PKCS 0 @@ -57,11 +58,9 @@ static int rimage_read_key(EVP_PKEY **privkey, struct image *image) fprintf(stdout, " %s: read key '%s'\n", __func__, path); fp = fopen(path, "rb"); - if (!fp) { - fprintf(stderr, "error: can't open file %s %d\n", - path, -errno); - return -errno; - } + if (!fp) + return file_error("unable to open file for reading", path); + PEM_read_PrivateKey(fp, privkey, NULL, NULL); fclose(fp); diff --git a/src/rimage.c b/src/rimage.c index 4ec34a856840..a6e23470d698 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -14,6 +14,7 @@ #include <rimage/ext_manifest_gen.h> #include <rimage/rimage.h> #include <rimage/manifest.h> +#include <rimage/file_utils.h> static void usage(char *name) @@ -218,9 +219,7 @@ int main(int argc, char *argv[]) unlink(image.out_file); image.out_fd = fopen(image.out_file, "wb"); if (!image.out_fd) { - fprintf(stderr, "error: unable to open %s for writing %d\n", - image.out_file, errno); - ret = -EINVAL; + ret = file_error("unable to open file for writing", image.out_file); goto out; } From 125745bcad1742b2bc2aac20096857bb66f704d0 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 13:52:42 +0100 Subject: [PATCH 295/639] file_utils: Fix error detection in get_file_size function The fseek function returns -1 to signal an error. Return value was assigned to a variable without a sign, so the error could not be detected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/file_utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/file_utils.c b/src/file_utils.c index c8d406d677ba..89a89ae40954 100644 --- a/src/file_utils.c +++ b/src/file_utils.c @@ -44,7 +44,7 @@ int create_file_name(char *new_name, const size_t name_size, const char *templat int get_file_size(FILE *f, const char* filename, size_t *size) { int ret; - + long pos; assert(size); /* get file size */ @@ -52,13 +52,14 @@ int get_file_size(FILE *f, const char* filename, size_t *size) if (ret) return file_error("unable to seek eof", filename); - *size = ftell(f); - if (*size < 0) + pos = ftell(f); + if (pos < 0) return file_error("unable to get file size", filename); ret = fseek(f, 0, SEEK_SET); if (ret) return file_error("unable to seek set", filename); + *size = pos; return 0; } From 343b6d863da53ad29deb47b4fbb3f3cc51a289c2 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 10 Mar 2023 16:08:11 +0100 Subject: [PATCH 296/639] Revert "config:tgl/tglh: Do not set cached/uncached address aliases" Now that rimage can distinguish between Zephyr and XTOS builds, we can use memory alias specifiers with both. This reverts commit 1e0a85b44a19db37f9dd18906091d87abd8bd5e6. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/tgl-h.toml | 8 ++++++++ config/tgl.toml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/config/tgl-h.toml b/config/tgl-h.toml index 908c3bfc8a1f..997e1a832899 100644 --- a/config/tgl-h.toml +++ b/config/tgl-h.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x1F0000" # (30 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/tgl.toml b/config/tgl.toml index d6183faf5345..9a64c694c7f8 100644 --- a/config/tgl.toml +++ b/config/tgl.toml @@ -3,6 +3,7 @@ version = [2, 5] [adsp] name = "tgl" image_size = "0x2F0000" # (46 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] From 63eb6ffb0a0b81b328c209173f743f5b6750e521 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Tue, 21 Mar 2023 16:05:27 +0100 Subject: [PATCH 297/639] cAVS: add alias definitions to cAVS 1.5-2.0 cAVS 1.5, 1.8 and 2.0 are supported by Zephyr, their configurations need alias definitions. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- config/apl.toml | 8 ++++++++ config/cnl.toml | 8 ++++++++ config/icl.toml | 8 ++++++++ config/jsl.toml | 8 ++++++++ config/kbl.toml | 8 ++++++++ config/skl.toml | 8 ++++++++ config/sue.toml | 8 ++++++++ 7 files changed, 56 insertions(+) diff --git a/config/apl.toml b/config/apl.toml index fafd01853da7..e100c78a754c 100644 --- a/config/apl.toml +++ b/config/apl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "apl" image_size = "0x0A0000" # (8 + 2) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -13,6 +14,13 @@ type = "SRAM" base = "0xA000A000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/cnl.toml b/config/cnl.toml index fae7fe80c6d1..ccf33fb68e2a 100644 --- a/config/cnl.toml +++ b/config/cnl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "cnl" image_size = "0x300000" # (47 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/icl.toml b/config/icl.toml index 20ba7765fc56..f6e0fc9cb209 100644 --- a/config/icl.toml +++ b/config/icl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "icl" image_size = "0x300000" # (47 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/jsl.toml b/config/jsl.toml index a501066a2531..bec0e6bd3a7e 100644 --- a/config/jsl.toml +++ b/config/jsl.toml @@ -3,6 +3,7 @@ version = [1, 8] [adsp] name = "icl" image_size = "0x110000" # (16 + 1) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -17,6 +18,13 @@ type = "SRAM" base = "0xBE040000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [cse] partition_name = "ADSP" [[cse.entry]] diff --git a/config/kbl.toml b/config/kbl.toml index 442c886b99ec..f1c83d594905 100644 --- a/config/kbl.toml +++ b/config/kbl.toml @@ -3,6 +3,7 @@ version = [1, 5] [adsp] name = "kbl" image_size = "0x200000" # (30 + 2) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -13,6 +14,13 @@ type = "SRAM" base = "0xA000A000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [css] [fw_desc.header] diff --git a/config/skl.toml b/config/skl.toml index a907a121d74c..0fff3a382bbf 100644 --- a/config/skl.toml +++ b/config/skl.toml @@ -3,6 +3,7 @@ version = [1, 5] [adsp] name = "skl" image_size = "0x200000" # (30 + 2) bank * 64KB +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -13,6 +14,13 @@ type = "SRAM" base = "0xA000A000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [css] [fw_desc.header] diff --git a/config/sue.toml b/config/sue.toml index bcf093c70fc3..7579c7fcfb06 100644 --- a/config/sue.toml +++ b/config/sue.toml @@ -4,6 +4,7 @@ version = [1, 5] name = "sue" image_size = "0x300000" # (47 + 1) bank * 64KB exec_boot_ldr = 1 +alias_mask = "0xE0000000" [[adsp.mem_zone]] type = "ROM" @@ -18,6 +19,13 @@ type = "SRAM" base = "0xbe000000" size = "0x100000" +[[adsp.mem_alias]] +type = "uncached" +base = "0x9E000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xBE000000" + [fw_desc.header] name = "ADSPFW" load_offset = "0x2000" From 1bf447c8c2992b53c6028ea38165babe5640128b Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Thu, 30 Mar 2023 13:48:54 +0300 Subject: [PATCH 298/639] config: tgl-h-cavs: align modules to tgl-cavs config Update the list of modules to match that of "tgl-cavs". Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- config/tgl-h-cavs.toml | 155 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 154 insertions(+), 1 deletion(-) diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index cab16a4365a8..69f8de7ab581 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 8 +count = 15 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -235,3 +235,156 @@ count = 8 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + [[module.entry]] + name = "SRCINTC" + uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" + affinity_mask = "0xF" + instance_count = "10" + domain_types = "1" + load_type = "0" + module_type = "0x7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x45ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0xD" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + module_type = "0xC" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] From 01fd742605985351cfb4a8e50356764ec4e1fd01 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Fri, 23 Sep 2022 15:17:03 +0200 Subject: [PATCH 299/639] lnl: Add LNL configuration file Add base LNL config derived from MTL. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- config/lnl.toml | 488 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 488 insertions(+) create mode 100644 config/lnl.toml diff --git a/config/lnl.toml b/config/lnl.toml new file mode 100644 index 000000000000..0093e40a3eee --- /dev/null +++ b/config/lnl.toml @@ -0,0 +1,488 @@ +version = [3, 0] + +[adsp] +name = "lnl" +image_size = "0x2C0000" # (22) bank * 128KB +alias_mask = "0xE0000000" + +[[adsp.mem_zone]] +type = "ROM" +base = "0x1FF80000" +size = "0x400" +[[adsp.mem_zone]] +type = "IMR" +base = "0xA104A000" +size = "0x2000" +[[adsp.mem_zone]] +type = "SRAM" +base = "0xa00f0000" +size = "0x100000" + +[[adsp.mem_alias]] +type = "uncached" +base = "0x40000000" +[[adsp.mem_alias]] +type = "cached" +base = "0xA0000000" + +[cse] +partition_name = "ADSP" +[[cse.entry]] +name = "ADSP.man" +offset = "0x5c" +length = "0x464" +[[cse.entry]] +name = "ADSP.met" +offset = "0x4c0" +length = "0x70" +[[cse.entry]] +name = "ADSP" +offset = "0x540" +length = "0x0" # calculated by rimage + +[css] + +[signed_pkg] +name = "ADSP" +partition_usage = "0x23" +[[signed_pkg.module]] +name = "ADSP.met" + +[adsp_file] +[[adsp_file.comp]] +base_offset = "0x2000" + +[fw_desc.header] +name = "ADSPFW" +load_offset = "0x40000" + +[module] +count = 19 + [[module.entry]] + name = "BRNGUP" + uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "BASEFW" + uuid = "0E398C32-5ADE-BA4B-93B1-C50432280EE4" + affinity_mask = "3" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0" + auto_start = "0" + + [[module.entry]] + name = "MIXIN" + uuid = "39656EB2-3B71-4049-8D3F-F92CD5C43C09" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, + 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, + 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, + 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, + 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, + 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, + 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, + 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "MIXOUT" + uuid = "3C56505A-24D7-418F-BDDC-C1F5A3AC2AE0" + affinity_mask = "0x1" + instance_count = "30" + domain_types = "0" + load_type = "0" + module_type = "2" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, + 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, + 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, + 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "COPIER" + uuid = "9BA00C83-CA12-4A83-943C-1FA2E82F9DDA" + affinity_mask = "0x1" + instance_count = "32" + domain_types = "0" + load_type = "0" + module_type = "3" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, + 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, + 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, + 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, + 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, + 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, + 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, + 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PEAKVOL" + uuid = "8A171323-94A3-4E1D-AFE9-FE5DBAA4C393" + affinity_mask = "0x1" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "4" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "GAIN" + uuid = "61BCA9A8-18D0-4A18-8E7B-2639219804B7" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, + 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, + 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, + 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, + 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "ASRC" + uuid = "66B4402D-B468-42F2-81A7-B37121863DD4" + affinity_mask = "0x3" + instance_count = "2" + domain_types = "0" + + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, + 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] + + mod_cfg = [0, 0, 0, 0, 20480, 4065600, 24, 22, 0, 0, 0, + 1, 0, 0, 0, 20480, 5616000, 8, 25, 0, 0, 0, + 2, 0, 0, 0, 20480, 7319200, 24, 27, 0, 0, 0, + 3, 0, 0, 0, 20480, 9155300, 8, 27, 0, 0, 0, + 4, 0, 0, 0, 20480, 10972600, 48, 54, 0, 0, 0, + 5, 0, 0, 0, 20480, 12661000, 16, 36, 0, 0, 0, + 6, 0, 0, 0, 20480, 14448500, 48, 96, 0, 0, 0, + 7, 0, 0, 0, 20480, 16145000, 19, 68, 0, 0, 0, + 8, 0, 0, 0, 20480, 17861300, 45, 102, 0, 0, 0, + 9, 0, 0, 0, 20480, 21425900, 8, 36, 0, 0, 0, + 10, 0, 0, 0, 20480, 22771000, 32, 102, 0, 0, 0, + 11, 0, 0, 0, 20480, 23439000, 48, 27, 0, 0, 0, + 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, + 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, + 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + + [[module.entry]] + name = "SRC" + uuid = "E61BB28D-149A-4C1F-B709-46823EF5F5AE" + affinity_mask = "0x1" + #instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "7" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + + [[module.entry]] + name = "MICSEL" + uuid = "32FE92C1-1E17-4FC2-9758-C7F3542E980A" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "0xC" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xe, 0xa, 0x45ff, 1, 0, 0xfeef, 0xe, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, + 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, + 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "UPDWMIX" + uuid = "42F8060C-832F-4DBF-B247-51E961997B34" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "0" + module_type = "5" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xffff, 0xc, 0x8, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 216, 706000, 12, 16, 0, 0, 0, + 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, + 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, + 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, + 4, 0, 0, 0, 216, 3343000, 192, 192, 0, 0, 0, + 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, + 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, + 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] + + [[module.entry]] + name = "PROBE" + uuid = "7CAD0808-AB10-CD23-EF45-12AB34CD56EF" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] + + [[module.entry]] + name = "MUX" + uuid = "64ce6e35-857a-4878-ace8-e2a2f42e3069" + affinity_mask = "0x1" + instance_count = "15" + domain_types = "0" + load_type = "0" + module_type = "6" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 280, 460700, 16, 16, 0, 0, 0] + + [[module.entry]] + name = "KDTEST" + uuid = "EBA8D51F-7827-47B5-82EE-DE6E7743AF67" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "8" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 480, 1114000, 64, 64, 0, 0, 0] + + [[module.entry]] + name = "KPB" + uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + module_type = "0xB" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 14400, 1114000, 16, 16, 0, 0, 0] + + # smart amp test module config + [[module.entry]] + name = "SMATEST" + uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" + affinity_mask = "0x1" + instance_count = "1" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "0xD" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQIIR" + uuid = "5150C0E6-27F9-4EC8-8351-C705B642D12F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # eq iir module config + [[module.entry]] + name = "EQFIR" + uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] From 9643a986dda97c6cb339d5c75c0eaa178d8317da Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Mon, 3 Apr 2023 11:18:04 +0200 Subject: [PATCH 300/639] kpb: update UUID Change of uuid regarding Windows compatibility Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index a762ea7696c7..38698b8e2c39 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -387,7 +387,7 @@ count = 19 [[module.entry]] name = "KPB" - uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + uuid = "A8A0CB32-4A77-4DB1-85C7-53D7EE07BCE6" affinity_mask = "0x1" instance_count = "1" domain_types = "0" From b2177e55856279f3a0f381327c73b61bc6221c5c Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 13:40:21 +0100 Subject: [PATCH 301/639] elf: Add header guard to elf.h Added header guard in elf.h file to allow safe include this header by multiple units. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/elf.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/include/rimage/elf.h b/src/include/rimage/elf.h index a9a6505e7793..13a4965e059e 100644 --- a/src/include/rimage/elf.h +++ b/src/include/rimage/elf.h @@ -5,6 +5,9 @@ * Portions Copyright 2009 The Go Authors. All rights reserved. */ +#ifndef __ELF_H__ +#define __ELF_H__ + /* * ELF definitions that are independent of architecture or word size. */ @@ -929,3 +932,5 @@ typedef struct { #define ELF32SHDRSIZE sizeof(Elf32_Shdr) #define ELF32SYMSIZE sizeof(Elf32_Sym) #define ELF32RELSIZE 8 + +#endif /* __ELF_H__ */ From 9633c3b66ff77f41c5a8b5b070b0ee5fc6ed5798 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 10 Mar 2023 16:45:32 +0100 Subject: [PATCH 302/639] manifest: Check return value of man_create_modules The man_create_modules function may return an error that was ignored. Added check of a return value. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 5ce0c1d91744..f2a7c3e7a35b 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -774,7 +774,9 @@ int man_write_fw_v1_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -844,7 +846,10 @@ int man_write_fw_v1_5_sue(struct image *image) /* create each module - subtract the boot loader exec header */ m->desc.header.num_module_entries = image->num_modules - 1; - man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); + ret = man_create_modules(image, &m->desc, FILE_TEXT_OFFSET_V1_5_SUE); + if (ret) + goto err; + fprintf(stdout, "Firmware completing manifest v1.5\n"); /* write preload page count */ @@ -915,7 +920,9 @@ int man_write_fw_v1_8(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -1033,7 +1040,9 @@ int man_write_fw_meu_v1_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_5); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.5\n"); @@ -1117,7 +1126,9 @@ int man_write_fw_meu_v1_8(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; fprintf(stdout, "Firmware completing manifest v1.8\n"); @@ -1201,7 +1212,10 @@ int man_write_fw_meu_v2_5(struct image *image) /* create each module */ desc->header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; + /* platform config defines some modules except bringup & base modules */ man_create_modules_in_config(image, desc); @@ -1288,7 +1302,10 @@ int man_write_fw_v2_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; + /* platform config defines some modules except bringup & base modules */ man_create_modules_in_config(image, desc); @@ -1438,7 +1455,10 @@ int man_write_fw_ace_v1_5(struct image *image) /* create each module */ m->desc.header.num_module_entries = image->num_modules; - man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + ret = man_create_modules(image, desc, FILE_TEXT_OFFSET_V1_8); + if (ret) + goto err; + /* platform config defines some modules except bringup & base modules */ man_create_modules_in_config(image, desc); From c21018335af5d4b501376fa9d5b86187b64284a1 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 21 Mar 2023 13:10:49 +0100 Subject: [PATCH 303/639] Remove unused dram_offset field / config option There was no dram_offset value in any configuration file. It also wasn't used anywhere in the code. So the code reading it from the tolm file has been removed. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 5 ----- src/include/rimage/rimage.h | 1 - 2 files changed, 6 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 4cab5cbe489f..fdeadb7b9a52 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -66,7 +66,6 @@ static void dump_adsp(const struct adsp *adsp) DUMP("\nadsp"); DUMP_KEY("name", "'%s'", adsp->name); DUMP_KEY("image_size", "0x%x", adsp->image_size); - DUMP_KEY("dram_offset", "0x%x", adsp->dram_offset); DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); for (i = 0; i < ARRAY_SIZE(adsp->mem_zones); ++i) { DUMP_KEY("mem_zone.idx", "%d", i); @@ -115,10 +114,6 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - out->dram_offset = parse_uint32_hex_key(adsp, &ctx, "dram_offset", 0, &ret); - if (ret < 0) - return ret; - out->exec_boot_ldr = parse_uint32_key(adsp, &ctx, "exec_boot_ldr", 0, &ret); if (ret < 0) return ret; diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 692dbcdd7d28..ec2449dfcaac 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -146,7 +146,6 @@ struct adsp { struct mem_zone mem_zones[SOF_FW_BLK_TYPE_NUM]; uint32_t image_size; - uint32_t dram_offset; uint32_t alias_cached; uint32_t alias_uncached; From d20916066e1a8226ac3a0b91bb10781ac2219fad Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Tue, 7 Mar 2023 15:28:12 +0100 Subject: [PATCH 304/639] misc_utils: Added functions to print enum and flags value Added name_val structure representing name/value tuple. Added function print_enum which displays the name of the enum corresponding to a given value. Added print_flags function which display names of flags constituting a given value. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/misc_utils.h | 16 ++++++++++++++++ src/misc_utils.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/include/rimage/misc_utils.h b/src/include/rimage/misc_utils.h index cf9353ac9d8d..8ec051d74e91 100644 --- a/src/include/rimage/misc_utils.h +++ b/src/include/rimage/misc_utils.h @@ -3,6 +3,9 @@ * Copyright(c) 2023 Intel Corporation. All rights reserved. */ +#ifndef __MISC_UTILS_H__ +#define __MISC_UTILS_H__ + #include <stdint.h> /** @@ -11,3 +14,16 @@ * @param size of the array */ void bytes_swap(uint8_t *ptr, uint32_t size); + +struct name_val { + const char *name; + unsigned long value; +}; + +#define NAME_VAL_ENTRY(x) { .name = #x, .value = x } +#define NAME_VAL_END { .name = 0, .value = 0 } + +void print_enum(unsigned long value, const struct name_val *values); +void print_flags(unsigned long value, const struct name_val *flags); + +#endif /* __MISC_UTILS_H__ */ diff --git a/src/misc_utils.c b/src/misc_utils.c index e4b5e4d4ce5c..2c0146f5bdd9 100644 --- a/src/misc_utils.c +++ b/src/misc_utils.c @@ -1,8 +1,11 @@ // SPDX-License-Identifier: BSD-3-Clause /* * Copyright(c) 2018-2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> */ +#include <stdio.h> #include <rimage/misc_utils.h> void bytes_swap(uint8_t *ptr, uint32_t size) @@ -16,3 +19,33 @@ void bytes_swap(uint8_t *ptr, uint32_t size) ptr[size - 1 - index] = tmp; } } + +void print_enum(unsigned long value, const struct name_val *values) +{ + while (values->name) { + if (values->value == value) { + fprintf(stdout, "%s\n", values->name); + return; + } + + values++; + } + + printf("Unknown: 0x%lx\n", value); +} + +void print_flags(unsigned long value, const struct name_val *flags) +{ + while (flags->name) { + if (value & flags->value) { + fprintf(stdout, "%s ", flags->name); + value &= ~flags->value; + } + + flags++; + } + + if (value) + fprintf(stdout, "+ 0x%lx", value); + printf("\n"); +} From b9ecb0072d5dc39e6e7fcf3c5b3a92c00da2a84b Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 16:19:14 +0200 Subject: [PATCH 305/639] rimage: adsp_config: Create new memory_config structure. Moved mem_zone field from adsp structure to the new memory_config structure Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 14 +++++++------- src/elf.c | 8 ++++---- src/file_simple.c | 13 ++++++------- src/include/rimage/rimage.h | 8 ++++++-- src/manifest.c | 2 +- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index fdeadb7b9a52..7835883a1452 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -67,11 +67,11 @@ static void dump_adsp(const struct adsp *adsp) DUMP_KEY("name", "'%s'", adsp->name); DUMP_KEY("image_size", "0x%x", adsp->image_size); DUMP_KEY("exec_boot_ldr", "%d", adsp->exec_boot_ldr); - for (i = 0; i < ARRAY_SIZE(adsp->mem_zones); ++i) { + for (i = 0; i < ARRAY_SIZE(adsp->mem.zones); ++i) { DUMP_KEY("mem_zone.idx", "%d", i); - DUMP_KEY("mem_zone.size", "0x%x", adsp->mem_zones[i].size); - DUMP_KEY("mem_zone.base", "0x%x", adsp->mem_zones[i].base); - DUMP_KEY("mem_zone.host_offset", "0x%x", adsp->mem_zones[i].host_offset); + DUMP_KEY("mem_zone.size", "0x%x", adsp->mem.zones[i].size); + DUMP_KEY("mem_zone.base", "0x%x", adsp->mem.zones[i].base); + DUMP_KEY("mem_zone.host_offset", "0x%x", adsp->mem.zones[i].host_offset); } } @@ -79,7 +79,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a bool verbose) { toml_array_t *mem_zone_array, *alias_array; - struct mem_zone *zone; + struct memory_zone *zone; struct parse_ctx ctx; toml_table_t *adsp; toml_raw_t raw; @@ -164,7 +164,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a } /* look for entry array */ - memset(out->mem_zones, 0, sizeof(out->mem_zones)); + memset(&out->mem, 0, sizeof(out->mem)); mem_zone_array = toml_array_in(adsp, "mem_zone"); if (!mem_zone_array) return err_key_not_found("mem_zone"); @@ -196,7 +196,7 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (zone_idx < 0) return err_key_parse("mem_zone.name", "unknown zone '%s'", zone_name); - zone = &out->mem_zones[zone_idx]; + zone = &out->mem.zones[zone_idx]; zone->base = parse_uint32_hex_key(mem_zone, &ctx, "base", -1, &ret); if (ret < 0) return err_key_parse("mem_zone", NULL); diff --git a/src/elf.c b/src/elf.c index 0275a194ed79..5bad95fb26b7 100644 --- a/src/elf.c +++ b/src/elf.c @@ -28,8 +28,8 @@ static int elf_read_sections(struct image *image, struct module *module, size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - unsigned long rom_base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; - size_t rom_size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + unsigned long rom_base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; + size_t rom_size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; /* read in section header */ ret = fseek(module->fd, hdr->shoff, SEEK_SET); @@ -256,8 +256,8 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) start = section->vaddr; end = section->vaddr + section->size; - base = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].base; - size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; + size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; if (start < base || start > base + size) return 0; diff --git a/src/file_simple.c b/src/file_simple.c index a63afa8de815..b15d739ed98a 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -12,9 +12,8 @@ #include <rimage/manifest.h> #include <rimage/file_utils.h> -static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) +static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *section) { - const struct adsp *adsp = image->adsp; uint32_t start, end, base, size; int i; @@ -22,8 +21,8 @@ static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) end = section->vaddr + section->size; for (i = SOF_FW_BLK_TYPE_START; i < SOF_FW_BLK_TYPE_NUM; i++) { - base = adsp->mem_zones[i].base; - size = adsp->mem_zones[i].size; + base = memory->zones[i].base; + size = memory->zones[i].size; if (start < base) continue; @@ -55,11 +54,11 @@ static int write_block(struct image *image, struct module *module, block.size += padding; } - ret = get_mem_zone_type(image, section); + ret = get_mem_zone_type(&image->adsp->mem, section); if (ret != SOF_FW_BLK_TYPE_INVALID) { block.type = ret; - block.offset = section->vaddr - adsp->mem_zones[ret].base - + adsp->mem_zones[ret].host_offset; + block.offset = section->vaddr - adsp->mem.zones[ret].base + + adsp->mem.zones[ret].host_offset; } else { fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", section->vaddr, section->size); diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index ec2449dfcaac..fc88981c2401 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -110,12 +110,16 @@ struct image { uint32_t imr_type; }; -struct mem_zone { +struct memory_zone { uint32_t base; uint32_t size; uint32_t host_offset; }; +struct memory_config { + struct memory_zone zones[SOF_FW_BLK_TYPE_NUM]; +}; + struct fw_image_ext_mod_config { struct fw_ext_mod_config_header header; struct mod_scheduling_caps sched_caps; @@ -143,7 +147,7 @@ struct fw_image_manifest_module { */ struct adsp { const char *name; - struct mem_zone mem_zones[SOF_FW_BLK_TYPE_NUM]; + struct memory_config mem; uint32_t image_size; diff --git a/src/manifest.c b/src/manifest.c index f2a7c3e7a35b..f212b9d4ed33 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -36,7 +36,7 @@ static int man_open_rom_file(struct image *image) if (ret) return ret; - size = image->adsp->mem_zones[SOF_FW_BLK_TYPE_ROM].size; + size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; /* allocate ROM image */ image->rom_image = calloc(size, 1); From 9ecae53e2828e77976bc4d5f840579f256a08014 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 16:24:08 +0200 Subject: [PATCH 306/639] rimage: Moved memory alias configuration to a new struct A new memory_alias structure containing memory address alias configurations has been created. It was placed in the memory_config structure. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/adsp_config.c | 13 +++++++------ src/elf.c | 2 +- src/include/rimage/rimage.h | 11 +++++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/adsp_config.c b/src/adsp_config.c index 7835883a1452..ac196075a2b0 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -118,7 +118,8 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a if (ret < 0) return ret; - out->alias_mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", -ENODATA, &ret); + memset(&out->mem, 0, sizeof(out->mem)); + out->mem.alias.mask = parse_uint32_hex_key(adsp, &ctx, "alias_mask", -ENODATA, &ret); alias_found = !ret; /* check everything parsed, 1 or 2 tables should be present */ @@ -153,18 +154,18 @@ static int parse_adsp(const toml_table_t *toml, struct parse_ctx *pctx, struct a base = parse_uint32_hex_key(alias, &ctx, "base", -1, &ret); if (!strncmp("cached", alias_name, sizeof("cached"))) - out->alias_cached = base & out->alias_mask; + out->mem.alias.cached = base & out->mem.alias.mask; else if (!strncmp("uncached", alias_name, sizeof("uncached"))) - out->alias_uncached = base & out->alias_mask; + out->mem.alias.uncached = base & out->mem.alias.mask; } } else { /* Make uncache_to_cache() an identity transform */ - out->alias_cached = 0; - out->alias_mask = 0; + out->mem.alias.uncached = 0; + out->mem.alias.cached = 0; + out->mem.alias.mask = 0; } /* look for entry array */ - memset(&out->mem, 0, sizeof(out->mem)); mem_zone_array = toml_array_in(adsp, "mem_zone"); if (!mem_zone_array) return err_key_not_found("mem_zone"); diff --git a/src/elf.c b/src/elf.c index 5bad95fb26b7..a8a98c9618f1 100644 --- a/src/elf.c +++ b/src/elf.c @@ -17,7 +17,7 @@ static unsigned long uncache_to_cache(const struct image *image, unsigned long address) { - return (address & ~image->adsp->alias_mask) | image->adsp->alias_cached; + return (address & ~image->adsp->mem.alias.mask) | image->adsp->mem.alias.cached; } static int elf_read_sections(struct image *image, struct module *module, diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index fc88981c2401..e682dc01ce66 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -116,8 +116,15 @@ struct memory_zone { uint32_t host_offset; }; +struct memory_alias { + uint32_t mask; + uint32_t cached; + uint32_t uncached; +}; + struct memory_config { struct memory_zone zones[SOF_FW_BLK_TYPE_NUM]; + struct memory_alias alias; }; struct fw_image_ext_mod_config { @@ -151,10 +158,6 @@ struct adsp { uint32_t image_size; - uint32_t alias_cached; - uint32_t alias_uncached; - uint32_t alias_mask; - int (*write_firmware_ext_man)(struct image *image); int (*write_firmware)(struct image *image); int (*write_firmware_meu)(struct image *image); From 99195d2ee6a7eeb926b6dd75be9a7ac23d6859fa Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 17:00:36 +0200 Subject: [PATCH 307/639] rimage: manifest: Rename struct module to manifest_module Changing the name of the structure type is a prelude to separating information about the elf file from the information used during creation of a manifest. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 26 ++++++++-------- src/ext_manifest.c | 8 ++--- src/file_simple.c | 10 +++---- src/include/rimage/manifest.h | 51 +++++++++++++++++++++++++++++++ src/include/rimage/rimage.h | 56 ++++------------------------------- src/manifest.c | 14 ++++----- 6 files changed, 85 insertions(+), 80 deletions(-) diff --git a/src/elf.c b/src/elf.c index a8a98c9618f1..e152b7588a00 100644 --- a/src/elf.c +++ b/src/elf.c @@ -20,7 +20,7 @@ static unsigned long uncache_to_cache(const struct image *image, unsigned long a return (address & ~image->adsp->mem.alias.mask) | image->adsp->mem.alias.cached; } -static int elf_read_sections(struct image *image, struct module *module, +static int elf_read_sections(struct image *image, struct manifest_module *module, int module_index) { Elf32_Ehdr *hdr = &module->hdr; @@ -151,7 +151,7 @@ static int elf_read_sections(struct image *image, struct module *module, return 0; } -static int elf_read_programs(struct image *image, struct module *module) +static int elf_read_programs(struct image *image, struct manifest_module *module) { Elf32_Ehdr *hdr = &module->hdr; Elf32_Phdr *prg = module->prg; @@ -207,7 +207,7 @@ static int elf_read_programs(struct image *image, struct module *module) return 0; } -static int elf_read_hdr(struct image *image, struct module *module) +static int elf_read_hdr(struct image *image, struct manifest_module *module) { Elf32_Ehdr *hdr = &module->hdr; size_t count; @@ -266,7 +266,7 @@ int elf_is_rom(struct image *image, Elf32_Shdr *section) return 1; } -static void elf_module_size(struct image *image, struct module *module, +static void elf_module_size(struct image *image, struct manifest_module *module, Elf32_Shdr *section, uint32_t lma, int index) { switch (section->type) { @@ -310,7 +310,7 @@ static void elf_module_size(struct image *image, struct module *module, } } -static void elf_module_size_reloc(struct image *image, struct module *module, +static void elf_module_size_reloc(struct image *image, struct manifest_module *module, Elf32_Shdr *section, int index) { switch (section->type) { @@ -346,7 +346,7 @@ static void elf_module_size_reloc(struct image *image, struct module *module, } } -static void elf_module_limits(struct image *image, struct module *module) +static void elf_module_limits(struct image *image, struct manifest_module *module) { Elf32_Shdr *section; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -408,10 +408,10 @@ static void elf_module_limits(struct image *image, struct module *module) } /* make sure no section overlap from any modules */ -int elf_validate_section(struct image *image, struct module *module, +int elf_validate_section(struct image *image, struct manifest_module *module, Elf32_Shdr *section, int index) { - struct module *m; + struct manifest_module *m; Elf32_Shdr *s; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i, j; @@ -464,7 +464,7 @@ int elf_validate_section(struct image *image, struct module *module, /* make sure no section overlaps from any modules */ int elf_validate_modules(struct image *image) { - struct module *module; + struct manifest_module *module; Elf32_Shdr *section; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); int i, j, ret; @@ -498,7 +498,7 @@ int elf_validate_modules(struct image *image) return 0; } -int elf_find_section(const struct module *module, const char *name) +int elf_find_section(const struct manifest_module *module, const char *name) { const Elf32_Ehdr *hdr = &module->hdr; const Elf32_Shdr *section, *s; @@ -546,7 +546,7 @@ int elf_find_section(const struct module *module, const char *name) return ret; } -int elf_read_section(const struct module *module, const char *section_name, +int elf_read_section(const struct manifest_module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { const Elf32_Shdr *section; @@ -585,7 +585,7 @@ int elf_read_section(const struct module *module, const char *section_name, int elf_parse_module(struct image *image, int module_index, const char *name) { - struct module *module; + struct manifest_module *module; uint32_t rem; int ret = 0; @@ -676,7 +676,7 @@ int elf_parse_module(struct image *image, int module_index, const char *name) void elf_free_module(struct image *image, int module_index) { - struct module *module = &image->module[module_index]; + struct manifest_module *module = &image->module[module_index]; free(module->prg); free(module->section); diff --git a/src/ext_manifest.c b/src/ext_manifest.c index e670b47825e5..92360d6bbf98 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -41,9 +41,9 @@ static int ext_man_open_file(struct image *image) return 0; } -static const struct module *ext_man_find_module(const struct image *image) +static const struct manifest_module *ext_man_find_module(const struct image *image) { - const struct module *module; + const struct manifest_module *module; int i; /* when there is more than one module, then first one is bootloader */ @@ -86,7 +86,7 @@ static int ext_man_validate(uint32_t section_size, const void *section_data) } } -static int ext_man_build(const struct module *module, +static int ext_man_build(const struct manifest_module *module, struct ext_man_header **dst_buff) { struct ext_man_header ext_man; @@ -135,7 +135,7 @@ static int ext_man_build(const struct module *module, int ext_man_write(struct image *image) { - const struct module *module; + const struct manifest_module *module; struct ext_man_header *ext_man = NULL; int count; int ret; diff --git a/src/file_simple.c b/src/file_simple.c index b15d739ed98a..931bee3c3d5b 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -37,7 +37,7 @@ static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *sec static int block_idx; -static int write_block(struct image *image, struct module *module, +static int write_block(struct image *image, struct manifest_module *module, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -109,7 +109,7 @@ static int write_block(struct image *image, struct module *module, return ret; } -static int simple_write_module(struct image *image, struct module *module) +static int simple_write_module(struct image *image, struct manifest_module *module) { struct snd_sof_mod_hdr hdr; Elf32_Shdr *section; @@ -191,7 +191,7 @@ static int simple_write_module(struct image *image, struct module *module) return padding; } -static int write_block_reloc(struct image *image, struct module *module) +static int write_block_reloc(struct image *image, struct manifest_module *module) { struct snd_sof_blk_hdr block; size_t count; @@ -240,7 +240,7 @@ static int write_block_reloc(struct image *image, struct module *module) return ret; } -static int simple_write_module_reloc(struct image *image, struct module *module) +static int simple_write_module_reloc(struct image *image, struct manifest_module *module) { struct snd_sof_mod_hdr hdr; size_t count; @@ -282,7 +282,7 @@ static int simple_write_module_reloc(struct image *image, struct module *module) int simple_write_firmware(struct image *image) { struct snd_sof_fw_header hdr; - struct module *module; + struct manifest_module *module; size_t count; int i, ret; diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index a1c9e39ec174..2f345779a6b8 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -7,10 +7,61 @@ #define __MANIFEST_H__ #include <stdint.h> +#include <stdio.h> #include <rimage/sof/user/manifest.h> #include <rimage/css.h> #include <rimage/cse.h> #include <rimage/plat_auth.h> +#include <rimage/elf.h> + +/* + * Manifest module data + */ +struct manifest_module { + /* This fields will be moved to module structure */ + const char *elf_file; + FILE *fd; + + Elf32_Ehdr hdr; + Elf32_Shdr *section; + Elf32_Phdr *prg; + char *strings; + + uint32_t text_start; + uint32_t text_end; + uint32_t data_start; + uint32_t data_end; + uint32_t bss_start; + uint32_t bss_end; + + int num_sections; + int num_bss; + int bss_index; + + /* sizes do not include any gaps */ + int bss_size; + int text_size; + int data_size; + + /* sizes do include gaps to nearest page */ + int bss_file_size; + int text_file_size; + int data_file_size; + + /* total file size */ + size_t file_size; + + /* Following fields are used in manifest creation process */ + int fw_size; + + /* executable header module */ + int exec_header; + + /* module offset in image file */ + size_t foffset; + + size_t text_fixup_size; +}; #define MAN_PAGE_SIZE 4096 #define MAN_MAX_SIZE_V1_8 (38 * 1024) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index e682dc01ce66..ac0595bd893d 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -6,11 +6,10 @@ #ifndef __RIMAGE_H__ #define __RIMAGE_H__ -#include "elf.h" - #include <stdint.h> #include <stdio.h> +#include <rimage/manifest.h> #include <rimage/cavs/cavs_ext_manifest.h> #include <rimage/sof/kernel/fw.h> @@ -18,51 +17,6 @@ #define MAX_MODULES 32 struct adsp; -struct manifest; -struct man_module; - -/* - * ELF module data - */ -struct module { - const char *elf_file; - FILE *fd; - - Elf32_Ehdr hdr; - Elf32_Shdr *section; - Elf32_Phdr *prg; - char *strings; - - uint32_t text_start; - uint32_t text_end; - uint32_t data_start; - uint32_t data_end; - uint32_t bss_start; - uint32_t bss_end; - uint32_t foffset; - - int num_sections; - int num_bss; - int fw_size; - int bss_index; - - /* sizes do not include any gaps */ - int bss_size; - int text_size; - int data_size; - - /* sizes do include gaps to nearest page */ - int bss_file_size; - int text_file_size; - int text_fixup_size; - int data_file_size; - - /* total file size */ - size_t file_size; - - /* executable header module */ - int exec_header; -}; /* * Firmware image context. @@ -79,7 +33,7 @@ struct image { int verbose; int reloc; /* ELF data is relocatable */ int num_modules; - struct module module[MAX_MODULES]; + struct manifest_module module[MAX_MODULES]; uint32_t image_end;/* module end, equal to output image size */ int meu_offset; const char *verify_file; @@ -219,10 +173,10 @@ int elf_parse_module(struct image *image, int module_index, const char *name); void elf_free_module(struct image *image, int module_index); int elf_is_rom(struct image *image, Elf32_Shdr *section); int elf_validate_modules(struct image *image); -int elf_find_section(const struct module *module, const char *name); -int elf_read_section(const struct module *module, const char *name, +int elf_find_section(const struct manifest_module *module, const char *name); +int elf_read_section(const struct manifest_module *module, const char *name, const Elf32_Shdr **dst_section, void **dst_buff); -int elf_validate_section(struct image *image, struct module *module, +int elf_validate_section(struct image *image, struct manifest_module *manifest_module, Elf32_Shdr *section, int index); #endif diff --git a/src/manifest.c b/src/manifest.c index f212b9d4ed33..76754a542650 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -141,7 +141,7 @@ static int man_init_image_v2_5(struct image *image) /* we should call this after all segments size set up via iterate */ static uint32_t elf_to_file_offset(struct image *image, - struct module *module, + struct manifest_module *module, struct sof_man_module *man_module, Elf32_Shdr *section) { @@ -174,7 +174,7 @@ static uint32_t elf_to_file_offset(struct image *image, /* write SRAM sections */ static int man_copy_sram(struct image *image, Elf32_Shdr *section, - struct module *module, + struct manifest_module *module, struct sof_man_module *man_module, int section_idx) { @@ -227,7 +227,7 @@ static int man_copy_sram(struct image *image, Elf32_Shdr *section, } static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, - struct module *module, + struct manifest_module *module, struct sof_man_module *man_module, int idx) { int ret; @@ -244,7 +244,7 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, return 0; } -static int man_get_module_manifest(struct image *image, struct module *module, +static int man_get_module_manifest(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { Elf32_Shdr *section; @@ -371,7 +371,7 @@ static int man_module_validate(struct sof_man_module *man_module) return -EINVAL; } -static int man_module_create(struct image *image, struct module *module, +static int man_module_create(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { /* create module and segments */ @@ -502,7 +502,7 @@ static int man_module_create(struct image *image, struct module *module, return 0; } -static int man_module_create_reloc(struct image *image, struct module *module, +static int man_module_create_reloc(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { /* create module and segments */ @@ -634,7 +634,7 @@ static int man_write_fw_mod(struct image *image) static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, int file_text_offset) { - struct module *module; + struct manifest_module *module; struct sof_man_module *man_module; int err; int i = 0, offset = 0; From 7367fdf1e6133ca36a38eb7ddbf7d2a85565e358 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 18:21:23 +0200 Subject: [PATCH 308/639] manifest_module: rename fw_size to output_size Changed the name of the fw_size variable to a more clear one and added a description. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 6 +++--- src/file_simple.c | 6 +++--- src/include/rimage/manifest.h | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/elf.c b/src/elf.c index e152b7588a00..6ea44cffe274 100644 --- a/src/elf.c +++ b/src/elf.c @@ -109,7 +109,7 @@ static int elf_read_sections(struct image *image, struct manifest_module *module /* fall through */ case SHT_PROGBITS: /* text or data */ - module->fw_size += section[i].size; + module->output_size += section[i].size; if (section[i].flags & SHF_EXECINSTR) module->text_size += section[i].size; @@ -637,8 +637,8 @@ int elf_parse_module(struct image *image, int module_index, const char *name) elf_find_section(module, ""); - fprintf(stdout, " module: input size %d (0x%x) bytes %d sections\n", - module->fw_size, module->fw_size, module->num_sections); + fprintf(stdout, " module: input size %zu (0x%zx) bytes %d sections\n", + module->output_size, module->output_size, module->num_sections); fprintf(stdout, " module: text %d (0x%x) bytes\n" " data %d (0x%x) bytes\n" " bss %d (0x%x) bytes\n\n", diff --git a/src/file_simple.c b/src/file_simple.c index 931bee3c3d5b..872473525703 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -294,11 +294,11 @@ int simple_write_firmware(struct image *image) for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; - module->fw_size += sizeof(struct snd_sof_blk_hdr) * + module->output_size += sizeof(struct snd_sof_blk_hdr) * (module->num_sections - module->num_bss); - module->fw_size += sizeof(struct snd_sof_mod_hdr) * + module->output_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; - hdr.file_size += module->fw_size; + hdr.file_size += module->output_size; } count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 2f345779a6b8..e97982a2bdae 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -54,6 +54,10 @@ struct manifest_module { /* Following fields are used in manifest creation process */ int fw_size; + /* Size of the module in the output image. + * Includes text and data sections size + image headers*/ + size_t output_size; + /* executable header module */ int exec_header; From 1bda0c52541ee64132ff005ac5ed333fe7126080 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Wed, 29 Mar 2023 18:30:05 +0200 Subject: [PATCH 309/639] manifest_module: Add is_bootloader field A is_bootloader field has been added to determine whether a module is a bootloader. This is clearer than checking the module index and the number of modules in different places in the program. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 2 +- src/ext_manifest.c | 7 +++++-- src/include/rimage/manifest.h | 3 +++ src/rimage.c | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/elf.c b/src/elf.c index 6ea44cffe274..3843635d469f 100644 --- a/src/elf.c +++ b/src/elf.c @@ -77,7 +77,7 @@ static int elf_read_sections(struct image *image, struct manifest_module *module return -errno; } - if (image->num_modules > 1 && module_index == 0) { + if (module->is_bootloader) { /* In case of multiple modules first one should be bootloader, * that should not have these sections. */ diff --git a/src/ext_manifest.c b/src/ext_manifest.c index 92360d6bbf98..fb021e3dc270 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -46,9 +46,12 @@ static const struct manifest_module *ext_man_find_module(const struct image *ima const struct manifest_module *module; int i; - /* when there is more than one module, then first one is bootloader */ - for (i = image->num_modules == 1 ? 0 : 1; i < image->num_modules; i++) { + for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; + + if (module->is_bootloader) + continue; + if (elf_find_section(module, EXT_MAN_DATA_SECTION) >= 0) return module; } diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index e97982a2bdae..15c79b732661 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -8,6 +8,7 @@ #include <stdint.h> #include <stdio.h> +#include <stdbool.h> #include <rimage/sof/user/manifest.h> #include <rimage/css.h> #include <rimage/cse.h> @@ -54,6 +55,8 @@ struct manifest_module { /* Following fields are used in manifest creation process */ int fw_size; + bool is_bootloader; + /* Size of the module in the output image. * Includes text and data sections size + image headers*/ size_t output_size; diff --git a/src/rimage.c b/src/rimage.c index a6e23470d698..75c4a8bff56d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -204,6 +204,10 @@ int main(int argc, char *argv[]) /* getopt reorders argv[] */ for (i = first_non_opt; i < argc; i++) { + /* When there is more than one module, then first one is bootloader. */ + image.module[i - first_non_opt].is_bootloader = image.num_modules > 1 && + i == first_non_opt; + fprintf(stdout, "\nModule Reading %s\n", argv[i]); ret = elf_parse_module(&image, i - first_non_opt, argv[i]); if (ret < 0) From 6e3abe6afed380e7e9a6f430552f3ce54915eb40 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 10 Mar 2023 16:44:20 +0100 Subject: [PATCH 310/639] rimage: Add suport for loadable modules A new -l parameter has been added to the program's command line. It instructs the program to not treat the first module as a bootloader and not to skip the bss section for it. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/rimage.h | 3 +++ src/rimage.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index ac0595bd893d..2b9a26ef5b41 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -62,6 +62,9 @@ struct image { uint16_t fw_ver_build; uint32_t imr_type; + + /* Output image is a loadable module */ + bool loadable_module; }; struct memory_zone { diff --git a/src/rimage.c b/src/rimage.c index 75c4a8bff56d..556e05890507 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -30,6 +30,7 @@ static void usage(char *name) fprintf(stdout, "\t -f firmware version = major.minor.micro\n"); fprintf(stdout, "\t -b build version\n"); fprintf(stdout, "\t -e build extended manifest\n"); + fprintf(stdout, "\t -l build loadable modules image (don't treat the first module as a bootloader)\n"); fprintf(stdout, "\t -y verify signed file\n"); fprintf(stdout, "\t -q resign binary\n"); fprintf(stdout, "\t -p set PV bit\n"); @@ -49,7 +50,7 @@ int main(int argc, char *argv[]) image.imr_type = MAN_DEFAULT_IMR_TYPE; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p:l")) != -1) { switch (opt) { case 'o': image.out_file = optarg; @@ -97,6 +98,9 @@ int main(int argc, char *argv[]) case 'p': pv_bit = 1; break; + case 'l': + image.loadable_module = true; + break; default: /* getopt's default error message is good enough */ return 1; @@ -204,9 +208,10 @@ int main(int argc, char *argv[]) /* getopt reorders argv[] */ for (i = first_non_opt; i < argc; i++) { - /* When there is more than one module, then first one is bootloader. */ + /* When there is more than one module, then first one is bootloader. + * Does not apply to building a image of a loadable module. */ image.module[i - first_non_opt].is_bootloader = image.num_modules > 1 && - i == first_non_opt; + i == first_non_opt && !image.loadable_module; fprintf(stdout, "\nModule Reading %s\n", argv[i]); ret = elf_parse_module(&image, i - first_non_opt, argv[i]); From debf4cf605ef39b283abb1f9bce582afaebc96cf Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 10:13:57 +0200 Subject: [PATCH 311/639] manifest: Move MAN_MAX_SIZE_V1_8 define to the public manifest header Currently, sof incorrectly includes a private manifest.h header belonging to the manifest.c module. Moved the MAN_MAX_SIZE_V1_8 definition used by sof, to the public manifest header to allow sof to switch to using the correct file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/manifest.h | 1 - src/include/rimage/sof/user/manifest.h | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index 15c79b732661..c1f820c5a624 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -71,7 +71,6 @@ struct manifest_module { }; #define MAN_PAGE_SIZE 4096 -#define MAN_MAX_SIZE_V1_8 (38 * 1024) /* start offset for modules built using xcc */ #define DEFAULT_XCC_MOD_OFFSET 0x8 diff --git a/src/include/rimage/sof/user/manifest.h b/src/include/rimage/sof/user/manifest.h index e49a76f76fcb..d270ce98b309 100644 --- a/src/include/rimage/sof/user/manifest.h +++ b/src/include/rimage/sof/user/manifest.h @@ -30,6 +30,9 @@ #define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG 0 /* Base config only */ #define SOF_MAN_MOD_INIT_CONFIG_BASE_CFG_WITH_EXT 1 /* Base config with extension */ +#define MAN_MAX_SIZE_V1_8 (38 * 1024) + + struct sof_man_module_type { uint32_t load_type:4; /* SOF_MAN_MOD_TYPE_ */ uint32_t auto_start:1; From 25804e7dc8ee37f3cb87b0a96b58300478cd3cff Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 12:50:25 +0200 Subject: [PATCH 312/639] manifest: Use module manifest from toml as a template for elf modules The manifest for elf modules is read from their .module section. The modules configuration parsed from a toml file was completely ignored. After this change, the parsed configuration is treated as a template for the module manifest. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 10 ++++++++-- src/rimage.c | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 76754a542650..3e8f2fc7e81d 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -662,6 +662,10 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, for (; i < image->num_modules; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i - offset); + /* Use manifest created using toml files as template */ + assert(i < image->adsp->modules->mod_man_count); + memcpy(man_module, &image->adsp->modules->mod_man[i], sizeof(*man_module)); + module = &image->module[i]; if (i == 0) @@ -693,12 +697,14 @@ static void man_create_modules_in_config(struct image *image, struct sof_man_fw_ if (!modules) return; - /*skip bringup and base module */ - for (i = 2; i < modules->mod_man_count; i++) { + /* skip modules passed as parameters. Their manifests have already been copied by the + * man_create_modules function. */ + for (i = image->num_modules; i < modules->mod_man_count; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i); memcpy(man_module, &modules->mod_man[i], sizeof(*man_module)); } + /* We need to copy the configurations for all modules. */ cfg_start = (void *)desc + SOF_MAN_MODULE_OFFSET(i); memcpy(cfg_start, modules->mod_cfg, modules->mod_cfg_count * sizeof(struct sof_man_mod_config)); diff --git a/src/rimage.c b/src/rimage.c index 556e05890507..d181a3da5096 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -206,6 +206,12 @@ int main(int argc, char *argv[]) goto out; } + if (image.num_modules > image.adsp->modules->mod_man_count) { + fprintf(stderr, "error: Each ELF input module requires entry in toml file.\n"); + ret = -EINVAL; + goto out; + } + /* getopt reorders argv[] */ for (i = first_non_opt; i < argc; i++) { /* When there is more than one module, then first one is bootloader. From ab0429fdbe563ef6abe499c69b2483e96c4762d0 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 6 Apr 2023 15:42:23 +0200 Subject: [PATCH 313/639] Fix: Use module manifest from toml as a template for elf modules Some platforms (eg. tgl) dont have modules configuration in a toml files. An attempt to use the configuration template ended with a reference to a null pointer. This commit fixes this issue. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/manifest.c | 10 +++++++--- src/rimage.c | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/manifest.c b/src/manifest.c index 3e8f2fc7e81d..673740ecaa87 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -662,9 +662,13 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, for (; i < image->num_modules; i++) { man_module = (void *)desc + SOF_MAN_MODULE_OFFSET(i - offset); - /* Use manifest created using toml files as template */ - assert(i < image->adsp->modules->mod_man_count); - memcpy(man_module, &image->adsp->modules->mod_man[i], sizeof(*man_module)); + + /* Some platforms dont have modules configuration in toml file */ + if (image->adsp->modules) { + /* Use manifest created using toml files as template */ + assert(i < image->adsp->modules->mod_man_count); + memcpy(man_module, &image->adsp->modules->mod_man[i], sizeof(*man_module)); + } module = &image->module[i]; diff --git a/src/rimage.c b/src/rimage.c index d181a3da5096..2be83efe104d 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -206,7 +206,8 @@ int main(int argc, char *argv[]) goto out; } - if (image.num_modules > image.adsp->modules->mod_man_count) { + /* Some platforms dont have modules configuration in toml file */ + if (image.adsp->modules && image.num_modules > image.adsp->modules->mod_man_count) { fprintf(stderr, "error: Each ELF input module requires entry in toml file.\n"); ret = -EINVAL; goto out; From 77d4a2acd7512ca2fe2d6147ea30ce34a2ca505e Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 18 Apr 2023 17:57:07 +0000 Subject: [PATCH 314/639] cmake: remove "install" target The deleted "install" target copied only the rimage executable and left the config files behind. This gave the wrong impression that the executable is useful without config files. "Installing" also gave the wrong impression that rimage versions are somewhat stable and relatively independent of SOF versions: they're not. In fact there is no such thing as an rimage "version": everyone should always use the exact rimage _git commit_ from the west manifest or git submodule. There are no rimage "releases" and no semantic versioning or anything like it, rimage is effectively part of the SOF source and build and run directly from its build directory by practically every SOF developer and SOF CI thanks to sof/src/arch/xtensa/CMakeLists.txt#ExternalProject_Add(rimage_ep ... sof/scripts/xtensa-build-zephyr.py#def build_rimage() sof/zephyr/CMakeLists.txt#set(RIMAGE_CONFIG_PATH ... etc. Providing an "install" target greatly increases the chances of different people and CIs using different rimage versions which is the last thing we want considering the many significant rimage changes happening right now, examples: - https://github.com/zephyrproject-rtos/zephyr/pull/56099 - https://github.com/zephyrproject-rtos/zephyr/pull/54700 - https://github.com/thesofproject/sof/issues/7270 - https://github.com/thesofproject/sof/issues/7304 - https://github.com/thesofproject/sof/pull/7320 - https://github.com/thesofproject/rimage/pull/155 While it's useful for multiple files (e.g.: config files), a CMake target was always overkill to copy a single file. Someone or some script who really wants to copy the rimage binary to some other place that the build directory for some (discouraged) reason _can still do so_ with a much more basic, simpler and more transparent file copy command. Finally, the default "bin" DESTINATION required root access which is otherwise totally unncessary to build SOF. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76ed18a3392a..2f8b0c56a6f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,5 +64,3 @@ target_include_directories(rimage PRIVATE src/include/ tomlc99/ ) - -install(TARGETS rimage DESTINATION bin) From acd8a2bc1bc05f0c38e0bd1b1e7142f09d0b7d04 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 18 Apr 2023 14:15:06 +0300 Subject: [PATCH 315/639] Config: Change SRCINTC for tgl-cavs.toml and tgl-h-cavs.toml to LL The SRC should be a normal LL component, it can process 1 ms blocks of audio in real-time. The domain_types = "1" is for DP scheduling that is not enabled currently in Zephyr configuration. It causes a pipeline prepare fail when a topology contains SRC. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 2 +- config/tgl-h-cavs.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 2125cda5ed4f..851481ba2b35 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -240,7 +240,7 @@ count = 15 uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" affinity_mask = "0xF" instance_count = "10" - domain_types = "1" + domain_types = "0" load_type = "0" module_type = "0x7" auto_start = "0" diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 69f8de7ab581..a499e985625a 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -240,7 +240,7 @@ count = 15 uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" affinity_mask = "0xF" instance_count = "10" - domain_types = "1" + domain_types = "0" load_type = "0" module_type = "0x7" auto_start = "0" From 8f250a99eb27e43c2bbc27c428b3f52606b42ad7 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 18 Apr 2023 14:17:13 +0300 Subject: [PATCH 316/639] Config: Change indent for SRCINTC This patch removes one unnecessary tab from section for SRCINTC. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 851481ba2b35..1f9de2936cbc 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -236,15 +236,15 @@ count = 15 mod_cfg = [0, 0, 0, 0, 4096, 100000, 48, 48, 0, 1000, 0] [[module.entry]] - name = "SRCINTC" - uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" - affinity_mask = "0xF" - instance_count = "10" - domain_types = "0" - load_type = "0" - module_type = "0x7" - auto_start = "0" - sched_caps = [1, 0x00008000] + name = "SRCINTC" + uuid = "e61bb28d-149a-4c1f-b709-46823ef5f5ae" + affinity_mask = "0xF" + instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "0x7" + auto_start = "0" + sched_caps = [1, 0x00008000] # pin = [dir, type, sample rate, size, container, channel-cfg] pin = [0, 0, 0xffff, 0xc, 0x8, 0x45ff, From 1ea1327b9cf169c847734c7dca716869534e2c51 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 24 May 2023 01:17:37 +0000 Subject: [PATCH 317/639] README.md: remove "install" target Fixes commit 77d4a2acd751 ("cmake: remove "install" target") Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index de6556334468..64fe71e11ce5 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,23 @@ to generate binary image files. ## Building -Most users don't build `rimage` directly but as an ExternalProject -defined by CMake in SOF. This being said, `rimage` can be built with the -usual CMake commands: +Most SOF users never build `rimage` directly but as an ExternalProject +defined by CMake in SOF. This makes sure they always use an up-to-date +version of rimage and configuration files that have been fully tested. + +If needed, `rimage` can be built manually with the usual CMake commands: ```shell $ cmake -B build/ $ make -C build/ help # lists all targets $ make -C build/ -$ sudo make -C build/ install # optional ``` +The `build/rimage` executable can then be copied to a directory in the +PATH. Zephyr users can run `west config rimage.path +/path/to/rimage/build/rimage`; Zephyr documentation and `west sign -h` +have more details. + ## Testing rimage changes with SOF Continuous Integration This section is about leveraging SOF validation to test rimage changes From 649b0a6790a9f2c878fc6cce8a42e0f76a36a418 Mon Sep 17 00:00:00 2001 From: Paul Olaru <paul.olaru@nxp.com> Date: Tue, 30 May 2023 12:29:52 +0300 Subject: [PATCH 318/639] file_simple: Allocate correct buffer size for writing sections out The original size given to the "calloc" call did not account for the necessity to pad section sizes to a multiple of 4 bytes. As such, every time we wrote a section that did not have a size multiple of 4 we would overflow the allocated buffer. Fix the calloc call to account for that padding requirement. Signed-off-by: Paul Olaru <paul.olaru@nxp.com> --- src/file_simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/file_simple.c b/src/file_simple.c index 872473525703..251053498f1b 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -71,7 +71,7 @@ static int write_block(struct image *image, struct manifest_module *module, return file_error("Write header failed", image->out_file); /* alloc data data */ - buffer = calloc(1, section->size); + buffer = calloc(1, block.size); if (!buffer) return -ENOMEM; From 4ce79b152e23c7b3937a09ef57cdd69d125a9214 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Fri, 19 May 2023 15:25:37 +0200 Subject: [PATCH 319/639] kpb: update kpb uuid for lnl Change of uuid regarding Windows compatibility Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- config/lnl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/lnl.toml b/config/lnl.toml index 0093e40a3eee..d4d7f6404055 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -387,7 +387,7 @@ count = 19 [[module.entry]] name = "KPB" - uuid = "D8218443-5FF3-4A4C-B388-6CFE07B9562E" + uuid = "A8A0CB32-4A77-4DB1-85C7-53D7EE07BCE6" affinity_mask = "0x1" instance_count = "1" domain_types = "0" From 089157d4617fd0b6a2d9b18578ebba1fcd28621d Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 15 Jun 2023 15:27:36 +0300 Subject: [PATCH 320/639] Config: Add Aria module to tgl-cavs.toml and tgl-h-cavs.toml This patch adds Aria module for TGL and TGL-H platforms. The used configuration data is copy from mtl.toml. This change allows to use Aria component in topologies. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 27 ++++++++++++++++++++++++++- config/tgl-h-cavs.toml | 27 ++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 1f9de2936cbc..8e859ee0921a 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 15 +count = 16 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -388,3 +388,28 @@ count = 15 mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index a499e985625a..c277c6235fd9 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 15 +count = 16 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -388,3 +388,28 @@ count = 15 mod_cfg = [0, 0, 0, 0, 960, 488500, 16, 16, 0, 0, 0, 1, 0, 0, 0, 960, 964500, 16, 16, 0, 0, 0, 2, 0, 0, 0, 960, 2003000, 16, 16, 0, 0, 0] + + # Aria module config + [[module.entry]] + name = "ARIA" + uuid = "99F7166D-372C-43EF-81F6-22007AA15F03" + affinity_mask = "0x1" + instance_count = "8" + domain_types = "0" + load_type = "0" + init_config = "1" + module_type = "30" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 260, 1063000, 16, 21, 0, 0, 0, + 1, 0, 0, 0, 260, 1873500, 192, 256, 0, 0, 0, + 2, 0, 0, 0, 260, 2680000, 32, 42, 0, 0, 0, + 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, + 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, + 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] From 48777207f5fdc49314dd4709d660e891c48d5ba9 Mon Sep 17 00:00:00 2001 From: "SaiSurya, Ch" <saisurya.chakkaveeravenkatanaga@amd.com> Date: Tue, 6 Jun 2023 11:59:23 +0530 Subject: [PATCH 321/639] config: add vangogh toml file to support vangogh build Add vangogh toml file to support sof-vangogh.ri binary build Signed-off-by: SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- config/vangogh.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 config/vangogh.toml diff --git a/config/vangogh.toml b/config/vangogh.toml new file mode 100644 index 000000000000..c5acdb9c9ba3 --- /dev/null +++ b/config/vangogh.toml @@ -0,0 +1,15 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "vangogh" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x20000000" +size = "0x40000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xE0000000" +size = "0x100000" +host_offset = "0x0" From aa0ac9eae67506b86e30d66ec75b6f514d729150 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 11 Jul 2023 17:27:03 +0000 Subject: [PATCH 322/639] rimage.c: fix bug where -p requires a new and ignored parameter Fixes commit 6e3abe6afed3 ("rimage: Add suport for loadable modules") It looks like that commit mistook the `:` sign as a separator. This accidentally added the requirement to give `-p` a parameter which is then ignored. Remove the spurious `:`. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- src/rimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rimage.c b/src/rimage.c index 2be83efe104d..7c89e0921d18 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) image.imr_type = MAN_DEFAULT_IMR_TYPE; - while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p:l")) != -1) { + while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:pl")) != -1) { switch (opt) { case 'o': image.out_file = optarg; From b8ee1aa8f6953c84eff384fb30dd7f5afa288108 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 16 May 2023 12:58:15 +0300 Subject: [PATCH 323/639] Config: Add DRC component to TGL, TGL-H, MTL, LNL This patch allows to load the DRC component. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index d4d7f6404055..990805e9bcfe 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -486,3 +486,19 @@ count = 19 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 38698b8e2c39..989a07e8dae1 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -486,3 +486,19 @@ count = 19 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 8e859ee0921a..6d2d77daf93b 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 16 +count = 17 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -413,3 +413,19 @@ count = 16 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index c277c6235fd9..46547ca5a3a6 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 16 +count = 17 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -413,3 +413,19 @@ count = 16 3, 0, 0, 0, 260, 3591000, 64, 85, 0, 0, 0, 4, 0, 0, 0, 260, 4477000, 96, 128, 0, 0, 0, 5, 0, 0, 0, 260, 7195000, 192, 192, 0, 0, 0] + + # DRC module config + [[module.entry]] + name = "DRC" + uuid = "B36EE4DA-006F-47F9-A06D-FECBE2D8B6CE" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From af9a2fe58f2141dc10720df8c296dd8301ec513d Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 16 May 2023 12:59:29 +0300 Subject: [PATCH 324/639] Config: Fix comment typo for EQ FIR module The comment for FIR module entry is corrected. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 2 +- config/mtl.toml | 2 +- config/tgl-cavs.toml | 2 +- config/tgl-h-cavs.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 990805e9bcfe..83b7b867731a 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -443,7 +443,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" diff --git a/config/mtl.toml b/config/mtl.toml index 989a07e8dae1..1ee803e3dcf7 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -443,7 +443,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 6d2d77daf93b..e3a70e0f030a 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -315,7 +315,7 @@ count = 17 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 46547ca5a3a6..d84388d99aec 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -315,7 +315,7 @@ count = 17 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - # eq iir module config + # eq fir module config [[module.entry]] name = "EQFIR" uuid = "43A90CE7-f3A5-41Df-AC06-BA98651AE6A3" From d20f1d8a85e7342a74e7f3865681d21b3988d3f6 Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Mon, 3 May 2021 18:42:52 -0700 Subject: [PATCH 325/639] actions: remove travis We removed them from the main repo, lets remove them here too. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- .checkpatch.conf | 6 ++++++ .github/workflows/build.yml | 25 +++++++++++++++++++++++++ .github/workflows/pull-request.yml | 23 ++++++++++++++++++++--- .travis.yml | 22 ---------------------- 4 files changed, 51 insertions(+), 25 deletions(-) create mode 100644 .checkpatch.conf create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 000000000000..98ddafcb3fb1 --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,6 @@ +--codespell +--codespellfile scripts/spelling.txt +--ignore C99_COMMENT_TOLERANCE +--no-tree +--strict +-g diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000000..2102fae4f8f0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +--- +# Basic build test + +name: build + +# yamllint disable-line rule:truthy +on: [pull_request, push, workflow_dispatch] + +env: + CMAKE_C_FLAGS: "-Werror -Wall -Wmissing-prototypes\ + -Wimplicit-fallthrough=3 -Wpointer-arith" + +jobs: + build-test: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: {fetch-depth: 50, submodules: recursive} + + - name: install tools + run: sudo apt update && sudo apt install -y ninja-build + + - name: build + run: cmake -B build/ -G Ninja + - run: cmake --build build/ diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b821ce4fb5f7..c0400490b276 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -9,17 +9,34 @@ # github.com also has a powerful web editor that can be used without # committing. -name: checkpatch +name: codestyle # yamllint disable-line rule:truthy on: [pull_request] jobs: yamllint: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - with: {fetch-depth: 50, submodules: recursive} + with: + fetch-depth: 50 + submodules: recursive - name: run yamllint run: yamllint .github/workflows/*.yml + checkpatch: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.PR_FETCH_DEPTH }} + + - name: install codespell + run: sudo apt update && sudo apt install -y codespell + + - name: checkpatch.pl PR review + uses: webispy/checkpatch-action@v9 + env: + CHECKPATCH_COMMAND: ./scripts/checkpatch.pl diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d89521056ee9..000000000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: c - -git: - depth: false - -services: - - docker - -jobs: - include: - - name: "Build Test" - before_install: docker pull thesofproject/sof && docker tag thesofproject/sof sof - script: - - echo -e '#!/bin/bash\nmkdir build && cd build && cmake .. && make -Werror -Wall -Wmissing-prototypes -Wimplicit-fallthrough=3 -Wpointer-arith' > build.sh && chmod +x build.sh - - docker run -i -t -v $(pwd):/home/sof/work/sof.git --user $(id -u) sof ./build.sh - - name: checkpatch - before_install: - - sudo apt-get -y install codespell - script: - - git --no-pager log --oneline --graph --decorate --max-count=5 - - git --no-pager log --oneline --graph --decorate --max-count=5 "${TRAVIS_BRANCH}" - - (set -x; scripts/checkpatch.pl --no-tree --strict --codespell --no-signoff -g ${TRAVIS_COMMIT_RANGE/.../..}) From 8c8440070a08fd9ff54f8dcb5e528b30bf0fc9eb Mon Sep 17 00:00:00 2001 From: Curtis Malainey <cujomalainey@chromium.org> Date: Thu, 27 Jul 2023 13:03:23 -0700 Subject: [PATCH 326/639] style: trailing whitespace is the root of all evil Signed-off-by: Curtis Malainey <cujomalainey@chromium.org> --- config/lnl.toml | 4 ++-- config/mtl.toml | 4 ++-- src/file_simple.c | 2 +- src/hash.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 83b7b867731a..dc10a4bd95bd 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -247,7 +247,7 @@ count = 20 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, - 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] [[module.entry]] name = "SRC" @@ -461,7 +461,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - + # Aria module config [[module.entry]] name = "ARIA" diff --git a/config/mtl.toml b/config/mtl.toml index 1ee803e3dcf7..6b8be7de6559 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -247,7 +247,7 @@ count = 20 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, - 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] [[module.entry]] name = "SRC" @@ -461,7 +461,7 @@ count = 20 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] - + # Aria module config [[module.entry]] name = "ARIA" diff --git a/src/file_simple.c b/src/file_simple.c index 251053498f1b..f79cc4b50365 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -179,7 +179,7 @@ static int simple_write_module(struct image *image, struct manifest_module *modu return file_error("cant seek to header", image->out_file); count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); - if (count != 1) + if (count != 1) return file_error("failed to write section header", image->out_file); err = fseek(image->out_fd, ptr_cur, SEEK_SET); diff --git a/src/hash.c b/src/hash.c index 4a47730f4c99..0604670e9c6e 100644 --- a/src/hash.c +++ b/src/hash.c @@ -100,7 +100,7 @@ int hash_update(struct hash_context *context, const void *data, size_t size) return context->error; assert(context->state == HS_UPDATE); - + if (!EVP_DigestUpdate(context->context, data, size)) return hash_error(context, EINVAL, "Unable to update hash context."); @@ -168,7 +168,7 @@ int hash_single(const void *data, size_t size, const EVP_MD *algo, void *output, assert(algo); assert(data); assert(output); - + //algo_out_size = EVP_MD_get_size(algo); algo_out_size = EVP_MD_size(algo); if (algo_out_size <= 0) From c809af816859f7213d67a90c04efff57f7b05a59 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 29 Jun 2023 20:02:34 +0300 Subject: [PATCH 327/639] Config: Add crossover component for TGL and TGL-H cAVS platforms The configuration is for now copy from IIR, name and UUID are changed. The init_config is set to 1 to let kernel know that the base_cfg_ext is passed to firmware. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/tgl-cavs.toml | 21 ++++++++++++++++++++- config/tgl-h-cavs.toml | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index e3a70e0f030a..1f439bbf4a9a 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 17 +count = 18 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -429,3 +429,22 @@ count = 17 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index d84388d99aec..2c737f94f2be 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 17 +count = 18 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -429,3 +429,22 @@ count = 17 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 4fb9fe00575bc2e9f14570803d811987fb27f010 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Thu, 24 Aug 2023 19:22:29 +0300 Subject: [PATCH 328/639] config: lnl+mtl: fix length of ADSP.man CSE manifest The ADSP.man contents is different for ACE_V1_5 layout compared to CAVS_V2_5 layout. so the ADSP.man length should be adjusted accordingly. With this fix, sof_ri_info.py can be used to analyze LNL and MTL firmware images created with rimage. Closes: https://github.com/thesofproject/sof/issues/8073 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- config/lnl.toml | 2 +- config/mtl.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index dc10a4bd95bd..7d1967bee61f 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -30,7 +30,7 @@ partition_name = "ADSP" [[cse.entry]] name = "ADSP.man" offset = "0x5c" -length = "0x464" +length = "0x4b8" [[cse.entry]] name = "ADSP.met" offset = "0x4c0" diff --git a/config/mtl.toml b/config/mtl.toml index 6b8be7de6559..065731bc8166 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -30,7 +30,7 @@ partition_name = "ADSP" [[cse.entry]] name = "ADSP.man" offset = "0x5c" -length = "0x464" +length = "0x4b8" [[cse.entry]] name = "ADSP.met" offset = "0x4c0" From 43eb2a435c2962cf500daa602866f536c8bc7cd2 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 21 Aug 2023 17:58:59 +0300 Subject: [PATCH 329/639] Config: Add crossover component for MTL and LNL platforms This PR adds the crossover component for MTL and LNL. The parameters are copied from TGL and TGL-H configuration of crossover. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 21 ++++++++++++++++++++- config/mtl.toml | 21 ++++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 7d1967bee61f..032cc3a2371a 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -502,3 +502,22 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 065731bc8166..c68b0291f741 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -502,3 +502,22 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Crossover module config + # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to + # be appended to the IPC payload. The Extension is needed to know the output pin indices. + [[module.entry]] + name = "XOVER" + uuid = "948C9AD1-806A-4131-AD6C-B2BDA9E35A9F" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From c183ce2739435a6a49bd3f64869ffd3ef78d7005 Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Fri, 24 Feb 2023 16:50:34 +0100 Subject: [PATCH 330/639] mtl: add measured cps and cpc values Add CPS and CPC consumptions for given modules Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 74 ++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index c68b0291f741..feb0450f4542 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -96,16 +96,16 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 296, 644000, 45, 60, 0, 0, 0, - 1, 0, 0, 0, 296, 669900, 48, 64, 0, 0, 0, - 2, 0, 0, 0, 296, 934000, 96, 128, 0, 0, 0, - 3, 0, 0, 0, 296, 1137000, 96, 128, 0, 0, 0, - 4, 0, 0, 0, 296, 1482000, 48, 64, 0, 0, 0, - 5, 0, 0, 0, 296, 1746000, 96, 128, 0, 0, 0, - 6, 0, 0, 0, 296, 2274000, 192, 256, 0, 0, 0, - 7, 0, 0, 0, 296, 2700000, 48, 64, 0, 0, 0, - 8, 0, 0, 0, 296, 2964000, 96, 128, 0, 0, 0, - 9, 0, 0, 0, 296, 3492000, 192, 256, 0, 0, 0] + mod_cfg = [ 0, 0, 0, 0, 296, 5048000, 45, 60, 0, 5048, 0, + 1, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, + 2, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 3, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 4, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, + 5, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 6, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0, + 7, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, + 8, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, + 9, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0] [[module.entry]] name = "MIXOUT" @@ -130,14 +130,14 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 520, 649600, 48, 64, 0, 0, 0, - 1, 0, 0, 0, 520, 966300, 96, 128, 0, 0, 0, - 2, 0, 0, 0, 520, 2101000, 48, 64, 0, 0, 0, - 3, 0, 0, 0, 520, 2500800, 192, 256, 0, 0, 0, - 4, 0, 0, 0, 520, 2616700, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 520, 2964500, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 520, 4202000, 96, 128, 0, 0, 0, - 7, 0, 0, 0, 520, 3730000, 192, 256, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, + 1, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, + 2, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, + 3, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, + 4, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, + 5, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, + 6, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, + 7, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0] [[module.entry]] name = "COPIER" @@ -158,16 +158,16 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 280, 640100, 45, 60, 0, 0, 0, - 1, 0, 0, 0, 280, 1106300, 192, 192, 0, 0, 0, - 2, 0, 0, 0, 280, 1573000, 45, 45, 0, 0, 0, - 3, 0, 0, 0, 280, 2040600, 192, 256, 0, 0, 0, - 4, 0, 0, 0, 280, 2507500, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 280, 2999000, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 280, 3501000, 45, 60, 0, 0, 0, - 7, 0, 0, 0, 280, 3927000, 192, 256, 0, 0, 0, - 8, 0, 0, 0, 280, 4424000, 192, 256, 0, 0, 0, - 9, 0, 0, 0, 280, 4941000, 192, 256, 0, 0, 0] + mod_cfg = [ 0, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, + 1, 0, 0, 0, 280, 4288000, 192, 192, 0, 4288, 0, + 2, 0, 0, 0, 280, 4288000, 45, 45, 0, 4288, 0, + 3, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 4, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 5, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 6, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, + 7, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 8, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, + 9, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0] [[module.entry]] name = "PEAKVOL" @@ -209,13 +209,13 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 416, 914000, 48, 64, 0, 0, 0, - 1, 0, 0, 0, 416, 1321600, 192, 256, 0, 0, 0, - 2, 0, 0, 0, 416, 1786000, 192, 256, 0, 0, 0, - 3, 0, 0, 0, 416, 2333000, 48, 64, 0, 0, 0, - 4, 0, 0, 0, 416, 2910000, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 416, 3441000, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 416, 4265000, 192, 256, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, + 1, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 2, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 3, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, + 4, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 5, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, + 6, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0] [[module.entry]] name = "ASRC" @@ -265,7 +265,7 @@ count = 21 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + mod_cfg = [0, 0, 0, 0, 12832, 15920000, 0, 0, 0, 15920, 0, 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, @@ -325,7 +325,7 @@ count = 21 1, 0, 0xffff, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 216, 706000, 12, 16, 0, 0, 0, + mod_cfg = [0, 0, 0, 0, 216, 2700000, 12, 16, 0, 2700, 0, 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, From 352f01fee4ba0b1282091bb41dd08c51c353d79a Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Mon, 27 Feb 2023 20:16:34 +0100 Subject: [PATCH 331/639] mtl: fill in subsequent measured cps and mcps data Fill in measured cps consumption data for: mixin, mixout, copier, peakvol, gain, src, updwnmixer for a range of supported formats. Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 188 +++++++++++++++++++++++++++++------------------- 1 file changed, 115 insertions(+), 73 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index feb0450f4542..c4566359d8a5 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -96,16 +96,11 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 296, 5048000, 45, 60, 0, 5048, 0, - 1, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, - 2, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 3, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 4, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, - 5, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 6, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0, - 7, 0, 0, 0, 296, 5048000, 48, 64, 0, 5048, 0, - 8, 0, 0, 0, 296, 5048000, 96, 128, 0, 5048, 0, - 9, 0, 0, 0, 296, 5048000, 192, 256, 0, 5048, 0] + mod_cfg = [1, 0, 0, 0, 296, 4996000, 384, 384, 0, 4996, 0, + 2, 0, 0, 0, 296, 2652000, 384, 384, 0, 2652, 0, + 3, 0, 0, 0, 296, 2928000, 512, 512, 0, 2928, 0, + 4, 0, 0, 0, 296, 2572000, 128, 128, 0, 2572, 0, + 5, 0, 0, 0, 296, 3760000, 1536, 1536, 0, 3760, 0] [[module.entry]] name = "MIXOUT" @@ -130,14 +125,11 @@ count = 21 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, - 1, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, - 2, 0, 0, 0, 520, 2163000, 48, 64, 0, 2163, 0, - 3, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, - 4, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, - 5, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0, - 6, 0, 0, 0, 520, 2163000, 96, 128, 0, 2163, 0, - 7, 0, 0, 0, 520, 2163000, 192, 256, 0, 2163, 0] + mod_cfg = [1, 0, 0, 0, 520, 2280000, 384, 384, 0, 2280, 0, + 2, 0, 0, 0, 520, 1988000, 384, 384, 0, 1988, 0, + 3, 0, 0, 0, 520, 7631000, 512, 512, 0, 7631, 0, + 4, 0, 0, 0, 520, 1953000, 128, 128, 0, 1953, 0, + 5, 0, 0, 0, 520, 2301000, 1536, 1536, 0, 2301, 0] [[module.entry]] name = "COPIER" @@ -158,16 +150,46 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [ 0, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, - 1, 0, 0, 0, 280, 4288000, 192, 192, 0, 4288, 0, - 2, 0, 0, 0, 280, 4288000, 45, 45, 0, 4288, 0, - 3, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 4, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 5, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 6, 0, 0, 0, 280, 4288000, 45, 60, 0, 4288, 0, - 7, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 8, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0, - 9, 0, 0, 0, 280, 4288000, 192, 256, 0, 4288, 0] + mod_cfg = [1, 0, 0, 0, 280, 4918000, 768, 768, 0, 4918, 0, + 2, 0, 0, 0, 280, 6526000, 768, 768, 0, 6526, 0, + 3, 0, 0, 0, 280, 6388000, 384, 384, 0, 6388, 0, + 4, 0, 0, 0, 280, 4682000, 512, 512, 0, 4682, 0, + 5, 0, 0, 0, 280, 5738000, 512, 512, 0, 5738, 0, + 6, 0, 0, 0, 280, 6250000, 256, 256, 0, 6250, 0, + 7, 0, 0, 0, 280, 6460000, 768, 768, 0, 6460, 0, + 8, 0, 0, 0, 280, 7116000, 768, 768, 0, 7116, 0, + 9, 0, 0, 0, 280, 6008000, 384, 384, 0, 6008, 0, + 10, 0, 0, 0, 280, 6258000, 512, 512, 0, 6258, 0, + 11, 0, 0, 0, 280, 7188000, 1024, 1024, 0, 7188, 0, + 12, 0, 0, 0, 280, 7272000, 1536, 1536, 0, 7272, 0, + 13, 0, 0, 0, 280, 6290000, 768, 768, 0, 6290, 0, + 14, 0, 0, 0, 280, 6604000, 1024, 1024, 0, 6604, 0, + 15, 0, 0, 0, 280, 6198000, 384, 384, 0, 6198, 0, + 16, 0, 0, 0, 280, 6250000, 384, 384, 0, 6250, 0, + 17, 0, 0, 0, 280, 6258000, 256, 256, 0, 6258, 0, + 18, 0, 0, 0, 280, 4354000, 256, 256, 0, 4354, 0, + 19, 0, 0, 0, 280, 6198000, 256, 256, 0, 6198, 0, + 20, 0, 0, 0, 280, 6250000, 128, 128, 0, 6250, 0, + 21, 0, 0, 0, 280, 6250000, 128, 128, 0, 6250, 0, + 22, 0, 0, 0, 280, 6206000, 128, 128, 0, 6206, 0, + 23, 0, 0, 0, 280, 4170000, 64, 64, 0, 4170, 0, + 24, 0, 0, 0, 280, 4234000, 96, 96, 0, 4234, 0, + 25, 0, 0, 0, 280, 6198000, 96, 96, 0, 6198, 0, + 26, 0, 0, 0, 280, 6250000, 96, 96, 0, 6250, 0, + 27, 0, 0, 0, 280, 6198000, 192, 192, 0, 6198, 0, + 28, 0, 0, 0, 280, 6258000, 192, 192, 0, 6258, 0, + 29, 0, 0, 0, 280, 6392000, 720, 720, 0, 6392, 0, + 30, 0, 0, 0, 280, 6250000, 360, 360, 0, 6250, 0, + 31, 0, 0, 0, 280, 5326000, 360, 360, 0, 5326, 0, + 32, 0, 0, 0, 280, 6258000, 180, 180, 0, 6258, 0, + 33, 0, 0, 0, 280, 4354000, 256, 256, 0, 4354, 0, + 34, 0, 0, 0, 280, 4898000, 256, 256, 0, 4898, 0, + 35, 0, 0, 0, 280, 6246000, 128, 128, 0, 6246, 0, + 36, 0, 0, 0, 280, 6250000, 192, 192, 0, 6250, 0, + 37, 0, 0, 0, 280, 6250000, 48, 48, 0, 6250, 0, + 38, 0, 0, 0, 280, 4170000, 64, 64, 0, 4170, 0, + 39, 0, 0, 0, 280, 6198000, 64, 64, 0, 6198, 0, + 40, 0, 0, 0, 280, 6246000, 32, 32, 0, 6246, 0] [[module.entry]] name = "PEAKVOL" @@ -185,13 +207,11 @@ count = 21 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 480, 1114000, 48, 64, 0, 0, 0, - 1, 0, 0, 0, 480, 3321600, 192, 256, 0, 0, 0, - 2, 0, 0, 0, 480, 3786000, 192, 256, 0, 0, 0, - 3, 0, 0, 0, 480, 4333000, 48, 64, 0, 0, 0, - 4, 0, 0, 0, 480, 4910000, 192, 256, 0, 0, 0, - 5, 0, 0, 0, 480, 5441000, 192, 256, 0, 0, 0, - 6, 0, 0, 0, 480, 6265000, 192, 256, 0, 0, 0] + mod_cfg = [1, 0, 0, 0, 480, 11667000, 384, 384, 0, 11667, 0, + 2, 0, 0, 0, 480, 5943000, 192, 192, 0, 5943, 0, + 3, 0, 0, 0, 480, 12567000, 720, 720, 0, 12567, 0, + 4, 0, 0, 0, 480, 7360000, 768, 768, 0, 7360, 0, + 5, 0, 0, 0, 480, 12236000, 1536, 1536, 0, 12236, 0] [[module.entry]] name = "GAIN" @@ -209,13 +229,10 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, - 1, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 2, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 3, 0, 0, 0, 416, 4964000, 48, 64, 0, 4964, 0, - 4, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 5, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0, - 6, 0, 0, 0, 416, 4964000, 192, 256, 0, 4964, 0] + mod_cfg = [1, 0, 0, 0, 416, 12100000, 1536, 1536, 0, 12100, 0, + 2, 0, 0, 0, 416, 10183000, 384, 384, 0, 10183, 0, + 3, 0, 0, 0, 416, 8192000, 512, 512, 0, 8192, 0, + 4, 0, 0, 0, 416, 10091000, 128, 128, 0, 10091, 0] [[module.entry]] name = "ASRC" @@ -265,29 +282,32 @@ count = 21 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 12832, 15920000, 0, 0, 0, 15920, 0, - 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, - 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, - 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, - 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, - 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, - 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, - 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, - 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, - 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, - 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, - 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, - 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, - 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, - 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, - 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, - 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, - 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, - 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, - 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, - 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, - 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, - 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] + mod_cfg = [1, 0, 0, 0, 12832, 15976000, 128, 512, 0, 15976, 0, + 2, 0, 0, 0, 12832, 15340000, 64, 256, 0, 15340, 0, + 3, 0, 0, 0, 12832, 21880000, 96, 512, 0, 21880, 0, + 4, 0, 0, 0, 12832, 19968000, 48, 256, 0, 19968, 0, + 5, 0, 0, 0, 12832, 18236000, 64, 256, 0, 18236, 0, + 6, 0, 0, 0, 12832, 15244000, 32, 256, 0, 15244, 0, + 7, 0, 0, 0, 12832, 56028000, 1536, 512, 0, 56028, 0, + 8, 0, 0, 0, 12832, 46740000, 768, 256, 0, 46740, 0, + 9, 0, 0, 0, 12832, 24656000, 768, 512, 0, 24656, 0, + 10, 0, 0, 0, 12832, 23516000, 384, 256, 0, 23516, 0, + 11, 0, 0, 0, 12832, 29368000, 384, 488, 0, 29368, 0, + 12, 0, 0, 0, 12832, 27164000, 192, 244, 0, 27164, 0, + 13, 0, 0, 0, 12832, 15892000, 384, 384, 0, 15892, 0, + 14, 0, 0, 0, 12832, 19916000, 192, 512, 0, 19916, 0, + 15, 0, 0, 0, 12832, 19176000, 96, 256, 0, 19176, 0, + 16, 0, 0, 0, 12832, 12676000, 192, 192, 0, 12676, 0, + 17, 0, 0, 0, 12832, 16280000, 384, 320, 0, 16280, 0, + 18, 0, 0, 0, 12832, 13076000, 192, 160, 0, 13076, 0, + 19, 0, 0, 0, 12832, 11440000, 384, 256, 0, 11440, 0, + 20, 0, 0, 0, 12832, 10996000, 192, 128, 0, 10996, 0, + 21, 0, 0, 0, 12832, 11428000, 384, 192, 0, 11428, 0, + 22, 0, 0, 0, 12832, 10740000, 192, 96, 0, 10740, 0, + 23, 0, 0, 0, 12832, 29936000, 360, 512, 0, 29936, 0, + 24, 0, 0, 0, 12832, 27696000, 180, 256, 0, 27696, 0, + 25, 0, 0, 0, 12832, 18368000, 256, 512, 0, 18368, 0, + 26, 0, 0, 0, 12832, 15204000, 128, 256, 0, 15204, 0] [[module.entry]] name = "MICSEL" @@ -325,14 +345,36 @@ count = 21 1, 0, 0xffff, 0xc, 0x8, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 216, 2700000, 12, 16, 0, 2700, 0, - 1, 0, 0, 0, 216, 1271000, 8, 8, 0, 0, 0, - 2, 0, 0, 0, 216, 1839000, 89, 118, 0, 0, 0, - 3, 0, 0, 0, 216, 2435000, 48, 64, 0, 0, 0, - 4, 0, 0, 0, 216, 3343000, 192, 192, 0, 0, 0, - 5, 0, 0, 0, 216, 3961000, 177, 177, 0, 0, 0, - 6, 0, 0, 0, 216, 4238000, 192, 256, 0, 0, 0, - 7, 0, 0, 0, 216, 6691000, 192, 256, 0, 0, 0] + mod_cfg = [1, 0, 0, 0, 216, 5044000, 384, 192, 0, 5044, 0, + 2, 0, 0, 0, 216, 2660000, 384, 384, 0, 2660, 0, + 3, 0, 0, 0, 216, 3164000, 576, 384, 0, 3164, 0, + 4, 0, 0, 0, 216, 3316000, 768, 384, 0, 3316, 0, + 5, 0, 0, 0, 216, 5264000, 768, 384, 0, 5264, 0, + 6, 0, 0, 0, 216, 5440000, 768, 384, 0, 5440, 0, + 7, 0, 0, 0, 216, 2888000, 768, 192, 0, 2888, 0, + 8, 0, 0, 0, 216, 2856000, 768, 192, 0, 2856, 0, + 9, 0, 0, 0, 216, 2876000, 768, 192, 0, 2876, 0, + 10, 0, 0, 0, 216, 2956000, 960, 192, 0, 2956, 0, + 11, 0, 0, 0, 216, 2888000, 1152, 192, 0, 2888, 0, + 12, 0, 0, 0, 216, 2888000, 1152, 192, 0, 2888, 0, + 13, 0, 0, 0, 216, 2816000, 1536, 192, 0, 2816, 0, + 14, 0, 0, 0, 216, 2468000, 192, 384, 0, 2468, 0, + 15, 0, 0, 0, 216, 3084000, 576, 384, 0, 3084, 0, + 16, 0, 0, 0, 216, 3442000, 960, 384, 0, 3442, 0, + 17, 0, 0, 0, 216, 3478000, 1152, 384, 0, 3478, 0, + 18, 0, 0, 0, 216, 3478000, 1152, 384, 0, 3478, 0, + 19, 0, 0, 0, 216, 3736000, 1536, 384, 0, 3736, 0, + 20, 0, 0, 0, 216, 3216000, 192, 1152, 0, 3216, 0, + 21, 0, 0, 0, 216, 3308000, 384, 1152, 0, 3308, 0, + 22, 0, 0, 0, 216, 3616000, 768, 1152, 0, 3616, 0, + 23, 0, 0, 0, 216, 3616000, 768, 1152, 0, 3616, 0, + 24, 0, 0, 0, 216, 4916000, 1536, 1152, 0, 4916, 0, + 25, 0, 0, 0, 216, 3228000, 192, 1152, 0, 3228, 0, + 26, 0, 0, 0, 216, 3452000, 384, 1152, 0, 3452, 0, + 27, 0, 0, 0, 216, 4016000, 768, 1152, 0, 4016, 0, + 28, 0, 0, 0, 216, 5080000, 1536, 1152, 0, 5080, 0, + 29, 0, 0, 0, 216, 3552000, 384, 1536, 0, 3552, 0, + 30, 0, 0, 0, 216, 3728000, 768, 1152, 0, 3728, 0] [[module.entry]] name = "PROBE" From 476d63608bccd5f6e26ae308be573706be3cefe8 Mon Sep 17 00:00:00 2001 From: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> Date: Tue, 28 Feb 2023 14:09:17 +0100 Subject: [PATCH 332/639] mtl: fill in cps and cpc data for ASRC module Fill in measured cps consumption data for ASRC module for various formats. Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com> --- config/mtl.toml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index c4566359d8a5..0c1f9fdb72d1 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -249,22 +249,21 @@ count = 21 pin = [0, 0, 0xfeef, 0xc, 0x8, 0x45ff, 1, 0, 0xfeef, 0xc, 0x8, 0x45ff] - mod_cfg = [0, 0, 0, 0, 20480, 4065600, 24, 22, 0, 0, 0, - 1, 0, 0, 0, 20480, 5616000, 8, 25, 0, 0, 0, - 2, 0, 0, 0, 20480, 7319200, 24, 27, 0, 0, 0, - 3, 0, 0, 0, 20480, 9155300, 8, 27, 0, 0, 0, - 4, 0, 0, 0, 20480, 10972600, 48, 54, 0, 0, 0, - 5, 0, 0, 0, 20480, 12661000, 16, 36, 0, 0, 0, - 6, 0, 0, 0, 20480, 14448500, 48, 96, 0, 0, 0, - 7, 0, 0, 0, 20480, 16145000, 19, 68, 0, 0, 0, - 8, 0, 0, 0, 20480, 17861300, 45, 102, 0, 0, 0, - 9, 0, 0, 0, 20480, 21425900, 8, 36, 0, 0, 0, - 10, 0, 0, 0, 20480, 22771000, 32, 102, 0, 0, 0, - 11, 0, 0, 0, 20480, 23439000, 48, 27, 0, 0, 0, - 12, 0, 0, 0, 20480, 33394000, 48, 51, 0, 0, 0, - 13, 0, 0, 0, 20480, 36140000, 16, 96, 0, 0, 0, - 14, 0, 0, 0, 20480, 38003000, 16, 68, 0, 0, 0, - 15, 0, 0, 0, 20480, 39787000, 45, 51, 0, 0, 0] + mod_cfg = [1, 0, 0, 0, 20480, 21808000, 64, 192, 0, 21808, 0, + 2, 0, 0, 0, 20480, 45820000, 64, 384, 0, 45820, 0, + 3, 0, 0, 0, 20480, 75236000, 512, 1440, 0, 75236, 0, + 4, 0, 0, 0, 20480, 79732000, 512, 1536, 0, 79732, 0, + 5, 0, 0, 0, 20480, 50411000, 184, 384, 0, 50411, 0, + 6, 0, 0, 0, 20480, 24236000, 192, 128, 0, 24236, 0, + 7, 0, 0, 0, 20480, 46753000, 192, 384, 0, 46753, 0, + 8, 0, 0, 0, 20480, 30032000, 256, 256, 0, 30032, 0, + 9, 0, 0, 0, 20480, 48676000, 256, 384, 0, 48676, 0, + 10, 0, 0, 0, 20480, 46548000, 360, 360, 0, 46548, 0, + 11, 0, 0, 0, 20480, 94372000, 1440, 1536, 0, 94372, 0, + 12, 0, 0, 0, 20480, 42912000, 1536, 512, 0, 42912, 0, + 13, 0, 0, 0, 20480, 31871000, 384, 192, 0, 31871, 0, + 14, 0, 0, 0, 20480, 34216000, 384, 256, 0, 34216, 0, + 15, 0, 0, 0, 20480, 83448000, 1536, 1440, 0, 83448, 0] [[module.entry]] name = "SRC" From fea2a30e56911eefbdf88870547317873f204a01 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Fri, 10 Mar 2023 08:25:30 +0100 Subject: [PATCH 333/639] mtl: fill in cps and cpc data for smart_amp_test module Fill in measured cps consumption data for SMATEST module Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 0c1f9fdb72d1..bf32358dd6b5 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -463,7 +463,7 @@ count = 21 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 296, 5000000, 384, 384, 0, 5000, 0] # eq iir module config [[module.entry]] From 4a36634db6122393003b9489aedfbd236c6ca501 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Thu, 18 May 2023 09:36:22 +0200 Subject: [PATCH 334/639] mtl: fill in cps and cpc data for EQIIR module Fill in measured cps consumption data for EQIIR module Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index bf32358dd6b5..b9cc7502b0a5 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -482,7 +482,8 @@ count = 21 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 1000, 0, + 0, 0, 0, 0, 4096, 20663000, 768, 768, 0, 20663, 0] # eq fir module config [[module.entry]] From 8bcf1fc9114765cf91de80a00415d350293445c0 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Wed, 19 Jul 2023 09:36:34 +0200 Subject: [PATCH 335/639] mtl: fill in cps and cpc data for COPIER & GAIN modules Fill in measured cps consumption data for COPIER & GAIN modules Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> --- config/mtl.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index b9cc7502b0a5..49ebe055e4f0 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -189,7 +189,8 @@ count = 21 37, 0, 0, 0, 280, 6250000, 48, 48, 0, 6250, 0, 38, 0, 0, 0, 280, 4170000, 64, 64, 0, 4170, 0, 39, 0, 0, 0, 280, 6198000, 64, 64, 0, 6198, 0, - 40, 0, 0, 0, 280, 6246000, 32, 32, 0, 6246, 0] + 40, 0, 0, 0, 280, 6246000, 32, 32, 0, 6246, 0, + 41, 0, 0, 0, 280, 5272000, 192, 384, 0, 5272, 0] [[module.entry]] name = "PEAKVOL" @@ -232,7 +233,8 @@ count = 21 mod_cfg = [1, 0, 0, 0, 416, 12100000, 1536, 1536, 0, 12100, 0, 2, 0, 0, 0, 416, 10183000, 384, 384, 0, 10183, 0, 3, 0, 0, 0, 416, 8192000, 512, 512, 0, 8192, 0, - 4, 0, 0, 0, 416, 10091000, 128, 128, 0, 10091, 0] + 4, 0, 0, 0, 416, 10091000, 128, 128, 0, 10091, 0, + 5, 0, 0, 0, 416, 5908000, 768, 768, 0, 5908, 0] [[module.entry]] name = "ASRC" From e8b380d4aec2eab7f0e0ab82246f8bcc22964ffa Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 13 Jun 2023 16:52:33 +0300 Subject: [PATCH 336/639] Config: Add Multiband-DRC component to TGL, TGL-H, MTL, LNL This patch allows to load the Multiband-DRC component. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 032cc3a2371a..3c499e4f7459 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 21 +count = 22 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -521,3 +521,19 @@ count = 21 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 49ebe055e4f0..450400325dbe 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 21 +count = 22 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -565,3 +565,19 @@ count = 21 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 1f439bbf4a9a..d4b4be11e36d 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 18 +count = 19 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -448,3 +448,19 @@ count = 18 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 2c737f94f2be..ff79f92c71db 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 18 +count = 19 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -448,3 +448,19 @@ count = 18 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # Multiband-DRC module config + [[module.entry]] + name = "MB_DRC" + uuid = "0D9F2256-8E4F-47B3-8448-239A334F1191" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 7bc2958ba4fd8bab351e688225c2241812cf1cb4 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 1 Sep 2023 20:25:48 +0300 Subject: [PATCH 337/639] Config: Add DCblock to TGL, TGL-H, MTL, and LNL This patch enables load of the DC blocker component. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 3c499e4f7459..30e567b060ec 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 22 +count = 23 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -537,3 +537,19 @@ count = 22 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index 450400325dbe..4a246dcf140d 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 22 +count = 23 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -581,3 +581,19 @@ count = 22 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index d4b4be11e36d..15638424c9fe 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -464,3 +464,19 @@ count = 19 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index ff79f92c71db..04a0df56a861 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 19 +count = 20 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -464,3 +464,19 @@ count = 19 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # DCblock module config + [[module.entry]] + name = "DCBLOCK" + uuid = "B809EFAF-5681-42B1-9ED6-04BB012DD384" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From 9ccfbc4e39bbfd09c68476f20789c2ab0879ad76 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Thu, 7 Sep 2023 00:05:34 +0000 Subject: [PATCH 338/639] sof-glk-nocodec: disable pipelines when disabling SSPs When we added the flags to disable SSP0 and SSP1 on the UP2, we took the shortcut of just removing the PCMs in topology but left the pipelines and widgets in the topology in. While this works in practice to prevent us from testing those SSPs, the right way is to also remove those pipelines also when the SSPs are disabled. This stops tplgtool2.py from complaining constantly about this inconsistency since https://github.com/thesofproject/sof-test/pull/1079 which made the sof-test verify-tplg-binary.sh fail every time: ``` tplgtool2.py sof-glk-nocodec.tplg ERROR: No pcm id=0 for widget=PCM0C ERROR: No pcm id=1 for widget=PCM1C ERROR: No pcm id=0 for widget=PCM0P ERROR: No pcm id=1 for widget=PCM1P ERROR: tplgtool2.py returned 4 ``` This change affects only sof-apl-nocodec and sof-glk-nocodec. Signed-off-by: Marc Herbert <marc.herbert@intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- tools/topology/topology1/sof-cavs-nocodec.m4 | 44 ++++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/tools/topology/topology1/sof-cavs-nocodec.m4 b/tools/topology/topology1/sof-cavs-nocodec.m4 index d5c3e2ed147f..ba5f741f26e2 100644 --- a/tools/topology/topology1/sof-cavs-nocodec.m4 +++ b/tools/topology/topology1/sof-cavs-nocodec.m4 @@ -101,17 +101,19 @@ dnl time_domain, sched_comp) # Volume switch capture pipeline 2 on PCM 0 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, +ifdef(`DISABLE_SSP0',, + `PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 2, 0, 2, PIPE_BITS, 1000, 0, SSP0_CORE_ID, - 48000, 48000, 48000) + 48000, 48000, 48000)') # Volume switch capture pipeline 4 on PCM 1 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP1_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, +ifdef(`DISABLE_SSP1',, + `PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, 4, 1, 2, PIPE_BITS, 1000, 0, SSP1_CORE_ID, - 48000, 48000, 48000) + 48000, 48000, 48000)') # Volume switch capture pipeline 6 on PCM 2 using max 2 channels of PIPE_BITS. # Set 1000us deadline with priority 0 on core SSP2_CORE_ID @@ -132,19 +134,21 @@ dnl deadline, priority, core, time_domain) # playback DAI is SSP0 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP0_CORE_ID # The 'NOT_USED_IGNORED' is due to dependencies and is adjusted later with an explicit dapm line. -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, +ifdef(`DISABLE_SSP0',, + `DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, 1, SSP, SSP0_IDX, NoCodec-0, NOT_USED_IGNORED, 2, DAI_BITS, - 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)') # Low Latency playback pipeline 1 on PCM 0 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, +ifdef(`DISABLE_SSP0',, + `PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, 7, 0, 2, PIPE_BITS, 1000, 0, SSP0_CORE_ID, 48000, 48000, 48000, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) + PIPELINE_PLAYBACK_SCHED_COMP_1)') # Deep buffer playback pipeline 11 on PCM 3 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP0_CORE_ID with priority 0. @@ -158,33 +162,37 @@ PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, # capture DAI is SSP0 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP0_IDX -DAI_ADD(sof/pipe-dai-capture.m4, +ifdef(`DISABLE_SSP0',, + `DAI_ADD(sof/pipe-dai-capture.m4, 2, SSP, SSP0_IDX, NoCodec-0, PIPELINE_SINK_2, 2, DAI_BITS, - 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, SSP0_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP1 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP1_CORE_ID -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, +ifdef(`DISABLE_SSP1',, + `DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, 3, SSP, SSP1_IDX, NoCodec-1, NOT_USED_IGNORED, 2, DAI_BITS, - 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) + 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000)') # Low Latency playback pipeline 8 on PCM 1 using max 2 channels of PIPE_BITS. # Set 1000us deadline on core SSP1_CORE_ID with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, +ifdef(`DISABLE_SSP1',, + `PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, 8, 1, 2, PIPE_BITS, 1000, 0, SSP1_CORE_ID, 48000, 48000, 48000, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_3) + PIPELINE_PLAYBACK_SCHED_COMP_3)') # capture DAI is SSP1 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP1_CORE_ID -DAI_ADD(sof/pipe-dai-capture.m4, +ifdef(`DISABLE_SSP1',, + `DAI_ADD(sof/pipe-dai-capture.m4, 4, SSP, SSP1_IDX, NoCodec-1, PIPELINE_SINK_4, 2, DAI_BITS, - 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) + 1000, 0, SSP1_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') # playback DAI is SSP2 using 2 periods # Buffers use DAI_BITS format, 1000us deadline with priority 0 on core SSP2_CORE_ID @@ -214,8 +222,8 @@ SectionGraph."mixer-host" { lines [ # connect mixer dai pipelines to PCM pipelines - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_7) - dapm(PIPELINE_MIXER_3, PIPELINE_SOURCE_8) + ifdef(`DISABLE_SSP0',,`dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_7)') + ifdef(`DISABLE_SSP1',, `dapm(PIPELINE_MIXER_3, PIPELINE_SOURCE_8)') dapm(PIPELINE_MIXER_5, PIPELINE_SOURCE_9) ] } From 4a036999118cfa7e491cbefc8eb6b737f50b7e33 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Tue, 8 Aug 2023 10:29:05 +0200 Subject: [PATCH 339/639] buf: remove coherent.h from struct comp_buffer This commit removes coherent.h from struct comp_buffer As sharing status of a buffer is known at creation time, it is enough to create a buffer in shared (not cached mem alias) when it will be used by several cores Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/buffer.c | 75 +++------------------ src/audio/chain_dma.c | 4 +- src/audio/copier/copier_generic.c | 4 +- src/audio/dai-legacy.c | 2 +- src/audio/dai-zephyr.c | 3 +- src/audio/host-legacy.c | 2 +- src/audio/host-zephyr.c | 3 +- src/audio/module_adapter/module_adapter.c | 3 +- src/audio/pipeline/pipeline-graph.c | 4 -- src/include/sof/audio/buffer.h | 27 +++----- src/ipc/ipc-helper.c | 9 +-- src/ipc/ipc3/helper.c | 14 +++- src/ipc/ipc4/helper.c | 10 +-- test/cmocka/src/audio/buffer/buffer_copy.c | 20 +++--- test/cmocka/src/audio/buffer/buffer_new.c | 2 +- test/cmocka/src/audio/buffer/buffer_wrap.c | 2 +- test/cmocka/src/audio/buffer/buffer_write.c | 4 +- test/cmocka/src/math/fft/fft.c | 42 ++++++------ test/cmocka/src/util.h | 4 +- 19 files changed, 92 insertions(+), 142 deletions(-) diff --git a/src/audio/buffer.c b/src/audio/buffer.c index c9c86cf8dc61..a6da20dea456 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -27,7 +27,8 @@ DECLARE_SOF_RT_UUID("buffer", buffer_uuid, 0x42544c92, 0x8e92, 0x4e41, 0xb6, 0x79, 0x34, 0x51, 0x9f, 0x1c, 0x1d, 0x28); DECLARE_TR_CTX(buffer_tr, SOF_UUID(buffer_uuid), LOG_LEVEL_INFO); -struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, uint32_t align) +struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, uint32_t align, + bool is_shared) { struct comp_buffer *buffer; struct comp_buffer __sparse_cache *buffer_c; @@ -42,16 +43,17 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u return NULL; } - /* - * allocate new buffer, align the allocation size to a cache line for - * the coherent API - */ - buffer = coherent_init_thread(struct comp_buffer, c); + /* allocate new buffer */ + enum mem_zone zone = is_shared ? SOF_MEM_ZONE_RUNTIME_SHARED : SOF_MEM_ZONE_RUNTIME; + + buffer = rzalloc(zone, 0, SOF_MEM_CAPS_RAM, sizeof(*buffer)); + if (!buffer) { tr_err(&buffer_tr, "buffer_alloc(): could not alloc structure"); return NULL; } + buffer->is_shared = is_shared; stream_addr = rballoc_align(0, caps, size, align); if (!stream_addr) { rfree(buffer); @@ -70,18 +72,6 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u buffer_release(buffer_c); - /* - * The buffer hasn't yet been marked as shared, hence buffer_release() - * hasn't written back and invalidated the cache. Therefore we have to - * do this manually now before adding to the lists. Buffer list - * structures are always accessed uncached and they're never modified at - * run-time, i.e. buffers are never relinked. So we have to make sure, - * that what we have written into buffer's cache is in RAM before - * modifying that RAM bypassing cache, and that after this cache is - * re-loaded again. - */ - dcache_writeback_invalidate_region(uncache_to_cache(buffer), sizeof(*buffer)); - list_init(&buffer->source_list); list_init(&buffer->sink_list); @@ -303,30 +293,7 @@ void comp_update_buffer_consume(struct comp_buffer __sparse_cache *buffer, uint3 void buffer_attach(struct comp_buffer *buffer, struct list_item *head, int dir) { struct list_item *list = buffer_comp_list(buffer, dir); - struct list_item __sparse_cache *needs_sync; - bool further_buffers_exist; - - /* - * There can already be buffers on the target list. If we just link this - * buffer, we modify the first buffer's list header via uncached alias, - * so its cached copy can later be written back, overwriting the - * modified header. FIXME: this is still a problem with different cores. - */ - further_buffers_exist = !list_is_empty(head); - needs_sync = uncache_to_cache(head->next); - if (further_buffers_exist) - dcache_writeback_region(needs_sync, sizeof(struct list_item)); - /* The cache line can be prefetched here, invalidate it after prepending */ list_item_prepend(list, head); - if (further_buffers_exist) - dcache_invalidate_region(needs_sync, sizeof(struct list_item)); -#if CONFIG_INTEL - /* - * Until now the buffer object wasn't in cache, but uncached access to it could have - * triggered a cache prefetch. Drop that cache line to avoid using stale data in it. - */ - dcache_invalidate_region(uncache_to_cache(list), sizeof(*list)); -#endif } /* @@ -335,32 +302,6 @@ void buffer_attach(struct comp_buffer *buffer, struct list_item *head, int dir) */ void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir) { - struct list_item __sparse_cache *needs_sync_prev, *needs_sync_next; - bool buffers_after_exist, buffers_before_exist; struct list_item *buf_list = buffer_comp_list(buffer, dir); - - /* - * There can be more buffers linked together with this one, that will - * still be staying on their respective pipelines and might get used via - * their cached aliases. If we just unlink this buffer, we modify their - * list header via uncached alias, so their cached copy can later be - * written back, overwriting the modified header. FIXME: this is still a - * problem with different cores. - */ - buffers_after_exist = head != buf_list->next; - buffers_before_exist = head != buf_list->prev; - needs_sync_prev = uncache_to_cache(buf_list->prev); - needs_sync_next = uncache_to_cache(buf_list->next); - if (buffers_after_exist) - dcache_writeback_region(needs_sync_next, sizeof(struct list_item)); - if (buffers_before_exist) - dcache_writeback_region(needs_sync_prev, sizeof(struct list_item)); - dcache_writeback_region(uncache_to_cache(buf_list), sizeof(*buf_list)); - /* buffers before or after can be prefetched here */ list_item_del(buf_list); - dcache_invalidate_region(uncache_to_cache(buf_list), sizeof(*buf_list)); - if (buffers_after_exist) - dcache_invalidate_region(needs_sync_next, sizeof(struct list_item)); - if (buffers_before_exist) - dcache_invalidate_region(needs_sync_prev, sizeof(struct list_item)); } diff --git a/src/audio/chain_dma.c b/src/audio/chain_dma.c index b8cf7ded072a..f2fbf3cdbfbb 100644 --- a/src/audio/chain_dma.c +++ b/src/audio/chain_dma.c @@ -588,8 +588,8 @@ static int chain_task_init(struct comp_dev *dev, uint8_t host_dma_id, uint8_t li } fifo_size = ALIGN_UP_INTERNAL(fifo_size, addr_align); - - cd->dma_buffer = buffer_alloc(fifo_size, SOF_MEM_CAPS_DMA, 0, addr_align); + /* allocate not shared buffer */ + cd->dma_buffer = buffer_alloc(fifo_size, SOF_MEM_CAPS_DMA, 0, addr_align, false); if (!cd->dma_buffer) { comp_err(dev, "chain_task_init(): failed to alloc dma buffer"); diff --git a/src/audio/copier/copier_generic.c b/src/audio/copier/copier_generic.c index c610d05a049d..13794b19bccd 100644 --- a/src/audio/copier/copier_generic.c +++ b/src/audio/copier/copier_generic.c @@ -204,8 +204,8 @@ int create_endpoint_buffer(struct comp_dev *dev, ipc_buf.size = buf_size; ipc_buf.comp.pipeline_id = config->pipeline_id; ipc_buf.comp.core = config->core; - - buffer = buffer_new(&ipc_buf); + /* allocate not shared buffer */ + buffer = buffer_new(&ipc_buf, false); if (!buffer) return -ENOMEM; diff --git a/src/audio/dai-legacy.c b/src/audio/dai-legacy.c index 884f2b00f2fc..446ae0c83c08 100644 --- a/src/audio/dai-legacy.c +++ b/src/audio/dai-legacy.c @@ -600,7 +600,7 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, } } else { dd->dma_buffer = buffer_alloc(buffer_size, SOF_MEM_CAPS_DMA, 0, - addr_align); + addr_align, false); if (!dd->dma_buffer) { comp_err(dev, "dai_params(): failed to alloc dma buffer"); return -ENOMEM; diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index bcbfd91dd2ad..f83bf3d27f94 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -977,8 +977,9 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, return err; } } else { + /* allocate not shared buffer */ dd->dma_buffer = buffer_alloc(buffer_size, SOF_MEM_CAPS_DMA, 0, - addr_align); + addr_align, false); if (!dd->dma_buffer) { comp_err(dev, "dai_common_params(): failed to alloc dma buffer"); return -ENOMEM; diff --git a/src/audio/host-legacy.c b/src/audio/host-legacy.c index b9a112583586..546cc6edbfc1 100644 --- a/src/audio/host-legacy.c +++ b/src/audio/host-legacy.c @@ -788,7 +788,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, } } else { hd->dma_buffer = buffer_alloc(buffer_size, SOF_MEM_CAPS_DMA, 0, - addr_align); + addr_align, false); if (!hd->dma_buffer) { comp_err(dev, "host_params(): failed to alloc dma buffer"); err = -ENOMEM; diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index d62ad4b424fc..5a2a57438536 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -857,8 +857,9 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, goto out; } } else { + /* allocate not shared buffer */ hd->dma_buffer = buffer_alloc(buffer_size, SOF_MEM_CAPS_DMA, 0, - addr_align); + addr_align, false); if (!hd->dma_buffer) { comp_err(dev, "host_params(): failed to alloc dma buffer"); err = -ENOMEM; diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index e28541560403..81b0cb890bf8 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -448,8 +448,9 @@ int module_adapter_prepare(struct comp_dev *dev) /* allocate buffer for all sinks */ if (list_is_empty(&mod->sink_buffer_list)) { for (i = 0; i < mod->num_output_buffers; i++) { + /* allocate not shared buffer */ struct comp_buffer *buffer = buffer_alloc(buff_size, SOF_MEM_CAPS_RAM, - 0, PLATFORM_DCACHE_ALIGN); + 0, PLATFORM_DCACHE_ALIGN, false); uint32_t flags; if (!buffer) { diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 71645c69fa84..160e14e15441 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -176,10 +176,6 @@ static void buffer_set_comp(struct comp_buffer *buffer, struct comp_dev *comp, buffer_c->sink = comp; buffer_release(buffer_c); - - /* The buffer might be marked as shared later, write back the cache */ - if (!buffer->c.shared) - dcache_writeback_invalidate_region(uncache_to_cache(buffer), sizeof(*buffer)); } int pipeline_connect(struct comp_dev *comp, struct comp_buffer *buffer, diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 2eeef2d9f80a..4238c902dfdf 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -133,8 +133,6 @@ extern struct tr_ctx buffer_tr; * 5) write back cached data and release lock using uncache pointer. */ struct comp_buffer { - struct coherent c; - /* data buffer */ struct audio_stream stream; @@ -144,6 +142,7 @@ struct comp_buffer { uint32_t caps; uint32_t core; struct tr_ctx tctx; /* trace settings */ + bool is_shared; /* buffer structure is shared between 2 cores */ /* connected components */ struct comp_dev *source; /* source component */ @@ -188,8 +187,9 @@ struct buffer_cb_free { } while (0) /* pipeline buffer creation and destruction */ -struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, uint32_t align); -struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc); +struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, uint32_t align, + bool is_shared); +struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared); int buffer_set_size(struct comp_buffer __sparse_cache *buffer, uint32_t size, uint32_t alignment); void buffer_free(struct comp_buffer *buffer); void buffer_zero(struct comp_buffer __sparse_cache *buffer); @@ -209,32 +209,27 @@ bool buffer_params_match(struct comp_buffer __sparse_cache *buffer, static inline void buffer_stream_invalidate(struct comp_buffer __sparse_cache *buffer, uint32_t bytes) { - if (!is_coherent_shared(buffer, c)) - return; - - audio_stream_invalidate(&buffer->stream, bytes); + if (buffer->is_shared) + audio_stream_invalidate(&buffer->stream, bytes); } static inline void buffer_stream_writeback(struct comp_buffer __sparse_cache *buffer, uint32_t bytes) { - if (!is_coherent_shared(buffer, c)) - return; - - audio_stream_writeback(&buffer->stream, bytes); + if (buffer->is_shared) + audio_stream_writeback(&buffer->stream, bytes); } +/* stubs for acquire/release for compilation, to be removed at last step */ __must_check static inline struct comp_buffer __sparse_cache *buffer_acquire( struct comp_buffer *buffer) { - struct coherent __sparse_cache *c = coherent_acquire_thread(&buffer->c, sizeof(*buffer)); - - return attr_container_of(c, struct comp_buffer __sparse_cache, c, __sparse_cache); + return (struct comp_buffer __sparse_cache *)buffer; } static inline void buffer_release(struct comp_buffer __sparse_cache *buffer) { - coherent_release_thread(&buffer->c, sizeof(*buffer)); + (void)buffer; } /* diff --git a/src/ipc/ipc-helper.c b/src/ipc/ipc-helper.c index bbcec49698f0..d71045139d82 100644 --- a/src/ipc/ipc-helper.c +++ b/src/ipc/ipc-helper.c @@ -36,7 +36,7 @@ LOG_MODULE_DECLARE(ipc, CONFIG_SOF_LOG_LEVEL); /* create a new component in the pipeline */ -struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc) +struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared) { struct comp_buffer *buffer; @@ -44,7 +44,8 @@ struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc) desc->size, desc->comp.pipeline_id, desc->comp.id, desc->flags); /* allocate buffer */ - buffer = buffer_alloc(desc->size, desc->caps, desc->flags, PLATFORM_DCACHE_ALIGN); + buffer = buffer_alloc(desc->size, desc->caps, desc->flags, PLATFORM_DCACHE_ALIGN, + is_shared); if (buffer) { buffer->id = desc->comp.id; buffer->pipeline_id = desc->comp.pipeline_id; @@ -174,8 +175,8 @@ int comp_buffer_connect(struct comp_dev *comp, uint32_t comp_core, { /* check if it's a connection between cores */ if (buffer->core != comp_core) { - /* set the buffer as a coherent object */ - coherent_shared_thread(buffer, c); + /* buffer must be shared */ + assert(buffer->is_shared); if (!comp->is_shared) comp_make_shared(comp); diff --git a/src/ipc/ipc3/helper.c b/src/ipc/ipc3/helper.c index 4a723b9539a7..2bd55ec22717 100644 --- a/src/ipc/ipc3/helper.c +++ b/src/ipc/ipc3/helper.c @@ -454,7 +454,7 @@ int ipc_buffer_new(struct ipc *ipc, const struct sof_ipc_buffer *desc) } /* register buffer with pipeline */ - buffer = buffer_new(desc); + buffer = buffer_new(desc, false); if (!buffer) { tr_err(&ipc_tr, "ipc_buffer_new(): buffer_new() failed"); return -ENOMEM; @@ -572,6 +572,12 @@ static int ipc_comp_to_buffer_connect(struct ipc_comp_dev *comp, tr_dbg(&ipc_tr, "ipc: comp sink %d, source %d -> connect", buffer->id, comp->id); +#if CONFIG_INCOHERENT + if (comp->core != buffer->cb->core) { + tr_err(&ipc_tr, "ipc: shared buffers are not supported for IPC3 incoherent architectures"); + return -ENOTSUP; + } +#endif return comp_buffer_connect(comp->cd, comp->core, buffer->cb, PPL_CONN_DIR_COMP_TO_BUFFER); } @@ -582,6 +588,12 @@ static int ipc_buffer_to_comp_connect(struct ipc_comp_dev *buffer, tr_dbg(&ipc_tr, "ipc: comp sink %d, source %d -> connect", comp->id, buffer->id); +#if CONFIG_INCOHERENT + if (comp->core != buffer->cb->core) { + tr_err(&ipc_tr, "ipc: shared buffers are not supported for IPC3 incoherent architectures"); + return -ENOTSUP; + } +#endif return comp_buffer_connect(comp->cd, comp->core, buffer->cb, PPL_CONN_DIR_BUFFER_TO_COMP); } diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 46a4ff1e3f1b..1d2838c1ed57 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -315,7 +315,7 @@ int ipc_pipeline_free(struct ipc *ipc, uint32_t comp_id) return IPC4_SUCCESS; } -static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, struct comp_dev *sink, +static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, bool is_shared, uint32_t src_obs, uint32_t src_queue, uint32_t dst_queue) { @@ -330,7 +330,7 @@ static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, struct comp_ ipc_buf.comp.id = IPC4_COMP_ID(src_queue, dst_queue); ipc_buf.comp.pipeline_id = src->ipc_config.pipeline_id; ipc_buf.comp.core = src->ipc_config.core; - return buffer_new(&ipc_buf); + return buffer_new(&ipc_buf, is_shared); } int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) @@ -344,6 +344,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) struct ipc4_base_module_cfg sink_src_cfg; uint32_t flags; int src_id, sink_id; + bool is_shared; int ret; bu = (struct ipc4_module_bind_unbind *)_connect; @@ -360,6 +361,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) /* Pass IPC to target core if both modules has the same target core */ if (!cpu_is_me(source->ipc_config.core) && source->ipc_config.core == sink->ipc_config.core) return ipc4_process_on_core(source->ipc_config.core, false); + is_shared = (source->ipc_config.core != sink->ipc_config.core); ret = comp_get_attribute(source, COMP_ATTR_BASE_CONFIG, &source_src_cfg); if (ret < 0) { @@ -373,8 +375,8 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) return IPC4_FAILURE; } - buffer = ipc4_create_buffer(source, sink, source_src_cfg.obs, bu->extension.r.src_queue, - bu->extension.r.dst_queue); + buffer = ipc4_create_buffer(source, is_shared, source_src_cfg.obs, + bu->extension.r.src_queue, bu->extension.r.dst_queue); if (!buffer) { tr_err(&ipc_tr, "failed to allocate buffer to bind %d to %d", src_id, sink_id); return IPC4_OUT_OF_MEMORY; diff --git a/test/cmocka/src/audio/buffer/buffer_copy.c b/test/cmocka/src/audio/buffer/buffer_copy.c index 1983d92edfdf..be1500cb66f0 100644 --- a/test/cmocka/src/audio/buffer/buffer_copy.c +++ b/test/cmocka/src/audio/buffer/buffer_copy.c @@ -29,8 +29,8 @@ static void test_audio_buffer_copy_underrun(void **state) .size = 256 }; - struct comp_buffer *src = buffer_new(&test_buf_desc); - struct comp_buffer *snk = buffer_new(&test_buf_desc); + struct comp_buffer *src = buffer_new(&test_buf_desc, false); + struct comp_buffer *snk = buffer_new(&test_buf_desc, false); assert_non_null(src); assert_non_null(snk); @@ -56,8 +56,8 @@ static void test_audio_buffer_copy_overrun(void **state) .size = 256 }; - struct comp_buffer *src = buffer_new(&test_buf_desc); - struct comp_buffer *snk = buffer_new(&test_buf_desc); + struct comp_buffer *src = buffer_new(&test_buf_desc, false); + struct comp_buffer *snk = buffer_new(&test_buf_desc, false); assert_non_null(src); assert_non_null(snk); @@ -85,8 +85,8 @@ static void test_audio_buffer_copy_success(void **state) .size = 256 }; - struct comp_buffer *src = buffer_new(&test_buf_desc); - struct comp_buffer *snk = buffer_new(&test_buf_desc); + struct comp_buffer *src = buffer_new(&test_buf_desc, false); + struct comp_buffer *snk = buffer_new(&test_buf_desc, false); assert_non_null(src); assert_non_null(snk); @@ -111,8 +111,8 @@ static void test_audio_buffer_copy_fit_space_constraint(void **state) .size = 256 }; - struct comp_buffer *src = buffer_new(&test_buf_desc); - struct comp_buffer *snk = buffer_new(&test_buf_desc); + struct comp_buffer *src = buffer_new(&test_buf_desc, false); + struct comp_buffer *snk = buffer_new(&test_buf_desc, false); assert_non_null(src); assert_non_null(snk); @@ -139,8 +139,8 @@ static void test_audio_buffer_copy_fit_no_space_constraint(void **state) .size = 256 }; - struct comp_buffer *src = buffer_new(&test_buf_desc); - struct comp_buffer *snk = buffer_new(&test_buf_desc); + struct comp_buffer *src = buffer_new(&test_buf_desc, false); + struct comp_buffer *snk = buffer_new(&test_buf_desc, false); assert_non_null(src); assert_non_null(snk); diff --git a/test/cmocka/src/audio/buffer/buffer_new.c b/test/cmocka/src/audio/buffer/buffer_new.c index 2f78033a5fc1..e2ce0c274b57 100644 --- a/test/cmocka/src/audio/buffer/buffer_new.c +++ b/test/cmocka/src/audio/buffer/buffer_new.c @@ -27,7 +27,7 @@ static void test_audio_buffer_new(void **state) .size = 256 }; - struct comp_buffer *buf = buffer_new(&test_buf_desc); + struct comp_buffer *buf = buffer_new(&test_buf_desc, false); assert_non_null(buf); assert_int_equal(audio_stream_get_avail_bytes(&buf->stream), 0); diff --git a/test/cmocka/src/audio/buffer/buffer_wrap.c b/test/cmocka/src/audio/buffer/buffer_wrap.c index 210bce1a2ef0..b0c7d11ce555 100644 --- a/test/cmocka/src/audio/buffer/buffer_wrap.c +++ b/test/cmocka/src/audio/buffer/buffer_wrap.c @@ -27,7 +27,7 @@ static void test_audio_buffer_write_fill_10_bytes_and_write_5(void **state) .size = 10 }; - struct comp_buffer *buf = buffer_new(&test_buf_desc); + struct comp_buffer *buf = buffer_new(&test_buf_desc, false); assert_non_null(buf); assert_int_equal(audio_stream_get_avail_bytes(&buf->stream), 0); diff --git a/test/cmocka/src/audio/buffer/buffer_write.c b/test/cmocka/src/audio/buffer/buffer_write.c index 8c4fc185c2db..8c3e437d612a 100644 --- a/test/cmocka/src/audio/buffer/buffer_write.c +++ b/test/cmocka/src/audio/buffer/buffer_write.c @@ -28,7 +28,7 @@ static void test_audio_buffer_write_10_bytes_out_of_256_and_read_back .size = 256 }; - struct comp_buffer *buf = buffer_new(&test_buf_desc); + struct comp_buffer *buf = buffer_new(&test_buf_desc, false); assert_non_null(buf); assert_int_equal(audio_stream_get_avail_bytes(&buf->stream), 0); @@ -63,7 +63,7 @@ static void test_audio_buffer_fill_10_bytes(void **state) .size = 10 }; - struct comp_buffer *buf = buffer_new(&test_buf_desc); + struct comp_buffer *buf = buffer_new(&test_buf_desc, false); assert_non_null(buf); assert_int_equal(audio_stream_get_avail_bytes(&buf->stream), 0); diff --git a/test/cmocka/src/math/fft/fft.c b/test/cmocka/src/math/fft/fft.c index 653212c7bfc2..cfb2ec8d98bb 100644 --- a/test/cmocka/src/math/fft/fft.c +++ b/test/cmocka/src/math/fft/fft.c @@ -265,8 +265,8 @@ static void test_math_fft_256(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 256 * 2 * sizeof(int32_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex32 *out = (struct icomplex32 *)sink->stream.addr; int32_t *in = (int32_t *)source->stream.addr; int fft_size = 256; @@ -307,8 +307,8 @@ static void test_math_fft_512(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 512 * 2 * sizeof(int32_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex32 *out = (struct icomplex32 *)sink->stream.addr; int32_t *in = (int32_t *)source->stream.addr; int fft_size = 512; @@ -349,8 +349,8 @@ static void test_math_fft_1024(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 1024 * 2 * sizeof(int32_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex32 *out = (struct icomplex32 *)sink->stream.addr; int32_t *in = (int32_t *)source->stream.addr; int fft_size = 1024; @@ -391,9 +391,9 @@ static void test_math_fft_1024_ifft(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 1024 * 4 * 2, }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *intm = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *intm = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex32 *out = (struct icomplex32 *)sink->stream.addr; float db; int64_t signal = 0; @@ -432,9 +432,9 @@ static void test_math_fft_512_2ch(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 512 * 4 * 2, }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink1 = buffer_new(&test_buf_desc); - struct comp_buffer *sink2 = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink1 = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink2 = buffer_new(&test_buf_desc, false); struct icomplex32 *out1 = (struct icomplex32 *)sink1->stream.addr; struct icomplex32 *out2 = (struct icomplex32 *)sink2->stream.addr; uint32_t fft_size = 512; @@ -625,8 +625,8 @@ static void test_math_fft_256_16(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 256 * 2 * sizeof(int16_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex16 *out = (struct icomplex16 *)sink->stream.addr; int16_t *in = (int16_t *)source->stream.addr; int fft_size = 256; @@ -667,8 +667,8 @@ static void test_math_fft_512_16(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 512 * 2 * sizeof(int16_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex16 *out = (struct icomplex16 *)sink->stream.addr; int16_t *in = (int16_t *)source->stream.addr; int fft_size = 512; @@ -709,8 +709,8 @@ static void test_math_fft_1024_16(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 1024 * 2 * sizeof(int16_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex16 *out = (struct icomplex16 *)sink->stream.addr; int16_t *in = (int16_t *)source->stream.addr; int fft_size = 1024; @@ -751,9 +751,9 @@ static void test_math_fft_1024_ifft_16(void **state) struct sof_ipc_buffer test_buf_desc = { .size = 1024 * 2 * sizeof(int16_t), }; - struct comp_buffer *source = buffer_new(&test_buf_desc); - struct comp_buffer *intm = buffer_new(&test_buf_desc); - struct comp_buffer *sink = buffer_new(&test_buf_desc); + struct comp_buffer *source = buffer_new(&test_buf_desc, false); + struct comp_buffer *intm = buffer_new(&test_buf_desc, false); + struct comp_buffer *sink = buffer_new(&test_buf_desc, false); struct icomplex16 *out = (struct icomplex16 *)sink->stream.addr; float db; int64_t signal = 0; diff --git a/test/cmocka/src/util.h b/test/cmocka/src/util.h index be540359395c..5ef231ceba64 100644 --- a/test/cmocka/src/util.h +++ b/test/cmocka/src/util.h @@ -23,7 +23,7 @@ static inline struct comp_buffer *create_test_sink(struct comp_dev *dev, }, .size = buffer_size, }; - struct comp_buffer *buffer = buffer_new(&desc); + struct comp_buffer *buffer = buffer_new(&desc, false); memset(buffer->stream.addr, 0, buffer_size); @@ -58,7 +58,7 @@ static inline struct comp_buffer *create_test_source(struct comp_dev *dev, }, .size = buffer_size, }; - struct comp_buffer *buffer = buffer_new(&desc); + struct comp_buffer *buffer = buffer_new(&desc, false); memset(buffer->stream.addr, 0, buffer_size); From aaebb2563b5afccf4d30b2dc6136db07cf003f4c Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Mon, 4 Sep 2023 10:35:49 +0200 Subject: [PATCH 340/639] sparse: add a debug core check for shared structures to verify that shared structures are used in a proper way a debug check is introduced If compiled with COHERENT_CHECK_NONSHARED_CORES flag each usage of shared structures will be verified against proper memory alias usage Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/buffer.c | 14 ++++++++++++++ src/include/sof/audio/buffer.h | 2 ++ src/include/sof/coherent.h | 14 ++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/audio/buffer.c b/src/audio/buffer.c index a6da20dea456..e90227593cab 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -53,6 +53,8 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u return NULL; } + CORE_CHECK_STRUCT_INIT(buffer, is_shared); + buffer->is_shared = is_shared; stream_addr = rballoc_align(0, caps, size, align); if (!stream_addr) { @@ -81,6 +83,7 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u void buffer_zero(struct comp_buffer __sparse_cache *buffer) { buf_dbg(buffer, "stream_zero()"); + CORE_CHECK_STRUCT(buffer); bzero(audio_stream_get_addr(&buffer->stream), audio_stream_get_size(&buffer->stream)); if (buffer->caps & SOF_MEM_CAPS_DMA) @@ -93,6 +96,8 @@ int buffer_set_size(struct comp_buffer __sparse_cache *buffer, uint32_t size, ui { void *new_ptr = NULL; + CORE_CHECK_STRUCT(buffer); + /* validate request */ if (size == 0) { buf_err(buffer, "resize size = %u is invalid", size); @@ -131,6 +136,8 @@ int buffer_set_params(struct comp_buffer __sparse_cache *buffer, int ret; int i; + CORE_CHECK_STRUCT(buffer); + if (!params) { buf_err(buffer, "buffer_set_params(): !params"); return -EINVAL; @@ -158,6 +165,7 @@ bool buffer_params_match(struct comp_buffer __sparse_cache *buffer, struct sof_ipc_stream_params *params, uint32_t flag) { assert(params); + CORE_CHECK_STRUCT(buffer); if ((flag & BUFF_PARAMS_FRAME_FMT) && audio_stream_get_frm_fmt(&buffer->stream) != params->frame_fmt) @@ -181,6 +189,8 @@ void buffer_free(struct comp_buffer *buffer) .buffer = buffer, }; + CORE_CHECK_STRUCT(buffer); + if (!buffer) return; @@ -255,6 +265,8 @@ void comp_update_buffer_consume(struct comp_buffer __sparse_cache *buffer, uint3 .transaction_begin_address = audio_stream_get_rptr(&buffer->stream), }; + CORE_CHECK_STRUCT(buffer); + /* return if no bytes */ if (!bytes) { #if CONFIG_SOF_LOG_DBG_BUFFER @@ -293,6 +305,7 @@ void comp_update_buffer_consume(struct comp_buffer __sparse_cache *buffer, uint3 void buffer_attach(struct comp_buffer *buffer, struct list_item *head, int dir) { struct list_item *list = buffer_comp_list(buffer, dir); + CORE_CHECK_STRUCT(buffer); list_item_prepend(list, head); } @@ -303,5 +316,6 @@ void buffer_attach(struct comp_buffer *buffer, struct list_item *head, int dir) void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir) { struct list_item *buf_list = buffer_comp_list(buffer, dir); + CORE_CHECK_STRUCT(buffer); list_item_del(buf_list); } diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 4238c902dfdf..51a505b209cf 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -134,6 +134,8 @@ extern struct tr_ctx buffer_tr; */ struct comp_buffer { /* data buffer */ + CORE_CHECK_STRUCT_FIELD; + struct audio_stream stream; /* configuration */ diff --git a/src/include/sof/coherent.h b/src/include/sof/coherent.h index 4ca5120cfee9..8e06fb466a66 100644 --- a/src/include/sof/coherent.h +++ b/src/include/sof/coherent.h @@ -80,9 +80,23 @@ struct coherent { /* debug sharing amongst cores */ #ifdef COHERENT_CHECK_NONSHARED_CORES + +#define CORE_CHECK_STRUCT_FIELD uint32_t __core; bool __is_shared +#define CORE_CHECK_STRUCT_INIT(_c, is_shared) { (_c)->__core = cpu_get_id(); \ + (_c)->__is_shared = is_shared; } +#define CORE_CHECK_STRUCT(_c) { assert(!!(_c)->__is_shared == !!is_uncached(_c)); \ + assert(cpu_get_id() == (_c)->__core || (_c)->__is_shared); } + #define CHECK_COHERENT_CORE(_c) assert((_c)->core == cpu_get_id()) + #else + +#define CORE_CHECK_STRUCT_FIELD +#define CORE_CHECK_STRUCT_INIT(_c, is_shared) +#define CORE_CHECK_STRUCT(_c) + #define CHECK_COHERENT_CORE(_c) + #endif #ifdef __ZEPHYR__ From 94ebaa31669ee2fdd9a546c0c565dd25547dc92e Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 7 Sep 2023 10:00:14 +0200 Subject: [PATCH 341/639] sparse: remove notifier cache/uncache conversions as buffer pointer now is not swapping between cached and uncached aliases, there's no need to convert pointers in notifier events Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/buffer.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/src/audio/buffer.c b/src/audio/buffer.c index e90227593cab..32ade5781c0b 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -206,18 +206,6 @@ void buffer_free(struct comp_buffer *buffer) coherent_free_thread(buffer, c); } -/* - * comp_update_buffer_produce() and comp_update_buffer_consume() send - * NOTIFIER_ID_BUFFER_PRODUCE and NOTIFIER_ID_BUFFER_CONSUME notifier events - * respectively. The only recipient of those notifications is probes. The - * target for those notifications is always the current core, therefore notifier - * callbacks will be called synchronously from notifier_event() calls. Therefore - * we cannot pass unlocked buffer pointers to probes, because if they try to - * acquire the buffer, that can cause a deadlock. In general locked objects - * shouldn't be passed to potentially asynchronous contexts, but here we have no - * choice but to use our knowledge of the local notifier behaviour and pass - * locked buffers to notification recipients. - */ void comp_update_buffer_produce(struct comp_buffer __sparse_cache *buffer, uint32_t bytes) { struct buffer_cb_transact cb_data = { @@ -240,8 +228,7 @@ void comp_update_buffer_produce(struct comp_buffer __sparse_cache *buffer, uint3 audio_stream_produce(&buffer->stream, bytes); - /* Notifier looks for the pointer value to match it against registration */ - notifier_event(cache_to_uncache(buffer), NOTIFIER_ID_BUFFER_PRODUCE, + notifier_event((__sparse_force void *)buffer, NOTIFIER_ID_BUFFER_PRODUCE, NOTIFIER_TARGET_CORE_LOCAL, &cb_data, sizeof(cb_data)); #if CONFIG_SOF_LOG_DBG_BUFFER @@ -281,7 +268,7 @@ void comp_update_buffer_consume(struct comp_buffer __sparse_cache *buffer, uint3 audio_stream_consume(&buffer->stream, bytes); - notifier_event(cache_to_uncache(buffer), NOTIFIER_ID_BUFFER_CONSUME, + notifier_event((__sparse_force void *)buffer, NOTIFIER_ID_BUFFER_CONSUME, NOTIFIER_TARGET_CORE_LOCAL, &cb_data, sizeof(cb_data)); #if CONFIG_SOF_LOG_DBG_BUFFER From 84809f9606e51f59805ffb4eb7c29b7dfca00a71 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 13 Jun 2023 16:36:11 +0300 Subject: [PATCH 342/639] Tools: Topology2: Add Multiband-DRC This patch adds the topology2 files for multiband-DRC. The EFX processing chain is gain - IIR - FIR - DRC or Multiband-DRC. The DRC selection is done with macro EFX_DRC_COMPONENT and values "singleband" and "multiband". The multiband-drc has two ALSA controls, bytes and switch. The switch control switches the processing on and off. The generated topology files with multiband-drc are: sof-hda-efx-mbdrc-generic.tplg sof-hda-efx-mbdrc-generic-2ch.tplg sof-hda-efx-mbdrc-generic-4cg.tplg The topology files with DRC are as before: sof-hda-efx-mbdrc-generic.tplg sof-hda-efx-mbdrc-generic-2ch.tplg sof-hda-efx-mbdrc-generic-4cg.tplg The configuration blob default is updated to what is generated by the current example_multiband_drc.m configuration script. The pass-through blob is set as default for tplg2. The topology 1 blobs are updated similarly. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/cavs-mixin-mixout-efx-hda.conf | 165 +++++++++++----- .../topology2/development/tplg-targets.cmake | 16 ++ .../include/components/multiband_drc.conf | 85 +++++++++ .../components/multiband_drc/default.conf | 82 ++++++++ .../components/multiband_drc/passthrough.conf | 71 +++++++ .../mixout-gain-efx-dai-copier-playback.conf | 2 +- ...ut-gain-efx-mbdrc-dai-copier-playback.conf | 176 ++++++++++++++++++ .../topology2/platform/intel/efx-default.conf | 2 + tools/topology/topology2/sof-hda-generic.conf | 1 + 9 files changed, 550 insertions(+), 50 deletions(-) create mode 100644 tools/topology/topology2/include/components/multiband_drc.conf create mode 100644 tools/topology/topology2/include/components/multiband_drc/default.conf create mode 100644 tools/topology/topology2/include/components/multiband_drc/passthrough.conf create mode 100644 tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf diff --git a/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf b/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf index 076191afd289..2ce8e2fa2cbd 100644 --- a/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf +++ b/tools/topology/topology2/cavs-mixin-mixout-efx-hda.conf @@ -28,38 +28,81 @@ Object.Dai.HDA [ ] Object.Pipeline { - mixout-gain-efx-dai-copier-playback [ - { - index 2 + IncludeByKey.EFX_DRC_COMPONENT { + "singleband" { + mixout-gain-efx-dai-copier-playback [ + { + index 2 - Object.Widget.dai-copier.1 { - node_type $HDA_LINK_OUTPUT_CLASS - stream_name $HDA_ANALOG_DAI_NAME - dai_type "HDA" - copier_type "HDA" - } - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume' - } - } - Object.Widget.eqiir.1 { - Object.Control.bytes."1" { - name 'Post Mixer $ANALOG_PLAYBACK_PCM IIR Eq' - } - } - Object.Widget.eqfir.1 { - Object.Control.bytes."1" { - name 'Post Mixer $ANALOG_PLAYBACK_PCM FIR Eq' - } - } - Object.Widget.drc.1 { - Object.Control.bytes."1" { - name '2 Main playback DRC' - } - } - } - ] + Object.Widget.dai-copier.1 { + node_type $HDA_LINK_OUTPUT_CLASS + stream_name $HDA_ANALOG_DAI_NAME + dai_type "HDA" + copier_type "HDA" + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume' + } + } + Object.Widget.eqiir.1 { + Object.Control.bytes."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM IIR Eq' + } + } + Object.Widget.eqfir.1 { + Object.Control.bytes."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM FIR Eq' + } + } + Object.Widget.drc.1 { + Object.Control.bytes."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM DRC' + } + } + } + ] + } + "multiband" { + mixout-gain-efx-mbdrc-dai-copier-playback [ + { + index 2 + + Object.Widget.dai-copier.1 { + node_type $HDA_LINK_OUTPUT_CLASS + stream_name $HDA_ANALOG_DAI_NAME + dai_type "HDA" + copier_type "HDA" + } + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume' + } + } + Object.Widget.eqiir.1 { + Object.Control.bytes."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM IIR Eq' + } + } + Object.Widget.eqfir.1 { + Object.Control.bytes."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM FIR Eq' + } + } + Object.Widget.multiband_drc.1 { + Object.Control { + bytes."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM MBDRC bytes' + } + mixer."1" { + name 'Post Mixer $ANALOG_PLAYBACK_PCM MBDRC switch' + } + } + } + } + ] + } + } host-copier-gain-mixin-playback [ { @@ -140,21 +183,45 @@ Object.PCM.pcm [ ] # top-level pipeline connections -Object.Base.route [ - { - sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' - source 'drc.2.1' - } - { - source 'mixin.1.1' - sink 'mixout.2.1' - } - { - source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' - sink 'host-copier.0.capture' - } - { - source 'host-copier.0.playback' - sink 'gain.1.1' - } -] +IncludeByKey.EFX_DRC_COMPONENT { + "singleband" { + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'drc.2.1' + } + { + source 'mixin.1.1' + sink 'mixout.2.1' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'host-copier.0.capture' + } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } + ] + } + "multiband" { + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'multiband_drc.2.1' + } + { + source 'mixin.1.1' + sink 'mixout.2.1' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'host-copier.0.capture' + } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } + ] + } +} diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index a2245db252a3..27e9aab73f7b 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -81,6 +81,22 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-efx-generic-4ch.bin,USE_CHAIN_DMA= DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\ EFX_DRC_PARAMS=passthrough" +"sof-hda-generic\;sof-hda-efx-mbdrc-generic\;\ +HDA_CONFIG=efx,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100,\ +EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\ +EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough" + +"sof-hda-generic\;sof-hda-efx-mbdrc-generic-2ch\;\ +HDA_CONFIG=efx,NUM_DMICS=2,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-fir-generic-2ch.bin,\ +USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\ +EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough" + +"sof-hda-generic\;sof-hda-efx-mbdrc-generic-4ch\;\ +HDA_CONFIG=efx,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-hda-efx-generic-4ch.bin,USE_CHAIN_DMA=true,\ +DEEPBUFFER_FW_DMA_MS=100,EFX_FIR_PARAMS=passthrough,EFX_IIR_PARAMS=passthrough,\ +EFX_DRC_COMPONENT=multiband,EFX_MBDRC_PARAMS=passthrough" + # CAVS HDA topology with gain and SRC before mixin for HDA and passthrough pipelines for HDMI "sof-hda-generic\;sof-hda-src-generic\;HDA_CONFIG=src,USE_CHAIN_DMA=true,DEEPBUFFER_FW_DMA_MS=100" diff --git a/tools/topology/topology2/include/components/multiband_drc.conf b/tools/topology/topology2/include/components/multiband_drc.conf new file mode 100644 index 000000000000..d363e930e77b --- /dev/null +++ b/tools/topology/topology2/include/components/multiband_drc.conf @@ -0,0 +1,85 @@ +# +# +# A generic MULTIBAND_DRC component. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.multiband_drc.attribute_name" +# +# Usage: this component can be used by declaring in the parent object. i.e. +# +# Object.Widget.multiband_drc."N" { +# index 1 +# } +# } + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Widget."multiband_drc" { + # + # Pipeline ID + # + DefineAttribute."index" { + type "integer" + } + + # + # Unique instance for MULTIBAND_DRC widget + # + DefineAttribute."instance" { + type "integer" + } + + # Include common widget attributes definition + <include/components/widget-common.conf> + + attributes { + !constructor [ + "index" + "instance" + ] + !mandatory [ + "num_input_pins" + "num_output_pins" + "num_input_audio_formats" + "num_output_audio_formats" + ] + + !immutable [ + "uuid" + "type" + ] + !deprecated [ + "preload_count" + ] + unique "instance" + } + + # + # multiband_drc widget switch control + # + Object.Control { + mixer."1" { + Object.Base.channel.1 { + name "fc" + shift 0 + } + Object.Base.ops.1 { + name "ctl" + info "volsw" + #259 binds the mixer control to switch get/put handlers + get 259 + put 259 + } + max 1 + } + } + + # + # Default attributes for multiband_drc + # + + uuid "56:22:9f:0d:4f:8e:b3:47:84:48:23:9a:33:4f:11:91" + type "effect" + no_pm "true" + num_input_pins 1 + num_output_pins 1 +} diff --git a/tools/topology/topology2/include/components/multiband_drc/default.conf b/tools/topology/topology2/include/components/multiband_drc/default.conf new file mode 100644 index 000000000000..e42467528301 --- /dev/null +++ b/tools/topology/topology2/include/components/multiband_drc/default.conf @@ -0,0 +1,82 @@ +# Exported with script example_multiband_drc.m 01-Sep-2023 +Object.Base.data."multiband_drc_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x4c,0x02,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x4c,0x02,0x00,0x00,0x03,0x00,0x00,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x7b,0x8e,0x88,0xfe, + 0x36,0x79,0x57,0x17,0x5f,0x19,0x6f,0x06, + 0xe8,0x79,0x67,0xd4,0x00,0x00,0x00,0x40, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x5f,0x6d,0x19,0xe7,0x39,0xc4,0xd4,0x50, + 0x0c,0x9b,0x09,0x24,0xad,0x76,0x82,0x9f, + 0x00,0x00,0x00,0x40,0xff,0xff,0xff,0xff, + 0x43,0x72,0x00,0x00,0xa1,0xe6,0x90,0xf9, + 0x18,0x86,0x98,0x2b,0xe3,0x32,0xef,0x00, + 0x4b,0xf7,0x20,0xf1,0x18,0x69,0xc6,0x28, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0xf4,0x64,0xf6,0xdb,0x53,0x89,0x7d,0x60, + 0x5c,0x14,0xf2,0x0a,0x84,0x0d,0x78,0xdc, + 0xda,0xef,0x21,0x1c,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x6f,0x82,0x53,0xc2, + 0x3e,0x77,0xa1,0x7d,0x95,0xc1,0x02,0x00, + 0x2a,0x83,0x05,0x00,0x95,0xc1,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x6f,0x82,0x53,0xc2,0x3e,0x77,0xa1,0x7d, + 0x34,0x7d,0xd3,0x3e,0x99,0x05,0x59,0x82, + 0x34,0x7d,0xd3,0x3e,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x2d,0x3a,0xcd,0xd3, + 0xc0,0xf5,0x82,0x68,0x05,0xf4,0xeb,0x00, + 0x0a,0xe8,0xd7,0x01,0x05,0xf4,0xeb,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x2d,0x3a,0xcd,0xd3,0xc0,0xf5,0x82,0x68, + 0xe5,0x6e,0x2d,0x35,0x36,0x22,0xa5,0x95, + 0xe5,0x6e,0x2d,0x35,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x2d,0x3a,0xcd,0xd3, + 0xc0,0xf5,0x82,0x68,0x05,0xf4,0xeb,0x00, + 0x0a,0xe8,0xd7,0x01,0x05,0xf4,0xeb,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x2d,0x3a,0xcd,0xd3,0xc0,0xf5,0x82,0x68, + 0xe5,0x6e,0x2d,0x35,0x36,0x22,0xa5,0x95, + 0xe5,0x6e,0x2d,0x35,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e, + 0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00, + 0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05, + 0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00, + 0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01, + 0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01, + 0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff, + 0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00, + 0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00, + 0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00, + 0x5b,0x91,0x00,0x00,0x02,0x00,0x00,0x00, + 0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e, + 0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00, + 0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05, + 0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00, + 0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01, + 0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01, + 0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff, + 0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00, + 0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00, + 0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00, + 0x5b,0x91,0x00,0x00,0x03,0x00,0x00,0x00, + 0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e, + 0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00, + 0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05, + 0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00, + 0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01, + 0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01, + 0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff, + 0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00, + 0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00, + 0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00, + 0x5b,0x91,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/multiband_drc/passthrough.conf b/tools/topology/topology2/include/components/multiband_drc/passthrough.conf new file mode 100644 index 000000000000..09cb3c4f4ac8 --- /dev/null +++ b/tools/topology/topology2/include/components/multiband_drc/passthrough.conf @@ -0,0 +1,71 @@ +# Exported with script example_multiband_drc.m 01-Sep-2023 +Object.Base.data."multiband_drc_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0xf4,0x01,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf4,0x01,0x00,0x00,0x02,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x7b,0x8e,0x88,0xfe, + 0x36,0x79,0x57,0x17,0x5f,0x19,0x6f,0x06, + 0xe8,0x79,0x67,0xd4,0x00,0x00,0x00,0x40, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x5f,0x6d,0x19,0xe7,0x39,0xc4,0xd4,0x50, + 0x0c,0x9b,0x09,0x24,0xad,0x76,0x82,0x9f, + 0x00,0x00,0x00,0x40,0xff,0xff,0xff,0xff, + 0x43,0x72,0x00,0x00,0xa1,0xe6,0x90,0xf9, + 0x18,0x86,0x98,0x2b,0xe3,0x32,0xef,0x00, + 0x4b,0xf7,0x20,0xf1,0x18,0x69,0xc6,0x28, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0xf4,0x64,0xf6,0xdb,0x53,0x89,0x7d,0x60, + 0x5c,0x14,0xf2,0x0a,0x84,0x0d,0x78,0xdc, + 0xda,0xef,0x21,0x1c,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x6f,0x82,0x53,0xc2, + 0x3e,0x77,0xa1,0x7d,0x95,0xc1,0x02,0x00, + 0x2a,0x83,0x05,0x00,0x95,0xc1,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x6f,0x82,0x53,0xc2,0x3e,0x77,0xa1,0x7d, + 0x34,0x7d,0xd3,0x3e,0x99,0x05,0x59,0x82, + 0x34,0x7d,0xd3,0x3e,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e, + 0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00, + 0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05, + 0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00, + 0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01, + 0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01, + 0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff, + 0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00, + 0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00, + 0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00, + 0x5b,0x91,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0xe8,0x00,0x00,0x00,0x1e, + 0x00,0x00,0x00,0x0c,0xd3,0x4d,0x62,0x00, + 0xb1,0xc2,0x09,0x04,0x55,0x55,0x55,0x05, + 0x50,0xfa,0x1e,0x00,0x55,0x60,0x94,0x00, + 0x7e,0x98,0x6a,0xff,0x83,0xc9,0xfe,0x01, + 0x64,0x47,0x47,0x22,0x17,0x56,0x74,0x01, + 0x1c,0xc7,0x71,0x00,0x77,0x77,0x77,0xff, + 0xd8,0x77,0x1f,0x00,0x05,0x00,0x00,0x00, + 0x00,0x00,0x36,0x00,0xdf,0x97,0x03,0x00, + 0xe7,0x3e,0x1e,0x00,0xdf,0x97,0x07,0x00, + 0x5b,0x91,0x00,0x00" +} diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf index 93dc0e64c893..9d8c9eebad53 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf @@ -22,8 +22,8 @@ <include/components/mixout.conf> <include/components/pipeline.conf> <include/controls/bytes.conf> -<include/components/eqfir.conf> <include/components/eqiir.conf> +<include/components/eqfir.conf> <include/components/drc.conf> <platform/intel/efx-default.conf> diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf new file mode 100644 index 000000000000..876d8cf3c46f --- /dev/null +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf @@ -0,0 +1,176 @@ +# +# BE playback pipeline: mixout-gain-efx-mbdrc-dai-copier. +# +# All attributes defined herein are namespaced +# by alsatplg to "Object.Pipeline.mixout-gain-efx-mbdrc-dai-copier-playback.N.attribute_name" +# +# Usage: mixout-gain-efx-mbdrc-dai-copier-playback pipeline object can be instantiated as: +# +# Object.Pipeline.mixout-gain-efx-mbdrc-dai-copier-playback."N" { +# period 1000 +# time_domain "timer" +# channels 2 +# rate 48000 +# } +# +# Where N is the unique pipeline ID within the same alsaconf node. +# + +<include/common/audio_format.conf> +<include/components/dai-copier.conf> +<include/components/gain.conf> +<include/components/mixout.conf> +<include/components/pipeline.conf> +<include/controls/bytes.conf> +<include/components/eqiir.conf> +<include/components/eqfir.conf> +<include/components/multiband_drc.conf> +<platform/intel/efx-default.conf> + +Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { + + DefineAttribute."index" {} + + <include/pipelines/pipeline-common.conf> + + attributes { + !constructor [ + "index" + ] + + !immutable [ + "direction" + ] + + # + # mixout-gain-efx-mbdrc-dai-copier-playback objects instantiated within the same alsaconf node must have + # unique instance attribute + # + unique "instance" + } + + Object.Widget { + mixout."1" {} + dai-copier."1" { + type dai_in + num_input_audio_formats 1 + num_output_audio_formats 1 + num_input_pins 1 + + # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + gain."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + eqiir."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + Object.Control.bytes."1" { + IncludeByKey.EFX_IIR_PARAMS { + "passthrough" "include/components/eqiir/passthrough.conf" + } + } + } + eqfir."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + + Object.Control.bytes."1" { + IncludeByKey.EFX_FIR_PARAMS { + "passthrough" "include/components/eqfir/passthrough.conf" + } + } + } + multiband_drc."1" { + num_input_audio_formats 1 + num_output_audio_formats 1 + + Object.Base.audio_format.1 { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + + Object.Control.bytes."1" { + IncludeByKey.EFX_MBDRC_PARAMS { + "passthrough" "include/components/multiband_drc/passthrough.conf" + "default" "include/components/multiband_drc/default.conf" + } + } + } + pipeline."1" { + priority 0 + lp_mode 0 + } + } + + Object.Base { + route.1 { + source mixout..1 + sink gain..1 + } + route.2 { + source gain..1 + sink eqiir..1 + } + route.3 { + source eqiir..1 + sink eqfir..1 + } + route.4 { + source eqfir..1 + sink multiband_drc..1 + } + } + + direction "playback" + dynamic_pipeline 1 + time_domain "timer" + channels 2 + channels_min 2 + channels_max 2 + rate 48000 + rate_min 48000 + rate_max 48000 +} diff --git a/tools/topology/topology2/platform/intel/efx-default.conf b/tools/topology/topology2/platform/intel/efx-default.conf index ed9304b4c062..6a152e68a1ef 100644 --- a/tools/topology/topology2/platform/intel/efx-default.conf +++ b/tools/topology/topology2/platform/intel/efx-default.conf @@ -3,4 +3,6 @@ Define { EFX_IIR_PARAMS 'passthrough' EFX_CROSSOVER_PARAMS '2way' EFX_DRC_PARAMS 'passthrough' + EFX_MBDRC_PARAMS 'passthrough' + EFX_DRC_COMPONENT 'singleband' } diff --git a/tools/topology/topology2/sof-hda-generic.conf b/tools/topology/topology2/sof-hda-generic.conf index 1bd06bff796f..260cadb924bc 100644 --- a/tools/topology/topology2/sof-hda-generic.conf +++ b/tools/topology/topology2/sof-hda-generic.conf @@ -17,6 +17,7 @@ <mixout-gain-dai-copier-playback.conf> <mixout-aria-gain-mixin-playback.conf> <mixout-gain-efx-dai-copier-playback.conf> +<mixout-gain-efx-mbdrc-dai-copier-playback.conf> <mixout-gain-host-copier-capture.conf> <dai-copier-eqiir-module-copier-capture.conf> <gain-capture.conf> From fc9fe6c043be53f23b0b265b6d888cfa2895fa48 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 6 Sep 2023 14:28:04 +0200 Subject: [PATCH 343/639] sparse: remove all sparse_cache from buffer related structs struct audio_stream __sparse_cache => struct audio_stream struct comp_buffer __sparse_cache => struct comp_buffer struct sof_source __sparse_cache => struct sof_source struct sof_sink __sparse_cache => struct sof_sinkurce this commit is 100% generated by editor find/replace + one cosmetic change (intent correction to make checkpatch happy) Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/aria/aria.c | 10 +- src/audio/aria/aria_generic.c | 4 +- src/audio/aria/aria_hifi3.c | 6 +- src/audio/asrc/asrc.c | 24 +-- src/audio/audio_stream.c | 78 +++++----- src/audio/buffer.c | 14 +- src/audio/chain_dma.c | 4 +- src/audio/component.c | 20 +-- src/audio/copier/copier.c | 26 ++-- src/audio/copier/copier_dai.c | 10 +- src/audio/copier/copier_generic.c | 6 +- src/audio/copier/copier_hifi.c | 2 +- src/audio/copier/copier_host.c | 2 +- src/audio/copier/copier_ipcgtw.c | 10 +- src/audio/crossover/crossover.c | 14 +- src/audio/crossover/crossover_generic.c | 20 +-- src/audio/dai-legacy.c | 18 +-- src/audio/dai-zephyr.c | 30 ++-- src/audio/dcblock/dcblock.c | 16 +- src/audio/dcblock/dcblock_generic.c | 12 +- src/audio/dcblock/dcblock_hifi3.c | 14 +- src/audio/dcblock/dcblock_hifi4.c | 16 +- src/audio/drc/drc.c | 16 +- src/audio/drc/drc_generic.c | 28 ++-- src/audio/eq_fir/eq_fir.c | 18 +-- src/audio/eq_fir/eq_fir_generic.c | 12 +- src/audio/eq_fir/eq_fir_hifi2ep.c | 12 +- src/audio/eq_fir/eq_fir_hifi3.c | 12 +- src/audio/eq_iir/eq_iir.c | 50 +++--- src/audio/google/google_hotword_detect.c | 6 +- .../google/google_rtc_audio_processing.c | 8 +- src/audio/host-legacy.c | 18 +-- src/audio/host-zephyr.c | 22 +-- src/audio/igo_nr/igo_nr.c | 20 +-- src/audio/kpb.c | 86 +++++------ src/audio/mfcc/mfcc.c | 12 +- src/audio/mfcc/mfcc_common.c | 2 +- src/audio/mfcc/mfcc_generic.c | 2 +- src/audio/mfcc/mfcc_hifi3.c | 2 +- src/audio/mfcc/mfcc_hifi4.c | 2 +- src/audio/mixer/mixer.c | 14 +- src/audio/mixer/mixer_generic.c | 12 +- src/audio/mixer/mixer_hifi3.c | 12 +- src/audio/mixin_mixout/mixin_mixout.c | 46 +++--- src/audio/mixin_mixout/mixin_mixout_generic.c | 16 +- src/audio/mixin_mixout/mixin_mixout_hifi3.c | 16 +- src/audio/module_adapter/module/cadence.c | 6 +- src/audio/module_adapter/module/dts/dts.c | 8 +- src/audio/module_adapter/module/generic.c | 8 +- src/audio/module_adapter/module/modules.c | 4 +- src/audio/module_adapter/module/passthrough.c | 4 +- src/audio/module_adapter/module/waves/waves.c | 16 +- src/audio/module_adapter/module_adapter.c | 70 ++++----- src/audio/multiband_drc/multiband_drc.c | 16 +- .../multiband_drc/multiband_drc_generic.c | 16 +- src/audio/mux/mux.c | 30 ++-- src/audio/mux/mux_generic.c | 62 ++++---- src/audio/pcm_converter/pcm_converter.c | 4 +- .../pcm_converter/pcm_converter_generic.c | 100 ++++++------ src/audio/pcm_converter/pcm_converter_hifi3.c | 84 +++++------ src/audio/pipeline/pipeline-graph.c | 4 +- src/audio/pipeline/pipeline-params.c | 6 +- src/audio/rtnr/rtnr.c | 8 +- src/audio/selector/selector.c | 20 +-- src/audio/selector/selector_generic.c | 24 +-- src/audio/sink_api_helper.c | 48 +++--- src/audio/sink_source_utils.c | 4 +- src/audio/smart_amp/smart_amp.c | 20 +-- src/audio/smart_amp/smart_amp_generic.c | 36 ++--- src/audio/smart_amp/smart_amp_maxim_dsm.c | 12 +- src/audio/source_api_helper.c | 46 +++--- src/audio/src/src.c | 54 +++---- src/audio/tdfb/tdfb.c | 14 +- src/audio/tdfb/tdfb_generic.c | 12 +- src/audio/tdfb/tdfb_hifi3.c | 12 +- src/audio/tdfb/tdfb_hifiep.c | 12 +- src/audio/tone.c | 8 +- src/audio/up_down_mixer/up_down_mixer.c | 4 +- src/audio/volume/volume.c | 18 +-- src/audio/volume/volume.h | 4 +- src/audio/volume/volume_generic.c | 24 +-- .../volume/volume_generic_with_peakvol.c | 24 +-- src/audio/volume/volume_hifi3.c | 24 +-- src/audio/volume/volume_hifi3_with_peakvol.c | 24 +-- src/audio/volume/volume_hifi4.c | 24 +-- src/audio/volume/volume_hifi4_with_peakvol.c | 24 +-- src/audio/volume/volume_ipc3.c | 2 +- src/audio/volume/volume_ipc4.c | 2 +- src/include/ipc4/base-config.h | 2 +- src/include/ipc4/copier.h | 2 +- src/include/ipc4/mixin_mixout.h | 6 +- src/include/sof/audio/aria/aria.h | 4 +- src/include/sof/audio/audio_stream.h | 142 +++++++++--------- src/include/sof/audio/buffer.h | 33 ++-- src/include/sof/audio/component.h | 16 +- src/include/sof/audio/dcblock/dcblock.h | 4 +- src/include/sof/audio/drc/drc.h | 8 +- src/include/sof/audio/igo_nr/igo_nr_comp.h | 4 +- src/include/sof/audio/mixer.h | 10 +- .../sof/audio/module_adapter/module/generic.h | 16 +- .../module_adapter/module/module_interface.h | 12 +- .../sof/audio/multiband_drc/multiband_drc.h | 4 +- src/include/sof/audio/mux.h | 8 +- src/include/sof/audio/pcm_converter.h | 8 +- src/include/sof/audio/pipeline.h | 2 +- src/include/sof/audio/selector.h | 4 +- src/include/sof/audio/sink_api.h | 46 +++--- .../sof/audio/sink_api_implementation.h | 14 +- src/include/sof/audio/sink_source_utils.h | 4 +- src/include/sof/audio/smart_amp/smart_amp.h | 14 +- src/include/sof/audio/source_api.h | 44 +++--- .../sof/audio/source_api_implementation.h | 14 +- src/include/sof/math/fir_hifi3.h | 2 +- src/ipc/ipc-helper.c | 8 +- src/ipc/ipc3/dai.c | 2 +- src/ipc/ipc3/helper.c | 2 +- src/ipc/ipc4/helper.c | 10 +- src/lib/dma.c | 18 +-- src/probe/probe.c | 4 +- src/samples/audio/detect_test.c | 8 +- src/samples/audio/kwd_nn_detect_test.c | 2 +- src/samples/audio/smart_amp_test_ipc3.c | 26 ++-- src/samples/audio/smart_amp_test_ipc4.c | 24 +-- xtos/include/sof/lib/dma.h | 16 +- 124 files changed, 1142 insertions(+), 1143 deletions(-) diff --git a/src/audio/aria/aria.c b/src/audio/aria/aria.c index 9d9c16c9c1d9..a20afc6e365f 100644 --- a/src/audio/aria/aria.c +++ b/src/audio/aria/aria.c @@ -72,8 +72,8 @@ static int aria_algo_init(struct aria_data *cd, void *buffer_desc, } static inline void aria_process_data(struct processing_module *mod, - struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + struct audio_stream *source, + struct audio_stream *sink, size_t frames) { struct aria_data *cd = module_get_private_data(mod); @@ -153,7 +153,7 @@ static int aria_free(struct processing_module *mod) static void aria_set_stream_params(struct comp_buffer *buffer, struct processing_module *mod) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; const struct ipc4_audio_format *audio_fmt = &mod->priv.cfg.base_cfg.audio_fmt; buffer_c = buffer_acquire(buffer); @@ -169,8 +169,8 @@ static void aria_set_stream_params(struct comp_buffer *buffer, } static int aria_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { int ret; struct comp_buffer *source, *sink; diff --git a/src/audio/aria/aria_generic.c b/src/audio/aria/aria_generic.c index cc0f90b2de2e..09daee86c5d9 100644 --- a/src/audio/aria/aria_generic.c +++ b/src/audio/aria/aria_generic.c @@ -20,7 +20,7 @@ const uint8_t INDEX_TAB[] = { }; inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx, - struct audio_stream __sparse_cache *source, int frames) + struct audio_stream *source, int frames) { int32_t max_data = 0; int32_t sample_abs; @@ -50,7 +50,7 @@ inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx, } void aria_algo_get_data(struct processing_module *mod, - struct audio_stream __sparse_cache *sink, int frames) + struct audio_stream *sink, int frames) { struct aria_data *cd = module_get_private_data(mod); int32_t step, in_sample; diff --git a/src/audio/aria/aria_hifi3.c b/src/audio/aria/aria_hifi3.c index 17e356b968bc..363ba583b0d3 100644 --- a/src/audio/aria/aria_hifi3.c +++ b/src/audio/aria/aria_hifi3.c @@ -21,7 +21,7 @@ const uint8_t INDEX_TAB[] = { }; inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx, - struct audio_stream __sparse_cache *source, int frames) + struct audio_stream *source, int frames) { /* detecting maximum value in data chunk */ ae_int32x2 in_sample; @@ -61,7 +61,7 @@ inline void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx, } void aria_algo_get_data_odd_channel(struct processing_module *mod, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, int frames) { struct aria_data *cd = module_get_private_data(mod); @@ -118,7 +118,7 @@ void aria_algo_get_data_odd_channel(struct processing_module *mod, } void aria_algo_get_data_even_channel(struct processing_module *mod, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, int frames) { struct aria_data *cd = module_get_private_data(mod); diff --git a/src/audio/asrc/asrc.c b/src/audio/asrc/asrc.c index 6f25e15129c5..dbefb7ba14c6 100644 --- a/src/audio/asrc/asrc.c +++ b/src/audio/asrc/asrc.c @@ -48,8 +48,8 @@ #define COEF_C2 Q_CONVERT_FLOAT(0.99, 30) typedef void (*asrc_proc_func)(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int *consumed, int *produced); @@ -122,8 +122,8 @@ static inline void src_inc_wrap_s16(int16_t **ptr, int16_t *end, size_t size) /* A fast copy function for same in and out rate */ static void src_copy_s32(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int *n_read, int *n_written) { struct comp_data *cd = comp_get_drvdata(dev); @@ -194,8 +194,8 @@ static void src_copy_s32(struct comp_dev *dev, } static void src_copy_s16(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int *n_read, int *n_written) { struct comp_data *cd = comp_get_drvdata(dev); @@ -534,7 +534,7 @@ static int asrc_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; int err; comp_info(dev, "asrc_params()"); @@ -604,7 +604,7 @@ static int asrc_params(struct comp_dev *dev, static int asrc_dai_find(struct comp_dev *dev, struct comp_data *cd) { struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; int pid; /* Get current pipeline ID and walk to find the DAI */ @@ -722,7 +722,7 @@ static int asrc_prepare(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; uint32_t source_period_bytes; uint32_t sink_period_bytes; int sample_bytes; @@ -978,8 +978,8 @@ static int asrc_control_loop(struct comp_dev *dev, struct comp_data *cd) return 0; } -static void asrc_process(struct comp_dev *dev, struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink) +static void asrc_process(struct comp_dev *dev, struct comp_buffer *source, + struct comp_buffer *sink) { struct comp_data *cd = comp_get_drvdata(dev); int consumed = 0; @@ -1005,7 +1005,7 @@ static int asrc_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *source, *sink; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; int frames_src; int frames_snk; int ret; diff --git a/src/audio/audio_stream.c b/src/audio/audio_stream.c index 96f02cff8b90..5fa8fa805c10 100644 --- a/src/audio/audio_stream.c +++ b/src/audio/audio_stream.c @@ -6,20 +6,20 @@ #include <sof/audio/audio_stream.h> #include <sof/audio/buffer.h> -static size_t audio_stream_get_free_size(struct sof_sink __sparse_cache *sink) +static size_t audio_stream_get_free_size(struct sof_sink *sink) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(sink, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(sink, struct audio_stream, sink_api, __sparse_cache); return audio_stream_get_free_bytes(audio_stream); } -static int audio_stream_get_buffer(struct sof_sink __sparse_cache *sink, size_t req_size, +static int audio_stream_get_buffer(struct sof_sink *sink, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(sink, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(sink, struct audio_stream, sink_api, __sparse_cache); if (req_size > audio_stream_get_free_size(sink)) @@ -32,13 +32,13 @@ static int audio_stream_get_buffer(struct sof_sink __sparse_cache *sink, size_t return 0; } -static int audio_stream_commit_buffer(struct sof_sink __sparse_cache *sink, size_t commit_size) +static int audio_stream_commit_buffer(struct sof_sink *sink, size_t commit_size) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(sink, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(sink, struct audio_stream, sink_api, __sparse_cache); - struct comp_buffer __sparse_cache *buffer_c = - attr_container_of(audio_stream, struct comp_buffer __sparse_cache, + struct comp_buffer *buffer_c = + attr_container_of(audio_stream, struct comp_buffer, stream, __sparse_cache); if (commit_size) { @@ -49,24 +49,24 @@ static int audio_stream_commit_buffer(struct sof_sink __sparse_cache *sink, size return 0; } -static size_t audio_stream_get_data_available(struct sof_source __sparse_cache *source) +static size_t audio_stream_get_data_available(struct sof_source *source) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(source, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(source, struct audio_stream, source_api, __sparse_cache); return audio_stream_get_avail_bytes(audio_stream); } -static int audio_stream_get_data(struct sof_source __sparse_cache *source, size_t req_size, +static int audio_stream_get_data(struct sof_source *source, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(source, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(source, struct audio_stream, source_api, __sparse_cache); - struct comp_buffer __sparse_cache *buffer_c = - attr_container_of(audio_stream, struct comp_buffer __sparse_cache, + struct comp_buffer *buffer_c = + attr_container_of(audio_stream, struct comp_buffer, stream, __sparse_cache); if (req_size > audio_stream_get_data_available(source)) @@ -81,10 +81,10 @@ static int audio_stream_get_data(struct sof_source __sparse_cache *source, size_ return 0; } -static int audio_stream_release_data(struct sof_source __sparse_cache *source, size_t free_size) +static int audio_stream_release_data(struct sof_source *source, size_t free_size) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(source, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(source, struct audio_stream, source_api, __sparse_cache); if (free_size) @@ -93,40 +93,40 @@ static int audio_stream_release_data(struct sof_source __sparse_cache *source, s return 0; } -static int audio_stream_set_ipc_params_source(struct sof_source __sparse_cache *source, +static int audio_stream_set_ipc_params_source(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(source, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(source, struct audio_stream, source_api, __sparse_cache); - struct comp_buffer __sparse_cache *buffer = - attr_container_of(audio_stream, struct comp_buffer __sparse_cache, + struct comp_buffer *buffer = + attr_container_of(audio_stream, struct comp_buffer, stream, __sparse_cache); return buffer_set_params(buffer, params, force_update); } -static int audio_stream_set_ipc_params_sink(struct sof_sink __sparse_cache *sink, +static int audio_stream_set_ipc_params_sink(struct sof_sink *sink, struct sof_ipc_stream_params *params, bool force_update) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(sink, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(sink, struct audio_stream, sink_api, __sparse_cache); - struct comp_buffer __sparse_cache *buffer = - attr_container_of(audio_stream, struct comp_buffer __sparse_cache, + struct comp_buffer *buffer = + attr_container_of(audio_stream, struct comp_buffer, stream, __sparse_cache); return buffer_set_params(buffer, params, force_update); } -static int audio_stream_source_set_alignment_constants(struct sof_source __sparse_cache *source, +static int audio_stream_source_set_alignment_constants(struct sof_source *source, const uint32_t byte_align, const uint32_t frame_align_req) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(source, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(source, struct audio_stream, source_api, __sparse_cache); audio_stream_init_alignment_constants(byte_align, frame_align_req, audio_stream); @@ -134,12 +134,12 @@ static int audio_stream_source_set_alignment_constants(struct sof_source __spars return 0; } -static int audio_stream_sink_set_alignment_constants(struct sof_sink __sparse_cache *sink, +static int audio_stream_sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_align, const uint32_t frame_align_req) { - struct audio_stream __sparse_cache *audio_stream = - attr_container_of(sink, struct audio_stream __sparse_cache, + struct audio_stream *audio_stream = + attr_container_of(sink, struct audio_stream, sink_api, __sparse_cache); audio_stream_init_alignment_constants(byte_align, frame_align_req, audio_stream); @@ -163,7 +163,7 @@ static const struct sink_ops audio_stream_sink_ops = { .set_alignment_constants = audio_stream_sink_set_alignment_constants }; -void audio_stream_init(struct audio_stream __sparse_cache *audio_stream, +void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint32_t size) { audio_stream->size = size; diff --git a/src/audio/buffer.c b/src/audio/buffer.c index 32ade5781c0b..a366592eab12 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -31,7 +31,7 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u bool is_shared) { struct comp_buffer *buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; void *stream_addr; tr_dbg(&buffer_tr, "buffer_alloc()"); @@ -80,7 +80,7 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u return buffer; } -void buffer_zero(struct comp_buffer __sparse_cache *buffer) +void buffer_zero(struct comp_buffer *buffer) { buf_dbg(buffer, "stream_zero()"); CORE_CHECK_STRUCT(buffer); @@ -92,7 +92,7 @@ void buffer_zero(struct comp_buffer __sparse_cache *buffer) audio_stream_get_size(&buffer->stream)); } -int buffer_set_size(struct comp_buffer __sparse_cache *buffer, uint32_t size, uint32_t alignment) +int buffer_set_size(struct comp_buffer *buffer, uint32_t size, uint32_t alignment) { void *new_ptr = NULL; @@ -130,7 +130,7 @@ int buffer_set_size(struct comp_buffer __sparse_cache *buffer, uint32_t size, ui return 0; } -int buffer_set_params(struct comp_buffer __sparse_cache *buffer, +int buffer_set_params(struct comp_buffer *buffer, struct sof_ipc_stream_params *params, bool force_update) { int ret; @@ -161,7 +161,7 @@ int buffer_set_params(struct comp_buffer __sparse_cache *buffer, return 0; } -bool buffer_params_match(struct comp_buffer __sparse_cache *buffer, +bool buffer_params_match(struct comp_buffer *buffer, struct sof_ipc_stream_params *params, uint32_t flag) { assert(params); @@ -206,7 +206,7 @@ void buffer_free(struct comp_buffer *buffer) coherent_free_thread(buffer, c); } -void comp_update_buffer_produce(struct comp_buffer __sparse_cache *buffer, uint32_t bytes) +void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes) { struct buffer_cb_transact cb_data = { .buffer = buffer, @@ -244,7 +244,7 @@ void comp_update_buffer_produce(struct comp_buffer __sparse_cache *buffer, uint3 #endif } -void comp_update_buffer_consume(struct comp_buffer __sparse_cache *buffer, uint32_t bytes) +void comp_update_buffer_consume(struct comp_buffer *buffer, uint32_t bytes) { struct buffer_cb_transact cb_data = { .buffer = buffer, diff --git a/src/audio/chain_dma.c b/src/audio/chain_dma.c index f2fbf3cdbfbb..41c28fa0c3e0 100644 --- a/src/audio/chain_dma.c +++ b/src/audio/chain_dma.c @@ -238,7 +238,7 @@ static enum task_state chain_task_run(void *data) * mode task will update read position based on transferred data size to avoid * overwriting valid data and write position by half buffer size. */ - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(cd->dma_buffer); + struct comp_buffer *buffer_c = buffer_acquire(cd->dma_buffer); const size_t buff_size = audio_stream_get_size(&buffer_c->stream); const size_t half_buff_size = buff_size / 2; @@ -510,7 +510,7 @@ static int chain_task_init(struct comp_dev *dev, uint8_t host_dma_id, uint8_t li uint32_t fifo_size) { struct chain_dma_data *cd = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t addr_align; size_t buff_size; void *buff_addr; diff --git a/src/audio/component.c b/src/audio/component.c index 51e6b4250f9b..1d30801221dd 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -158,8 +158,8 @@ void sys_comp_init(struct sof *sof) k_spinlock_init(&sof->comp_drivers->lock); } -void comp_get_copy_limits(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +void comp_get_copy_limits(struct comp_buffer *source, + struct comp_buffer *sink, struct comp_copy_limits *cl) { cl->frames = audio_stream_avail_frames(&source->stream, &sink->stream); @@ -169,8 +169,8 @@ void comp_get_copy_limits(struct comp_buffer __sparse_cache *source, cl->sink_bytes = cl->frames * cl->sink_frame_bytes; } -void comp_get_copy_limits_frame_aligned(const struct comp_buffer __sparse_cache *source, - const struct comp_buffer __sparse_cache *sink, +void comp_get_copy_limits_frame_aligned(const struct comp_buffer *source, + const struct comp_buffer *sink, struct comp_copy_limits *cl) { cl->frames = audio_stream_avail_frames_aligned(&source->stream, &sink->stream); @@ -182,8 +182,8 @@ void comp_get_copy_limits_frame_aligned(const struct comp_buffer __sparse_cache #ifdef STREAMCOPY_HIFI3 -int audio_stream_copy(const struct audio_stream __sparse_cache *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, uint32_t ooffset, uint32_t samples) +int audio_stream_copy(const struct audio_stream *source, uint32_t ioffset, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int ssize = audio_stream_sample_bytes(source); /* src fmt == sink fmt */ ae_int16x4 *src = (ae_int16x4 *)((int8_t *)audio_stream_get_rptr(source) + ioffset * ssize); @@ -227,8 +227,8 @@ int audio_stream_copy(const struct audio_stream __sparse_cache *source, uint32_t #else -int audio_stream_copy(const struct audio_stream __sparse_cache *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, uint32_t ooffset, uint32_t samples) +int audio_stream_copy(const struct audio_stream *source, uint32_t ioffset, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int ssize = audio_stream_sample_bytes(source); /* src fmt == sink fmt */ uint8_t *src = audio_stream_wrap(source, (uint8_t *)audio_stream_get_rptr(source) + @@ -279,7 +279,7 @@ void cir_buf_copy(void *src, void *src_addr, void *src_end, void *dst, } void audio_stream_copy_from_linear(const void *linear_source, int ioffset, - struct audio_stream __sparse_cache *sink, int ooffset, + struct audio_stream *sink, int ooffset, unsigned int samples) { int ssize = audio_stream_sample_bytes(sink); /* src fmt == sink fmt */ @@ -300,7 +300,7 @@ void audio_stream_copy_from_linear(const void *linear_source, int ioffset, } } -void audio_stream_copy_to_linear(const struct audio_stream __sparse_cache *source, int ioffset, +void audio_stream_copy_to_linear(const struct audio_stream *source, int ioffset, void *linear_sink, int ooffset, unsigned int samples) { int ssize = audio_stream_sample_bytes(source); /* src fmt == sink fmt */ diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index ae03226be8c1..2235d3e01c54 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -178,8 +178,8 @@ static int copier_free(struct processing_module *mod) static int copier_params(struct processing_module *mod); static int copier_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct copier_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; @@ -266,7 +266,7 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd) struct sof_ipc_stream_posn posn; struct comp_dev *dai_copier; struct comp_buffer *buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t latency; int ret; @@ -396,8 +396,8 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd) static int do_conversion_copy(struct comp_dev *dev, struct copier_data *cd, - struct comp_buffer __sparse_cache *src, - struct comp_buffer __sparse_cache *sink, + struct comp_buffer *src, + struct comp_buffer *sink, struct comp_copy_limits *processed_data) { int i; @@ -423,10 +423,10 @@ static int do_conversion_copy(struct comp_dev *dev, } static int copier_copy_to_sinks(struct copier_data *cd, struct comp_dev *dev, - struct comp_buffer __sparse_cache *src_c, + struct comp_buffer *src_c, struct comp_copy_limits *processed_data) { - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct list_item *sink_list; struct comp_buffer *sink; int ret = 0; @@ -466,25 +466,25 @@ static int copier_module_copy(struct processing_module *mod, struct output_stream_buffer *output_buffers, int num_output_buffers) { struct copier_data *cd = module_get_private_data(mod); - struct comp_buffer __sparse_cache *src_c; + struct comp_buffer *src_c; struct comp_copy_limits processed_data; int i; if (!num_input_buffers || !num_output_buffers) return 0; - src_c = attr_container_of(input_buffers[0].data, struct comp_buffer __sparse_cache, + src_c = attr_container_of(input_buffers[0].data, struct comp_buffer, stream, __sparse_cache); processed_data.source_bytes = 0; /* convert format and copy to each active sink */ for (i = 0; i < num_output_buffers; i++) { - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct comp_dev *sink_dev; sink_c = attr_container_of(output_buffers[i].data, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); sink_dev = sink_c->sink; processed_data.sink_bytes = 0; @@ -518,7 +518,7 @@ static int copier_module_copy(struct processing_module *mod, static int copier_multi_endpoint_dai_copy(struct copier_data *cd, struct comp_dev *dev) { - struct comp_buffer __sparse_cache *src_c, *sink_c; + struct comp_buffer *src_c, *sink_c; struct comp_copy_limits processed_data; struct comp_buffer *src; int ret; @@ -649,7 +649,7 @@ static int copier_set_sink_fmt(struct comp_dev *dev, const void *data, const struct ipc4_copier_config_set_sink_format *sink_fmt = data; struct processing_module *mod = comp_get_drvdata(dev); struct copier_data *cd = module_get_private_data(mod); - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct list_item *sink_list; struct comp_buffer *sink; diff --git a/src/audio/copier/copier_dai.c b/src/audio/copier/copier_dai.c index 31b832b81d01..d5996848bdcd 100644 --- a/src/audio/copier/copier_dai.c +++ b/src/audio/copier/copier_dai.c @@ -310,9 +310,9 @@ int copier_dai_prepare(struct comp_dev *dev, struct copier_data *cd) return 0; } -static int copy_single_channel_c16(const struct audio_stream __sparse_cache *src, +static int copy_single_channel_c16(const struct audio_stream *src, unsigned int src_channel, - struct audio_stream __sparse_cache *dst, + struct audio_stream *dst, unsigned int dst_channel, unsigned int frame_count) { int16_t *r_ptr = (int16_t *)audio_stream_get_rptr(src) + src_channel; @@ -351,9 +351,9 @@ static int copy_single_channel_c16(const struct audio_stream __sparse_cache *src return 0; } -static int copy_single_channel_c32(const struct audio_stream __sparse_cache *src, +static int copy_single_channel_c32(const struct audio_stream *src, unsigned int src_channel, - struct audio_stream __sparse_cache *dst, + struct audio_stream *dst, unsigned int dst_channel, unsigned int frame_count) { int32_t *r_ptr = (int32_t *)audio_stream_get_rptr(src) + src_channel; @@ -395,7 +395,7 @@ static int copy_single_channel_c32(const struct audio_stream __sparse_cache *src int copier_dai_params(struct copier_data *cd, struct comp_dev *dev, struct sof_ipc_stream_params *params, int dai_index) { - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; struct sof_ipc_stream_params demuxed_params = *params; const struct ipc4_audio_format *in_fmt = &cd->config.base.audio_fmt; const struct ipc4_audio_format *out_fmt = &cd->config.out_fmt; diff --git a/src/audio/copier/copier_generic.c b/src/audio/copier/copier_generic.c index 13794b19bccd..67c0e23af636 100644 --- a/src/audio/copier/copier_generic.c +++ b/src/audio/copier/copier_generic.c @@ -22,7 +22,7 @@ LOG_MODULE_DECLARE(copier, CONFIG_SOF_LOG_LEVEL); #include <stdint.h> int apply_attenuation(struct comp_dev *dev, struct copier_data *cd, - struct comp_buffer __sparse_cache *sink, int frame) + struct comp_buffer *sink, int frame) { int i; int n; @@ -62,7 +62,7 @@ void copier_update_params(struct copier_data *cd, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *sink, *source; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; struct list_item *sink_list; memset(params, 0, sizeof(*params)); @@ -140,7 +140,7 @@ int create_endpoint_buffer(struct comp_dev *dev, enum sof_ipc_frame valid_fmt; struct sof_ipc_buffer ipc_buf; struct comp_buffer *buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t buf_size; uint32_t chan_map; int i; diff --git a/src/audio/copier/copier_hifi.c b/src/audio/copier/copier_hifi.c index de6a8606aa7b..a419a4aee431 100644 --- a/src/audio/copier/copier_hifi.c +++ b/src/audio/copier/copier_hifi.c @@ -21,7 +21,7 @@ LOG_MODULE_REGISTER(copier_hifi, CONFIG_SOF_LOG_LEVEL); int apply_attenuation(struct comp_dev *dev, struct copier_data *cd, - struct comp_buffer __sparse_cache *sink, int frame) + struct comp_buffer *sink, int frame) { int i; int n; diff --git a/src/audio/copier/copier_host.c b/src/audio/copier/copier_host.c index 35456ed4dec1..ab4c2e422c9e 100644 --- a/src/audio/copier/copier_host.c +++ b/src/audio/copier/copier_host.c @@ -246,7 +246,7 @@ void copier_host_dma_cb(struct comp_dev *dev, size_t bytes) { struct processing_module *mod = comp_get_drvdata(dev); struct copier_data *cd = module_get_private_data(mod); - struct comp_buffer __sparse_cache *sink, *source; + struct comp_buffer *sink, *source; int ret, frames; comp_dbg(dev, "copier_host_dma_cb() %p", dev); diff --git a/src/audio/copier/copier_ipcgtw.c b/src/audio/copier/copier_ipcgtw.c index 967467f098ad..642a934bbfe8 100644 --- a/src/audio/copier/copier_ipcgtw.c +++ b/src/audio/copier/copier_ipcgtw.c @@ -37,7 +37,7 @@ static struct comp_dev *find_ipcgtw_by_node_id(union ipc4_connector_node_id node } static inline void audio_stream_copy_bytes_from_linear(const void *linear_source, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, unsigned int bytes) { const uint8_t *src = (const uint8_t *)linear_source; @@ -55,7 +55,7 @@ static inline void audio_stream_copy_bytes_from_linear(const void *linear_source } static inline -void audio_stream_copy_bytes_to_linear(const struct audio_stream __sparse_cache *source, +void audio_stream_copy_bytes_to_linear(const struct audio_stream *source, void *linear_sink, unsigned int bytes) { uint8_t *src = audio_stream_wrap(source, audio_stream_get_rptr(source)); @@ -93,7 +93,7 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd, const struct ipc4_ipc_gateway_cmd_data *in; struct comp_dev *dev; struct comp_buffer *buf; - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; uint32_t data_size; struct ipc4_ipc_gateway_cmd_data_reply *out; @@ -184,7 +184,7 @@ int copier_ipcgtw_params(struct ipcgtw_data *ipcgtw_data, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *buf; - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; int err; comp_dbg(dev, "ipcgtw_params()"); @@ -214,7 +214,7 @@ void copier_ipcgtw_reset(struct comp_dev *dev) struct comp_buffer *buf = get_buffer(dev); if (buf) { - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(buf); + struct comp_buffer *buf_c = buffer_acquire(buf); audio_stream_reset(&buf_c->stream); buffer_release(buf_c); diff --git a/src/audio/crossover/crossover.c b/src/audio/crossover/crossover.c index 029e2fcbf74c..dd1fb0468eda 100644 --- a/src/audio/crossover/crossover.c +++ b/src/audio/crossover/crossover.c @@ -133,7 +133,7 @@ static int crossover_assign_sinks(struct processing_module *mod, struct sof_crossover_config *config = cd->config; struct comp_dev *dev = mod->dev; struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct list_item *sink_list; int num_sinks = 0; int i; @@ -486,7 +486,7 @@ static int crossover_check_sink_assign(struct processing_module *mod, { struct comp_dev *dev = mod->dev; struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct list_item *sink_list; int num_assigned_sinks = 0; uint8_t assigned_sinks[SOF_CROSSOVER_MAX_STREAMS] = {0}; @@ -623,7 +623,7 @@ static int crossover_process_audio_stream(struct processing_module *mod, bool enabled_buffers[PLATFORM_MAX_STREAMS] = { false }; struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; - struct audio_stream __sparse_cache *source = input_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; uint32_t num_sinks; uint32_t num_assigned_sinks = 0; /* The frames count to process from module adapter applies for source buffer and @@ -691,7 +691,7 @@ static int crossover_process_audio_stream(struct processing_module *mod, static void crossover_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct list_item *sink_list; struct comp_dev *dev = mod->dev; @@ -721,13 +721,13 @@ static void crossover_params(struct processing_module *mod) * \return Error code. */ static int crossover_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *source, *sink; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct list_item *sink_list; int channels; int ret = 0; diff --git a/src/audio/crossover/crossover_generic.c b/src/audio/crossover/crossover_generic.c index ad8b6b930ea9..0823ce85920f 100644 --- a/src/audio/crossover/crossover_generic.c +++ b/src/audio/crossover/crossover_generic.c @@ -93,8 +93,8 @@ static void crossover_s16_default_pass(struct comp_data *cd, int32_t num_sinks, uint32_t frames) { - const struct audio_stream __sparse_cache *sink_stream; - const struct audio_stream __sparse_cache *source_stream = bsource->data; + const struct audio_stream *sink_stream; + const struct audio_stream *source_stream = bsource->data; int16_t *x; int32_t *y; int i, j; @@ -121,8 +121,8 @@ static void crossover_s32_default_pass(struct comp_data *cd, int32_t num_sinks, uint32_t frames) { - const struct audio_stream __sparse_cache *sink_stream; - const struct audio_stream __sparse_cache *source_stream = bsource->data; + const struct audio_stream *sink_stream; + const struct audio_stream *source_stream = bsource->data; int32_t *x, *y; int i, j; int n = audio_stream_get_channels(source_stream) * frames; @@ -149,8 +149,8 @@ static void crossover_s16_default(struct comp_data *cd, uint32_t frames) { struct crossover_state *state; - const struct audio_stream __sparse_cache *source_stream = bsource->data; - struct audio_stream __sparse_cache *sink_stream; + const struct audio_stream *source_stream = bsource->data; + struct audio_stream *sink_stream; int16_t *x, *y; int ch, i, j; int idx; @@ -187,8 +187,8 @@ static void crossover_s24_default(struct comp_data *cd, uint32_t frames) { struct crossover_state *state; - const struct audio_stream __sparse_cache *source_stream = bsource->data; - struct audio_stream __sparse_cache *sink_stream; + const struct audio_stream *source_stream = bsource->data; + struct audio_stream *sink_stream; int32_t *x, *y; int ch, i, j; int idx; @@ -225,8 +225,8 @@ static void crossover_s32_default(struct comp_data *cd, uint32_t frames) { struct crossover_state *state; - const struct audio_stream __sparse_cache *source_stream = bsource->data; - struct audio_stream __sparse_cache *sink_stream; + const struct audio_stream *source_stream = bsource->data; + struct audio_stream *sink_stream; int32_t *x, *y; int ch, i, j; int idx; diff --git a/src/audio/dai-legacy.c b/src/audio/dai-legacy.c index 446ae0c83c08..933d23d43fdb 100644 --- a/src/audio/dai-legacy.c +++ b/src/audio/dai-legacy.c @@ -97,7 +97,7 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) struct comp_dev *dev = arg; struct dai_data *dd = comp_get_drvdata(dev); uint32_t bytes = next->elem.size; - struct comp_buffer __sparse_cache *local_buf, *dma_buf; + struct comp_buffer *local_buf, *dma_buf; int ret; comp_dbg(dev, "dai_dma_cb()"); @@ -138,7 +138,7 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) /* assert dma_buffer_copy succeed */ if (ret < 0) { - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; source_c = dev->direction == SOF_IPC_STREAM_PLAYBACK ? local_buf : dma_buf; @@ -357,7 +357,7 @@ static int dai_playback_params(struct comp_dev *dev, uint32_t period_bytes, { struct dai_data *dd = comp_get_drvdata(dev); struct dma_sg_config *config = &dd->config; - struct comp_buffer __sparse_cache *dma_buf = buffer_acquire(dd->dma_buffer), + struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), *local_buf = buffer_acquire(dd->local_buffer); uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); @@ -419,7 +419,7 @@ static int dai_capture_params(struct comp_dev *dev, uint32_t period_bytes, { struct dai_data *dd = comp_get_drvdata(dev); struct dma_sg_config *config = &dd->config; - struct comp_buffer __sparse_cache *dma_buf = buffer_acquire(dd->dma_buffer), + struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), *local_buf = buffer_acquire(dd->local_buffer); uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); @@ -491,7 +491,7 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct sof_ipc_stream_params hw_params = *params; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t frame_size; uint32_t period_count; uint32_t period_bytes; @@ -685,7 +685,7 @@ int dai_common_config_prepare(struct dai_data *dd, struct comp_dev *dev) int dai_common_prepare(struct dai_data *dd, struct comp_dev *dev) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; int ret; dd->total_data_processed = 0; @@ -815,7 +815,7 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, * this is only supported at capture mode. */ if (dev->direction == SOF_IPC_STREAM_CAPTURE) { - struct comp_buffer __sparse_cache *buffer_c = + struct comp_buffer *buffer_c = buffer_acquire(dd->dma_buffer); buffer_zero(buffer_c); @@ -947,7 +947,7 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd) static void dai_report_xrun(struct comp_dev *dev, uint32_t bytes) { struct dai_data *dd = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(dd->local_buffer); + struct comp_buffer *buf_c = buffer_acquire(dd->local_buffer); if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { comp_err(dev, "dai_report_xrun(): underrun due to no data available"); @@ -965,7 +965,7 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun { uint32_t dma_fmt; uint32_t sampling; - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; uint32_t avail_bytes = 0; uint32_t free_bytes = 0; uint32_t copy_bytes = 0; diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index f83bf3d27f94..6f72a68f26d9 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -226,7 +226,7 @@ static enum dma_cb_status dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, pcm_converter_func *converter) { - struct comp_buffer __sparse_cache *local_buf, *dma_buf; + struct comp_buffer *local_buf, *dma_buf; enum dma_cb_status dma_status = DMA_CB_STATUS_RELOAD; int ret; @@ -276,7 +276,7 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, * function */ list_for_item(sink_list, &dev->bsink_list) { - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct comp_dev *sink_dev; struct comp_buffer *sink; int j; @@ -318,7 +318,7 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, /* assert dma_buffer_copy succeed */ if (ret < 0) { - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; source_c = dev->direction == SOF_IPC_STREAM_PLAYBACK ? local_buf : dma_buf; @@ -346,7 +346,7 @@ static enum dma_cb_status dai_dma_multi_endpoint_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t frames, struct comp_buffer *multi_endpoint_buffer) { - struct comp_buffer __sparse_cache *multi_buf_c, *dma_buf; + struct comp_buffer *multi_buf_c, *dma_buf; enum dma_cb_status dma_status = DMA_CB_STATUS_RELOAD; uint32_t i, bytes; @@ -592,7 +592,7 @@ static int dai_playback_params(struct dai_data *dd, struct comp_dev *dev, uint32 struct dma_config *dma_cfg; struct dma_block_config *dma_block_cfg; struct dma_block_config *prev = NULL; - struct comp_buffer __sparse_cache *dma_buf = buffer_acquire(dd->dma_buffer), + struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), *local_buf = buffer_acquire(dd->local_buffer); uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); @@ -734,7 +734,7 @@ static int dai_capture_params(struct dai_data *dd, struct comp_dev *dev, uint32_ struct dma_config *dma_cfg; struct dma_block_config *dma_block_cfg; struct dma_block_config *prev = NULL; - struct comp_buffer __sparse_cache *dma_buf = buffer_acquire(dd->dma_buffer), + struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), *local_buf = buffer_acquire(dd->local_buffer); uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); @@ -885,7 +885,7 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct sof_ipc_stream_params hw_params = *params; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t frame_size; uint32_t period_count; uint32_t period_bytes; @@ -1064,7 +1064,7 @@ int dai_common_config_prepare(struct dai_data *dd, struct comp_dev *dev) int dai_common_prepare(struct dai_data *dd, struct comp_dev *dev) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; int ret; dd->total_data_processed = 0; @@ -1193,7 +1193,7 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, * this is only supported at capture mode. */ if (dev->direction == SOF_IPC_STREAM_CAPTURE) { - struct comp_buffer __sparse_cache *buffer_c = + struct comp_buffer *buffer_c = buffer_acquire(dd->dma_buffer); buffer_zero(buffer_c); @@ -1339,7 +1339,7 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd) /* report xrun occurrence */ static void dai_report_xrun(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes) { - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(dd->local_buffer); + struct comp_buffer *buf_c = buffer_acquire(dd->local_buffer); if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { comp_err(dev, "dai_report_xrun(): underrun due to no data available"); @@ -1357,7 +1357,7 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, struct comp_buffer *multi_endpoint_buffer, int num_endpoints) { - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; uint32_t avail_bytes = UINT32_MAX; uint32_t free_bytes = UINT32_MAX; uint32_t frames; @@ -1476,8 +1476,8 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev) { - struct comp_buffer __sparse_cache *dma_buf = buffer_acquire(dd->dma_buffer); - struct comp_buffer __sparse_cache *local_buf; + struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer); + struct comp_buffer *local_buf; uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); uint32_t local_fmt; @@ -1509,7 +1509,7 @@ static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev) int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_func *converter) { uint32_t sampling = dd->sampling; - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; struct dma_status stat; uint32_t avail_bytes; uint32_t free_bytes; @@ -1792,7 +1792,7 @@ static uint64_t dai_get_processed_data(struct comp_dev *dev, uint32_t stream_no, #ifdef CONFIG_IPC_MAJOR_4 int dai_zephyr_unbind(struct dai_data *dd, struct comp_dev *dev, void *data) { - struct comp_buffer __sparse_cache *local_buf_c; + struct comp_buffer *local_buf_c; struct ipc4_module_bind_unbind *bu; int buf_id; diff --git a/src/audio/dcblock/dcblock.c b/src/audio/dcblock/dcblock.c index 956181149900..3a476933299e 100644 --- a/src/audio/dcblock/dcblock.c +++ b/src/audio/dcblock/dcblock.c @@ -194,8 +194,8 @@ static int dcblock_process(struct processing_module *mod, int num_output_buffers) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = input_buffers[0].data; - struct audio_stream __sparse_cache *sink = output_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; + struct audio_stream *sink = output_buffers[0].data; uint32_t frames = input_buffers[0].size; comp_dbg(mod->dev, "dcblock_process()"); @@ -207,8 +207,8 @@ static int dcblock_process(struct processing_module *mod, } /* init and calculate the aligned setting for available frames and free frames retrieve*/ -static inline void dcblock_set_frame_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static inline void dcblock_set_frame_alignment(struct audio_stream *source, + struct audio_stream *sink) { const uint32_t byte_align = 1; const uint32_t frame_align_req = 1; @@ -221,7 +221,7 @@ static inline void dcblock_set_frame_alignment(struct audio_stream __sparse_cach static void dcblock_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct comp_dev *dev = mod->dev; @@ -248,12 +248,12 @@ static void dcblock_params(struct processing_module *mod) * \return Error code. */ static int dcblock_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; comp_info(dev, "dcblock_prepare()"); diff --git a/src/audio/dcblock/dcblock_generic.c b/src/audio/dcblock/dcblock_generic.c index 3fb6b476d5e6..459d51993f09 100644 --- a/src/audio/dcblock/dcblock_generic.c +++ b/src/audio/dcblock/dcblock_generic.c @@ -36,8 +36,8 @@ static int32_t dcblock_generic(struct dcblock_state *state, #if CONFIG_FORMAT_S16LE static void dcblock_s16_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { struct dcblock_state *state; @@ -76,8 +76,8 @@ static void dcblock_s16_default(struct comp_data *cd, #if CONFIG_FORMAT_S24LE static void dcblock_s24_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { struct dcblock_state *state; @@ -116,8 +116,8 @@ static void dcblock_s24_default(struct comp_data *cd, #if CONFIG_FORMAT_S32LE static void dcblock_s32_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { struct dcblock_state *state; diff --git a/src/audio/dcblock/dcblock_hifi3.c b/src/audio/dcblock/dcblock_hifi3.c index e8ef80032bb6..30d8aa4d32a8 100644 --- a/src/audio/dcblock/dcblock_hifi3.c +++ b/src/audio/dcblock/dcblock_hifi3.c @@ -29,7 +29,7 @@ static inline ae_int32x2 dcblock_cal(ae_int32x2 R, ae_int32x2 state_x, ae_int32 } /* Setup circular for component source */ -static inline void dcblock_set_circular(const struct audio_stream __sparse_cache *source) +static inline void dcblock_set_circular(const struct audio_stream *source) { /* Set source as circular buffer 0 */ AE_SETCBEGIN0(audio_stream_get_addr(source)); @@ -38,8 +38,8 @@ static inline void dcblock_set_circular(const struct audio_stream __sparse_cache #if CONFIG_FORMAT_S16LE static void dcblock_s16_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { ae_int16 *src = audio_stream_get_rptr(source); @@ -85,8 +85,8 @@ static void dcblock_s16_default(struct comp_data *cd, #if CONFIG_FORMAT_S24LE static void dcblock_s24_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { ae_int32 *src = audio_stream_get_rptr(source); @@ -132,8 +132,8 @@ static void dcblock_s24_default(struct comp_data *cd, #if CONFIG_FORMAT_S32LE static void dcblock_s32_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { ae_int32 *src = audio_stream_get_rptr(source); diff --git a/src/audio/dcblock/dcblock_hifi4.c b/src/audio/dcblock/dcblock_hifi4.c index b537b3dce7b0..98d8edf6345e 100644 --- a/src/audio/dcblock/dcblock_hifi4.c +++ b/src/audio/dcblock/dcblock_hifi4.c @@ -29,8 +29,8 @@ static inline ae_int32x2 dcblock_cal(ae_int32x2 R, ae_int32x2 state_x, ae_int32 } /* Setup circular for component sink and source */ -static inline void dcblock_set_circular(const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink) +static inline void dcblock_set_circular(const struct audio_stream *source, + const struct audio_stream *sink) { /* Set source as circular buffer 0 */ AE_SETCBEGIN0(audio_stream_get_addr(source)); @@ -43,8 +43,8 @@ static inline void dcblock_set_circular(const struct audio_stream __sparse_cache #if CONFIG_FORMAT_S16LE static void dcblock_s16_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { ae_int16 *in; @@ -80,8 +80,8 @@ static void dcblock_s16_default(struct comp_data *cd, #if CONFIG_FORMAT_S24LE static void dcblock_s24_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { ae_int32 *in; @@ -118,8 +118,8 @@ static void dcblock_s24_default(struct comp_data *cd, #if CONFIG_FORMAT_S32LE static void dcblock_s32_default(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames) { ae_int32 *in; diff --git a/src/audio/drc/drc.c b/src/audio/drc/drc.c index a435e347a608..47462b3f79ec 100644 --- a/src/audio/drc/drc.c +++ b/src/audio/drc/drc.c @@ -227,8 +227,8 @@ static int drc_get_config(struct processing_module *mod, return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size); } -static void drc_set_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static void drc_set_alignment(struct audio_stream *source, + struct audio_stream *sink) { /* Currently no optimizations those would use wider loads and stores */ audio_stream_init_alignment_constants(1, 1, source); @@ -243,8 +243,8 @@ static int drc_process(struct processing_module *mod, { struct drc_comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; - struct audio_stream __sparse_cache *source = input_buffers[0].data; - struct audio_stream __sparse_cache *sink = output_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; + struct audio_stream *sink = output_buffers[0].data; int frames = input_buffers[0].size; int ret; @@ -272,7 +272,7 @@ static int drc_process(struct processing_module *mod, static void drc_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct comp_dev *dev = mod->dev; @@ -294,12 +294,12 @@ static void drc_params(struct processing_module *mod) #endif /* CONFIG_IPC_MAJOR_4 */ static int drc_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct drc_comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; int channels; int rate; diff --git a/src/audio/drc/drc_generic.c b/src/audio/drc/drc_generic.c index fb7978c54cdc..472431a0e408 100644 --- a/src/audio/drc/drc_generic.c +++ b/src/audio/drc/drc_generic.c @@ -466,8 +466,8 @@ static void drc_process_one_division(struct drc_state *state, } void drc_default_pass(struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, uint32_t frames) + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { audio_stream_copy(source, 0, sink, 0, frames * audio_stream_get_channels(source)); } @@ -479,8 +479,8 @@ static inline void drc_pre_delay_index_inc(int *idx, int increment) #if CONFIG_FORMAT_S16LE static void drc_delay_input_sample_s16(struct drc_state *state, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int16_t **x, int16_t **y, int samples) { int16_t *x1; @@ -528,8 +528,8 @@ static void drc_delay_input_sample_s16(struct drc_state *state, } static void drc_s16_default(struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { int16_t *x = audio_stream_get_rptr(source); @@ -574,8 +574,8 @@ static void drc_s16_default(struct processing_module *mod, #if CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE static void drc_delay_input_sample_s32(struct drc_state *state, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int32_t **x, int32_t **y, int samples) { int32_t *x1; @@ -625,8 +625,8 @@ static void drc_delay_input_sample_s32(struct drc_state *state, #if CONFIG_FORMAT_S24LE static void drc_delay_input_sample_s24(struct drc_state *state, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int32_t **x, int32_t **y, int samples) { int32_t *x1; @@ -674,8 +674,8 @@ static void drc_delay_input_sample_s24(struct drc_state *state, } static void drc_s24_default(struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { int32_t *x = audio_stream_get_rptr(source); @@ -722,8 +722,8 @@ static void drc_s24_default(struct processing_module *mod, #if CONFIG_FORMAT_S32LE static void drc_s32_default(struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { int32_t *x = audio_stream_get_rptr(source); diff --git a/src/audio/eq_fir/eq_fir.c b/src/audio/eq_fir/eq_fir.c index 5fad4db4babf..5d304d15c368 100644 --- a/src/audio/eq_fir/eq_fir.c +++ b/src/audio/eq_fir/eq_fir.c @@ -174,7 +174,7 @@ static int eq_fir_params(struct processing_module *mod) struct sof_ipc_stream_params comp_params; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; enum sof_ipc_frame valid_fmt, frame_fmt; int i, ret; @@ -213,8 +213,8 @@ static void eq_fir_passthrough(struct fir_state_32x16 fir[], struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; audio_stream_copy(source, 0, sink, 0, frames * audio_stream_get_channels(source)); } @@ -512,7 +512,7 @@ static int eq_fir_process(struct processing_module *mod, int num_output_buffers) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = input_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; uint32_t frame_count = input_buffers[0].size; int ret; @@ -554,8 +554,8 @@ static int eq_fir_process(struct processing_module *mod, return 0; } -static void eq_fir_set_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static void eq_fir_set_alignment(struct audio_stream *source, + struct audio_stream *sink) { const uint32_t byte_align = 1; const uint32_t frame_align_req = 2; /* Process multiples of 2 frames */ @@ -565,12 +565,12 @@ static void eq_fir_set_alignment(struct audio_stream __sparse_cache *source, } static int eq_fir_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; int channels; enum sof_ipc_frame frame_fmt; diff --git a/src/audio/eq_fir/eq_fir_generic.c b/src/audio/eq_fir/eq_fir_generic.c index ff763d325864..7edea7b21057 100644 --- a/src/audio/eq_fir/eq_fir_generic.c +++ b/src/audio/eq_fir/eq_fir_generic.c @@ -23,8 +23,8 @@ LOG_MODULE_DECLARE(eq_fir, CONFIG_SOF_LOG_LEVEL); void eq_fir_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *filter; int32_t z; int16_t *x0, *y0; @@ -61,8 +61,8 @@ void eq_fir_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bsourc void eq_fir_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *filter; int32_t z; int32_t *x0, *y0; @@ -99,8 +99,8 @@ void eq_fir_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bsourc void eq_fir_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *filter; int32_t *x0, *y0; int32_t *x = audio_stream_get_rptr(source); diff --git a/src/audio/eq_fir/eq_fir_hifi2ep.c b/src/audio/eq_fir/eq_fir_hifi2ep.c index 29d12587ab1f..fc5ce500b9de 100644 --- a/src/audio/eq_fir/eq_fir_hifi2ep.c +++ b/src/audio/eq_fir/eq_fir_hifi2ep.c @@ -28,8 +28,8 @@ LOG_MODULE_DECLARE(eq_fir, CONFIG_SOF_LOG_LEVEL); void eq_fir_2x_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *f; int32_t *src = audio_stream_get_rptr(source); int32_t *snk = audio_stream_get_wptr(sink); @@ -72,8 +72,8 @@ void eq_fir_2x_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bso void eq_fir_2x_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *f; int32_t *src = audio_stream_get_rptr(source); int32_t *snk = audio_stream_get_wptr(sink); @@ -120,8 +120,8 @@ void eq_fir_2x_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bso void eq_fir_2x_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *f; int16_t *src = audio_stream_get_rptr(source); int16_t *snk = audio_stream_get_wptr(sink); diff --git a/src/audio/eq_fir/eq_fir_hifi3.c b/src/audio/eq_fir/eq_fir_hifi3.c index b9b5f3b1ec63..00ce836741f5 100644 --- a/src/audio/eq_fir/eq_fir_hifi3.c +++ b/src/audio/eq_fir/eq_fir_hifi3.c @@ -27,8 +27,8 @@ LOG_MODULE_DECLARE(eq_fir, CONFIG_SOF_LOG_LEVEL); void eq_fir_2x_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *f; ae_int32x2 d0 = 0; ae_int32x2 d1 = 0; @@ -84,8 +84,8 @@ void eq_fir_2x_s32(struct fir_state_32x16 fir[], struct input_stream_buffer *bso void eq_fir_2x_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *f; ae_int32x2 d0 = 0; ae_int32x2 d1 = 0; @@ -156,8 +156,8 @@ void eq_fir_2x_s24(struct fir_state_32x16 fir[], struct input_stream_buffer *bso void eq_fir_2x_s16(struct fir_state_32x16 fir[], struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct fir_state_32x16 *f; ae_int16x4 d0 = AE_ZERO16(); ae_int16x4 d1 = AE_ZERO16(); diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index 1ff8ed6879e6..cf9c6fdbf6c1 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -64,8 +64,8 @@ static void eq_iir_s16_default(struct processing_module *mod, struct input_strea struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct iir_state_df1 *filter; int16_t *x0; int16_t *y0; @@ -112,8 +112,8 @@ static void eq_iir_s24_default(struct processing_module *mod, struct input_strea struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct iir_state_df1 *filter; int32_t *x0; int32_t *y0; @@ -160,8 +160,8 @@ static void eq_iir_s32_default(struct processing_module *mod, struct input_strea struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct iir_state_df1 *filter; int32_t *x0; int32_t *y0; @@ -209,8 +209,8 @@ static void eq_iir_s32_16_default(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct iir_state_df1 *filter; int32_t *x0; int16_t *y0; @@ -257,8 +257,8 @@ static void eq_iir_s32_24_default(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct iir_state_df1 *filter; int32_t *x0; int32_t *y0; @@ -303,8 +303,8 @@ static void eq_iir_s32_24_default(struct processing_module *mod, static void eq_iir_pass(struct processing_module *mod, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, uint32_t frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; audio_stream_copy(source, 0, sink, 0, frames * audio_stream_get_channels(source)); } @@ -314,8 +314,8 @@ static void eq_iir_pass(struct processing_module *mod, struct input_stream_buffe static void eq_iir_s32_s16_pass(struct processing_module *mod, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, uint32_t frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x = audio_stream_get_rptr(source); int16_t *y = audio_stream_get_wptr(sink); int nmax; @@ -344,8 +344,8 @@ static void eq_iir_s32_s16_pass(struct processing_module *mod, struct input_stre static void eq_iir_s32_s24_pass(struct processing_module *mod, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, uint32_t frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x = audio_stream_get_rptr(source); int32_t *y = audio_stream_get_wptr(sink); int nmax; @@ -694,7 +694,7 @@ static int eq_iir_verify_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; uint32_t buffer_flag; int ret; @@ -794,8 +794,8 @@ static int eq_iir_process(struct processing_module *mod, struct output_stream_buffer *output_buffers, int num_output_buffers) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = input_buffers[0].data; - struct audio_stream __sparse_cache *sink = output_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; + struct audio_stream *sink = output_buffers[0].data; uint32_t frame_count = input_buffers[0].size; int ret; @@ -821,8 +821,8 @@ static int eq_iir_process(struct processing_module *mod, * \param[in,out] source Structure pointer of source. * \param[in,out] sink Structure pointer of sink. */ -static void eq_iir_set_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static void eq_iir_set_alignment(struct audio_stream *source, + struct audio_stream *sink) { const uint32_t byte_align = 8; const uint32_t frame_align_req = 2; @@ -838,7 +838,7 @@ static int eq_iir_params(struct processing_module *mod) struct sof_ipc_stream_params comp_params; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; enum sof_ipc_frame valid_fmt, frame_fmt; int i, ret; @@ -880,12 +880,12 @@ static void eq_iir_set_passthrough_func(struct comp_data *cd, } static int eq_iir_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame source_format; enum sof_ipc_frame sink_format; diff --git a/src/audio/google/google_hotword_detect.c b/src/audio/google/google_hotword_detect.c index b948420ec36b..766a26b0616e 100644 --- a/src/audio/google/google_hotword_detect.c +++ b/src/audio/google/google_hotword_detect.c @@ -159,7 +159,7 @@ static int ghd_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *sourceb; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; int ret; /* Detector is used only in KPB topology. It always requires channels @@ -383,8 +383,8 @@ static int ghd_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *source; - struct comp_buffer __sparse_cache *source_c; - struct audio_stream __sparse_cache *stream; + struct comp_buffer *source_c; + struct audio_stream *stream; uint32_t bytes, tail_bytes, head_bytes = 0; int ret; diff --git a/src/audio/google/google_rtc_audio_processing.c b/src/audio/google/google_rtc_audio_processing.c index 29493cf9da0b..3a5bbe3dfa65 100644 --- a/src/audio/google/google_rtc_audio_processing.c +++ b/src/audio/google/google_rtc_audio_processing.c @@ -89,7 +89,7 @@ static int google_rtc_audio_processing_params( int ret; #if CONFIG_IPC_MAJOR_4 struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct comp_buffer *sink; /* update sink buffer format */ @@ -502,7 +502,7 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) { struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); struct list_item *source_buffer_list_item; - struct comp_buffer __sparse_cache *output_c; + struct comp_buffer *output_c; unsigned int aec_channels = 0, frame_fmt, rate; int ret; @@ -512,7 +512,7 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) list_for_item(source_buffer_list_item, &dev->bsource_list) { struct comp_buffer *source = container_of(source_buffer_list_item, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c = buffer_acquire(source); + struct comp_buffer *source_c = buffer_acquire(source); #if CONFIG_IPC_MAJOR_4 if (IPC4_SINK_QUEUE_ID(source_c->id) == SOF_AEC_FEEDBACK_QUEUE_ID) { @@ -592,7 +592,7 @@ static int google_rtc_audio_processing_reset(struct comp_dev *dev) static int google_rtc_audio_processing_copy(struct comp_dev *dev) { struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *buffer_c, *mic_buf, *output_buf; + struct comp_buffer *buffer_c, *mic_buf, *output_buf; struct comp_copy_limits cl; int16_t *src, *dst, *ref; uint32_t num_aec_reference_frames; diff --git a/src/audio/host-legacy.c b/src/audio/host-legacy.c index 546cc6edbfc1..2574e3b54467 100644 --- a/src/audio/host-legacy.c +++ b/src/audio/host-legacy.c @@ -105,7 +105,7 @@ static int host_dma_set_config_and_copy(struct host_data *hd, struct comp_dev *d */ static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd, struct comp_dev *dev) { - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(hd->local_buffer); + struct comp_buffer *buffer_c = buffer_acquire(hd->local_buffer); uint32_t copy_bytes; /* calculate minimum size to copy */ @@ -168,7 +168,7 @@ static int host_copy_one_shot(struct host_data *hd, struct comp_dev *dev, copy_c static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd, struct comp_dev *dev) { struct dma_sg_elem *local_elem = hd->config.elem_array.elems; - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(hd->local_buffer); + struct comp_buffer *buffer_c = buffer_acquire(hd->local_buffer); uint32_t copy_bytes; uint32_t split_value; @@ -232,8 +232,8 @@ static int host_copy_one_shot(struct host_data *hd, struct comp_dev *dev, copy_c void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t bytes) { - struct comp_buffer __sparse_cache *source; - struct comp_buffer __sparse_cache *sink; + struct comp_buffer *source; + struct comp_buffer *sink; int ret; bool update_mailbox = false; bool send_ipc = false; @@ -372,7 +372,7 @@ static void host_dma_cb(void *arg, enum notify_id type, void *data) */ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev *dev) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t avail_bytes = 0; uint32_t free_bytes = 0; uint32_t copy_bytes = 0; @@ -446,7 +446,7 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal static int create_local_elems(struct host_data *hd, struct comp_dev *dev, uint32_t buffer_count, uint32_t buffer_bytes) { - struct comp_buffer __sparse_cache *dma_buf_c; + struct comp_buffer *dma_buf_c; struct dma_sg_elem_array *elem_array; uint32_t dir; int err; @@ -690,8 +690,8 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, struct sof_ipc_stream_params *params, notifier_callback_t cb) { struct dma_sg_config *config = &hd->config; - struct comp_buffer __sparse_cache *host_buf_c; - struct comp_buffer __sparse_cache *dma_buf_c; + struct comp_buffer *host_buf_c; + struct comp_buffer *dma_buf_c; uint32_t period_count; uint32_t period_bytes; uint32_t buffer_size; @@ -886,7 +886,7 @@ static int host_params(struct comp_dev *dev, int host_common_prepare(struct host_data *hd) { - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(hd->dma_buffer); + struct comp_buffer *buf_c = buffer_acquire(hd->dma_buffer); buffer_zero(buf_c); buffer_release(buf_c); diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 5a2a57438536..49f64e42179d 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -109,7 +109,7 @@ static int host_dma_set_config_and_copy(struct host_data *hd, struct comp_dev *d static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd) { struct comp_buffer *buffer = hd->local_buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t copy_bytes; buffer_c = buffer_acquire(buffer); @@ -175,7 +175,7 @@ static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd) { struct dma_sg_elem *local_elem = hd->config.elem_array.elems; struct comp_buffer *buffer = hd->local_buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t copy_bytes; uint32_t split_value; @@ -241,8 +241,8 @@ static int host_copy_one_shot(struct host_data *hd, struct comp_dev *dev, copy_c void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t bytes) { - struct comp_buffer __sparse_cache *source; - struct comp_buffer __sparse_cache *sink; + struct comp_buffer *source; + struct comp_buffer *sink; int ret; bool update_mailbox = false; bool send_ipc = false; @@ -379,8 +379,8 @@ static void host_dma_cb(struct comp_dev *dev, size_t bytes) static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev *dev) { struct comp_buffer *buffer = hd->local_buffer; - struct comp_buffer __sparse_cache *buffer_c; - struct comp_buffer __sparse_cache *dma_buf_c; + struct comp_buffer *buffer_c; + struct comp_buffer *dma_buf_c; struct dma_status dma_stat; uint32_t avail_samples; uint32_t free_samples; @@ -464,7 +464,7 @@ static inline bool stream_sync(struct host_data *hd, struct comp_dev *dev) */ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_callback_t cb) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t copy_bytes; const unsigned int threshold = #if CONFIG_HOST_DMA_RELOAD_DELAY_ENABLE @@ -512,7 +512,7 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal static int create_local_elems(struct host_data *hd, struct comp_dev *dev, uint32_t buffer_count, uint32_t buffer_bytes, uint32_t direction) { - struct comp_buffer __sparse_cache *dma_buf_c; + struct comp_buffer *dma_buf_c; struct dma_sg_elem_array *elem_array; uint32_t dir; int err; @@ -759,8 +759,8 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, struct dma_sg_elem *sg_elem; struct dma_config *dma_cfg = &hd->z_config; struct dma_block_config dma_block_cfg; - struct comp_buffer __sparse_cache *host_buf_c; - struct comp_buffer __sparse_cache *dma_buf_c; + struct comp_buffer *host_buf_c; + struct comp_buffer *dma_buf_c; uint32_t period_count; uint32_t period_bytes; uint32_t buffer_size; @@ -1007,7 +1007,7 @@ static int host_params(struct comp_dev *dev, int host_common_prepare(struct host_data *hd) { - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(hd->dma_buffer); + struct comp_buffer *buf_c = buffer_acquire(hd->dma_buffer); buffer_zero(buf_c); buffer_release(buf_c); diff --git a/src/audio/igo_nr/igo_nr.c b/src/audio/igo_nr/igo_nr.c index 7ee3884bd023..aaea52ed2178 100644 --- a/src/audio/igo_nr/igo_nr.c +++ b/src/audio/igo_nr/igo_nr.c @@ -66,8 +66,8 @@ static void igo_nr_lib_process(struct comp_data *cd) #if CONFIG_FORMAT_S16LE static void igo_nr_capture_s16(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int32_t frames) { int32_t nch = audio_stream_get_channels(source); @@ -125,8 +125,8 @@ static void igo_nr_capture_s16(struct comp_data *cd, #if CONFIG_FORMAT_S24LE static void igo_nr_capture_s24(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int32_t frames) { int32_t nch = audio_stream_get_channels(source); @@ -184,8 +184,8 @@ static void igo_nr_capture_s24(struct comp_data *cd, #if CONFIG_FORMAT_S32LE static void igo_nr_capture_s32(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int32_t frames) { int32_t nch = audio_stream_get_channels(source); @@ -379,7 +379,7 @@ static int32_t igo_nr_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb, *sourceb; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; int32_t err; comp_info(dev, "igo_nr_params()"); @@ -619,8 +619,8 @@ static int32_t igo_nr_cmd(struct comp_dev *dev, } static void igo_nr_process(struct comp_dev *dev, - struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, + struct comp_buffer *source, + struct comp_buffer *sink, struct comp_copy_limits *cl, int32_t frames) @@ -701,7 +701,7 @@ static int32_t igo_nr_copy(struct comp_dev *dev) { struct comp_copy_limits cl; struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct comp_data *cd = comp_get_drvdata(dev); int32_t src_frames; int32_t sink_frames; diff --git a/src/audio/kpb.c b/src/audio/kpb.c index dee693d6fd9d..45a8b7f9b3cc 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -120,18 +120,18 @@ static int kpb_register_client(struct comp_data *kpb, struct kpb_client *cli); static void kpb_init_draining(struct comp_dev *dev, struct kpb_client *cli); static enum task_state kpb_draining_task(void *arg); static int kpb_buffer_data(struct comp_dev *dev, - const struct comp_buffer __sparse_cache *source, size_t size); + const struct comp_buffer *source, size_t size); static size_t kpb_allocate_history_buffer(struct comp_data *kpb, size_t hb_size_req); static void kpb_clear_history_buffer(struct history_buffer *buff); static void kpb_free_history_buffer(struct history_buffer *buff); static inline bool kpb_is_sample_width_supported(uint32_t sampling_width); -static void kpb_copy_samples(struct comp_buffer __sparse_cache *sink, - struct comp_buffer __sparse_cache *source, size_t size, +static void kpb_copy_samples(struct comp_buffer *sink, + struct comp_buffer *source, size_t size, size_t sample_width, uint32_t channels); -static void kpb_drain_samples(void *source, struct audio_stream __sparse_cache *sink, +static void kpb_drain_samples(void *source, struct audio_stream *sink, size_t size, size_t sample_width); -static void kpb_buffer_samples(const struct audio_stream __sparse_cache *source, +static void kpb_buffer_samples(const struct audio_stream *source, int offset, void *sink, size_t size, size_t sample_width); static void kpb_reset_history_buffer(struct history_buffer *buff); @@ -330,7 +330,7 @@ static int kpb_bind(struct comp_dev *dev, void *data) list_for_item(blist, &dev->bsink_list) { struct comp_buffer *sink = container_of(blist, struct comp_buffer, source_list); - struct comp_buffer __sparse_cache *sink_c = buffer_acquire(sink); + struct comp_buffer *sink_c = buffer_acquire(sink); int sink_buf_id; if (!sink_c->sink) { @@ -848,7 +848,7 @@ static int kpb_prepare(struct comp_dev *dev) list_for_item(blist, &dev->bsink_list) { struct comp_buffer *sink = container_of(blist, struct comp_buffer, source_list); - struct comp_buffer __sparse_cache *sink_c = buffer_acquire(sink); + struct comp_buffer *sink_c = buffer_acquire(sink); enum sof_comp_type type; if (!sink_c->sink) { @@ -886,7 +886,7 @@ static int kpb_prepare(struct comp_dev *dev) list_for_item(sink_list, &dev->bsink_list) { struct comp_buffer *sink = container_of(sink_list, struct comp_buffer, source_list); - struct comp_buffer __sparse_cache *sink_c = buffer_acquire(sink); + struct comp_buffer *sink_c = buffer_acquire(sink); audio_stream_init_alignment_constants(byte_align, frame_align_req, &sink_c->stream); @@ -991,12 +991,12 @@ static int kpb_reset(struct comp_dev *dev) #ifdef KPB_HIFI3 #if CONFIG_FORMAT_S16LE -static void kpb_micselect_copy16(struct comp_buffer __sparse_cache *sink, - struct comp_buffer __sparse_cache *source, size_t size, +static void kpb_micselect_copy16(struct comp_buffer *sink, + struct comp_buffer *source, size_t size, uint32_t in_channels, uint32_t micsel_channels, uint32_t *offsets) { - struct audio_stream __sparse_cache *istream = &source->stream; - struct audio_stream __sparse_cache *ostream = &sink->stream; + struct audio_stream *istream = &source->stream; + struct audio_stream *ostream = &sink->stream; uint16_t ch; size_t i; @@ -1024,12 +1024,12 @@ static void kpb_micselect_copy16(struct comp_buffer __sparse_cache *sink, } #endif #if CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE -static void kpb_micselect_copy32(struct comp_buffer __sparse_cache *sink, - struct comp_buffer __sparse_cache *source, size_t size, +static void kpb_micselect_copy32(struct comp_buffer *sink, + struct comp_buffer *source, size_t size, uint32_t in_channels, uint32_t micsel_channels, uint32_t *offsets) { - struct audio_stream __sparse_cache *istream = &source->stream; - struct audio_stream __sparse_cache *ostream = &sink->stream; + struct audio_stream *istream = &source->stream; + struct audio_stream *ostream = &sink->stream; uint16_t ch; size_t i; @@ -1058,12 +1058,12 @@ static void kpb_micselect_copy32(struct comp_buffer __sparse_cache *sink, } #endif #else -static void kpb_micselect_copy16(struct comp_buffer __sparse_cache *sink, - struct comp_buffer __sparse_cache *source, size_t size, +static void kpb_micselect_copy16(struct comp_buffer *sink, + struct comp_buffer *source, size_t size, uint32_t in_channels, uint32_t micsel_channels, uint32_t *offsets) { - struct audio_stream __sparse_cache *istream = &source->stream; - struct audio_stream __sparse_cache *ostream = &sink->stream; + struct audio_stream *istream = &source->stream; + struct audio_stream *ostream = &sink->stream; buffer_stream_invalidate(source, size); size_t out_samples; @@ -1090,12 +1090,12 @@ static void kpb_micselect_copy16(struct comp_buffer __sparse_cache *sink, } } -static void kpb_micselect_copy32(struct comp_buffer __sparse_cache *sink, - struct comp_buffer __sparse_cache *source, size_t size, +static void kpb_micselect_copy32(struct comp_buffer *sink, + struct comp_buffer *source, size_t size, uint32_t in_channels, uint32_t micsel_channels, uint32_t *offsets) { - struct audio_stream __sparse_cache *istream = &source->stream; - struct audio_stream __sparse_cache *ostream = &sink->stream; + struct audio_stream *istream = &source->stream; + struct audio_stream *ostream = &sink->stream; buffer_stream_invalidate(source, size); size_t out_samples; @@ -1121,8 +1121,8 @@ static void kpb_micselect_copy32(struct comp_buffer __sparse_cache *sink, } } #endif -static void kpb_micselect_copy(struct comp_dev *dev, struct comp_buffer __sparse_cache *sink_c, - struct comp_buffer __sparse_cache *source_c, size_t copy_bytes, +static void kpb_micselect_copy(struct comp_dev *dev, struct comp_buffer *sink_c, + struct comp_buffer *source_c, size_t copy_bytes, uint32_t channels) { struct comp_data *kpb = comp_get_drvdata(dev); @@ -1167,7 +1167,7 @@ static int kpb_copy(struct comp_dev *dev) int ret = 0; struct comp_data *kpb = comp_get_drvdata(dev); struct comp_buffer *source, *sink; - struct comp_buffer __sparse_cache *source_c, *sink_c = NULL; + struct comp_buffer *source_c, *sink_c = NULL; size_t copy_bytes = 0, produced_bytes = 0; size_t sample_width = kpb->config.sampling_width; struct draining_data *dd = &kpb->draining_task_data; @@ -1365,7 +1365,7 @@ static int kpb_copy(struct comp_dev *dev) * */ static int kpb_buffer_data(struct comp_dev *dev, - const struct comp_buffer __sparse_cache *source, size_t size) + const struct comp_buffer *source, size_t size) { int ret = 0; size_t size_to_copy = size; @@ -1729,7 +1729,7 @@ static void kpb_init_draining(struct comp_dev *dev, struct kpb_client *cli) static enum task_state kpb_draining_task(void *arg) { struct draining_data *draining_data = (struct draining_data *)arg; - struct comp_buffer __sparse_cache *sink = buffer_acquire(draining_data->sink); + struct comp_buffer *sink = buffer_acquire(draining_data->sink); struct history_buffer *buff = draining_data->hb; size_t drain_req = draining_data->drain_req; size_t sample_width = draining_data->sample_width; @@ -1880,7 +1880,7 @@ static enum task_state kpb_draining_task(void *arg) #ifdef KPB_HIFI3 static void kpb_convert_24b_to_32b(const void *linear_source, int ioffset, - struct audio_stream __sparse_cache *sink, int ooffset, + struct audio_stream *sink, int ooffset, unsigned int n_samples) { int ssize = audio_stream_sample_bytes(sink); @@ -1928,7 +1928,7 @@ static void kpb_convert_24b_to_32b(const void *linear_source, int ioffset, } #else static void kpb_convert_24b_to_32b(const void *source, int ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, int ooffset, unsigned int samples) { int ssize = audio_stream_sample_bytes(sink); @@ -1960,7 +1960,7 @@ static void kpb_convert_24b_to_32b(const void *source, int ioffset, * * \return none. */ -static void kpb_drain_samples(void *source, struct audio_stream __sparse_cache *sink, +static void kpb_drain_samples(void *source, struct audio_stream *sink, size_t size, size_t sample_width) { unsigned int samples; @@ -1989,7 +1989,7 @@ static void kpb_drain_samples(void *source, struct audio_stream __sparse_cache * } #ifdef KPB_HIFI3 -static void kpb_convert_32b_to_24b(const struct audio_stream __sparse_cache *source, int ioffset, +static void kpb_convert_32b_to_24b(const struct audio_stream *source, int ioffset, void *linear_sink, int ooffset, unsigned int n_samples) { int ssize = audio_stream_sample_bytes(source); @@ -2027,7 +2027,7 @@ static void kpb_convert_32b_to_24b(const struct audio_stream __sparse_cache *sou } } #else -static void kpb_convert_32b_to_24b(const struct audio_stream __sparse_cache *source, int ioffset, +static void kpb_convert_32b_to_24b(const struct audio_stream *source, int ioffset, void *sink, int ooffset, unsigned int samples) { int ssize = audio_stream_sample_bytes(source); @@ -2060,7 +2060,7 @@ static void kpb_convert_32b_to_24b(const struct audio_stream __sparse_cache *sou * \param[in] size Requested copy size in bytes. * \param[in] sample_width Sample size. */ -static void kpb_buffer_samples(const struct audio_stream __sparse_cache *source, +static void kpb_buffer_samples(const struct audio_stream *source, int offset, void *sink, size_t size, size_t sample_width) { @@ -2147,8 +2147,8 @@ static inline bool kpb_is_sample_width_supported(uint32_t sampling_width) } #ifdef KPB_HIFI3 -static void kpb_copy_24b_in_32b(const struct audio_stream __sparse_cache *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, uint32_t ooffset, +static void kpb_copy_24b_in_32b(const struct audio_stream *source, uint32_t ioffset, + struct audio_stream *sink, uint32_t ooffset, uint32_t n_samples) { int ssize = audio_stream_sample_bytes(source); /* src fmt == sink fmt */ @@ -2181,8 +2181,8 @@ static void kpb_copy_24b_in_32b(const struct audio_stream __sparse_cache *source } } #else -static void kpb_copy_24b_in_32b(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static void kpb_copy_24b_in_32b(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -2217,12 +2217,12 @@ static void kpb_copy_24b_in_32b(const struct audio_stream __sparse_cache *source * * \return none. */ -static void kpb_copy_samples(struct comp_buffer __sparse_cache *sink, - struct comp_buffer __sparse_cache *source, size_t size, +static void kpb_copy_samples(struct comp_buffer *sink, + struct comp_buffer *source, size_t size, size_t sample_width, uint32_t channels) { - struct audio_stream __sparse_cache *istream = &source->stream; - struct audio_stream __sparse_cache *ostream = &sink->stream; + struct audio_stream *istream = &source->stream; + struct audio_stream *ostream = &sink->stream; unsigned int samples; buffer_stream_invalidate(source, size); diff --git a/src/audio/mfcc/mfcc.c b/src/audio/mfcc/mfcc.c index b93e49dab743..bc3803a104ff 100644 --- a/src/audio/mfcc/mfcc.c +++ b/src/audio/mfcc/mfcc.c @@ -161,8 +161,8 @@ static int mfcc_process(struct processing_module *mod, struct output_stream_buffer *output_buffers, int num_output_buffers) { struct mfcc_comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = input_buffers->data; - struct audio_stream __sparse_cache *sink = output_buffers->data; + struct audio_stream *source = input_buffers->data; + struct audio_stream *sink = output_buffers->data; int frames = input_buffers->size; comp_dbg(mod->dev, "mfcc_process(), start"); @@ -187,14 +187,14 @@ static void mfcc_set_alignment(struct audio_stream *source, struct audio_stream } static int mfcc_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct mfcc_comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb; struct comp_buffer *sinkb; - struct comp_buffer __sparse_cache *source_c; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *source_c; + struct comp_buffer *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame source_format; enum sof_ipc_frame sink_format; diff --git a/src/audio/mfcc/mfcc_common.c b/src/audio/mfcc/mfcc_common.c index 8ea1d7db4184..63ab84943669 100644 --- a/src/audio/mfcc/mfcc_common.c +++ b/src/audio/mfcc/mfcc_common.c @@ -143,7 +143,7 @@ static int mfcc_stft_process(const struct comp_dev *dev, struct mfcc_state *stat void mfcc_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *sink = bsink->data; struct mfcc_comp_data *cd = module_get_private_data(mod); struct mfcc_state *state = &cd->state; struct mfcc_buffer *buf = &cd->state.buf; diff --git a/src/audio/mfcc/mfcc_generic.c b/src/audio/mfcc/mfcc_generic.c index 447b1382ce11..9384b16e0cee 100644 --- a/src/audio/mfcc/mfcc_generic.c +++ b/src/audio/mfcc/mfcc_generic.c @@ -27,7 +27,7 @@ void mfcc_source_copy_s16(struct input_stream_buffer *bsource, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel) { - struct audio_stream __sparse_cache *source = bsource->data; + struct audio_stream *source = bsource->data; int32_t s; int16_t *x0; int16_t *x = audio_stream_get_rptr(source); diff --git a/src/audio/mfcc/mfcc_hifi3.c b/src/audio/mfcc/mfcc_hifi3.c index 6b274a58ae84..41062e014893 100644 --- a/src/audio/mfcc/mfcc_hifi3.c +++ b/src/audio/mfcc/mfcc_hifi3.c @@ -36,7 +36,7 @@ static inline void set_circular_buf0(const void *start, const void *end) void mfcc_source_copy_s16(struct input_stream_buffer *bsource, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel) { - struct audio_stream __sparse_cache *source = bsource->data; + struct audio_stream *source = bsource->data; int copied; int nmax; int n; diff --git a/src/audio/mfcc/mfcc_hifi4.c b/src/audio/mfcc/mfcc_hifi4.c index 4e8853a4903b..25df53b4ca06 100644 --- a/src/audio/mfcc/mfcc_hifi4.c +++ b/src/audio/mfcc/mfcc_hifi4.c @@ -42,7 +42,7 @@ static inline void set_circular_buf1(const void *start, const void *end) void mfcc_source_copy_s16(struct input_stream_buffer *bsource, struct mfcc_buffer *buf, struct mfcc_pre_emph *emph, int frames, int source_channel) { - struct audio_stream __sparse_cache *source = bsource->data; + struct audio_stream *source = bsource->data; int num_channels = audio_stream_get_channels(source); ae_int16 *in = (ae_int16 *)source->r_ptr + source_channel; ae_int16 *out = (ae_int16 *)buf->w_ptr; diff --git a/src/audio/mixer/mixer.c b/src/audio/mixer/mixer.c index 3dc6ee1407dc..b26a880d1d1f 100644 --- a/src/audio/mixer/mixer.c +++ b/src/audio/mixer/mixer.c @@ -82,7 +82,7 @@ static int mixer_process(struct processing_module *mod, { struct mixer_data *md = module_get_private_data(mod); struct comp_dev *dev = mod->dev; - const struct audio_stream __sparse_cache *sources_stream[PLATFORM_MAX_STREAMS]; + const struct audio_stream *sources_stream[PLATFORM_MAX_STREAMS]; int sources_indices[PLATFORM_MAX_STREAMS]; int32_t i = 0, j = 0; uint32_t frames = INT32_MAX; @@ -174,7 +174,7 @@ static int mixer_reset(struct processing_module *mod) /* FIXME: this is racy and implicitly protected by serialised IPCs */ struct comp_buffer *source = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c = buffer_acquire(source); + struct comp_buffer *source_c = buffer_acquire(source); bool stop = false; if (source_c->source && source_c->source->state > COMP_STATE_READY) @@ -194,7 +194,7 @@ static int mixer_reset(struct processing_module *mod) } /* init and calculate the aligned setting for available frames and free frames retrieve*/ -static inline void mixer_set_frame_alignment(struct audio_stream __sparse_cache *source) +static inline void mixer_set_frame_alignment(struct audio_stream *source) { #if XCHAL_HAVE_HIFI3 || XCHAL_HAVE_HIFI4 @@ -220,11 +220,11 @@ static inline void mixer_set_frame_alignment(struct audio_stream __sparse_cache } static int mixer_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct mixer_data *md = module_get_private_data(mod); - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct comp_dev *dev = mod->dev; struct comp_buffer *sink; struct list_item *blist; @@ -239,7 +239,7 @@ static int mixer_prepare(struct processing_module *mod, /* check each mixer source state */ list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; bool stop; /* diff --git a/src/audio/mixer/mixer_generic.c b/src/audio/mixer/mixer_generic.c index b8be3ecf63a1..0deabe2093a7 100644 --- a/src/audio/mixer/mixer_generic.c +++ b/src/audio/mixer/mixer_generic.c @@ -11,8 +11,8 @@ #if CONFIG_FORMAT_S16LE /* Mix n 16 bit PCM source streams to one sink stream */ -static void mix_n_s16(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +static void mix_n_s16(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames) { int16_t *src[PLATFORM_MAX_CHANNELS]; @@ -57,8 +57,8 @@ static void mix_n_s16(struct comp_dev *dev, struct audio_stream __sparse_cache * #if CONFIG_FORMAT_S24LE /* Mix n 24 bit PCM source streams to one sink stream */ -static void mix_n_s24(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +static void mix_n_s24(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames) { int32_t *src[PLATFORM_MAX_CHANNELS]; @@ -105,8 +105,8 @@ static void mix_n_s24(struct comp_dev *dev, struct audio_stream __sparse_cache * #if CONFIG_FORMAT_S32LE /* Mix n 32 bit PCM source streams to one sink stream */ -static void mix_n_s32(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +static void mix_n_s32(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames) { int32_t *src[PLATFORM_MAX_CHANNELS]; diff --git a/src/audio/mixer/mixer_hifi3.c b/src/audio/mixer/mixer_hifi3.c index 3147ce0a35b6..2bba6c213df6 100644 --- a/src/audio/mixer/mixer_hifi3.c +++ b/src/audio/mixer/mixer_hifi3.c @@ -13,8 +13,8 @@ #if CONFIG_FORMAT_S16LE /* Mix n 16 bit PCM source streams to one sink stream */ -static void mix_n_s16(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +static void mix_n_s16(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames) { ae_int16x4 * in[PLATFORM_MAX_CHANNELS]; @@ -69,8 +69,8 @@ static void mix_n_s16(struct comp_dev *dev, struct audio_stream __sparse_cache * #if CONFIG_FORMAT_S24LE /* Mix n 24 bit PCM source streams to one sink stream */ -static void mix_n_s24(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +static void mix_n_s24(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames) { ae_int32x2 *in[PLATFORM_MAX_CHANNELS]; @@ -114,8 +114,8 @@ static void mix_n_s24(struct comp_dev *dev, struct audio_stream __sparse_cache * #if CONFIG_FORMAT_S32LE /* Mix n 32 bit PCM source streams to one sink stream */ -static void mix_n_s32(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +static void mix_n_s32(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames) { ae_q32s * in[PLATFORM_MAX_CHANNELS]; diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index 78d69223de56..6538e8747fc3 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -167,9 +167,9 @@ static int mixout_free(struct processing_module *mod) } static int mix_and_remap(struct comp_dev *dev, const struct mixin_data *mixin_data, - uint16_t sink_index, struct audio_stream __sparse_cache *sink, + uint16_t sink_index, struct audio_stream *sink, uint32_t start_frame, uint32_t mixed_frames, - const struct audio_stream __sparse_cache *source, uint32_t frame_count) + const struct audio_stream *source, uint32_t frame_count) { const struct mixin_sink_config *sink_config; @@ -197,7 +197,7 @@ static int mix_and_remap(struct comp_dev *dev, const struct mixin_data *mixin_da } /* mix silence into stream, i.e. set not yet mixed data in stream to zero */ -static void silence(struct audio_stream __sparse_cache *stream, uint32_t start_frame, +static void silence(struct audio_stream *stream, uint32_t start_frame, uint32_t mixed_frames, uint32_t frame_count) { uint32_t skip_mixed_frames; @@ -274,19 +274,19 @@ static int mixin_process(struct processing_module *mod, * and frames free in each connected mixout sink buffer. */ for (i = 0; i < num_output_buffers; i++) { - struct comp_buffer __sparse_cache *unused_in_between_buf_c; + struct comp_buffer *unused_in_between_buf_c; struct comp_dev *mixout; uint16_t sink_id; struct comp_buffer *sink; struct mixout_data *mixout_data; struct processing_module *mixout_mod; struct module_source_info __sparse_cache *mod_source_info; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; uint32_t free_frames, pending_frames; /* unused buffer between mixin and mixout */ unused_in_between_buf_c = attr_container_of(output_buffers[i].data, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); mixout = unused_in_between_buf_c->sink; sink_id = IPC4_SRC_QUEUE_ID(unused_in_between_buf_c->id); @@ -334,7 +334,7 @@ static int mixin_process(struct processing_module *mod, } if (source_avail_frames > 0) { - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; frames_to_copy = MIN(source_avail_frames, sinks_free_frames); bytes_to_consume_from_source_buf = @@ -342,7 +342,7 @@ static int mixin_process(struct processing_module *mod, if (bytes_to_consume_from_source_buf > 0) { input_buffers[0].consumed = bytes_to_consume_from_source_buf; source_c = attr_container_of(input_buffers[0].data, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); buffer_stream_invalidate(source_c, bytes_to_consume_from_source_buf); } @@ -363,7 +363,7 @@ static int mixin_process(struct processing_module *mod, struct module_source_info __sparse_cache *mod_source_info; struct processing_module *mixout_mod; uint32_t start_frame; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; uint32_t writeback_size; mixout = active_mixouts[i]; @@ -455,14 +455,14 @@ static int mixout_process(struct processing_module *mod, * produced now. */ for (i = 0; i < num_input_buffers; i++) { - const struct audio_stream __sparse_cache *source_stream; - struct comp_buffer __sparse_cache *unused_in_between_buf; + const struct audio_stream *source_stream; + struct comp_buffer *unused_in_between_buf; struct comp_dev *source; int source_index; source_stream = input_buffers[i].data; unused_in_between_buf = attr_container_of(source_stream, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); source = unused_in_between_buf->source; @@ -480,15 +480,15 @@ static int mixout_process(struct processing_module *mod, if (frames_to_produce > 0 && frames_to_produce < INT32_MAX) { for (i = 0; i < num_input_buffers; i++) { - const struct audio_stream __sparse_cache *source_stream; - struct comp_buffer __sparse_cache *unused_in_between_buf; + const struct audio_stream *source_stream; + struct comp_buffer *unused_in_between_buf; struct comp_dev *source; int source_index; uint32_t pending_frames; source_stream = input_buffers[i].data; unused_in_between_buf = attr_container_of(source_stream, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); source = unused_in_between_buf->source; @@ -547,7 +547,7 @@ static int mixout_reset(struct processing_module *mod) if (dev->pipeline->source_comp->direction == SOF_IPC_STREAM_PLAYBACK) { list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; bool stop; /* FIXME: this is racy and implicitly protected by serialised IPCs */ @@ -584,7 +584,7 @@ static int mixin_params(struct processing_module *mod) */ list_for_item(blist, &dev->bsink_list) { struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; enum sof_ipc_frame frame_fmt, valid_fmt; uint16_t sink_id; @@ -641,13 +641,13 @@ static int mixin_params(struct processing_module *mod) * if downstream is not currently active. */ static int mixin_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct mixin_data *md = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; enum sof_ipc_frame fmt; int ret; @@ -687,7 +687,7 @@ static int mixout_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame frame_fmt, valid_fmt; uint32_t sink_period_bytes, sink_stream_size; @@ -737,8 +737,8 @@ static int mixout_params(struct processing_module *mod) } static int mixout_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct module_source_info __sparse_cache *mod_source_info; struct comp_dev *dev = mod->dev; diff --git a/src/audio/mixin_mixout/mixin_mixout_generic.c b/src/audio/mixin_mixout/mixin_mixout_generic.c index 75468fdb4d67..a99788be32bc 100644 --- a/src/audio/mixin_mixout/mixin_mixout_generic.c +++ b/src/audio/mixin_mixout/mixin_mixout_generic.c @@ -17,9 +17,9 @@ * parameters: multichannel stream is treated as single channel and so the entire stream * contents is mixed. */ -static void normal_mix_channel_s16(struct audio_stream __sparse_cache *sink, int32_t start_frame, +static void normal_mix_channel_s16(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain) { int32_t frames_to_mix, frames_to_copy, left_frames; @@ -61,7 +61,7 @@ static void normal_mix_channel_s16(struct audio_stream __sparse_cache *sink, int } } -static void mute_channel_s16(struct audio_stream __sparse_cache *stream, int32_t channel_index, +static void mute_channel_s16(struct audio_stream *stream, int32_t channel_index, int32_t start_frame, int32_t mixed_frames, int32_t frame_count) { int32_t skip_mixed_frames, n, left_frames, i, channel_count, frames, samples; @@ -101,9 +101,9 @@ static void mute_channel_s16(struct audio_stream __sparse_cache *stream, int32_t * parameters: multichannel stream is treated as single channel and so the entire stream * contents is mixed. */ -static void normal_mix_channel_s24(struct audio_stream __sparse_cache *sink, int32_t start_frame, +static void normal_mix_channel_s24(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain) { int32_t frames_to_mix, frames_to_copy, left_frames; @@ -153,9 +153,9 @@ static void normal_mix_channel_s24(struct audio_stream __sparse_cache *sink, int * parameters: multichannel stream is treated as single channel and so the entire stream * contents is mixed. */ -static void normal_mix_channel_s32(struct audio_stream __sparse_cache *sink, int32_t start_frame, +static void normal_mix_channel_s32(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain) { int32_t frames_to_mix, frames_to_copy, left_frames; @@ -198,7 +198,7 @@ static void normal_mix_channel_s32(struct audio_stream __sparse_cache *sink, int #endif /* CONFIG_FORMAT_S32LE */ #if CONFIG_FORMAT_S32LE || CONFIG_FORMAT_S24LE -static void mute_channel_s32(struct audio_stream __sparse_cache *stream, int32_t channel_index, +static void mute_channel_s32(struct audio_stream *stream, int32_t channel_index, int32_t start_frame, int32_t mixed_frames, int32_t frame_count) { int32_t skip_mixed_frames, left_frames, n, channel_count, i, frames, samples; diff --git a/src/audio/mixin_mixout/mixin_mixout_hifi3.c b/src/audio/mixin_mixout/mixin_mixout_hifi3.c index 3fb46f2b74f6..93905a5d80af 100644 --- a/src/audio/mixin_mixout/mixin_mixout_hifi3.c +++ b/src/audio/mixin_mixout/mixin_mixout_hifi3.c @@ -16,9 +16,9 @@ * parameters: multichannel stream is treated as single channel and so the entire stream * contents is mixed. */ -static void normal_mix_channel_s16(struct audio_stream __sparse_cache *sink, int32_t start_frame, +static void normal_mix_channel_s16(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain) { int frames_to_mix, frames_to_copy, left_frames; @@ -104,7 +104,7 @@ static void normal_mix_channel_s16(struct audio_stream __sparse_cache *sink, int } } -static void mute_channel_s16(struct audio_stream __sparse_cache *stream, int32_t channel_index, +static void mute_channel_s16(struct audio_stream *stream, int32_t channel_index, int32_t start_frame, int32_t mixed_frames, int32_t frame_count) { int skip_mixed_frames, left_frames; @@ -140,9 +140,9 @@ static void mute_channel_s16(struct audio_stream __sparse_cache *stream, int32_t * parameters: multichannel stream is treated as single channel and so the entire stream * contents is mixed. */ -static void normal_mix_channel_s24(struct audio_stream __sparse_cache *sink, int32_t start_frame, +static void normal_mix_channel_s24(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain) { int frames_to_mix, frames_to_copy, left_frames; @@ -230,9 +230,9 @@ static void normal_mix_channel_s24(struct audio_stream __sparse_cache *sink, int * parameters: multichannel stream is treated as single channel and so the entire stream * contents is mixed. */ -static void normal_mix_channel_s32(struct audio_stream __sparse_cache *sink, int32_t start_frame, +static void normal_mix_channel_s32(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain) { int frames_to_mix, frames_to_copy, left_frames; @@ -315,7 +315,7 @@ static void normal_mix_channel_s32(struct audio_stream __sparse_cache *sink, int #endif /* CONFIG_FORMAT_S32LE */ #if CONFIG_FORMAT_S32LE || CONFIG_FORMAT_S24LE -static void mute_channel_s32(struct audio_stream __sparse_cache *stream, int32_t channel_index, +static void mute_channel_s32(struct audio_stream *stream, int32_t channel_index, int32_t start_frame, int32_t mixed_frames, int32_t frame_count) { int skip_mixed_frames, left_frames; diff --git a/src/audio/module_adapter/module/cadence.c b/src/audio/module_adapter/module/cadence.c index 9279ce3a430a..d3f9a9e407e7 100644 --- a/src/audio/module_adapter/module/cadence.c +++ b/src/audio/module_adapter/module/cadence.c @@ -633,8 +633,8 @@ static int cadence_codec_init_process(struct processing_module *mod) } static int cadence_codec_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { int ret = 0, mem_tabs_size; struct comp_dev *dev = mod->dev; @@ -716,7 +716,7 @@ cadence_codec_process(struct processing_module *mod, struct output_stream_buffer *output_buffers, int num_output_buffers) { struct comp_buffer *local_buff; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct comp_dev *dev = mod->dev; struct module_data *codec = &mod->priv; struct cadence_codec_data *cd = codec->private; diff --git a/src/audio/module_adapter/module/dts/dts.c b/src/audio/module_adapter/module/dts/dts.c index 62415f38c660..b136b23f586e 100644 --- a/src/audio/module_adapter/module/dts/dts.c +++ b/src/audio/module_adapter/module/dts/dts.c @@ -78,8 +78,8 @@ static int dts_effect_populate_buffer_configuration(struct comp_dev *dev, { struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c; - const struct audio_stream __sparse_cache *stream; + struct comp_buffer *source_c; + const struct audio_stream *stream; DtsSofInterfaceBufferLayout buffer_layout; DtsSofInterfaceBufferFormat buffer_format; unsigned int buffer_fmt, frame_fmt, rate, channels; @@ -184,8 +184,8 @@ static int dts_codec_init(struct processing_module *mod) } static int dts_codec_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { int ret; struct comp_dev *dev = mod->dev; diff --git a/src/audio/module_adapter/module/generic.c b/src/audio/module_adapter/module/generic.c index 760652982245..709230b6639f 100644 --- a/src/audio/module_adapter/module/generic.c +++ b/src/audio/module_adapter/module/generic.c @@ -196,8 +196,8 @@ static int validate_config(struct module_config *cfg) } int module_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { int ret; struct module_data *md = &mod->priv; @@ -283,8 +283,8 @@ int module_process_legacy(struct processing_module *mod, } int module_process_sink_src(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_dev *dev = mod->dev; diff --git a/src/audio/module_adapter/module/modules.c b/src/audio/module_adapter/module/modules.c index 865aa945baea..1bb917fd36a4 100644 --- a/src/audio/module_adapter/module/modules.c +++ b/src/audio/module_adapter/module/modules.c @@ -155,8 +155,8 @@ static int modules_init(struct processing_module *mod) * There is one assumption - all IADK modules utilize IPC4 protocol. */ static int modules_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_dev *dev = mod->dev; int ret = 0; diff --git a/src/audio/module_adapter/module/passthrough.c b/src/audio/module_adapter/module/passthrough.c index a7e41c04ff65..ef86eadc896e 100644 --- a/src/audio/module_adapter/module/passthrough.c +++ b/src/audio/module_adapter/module/passthrough.c @@ -21,8 +21,8 @@ static int passthrough_codec_init(struct processing_module *mod) } static int passthrough_codec_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_dev *dev = mod->dev; struct module_data *codec = &mod->priv; diff --git a/src/audio/module_adapter/module/waves/waves.c b/src/audio/module_adapter/module/waves/waves.c index 570a68f27b82..1124bc5d3a69 100644 --- a/src/audio/module_adapter/module/waves/waves.c +++ b/src/audio/module_adapter/module/waves/waves.c @@ -220,10 +220,10 @@ static int waves_effect_check(struct comp_dev *dev) source_list); struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c = buffer_acquire(source); - struct comp_buffer __sparse_cache *sink_c = buffer_acquire(sink); - const struct audio_stream __sparse_cache *src_fmt = &source_c->stream; - const struct audio_stream __sparse_cache *snk_fmt = &sink_c->stream; + struct comp_buffer *source_c = buffer_acquire(source); + struct comp_buffer *sink_c = buffer_acquire(sink); + const struct audio_stream *src_fmt = &source_c->stream; + const struct audio_stream *snk_fmt = &sink_c->stream; int ret = 0; /* Init sink & source buffers */ @@ -303,10 +303,10 @@ static int waves_effect_init(struct processing_module *mod) struct comp_dev *dev = mod->dev; struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c = buffer_acquire(source); + struct comp_buffer *source_c = buffer_acquire(source); struct module_data *codec = &mod->priv; struct waves_codec_data *waves_codec = codec->private; - const struct audio_stream __sparse_cache *src_fmt = &source_c->stream; + const struct audio_stream *src_fmt = &source_c->stream; MaxxStatus_t status; MaxxBuffer_Format_t sample_format; MaxxBuffer_Layout_t buffer_format; @@ -686,8 +686,8 @@ static int waves_codec_init(struct processing_module *mod) } static int waves_codec_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_dev *dev = mod->dev; int ret; diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 81b0cb890bf8..824fe9fa831b 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -175,10 +175,10 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, static int module_adapter_sink_src_prepare(struct comp_dev *dev) { - struct comp_buffer __sparse_cache *source_buffers_c[PLATFORM_MAX_STREAMS]; - struct comp_buffer __sparse_cache *sinks_buffers_c[PLATFORM_MAX_STREAMS]; - struct sof_sink __sparse_cache *audio_sink[PLATFORM_MAX_STREAMS]; - struct sof_source __sparse_cache *audio_src[PLATFORM_MAX_STREAMS]; + struct comp_buffer *source_buffers_c[PLATFORM_MAX_STREAMS]; + struct comp_buffer *sinks_buffers_c[PLATFORM_MAX_STREAMS]; + struct sof_sink *audio_sink[PLATFORM_MAX_STREAMS]; + struct sof_source *audio_src[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; uint32_t num_of_sources = 0; @@ -236,8 +236,8 @@ int module_adapter_prepare(struct comp_dev *dev) int ret; struct processing_module *mod = comp_get_drvdata(dev); struct module_data *md = &mod->priv; - struct comp_buffer __sparse_cache *buffer_c; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *buffer_c; + struct comp_buffer *sink_c; struct comp_buffer *sink; struct list_item *blist, *_blist; uint32_t buff_periods; @@ -567,7 +567,7 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa * @bytes: number of bytes available in the source buffer */ static void -ca_copy_from_source_to_module(const struct audio_stream __sparse_cache *source, +ca_copy_from_source_to_module(const struct audio_stream *source, void __sparse_cache *buff, uint32_t buff_size, size_t bytes) { /* head_size - available data until end of source buffer */ @@ -595,7 +595,7 @@ ca_copy_from_source_to_module(const struct audio_stream __sparse_cache *source, * @bytes: number of bytes available in the module output buffer */ static void -ca_copy_from_module_to_sink(const struct audio_stream __sparse_cache *sink, +ca_copy_from_module_to_sink(const struct audio_stream *sink, void __sparse_cache *buff, size_t bytes) { /* head_size - free space until end of sink buffer */ @@ -624,7 +624,7 @@ ca_copy_from_module_to_sink(const struct audio_stream __sparse_cache *sink, * * \return: none. */ -static void generate_zeroes(struct comp_buffer __sparse_cache *sink, uint32_t bytes) +static void generate_zeroes(struct comp_buffer *sink, uint32_t bytes) { uint32_t tmp, copy_bytes = bytes; void *ptr; @@ -639,8 +639,8 @@ static void generate_zeroes(struct comp_buffer __sparse_cache *sink, uint32_t by comp_update_buffer_produce(sink, bytes); } -static void module_copy_samples(struct comp_dev *dev, struct comp_buffer __sparse_cache *src_buffer, - struct comp_buffer __sparse_cache *sink_buffer, uint32_t produced) +static void module_copy_samples(struct comp_dev *dev, struct comp_buffer *src_buffer, + struct comp_buffer *sink_buffer, uint32_t produced) { struct processing_module *mod = comp_get_drvdata(dev); struct comp_copy_limits cl; @@ -681,7 +681,7 @@ static void module_adapter_process_output(struct comp_dev *dev) { struct processing_module *mod = comp_get_drvdata(dev); struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct list_item *blist; int i = 0; @@ -692,7 +692,7 @@ static void module_adapter_process_output(struct comp_dev *dev) list_for_item(blist, &mod->sink_buffer_list) { if (mod->output_buffers[i].size > 0) { struct comp_buffer *buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; buffer = container_of(blist, struct comp_buffer, sink_list); buffer_c = buffer_acquire(buffer); @@ -714,7 +714,7 @@ static void module_adapter_process_output(struct comp_dev *dev) list_for_item(_blist, &mod->sink_buffer_list) { if (i == j) { struct comp_buffer *source; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; sink = container_of(blist, struct comp_buffer, source_list); source = container_of(_blist, struct comp_buffer, sink_list); @@ -739,8 +739,8 @@ static void module_adapter_process_output(struct comp_dev *dev) static uint32_t module_single_sink_setup(struct comp_dev *dev, - struct comp_buffer __sparse_cache **source_c, - struct comp_buffer __sparse_cache **sinks_c) + struct comp_buffer **source_c, + struct comp_buffer **sinks_c) { struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; @@ -780,8 +780,8 @@ module_single_sink_setup(struct comp_dev *dev, static uint32_t module_single_source_setup(struct comp_dev *dev, - struct comp_buffer __sparse_cache **source_c, - struct comp_buffer __sparse_cache **sinks_c) + struct comp_buffer **source_c, + struct comp_buffer **sinks_c) { struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; @@ -824,8 +824,8 @@ module_single_source_setup(struct comp_dev *dev, static int module_adapter_audio_stream_copy_1to1(struct comp_dev *dev) { struct processing_module *mod = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *source_c; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *source_c; + struct comp_buffer *sink_c; uint32_t num_output_buffers = 0; uint32_t frames; int ret; @@ -872,8 +872,8 @@ static int module_adapter_audio_stream_copy_1to1(struct comp_dev *dev) static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) { - struct comp_buffer __sparse_cache *source_c[PLATFORM_MAX_STREAMS]; - struct comp_buffer __sparse_cache *sinks_c[PLATFORM_MAX_STREAMS]; + struct comp_buffer *source_c[PLATFORM_MAX_STREAMS]; + struct comp_buffer *sinks_c[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; uint32_t num_input_buffers, num_output_buffers; @@ -949,10 +949,10 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* consume from all active input buffers */ for (i = 0; i < num_input_buffers; i++) { - struct comp_buffer __sparse_cache *src_c; + struct comp_buffer *src_c; src_c = attr_container_of(mod->input_buffers[i].data, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); if (mod->input_buffers[i].consumed) audio_stream_consume(&src_c->stream, mod->input_buffers[i].consumed); @@ -972,10 +972,10 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* produce data into all active output buffers */ for (i = 0; i < num_output_buffers; i++) { - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; sink_c = attr_container_of(mod->output_buffers[i].data, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); if (!mod->skip_sink_buffer_writeback) @@ -1010,10 +1010,10 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) static int module_adapter_sink_source_copy(struct comp_dev *dev) { - struct comp_buffer __sparse_cache *source_buffers_c[PLATFORM_MAX_STREAMS]; - struct comp_buffer __sparse_cache *sinks_buffers_c[PLATFORM_MAX_STREAMS]; - struct sof_sink __sparse_cache *audio_sink[PLATFORM_MAX_STREAMS]; - struct sof_source __sparse_cache *audio_src[PLATFORM_MAX_STREAMS]; + struct comp_buffer *source_buffers_c[PLATFORM_MAX_STREAMS]; + struct comp_buffer *sinks_buffers_c[PLATFORM_MAX_STREAMS]; + struct sof_sink *audio_sink[PLATFORM_MAX_STREAMS]; + struct sof_source *audio_src[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; uint32_t num_of_sources = 0; @@ -1075,7 +1075,7 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) struct processing_module *mod = comp_get_drvdata(dev); struct module_data *md = &mod->priv; struct comp_buffer *source, *sink; - struct comp_buffer __sparse_cache *sink_c = NULL; + struct comp_buffer *sink_c = NULL; struct list_item *blist; size_t size = MAX(mod->deep_buff_bytes, mod->period_bytes); uint32_t min_free_frames = UINT_MAX; @@ -1094,7 +1094,7 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) /* copy source samples into input buffer */ list_for_item(blist, &dev->bsource_list) { - struct comp_buffer __sparse_cache *src_c; + struct comp_buffer *src_c; uint32_t bytes_to_process; int frames, source_frame_bytes; @@ -1139,7 +1139,7 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) i = 0; /* consume from all input buffers */ list_for_item(blist, &dev->bsource_list) { - struct comp_buffer __sparse_cache *src_c; + struct comp_buffer *src_c; source = container_of(blist, struct comp_buffer, sink_list); src_c = buffer_acquire(source); @@ -1334,7 +1334,7 @@ static int module_source_status_count(struct comp_dev *dev, uint32_t status) */ struct comp_buffer *source = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c = buffer_acquire(source); + struct comp_buffer *source_c = buffer_acquire(source); if (source_c->source && source_c->source->state == status) count++; @@ -1424,7 +1424,7 @@ int module_adapter_reset(struct comp_dev *dev) list_for_item(blist, &mod->sink_buffer_list) { struct comp_buffer *buffer = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(buffer); + struct comp_buffer *buffer_c = buffer_acquire(buffer); buffer_zero(buffer_c); buffer_release(buffer_c); diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index a23a6eebc830..9a836b3e5644 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -388,8 +388,8 @@ static int multiband_drc_get_config(struct processing_module *mod, return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size); } -static void multiband_drc_set_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static void multiband_drc_set_alignment(struct audio_stream *source, + struct audio_stream *sink) { /* Currently no optimizations those would use wider loads and stores */ audio_stream_init_alignment_constants(1, 1, source); @@ -403,8 +403,8 @@ static int multiband_drc_process(struct processing_module *mod, { struct multiband_drc_comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; - struct audio_stream __sparse_cache *source = input_buffers[0].data; - struct audio_stream __sparse_cache *sink = output_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; + struct audio_stream *sink = output_buffers[0].data; int frames = input_buffers[0].size; int ret; @@ -435,7 +435,7 @@ static int multiband_drc_params(struct processing_module *mod) struct sof_ipc_stream_params comp_params; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; enum sof_ipc_frame valid_fmt, frame_fmt; int i, ret; @@ -466,13 +466,13 @@ static int multiband_drc_params(struct processing_module *mod) #endif /* CONFIG_IPC_MAJOR_4 */ static int multiband_drc_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct multiband_drc_comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; int channels; int rate; int ret = 0; diff --git a/src/audio/multiband_drc/multiband_drc_generic.c b/src/audio/multiband_drc/multiband_drc_generic.c index e4d3014c9270..fff21e2653bf 100644 --- a/src/audio/multiband_drc/multiband_drc_generic.c +++ b/src/audio/multiband_drc/multiband_drc_generic.c @@ -11,8 +11,8 @@ #include <sof/math/iir_df2t.h> static void multiband_drc_default_pass(const struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { audio_stream_copy(source, 0, sink, 0, audio_stream_get_channels(source) * frames); @@ -203,8 +203,8 @@ static void multiband_drc_process_deemp(struct multiband_drc_state *state, */ #if CONFIG_FORMAT_S16LE static void multiband_drc_s16_default(const struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { struct multiband_drc_comp_data *cd = module_get_private_data(mod); @@ -270,8 +270,8 @@ static void multiband_drc_s16_default(const struct processing_module *mod, #if CONFIG_FORMAT_S24LE static void multiband_drc_s24_default(const struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { struct multiband_drc_comp_data *cd = module_get_private_data(mod); @@ -337,8 +337,8 @@ static void multiband_drc_s24_default(const struct processing_module *mod, #if CONFIG_FORMAT_S32LE static void multiband_drc_s32_default(const struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames) { struct multiband_drc_comp_data *cd = module_get_private_data(mod); diff --git a/src/audio/mux/mux.c b/src/audio/mux/mux.c index 3223f515438c..ca35d73b6131 100644 --- a/src/audio/mux/mux.c +++ b/src/audio/mux/mux.c @@ -274,7 +274,7 @@ static void set_mux_params(struct processing_module *mod) struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *sink, *source; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; struct list_item *source_list; int j; const uint32_t byte_align = 1; @@ -375,10 +375,10 @@ static struct mux_look_up *get_lookup_table(struct comp_dev *dev, struct comp_da } static void mux_prepare_active_look_up(struct comp_data *cd, - struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources) + struct audio_stream *sink, + const struct audio_stream **sources) { - const struct audio_stream __sparse_cache *source; + const struct audio_stream *source; int elem; int active_elem = 0; @@ -400,8 +400,8 @@ static void mux_prepare_active_look_up(struct comp_data *cd, } static void demux_prepare_active_look_up(struct comp_data *cd, - struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, + struct audio_stream *sink, + const struct audio_stream *source, struct mux_look_up *look_up) { int elem; @@ -429,8 +429,8 @@ static int demux_process(struct processing_module *mod, struct comp_dev *dev = mod->dev; struct list_item *clist; struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; - struct audio_stream __sparse_cache *sinks_stream[MUX_MAX_STREAMS] = { NULL }; + struct comp_buffer *sink_c; + struct audio_stream *sinks_stream[MUX_MAX_STREAMS] = { NULL }; struct mux_look_up *look_ups[MUX_MAX_STREAMS] = { NULL }; int frames; int sink_bytes; @@ -487,9 +487,9 @@ static int mux_process(struct processing_module *mod, struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *source; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; struct list_item *clist; - const struct audio_stream __sparse_cache *sources_stream[MUX_MAX_STREAMS] = { NULL }; + const struct audio_stream *sources_stream[MUX_MAX_STREAMS] = { NULL }; int frames = 0; int sink_bytes; int source_bytes; @@ -560,7 +560,7 @@ static int mux_reset(struct processing_module *mod) list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *source_c = buffer_acquire(source); + struct comp_buffer *source_c = buffer_acquire(source); int state = source_c->source->state; buffer_release(source_c); @@ -578,16 +578,16 @@ static int mux_reset(struct processing_module *mod) } static int mux_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_dev *dev = mod->dev; struct comp_data *cd = module_get_private_data(mod); struct list_item *blist; struct comp_buffer *source; struct comp_buffer *sink; - struct comp_buffer __sparse_cache *source_c; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *source_c; + struct comp_buffer *sink_c; struct sof_mux_config *config; size_t blob_size; int state; diff --git a/src/audio/mux/mux_generic.c b/src/audio/mux/mux_generic.c index dd58cedbbd6b..a00a36cc084b 100644 --- a/src/audio/mux/mux_generic.c +++ b/src/audio/mux/mux_generic.c @@ -19,11 +19,11 @@ LOG_MODULE_DECLARE(muxdemux, CONFIG_SOF_LOG_LEVEL); -static void mux_check_for_wrap(struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, +static void mux_check_for_wrap(struct audio_stream *sink, + const struct audio_stream **sources, struct mux_look_up *lookup) { - const struct audio_stream __sparse_cache *source; + const struct audio_stream *source; uint32_t elem; /* check sources and destinations for wrap */ @@ -36,8 +36,8 @@ static void mux_check_for_wrap(struct audio_stream __sparse_cache *sink, } } -static void demux_check_for_wrap(struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, +static void demux_check_for_wrap(struct audio_stream *sink, + const struct audio_stream *source, struct mux_look_up *lookup) { uint32_t elem; @@ -53,7 +53,7 @@ static void demux_check_for_wrap(struct audio_stream __sparse_cache *sink, #if CONFIG_FORMAT_S16LE -static uint32_t demux_calc_frames_without_wrap_s16(struct audio_stream __sparse_cache *sink, +static uint32_t demux_calc_frames_without_wrap_s16(struct audio_stream *sink, const struct audio_stream __sparse_cache *source, struct mux_look_up *lookup) @@ -79,12 +79,12 @@ static uint32_t demux_calc_frames_without_wrap_s16(struct audio_stream __sparse_ return min_frames; } -static uint32_t mux_calc_frames_without_wrap_s16(struct audio_stream __sparse_cache *sink, +static uint32_t mux_calc_frames_without_wrap_s16(struct audio_stream *sink, const struct audio_stream __sparse_cache **sources, struct mux_look_up *lookup) { - const struct audio_stream __sparse_cache *source; + const struct audio_stream *source; uint32_t frames; uint32_t min_frames; uint32_t elem; @@ -111,11 +111,11 @@ static uint32_t mux_calc_frames_without_wrap_s16(struct audio_stream __sparse_ca return min_frames; } -static void mux_init_look_up_pointers_s16(struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, +static void mux_init_look_up_pointers_s16(struct audio_stream *sink, + const struct audio_stream **sources, struct mux_look_up *lookup) { - const struct audio_stream __sparse_cache *source; + const struct audio_stream *source; uint32_t elem; /* init pointers */ @@ -132,8 +132,8 @@ static void mux_init_look_up_pointers_s16(struct audio_stream __sparse_cache *si } } -static void demux_init_look_up_pointers_s16(struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, +static void demux_init_look_up_pointers_s16(struct audio_stream *sink, + const struct audio_stream *source, struct mux_look_up *lookup) { uint32_t elem; @@ -162,8 +162,8 @@ static void demux_init_look_up_pointers_s16(struct audio_stream __sparse_cache * * @param[in] frames Number of frames to process. * @param[in] lookup mux look up table. */ -static void demux_s16le(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames, +static void demux_s16le(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames, struct mux_look_up *lookup) { uint32_t i; @@ -215,8 +215,8 @@ static void demux_s16le(struct comp_dev *dev, struct audio_stream __sparse_cache * @param[in] frames Number of frames to process. * @param[in] lookup mux look up table. */ -static void mux_s16le(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t frames, +static void mux_s16le(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t frames, struct mux_look_up *lookup) { uint32_t i; @@ -259,12 +259,12 @@ static void mux_s16le(struct comp_dev *dev, struct audio_stream __sparse_cache * #if CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE -static uint32_t mux_calc_frames_without_wrap_s32(struct audio_stream __sparse_cache *sink, +static uint32_t mux_calc_frames_without_wrap_s32(struct audio_stream *sink, const struct audio_stream __sparse_cache **sources, struct mux_look_up *lookup) { - const struct audio_stream __sparse_cache *source; + const struct audio_stream *source; uint32_t frames; uint32_t min_frames; uint32_t elem; @@ -289,7 +289,7 @@ static uint32_t mux_calc_frames_without_wrap_s32(struct audio_stream __sparse_ca return min_frames; } -static uint32_t demux_calc_frames_without_wrap_s32(struct audio_stream __sparse_cache *sink, +static uint32_t demux_calc_frames_without_wrap_s32(struct audio_stream *sink, const struct audio_stream __sparse_cache *source, struct mux_look_up *lookup) @@ -313,11 +313,11 @@ static uint32_t demux_calc_frames_without_wrap_s32(struct audio_stream __sparse_ return min_frames; } -static void mux_init_look_up_pointers_s32(struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, +static void mux_init_look_up_pointers_s32(struct audio_stream *sink, + const struct audio_stream **sources, struct mux_look_up *lookup) { - const struct audio_stream __sparse_cache *source; + const struct audio_stream *source; uint32_t elem; /* init pointers */ @@ -334,8 +334,8 @@ static void mux_init_look_up_pointers_s32(struct audio_stream __sparse_cache *si } } -static void demux_init_look_up_pointers_s32(struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, +static void demux_init_look_up_pointers_s32(struct audio_stream *sink, + const struct audio_stream *source, struct mux_look_up *lookup) { uint32_t elem; @@ -364,8 +364,8 @@ static void demux_init_look_up_pointers_s32(struct audio_stream __sparse_cache * * @param[in] frames Number of frames to process. * @param[in] lookup mux look up table. */ -static void demux_s32le(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames, +static void demux_s32le(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames, struct mux_look_up *lookup) { uint32_t i; @@ -417,8 +417,8 @@ static void demux_s32le(struct comp_dev *dev, struct audio_stream __sparse_cache * @param[in] frames Number of frames to process. * @param[in] lookup mux look up table. */ -static void mux_s32le(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t frames, +static void mux_s32le(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t frames, struct mux_look_up *lookup) { uint32_t i; @@ -534,7 +534,7 @@ mux_func mux_get_processing_function(struct processing_module *mod) source_list); for (i = 0; i < ARRAY_SIZE(mux_func_map); i++) { - struct comp_buffer __sparse_cache *sink_c = buffer_acquire(sinkb); + struct comp_buffer *sink_c = buffer_acquire(sinkb); enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sink_c->stream); @@ -558,7 +558,7 @@ demux_func demux_get_processing_function(struct processing_module *mod) sink_list); for (i = 0; i < ARRAY_SIZE(mux_func_map); i++) { - struct comp_buffer __sparse_cache *source_c = buffer_acquire(sourceb); + struct comp_buffer *source_c = buffer_acquire(sourceb); enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&source_c->stream); buffer_release(source_c); diff --git a/src/audio/pcm_converter/pcm_converter.c b/src/audio/pcm_converter/pcm_converter.c index 6c3753b8d8e7..5335ee295b51 100644 --- a/src/audio/pcm_converter/pcm_converter.c +++ b/src/audio/pcm_converter/pcm_converter.c @@ -15,8 +15,8 @@ #include <sof/audio/pcm_converter.h> #include <rtos/panic.h> -int pcm_convert_as_linear(const struct audio_stream __sparse_cache *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, uint32_t ooffset, +int pcm_convert_as_linear(const struct audio_stream *source, uint32_t ioffset, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples, pcm_converter_lin_func converter) { const int s_size_in = audio_stream_sample_bytes(source); diff --git a/src/audio/pcm_converter/pcm_converter_generic.c b/src/audio/pcm_converter/pcm_converter_generic.c index db3bbe9b88d4..6de32bd52495 100644 --- a/src/audio/pcm_converter/pcm_converter_generic.c +++ b/src/audio/pcm_converter/pcm_converter_generic.c @@ -34,9 +34,9 @@ #define BYTES_TO_S32_SAMPLES 2 #if CONFIG_PCM_CONVERTER_FORMAT_U8 && CONFIG_PCM_CONVERTER_FORMAT_S32LE -static int pcm_convert_u8_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, - uint32_t ooffset, uint32_t samples) +static int pcm_convert_u8_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, + uint32_t ooffset, uint32_t samples) { uint8_t *src = audio_stream_get_rptr(source); int32_t *dst = audio_stream_get_wptr(sink); @@ -63,9 +63,9 @@ static int pcm_convert_u8_to_s32(const struct audio_stream __sparse_cache *sourc return samples; } -static int pcm_convert_s32_to_u8(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, - uint32_t ooffset, uint32_t samples) +static int pcm_convert_s32_to_u8(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, + uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); uint8_t *dst = audio_stream_get_wptr(sink); @@ -95,8 +95,8 @@ static int pcm_convert_s32_to_u8(const struct audio_stream __sparse_cache *sourc #if CONFIG_PCM_CONVERTER_FORMAT_S16LE && CONFIG_PCM_CONVERTER_FORMAT_S24LE -static int pcm_convert_s16_to_s24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_to_s24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int16_t *src = audio_stream_get_rptr(source); @@ -124,8 +124,8 @@ static int pcm_convert_s16_to_s24(const struct audio_stream __sparse_cache *sour return samples; } -static int pcm_convert_s24_to_s16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_to_s16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -157,8 +157,8 @@ static int pcm_convert_s24_to_s16(const struct audio_stream __sparse_cache *sour #if CONFIG_PCM_CONVERTER_FORMAT_S16LE && CONFIG_PCM_CONVERTER_FORMAT_S32LE -static int pcm_convert_s16_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int16_t *src = audio_stream_get_rptr(source); @@ -186,8 +186,8 @@ static int pcm_convert_s16_to_s32(const struct audio_stream __sparse_cache *sour return samples; } -static int pcm_convert_s32_to_s16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_s16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -219,8 +219,8 @@ static int pcm_convert_s32_to_s16(const struct audio_stream __sparse_cache *sour #if CONFIG_PCM_CONVERTER_FORMAT_S24LE && CONFIG_PCM_CONVERTER_FORMAT_S32LE -static int pcm_convert_s24_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -248,8 +248,8 @@ static int pcm_convert_s24_to_s32(const struct audio_stream __sparse_cache *sour return samples; } -static int pcm_convert_s32_to_s24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_s24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -277,8 +277,8 @@ static int pcm_convert_s32_to_s24(const struct audio_stream __sparse_cache *sour return samples; } -static int pcm_convert_s32_to_s24_be(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_s24_be(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -442,16 +442,16 @@ static void pcm_convert_f_to_s16_lin(const void *psrc, void *pdst, dst[i] = sat_int16(_pcm_convert_f_to_i(src[i], 15)); } -static int pcm_convert_s16_to_f(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_to_f(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, pcm_convert_s16_to_f_lin); } -static int pcm_convert_f_to_s16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_f_to_s16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -486,16 +486,16 @@ static void pcm_convert_f_to_s24_lin(const void *psrc, void *pdst, dst[i] = sat_int24(_pcm_convert_f_to_i(src[i], 23)); } -static int pcm_convert_s24_to_f(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_to_f(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, pcm_convert_s24_to_f_lin); } -static int pcm_convert_f_to_s24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_f_to_s24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -530,16 +530,16 @@ static void pcm_convert_f_to_s32_lin(const void *psrc, void *pdst, dst[i] = _pcm_convert_f_to_i(src[i], 31); } -static int pcm_convert_s32_to_f(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_f(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, pcm_convert_s32_to_f_lin); } -static int pcm_convert_f_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_f_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -599,8 +599,8 @@ const struct pcm_func_map pcm_func_map[] = { const size_t pcm_func_count = ARRAY_SIZE(pcm_func_map); #if CONFIG_PCM_CONVERTER_FORMAT_S16_C16_AND_S16_C32 -static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int16_t *src = audio_stream_get_rptr(source); @@ -628,8 +628,8 @@ static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -658,8 +658,8 @@ static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream __sparse_cac } #endif #if CONFIG_PCM_CONVERTER_FORMAT_S16_C32_AND_S32_C32 -static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -687,8 +687,8 @@ static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -717,8 +717,8 @@ static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream __sparse_cac } #endif #if CONFIG_PCM_CONVERTER_FORMAT_S16_C32_AND_S24_C32 -static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -746,8 +746,8 @@ static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -777,8 +777,8 @@ static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream __sparse_cac #endif #if CONFIG_PCM_CONVERTER_FORMAT_S24_C24_AND_S24_C32 -static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { uint8_t *src = audio_stream_get_rptr(source); @@ -807,8 +807,8 @@ static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -841,8 +841,8 @@ static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream __sparse_cac } /* 2x24bit samples are packed into 3x16bit samples for hda link dma */ -static int pcm_convert_s24_c32_to_s24_c24_link_gtw(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_c32_to_s24_c24_link_gtw(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); diff --git a/src/audio/pcm_converter/pcm_converter_hifi3.c b/src/audio/pcm_converter/pcm_converter_hifi3.c index ac5c14b379bc..da7e2ff1c7d1 100644 --- a/src/audio/pcm_converter/pcm_converter_hifi3.c +++ b/src/audio/pcm_converter/pcm_converter_hifi3.c @@ -36,8 +36,8 @@ * \param[in,out] sink Destination buffer. * \param[in] samples Number of samples to process. */ -static int pcm_convert_s16_to_s24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_to_s24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { ae_int16x4 sample = AE_ZERO16(); @@ -110,8 +110,8 @@ static ae_int32x2 pcm_shift_s24_to_s16(ae_int32x2 sample) * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s24_to_s16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_to_s16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { ae_int16x4 sample = AE_ZERO16(); @@ -181,8 +181,8 @@ static int pcm_convert_s24_to_s16(const struct audio_stream __sparse_cache *sour * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s16_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int16_t *src = audio_stream_get_rptr(source); @@ -237,8 +237,8 @@ static int pcm_convert_s16_to_s32(const struct audio_stream __sparse_cache *sour * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s32_to_s16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_s16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -303,8 +303,8 @@ static int pcm_convert_s32_to_s16(const struct audio_stream __sparse_cache *sour * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s24_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -368,8 +368,8 @@ static ae_int32x2 pcm_shift_s32_to_s24(ae_int32x2 sample) * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s32_to_s24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_s24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -413,8 +413,8 @@ static int pcm_convert_s32_to_s24(const struct audio_stream __sparse_cache *sour return samples; } -static int pcm_convert_s32_to_s24_be(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_s24_be(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -541,8 +541,8 @@ static void pcm_convert_f_to_s16_lin(const void *psrc, void *pdst, * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s16_to_f(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s16_to_f(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -556,8 +556,8 @@ static int pcm_convert_s16_to_f(const struct audio_stream __sparse_cache *source * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_f_to_s16(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_f_to_s16(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -642,8 +642,8 @@ static void pcm_convert_f_to_s24_lin(const void *psrc, void *pdst, * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s24_to_f(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s24_to_f(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -657,8 +657,8 @@ static int pcm_convert_s24_to_f(const struct audio_stream __sparse_cache *source * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_f_to_s24(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_f_to_s24(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -739,8 +739,8 @@ static void pcm_convert_f_to_s32_lin(const void *psrc, void *pdst, * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_s32_to_f(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_s32_to_f(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -754,8 +754,8 @@ static int pcm_convert_s32_to_f(const struct audio_stream __sparse_cache *source * \param[in] samples Number of samples to process. * \return error code or number of processed samples. */ -static int pcm_convert_f_to_s32(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +static int pcm_convert_f_to_s32(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { return pcm_convert_as_linear(source, ioffset, sink, ooffset, samples, @@ -810,9 +810,9 @@ const struct pcm_func_map pcm_func_map[] = { const size_t pcm_func_count = ARRAY_SIZE(pcm_func_map); #if CONFIG_PCM_CONVERTER_FORMAT_S16_C16_AND_S16_C32 -static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int16_t *src = audio_stream_get_rptr(source); @@ -860,9 +860,9 @@ static int pcm_convert_s16_c16_to_s16_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -919,9 +919,9 @@ static int pcm_convert_s16_c32_to_s16_c16(const struct audio_stream __sparse_cac #endif #if CONFIG_PCM_CONVERTER_FORMAT_S16_C32_AND_S32_C32 -static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -962,9 +962,9 @@ static int pcm_convert_s16_c32_to_s32_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -1007,9 +1007,9 @@ static int pcm_convert_s32_c32_to_s16_c32(const struct audio_stream __sparse_cac #endif #if CONFIG_PCM_CONVERTER_FORMAT_S16_C32_AND_S24_C32 -static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s16_c32_to_s24_c32(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -1062,9 +1062,9 @@ static ae_int32x2 pcm_shift_s24_c32_to_s16(ae_int32x2 sample) return sample; } -static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); @@ -1109,9 +1109,9 @@ static int pcm_convert_s24_c32_to_s16_c32(const struct audio_stream __sparse_cac #endif #if CONFIG_PCM_CONVERTER_FORMAT_S24_C24_AND_S24_C32 -static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { uint8_t *src = audio_stream_get_rptr(source); @@ -1156,9 +1156,9 @@ static int pcm_convert_s24_c24_to_s24_c32(const struct audio_stream __sparse_cac return samples; } -static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream __sparse_cache *source, +static int pcm_convert_s24_c32_to_s24_c24(const struct audio_stream *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples) { int32_t *src = audio_stream_get_rptr(source); diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 160e14e15441..46b9f9b510f8 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -168,7 +168,7 @@ struct pipeline *pipeline_new(uint32_t pipeline_id, uint32_t priority, uint32_t static void buffer_set_comp(struct comp_buffer *buffer, struct comp_dev *comp, int dir) { - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(buffer); + struct comp_buffer *buffer_c = buffer_acquire(buffer); if (dir == PPL_CONN_DIR_COMP_TO_BUFFER) buffer_c->source = comp; @@ -410,7 +410,7 @@ int pipeline_for_each_comp(struct comp_dev *current, /* run this operation further */ list_for_item(clist, buffer_list) { struct comp_buffer *buffer = buffer_from_list(clist, dir); - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct comp_dev *buffer_comp; int err = 0; diff --git a/src/audio/pipeline/pipeline-params.c b/src/audio/pipeline/pipeline-params.c index 43974e290fb4..a0a53749320c 100644 --- a/src/audio/pipeline/pipeline-params.c +++ b/src/audio/pipeline/pipeline-params.c @@ -30,7 +30,7 @@ static int pipeline_comp_params_neg(struct comp_dev *current, int dir) { struct pipeline_data *ppl_data = ctx->comp_data; - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(calling_buf); + struct comp_buffer *buf_c = buffer_acquire(calling_buf); int err = 0; pipe_dbg(current->pipeline, "pipeline_comp_params_neg(), current->comp.id = %u, dir = %u", @@ -131,7 +131,7 @@ static int pipeline_comp_params(struct comp_dev *current, } /* save params changes made by component */ -static void pipeline_update_buffer_pcm_params(struct comp_buffer __sparse_cache *buffer, +static void pipeline_update_buffer_pcm_params(struct comp_buffer *buffer, void *data) { struct sof_ipc_stream_params *params = data; @@ -188,7 +188,7 @@ static int pipeline_comp_hw_params_buf(struct comp_dev *current, return ret; /* set buffer parameters */ if (calling_buf) { - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(calling_buf); + struct comp_buffer *buf_c = buffer_acquire(calling_buf); ret = buffer_set_params(buf_c, &ppl_data->params->params, BUFFER_UPDATE_IF_UNSET); diff --git a/src/audio/rtnr/rtnr.c b/src/audio/rtnr/rtnr.c index 8c3ce8496c14..270559b0728f 100644 --- a/src/audio/rtnr/rtnr.c +++ b/src/audio/rtnr/rtnr.c @@ -325,7 +325,7 @@ static int rtnr_params(struct comp_dev *dev, struct sof_ipc_stream_params *param int ret; struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb, *sourceb; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; bool channels_valid; comp_info(dev, "rtnr_params()"); @@ -727,7 +727,7 @@ static int rtnr_trigger(struct comp_dev *dev, int cmd) } static void rtnr_copy_from_sof_stream(struct audio_stream_rtnr *dst, - struct audio_stream __sparse_cache *src) + struct audio_stream *src) { dst->size = audio_stream_get_size(src); @@ -739,7 +739,7 @@ static void rtnr_copy_from_sof_stream(struct audio_stream_rtnr *dst, dst->end_addr = audio_stream_get_end_addr(src); } -static void rtnr_copy_to_sof_stream(struct audio_stream __sparse_cache *dst, +static void rtnr_copy_to_sof_stream(struct audio_stream *dst, struct audio_stream_rtnr *src) { audio_stream_set_size(dst, src->size); @@ -851,7 +851,7 @@ static int rtnr_prepare(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; int ret; comp_dbg(dev, "rtnr_prepare()"); diff --git a/src/audio/selector/selector.c b/src/audio/selector/selector.c index 8a39db81b2ef..8748f07ea1a3 100644 --- a/src/audio/selector/selector.c +++ b/src/audio/selector/selector.c @@ -60,7 +60,7 @@ static int selector_verify_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *buffer, *sinkb; - struct comp_buffer __sparse_cache *buffer_c, *sink_c; + struct comp_buffer *buffer_c, *sink_c; uint32_t in_channels; uint32_t out_channels; @@ -358,7 +358,7 @@ static int selector_cmd(struct comp_dev *dev, int cmd, void *data, static int selector_trigger(struct comp_dev *dev, int cmd) { struct comp_buffer *sourceb; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; enum sof_comp_type type; int ret; @@ -391,7 +391,7 @@ static int selector_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sink, *source; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; uint32_t frames; uint32_t source_bytes; uint32_t sink_bytes; @@ -444,7 +444,7 @@ static int selector_prepare(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb, *sourceb; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; size_t sink_size; int ret; @@ -673,7 +673,7 @@ static void set_selector_params(struct processing_module *mod, { struct comp_dev *dev = mod->dev; struct comp_data *cd = module_get_private_data(mod); - struct comp_buffer __sparse_cache *source; + struct comp_buffer *source; const struct sof_selector_ipc4_config *sel_cfg = &cd->sel_ipc4_cfg; const struct ipc4_audio_format *out_fmt = NULL; struct comp_buffer *src_buf; @@ -700,7 +700,7 @@ static void set_selector_params(struct processing_module *mod, list_for_item(sink_list, &dev->bsink_list) { struct comp_buffer *sink_buf = container_of(sink_list, struct comp_buffer, source_list); - struct comp_buffer __sparse_cache *sink = buffer_acquire(sink_buf); + struct comp_buffer *sink = buffer_acquire(sink_buf); ipc4_update_buffer_format(sink, out_fmt); audio_stream_set_channels(&sink->stream, params->channels); @@ -729,7 +729,7 @@ static int selector_verify_params(struct processing_module *mod, struct comp_dev *dev = mod->dev; struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; uint32_t in_channels = cd->config.in_channels_count; uint32_t out_channels = cd->config.out_channels_count; @@ -862,14 +862,14 @@ static int selector_process(struct processing_module *mod, * \return Error code. */ static int selector_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); struct module_data *md = &mod->priv; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb, *sourceb; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; size_t sink_size; int ret; diff --git a/src/audio/selector/selector_generic.c b/src/audio/selector/selector_generic.c index ca9e72f656d5..923277ec3f46 100644 --- a/src/audio/selector/selector_generic.c +++ b/src/audio/selector/selector_generic.c @@ -32,8 +32,8 @@ LOG_MODULE_DECLARE(selector, CONFIG_SOF_LOG_LEVEL); * \param[in,out] source Source buffer. * \param[in] frames Number of frames to process. */ -static void sel_s16le_1ch(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames) +static void sel_s16le_1ch(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames) { struct comp_data *cd = comp_get_drvdata(dev); int16_t *src = audio_stream_get_rptr(source); @@ -72,8 +72,8 @@ static void sel_s16le_1ch(struct comp_dev *dev, struct audio_stream __sparse_cac * \param[in,out] source Source buffer. * \param[in] frames Number of frames to process. */ -static void sel_s16le_nch(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames) +static void sel_s16le_nch(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames) { int8_t *src = audio_stream_get_rptr(source); int8_t *dst = audio_stream_get_wptr(sink); @@ -104,8 +104,8 @@ static void sel_s16le_nch(struct comp_dev *dev, struct audio_stream __sparse_cac * \param[in,out] source Source buffer. * \param[in] frames Number of frames to process. */ -static void sel_s32le_1ch(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames) +static void sel_s32le_1ch(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames) { struct comp_data *cd = comp_get_drvdata(dev); int32_t *src = audio_stream_get_rptr(source); @@ -144,8 +144,8 @@ static void sel_s32le_1ch(struct comp_dev *dev, struct audio_stream __sparse_cac * \param[in,out] source Source buffer. * \param[in] frames Number of frames to process. */ -static void sel_s32le_nch(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames) +static void sel_s32le_nch(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames) { int8_t *src = audio_stream_get_rptr(source); int8_t *dst = audio_stream_get_wptr(sink); @@ -206,8 +206,8 @@ static void sel_s16le(struct processing_module *mod, struct input_stream_buffer struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int16_t *src = audio_stream_get_rptr(source); int16_t *dest = audio_stream_get_wptr(sink); int nmax; @@ -277,8 +277,8 @@ static void sel_s32le(struct processing_module *mod, struct input_stream_buffer struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *src = audio_stream_get_rptr(source); int32_t *dest = audio_stream_get_wptr(sink); int nmax; diff --git a/src/audio/sink_api_helper.c b/src/audio/sink_api_helper.c index 4655fdbde347..519912e49967 100644 --- a/src/audio/sink_api_helper.c +++ b/src/audio/sink_api_helper.c @@ -7,19 +7,19 @@ #include <sof/audio/sink_api_implementation.h> #include <sof/audio/audio_stream.h> -void sink_init(struct sof_sink __sparse_cache *sink, const struct sink_ops *ops, +void sink_init(struct sof_sink *sink, const struct sink_ops *ops, struct sof_audio_stream_params *audio_stream_params) { sink->ops = ops; sink->audio_stream_params = audio_stream_params; } -size_t sink_get_free_size(struct sof_sink __sparse_cache *sink) +size_t sink_get_free_size(struct sof_sink *sink) { return sink->ops->get_free_size(sink); } -int sink_get_buffer(struct sof_sink __sparse_cache *sink, size_t req_size, +int sink_get_buffer(struct sof_sink *sink, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { int ret; @@ -35,7 +35,7 @@ int sink_get_buffer(struct sof_sink __sparse_cache *sink, size_t req_size, return ret; } -int sink_commit_buffer(struct sof_sink __sparse_cache *sink, size_t commit_size) +int sink_commit_buffer(struct sof_sink *sink, size_t commit_size) { int ret; @@ -56,47 +56,47 @@ int sink_commit_buffer(struct sof_sink __sparse_cache *sink, size_t commit_size) return ret; } -size_t sink_get_num_of_processed_bytes(struct sof_sink __sparse_cache *sink) +size_t sink_get_num_of_processed_bytes(struct sof_sink *sink) { return sink->num_of_bytes_processed; } -void sink_reset_num_of_processed_bytes(struct sof_sink __sparse_cache *sink) +void sink_reset_num_of_processed_bytes(struct sof_sink *sink) { sink->num_of_bytes_processed = 0; } -enum sof_ipc_frame sink_get_frm_fmt(struct sof_sink __sparse_cache *sink) +enum sof_ipc_frame sink_get_frm_fmt(struct sof_sink *sink) { return sink->audio_stream_params->frame_fmt; } -enum sof_ipc_frame sink_get_valid_fmt(struct sof_sink __sparse_cache *sink) +enum sof_ipc_frame sink_get_valid_fmt(struct sof_sink *sink) { return sink->audio_stream_params->valid_sample_fmt; } -uint32_t sink_get_rate(struct sof_sink __sparse_cache *sink) +uint32_t sink_get_rate(struct sof_sink *sink) { return sink->audio_stream_params->rate; } -uint32_t sink_get_channels(struct sof_sink __sparse_cache *sink) +uint32_t sink_get_channels(struct sof_sink *sink) { return sink->audio_stream_params->channels; } -uint32_t sink_get_buffer_fmt(struct sof_sink __sparse_cache *sink) +uint32_t sink_get_buffer_fmt(struct sof_sink *sink) { return sink->audio_stream_params->buffer_fmt; } -bool sink_get_overrun(struct sof_sink __sparse_cache *sink) +bool sink_get_overrun(struct sof_sink *sink) { return sink->audio_stream_params->overrun_permitted; } -int sink_set_frm_fmt(struct sof_sink __sparse_cache *sink, enum sof_ipc_frame frame_fmt) +int sink_set_frm_fmt(struct sof_sink *sink, enum sof_ipc_frame frame_fmt) { sink->audio_stream_params->frame_fmt = frame_fmt; @@ -106,7 +106,7 @@ int sink_set_frm_fmt(struct sof_sink __sparse_cache *sink, enum sof_ipc_frame fr return 0; } -int sink_set_valid_fmt(struct sof_sink __sparse_cache *sink, +int sink_set_valid_fmt(struct sof_sink *sink, enum sof_ipc_frame valid_sample_fmt) { sink->audio_stream_params->valid_sample_fmt = valid_sample_fmt; @@ -115,7 +115,7 @@ int sink_set_valid_fmt(struct sof_sink __sparse_cache *sink, return 0; } -int sink_set_rate(struct sof_sink __sparse_cache *sink, unsigned int rate) +int sink_set_rate(struct sof_sink *sink, unsigned int rate) { sink->audio_stream_params->rate = rate; if (sink->ops->on_audio_format_set) @@ -123,7 +123,7 @@ int sink_set_rate(struct sof_sink __sparse_cache *sink, unsigned int rate) return 0; } -int sink_set_channels(struct sof_sink __sparse_cache *sink, unsigned int channels) +int sink_set_channels(struct sof_sink *sink, unsigned int channels) { sink->audio_stream_params->channels = channels; if (sink->ops->on_audio_format_set) @@ -131,7 +131,7 @@ int sink_set_channels(struct sof_sink __sparse_cache *sink, unsigned int channel return 0; } -int sink_set_buffer_fmt(struct sof_sink __sparse_cache *sink, uint32_t buffer_fmt) +int sink_set_buffer_fmt(struct sof_sink *sink, uint32_t buffer_fmt) { sink->audio_stream_params->buffer_fmt = buffer_fmt; if (sink->ops->on_audio_format_set) @@ -139,7 +139,7 @@ int sink_set_buffer_fmt(struct sof_sink __sparse_cache *sink, uint32_t buffer_fm return 0; } -int sink_set_overrun(struct sof_sink __sparse_cache *sink, bool overrun_permitted) +int sink_set_overrun(struct sof_sink *sink, bool overrun_permitted) { sink->audio_stream_params->overrun_permitted = overrun_permitted; if (sink->ops->on_audio_format_set) @@ -147,19 +147,19 @@ int sink_set_overrun(struct sof_sink __sparse_cache *sink, bool overrun_permitte return 0; } -size_t sink_get_frame_bytes(struct sof_sink __sparse_cache *sink) +size_t sink_get_frame_bytes(struct sof_sink *sink) { return get_frame_bytes(sink_get_frm_fmt(sink), sink_get_channels(sink)); } -size_t sink_get_free_frames(struct sof_sink __sparse_cache *sink) +size_t sink_get_free_frames(struct sof_sink *sink) { return sink_get_free_size(sink) / sink_get_frame_bytes(sink); } -int sink_set_params(struct sof_sink __sparse_cache *sink, +int sink_set_params(struct sof_sink *sink, struct sof_ipc_stream_params *params, bool force_update) { if (sink->ops->audio_set_ipc_params) @@ -167,7 +167,7 @@ int sink_set_params(struct sof_sink __sparse_cache *sink, return 0; } -int sink_set_alignment_constants(struct sof_sink __sparse_cache *sink, +int sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_align, const uint32_t frame_align_req) { @@ -176,12 +176,12 @@ int sink_set_alignment_constants(struct sof_sink __sparse_cache *sink, return 0; } -void sink_set_obs(struct sof_sink __sparse_cache *sink, size_t obs) +void sink_set_obs(struct sof_sink *sink, size_t obs) { sink->obs = obs; } -size_t sink_get_obs(struct sof_sink __sparse_cache *sink) +size_t sink_get_obs(struct sof_sink *sink) { return sink->obs; } diff --git a/src/audio/sink_source_utils.c b/src/audio/sink_source_utils.c index 671c1752d544..5a0d17608be4 100644 --- a/src/audio/sink_source_utils.c +++ b/src/audio/sink_source_utils.c @@ -12,8 +12,8 @@ #include <sof/math/numbers.h> #include <limits.h> -int source_to_sink_copy(struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink, bool free, size_t size) +int source_to_sink_copy(struct sof_source *source, + struct sof_sink *sink, bool free, size_t size) { uint8_t *src_ptr; uint8_t *src_begin; diff --git a/src/audio/smart_amp/smart_amp.c b/src/audio/smart_amp/smart_amp.c index d0108aa346c7..351db6cbf9c6 100644 --- a/src/audio/smart_amp/smart_amp.c +++ b/src/audio/smart_amp/smart_amp.c @@ -26,8 +26,8 @@ DECLARE_TR_CTX(maxim_dsm_comp_tr, SOF_UUID(maxim_dsm_comp_uuid), #define SOF_SMART_AMP_MODEL 1 typedef int(*smart_amp_proc)(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, uint32_t frames, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames, int8_t *chan_map, bool is_feedback); struct smart_amp_data { @@ -518,7 +518,7 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) case COMP_TRIGGER_START: case COMP_TRIGGER_RELEASE: if (sad->feedback_buf) { - struct comp_buffer __sparse_cache *buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); buffer_zero(buf); buffer_release(buf); } @@ -534,8 +534,8 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) } static int smart_amp_process(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames, int8_t *chan_map, bool is_feedback) { @@ -558,7 +558,7 @@ static int smart_amp_process(struct comp_dev *dev, static smart_amp_proc get_smart_amp_process(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *source_buf = buffer_acquire(sad->source_buf); + struct comp_buffer *source_buf = buffer_acquire(sad->source_buf); enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&source_buf->stream); buffer_release(source_buf); @@ -577,8 +577,8 @@ static smart_amp_proc get_smart_amp_process(struct comp_dev *dev) static int smart_amp_copy(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *source_buf = buffer_acquire(sad->source_buf); - struct comp_buffer __sparse_cache *sink_buf = buffer_acquire(sad->sink_buf); + struct comp_buffer *source_buf = buffer_acquire(sad->source_buf); + struct comp_buffer *sink_buf = buffer_acquire(sad->sink_buf); uint32_t avail_passthrough_frames; uint32_t avail_feedback_frames; uint32_t avail_frames; @@ -595,7 +595,7 @@ static int smart_amp_copy(struct comp_dev *dev) avail_frames = avail_passthrough_frames; if (sad->feedback_buf) { - struct comp_buffer __sparse_cache *feedback_buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *feedback_buf = buffer_acquire(sad->feedback_buf); if (comp_get_state(dev, feedback_buf->source) == dev->state) { /* feedback */ @@ -661,7 +661,7 @@ static int smart_amp_reset(struct comp_dev *dev) static int smart_amp_prepare(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *source_c, *buf_c; + struct comp_buffer *source_c, *buf_c; struct list_item *blist; int ret; int bitwidth; diff --git a/src/audio/smart_amp/smart_amp_generic.c b/src/audio/smart_amp/smart_amp_generic.c index 3ad4c1ce28de..35dffeb0e449 100644 --- a/src/audio/smart_amp/smart_amp_generic.c +++ b/src/audio/smart_amp/smart_amp_generic.c @@ -24,9 +24,9 @@ static void smart_amp_fb_generic(int32_t x) #if CONFIG_FORMAT_S16LE static void smart_amp_s16_ff_default(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames) { int16_t *x; @@ -52,9 +52,9 @@ static void smart_amp_s16_ff_default(const struct comp_dev *dev, #if CONFIG_FORMAT_S24LE static void smart_amp_s24_ff_default(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames) { int32_t *x; @@ -80,9 +80,9 @@ static void smart_amp_s24_ff_default(const struct comp_dev *dev, #if CONFIG_FORMAT_S32LE static void smart_amp_s32_ff_default(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames) { int32_t *x; @@ -106,9 +106,9 @@ static void smart_amp_s32_ff_default(const struct comp_dev *dev, #if CONFIG_FORMAT_S16LE static void smart_amp_s16_fb_default(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames) { int16_t *x; @@ -130,9 +130,9 @@ static void smart_amp_s16_fb_default(const struct comp_dev *dev, #if CONFIG_FORMAT_S24LE static void smart_amp_s24_fb_default(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames) { int32_t *x; @@ -154,9 +154,9 @@ static void smart_amp_s24_fb_default(const struct comp_dev *dev, #if CONFIG_FORMAT_S32LE static void smart_amp_s32_fb_default(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames) { int32_t *x; diff --git a/src/audio/smart_amp/smart_amp_maxim_dsm.c b/src/audio/smart_amp/smart_amp_maxim_dsm.c index ed6b5a218511..165d159678dc 100644 --- a/src/audio/smart_amp/smart_amp_maxim_dsm.c +++ b/src/audio/smart_amp/smart_amp_maxim_dsm.c @@ -579,7 +579,7 @@ int smart_amp_check_audio_fmt(int sample_rate, int ch_num) } static int smart_amp_get_buffer(int32_t *buf, uint32_t frames, - const struct audio_stream __sparse_cache *stream, + const struct audio_stream *stream, int8_t *chan_map, uint32_t num_ch) { int idx, ch; @@ -629,7 +629,7 @@ static int smart_amp_get_buffer(int32_t *buf, uint32_t frames, } static int smart_amp_put_buffer(int32_t *buf, uint32_t frames, - const struct audio_stream __sparse_cache *stream, + const struct audio_stream *stream, int8_t *chan_map, uint32_t num_ch_in, uint32_t num_ch_out) { @@ -681,8 +681,8 @@ static int smart_amp_put_buffer(int32_t *buf, uint32_t frames, } int smart_amp_ff_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, int8_t *chan_map, + const struct audio_stream *source, + const struct audio_stream *sink, int8_t *chan_map, struct smart_amp_mod_struct_t *hspk, uint32_t num_ch_in, uint32_t num_ch_out) { @@ -741,8 +741,8 @@ int smart_amp_ff_copy(struct comp_dev *dev, uint32_t frames, } int smart_amp_fb_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, int8_t *chan_map, + const struct audio_stream *source, + const struct audio_stream *sink, int8_t *chan_map, struct smart_amp_mod_struct_t *hspk, uint32_t num_ch) { diff --git a/src/audio/source_api_helper.c b/src/audio/source_api_helper.c index 91985aeed969..1483fb6603c9 100644 --- a/src/audio/source_api_helper.c +++ b/src/audio/source_api_helper.c @@ -7,7 +7,7 @@ #include <sof/audio/source_api_implementation.h> #include <sof/audio/audio_stream.h> -void source_init(struct sof_source __sparse_cache *source, const struct source_ops *ops, +void source_init(struct sof_source *source, const struct source_ops *ops, struct sof_audio_stream_params *audio_stream_params) { source->ops = ops; @@ -15,12 +15,12 @@ void source_init(struct sof_source __sparse_cache *source, const struct source_o source->audio_stream_params = audio_stream_params; } -size_t source_get_data_available(struct sof_source __sparse_cache *source) +size_t source_get_data_available(struct sof_source *source) { return source->ops->get_data_available(source); } -int source_get_data(struct sof_source __sparse_cache *source, size_t req_size, +int source_get_data(struct sof_source *source, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { int ret; @@ -35,7 +35,7 @@ int source_get_data(struct sof_source __sparse_cache *source, size_t req_size, return ret; } -int source_release_data(struct sof_source __sparse_cache *source, size_t free_size) +int source_release_data(struct sof_source *source, size_t free_size) { int ret; @@ -56,47 +56,47 @@ int source_release_data(struct sof_source __sparse_cache *source, size_t free_si return ret; } -size_t source_get_num_of_processed_bytes(struct sof_source __sparse_cache *source) +size_t source_get_num_of_processed_bytes(struct sof_source *source) { return source->num_of_bytes_processed; } -void source_reset_num_of_processed_bytes(struct sof_source __sparse_cache *source) +void source_reset_num_of_processed_bytes(struct sof_source *source) { source->num_of_bytes_processed = 0; } -enum sof_ipc_frame source_get_frm_fmt(struct sof_source __sparse_cache *source) +enum sof_ipc_frame source_get_frm_fmt(struct sof_source *source) { return source->audio_stream_params->frame_fmt; } -enum sof_ipc_frame source_get_valid_fmt(struct sof_source __sparse_cache *source) +enum sof_ipc_frame source_get_valid_fmt(struct sof_source *source) { return source->audio_stream_params->valid_sample_fmt; } -unsigned int source_get_rate(struct sof_source __sparse_cache *source) +unsigned int source_get_rate(struct sof_source *source) { return source->audio_stream_params->rate; } -unsigned int source_get_channels(struct sof_source __sparse_cache *source) +unsigned int source_get_channels(struct sof_source *source) { return source->audio_stream_params->channels; } -uint32_t source_get_buffer_fmt(struct sof_source __sparse_cache *source) +uint32_t source_get_buffer_fmt(struct sof_source *source) { return source->audio_stream_params->buffer_fmt; } -bool source_get_underrun(struct sof_source __sparse_cache *source) +bool source_get_underrun(struct sof_source *source) { return source->audio_stream_params->underrun_permitted; } -int source_set_valid_fmt(struct sof_source __sparse_cache *source, +int source_set_valid_fmt(struct sof_source *source, enum sof_ipc_frame valid_sample_fmt) { source->audio_stream_params->valid_sample_fmt = valid_sample_fmt; @@ -105,7 +105,7 @@ int source_set_valid_fmt(struct sof_source __sparse_cache *source, return 0; } -int source_set_rate(struct sof_source __sparse_cache *source, unsigned int rate) +int source_set_rate(struct sof_source *source, unsigned int rate) { source->audio_stream_params->rate = rate; if (source->ops->on_audio_format_set) @@ -113,7 +113,7 @@ int source_set_rate(struct sof_source __sparse_cache *source, unsigned int rate) return 0; } -int source_set_channels(struct sof_source __sparse_cache *source, unsigned int channels) +int source_set_channels(struct sof_source *source, unsigned int channels) { source->audio_stream_params->channels = channels; if (source->ops->on_audio_format_set) @@ -121,7 +121,7 @@ int source_set_channels(struct sof_source __sparse_cache *source, unsigned int c return 0; } -int source_set_buffer_fmt(struct sof_source __sparse_cache *source, uint32_t buffer_fmt) +int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt) { source->audio_stream_params->buffer_fmt = buffer_fmt; if (source->ops->on_audio_format_set) @@ -129,7 +129,7 @@ int source_set_buffer_fmt(struct sof_source __sparse_cache *source, uint32_t buf return 0; } -int source_set_underrun(struct sof_source __sparse_cache *source, bool underrun_permitted) +int source_set_underrun(struct sof_source *source, bool underrun_permitted) { source->audio_stream_params->underrun_permitted = underrun_permitted; if (source->ops->on_audio_format_set) @@ -137,19 +137,19 @@ int source_set_underrun(struct sof_source __sparse_cache *source, bool underrun_ return 0; } -size_t source_get_frame_bytes(struct sof_source __sparse_cache *source) +size_t source_get_frame_bytes(struct sof_source *source) { return get_frame_bytes(source_get_frm_fmt(source), source_get_channels(source)); } -size_t source_get_data_frames_available(struct sof_source __sparse_cache *source) +size_t source_get_data_frames_available(struct sof_source *source) { return source_get_data_available(source) / source_get_frame_bytes(source); } -int source_set_params(struct sof_source __sparse_cache *source, +int source_set_params(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update) { if (source->ops->audio_set_ipc_params) @@ -157,7 +157,7 @@ int source_set_params(struct sof_source __sparse_cache *source, return 0; } -int source_set_alignment_constants(struct sof_source __sparse_cache *source, +int source_set_alignment_constants(struct sof_source *source, const uint32_t byte_align, const uint32_t frame_align_req) { @@ -166,12 +166,12 @@ int source_set_alignment_constants(struct sof_source __sparse_cache *source, return 0; } -void source_set_ibs(struct sof_source __sparse_cache *source, size_t ibs) +void source_set_ibs(struct sof_source *source, size_t ibs) { source->ibs = ibs; } -size_t source_get_ibs(struct sof_source __sparse_cache *source) +size_t source_get_ibs(struct sof_source *source) { return source->ibs; } diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 82501728c59c..65b8ae965abd 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -101,8 +101,8 @@ struct comp_data { int sink_frames; int sample_container_bytes; int channels_count; - int (*src_func)(struct comp_data *cd, struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink); + int (*src_func)(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink); void (*polyphase_func)(struct src_stage_prm *s); }; @@ -335,15 +335,15 @@ int src_polyphase_init(struct polyphase_src *src, struct src_param *p, } /* Fallback function */ -static int src_fallback(struct comp_data *cd, struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) +static int src_fallback(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink) { return 0; } /* Normal 2 stage SRC */ static int src_2s(struct comp_data *cd, - struct sof_source __sparse_cache *source, struct sof_sink __sparse_cache *sink) + struct sof_source *source, struct sof_sink *sink) { struct src_stage_prm s1; struct src_stage_prm s2; @@ -443,8 +443,8 @@ static int src_2s(struct comp_data *cd, } /* 1 stage SRC for simple conversions */ -static int src_1s(struct comp_data *cd, struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) +static int src_1s(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink) { struct src_stage_prm s1; int ret; @@ -482,8 +482,8 @@ static int src_1s(struct comp_data *cd, struct sof_source __sparse_cache *source } /* A fast copy function for same in and out rate */ -static int src_copy_sxx(struct comp_data *cd, struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) +static int src_copy_sxx(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink) { int frames = cd->param.blk_in; @@ -531,7 +531,7 @@ static int src_stream_pcm_sink_rate_check(struct ipc4_config_src cfg, * set up param then verify param. BTW for IPC3 path, the param is sent by * host driver. */ -static int src_set_params(struct processing_module *mod, struct sof_sink __sparse_cache *sink) +static int src_set_params(struct processing_module *mod, struct sof_sink *sink) { struct sof_ipc_stream_params src_params; struct sof_ipc_stream_params *params = mod->stream_params; @@ -561,7 +561,7 @@ static int src_set_params(struct processing_module *mod, struct sof_sink __spars return ret; } -static void src_set_sink_params(struct comp_dev *dev, struct sof_sink __sparse_cache *sink) +static void src_set_sink_params(struct comp_dev *dev, struct sof_sink *sink) { struct processing_module *mod = comp_get_drvdata(dev); struct comp_data *cd = module_get_private_data(mod); @@ -610,12 +610,12 @@ static int src_stream_pcm_source_rate_check(struct ipc_config_src cfg, return 0; } -static int src_set_params(struct processing_module *mod, struct sof_sink __sparse_cache *sink) +static int src_set_params(struct processing_module *mod, struct sof_sink *sink) { return 0; } -static void src_set_sink_params(struct comp_dev *dev, struct sof_sink __sparse_cache *sink) +static void src_set_sink_params(struct comp_dev *dev, struct sof_sink *sink) { /* empty */ } @@ -624,8 +624,8 @@ static void src_set_sink_params(struct comp_dev *dev, struct sof_sink __sparse_c #error "No or invalid IPC MAJOR version selected." #endif /* CONFIG_IPC_MAJOR_4 */ -static void src_set_alignment(struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) +static void src_set_alignment(struct sof_source *source, + struct sof_sink *sink) { const uint32_t byte_align = 1; const uint32_t frame_align_req = 1; @@ -672,8 +672,8 @@ static int src_verify_params(struct processing_module *mod) } static bool src_get_copy_limits(struct comp_data *cd, - struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) + struct sof_source *source, + struct sof_sink *sink) { struct src_param *sp; struct src_stage *s1; @@ -716,8 +716,8 @@ static bool src_get_copy_limits(struct comp_data *cd, } static int src_params_general(struct processing_module *mod, - struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) + struct sof_source *source, + struct sof_sink *sink) { struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; @@ -826,8 +826,8 @@ static int src_params_general(struct processing_module *mod, } static int src_prepare_general(struct processing_module *mod, - struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink) + struct sof_source *source, + struct sof_sink *sink) { struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; @@ -983,8 +983,8 @@ static int src_init(struct processing_module *mod) } static int src_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { int ret; @@ -1002,8 +1002,8 @@ static int src_prepare(struct processing_module *mod, static bool src_is_ready_to_process(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); @@ -1011,8 +1011,8 @@ static bool src_is_ready_to_process(struct processing_module *mod, } static int src_process(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); diff --git a/src/audio/tdfb/tdfb.c b/src/audio/tdfb/tdfb.c index d1b04b7faf42..976119264e02 100644 --- a/src/audio/tdfb/tdfb.c +++ b/src/audio/tdfb/tdfb.c @@ -660,8 +660,8 @@ static int tdfb_process(struct processing_module *mod, { struct comp_dev *dev = mod->dev; struct tdfb_comp_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = input_buffers[0].data; - struct audio_stream __sparse_cache *sink = output_buffers[0].data; + struct audio_stream *source = input_buffers[0].data; + struct audio_stream *sink = output_buffers[0].data; int frame_count = input_buffers[0].size; int ret; @@ -715,8 +715,8 @@ static int tdfb_process(struct processing_module *mod, return 0; } -static void tdfb_set_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static void tdfb_set_alignment(struct audio_stream *source, + struct audio_stream *sink) { const uint32_t byte_align = 1; const uint32_t frame_align_req = 2; /* Process multiples of 2 frames */ @@ -726,12 +726,12 @@ static void tdfb_set_alignment(struct audio_stream __sparse_cache *source, } static int tdfb_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct tdfb_comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame frame_fmt; int source_channels; diff --git a/src/audio/tdfb/tdfb_generic.c b/src/audio/tdfb/tdfb_generic.c index 8306bb6a8991..22f74702ac06 100644 --- a/src/audio/tdfb/tdfb_generic.c +++ b/src/audio/tdfb/tdfb_generic.c @@ -58,8 +58,8 @@ static inline void tdfb_core(struct tdfb_comp_data *cd, int in_nch, int out_nch) void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int16_t *x = audio_stream_get_rptr(source); int16_t *y = audio_stream_get_wptr(sink); int fmax; @@ -104,8 +104,8 @@ void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource void tdfb_fir_s24(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x = audio_stream_get_rptr(source); int32_t *y = audio_stream_get_wptr(sink); int fmax; @@ -150,8 +150,8 @@ void tdfb_fir_s24(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource void tdfb_fir_s32(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x = audio_stream_get_rptr(source); int32_t *y = audio_stream_get_wptr(sink); int fmax; diff --git a/src/audio/tdfb/tdfb_hifi3.c b/src/audio/tdfb/tdfb_hifi3.c index 97b5229d02dd..421784db9d1d 100644 --- a/src/audio/tdfb/tdfb_hifi3.c +++ b/src/audio/tdfb/tdfb_hifi3.c @@ -19,8 +19,8 @@ void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct sof_tdfb_config *cfg = cd->config; struct fir_state_32x16 *f; ae_int16x4 d; @@ -108,8 +108,8 @@ void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource void tdfb_fir_s24(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct sof_tdfb_config *cfg = cd->config; struct fir_state_32x16 *f; ae_int32x2 d; @@ -197,8 +197,8 @@ void tdfb_fir_s24(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource void tdfb_fir_s32(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; struct sof_tdfb_config *cfg = cd->config; struct fir_state_32x16 *f; ae_int32x2 d; diff --git a/src/audio/tdfb/tdfb_hifiep.c b/src/audio/tdfb/tdfb_hifiep.c index eba8d7c7807e..1f5b71dbe612 100644 --- a/src/audio/tdfb/tdfb_hifiep.c +++ b/src/audio/tdfb/tdfb_hifiep.c @@ -58,8 +58,8 @@ static inline void tdfb_core(struct tdfb_comp_data *cd, int in_nch, int out_nch) void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int16_t *x = audio_stream_get_rptr(source); int16_t *y = audio_stream_get_wptr(sink); int fmax; @@ -104,8 +104,8 @@ void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource void tdfb_fir_s24(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x = audio_stream_get_rptr(source); int32_t *y = audio_stream_get_wptr(sink); int fmax; @@ -150,8 +150,8 @@ void tdfb_fir_s24(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource void tdfb_fir_s32(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, int frames) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x = audio_stream_get_rptr(source); int32_t *y = audio_stream_get_wptr(sink); int fmax; diff --git a/src/audio/tone.c b/src/audio/tone.c index 65c934246909..0f744cb75d4d 100644 --- a/src/audio/tone.c +++ b/src/audio/tone.c @@ -95,7 +95,7 @@ struct comp_data { uint32_t frame_bytes; uint32_t rate; struct tone_state sg[PLATFORM_MAX_CHANNELS]; - void (*tone_func)(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, + void (*tone_func)(struct comp_dev *dev, struct audio_stream *sink, uint32_t frames); }; @@ -113,7 +113,7 @@ static inline void tone_circ_inc_wrap(int32_t **ptr, int32_t *end, size_t size) *ptr = (int32_t *)((size_t)*ptr - size); } -static void tone_s32_default(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, +static void tone_s32_default(struct comp_dev *dev, struct audio_stream *sink, uint32_t frames) { struct comp_data *cd = comp_get_drvdata(dev); @@ -429,7 +429,7 @@ static int tone_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); @@ -634,7 +634,7 @@ static int tone_trigger(struct comp_dev *dev, int cmd) static int tone_copy(struct comp_dev *dev) { struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; struct comp_data *cd = comp_get_drvdata(dev); uint32_t free; int ret = 0; diff --git a/src/audio/up_down_mixer/up_down_mixer.c b/src/audio/up_down_mixer/up_down_mixer.c index e1887865ac70..7736b681dd24 100644 --- a/src/audio/up_down_mixer/up_down_mixer.c +++ b/src/audio/up_down_mixer/up_down_mixer.c @@ -400,8 +400,8 @@ static int up_down_mixer_init(struct processing_module *mod) /* just stubs for now. Remove these after making these ops optional in the module adapter */ static int up_down_mixer_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct up_down_mixer_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index a4128136a5e5..797b201b03b5 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -57,7 +57,7 @@ LOG_MODULE_REGISTER(volume, CONFIG_SOF_LOG_LEVEL); * \param[in] frames Number of frames. * \param[in,out] prev_sum Previous sum of channel samples. */ -static uint32_t vol_zc_get_s16(const struct audio_stream __sparse_cache *source, +static uint32_t vol_zc_get_s16(const struct audio_stream *source, uint32_t frames, int64_t *prev_sum) { uint32_t curr_frames = frames; @@ -105,7 +105,7 @@ static uint32_t vol_zc_get_s16(const struct audio_stream __sparse_cache *source, * \param[in] frames Number of frames. * \param[in,out] prev_sum Previous sum of channel samples. */ -static uint32_t vol_zc_get_s24(const struct audio_stream __sparse_cache *source, +static uint32_t vol_zc_get_s24(const struct audio_stream *source, uint32_t frames, int64_t *prev_sum) { int64_t sum; @@ -153,7 +153,7 @@ static uint32_t vol_zc_get_s24(const struct audio_stream __sparse_cache *source, * \param[in] frames Number of frames. * \param[in,out] prev_sum Previous sum of channel samples. */ -static uint32_t vol_zc_get_s32(const struct audio_stream __sparse_cache *source, +static uint32_t vol_zc_get_s32(const struct audio_stream *source, uint32_t frames, int64_t *prev_sum) { int64_t sum; @@ -575,7 +575,7 @@ static int volume_process(struct processing_module *mod, * \param[in,out] dev Volume base component device. */ static vol_zc_func vol_get_zc_function(struct comp_dev *dev, - struct comp_buffer __sparse_cache *sinkb) + struct comp_buffer *sinkb) { int i; @@ -593,8 +593,8 @@ static vol_zc_func vol_get_zc_function(struct comp_dev *dev, * \param[in,out] source Structure pointer of source. * \param[in,out] sink Structure pointer of sink. */ -static void volume_set_alignment(struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink) +static void volume_set_alignment(struct audio_stream *source, + struct audio_stream *sink) { #if XCHAL_HAVE_HIFI3 || XCHAL_HAVE_HIFI4 @@ -631,14 +631,14 @@ static void volume_set_alignment(struct audio_stream __sparse_cache *source, * to also do some type of conversion here. */ static int volume_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct vol_data *cd = module_get_private_data(mod); struct module_data *md = &mod->priv; struct comp_dev *dev = mod->dev; struct comp_buffer *sourceb, *sinkb; - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; uint32_t sink_period_bytes; int ret; int i; diff --git a/src/audio/volume/volume.h b/src/audio/volume/volume.h index 856c27568d84..140ec3e7af2f 100644 --- a/src/audio/volume/volume.h +++ b/src/audio/volume/volume.h @@ -134,7 +134,7 @@ typedef void (*vol_scale_func)(struct processing_module *mod, struct input_strea /** * \brief volume interface for function getting nearest zero crossing frame */ -typedef uint32_t (*vol_zc_func)(const struct audio_stream __sparse_cache *source, +typedef uint32_t (*vol_zc_func)(const struct audio_stream *source, uint32_t frames, int64_t *prev_sum); /** @@ -205,7 +205,7 @@ struct comp_zc_func_map { * \param[in] cd Volume data structure. */ static inline vol_scale_func vol_get_processing_function(struct comp_dev *dev, - struct comp_buffer __sparse_cache *sinkb, + struct comp_buffer *sinkb, struct vol_data *cd) { int i; diff --git a/src/audio/volume/volume_generic.c b/src/audio/volume/volume_generic.c index 966f62b7da34..30498bc992eb 100644 --- a/src/audio/volume/volume_generic.c +++ b/src/audio/volume/volume_generic.c @@ -61,8 +61,8 @@ static void vol_s24_to_s24(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t vol; int32_t *x, *x0; int32_t *y, *y0; @@ -110,8 +110,8 @@ static void vol_passthrough_s24_to_s24(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x; int32_t *y; int nmax, n; @@ -153,8 +153,8 @@ static void vol_s32_to_s32(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t vol; int32_t *x, *x0; int32_t *y, *y0; @@ -205,8 +205,8 @@ static void vol_passthrough_s32_to_s32(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x; int32_t *y; int nmax, n; @@ -247,8 +247,8 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t vol; int16_t *x, *x0; int16_t *y, *y0; @@ -296,8 +296,8 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int16_t *x; int16_t *y; int nmax, n; diff --git a/src/audio/volume/volume_generic_with_peakvol.c b/src/audio/volume/volume_generic_with_peakvol.c index fb0cff0bee3a..0ef720d78665 100644 --- a/src/audio/volume/volume_generic_with_peakvol.c +++ b/src/audio/volume/volume_generic_with_peakvol.c @@ -57,8 +57,8 @@ static void vol_s24_to_s24(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t vol; int32_t *x, *x0; int32_t *y, *y0; @@ -112,8 +112,8 @@ static void vol_passthrough_s24_to_s24(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x, *x0; int32_t *y, *y0; int nmax, n, i, j; @@ -166,8 +166,8 @@ static void vol_s32_to_s32(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t vol; int32_t *x, *x0; int32_t *y, *y0; @@ -224,8 +224,8 @@ static void vol_passthrough_s32_to_s32(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x, *x0; int32_t *y, *y0; int nmax, n, i, j; @@ -280,8 +280,8 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t vol; int16_t *x, *x0; int16_t *y, *y0; @@ -336,8 +336,8 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *x, *x0; int32_t *y, *y0; int nmax, n, i, j; diff --git a/src/audio/volume/volume_hifi3.c b/src/audio/volume/volume_hifi3.c index 05746ab40f67..e32b8551c775 100644 --- a/src/audio/volume/volume_hifi3.c +++ b/src/audio/volume/volume_hifi3.c @@ -61,8 +61,8 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -147,8 +147,8 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, m; ae_valign inu = AE_ZALIGN64(); @@ -198,8 +198,8 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -289,8 +289,8 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, m; ae_valign inu = AE_ZALIGN64(); @@ -339,8 +339,8 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 volume0 = AE_ZERO32(); ae_f32x2 volume1 = AE_ZERO32(); ae_f32x2 out_sample0 = AE_ZERO32(); @@ -436,8 +436,8 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f16x4 in_sample = AE_ZERO16(); int i, n, m; ae_valign inu = AE_ZALIGN64(); diff --git a/src/audio/volume/volume_hifi3_with_peakvol.c b/src/audio/volume/volume_hifi3_with_peakvol.c index 5d0ff31b0385..9bda00a27bc7 100644 --- a/src/audio/volume/volume_hifi3_with_peakvol.c +++ b/src/audio/volume/volume_hifi3_with_peakvol.c @@ -41,8 +41,8 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -116,8 +116,8 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int channel, n, i, m; ae_f32 *in0 = (ae_f32 *)audio_stream_wrap(source, (char *)audio_stream_get_rptr(source) @@ -176,8 +176,8 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -252,8 +252,8 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, channel, m; const int channels_count = audio_stream_get_channels(sink); @@ -312,8 +312,8 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 volume = AE_ZERO32(); ae_f32x2 out_sample0 = AE_ZERO32(); ae_f16x4 in_sample = AE_ZERO16(); @@ -394,8 +394,8 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f16x4 in_sample = AE_ZERO16(); int i, n, channel, m; ae_f16 *in; diff --git a/src/audio/volume/volume_hifi4.c b/src/audio/volume/volume_hifi4.c index 880aef23f139..d0d114dcfc5d 100644 --- a/src/audio/volume/volume_hifi4.c +++ b/src/audio/volume/volume_hifi4.c @@ -61,8 +61,8 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -147,8 +147,8 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, m; ae_valign inu = AE_ZALIGN64(); @@ -198,8 +198,8 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -289,8 +289,8 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, m; ae_valign inu = AE_ZALIGN64(); @@ -338,8 +338,8 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 volume0 = AE_ZERO32(); ae_f32x2 volume1 = AE_ZERO32(); ae_f32x2 out_sample0 = AE_ZERO32(); @@ -435,8 +435,8 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod, struct output_stream_buffer *bsink, uint32_t frames, uint32_t attenuation) { - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f16x4 in_sample = AE_ZERO16(); int i, n, m; ae_valign inu = AE_ZALIGN64(); diff --git a/src/audio/volume/volume_hifi4_with_peakvol.c b/src/audio/volume/volume_hifi4_with_peakvol.c index df1eafff2788..cbb08e297b87 100644 --- a/src/audio/volume/volume_hifi4_with_peakvol.c +++ b/src/audio/volume/volume_hifi4_with_peakvol.c @@ -54,8 +54,8 @@ static void vol_s24_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -150,8 +150,8 @@ static void vol_passthrough_s24_to_s24_s32(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, m; @@ -217,8 +217,8 @@ static void vol_s32_to_s24_s32(struct processing_module *mod, struct input_strea uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); ae_f32x2 out_sample = AE_ZERO32(); ae_f32x2 volume = AE_ZERO32(); @@ -321,8 +321,8 @@ static void vol_passthrough_s32_to_s24_s32(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 in_sample = AE_ZERO32(); int i, n, m; ae_valign inu = AE_ZALIGN64(); @@ -385,8 +385,8 @@ static void vol_s16_to_s16(struct processing_module *mod, struct input_stream_bu uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f32x2 volume0 = AE_ZERO32(); ae_f32x2 volume1 = AE_ZERO32(); ae_f32x2 out_sample0 = AE_ZERO32(); @@ -501,8 +501,8 @@ static void vol_passthrough_s16_to_s16(struct processing_module *mod, uint32_t attenuation) { struct vol_data *cd = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; ae_f16x4 in_sample = AE_ZERO16(); int i, n, m; ae_valign inu = AE_ZALIGN64(); diff --git a/src/audio/volume/volume_ipc3.c b/src/audio/volume/volume_ipc3.c index c1378acbdd45..3881c4ae7f8b 100644 --- a/src/audio/volume/volume_ipc3.c +++ b/src/audio/volume/volume_ipc3.c @@ -37,7 +37,7 @@ LOG_MODULE_DECLARE(volume, CONFIG_SOF_LOG_LEVEL); void set_volume_process(struct vol_data *cd, struct comp_dev *dev, bool source_or_sink) { struct comp_buffer *bufferb; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; if (source_or_sink) bufferb = list_first_item(&dev->bsource_list, diff --git a/src/audio/volume/volume_ipc4.c b/src/audio/volume/volume_ipc4.c index 0ec4c4c275f0..23cd6c7281eb 100644 --- a/src/audio/volume/volume_ipc4.c +++ b/src/audio/volume/volume_ipc4.c @@ -366,7 +366,7 @@ int volume_get_config(struct processing_module *mod, static int volume_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer __sparse_cache *sink_c, *source_c; + struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct comp_dev *dev = mod->dev; diff --git a/src/include/ipc4/base-config.h b/src/include/ipc4/base-config.h index 26eeb07bf355..2e54478efd3a 100644 --- a/src/include/ipc4/base-config.h +++ b/src/include/ipc4/base-config.h @@ -242,7 +242,7 @@ struct sof_ipc_stream_params; void ipc4_base_module_cfg_to_stream_params(const struct ipc4_base_module_cfg *base_cfg, struct sof_ipc_stream_params *params); struct comp_buffer; -void ipc4_update_buffer_format(struct comp_buffer __sparse_cache *buf_c, +void ipc4_update_buffer_format(struct comp_buffer *buf_c, const struct ipc4_audio_format *fmt); #endif diff --git a/src/include/ipc4/copier.h b/src/include/ipc4/copier.h index 285b6ca3f4d4..23953d6aca97 100644 --- a/src/include/ipc4/copier.h +++ b/src/include/ipc4/copier.h @@ -272,7 +272,7 @@ struct copier_data { }; int apply_attenuation(struct comp_dev *dev, struct copier_data *cd, - struct comp_buffer __sparse_cache *sink, int frame); + struct comp_buffer *sink, int frame); pcm_converter_func get_converter_func(const struct ipc4_audio_format *in_fmt, const struct ipc4_audio_format *out_fmt, diff --git a/src/include/ipc4/mixin_mixout.h b/src/include/ipc4/mixin_mixout.h index f44ef97e0b37..49184e2aa51b 100644 --- a/src/include/ipc4/mixin_mixout.h +++ b/src/include/ipc4/mixin_mixout.h @@ -105,15 +105,15 @@ struct ipc4_mixer_mode_config { /** * \brief normal mode mixin_mixout processing function interface */ -typedef void (*normal_mix_func)(struct audio_stream __sparse_cache *sink, int32_t start_frame, +typedef void (*normal_mix_func)(struct audio_stream *sink, int32_t start_frame, int32_t mixed_frames, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, int32_t frame_count, uint16_t gain); /** * \brief mixin_mixout mute processing function interface */ -typedef void (*mute_func) (struct audio_stream __sparse_cache *stream, int32_t channel_index, +typedef void (*mute_func) (struct audio_stream *stream, int32_t channel_index, int32_t start_frame, int32_t mixed_frames, int32_t frame_count); /** diff --git a/src/include/sof/audio/aria/aria.h b/src/include/sof/audio/aria/aria.h index 64e34e09c86b..6718f84a72da 100644 --- a/src/include/sof/audio/aria/aria.h +++ b/src/include/sof/audio/aria/aria.h @@ -48,14 +48,14 @@ * \brief aria get data function interface */ typedef void (*aria_get_data_func)(struct processing_module *mod, - struct audio_stream __sparse_cache *sink, int frames); + struct audio_stream *sink, int frames); struct aria_data; /** * \brief Aria gain processing function */ void aria_algo_calc_gain(struct aria_data *cd, size_t gain_idx, - struct audio_stream __sparse_cache *source, int frames); + struct audio_stream *source, int frames); aria_get_data_func aria_algo_get_data_func(struct processing_module *mod); diff --git a/src/include/sof/audio/audio_stream.h b/src/include/sof/audio/audio_stream.h index ecfc63432d86..1bbc23b1e85e 100644 --- a/src/include/sof/audio/audio_stream.h +++ b/src/include/sof/audio/audio_stream.h @@ -104,148 +104,148 @@ struct audio_stream { struct sof_audio_stream_params runtime_stream_params; }; -static inline void *audio_stream_get_rptr(const struct audio_stream __sparse_cache *buf) +static inline void *audio_stream_get_rptr(const struct audio_stream *buf) { return buf->r_ptr; } -static inline void *audio_stream_get_wptr(const struct audio_stream __sparse_cache *buf) +static inline void *audio_stream_get_wptr(const struct audio_stream *buf) { return buf->w_ptr; } -static inline void *audio_stream_get_end_addr(const struct audio_stream __sparse_cache *buf) +static inline void *audio_stream_get_end_addr(const struct audio_stream *buf) { return buf->end_addr; } -static inline void *audio_stream_get_addr(const struct audio_stream __sparse_cache *buf) +static inline void *audio_stream_get_addr(const struct audio_stream *buf) { return buf->addr; } -static inline uint32_t audio_stream_get_size(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_get_size(const struct audio_stream *buf) { return buf->size; } -static inline uint32_t audio_stream_get_avail(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_get_avail(const struct audio_stream *buf) { return buf->avail; } -static inline uint32_t audio_stream_get_free(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_get_free(const struct audio_stream *buf) { return buf->free; } static inline enum sof_ipc_frame audio_stream_get_frm_fmt( - const struct audio_stream __sparse_cache *buf) + const struct audio_stream *buf) { return buf->runtime_stream_params.frame_fmt; } static inline enum sof_ipc_frame audio_stream_get_valid_fmt( - const struct audio_stream __sparse_cache *buf) + const struct audio_stream *buf) { return buf->runtime_stream_params.valid_sample_fmt; } -static inline uint32_t audio_stream_get_rate(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_get_rate(const struct audio_stream *buf) { return buf->runtime_stream_params.rate; } -static inline uint32_t audio_stream_get_channels(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_get_channels(const struct audio_stream *buf) { return buf->runtime_stream_params.channels; } -static inline bool audio_stream_get_underrun(const struct audio_stream __sparse_cache *buf) +static inline bool audio_stream_get_underrun(const struct audio_stream *buf) { return buf->runtime_stream_params.underrun_permitted; } -static inline uint32_t audio_stream_get_buffer_fmt(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_get_buffer_fmt(const struct audio_stream *buf) { return buf->runtime_stream_params.buffer_fmt; } -static inline bool audio_stream_get_overrun(const struct audio_stream __sparse_cache *buf) +static inline bool audio_stream_get_overrun(const struct audio_stream *buf) { return buf->runtime_stream_params.overrun_permitted; } -static inline void audio_stream_set_rptr(struct audio_stream __sparse_cache *buf, void *val) +static inline void audio_stream_set_rptr(struct audio_stream *buf, void *val) { buf->r_ptr = val; } -static inline void audio_stream_set_wptr(struct audio_stream __sparse_cache *buf, void *val) +static inline void audio_stream_set_wptr(struct audio_stream *buf, void *val) { buf->w_ptr = val; } -static inline void audio_stream_set_end_addr(struct audio_stream __sparse_cache *buf, void *val) +static inline void audio_stream_set_end_addr(struct audio_stream *buf, void *val) { buf->end_addr = val; } -static inline void audio_stream_set_addr(struct audio_stream __sparse_cache *buf, void *val) +static inline void audio_stream_set_addr(struct audio_stream *buf, void *val) { buf->addr = val; } -static inline void audio_stream_set_size(struct audio_stream __sparse_cache *buf, uint32_t val) +static inline void audio_stream_set_size(struct audio_stream *buf, uint32_t val) { buf->size = val; } -static inline void audio_stream_set_avail(struct audio_stream __sparse_cache *buf, uint32_t val) +static inline void audio_stream_set_avail(struct audio_stream *buf, uint32_t val) { buf->avail = val; } -static inline void audio_stream_set_free(struct audio_stream __sparse_cache *buf, uint32_t val) +static inline void audio_stream_set_free(struct audio_stream *buf, uint32_t val) { buf->free = val; } -static inline void audio_stream_set_frm_fmt(struct audio_stream __sparse_cache *buf, +static inline void audio_stream_set_frm_fmt(struct audio_stream *buf, enum sof_ipc_frame val) { buf->runtime_stream_params.frame_fmt = val; } -static inline void audio_stream_set_valid_fmt(struct audio_stream __sparse_cache *buf, +static inline void audio_stream_set_valid_fmt(struct audio_stream *buf, enum sof_ipc_frame val) { buf->runtime_stream_params.valid_sample_fmt = val; } -static inline void audio_stream_set_rate(struct audio_stream __sparse_cache *buf, uint32_t val) +static inline void audio_stream_set_rate(struct audio_stream *buf, uint32_t val) { buf->runtime_stream_params.rate = val; } -static inline void audio_stream_set_channels(struct audio_stream __sparse_cache *buf, uint16_t val) +static inline void audio_stream_set_channels(struct audio_stream *buf, uint16_t val) { buf->runtime_stream_params.channels = val; } -static inline void audio_stream_set_underrun(struct audio_stream __sparse_cache *buf, +static inline void audio_stream_set_underrun(struct audio_stream *buf, bool underrun_permitted) { buf->runtime_stream_params.underrun_permitted = underrun_permitted; } -static inline void audio_stream_set_overrun(struct audio_stream __sparse_cache *buf, +static inline void audio_stream_set_overrun(struct audio_stream *buf, bool overrun_permitted) { buf->runtime_stream_params.overrun_permitted = overrun_permitted; } -static inline void audio_stream_set_buffer_fmt(struct audio_stream __sparse_cache *buf, +static inline void audio_stream_set_buffer_fmt(struct audio_stream *buf, uint32_t buffer_fmt) { buf->runtime_stream_params.buffer_fmt = buffer_fmt; @@ -356,7 +356,7 @@ static inline void audio_stream_set_buffer_fmt(struct audio_stream __sparse_cach * @param params Parameters (frame format, rate, number of channels). * @return 0 if succeeded, error code otherwise. */ -static inline int audio_stream_set_params(struct audio_stream __sparse_cache *buffer, +static inline int audio_stream_set_params(struct audio_stream *buffer, struct sof_ipc_stream_params *params) { if (!params) @@ -374,7 +374,7 @@ static inline int audio_stream_set_params(struct audio_stream __sparse_cache *bu * @param buf Component buffer. * @return Period size in bytes. */ -static inline uint32_t audio_stream_frame_bytes(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_frame_bytes(const struct audio_stream *buf) { return get_frame_bytes(buf->runtime_stream_params.frame_fmt, buf->runtime_stream_params.channels); @@ -385,7 +385,7 @@ static inline uint32_t audio_stream_frame_bytes(const struct audio_stream __spar * @param buf Component buffer. * @return Size of sample in bytes. */ -static inline uint32_t audio_stream_sample_bytes(const struct audio_stream __sparse_cache *buf) +static inline uint32_t audio_stream_sample_bytes(const struct audio_stream *buf) { return get_sample_bytes(buf->runtime_stream_params.frame_fmt); } @@ -423,7 +423,7 @@ static inline uint32_t audio_stream_frame_align_get(const uint32_t byte_align, */ static inline void audio_stream_init_alignment_constants(const uint32_t byte_align, const uint32_t frame_align_req, - struct audio_stream __sparse_cache *stream) + struct audio_stream *stream) { uint32_t process_size; uint32_t frame_size = audio_stream_frame_bytes(stream); @@ -441,7 +441,7 @@ static inline void audio_stream_init_alignment_constants(const uint32_t byte_ali * @param frames Number of processing frames. * @return Period size in bytes. */ -static inline uint32_t audio_stream_period_bytes(const struct audio_stream __sparse_cache *buf, +static inline uint32_t audio_stream_period_bytes(const struct audio_stream *buf, uint32_t frames) { return frames * audio_stream_frame_bytes(buf); @@ -454,7 +454,7 @@ static inline uint32_t audio_stream_period_bytes(const struct audio_stream __spa * @param ptr Pointer * @return Pointer, adjusted if necessary. */ -static inline void *audio_stream_wrap(const struct audio_stream __sparse_cache *buffer, +static inline void *audio_stream_wrap(const struct audio_stream *buffer, void *ptr) { if (ptr >= buffer->end_addr) @@ -492,7 +492,7 @@ static inline void *cir_buf_wrap(void *ptr, void *buf_addr, void *buf_end) * @param ptr Pointer * @return Pointer, adjusted if necessary. */ -static inline void *audio_stream_rewind_wrap(const struct audio_stream __sparse_cache *buffer, +static inline void *audio_stream_rewind_wrap(const struct audio_stream *buffer, void *ptr) { if (ptr < buffer->addr) @@ -509,7 +509,7 @@ static inline void *audio_stream_rewind_wrap(const struct audio_stream __sparse_ * @return amount of data available for processing in bytes */ static inline uint32_t -audio_stream_get_avail_bytes(const struct audio_stream __sparse_cache *stream) +audio_stream_get_avail_bytes(const struct audio_stream *stream) { /* * In case of underrun-permitted stream, report buffer full instead of @@ -529,7 +529,7 @@ audio_stream_get_avail_bytes(const struct audio_stream __sparse_cache *stream) * @return amount of data available for processing in samples */ static inline uint32_t -audio_stream_get_avail_samples(const struct audio_stream __sparse_cache *stream) +audio_stream_get_avail_samples(const struct audio_stream *stream) { return audio_stream_get_avail_bytes(stream) / audio_stream_sample_bytes(stream); @@ -541,7 +541,7 @@ audio_stream_get_avail_samples(const struct audio_stream __sparse_cache *stream) * @return amount of data available for processing in frames */ static inline uint32_t -audio_stream_get_avail_frames(const struct audio_stream __sparse_cache *stream) +audio_stream_get_avail_frames(const struct audio_stream *stream) { return audio_stream_get_avail_bytes(stream) / audio_stream_frame_bytes(stream); @@ -553,7 +553,7 @@ audio_stream_get_avail_frames(const struct audio_stream __sparse_cache *stream) * @return amount of space free in bytes */ static inline uint32_t -audio_stream_get_free_bytes(const struct audio_stream __sparse_cache *stream) +audio_stream_get_free_bytes(const struct audio_stream *stream) { /* * In case of overrun-permitted stream, report buffer empty instead of @@ -573,7 +573,7 @@ audio_stream_get_free_bytes(const struct audio_stream __sparse_cache *stream) * @return amount of space free in samples */ static inline uint32_t -audio_stream_get_free_samples(const struct audio_stream __sparse_cache *stream) +audio_stream_get_free_samples(const struct audio_stream *stream) { return audio_stream_get_free_bytes(stream) / audio_stream_sample_bytes(stream); @@ -585,7 +585,7 @@ audio_stream_get_free_samples(const struct audio_stream __sparse_cache *stream) * @return amount of space free in frames */ static inline uint32_t -audio_stream_get_free_frames(const struct audio_stream __sparse_cache *stream) +audio_stream_get_free_frames(const struct audio_stream *stream) { return audio_stream_get_free_bytes(stream) / audio_stream_frame_bytes(stream); @@ -601,8 +601,8 @@ audio_stream_get_free_frames(const struct audio_stream __sparse_cache *stream) * @return 1 if there is not enough free space in sink. * @return -1 if there is not enough data in source. */ -static inline int audio_stream_can_copy_bytes(const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, +static inline int audio_stream_can_copy_bytes(const struct audio_stream *source, + const struct audio_stream *sink, uint32_t bytes) { /* check for underrun */ @@ -626,8 +626,8 @@ static inline int audio_stream_can_copy_bytes(const struct audio_stream __sparse * @return Number of bytes. */ static inline uint32_t -audio_stream_get_copy_bytes(const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink) +audio_stream_get_copy_bytes(const struct audio_stream *source, + const struct audio_stream *sink) { uint32_t avail = audio_stream_get_avail_bytes(source); uint32_t free = audio_stream_get_free_bytes(sink); @@ -647,8 +647,8 @@ audio_stream_get_copy_bytes(const struct audio_stream __sparse_cache *source, * @return Number of frames. */ static inline uint32_t -audio_stream_avail_frames(const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink) +audio_stream_avail_frames(const struct audio_stream *source, + const struct audio_stream *sink) { uint32_t src_frames = audio_stream_get_avail_frames(source); uint32_t sink_frames = audio_stream_get_free_frames(sink); @@ -665,8 +665,8 @@ audio_stream_avail_frames(const struct audio_stream __sparse_cache *source, * @return Number of frames. */ static inline uint32_t -audio_stream_avail_frames_aligned(const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink) +audio_stream_avail_frames_aligned(const struct audio_stream *source, + const struct audio_stream *sink) { uint32_t src_frames = (audio_stream_get_avail_bytes(source) >> source->runtime_stream_params.align_shift_idx) * @@ -683,7 +683,7 @@ audio_stream_avail_frames_aligned(const struct audio_stream __sparse_cache *sour * @param buffer Buffer to update. * @param bytes Number of written bytes. */ -static inline void audio_stream_produce(struct audio_stream __sparse_cache *buffer, +static inline void audio_stream_produce(struct audio_stream *buffer, uint32_t bytes) { buffer->w_ptr = audio_stream_wrap(buffer, @@ -711,7 +711,7 @@ static inline void audio_stream_produce(struct audio_stream __sparse_cache *buff * @param buffer Buffer to update. * @param bytes Number of read bytes. */ -static inline void audio_stream_consume(struct audio_stream __sparse_cache *buffer, +static inline void audio_stream_consume(struct audio_stream *buffer, uint32_t bytes) { buffer->r_ptr = audio_stream_wrap(buffer, @@ -734,7 +734,7 @@ static inline void audio_stream_consume(struct audio_stream __sparse_cache *buff * Resets the buffer. * @param buffer Buffer to reset. */ -static inline void audio_stream_reset(struct audio_stream __sparse_cache *buffer) +static inline void audio_stream_reset(struct audio_stream *buffer) { /* reset read and write pointer to buffer bas */ buffer->w_ptr = buffer->addr; @@ -753,7 +753,7 @@ static inline void audio_stream_reset(struct audio_stream __sparse_cache *buffer * @param buff_addr Address of the memory block to assign. * @param size Size of the memory block in bytes. */ -void audio_stream_init(struct audio_stream __sparse_cache *audio_stream, +void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint32_t size); /** @@ -762,7 +762,7 @@ void audio_stream_init(struct audio_stream __sparse_cache *audio_stream, * @param buffer Buffer. * @param bytes Size of the fragment to invalidate. */ -static inline void audio_stream_invalidate(struct audio_stream __sparse_cache *buffer, +static inline void audio_stream_invalidate(struct audio_stream *buffer, uint32_t bytes) { uint32_t head_size = bytes; @@ -786,7 +786,7 @@ static inline void audio_stream_invalidate(struct audio_stream __sparse_cache *b * @param buffer Buffer. * @param bytes Size of the fragment to write back. */ -static inline void audio_stream_writeback(struct audio_stream __sparse_cache *buffer, +static inline void audio_stream_writeback(struct audio_stream *buffer, uint32_t bytes) { uint32_t head_size = bytes; @@ -811,7 +811,7 @@ static inline void audio_stream_writeback(struct audio_stream __sparse_cache *bu * @return Number of data samples to buffer wrap. */ static inline int -audio_stream_bytes_without_wrap(const struct audio_stream __sparse_cache *source, +audio_stream_bytes_without_wrap(const struct audio_stream *source, const void *ptr) { assert((intptr_t)source->end_addr >= (intptr_t)ptr); @@ -827,7 +827,7 @@ audio_stream_bytes_without_wrap(const struct audio_stream __sparse_cache *source * need to add size of sample to returned bytes count. */ static inline int -audio_stream_rewind_bytes_without_wrap(const struct audio_stream __sparse_cache *source, +audio_stream_rewind_bytes_without_wrap(const struct audio_stream *source, const void *ptr) { assert((intptr_t)ptr >= (intptr_t)source->addr); @@ -843,7 +843,7 @@ audio_stream_rewind_bytes_without_wrap(const struct audio_stream __sparse_cache * @return Previous position of the write pointer. */ static inline uint32_t -*audio_stream_rewind_wptr_by_bytes(const struct audio_stream __sparse_cache *source, +*audio_stream_rewind_wptr_by_bytes(const struct audio_stream *source, const uint32_t bytes) { void *wptr = audio_stream_get_wptr(source); @@ -866,7 +866,7 @@ static inline uint32_t * @return Number of data s16 samples until circular wrap need at end */ static inline int -audio_stream_samples_without_wrap_s16(const struct audio_stream __sparse_cache *source, +audio_stream_samples_without_wrap_s16(const struct audio_stream *source, const void *ptr) { int to_end = (int16_t *)source->end_addr - (int16_t *)ptr; @@ -883,7 +883,7 @@ audio_stream_samples_without_wrap_s16(const struct audio_stream __sparse_cache * * @return Number of data s24 samples until circular wrap need at end */ static inline int -audio_stream_samples_without_wrap_s24(const struct audio_stream __sparse_cache *source, +audio_stream_samples_without_wrap_s24(const struct audio_stream *source, const void *ptr) { int to_end = (int32_t *)source->end_addr - (int32_t *)ptr; @@ -900,7 +900,7 @@ audio_stream_samples_without_wrap_s24(const struct audio_stream __sparse_cache * * @return Number of data s32 samples until circular wrap need at end */ static inline int -audio_stream_samples_without_wrap_s32(const struct audio_stream __sparse_cache *source, +audio_stream_samples_without_wrap_s32(const struct audio_stream *source, const void *ptr) { int to_end = (int32_t *)source->end_addr - (int32_t *)ptr; @@ -947,7 +947,7 @@ static inline int cir_buf_samples_without_wrap_s32(void *ptr, void *buf_end) * @return Number of data frames to buffer wrap. */ static inline uint32_t -audio_stream_frames_without_wrap(const struct audio_stream __sparse_cache *source, +audio_stream_frames_without_wrap(const struct audio_stream *source, const void *ptr) { uint32_t bytes = audio_stream_bytes_without_wrap(source, ptr); @@ -965,8 +965,8 @@ audio_stream_frames_without_wrap(const struct audio_stream __sparse_cache *sourc * @param samples Number of samples to copy. * @return number of processed samples. */ -int audio_stream_copy(const struct audio_stream __sparse_cache *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, uint32_t ooffset, uint32_t samples); +int audio_stream_copy(const struct audio_stream *source, uint32_t ioffset, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples); /** * Copies data from one circular buffer to another circular buffer. @@ -990,7 +990,7 @@ void cir_buf_copy(void *src, void *src_addr, void *src_end, void *dst, * @param samples Number of samples to copy. */ void audio_stream_copy_from_linear(const void *linear_source, int ioffset, - struct audio_stream __sparse_cache *sink, int ooffset, + struct audio_stream *sink, int ooffset, unsigned int samples); /** @@ -1001,7 +1001,7 @@ void audio_stream_copy_from_linear(const void *linear_source, int ioffset, * @param ooffset Offset (in samples) in sink buffer to start writing to. * @param samples Number of samples to copy. */ -void audio_stream_copy_to_linear(const struct audio_stream __sparse_cache *source, int ioffset, +void audio_stream_copy_to_linear(const struct audio_stream *source, int ioffset, void *linear_sink, int ooffset, unsigned int samples); /** @@ -1011,7 +1011,7 @@ void audio_stream_copy_to_linear(const struct audio_stream __sparse_cache *sourc * @return 0 if there is enough free space in buffer. * @return 1 if there is not enough free space in buffer. */ -static inline int audio_stream_set_zero(struct audio_stream __sparse_cache *buffer, +static inline int audio_stream_set_zero(struct audio_stream *buffer, uint32_t bytes) { uint32_t head_size = bytes; @@ -1073,14 +1073,14 @@ static inline void audio_stream_fmt_conversion(enum ipc4_bit_depth depth, /** get a handler to source API * NOTE! to use the handlers the buffer must be acquired by buffer_acquire */ -static inline struct sof_source __sparse_cache * -audio_stream_get_source(struct audio_stream __sparse_cache *audio_stream) +static inline struct sof_source * +audio_stream_get_source(struct audio_stream *audio_stream) { return &audio_stream->source_api; } -static inline struct sof_sink __sparse_cache * -audio_stream_get_sink(struct audio_stream __sparse_cache *audio_stream) +static inline struct sof_sink * +audio_stream_get_sink(struct audio_stream *audio_stream) { return &audio_stream->sink_api; } diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 51a505b209cf..631ced3dabd1 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -163,7 +163,7 @@ struct comp_buffer { /* Only to be used for synchronous same-core notifications! */ struct buffer_cb_transact { - struct comp_buffer __sparse_cache *buffer; + struct comp_buffer *buffer; uint32_t transaction_amount; void *transaction_begin_address; }; @@ -192,30 +192,30 @@ struct buffer_cb_free { struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, uint32_t align, bool is_shared); struct comp_buffer *buffer_new(const struct sof_ipc_buffer *desc, bool is_shared); -int buffer_set_size(struct comp_buffer __sparse_cache *buffer, uint32_t size, uint32_t alignment); +int buffer_set_size(struct comp_buffer *buffer, uint32_t size, uint32_t alignment); void buffer_free(struct comp_buffer *buffer); -void buffer_zero(struct comp_buffer __sparse_cache *buffer); +void buffer_zero(struct comp_buffer *buffer); /* called by a component after producing data into this buffer */ -void comp_update_buffer_produce(struct comp_buffer __sparse_cache *buffer, uint32_t bytes); +void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes); /* called by a component after consuming data from this buffer */ -void comp_update_buffer_consume(struct comp_buffer __sparse_cache *buffer, uint32_t bytes); +void comp_update_buffer_consume(struct comp_buffer *buffer, uint32_t bytes); -int buffer_set_params(struct comp_buffer __sparse_cache *buffer, +int buffer_set_params(struct comp_buffer *buffer, struct sof_ipc_stream_params *params, bool force_update); -bool buffer_params_match(struct comp_buffer __sparse_cache *buffer, +bool buffer_params_match(struct comp_buffer *buffer, struct sof_ipc_stream_params *params, uint32_t flag); -static inline void buffer_stream_invalidate(struct comp_buffer __sparse_cache *buffer, +static inline void buffer_stream_invalidate(struct comp_buffer *buffer, uint32_t bytes) { if (buffer->is_shared) audio_stream_invalidate(&buffer->stream, bytes); } -static inline void buffer_stream_writeback(struct comp_buffer __sparse_cache *buffer, +static inline void buffer_stream_writeback(struct comp_buffer *buffer, uint32_t bytes) { if (buffer->is_shared) @@ -223,13 +223,12 @@ static inline void buffer_stream_writeback(struct comp_buffer __sparse_cache *bu } /* stubs for acquire/release for compilation, to be removed at last step */ -__must_check static inline struct comp_buffer __sparse_cache *buffer_acquire( - struct comp_buffer *buffer) +__must_check static inline struct comp_buffer *buffer_acquire(struct comp_buffer *buffer) { - return (struct comp_buffer __sparse_cache *)buffer; + return (struct comp_buffer *)buffer; } -static inline void buffer_release(struct comp_buffer __sparse_cache *buffer) +static inline void buffer_release(struct comp_buffer *buffer) { (void)buffer; } @@ -252,14 +251,14 @@ void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir); static inline struct comp_dev *buffer_get_comp(struct comp_buffer *buffer, int dir) { - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(buffer); + struct comp_buffer *buffer_c = buffer_acquire(buffer); struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer_c->sink : buffer_c->source; buffer_release(buffer_c); return comp; } -static inline void buffer_reset_pos(struct comp_buffer __sparse_cache *buffer, void *data) +static inline void buffer_reset_pos(struct comp_buffer *buffer, void *data) { /* reset rw pointers and avail/free bytes counters */ audio_stream_reset(&buffer->stream); @@ -269,7 +268,7 @@ static inline void buffer_reset_pos(struct comp_buffer __sparse_cache *buffer, v } /* Run-time buffer re-configuration calls this too, so it must use cached access */ -static inline void buffer_init(struct comp_buffer __sparse_cache *buffer, +static inline void buffer_init(struct comp_buffer *buffer, uint32_t size, uint32_t caps) { buffer->caps = caps; @@ -278,7 +277,7 @@ static inline void buffer_init(struct comp_buffer __sparse_cache *buffer, audio_stream_init(&buffer->stream, buffer->stream.addr, size); } -static inline void buffer_reset_params(struct comp_buffer __sparse_cache *buffer, void *data) +static inline void buffer_reset_params(struct comp_buffer *buffer, void *data) { buffer->hw_params_configured = false; } diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index f860cdcb3d90..b4a61d765e21 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -817,7 +817,7 @@ static inline void component_set_nearest_period_frames(struct comp_dev *current, * @param copy_bytes Requested size of data to be available. */ static inline void comp_underrun(struct comp_dev *dev, - struct comp_buffer __sparse_cache *source, + struct comp_buffer *source, uint32_t copy_bytes) { LOG_MODULE_DECLARE(component, CONFIG_SOF_LOG_LEVEL); @@ -839,7 +839,7 @@ static inline void comp_underrun(struct comp_dev *dev, * @param sink Sink buffer. * @param copy_bytes Requested size of free space to be available. */ -static inline void comp_overrun(struct comp_dev *dev, struct comp_buffer __sparse_cache *sink, +static inline void comp_overrun(struct comp_dev *dev, struct comp_buffer *sink, uint32_t copy_bytes) { LOG_MODULE_DECLARE(component, CONFIG_SOF_LOG_LEVEL); @@ -864,8 +864,8 @@ static inline void comp_overrun(struct comp_dev *dev, struct comp_buffer __spars * @param[in] sink Sink buffer. * @param[out] cl Current copy limits. */ -void comp_get_copy_limits(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +void comp_get_copy_limits(struct comp_buffer *source, + struct comp_buffer *sink, struct comp_copy_limits *cl); /** @@ -877,8 +877,8 @@ void comp_get_copy_limits(struct comp_buffer __sparse_cache *source, * @param[in] sink Buffer of sink. * @param[out] cl Current copy limits. */ -void comp_get_copy_limits_frame_aligned(const struct comp_buffer __sparse_cache *source, - const struct comp_buffer __sparse_cache *sink, +void comp_get_copy_limits_frame_aligned(const struct comp_buffer *source, + const struct comp_buffer *sink, struct comp_copy_limits *cl); /** @@ -894,7 +894,7 @@ void comp_get_copy_limits_with_lock(struct comp_buffer *source, struct comp_buffer *sink, struct comp_copy_limits *cl) { - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; source_c = buffer_acquire(source); sink_c = buffer_acquire(sink); @@ -919,7 +919,7 @@ void comp_get_copy_limits_with_lock_frame_aligned(struct comp_buffer *source, struct comp_buffer *sink, struct comp_copy_limits *cl) { - struct comp_buffer __sparse_cache *source_c, *sink_c; + struct comp_buffer *source_c, *sink_c; source_c = buffer_acquire(source); sink_c = buffer_acquire(sink); diff --git a/src/include/sof/audio/dcblock/dcblock.h b/src/include/sof/audio/dcblock/dcblock.h index 35019364b33f..2d0d46317e5c 100644 --- a/src/include/sof/audio/dcblock/dcblock.h +++ b/src/include/sof/audio/dcblock/dcblock.h @@ -43,8 +43,8 @@ struct dcblock_state { struct comp_data; typedef void (*dcblock_func)(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames); /* DC Blocking Filter component private data */ diff --git a/src/include/sof/audio/drc/drc.h b/src/include/sof/audio/drc/drc.h index ee480e1d8692..e7571096313e 100644 --- a/src/include/sof/audio/drc/drc.h +++ b/src/include/sof/audio/drc/drc.h @@ -60,8 +60,8 @@ struct drc_state { }; typedef void (*drc_func)(struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames); /* DRC component private data */ @@ -83,8 +83,8 @@ extern const struct drc_proc_fnmap drc_proc_fnmap[]; extern const size_t drc_proc_fncount; void drc_default_pass(struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, uint32_t frames); + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames); /** * \brief Returns DRC processing function. */ diff --git a/src/include/sof/audio/igo_nr/igo_nr_comp.h b/src/include/sof/audio/igo_nr/igo_nr_comp.h index 50159adb1a08..64c663a99944 100644 --- a/src/include/sof/audio/igo_nr/igo_nr_comp.h +++ b/src/include/sof/audio/igo_nr/igo_nr_comp.h @@ -41,8 +41,8 @@ struct comp_data { int32_t sink_frames_max; /* Max # of frames to process at sink */ int32_t frames; /* IO buffer length */ void (*igo_nr_func)(struct comp_data *cd, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, int32_t frames); }; diff --git a/src/include/sof/audio/mixer.h b/src/include/sof/audio/mixer.h index 2dd5e3c80885..118aaf1c914f 100644 --- a/src/include/sof/audio/mixer.h +++ b/src/include/sof/audio/mixer.h @@ -34,16 +34,16 @@ void sys_comp_module_mixer_interface_init(void); /* mixer component private data */ struct mixer_data { - void (*mix_func)(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t count, + void (*mix_func)(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t count, uint32_t frames); }; /** * \brief mixer processing function interface */ -typedef void (*mixer_func)(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t num_sources, +typedef void (*mixer_func)(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t num_sources, uint32_t frames); /** \brief Volume processing functions map. */ @@ -64,7 +64,7 @@ extern const size_t mixer_func_count; * \param[in] sinkb Sink buffer to match against */ static inline mixer_func mixer_get_processing_function(struct comp_dev *dev, - struct comp_buffer __sparse_cache *sinkb) + struct comp_buffer *sinkb) { int i; diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 28f5c0765d0c..038f774df3eb 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -245,14 +245,14 @@ void *module_allocate_memory(struct processing_module *mod, uint32_t size, uint3 int module_free_memory(struct processing_module *mod, void *ptr); void module_free_all_memory(struct processing_module *mod); int module_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks); + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); static inline bool module_is_ready_to_process(struct processing_module *mod, - struct sof_source __sparse_cache **sources, + struct sof_source **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, + struct sof_sink **sinks, int num_of_sinks) { struct module_data *md = &mod->priv; @@ -272,8 +272,8 @@ bool module_is_ready_to_process(struct processing_module *mod, } int module_process_sink_src(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks); + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); int module_process_legacy(struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, struct output_stream_buffer *output_buffers, @@ -319,8 +319,8 @@ static inline void module_update_buffer_position(struct input_stream_buffer *inp struct output_stream_buffer *output_buffers, uint32_t frames) { - struct audio_stream __sparse_cache *source = input_buffers->data; - struct audio_stream __sparse_cache *sink = output_buffers->data; + struct audio_stream *source = input_buffers->data; + struct audio_stream *sink = output_buffers->data; input_buffers->consumed += audio_stream_frame_bytes(source) * frames; output_buffers->size += audio_stream_frame_bytes(sink) * frames; diff --git a/src/include/sof/audio/module_adapter/module/module_interface.h b/src/include/sof/audio/module_adapter/module/module_interface.h index e4b7ddcfb7d4..5a4e27c354f7 100644 --- a/src/include/sof/audio/module_adapter/module/module_interface.h +++ b/src/include/sof/audio/module_adapter/module/module_interface.h @@ -158,8 +158,8 @@ struct module_interface { * component preparation in .prepare() */ int (*prepare)(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks); + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); /** * (optional) return true if the module is ready to process @@ -177,8 +177,8 @@ struct module_interface { * the module */ bool (*is_ready_to_process)(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks); + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); /** * Module specific processing procedure @@ -200,8 +200,8 @@ struct module_interface { * - sinks are handlers to sink API struct sink*[] */ int (*process)(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks); + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); /** * process_audio_stream (depreciated) diff --git a/src/include/sof/audio/multiband_drc/multiband_drc.h b/src/include/sof/audio/multiband_drc/multiband_drc.h index a5058bd158dc..2c331215a8ee 100644 --- a/src/include/sof/audio/multiband_drc/multiband_drc.h +++ b/src/include/sof/audio/multiband_drc/multiband_drc.h @@ -28,8 +28,8 @@ struct multiband_drc_state { }; typedef void (*multiband_drc_func)(const struct processing_module *mod, - const struct audio_stream __sparse_cache *source, - struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + struct audio_stream *sink, uint32_t frames); /* Multiband DRC component private data */ diff --git a/src/include/sof/audio/mux.h b/src/include/sof/audio/mux.h index 2c42c2506edd..e8eb9bc9de54 100644 --- a/src/include/sof/audio/mux.h +++ b/src/include/sof/audio/mux.h @@ -65,11 +65,11 @@ struct mux_stream_data { uint8_t reserved2[3]; // padding to ensure proper alignment of following instances } __attribute__((packed, aligned(4))); -typedef void(*demux_func)(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames, +typedef void(*demux_func)(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames, struct mux_look_up *look_up); -typedef void(*mux_func)(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache **sources, uint32_t frames, +typedef void(*mux_func)(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream **sources, uint32_t frames, struct mux_look_up *look_up); /** diff --git a/src/include/sof/audio/pcm_converter.h b/src/include/sof/audio/pcm_converter.h index 09d20f5568b6..a06dc79f632a 100644 --- a/src/include/sof/audio/pcm_converter.h +++ b/src/include/sof/audio/pcm_converter.h @@ -45,8 +45,8 @@ struct audio_stream; * \param samples number of samples to convert * \return error code or number of processed samples. */ -typedef int (*pcm_converter_func)(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +typedef int (*pcm_converter_func)(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t samples); /** @@ -156,8 +156,8 @@ pcm_get_conversion_vc_function(enum sof_ipc_frame in_bits, * \param converter core conversion function working on linear memory regions * \return error code or number of processed samples */ -int pcm_convert_as_linear(const struct audio_stream __sparse_cache *source, uint32_t ioffset, - struct audio_stream __sparse_cache *sink, uint32_t ooffset, +int pcm_convert_as_linear(const struct audio_stream *source, uint32_t ioffset, + struct audio_stream *sink, uint32_t ooffset, uint32_t samples, pcm_converter_lin_func converter); #endif /* __SOF_AUDIO_PCM_CONVERTER_H__ */ diff --git a/src/include/sof/audio/pipeline.h b/src/include/sof/audio/pipeline.h index d80e4380aa82..8dc5ea16d51d 100644 --- a/src/include/sof/audio/pipeline.h +++ b/src/include/sof/audio/pipeline.h @@ -100,7 +100,7 @@ struct pipeline_walk_context { int (*comp_func)(struct comp_dev *cd, struct comp_buffer *buffer, struct pipeline_walk_context *ctx, int dir); void *comp_data; - void (*buff_func)(struct comp_buffer __sparse_cache *buffer, void *data); + void (*buff_func)(struct comp_buffer *buffer, void *data); void *buff_data; struct comp_buffer *incoming; /**< pipelines to be scheduled after trigger walk */ diff --git a/src/include/sof/audio/selector.h b/src/include/sof/audio/selector.h index e07576430322..cd4aa926c7f4 100644 --- a/src/include/sof/audio/selector.h +++ b/src/include/sof/audio/selector.h @@ -100,8 +100,8 @@ struct sof_selector_avs_ipc4_config { }; #else -typedef void (*sel_func)(struct comp_dev *dev, struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *source, uint32_t frames); +typedef void (*sel_func)(struct comp_dev *dev, struct audio_stream *sink, + const struct audio_stream *source, uint32_t frames); #endif /** \brief Selector component private data. */ diff --git a/src/include/sof/audio/sink_api.h b/src/include/sof/audio/sink_api.h index 07172f332555..83aeae514317 100644 --- a/src/include/sof/audio/sink_api.h +++ b/src/include/sof/audio/sink_api.h @@ -54,13 +54,13 @@ struct sof_ipc_stream_params; * Retrieves size of free space available in sink (in bytes) * return number of free bytes in buffer available to immediate filling */ -size_t sink_get_free_size(struct sof_sink __sparse_cache *sink); +size_t sink_get_free_size(struct sof_sink *sink); /** * Retrieves size of free space available in sink (in frames) * return number of free bytes in buffer available to immediate filling */ -size_t sink_get_free_frames(struct sof_sink __sparse_cache *sink); +size_t sink_get_free_frames(struct sof_sink *sink); /** * Get a circular buffer to operate on (to write). @@ -81,7 +81,7 @@ size_t sink_get_free_frames(struct sof_sink __sparse_cache *sink); * @retval -ENODATA if req_size is bigger than free space * */ -int sink_get_buffer(struct sof_sink __sparse_cache *sink, size_t req_size, +int sink_get_buffer(struct sof_sink *sink, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size); /** @@ -96,7 +96,7 @@ int sink_get_buffer(struct sof_sink __sparse_cache *sink, size_t req_size, * commit_buffer with commit_size==MAXINT * @return proper error code (0 on success) */ -int sink_commit_buffer(struct sof_sink __sparse_cache *sink, size_t commit_size); +int sink_commit_buffer(struct sof_sink *sink, size_t commit_size); /** * Get total number of bytes processed by the sink (meaning - committed by sink_commit_buffer()) @@ -104,33 +104,33 @@ int sink_commit_buffer(struct sof_sink __sparse_cache *sink, size_t commit_size) * @param sink a handler to sink * @return total number of processed data */ -size_t sink_get_num_of_processed_bytes(struct sof_sink __sparse_cache *sink); +size_t sink_get_num_of_processed_bytes(struct sof_sink *sink); /** * sets counter of total number of bytes processed to zero */ -void sink_reset_num_of_processed_bytes(struct sof_sink __sparse_cache *sink); +void sink_reset_num_of_processed_bytes(struct sof_sink *sink); /** get size of a single audio frame (in bytes) */ -size_t sink_get_frame_bytes(struct sof_sink __sparse_cache *sink); +size_t sink_get_frame_bytes(struct sof_sink *sink); /** set of functions for retrieve audio parameters */ -enum sof_ipc_frame sink_get_frm_fmt(struct sof_sink __sparse_cache *sink); -enum sof_ipc_frame sink_get_valid_fmt(struct sof_sink __sparse_cache *sink); -uint32_t sink_get_rate(struct sof_sink __sparse_cache *sink); -uint32_t sink_get_channels(struct sof_sink __sparse_cache *sink); -uint32_t sink_get_buffer_fmt(struct sof_sink __sparse_cache *sink); -bool sink_get_overrun(struct sof_sink __sparse_cache *sink); +enum sof_ipc_frame sink_get_frm_fmt(struct sof_sink *sink); +enum sof_ipc_frame sink_get_valid_fmt(struct sof_sink *sink); +uint32_t sink_get_rate(struct sof_sink *sink); +uint32_t sink_get_channels(struct sof_sink *sink); +uint32_t sink_get_buffer_fmt(struct sof_sink *sink); +bool sink_get_overrun(struct sof_sink *sink); /** set of functions for setting audio parameters */ -int sink_set_frm_fmt(struct sof_sink __sparse_cache *sink, enum sof_ipc_frame frame_fmt); -int sink_set_valid_fmt(struct sof_sink __sparse_cache *sink, enum sof_ipc_frame valid_sample_fmt); -int sink_set_rate(struct sof_sink __sparse_cache *sink, unsigned int rate); -int sink_set_channels(struct sof_sink __sparse_cache *sink, unsigned int channels); -int sink_set_overrun(struct sof_sink __sparse_cache *sink, bool overrun_permitted); -int sink_set_buffer_fmt(struct sof_sink __sparse_cache *sink, uint32_t buffer_fmt); -void sink_set_obs(struct sof_sink __sparse_cache *sink, size_t obs); -size_t sink_get_obs(struct sof_sink __sparse_cache *sink); +int sink_set_frm_fmt(struct sof_sink *sink, enum sof_ipc_frame frame_fmt); +int sink_set_valid_fmt(struct sof_sink *sink, enum sof_ipc_frame valid_sample_fmt); +int sink_set_rate(struct sof_sink *sink, unsigned int rate); +int sink_set_channels(struct sof_sink *sink, unsigned int channels); +int sink_set_overrun(struct sof_sink *sink, bool overrun_permitted); +int sink_set_buffer_fmt(struct sof_sink *sink, uint32_t buffer_fmt); +void sink_set_obs(struct sof_sink *sink, size_t obs); +size_t sink_get_obs(struct sof_sink *sink); /** * initial set of audio parameters, provided in sof_ipc_stream_params @@ -140,7 +140,7 @@ size_t sink_get_obs(struct sof_sink __sparse_cache *sink); * @param force_update tells the implementation that the params should override actual settings * @return 0 if success */ -int sink_set_params(struct sof_sink __sparse_cache *sink, +int sink_set_params(struct sof_sink *sink, struct sof_ipc_stream_params *params, bool force_update); /** @@ -158,7 +158,7 @@ int sink_set_params(struct sof_sink __sparse_cache *sink, * * @return 0 if success */ -int sink_set_alignment_constants(struct sof_sink __sparse_cache *sink, +int sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_align, const uint32_t frame_align_req); diff --git a/src/include/sof/audio/sink_api_implementation.h b/src/include/sof/audio/sink_api_implementation.h index 15db32152039..71c694d8a774 100644 --- a/src/include/sof/audio/sink_api_implementation.h +++ b/src/include/sof/audio/sink_api_implementation.h @@ -27,18 +27,18 @@ struct sink_ops { /** * see comment of sink_get_free_size() */ - size_t (*get_free_size)(struct sof_sink __sparse_cache *sink); + size_t (*get_free_size)(struct sof_sink *sink); /** * see comment of sink_get_buffer() */ - int (*get_buffer)(struct sof_sink __sparse_cache *sink, size_t req_size, + int (*get_buffer)(struct sof_sink *sink, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size); /** * see comment of sink_commit_buffer() */ - int (*commit_buffer)(struct sof_sink __sparse_cache *sink, size_t commit_size); + int (*commit_buffer)(struct sof_sink *sink, size_t commit_size); /** * OPTIONAL: Notification to the sink implementation about changes in audio format @@ -49,20 +49,20 @@ struct sink_ops { * * @retval 0 if success, negative if new parameters are not supported */ - int (*on_audio_format_set)(struct sof_sink __sparse_cache *sink); + int (*on_audio_format_set)(struct sof_sink *sink); /** * OPTIONAL * see sink_set_params comments */ - int (*audio_set_ipc_params)(struct sof_sink __sparse_cache *sink, + int (*audio_set_ipc_params)(struct sof_sink *sink, struct sof_ipc_stream_params *params, bool force_update); /** * OPTIONAL * see comment for sink_set_alignment_constants */ - int (*set_alignment_constants)(struct sof_sink __sparse_cache *sink, + int (*set_alignment_constants)(struct sof_sink *sink, const uint32_t byte_align, const uint32_t frame_align_req); }; @@ -86,7 +86,7 @@ struct sof_sink { * the implementation must ensure coherent access to the parameteres * in case of i.e. cross core shared queue, it must be located in non-cached memory */ -void sink_init(struct sof_sink __sparse_cache *sink, const struct sink_ops *ops, +void sink_init(struct sof_sink *sink, const struct sink_ops *ops, struct sof_audio_stream_params *audio_stream_params); #endif /* __SOF_SINK_API_IMPLEMENTATION_H__ */ diff --git a/src/include/sof/audio/sink_source_utils.h b/src/include/sof/audio/sink_source_utils.h index 8f550b1d2276..ca8752f07294 100644 --- a/src/include/sof/audio/sink_source_utils.h +++ b/src/include/sof/audio/sink_source_utils.h @@ -19,7 +19,7 @@ * if false, data will remain in the source * @param size number of bytes to be copied */ -int source_to_sink_copy(struct sof_source __sparse_cache *source, - struct sof_sink __sparse_cache *sink, bool free, size_t size); +int source_to_sink_copy(struct sof_source *source, + struct sof_sink *sink, bool free, size_t size); #endif /* SINK_SOURCE_UTILS_H */ diff --git a/src/include/sof/audio/smart_amp/smart_amp.h b/src/include/sof/audio/smart_amp/smart_amp.h index 6438d7f082bc..d19f2e00e627 100644 --- a/src/include/sof/audio/smart_amp/smart_amp.h +++ b/src/include/sof/audio/smart_amp/smart_amp.h @@ -136,9 +136,9 @@ struct smart_amp_mod_struct_t { }; typedef void (*smart_amp_func)(const struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, - const struct audio_stream __sparse_cache *feedback, + const struct audio_stream *source, + const struct audio_stream *sink, + const struct audio_stream *feedback, uint32_t frames); struct smart_amp_func_map { uint16_t frame_fmt; @@ -151,14 +151,14 @@ int smart_amp_init(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev); int smart_amp_flush(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev); /* Feed forward processing function */ int smart_amp_ff_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, int8_t *chan_map, + const struct audio_stream *source, + const struct audio_stream *sink, int8_t *chan_map, struct smart_amp_mod_struct_t *hspk, uint32_t num_ch_in, uint32_t num_ch_out); /* Feedback processing function */ int smart_amp_fb_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, int8_t *chan_map, + const struct audio_stream *source, + const struct audio_stream *sink, int8_t *chan_map, struct smart_amp_mod_struct_t *hspk, uint32_t num_ch); /* memory usage calculation for the component */ diff --git a/src/include/sof/audio/source_api.h b/src/include/sof/audio/source_api.h index bfbcf530a81b..785b15167b17 100644 --- a/src/include/sof/audio/source_api.h +++ b/src/include/sof/audio/source_api.h @@ -54,13 +54,13 @@ struct sof_ipc_stream_params; * Retrieves size of available data (in bytes) * return number of bytes that are available for immediate use */ -size_t source_get_data_available(struct sof_source __sparse_cache *source); +size_t source_get_data_available(struct sof_source *source); /** * Retrieves size of available data (in frames) * return number of bytes that are available for immediate use */ -size_t source_get_data_frames_available(struct sof_source __sparse_cache *source); +size_t source_get_data_frames_available(struct sof_source *source); /** * Retrieves a fragment of circular data to be used by the caller (to read) @@ -93,7 +93,7 @@ size_t source_get_data_frames_available(struct sof_source __sparse_cache *source * * @retval -ENODATA if req_size is bigger than available data */ -int source_get_data(struct sof_source __sparse_cache *source, size_t req_size, +int source_get_data(struct sof_source *source, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size); /** @@ -110,38 +110,38 @@ int source_get_data(struct sof_source __sparse_cache *source, size_t req_size, * * @return proper error code (0 on success) */ -int source_release_data(struct sof_source __sparse_cache *source, size_t free_size); +int source_release_data(struct sof_source *source, size_t free_size); /** * Get total number of bytes processed by the source (meaning - freed by source_release_data()) */ -size_t source_get_num_of_processed_bytes(struct sof_source __sparse_cache *source); +size_t source_get_num_of_processed_bytes(struct sof_source *source); /** * sets counter of total number of bytes processed to zero */ -void source_reset_num_of_processed_bytes(struct sof_source __sparse_cache *source); +void source_reset_num_of_processed_bytes(struct sof_source *source); /** get size of a single audio frame (in bytes) */ -size_t source_get_frame_bytes(struct sof_source __sparse_cache *source); +size_t source_get_frame_bytes(struct sof_source *source); /** set of functions for retrieve audio parameters */ -enum sof_ipc_frame source_get_frm_fmt(struct sof_source __sparse_cache *source); -enum sof_ipc_frame source_get_valid_fmt(struct sof_source __sparse_cache *source); -unsigned int source_get_rate(struct sof_source __sparse_cache *source); -unsigned int source_get_channels(struct sof_source __sparse_cache *source); -uint32_t source_get_buffer_fmt(struct sof_source __sparse_cache *source); -bool source_get_underrun(struct sof_source __sparse_cache *source); +enum sof_ipc_frame source_get_frm_fmt(struct sof_source *source); +enum sof_ipc_frame source_get_valid_fmt(struct sof_source *source); +unsigned int source_get_rate(struct sof_source *source); +unsigned int source_get_channels(struct sof_source *source); +uint32_t source_get_buffer_fmt(struct sof_source *source); +bool source_get_underrun(struct sof_source *source); /** set of functions for setting audio parameters */ -int source_set_valid_fmt(struct sof_source __sparse_cache *source, +int source_set_valid_fmt(struct sof_source *source, enum sof_ipc_frame valid_sample_fmt); -int source_set_rate(struct sof_source __sparse_cache *source, unsigned int rate); -int source_set_channels(struct sof_source __sparse_cache *source, unsigned int channels); -int source_set_underrun(struct sof_source __sparse_cache *source, bool underrun_permitted); -int source_set_buffer_fmt(struct sof_source __sparse_cache *source, uint32_t buffer_fmt); -void source_set_ibs(struct sof_source __sparse_cache *source, size_t ibs); -size_t source_get_ibs(struct sof_source __sparse_cache *source); +int source_set_rate(struct sof_source *source, unsigned int rate); +int source_set_channels(struct sof_source *source, unsigned int channels); +int source_set_underrun(struct sof_source *source, bool underrun_permitted); +int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt); +void source_set_ibs(struct sof_source *source, size_t ibs); +size_t source_get_ibs(struct sof_source *source); /** * initial set of audio parameters, provided in sof_ipc_stream_params @@ -151,7 +151,7 @@ size_t source_get_ibs(struct sof_source __sparse_cache *source); * @param force_update tells the implementation that the params should override actual settings * @return 0 if success */ -int source_set_params(struct sof_source __sparse_cache *source, +int source_set_params(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update); /** @@ -169,7 +169,7 @@ int source_set_params(struct sof_source __sparse_cache *source, * * @return 0 if success */ -int source_set_alignment_constants(struct sof_source __sparse_cache *source, +int source_set_alignment_constants(struct sof_source *source, const uint32_t byte_align, const uint32_t frame_align_req); diff --git a/src/include/sof/audio/source_api_implementation.h b/src/include/sof/audio/source_api_implementation.h index c75330cde019..4977c81e86d2 100644 --- a/src/include/sof/audio/source_api_implementation.h +++ b/src/include/sof/audio/source_api_implementation.h @@ -27,18 +27,18 @@ struct source_ops { /** * see comment of source_get_data_available() */ - size_t (*get_data_available)(struct sof_source __sparse_cache *source); + size_t (*get_data_available)(struct sof_source *source); /** * see comment of source_get_data_available() */ - int (*get_data)(struct sof_source __sparse_cache *source, size_t req_size, + int (*get_data)(struct sof_source *source, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size); /** * see comment of source_release_data() */ - int (*release_data)(struct sof_source __sparse_cache *source, size_t free_size); + int (*release_data)(struct sof_source *source, size_t free_size); /** * OPTIONAL: Notification to the source implementation about changes in audio format @@ -49,20 +49,20 @@ struct source_ops { * * @retval 0 if success, negative if new parameteres are not supported */ - int (*on_audio_format_set)(struct sof_source __sparse_cache *source); + int (*on_audio_format_set)(struct sof_source *source); /** * OPTIONAL * see source_set_params comments */ - int (*audio_set_ipc_params)(struct sof_source __sparse_cache *source, + int (*audio_set_ipc_params)(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update); /** * OPTIONAL * see comment for source_set_alignment_constants */ - int (*set_alignment_constants)(struct sof_source __sparse_cache *source, + int (*set_alignment_constants)(struct sof_source *source, const uint32_t byte_align, const uint32_t frame_align_req); }; @@ -86,7 +86,7 @@ struct sof_source { * the implementation must ensure coherent access to the parameteres * in case of i.e. cross core shared queue, it must be located in non-cached memory */ -void source_init(struct sof_source __sparse_cache *source, const struct source_ops *ops, +void source_init(struct sof_source *source, const struct source_ops *ops, struct sof_audio_stream_params *audio_stream_params); #endif /* __SOF_SOURCE_API_IMPLEMENTATION_H__ */ diff --git a/src/include/sof/math/fir_hifi3.h b/src/include/sof/math/fir_hifi3.h index a3d4b19ce0ce..aa1102ef2a1f 100644 --- a/src/include/sof/math/fir_hifi3.h +++ b/src/include/sof/math/fir_hifi3.h @@ -48,7 +48,7 @@ static inline void fir_core_setup_circular(struct fir_state_32x16 *fir) } /* Setup circular for component buffer */ -static inline void fir_comp_setup_circular(const struct audio_stream __sparse_cache *buffer) +static inline void fir_comp_setup_circular(const struct audio_stream *buffer) { AE_SETCBEGIN0(audio_stream_get_addr(buffer)); AE_SETCEND0(audio_stream_get_end_addr(buffer)); diff --git a/src/ipc/ipc-helper.c b/src/ipc/ipc-helper.c index d71045139d82..5ca3c78c72e6 100644 --- a/src/ipc/ipc-helper.c +++ b/src/ipc/ipc-helper.c @@ -80,7 +80,7 @@ int32_t ipc_comp_pipe_id(const struct ipc_comp_dev *icd) */ static void comp_update_params(uint32_t flag, struct sof_ipc_stream_params *params, - struct comp_buffer __sparse_cache *buffer) + struct comp_buffer *buffer) { if (flag & BUFF_PARAMS_FRAME_FMT) params->frame_fmt = audio_stream_get_frm_fmt(&buffer->stream); @@ -104,7 +104,7 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag, struct list_item *clist; struct comp_buffer *sinkb; struct comp_buffer *buf; - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; int dir = dev->direction; if (!params) { @@ -291,7 +291,7 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id) irq_local_disable(flags); list_for_item_safe(clist, tmp, &icd->cd->bsource_list) { struct comp_buffer *buffer = container_of(clist, struct comp_buffer, sink_list); - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(buffer); + struct comp_buffer *buffer_c = buffer_acquire(buffer); buffer_c->sink = NULL; buffer_release(buffer_c); @@ -304,7 +304,7 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id) list_for_item_safe(clist, tmp, &icd->cd->bsink_list) { struct comp_buffer *buffer = container_of(clist, struct comp_buffer, source_list); - struct comp_buffer __sparse_cache *buffer_c = buffer_acquire(buffer); + struct comp_buffer *buffer_c = buffer_acquire(buffer); buffer_c->source = NULL; buffer_release(buffer_c); diff --git a/src/ipc/ipc3/dai.c b/src/ipc/ipc3/dai.c index decee57299b9..ccc41524e002 100644 --- a/src/ipc/ipc3/dai.c +++ b/src/ipc/ipc3/dai.c @@ -103,7 +103,7 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev) { struct ipc_config_dai *dai = &dd->ipc_config; struct sof_ipc_dai_config *config = ipc_from_dai_config(dd->dai_spec_config); - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; if (!config) { comp_err(dev, "dai_data_config(): no config set for dai %d type %d", diff --git a/src/ipc/ipc3/helper.c b/src/ipc/ipc3/helper.c index 2bd55ec22717..9a9bbf0ac21d 100644 --- a/src/ipc/ipc3/helper.c +++ b/src/ipc/ipc3/helper.c @@ -487,7 +487,7 @@ int ipc_buffer_free(struct ipc *ipc, uint32_t buffer_id) unsigned int core; bool sink_active = false; bool source_active = false; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; /* check whether buffer exists */ ibd = ipc_get_buffer_by_id(ipc, buffer_id); diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 1d2838c1ed57..206773d23c0c 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -241,7 +241,7 @@ static int ipc_pipeline_module_free(uint32_t pipeline_id) /* free sink buffer allocated by current component in bind function */ list_for_item_safe(list, _list, &icd->cd->bsink_list) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct comp_dev *sink; buffer = container_of(list, struct comp_buffer, source_list); @@ -257,7 +257,7 @@ static int ipc_pipeline_module_free(uint32_t pipeline_id) /* free source buffer allocated by current component in bind function */ list_for_item_safe(list, _list, &icd->cd->bsource_list) { - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct comp_dev *source; buffer = container_of(list, struct comp_buffer, sink_list); @@ -337,7 +337,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) { struct ipc4_module_bind_unbind *bu; struct comp_buffer *buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct comp_dev *source; struct comp_dev *sink; struct ipc4_base_module_cfg source_src_cfg; @@ -490,7 +490,7 @@ int ipc_comp_disconnect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) buffer_id = IPC4_COMP_ID(bu->extension.r.src_queue, bu->extension.r.dst_queue); list_for_item(sink_list, &src->bsink_list) { struct comp_buffer *buf = container_of(sink_list, struct comp_buffer, source_list); - struct comp_buffer __sparse_cache *buf_c = buffer_acquire(buf); + struct comp_buffer *buf_c = buffer_acquire(buf); bool found = buf_c->id == buffer_id; buffer_release(buf_c); @@ -841,7 +841,7 @@ void ipc4_base_module_cfg_to_stream_params(const struct ipc4_base_module_cfg *ba params->chmap[i] = (base_cfg->audio_fmt.ch_map >> i * 4) & 0xf; } -void ipc4_update_buffer_format(struct comp_buffer __sparse_cache *buf_c, +void ipc4_update_buffer_format(struct comp_buffer *buf_c, const struct ipc4_audio_format *fmt) { enum sof_ipc_frame valid_fmt, frame_fmt; diff --git a/src/lib/dma.c b/src/lib/dma.c index 6115cfba1e85..f124a040c4c3 100644 --- a/src/lib/dma.c +++ b/src/lib/dma.c @@ -321,11 +321,11 @@ void dma_sg_free(struct dma_sg_elem_array *elem_array) dma_sg_init(elem_array); } -int dma_buffer_copy_from(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +int dma_buffer_copy_from(struct comp_buffer *source, + struct comp_buffer *sink, dma_process_func process, uint32_t source_bytes) { - struct audio_stream __sparse_cache *istream = &source->stream; + struct audio_stream *istream = &source->stream; uint32_t samples = source_bytes / audio_stream_sample_bytes(istream); uint32_t sink_bytes = audio_stream_sample_bytes(&sink->stream) * @@ -350,11 +350,11 @@ int dma_buffer_copy_from(struct comp_buffer __sparse_cache *source, return ret; } -int dma_buffer_copy_to(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +int dma_buffer_copy_to(struct comp_buffer *source, + struct comp_buffer *sink, dma_process_func process, uint32_t sink_bytes) { - struct audio_stream __sparse_cache *ostream = &sink->stream; + struct audio_stream *ostream = &sink->stream; uint32_t samples = sink_bytes / audio_stream_sample_bytes(ostream); uint32_t source_bytes = audio_stream_sample_bytes(&source->stream) * @@ -379,11 +379,11 @@ int dma_buffer_copy_to(struct comp_buffer __sparse_cache *source, return ret; } -int dma_buffer_copy_from_no_consume(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +int dma_buffer_copy_from_no_consume(struct comp_buffer *source, + struct comp_buffer *sink, dma_process_func process, uint32_t source_bytes) { - struct audio_stream __sparse_cache *istream = &source->stream; + struct audio_stream *istream = &source->stream; uint32_t samples = source_bytes / audio_stream_sample_bytes(istream); uint32_t sink_bytes = audio_stream_sample_bytes(&sink->stream) * diff --git a/src/probe/probe.c b/src/probe/probe.c index 91344e08c56a..fe1b8ae9efa1 100644 --- a/src/probe/probe.c +++ b/src/probe/probe.c @@ -879,7 +879,7 @@ static void probe_cb_produce(void *arg, enum notify_id type, void *data) { struct probe_pdata *_probe = probe_get(); struct buffer_cb_transact *cb_data = data; - struct comp_buffer __sparse_cache *buffer = cb_data->buffer; + struct comp_buffer *buffer = cb_data->buffer; struct probe_dma_ext *dma; uint32_t buffer_id; uint32_t head, tail; @@ -1066,7 +1066,7 @@ static bool probe_purpose_needs_ext_dma(uint32_t purpose) static struct comp_buffer *ipc4_get_buffer(struct ipc_comp_dev *dev, probe_point_id_t probe_point) { struct comp_buffer *buf; - struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buf_c; struct list_item *sink_list, *source_list; unsigned int queue_id; diff --git a/src/samples/audio/detect_test.c b/src/samples/audio/detect_test.c index 55058f6ca047..632ad4a6a00d 100644 --- a/src/samples/audio/detect_test.c +++ b/src/samples/audio/detect_test.c @@ -101,7 +101,7 @@ struct comp_data { struct ipc_msg *msg; /**< host notification */ void (*detect_func)(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, uint32_t frames); + const struct audio_stream *source, uint32_t frames); struct sof_ipc_comp_event event; #if CONFIG_AMS @@ -209,7 +209,7 @@ void detect_test_notify(const struct comp_dev *dev) } static void default_detect_test(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, uint32_t frames) { struct comp_data *cd = comp_get_drvdata(dev); @@ -797,7 +797,7 @@ static int test_keyword_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; unsigned int channels, rate; enum sof_ipc_frame frame_fmt; int err; @@ -881,7 +881,7 @@ static int test_keyword_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *source; - struct comp_buffer __sparse_cache *source_c; + struct comp_buffer *source_c; uint32_t frames; comp_dbg(dev, "test_keyword_copy()"); diff --git a/src/samples/audio/kwd_nn_detect_test.c b/src/samples/audio/kwd_nn_detect_test.c index df0a8c80af98..ef71a441580b 100644 --- a/src/samples/audio/kwd_nn_detect_test.c +++ b/src/samples/audio/kwd_nn_detect_test.c @@ -35,7 +35,7 @@ static int kwd_nn_detect_postprocess(uint8_t confidences[KWD_NN_CONFIDENCES_SIZE } void kwd_nn_detect_test(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, + const struct audio_stream *source, uint32_t frames) { void *src; diff --git a/src/samples/audio/smart_amp_test_ipc3.c b/src/samples/audio/smart_amp_test_ipc3.c index b2056c6cb7d0..dc58cd0727d9 100644 --- a/src/samples/audio/smart_amp_test_ipc3.c +++ b/src/samples/audio/smart_amp_test_ipc3.c @@ -28,8 +28,8 @@ DECLARE_TR_CTX(smart_amp_comp_tr, SOF_UUID(smart_amp_comp_uuid), LOG_LEVEL_INFO); typedef int(*smart_amp_proc)(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, uint32_t frames, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames, int8_t *chan_map); struct smart_amp_data { @@ -316,7 +316,7 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) case COMP_TRIGGER_START: case COMP_TRIGGER_RELEASE: if (sad->feedback_buf) { - struct comp_buffer __sparse_cache *buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); buffer_zero(buf); buffer_release(buf); } @@ -332,8 +332,8 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) } static int smart_amp_process_s16(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames, int8_t *chan_map) { struct smart_amp_data *sad = comp_get_drvdata(dev); @@ -364,8 +364,8 @@ static int smart_amp_process_s16(struct comp_dev *dev, } static int smart_amp_process_s32(struct comp_dev *dev, - const struct audio_stream __sparse_cache *source, - const struct audio_stream __sparse_cache *sink, + const struct audio_stream *source, + const struct audio_stream *sink, uint32_t frames, int8_t *chan_map) { struct smart_amp_data *sad = comp_get_drvdata(dev); @@ -397,7 +397,7 @@ static int smart_amp_process_s32(struct comp_dev *dev, } static smart_amp_proc get_smart_amp_process(struct comp_dev *dev, - struct comp_buffer __sparse_cache *buf) + struct comp_buffer *buf) { switch (audio_stream_get_frm_fmt(&buf->stream)) { case SOF_IPC_FRAME_S16_LE: @@ -414,8 +414,8 @@ static smart_amp_proc get_smart_amp_process(struct comp_dev *dev, static int smart_amp_copy(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer __sparse_cache *source_buf = buffer_acquire(sad->source_buf); - struct comp_buffer __sparse_cache *sink_buf = buffer_acquire(sad->sink_buf); + struct comp_buffer *source_buf = buffer_acquire(sad->source_buf); + struct comp_buffer *sink_buf = buffer_acquire(sad->sink_buf); uint32_t avail_passthrough_frames; uint32_t avail_feedback_frames; uint32_t avail_frames = 0; @@ -431,7 +431,7 @@ static int smart_amp_copy(struct comp_dev *dev) &sink_buf->stream); if (sad->feedback_buf) { - struct comp_buffer __sparse_cache *buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); if (buf->source && comp_get_state(dev, buf->source) == dev->state) { /* feedback */ @@ -496,7 +496,7 @@ static int smart_amp_prepare(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); struct comp_buffer *source_buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct list_item *blist; int ret; @@ -535,7 +535,7 @@ static int smart_amp_prepare(struct comp_dev *dev) sad->in_channels = audio_stream_get_channels(&buffer_c->stream); if (sad->feedback_buf) { - struct comp_buffer __sparse_cache *buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); audio_stream_set_channels(&buf->stream, sad->config.feedback_channels); audio_stream_set_rate(&buf->stream, audio_stream_get_rate(&buffer_c->stream)); diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index a256de9c3d28..802e54a39169 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -92,7 +92,7 @@ static void smart_amp_set_params(struct processing_module *mod) struct comp_dev *dev = mod->dev; struct smart_amp_data *sad = module_get_private_data(mod); struct comp_buffer *sink; - struct comp_buffer __sparse_cache *sink_c; + struct comp_buffer *sink_c; ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); @@ -196,8 +196,8 @@ static int smart_amp_process_s16(struct processing_module *mod, uint32_t frames, int8_t *chan_map) { struct smart_amp_data *sad = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int16_t *src; int16_t *dest; uint32_t in_frag = 0; @@ -229,8 +229,8 @@ static int smart_amp_process_s32(struct processing_module *mod, uint32_t frames, int8_t *chan_map) { struct smart_amp_data *sad = module_get_private_data(mod); - struct audio_stream __sparse_cache *source = bsource->data; - struct audio_stream __sparse_cache *sink = bsink->data; + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; int32_t *src; int32_t *dest; uint32_t in_frag = 0; @@ -258,7 +258,7 @@ static int smart_amp_process_s32(struct processing_module *mod, } static smart_amp_proc get_smart_amp_process(struct comp_dev *dev, - struct comp_buffer __sparse_cache *buf) + struct comp_buffer *buf) { switch (audio_stream_get_frm_fmt(&buf->stream)) { case SOF_IPC_FRAME_S16_LE: @@ -278,8 +278,8 @@ static int smart_amp_process(struct processing_module *mod, { struct smart_amp_data *sad = module_get_private_data(mod); struct comp_dev *dev = mod->dev; - struct comp_buffer __sparse_cache *fb_buf_c; - struct comp_buffer __sparse_cache *buf; + struct comp_buffer *fb_buf_c; + struct comp_buffer *buf; struct module_source_info __sparse_cache *mod_source_info; struct input_stream_buffer *fb_input = NULL; /* if there is only one input stream, it should be the source input */ @@ -294,7 +294,7 @@ static int smart_amp_process(struct processing_module *mod, if (num_input_buffers == SMART_AMP_NUM_IN_PINS) for (i = 0; i < num_input_buffers; i++) { buf = attr_container_of(input_buffers[i].data, - struct comp_buffer __sparse_cache, + struct comp_buffer, stream, __sparse_cache); if (IPC4_SINK_QUEUE_ID(buf->id) == SOF_SMART_AMP_FEEDBACK_QUEUE_ID) { @@ -345,14 +345,14 @@ static int smart_amp_reset(struct processing_module *mod) } static int smart_amp_prepare(struct processing_module *mod, - struct sof_source __sparse_cache **sources, int num_of_sources, - struct sof_sink __sparse_cache **sinks, int num_of_sinks) + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct smart_amp_data *sad = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *source_buffer; struct comp_buffer *sink_buffer; - struct comp_buffer __sparse_cache *buffer_c; + struct comp_buffer *buffer_c; struct list_item *blist; int ret; diff --git a/xtos/include/sof/lib/dma.h b/xtos/include/sof/lib/dma.h index 85080e70c18b..82f4992cbe88 100644 --- a/xtos/include/sof/lib/dma.h +++ b/xtos/include/sof/lib/dma.h @@ -254,8 +254,8 @@ struct dma_info { }; struct audio_stream; -typedef int (*dma_process_func)(const struct audio_stream __sparse_cache *source, - uint32_t ioffset, struct audio_stream __sparse_cache *sink, +typedef int (*dma_process_func)(const struct audio_stream *source, + uint32_t ioffset, struct audio_stream *sink, uint32_t ooffset, uint32_t frames); /** @@ -530,8 +530,8 @@ typedef void (*dma_process)(const struct audio_stream *, struct audio_stream *, uint32_t); /* copies data from DMA buffer using provided processing function */ -int dma_buffer_copy_from(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +int dma_buffer_copy_from(struct comp_buffer *source, + struct comp_buffer *sink, dma_process_func process, uint32_t source_bytes); /* @@ -539,13 +539,13 @@ int dma_buffer_copy_from(struct comp_buffer __sparse_cache *source, * conversion function. DMA buffer consume should be performed after the data has been copied * to all sinks. */ -int dma_buffer_copy_from_no_consume(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +int dma_buffer_copy_from_no_consume(struct comp_buffer *source, + struct comp_buffer *sink, dma_process_func process, uint32_t source_bytes); /* copies data to DMA buffer using provided processing function */ -int dma_buffer_copy_to(struct comp_buffer __sparse_cache *source, - struct comp_buffer __sparse_cache *sink, +int dma_buffer_copy_to(struct comp_buffer *source, + struct comp_buffer *sink, dma_process_func process, uint32_t sink_bytes); /* generic DMA DSP <-> Host copier */ From 0725ce85418625e2821b8b1a02179f4f073deaea Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 6 Sep 2023 14:46:43 +0200 Subject: [PATCH 344/639] sparse: remove __sparse annotations from various places Prev commit removing __sparse was a pure editor action, this commit is removing some other __sparse annotations and mappings that must have been done manually This commit contains "safe" changes only Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/audio_stream.c | 63 +++++-------------- src/audio/buffer.c | 4 +- src/audio/copier/copier.c | 7 +-- src/audio/mixin_mixout/mixin_mixout.c | 20 +++--- src/audio/module_adapter/module_adapter.c | 22 +++---- src/audio/mux/mux_generic.c | 12 ++-- .../module_adapter/module/module_interface.h | 4 +- src/samples/audio/smart_amp_test_ipc4.c | 4 +- 8 files changed, 42 insertions(+), 94 deletions(-) diff --git a/src/audio/audio_stream.c b/src/audio/audio_stream.c index 5fa8fa805c10..295fa65ac1c0 100644 --- a/src/audio/audio_stream.c +++ b/src/audio/audio_stream.c @@ -8,9 +8,7 @@ static size_t audio_stream_get_free_size(struct sof_sink *sink) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); return audio_stream_get_free_bytes(audio_stream); } @@ -18,9 +16,7 @@ static size_t audio_stream_get_free_size(struct sof_sink *sink) static int audio_stream_get_buffer(struct sof_sink *sink, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); if (req_size > audio_stream_get_free_size(sink)) return -ENODATA; @@ -34,15 +30,11 @@ static int audio_stream_get_buffer(struct sof_sink *sink, size_t req_size, static int audio_stream_commit_buffer(struct sof_sink *sink, size_t commit_size) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); - struct comp_buffer *buffer_c = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); if (commit_size) { - buffer_stream_writeback(buffer_c, commit_size); + buffer_stream_writeback(buffer, commit_size); audio_stream_produce(audio_stream, commit_size); } @@ -51,9 +43,7 @@ static int audio_stream_commit_buffer(struct sof_sink *sink, size_t commit_size) static size_t audio_stream_get_data_available(struct sof_source *source) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); return audio_stream_get_avail_bytes(audio_stream); } @@ -61,18 +51,13 @@ static size_t audio_stream_get_data_available(struct sof_source *source) static int audio_stream_get_data(struct sof_source *source, size_t req_size, void **data_ptr, void **buffer_start, size_t *buffer_size) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); - - struct comp_buffer *buffer_c = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); if (req_size > audio_stream_get_data_available(source)) return -ENODATA; - buffer_stream_invalidate(buffer_c, req_size); + buffer_stream_invalidate(buffer, req_size); /* get circular buffer parameters */ *data_ptr = audio_stream->r_ptr; @@ -83,9 +68,7 @@ static int audio_stream_get_data(struct sof_source *source, size_t req_size, static int audio_stream_release_data(struct sof_source *source, size_t free_size) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); if (free_size) audio_stream_consume(audio_stream, free_size); @@ -97,12 +80,8 @@ static int audio_stream_set_ipc_params_source(struct sof_source *source, struct sof_ipc_stream_params *params, bool force_update) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); - struct comp_buffer *buffer = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); return buffer_set_params(buffer, params, force_update); } @@ -111,12 +90,8 @@ static int audio_stream_set_ipc_params_sink(struct sof_sink *sink, struct sof_ipc_stream_params *params, bool force_update) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); - struct comp_buffer *buffer = - attr_container_of(audio_stream, struct comp_buffer, - stream, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); + struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); return buffer_set_params(buffer, params, force_update); } @@ -125,9 +100,7 @@ static int audio_stream_source_set_alignment_constants(struct sof_source *source const uint32_t byte_align, const uint32_t frame_align_req) { - struct audio_stream *audio_stream = - attr_container_of(source, struct audio_stream, - source_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); audio_stream_init_alignment_constants(byte_align, frame_align_req, audio_stream); @@ -138,9 +111,7 @@ static int audio_stream_sink_set_alignment_constants(struct sof_sink *sink, const uint32_t byte_align, const uint32_t frame_align_req) { - struct audio_stream *audio_stream = - attr_container_of(sink, struct audio_stream, - sink_api, __sparse_cache); + struct audio_stream *audio_stream = container_of(sink, struct audio_stream, sink_api); audio_stream_init_alignment_constants(byte_align, frame_align_req, audio_stream); @@ -177,10 +148,8 @@ void audio_stream_init(struct audio_stream *audio_stream, audio_stream_init_alignment_constants(1, 1, audio_stream); source_init(audio_stream_get_source(audio_stream), &audio_stream_source_ops, - (__sparse_force struct sof_audio_stream_params *) &audio_stream->runtime_stream_params); sink_init(audio_stream_get_sink(audio_stream), &audio_stream_sink_ops, - (__sparse_force struct sof_audio_stream_params *) &audio_stream->runtime_stream_params); audio_stream_reset(audio_stream); } diff --git a/src/audio/buffer.c b/src/audio/buffer.c index a366592eab12..40ef2a914817 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -228,7 +228,7 @@ void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes) audio_stream_produce(&buffer->stream, bytes); - notifier_event((__sparse_force void *)buffer, NOTIFIER_ID_BUFFER_PRODUCE, + notifier_event(buffer, NOTIFIER_ID_BUFFER_PRODUCE, NOTIFIER_TARGET_CORE_LOCAL, &cb_data, sizeof(cb_data)); #if CONFIG_SOF_LOG_DBG_BUFFER @@ -268,7 +268,7 @@ void comp_update_buffer_consume(struct comp_buffer *buffer, uint32_t bytes) audio_stream_consume(&buffer->stream, bytes); - notifier_event((__sparse_force void *)buffer, NOTIFIER_ID_BUFFER_CONSUME, + notifier_event(buffer, NOTIFIER_ID_BUFFER_CONSUME, NOTIFIER_TARGET_CORE_LOCAL, &cb_data, sizeof(cb_data)); #if CONFIG_SOF_LOG_DBG_BUFFER diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index 2235d3e01c54..c9157240466c 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -473,8 +473,7 @@ static int copier_module_copy(struct processing_module *mod, if (!num_input_buffers || !num_output_buffers) return 0; - src_c = attr_container_of(input_buffers[0].data, struct comp_buffer, - stream, __sparse_cache); + src_c = container_of(input_buffers[0].data, struct comp_buffer, stream); processed_data.source_bytes = 0; @@ -483,9 +482,7 @@ static int copier_module_copy(struct processing_module *mod, struct comp_buffer *sink_c; struct comp_dev *sink_dev; - sink_c = attr_container_of(output_buffers[i].data, - struct comp_buffer, - stream, __sparse_cache); + sink_c = container_of(output_buffers[i].data, struct comp_buffer, stream); sink_dev = sink_c->sink; processed_data.sink_bytes = 0; if (sink_dev->state == COMP_STATE_ACTIVE) { diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index 6538e8747fc3..2bfe3e64196b 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -285,9 +285,8 @@ static int mixin_process(struct processing_module *mod, uint32_t free_frames, pending_frames; /* unused buffer between mixin and mixout */ - unused_in_between_buf_c = attr_container_of(output_buffers[i].data, - struct comp_buffer, - stream, __sparse_cache); + unused_in_between_buf_c = container_of(output_buffers[i].data, struct comp_buffer, + stream); mixout = unused_in_between_buf_c->sink; sink_id = IPC4_SRC_QUEUE_ID(unused_in_between_buf_c->id); @@ -341,9 +340,8 @@ static int mixin_process(struct processing_module *mod, audio_stream_period_bytes(input_buffers[0].data, frames_to_copy); if (bytes_to_consume_from_source_buf > 0) { input_buffers[0].consumed = bytes_to_consume_from_source_buf; - source_c = attr_container_of(input_buffers[0].data, - struct comp_buffer, - stream, __sparse_cache); + source_c = container_of(input_buffers[0].data, struct comp_buffer, + stream); buffer_stream_invalidate(source_c, bytes_to_consume_from_source_buf); } } else { @@ -461,9 +459,8 @@ static int mixout_process(struct processing_module *mod, int source_index; source_stream = input_buffers[i].data; - unused_in_between_buf = attr_container_of(source_stream, - struct comp_buffer, - stream, __sparse_cache); + unused_in_between_buf = container_of(source_stream, struct comp_buffer, + stream); source = unused_in_between_buf->source; @@ -487,9 +484,8 @@ static int mixout_process(struct processing_module *mod, uint32_t pending_frames; source_stream = input_buffers[i].data; - unused_in_between_buf = attr_container_of(source_stream, - struct comp_buffer, - stream, __sparse_cache); + unused_in_between_buf = container_of(source_stream, + struct comp_buffer, stream); source = unused_in_between_buf->source; diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 824fe9fa831b..d0b8305667ab 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -421,8 +421,7 @@ int module_adapter_prepare(struct comp_dev *dev) list_for_item(blist, &dev->bsource_list) { size_t size = MAX(mod->deep_buff_bytes, mod->period_bytes); - mod->input_buffers[i].data = - (__sparse_force void __sparse_cache *)rballoc(0, SOF_MEM_CAPS_RAM, size); + mod->input_buffers[i].data = rballoc(0, SOF_MEM_CAPS_RAM, size); if (!mod->input_buffers[i].data) { comp_err(mod->dev, "module_adapter_prepare(): Failed to alloc input buffer data"); ret = -ENOMEM; @@ -434,9 +433,7 @@ int module_adapter_prepare(struct comp_dev *dev) /* allocate memory for output buffer data */ i = 0; list_for_item(blist, &dev->bsink_list) { - mod->output_buffers[i].data = - (__sparse_force void __sparse_cache *)rballoc(0, SOF_MEM_CAPS_RAM, - md->mpd.out_buff_size); + mod->output_buffers[i].data = rballoc(0, SOF_MEM_CAPS_RAM, md->mpd.out_buff_size); if (!mod->output_buffers[i].data) { comp_err(mod->dev, "module_adapter_prepare(): Failed to alloc output buffer data"); ret = -ENOMEM; @@ -568,7 +565,7 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa */ static void ca_copy_from_source_to_module(const struct audio_stream *source, - void __sparse_cache *buff, uint32_t buff_size, size_t bytes) + void *buff, uint32_t buff_size, size_t bytes) { /* head_size - available data until end of source buffer */ const int without_wrap = audio_stream_bytes_without_wrap(source, @@ -596,7 +593,7 @@ ca_copy_from_source_to_module(const struct audio_stream *source, */ static void ca_copy_from_module_to_sink(const struct audio_stream *sink, - void __sparse_cache *buff, size_t bytes) + void *buff, size_t bytes) { /* head_size - free space until end of sink buffer */ const int without_wrap = audio_stream_bytes_without_wrap(sink, audio_stream_get_wptr(sink)); @@ -951,9 +948,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) for (i = 0; i < num_input_buffers; i++) { struct comp_buffer *src_c; - src_c = attr_container_of(mod->input_buffers[i].data, - struct comp_buffer, - stream, __sparse_cache); + src_c = container_of(mod->input_buffers[i].data, struct comp_buffer, stream); if (mod->input_buffers[i].consumed) audio_stream_consume(&src_c->stream, mod->input_buffers[i].consumed); } @@ -972,11 +967,8 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* produce data into all active output buffers */ for (i = 0; i < num_output_buffers; i++) { - struct comp_buffer *sink_c; - - sink_c = attr_container_of(mod->output_buffers[i].data, - struct comp_buffer, - stream, __sparse_cache); + struct comp_buffer *sink_c = + container_of(mod->output_buffers[i].data, struct comp_buffer, stream); if (!mod->skip_sink_buffer_writeback) buffer_stream_writeback(sink_c, mod->output_buffers[i].size); diff --git a/src/audio/mux/mux_generic.c b/src/audio/mux/mux_generic.c index a00a36cc084b..51d5bcd70e9a 100644 --- a/src/audio/mux/mux_generic.c +++ b/src/audio/mux/mux_generic.c @@ -54,8 +54,7 @@ static void demux_check_for_wrap(struct audio_stream *sink, #if CONFIG_FORMAT_S16LE static uint32_t demux_calc_frames_without_wrap_s16(struct audio_stream *sink, - const struct audio_stream - __sparse_cache *source, + const struct audio_stream *source, struct mux_look_up *lookup) { uint32_t frames; @@ -80,8 +79,7 @@ static uint32_t demux_calc_frames_without_wrap_s16(struct audio_stream *sink, } static uint32_t mux_calc_frames_without_wrap_s16(struct audio_stream *sink, - const struct audio_stream - __sparse_cache **sources, + const struct audio_stream **sources, struct mux_look_up *lookup) { const struct audio_stream *source; @@ -260,8 +258,7 @@ static void mux_s16le(struct comp_dev *dev, struct audio_stream *sink, #if CONFIG_FORMAT_S24LE || CONFIG_FORMAT_S32LE static uint32_t mux_calc_frames_without_wrap_s32(struct audio_stream *sink, - const struct audio_stream - __sparse_cache **sources, + const struct audio_stream **sources, struct mux_look_up *lookup) { const struct audio_stream *source; @@ -290,8 +287,7 @@ static uint32_t mux_calc_frames_without_wrap_s32(struct audio_stream *sink, } static uint32_t demux_calc_frames_without_wrap_s32(struct audio_stream *sink, - const struct audio_stream - __sparse_cache *source, + const struct audio_stream *source, struct mux_look_up *lookup) { uint32_t frames; diff --git a/src/include/sof/audio/module_adapter/module/module_interface.h b/src/include/sof/audio/module_adapter/module/module_interface.h index 5a4e27c354f7..fab3cefdc0ef 100644 --- a/src/include/sof/audio/module_adapter/module/module_interface.h +++ b/src/include/sof/audio/module_adapter/module/module_interface.h @@ -50,7 +50,7 @@ enum module_processing_mode { * \brief Input stream buffer */ struct input_stream_buffer { - void __sparse_cache *data; /* data stream buffer */ + void *data; /* data stream buffer */ uint32_t size; /* size of data in the buffer */ uint32_t consumed; /* number of bytes consumed by the module */ @@ -63,7 +63,7 @@ struct input_stream_buffer { * \brief Output stream buffer */ struct output_stream_buffer { - void __sparse_cache *data; /* data stream buffer */ + void *data; /* data stream buffer */ uint32_t size; /* size of data in the buffer */ }; diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index 802e54a39169..a21e29684218 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -293,9 +293,7 @@ static int smart_amp_process(struct processing_module *mod, if (num_input_buffers == SMART_AMP_NUM_IN_PINS) for (i = 0; i < num_input_buffers; i++) { - buf = attr_container_of(input_buffers[i].data, - struct comp_buffer, - stream, __sparse_cache); + buf = container_of(input_buffers[i].data, struct comp_buffer, stream); if (IPC4_SINK_QUEUE_ID(buf->id) == SOF_SMART_AMP_FEEDBACK_QUEUE_ID) { fb_input = &input_buffers[i]; From 6ce1890443d12946b053ac02928a0f8407f7e654 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 6 Sep 2023 14:47:48 +0200 Subject: [PATCH 345/639] sparse: do some cosmetic changes after removal of __Sparse some of lines may be formatted differently. This commit contains cosmetic changes only Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/audio_stream.c | 3 +- src/include/sof/audio/audio_stream.h | 55 +++++++++------------------- src/include/sof/audio/buffer.h | 6 +-- 3 files changed, 21 insertions(+), 43 deletions(-) diff --git a/src/audio/audio_stream.c b/src/audio/audio_stream.c index 295fa65ac1c0..27a64731d45c 100644 --- a/src/audio/audio_stream.c +++ b/src/audio/audio_stream.c @@ -134,8 +134,7 @@ static const struct sink_ops audio_stream_sink_ops = { .set_alignment_constants = audio_stream_sink_set_alignment_constants }; -void audio_stream_init(struct audio_stream *audio_stream, - void *buff_addr, uint32_t size) +void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint32_t size) { audio_stream->size = size; audio_stream->addr = buff_addr; diff --git a/src/include/sof/audio/audio_stream.h b/src/include/sof/audio/audio_stream.h index 1bbc23b1e85e..49f3dab09245 100644 --- a/src/include/sof/audio/audio_stream.h +++ b/src/include/sof/audio/audio_stream.h @@ -139,14 +139,12 @@ static inline uint32_t audio_stream_get_free(const struct audio_stream *buf) return buf->free; } -static inline enum sof_ipc_frame audio_stream_get_frm_fmt( - const struct audio_stream *buf) +static inline enum sof_ipc_frame audio_stream_get_frm_fmt(const struct audio_stream *buf) { return buf->runtime_stream_params.frame_fmt; } -static inline enum sof_ipc_frame audio_stream_get_valid_fmt( - const struct audio_stream *buf) +static inline enum sof_ipc_frame audio_stream_get_valid_fmt(const struct audio_stream *buf) { return buf->runtime_stream_params.valid_sample_fmt; } @@ -441,8 +439,7 @@ static inline void audio_stream_init_alignment_constants(const uint32_t byte_ali * @param frames Number of processing frames. * @return Period size in bytes. */ -static inline uint32_t audio_stream_period_bytes(const struct audio_stream *buf, - uint32_t frames) +static inline uint32_t audio_stream_period_bytes(const struct audio_stream *buf, uint32_t frames) { return frames * audio_stream_frame_bytes(buf); } @@ -454,8 +451,7 @@ static inline uint32_t audio_stream_period_bytes(const struct audio_stream *buf, * @param ptr Pointer * @return Pointer, adjusted if necessary. */ -static inline void *audio_stream_wrap(const struct audio_stream *buffer, - void *ptr) +static inline void *audio_stream_wrap(const struct audio_stream *buffer, void *ptr) { if (ptr >= buffer->end_addr) ptr = (char *)buffer->addr + @@ -492,8 +488,7 @@ static inline void *cir_buf_wrap(void *ptr, void *buf_addr, void *buf_end) * @param ptr Pointer * @return Pointer, adjusted if necessary. */ -static inline void *audio_stream_rewind_wrap(const struct audio_stream *buffer, - void *ptr) +static inline void *audio_stream_rewind_wrap(const struct audio_stream *buffer, void *ptr) { if (ptr < buffer->addr) ptr = (char *)buffer->end_addr - ((char *)buffer->addr - (char *)ptr); @@ -683,8 +678,7 @@ audio_stream_avail_frames_aligned(const struct audio_stream *source, * @param buffer Buffer to update. * @param bytes Number of written bytes. */ -static inline void audio_stream_produce(struct audio_stream *buffer, - uint32_t bytes) +static inline void audio_stream_produce(struct audio_stream *buffer, uint32_t bytes) { buffer->w_ptr = audio_stream_wrap(buffer, (char *)buffer->w_ptr + bytes); @@ -711,8 +705,7 @@ static inline void audio_stream_produce(struct audio_stream *buffer, * @param buffer Buffer to update. * @param bytes Number of read bytes. */ -static inline void audio_stream_consume(struct audio_stream *buffer, - uint32_t bytes) +static inline void audio_stream_consume(struct audio_stream *buffer, uint32_t bytes) { buffer->r_ptr = audio_stream_wrap(buffer, (char *)buffer->r_ptr + bytes); @@ -753,8 +746,7 @@ static inline void audio_stream_reset(struct audio_stream *buffer) * @param buff_addr Address of the memory block to assign. * @param size Size of the memory block in bytes. */ -void audio_stream_init(struct audio_stream *audio_stream, - void *buff_addr, uint32_t size); +void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint32_t size); /** * Invalidates (in DSP d-cache) the buffer in range [r_ptr, r_ptr+bytes], @@ -762,8 +754,7 @@ void audio_stream_init(struct audio_stream *audio_stream, * @param buffer Buffer. * @param bytes Size of the fragment to invalidate. */ -static inline void audio_stream_invalidate(struct audio_stream *buffer, - uint32_t bytes) +static inline void audio_stream_invalidate(struct audio_stream *buffer, uint32_t bytes) { uint32_t head_size = bytes; uint32_t tail_size = 0; @@ -786,8 +777,7 @@ static inline void audio_stream_invalidate(struct audio_stream *buffer, * @param buffer Buffer. * @param bytes Size of the fragment to write back. */ -static inline void audio_stream_writeback(struct audio_stream *buffer, - uint32_t bytes) +static inline void audio_stream_writeback(struct audio_stream *buffer, uint32_t bytes) { uint32_t head_size = bytes; uint32_t tail_size = 0; @@ -811,8 +801,7 @@ static inline void audio_stream_writeback(struct audio_stream *buffer, * @return Number of data samples to buffer wrap. */ static inline int -audio_stream_bytes_without_wrap(const struct audio_stream *source, - const void *ptr) +audio_stream_bytes_without_wrap(const struct audio_stream *source, const void *ptr) { assert((intptr_t)source->end_addr >= (intptr_t)ptr); return (intptr_t)source->end_addr - (intptr_t)ptr; @@ -827,8 +816,7 @@ audio_stream_bytes_without_wrap(const struct audio_stream *source, * need to add size of sample to returned bytes count. */ static inline int -audio_stream_rewind_bytes_without_wrap(const struct audio_stream *source, - const void *ptr) +audio_stream_rewind_bytes_without_wrap(const struct audio_stream *source, const void *ptr) { assert((intptr_t)ptr >= (intptr_t)source->addr); int to_begin = (intptr_t)ptr - (intptr_t)source->addr; @@ -843,8 +831,7 @@ audio_stream_rewind_bytes_without_wrap(const struct audio_stream *source, * @return Previous position of the write pointer. */ static inline uint32_t -*audio_stream_rewind_wptr_by_bytes(const struct audio_stream *source, - const uint32_t bytes) +*audio_stream_rewind_wptr_by_bytes(const struct audio_stream *source, const uint32_t bytes) { void *wptr = audio_stream_get_wptr(source); int to_begin = audio_stream_rewind_bytes_without_wrap(source, wptr); @@ -866,8 +853,7 @@ static inline uint32_t * @return Number of data s16 samples until circular wrap need at end */ static inline int -audio_stream_samples_without_wrap_s16(const struct audio_stream *source, - const void *ptr) +audio_stream_samples_without_wrap_s16(const struct audio_stream *source, const void *ptr) { int to_end = (int16_t *)source->end_addr - (int16_t *)ptr; @@ -883,8 +869,7 @@ audio_stream_samples_without_wrap_s16(const struct audio_stream *source, * @return Number of data s24 samples until circular wrap need at end */ static inline int -audio_stream_samples_without_wrap_s24(const struct audio_stream *source, - const void *ptr) +audio_stream_samples_without_wrap_s24(const struct audio_stream *source, const void *ptr) { int to_end = (int32_t *)source->end_addr - (int32_t *)ptr; @@ -900,8 +885,7 @@ audio_stream_samples_without_wrap_s24(const struct audio_stream *source, * @return Number of data s32 samples until circular wrap need at end */ static inline int -audio_stream_samples_without_wrap_s32(const struct audio_stream *source, - const void *ptr) +audio_stream_samples_without_wrap_s32(const struct audio_stream *source, const void *ptr) { int to_end = (int32_t *)source->end_addr - (int32_t *)ptr; @@ -947,8 +931,7 @@ static inline int cir_buf_samples_without_wrap_s32(void *ptr, void *buf_end) * @return Number of data frames to buffer wrap. */ static inline uint32_t -audio_stream_frames_without_wrap(const struct audio_stream *source, - const void *ptr) +audio_stream_frames_without_wrap(const struct audio_stream *source, const void *ptr) { uint32_t bytes = audio_stream_bytes_without_wrap(source, ptr); uint32_t frame_bytes = audio_stream_frame_bytes(source); @@ -1011,8 +994,7 @@ void audio_stream_copy_to_linear(const struct audio_stream *source, int ioffset, * @return 0 if there is enough free space in buffer. * @return 1 if there is not enough free space in buffer. */ -static inline int audio_stream_set_zero(struct audio_stream *buffer, - uint32_t bytes) +static inline int audio_stream_set_zero(struct audio_stream *buffer, uint32_t bytes) { uint32_t head_size = bytes; uint32_t tail_size = 0; @@ -1071,7 +1053,6 @@ static inline void audio_stream_fmt_conversion(enum ipc4_bit_depth depth, } /** get a handler to source API - * NOTE! to use the handlers the buffer must be acquired by buffer_acquire */ static inline struct sof_source * audio_stream_get_source(struct audio_stream *audio_stream) diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 631ced3dabd1..c461d19c6977 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -208,15 +208,13 @@ int buffer_set_params(struct comp_buffer *buffer, bool buffer_params_match(struct comp_buffer *buffer, struct sof_ipc_stream_params *params, uint32_t flag); -static inline void buffer_stream_invalidate(struct comp_buffer *buffer, - uint32_t bytes) +static inline void buffer_stream_invalidate(struct comp_buffer *buffer, uint32_t bytes) { if (buffer->is_shared) audio_stream_invalidate(&buffer->stream, bytes); } -static inline void buffer_stream_writeback(struct comp_buffer *buffer, - uint32_t bytes) +static inline void buffer_stream_writeback(struct comp_buffer *buffer, uint32_t bytes) { if (buffer->is_shared) audio_stream_writeback(&buffer->stream, bytes); From f114acecb175773ba9e622fab62f877c701c12eb Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 7 Sep 2023 16:07:31 +0300 Subject: [PATCH 346/639] Audio: Kconfig: Deprecate tone component Tone component has been without maintenance and validation, and there is no interface to control sound generation from user space so it will be deprecated and removed from successive release. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- app/stub_build_all_ipc3.conf | 2 +- src/audio/Kconfig | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/stub_build_all_ipc3.conf b/app/stub_build_all_ipc3.conf index c64fc4790da1..9dcfbb50f1fb 100644 --- a/app/stub_build_all_ipc3.conf +++ b/app/stub_build_all_ipc3.conf @@ -1,6 +1,6 @@ CONFIG_COMP_STUBS=y CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y -CONFIG_COMP_TONE=y +CONFIG_COMP_TONE=n CONFIG_COMP_CROSSOVER=y CONFIG_COMP_DRC=y CONFIG_COMP_MULTIBAND_DRC=y diff --git a/src/audio/Kconfig b/src/audio/Kconfig index be2ff5f360b2..1025ad8aef11 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -209,7 +209,8 @@ config COMP_TONE default n select CORDIC_FIXED help - Select for Tone component + Select for Tone component. + Warning: This component is deprecated and will be removed from SOF v2.8. config COMP_MIXER bool "Mixer component" From 3253175a5c4ba517e274421477dafc9909bfa084 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 23 Aug 2023 15:27:30 +0200 Subject: [PATCH 347/639] source API: mark data pointers as const Data provided by source interface cannot be modified in any way by the module using source API. Mark pointers as const Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/audio_stream.c | 3 ++- src/audio/sink_source_utils.c | 10 ++++---- src/audio/source_api_helper.c | 2 +- src/audio/src/src.c | 24 ++++++++++--------- src/include/sof/audio/source_api.h | 2 +- .../sof/audio/source_api_implementation.h | 2 +- src/include/sof/audio/src/src.h | 4 ++-- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/audio/audio_stream.c b/src/audio/audio_stream.c index 27a64731d45c..0308e036755c 100644 --- a/src/audio/audio_stream.c +++ b/src/audio/audio_stream.c @@ -49,7 +49,8 @@ static size_t audio_stream_get_data_available(struct sof_source *source) } static int audio_stream_get_data(struct sof_source *source, size_t req_size, - void **data_ptr, void **buffer_start, size_t *buffer_size) + void const **data_ptr, void const **buffer_start, + size_t *buffer_size) { struct audio_stream *audio_stream = container_of(source, struct audio_stream, source_api); struct comp_buffer *buffer = container_of(audio_stream, struct comp_buffer, stream); diff --git a/src/audio/sink_source_utils.c b/src/audio/sink_source_utils.c index 5a0d17608be4..3b79c8c2d5e1 100644 --- a/src/audio/sink_source_utils.c +++ b/src/audio/sink_source_utils.c @@ -15,9 +15,9 @@ int source_to_sink_copy(struct sof_source *source, struct sof_sink *sink, bool free, size_t size) { - uint8_t *src_ptr; - uint8_t *src_begin; - uint8_t *src_end; + uint8_t const *src_ptr; + uint8_t const *src_begin; + uint8_t const *src_end; uint8_t *dst_ptr; uint8_t *dst_begin; uint8_t *dst_end; @@ -32,8 +32,8 @@ int source_to_sink_copy(struct sof_source *source, return -ENOSPC; ret = source_get_data(source, size, - (void **)&src_ptr, - (void **)&src_begin, + (void const **)&src_ptr, + (void const **)&src_begin, &src_size); if (ret) return ret; diff --git a/src/audio/source_api_helper.c b/src/audio/source_api_helper.c index 1483fb6603c9..f71cf5bdc7e1 100644 --- a/src/audio/source_api_helper.c +++ b/src/audio/source_api_helper.c @@ -21,7 +21,7 @@ size_t source_get_data_available(struct sof_source *source) } int source_get_data(struct sof_source *source, size_t req_size, - void **data_ptr, void **buffer_start, size_t *buffer_size) + void const **data_ptr, void const **buffer_start, size_t *buffer_size) { int ret; diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 65b8ae965abd..752f0f7a1825 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -94,7 +94,7 @@ struct comp_data { uint32_t sink_rate; uint32_t source_rate; int32_t *sbuf_w_ptr; - int32_t *sbuf_r_ptr; + int32_t const *sbuf_r_ptr; int sbuf_avail; int data_shift; int source_frames; @@ -353,7 +353,8 @@ static int src_2s(struct comp_data *cd, int s2_blk_out; uint32_t n_read = 0, n_written = 0; int ret; - uint8_t *buffer_start; + uint8_t const *source_buffer_start; + uint8_t *sink_buffer_start; void *sbuf_end_addr = &cd->delay_lines[cd->param.sbuf_length]; size_t sbuf_size = cd->param.sbuf_length * sizeof(int32_t); /* chan sink == chan src therefore we only need to use one*/ @@ -366,18 +367,18 @@ static int src_2s(struct comp_data *cd, uint32_t sink_frag_size = cd->param.blk_out * sink_get_frame_bytes(sink); ret = source_get_data(source, source_frag_size, - &s1.x_rptr, (void **)&buffer_start, &s1.x_size); + &s1.x_rptr, (void const **)&source_buffer_start, &s1.x_size); if (ret) return ret; - s1.x_end_addr = buffer_start + s1.x_size; + s1.x_end_addr = source_buffer_start + s1.x_size; ret = sink_get_buffer(sink, sink_frag_size, - &s2.y_wptr, (void **)&buffer_start, &s2.y_size); + &s2.y_wptr, (void **)&sink_buffer_start, &s2.y_size); if (ret) { source_release_data(source, 0); return ret; } - s2.y_end_addr = buffer_start + s2.y_size; + s2.y_end_addr = sink_buffer_start + s2.y_size; s1.y_end_addr = sbuf_end_addr; s1.y_size = sbuf_size; @@ -448,23 +449,24 @@ static int src_1s(struct comp_data *cd, struct sof_source *source, { struct src_stage_prm s1; int ret; - uint8_t *buffer_start; + uint8_t const *source_buffer_start; + uint8_t *sink_buffer_start; uint32_t source_frag_size = cd->param.blk_in * source_get_frame_bytes(source); uint32_t sink_frag_size = cd->param.blk_out * sink_get_frame_bytes(sink); ret = source_get_data(source, source_frag_size, - &s1.x_rptr, (void **)&buffer_start, &s1.x_size); + &s1.x_rptr, (void const **)&source_buffer_start, &s1.x_size); if (ret) return ret; - s1.x_end_addr = buffer_start + s1.x_size; + s1.x_end_addr = source_buffer_start + s1.x_size; ret = sink_get_buffer(sink, sink_frag_size, - &s1.y_wptr, (void **)&buffer_start, &s1.y_size); + &s1.y_wptr, (void **)&sink_buffer_start, &s1.y_size); if (ret) { source_release_data(source, 0); return ret; } - s1.y_end_addr = buffer_start + s1.y_size; + s1.y_end_addr = sink_buffer_start + s1.y_size; s1.times = cd->param.stage1_times; s1.state = &cd->src.state1; diff --git a/src/include/sof/audio/source_api.h b/src/include/sof/audio/source_api.h index 785b15167b17..e4bd132a8ada 100644 --- a/src/include/sof/audio/source_api.h +++ b/src/include/sof/audio/source_api.h @@ -94,7 +94,7 @@ size_t source_get_data_frames_available(struct sof_source *source); * @retval -ENODATA if req_size is bigger than available data */ int source_get_data(struct sof_source *source, size_t req_size, - void **data_ptr, void **buffer_start, size_t *buffer_size); + void const **data_ptr, void const **buffer_start, size_t *buffer_size); /** * Releases fragment previously obtained by source_get_data() diff --git a/src/include/sof/audio/source_api_implementation.h b/src/include/sof/audio/source_api_implementation.h index 4977c81e86d2..5f2a9ffb4803 100644 --- a/src/include/sof/audio/source_api_implementation.h +++ b/src/include/sof/audio/source_api_implementation.h @@ -33,7 +33,7 @@ struct source_ops { * see comment of source_get_data_available() */ int (*get_data)(struct sof_source *source, size_t req_size, - void **data_ptr, void **buffer_start, size_t *buffer_size); + void const **data_ptr, void const **buffer_start, size_t *buffer_size); /** * see comment of source_release_data() diff --git a/src/include/sof/audio/src/src.h b/src/include/sof/audio/src/src.h index 6fa936fc74eb..b86f0440fe5d 100644 --- a/src/include/sof/audio/src/src.h +++ b/src/include/sof/audio/src/src.h @@ -61,8 +61,8 @@ struct polyphase_src { struct src_stage_prm { int nch; int times; - void *x_rptr; - void *x_end_addr; + void const *x_rptr; + void const *x_end_addr; size_t x_size; void *y_wptr; void *y_addr; From bec031a7a38f145537362a37d80bc558aa8e5968 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 16 Aug 2023 08:32:28 +0200 Subject: [PATCH 348/639] dp: introduce dp_queue DP queue is a lockless circular buffer providing safe consumer/producer cached operations cross cores prerequisites: 1) incoming and outgoing data rate MUST be the same 2) Both data consumer and data producer declare max chunk sizes they want to use (IBS/OBS) required Buffer size: - 2*MAX(IBS,OBS) if the larger of IBS/OBS is multiplication of smaller - 3*MAX(IBS,OBS) otherwise The queue may work in 2 modes 1) local mode in case both receiver and sender are located on the same core and cache coherency does not matter. dp_queue structure is located in cached memory In this case DP Queue is a simple ring buffer 2) shared mode In this case we need to writeback cache when new data arrive and invalidate cache on secondary core. dp_queue structure is located in shared memory dpQueue is a lockless consumer/producer safe buffer. It is achieved by having only 2 shared variables: write_offset - can be modified by data producer only read_offset - can be modified by data consumer only as 32 bit operations are atomic, it is multi-thread and multi-core save There some explanation needed how free_space and available_data are calculated number of avail data in circular buffer may be calculated as: data_avail = write_offset - read_offset and check for wrap around if (data_avail < 0) data_avail = buffer_size + data_avail The problem is when write_offset == read_offset, !!! it may mean either that the buffer is empty or the buffer is completely filled !!! To solve the above issue having only 2 variables mentioned before: - allow both offsets to point from 0 to DOUBLE buffer_size - when calculating pointers to data, use: data_bufer[offset % buffer_size] - use double buffer size in wrap around check when calculating available data And now: - write_offset == read_offset always means "buffer empty" - write_offset == read_offset + buffer_size always means "buffer full" - data_avail = write_offset - read_offset if (data_avail < 0) data_avail = 2 * buffer_size + data_avail Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/dp_queue.c | 300 +++++++++++++++++++++++++++++++ src/include/sof/audio/dp_queue.h | 169 +++++++++++++++++ zephyr/CMakeLists.txt | 3 + 3 files changed, 472 insertions(+) create mode 100644 src/audio/dp_queue.c create mode 100644 src/include/sof/audio/dp_queue.h diff --git a/src/audio/dp_queue.c b/src/audio/dp_queue.c new file mode 100644 index 000000000000..62ca3e85f894 --- /dev/null +++ b/src/audio/dp_queue.c @@ -0,0 +1,300 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Intel Corporation. All rights reserved. +// + +#include <sof/common.h> +#include <sof/trace/trace.h> +#include <sof/lib/uuid.h> + +#include <sof/audio/dp_queue.h> + +#include <rtos/alloc.h> +#include <ipc/topology.h> + +LOG_MODULE_REGISTER(dp_queue, CONFIG_SOF_LOG_LEVEL); + +/* 393608d8-4188-11ee-be56-0242ac120002 */ +DECLARE_SOF_RT_UUID("dp_queue", dp_queue_uuid, 0x393608d8, 0x4188, 0x11ee, + 0xbe, 0x56, 0x02, 0x42, 0xac, 0x12, 0x20, 0x02); +DECLARE_TR_CTX(dp_queue_tr, SOF_UUID(dp_queue_uuid), LOG_LEVEL_INFO); + +static inline uint8_t __sparse_cache *dp_queue_buffer_end(struct dp_queue *dp_queue) +{ + return dp_queue->_data_buffer + dp_queue->data_buffer_size; +} + +static inline struct dp_queue *dp_queue_from_sink(struct sof_sink *sink) +{ + return container_of(sink, struct dp_queue, _sink_api); +} + +static inline struct dp_queue *dp_queue_from_source(struct sof_source *source) +{ + return container_of(source, struct dp_queue, _source_api); +} + +static inline void dp_queue_invalidate_shared(struct dp_queue *dp_queue, + void __sparse_cache *ptr, size_t size) +{ + /* no cache required in case of not shared queue */ + if (!dp_queue_is_shared(dp_queue)) + return; + + /* wrap-around? */ + if ((uintptr_t)ptr + size > (uintptr_t)dp_queue_buffer_end(dp_queue)) { + /* writeback till the end of circular buffer */ + dcache_invalidate_region + (ptr, (uintptr_t)dp_queue_buffer_end(dp_queue) - (uintptr_t)ptr); + size -= (uintptr_t)dp_queue_buffer_end(dp_queue) - (uintptr_t)ptr; + ptr = dp_queue->_data_buffer; + } + /* invalidate rest of data */ + dcache_invalidate_region(ptr, size); +} + +static inline void dp_queue_writeback_shared(struct dp_queue *dp_queue, + void __sparse_cache *ptr, size_t size) +{ + /* no cache required in case of not shared queue */ + if (!dp_queue_is_shared(dp_queue)) + return; + + /* wrap-around? */ + if ((uintptr_t)ptr + size > (uintptr_t)dp_queue_buffer_end(dp_queue)) { + /* writeback till the end of circular buffer */ + dcache_writeback_region + (ptr, (uintptr_t)dp_queue_buffer_end(dp_queue) - (uintptr_t)ptr); + size -= (uintptr_t)dp_queue_buffer_end(dp_queue) - (uintptr_t)ptr; + ptr = dp_queue->_data_buffer; + } + /* writeback rest of data */ + dcache_writeback_region(ptr, size); +} + +static inline +uint8_t __sparse_cache *dp_queue_get_pointer(struct dp_queue *dp_queue, uint32_t offset) +{ + /* check if offset is not in "double area" + * lines below do a quicker version of offset %= dp_queue->data_buffer_size; + */ + if (offset >= dp_queue->data_buffer_size) + offset -= dp_queue->data_buffer_size; + return dp_queue->_data_buffer + offset; +} + +static inline +uint32_t dp_queue_inc_offset(struct dp_queue *dp_queue, uint32_t offset, uint32_t inc) +{ + assert(inc <= dp_queue->data_buffer_size); + offset += inc; + /* wrap around ? 2*size because of "double area" */ + if (offset >= 2 * dp_queue->data_buffer_size) + offset -= 2 * dp_queue->data_buffer_size; + return offset; +} + +static inline +size_t _dp_queue_get_data_available(struct dp_queue *dp_queue) +{ + int32_t avail_data = dp_queue->_write_offset - dp_queue->_read_offset; + /* wrap around ? 2*size because of "double area" */ + if (avail_data < 0) + avail_data = 2 * dp_queue->data_buffer_size + avail_data; + + return avail_data; +} + +static size_t dp_queue_get_data_available(struct sof_source *source) +{ + struct dp_queue *dp_queue = dp_queue_from_source(source); + + CORE_CHECK_STRUCT(dp_queue); + return _dp_queue_get_data_available(dp_queue); +} + +static size_t dp_queue_get_free_size(struct sof_sink *sink) +{ + struct dp_queue *dp_queue = dp_queue_from_sink(sink); + + CORE_CHECK_STRUCT(dp_queue); + return dp_queue->data_buffer_size - _dp_queue_get_data_available(dp_queue); +} + +static int dp_queue_get_buffer(struct sof_sink *sink, size_t req_size, + void **data_ptr, void **buffer_start, size_t *buffer_size) +{ + struct dp_queue *dp_queue = dp_queue_from_sink(sink); + + CORE_CHECK_STRUCT(dp_queue); + if (req_size > dp_queue_get_free_size(sink)) + return -ENODATA; + + /* note, __sparse_force is to be removed once sink/src use __sparse_cache for data ptrs */ + *data_ptr = (__sparse_force void *)dp_queue_get_pointer(dp_queue, dp_queue->_write_offset); + *buffer_start = (__sparse_force void *)dp_queue->_data_buffer; + *buffer_size = dp_queue->data_buffer_size; + + /* no need to invalidate cache - buffer is to be written only */ + return 0; +} + +static int dp_queue_commit_buffer(struct sof_sink *sink, size_t commit_size) +{ + struct dp_queue *dp_queue = dp_queue_from_sink(sink); + + CORE_CHECK_STRUCT(dp_queue); + if (commit_size) { + dp_queue_writeback_shared(dp_queue, + dp_queue_get_pointer(dp_queue, dp_queue->_write_offset), + commit_size); + + /* move write pointer */ + dp_queue->_write_offset = + dp_queue_inc_offset(dp_queue, dp_queue->_write_offset, commit_size); + } + + return 0; +} + +static int dp_queue_get_data(struct sof_source *source, size_t req_size, + void const **data_ptr, void const **buffer_start, size_t *buffer_size) +{ + struct dp_queue *dp_queue = dp_queue_from_source(source); + __sparse_cache void *_data_ptr; + + CORE_CHECK_STRUCT(dp_queue); + if (req_size > dp_queue_get_data_available(source)) + return -ENODATA; + + _data_ptr = dp_queue_get_pointer(dp_queue, dp_queue->_read_offset); + + /* clean cache in provided data range */ + dp_queue_invalidate_shared(dp_queue, _data_ptr, req_size); + + *buffer_start = (__sparse_force void *)dp_queue->_data_buffer; + *buffer_size = dp_queue->data_buffer_size; + *data_ptr = (__sparse_force void *)_data_ptr; + + return 0; +} + +static int dp_queue_release_data(struct sof_source *source, size_t free_size) +{ + struct dp_queue *dp_queue = dp_queue_from_source(source); + + CORE_CHECK_STRUCT(dp_queue); + if (free_size) { + /* data consumed, free buffer space, no need for any special cache operations */ + dp_queue->_read_offset = + dp_queue_inc_offset(dp_queue, dp_queue->_read_offset, free_size); + } + + return 0; +} + +static int dp_queue_set_ipc_params(struct dp_queue *dp_queue, + struct sof_ipc_stream_params *params, + bool force_update) +{ + CORE_CHECK_STRUCT(dp_queue); + if (dp_queue->_hw_params_configured && !force_update) + return 0; + + dp_queue->audio_stream_params.frame_fmt = params->frame_fmt; + dp_queue->audio_stream_params.rate = params->rate; + dp_queue->audio_stream_params.channels = params->channels; + dp_queue->audio_stream_params.buffer_fmt = params->buffer_fmt; + + dp_queue->_hw_params_configured = true; + + return 0; +} + +static int dp_queue_set_ipc_params_source(struct sof_source *source, + struct sof_ipc_stream_params *params, + bool force_update) +{ + struct dp_queue *dp_queue = dp_queue_from_source(source); + + CORE_CHECK_STRUCT(dp_queue); + return dp_queue_set_ipc_params(dp_queue, params, force_update); +} + +static int dp_queue_set_ipc_params_sink(struct sof_sink *sink, + struct sof_ipc_stream_params *params, + bool force_update) +{ + struct dp_queue *dp_queue = dp_queue_from_sink(sink); + + CORE_CHECK_STRUCT(dp_queue); + return dp_queue_set_ipc_params(dp_queue, params, force_update); +} + +static const struct source_ops dp_queue_source_ops = { + .get_data_available = dp_queue_get_data_available, + .get_data = dp_queue_get_data, + .release_data = dp_queue_release_data, + .audio_set_ipc_params = dp_queue_set_ipc_params_source, +}; + +static const struct sink_ops dp_queue_sink_ops = { + .get_free_size = dp_queue_get_free_size, + .get_buffer = dp_queue_get_buffer, + .commit_buffer = dp_queue_commit_buffer, + .audio_set_ipc_params = dp_queue_set_ipc_params_sink, +}; + +struct dp_queue *dp_queue_create(size_t ibs, size_t obs, uint32_t flags) +{ + struct dp_queue *dp_queue; + + /* allocate DP structure */ + if (flags & DP_QUEUE_MODE_SHARED) + dp_queue = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, + sizeof(*dp_queue)); + else + dp_queue = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*dp_queue)); + if (!dp_queue) + return NULL; + + dp_queue->_flags = flags; + + CORE_CHECK_STRUCT_INIT(dp_queue, flags & DP_QUEUE_MODE_SHARED); + + /* initiate sink/source */ + source_init(dp_queue_get_source(dp_queue), &dp_queue_source_ops, + &dp_queue->audio_stream_params); + sink_init(dp_queue_get_sink(dp_queue), &dp_queue_sink_ops, + &dp_queue->audio_stream_params); + + /* set obs/ibs in sink/source interfaces */ + sink_set_obs(&dp_queue->_sink_api, obs); + source_set_ibs(&dp_queue->_source_api, ibs); + + uint32_t max_ibs_obs = MAX(ibs, obs); + uint32_t min_ibs_obs = MIN(ibs, obs); + + /* calculate required buffer size */ + if (max_ibs_obs % min_ibs_obs == 0) + dp_queue->data_buffer_size = 2 * max_ibs_obs; + else + dp_queue->data_buffer_size = 3 * max_ibs_obs; + + /* allocate data buffer - always in cached memory alias */ + dp_queue->data_buffer_size = ALIGN_UP(dp_queue->data_buffer_size, PLATFORM_DCACHE_ALIGN); + dp_queue->_data_buffer = (__sparse_force __sparse_cache void *) + rballoc_align(0, 0, dp_queue->data_buffer_size, PLATFORM_DCACHE_ALIGN); + if (!dp_queue->_data_buffer) + goto err; + + tr_info(&dp_queue_tr, "DpQueue created, shared: %u ibs: %u obs %u, size %u", + dp_queue_is_shared(dp_queue), ibs, obs, dp_queue->data_buffer_size); + + /* return a pointer to allocated structure */ + return dp_queue; +err: + tr_err(&dp_queue_tr, "DpQueue creation failure"); + rfree(dp_queue); + return NULL; +} diff --git a/src/include/sof/audio/dp_queue.h b/src/include/sof/audio/dp_queue.h new file mode 100644 index 000000000000..64409abed6cd --- /dev/null +++ b/src/include/sof/audio/dp_queue.h @@ -0,0 +1,169 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + */ + +#ifndef __SOF_DP_QUEUE_H__ +#define __SOF_DP_QUEUE_H__ + +#include <sof/audio/sink_api.h> +#include <sof/audio/source_api.h> +#include <sof/audio/sink_api_implementation.h> +#include <sof/audio/source_api_implementation.h> +#include <sof/audio/audio_stream.h> +#include <rtos/bit.h> +#include <sof/common.h> +#include <ipc/topology.h> +#include <sof/coherent.h> + +/** + * DP queue is a lockless circular buffer + * providing safe consumer/producer cached operations cross cores + * + * prerequisites: + * 1) incoming and outgoing data rate MUST be the same + * 2) Both data consumer and data producer declare max chunk sizes they want to use (IBS/OBS) + * + * required Buffer size: + * - 2*MAX(IBS,OBS) if the larger of IBS/OBS is multiplication of smaller + * - 3*MAX(IBS,OBS) otherwise + * + * The queue may work in 2 modes + * 1) local mode + * in case both receiver and sender are located on the same core and cache coherency + * does not matter. dp_queue structure is located in cached memory + * In this case DP Queue is a simple ring buffer + * + * 2) shared mode + * In this case we need to writeback cache when new data arrive and invalidate cache on + * secondary core. dp_queue structure is located in shared memory + * + * + * dpQueue is a lockless consumer/producer safe buffer. It is achieved by having only 2 shared + * variables: + * _write_offset - can be modified by data producer only + * _read_offset - can be modified by data consumer only + * + * as 32 bit operations are atomic, it is multi-thread and multi-core save + * + * There some explanation needed how free_space and available_data are calculated + * + * number of avail data in circular buffer may be calculated as: + * data_avail = _write_offset - _read_offset + * and check for wrap around + * if (data_avail < 0) data_avail = buffer_size - data_avail + * + * The problem is when _write_offset == _read_offset, + * !!! it may mean either that the buffer is empty or the buffer is completely filled !!! + * + * To solve the above issue having only 2 variables mentioned before: + * - allow both offsets to point from 0 to DOUBLE buffer_size + * - when calculating pointers to data, use: data_bufer[offset % buffer_size] + * - use double buffer size in wrap around check when calculating available data + * + * And now: + * - _write_offset == _read_offset + * always means "buffer empty" + * - _write_offset == _read_offset + buffer_size + * always means "buffer full" + */ + +struct dp_queue; +struct sof_audio_stream_params; + +/* DP flags */ +#define DP_QUEUE_MODE_LOCAL 0 +#define DP_QUEUE_MODE_SHARED BIT(1) + +/* the dpQueue structure */ +struct dp_queue { + CORE_CHECK_STRUCT_FIELD; + + /* public: read only */ + struct sof_audio_stream_params audio_stream_params; + size_t data_buffer_size; + + /* private: */ + struct sof_source _source_api; /**< src api handler */ + struct sof_sink _sink_api; /**< sink api handler */ + + uint32_t _flags; /* DP_QUEUE_MODE_* */ + + uint8_t __sparse_cache *_data_buffer; + uint32_t _write_offset; /* private: to be modified by data producer using API */ + uint32_t _read_offset; /* private: to be modified by data consumer using API */ + + bool _hw_params_configured; +}; + +/** + * @param ibs input buffer size + * the size of data to be produced in 1 cycle + * the data producer declares here how much data it will produce in single cycle + * + * @param obs output buffer size + * the size of data to be consumed in 1 cycle + * the data receiver declares here how much data it will consume in single cycle + * + * @param flags a combinatin of DP_QUEUE_MODE_* flags determining working mode + * + */ +struct dp_queue *dp_queue_create(size_t ibs, size_t obs, uint32_t flags); + +/** + * @brief free dp queue memory + */ +static inline +void dp_queue_free(struct dp_queue *dp_queue) +{ + CORE_CHECK_STRUCT(dp_queue); + rfree((__sparse_force void *)dp_queue->_data_buffer); + rfree(dp_queue); +} + +/** + * @brief return a handler to sink API of dp_queue. + * the handler may be used by helper functions defined in sink_api.h + */ +static inline +struct sof_sink *dp_queue_get_sink(struct dp_queue *dp_queue) +{ + CORE_CHECK_STRUCT(dp_queue); + return &dp_queue->_sink_api; +} + +/** + * @brief return a handler to source API of dp_queue + * the handler may be used by helper functions defined in source_api.h + */ +static inline +struct sof_source *dp_queue_get_source(struct dp_queue *dp_queue) +{ + CORE_CHECK_STRUCT(dp_queue); + return &dp_queue->_source_api; +} + +/** + * @brief this is a backdoor to get complete audio params structure from dp_queue + * it is needed till pipeline 2.0 is ready + * + */ +static inline +struct sof_audio_stream_params *dp_queue_get_audio_params(struct dp_queue *dp_queue) +{ + CORE_CHECK_STRUCT(dp_queue); + return &dp_queue->audio_stream_params; +} + +/** + * @brief return true if the queue is shared between 2 cores + */ +static inline +bool dp_queue_is_shared(struct dp_queue *dp_queue) +{ + CORE_CHECK_STRUCT(dp_queue); + return !!(dp_queue->_flags & DP_QUEUE_MODE_SHARED); +} + +#endif /* __SOF_DP_QUEUE_H__ */ diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index e531eaabb690..1412508147c9 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -362,6 +362,9 @@ zephyr_library_sources( lib.c ) +if(CONFIG_ZEPHYR_DP_SCHEDULER) + zephyr_library_sources(${SOF_AUDIO_PATH}/dp_queue.c) +endif() if(CONFIG_SCHEDULE_DMA_SINGLE_CHANNEL AND NOT(CONFIG_DMA_DOMAIN)) zephyr_library_sources(${SOF_SRC_PATH}/schedule/dma_single_chan_domain.c) endif() From 2c54a5488741363a53c676127d744fd5942441f8 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 8 Sep 2023 16:50:59 +0200 Subject: [PATCH 349/639] module-adapter: make interface const Module adapter interfaces are a collection of methods, implementing the API, they never change. Make them const. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/audio/aria/aria.c | 4 ++-- src/audio/copier/copier.c | 4 ++-- src/audio/crossover/crossover.c | 4 ++-- src/audio/dcblock/dcblock.c | 4 ++-- src/audio/drc/drc.c | 4 ++-- src/audio/eq_fir/eq_fir.c | 2 +- src/audio/eq_iir/eq_iir.c | 4 ++-- src/audio/mfcc/mfcc.c | 16 ++++++++-------- src/audio/mixer/mixer.c | 4 ++-- src/audio/mixin_mixout/mixin_mixout.c | 8 ++++---- src/audio/module_adapter/module/cadence.c | 4 ++-- src/audio/module_adapter/module/dts/dts.c | 4 ++-- src/audio/module_adapter/module/generic.c | 2 +- src/audio/module_adapter/module/modules.c | 4 ++-- src/audio/module_adapter/module/passthrough.c | 4 ++-- src/audio/module_adapter/module/waves/waves.c | 4 ++-- src/audio/module_adapter/module_adapter.c | 2 +- src/audio/multiband_drc/multiband_drc.c | 4 ++-- src/audio/mux/mux.c | 8 ++++---- src/audio/selector/selector.c | 2 +- src/audio/src/src.c | 4 ++-- src/audio/tdfb/tdfb.c | 2 +- src/audio/up_down_mixer/up_down_mixer.c | 4 ++-- src/audio/volume/volume.c | 8 ++++---- .../sof/audio/module_adapter/module/generic.h | 6 +++--- src/samples/audio/smart_amp_test_ipc4.c | 4 ++-- 26 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/audio/aria/aria.c b/src/audio/aria/aria.c index a20afc6e365f..0b2b6b763c42 100644 --- a/src/audio/aria/aria.c +++ b/src/audio/aria/aria.c @@ -254,8 +254,8 @@ static int aria_process(struct processing_module *mod, return 0; } -static struct module_interface aria_interface = { - .init = aria_init, +static const struct module_interface aria_interface = { + .init = aria_init, .prepare = aria_prepare, .process_audio_stream = aria_process, .reset = aria_reset, diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index c9157240466c..de45b6273e85 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -1000,8 +1000,8 @@ static struct module_endpoint_ops copier_endpoint_ops = { .trigger = copier_comp_trigger }; -static struct module_interface copier_interface = { - .init = copier_init, +static const struct module_interface copier_interface = { + .init = copier_init, .prepare = copier_prepare, .process_audio_stream = copier_process, .reset = copier_reset, diff --git a/src/audio/crossover/crossover.c b/src/audio/crossover/crossover.c index dd1fb0468eda..4d75db645132 100644 --- a/src/audio/crossover/crossover.c +++ b/src/audio/crossover/crossover.c @@ -832,8 +832,8 @@ static int crossover_reset(struct processing_module *mod) } /** \brief Crossover Filter component definition. */ -static struct module_interface crossover_interface = { - .init = crossover_init, +static const struct module_interface crossover_interface = { + .init = crossover_init, .prepare = crossover_prepare, .process_audio_stream = crossover_process_audio_stream, .set_configuration = crossover_set_config, diff --git a/src/audio/dcblock/dcblock.c b/src/audio/dcblock/dcblock.c index 3a476933299e..cc5024156eaa 100644 --- a/src/audio/dcblock/dcblock.c +++ b/src/audio/dcblock/dcblock.c @@ -316,8 +316,8 @@ static int dcblock_reset(struct processing_module *mod) return 0; } -static struct module_interface dcblock_interface = { - .init = dcblock_init, +static const struct module_interface dcblock_interface = { + .init = dcblock_init, .prepare = dcblock_prepare, .process_audio_stream = dcblock_process, .set_configuration = dcblock_set_config, diff --git a/src/audio/drc/drc.c b/src/audio/drc/drc.c index 47462b3f79ec..b0326bf31e42 100644 --- a/src/audio/drc/drc.c +++ b/src/audio/drc/drc.c @@ -360,8 +360,8 @@ static int drc_reset(struct processing_module *mod) return 0; } -static struct module_interface drc_interface = { - .init = drc_init, +static const struct module_interface drc_interface = { + .init = drc_init, .prepare = drc_prepare, .process_audio_stream = drc_process, .set_configuration = drc_set_config, diff --git a/src/audio/eq_fir/eq_fir.c b/src/audio/eq_fir/eq_fir.c index 5d304d15c368..47efd54627ed 100644 --- a/src/audio/eq_fir/eq_fir.c +++ b/src/audio/eq_fir/eq_fir.c @@ -636,7 +636,7 @@ static int eq_fir_reset(struct processing_module *mod) return 0; } -static struct module_interface eq_fir_interface = { +static const struct module_interface eq_fir_interface = { .init = eq_fir_init, .free = eq_fir_free, .set_configuration = eq_fir_set_config, diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index cf9c6fdbf6c1..97421be8840a 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -960,8 +960,8 @@ static int eq_iir_reset(struct processing_module *mod) return 0; } -static struct module_interface eq_iir_interface = { - .init = eq_iir_init, +static const struct module_interface eq_iir_interface = { + .init = eq_iir_init, .prepare = eq_iir_prepare, .process_audio_stream = eq_iir_process, .set_configuration = eq_iir_set_config, diff --git a/src/audio/mfcc/mfcc.c b/src/audio/mfcc/mfcc.c index bc3803a104ff..89621ede49b7 100644 --- a/src/audio/mfcc/mfcc.c +++ b/src/audio/mfcc/mfcc.c @@ -268,14 +268,14 @@ static int mfcc_reset(struct processing_module *mod) return 0; } -static struct module_interface mfcc_interface = { - .init = mfcc_init, - .free = mfcc_free, - .set_configuration = mfcc_set_config, - .get_configuration = mfcc_get_config, - .process_audio_stream = mfcc_process, - .prepare = mfcc_prepare, - .reset = mfcc_reset, +static const struct module_interface mfcc_interface = { + .init = mfcc_init, + .free = mfcc_free, + .set_configuration = mfcc_set_config, + .get_configuration = mfcc_get_config, + .process_audio_stream = mfcc_process, + .prepare = mfcc_prepare, + .reset = mfcc_reset, }; DECLARE_MODULE_ADAPTER(mfcc_interface, mfcc_uuid, mfcc_tr); diff --git a/src/audio/mixer/mixer.c b/src/audio/mixer/mixer.c index b26a880d1d1f..740f31e142aa 100644 --- a/src/audio/mixer/mixer.c +++ b/src/audio/mixer/mixer.c @@ -266,8 +266,8 @@ static int mixer_prepare(struct processing_module *mod, return 0; } -static struct module_interface mixer_interface = { - .init = mixer_init, +static const struct module_interface mixer_interface = { + .init = mixer_init, .prepare = mixer_prepare, .process_audio_stream = mixer_process, .reset = mixer_reset, diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index 2bfe3e64196b..ba68e96a56c1 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -852,8 +852,8 @@ static int mixin_set_config(struct processing_module *mod, uint32_t config_id, return 0; } -static struct module_interface mixin_interface = { - .init = mixin_init, +static const struct module_interface mixin_interface = { + .init = mixin_init, .prepare = mixin_prepare, .process_audio_stream = mixin_process, .set_configuration = mixin_set_config, @@ -864,8 +864,8 @@ static struct module_interface mixin_interface = { DECLARE_MODULE_ADAPTER(mixin_interface, mixin_uuid, mixin_tr); SOF_MODULE_INIT(mixin, sys_comp_module_mixin_interface_init); -static struct module_interface mixout_interface = { - .init = mixout_init, +static const struct module_interface mixout_interface = { + .init = mixout_init, .prepare = mixout_prepare, .process_audio_stream = mixout_process, .reset = mixout_reset, diff --git a/src/audio/module_adapter/module/cadence.c b/src/audio/module_adapter/module/cadence.c index d3f9a9e407e7..0de9d8040ae1 100644 --- a/src/audio/module_adapter/module/cadence.c +++ b/src/audio/module_adapter/module/cadence.c @@ -879,8 +879,8 @@ cadence_codec_set_configuration(struct processing_module *mod, uint32_t config_i return 0; } -static struct module_interface cadence_interface = { - .init = cadence_codec_init, +static const struct module_interface cadence_interface = { + .init = cadence_codec_init, .prepare = cadence_codec_prepare, .process_raw_data = cadence_codec_process, .set_configuration = cadence_codec_set_configuration, diff --git a/src/audio/module_adapter/module/dts/dts.c b/src/audio/module_adapter/module/dts/dts.c index b136b23f586e..ac4ee9034683 100644 --- a/src/audio/module_adapter/module/dts/dts.c +++ b/src/audio/module_adapter/module/dts/dts.c @@ -451,8 +451,8 @@ dts_codec_set_configuration(struct processing_module *mod, uint32_t config_id, return 0; } -static struct module_interface dts_interface = { - .init = dts_codec_init, +static const struct module_interface dts_interface = { + .init = dts_codec_init, .prepare = dts_codec_prepare, .process_raw_data = dts_codec_process, .set_configuration = dts_codec_set_configuration, diff --git a/src/audio/module_adapter/module/generic.c b/src/audio/module_adapter/module/generic.c index 709230b6639f..7c7f56481182 100644 --- a/src/audio/module_adapter/module/generic.c +++ b/src/audio/module_adapter/module/generic.c @@ -75,7 +75,7 @@ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size) return ret; } -int module_init(struct processing_module *mod, struct module_interface *interface) +int module_init(struct processing_module *mod, const struct module_interface *interface) { int ret; struct module_data *md = &mod->priv; diff --git a/src/audio/module_adapter/module/modules.c b/src/audio/module_adapter/module/modules.c index 1bb917fd36a4..3a2fd29abd04 100644 --- a/src/audio/module_adapter/module/modules.c +++ b/src/audio/module_adapter/module/modules.c @@ -375,8 +375,8 @@ static int modules_reset(struct processing_module *mod) } /* Processing Module Adapter API*/ -static struct module_interface interface = { - .init = modules_init, +static const struct module_interface interface = { + .init = modules_init, .prepare = modules_prepare, .process_raw_data = modules_process, .set_processing_mode = modules_set_processing_mode, diff --git a/src/audio/module_adapter/module/passthrough.c b/src/audio/module_adapter/module/passthrough.c index ef86eadc896e..af8a7227f346 100644 --- a/src/audio/module_adapter/module/passthrough.c +++ b/src/audio/module_adapter/module/passthrough.c @@ -116,8 +116,8 @@ static int passthrough_codec_free(struct processing_module *mod) return 0; } -static struct module_interface passthrough_interface = { - .init = passthrough_codec_init, +static const struct module_interface passthrough_interface = { + .init = passthrough_codec_init, .prepare = passthrough_codec_prepare, .process_raw_data = passthrough_codec_process, .reset = passthrough_codec_reset, diff --git a/src/audio/module_adapter/module/waves/waves.c b/src/audio/module_adapter/module/waves/waves.c index 1124bc5d3a69..e32f8d5c95f5 100644 --- a/src/audio/module_adapter/module/waves/waves.c +++ b/src/audio/module_adapter/module/waves/waves.c @@ -883,8 +883,8 @@ waves_codec_set_configuration(struct processing_module *mod, uint32_t config_id, return 0; } -static struct module_interface waves_interface = { - .init = waves_codec_init, +static const struct module_interface waves_interface = { + .init = waves_codec_init, .prepare = waves_codec_prepare, .process_raw_data = waves_codec_process, .set_configuration = waves_codec_set_configuration, diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index d0b8305667ab..dace298fa5f8 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -46,7 +46,7 @@ LOG_MODULE_REGISTER(module_adapter, CONFIG_SOF_LOG_LEVEL); */ struct comp_dev *module_adapter_new(const struct comp_driver *drv, const struct comp_ipc_config *config, - struct module_interface *interface, const void *spec) + const struct module_interface *interface, const void *spec) { int ret; struct comp_dev *dev; diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index 9a836b3e5644..edf76400c284 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -551,8 +551,8 @@ static int multiband_drc_reset(struct processing_module *mod) return 0; } -static struct module_interface multiband_drc_interface = { - .init = multiband_drc_init, +static const struct module_interface multiband_drc_interface = { + .init = multiband_drc_init, .prepare = multiband_drc_prepare, .process_audio_stream = multiband_drc_process, .set_configuration = multiband_drc_set_config, diff --git a/src/audio/mux/mux.c b/src/audio/mux/mux.c index ca35d73b6131..cd0176766cfa 100644 --- a/src/audio/mux/mux.c +++ b/src/audio/mux/mux.c @@ -675,8 +675,8 @@ static int mux_set_config(struct processing_module *mod, uint32_t config_id, fragment, fragment_size); } -static struct module_interface mux_interface = { - .init = mux_init, +static const struct module_interface mux_interface = { + .init = mux_init, .set_configuration = mux_set_config, .get_configuration = mux_get_config, .prepare = mux_prepare, @@ -688,8 +688,8 @@ static struct module_interface mux_interface = { DECLARE_MODULE_ADAPTER(mux_interface, mux_uuid, mux_tr); SOF_MODULE_INIT(mux, sys_comp_module_mux_interface_init); -static struct module_interface demux_interface = { - .init = demux_init, +static const struct module_interface demux_interface = { + .init = demux_init, .set_configuration = mux_set_config, .get_configuration = mux_get_config, .prepare = mux_prepare, diff --git a/src/audio/selector/selector.c b/src/audio/selector/selector.c index 8748f07ea1a3..19adb3c29402 100644 --- a/src/audio/selector/selector.c +++ b/src/audio/selector/selector.c @@ -965,7 +965,7 @@ static int selector_reset(struct processing_module *mod) } /** \brief Selector component definition. */ -static struct module_interface selector_interface = { +static const struct module_interface selector_interface = { .init = selector_init, .prepare = selector_prepare, .process_audio_stream = selector_process, diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 752f0f7a1825..4f863dfce5cc 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -1068,8 +1068,8 @@ static int src_free(struct processing_module *mod) return 0; } -static struct module_interface src_interface = { - .init = src_init, +static const struct module_interface src_interface = { + .init = src_init, .prepare = src_prepare, .process = src_process, .is_ready_to_process = src_is_ready_to_process, diff --git a/src/audio/tdfb/tdfb.c b/src/audio/tdfb/tdfb.c index 976119264e02..339b9da6b57c 100644 --- a/src/audio/tdfb/tdfb.c +++ b/src/audio/tdfb/tdfb.c @@ -819,7 +819,7 @@ static int tdfb_reset(struct processing_module *mod) return 0; } -static struct module_interface tdfb_interface = { +static const struct module_interface tdfb_interface = { .init = tdfb_init, .free = tdfb_free, .set_configuration = tdfb_set_config, diff --git a/src/audio/up_down_mixer/up_down_mixer.c b/src/audio/up_down_mixer/up_down_mixer.c index 7736b681dd24..c6e6c6b5bd58 100644 --- a/src/audio/up_down_mixer/up_down_mixer.c +++ b/src/audio/up_down_mixer/up_down_mixer.c @@ -456,8 +456,8 @@ up_down_mixer_process(struct processing_module *mod, return 0; } -static struct module_interface up_down_mixer_interface = { - .init = up_down_mixer_init, +static const struct module_interface up_down_mixer_interface = { + .init = up_down_mixer_init, .prepare = up_down_mixer_prepare, .process_audio_stream = up_down_mixer_process, .reset = up_down_mixer_reset, diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index 797b201b03b5..37c6ad05040b 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -745,8 +745,8 @@ static int volume_reset(struct processing_module *mod) return 0; } -static struct module_interface volume_interface = { - .init = volume_init, +static const struct module_interface volume_interface = { + .init = volume_init, .prepare = volume_prepare, .process_audio_stream = volume_process, .set_configuration = volume_set_config, @@ -759,8 +759,8 @@ DECLARE_MODULE_ADAPTER(volume_interface, volume_uuid, volume_tr); SOF_MODULE_INIT(volume, sys_comp_module_volume_interface_init); #if CONFIG_COMP_GAIN -static struct module_interface gain_interface = { - .init = volume_init, +static const struct module_interface gain_interface = { + .init = volume_init, .prepare = volume_prepare, .process_audio_stream = volume_process, .set_configuration = volume_set_config, diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 038f774df3eb..b101e458f6cc 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -155,7 +155,7 @@ struct module_data { void *private; /**< self object, memory tables etc here */ void *runtime_params; struct module_config cfg; /**< module configuration data */ - struct module_interface *ops; /**< module specific operations */ + const struct module_interface *ops; /**< module specific operations */ struct module_memory memory; /**< memory allocated by module */ struct module_processing_data mpd; /**< shared data comp <-> module */ void *module_adapter; /**<loadable module interface handle */ @@ -240,7 +240,7 @@ struct processing_module { /* Module generic interfaces */ /*****************************************************************************/ int module_load_config(struct comp_dev *dev, const void *cfg, size_t size); -int module_init(struct processing_module *mod, struct module_interface *interface); +int module_init(struct processing_module *mod, const struct module_interface *interface); void *module_allocate_memory(struct processing_module *mod, uint32_t size, uint32_t alignment); int module_free_memory(struct processing_module *mod, void *ptr); void module_free_all_memory(struct processing_module *mod); @@ -290,7 +290,7 @@ int module_unbind(struct processing_module *mod, void *data); struct comp_dev *module_adapter_new(const struct comp_driver *drv, const struct comp_ipc_config *config, - struct module_interface *interface, const void *spec); + const struct module_interface *interface, const void *spec); int module_adapter_prepare(struct comp_dev *dev); int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *params); int module_adapter_copy(struct comp_dev *dev); diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index a21e29684218..8e6058160b58 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -387,8 +387,8 @@ static int smart_amp_prepare(struct processing_module *mod, return ret; } -static struct module_interface smart_amp_interface = { - .init = smart_amp_init, +static const struct module_interface smart_amp_interface = { + .init = smart_amp_init, .prepare = smart_amp_prepare, .process_audio_stream = smart_amp_process, .set_configuration = smart_amp_set_config, From 3f9e6be455d792fc5c2b9c0dda23c91c40380ada Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 8 Sep 2023 17:30:47 +0200 Subject: [PATCH 350/639] module-adapter: (cosmetic) remove a redundant check rfree(NULL) is valid, remove a redundant NULL check. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/audio/module_adapter/module/generic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/audio/module_adapter/module/generic.c b/src/audio/module_adapter/module/generic.c index 7c7f56481182..f43a776de136 100644 --- a/src/audio/module_adapter/module/generic.c +++ b/src/audio/module_adapter/module/generic.c @@ -222,8 +222,7 @@ int module_prepare(struct processing_module *mod, * as it has been applied during the procedure - it is safe to * free it. */ - if (md->cfg.data) - rfree(md->cfg.data); + rfree(md->cfg.data); md->cfg.avail = false; md->cfg.data = NULL; From b6aad8d205b9e3d257a538962fd1dea44a2a3968 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 8 Sep 2023 15:21:21 +0200 Subject: [PATCH 351/639] smart-amp: remove unused header platform.h isn't needed in smart_amp_test.h, remove it from there. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/include/sof/samples/audio/smart_amp_test.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/include/sof/samples/audio/smart_amp_test.h b/src/include/sof/samples/audio/smart_amp_test.h index 7f24b5c37de8..3feda5005125 100644 --- a/src/include/sof/samples/audio/smart_amp_test.h +++ b/src/include/sof/samples/audio/smart_amp_test.h @@ -8,7 +8,6 @@ #ifndef __SOF_AUDIO_SMART_AMP_H__ #define __SOF_AUDIO_SMART_AMP_H__ -#include <sof/platform.h> #include <sof/audio/component.h> #include <sof/audio/data_blob.h> From ca3f44f2d73217b22901cd755a648a59f92bc4a9 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Wed, 6 Sep 2023 10:07:12 +0800 Subject: [PATCH 352/639] audio: src: move out src component data out from src source move component data out of source file to avoid ipc3 and ipc4 usage in src source file. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/src/src.c | 29 --------------------------- src/include/sof/audio/src/src.h | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 4f863dfce5cc..08e9db621c5f 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -63,11 +63,6 @@ LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL); #if CONFIG_IPC_MAJOR_4 -/* src component private data */ -struct ipc4_config_src { - struct ipc4_base_module_cfg base; - uint32_t sink_rate; -}; /* e61bb28d-149a-4c1f-b709-46823ef5f5a3 */ DECLARE_SOF_RT_UUID("src", src_uuid, 0xe61bb28d, 0x149a, 0x4c1f, @@ -82,30 +77,6 @@ DECLARE_SOF_RT_UUID("src", src_uuid, 0xc1c5326d, 0x8390, 0x46b4, DECLARE_TR_CTX(src_tr, SOF_UUID(src_uuid), LOG_LEVEL_INFO); -struct comp_data { -#if CONFIG_IPC_MAJOR_4 - struct ipc4_config_src ipc_config; -#else - struct ipc_config_src ipc_config; -#endif /* CONFIG_IPC_MAJOR_4 */ - struct polyphase_src src; - struct src_param param; - int32_t *delay_lines; - uint32_t sink_rate; - uint32_t source_rate; - int32_t *sbuf_w_ptr; - int32_t const *sbuf_r_ptr; - int sbuf_avail; - int data_shift; - int source_frames; - int sink_frames; - int sample_container_bytes; - int channels_count; - int (*src_func)(struct comp_data *cd, struct sof_source *source, - struct sof_sink *sink); - void (*polyphase_func)(struct src_stage_prm *s); -}; - /* Calculates the needed FIR delay line length */ static int src_fir_delay_length(struct src_stage *s) { diff --git a/src/include/sof/audio/src/src.h b/src/include/sof/audio/src/src.h index b86f0440fe5d..33f7de34cc81 100644 --- a/src/include/sof/audio/src/src.h +++ b/src/include/sof/audio/src/src.h @@ -10,6 +10,9 @@ #include <stddef.h> #include <stdint.h> +#include <ipc4/base-config.h> +#include <sof/audio/ipc-config.h> +#include <sof/audio/audio_stream.h> struct src_param { int fir_s1; @@ -119,4 +122,36 @@ int32_t src_input_rates(void); int32_t src_output_rates(void); +#if CONFIG_IPC_MAJOR_4 +/* src component private data */ +struct ipc4_config_src { + struct ipc4_base_module_cfg base; + uint32_t sink_rate; +}; +#endif + +struct comp_data { +#if CONFIG_IPC_MAJOR_4 + struct ipc4_config_src ipc_config; +#else + struct ipc_config_src ipc_config; +#endif /* CONFIG_IPC_MAJOR_4 */ + struct polyphase_src src; + struct src_param param; + int32_t *delay_lines; + uint32_t sink_rate; + uint32_t source_rate; + int32_t *sbuf_w_ptr; + int32_t const *sbuf_r_ptr; + int sbuf_avail; + int data_shift; + int source_frames; + int sink_frames; + int sample_container_bytes; + int channels_count; + int (*src_func)(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink); + void (*polyphase_func)(struct src_stage_prm *s); +}; + #endif /* __SOF_AUDIO_SRC_SRC_H__ */ From 9fdbf1c398184d715a68c5a49367221f4d2fec7b Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Wed, 6 Sep 2023 11:28:56 +0800 Subject: [PATCH 353/639] audio: src: split src ipc3 and ipc4 specific file create new files to cover ipc3 and ipc4 specific code. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/CMakeLists.txt | 3 +- src/audio/src/CMakeLists.txt | 6 + src/audio/src/src.c | 312 +------------------------------- src/audio/src/src_ipc3.c | 199 ++++++++++++++++++++ src/audio/src/src_ipc4.c | 232 ++++++++++++++++++++++++ src/include/sof/audio/src/src.h | 33 ++++ zephyr/CMakeLists.txt | 26 ++- 7 files changed, 495 insertions(+), 316 deletions(-) create mode 100644 src/audio/src/src_ipc3.c create mode 100644 src/audio/src/src_ipc4.c diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index f35dd917eae0..649a80520dda 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -168,11 +168,12 @@ set(sof_audio_modules mixer volume src asrc eq-fir eq-iir dcblock crossover tdfb # sources for each module if(CONFIG_IPC_MAJOR_3) set(volume_sources volume/volume.c volume/volume_generic.c volume/volume_ipc3.c) + set(src_sources src/src.c src/src_ipc3.c src/src_generic.c) elseif(CONFIG_IPC_MAJOR_4) set(volume_sources volume/volume.c volume/volume_generic.c volume/volume_ipc4.c) + set(src_sources src/src.c src/src_ipc4.c src/src_generic.c) endif() set(mixer_sources ${mixer_src}) -set(src_sources src/src.c src/src_generic.c) set(asrc_sources asrc/asrc.c asrc/asrc_farrow.c asrc/asrc_farrow_generic.c) set(eq-fir_sources eq_fir/eq_fir.c eq_fir/eq_fir_generic.c) set(eq-iir_sources eq_iir/eq_iir.c) diff --git a/src/audio/src/CMakeLists.txt b/src/audio/src/CMakeLists.txt index 1884f44ffd6f..2f3d2d561822 100644 --- a/src/audio/src/CMakeLists.txt +++ b/src/audio/src/CMakeLists.txt @@ -1,3 +1,9 @@ # SPDX-License-Identifier: BSD-3-Clause add_local_sources(sof src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src.c) + +if(CONFIG_IPC_MAJOR_3) + add_local_sources(sof src_ipc3.c) +elseif(CONFIG_IPC_MAJOR_4) + add_local_sources(sof src_ipc4.c) +endif() diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 08e9db621c5f..c9c8e0517120 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -62,21 +62,6 @@ LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL); -#if CONFIG_IPC_MAJOR_4 - -/* e61bb28d-149a-4c1f-b709-46823ef5f5a3 */ -DECLARE_SOF_RT_UUID("src", src_uuid, 0xe61bb28d, 0x149a, 0x4c1f, - 0xb7, 0x09, 0x46, 0x82, 0x3e, 0xf5, 0xf5, 0xae); -#elif CONFIG_IPC_MAJOR_3 -/* c1c5326d-8390-46b4-aa47-95c3beca6550 */ -DECLARE_SOF_RT_UUID("src", src_uuid, 0xc1c5326d, 0x8390, 0x46b4, - 0xaa, 0x47, 0x95, 0xc3, 0xbe, 0xca, 0x65, 0x50); -#else -#error "No or invalid IPC MAJOR version selected." -#endif /* CONFIG_IPC_MAJOR_4 */ - -DECLARE_TR_CTX(src_tr, SOF_UUID(src_uuid), LOG_LEVEL_INFO); - /* Calculates the needed FIR delay line length */ static int src_fir_delay_length(struct src_stage *s) { @@ -306,8 +291,8 @@ int src_polyphase_init(struct polyphase_src *src, struct src_param *p, } /* Fallback function */ -static int src_fallback(struct comp_data *cd, struct sof_source *source, - struct sof_sink *sink) +int src_fallback(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink) { return 0; } @@ -473,132 +458,7 @@ static int src_copy_sxx(struct comp_data *cd, struct sof_source *source, return -ENOTSUP; } -#if CONFIG_IPC_MAJOR_4 -static int src_rate_check(const void *spec) -{ - const struct ipc4_config_src *ipc_src = spec; - - if (ipc_src->base.audio_fmt.sampling_frequency == 0 || ipc_src->sink_rate == 0) - return -EINVAL; - - return 0; -} - -static int src_stream_pcm_source_rate_check(struct ipc4_config_src cfg, - struct sof_ipc_stream_params *params) -{ - /* Nothing to check */ - return 0; -} - -static int src_stream_pcm_sink_rate_check(struct ipc4_config_src cfg, - struct sof_ipc_stream_params *params) -{ - if (cfg.sink_rate && params->rate != cfg.sink_rate) - return -EINVAL; - - return 0; -} - -/* In ipc4 case param is figured out by module config so we need to first - * set up param then verify param. BTW for IPC3 path, the param is sent by - * host driver. - */ -static int src_set_params(struct processing_module *mod, struct sof_sink *sink) -{ - struct sof_ipc_stream_params src_params; - struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_data *cd = module_get_private_data(mod); - enum sof_ipc_frame frame_fmt, valid_fmt; - struct comp_dev *dev = mod->dev; - int ret; - - src_params = *params; - src_params.channels = mod->priv.cfg.base_cfg.audio_fmt.channels_count; - src_params.buffer_fmt = mod->priv.cfg.base_cfg.audio_fmt.interleaving_style; - src_params.rate = cd->ipc_config.sink_rate; - - /* Get frame_fmt and valid_fmt */ - audio_stream_fmt_conversion(mod->priv.cfg.base_cfg.audio_fmt.depth, - mod->priv.cfg.base_cfg.audio_fmt.valid_bit_depth, - &frame_fmt, &valid_fmt, - mod->priv.cfg.base_cfg.audio_fmt.s_type); - - src_params.frame_fmt = valid_fmt; - component_set_nearest_period_frames(dev, src_params.rate); - - ret = sink_set_params(sink, &src_params, true); - - /* Update module stream_params */ - params->rate = cd->ipc_config.sink_rate; - return ret; -} - -static void src_set_sink_params(struct comp_dev *dev, struct sof_sink *sink) -{ - struct processing_module *mod = comp_get_drvdata(dev); - struct comp_data *cd = module_get_private_data(mod); - enum sof_ipc_frame frame_fmt, valid_fmt; - - /* convert IPC4 config to format used by the module */ - audio_stream_fmt_conversion(cd->ipc_config.base.audio_fmt.depth, - cd->ipc_config.base.audio_fmt.valid_bit_depth, - &frame_fmt, &valid_fmt, - cd->ipc_config.base.audio_fmt.s_type); - sink_set_frm_fmt(sink, frame_fmt); - sink_set_valid_fmt(sink, valid_fmt); - sink_set_channels(sink, cd->ipc_config.base.audio_fmt.channels_count); - sink_set_buffer_fmt(sink, cd->ipc_config.base.audio_fmt.interleaving_style); - sink_set_rate(sink, cd->ipc_config.sink_rate); -} - -#elif CONFIG_IPC_MAJOR_3 -static int src_rate_check(const void *spec) -{ - const struct ipc_config_src *ipc_src = spec; - - if (ipc_src->source_rate == 0 && ipc_src->sink_rate == 0) - return -EINVAL; - - return 0; -} - -static int src_stream_pcm_sink_rate_check(struct ipc_config_src cfg, - struct sof_ipc_stream_params *params) -{ - /* In playback, module adapter mod->stream_params from prepare() is for sink side */ - if (cfg.sink_rate && params->rate != cfg.sink_rate) - return -EINVAL; - - return 0; -} - -static int src_stream_pcm_source_rate_check(struct ipc_config_src cfg, - struct sof_ipc_stream_params *params) -{ - /* In capture, module adapter mod->stream_params from prepare() is for source side */ - if (cfg.source_rate && params->rate != cfg.source_rate) - return -EINVAL; - - return 0; -} - -static int src_set_params(struct processing_module *mod, struct sof_sink *sink) -{ - return 0; -} - -static void src_set_sink_params(struct comp_dev *dev, struct sof_sink *sink) -{ - /* empty */ -} - -#else -#error "No or invalid IPC MAJOR version selected." -#endif /* CONFIG_IPC_MAJOR_4 */ - -static void src_set_alignment(struct sof_source *source, - struct sof_sink *sink) +void src_set_alignment(struct sof_source *source, struct sof_sink *sink) { const uint32_t byte_align = 1; const uint32_t frame_align_req = 1; @@ -713,15 +573,8 @@ static int src_params_general(struct processing_module *mod, return err; } - src_set_sink_params(dev, sink); + src_get_source_sink_params(dev, source, sink); -#if CONFIG_IPC_MAJOR_3 - /* Set source/sink_rate/frames */ - cd->channels_count = source_get_channels(source); - cd->source_rate = source_get_rate(source); - cd->sink_rate = sink_get_rate(sink); - cd->sample_container_bytes = mod->stream_params->sample_container_bytes; -#endif comp_info(dev, "src_params(), source_rate = %u, sink_rate = %u", cd->source_rate, cd->sink_rate); comp_dbg(dev, "src_params(), sample_container_bytes = %d, channels = %u, dev->frames = %u", @@ -798,163 +651,6 @@ static int src_params_general(struct processing_module *mod, return 0; } -static int src_prepare_general(struct processing_module *mod, - struct sof_source *source, - struct sof_sink *sink) -{ - struct comp_data *cd = module_get_private_data(mod); - struct comp_dev *dev = mod->dev; - int ret = 0; -#if CONFIG_IPC_MAJOR_3 - enum sof_ipc_frame source_format; - enum sof_ipc_frame sink_format; -#endif - - - /* set align requirements */ - src_set_alignment(source, sink); - -#if CONFIG_IPC_MAJOR_4 - switch (cd->ipc_config.base.audio_fmt.depth) { -#if CONFIG_FORMAT_S16LE - case IPC4_DEPTH_16BIT: - cd->data_shift = 0; - cd->polyphase_func = src_polyphase_stage_cir_s16; - break; -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S24LE - case IPC4_DEPTH_24BIT: - cd->data_shift = 8; - cd->polyphase_func = src_polyphase_stage_cir; - break; -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S32LE - case IPC4_DEPTH_32BIT: - cd->data_shift = 0; - cd->polyphase_func = src_polyphase_stage_cir; - break; -#endif /* CONFIG_FORMAT_S32LE */ - default: - comp_err(dev, "src_prepare(): Invalid depth %d", - cd->ipc_config.base.audio_fmt.depth); - ret = -EINVAL; - goto out; - } -#elif CONFIG_IPC_MAJOR_3 - /* get source/sink data format */ - source_format = source_get_frm_fmt(source); - sink_format = sink_get_frm_fmt(sink); - - /* SRC supports S16_LE, S24_4LE and S32_LE formats */ - if (source_format != sink_format) { - comp_err(dev, "src_prepare(): Source fmt %d and sink fmt %d are different.", - source_format, sink_format); - ret = -EINVAL; - goto out; - } - - switch (source_format) { -#if CONFIG_FORMAT_S16LE - case SOF_IPC_FRAME_S16_LE: - cd->data_shift = 0; - cd->polyphase_func = src_polyphase_stage_cir_s16; - break; -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S24LE - case SOF_IPC_FRAME_S24_4LE: - cd->data_shift = 8; - cd->polyphase_func = src_polyphase_stage_cir; - break; -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S32LE - case SOF_IPC_FRAME_S32_LE: - cd->data_shift = 0; - cd->polyphase_func = src_polyphase_stage_cir; - break; -#endif /* CONFIG_FORMAT_S32LE */ - default: - comp_err(dev, "src_prepare(): invalid format %d", source_format); - ret = -EINVAL; - goto out; - } -#endif /* CONFIG_IPC_MAJOR_3 */ - -out: - if (ret < 0) - comp_set_state(dev, COMP_TRIGGER_RESET); - - return ret; -} - -static int src_init(struct processing_module *mod) -{ - struct module_data *md = &mod->priv; - struct module_config *cfg = &md->cfg; - struct comp_dev *dev = mod->dev; - struct comp_data *cd = NULL; - - comp_dbg(dev, "src_init()"); -#if CONFIG_IPC_MAJOR_3 - if (dev->ipc_config.type != SOF_COMP_SRC) { - comp_err(dev, "src_init(): Wrong IPC config type %u", - dev->ipc_config.type); - return -EINVAL; - } -#endif - if (!cfg->init_data || cfg->size != sizeof(cd->ipc_config)) { - comp_err(dev, "src_init(): Missing or bad size (%u) init data", - cfg->size); - return -EINVAL; - } - - /* validate init data - either SRC sink or source rate must be set */ - if (src_rate_check(cfg->init_data) < 0) { - comp_err(dev, "src_init(): SRC sink and source rate are not set"); - return -EINVAL; - } - - cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd)); - if (!cd) - return -ENOMEM; - - md->private = cd; - memcpy_s(&cd->ipc_config, sizeof(cd->ipc_config), cfg->init_data, sizeof(cd->ipc_config)); - - cd->delay_lines = NULL; - cd->src_func = src_fallback; - cd->polyphase_func = NULL; - src_polyphase_reset(&cd->src); - -#if CONFIG_IPC_MAJOR_4 - comp_dbg(dev, "src_init(), channels_count = %d, depth = %d", - cd->ipc_config.base.audio_fmt.channels_count, - cd->ipc_config.base.audio_fmt.depth); - comp_dbg(dev, "src_init(), sampling frequency = %d, sink rate = %d", - cd->ipc_config.base.audio_fmt.sampling_frequency, cd->ipc_config.sink_rate); - cd->source_rate = cd->ipc_config.base.audio_fmt.sampling_frequency; - cd->sink_rate = cd->ipc_config.sink_rate; - cd->channels_count = cd->ipc_config.base.audio_fmt.channels_count; - switch (cd->ipc_config.base.audio_fmt.depth) { - case IPC4_DEPTH_16BIT: - cd->sample_container_bytes = sizeof(int16_t); - break; - case IPC4_DEPTH_24BIT: - case IPC4_DEPTH_32BIT: - cd->sample_container_bytes = sizeof(int32_t); - break; - default: - comp_err(dev, "src_init(): Illegal sample depth %d", - cd->ipc_config.base.audio_fmt.depth); - rfree(cd); - return -EINVAL; - } -#elif CONFIG_IPC_MAJOR_3 - mod->verify_params_flags = BUFF_PARAMS_RATE; -#endif - - return 0; -} - static int src_prepare(struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) diff --git a/src/audio/src/src_ipc3.c b/src/audio/src/src_ipc3.c new file mode 100644 index 000000000000..aef12e0537a3 --- /dev/null +++ b/src/audio/src/src_ipc3.c @@ -0,0 +1,199 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> +// Liam Girdwood <liam.r.girdwood@linux.intel.com> +// Keyon Jie <yang.jie@linux.intel.com> + +#include <sof/common.h> +#include <sof/audio/buffer.h> +#include <sof/audio/component.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/audio_stream.h> +#include <sof/audio/ipc-config.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/src/src.h> +#include <sof/audio/src/src_config.h> +#include <sof/audio/sink_api.h> +#include <sof/audio/source_api.h> +#include <sof/audio/sink_source_utils.h> +#include <rtos/panic.h> +#include <sof/ipc/msg.h> +#include <rtos/alloc.h> +#include <rtos/init.h> +#include <sof/lib/memory.h> +#include <sof/lib/uuid.h> +#include <sof/list.h> +#include <sof/math/numbers.h> +#include <sof/platform.h> +#include <rtos/string.h> +#include <sof/ut.h> +#include <sof/trace/trace.h> +#include <ipc/control.h> +#include <ipc/stream.h> +#include <ipc/topology.h> +#include <ipc4/base-config.h> +#include <user/trace.h> +#include <errno.h> +#include <stddef.h> +#include <stdint.h> +#include <limits.h> + +/* c1c5326d-8390-46b4-aa47-95c3beca6550 */ +DECLARE_SOF_RT_UUID("src", src_uuid, 0xc1c5326d, 0x8390, 0x46b4, + 0xaa, 0x47, 0x95, 0xc3, 0xbe, 0xca, 0x65, 0x50); + +DECLARE_TR_CTX(src_tr, SOF_UUID(src_uuid), LOG_LEVEL_INFO); + +LOG_MODULE_DECLARE(src, CONFIG_SOF_LOG_LEVEL); + +int src_rate_check(const void *spec) +{ + const struct ipc_config_src *ipc_src = spec; + + if (ipc_src->source_rate == 0 && ipc_src->sink_rate == 0) + return -EINVAL; + + return 0; +} + +int src_stream_pcm_sink_rate_check(struct ipc_config_src cfg, + struct sof_ipc_stream_params *params) +{ + /* In playback, module adapter mod->stream_params from prepare() is for sink side */ + if (cfg.sink_rate && params->rate != cfg.sink_rate) + return -EINVAL; + + return 0; +} + +int src_stream_pcm_source_rate_check(struct ipc_config_src cfg, + struct sof_ipc_stream_params *params) +{ + /* In capture, module adapter mod->stream_params from prepare() is for source side */ + if (cfg.source_rate && params->rate != cfg.source_rate) + return -EINVAL; + + return 0; +} + +int src_set_params(struct processing_module *mod, struct sof_sink *sink) +{ + return 0; +} + +void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source, + struct sof_sink *sink) +{ + struct processing_module *mod = comp_get_drvdata(dev); + struct comp_data *cd = module_get_private_data(mod); + + /* Set source/sink_rate/frames */ + cd->channels_count = source_get_channels(source); + cd->source_rate = source_get_rate(source); + cd->sink_rate = sink_get_rate(sink); + cd->sample_container_bytes = mod->stream_params->sample_container_bytes; +} + +int src_prepare_general(struct processing_module *mod, + struct sof_source *source, + struct sof_sink *sink) +{ + struct comp_data *cd = module_get_private_data(mod); + struct comp_dev *dev = mod->dev; + int ret = 0; + enum sof_ipc_frame source_format; + enum sof_ipc_frame sink_format; + + /* set align requirements */ + src_set_alignment(source, sink); + + /* get source/sink data format */ + source_format = source_get_frm_fmt(source); + sink_format = sink_get_frm_fmt(sink); + + /* SRC supports S16_LE, S24_4LE and S32_LE formats */ + if (source_format != sink_format) { + comp_err(dev, "src_prepare(): Source fmt %d and sink fmt %d are different.", + source_format, sink_format); + ret = -EINVAL; + goto out; + } + + switch (source_format) { +#if CONFIG_FORMAT_S16LE + case SOF_IPC_FRAME_S16_LE: + cd->data_shift = 0; + cd->polyphase_func = src_polyphase_stage_cir_s16; + break; +#endif /* CONFIG_FORMAT_S16LE */ +#if CONFIG_FORMAT_S24LE + case SOF_IPC_FRAME_S24_4LE: + cd->data_shift = 8; + cd->polyphase_func = src_polyphase_stage_cir; + break; +#endif /* CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S32LE + case SOF_IPC_FRAME_S32_LE: + cd->data_shift = 0; + cd->polyphase_func = src_polyphase_stage_cir; + break; +#endif /* CONFIG_FORMAT_S32LE */ + default: + comp_err(dev, "src_prepare(): invalid format %d", source_format); + ret = -EINVAL; + goto out; + } + +out: + if (ret < 0) + comp_set_state(dev, COMP_TRIGGER_RESET); + + return ret; +} + +int src_init(struct processing_module *mod) +{ + struct module_data *md = &mod->priv; + struct module_config *cfg = &md->cfg; + struct comp_dev *dev = mod->dev; + struct comp_data *cd = NULL; + + comp_dbg(dev, "src_init()"); + + if (dev->ipc_config.type != SOF_COMP_SRC) { + comp_err(dev, "src_init(): Wrong IPC config type %u", + dev->ipc_config.type); + return -EINVAL; + } + + if (!cfg->init_data || cfg->size != sizeof(cd->ipc_config)) { + comp_err(dev, "src_init(): Missing or bad size (%u) init data", + cfg->size); + return -EINVAL; + } + + /* validate init data - either SRC sink or source rate must be set */ + if (src_rate_check(cfg->init_data) < 0) { + comp_err(dev, "src_init(): SRC sink and source rate are not set"); + return -EINVAL; + } + + cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd)); + if (!cd) + return -ENOMEM; + + md->private = cd; + memcpy_s(&cd->ipc_config, sizeof(cd->ipc_config), cfg->init_data, sizeof(cd->ipc_config)); + + cd->delay_lines = NULL; + cd->src_func = src_fallback; + cd->polyphase_func = NULL; + src_polyphase_reset(&cd->src); + + mod->verify_params_flags = BUFF_PARAMS_RATE; + + return 0; +} + diff --git a/src/audio/src/src_ipc4.c b/src/audio/src/src_ipc4.c new file mode 100644 index 000000000000..7d29ad9aeb49 --- /dev/null +++ b/src/audio/src/src_ipc4.c @@ -0,0 +1,232 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017 Intel Corporation. All rights reserved. +// +// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> +// Liam Girdwood <liam.r.girdwood@linux.intel.com> +// Keyon Jie <yang.jie@linux.intel.com> + +#include <sof/common.h> +#include <sof/audio/buffer.h> +#include <sof/audio/component.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/audio_stream.h> +#include <sof/audio/ipc-config.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/src/src.h> +#include <sof/audio/src/src_config.h> +#include <sof/audio/sink_api.h> +#include <sof/audio/source_api.h> +#include <sof/audio/sink_source_utils.h> +#include <rtos/panic.h> +#include <sof/ipc/msg.h> +#include <rtos/alloc.h> +#include <rtos/init.h> +#include <sof/lib/memory.h> +#include <sof/lib/uuid.h> +#include <sof/list.h> +#include <sof/math/numbers.h> +#include <sof/platform.h> +#include <rtos/string.h> +#include <sof/ut.h> +#include <sof/trace/trace.h> +#include <ipc/control.h> +#include <ipc/stream.h> +#include <ipc/topology.h> +#include <ipc4/base-config.h> +#include <user/trace.h> +#include <errno.h> +#include <stddef.h> +#include <stdint.h> +#include <limits.h> + +/* e61bb28d-149a-4c1f-b709-46823ef5f5a3 */ +DECLARE_SOF_RT_UUID("src", src_uuid, 0xe61bb28d, 0x149a, 0x4c1f, + 0xb7, 0x09, 0x46, 0x82, 0x3e, 0xf5, 0xf5, 0xae); + +DECLARE_TR_CTX(src_tr, SOF_UUID(src_uuid), LOG_LEVEL_INFO); + +LOG_MODULE_DECLARE(src, CONFIG_SOF_LOG_LEVEL); + +int src_rate_check(const void *spec) +{ + const struct ipc4_config_src *ipc_src = spec; + + if (ipc_src->base.audio_fmt.sampling_frequency == 0 || ipc_src->sink_rate == 0) + return -EINVAL; + + return 0; +} + +int src_stream_pcm_source_rate_check(struct ipc4_config_src cfg, + struct sof_ipc_stream_params *params) +{ + /* Nothing to check */ + return 0; +} + +int src_stream_pcm_sink_rate_check(struct ipc4_config_src cfg, + struct sof_ipc_stream_params *params) +{ + if (cfg.sink_rate && params->rate != cfg.sink_rate) + return -EINVAL; + + return 0; +} + +/* In ipc4 case param is figured out by module config so we need to first + * set up param then verify param. BTW for IPC3 path, the param is sent by + * host driver. + */ +int src_set_params(struct processing_module *mod, struct sof_sink *sink) +{ + struct sof_ipc_stream_params src_params; + struct sof_ipc_stream_params *params = mod->stream_params; + struct comp_data *cd = module_get_private_data(mod); + enum sof_ipc_frame frame_fmt, valid_fmt; + struct comp_dev *dev = mod->dev; + int ret; + + src_params = *params; + src_params.channels = mod->priv.cfg.base_cfg.audio_fmt.channels_count; + src_params.buffer_fmt = mod->priv.cfg.base_cfg.audio_fmt.interleaving_style; + src_params.rate = cd->ipc_config.sink_rate; + + /* Get frame_fmt and valid_fmt */ + audio_stream_fmt_conversion(mod->priv.cfg.base_cfg.audio_fmt.depth, + mod->priv.cfg.base_cfg.audio_fmt.valid_bit_depth, + &frame_fmt, &valid_fmt, + mod->priv.cfg.base_cfg.audio_fmt.s_type); + + src_params.frame_fmt = valid_fmt; + component_set_nearest_period_frames(dev, src_params.rate); + + ret = sink_set_params(sink, &src_params, true); + + /* Update module stream_params */ + params->rate = cd->ipc_config.sink_rate; + return ret; +} + +void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source, + struct sof_sink *sink) +{ + struct processing_module *mod = comp_get_drvdata(dev); + struct comp_data *cd = module_get_private_data(mod); + enum sof_ipc_frame frame_fmt, valid_fmt; + + /* convert IPC4 config to format used by the module */ + audio_stream_fmt_conversion(cd->ipc_config.base.audio_fmt.depth, + cd->ipc_config.base.audio_fmt.valid_bit_depth, + &frame_fmt, &valid_fmt, + cd->ipc_config.base.audio_fmt.s_type); + sink_set_frm_fmt(sink, frame_fmt); + sink_set_valid_fmt(sink, valid_fmt); + sink_set_channels(sink, cd->ipc_config.base.audio_fmt.channels_count); + sink_set_buffer_fmt(sink, cd->ipc_config.base.audio_fmt.interleaving_style); + sink_set_rate(sink, cd->ipc_config.sink_rate); +} + +int src_prepare_general(struct processing_module *mod, + struct sof_source *source, + struct sof_sink *sink) +{ + struct comp_data *cd = module_get_private_data(mod); + struct comp_dev *dev = mod->dev; + int ret = 0; + + /* set align requirements */ + src_set_alignment(source, sink); + + switch (cd->ipc_config.base.audio_fmt.depth) { +#if CONFIG_FORMAT_S16LE + case IPC4_DEPTH_16BIT: + cd->data_shift = 0; + cd->polyphase_func = src_polyphase_stage_cir_s16; + break; +#endif /* CONFIG_FORMAT_S16LE */ +#if CONFIG_FORMAT_S24LE + case IPC4_DEPTH_24BIT: + cd->data_shift = 8; + cd->polyphase_func = src_polyphase_stage_cir; + break; +#endif /* CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S32LE + case IPC4_DEPTH_32BIT: + cd->data_shift = 0; + cd->polyphase_func = src_polyphase_stage_cir; + break; +#endif /* CONFIG_FORMAT_S32LE */ + default: + comp_err(dev, "src_prepare(): Invalid depth %d", + cd->ipc_config.base.audio_fmt.depth); + ret = -EINVAL; + goto out; + } + +out: + if (ret < 0) + comp_set_state(dev, COMP_TRIGGER_RESET); + + return ret; +} + +int src_init(struct processing_module *mod) +{ + struct module_data *md = &mod->priv; + struct module_config *cfg = &md->cfg; + struct comp_dev *dev = mod->dev; + struct comp_data *cd = NULL; + + comp_dbg(dev, "src_init()"); + + if (!cfg->init_data || cfg->size != sizeof(cd->ipc_config)) { + comp_err(dev, "src_init(): Missing or bad size (%u) init data", + cfg->size); + return -EINVAL; + } + + /* validate init data - either SRC sink or source rate must be set */ + if (src_rate_check(cfg->init_data) < 0) { + comp_err(dev, "src_init(): SRC sink and source rate are not set"); + return -EINVAL; + } + + cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd)); + if (!cd) + return -ENOMEM; + + md->private = cd; + memcpy_s(&cd->ipc_config, sizeof(cd->ipc_config), cfg->init_data, sizeof(cd->ipc_config)); + + cd->delay_lines = NULL; + cd->src_func = src_fallback; + cd->polyphase_func = NULL; + src_polyphase_reset(&cd->src); + + comp_dbg(dev, "src_init(), channels_count = %d, depth = %d", + cd->ipc_config.base.audio_fmt.channels_count, + cd->ipc_config.base.audio_fmt.depth); + comp_dbg(dev, "src_init(), sampling frequency = %d, sink rate = %d", + cd->ipc_config.base.audio_fmt.sampling_frequency, cd->ipc_config.sink_rate); + cd->source_rate = cd->ipc_config.base.audio_fmt.sampling_frequency; + cd->sink_rate = cd->ipc_config.sink_rate; + cd->channels_count = cd->ipc_config.base.audio_fmt.channels_count; + switch (cd->ipc_config.base.audio_fmt.depth) { + case IPC4_DEPTH_16BIT: + cd->sample_container_bytes = sizeof(int16_t); + break; + case IPC4_DEPTH_24BIT: + case IPC4_DEPTH_32BIT: + cd->sample_container_bytes = sizeof(int32_t); + break; + default: + comp_err(dev, "src_init(): Illegal sample depth %d", + cd->ipc_config.base.audio_fmt.depth); + rfree(cd); + return -EINVAL; + } + + return 0; +} + diff --git a/src/include/sof/audio/src/src.h b/src/include/sof/audio/src/src.h index 33f7de34cc81..fe2170ab1714 100644 --- a/src/include/sof/audio/src/src.h +++ b/src/include/sof/audio/src/src.h @@ -13,6 +13,8 @@ #include <ipc4/base-config.h> #include <sof/audio/ipc-config.h> #include <sof/audio/audio_stream.h> +#include <sof/audio/component.h> +#include <sof/audio/module_adapter/module/generic.h> struct src_param { int fir_s1; @@ -122,6 +124,8 @@ int32_t src_input_rates(void); int32_t src_output_rates(void); +void src_set_alignment(struct sof_source *source, struct sof_sink *sink); + #if CONFIG_IPC_MAJOR_4 /* src component private data */ struct ipc4_config_src { @@ -155,3 +159,32 @@ struct comp_data { }; #endif /* __SOF_AUDIO_SRC_SRC_H__ */ + +#if CONFIG_IPC_MAJOR_4 + +int src_stream_pcm_source_rate_check(struct ipc4_config_src cfg, + struct sof_ipc_stream_params *params); +int src_stream_pcm_sink_rate_check(struct ipc4_config_src cfg, + struct sof_ipc_stream_params *params); +#elif CONFIG_IPC_MAJOR_3 +int src_stream_pcm_sink_rate_check(struct ipc_config_src cfg, + struct sof_ipc_stream_params *params); +int src_stream_pcm_source_rate_check(struct ipc_config_src cfg, + struct sof_ipc_stream_params *params); +#endif /* CONFIG_IPC_MAJOR_4 */ + +int src_rate_check(const void *spec); +int src_set_params(struct processing_module *mod, struct sof_sink *sink); + +void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source, + struct sof_sink *sink); +int src_prepare_general(struct processing_module *mod, + struct sof_source *source, + struct sof_sink *sink); +int src_init(struct processing_module *mod); +int src_fallback(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink); + +extern const struct sof_uuid src_uuid; +extern struct tr_ctx src_tr; + diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 1412508147c9..7ffa43160927 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -570,13 +570,25 @@ zephyr_library_sources_ifdef(CONFIG_COMP_CHAIN_DMA ${SOF_AUDIO_PATH}/chain_dma.c ) -zephyr_library_sources_ifdef(CONFIG_COMP_SRC - ${SOF_AUDIO_PATH}/src/src_hifi2ep.c - ${SOF_AUDIO_PATH}/src/src_generic.c - ${SOF_AUDIO_PATH}/src/src_hifi3.c - ${SOF_AUDIO_PATH}/src/src_hifi4.c - ${SOF_AUDIO_PATH}/src/src.c -) +if(CONFIG_IPC_MAJOR_3) + zephyr_library_sources_ifdef(CONFIG_COMP_SRC + ${SOF_AUDIO_PATH}/src/src_hifi2ep.c + ${SOF_AUDIO_PATH}/src/src_generic.c + ${SOF_AUDIO_PATH}/src/src_hifi3.c + ${SOF_AUDIO_PATH}/src/src_hifi4.c + ${SOF_AUDIO_PATH}/src/src.c + ${SOF_AUDIO_PATH}/src/src_ipc3.c + ) +elseif(CONFIG_IPC_MAJOR_4) + zephyr_library_sources_ifdef(CONFIG_COMP_SRC + ${SOF_AUDIO_PATH}/src/src_hifi2ep.c + ${SOF_AUDIO_PATH}/src/src_generic.c + ${SOF_AUDIO_PATH}/src/src_hifi3.c + ${SOF_AUDIO_PATH}/src/src_hifi4.c + ${SOF_AUDIO_PATH}/src/src.c + ${SOF_AUDIO_PATH}/src/src_ipc4.c + ) +endif() zephyr_library_sources_ifdef(CONFIG_COMP_BASEFW_IPC4 ${SOF_AUDIO_PATH}/base_fw.c From 611374e3ff70bd0d3bb2ed09eb6605fc98329ba8 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Wed, 6 Sep 2023 14:47:48 +0800 Subject: [PATCH 354/639] audio: src: move src header file to source folder previously, these headers are located in include directory. Now, move it to src/audio/src/ directory, since these headers are only used by src module. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/src/src.c | 21 ++- src/{include/sof => }/audio/src/src.h | 0 .../src}/src/src_ipc4_int32_10_21_2500_5000.h | 2 +- .../src}/src/src_ipc4_int32_10_21_3455_5000.h | 2 +- .../src}/src/src_ipc4_int32_10_21_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_10_9_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_16_21_4319_5000.h | 2 +- .../src}/src/src_ipc4_int32_16_21_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_16_7_4082_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_2_2268_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_2_2500_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_2_2721_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_2_3401_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_2_3887_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_2_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_3_2268_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_3_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_4_1512_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_4_2268_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_4_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_1_6_1134_5000.h | 2 +- .../src}/src/src_ipc4_int32_20_21_1250_5000.h | 2 +- .../src}/src/src_ipc4_int32_20_21_2500_5000.h | 2 +- .../src}/src/src_ipc4_int32_20_21_3125_5000.h | 2 +- .../src}/src/src_ipc4_int32_20_21_4167_5000.h | 2 +- .../src}/src/src_ipc4_int32_20_21_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_20_7_2976_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_10_2500_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_10_3455_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_10_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_16_4319_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_16_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_20_1250_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_20_2500_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_20_3125_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_20_4167_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_20_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_2_3239_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_32_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_40_2381_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_40_3968_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_4_1080_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_4_3239_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_5_1728_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_5_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_80_3968_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_8_2160_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_8_3239_5000.h | 2 +- .../src}/src/src_ipc4_int32_21_8_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_2_1_2268_5000.h | 2 +- .../src}/src/src_ipc4_int32_2_1_2500_5000.h | 2 +- .../src}/src/src_ipc4_int32_2_1_2721_5000.h | 2 +- .../src}/src/src_ipc4_int32_2_1_3401_5000.h | 2 +- .../src}/src/src_ipc4_int32_2_1_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_2_3_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_32_21_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_3_1_2268_5000.h | 2 +- .../src}/src/src_ipc4_int32_3_1_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_3_2_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_3_4_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_40_21_2381_5000.h | 2 +- .../src}/src/src_ipc4_int32_40_21_2976_5000.h | 2 +- .../src}/src/src_ipc4_int32_40_21_3968_5000.h | 2 +- .../src}/src/src_ipc4_int32_40_7_2976_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_1_1134_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_1_1512_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_1_2268_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_1_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_21_1080_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_21_3239_5000.h | 2 +- .../src}/src/src_ipc4_int32_4_3_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_5_21_1728_5000.h | 2 +- .../src}/src/src_ipc4_int32_5_21_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_5_7_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_6_1_1134_5000.h | 2 +- .../src}/src/src_ipc4_int32_7_3_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_7_5_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_7_8_1361_5000.h | 2 +- .../src}/src/src_ipc4_int32_7_8_2468_5000.h | 2 +- .../src}/src/src_ipc4_int32_7_8_2721_5000.h | 2 +- .../src}/src/src_ipc4_int32_7_8_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_21_2160_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_21_3239_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_21_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_7_1361_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_7_2468_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_7_2721_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_7_4082_5000.h | 2 +- .../src}/src/src_ipc4_int32_8_7_4535_5000.h | 2 +- .../src}/src/src_ipc4_int32_define.h | 0 .../src}/src/src_ipc4_int32_table.h | 176 +++++++++--------- .../src}/src/src_small_int32_1_2_2268_5000.h | 2 +- .../src}/src/src_small_int32_1_2_4535_5000.h | 2 +- .../src}/src/src_small_int32_1_3_2268_5000.h | 2 +- .../src}/src/src_small_int32_1_3_4535_5000.h | 2 +- .../src/src_small_int32_20_21_4167_5000.h | 2 +- .../src/src_small_int32_21_20_4167_5000.h | 2 +- .../src}/src/src_small_int32_2_1_2268_5000.h | 2 +- .../src}/src/src_small_int32_2_1_4535_5000.h | 2 +- .../src}/src/src_small_int32_2_3_4535_5000.h | 2 +- .../src}/src/src_small_int32_3_1_2268_5000.h | 2 +- .../src}/src/src_small_int32_3_1_4535_5000.h | 2 +- .../src}/src/src_small_int32_3_2_4535_5000.h | 2 +- .../src}/src/src_small_int32_3_4_4535_5000.h | 2 +- .../src}/src/src_small_int32_4_3_4535_5000.h | 2 +- .../src}/src/src_small_int32_4_5_4535_5000.h | 2 +- .../src}/src/src_small_int32_5_4_4535_5000.h | 2 +- .../src}/src/src_small_int32_5_6_4354_5000.h | 2 +- .../src}/src/src_small_int32_6_5_4354_5000.h | 2 +- .../src}/src/src_small_int32_7_8_4535_5000.h | 2 +- .../src}/src/src_small_int32_8_7_4535_5000.h | 2 +- .../src}/src/src_small_int32_define.h | 0 .../src}/src/src_small_int32_table.h | 42 ++--- .../src}/src/src_std_int32_10_21_4535_5000.h | 0 .../src}/src/src_std_int32_1_2_2268_5000.h | 0 .../src}/src/src_std_int32_1_2_4535_5000.h | 0 .../src}/src/src_std_int32_1_3_2268_5000.h | 0 .../src}/src/src_std_int32_1_3_4535_5000.h | 0 .../src}/src/src_std_int32_20_21_4167_5000.h | 0 .../src}/src/src_std_int32_20_7_2976_5000.h | 0 .../src}/src/src_std_int32_21_20_4167_5000.h | 0 .../src}/src/src_std_int32_21_40_3968_5000.h | 0 .../src}/src/src_std_int32_21_80_3968_5000.h | 0 .../src}/src/src_std_int32_2_1_2268_5000.h | 0 .../src}/src/src_std_int32_2_1_4535_5000.h | 0 .../src}/src/src_std_int32_2_3_4535_5000.h | 0 .../src}/src/src_std_int32_32_21_4535_5000.h | 0 .../src}/src/src_std_int32_3_1_2268_5000.h | 0 .../src}/src/src_std_int32_3_1_4535_5000.h | 0 .../src}/src/src_std_int32_3_2_4535_5000.h | 0 .../src}/src/src_std_int32_3_4_4535_5000.h | 0 .../src}/src/src_std_int32_40_21_3968_5000.h | 0 .../src}/src/src_std_int32_4_3_4535_5000.h | 0 .../src}/src/src_std_int32_4_5_4535_5000.h | 0 .../src}/src/src_std_int32_5_4_4535_5000.h | 0 .../src}/src/src_std_int32_5_6_4354_5000.h | 0 .../src}/src/src_std_int32_5_7_4535_5000.h | 0 .../src}/src/src_std_int32_6_5_4354_5000.h | 0 .../src}/src/src_std_int32_7_8_4535_5000.h | 0 .../src}/src/src_std_int32_8_21_3239_5000.h | 0 .../src}/src/src_std_int32_8_7_2468_5000.h | 0 .../src}/src/src_std_int32_8_7_4535_5000.h | 0 .../src}/src/src_std_int32_define.h | 0 .../src}/src/src_std_int32_table.h | 60 +++--- .../src}/src/src_tiny_int16_1_2_1814_5000.h | 0 .../src}/src/src_tiny_int16_1_3_1814_5000.h | 0 .../src}/src/src_tiny_int16_1_6_1814_5000.h | 0 .../src}/src/src_tiny_int16_20_21_1667_5000.h | 0 .../src}/src/src_tiny_int16_21_20_1667_5000.h | 0 .../src}/src/src_tiny_int16_24_25_1814_5000.h | 0 .../src}/src/src_tiny_int16_25_24_1814_5000.h | 0 .../src}/src/src_tiny_int16_2_1_1814_5000.h | 0 .../src}/src/src_tiny_int16_2_3_1814_5000.h | 0 .../src}/src/src_tiny_int16_3_1_1814_5000.h | 0 .../src}/src/src_tiny_int16_3_2_1814_5000.h | 0 .../src}/src/src_tiny_int16_6_1_1814_5000.h | 0 .../src}/src/src_tiny_int16_7_8_1814_5000.h | 0 .../src}/src/src_tiny_int16_8_7_1814_5000.h | 0 .../src}/src/src_tiny_int16_define.h | 0 .../src}/src/src_tiny_int16_table.h | 30 +-- src/{include/sof => }/audio/src/src_config.h | 0 src/audio/src/src_generic.c | 5 +- src/audio/src/src_hifi2ep.c | 5 +- src/audio/src/src_hifi3.c | 5 +- src/audio/src/src_hifi4.c | 5 +- src/audio/src/src_ipc3.c | 5 +- src/audio/src/src_ipc4.c | 5 +- 167 files changed, 290 insertions(+), 283 deletions(-) rename src/{include/sof => }/audio/src/src.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_10_21_2500_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_10_21_3455_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_10_21_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_10_9_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_16_21_4319_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_16_21_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_16_7_4082_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_2_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_2_2500_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_2_2721_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_2_3401_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_2_3887_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_2_4535_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_3_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_4_1512_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_4_2268_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_4_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_1_6_1134_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_20_21_1250_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_20_21_2500_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_20_21_3125_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_20_21_4167_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_20_21_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_20_7_2976_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_10_2500_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_10_3455_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_10_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_16_4319_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_16_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_20_1250_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_20_2500_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_20_3125_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_20_4167_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_20_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_2_3239_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_32_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_40_2381_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_40_3968_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_4_1080_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_4_3239_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_5_1728_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_5_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_80_3968_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_8_2160_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_8_3239_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_21_8_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_2_1_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_2_1_2500_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_2_1_2721_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_2_1_3401_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_2_1_4535_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_2_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_32_21_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_3_1_2268_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_3_1_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_3_2_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_3_4_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_40_21_2381_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_40_21_2976_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_40_21_3968_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_40_7_2976_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_1_1134_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_1_1512_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_1_2268_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_1_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_21_1080_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_21_3239_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_4_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_5_21_1728_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_5_21_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_5_7_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_6_1_1134_5000.h (97%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_7_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_7_5_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_7_8_1361_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_7_8_2468_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_7_8_2721_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_7_8_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_21_2160_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_21_3239_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_21_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_7_1361_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_7_2468_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_7_2721_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_7_4082_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_8_7_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_define.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_ipc4_int32_table.h (60%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_1_2_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_1_2_4535_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_1_3_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_1_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_20_21_4167_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_21_20_4167_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_2_1_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_2_1_4535_5000.h (98%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_2_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_3_1_2268_5000.h (96%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_3_1_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_3_2_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_3_4_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_4_3_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_4_5_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_5_4_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_5_6_4354_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_6_5_4354_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_7_8_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_8_7_4535_5000.h (99%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_define.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_small_int32_table.h (68%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_10_21_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_1_2_2268_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_1_2_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_1_3_2268_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_1_3_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_20_21_4167_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_20_7_2976_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_21_20_4167_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_21_40_3968_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_21_80_3968_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_2_1_2268_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_2_1_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_2_3_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_32_21_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_3_1_2268_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_3_1_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_3_2_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_3_4_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_40_21_3968_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_4_3_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_4_5_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_5_4_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_5_6_4354_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_5_7_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_6_5_4354_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_7_8_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_8_21_3239_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_8_7_2468_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_8_7_4535_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_define.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_std_int32_table.h (79%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_1_2_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_1_3_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_1_6_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_20_21_1667_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_21_20_1667_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_24_25_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_25_24_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_2_1_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_2_3_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_3_1_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_3_2_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_6_1_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_7_8_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_8_7_1814_5000.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_define.h (100%) rename src/{include/sof/audio/coefficients => audio/src}/src/src_tiny_int16_table.h (75%) rename src/{include/sof => }/audio/src/src_config.h (100%) diff --git a/src/audio/src/src.c b/src/audio/src/src.c index c9c8e0517120..6507d7bc1c8d 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -13,8 +13,6 @@ #include <sof/audio/audio_stream.h> #include <sof/audio/ipc-config.h> #include <sof/audio/module_adapter/module/generic.h> -#include <sof/audio/src/src.h> -#include <sof/audio/src/src_config.h> #include <sof/audio/sink_api.h> #include <sof/audio/source_api.h> #include <sof/audio/sink_source_utils.h> @@ -40,18 +38,21 @@ #include <stdint.h> #include <limits.h> +#include "src.h" +#include "src_config.h" + #if SRC_SHORT || CONFIG_COMP_SRC_TINY -#include <sof/audio/coefficients/src/src_tiny_int16_define.h> -#include <sof/audio/coefficients/src/src_tiny_int16_table.h> +#include "src/src_tiny_int16_define.h" +#include "src/src_tiny_int16_table.h" #elif CONFIG_COMP_SRC_SMALL -#include <sof/audio/coefficients/src/src_small_int32_define.h> -#include <sof/audio/coefficients/src/src_small_int32_table.h> +#include "src/src_small_int32_define.h" +#include "src/src_small_int32_table.h" #elif CONFIG_COMP_SRC_STD -#include <sof/audio/coefficients/src/src_std_int32_define.h> -#include <sof/audio/coefficients/src/src_std_int32_table.h> +#include "src/src_std_int32_define.h" +#include "src/src_std_int32_table.h" #elif CONFIG_COMP_SRC_IPC4_FULL_MATRIX -#include <sof/audio/coefficients/src/src_ipc4_int32_define.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_table.h> +#include "src/src_ipc4_int32_define.h" +#include "src/src_ipc4_int32_table.h" #else #error "No valid configuration selected for SRC" #endif diff --git a/src/include/sof/audio/src/src.h b/src/audio/src/src.h similarity index 100% rename from src/include/sof/audio/src/src.h rename to src/audio/src/src.h diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_2500_5000.h b/src/audio/src/src/src_ipc4_int32_10_21_2500_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_2500_5000.h rename to src/audio/src/src/src_ipc4_int32_10_21_2500_5000.h index 065a4222779b..d1d115ee44a0 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_2500_5000.h +++ b/src/audio/src/src/src_ipc4_int32_10_21_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_10_21_2500_5000_fir[480] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_3455_5000.h b/src/audio/src/src/src_ipc4_int32_10_21_3455_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_3455_5000.h rename to src/audio/src/src/src_ipc4_int32_10_21_3455_5000.h index a3e3c6314cdf..18c85e663503 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_3455_5000.h +++ b/src/audio/src/src/src_ipc4_int32_10_21_3455_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_10_21_3455_5000_fir[640] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_4535_5000.h b/src/audio/src/src/src_ipc4_int32_10_21_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_10_21_4535_5000.h index c683105b3be0..44548957393b 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_21_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_10_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_10_21_4535_5000_fir[2320] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_9_4535_5000.h b/src/audio/src/src/src_ipc4_int32_10_9_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_10_9_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_10_9_4535_5000.h index ad3b67a7d7ca..25cc0225e3be 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_10_9_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_10_9_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_10_9_4535_5000_fir[1080] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_16_21_4319_5000.h b/src/audio/src/src/src_ipc4_int32_16_21_4319_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_16_21_4319_5000.h rename to src/audio/src/src/src_ipc4_int32_16_21_4319_5000.h index 0fdff4295a78..337160da937f 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_16_21_4319_5000.h +++ b/src/audio/src/src/src_ipc4_int32_16_21_4319_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_16_21_4319_5000_fir[1472] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_16_21_4535_5000.h b/src/audio/src/src/src_ipc4_int32_16_21_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_16_21_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_16_21_4535_5000.h index 0a7175e0512e..e3c61b76f695 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_16_21_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_16_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_16_21_4535_5000_fir[2048] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_16_7_4082_5000.h b/src/audio/src/src/src_ipc4_int32_16_7_4082_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_16_7_4082_5000.h rename to src/audio/src/src/src_ipc4_int32_16_7_4082_5000.h index 4daec91d4e62..43805148096f 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_16_7_4082_5000.h +++ b/src/audio/src/src/src_ipc4_int32_16_7_4082_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_16_7_4082_5000_fir[896] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2268_5000.h b/src/audio/src/src/src_ipc4_int32_1_2_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2268_5000.h rename to src/audio/src/src/src_ipc4_int32_1_2_2268_5000.h index c6406b56dfe8..be58891825a2 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2268_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_2_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_2268_5000_fir[36] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2500_5000.h b/src/audio/src/src/src_ipc4_int32_1_2_2500_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2500_5000.h rename to src/audio/src/src/src_ipc4_int32_1_2_2500_5000.h index 15192f4b0f73..969ee2727761 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2500_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_2_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_2500_5000_fir[40] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2721_5000.h b/src/audio/src/src/src_ipc4_int32_1_2_2721_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2721_5000.h rename to src/audio/src/src/src_ipc4_int32_1_2_2721_5000.h index 685fdf20490d..92d3ee21d921 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_2721_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_2_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_2721_5000_fir[44] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_3401_5000.h b/src/audio/src/src/src_ipc4_int32_1_2_3401_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_3401_5000.h rename to src/audio/src/src/src_ipc4_int32_1_2_3401_5000.h index e8573294477c..e3556ed816c1 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_3401_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_2_3401_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_3401_5000_fir[60] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_3887_5000.h b/src/audio/src/src/src_ipc4_int32_1_2_3887_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_3887_5000.h rename to src/audio/src/src/src_ipc4_int32_1_2_3887_5000.h index 9884373e089e..369c861cd598 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_3887_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_2_3887_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_3887_5000_fir[84] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_4535_5000.h b/src/audio/src/src/src_ipc4_int32_1_2_4535_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_1_2_4535_5000.h index b06b5a258f83..c5221b373733 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_2_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_2_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_4535_5000_fir[192] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_3_2268_5000.h b/src/audio/src/src/src_ipc4_int32_1_3_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_3_2268_5000.h rename to src/audio/src/src/src_ipc4_int32_1_3_2268_5000.h index 6da1f70dc034..51c259bc7617 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_3_2268_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_3_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_3_2268_5000_fir[52] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_3_4535_5000.h b/src/audio/src/src/src_ipc4_int32_1_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_3_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_1_3_4535_5000.h index 8e45ac26f184..1f717019d9ea 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_3_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_3_4535_5000_fir[260] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_1512_5000.h b/src/audio/src/src/src_ipc4_int32_1_4_1512_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_1512_5000.h rename to src/audio/src/src/src_ipc4_int32_1_4_1512_5000.h index f98ba0f9be7c..fcf3ba774765 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_1512_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_4_1512_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_4_1512_5000_fir[52] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_2268_5000.h b/src/audio/src/src/src_ipc4_int32_1_4_2268_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_2268_5000.h rename to src/audio/src/src/src_ipc4_int32_1_4_2268_5000.h index 8df1653d8afd..b2f84d157233 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_2268_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_4_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_4_2268_5000_fir[60] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_4535_5000.h b/src/audio/src/src/src_ipc4_int32_1_4_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_1_4_4535_5000.h index bab9a1df434b..b33697aedb89 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_4_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_4_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_4_4535_5000_fir[332] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_6_1134_5000.h b/src/audio/src/src/src_ipc4_int32_1_6_1134_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_1_6_1134_5000.h rename to src/audio/src/src/src_ipc4_int32_1_6_1134_5000.h index 7342c541f490..6cc06424de00 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_1_6_1134_5000.h +++ b/src/audio/src/src/src_ipc4_int32_1_6_1134_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_6_1134_5000_fir[68] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_1250_5000.h b/src/audio/src/src/src_ipc4_int32_20_21_1250_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_1250_5000.h rename to src/audio/src/src/src_ipc4_int32_20_21_1250_5000.h index 0bda24345ace..b50d11408430 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_1250_5000.h +++ b/src/audio/src/src/src_ipc4_int32_20_21_1250_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_1250_5000_fir[320] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_2500_5000.h b/src/audio/src/src/src_ipc4_int32_20_21_2500_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_2500_5000.h rename to src/audio/src/src/src_ipc4_int32_20_21_2500_5000.h index 1624d3b5d039..5828ac080c60 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_2500_5000.h +++ b/src/audio/src/src/src_ipc4_int32_20_21_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_2500_5000_fir[560] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_3125_5000.h b/src/audio/src/src/src_ipc4_int32_20_21_3125_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_3125_5000.h rename to src/audio/src/src/src_ipc4_int32_20_21_3125_5000.h index 3063a4cb793b..c34349e9e25e 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_3125_5000.h +++ b/src/audio/src/src/src_ipc4_int32_20_21_3125_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_3125_5000_fir[640] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_4167_5000.h b/src/audio/src/src/src_ipc4_int32_20_21_4167_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_4167_5000.h rename to src/audio/src/src/src_ipc4_int32_20_21_4167_5000.h index 4b83c9f4e32a..521d2f244aa2 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_4167_5000.h +++ b/src/audio/src/src/src_ipc4_int32_20_21_4167_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_4167_5000_fir[1200] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_4535_5000.h b/src/audio/src/src/src_ipc4_int32_20_21_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_20_21_4535_5000.h index 2ebde5a89b7c..0a1677d6f277 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_21_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_20_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_4535_5000_fir[2080] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_7_2976_5000.h b/src/audio/src/src/src_ipc4_int32_20_7_2976_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_20_7_2976_5000.h rename to src/audio/src/src/src_ipc4_int32_20_7_2976_5000.h index ffb4fbf6abbf..a16d7b713113 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_20_7_2976_5000.h +++ b/src/audio/src/src/src_ipc4_int32_20_7_2976_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_7_2976_5000_fir[560] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_2500_5000.h b/src/audio/src/src/src_ipc4_int32_21_10_2500_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_2500_5000.h rename to src/audio/src/src/src_ipc4_int32_21_10_2500_5000.h index 0f2abed0ca46..e58dddfb028a 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_2500_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_10_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_10_2500_5000_fir[504] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_3455_5000.h b/src/audio/src/src/src_ipc4_int32_21_10_3455_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_3455_5000.h rename to src/audio/src/src/src_ipc4_int32_21_10_3455_5000.h index 9b1bcf324af2..ec2fef3d8cd7 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_3455_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_10_3455_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_10_3455_5000_fir[756] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_4535_5000.h b/src/audio/src/src/src_ipc4_int32_21_10_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_21_10_4535_5000.h index 35f53ab94add..f24f635f1ac5 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_10_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_10_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_10_4535_5000_fir[2520] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_16_4319_5000.h b/src/audio/src/src/src_ipc4_int32_21_16_4319_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_16_4319_5000.h rename to src/audio/src/src/src_ipc4_int32_21_16_4319_5000.h index a51f25af699b..aab03d7e8db5 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_16_4319_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_16_4319_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_16_4319_5000_fir[1596] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_16_4535_5000.h b/src/audio/src/src/src_ipc4_int32_21_16_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_16_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_21_16_4535_5000.h index 2c82d535369f..924268316718 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_16_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_16_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_16_4535_5000_fir[2436] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_1250_5000.h b/src/audio/src/src/src_ipc4_int32_21_20_1250_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_1250_5000.h rename to src/audio/src/src/src_ipc4_int32_21_20_1250_5000.h index 1c952f207c14..a4c08f30e549 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_1250_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_20_1250_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_1250_5000_fir[420] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_2500_5000.h b/src/audio/src/src/src_ipc4_int32_21_20_2500_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_2500_5000.h rename to src/audio/src/src/src_ipc4_int32_21_20_2500_5000.h index d5e0479f2c3b..356e9539e193 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_2500_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_20_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_2500_5000_fir[504] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_3125_5000.h b/src/audio/src/src/src_ipc4_int32_21_20_3125_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_3125_5000.h rename to src/audio/src/src/src_ipc4_int32_21_20_3125_5000.h index 24d8d957b490..fa68cd2fe43a 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_3125_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_20_3125_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_3125_5000_fir[672] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_4167_5000.h b/src/audio/src/src/src_ipc4_int32_21_20_4167_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_4167_5000.h rename to src/audio/src/src/src_ipc4_int32_21_20_4167_5000.h index 1511079ef865..e1476e94177a 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_4167_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_20_4167_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_4167_5000_fir[1260] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_4535_5000.h b/src/audio/src/src/src_ipc4_int32_21_20_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_21_20_4535_5000.h index 2a9cc7a4bdaf..603779985693 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_20_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_20_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_4535_5000_fir[2268] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_2_3239_5000.h b/src/audio/src/src/src_ipc4_int32_21_2_3239_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_2_3239_5000.h rename to src/audio/src/src/src_ipc4_int32_21_2_3239_5000.h index f64f91cda9b6..0dec16ed1041 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_2_3239_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_2_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_2_3239_5000_fir[672] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_32_4535_5000.h b/src/audio/src/src/src_ipc4_int32_21_32_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_32_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_21_32_4535_5000.h index a8f8d8a032c8..445cba531dbd 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_32_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_32_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_32_4535_5000_fir[3612] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_40_2381_5000.h b/src/audio/src/src/src_ipc4_int32_21_40_2381_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_40_2381_5000.h rename to src/audio/src/src/src_ipc4_int32_21_40_2381_5000.h index 41bbf11c3a08..654a37afa02a 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_40_2381_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_40_2381_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_40_2381_5000_fir[924] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_40_3968_5000.h b/src/audio/src/src/src_ipc4_int32_21_40_3968_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_40_3968_5000.h rename to src/audio/src/src/src_ipc4_int32_21_40_3968_5000.h index 66b78a30d922..63b0727e24c5 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_40_3968_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_40_3968_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_40_3968_5000_fir[1680] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_4_1080_5000.h b/src/audio/src/src/src_ipc4_int32_21_4_1080_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_4_1080_5000.h rename to src/audio/src/src/src_ipc4_int32_21_4_1080_5000.h index 6b183e05633f..f22d15eca1bf 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_4_1080_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_4_1080_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_4_1080_5000_fir[336] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_4_3239_5000.h b/src/audio/src/src/src_ipc4_int32_21_4_3239_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_4_3239_5000.h rename to src/audio/src/src/src_ipc4_int32_21_4_3239_5000.h index 18b2cb0702e6..6c4d3524e4dc 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_4_3239_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_4_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_4_3239_5000_fir[672] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_5_1728_5000.h b/src/audio/src/src/src_ipc4_int32_21_5_1728_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_5_1728_5000.h rename to src/audio/src/src/src_ipc4_int32_21_5_1728_5000.h index 95cdfda00bdf..8d5e1920f9c1 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_5_1728_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_5_1728_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_5_1728_5000_fir[420] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_5_4535_5000.h b/src/audio/src/src/src_ipc4_int32_21_5_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_5_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_21_5_4535_5000.h index ae1996ab8df3..4f4d101eb8e4 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_5_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_5_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_5_4535_5000_fir[2184] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_80_3968_5000.h b/src/audio/src/src/src_ipc4_int32_21_80_3968_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_80_3968_5000.h rename to src/audio/src/src/src_ipc4_int32_21_80_3968_5000.h index 4d20797dfb87..e2a51e917c54 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_80_3968_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_80_3968_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_80_3968_5000_fir[3360] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_2160_5000.h b/src/audio/src/src/src_ipc4_int32_21_8_2160_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_2160_5000.h rename to src/audio/src/src/src_ipc4_int32_21_8_2160_5000.h index da333448465a..860c7d00c3b5 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_2160_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_8_2160_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_8_2160_5000_fir[420] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_3239_5000.h b/src/audio/src/src/src_ipc4_int32_21_8_3239_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_3239_5000.h rename to src/audio/src/src/src_ipc4_int32_21_8_3239_5000.h index 748d19d4df8e..b6568d54b125 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_3239_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_8_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_8_3239_5000_fir[672] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_4535_5000.h b/src/audio/src/src/src_ipc4_int32_21_8_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_21_8_4535_5000.h index 43c10ee4f0b5..d2d853e7af50 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_21_8_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_21_8_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_8_4535_5000_fir[2436] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2268_5000.h b/src/audio/src/src/src_ipc4_int32_2_1_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2268_5000.h rename to src/audio/src/src/src_ipc4_int32_2_1_2268_5000.h index bce5bd4c6c05..09c3bff531dd 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2268_5000.h +++ b/src/audio/src/src/src_ipc4_int32_2_1_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_2268_5000_fir[48] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2500_5000.h b/src/audio/src/src/src_ipc4_int32_2_1_2500_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2500_5000.h rename to src/audio/src/src/src_ipc4_int32_2_1_2500_5000.h index 021876ed8312..83488544fdf0 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2500_5000.h +++ b/src/audio/src/src/src_ipc4_int32_2_1_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_2500_5000_fir[40] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2721_5000.h b/src/audio/src/src/src_ipc4_int32_2_1_2721_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2721_5000.h rename to src/audio/src/src/src_ipc4_int32_2_1_2721_5000.h index 693de6c34e28..20de3bfeb5a3 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_2721_5000.h +++ b/src/audio/src/src/src_ipc4_int32_2_1_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_2721_5000_fir[48] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_3401_5000.h b/src/audio/src/src/src_ipc4_int32_2_1_3401_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_3401_5000.h rename to src/audio/src/src/src_ipc4_int32_2_1_3401_5000.h index cbf4b40708e5..9dd605d6e52a 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_3401_5000.h +++ b/src/audio/src/src/src_ipc4_int32_2_1_3401_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_3401_5000_fir[72] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_4535_5000.h b/src/audio/src/src/src_ipc4_int32_2_1_4535_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_2_1_4535_5000.h index ec672dfd00be..732ef897a283 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_1_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_2_1_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_4535_5000_fir[240] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_3_4535_5000.h b/src/audio/src/src/src_ipc4_int32_2_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_2_3_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_2_3_4535_5000.h index 513075e3ff2e..79eb8611a146 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_2_3_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_2_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_3_4535_5000_fir[264] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_32_21_4535_5000.h b/src/audio/src/src/src_ipc4_int32_32_21_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_32_21_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_32_21_4535_5000.h index 92ab6b6e75e9..df6eef20aeae 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_32_21_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_32_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_32_21_4535_5000_fir[3840] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_1_2268_5000.h b/src/audio/src/src/src_ipc4_int32_3_1_2268_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_3_1_2268_5000.h rename to src/audio/src/src/src_ipc4_int32_3_1_2268_5000.h index dec77767fb6f..5edce0ac9d2d 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_1_2268_5000.h +++ b/src/audio/src/src/src_ipc4_int32_3_1_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_1_2268_5000_fir[72] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_1_4535_5000.h b/src/audio/src/src/src_ipc4_int32_3_1_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_3_1_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_3_1_4535_5000.h index 488055f17f1d..eee1b3a17b92 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_1_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_3_1_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_1_4535_5000_fir[336] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_2_4535_5000.h b/src/audio/src/src/src_ipc4_int32_3_2_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_3_2_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_3_2_4535_5000.h index e1beb7178778..815f41b7bc60 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_2_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_3_2_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_2_4535_5000_fir[324] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_4_4535_5000.h b/src/audio/src/src/src_ipc4_int32_3_4_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_3_4_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_3_4_4535_5000.h index 9be2b9b6a3f4..1c4a33a25539 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_3_4_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_3_4_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_4_4535_5000_fir[360] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_2381_5000.h b/src/audio/src/src/src_ipc4_int32_40_21_2381_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_2381_5000.h rename to src/audio/src/src/src_ipc4_int32_40_21_2381_5000.h index 757fee8933dc..cec8b5f212fe 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_2381_5000.h +++ b/src/audio/src/src/src_ipc4_int32_40_21_2381_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_40_21_2381_5000_fir[960] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_2976_5000.h b/src/audio/src/src/src_ipc4_int32_40_21_2976_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_2976_5000.h rename to src/audio/src/src/src_ipc4_int32_40_21_2976_5000.h index 9fbb7a8f57de..df32a455a27c 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_2976_5000.h +++ b/src/audio/src/src/src_ipc4_int32_40_21_2976_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_40_21_2976_5000_fir[1120] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_3968_5000.h b/src/audio/src/src/src_ipc4_int32_40_21_3968_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_3968_5000.h rename to src/audio/src/src/src_ipc4_int32_40_21_3968_5000.h index 021b6075ac39..31d57d112ddc 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_21_3968_5000.h +++ b/src/audio/src/src/src_ipc4_int32_40_21_3968_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_40_21_3968_5000_fir[2080] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_7_2976_5000.h b/src/audio/src/src/src_ipc4_int32_40_7_2976_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_40_7_2976_5000.h rename to src/audio/src/src/src_ipc4_int32_40_7_2976_5000.h index 5058110df7be..da0467c3c147 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_40_7_2976_5000.h +++ b/src/audio/src/src/src_ipc4_int32_40_7_2976_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_40_7_2976_5000_fir[1120] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_1134_5000.h b/src/audio/src/src/src_ipc4_int32_4_1_1134_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_1134_5000.h rename to src/audio/src/src/src_ipc4_int32_4_1_1134_5000.h index 45dfaa500a92..a6698dac6739 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_1134_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_1_1134_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_1_1134_5000_fir[64] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_1512_5000.h b/src/audio/src/src/src_ipc4_int32_4_1_1512_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_1512_5000.h rename to src/audio/src/src/src_ipc4_int32_4_1_1512_5000.h index 67a6f4e65363..0f5b9d267505 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_1512_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_1_1512_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_1_1512_5000_fir[64] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_2268_5000.h b/src/audio/src/src/src_ipc4_int32_4_1_2268_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_2268_5000.h rename to src/audio/src/src/src_ipc4_int32_4_1_2268_5000.h index fa992ea0fc89..2caa64654899 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_2268_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_1_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_1_2268_5000_fir[80] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_4535_5000.h b/src/audio/src/src/src_ipc4_int32_4_1_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_4_1_4535_5000.h index db0a1f73fbae..efb70988f749 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_1_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_1_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_1_4535_5000_fir[416] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_21_1080_5000.h b/src/audio/src/src/src_ipc4_int32_4_21_1080_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_21_1080_5000.h rename to src/audio/src/src/src_ipc4_int32_4_21_1080_5000.h index 85e550434456..7b5a30d154b2 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_21_1080_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_21_1080_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_21_1080_5000_fir[224] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_21_3239_5000.h b/src/audio/src/src/src_ipc4_int32_4_21_3239_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_21_3239_5000.h rename to src/audio/src/src/src_ipc4_int32_4_21_3239_5000.h index 06b3e92c97da..1b876606df53 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_21_3239_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_21_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_21_3239_5000_fir[512] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_3_4535_5000.h b/src/audio/src/src/src_ipc4_int32_4_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_4_3_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_4_3_4535_5000.h index 472e6cb9b2ce..84ab1b359e7b 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_4_3_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_4_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_3_4535_5000_fir[432] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_5_21_1728_5000.h b/src/audio/src/src/src_ipc4_int32_5_21_1728_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_5_21_1728_5000.h rename to src/audio/src/src/src_ipc4_int32_5_21_1728_5000.h index dc6d468dd22f..226e1a6216af 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_5_21_1728_5000.h +++ b/src/audio/src/src/src_ipc4_int32_5_21_1728_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_5_21_1728_5000_fir[320] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_5_21_4535_5000.h b/src/audio/src/src/src_ipc4_int32_5_21_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_5_21_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_5_21_4535_5000.h index e7b58e37f993..290d409fd00d 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_5_21_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_5_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_5_21_4535_5000_fir[1740] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_5_7_4535_5000.h b/src/audio/src/src/src_ipc4_int32_5_7_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_5_7_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_5_7_4535_5000.h index 271b6d9e8e28..f8314556a665 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_5_7_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_5_7_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_5_7_4535_5000_fir[680] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_6_1_1134_5000.h b/src/audio/src/src/src_ipc4_int32_6_1_1134_5000.h similarity index 97% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_6_1_1134_5000.h rename to src/audio/src/src/src_ipc4_int32_6_1_1134_5000.h index 006678f426a8..ddf6e0c51bde 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_6_1_1134_5000.h +++ b/src/audio/src/src/src_ipc4_int32_6_1_1134_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_6_1_1134_5000_fir[96] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_3_4535_5000.h b/src/audio/src/src/src_ipc4_int32_7_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_7_3_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_7_3_4535_5000.h index 33a58e2228ec..1b40753e77d7 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_3_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_7_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_3_4535_5000_fir[728] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_5_4535_5000.h b/src/audio/src/src/src_ipc4_int32_7_5_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_7_5_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_7_5_4535_5000.h index 3704f52287df..0e7ecf543842 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_5_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_7_5_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_5_4535_5000_fir[812] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_1361_5000.h b/src/audio/src/src/src_ipc4_int32_7_8_1361_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_1361_5000.h rename to src/audio/src/src/src_ipc4_int32_7_8_1361_5000.h index b21195f8e7d8..d5a31e8fa3d4 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_1361_5000.h +++ b/src/audio/src/src/src_ipc4_int32_7_8_1361_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_8_1361_5000_fir[140] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_2468_5000.h b/src/audio/src/src/src_ipc4_int32_7_8_2468_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_2468_5000.h rename to src/audio/src/src/src_ipc4_int32_7_8_2468_5000.h index 5dc8df90db50..c68546b258d9 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_2468_5000.h +++ b/src/audio/src/src/src_ipc4_int32_7_8_2468_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_8_2468_5000_fir[196] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_2721_5000.h b/src/audio/src/src/src_ipc4_int32_7_8_2721_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_2721_5000.h rename to src/audio/src/src/src_ipc4_int32_7_8_2721_5000.h index 3bbf0802f8ed..3c7c02ecbc3d 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_2721_5000.h +++ b/src/audio/src/src/src_ipc4_int32_7_8_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_8_2721_5000_fir[224] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_4535_5000.h b/src/audio/src/src/src_ipc4_int32_7_8_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_7_8_4535_5000.h index 05b14977a701..3037d3dd258e 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_7_8_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_7_8_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_8_4535_5000_fir[840] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_2160_5000.h b/src/audio/src/src/src_ipc4_int32_8_21_2160_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_2160_5000.h rename to src/audio/src/src/src_ipc4_int32_8_21_2160_5000.h index 09735d1a5eff..c687495d433d 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_2160_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_21_2160_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_21_2160_5000_fir[384] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_3239_5000.h b/src/audio/src/src/src_ipc4_int32_8_21_3239_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_3239_5000.h rename to src/audio/src/src/src_ipc4_int32_8_21_3239_5000.h index 34df502e0431..4bc6f351e350 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_3239_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_21_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_21_3239_5000_fir[544] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_4535_5000.h b/src/audio/src/src/src_ipc4_int32_8_21_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_8_21_4535_5000.h index 1e923f32b334..d61a7d09d215 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_21_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_21_4535_5000_fir[1984] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_1361_5000.h b/src/audio/src/src/src_ipc4_int32_8_7_1361_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_1361_5000.h rename to src/audio/src/src/src_ipc4_int32_8_7_1361_5000.h index 2ac3837f35a3..a0746b412434 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_1361_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_7_1361_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_1361_5000_fir[160] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_2468_5000.h b/src/audio/src/src/src_ipc4_int32_8_7_2468_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_2468_5000.h rename to src/audio/src/src/src_ipc4_int32_8_7_2468_5000.h index 9e04cea51d53..01b479c08705 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_2468_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_7_2468_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_2468_5000_fir[192] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_2721_5000.h b/src/audio/src/src/src_ipc4_int32_8_7_2721_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_2721_5000.h rename to src/audio/src/src/src_ipc4_int32_8_7_2721_5000.h index 40ff2e3b153e..921abdb6b94d 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_2721_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_7_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_2721_5000_fir[192] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_4082_5000.h b/src/audio/src/src/src_ipc4_int32_8_7_4082_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_4082_5000.h rename to src/audio/src/src/src_ipc4_int32_8_7_4082_5000.h index 6d58cd3f2a4c..7a5b0ec6b469 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_4082_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_7_4082_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_4082_5000_fir[480] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_4535_5000.h b/src/audio/src/src/src_ipc4_int32_8_7_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_4535_5000.h rename to src/audio/src/src/src_ipc4_int32_8_7_4535_5000.h index b5d8f6e0dec5..51b0c1dc13df 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_8_7_4535_5000.h +++ b/src/audio/src/src/src_ipc4_int32_8_7_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_4535_5000_fir[896] = { diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_define.h b/src/audio/src/src/src_ipc4_int32_define.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_define.h rename to src/audio/src/src/src_ipc4_int32_define.h diff --git a/src/include/sof/audio/coefficients/src/src_ipc4_int32_table.h b/src/audio/src/src/src_ipc4_int32_table.h similarity index 60% rename from src/include/sof/audio/coefficients/src/src_ipc4_int32_table.h rename to src/audio/src/src/src_ipc4_int32_table.h index 1530b9f9d442..23a470ad7025 100644 --- a/src/include/sof/audio/coefficients/src/src_ipc4_int32_table.h +++ b/src/audio/src/src/src_ipc4_int32_table.h @@ -10,94 +10,94 @@ #define __SOF_AUDIO_COEFFICIENTS_SRC_SRC_IPC4_INT32_TABLE_H__ /* SRC conversions */ -#include <sof/audio/coefficients/src/src_ipc4_int32_1_2_2268_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_2_2500_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_2_2721_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_2_3401_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_2_3887_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_2_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_3_2268_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_4_1512_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_4_2268_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_4_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_1_6_1134_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_2_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_2_1_2500_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_2_1_2721_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_2_1_3401_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_2_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_2_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_3_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_3_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_3_2_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_3_4_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_1_1134_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_1_1512_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_21_1080_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_4_21_3239_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_5_7_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_5_21_1728_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_5_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_6_1_1134_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_7_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_7_5_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_7_8_1361_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_7_8_2468_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_7_8_2721_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_7_8_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_7_1361_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_7_2468_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_7_2721_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_7_4082_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_7_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_21_2160_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_21_3239_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_8_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_10_9_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_10_21_2500_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_10_21_3455_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_10_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_16_7_4082_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_16_21_4319_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_16_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_20_7_2976_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_20_21_1250_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_20_21_2500_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_20_21_3125_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_20_21_4167_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_20_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_2_3239_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_4_1080_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_4_3239_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_5_1728_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_5_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_8_2160_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_8_3239_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_8_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_10_2500_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_10_3455_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_10_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_16_4319_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_16_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_20_1250_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_20_2500_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_20_3125_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_20_4167_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_20_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_32_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_40_2381_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_40_3968_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_21_80_3968_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_32_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_40_7_2976_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_40_21_2381_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_40_21_2976_5000.h> -#include <sof/audio/coefficients/src/src_ipc4_int32_40_21_3968_5000.h> -#include <sof/audio/src/src.h> +#include "src_ipc4_int32_1_2_2268_5000.h" +#include "src_ipc4_int32_1_2_2500_5000.h" +#include "src_ipc4_int32_1_2_2721_5000.h" +#include "src_ipc4_int32_1_2_3401_5000.h" +#include "src_ipc4_int32_1_2_3887_5000.h" +#include "src_ipc4_int32_1_2_4535_5000.h" +#include "src_ipc4_int32_1_3_2268_5000.h" +#include "src_ipc4_int32_1_3_4535_5000.h" +#include "src_ipc4_int32_1_4_1512_5000.h" +#include "src_ipc4_int32_1_4_2268_5000.h" +#include "src_ipc4_int32_1_4_4535_5000.h" +#include "src_ipc4_int32_1_6_1134_5000.h" +#include "src_ipc4_int32_2_1_2268_5000.h" +#include "src_ipc4_int32_2_1_2500_5000.h" +#include "src_ipc4_int32_2_1_2721_5000.h" +#include "src_ipc4_int32_2_1_3401_5000.h" +#include "src_ipc4_int32_2_1_4535_5000.h" +#include "src_ipc4_int32_2_3_4535_5000.h" +#include "src_ipc4_int32_3_1_2268_5000.h" +#include "src_ipc4_int32_3_1_4535_5000.h" +#include "src_ipc4_int32_3_2_4535_5000.h" +#include "src_ipc4_int32_3_4_4535_5000.h" +#include "src_ipc4_int32_4_1_1134_5000.h" +#include "src_ipc4_int32_4_1_1512_5000.h" +#include "src_ipc4_int32_4_1_2268_5000.h" +#include "src_ipc4_int32_4_1_4535_5000.h" +#include "src_ipc4_int32_4_3_4535_5000.h" +#include "src_ipc4_int32_4_21_1080_5000.h" +#include "src_ipc4_int32_4_21_3239_5000.h" +#include "src_ipc4_int32_5_7_4535_5000.h" +#include "src_ipc4_int32_5_21_1728_5000.h" +#include "src_ipc4_int32_5_21_4535_5000.h" +#include "src_ipc4_int32_6_1_1134_5000.h" +#include "src_ipc4_int32_7_3_4535_5000.h" +#include "src_ipc4_int32_7_5_4535_5000.h" +#include "src_ipc4_int32_7_8_1361_5000.h" +#include "src_ipc4_int32_7_8_2468_5000.h" +#include "src_ipc4_int32_7_8_2721_5000.h" +#include "src_ipc4_int32_7_8_4535_5000.h" +#include "src_ipc4_int32_8_7_1361_5000.h" +#include "src_ipc4_int32_8_7_2468_5000.h" +#include "src_ipc4_int32_8_7_2721_5000.h" +#include "src_ipc4_int32_8_7_4082_5000.h" +#include "src_ipc4_int32_8_7_4535_5000.h" +#include "src_ipc4_int32_8_21_2160_5000.h" +#include "src_ipc4_int32_8_21_3239_5000.h" +#include "src_ipc4_int32_8_21_4535_5000.h" +#include "src_ipc4_int32_10_9_4535_5000.h" +#include "src_ipc4_int32_10_21_2500_5000.h" +#include "src_ipc4_int32_10_21_3455_5000.h" +#include "src_ipc4_int32_10_21_4535_5000.h" +#include "src_ipc4_int32_16_7_4082_5000.h" +#include "src_ipc4_int32_16_21_4319_5000.h" +#include "src_ipc4_int32_16_21_4535_5000.h" +#include "src_ipc4_int32_20_7_2976_5000.h" +#include "src_ipc4_int32_20_21_1250_5000.h" +#include "src_ipc4_int32_20_21_2500_5000.h" +#include "src_ipc4_int32_20_21_3125_5000.h" +#include "src_ipc4_int32_20_21_4167_5000.h" +#include "src_ipc4_int32_20_21_4535_5000.h" +#include "src_ipc4_int32_21_2_3239_5000.h" +#include "src_ipc4_int32_21_4_1080_5000.h" +#include "src_ipc4_int32_21_4_3239_5000.h" +#include "src_ipc4_int32_21_5_1728_5000.h" +#include "src_ipc4_int32_21_5_4535_5000.h" +#include "src_ipc4_int32_21_8_2160_5000.h" +#include "src_ipc4_int32_21_8_3239_5000.h" +#include "src_ipc4_int32_21_8_4535_5000.h" +#include "src_ipc4_int32_21_10_2500_5000.h" +#include "src_ipc4_int32_21_10_3455_5000.h" +#include "src_ipc4_int32_21_10_4535_5000.h" +#include "src_ipc4_int32_21_16_4319_5000.h" +#include "src_ipc4_int32_21_16_4535_5000.h" +#include "src_ipc4_int32_21_20_1250_5000.h" +#include "src_ipc4_int32_21_20_2500_5000.h" +#include "src_ipc4_int32_21_20_3125_5000.h" +#include "src_ipc4_int32_21_20_4167_5000.h" +#include "src_ipc4_int32_21_20_4535_5000.h" +#include "src_ipc4_int32_21_32_4535_5000.h" +#include "src_ipc4_int32_21_40_2381_5000.h" +#include "src_ipc4_int32_21_40_3968_5000.h" +#include "src_ipc4_int32_21_80_3968_5000.h" +#include "src_ipc4_int32_32_21_4535_5000.h" +#include "src_ipc4_int32_40_7_2976_5000.h" +#include "src_ipc4_int32_40_21_2381_5000.h" +#include "src_ipc4_int32_40_21_2976_5000.h" +#include "src_ipc4_int32_40_21_3968_5000.h" +#include "../src.h" #include <stdint.h> /* SRC table */ diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_1_2_2268_5000.h b/src/audio/src/src/src_small_int32_1_2_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_small_int32_1_2_2268_5000.h rename to src/audio/src/src/src_small_int32_1_2_2268_5000.h index 303d9f2520fc..e71ef83a079e 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_1_2_2268_5000.h +++ b/src/audio/src/src/src_small_int32_1_2_2268_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_2268_5000_fir[40] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_1_2_4535_5000.h b/src/audio/src/src/src_small_int32_1_2_4535_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_small_int32_1_2_4535_5000.h rename to src/audio/src/src/src_small_int32_1_2_4535_5000.h index 928e3448d58a..9a207cfc4a78 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_1_2_4535_5000.h +++ b/src/audio/src/src/src_small_int32_1_2_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_4535_5000_fir[200] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_1_3_2268_5000.h b/src/audio/src/src/src_small_int32_1_3_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_small_int32_1_3_2268_5000.h rename to src/audio/src/src/src_small_int32_1_3_2268_5000.h index f85f893ff16b..22114da5f961 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_1_3_2268_5000.h +++ b/src/audio/src/src/src_small_int32_1_3_2268_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_3_2268_5000_fir[56] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_1_3_4535_5000.h b/src/audio/src/src/src_small_int32_1_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_1_3_4535_5000.h rename to src/audio/src/src/src_small_int32_1_3_4535_5000.h index 972926179ed2..40d2c1d57b00 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_1_3_4535_5000.h +++ b/src/audio/src/src/src_small_int32_1_3_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_1_3_4535_5000_fir[268] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_20_21_4167_5000.h b/src/audio/src/src/src_small_int32_20_21_4167_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_20_21_4167_5000.h rename to src/audio/src/src/src_small_int32_20_21_4167_5000.h index 4d674379a2f3..5ba424809efe 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_20_21_4167_5000.h +++ b/src/audio/src/src/src_small_int32_20_21_4167_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_4167_5000_fir[1120] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_21_20_4167_5000.h b/src/audio/src/src/src_small_int32_21_20_4167_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_21_20_4167_5000.h rename to src/audio/src/src/src_small_int32_21_20_4167_5000.h index e952c70e4a01..5280f529fb30 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_21_20_4167_5000.h +++ b/src/audio/src/src/src_small_int32_21_20_4167_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_4167_5000_fir[1092] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_2_1_2268_5000.h b/src/audio/src/src/src_small_int32_2_1_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_small_int32_2_1_2268_5000.h rename to src/audio/src/src/src_small_int32_2_1_2268_5000.h index 494c2e75676a..3b727a0d782b 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_2_1_2268_5000.h +++ b/src/audio/src/src/src_small_int32_2_1_2268_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_2268_5000_fir[40] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_2_1_4535_5000.h b/src/audio/src/src/src_small_int32_2_1_4535_5000.h similarity index 98% rename from src/include/sof/audio/coefficients/src/src_small_int32_2_1_4535_5000.h rename to src/audio/src/src/src_small_int32_2_1_4535_5000.h index 200de76bf2b1..4d2d75ec328b 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_2_1_4535_5000.h +++ b/src/audio/src/src/src_small_int32_2_1_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_4535_5000_fir[200] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_2_3_4535_5000.h b/src/audio/src/src/src_small_int32_2_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_2_3_4535_5000.h rename to src/audio/src/src/src_small_int32_2_3_4535_5000.h index 206f0a03a635..b6b464f6b4bf 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_2_3_4535_5000.h +++ b/src/audio/src/src/src_small_int32_2_3_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_2_3_4535_5000_fir[272] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_3_1_2268_5000.h b/src/audio/src/src/src_small_int32_3_1_2268_5000.h similarity index 96% rename from src/include/sof/audio/coefficients/src/src_small_int32_3_1_2268_5000.h rename to src/audio/src/src/src_small_int32_3_1_2268_5000.h index e6f4bc6216ea..8b79acf94a6e 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_3_1_2268_5000.h +++ b/src/audio/src/src/src_small_int32_3_1_2268_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_1_2268_5000_fir[60] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_3_1_4535_5000.h b/src/audio/src/src/src_small_int32_3_1_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_3_1_4535_5000.h rename to src/audio/src/src/src_small_int32_3_1_4535_5000.h index 306409d4d04e..33ebefc04653 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_3_1_4535_5000.h +++ b/src/audio/src/src/src_small_int32_3_1_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_1_4535_5000_fir[276] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_3_2_4535_5000.h b/src/audio/src/src/src_small_int32_3_2_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_3_2_4535_5000.h rename to src/audio/src/src/src_small_int32_3_2_4535_5000.h index 42f56dd77c6c..668947ceb7e6 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_3_2_4535_5000.h +++ b/src/audio/src/src/src_small_int32_3_2_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_2_4535_5000_fir[276] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_3_4_4535_5000.h b/src/audio/src/src/src_small_int32_3_4_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_3_4_4535_5000.h rename to src/audio/src/src/src_small_int32_3_4_4535_5000.h index f930daf54992..b6527580c8f2 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_3_4_4535_5000.h +++ b/src/audio/src/src/src_small_int32_3_4_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_3_4_4535_5000_fir[348] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_4_3_4535_5000.h b/src/audio/src/src/src_small_int32_4_3_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_4_3_4535_5000.h rename to src/audio/src/src/src_small_int32_4_3_4535_5000.h index 3505f63d196b..5266ca1448c9 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_4_3_4535_5000.h +++ b/src/audio/src/src/src_small_int32_4_3_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_3_4535_5000_fir[352] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_4_5_4535_5000.h b/src/audio/src/src/src_small_int32_4_5_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_4_5_4535_5000.h rename to src/audio/src/src/src_small_int32_4_5_4535_5000.h index 9af3feb400ec..4eca45e3d5f8 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_4_5_4535_5000.h +++ b/src/audio/src/src/src_small_int32_4_5_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_4_5_4535_5000_fir[448] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_5_4_4535_5000.h b/src/audio/src/src/src_small_int32_5_4_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_5_4_4535_5000.h rename to src/audio/src/src/src_small_int32_5_4_4535_5000.h index d608c8f5c0e1..79240798db05 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_5_4_4535_5000.h +++ b/src/audio/src/src/src_small_int32_5_4_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_5_4_4535_5000_fir[440] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_5_6_4354_5000.h b/src/audio/src/src/src_small_int32_5_6_4354_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_5_6_4354_5000.h rename to src/audio/src/src/src_small_int32_5_6_4354_5000.h index 51a71506d803..a34c3d2d7c1f 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_5_6_4354_5000.h +++ b/src/audio/src/src/src_small_int32_5_6_4354_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_5_6_4354_5000_fir[380] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_6_5_4354_5000.h b/src/audio/src/src/src_small_int32_6_5_4354_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_6_5_4354_5000.h rename to src/audio/src/src/src_small_int32_6_5_4354_5000.h index 3ebd2e13b4c3..1cb91867ff13 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_6_5_4354_5000.h +++ b/src/audio/src/src/src_small_int32_6_5_4354_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_6_5_4354_5000_fir[384] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_7_8_4535_5000.h b/src/audio/src/src/src_small_int32_7_8_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_7_8_4535_5000.h rename to src/audio/src/src/src_small_int32_7_8_4535_5000.h index 5dd8e49e4e59..537a4e1d63ca 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_7_8_4535_5000.h +++ b/src/audio/src/src/src_small_int32_7_8_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_7_8_4535_5000_fir[644] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_8_7_4535_5000.h b/src/audio/src/src/src_small_int32_8_7_4535_5000.h similarity index 99% rename from src/include/sof/audio/coefficients/src/src_small_int32_8_7_4535_5000.h rename to src/audio/src/src/src_small_int32_8_7_4535_5000.h index ed965a4e762d..fda7bb6c4e41 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_8_7_4535_5000.h +++ b/src/audio/src/src/src_small_int32_8_7_4535_5000.h @@ -4,7 +4,7 @@ * */ -#include <sof/audio/src/src.h> +#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_4535_5000_fir[640] = { diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_define.h b/src/audio/src/src/src_small_int32_define.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_small_int32_define.h rename to src/audio/src/src/src_small_int32_define.h diff --git a/src/include/sof/audio/coefficients/src/src_small_int32_table.h b/src/audio/src/src/src_small_int32_table.h similarity index 68% rename from src/include/sof/audio/coefficients/src/src_small_int32_table.h rename to src/audio/src/src/src_small_int32_table.h index 57af8877185c..2fd22a6372f3 100644 --- a/src/include/sof/audio/coefficients/src/src_small_int32_table.h +++ b/src/audio/src/src/src_small_int32_table.h @@ -8,27 +8,27 @@ #define __SOF_AUDIO_COEFFICIENTS_SRC_SRC_SMALL_INT32_TABLE_H__ /* SRC conversions */ -#include <sof/audio/coefficients/src/src_small_int32_1_2_2268_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_1_2_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_1_3_2268_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_1_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_2_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_2_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_2_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_3_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_3_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_3_2_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_3_4_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_4_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_4_5_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_5_4_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_5_6_4354_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_6_5_4354_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_7_8_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_8_7_4535_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_20_21_4167_5000.h> -#include <sof/audio/coefficients/src/src_small_int32_21_20_4167_5000.h> -#include <sof/audio/src/src.h> +#include "src_small_int32_1_2_2268_5000.h" +#include "src_small_int32_1_2_4535_5000.h" +#include "src_small_int32_1_3_2268_5000.h" +#include "src_small_int32_1_3_4535_5000.h" +#include "src_small_int32_2_1_2268_5000.h" +#include "src_small_int32_2_1_4535_5000.h" +#include "src_small_int32_2_3_4535_5000.h" +#include "src_small_int32_3_1_2268_5000.h" +#include "src_small_int32_3_1_4535_5000.h" +#include "src_small_int32_3_2_4535_5000.h" +#include "src_small_int32_3_4_4535_5000.h" +#include "src_small_int32_4_3_4535_5000.h" +#include "src_small_int32_4_5_4535_5000.h" +#include "src_small_int32_5_4_4535_5000.h" +#include "src_small_int32_5_6_4354_5000.h" +#include "src_small_int32_6_5_4354_5000.h" +#include "src_small_int32_7_8_4535_5000.h" +#include "src_small_int32_8_7_4535_5000.h" +#include "src_small_int32_20_21_4167_5000.h" +#include "src_small_int32_21_20_4167_5000.h" +#include "../src.h" #include <stdint.h> /* SRC table */ diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_10_21_4535_5000.h b/src/audio/src/src/src_std_int32_10_21_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_10_21_4535_5000.h rename to src/audio/src/src/src_std_int32_10_21_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_1_2_2268_5000.h b/src/audio/src/src/src_std_int32_1_2_2268_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_1_2_2268_5000.h rename to src/audio/src/src/src_std_int32_1_2_2268_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_1_2_4535_5000.h b/src/audio/src/src/src_std_int32_1_2_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_1_2_4535_5000.h rename to src/audio/src/src/src_std_int32_1_2_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_1_3_2268_5000.h b/src/audio/src/src/src_std_int32_1_3_2268_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_1_3_2268_5000.h rename to src/audio/src/src/src_std_int32_1_3_2268_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_1_3_4535_5000.h b/src/audio/src/src/src_std_int32_1_3_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_1_3_4535_5000.h rename to src/audio/src/src/src_std_int32_1_3_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_20_21_4167_5000.h b/src/audio/src/src/src_std_int32_20_21_4167_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_20_21_4167_5000.h rename to src/audio/src/src/src_std_int32_20_21_4167_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_20_7_2976_5000.h b/src/audio/src/src/src_std_int32_20_7_2976_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_20_7_2976_5000.h rename to src/audio/src/src/src_std_int32_20_7_2976_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_21_20_4167_5000.h b/src/audio/src/src/src_std_int32_21_20_4167_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_21_20_4167_5000.h rename to src/audio/src/src/src_std_int32_21_20_4167_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_21_40_3968_5000.h b/src/audio/src/src/src_std_int32_21_40_3968_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_21_40_3968_5000.h rename to src/audio/src/src/src_std_int32_21_40_3968_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_21_80_3968_5000.h b/src/audio/src/src/src_std_int32_21_80_3968_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_21_80_3968_5000.h rename to src/audio/src/src/src_std_int32_21_80_3968_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_2_1_2268_5000.h b/src/audio/src/src/src_std_int32_2_1_2268_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_2_1_2268_5000.h rename to src/audio/src/src/src_std_int32_2_1_2268_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_2_1_4535_5000.h b/src/audio/src/src/src_std_int32_2_1_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_2_1_4535_5000.h rename to src/audio/src/src/src_std_int32_2_1_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_2_3_4535_5000.h b/src/audio/src/src/src_std_int32_2_3_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_2_3_4535_5000.h rename to src/audio/src/src/src_std_int32_2_3_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_32_21_4535_5000.h b/src/audio/src/src/src_std_int32_32_21_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_32_21_4535_5000.h rename to src/audio/src/src/src_std_int32_32_21_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_3_1_2268_5000.h b/src/audio/src/src/src_std_int32_3_1_2268_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_3_1_2268_5000.h rename to src/audio/src/src/src_std_int32_3_1_2268_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_3_1_4535_5000.h b/src/audio/src/src/src_std_int32_3_1_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_3_1_4535_5000.h rename to src/audio/src/src/src_std_int32_3_1_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_3_2_4535_5000.h b/src/audio/src/src/src_std_int32_3_2_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_3_2_4535_5000.h rename to src/audio/src/src/src_std_int32_3_2_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_3_4_4535_5000.h b/src/audio/src/src/src_std_int32_3_4_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_3_4_4535_5000.h rename to src/audio/src/src/src_std_int32_3_4_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_40_21_3968_5000.h b/src/audio/src/src/src_std_int32_40_21_3968_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_40_21_3968_5000.h rename to src/audio/src/src/src_std_int32_40_21_3968_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_4_3_4535_5000.h b/src/audio/src/src/src_std_int32_4_3_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_4_3_4535_5000.h rename to src/audio/src/src/src_std_int32_4_3_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_4_5_4535_5000.h b/src/audio/src/src/src_std_int32_4_5_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_4_5_4535_5000.h rename to src/audio/src/src/src_std_int32_4_5_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_5_4_4535_5000.h b/src/audio/src/src/src_std_int32_5_4_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_5_4_4535_5000.h rename to src/audio/src/src/src_std_int32_5_4_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_5_6_4354_5000.h b/src/audio/src/src/src_std_int32_5_6_4354_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_5_6_4354_5000.h rename to src/audio/src/src/src_std_int32_5_6_4354_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_5_7_4535_5000.h b/src/audio/src/src/src_std_int32_5_7_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_5_7_4535_5000.h rename to src/audio/src/src/src_std_int32_5_7_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_6_5_4354_5000.h b/src/audio/src/src/src_std_int32_6_5_4354_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_6_5_4354_5000.h rename to src/audio/src/src/src_std_int32_6_5_4354_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_7_8_4535_5000.h b/src/audio/src/src/src_std_int32_7_8_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_7_8_4535_5000.h rename to src/audio/src/src/src_std_int32_7_8_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_8_21_3239_5000.h b/src/audio/src/src/src_std_int32_8_21_3239_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_8_21_3239_5000.h rename to src/audio/src/src/src_std_int32_8_21_3239_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_8_7_2468_5000.h b/src/audio/src/src/src_std_int32_8_7_2468_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_8_7_2468_5000.h rename to src/audio/src/src/src_std_int32_8_7_2468_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_8_7_4535_5000.h b/src/audio/src/src/src_std_int32_8_7_4535_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_8_7_4535_5000.h rename to src/audio/src/src/src_std_int32_8_7_4535_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_define.h b/src/audio/src/src/src_std_int32_define.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_std_int32_define.h rename to src/audio/src/src/src_std_int32_define.h diff --git a/src/include/sof/audio/coefficients/src/src_std_int32_table.h b/src/audio/src/src/src_std_int32_table.h similarity index 79% rename from src/include/sof/audio/coefficients/src/src_std_int32_table.h rename to src/audio/src/src/src_std_int32_table.h index 06a7965a382c..7905e3a88745 100644 --- a/src/include/sof/audio/coefficients/src/src_std_int32_table.h +++ b/src/audio/src/src/src_std_int32_table.h @@ -9,36 +9,36 @@ #define __SOF_AUDIO_COEFFICIENTS_SRC_SRC_STD_INT32_TABLE_H__ /* SRC conversions */ -#include <sof/audio/coefficients/src/src_std_int32_1_2_2268_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_1_2_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_1_3_2268_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_1_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_2_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_2_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_2_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_3_1_2268_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_3_1_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_3_2_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_3_4_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_4_3_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_4_5_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_5_4_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_5_6_4354_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_5_7_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_6_5_4354_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_7_8_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_8_7_2468_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_8_7_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_8_21_3239_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_10_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_20_7_2976_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_20_21_4167_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_21_20_4167_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_21_40_3968_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_21_80_3968_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_32_21_4535_5000.h> -#include <sof/audio/coefficients/src/src_std_int32_40_21_3968_5000.h> -#include <sof/audio/src/src.h> +#include "src_std_int32_1_2_2268_5000.h" +#include "src_std_int32_1_2_4535_5000.h" +#include "src_std_int32_1_3_2268_5000.h" +#include "src_std_int32_1_3_4535_5000.h" +#include "src_std_int32_2_1_2268_5000.h" +#include "src_std_int32_2_1_4535_5000.h" +#include "src_std_int32_2_3_4535_5000.h" +#include "src_std_int32_3_1_2268_5000.h" +#include "src_std_int32_3_1_4535_5000.h" +#include "src_std_int32_3_2_4535_5000.h" +#include "src_std_int32_3_4_4535_5000.h" +#include "src_std_int32_4_3_4535_5000.h" +#include "src_std_int32_4_5_4535_5000.h" +#include "src_std_int32_5_4_4535_5000.h" +#include "src_std_int32_5_6_4354_5000.h" +#include "src_std_int32_5_7_4535_5000.h" +#include "src_std_int32_6_5_4354_5000.h" +#include "src_std_int32_7_8_4535_5000.h" +#include "src_std_int32_8_7_2468_5000.h" +#include "src_std_int32_8_7_4535_5000.h" +#include "src_std_int32_8_21_3239_5000.h" +#include "src_std_int32_10_21_4535_5000.h" +#include "src_std_int32_20_7_2976_5000.h" +#include "src_std_int32_20_21_4167_5000.h" +#include "src_std_int32_21_20_4167_5000.h" +#include "src_std_int32_21_40_3968_5000.h" +#include "src_std_int32_21_80_3968_5000.h" +#include "src_std_int32_32_21_4535_5000.h" +#include "src_std_int32_40_21_3968_5000.h" +#include "../src.h" #include <stdint.h> /* SRC table */ diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_1_2_1814_5000.h b/src/audio/src/src/src_tiny_int16_1_2_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_1_2_1814_5000.h rename to src/audio/src/src/src_tiny_int16_1_2_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_1_3_1814_5000.h b/src/audio/src/src/src_tiny_int16_1_3_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_1_3_1814_5000.h rename to src/audio/src/src/src_tiny_int16_1_3_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_1_6_1814_5000.h b/src/audio/src/src/src_tiny_int16_1_6_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_1_6_1814_5000.h rename to src/audio/src/src/src_tiny_int16_1_6_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_20_21_1667_5000.h b/src/audio/src/src/src_tiny_int16_20_21_1667_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_20_21_1667_5000.h rename to src/audio/src/src/src_tiny_int16_20_21_1667_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_21_20_1667_5000.h b/src/audio/src/src/src_tiny_int16_21_20_1667_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_21_20_1667_5000.h rename to src/audio/src/src/src_tiny_int16_21_20_1667_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_24_25_1814_5000.h b/src/audio/src/src/src_tiny_int16_24_25_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_24_25_1814_5000.h rename to src/audio/src/src/src_tiny_int16_24_25_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_25_24_1814_5000.h b/src/audio/src/src/src_tiny_int16_25_24_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_25_24_1814_5000.h rename to src/audio/src/src/src_tiny_int16_25_24_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_2_1_1814_5000.h b/src/audio/src/src/src_tiny_int16_2_1_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_2_1_1814_5000.h rename to src/audio/src/src/src_tiny_int16_2_1_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_2_3_1814_5000.h b/src/audio/src/src/src_tiny_int16_2_3_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_2_3_1814_5000.h rename to src/audio/src/src/src_tiny_int16_2_3_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_3_1_1814_5000.h b/src/audio/src/src/src_tiny_int16_3_1_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_3_1_1814_5000.h rename to src/audio/src/src/src_tiny_int16_3_1_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_3_2_1814_5000.h b/src/audio/src/src/src_tiny_int16_3_2_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_3_2_1814_5000.h rename to src/audio/src/src/src_tiny_int16_3_2_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_6_1_1814_5000.h b/src/audio/src/src/src_tiny_int16_6_1_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_6_1_1814_5000.h rename to src/audio/src/src/src_tiny_int16_6_1_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_7_8_1814_5000.h b/src/audio/src/src/src_tiny_int16_7_8_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_7_8_1814_5000.h rename to src/audio/src/src/src_tiny_int16_7_8_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_8_7_1814_5000.h b/src/audio/src/src/src_tiny_int16_8_7_1814_5000.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_8_7_1814_5000.h rename to src/audio/src/src/src_tiny_int16_8_7_1814_5000.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_define.h b/src/audio/src/src/src_tiny_int16_define.h similarity index 100% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_define.h rename to src/audio/src/src/src_tiny_int16_define.h diff --git a/src/include/sof/audio/coefficients/src/src_tiny_int16_table.h b/src/audio/src/src/src_tiny_int16_table.h similarity index 75% rename from src/include/sof/audio/coefficients/src/src_tiny_int16_table.h rename to src/audio/src/src/src_tiny_int16_table.h index 4da547757cb5..f4b7b790ca24 100644 --- a/src/include/sof/audio/coefficients/src/src_tiny_int16_table.h +++ b/src/audio/src/src/src_tiny_int16_table.h @@ -9,21 +9,21 @@ #define __SOF_AUDIO_COEFFICIENTS_SRC_SRC_TINY_INT16_TABLE_H__ /* SRC conversions */ -#include <sof/audio/coefficients/src/src_tiny_int16_1_2_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_1_3_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_1_6_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_2_1_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_2_3_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_3_1_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_3_2_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_6_1_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_7_8_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_8_7_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_20_21_1667_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_21_20_1667_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_24_25_1814_5000.h> -#include <sof/audio/coefficients/src/src_tiny_int16_25_24_1814_5000.h> -#include <sof/audio/src/src.h> +#include "src_tiny_int16_1_2_1814_5000.h" +#include "src_tiny_int16_1_3_1814_5000.h" +#include "src_tiny_int16_1_6_1814_5000.h" +#include "src_tiny_int16_2_1_1814_5000.h" +#include "src_tiny_int16_2_3_1814_5000.h" +#include "src_tiny_int16_3_1_1814_5000.h" +#include "src_tiny_int16_3_2_1814_5000.h" +#include "src_tiny_int16_6_1_1814_5000.h" +#include "src_tiny_int16_7_8_1814_5000.h" +#include "src_tiny_int16_8_7_1814_5000.h" +#include "src_tiny_int16_20_21_1667_5000.h" +#include "src_tiny_int16_21_20_1667_5000.h" +#include "src_tiny_int16_24_25_1814_5000.h" +#include "src_tiny_int16_25_24_1814_5000.h" +#include "../src.h" #include <stdint.h> /* SRC table */ diff --git a/src/include/sof/audio/src/src_config.h b/src/audio/src/src_config.h similarity index 100% rename from src/include/sof/audio/src/src_config.h rename to src/audio/src/src_config.h diff --git a/src/audio/src/src_generic.c b/src/audio/src/src_generic.c index 745afc16c025..6b6661d02c66 100644 --- a/src/audio/src/src_generic.c +++ b/src/audio/src/src_generic.c @@ -8,15 +8,16 @@ * architecture. */ -#include <sof/audio/src/src_config.h> +#include "src_config.h" #if SRC_GENERIC #include <sof/audio/format.h> -#include <sof/audio/src/src.h> #include <stddef.h> #include <stdint.h> +#include "src.h" + #if SRC_SHORT /* 16 bit coefficients version */ static inline void fir_filter_generic(int32_t *rp, const void *cp, int32_t *wp0, diff --git a/src/audio/src/src_hifi2ep.c b/src/audio/src/src_hifi2ep.c index b426c622cafb..6c1e06b23d96 100644 --- a/src/audio/src/src_hifi2ep.c +++ b/src/audio/src/src_hifi2ep.c @@ -6,11 +6,12 @@ /* HiFi EP optimized code parts for SRC */ -#include <sof/audio/src/src_config.h> +#include "src_config.h" #if SRC_HIFIEP -#include <sof/audio/src/src.h> +#include "src.h" + #include <xtensa/config/defs.h> #include <xtensa/tie/xt_hifi2.h> #include <stddef.h> diff --git a/src/audio/src/src_hifi3.c b/src/audio/src/src_hifi3.c index 2811a422c05d..bd419fdbfbb1 100644 --- a/src/audio/src/src_hifi3.c +++ b/src/audio/src/src_hifi3.c @@ -6,11 +6,12 @@ /* HiFi3 optimized code parts for SRC */ -#include <sof/audio/src/src_config.h> +#include "src_config.h" #if SRC_HIFI3 -#include <sof/audio/src/src.h> +#include "src.h" + #include <xtensa/config/defs.h> #include <xtensa/tie/xt_hifi3.h> #include <stddef.h> diff --git a/src/audio/src/src_hifi4.c b/src/audio/src/src_hifi4.c index a2d2cd313a5e..9e011bf800f3 100644 --- a/src/audio/src/src_hifi4.c +++ b/src/audio/src/src_hifi4.c @@ -6,12 +6,13 @@ /* HiFi4 optimized code parts for SRC */ -#include <sof/audio/src/src_config.h> +#include "src_config.h" #if SRC_HIFI4 +#include "src.h" + #include <sof/math/numbers.h> -#include <sof/audio/src/src.h> #include <xtensa/config/defs.h> #include <xtensa/tie/xt_hifi4.h> #include <stddef.h> diff --git a/src/audio/src/src_ipc3.c b/src/audio/src/src_ipc3.c index aef12e0537a3..b2c2fbfd0930 100644 --- a/src/audio/src/src_ipc3.c +++ b/src/audio/src/src_ipc3.c @@ -13,8 +13,6 @@ #include <sof/audio/audio_stream.h> #include <sof/audio/ipc-config.h> #include <sof/audio/module_adapter/module/generic.h> -#include <sof/audio/src/src.h> -#include <sof/audio/src/src_config.h> #include <sof/audio/sink_api.h> #include <sof/audio/source_api.h> #include <sof/audio/sink_source_utils.h> @@ -40,6 +38,9 @@ #include <stdint.h> #include <limits.h> +#include "src.h" +#include "src_config.h" + /* c1c5326d-8390-46b4-aa47-95c3beca6550 */ DECLARE_SOF_RT_UUID("src", src_uuid, 0xc1c5326d, 0x8390, 0x46b4, 0xaa, 0x47, 0x95, 0xc3, 0xbe, 0xca, 0x65, 0x50); diff --git a/src/audio/src/src_ipc4.c b/src/audio/src/src_ipc4.c index 7d29ad9aeb49..8b55c10bc500 100644 --- a/src/audio/src/src_ipc4.c +++ b/src/audio/src/src_ipc4.c @@ -13,8 +13,6 @@ #include <sof/audio/audio_stream.h> #include <sof/audio/ipc-config.h> #include <sof/audio/module_adapter/module/generic.h> -#include <sof/audio/src/src.h> -#include <sof/audio/src/src_config.h> #include <sof/audio/sink_api.h> #include <sof/audio/source_api.h> #include <sof/audio/sink_source_utils.h> @@ -40,6 +38,9 @@ #include <stdint.h> #include <limits.h> +#include "src.h" +#include "src_config.h" + /* e61bb28d-149a-4c1f-b709-46823ef5f5a3 */ DECLARE_SOF_RT_UUID("src", src_uuid, 0xe61bb28d, 0x149a, 0x4c1f, 0xb7, 0x09, 0x46, 0x82, 0x3e, 0xf5, 0xf5, 0xae); From 88fdb10e522c8b064f61eef22827e3902e5dba2e Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Mon, 11 Sep 2023 09:46:59 +0800 Subject: [PATCH 355/639] audio: src: rename sample rate converter coefficient folder name rename it from src to coef to reflect the real content inside. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- .../src_ipc4_int32_10_21_2500_5000.h | 0 .../src_ipc4_int32_10_21_3455_5000.h | 0 .../src_ipc4_int32_10_21_4535_5000.h | 0 .../src_ipc4_int32_10_9_4535_5000.h | 0 .../src_ipc4_int32_16_21_4319_5000.h | 0 .../src_ipc4_int32_16_21_4535_5000.h | 0 .../src_ipc4_int32_16_7_4082_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_2_2268_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_2_2500_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_2_2721_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_2_3401_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_2_3887_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_2_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_3_2268_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_3_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_4_1512_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_4_2268_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_4_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_1_6_1134_5000.h | 0 .../src_ipc4_int32_20_21_1250_5000.h | 0 .../src_ipc4_int32_20_21_2500_5000.h | 0 .../src_ipc4_int32_20_21_3125_5000.h | 0 .../src_ipc4_int32_20_21_4167_5000.h | 0 .../src_ipc4_int32_20_21_4535_5000.h | 0 .../src_ipc4_int32_20_7_2976_5000.h | 0 .../src_ipc4_int32_21_10_2500_5000.h | 0 .../src_ipc4_int32_21_10_3455_5000.h | 0 .../src_ipc4_int32_21_10_4535_5000.h | 0 .../src_ipc4_int32_21_16_4319_5000.h | 0 .../src_ipc4_int32_21_16_4535_5000.h | 0 .../src_ipc4_int32_21_20_1250_5000.h | 0 .../src_ipc4_int32_21_20_2500_5000.h | 0 .../src_ipc4_int32_21_20_3125_5000.h | 0 .../src_ipc4_int32_21_20_4167_5000.h | 0 .../src_ipc4_int32_21_20_4535_5000.h | 0 .../src_ipc4_int32_21_2_3239_5000.h | 0 .../src_ipc4_int32_21_32_4535_5000.h | 0 .../src_ipc4_int32_21_40_2381_5000.h | 0 .../src_ipc4_int32_21_40_3968_5000.h | 0 .../src_ipc4_int32_21_4_1080_5000.h | 0 .../src_ipc4_int32_21_4_3239_5000.h | 0 .../src_ipc4_int32_21_5_1728_5000.h | 0 .../src_ipc4_int32_21_5_4535_5000.h | 0 .../src_ipc4_int32_21_80_3968_5000.h | 0 .../src_ipc4_int32_21_8_2160_5000.h | 0 .../src_ipc4_int32_21_8_3239_5000.h | 0 .../src_ipc4_int32_21_8_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_2_1_2268_5000.h | 0 .../{src => coef}/src_ipc4_int32_2_1_2500_5000.h | 0 .../{src => coef}/src_ipc4_int32_2_1_2721_5000.h | 0 .../{src => coef}/src_ipc4_int32_2_1_3401_5000.h | 0 .../{src => coef}/src_ipc4_int32_2_1_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_2_3_4535_5000.h | 0 .../src_ipc4_int32_32_21_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_3_1_2268_5000.h | 0 .../{src => coef}/src_ipc4_int32_3_1_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_3_2_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_3_4_4535_5000.h | 0 .../src_ipc4_int32_40_21_2381_5000.h | 0 .../src_ipc4_int32_40_21_2976_5000.h | 0 .../src_ipc4_int32_40_21_3968_5000.h | 0 .../src_ipc4_int32_40_7_2976_5000.h | 0 .../{src => coef}/src_ipc4_int32_4_1_1134_5000.h | 0 .../{src => coef}/src_ipc4_int32_4_1_1512_5000.h | 0 .../{src => coef}/src_ipc4_int32_4_1_2268_5000.h | 0 .../{src => coef}/src_ipc4_int32_4_1_4535_5000.h | 0 .../src_ipc4_int32_4_21_1080_5000.h | 0 .../src_ipc4_int32_4_21_3239_5000.h | 0 .../{src => coef}/src_ipc4_int32_4_3_4535_5000.h | 0 .../src_ipc4_int32_5_21_1728_5000.h | 0 .../src_ipc4_int32_5_21_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_5_7_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_6_1_1134_5000.h | 0 .../{src => coef}/src_ipc4_int32_7_3_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_7_5_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_7_8_1361_5000.h | 0 .../{src => coef}/src_ipc4_int32_7_8_2468_5000.h | 0 .../{src => coef}/src_ipc4_int32_7_8_2721_5000.h | 0 .../{src => coef}/src_ipc4_int32_7_8_4535_5000.h | 0 .../src_ipc4_int32_8_21_2160_5000.h | 0 .../src_ipc4_int32_8_21_3239_5000.h | 0 .../src_ipc4_int32_8_21_4535_5000.h | 0 .../{src => coef}/src_ipc4_int32_8_7_1361_5000.h | 0 .../{src => coef}/src_ipc4_int32_8_7_2468_5000.h | 0 .../{src => coef}/src_ipc4_int32_8_7_2721_5000.h | 0 .../{src => coef}/src_ipc4_int32_8_7_4082_5000.h | 0 .../{src => coef}/src_ipc4_int32_8_7_4535_5000.h | 0 .../src/{src => coef}/src_ipc4_int32_define.h | 0 .../src/{src => coef}/src_ipc4_int32_table.h | 0 .../src_small_int32_1_2_2268_5000.h | 0 .../src_small_int32_1_2_4535_5000.h | 0 .../src_small_int32_1_3_2268_5000.h | 0 .../src_small_int32_1_3_4535_5000.h | 0 .../src_small_int32_20_21_4167_5000.h | 0 .../src_small_int32_21_20_4167_5000.h | 0 .../src_small_int32_2_1_2268_5000.h | 0 .../src_small_int32_2_1_4535_5000.h | 0 .../src_small_int32_2_3_4535_5000.h | 0 .../src_small_int32_3_1_2268_5000.h | 0 .../src_small_int32_3_1_4535_5000.h | 0 .../src_small_int32_3_2_4535_5000.h | 0 .../src_small_int32_3_4_4535_5000.h | 0 .../src_small_int32_4_3_4535_5000.h | 0 .../src_small_int32_4_5_4535_5000.h | 0 .../src_small_int32_5_4_4535_5000.h | 0 .../src_small_int32_5_6_4354_5000.h | 0 .../src_small_int32_6_5_4354_5000.h | 0 .../src_small_int32_7_8_4535_5000.h | 0 .../src_small_int32_8_7_4535_5000.h | 0 .../src/{src => coef}/src_small_int32_define.h | 0 .../src/{src => coef}/src_small_int32_table.h | 0 .../src_std_int32_10_21_4535_5000.h | 0 .../{src => coef}/src_std_int32_1_2_2268_5000.h | 0 .../{src => coef}/src_std_int32_1_2_4535_5000.h | 0 .../{src => coef}/src_std_int32_1_3_2268_5000.h | 0 .../{src => coef}/src_std_int32_1_3_4535_5000.h | 0 .../src_std_int32_20_21_4167_5000.h | 0 .../{src => coef}/src_std_int32_20_7_2976_5000.h | 0 .../src_std_int32_21_20_4167_5000.h | 0 .../src_std_int32_21_40_3968_5000.h | 0 .../src_std_int32_21_80_3968_5000.h | 0 .../{src => coef}/src_std_int32_2_1_2268_5000.h | 0 .../{src => coef}/src_std_int32_2_1_4535_5000.h | 0 .../{src => coef}/src_std_int32_2_3_4535_5000.h | 0 .../src_std_int32_32_21_4535_5000.h | 0 .../{src => coef}/src_std_int32_3_1_2268_5000.h | 0 .../{src => coef}/src_std_int32_3_1_4535_5000.h | 0 .../{src => coef}/src_std_int32_3_2_4535_5000.h | 0 .../{src => coef}/src_std_int32_3_4_4535_5000.h | 0 .../src_std_int32_40_21_3968_5000.h | 0 .../{src => coef}/src_std_int32_4_3_4535_5000.h | 0 .../{src => coef}/src_std_int32_4_5_4535_5000.h | 0 .../{src => coef}/src_std_int32_5_4_4535_5000.h | 0 .../{src => coef}/src_std_int32_5_6_4354_5000.h | 0 .../{src => coef}/src_std_int32_5_7_4535_5000.h | 0 .../{src => coef}/src_std_int32_6_5_4354_5000.h | 0 .../{src => coef}/src_std_int32_7_8_4535_5000.h | 0 .../{src => coef}/src_std_int32_8_21_3239_5000.h | 0 .../{src => coef}/src_std_int32_8_7_2468_5000.h | 0 .../{src => coef}/src_std_int32_8_7_4535_5000.h | 0 .../src/{src => coef}/src_std_int32_define.h | 0 .../src/{src => coef}/src_std_int32_table.h | 0 .../{src => coef}/src_tiny_int16_1_2_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_1_3_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_1_6_1814_5000.h | 0 .../src_tiny_int16_20_21_1667_5000.h | 0 .../src_tiny_int16_21_20_1667_5000.h | 0 .../src_tiny_int16_24_25_1814_5000.h | 0 .../src_tiny_int16_25_24_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_2_1_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_2_3_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_3_1_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_3_2_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_6_1_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_7_8_1814_5000.h | 0 .../{src => coef}/src_tiny_int16_8_7_1814_5000.h | 0 .../src/{src => coef}/src_tiny_int16_define.h | 0 .../src/{src => coef}/src_tiny_int16_table.h | 0 src/audio/src/src.c | 16 ++++++++-------- 159 files changed, 8 insertions(+), 8 deletions(-) rename src/audio/src/{src => coef}/src_ipc4_int32_10_21_2500_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_10_21_3455_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_10_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_10_9_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_16_21_4319_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_16_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_16_7_4082_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_2_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_2_2500_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_2_2721_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_2_3401_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_2_3887_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_2_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_3_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_4_1512_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_4_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_4_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_1_6_1134_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_20_21_1250_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_20_21_2500_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_20_21_3125_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_20_21_4167_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_20_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_20_7_2976_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_10_2500_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_10_3455_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_10_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_16_4319_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_16_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_20_1250_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_20_2500_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_20_3125_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_20_4167_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_20_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_2_3239_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_32_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_40_2381_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_40_3968_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_4_1080_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_4_3239_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_5_1728_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_5_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_80_3968_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_8_2160_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_8_3239_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_21_8_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_2_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_2_1_2500_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_2_1_2721_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_2_1_3401_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_2_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_2_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_32_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_3_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_3_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_3_2_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_3_4_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_40_21_2381_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_40_21_2976_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_40_21_3968_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_40_7_2976_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_1_1134_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_1_1512_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_21_1080_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_21_3239_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_4_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_5_21_1728_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_5_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_5_7_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_6_1_1134_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_7_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_7_5_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_7_8_1361_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_7_8_2468_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_7_8_2721_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_7_8_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_21_2160_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_21_3239_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_7_1361_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_7_2468_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_7_2721_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_7_4082_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_8_7_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_define.h (100%) rename src/audio/src/{src => coef}/src_ipc4_int32_table.h (100%) rename src/audio/src/{src => coef}/src_small_int32_1_2_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_1_2_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_1_3_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_1_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_20_21_4167_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_21_20_4167_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_2_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_2_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_2_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_3_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_3_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_3_2_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_3_4_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_4_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_4_5_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_5_4_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_5_6_4354_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_6_5_4354_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_7_8_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_8_7_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_small_int32_define.h (100%) rename src/audio/src/{src => coef}/src_small_int32_table.h (100%) rename src/audio/src/{src => coef}/src_std_int32_10_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_1_2_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_1_2_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_1_3_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_1_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_20_21_4167_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_20_7_2976_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_21_20_4167_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_21_40_3968_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_21_80_3968_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_2_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_2_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_2_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_32_21_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_3_1_2268_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_3_1_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_3_2_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_3_4_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_40_21_3968_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_4_3_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_4_5_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_5_4_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_5_6_4354_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_5_7_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_6_5_4354_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_7_8_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_8_21_3239_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_8_7_2468_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_8_7_4535_5000.h (100%) rename src/audio/src/{src => coef}/src_std_int32_define.h (100%) rename src/audio/src/{src => coef}/src_std_int32_table.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_1_2_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_1_3_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_1_6_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_20_21_1667_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_21_20_1667_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_24_25_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_25_24_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_2_1_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_2_3_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_3_1_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_3_2_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_6_1_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_7_8_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_8_7_1814_5000.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_define.h (100%) rename src/audio/src/{src => coef}/src_tiny_int16_table.h (100%) diff --git a/src/audio/src/src/src_ipc4_int32_10_21_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_10_21_2500_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_10_21_2500_5000.h rename to src/audio/src/coef/src_ipc4_int32_10_21_2500_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_10_21_3455_5000.h b/src/audio/src/coef/src_ipc4_int32_10_21_3455_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_10_21_3455_5000.h rename to src/audio/src/coef/src_ipc4_int32_10_21_3455_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_10_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_10_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_10_21_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_10_21_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_10_9_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_10_9_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_10_9_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_10_9_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_16_21_4319_5000.h b/src/audio/src/coef/src_ipc4_int32_16_21_4319_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_16_21_4319_5000.h rename to src/audio/src/coef/src_ipc4_int32_16_21_4319_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_16_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_16_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_16_21_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_16_21_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_16_7_4082_5000.h b/src/audio/src/coef/src_ipc4_int32_16_7_4082_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_16_7_4082_5000.h rename to src/audio/src/coef/src_ipc4_int32_16_7_4082_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_2_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_2268_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_2_2268_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_2_2268_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_2_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_2500_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_2_2500_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_2_2500_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_2_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_2721_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_2_2721_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_2_2721_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_2_3401_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_3401_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_2_3401_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_2_3401_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_2_3887_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_3887_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_2_3887_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_2_3887_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_2_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_2_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_2_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_3_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_1_3_2268_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_3_2268_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_3_2268_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_1_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_3_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_3_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_4_1512_5000.h b/src/audio/src/coef/src_ipc4_int32_1_4_1512_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_4_1512_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_4_1512_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_4_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_1_4_2268_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_4_2268_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_4_2268_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_4_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_1_4_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_4_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_4_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_1_6_1134_5000.h b/src/audio/src/coef/src_ipc4_int32_1_6_1134_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_1_6_1134_5000.h rename to src/audio/src/coef/src_ipc4_int32_1_6_1134_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_20_21_1250_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_1250_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_20_21_1250_5000.h rename to src/audio/src/coef/src_ipc4_int32_20_21_1250_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_20_21_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_2500_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_20_21_2500_5000.h rename to src/audio/src/coef/src_ipc4_int32_20_21_2500_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_20_21_3125_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_3125_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_20_21_3125_5000.h rename to src/audio/src/coef/src_ipc4_int32_20_21_3125_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_20_21_4167_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_4167_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_20_21_4167_5000.h rename to src/audio/src/coef/src_ipc4_int32_20_21_4167_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_20_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_20_21_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_20_21_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_20_7_2976_5000.h b/src/audio/src/coef/src_ipc4_int32_20_7_2976_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_20_7_2976_5000.h rename to src/audio/src/coef/src_ipc4_int32_20_7_2976_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_10_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_21_10_2500_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_10_2500_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_10_2500_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_10_3455_5000.h b/src/audio/src/coef/src_ipc4_int32_21_10_3455_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_10_3455_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_10_3455_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_10_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_10_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_10_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_10_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_16_4319_5000.h b/src/audio/src/coef/src_ipc4_int32_21_16_4319_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_16_4319_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_16_4319_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_16_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_16_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_16_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_16_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_20_1250_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_1250_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_20_1250_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_20_1250_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_20_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_2500_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_20_2500_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_20_2500_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_20_3125_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_3125_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_20_3125_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_20_3125_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_20_4167_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_4167_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_20_4167_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_20_4167_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_20_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_20_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_20_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_2_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_21_2_3239_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_2_3239_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_2_3239_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_32_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_32_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_32_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_32_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_40_2381_5000.h b/src/audio/src/coef/src_ipc4_int32_21_40_2381_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_40_2381_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_40_2381_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_40_3968_5000.h b/src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_40_3968_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_4_1080_5000.h b/src/audio/src/coef/src_ipc4_int32_21_4_1080_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_4_1080_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_4_1080_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_4_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_21_4_3239_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_4_3239_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_4_3239_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_5_1728_5000.h b/src/audio/src/coef/src_ipc4_int32_21_5_1728_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_5_1728_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_5_1728_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_5_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_5_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_5_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_5_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_80_3968_5000.h b/src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_80_3968_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_8_2160_5000.h b/src/audio/src/coef/src_ipc4_int32_21_8_2160_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_8_2160_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_8_2160_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_8_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_21_8_3239_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_8_3239_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_8_3239_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_21_8_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_8_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_21_8_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_21_8_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_2_1_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_2_1_2268_5000.h rename to src/audio/src/coef/src_ipc4_int32_2_1_2268_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_2_1_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_2500_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_2_1_2500_5000.h rename to src/audio/src/coef/src_ipc4_int32_2_1_2500_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_2_1_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_2721_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_2_1_2721_5000.h rename to src/audio/src/coef/src_ipc4_int32_2_1_2721_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_2_1_3401_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_3401_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_2_1_3401_5000.h rename to src/audio/src/coef/src_ipc4_int32_2_1_3401_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_2_1_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_2_1_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_2_1_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_2_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_2_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_2_3_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_2_3_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_32_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_32_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_32_21_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_32_21_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_3_1_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_3_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_3_1_2268_5000.h rename to src/audio/src/coef/src_ipc4_int32_3_1_2268_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_3_1_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_3_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_3_1_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_3_1_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_3_2_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_3_2_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_3_2_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_3_2_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_3_4_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_3_4_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_3_4_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_3_4_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_40_21_2381_5000.h b/src/audio/src/coef/src_ipc4_int32_40_21_2381_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_40_21_2381_5000.h rename to src/audio/src/coef/src_ipc4_int32_40_21_2381_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_40_21_2976_5000.h b/src/audio/src/coef/src_ipc4_int32_40_21_2976_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_40_21_2976_5000.h rename to src/audio/src/coef/src_ipc4_int32_40_21_2976_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_40_21_3968_5000.h b/src/audio/src/coef/src_ipc4_int32_40_21_3968_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_40_21_3968_5000.h rename to src/audio/src/coef/src_ipc4_int32_40_21_3968_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_40_7_2976_5000.h b/src/audio/src/coef/src_ipc4_int32_40_7_2976_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_40_7_2976_5000.h rename to src/audio/src/coef/src_ipc4_int32_40_7_2976_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_1_1134_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_1134_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_1_1134_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_1_1134_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_1_1512_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_1512_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_1_1512_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_1_1512_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_1_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_1_2268_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_1_2268_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_1_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_1_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_1_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_21_1080_5000.h b/src/audio/src/coef/src_ipc4_int32_4_21_1080_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_21_1080_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_21_1080_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_21_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_4_21_3239_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_21_3239_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_21_3239_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_4_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_4_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_4_3_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_4_3_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_5_21_1728_5000.h b/src/audio/src/coef/src_ipc4_int32_5_21_1728_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_5_21_1728_5000.h rename to src/audio/src/coef/src_ipc4_int32_5_21_1728_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_5_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_5_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_5_21_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_5_21_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_5_7_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_5_7_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_5_7_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_5_7_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_6_1_1134_5000.h b/src/audio/src/coef/src_ipc4_int32_6_1_1134_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_6_1_1134_5000.h rename to src/audio/src/coef/src_ipc4_int32_6_1_1134_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_7_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_7_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_7_3_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_7_3_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_7_5_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_7_5_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_7_5_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_7_5_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_7_8_1361_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_1361_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_7_8_1361_5000.h rename to src/audio/src/coef/src_ipc4_int32_7_8_1361_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_7_8_2468_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_2468_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_7_8_2468_5000.h rename to src/audio/src/coef/src_ipc4_int32_7_8_2468_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_7_8_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_2721_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_7_8_2721_5000.h rename to src/audio/src/coef/src_ipc4_int32_7_8_2721_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_7_8_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_7_8_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_7_8_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_21_2160_5000.h b/src/audio/src/coef/src_ipc4_int32_8_21_2160_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_21_2160_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_21_2160_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_21_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_8_21_3239_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_21_3239_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_21_3239_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_8_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_21_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_21_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_7_1361_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_1361_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_7_1361_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_7_1361_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_7_2468_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_2468_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_7_2468_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_7_2468_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_7_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_2721_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_7_2721_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_7_2721_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_7_4082_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_4082_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_7_4082_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_7_4082_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_8_7_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_4535_5000.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_8_7_4535_5000.h rename to src/audio/src/coef/src_ipc4_int32_8_7_4535_5000.h diff --git a/src/audio/src/src/src_ipc4_int32_define.h b/src/audio/src/coef/src_ipc4_int32_define.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_define.h rename to src/audio/src/coef/src_ipc4_int32_define.h diff --git a/src/audio/src/src/src_ipc4_int32_table.h b/src/audio/src/coef/src_ipc4_int32_table.h similarity index 100% rename from src/audio/src/src/src_ipc4_int32_table.h rename to src/audio/src/coef/src_ipc4_int32_table.h diff --git a/src/audio/src/src/src_small_int32_1_2_2268_5000.h b/src/audio/src/coef/src_small_int32_1_2_2268_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_1_2_2268_5000.h rename to src/audio/src/coef/src_small_int32_1_2_2268_5000.h diff --git a/src/audio/src/src/src_small_int32_1_2_4535_5000.h b/src/audio/src/coef/src_small_int32_1_2_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_1_2_4535_5000.h rename to src/audio/src/coef/src_small_int32_1_2_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_1_3_2268_5000.h b/src/audio/src/coef/src_small_int32_1_3_2268_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_1_3_2268_5000.h rename to src/audio/src/coef/src_small_int32_1_3_2268_5000.h diff --git a/src/audio/src/src/src_small_int32_1_3_4535_5000.h b/src/audio/src/coef/src_small_int32_1_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_1_3_4535_5000.h rename to src/audio/src/coef/src_small_int32_1_3_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_20_21_4167_5000.h b/src/audio/src/coef/src_small_int32_20_21_4167_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_20_21_4167_5000.h rename to src/audio/src/coef/src_small_int32_20_21_4167_5000.h diff --git a/src/audio/src/src/src_small_int32_21_20_4167_5000.h b/src/audio/src/coef/src_small_int32_21_20_4167_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_21_20_4167_5000.h rename to src/audio/src/coef/src_small_int32_21_20_4167_5000.h diff --git a/src/audio/src/src/src_small_int32_2_1_2268_5000.h b/src/audio/src/coef/src_small_int32_2_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_2_1_2268_5000.h rename to src/audio/src/coef/src_small_int32_2_1_2268_5000.h diff --git a/src/audio/src/src/src_small_int32_2_1_4535_5000.h b/src/audio/src/coef/src_small_int32_2_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_2_1_4535_5000.h rename to src/audio/src/coef/src_small_int32_2_1_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_2_3_4535_5000.h b/src/audio/src/coef/src_small_int32_2_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_2_3_4535_5000.h rename to src/audio/src/coef/src_small_int32_2_3_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_3_1_2268_5000.h b/src/audio/src/coef/src_small_int32_3_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_3_1_2268_5000.h rename to src/audio/src/coef/src_small_int32_3_1_2268_5000.h diff --git a/src/audio/src/src/src_small_int32_3_1_4535_5000.h b/src/audio/src/coef/src_small_int32_3_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_3_1_4535_5000.h rename to src/audio/src/coef/src_small_int32_3_1_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_3_2_4535_5000.h b/src/audio/src/coef/src_small_int32_3_2_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_3_2_4535_5000.h rename to src/audio/src/coef/src_small_int32_3_2_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_3_4_4535_5000.h b/src/audio/src/coef/src_small_int32_3_4_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_3_4_4535_5000.h rename to src/audio/src/coef/src_small_int32_3_4_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_4_3_4535_5000.h b/src/audio/src/coef/src_small_int32_4_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_4_3_4535_5000.h rename to src/audio/src/coef/src_small_int32_4_3_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_4_5_4535_5000.h b/src/audio/src/coef/src_small_int32_4_5_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_4_5_4535_5000.h rename to src/audio/src/coef/src_small_int32_4_5_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_5_4_4535_5000.h b/src/audio/src/coef/src_small_int32_5_4_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_5_4_4535_5000.h rename to src/audio/src/coef/src_small_int32_5_4_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_5_6_4354_5000.h b/src/audio/src/coef/src_small_int32_5_6_4354_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_5_6_4354_5000.h rename to src/audio/src/coef/src_small_int32_5_6_4354_5000.h diff --git a/src/audio/src/src/src_small_int32_6_5_4354_5000.h b/src/audio/src/coef/src_small_int32_6_5_4354_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_6_5_4354_5000.h rename to src/audio/src/coef/src_small_int32_6_5_4354_5000.h diff --git a/src/audio/src/src/src_small_int32_7_8_4535_5000.h b/src/audio/src/coef/src_small_int32_7_8_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_7_8_4535_5000.h rename to src/audio/src/coef/src_small_int32_7_8_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_8_7_4535_5000.h b/src/audio/src/coef/src_small_int32_8_7_4535_5000.h similarity index 100% rename from src/audio/src/src/src_small_int32_8_7_4535_5000.h rename to src/audio/src/coef/src_small_int32_8_7_4535_5000.h diff --git a/src/audio/src/src/src_small_int32_define.h b/src/audio/src/coef/src_small_int32_define.h similarity index 100% rename from src/audio/src/src/src_small_int32_define.h rename to src/audio/src/coef/src_small_int32_define.h diff --git a/src/audio/src/src/src_small_int32_table.h b/src/audio/src/coef/src_small_int32_table.h similarity index 100% rename from src/audio/src/src/src_small_int32_table.h rename to src/audio/src/coef/src_small_int32_table.h diff --git a/src/audio/src/src/src_std_int32_10_21_4535_5000.h b/src/audio/src/coef/src_std_int32_10_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_10_21_4535_5000.h rename to src/audio/src/coef/src_std_int32_10_21_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_1_2_2268_5000.h b/src/audio/src/coef/src_std_int32_1_2_2268_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_1_2_2268_5000.h rename to src/audio/src/coef/src_std_int32_1_2_2268_5000.h diff --git a/src/audio/src/src/src_std_int32_1_2_4535_5000.h b/src/audio/src/coef/src_std_int32_1_2_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_1_2_4535_5000.h rename to src/audio/src/coef/src_std_int32_1_2_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_1_3_2268_5000.h b/src/audio/src/coef/src_std_int32_1_3_2268_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_1_3_2268_5000.h rename to src/audio/src/coef/src_std_int32_1_3_2268_5000.h diff --git a/src/audio/src/src/src_std_int32_1_3_4535_5000.h b/src/audio/src/coef/src_std_int32_1_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_1_3_4535_5000.h rename to src/audio/src/coef/src_std_int32_1_3_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_20_21_4167_5000.h b/src/audio/src/coef/src_std_int32_20_21_4167_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_20_21_4167_5000.h rename to src/audio/src/coef/src_std_int32_20_21_4167_5000.h diff --git a/src/audio/src/src/src_std_int32_20_7_2976_5000.h b/src/audio/src/coef/src_std_int32_20_7_2976_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_20_7_2976_5000.h rename to src/audio/src/coef/src_std_int32_20_7_2976_5000.h diff --git a/src/audio/src/src/src_std_int32_21_20_4167_5000.h b/src/audio/src/coef/src_std_int32_21_20_4167_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_21_20_4167_5000.h rename to src/audio/src/coef/src_std_int32_21_20_4167_5000.h diff --git a/src/audio/src/src/src_std_int32_21_40_3968_5000.h b/src/audio/src/coef/src_std_int32_21_40_3968_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_21_40_3968_5000.h rename to src/audio/src/coef/src_std_int32_21_40_3968_5000.h diff --git a/src/audio/src/src/src_std_int32_21_80_3968_5000.h b/src/audio/src/coef/src_std_int32_21_80_3968_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_21_80_3968_5000.h rename to src/audio/src/coef/src_std_int32_21_80_3968_5000.h diff --git a/src/audio/src/src/src_std_int32_2_1_2268_5000.h b/src/audio/src/coef/src_std_int32_2_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_2_1_2268_5000.h rename to src/audio/src/coef/src_std_int32_2_1_2268_5000.h diff --git a/src/audio/src/src/src_std_int32_2_1_4535_5000.h b/src/audio/src/coef/src_std_int32_2_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_2_1_4535_5000.h rename to src/audio/src/coef/src_std_int32_2_1_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_2_3_4535_5000.h b/src/audio/src/coef/src_std_int32_2_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_2_3_4535_5000.h rename to src/audio/src/coef/src_std_int32_2_3_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_32_21_4535_5000.h b/src/audio/src/coef/src_std_int32_32_21_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_32_21_4535_5000.h rename to src/audio/src/coef/src_std_int32_32_21_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_3_1_2268_5000.h b/src/audio/src/coef/src_std_int32_3_1_2268_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_3_1_2268_5000.h rename to src/audio/src/coef/src_std_int32_3_1_2268_5000.h diff --git a/src/audio/src/src/src_std_int32_3_1_4535_5000.h b/src/audio/src/coef/src_std_int32_3_1_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_3_1_4535_5000.h rename to src/audio/src/coef/src_std_int32_3_1_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_3_2_4535_5000.h b/src/audio/src/coef/src_std_int32_3_2_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_3_2_4535_5000.h rename to src/audio/src/coef/src_std_int32_3_2_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_3_4_4535_5000.h b/src/audio/src/coef/src_std_int32_3_4_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_3_4_4535_5000.h rename to src/audio/src/coef/src_std_int32_3_4_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_40_21_3968_5000.h b/src/audio/src/coef/src_std_int32_40_21_3968_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_40_21_3968_5000.h rename to src/audio/src/coef/src_std_int32_40_21_3968_5000.h diff --git a/src/audio/src/src/src_std_int32_4_3_4535_5000.h b/src/audio/src/coef/src_std_int32_4_3_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_4_3_4535_5000.h rename to src/audio/src/coef/src_std_int32_4_3_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_4_5_4535_5000.h b/src/audio/src/coef/src_std_int32_4_5_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_4_5_4535_5000.h rename to src/audio/src/coef/src_std_int32_4_5_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_5_4_4535_5000.h b/src/audio/src/coef/src_std_int32_5_4_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_5_4_4535_5000.h rename to src/audio/src/coef/src_std_int32_5_4_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_5_6_4354_5000.h b/src/audio/src/coef/src_std_int32_5_6_4354_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_5_6_4354_5000.h rename to src/audio/src/coef/src_std_int32_5_6_4354_5000.h diff --git a/src/audio/src/src/src_std_int32_5_7_4535_5000.h b/src/audio/src/coef/src_std_int32_5_7_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_5_7_4535_5000.h rename to src/audio/src/coef/src_std_int32_5_7_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_6_5_4354_5000.h b/src/audio/src/coef/src_std_int32_6_5_4354_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_6_5_4354_5000.h rename to src/audio/src/coef/src_std_int32_6_5_4354_5000.h diff --git a/src/audio/src/src/src_std_int32_7_8_4535_5000.h b/src/audio/src/coef/src_std_int32_7_8_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_7_8_4535_5000.h rename to src/audio/src/coef/src_std_int32_7_8_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_8_21_3239_5000.h b/src/audio/src/coef/src_std_int32_8_21_3239_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_8_21_3239_5000.h rename to src/audio/src/coef/src_std_int32_8_21_3239_5000.h diff --git a/src/audio/src/src/src_std_int32_8_7_2468_5000.h b/src/audio/src/coef/src_std_int32_8_7_2468_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_8_7_2468_5000.h rename to src/audio/src/coef/src_std_int32_8_7_2468_5000.h diff --git a/src/audio/src/src/src_std_int32_8_7_4535_5000.h b/src/audio/src/coef/src_std_int32_8_7_4535_5000.h similarity index 100% rename from src/audio/src/src/src_std_int32_8_7_4535_5000.h rename to src/audio/src/coef/src_std_int32_8_7_4535_5000.h diff --git a/src/audio/src/src/src_std_int32_define.h b/src/audio/src/coef/src_std_int32_define.h similarity index 100% rename from src/audio/src/src/src_std_int32_define.h rename to src/audio/src/coef/src_std_int32_define.h diff --git a/src/audio/src/src/src_std_int32_table.h b/src/audio/src/coef/src_std_int32_table.h similarity index 100% rename from src/audio/src/src/src_std_int32_table.h rename to src/audio/src/coef/src_std_int32_table.h diff --git a/src/audio/src/src/src_tiny_int16_1_2_1814_5000.h b/src/audio/src/coef/src_tiny_int16_1_2_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_1_2_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_1_2_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_1_3_1814_5000.h b/src/audio/src/coef/src_tiny_int16_1_3_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_1_3_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_1_3_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_1_6_1814_5000.h b/src/audio/src/coef/src_tiny_int16_1_6_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_1_6_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_1_6_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_20_21_1667_5000.h b/src/audio/src/coef/src_tiny_int16_20_21_1667_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_20_21_1667_5000.h rename to src/audio/src/coef/src_tiny_int16_20_21_1667_5000.h diff --git a/src/audio/src/src/src_tiny_int16_21_20_1667_5000.h b/src/audio/src/coef/src_tiny_int16_21_20_1667_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_21_20_1667_5000.h rename to src/audio/src/coef/src_tiny_int16_21_20_1667_5000.h diff --git a/src/audio/src/src/src_tiny_int16_24_25_1814_5000.h b/src/audio/src/coef/src_tiny_int16_24_25_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_24_25_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_24_25_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_25_24_1814_5000.h b/src/audio/src/coef/src_tiny_int16_25_24_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_25_24_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_25_24_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_2_1_1814_5000.h b/src/audio/src/coef/src_tiny_int16_2_1_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_2_1_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_2_1_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_2_3_1814_5000.h b/src/audio/src/coef/src_tiny_int16_2_3_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_2_3_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_2_3_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_3_1_1814_5000.h b/src/audio/src/coef/src_tiny_int16_3_1_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_3_1_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_3_1_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_3_2_1814_5000.h b/src/audio/src/coef/src_tiny_int16_3_2_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_3_2_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_3_2_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_6_1_1814_5000.h b/src/audio/src/coef/src_tiny_int16_6_1_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_6_1_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_6_1_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_7_8_1814_5000.h b/src/audio/src/coef/src_tiny_int16_7_8_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_7_8_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_7_8_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_8_7_1814_5000.h b/src/audio/src/coef/src_tiny_int16_8_7_1814_5000.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_8_7_1814_5000.h rename to src/audio/src/coef/src_tiny_int16_8_7_1814_5000.h diff --git a/src/audio/src/src/src_tiny_int16_define.h b/src/audio/src/coef/src_tiny_int16_define.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_define.h rename to src/audio/src/coef/src_tiny_int16_define.h diff --git a/src/audio/src/src/src_tiny_int16_table.h b/src/audio/src/coef/src_tiny_int16_table.h similarity index 100% rename from src/audio/src/src/src_tiny_int16_table.h rename to src/audio/src/coef/src_tiny_int16_table.h diff --git a/src/audio/src/src.c b/src/audio/src/src.c index 6507d7bc1c8d..d1966efe5e4e 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -42,17 +42,17 @@ #include "src_config.h" #if SRC_SHORT || CONFIG_COMP_SRC_TINY -#include "src/src_tiny_int16_define.h" -#include "src/src_tiny_int16_table.h" +#include "coef/src_tiny_int16_define.h" +#include "coef/src_tiny_int16_table.h" #elif CONFIG_COMP_SRC_SMALL -#include "src/src_small_int32_define.h" -#include "src/src_small_int32_table.h" +#include "coef/src_small_int32_define.h" +#include "coef/src_small_int32_table.h" #elif CONFIG_COMP_SRC_STD -#include "src/src_std_int32_define.h" -#include "src/src_std_int32_table.h" +#include "coef/src_std_int32_define.h" +#include "coef/src_std_int32_table.h" #elif CONFIG_COMP_SRC_IPC4_FULL_MATRIX -#include "src/src_ipc4_int32_define.h" -#include "src/src_ipc4_int32_table.h" +#include "coef/src_ipc4_int32_define.h" +#include "coef/src_ipc4_int32_table.h" #else #error "No valid configuration selected for SRC" #endif From 623bc3871189bbf97ab2bd0c21562afb4810f445 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 8 Sep 2023 17:40:58 +0200 Subject: [PATCH 356/639] IPC4: remove a superfluous initialisation module_init in ipc4_init_module_instance() is completely overwritten, no need to initialise it. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/ipc/ipc4/handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index 0ab182e84d04..bb5ad023d06a 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -782,7 +782,7 @@ static int ipc4_process_glb_message(struct ipc4_message_request *ipc4) static int ipc4_init_module_instance(struct ipc4_message_request *ipc4) { - struct ipc4_module_init_instance module_init = {}; + struct ipc4_module_init_instance module_init; struct comp_dev *dev; /* we only need the common header here, all we have from the IPC */ int ret = memcpy_s(&module_init, sizeof(module_init), ipc4, sizeof(*ipc4)); From f27085f046526bc5c6b0afcfa561efe91bbdd705 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 1 Sep 2023 16:22:37 +0300 Subject: [PATCH 357/639] Tools: Tune: Multiband-DRC: Add comment about generator script This patch helps to find the right tool to create the setup blobs. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/tune/multiband_drc/example_multiband_drc.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tune/multiband_drc/example_multiband_drc.m b/tools/tune/multiband_drc/example_multiband_drc.m index 892c3fb41638..486e79dd88b2 100644 --- a/tools/tune/multiband_drc/example_multiband_drc.m +++ b/tools/tune/multiband_drc/example_multiband_drc.m @@ -139,7 +139,7 @@ function export_multiband_drc(prm) endian, 4); tplg_write(tplg1_fn, blob8, "MULTIBAND_DRC"); -tplg2_write(tplg2_fn, blob8_ipc4, "multiband_drc_config", 'Exported Control Bytes'); +tplg2_write(tplg2_fn, blob8_ipc4, "multiband_drc_config", "Exported with script example_multiband_drc.m"); blob_write(blob3_fn, blob8); alsactl_write(alsa3_fn, blob8); blob_write(blob4_fn, blob8_ipc4); From 832830aa13f8423f27c0317519aaf18c5088fdc9 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 8 Sep 2023 15:23:44 +0200 Subject: [PATCH 358/639] IDC: fix message cache handling When an IDC message is received from another core, the receiver core doesn't have any useful data for it in cache. Writing back the cache can corrupt the message data. Cache has to be invalidated instead. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/idc/zephyr_idc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/idc/zephyr_idc.c b/src/idc/zephyr_idc.c index 36b373e1aad8..9c33128349f4 100644 --- a/src/idc/zephyr_idc.c +++ b/src/idc/zephyr_idc.c @@ -63,7 +63,8 @@ static void idc_handler(struct k_p4wq_work *work) int payload = -1; k_spinlock_key_t key; - sys_cache_data_flush_range(msg, sizeof(*msg)); + /* A message is received from another core, invalidate local cache */ + sys_cache_data_invd_range(msg, sizeof(*msg)); if (msg->size == sizeof(int)) { const int idc_handler_memcpy_err __unused = @@ -123,12 +124,14 @@ int idc_send_msg(struct idc_msg *msg, uint32_t mode) msg->payload, msg->size); assert(!idc_send_memcpy_err); + /* Sending a message to another core, write back local payload cache */ sys_cache_data_flush_range(payload->data, MIN(sizeof(payload->data), msg->size)); } /* Temporarily store sender core ID */ msg_cp->core = cpu_get_id(); + /* Sending a message to another core, write back local message cache */ sys_cache_data_flush_range(msg_cp, sizeof(*msg_cp)); k_p4wq_submit(q_zephyr_idc + target_cpu, work); From b2c9944ae73ee0d9dd2651e037af6dbdb4c823ba Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 12 Dec 2022 22:19:46 +0000 Subject: [PATCH 359/639] xtos: mailbox: use memcpy for host mailbox_write Host based mailbox needs to be fixed in another place. It's here now until rtos partitioning is done. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- xtos/include/sof/lib/mailbox.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xtos/include/sof/lib/mailbox.h b/xtos/include/sof/lib/mailbox.h index 86fc900138b3..06e2659a5847 100644 --- a/xtos/include/sof/lib/mailbox.h +++ b/xtos/include/sof/lib/mailbox.h @@ -69,9 +69,8 @@ void mailbox_dspbox_read(void *dest, size_t dest_size, #if CONFIG_LIBRARY -static inline -void mailbox_hostbox_write(size_t offset, const void *src, size_t bytes) -{} +#define mailbox_hostbox_write(_offset, _src, _bytes) \ + memcpy((char *)ipc->comp_data + _offset, _src, _bytes) #else From 955a5b3fc8e9431bb96a858e84a2df7e951dea45 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 12 Dec 2022 22:22:50 +0000 Subject: [PATCH 360/639] host: cmake: make sure we build maths support for host config Add maths directory for host. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/math/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/math/CMakeLists.txt b/src/math/CMakeLists.txt index d27063c80b0d..899810544864 100644 --- a/src/math/CMakeLists.txt +++ b/src/math/CMakeLists.txt @@ -1,6 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause if(BUILD_LIBRARY) + add_local_sources(sof numbers.c) return() endif() From 5668576429f33f736f01df56c2edb94841cad525 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Mon, 28 Aug 2023 14:21:56 -0700 Subject: [PATCH 361/639] host: trace: decouple the testbench from host build Host build should not depend on testbench symbols. Also add timestamp to the trace log. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/include/sof/trace/trace.h | 29 ++++++++++++++--------- src/platform/library/lib/trace.c | 3 +-- test/cmocka/src/common_mocks.c | 2 ++ tools/testbench/common_test.c | 8 +++---- tools/testbench/include/testbench/trace.h | 2 +- tools/testbench/testbench.c | 10 ++++---- 6 files changed, 31 insertions(+), 23 deletions(-) diff --git a/src/include/sof/trace/trace.h b/src/include/sof/trace/trace.h index d3953bd16afe..737f9913cf6f 100644 --- a/src/include/sof/trace/trace.h +++ b/src/include/sof/trace/trace.h @@ -233,19 +233,26 @@ void _log_sofdict(log_func_t sofdict_logf, bool atomic, const void *log_entry, #ifdef CONFIG_LIBRARY -extern int test_bench_trace; +#include <sys/time.h> + +/* trace level used on host configurations */ +extern int host_trace_level; + char *get_trace_class(uint32_t trace_class); #define _log_message(ignored_log_func, atomic, level, comp_class, ctx, id_1, id_2, format, ...) \ -do { \ - (void)ctx; \ - (void)id_1; \ - (void)id_2; \ - if (test_bench_trace) { \ - char *msg = "(%s:%d) " format; \ - fprintf(stderr, msg, strrchr(__FILE__, '/') + 1,\ - __LINE__, ##__VA_ARGS__); \ - fprintf(stderr, "\n"); \ - } \ +do { \ + (void)ctx; \ + (void)id_1; \ + (void)id_2; \ + struct timeval tv; \ + char *msg = "(%s:%d) " format; \ + if (level >= host_trace_level) { \ + gettimeofday(&tv, NULL); \ + fprintf(stderr, "%ld.%6.6ld:", tv.tv_sec, tv.tv_usec); \ + fprintf(stderr, msg, strrchr(__FILE__, '/') + 1, \ + __LINE__, ##__VA_ARGS__); \ + fprintf(stderr, "\n"); \ + } \ } while (0) #define trace_point(x) do {} while (0) diff --git a/src/platform/library/lib/trace.c b/src/platform/library/lib/trace.c index fdd00b7777b6..7ca847afabec 100644 --- a/src/platform/library/lib/trace.c +++ b/src/platform/library/lib/trace.c @@ -12,8 +12,7 @@ #include <sof/trace/dma-trace.h> /* enable trace by default in testbench */ -int test_bench_trace = 1; -int debug; +int host_trace_level = LOG_LEVEL_ERROR; /* look up subsystem class name from table */ char *get_trace_class(uint32_t trace_class) diff --git a/test/cmocka/src/common_mocks.c b/test/cmocka/src/common_mocks.c index 180c2028b019..630bdd0a0d13 100644 --- a/test/cmocka/src/common_mocks.c +++ b/test/cmocka/src/common_mocks.c @@ -41,6 +41,8 @@ WEAK struct tr_ctx buffer_tr; WEAK struct tr_ctx comp_tr; WEAK struct tr_ctx ipc_tr; +int host_trace_level = 1; + void WEAK *rballoc_align(uint32_t flags, uint32_t caps, size_t bytes, uint32_t alignment) { diff --git a/tools/testbench/common_test.c b/tools/testbench/common_test.c index c80b94d503e2..221d6ba93d5c 100644 --- a/tools/testbench/common_test.c +++ b/tools/testbench/common_test.c @@ -264,15 +264,15 @@ int tb_pipeline_params(struct testbench_prm *tp, struct ipc *ipc, struct pipelin /* print debug messages */ void debug_print(char *message) { - if (debug) + if (host_trace_level >= LOG_LEVEL_DEBUG) printf("debug: %s", message); } /* enable trace in testbench */ -void tb_enable_trace(bool enable) +void tb_enable_trace(unsigned int log_level) { - test_bench_trace = enable; - if (enable) + host_trace_level = log_level; + if (host_trace_level) debug_print("trace print enabled\n"); else debug_print("trace print disabled\n"); diff --git a/tools/testbench/include/testbench/trace.h b/tools/testbench/include/testbench/trace.h index 73c50d43853d..66e63e217adf 100644 --- a/tools/testbench/include/testbench/trace.h +++ b/tools/testbench/include/testbench/trace.h @@ -11,6 +11,6 @@ #ifndef _TRACE_H #define _TRACE_H -void tb_enable_trace(bool enable); +void tb_enable_trace(unsigned int log_level); #endif diff --git a/tools/testbench/testbench.c b/tools/testbench/testbench.c index f4302765408f..889aba1c0209 100644 --- a/tools/testbench/testbench.c +++ b/tools/testbench/testbench.c @@ -317,9 +317,9 @@ static int parse_input_args(int argc, char **argv, struct testbench_prm *tp) tp->channels_out = atoi(optarg); break; - /* enable debug prints */ + /* set debug log level */ case 'd': - debug = 1; + host_trace_level = atoi(optarg); break; /* number of pipeline copy() iterations */ @@ -734,7 +734,6 @@ int main(int argc, char **argv) int i, err; /* initialize input and output sample rates, files, etc. */ - debug = 0; tp.total_cycles = 0; tp.fs_in = 0; tp.fs_out = 0; @@ -795,9 +794,10 @@ int main(int argc, char **argv) } if (tp.quiet) - tb_enable_trace(false); /* reduce trace output */ + tb_enable_trace(0); /* reduce trace output */ else - tb_enable_trace(true); + tb_enable_trace(1); + /* initialize ipc and scheduler */ if (tb_setup(sof_get(), &tp) < 0) { From 2a6d9d3c36190464a4268d353a6e27c49c4715b5 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Wed, 30 Aug 2023 15:03:58 -0700 Subject: [PATCH 362/639] posix: Add posix headers Add the posix headers for use with the SOF ALSA plugin. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- posix/include/CMakeLists.txt | 1 + posix/include/rtos/alloc.h | 172 +++++++ posix/include/rtos/atomic.h | 39 ++ posix/include/rtos/bit.h | 27 ++ posix/include/rtos/cache.h | 25 + posix/include/rtos/clk.h | 83 ++++ posix/include/rtos/idc.h | 201 ++++++++ posix/include/rtos/init.h | 11 + posix/include/rtos/interrupt.h | 217 +++++++++ posix/include/rtos/kernel.h | 46 ++ posix/include/rtos/mutex.h | 43 ++ posix/include/rtos/panic.h | 49 ++ posix/include/rtos/sof.h | 123 +++++ posix/include/rtos/spinlock.h | 163 +++++++ posix/include/rtos/string.h | 28 ++ posix/include/rtos/task.h | 123 +++++ posix/include/rtos/timer.h | 132 ++++++ posix/include/rtos/wait.h | 67 +++ posix/include/sof/compiler_attributes.h | 52 +++ posix/include/sof/compiler_info.h | 19 + posix/include/sof/init.h | 26 ++ posix/include/sof/lib/agent.h | 66 +++ posix/include/sof/lib/cpu.h | 93 ++++ posix/include/sof/lib/dai.h | 33 ++ posix/include/sof/lib/dma.h | 589 ++++++++++++++++++++++++ posix/include/sof/lib/io.h | 88 ++++ posix/include/sof/lib/mailbox.h | 118 +++++ posix/include/sof/lib/memory.h | 13 + posix/include/sof/lib/mm_heap.h | 113 +++++ posix/include/sof/lib/perf_cnt.h | 188 ++++++++ posix/include/sof/lib/pm_runtime.h | 176 +++++++ posix/include/sof/lib/shim.h | 13 + posix/include/sof/list.h | 127 +++++ src/arch/host/CMakeLists.txt | 3 +- tools/tplg_parser/CMakeLists.txt | 4 +- 35 files changed, 3266 insertions(+), 5 deletions(-) create mode 100644 posix/include/CMakeLists.txt create mode 100644 posix/include/rtos/alloc.h create mode 100644 posix/include/rtos/atomic.h create mode 100644 posix/include/rtos/bit.h create mode 100644 posix/include/rtos/cache.h create mode 100644 posix/include/rtos/clk.h create mode 100644 posix/include/rtos/idc.h create mode 100644 posix/include/rtos/init.h create mode 100644 posix/include/rtos/interrupt.h create mode 100644 posix/include/rtos/kernel.h create mode 100644 posix/include/rtos/mutex.h create mode 100644 posix/include/rtos/panic.h create mode 100644 posix/include/rtos/sof.h create mode 100644 posix/include/rtos/spinlock.h create mode 100644 posix/include/rtos/string.h create mode 100644 posix/include/rtos/task.h create mode 100644 posix/include/rtos/timer.h create mode 100644 posix/include/rtos/wait.h create mode 100644 posix/include/sof/compiler_attributes.h create mode 100644 posix/include/sof/compiler_info.h create mode 100644 posix/include/sof/init.h create mode 100644 posix/include/sof/lib/agent.h create mode 100644 posix/include/sof/lib/cpu.h create mode 100644 posix/include/sof/lib/dai.h create mode 100644 posix/include/sof/lib/dma.h create mode 100644 posix/include/sof/lib/io.h create mode 100644 posix/include/sof/lib/mailbox.h create mode 100644 posix/include/sof/lib/memory.h create mode 100644 posix/include/sof/lib/mm_heap.h create mode 100644 posix/include/sof/lib/perf_cnt.h create mode 100644 posix/include/sof/lib/pm_runtime.h create mode 100644 posix/include/sof/lib/shim.h create mode 100644 posix/include/sof/list.h diff --git a/posix/include/CMakeLists.txt b/posix/include/CMakeLists.txt new file mode 100644 index 000000000000..fd819740233b --- /dev/null +++ b/posix/include/CMakeLists.txt @@ -0,0 +1 @@ +target_include_directories(sof_public_headers INTERFACE include) diff --git a/posix/include/rtos/alloc.h b/posix/include/rtos/alloc.h new file mode 100644 index 000000000000..d64ea319f48e --- /dev/null +++ b/posix/include/rtos/alloc.h @@ -0,0 +1,172 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + */ + +/** + * \file xtos/include/rtos/alloc.h + * \brief Memory Allocation API definition + * \author Liam Girdwood <liam.r.girdwood@linux.intel.com> + * \author Keyon Jie <yang.jie@linux.intel.com> + */ + +#ifndef __SOF_LIB_ALLOC_H__ +#define __SOF_LIB_ALLOC_H__ + +#include <rtos/bit.h> +#include <rtos/string.h> +#include <sof/trace/trace.h> +#include <user/trace.h> + +#include <stddef.h> +#include <stdint.h> + +/** \addtogroup alloc_api Memory Allocation API + * @{ + */ + +/** + * \brief Heap Memory Zones + * + * The heap has three different zones from where memory can be allocated :- + * + * 1) System Zone. Fixed size heap where alloc always succeeds and is never + * freed. Used by any init code that will never give up the memory. + * + * 2) System Runtime Zone. Heap zone intended for runtime objects allocated + * by the kernel part of the code. + * + * 3) Runtime Zone. Main and larger heap zone where allocs are not guaranteed to + * succeed. Memory can be freed here. + * + * 4) Buffer Zone. Largest heap zone intended for audio buffers. + * + * 5) Runtime Shared Zone. Similar to Runtime Zone, but content may be used and + * fred from any enabled core. + * + * 6) System Shared Zone. Similar to System Zone, but content may be used from + * any enabled core. + * + * See platform/memory.h for heap size configuration and mappings. + */ +enum mem_zone { + SOF_MEM_ZONE_SYS = 0, /**< System zone */ + SOF_MEM_ZONE_SYS_RUNTIME, /**< System-runtime zone */ + SOF_MEM_ZONE_RUNTIME, /**< Runtime zone */ + SOF_MEM_ZONE_BUFFER, /**< Buffer zone */ + SOF_MEM_ZONE_RUNTIME_SHARED, /**< Runtime shared zone */ + SOF_MEM_ZONE_SYS_SHARED, /**< System shared zone */ +}; + +/** \name Heap zone flags + * @{ + */ + +/** \brief Indicates that original content should not be copied by realloc. */ +#define SOF_MEM_FLAG_NO_COPY BIT(1) +/** \brief Indicates that if we should return uncached address. */ +#define SOF_MEM_FLAG_COHERENT BIT(2) + +/** @} */ + +/** + * Allocates memory block. + * @param zone Zone to allocate memory from, see enum mem_zone. + * @param flags Flags, see SOF_MEM_FLAG_... + * @param caps Capabilities, see SOF_MEM_CAPS_... + * @param bytes Size in bytes. + * @return Pointer to the allocated memory or NULL if failed. + * + * @note Do not use for buffers (SOF_MEM_ZONE_BUFFER zone). + * Use rballoc(), rballoc_align() to allocate memory for buffers. + */ +void *rmalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes); + +/** + * Similar to rmalloc(), guarantees that returned block is zeroed. + * + * @note Do not use for buffers (SOF_MEM_ZONE_BUFFER zone). + * rballoc(), rballoc_align() to allocate memory for buffers. + */ +void *rzalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes); + +/** + * Allocates memory block from SOF_MEM_ZONE_BUFFER. + * @param flags Flags, see SOF_MEM_FLAG_... + * @param caps Capabilities, see SOF_MEM_CAPS_... + * @param bytes Size in bytes. + * @param alignment Alignment in bytes. + * @return Pointer to the allocated memory or NULL if failed. + */ +void *rballoc_align(uint32_t flags, uint32_t caps, size_t bytes, + uint32_t alignment); + +/** + * Similar to rballoc_align(), returns buffer aligned to PLATFORM_DCACHE_ALIGN. + */ +static inline void *rballoc(uint32_t flags, uint32_t caps, size_t bytes) +{ + return rballoc_align(flags, caps, bytes, PLATFORM_DCACHE_ALIGN); +} + +/** + * Changes size of the memory block allocated from SOF_MEM_ZONE_BUFFER. + * @param ptr Address of the block to resize. + * @param flags Flags, see SOF_MEM_FLAG_... + * @param caps Capabilities, see SOF_MEM_CAPS_... + * @param bytes New size in bytes. + * @param old_bytes Old size in bytes. + * @param alignment Alignment in bytes. + * @return Pointer to the resized memory of NULL if failed. + */ +void *rbrealloc_align(void *ptr, uint32_t flags, uint32_t caps, size_t bytes, + size_t old_bytes, uint32_t alignment); + +/** + * Similar to rballoc_align(), returns resized buffer aligned to + * PLATFORM_DCACHE_ALIGN. + */ +static inline void *rbrealloc(void *ptr, uint32_t flags, uint32_t caps, + size_t bytes, size_t old_bytes) +{ + return rbrealloc_align(ptr, flags, caps, bytes, old_bytes, + PLATFORM_DCACHE_ALIGN); +} + +/** + * Frees the memory block. + * @param ptr Pointer to the memory block. + * + * @note Blocks from SOF_MEM_ZONE_SYS cannot be freed, such a call causes + * panic. + */ +void rfree(void *ptr); + +/** + * Allocates memory block from the system heap reserved for the specified core. + * @param core Core id. + * @param bytes Size in bytes. + */ +void *rzalloc_core_sys(int core, size_t bytes); + +/** + * Calculates length of the null-terminated string. + * @param s String. + * @return Length of the string in bytes. + */ +int rstrlen(const char *s); + +/** + * Compares two strings, see man strcmp. + * @param s1 First string to compare. + * @param s2 Second string to compare. + * @return See man strcmp. + */ +int rstrcmp(const char *s1, const char *s2); + +/** @}*/ + +#endif /* __SOF_LIB_ALLOC_H__ */ diff --git a/posix/include/rtos/atomic.h b/posix/include/rtos/atomic.h new file mode 100644 index 000000000000..6d16b6b6c9e6 --- /dev/null +++ b/posix/include/rtos/atomic.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __SOF_ATOMIC_H__ +#define __SOF_ATOMIC_H__ + +#include <arch/atomic.h> +#include <stdint.h> + +static inline void atomic_init(atomic_t *a, int32_t value) +{ + arch_atomic_init(a, value); +} + +static inline int32_t atomic_read(const atomic_t *a) +{ + return arch_atomic_read(a); +} + +static inline void atomic_set(atomic_t *a, int32_t value) +{ + arch_atomic_set(a, value); +} + +static inline int32_t atomic_add(atomic_t *a, int32_t value) +{ + return arch_atomic_add(a, value); +} + +static inline int32_t atomic_sub(atomic_t *a, int32_t value) +{ + return arch_atomic_sub(a, value); +} + +#endif /* __SOF_ATOMIC_H__ */ diff --git a/posix/include/rtos/bit.h b/posix/include/rtos/bit.h new file mode 100644 index 000000000000..3dde908c2d6b --- /dev/null +++ b/posix/include/rtos/bit.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __XTOS_RTOS_BIT_H__ +#define __XTOS_RTOS_BIT_H__ + +#if ASSEMBLY +#define BIT(b) (1 << (b)) +#else +#define BIT(b) (1UL << (b)) +#endif + +#define MASK(b_hi, b_lo) \ + (((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL) << (b_lo)) +#define SET_BIT(b, x) (((x) & 1) << (b)) +#define SET_BITS(b_hi, b_lo, x) \ + (((x) & ((1ULL << ((b_hi) - (b_lo) + 1ULL)) - 1ULL)) << (b_lo)) +#define GET_BIT(b, x) \ + (((x) & (1ULL << (b))) >> (b)) +#define GET_BITS(b_hi, b_lo, x) \ + (((x) & MASK(b_hi, b_lo)) >> (b_lo)) + +#endif /* __XTOS_RTOS_BIT_H__ */ diff --git a/posix/include/rtos/cache.h b/posix/include/rtos/cache.h new file mode 100644 index 000000000000..914e61b52984 --- /dev/null +++ b/posix/include/rtos/cache.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + * + * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +/** + * \file xtos/include/rtos/cache.h + * \brief Cache header file + * \authors Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +#ifndef __SOF_LIB_CACHE_H__ +#define __SOF_LIB_CACHE_H__ + +#include <arch/lib/cache.h> + +/* writeback and invalidate data */ +#define CACHE_WRITEBACK_INV 0 + +/* invalidate data */ +#define CACHE_INVALIDATE 1 + +#endif /* __SOF_LIB_CACHE_H__ */ diff --git a/posix/include/rtos/clk.h b/posix/include/rtos/clk.h new file mode 100644 index 000000000000..e9a36796bc42 --- /dev/null +++ b/posix/include/rtos/clk.h @@ -0,0 +1,83 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Janusz Jankowski <janusz.jankowski@linux.intel.com> + */ + +#ifndef __SOF_LIB_CLK_H__ +#define __SOF_LIB_CLK_H__ + +#include <platform/lib/clk.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> +#include <stdbool.h> +#include <stdint.h> + +struct timer; + +#define CLOCK_NOTIFY_PRE 0 +#define CLOCK_NOTIFY_POST 1 + +struct clock_notify_data { + uint32_t old_freq; + uint32_t old_ticks_per_msec; + uint32_t freq; + uint32_t ticks_per_msec; + uint32_t message; +}; + +struct freq_table { + uint32_t freq; + uint32_t ticks_per_msec; +}; + +struct clock_info { + uint32_t freqs_num; + const struct freq_table *freqs; + uint32_t default_freq_idx; + uint32_t current_freq_idx; + uint32_t lowest_freq_idx; /* lowest possible clock */ + uint32_t notification_id; + uint32_t notification_mask; + + /* persistent change clock value in active state, caller must hold clk_lock */ + int (*set_freq)(int clock, int freq_idx); + + /* temporary change clock - don't modify default clock settings */ + void (*low_power_mode)(int clock, bool enable); +}; + +uint32_t clock_get_freq(int clock); + +void clock_set_freq(int clock, uint32_t hz); + +void clock_low_power_mode(int clock, bool enable); + +uint64_t clock_ms_to_ticks(int clock, uint64_t ms); + +uint64_t clock_us_to_ticks(int clock, uint64_t us); + +uint64_t clock_ns_to_ticks(int clock, uint64_t ns); + +uint64_t clock_ticks_per_sample(int clock, uint32_t sample_rate); + +extern struct k_spinlock clk_lock; + +static inline k_spinlock_key_t clock_lock(void) +{ + return k_spin_lock(&clk_lock); +} + +static inline void clock_unlock(k_spinlock_key_t key) +{ + k_spin_unlock(&clk_lock, key); +} + +static inline struct clock_info *clocks_get(void) +{ + return sof_get()->clocks; +} + +#endif /* __SOF_LIB_CLK_H__ */ diff --git a/posix/include/rtos/idc.h b/posix/include/rtos/idc.h new file mode 100644 index 000000000000..d6dd69f3e9e9 --- /dev/null +++ b/posix/include/rtos/idc.h @@ -0,0 +1,201 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +/** + * \file include/rtos/idc.h + * \brief IDC header file + * \authors Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +#ifndef __POSIX_RTOS_IDC_H__ +#define __POSIX_RTOS_IDC_H__ + +#include <arch/drivers/idc.h> +#include <platform/drivers/idc.h> +#include <rtos/task.h> +#include <sof/trace/trace.h> +#include <user/trace.h> +#include <stdint.h> +#include <rtos/cache.h> + +/** \brief IDC send blocking flag. */ +#define IDC_BLOCKING 0 + +/** \brief IDC send non-blocking flag. */ +#define IDC_NON_BLOCKING 1 + +/** \brief IDC send core power up flag. */ +#define IDC_POWER_UP 2 + +/** \brief IDC send core power down flag. */ +#define IDC_POWER_DOWN 3 + +/** \brief IDC send timeout in microseconds. */ +#define IDC_TIMEOUT 10000 + +/** \brief IDC task deadline. */ +#define IDC_DEADLINE 100 + +/** \brief ROM wake version parsed by ROM during core wake up. */ +#define IDC_ROM_WAKE_VERSION 0x2 + +/** \brief IDC message type. */ +#define IDC_TYPE_SHIFT 24 +#define IDC_TYPE_MASK 0x7f +#define IDC_TYPE(x) (((x) & IDC_TYPE_MASK) << IDC_TYPE_SHIFT) + +#define IDC_MSG_BIND IDC_TYPE(0xD) +#define IDC_MSG_UNBIND IDC_TYPE(0xE) +#define IDC_MSG_GET_ATTRIBUTE IDC_TYPE(0xF) + +/** \brief IDC pipeline set state message. */ +#define IDC_MSG_PPL_STATE IDC_TYPE(0xC) +#define IDC_PPL_STATE_PPL_ID_SHIFT 0 +#define IDC_PPL_STATE_PPL_ID_MASK MASK(23, 0) +#define IDC_PPL_STATE_PHASE_SHIFT 24 +#define IDC_PPL_STATE_PHASE_MASK MASK(27, 24) +#define IDC_PPL_STATE_PHASE_SET(x) (((x) << IDC_PPL_STATE_PHASE_SHIFT) & \ + IDC_PPL_STATE_PHASE_MASK) +#define IDC_PPL_STATE_PHASE_GET(x) (((x) & IDC_PPL_STATE_PHASE_MASK) >> \ + IDC_PPL_STATE_PHASE_SHIFT) +#define IDC_PPL_STATE_PHASE_PREPARE BIT(0) +#define IDC_PPL_STATE_PHASE_TRIGGER BIT(1) +#define IDC_PPL_STATE_PHASE_ONESHOT (IDC_PPL_STATE_PHASE_PREPARE | \ + IDC_PPL_STATE_PHASE_TRIGGER) + +#define IDC_MSG_PPL_STATE_EXT(_ppl_id, _action) \ + IDC_EXTENSION(((_ppl_id) & IDC_PPL_STATE_PPL_ID_MASK) | \ + IDC_PPL_STATE_PHASE_SET(_action)) + +/** \brief IDC message header. */ +#define IDC_HEADER_MASK 0xffffff +#define IDC_HEADER(x) ((x) & IDC_HEADER_MASK) + +/** \brief IDC message extension. */ +#define IDC_EXTENSION_MASK 0x3fffffff +#define IDC_EXTENSION(x) ((x) & IDC_EXTENSION_MASK) + +/** \brief IDC power up message. */ +#define IDC_MSG_POWER_UP (IDC_TYPE(0x1) | \ + IDC_HEADER(IDC_ROM_WAKE_VERSION)) +#define IDC_MSG_POWER_UP_EXT IDC_EXTENSION(SOF_TEXT_START >> 2) + +/** \brief IDC power down message. */ +#define IDC_MSG_POWER_DOWN IDC_TYPE(0x2) +#define IDC_MSG_POWER_DOWN_EXT IDC_EXTENSION(0x0) + +/** \brief IDC notify message. */ +#define IDC_MSG_NOTIFY IDC_TYPE(0x3) +#define IDC_MSG_NOTIFY_EXT IDC_EXTENSION(0x0) + +/** \brief IDC IPC processing message. */ +#define IDC_MSG_IPC IDC_TYPE(0x4) +#define IDC_MSG_IPC_EXT IDC_EXTENSION(0x0) + +/** \brief IDC component params message. */ +#define IDC_MSG_PARAMS IDC_TYPE(0x5) +#define IDC_MSG_PARAMS_EXT(x) IDC_EXTENSION(x) + +/** \brief IDC component prepare message. */ +#define IDC_MSG_PREPARE IDC_TYPE(0x6) +#define IDC_MSG_PREPARE_EXT(x) IDC_EXTENSION(x) + +/** \brief IDC component trigger message. */ +#define IDC_MSG_TRIGGER IDC_TYPE(0x7) +#define IDC_MSG_TRIGGER_EXT(x) IDC_EXTENSION(x) + +/** \brief IDC component reset message. */ +#define IDC_MSG_RESET IDC_TYPE(0x8) +#define IDC_MSG_RESET_EXT(x) IDC_EXTENSION(x) + +/** \brief IDC prepare D0ix message. */ +#define IDC_MSG_PREPARE_D0ix IDC_TYPE(0x9) +#define IDC_MSG_PREPARE_D0ix_EXT IDC_EXTENSION(0x0) + +/** \brief IDC secondary core crashed notify message. */ +#define IDC_MSG_SECONDARY_CORE_CRASHED IDC_TYPE(0xA) +#define IDC_MSG_SECONDARY_CORE_CRASHED_EXT(x) IDC_EXTENSION(x) + +/** \brief IDC process async msg */ +#define IDC_MSG_AMS IDC_TYPE(0xB) +#define IDC_MSG_AMS_EXT IDC_EXTENSION(0x0) + +#define IDC_HEADER_TO_AMS_SLOT_MASK(x) (x & 0xFFFF) + +/** \brief IDC_MSG_SECONDARY_CORE_CRASHED header fields. */ +#define IDC_SCC_CORE_SHIFT 0 +#define IDC_SCC_CORE_MASK 0xff +#define IDC_SCC_CORE(x) (((x) & IDC_SCC_CORE_MASK) << IDC_SCC_CORE_SHIFT) + +#define IDC_SCC_REASON_SHIFT 8 +#define IDC_SCC_REASON_MASK 0xff +#define IDC_SCC_REASON(x) (((x) & IDC_SCC_REASON_MASK) << IDC_SCC_REASON_SHIFT) + +/** \brief Secondary core crash reasons. */ +#define IDC_SCC_REASON_WATCHDOG 0x00 +#define IDC_SCC_REASON_EXCEPTION 0x01 + +/** \brief Decodes IDC message type. */ +#define iTS(x) (((x) >> IDC_TYPE_SHIFT) & IDC_TYPE_MASK) + +/** \brief Max IDC message payload size in bytes. */ +#define IDC_MAX_PAYLOAD_SIZE (DCACHE_LINE_SIZE * 2) + +/** \brief IDC free function flags */ +#define IDC_FREE_IRQ_ONLY BIT(0) /**< disable only irqs */ + +/** \brief IDC message payload. */ +struct idc_payload { + uint8_t data[IDC_MAX_PAYLOAD_SIZE]; +}; + +/** \brief IDC message. */ +struct idc_msg { + uint32_t header; /**< header value */ + uint32_t extension; /**< extension value */ + uint32_t core; /**< core id */ + uint32_t size; /**< payload size in bytes */ + void *payload; /**< pointer to payload data */ +}; + +/** \brief IDC data. */ +struct idc { + uint32_t busy_bit_mask; /**< busy interrupt mask */ + struct idc_msg received_msg; /**< received message */ + struct task idc_task; /**< IDC processing task */ + struct idc_payload *payload; + int irq; +}; + +/* idc trace context, used by multiple units */ +extern struct tr_ctx idc_tr; + +static inline struct idc_payload *idc_payload_get(struct idc *idc, + uint32_t core) +{ + return idc->payload + core; +} + +void idc_enable_interrupts(int target_core, int source_core); + +void idc_free(uint32_t flags); + +int platform_idc_init(void); + +int platform_idc_restore(void); + +enum task_state idc_do_cmd(void *data); + +void idc_cmd(struct idc_msg *msg); + +int idc_wait_in_blocking_mode(uint32_t target_core, bool (*cond)(int)); + +int idc_msg_status_get(uint32_t core); + +void idc_init_thread(void); + +#endif /* __POSIX_RTOS_IDC_H__ */ diff --git a/posix/include/rtos/init.h b/posix/include/rtos/init.h new file mode 100644 index 000000000000..7744d6b5b1f3 --- /dev/null +++ b/posix/include/rtos/init.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + */ + +#ifndef __POSIX_RTOS_INIT_H__ +#define __POSIX_RTOS_INIT_H__ + +#define SOF_MODULE_INIT(name, init) + +#endif /* __POSIX_RTOS_INIT_H__ */ diff --git a/posix/include/rtos/interrupt.h b/posix/include/rtos/interrupt.h new file mode 100644 index 000000000000..839b4bef3ca3 --- /dev/null +++ b/posix/include/rtos/interrupt.h @@ -0,0 +1,217 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Janusz Jankowski <janusz.jankowski@linux.intel.com> + */ + +#ifndef __SOF_DRIVERS_INTERRUPT_H__ +#define __SOF_DRIVERS_INTERRUPT_H__ + +#include <platform/drivers/interrupt.h> + +#if !defined(__ASSEMBLER__) && !defined(LINKER) +#include <arch/drivers/interrupt.h> +#include <sof/lib/cpu.h> +#include <sof/list.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> +#include <sof/trace/trace.h> +#include <user/trace.h> +#include <stdbool.h> +#include <stdint.h> + +/** + * \brief child IRQ descriptor for cascading IRQ controllers. + */ +struct irq_child { + int enable_count[CONFIG_CORE_COUNT]; /**< IRQ enable counter */ + struct list_item list; /**< head for IRQ descriptors, + * sharing this interrupt + */ +}; + +/** + * \brief interrupt client descriptor + */ +struct irq_desc { + int irq; /**< virtual IRQ number */ + void (*handler)(void *arg); /**< interrupt handler function */ + void *handler_arg; /**< interrupt handler argument */ + uint32_t cpu_mask; /**< a mask of CPUs on which this + * interrupt is enabled + */ + struct list_item irq_list; /**< to link to other irq_desc */ +}; + +/** + * \brief cascading IRQ controller operations. + */ +struct irq_cascade_ops { + void (*mask)(struct irq_desc *desc, uint32_t irq, + unsigned int cpu); /**< mask */ + void (*unmask)(struct irq_desc *desc, uint32_t irq, + unsigned int cpu); /**< unmask */ +}; + +/** + * \brief cascading interrupt controller descriptor. + */ +struct irq_cascade_desc { + const char *name; /**< name of the + * controller + */ + int irq_base; /**< first virtual IRQ + * number, assigned to + * this controller + */ + const struct irq_cascade_ops *ops; /**< cascading interrupt + * controller driver + * operations + */ + struct irq_desc desc; /**< the interrupt, that + * this controller is + * generating + */ + struct irq_cascade_desc *next; /**< link to the global + * list of interrupt + * controllers + */ + bool global_mask; /**< the controller + * cannot mask input + * interrupts per core + */ + struct k_spinlock lock; /**< protect child + * lists, enable and + * child counters + */ + int enable_count[CONFIG_CORE_COUNT]; /**< enabled child + * interrupt counter + */ + unsigned int num_children[CONFIG_CORE_COUNT]; /**< number of children + */ + struct irq_child child[PLATFORM_IRQ_CHILDREN]; /**< array of child + * lists - one per + * multiplexed IRQ + */ +}; + +/* A descriptor for cascading interrupt controller template */ +struct irq_cascade_tmpl { + const char *name; + const struct irq_cascade_ops *ops; + int irq; + void (*handler)(void *arg); + bool global_mask; +}; + +/** + * \brief Cascading interrupt controller root. + */ +struct cascade_root { + struct k_spinlock lock; /**< locking mechanism */ + struct irq_cascade_desc *list; /**< list of child cascade irqs */ + int last_irq; /**< last registered cascade irq */ +}; + +static inline struct cascade_root *cascade_root_get(void) +{ + return sof_get()->cascade_root; +} + +/* For i.MX, while building SOF with Zephyr use the interrupt_* + * functions from second level interrupt handling and IRQ_STEER. + */ +#if defined(__ZEPHYR__) && defined(CONFIG_IMX) +int mux_interrupt_get_irq(unsigned int irq, const char *cascade); +int mux_interrupt_register(uint32_t irq, void(*handler)(void *arg), void *arg); +void mux_interrupt_unregister(uint32_t irq, const void *arg); +uint32_t mux_interrupt_enable(uint32_t irq, void *arg); +uint32_t mux_interrupt_disable(uint32_t irq, void *arg); +#endif + +int interrupt_register(uint32_t irq, void(*handler)(void *arg), void *arg); +void interrupt_unregister(uint32_t irq, const void *arg); +uint32_t interrupt_enable(uint32_t irq, void *arg); +uint32_t interrupt_disable(uint32_t irq, void *arg); + +/* Zephyr compat */ +#if !defined(__ZEPHYR__) +#define arch_irq_lock() arch_interrupt_disable_mask(0xffffffff) +#endif + +void platform_interrupt_init(void); + +void platform_interrupt_set(uint32_t irq); +void platform_interrupt_clear(uint32_t irq, uint32_t mask); +uint32_t platform_interrupt_get_enabled(void); +void interrupt_mask(uint32_t irq, unsigned int cpu); +void interrupt_unmask(uint32_t irq, unsigned int cpu); + +/* + * On platforms, supporting cascading interrupts cascaded interrupt numbers + * are greater than or equal to PLATFORM_IRQ_HW_NUM + */ +#define interrupt_is_dsp_direct(irq) (!PLATFORM_IRQ_CHILDREN || \ + irq < PLATFORM_IRQ_HW_NUM) + +void interrupt_init(struct sof *sof); +int interrupt_cascade_register(const struct irq_cascade_tmpl *tmpl); +struct irq_cascade_desc *interrupt_get_parent(uint32_t irq); +int interrupt_get_irq(unsigned int irq, const char *cascade); + +static inline void interrupt_set(int irq) +{ + platform_interrupt_set(irq); +} + +static inline void interrupt_clear_mask(int irq, uint32_t mask) +{ + platform_interrupt_clear(irq, mask); +} + +static inline void interrupt_clear(int irq) +{ + interrupt_clear_mask(irq, 1); +} + +static inline uint32_t interrupt_global_disable(void) +{ + return arch_interrupt_global_disable(); +} + +static inline void interrupt_global_enable(uint32_t flags) +{ + arch_interrupt_global_enable(flags); +} + +#if CONFIG_LIBRARY + +/* temporary fix to remove build warning for testbench that will need shortly + * realigned when Zephyr native APIs are used. + */ +static inline void __irq_local_disable(unsigned long flags) {} +static inline void __irq_local_enable(unsigned long flags) {} + +/* disables all IRQ sources on current core - NO effect on library */ +#define irq_local_disable(flags) \ + do { \ + flags = 0; \ + __irq_local_disable(flags); \ + } while (0) + +/* re-enables IRQ sources on current core - NO effect on library*/ +#define irq_local_enable(flags) \ + __irq_local_enable(flags) + +#else +/* disables all IRQ sources on current core */ +#define irq_local_disable(flags) \ + (flags = interrupt_global_disable()) + +/* re-enables IRQ sources on current core */ +#define irq_local_enable(flags) \ + interrupt_global_enable(flags) +#endif +#endif +#endif /* __SOF_DRIVERS_INTERRUPT_H__ */ diff --git a/posix/include/rtos/kernel.h b/posix/include/rtos/kernel.h new file mode 100644 index 000000000000..5921d86b0012 --- /dev/null +++ b/posix/include/rtos/kernel.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022 Intel Corporation. All rights reserved. + * + * Author: Jyri Sarha <jyri.sarha@intel.com> + */ + +#ifndef __POSIX_RTOS_KERNEL_H__ +#define __POSIX_RTOS_KERNEL_H__ + +#include <rtos/wait.h> + +#include <stdint.h> + +#ifdef __ZEPHYR__ +#error "This file should only be included in XTOS builds." +#endif + +typedef uint32_t k_ticks_t; + +typedef struct { + k_ticks_t ticks; +} k_timeout_t; + +#define Z_TIMEOUT_TICKS(t) ((k_timeout_t) { .ticks = (t) }) + +#define Z_TIMEOUT_US(t) ((k_timeout_t) { .ticks = clock_us_to_ticks(PLATFORM_DEFAULT_CLOCK, t) }) + +#define Z_TIMEOUT_MS(t) ((k_timeout_t) { .ticks = clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, t) }) + +static inline void k_sleep(k_timeout_t timeout) +{ + wait_delay(timeout.ticks); +} + +static inline void k_msleep(int32_t ms) +{ + wait_delay_ms(ms); +} + +static inline void k_usleep(int32_t us) +{ + wait_delay_us(us); +} + +#endif /* __POSIX_RTOS_KERNEL_H__ */ diff --git a/posix/include/rtos/mutex.h b/posix/include/rtos/mutex.h new file mode 100644 index 000000000000..16c773f4cae4 --- /dev/null +++ b/posix/include/rtos/mutex.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022 Intel Corporation. All rights reserved. + * + */ + +/* + * Simple mutex implementation for SOF. + */ + +#ifndef __POSIX_RTOS_MUTEX_H +#define __POSIX_RTOS_MUTEX_H + +#include <rtos/kernel.h> +#include <rtos/spinlock.h> +#include <stdint.h> + +#define K_FOREVER ((k_timeout_t) { .ticks = 0xffffffff }) + +struct k_mutex { + struct k_spinlock lock; + k_spinlock_key_t key; +}; + +static inline int k_mutex_init(struct k_mutex *mutex) +{ + k_spinlock_init(&mutex->lock); + return 0; +} + +static inline int k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout) +{ + mutex->key = k_spin_lock(&mutex->lock); + return 0; +} + +static inline int k_mutex_unlock(struct k_mutex *mutex) +{ + k_spin_unlock(&mutex->lock, mutex->key); + return 0; +} + +#endif diff --git a/posix/include/rtos/panic.h b/posix/include/rtos/panic.h new file mode 100644 index 000000000000..65b06a1cab43 --- /dev/null +++ b/posix/include/rtos/panic.h @@ -0,0 +1,49 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2023 NXP + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __POSIX_RTOS_PANIC_H__ +#define __POSIX_RTOS_PANIC_H__ + +#include <ipc/trace.h> +#include <stdint.h> +#include <arch/debug/panic.h> + +#ifdef __ZEPHYR__ +#error "This file should only be included in XTOS builds." +#endif /* __ZEPHYR__ */ + +#ifdef __clang_analyzer__ +#define SOF_NORETURN __attribute__((analyzer_noreturn)) +#elif __GNUC__ +#define SOF_NORETURN __attribute__((noreturn)) +#else +#define SOF_NORETURN +#endif + +#ifndef RELATIVE_FILE +#error "This file requires RELATIVE_FILE to be defined. "\ + "Add it to CMake's target with sof_append_relative_path_definitions." +#endif + +void dump_panicinfo(void *addr, struct sof_ipc_panic_info *panic_info); +void panic_dump(uint32_t p, struct sof_ipc_panic_info *panic_info, + uintptr_t *data) SOF_NORETURN; +void __panic(uint32_t p, char *filename, uint32_t linenum) SOF_NORETURN; + +/** panic dump filename and linenumber of the call + * + * \param x panic code defined in ipc/trace.h + */ +#define sof_panic(x) __panic((x), (RELATIVE_FILE), (__LINE__)) + +/* runtime assertion */ +#ifndef assert +#define assert(cond) (void)((cond) || (sof_panic(SOF_IPC_PANIC_ASSERT), 0)) +#endif + +#endif /* __POSIX_RTOS_PANIC_H__ */ diff --git a/posix/include/rtos/sof.h b/posix/include/rtos/sof.h new file mode 100644 index 000000000000..3cbb2e7bfefa --- /dev/null +++ b/posix/include/rtos/sof.h @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __POSIX_RTOS_SOF_H__ +#define __POSIX_RTOS_SOF_H__ + +#include <sof/common.h> +#include <sof/lib/memory.h> +#include <rtos/spinlock.h> + +struct cascade_root; +struct clock_info; +struct comp_driver_list; +struct dai_info; +struct dma_info; +struct dma_trace_data; +struct ipc; +struct ll_schedule_domain; +struct mm; +struct mn; +struct ams_shared_context; +struct notify_data; +struct pm_runtime_data; +struct sa; +struct timer; +struct trace; +struct pipeline_posn; +struct probe_pdata; + +/** + * \brief General firmware context. + * This structure holds all the global pointers, which can potentially + * be accessed by SMP code, hence it should be aligned to platform's + * data cache line size. Alignments in the both beginning and end are needed + * to avoid potential before and after data evictions. + */ +struct sof { + /* init data */ + int argc; + char **argv; + + /* ipc */ + struct ipc *ipc; + + /* system agent */ + struct sa *sa; + + /* DMA for Trace*/ + struct dma_trace_data *dmat; + + /* generic trace structure */ + struct trace *trace; + + /* platform clock information */ + struct clock_info *clocks; + + /* default platform timer */ + struct timer *platform_timer; + + /* cpu (arch) timers - 1 per core */ + struct timer *cpu_timers; + + /* timer domain for driving timer LL scheduler */ + struct ll_schedule_domain *platform_timer_domain; + + /* DMA domain for driving DMA LL scheduler */ + struct ll_schedule_domain *platform_dma_domain; + + /* memory map */ + struct mm *memory_map; + + /* runtime power management data */ + struct pm_runtime_data *prd; + +#ifdef CONFIG_AMS + /* asynchronous messaging service */ + struct ams_shared_context *ams_shared_ctx; +#endif + + /* shared notifier data */ + struct notify_data *notify_data; + + /* platform dai information */ + const struct dai_info *dai_info; + + /* platform DMA information */ + const struct dma_info *dma_info; + + /* cascading interrupt controller root */ + struct cascade_root *cascade_root; + + /* list of registered component drivers */ + struct comp_driver_list *comp_drivers; + + /* M/N dividers */ + struct mn *mn; + + /* probes */ + struct probe_pdata *probe; + + /* pipelines stream position */ + struct pipeline_posn *pipeline_posn; + +#ifdef CONFIG_LIBRARY_MANAGER + /* dynamically loaded libraries */ + struct ext_library *ext_library; +#endif + +#if CONFIG_IPC_MAJOR_4 + /* lock for fw_reg access */ + struct k_spinlock fw_reg_lock; +#endif + + __aligned(PLATFORM_DCACHE_ALIGN) int alignment[0]; +} __aligned(PLATFORM_DCACHE_ALIGN); + +struct sof *sof_get(void); + +#endif /* __POSIX_RTOS_SOF_H__ */ diff --git a/posix/include/rtos/spinlock.h b/posix/include/rtos/spinlock.h new file mode 100644 index 000000000000..beb20ab6e847 --- /dev/null +++ b/posix/include/rtos/spinlock.h @@ -0,0 +1,163 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + */ + +/* + * Simple spinlock implementation for SOF. + */ + +#ifndef __POSIX_RTOS_SPINLOCK_H__ +#define __POSIX_RTOS_SPINLOCK_H__ + +#include <arch/spinlock.h> +typedef uint32_t k_spinlock_key_t; +#include <sof/lib/memory.h> +#include <ipc/trace.h> + +#include <stdint.h> + +/* + * Lock debugging provides a simple interface to debug deadlocks. The rmbox + * trace output will show an output :- + * + * 0xd70 [41.306406] delta [0.359638] lock eal + * 0xd80 [41.306409] delta [0.000002] value 0x00000000000001b7 + * 0xd90 [41.306411] delta [0.000002] value 0x0000000000000001 + * 0xda0 [41.306413] delta [0.000002] value 0x0000000001000348 + * + * "eal" indicates we are holding a lock with interrupts OFF. The next value + * is the line number of where the lock was acquired. The second number is the + * number of other locks held whilst this lock is held and the subsequent + * numbers list each lock and the line number of it's holder. e.g. to find + * the locks :- + * + * grep -rn lock --include *.c | grep 840 (search for lock at line 0x348) + * src/drivers/dw-dma.c:840: spinlock_init(&dma->lock); + * + * grep -rn lock --include *.c | grep 439 + * src/lib/alloc.c:439: k_spin_lock_irq(&memmap.lock, flags); + * + * Every lock entry and exit shows LcE and LcX in trace alongside the lock + * line numbers in hex. e.g. + * + * 0xfd60 [11032.730567] delta [0.000004] lock LcE + * 0xfd70 [11032.730569] delta [0.000002] value 0x00000000000000ae + * + * Deadlock can be confirmed in rmbox :- + * + * Debug log: + * debug: 0x0 (00) = 0xdead0007 (-559087609) |....| + * .... + * Error log: + * using 19.20MHz timestamp clock + * 0xc30 [26.247240] delta [26.245851] lock DED + * 0xc40 [26.247242] delta [0.000002] value 0x00000000000002b4 + * 0xc50 [26.247244] delta [0.000002] value 0x0000000000000109 + * + * DED means deadlock has been detected and the DSP is now halted. The first + * value after DEA is the line number where deadlock occurs and the second + * number is the line number where the lock is allocated. These can be grepped + * like above. + */ + +#if CONFIG_DEBUG_LOCKS + +#include <rtos/panic.h> +#include <sof/trace/trace.h> +#include <ipc/trace.h> +#include <user/trace.h> + +#define DBG_LOCK_USERS 8 +#define DBG_LOCK_TRIES 10000 + +extern uint32_t lock_dbg_atomic; +extern uint32_t lock_dbg_user[DBG_LOCK_USERS]; + +extern struct tr_ctx sl_tr; + +/* panic on deadlock */ +#define spin_try_lock_dbg(lock, line) \ + do { \ + int __tries; \ + for (__tries = DBG_LOCK_TRIES; __tries > 0; __tries--) { \ + if (arch_try_lock(lock)) \ + break; /* lock acquired */ \ + } \ + if (__tries == 0) { \ + tr_err_atomic(&sl_tr, "DED"); \ + tr_err_atomic(&sl_tr, "line: %d", line); \ + tr_err_atomic(&sl_tr, "user: %d", (lock)->user); \ + panic(SOF_IPC_PANIC_DEADLOCK); /* lock not acquired */ \ + } \ + } while (0) + +#if CONFIG_DEBUG_LOCKS_VERBOSE +#define spin_lock_log(lock, line) \ + do { \ + if (lock_dbg_atomic) { \ + int __i = 0; \ + int __count = lock_dbg_atomic >= DBG_LOCK_USERS \ + ? DBG_LOCK_USERS : lock_dbg_atomic; \ + tr_err_atomic(&sl_tr, "eal"); \ + tr_err_atomic(&sl_tr, "line: %d", line); \ + tr_err_atomic(&sl_tr, "dbg_atomic: %d", lock_dbg_atomic); \ + for (__i = 0; __i < __count; __i++) { \ + tr_err_atomic(&sl_tr, "value: %d", \ + (lock_dbg_atomic << 24) | \ + lock_dbg_user[__i]); \ + } \ + } \ + } while (0) + +#define spin_lock_dbg(line) \ + do { \ + tr_info(&sl_tr, "LcE"); \ + tr_info(&sl_tr, "line: %d", line); \ + } while (0) + +#define spin_unlock_dbg(line) \ + do { \ + tr_info(&sl_tr, "LcX"); \ + tr_info(&sl_tr, "line: %d", line); \ + } while (0) + +#else /* CONFIG_DEBUG_LOCKS_VERBOSE */ +#define spin_lock_log(lock, line) do {} while (0) +#define spin_lock_dbg(line) do {} while (0) +#define spin_unlock_dbg(line) do {} while (0) +#endif /* CONFIG_DEBUG_LOCKS_VERBOSE */ + +#else /* CONFIG_DEBUG_LOCKS */ + +#define trace_lock(__e) do {} while (0) +#define tracev_lock(__e) do {} while (0) + +#define spin_lock_dbg(line) do {} while (0) +#define spin_unlock_dbg(line) do {} while (0) + +#endif /* CONFIG_DEBUG_LOCKS */ + +/* all SMP spinlocks need init, nothing todo on UP */ +static inline void _spinlock_init(struct k_spinlock *lock, int line) +{ + arch_spinlock_init(lock); +#if CONFIG_DEBUG_LOCKS + lock->user = line; +#endif +} + +#define k_spinlock_init(lock) _spinlock_init(lock, __LINE__) + +/* disables all IRQ sources and takes lock - enter atomic context */ +k_spinlock_key_t _k_spin_lock_irq(struct k_spinlock *lock); +#define k_spin_lock(lock) _k_spin_lock_irq(lock) + +/* re-enables current IRQ sources and releases lock - leave atomic context */ +void _k_spin_unlock_irq(struct k_spinlock *lock, k_spinlock_key_t key, int line); +#define k_spin_unlock(lock, key) _k_spin_unlock_irq(lock, key, __LINE__) + +#endif /* __POSIX_RTOS_SPINLOCK_H__ */ diff --git a/posix/include/rtos/string.h b/posix/include/rtos/string.h new file mode 100644 index 000000000000..b3ca03f9ca4e --- /dev/null +++ b/posix/include/rtos/string.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __POSIX_RTOS_STRING_H__ +#define __POSIX_RTOS_STRING_H__ + +#include <arch/string.h> +#include <stddef.h> + +/* C memcpy for arch that don't have arch_memcpy() */ +void cmemcpy(void *dest, void *src, size_t size); +int memcmp(const void *p, const void *q, size_t count); +int rstrlen(const char *s); +int rstrcmp(const char *s1, const char *s2); + +#if defined(arch_memcpy) +#define rmemcpy(dest, src, size) \ + arch_memcpy(dest, src, size) +#else +#define rmemcpy(dest, src, size) \ + cmemcpy(dest, src, size) +#endif + +#endif /* __POSIX_RTOS_STRING_H__ */ diff --git a/posix/include/rtos/task.h b/posix/include/rtos/task.h new file mode 100644 index 000000000000..5aca574a5787 --- /dev/null +++ b/posix/include/rtos/task.h @@ -0,0 +1,123 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __POSIX_RTOS_TASK_H__ +#define __POSIX_RTOS_TASK_H__ + +#include <arch/schedule/task.h> +#include <rtos/panic.h> +#include <sof/list.h> +#include <stdbool.h> +#include <stdint.h> +#include <rtos/kernel.h> +#include <sof/lib/perf_cnt.h> + +struct comp_dev; +struct sof; + +/** \brief Predefined LL task priorities. */ +#define SOF_TASK_PRI_HIGH 0 /* priority level 0 - high */ +#define SOF_TASK_PRI_MED 4 /* priority level 4 - medium */ +#define SOF_TASK_PRI_LOW 9 /* priority level 9 - low */ + +/** \brief Predefined EDF task deadlines. */ +#define SOF_TASK_DEADLINE_IDLE UINT64_MAX +#define SOF_TASK_DEADLINE_ALMOST_IDLE (SOF_TASK_DEADLINE_IDLE - 1) +#define SOF_TASK_DEADLINE_NOW 0 + +/** \brief Task counter initial value. */ +#define SOF_TASK_SKIP_COUNT 0xFFFFu + +/** \brief Task states. */ +enum task_state { + SOF_TASK_STATE_INIT = 0, + SOF_TASK_STATE_QUEUED, + SOF_TASK_STATE_PENDING, + SOF_TASK_STATE_RUNNING, + SOF_TASK_STATE_PREEMPTED, + SOF_TASK_STATE_COMPLETED, + SOF_TASK_STATE_FREE, + SOF_TASK_STATE_CANCEL, + SOF_TASK_STATE_RESCHEDULE, +}; + +/** \brief Task operations. */ +struct task_ops { + enum task_state (*run)(void *data); /**< task's main operation */ + void (*complete)(void *data); /**< executed on completion */ + uint64_t (*get_deadline)(void *data); /**< returns current deadline */ +}; + +/** \brief Task used by schedulers. */ +struct task { + uint64_t start; /**< start time in [ms] since now (LL only) */ + const struct sof_uuid_entry *uid; /**< Uuid */ + uint16_t type; /**< type of the task (LL or EDF) */ + uint16_t priority; /**< priority of the task (used by LL) */ + uint16_t core; /**< execution core */ + uint16_t flags; /**< custom flags */ + enum task_state state; /**< current state */ + void *data; /**< custom data passed to all ops */ + struct list_item list; /**< used by schedulers to hold tasks */ + void *priv_data; /**< task private data */ + struct task_ops ops; /**< task operations */ +#if defined(CONFIG_SCHEDULE_LOG_CYCLE_STATISTICS) + uint32_t cycles_sum; + uint32_t cycles_max; + uint32_t cycles_cnt; +#endif +#if CONFIG_PERFORMANCE_COUNTERS + struct perf_cnt_data pcd; +#endif +}; + +static inline bool task_is_active(struct task *task) +{ + switch (task->state) { + case SOF_TASK_STATE_QUEUED: + case SOF_TASK_STATE_PENDING: + case SOF_TASK_STATE_RUNNING: + case SOF_TASK_STATE_PREEMPTED: + case SOF_TASK_STATE_RESCHEDULE: + return true; + default: + return false; + } +} + +static inline enum task_state task_run(struct task *task) +{ + assert(task->ops.run); + + return task->ops.run(task->data); +} + +static inline void task_complete(struct task *task) +{ + if (task->ops.complete) + task->ops.complete(task->data); +} + +static inline uint64_t task_get_deadline(struct task *task) +{ + assert(task->ops.get_deadline); + + return task->ops.get_deadline(task->data); +} + +enum task_state task_main_primary_core(void *data); + +enum task_state task_main_secondary_core(void *data); + +void task_main_init(void); + +void task_main_free(void); + +int task_main_start(struct sof *sof); +int start_complete(void); + +#endif /* __POSIX_RTOS_TASK_H__ */ diff --git a/posix/include/rtos/timer.h b/posix/include/rtos/timer.h new file mode 100644 index 000000000000..b9756b66c87c --- /dev/null +++ b/posix/include/rtos/timer.h @@ -0,0 +1,132 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Janusz Jankowski <janusz.jankowski@linux.intel.com> + */ + +#ifndef __SOF_DRIVERS_TIMER_H__ +#define __SOF_DRIVERS_TIMER_H__ + +#include <arch/drivers/timer.h> +#include <rtos/clk.h> +#include <sof/lib/cpu.h> +#include <rtos/sof.h> +#include <sof/platform.h> +#include <stdint.h> + +struct comp_dev; +struct sof_ipc_stream_posn; + +#define TIMER0 0 +#define TIMER1 1 +#define TIMER2 2 +#define TIMER3 3 +#define TIMER4 4 + +int timer_register(struct timer *timer, void (*handler)(void *arg), void *arg); +void timer_unregister(struct timer *timer, void *arg); +void timer_enable(struct timer *timer, void *arg, int core); +void timer_disable(struct timer *timer, void *arg, int core); + +static inline struct timer *timer_get(void) +{ + return sof_get()->platform_timer; +} + +static inline struct timer *cpu_timer_get(void) +{ + return &(sof_get()->cpu_timers[cpu_get_id()]); +} + +static inline int64_t timer_set(struct timer *timer, uint64_t ticks) +{ + return arch_timer_set(timer, ticks); +} + +void timer_set_ms(struct timer *timer, unsigned int ms); + +static inline void timer_clear(struct timer *timer) +{ + arch_timer_clear(timer); +} + +unsigned int timer_get_count(struct timer *timer); + +unsigned int timer_get_count_delta(struct timer *timer); + +static inline uint64_t timer_get_system(struct timer *timer) +{ + return arch_timer_get_system(timer); +} + +int64_t platform_timer_set(struct timer *timer, uint64_t ticks); +void platform_timer_clear(struct timer *timer); +uint64_t platform_timer_get(struct timer *timer); +uint64_t platform_timer_get_atomic(struct timer *timer); + +static inline uint64_t platform_safe_get_time(struct timer *timer) +{ + /* Default to something small but at least 1.0 microsecond so it + * does not look like an uninitialized zero; not even when the + * user does not request any microseconds decimals. See + * DEFAULT_CLOCK constant in logger.c + */ + return timer ? platform_timer_get(timer) : 50; +} + +void platform_timer_start(struct timer *timer); +void platform_timer_stop(struct timer *timer); + +static inline uint64_t k_ms_to_cyc_ceil64(uint64_t ms) +{ + return clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, ms); +} + +static inline uint64_t k_us_to_cyc_ceil64(uint64_t us) +{ + return clock_us_to_ticks(PLATFORM_DEFAULT_CLOCK, us); +} + +static inline uint64_t k_ns_to_cyc_near64(uint64_t ns) +{ + return clock_ns_to_ticks(PLATFORM_DEFAULT_CLOCK, ns); +} + +static inline uint64_t k_cyc_to_ms_near64(uint64_t ticks) +{ + return ticks / clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1); +} + +static inline uint64_t k_cyc_to_us_near64(uint64_t ticks) +{ + return ticks / clock_us_to_ticks(PLATFORM_DEFAULT_CLOCK, 1); +} + +static inline uint64_t sof_cycle_get_64(void) +{ + return platform_timer_get(timer_get()); +} + +static inline uint64_t sof_cycle_get_64_atomic(void) +{ + return platform_timer_get_atomic(timer_get()); +} + +static inline uint64_t sof_cycle_get_64_safe(void) +{ + return platform_safe_get_time(timer_get()); +} + +/* get timestamp for host stream DMA position */ +void platform_host_timestamp(struct comp_dev *host, + struct sof_ipc_stream_posn *posn); + +/* get timestamp for DAI stream DMA position */ +void platform_dai_timestamp(struct comp_dev *dai, + struct sof_ipc_stream_posn *posn); + +/* get current wallclock for componnent */ +void platform_dai_wallclock(struct comp_dev *dai, uint64_t *wallclock); + +#endif /* __SOF_DRIVERS_TIMER_H__ */ diff --git a/posix/include/rtos/wait.h b/posix/include/rtos/wait.h new file mode 100644 index 000000000000..b6874888a763 --- /dev/null +++ b/posix/include/rtos/wait.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +/* + * Simple wait for event completion and signaling with timeouts. + */ + +#ifndef __POSIX_RTOS_WAIT_H__ +#define __POSIX_RTOS_WAIT_H__ + +#include <stddef.h> +#include <stdint.h> + +#if !CONFIG_LIBRARY +#include <arch/lib/wait.h> +#include <rtos/interrupt.h> +#include <rtos/timer.h> +#include <rtos/spinlock.h> +#include <sof/trace/trace.h> +#include <user/trace.h> + +extern struct tr_ctx wait_tr; + +static inline void wait_for_interrupt(int level) +{ + LOG_MODULE_DECLARE(wait, CONFIG_SOF_LOG_LEVEL); + + tr_dbg(&wait_tr, "WFE"); +#if CONFIG_DEBUG_LOCKS + if (lock_dbg_atomic) + tr_err_atomic(&wait_tr, "atm"); +#endif + platform_wait_for_interrupt(level); + tr_dbg(&wait_tr, "WFX"); +} + +/** + * \brief Waits at least passed number of clocks. + * \param[in] number_of_clks Minimum number of clocks to wait. + */ +void wait_delay(uint64_t number_of_clks); + +/** + * \brief Waits at least passed number of milliseconds. + * \param[in] ms Minimum number of milliseconds to wait. + */ +void wait_delay_ms(uint64_t ms); + +/** + * \brief Waits at least passed number of microseconds. + * \param[in] us Minimum number of microseconds to wait. + */ +void wait_delay_us(uint64_t us); +#else +static inline void wait_delay(uint64_t number_of_clks) {} +static inline void wait_delay_ms(uint64_t ms) {} +static inline void wait_delay_us(uint64_t us) {} +#endif + +int poll_for_register_delay(uint32_t reg, uint32_t mask, + uint32_t val, uint64_t us); + +#endif /* __POSIX_RTOS_WAIT_H__ */ diff --git a/posix/include/sof/compiler_attributes.h b/posix/include/sof/compiler_attributes.h new file mode 100644 index 000000000000..bf88bfac4369 --- /dev/null +++ b/posix/include/sof/compiler_attributes.h @@ -0,0 +1,52 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> + */ + +#ifdef __ZEPHYR__ + +/* Get __sparse_cache and __sparse_force definitions if __CHECKER__ is defined */ +#include <zephyr/debug/sparse.h> + +#else + +#define __sparse_cache +#define __sparse_force + +#ifndef __packed +#define __packed __attribute__((packed)) +#endif + +#ifndef __unused +#define __unused __attribute__((unused)) +#endif + +#endif + +#ifndef __aligned +#define __aligned(x) __attribute__((__aligned__(x))) +#endif + +#ifndef __section +#define __section(x) __attribute__((section(x))) +#endif + +/* The fallthrough attribute is supported since GCC 7.0 + * and Clang 10.0.0. + * + * Note that Clang sets __GNUC__ == 4 so the GCC version + * test will not be true here, and must go through + * the Clang version test. + */ +#if ((defined(__GNUC__) && (__GNUC__ >= 7)) || \ + (defined(__clang__) && (__clang_major__ >= 10))) && !defined(__CHECKER__) + +#define COMPILER_FALLTHROUGH __attribute__((fallthrough)) + +#else + +#define COMPILER_FALLTHROUGH /* fallthrough */ + +#endif diff --git a/posix/include/sof/compiler_info.h b/posix/include/sof/compiler_info.h new file mode 100644 index 000000000000..9716575b7188 --- /dev/null +++ b/posix/include/sof/compiler_info.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + * + * Author: Karol Trzcinski <karolx.trzcinski@linux.intel.com> + */ + +/** + * \file xtos/include/sof/compiler_info.h + * \brief Compiler version and name descriptor + * \author Karol Trzcinski <karolx.trzcinski@linux.intel.com> + */ + +#ifndef __SOF_COMPILER_INFO_H__ +#define __SOF_COMPILER_INFO_H__ + +#include <arch/compiler_info.h> + +#endif /* __SOF_COMPILER_INFO_H__ */ diff --git a/posix/include/sof/init.h b/posix/include/sof/init.h new file mode 100644 index 000000000000..ce8522cd34ad --- /dev/null +++ b/posix/include/sof/init.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __SOF_INIT_H__ +#define __SOF_INIT_H__ + +struct sof; + +/* main firmware entry point - argc and argv not currently used */ +#ifndef CONFIG_ARCH_POSIX +int main(int argc, char *argv[]); +#endif + +#if CONFIG_MULTICORE + +int secondary_core_init(struct sof *sof); + +#endif /* CONFIG_MULTICORE */ + +int arch_init(void); + +#endif /* __SOF_INIT_H__ */ diff --git a/posix/include/sof/lib/agent.h b/posix/include/sof/lib/agent.h new file mode 100644 index 000000000000..6e70a4ce997d --- /dev/null +++ b/posix/include/sof/lib/agent.h @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2017 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __SOF_LIB_AGENT_H__ +#define __SOF_LIB_AGENT_H__ + +#include <rtos/atomic.h> +#include <sof/lib/memory.h> +#include <sof/lib/perf_cnt.h> +#include <rtos/task.h> +#include <rtos/sof.h> + +#include <stdbool.h> +#include <stdint.h> + +struct sof; + +/* simple agent */ +struct sa { + uint64_t last_check; /* time of last activity checking */ + uint64_t panic_timeout; /* threshold of panic */ + uint64_t warn_timeout; /* threshold of warning */ +#if CONFIG_PERFORMANCE_COUNTERS + struct perf_cnt_data pcd; +#endif + struct task work; + atomic_t panic_cnt; /**< ref counter for panic_on_delay property */ + bool panic_on_delay; /**< emits panic on delay if true */ +}; + +#if CONFIG_HAVE_AGENT + +/** + * Enables or disables panic on agent delay. + * @param enabled True for panic enabling, false otherwise. + */ +static inline void sa_set_panic_on_delay(bool enabled) +{ + struct sa *sa = sof_get()->sa; + + if (enabled) + atomic_add(&sa->panic_cnt, 1); + else + atomic_sub(&sa->panic_cnt, 1); + + /* enable panic only if no refs */ + sa->panic_on_delay = !atomic_read(&sa->panic_cnt); + +} + +void sa_init(struct sof *sof, uint64_t timeout); +void sa_exit(struct sof *sof); + +#else + +static inline void sa_init(struct sof *sof, uint64_t timeout) { } +static inline void sa_exit(struct sof *sof) { } +static inline void sa_set_panic_on_delay(bool enabled) { } + +#endif + +#endif /* __SOF_LIB_AGENT_H__ */ diff --git a/posix/include/sof/lib/cpu.h b/posix/include/sof/lib/cpu.h new file mode 100644 index 000000000000..d53e15e7535a --- /dev/null +++ b/posix/include/sof/lib/cpu.h @@ -0,0 +1,93 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +/** + * \file xtos/include/sof/lib/cpu.h + * \brief CPU header file + * \authors Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +#ifndef __SOF_LIB_CPU_H__ +#define __SOF_LIB_CPU_H__ +#ifndef __ZEPHYR__ + +#include <platform/lib/cpu.h> + +#if !defined(__ASSEMBLER__) && !defined(LINKER) + +#include <arch/lib/cpu.h> +#include <stdbool.h> + +/* let the compiler optimise when in single core mode */ +#if CONFIG_CORE_COUNT == 1 + +static inline int cpu_get_id(void) +{ + return 0; +} + +static inline bool cpu_is_primary(int id) +{ + return 1; +} + +static inline bool cpu_is_me(int id) +{ + return 1; +} + +#else + +static inline int cpu_get_id(void) +{ + return arch_cpu_get_id(); +} + +static inline bool cpu_is_primary(int id) +{ + return id == PLATFORM_PRIMARY_CORE_ID; +} + +static inline bool cpu_is_me(int id) +{ + return id == cpu_get_id(); +} +#endif + +static inline int cpu_enable_core(int id) +{ + return arch_cpu_enable_core(id); +} + +static inline void cpu_disable_core(int id) +{ + arch_cpu_disable_core(id); +} + +static inline int cpu_is_core_enabled(int id) +{ + return arch_cpu_is_core_enabled(id); +} + +static inline int cpu_enabled_cores(void) +{ + return arch_cpu_enabled_cores(); +} + +static inline int cpu_restore_secondary_cores(void) +{ + return arch_cpu_restore_secondary_cores(); +} + +static inline int cpu_secondary_cores_prepare_d0ix(void) +{ + return arch_cpu_secondary_cores_prepare_d0ix(); +} + +#endif +#endif +#endif /* __SOF_LIB_CPU_H__ */ diff --git a/posix/include/sof/lib/dai.h b/posix/include/sof/lib/dai.h new file mode 100644 index 000000000000..47677c19ae4c --- /dev/null +++ b/posix/include/sof/lib/dai.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + */ + +/** + * \file xtos/include/sof/lib/dai.h + * \brief DAI Drivers definition + * \author Liam Girdwood <liam.r.girdwood@linux.intel.com> + * \author Keyon Jie <yang.jie@linux.intel.com> + */ + +#ifndef __SOF_LIB_DAI_H__ +#define __SOF_LIB_DAI_H__ + +#ifdef CONFIG_ZEPHYR_NATIVE_DRIVERS +#include <sof/lib/dai-zephyr.h> +#else +#include <sof/lib/dai-legacy.h> +#endif + +struct ipc4_ipcgtw_cmd; + +static inline int ipcgtw_process_cmd(const struct ipc4_ipcgtw_cmd *cmd, + void *reply_payload, uint32_t *reply_payload_size) +{ + return 0; +} + +#endif /* __SOF_LIB_DAI_H__ */ diff --git a/posix/include/sof/lib/dma.h b/posix/include/sof/lib/dma.h new file mode 100644 index 000000000000..af9e4191cbbb --- /dev/null +++ b/posix/include/sof/lib/dma.h @@ -0,0 +1,589 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + */ + +/** + * \file xtos/include/sof/lib/dma.h + * \brief DMA Drivers definition + * \author Liam Girdwood <liam.r.girdwood@linux.intel.com> + * \author Keyon Jie <yang.jie@linux.intel.com> + */ + +#ifndef __SOF_LIB_DMA_H__ +#define __SOF_LIB_DMA_H__ + +#include <platform/lib/dma.h> +#include <rtos/atomic.h> +#include <rtos/bit.h> +#include <rtos/alloc.h> +#include <sof/lib/io.h> +#include <sof/lib/memory.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> + +#ifdef __ZEPHYR__ +#include <zephyr/device.h> +#include <zephyr/drivers/dma.h> +#endif + +struct comp_buffer; + +/** \addtogroup sof_dma_drivers DMA Drivers + * DMA Drivers API specification. + * @{ + */ + +/* DMA direction bitmasks used to define DMA copy direction */ +#define DMA_DIR_MEM_TO_MEM BIT(0) /**< local memory copy */ +#define DMA_DIR_HMEM_TO_LMEM BIT(1) /**< host memory to local mem copy */ +#define DMA_DIR_LMEM_TO_HMEM BIT(2) /**< local mem to host mem copy */ +#define DMA_DIR_MEM_TO_DEV BIT(3) /**< local mem to dev copy */ +#define DMA_DIR_DEV_TO_MEM BIT(4) /**< dev to local mem copy */ +#define DMA_DIR_DEV_TO_DEV BIT(5) /**< dev to dev copy */ + +/* DMA capabilities bitmasks used to define the type of DMA */ +#define DMA_CAP_HDA BIT(0) /**< HDA DMA */ +#define DMA_CAP_GP_LP BIT(1) /**< GP LP DMA */ +#define DMA_CAP_GP_HP BIT(2) /**< GP HP DMA */ +#define DMA_CAP_BT BIT(3) /**< BT DMA */ +#define DMA_CAP_SP BIT(4) /**< SP DMA */ +#define DMA_CAP_DMIC BIT(5) /**< ACP DMA DMIC > */ +#define DMA_CAP_SP_VIRTUAL BIT(6) /**< SP VIRTUAL DMA */ +#define DMA_CAP_HS_VIRTUAL BIT(7) /**< HS VIRTUAL DMA */ + +/* DMA dev type bitmasks used to define the type of DMA */ + +#define DMA_DEV_HOST BIT(0) /**< connectable to host */ +#define DMA_DEV_HDA BIT(1) /**< connectable to HD/A link */ +#define DMA_DEV_SSP BIT(2) /**< connectable to SSP fifo */ +#define DMA_DEV_DMIC BIT(3) /**< connectable to DMIC fifo */ +#define DMA_DEV_SSI BIT(4) /**< connectable to SSI / SPI fifo */ +#define DMA_DEV_ALH BIT(5) /**< connectable to ALH link */ +#define DMA_DEV_SAI BIT(6) /**< connectable to SAI fifo */ +#define DMA_DEV_ESAI BIT(7) /**< connectable to ESAI fifo */ +#define DMA_DEV_BT BIT(8) /**< connectable to ACP BT I2S */ +#define DMA_DEV_SP BIT(9) /**< connectable to ACP SP I2S */ +#define DMA_DEV_AFE_MEMIF BIT(10) /**< connectable to AFE fifo */ +#define DMA_DEV_SP_VIRTUAL BIT(11) /**< connectable to ACP SP VIRTUAL I2S */ +#define DMA_DEV_HS_VIRTUAL BIT(12) /**< connectable to ACP HS VIRTUAL I2S */ + +/* DMA access privilege flag */ +#define DMA_ACCESS_EXCLUSIVE 1 +#define DMA_ACCESS_SHARED 0 + +/* DMA copy flags */ +#define DMA_COPY_BLOCKING BIT(0) +#define DMA_COPY_ONE_SHOT BIT(1) + +/* We will use this enum in cb handler to inform dma what + * action we need to perform. + */ +enum dma_cb_status { + DMA_CB_STATUS_RELOAD = 0, + DMA_CB_STATUS_END, +}; + +/* DMA interrupt commands */ +enum dma_irq_cmd { + DMA_IRQ_STATUS_GET = 0, + DMA_IRQ_CLEAR, + DMA_IRQ_MASK, + DMA_IRQ_UNMASK +}; + +#define DMA_CHAN_INVALID 0xFFFFFFFF +#define DMA_CORE_INVALID 0xFFFFFFFF + +/* Attributes have been ported to Zephyr. This condition is necessary until full support of + * CONFIG_SOF_ZEPHYR_STRICT_HEADERS. + */ +#ifndef CONFIG_ZEPHYR_NATIVE_DRIVERS +/* DMA attributes */ +#define DMA_ATTR_BUFFER_ALIGNMENT 0 +#define DMA_ATTR_COPY_ALIGNMENT 1 +#define DMA_ATTR_BUFFER_ADDRESS_ALIGNMENT 2 +#define DMA_ATTR_BUFFER_PERIOD_COUNT 3 +#endif + +struct dma; + +/** + * \brief Element of SG list (as array item). + */ +struct dma_sg_elem { + uint32_t src; /**< source address */ + uint32_t dest; /**< destination address */ + uint32_t size; /**< size (in bytes) */ +}; + +/** + * \brief Data used in DMA callbacks. + */ +struct dma_cb_data { + struct dma_chan_data *channel; + struct dma_sg_elem elem; + enum dma_cb_status status; +}; + +/** + * \brief SG elem array. + */ +struct dma_sg_elem_array { + uint32_t count; /**< number of elements in elems */ + struct dma_sg_elem *elems; /**< elements */ +}; + +/* DMA physical SG params */ +struct dma_sg_config { + uint32_t src_width; /* in bytes */ + uint32_t dest_width; /* in bytes */ + uint32_t burst_elems; + uint32_t direction; + uint32_t src_dev; + uint32_t dest_dev; + uint32_t cyclic; /* circular buffer */ + uint64_t period; + struct dma_sg_elem_array elem_array; /* array of dma_sg elems */ + bool scatter; + bool irq_disabled; + /* true if configured DMA channel is the scheduling source */ + bool is_scheduling_source; +}; + +struct dma_chan_status { + uint32_t state; + uint32_t flags; + uint32_t w_pos; + uint32_t r_pos; + uint32_t timestamp; + + /* dma position info for ipc4 */ + void *ipc_posn_data; +}; + +/* DMA operations */ +struct dma_ops { + + struct dma_chan_data *(*channel_get)(struct dma *dma, + unsigned int req_channel); + void (*channel_put)(struct dma_chan_data *channel); + + int (*start)(struct dma_chan_data *channel); + int (*stop)(struct dma_chan_data *channel); + int (*stop_delayed)(struct dma_chan_data *channel); + int (*copy)(struct dma_chan_data *channel, int bytes, uint32_t flags); + int (*pause)(struct dma_chan_data *channel); + int (*release)(struct dma_chan_data *channel); + int (*status)(struct dma_chan_data *channel, + struct dma_chan_status *status, uint8_t direction); + + int (*set_config)(struct dma_chan_data *channel, + struct dma_sg_config *config); + + int (*probe)(struct dma *dma); + int (*remove)(struct dma *dma); + + int (*get_data_size)(struct dma_chan_data *channel, uint32_t *avail, + uint32_t *free); + + int (*get_attribute)(struct dma *dma, uint32_t type, uint32_t *value); + + int (*interrupt)(struct dma_chan_data *channel, enum dma_irq_cmd cmd); +}; + +/* DMA platform data */ +struct dma_plat_data { + uint32_t id; + uint32_t dir; /* bitmask of supported copy directions */ + uint32_t caps; /* bitmask of supported capabilities */ + uint32_t devs; /* bitmask of supported devs */ + uint32_t base; + uint32_t channels; + int irq; + const char *irq_name; + uint32_t chan_size; + const void *drv_plat_data; +#ifdef __ZEPHYR__ + uint32_t period_count; +#endif +}; + +struct dma { + struct dma_plat_data plat_data; + struct k_spinlock lock; /**< locking mechanism */ + int sref; /**< simple ref counter, guarded by lock */ + const struct dma_ops *ops; + atomic_t num_channels_busy; /* number of busy channels */ + struct dma_chan_data *chan; /* channels array */ +#ifdef __ZEPHYR__ + const struct device *z_dev; /* Zephyr driver */ +#endif + void *priv_data; +}; + +struct dma_chan_data { + struct dma *dma; + + uint32_t status; + uint32_t direction; + uint32_t desc_count; + uint32_t index; + uint32_t core; + uint64_t period; /* DMA channel's transfer period in us */ + /* true if this DMA channel is the scheduling source */ + bool is_scheduling_source; + + /* device specific data set by the device that requests the DMA channel */ + void *dev_data; + + void *priv_data; +}; + +struct dma_info { + struct dma *dma_array; + size_t num_dmas; +}; + +struct audio_stream; +typedef int (*dma_process_func)(const struct audio_stream __sparse_cache *source, + uint32_t ioffset, struct audio_stream __sparse_cache *sink, + uint32_t ooffset, uint32_t frames); + +/** + * \brief API to initialize a platform DMA controllers. + * + * \param[in] sof Pointer to firmware main context. + */ +int dmac_init(struct sof *sof); + +/** + * \brief API to request a platform DMAC. + * + * Users can request DMAC based on dev type, copy direction, capabilities + * and access privilege. + * For exclusive access, ret DMAC with no channels draining. + * For shared access, ret DMAC with the least number of channels draining. + */ +struct dma *dma_get(uint32_t dir, uint32_t caps, uint32_t dev, uint32_t flags); + +/** + * \brief API to release a platform DMAC. + * + * @param[in] dma DMAC to relese. + */ +void dma_put(struct dma *dma); + +#define dma_set_drvdata(dma, data) \ + (dma->priv_data = data) +#define dma_get_drvdata(dma) \ + dma->priv_data +#define dma_base(dma) \ + dma->plat_data.base +#define dma_irq(dma) \ + dma->plat_data.irq +#define dma_irq_name(dma) \ + dma->plat_data.irq_name +#define dma_chan_size(dma) \ + dma->plat_data.chan_size +#define dma_chan_base(dma, chan) \ + (dma->plat_data.base + chan * dma->plat_data.chan_size) +#define dma_chan_get_data(chan) \ + ((chan)->priv_data) +#define dma_chan_set_data(chan, data) \ + ((chan)->priv_data = data) + +/* DMA API + * Programming flow is :- + * + * 1) dma_channel_get() + * 2) notifier_register() + * 3) dma_set_config() + * 4) dma_start() + * ... DMA now running ... + * 5) dma_stop() + * 6) dma_stop_delayed() + * 7) dma_channel_put() + */ + +static inline struct dma_chan_data *dma_channel_get_legacy(struct dma *dma, + int req_channel) +{ + if (!dma || !dma->ops || !dma->ops->channel_get) + return NULL; + + struct dma_chan_data *chan = dma->ops->channel_get(dma, req_channel); + + return chan; +} + +static inline void dma_channel_put_legacy(struct dma_chan_data *channel) +{ + channel->dma->ops->channel_put(channel); +} + +static inline int dma_start_legacy(struct dma_chan_data *channel) +{ + return channel->dma->ops->start(channel); +} + +static inline int dma_stop_legacy(struct dma_chan_data *channel) +{ + if (channel->dma->ops->stop) + return channel->dma->ops->stop(channel); + + return 0; +} + +static inline int dma_stop_delayed_legacy(struct dma_chan_data *channel) +{ + if (channel->dma->ops->stop_delayed) + return channel->dma->ops->stop_delayed(channel); + + return 0; +} + +/** \defgroup sof_dma_copy_func static int dma_copy (struct dma_chan_data * channel, int bytes, uint32_t flags) + * + * This function is in a separate subgroup to solve a name clash with + * struct dma_copy {} + * @{ + */ +static inline int dma_copy_legacy(struct dma_chan_data *channel, int bytes, + uint32_t flags) +{ + return channel->dma->ops->copy(channel, bytes, flags); +} +/** @} */ + +static inline int dma_pause_legacy(struct dma_chan_data *channel) +{ + if (channel->dma->ops->pause) + return channel->dma->ops->pause(channel); + + return 0; +} + +static inline int dma_release_legacy(struct dma_chan_data *channel) +{ + if (channel->dma->ops->release) + return channel->dma->ops->release(channel); + + return 0; +} + +static inline int dma_status_legacy(struct dma_chan_data *channel, + struct dma_chan_status *status, uint8_t direction) +{ + return channel->dma->ops->status(channel, status, direction); +} + +static inline int dma_set_config_legacy(struct dma_chan_data *channel, + struct dma_sg_config *config) +{ + return channel->dma->ops->set_config(channel, config); +} + +static inline int dma_probe_legacy(struct dma *dma) +{ + return dma->ops->probe(dma); +} + +static inline int dma_remove_legacy(struct dma *dma) +{ + return dma->ops->remove(dma); +} + +static inline int dma_get_data_size_legacy(struct dma_chan_data *channel, + uint32_t *avail, uint32_t *free) +{ + return channel->dma->ops->get_data_size(channel, avail, free); +} + +static inline int dma_get_attribute_legacy(struct dma *dma, uint32_t type, + uint32_t *value) +{ + return dma->ops->get_attribute(dma, type, value); +} + +static inline int dma_interrupt_legacy(struct dma_chan_data *channel, + enum dma_irq_cmd cmd) +{ + return channel->dma->ops->interrupt(channel, cmd); +} + +/* DMA hardware register operations */ +static inline uint32_t dma_reg_read(struct dma *dma, uint32_t reg) +{ + return io_reg_read(dma_base(dma) + reg); +} + +static inline uint16_t dma_reg_read16(struct dma *dma, uint32_t reg) +{ + return io_reg_read16(dma_base(dma) + reg); +} + +static inline void dma_reg_write(struct dma *dma, uint32_t reg, uint32_t value) +{ + io_reg_write(dma_base(dma) + reg, value); +} + +static inline void dma_reg_write16(struct dma *dma, uint32_t reg, + uint16_t value) +{ + io_reg_write16(dma_base(dma) + reg, value); +} + +static inline void dma_reg_update_bits(struct dma *dma, uint32_t reg, + uint32_t mask, uint32_t value) +{ + io_reg_update_bits(dma_base(dma) + reg, mask, value); +} + +static inline uint32_t dma_chan_reg_read(struct dma_chan_data *channel, + uint32_t reg) +{ + return io_reg_read(dma_chan_base(channel->dma, channel->index) + reg); +} + +static inline uint16_t dma_chan_reg_read16(struct dma_chan_data *channel, + uint32_t reg) +{ + return io_reg_read16(dma_chan_base(channel->dma, channel->index) + reg); +} + +static inline void dma_chan_reg_write(struct dma_chan_data *channel, + uint32_t reg, uint32_t value) +{ + io_reg_write(dma_chan_base(channel->dma, channel->index) + reg, value); +} + +static inline void dma_chan_reg_write16(struct dma_chan_data *channel, + uint32_t reg, uint16_t value) +{ + io_reg_write16(dma_chan_base(channel->dma, channel->index) + reg, + value); +} + +static inline void dma_chan_reg_update_bits(struct dma_chan_data *channel, + uint32_t reg, uint32_t mask, + uint32_t value) +{ + io_reg_update_bits(dma_chan_base(channel->dma, channel->index) + reg, + mask, value); +} + +static inline void dma_chan_reg_update_bits16(struct dma_chan_data *channel, + uint32_t reg, uint16_t mask, + uint16_t value) +{ + io_reg_update_bits16(dma_chan_base(channel->dma, channel->index) + reg, + mask, value); +} + +static inline bool dma_is_scheduling_source(struct dma_chan_data *channel) +{ + return channel->is_scheduling_source; +} + +static inline void dma_sg_init(struct dma_sg_elem_array *ea) +{ + ea->count = 0; + ea->elems = NULL; +} + +int dma_sg_alloc(struct dma_sg_elem_array *ea, + enum mem_zone zone, + uint32_t direction, + uint32_t buffer_count, uint32_t buffer_bytes, + uintptr_t dma_buffer_addr, uintptr_t external_addr); + +void dma_sg_free(struct dma_sg_elem_array *ea); + +/** + * \brief Get the total size of SG buffer + * + * \param ea Array of SG elements. + * \return Size of the buffer. + */ +static inline uint32_t dma_sg_get_size(struct dma_sg_elem_array *ea) +{ + int i; + uint32_t size = 0; + + for (i = 0 ; i < ea->count; i++) + size += ea->elems[i].size; + + return size; +} + +struct audio_stream; +typedef void (*dma_process)(const struct audio_stream *, + struct audio_stream *, uint32_t); + +/* copies data from DMA buffer using provided processing function */ +int dma_buffer_copy_from(struct comp_buffer __sparse_cache *source, + struct comp_buffer __sparse_cache *sink, + dma_process_func process, uint32_t source_bytes); + +/* copies data to DMA buffer using provided processing function */ +int dma_buffer_copy_to(struct comp_buffer __sparse_cache *source, + struct comp_buffer __sparse_cache *sink, + dma_process_func process, uint32_t sink_bytes); + +/* + * Used when copying DMA buffer bytes into multiple sink buffers, one at a time using the provided + * conversion function. DMA buffer consume should be performed after the data has been copied + * to all sinks. + */ +int dma_buffer_copy_from_no_consume(struct comp_buffer __sparse_cache *source, + struct comp_buffer __sparse_cache *sink, + dma_process_func process, uint32_t source_bytes); + +/* generic DMA DSP <-> Host copier */ + +struct dma_copy { + struct dma_chan_data *chan; + struct dma *dmac; +}; + +/* init dma copy context */ +int dma_copy_new(struct dma_copy *dc); + +/* free dma copy context resources */ +static inline void dma_copy_free(struct dma_copy *dc) +{ + dma_channel_put_legacy(dc->chan); +} + +/* DMA copy data from host to DSP */ +int dma_copy_from_host(struct dma_copy *dc, struct dma_sg_config *host_sg, + int32_t host_offset, void *local_ptr, int32_t size); +int dma_copy_from_host_nowait(struct dma_copy *dc, + struct dma_sg_config *host_sg, + int32_t host_offset, void *local_ptr, + int32_t size); + +/* DMA copy data from DSP to host */ +int dma_copy_to_host(struct dma_copy *dc, struct dma_sg_config *host_sg, + int32_t host_offset, void *local_ptr, int32_t size); +int dma_copy_to_host_nowait(struct dma_copy *dc, struct dma_sg_config *host_sg, + int32_t host_offset, void *local_ptr, int32_t size); + + +int dma_copy_set_stream_tag(struct dma_copy *dc, uint32_t stream_tag); + +static inline const struct dma_info *dma_info_get(void) +{ + return sof_get()->dma_info; +} + +/** @}*/ + +#endif /* __SOF_LIB_DMA_H__ */ diff --git a/posix/include/sof/lib/io.h b/posix/include/sof/lib/io.h new file mode 100644 index 000000000000..07f1e5aa1fbe --- /dev/null +++ b/posix/include/sof/lib/io.h @@ -0,0 +1,88 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __XTOS_POSIX_LIB_IO_H__ +#define __XTOS_POSIX_LIB_IO_H__ + + +#include <stdint.h> + +#if CONFIG_LIBRARY + +static inline uint32_t io_reg_read(uint32_t reg) { return 0; } +static inline void io_reg_write(uint32_t reg, uint32_t val) {} +static inline void io_reg_update_bits(uint32_t reg, uint32_t mask, + uint32_t value) {} +static inline uint16_t io_reg_read16(uint32_t reg) { return 0; } +static inline void io_reg_write16(uint32_t reg, uint16_t val) {} +static inline void io_reg_update_bits16(uint32_t reg, uint16_t mask, + uint16_t value) {} + +#else + +static inline uint32_t io_reg_read(uint32_t reg) +{ + return *((volatile uint32_t *)reg); +} + +static inline void io_reg_write(uint32_t reg, uint32_t val) +{ + *((volatile uint32_t *)reg) = val; +} + +static inline void io_reg_update_bits(uint32_t reg, uint32_t mask, + uint32_t value) +{ + io_reg_write(reg, (io_reg_read(reg) & (~mask)) | (value & mask)); +} + +static inline uint16_t io_reg_read16(uint32_t reg) +{ + return *((volatile uint16_t *)reg); +} + +static inline void io_reg_write16(uint32_t reg, uint16_t val) +{ + *((volatile uint16_t *)reg) = val; +} + +static inline uint64_t io_reg_read64(uint32_t reg) +{ + return (uint64_t)io_reg_read(reg) + + (((uint64_t)io_reg_read(reg + 4)) << 32); +} + +static inline void io_reg_write64(uint32_t reg, uint64_t val) +{ + *((volatile uint64_t *)reg) = val; +} + +static inline void io_reg_update_bits16(uint32_t reg, uint16_t mask, + uint16_t value) +{ + io_reg_write16(reg, (io_reg_read16(reg) & (~mask)) | (value & mask)); +} + +static inline uint8_t io_reg_read8(uint32_t reg) +{ + return *((volatile uint8_t *)reg); +} + +static inline void io_reg_write8(uint32_t reg, uint8_t val) +{ + *((volatile uint8_t *)reg) = val; +} + +static inline void io_reg_update_bits8(uint32_t reg, uint8_t mask, + uint8_t value) +{ + io_reg_write8(reg, (io_reg_read8(reg) & (~mask)) | (value & mask)); +} + +#endif + +#endif /* __XTOS_POSIX_LIB_IO_H__ */ diff --git a/posix/include/sof/lib/mailbox.h b/posix/include/sof/lib/mailbox.h new file mode 100644 index 000000000000..3d43a22e10ec --- /dev/null +++ b/posix/include/sof/lib/mailbox.h @@ -0,0 +1,118 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Xiuli Pan <xiuli.pan@linux.intel.com> + */ + +#ifndef __SOF_LIB_MAILBOX_H__ +#define __SOF_LIB_MAILBOX_H__ + +#include <sof/common.h> +#include <kernel/mailbox.h> +#include <platform/lib/mailbox.h> +#include <rtos/panic.h> +#include <rtos/cache.h> +#include <sof/lib/memory.h> +#include <rtos/string.h> +#include <stddef.h> +#include <stdint.h> + +#define mailbox_get_exception_base() \ + MAILBOX_EXCEPTION_BASE + +#define mailbox_get_exception_size() \ + MAILBOX_EXCEPTION_SIZE + +#define mailbox_get_dspbox_base() \ + MAILBOX_DSPBOX_BASE + +#define mailbox_get_dspbox_size() \ + MAILBOX_DSPBOX_SIZE + +#define mailbox_get_hostbox_base() \ + MAILBOX_HOSTBOX_BASE + +#define mailbox_get_hostbox_size() \ + MAILBOX_HOSTBOX_SIZE + +#define mailbox_get_debug_base() \ + MAILBOX_DEBUG_BASE + +#define mailbox_get_debug_size() \ + MAILBOX_DEBUG_SIZE + +static inline +void mailbox_dspbox_write(size_t offset, const void *src, size_t bytes) +{ + int dsp_write_err __unused = memcpy_s((void *)(MAILBOX_DSPBOX_BASE + offset), + MAILBOX_DSPBOX_SIZE - offset, src, bytes); + + assert(!dsp_write_err); + dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_DSPBOX_BASE + + offset), bytes); +} + +static inline +void mailbox_dspbox_read(void *dest, size_t dest_size, + size_t offset, size_t bytes) +{ + int dsp_read_err __unused; + + dcache_invalidate_region((__sparse_force void __sparse_cache *)(MAILBOX_DSPBOX_BASE + + offset), bytes); + dsp_read_err = memcpy_s(dest, dest_size, + (void *)(MAILBOX_DSPBOX_BASE + offset), bytes); + assert(!dsp_read_err); +} + +#if CONFIG_LIBRARY + +#define mailbox_hostbox_write(_offset, _src, _bytes) \ + memcpy((char *)ipc->comp_data + _offset, _src, _bytes) + +static inline uint64_t mailbox_sw_reg_read64(uint32_t offset) +{ + return 0; +} +#else + +static inline +void mailbox_hostbox_write(size_t offset, const void *src, size_t bytes) +{ + int host_write_err __unused = memcpy_s((void *)(MAILBOX_HOSTBOX_BASE + offset), + MAILBOX_HOSTBOX_SIZE - offset, src, bytes); + + assert(!host_write_err); + dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_HOSTBOX_BASE + + offset), bytes); +} + +#endif + +static inline +void mailbox_hostbox_read(void *dest, size_t dest_size, + size_t offset, size_t bytes) +{ + int host_read_err __unused; + + dcache_invalidate_region((__sparse_force void __sparse_cache *)(MAILBOX_HOSTBOX_BASE + + offset), bytes); + host_read_err = memcpy_s(dest, dest_size, + (void *)(MAILBOX_HOSTBOX_BASE + offset), bytes); + assert(!host_read_err); +} + +static inline +void mailbox_stream_write(size_t offset, const void *src, size_t bytes) +{ + int stream_write_err __unused = memcpy_s((void *)(MAILBOX_STREAM_BASE + offset), + MAILBOX_STREAM_SIZE - offset, src, bytes); + + assert(!stream_write_err); + dcache_writeback_region((__sparse_force void __sparse_cache *)(MAILBOX_STREAM_BASE + + offset), bytes); +} + +#endif /* __SOF_LIB_MAILBOX_H__ */ diff --git a/posix/include/sof/lib/memory.h b/posix/include/sof/lib/memory.h new file mode 100644 index 000000000000..8fcbc1f9adbe --- /dev/null +++ b/posix/include/sof/lib/memory.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + * + * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +#ifndef __SOF_LIB_MEMORY_H__ +#define __SOF_LIB_MEMORY_H__ + +#include <platform/lib/memory.h> + +#endif /* __SOF_LIB_MEMORY_H__ */ diff --git a/posix/include/sof/lib/mm_heap.h b/posix/include/sof/lib/mm_heap.h new file mode 100644 index 000000000000..7bdab176eb5f --- /dev/null +++ b/posix/include/sof/lib/mm_heap.h @@ -0,0 +1,113 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + */ + +#ifndef __SOF_LIB_MM_HEAP_H__ +#define __SOF_LIB_MM_HEAP_H__ + +#include <sof/common.h> +#include <rtos/alloc.h> +#include <rtos/cache.h> +#include <sof/lib/memory.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> + +#include <stddef.h> +#include <stdint.h> + +struct dma_copy; +struct dma_sg_config; + +struct mm_info { + uint32_t used; + uint32_t free; +}; + +struct block_hdr { + uint16_t size; /* size in blocks for continuous allocation */ + uint16_t used; /* usage flags for page */ + void *unaligned_ptr; /* align ptr */ +} __packed; + +struct block_map { + uint16_t block_size; /* size of block in bytes */ + uint16_t count; /* number of blocks in map */ + uint16_t free_count; /* number of free blocks */ + uint16_t first_free; /* index of first free block */ + struct block_hdr *block; /* base block header */ + uint32_t base; /* base address of space */ +}; + +#define BLOCK_DEF(sz, cnt, hdr) \ + {.block_size = sz, .count = cnt, .free_count = cnt, .block = hdr, \ + .first_free = 0} + +struct mm_heap { + uint32_t blocks; + struct block_map *map; +#if CONFIG_LIBRARY + unsigned long heap; +#else + uint32_t heap; +#endif + uint32_t size; + uint32_t caps; + struct mm_info info; +}; + +/* heap block memory map */ +struct mm { + /* system heap - used during init cannot be freed */ + struct mm_heap system[PLATFORM_HEAP_SYSTEM]; + /* system runtime heap - used for runtime system components */ + struct mm_heap system_runtime[PLATFORM_HEAP_SYSTEM_RUNTIME]; +#if CONFIG_CORE_COUNT > 1 + /* object shared between different cores - used during init cannot be freed */ + struct mm_heap system_shared[PLATFORM_HEAP_SYSTEM_SHARED]; + /* object shared between different cores */ + struct mm_heap runtime_shared[PLATFORM_HEAP_RUNTIME_SHARED]; +#endif + /* general heap for components */ + struct mm_heap runtime[PLATFORM_HEAP_RUNTIME]; + /* general component buffer heap */ + struct mm_heap buffer[PLATFORM_HEAP_BUFFER]; + + struct mm_info total; + uint32_t heap_trace_updated; /* updates that can be presented */ + struct k_spinlock lock; /* all allocs and frees are atomic */ +}; + +/* Heap save/restore contents and context for PM D0/D3 events */ +uint32_t mm_pm_context_size(void); + +/* heap initialisation */ +void init_heap(struct sof *sof); + +/* frees entire heap (supported for secondary core system heap atm) */ +void free_heap(enum mem_zone zone); + +/* status */ +void heap_trace_all(int force); +void heap_trace(struct mm_heap *heap, int size); + +#if CONFIG_DEBUG_MEMORY_USAGE_SCAN +/** Fetch runtime information about heap, like used and free memory space + * @param zone to check, see enum mem_zone. + * @param index heap index, eg. cpu core index for any *SYS* zone + * @param out output variable + * @return error code or zero + */ +int heap_info(enum mem_zone zone, int index, struct mm_info *out); +#endif + +/* retrieve memory map pointer */ +static inline struct mm *memmap_get(void) +{ + return sof_get()->memory_map; +} + +#endif /* __SOF_LIB_MM_HEAP_H__ */ diff --git a/posix/include/sof/lib/perf_cnt.h b/posix/include/sof/lib/perf_cnt.h new file mode 100644 index 000000000000..bddda9c8e06b --- /dev/null +++ b/posix/include/sof/lib/perf_cnt.h @@ -0,0 +1,188 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + * + * Author: Marcin Maka <marcin.maka@linux.intel.com> + */ + +/** + * \file xtos/include/sof/lib/perf_cnt.h + * \brief Simple performance counters + * \author Marcin Maka <marcin.maka@linux.intel.com> + */ + +#ifndef __SOF_LIB_PERF_CNT_H__ +#define __SOF_LIB_PERF_CNT_H__ + +#include <rtos/timer.h> + +struct perf_cnt_data { + uint32_t plat_ts; + uint32_t cpu_ts; + uint32_t plat_delta_last; + uint32_t plat_delta_peak; + uint32_t cpu_delta_last; + uint32_t cpu_delta_peak; + uint32_t cpu_delta_sum; + uint32_t sample_cnt; +}; + +#if CONFIG_PERFORMANCE_COUNTERS + +#define perf_cnt_trace(ctx, pcd) \ + tr_info(ctx, "perf plat last %u peak %u cpu last %u, peak %u", \ + (uint32_t)((pcd)->plat_delta_last), \ + (uint32_t)((pcd)->plat_delta_peak), \ + (uint32_t)((pcd)->cpu_delta_last), \ + (uint32_t)((pcd)->cpu_delta_peak)) + +/** \brief Clears performance counters data. */ +#define perf_cnt_clear(pcd) memset((pcd), 0, sizeof(struct perf_cnt_data)) + +/* NOTE: Zephyr's arch_timing_counter_get() might not be implemented + * for a particular platform. In this case let's fallback to use + * Zephyr's k_cycle_get_64(). This will result in both "platform" and + * "cpu" timestamps to be equal. + */ +#ifdef __ZEPHYR__ + #ifdef CONFIG_TIMING_FUNCTIONS + #define perf_cnt_get_cpu_ts arch_timing_counter_get + #else + #define perf_cnt_get_cpu_ts sof_cycle_get_64 + #endif /* CONFIG_TIMING_FUNCTIONS */ +#else + #define perf_cnt_get_cpu_ts() timer_get_system(cpu_timer_get()) +#endif /* __ZEPHYR__ */ + +/** \brief Initializes timestamps with current timer values. */ +#define perf_cnt_init(pcd) do { \ + (pcd)->plat_ts = sof_cycle_get_64(); \ + (pcd)->cpu_ts = perf_cnt_get_cpu_ts(); \ + } while (0) + +/* Trace macros that can be used as trace_m argument of the perf_cnt_stamp() + * to trace PCD values if the last arch timer reading exceeds the previous + * peak value. + * + * arg passed to perf_cnt_stamp() is forwarded to the trace_m() macro + * as the second argument. + */ + +/** \brief No trace when detecting peak value. */ +#define perf_trace_null(pcd, arg) + +/** \brief Simple trace, all values are printed, arg should be a tr_ctx address. + */ +#define perf_trace_simple(pcd, arg) perf_cnt_trace(arg, pcd) + +/* perf measurement windows size 2^x */ +#define PERF_CNT_CHECK_WINDOW_SIZE 10 +#define task_perf_avg_info(pcd, task_p, class) \ + tr_info(task_p, "perf_cycle task %p, %pU cpu avg %u peak %u",\ + class, (class)->uid, \ + (uint32_t)((pcd)->cpu_delta_sum), \ + (uint32_t)((pcd)->cpu_delta_peak)) +#define task_perf_cnt_avg(pcd, trace_m, arg, class) do { \ + (pcd)->cpu_delta_sum += (pcd)->cpu_delta_last; \ + if (++(pcd)->sample_cnt == 1 << PERF_CNT_CHECK_WINDOW_SIZE) { \ + (pcd)->cpu_delta_sum >>= PERF_CNT_CHECK_WINDOW_SIZE; \ + trace_m(pcd, arg, class); \ + (pcd)->cpu_delta_sum = 0; \ + (pcd)->sample_cnt = 0; \ + (pcd)->plat_delta_peak = 0; \ + (pcd)->cpu_delta_peak = 0; \ + } \ + } while (0) + +/** \brief Accumulates cpu timer delta samples calculated by perf_cnt_stamp(). + * + * If current sample count reaches the window size, compute the average and run trace_m. + * \param pcd Performance counters data. + * \param trace_m Trace function trace_m(pcd, arg) or trace macro if a + * more precise line number is desired in the logs. + * \param arg Argument passed to trace_m as arg. + */ +#define perf_cnt_average(pcd, trace_m, arg) do { \ + (pcd)->cpu_delta_sum += (pcd)->cpu_delta_last; \ + if (++(pcd)->sample_cnt == 1 << PERF_CNT_CHECK_WINDOW_SIZE) {\ + (pcd)->cpu_delta_sum >>= PERF_CNT_CHECK_WINDOW_SIZE; \ + trace_m(pcd, arg); \ + (pcd)->cpu_delta_sum = 0; \ + (pcd)->sample_cnt = 0; \ + (pcd)->plat_delta_peak = 0; \ + (pcd)->cpu_delta_peak = 0; \ + } \ + } while (0) + +/** \brief Reads the timers and computes delta to the previous readings. + * + * If current arch delta exceeds the previous peak value, trace_m is run. + * \param pcd Performance counters data. + * \param trace_m Trace function trace_m(pcd, arg) or trace macro if a + * more precise line number is desired in the logs. + * \param arg Argument passed to trace_m as arg. + */ +#define perf_cnt_stamp(pcd, trace_m, arg) do { \ + uint32_t plat_ts = \ + (uint32_t)sof_cycle_get_64(); \ + uint32_t cpu_ts = \ + (uint32_t)perf_cnt_get_cpu_ts(); \ + if (plat_ts > (pcd)->plat_ts) \ + (pcd)->plat_delta_last = plat_ts - (pcd)->plat_ts; \ + else \ + (pcd)->plat_delta_last = UINT32_MAX - (pcd)->plat_ts \ + + plat_ts; \ + if (cpu_ts > (pcd)->cpu_ts) \ + (pcd)->cpu_delta_last = cpu_ts - (pcd)->cpu_ts; \ + else \ + (pcd)->cpu_delta_last = UINT32_MAX - (pcd)->cpu_ts \ + + cpu_ts;\ + if ((pcd)->plat_delta_last > (pcd)->plat_delta_peak) \ + (pcd)->plat_delta_peak = (pcd)->plat_delta_last; \ + if ((pcd)->cpu_delta_last > (pcd)->cpu_delta_peak) { \ + (pcd)->cpu_delta_peak = (pcd)->cpu_delta_last; \ + trace_m(pcd, arg); \ + } \ + } while (0) + +/** + * For simple performance measurement and optimization in development stage, + * tic-toc api is provided. Performance data are traced at each tok call, + * to allow fast clocks usage deviation estimation. Example: + * + * \code{.c} + * void foo(struct comp_dev *dev) { + * static struct perf_cnt_data pcd; + * + * perf_tic(&pcd); + * bar(); + * perf_toc(&pcd, dev); + * } + * \endcode + */ + +/** \brief Save start timestamp in pcd structure + * + * \param pcd Performance counters data. + */ +#define perf_tic(pcd) \ + perf_cnt_init(pcd) + +/** \brief Save start timestamp in pcd structure + * + * \param pcd Performance counters data. + * \param comp Component used to get corresponding trace context. + */ +#define perf_toc(pcd, comp) do { \ + perf_cnt_stamp(pcd, perf_trace_null, NULL); \ + perf_trace_simple(pcd, trace_comp_get_tr_ctx(comp)); \ + } while (0) + +#else +#define perf_cnt_clear(pcd) +#define perf_cnt_init(pcd) +#define perf_cnt_stamp(pcd, trace_m, arg) +#define perf_cnt_average(pcd, trace_m, arg) +#endif + +#endif /* __SOF_LIB_PERF_CNT_H__ */ diff --git a/posix/include/sof/lib/pm_runtime.h b/posix/include/sof/lib/pm_runtime.h new file mode 100644 index 000000000000..c0a24116e629 --- /dev/null +++ b/posix/include/sof/lib/pm_runtime.h @@ -0,0 +1,176 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2018 Intel Corporation. All rights reserved. + * + * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> + * Janusz Jankowski <janusz.jankowski@linux.intel.com> + */ + +/** + * \file xtos/include/sof/lib/pm_runtime.h + * \brief Runtime power management header file + * \author Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +#ifndef __SOF_LIB_PM_RUNTIME_H__ +#define __SOF_LIB_PM_RUNTIME_H__ + +#include <platform/lib/pm_runtime.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> +#include <sof/trace/trace.h> +#include <user/trace.h> +#include <stdint.h> + +/** \addtogroup pm_runtime PM Runtime + * PM runtime specification. + * @{ + */ + +/* PM runtime flags */ + +#define RPM_ASYNC 0x01 /**< Request is asynchronous */ + +/** \brief Runtime power management context */ +enum pm_runtime_context { + PM_RUNTIME_HOST_DMA_L1 = 0, /**< Host DMA L1 */ + SSP_CLK, /**< SSP Clock */ + SSP_POW, /**< SSP Power */ + DMIC_CLK, /**< DMIC Clock */ + DMIC_POW, /**< DMIC Power */ + DW_DMAC_CLK, /**< DW DMAC Clock */ + CORE_MEMORY_POW, /**< Core Memory power */ + CORE_HP_CLK, /**< High Performance Clock*/ + PM_RUNTIME_DSP /**< DSP */ +}; + +/** \brief Runtime power management data. */ +struct pm_runtime_data { + struct k_spinlock lock; /**< lock mechanism */ + void *platform_data; /**< platform specific data */ +#if CONFIG_DSP_RESIDENCY_COUNTERS + struct r_counters_data *r_counters; /**< diagnostic DSP residency counters */ +#endif +}; + +#if CONFIG_DSP_RESIDENCY_COUNTERS +/** + * \brief DSP residency counters + * R0, R1, R2 are DSP residency counters which can be used differently + * based on platform implementation. + * In general R0 is the highest power consumption state while R2 is + * the lowest power consumption state. See platform specific pm_runtime.h + * for the platform HW specific mapping. + */ +enum dsp_r_state { + r0_r_state = 0, + r1_r_state, + r2_r_state +}; + +/** \brief Diagnostic DSP residency counters data */ +struct r_counters_data { + enum dsp_r_state cur_r_state; /**< current dsp_r_state */ + uint64_t ts; /**< dsp_r_state timestamp */ +}; +#endif + +/** + * \brief Initializes runtime power management. + */ +void pm_runtime_init(struct sof *sof); + +/** + * \brief Retrieves power management resource (async). + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_get(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Retrieves power management resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_get_sync(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Releases power management resource (async). + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_put(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Releases power management resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_put_sync(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Enables power management operations for the resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_enable(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Disables power management operations for the resource. + * + * \param[in] context Type of power management context. + * \param[in] index Index of the device. + */ +void pm_runtime_disable(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Reports state of the power managed resource. + * + * @param context Type of power management context. + * @param index Index of the resource. + * + * @return true if the resource is active or pm disabled, false otherwise. + */ +bool pm_runtime_is_active(enum pm_runtime_context context, uint32_t index); + +/** + * \brief Retrieves pointer to runtime power management data. + * + * @return Runtime power management data pointer. + */ +static inline struct pm_runtime_data *pm_runtime_data_get(void) +{ + return sof_get()->prd; +} + +#if CONFIG_DSP_RESIDENCY_COUNTERS +/** + * \brief Initializes DSP residency counters. + * + * \param[in] context Type of power management context. + */ +void init_dsp_r_state(enum dsp_r_state); + +/** + * \brief Reports DSP residency state. + * + * \param[in] new state + */ +void report_dsp_r_state(enum dsp_r_state); + +/** + * \brief Retrieves current DSP residency state. + * + * @return active DSP residency state + */ +enum dsp_r_state get_dsp_r_state(void); +#endif + +/** @}*/ + +#endif /* __SOF_LIB_PM_RUNTIME_H__ */ diff --git a/posix/include/sof/lib/shim.h b/posix/include/sof/lib/shim.h new file mode 100644 index 000000000000..518880f1f953 --- /dev/null +++ b/posix/include/sof/lib/shim.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2019 Intel Corporation. All rights reserved. + * + * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> + */ + +#ifndef __SOF_LIB_SHIM_H__ +#define __SOF_LIB_SHIM_H__ + +#include <platform/lib/shim.h> + +#endif /* __SOF_LIB_SHIM_H__ */ diff --git a/posix/include/sof/list.h b/posix/include/sof/list.h new file mode 100644 index 000000000000..a81576fb5e68 --- /dev/null +++ b/posix/include/sof/list.h @@ -0,0 +1,127 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2016 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + * Keyon Jie <yang.jie@linux.intel.com> + */ + +#ifndef __SOF_LIST_H__ +#define __SOF_LIST_H__ + +/* Really simple list manipulation */ + +struct list_item; + +struct list_item { + struct list_item *next; + struct list_item *prev; +}; + +/* a static list head initialiser */ +#define LIST_INIT(head) {&head, &head} + +/* initialise list before any use - list will point to itself */ +static inline void list_init(struct list_item *list) +{ + list->next = list; + list->prev = list; +} + +/* add new item to the start or head of the list */ +static inline void list_item_prepend(struct list_item *item, + struct list_item *list) +{ + struct list_item *next = list->next; + + next->prev = item; + item->next = next; + item->prev = list; + list->next = item; +} + +/* add new item to the end or tail of the list */ +static inline void list_item_append(struct list_item *item, + struct list_item *list) +{ + struct list_item *tail = list->prev; + + tail->next = item; + item->next = list; + item->prev = tail; + list->prev = item; +} + +/* delete item from the list leaves deleted list item + *in undefined state list_is_empty will return true + */ +static inline void list_item_del(struct list_item *item) +{ + item->next->prev = item->prev; + item->prev->next = item->next; + list_init(item); +} + +/* is list item the last item in list ? */ +static inline int list_item_is_last(struct list_item *item, + struct list_item *list) +{ + return item->next == list; +} + +/* is list empty ? */ +#define list_is_empty(item) \ + ((item)->next == item) + +#define __list_object(item, type, offset) \ + ((type *)((char *)(item) - (offset))) + +/* get the container object of the list item */ +#define list_item(item, type, member) \ + __list_object(item, type, offsetof(type, member)) + +/* get the container object of the first item in the list */ +#define list_first_item(list, type, member) \ + __list_object((list)->next, type, offsetof(type, member)) + +/* get the next container object in the list */ +#define list_next_item(object, member) \ + list_item((object)->member.next, typeof(*(object)), member) + +/* list iterator */ +#define list_for_item(item, list) \ + for (item = (list)->next; item != (list); item = item->next) + +/* list iterator */ +#define list_for_item_prev(item, list) \ + for (item = (list)->prev; item != (list); item = item->prev) + +/* list iterator - safe to delete items */ +#define list_for_item_safe(item, tmp, list) \ + for (item = (list)->next, tmp = item->next;\ + item != (list); \ + item = tmp, tmp = item->next) + +/** + * Re-links the list when head address changed (list moved). + * @param new_list New address of the head. + * @param old_list Old address of the head. + */ +static inline void list_relink(struct list_item *new_list, + struct list_item *old_list) +{ + struct list_item *li; + + if (new_list->next == old_list) { + list_init(new_list); + } else { + list_for_item(li, new_list) + if (li->next == old_list) + li->next = new_list; /* for stops here */ + list_for_item_prev(li, new_list) + if (li->prev == old_list) + li->prev = new_list; /* for stops here */ + } +} + +#endif /* __SOF_LIST_H__ */ diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index 39b0ea640bd4..7ec47e59c668 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -5,10 +5,9 @@ target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/sr target_include_directories(sof_public_headers INTERFACE ${PROJECT_SOURCE_DIR}/src/platform/library/include) include(CheckCCompilerFlag) -# TODO: library should not need RTOS headers: FIX. if (NOT CONFIG_SOF_ZEPHYR_STRICT_HEADERS) target_include_directories(sof_public_headers INTERFACE - ${PROJECT_SOURCE_DIR}/xtos/include + ${PROJECT_SOURCE_DIR}/posix/include ) endif() diff --git a/tools/tplg_parser/CMakeLists.txt b/tools/tplg_parser/CMakeLists.txt index 5ede07db75d6..fbe1b6669ee4 100644 --- a/tools/tplg_parser/CMakeLists.txt +++ b/tools/tplg_parser/CMakeLists.txt @@ -42,9 +42,7 @@ target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/i target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/arch/host/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/platform/library/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio) - -# TODO: The topology parser should NOT need to include RTOS header. FIX. -target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/xtos/include) +target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/posix/include) # Configuration time, make copy configure_file(${default_asoc_h} ${CMAKE_CURRENT_BINARY_DIR}/include/alsa/sound/asoc.h) From 137c0bfc77366abe5b0b71dc628c03323e09d819 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Wed, 30 Aug 2023 16:01:09 -0700 Subject: [PATCH 363/639] host: remove XTOS prefix from headers And add the POSIX prefix. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/arch/host/include/arch/debug/panic.h | 4 ++-- src/arch/host/include/arch/drivers/idc.h | 4 ++-- src/arch/host/include/arch/schedule/task.h | 6 +++--- src/arch/host/include/arch/spinlock.h | 2 +- src/arch/host/include/arch/string.h | 2 +- src/platform/library/include/platform/drivers/idc.h | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/arch/host/include/arch/debug/panic.h b/src/arch/host/include/arch/debug/panic.h index 67fb04aa70eb..85f47a5ecbbc 100644 --- a/src/arch/host/include/arch/debug/panic.h +++ b/src/arch/host/include/arch/debug/panic.h @@ -5,7 +5,7 @@ * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> */ -#ifdef __XTOS_RTOS_PANIC_H__ +#ifdef __POSIX_RTOS_PANIC_H__ #ifndef __ARCH_DEBUG_PANIC_H__ #define __ARCH_DEBUG_PANIC_H__ @@ -21,4 +21,4 @@ static inline void arch_dump_regs(void *dump_buf, uintptr_t stack_ptr, #error "This file shouldn't be included from outside of XTOS's rtos/panic.h" -#endif /* __XTOS_RTOS_PANIC_H__ */ +#endif /* __POSIX_RTOS_PANIC_H__ */ diff --git a/src/arch/host/include/arch/drivers/idc.h b/src/arch/host/include/arch/drivers/idc.h index 73719e55f2b8..3f3e67b89d76 100644 --- a/src/arch/host/include/arch/drivers/idc.h +++ b/src/arch/host/include/arch/drivers/idc.h @@ -5,7 +5,7 @@ * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> */ -#ifdef __XTOS_RTOS_IDC_H__ +#ifdef __POSIX_RTOS_IDC_H__ #ifndef __ARCH_DRIVERS_IDC_H__ #define __ARCH_DRIVERS_IDC_H__ @@ -16,4 +16,4 @@ #error "This file shouldn't be included from outside of XTOS's rtos/idc.h" -#endif /* __XTOS_RTOS_IDC_H__ */ +#endif /* __POSIX_RTOS_IDC_H__ */ diff --git a/src/arch/host/include/arch/schedule/task.h b/src/arch/host/include/arch/schedule/task.h index 5c6cbf102744..2b89d264e0a6 100644 --- a/src/arch/host/include/arch/schedule/task.h +++ b/src/arch/host/include/arch/schedule/task.h @@ -11,7 +11,7 @@ * \authors Liam Girdwood <liam.r.girdwood@linux.intel.com> */ -#ifdef __XTOS_RTOS_TASK_H__ +#ifdef __POSIX_RTOS_TASK_H__ #ifndef __ARCH_SCHEDULE_TASK_H__ #define __ARCH_SCHEDULE_TASK_H__ @@ -20,6 +20,6 @@ #else -#error "This file shouldn't be included from outside of XTOS's rtos/task.h" +#error "This file shouldn't be included from outside of XTOS's posix/task.h" -#endif /* __XTOS_RTOS_TASK_H__ */ +#endif /* __POSIX_RTOS_TASK_H__ */ diff --git a/src/arch/host/include/arch/spinlock.h b/src/arch/host/include/arch/spinlock.h index 273133490e72..360cb72bdb1f 100644 --- a/src/arch/host/include/arch/spinlock.h +++ b/src/arch/host/include/arch/spinlock.h @@ -6,7 +6,7 @@ */ /* TODO: this needs fixed as part of the "host does not need rtos headers work" */ -#ifdef __XTOS_RTOS_SPINLOCK_H__ +#ifdef __POSIX_RTOS_SPINLOCK_H__ #ifndef __ARCH_SPINLOCK_H__ #define __ARCH_SPINLOCK_H__ diff --git a/src/arch/host/include/arch/string.h b/src/arch/host/include/arch/string.h index 166b417173f0..125f7bf555a6 100644 --- a/src/arch/host/include/arch/string.h +++ b/src/arch/host/include/arch/string.h @@ -5,7 +5,7 @@ * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> */ -#ifdef __XTOS_RTOS_STRING_H__ +#ifdef __POSIX_RTOS_STRING_H__ #ifndef __ARCH_STRING_H__ #define __ARCH_STRING_H__ diff --git a/src/platform/library/include/platform/drivers/idc.h b/src/platform/library/include/platform/drivers/idc.h index 8738c87324dd..e538884bbb5f 100644 --- a/src/platform/library/include/platform/drivers/idc.h +++ b/src/platform/library/include/platform/drivers/idc.h @@ -5,7 +5,7 @@ * Author: Tomasz Lauda <tomasz.lauda@linux.intel.com> */ -#if defined(__XTOS_RTOS_IDC_H__) || defined(__ZEPHYR_RTOS_IDC_H__) +#ifdef __POSIX_RTOS_IDC_H__ #ifndef __PLATFORM_DRIVERS_IDC_H__ #define __PLATFORM_DRIVERS_IDC_H__ From d1dd0486df3aef615e7b2c2e9b0c02a2a58ba700 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Wed, 30 Aug 2023 16:06:59 -0700 Subject: [PATCH 364/639] library: Add missing definitions Add missing platform definitions for CPU freq, DAI definitions etc. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/include/ipc4/fw_reg.h | 2 +- src/platform/library/include/platform/lib/clk.h | 16 ++++++++++++++++ src/platform/library/include/platform/lib/dai.h | 16 ++++++++++++++++ .../library/include/platform/lib/mailbox.h | 7 +++++++ .../library/include/platform/lib/memory.h | 2 ++ src/platform/library/include/platform/platform.h | 2 ++ 6 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/include/ipc4/fw_reg.h b/src/include/ipc4/fw_reg.h index 732de50600be..a0f450954050 100644 --- a/src/include/ipc4/fw_reg.h +++ b/src/include/ipc4/fw_reg.h @@ -30,7 +30,7 @@ #include <stdint.h> #include <ipc4/error_status.h> #include <ipc4/module.h> -#include <platform/lib/cpu.h> +#include <sof/lib/cpu.h> /* Reports current ROM/FW status. */ struct ipc4_fw_status_reg { diff --git a/src/platform/library/include/platform/lib/clk.h b/src/platform/library/include/platform/lib/clk.h index 7c089ebac4f9..6d389a6152af 100644 --- a/src/platform/library/include/platform/lib/clk.h +++ b/src/platform/library/include/platform/lib/clk.h @@ -18,6 +18,22 @@ #define NUM_CLOCKS 2 +#define CPU_WOVCRO_FREQ_IDX 0 + +#define CPU_LPRO_FREQ_IDX 1 + +#define CPU_HPRO_FREQ_IDX 2 + +#define CPU_LOWEST_FREQ_IDX CPU_WOVCRO_FREQ_IDX + +#define CPU_DEFAULT_IDX CPU_HPRO_FREQ_IDX + +#define SSP_DEFAULT_IDX 1 + +#define NUM_CPU_FREQ 3 + +#define NUM_SSP_FREQ 3 + #endif /* __PLATFORM_LIB_CLK_H__ */ #else diff --git a/src/platform/library/include/platform/lib/dai.h b/src/platform/library/include/platform/lib/dai.h index 45065e86c3b9..5fb740e32270 100644 --- a/src/platform/library/include/platform/lib/dai.h +++ b/src/platform/library/include/platform/lib/dai.h @@ -10,6 +10,22 @@ #ifndef __PLATFORM_LIB_DAI_H__ #define __PLATFORM_LIB_DAI_H__ +#define DAI_NUM_SSP_BASE 6 + +/** \brief Number of HD/A Link Outputs */ +#define DAI_NUM_HDA_OUT 6 + +/** \brief Number of HD/A Link Inputs */ +#define DAI_NUM_HDA_IN 7 + +/* ALH */ + +/** \brief Number of ALH bi-directional links */ +#define DAI_NUM_ALH_BI_DIR_LINKS 16 + +/** \brief Number of contiguous ALH bi-dir links */ +#define DAI_NUM_ALH_BI_DIR_LINKS_GROUP 4 + #endif /* __PLATFORM_LIB_DAI_H__ */ #else diff --git a/src/platform/library/include/platform/lib/mailbox.h b/src/platform/library/include/platform/lib/mailbox.h index fbfbc3719b96..04470a43e66e 100644 --- a/src/platform/library/include/platform/lib/mailbox.h +++ b/src/platform/library/include/platform/lib/mailbox.h @@ -52,6 +52,13 @@ static inline void mailbox_sw_reg_write(size_t offset, uint32_t src) { } +static inline void mailbox_sw_regs_write(size_t offset, const void *src, size_t bytes) {} + +static inline uint32_t mailbox_sw_reg_read(size_t offset) +{ + return 0; +} + #endif /* __PLATFORM_LIB_MAILBOX_H__ */ #else diff --git a/src/platform/library/include/platform/lib/memory.h b/src/platform/library/include/platform/lib/memory.h index f57e31617da3..fafb3df303f7 100644 --- a/src/platform/library/include/platform/lib/memory.h +++ b/src/platform/library/include/platform/lib/memory.h @@ -182,6 +182,8 @@ static inline uint32_t arch_get_stack_size(void) #define host_to_local(addr) (addr) #define local_to_host(addr) (addr) +#define IMR_BOOT_LDR_MANIFEST_BASE NULL + #endif /* __PLATFORM_LIB_MEMORY_H__ */ #else diff --git a/src/platform/library/include/platform/platform.h b/src/platform/library/include/platform/platform.h index b1912049d4ec..2b1b4f31fa0c 100644 --- a/src/platform/library/include/platform/platform.h +++ b/src/platform/library/include/platform/platform.h @@ -56,6 +56,8 @@ struct timer; */ #define DMA_TRACE_RESCHEDULE_TIME 100 +#define HW_CFG_VERSION 0 + static inline void platform_panic(uint32_t p) {} /** From 40b9e319258c9ad66cffc269cc057661ed127866 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Wed, 30 Aug 2023 16:11:27 -0700 Subject: [PATCH 365/639] ipc4: Add preprocessor directive Fix the base_fw.h file to add the missing preprocessor directive. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/include/ipc4/base_fw.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/include/ipc4/base_fw.h b/src/include/ipc4/base_fw.h index bd049fdded8c..3c4a953405e2 100644 --- a/src/include/ipc4/base_fw.h +++ b/src/include/ipc4/base_fw.h @@ -4,15 +4,8 @@ */ /* - * This file contains structures that are exact copies of an existing ABI used - * by IOT middleware. They are Intel specific and will be used by one middleware. - * * Some of the structures may contain programming implementations that makes them * unsuitable for generic use and general usage. - * - * This code is mostly copied "as-is" from existing C++ interface files hence the use of - * different style in places. The intention is to keep the interface as close as possible to - * original so it's easier to track changes with IPC host code. */ /** @@ -21,6 +14,9 @@ * NOTE: This ABI uses bit fields and is non portable. */ +#ifndef __SOF_IPC4_BASE_FW_H__ +#define __SOF_IPC4_BASE_FW_H__ + /* Three clk src states :low power XTAL, low power ring * and high power ring oscillator */ @@ -666,3 +662,5 @@ enum ipc4_power_state_type { IPC4_ACTIVE_CORES_MASK = 0, IPC4_CORE_KCPS = 1, }; + +#endif /* __SOF_IPC4_BASE_FW_H__ */ From b720f1a733150bb251bd8e78c869c1492a8e14d4 Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Wed, 30 Aug 2023 16:15:23 -0700 Subject: [PATCH 366/639] audio: Add new kconfig for shared library modules Add a new kconfig option to build the shared library modules that can be used to run the pipelines on the host with the testbench or the ALSA plugin. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/audio/CMakeLists.txt | 12 +++++++++--- src/audio/Kconfig | 8 ++++++++ src/audio/module_adapter/CMakeLists.txt | 2 +- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index 649a80520dda..7e58fd55d929 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -6,7 +6,7 @@ elseif(CONFIG_IPC_MAJOR_4) set(mixer_src mixin_mixout/mixin_mixout.c mixin_mixout/mixin_mixout_generic.c mixin_mixout/mixin_mixout_hifi3.c) endif() -if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) +if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD) add_local_sources(sof host-legacy.c component.c @@ -17,6 +17,7 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) audio_stream.c channel_map.c ) + if(CONFIG_COMP_BLOB) add_local_sources(sof data_blob.c) endif() @@ -62,7 +63,7 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) dai-legacy.c ) endif() - if(CONFIG_COMP_KPB) + if(CONFIG_COMP_KPB AND NOT CONFIG_LIBRARY_STATIC) add_local_sources(sof kpb.c ) @@ -89,7 +90,7 @@ if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) if(CONFIG_COMP_RTNR) add_subdirectory(rtnr) endif() - if(CONFIG_COMP_BASEFW_IPC4) + if(CONFIG_COMP_BASEFW_IPC4 AND NOT CONFIG_LIBRARY) add_local_sources(sof base_fw.c ) @@ -125,6 +126,11 @@ add_local_sources(sof component.c data_blob.c buffer.c + source_api_helper.c + sink_api_helper.c + sink_source_utils.c + audio_stream.c + channel_map.c ) # Audio Modules with various optimizaitons diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 1025ad8aef11..d92e2ce5872a 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -703,4 +703,12 @@ config WRAP_ACTUAL_POSITION It is not necessary that on wrap, the buffer position would be zero.At wrap, in some cases based on the period size, the frame may not exactly be at the end of the buffer and roll over for some bytes from the beginning of the buffer. + +config COMP_MODULE_SHARED_LIBRARY_BUILD + bool "Build SOF modules as shared libraries" + default n + help + Select if you want to build modules as shared objects that can be used to run + pipelines on the host with the testbench or the ALSA plugin. + endmenu diff --git a/src/audio/module_adapter/CMakeLists.txt b/src/audio/module_adapter/CMakeLists.txt index e803f78ba91a..c49ea576ef0d 100644 --- a/src/audio/module_adapter/CMakeLists.txt +++ b/src/audio/module_adapter/CMakeLists.txt @@ -3,7 +3,7 @@ add_local_sources(sof module_adapter.c module/generic.c) -if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) +if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD) if(CONFIG_CADENCE_CODEC) add_local_sources(sof module/cadence.c) From ba079694f4f5ecf1b5d2f3953cf0d530e47440fc Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 1 Sep 2023 12:17:41 +0300 Subject: [PATCH 367/639] ipc4: header: Add support for ALSA switch and enum control handling The structs sof_ipc4_control_msg_payload and sof_ipc4_ctrl_value_chan match the similar structures in Linux kernel SOF IPC4 driver. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/include/ipc4/header.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/include/ipc4/header.h b/src/include/ipc4/header.h index 4a91b1a8cb13..5aaa361283bc 100644 --- a/src/include/ipc4/header.h +++ b/src/include/ipc4/header.h @@ -171,4 +171,31 @@ struct ipc4_message_reply { } extension; } __attribute((packed, aligned(4))); +#define SOF_IPC4_SWITCH_CONTROL_PARAM_ID 200 +#define SOF_IPC4_ENUM_CONTROL_PARAM_ID 201 + +/** + * struct sof_ipc4_ctrl_value_chan: generic channel mapped value data + * @channel: Channel ID + * @value: control value + */ +struct sof_ipc4_ctrl_value_chan { + uint32_t channel; + uint32_t value; +} __attribute((packed, aligned(4))); + +/** + * struct sof_ipc4_control_msg_payload - IPC payload for kcontrol parameters + * @id: unique id of the control + * @num_elems: Number of elememnts in the chanv array + * @reserved: reserved for future use, must be set to 0 + * @chanv: channel ID and value array + */ +struct sof_ipc4_control_msg_payload { + uint16_t id; + uint16_t num_elems; + uint32_t reserved[4]; + struct sof_ipc4_ctrl_value_chan chanv[]; +} __attribute((packed, aligned(4))); + #endif From 833a558b8d343ee7fe95dea4223008e5b04e6846 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 30 Aug 2023 16:47:47 +0300 Subject: [PATCH 368/639] Audio: Multiband-DRC: Add switch control for IPC4 This patch adds switch control handling into multiband_drc_set_config() operation. The switch control is a set large config with param_id set to SOF_IPC4_SWITCH_CONTROL_PARAM_ID. The patch changes config_id to param_id in this function. The config_id name was confusing. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/multiband_drc/multiband_drc.c | 32 +++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index edf76400c284..9c898f1701b7 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -321,18 +321,42 @@ static int multiband_drc_cmd_set_value(struct processing_module *mod, } #endif -static int multiband_drc_set_config(struct processing_module *mod, uint32_t config_id, +static int multiband_drc_set_config(struct processing_module *mod, uint32_t param_id, enum module_cfg_fragment_position pos, uint32_t data_offset_size, const uint8_t *fragment, size_t fragment_size, uint8_t *response, size_t response_size) { struct multiband_drc_comp_data *cd = module_get_private_data(mod); + struct comp_dev *dev = mod->dev; - comp_dbg(mod->dev, "multiband_drc_set_config()"); + comp_dbg(dev, "multiband_drc_set_config()"); -#if CONFIG_IPC_MAJOR_3 - /* Other control types are possible only with IPC3 */ +#if CONFIG_IPC_MAJOR_4 + struct sof_ipc4_control_msg_payload *ctl = (struct sof_ipc4_control_msg_payload *)fragment; + + switch (param_id) { + case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: + comp_dbg(dev, "SOF_IPC4_SWITCH_CONTROL_PARAM_ID id = %d, num_elems = %d", + ctl->id, ctl->num_elems); + + if (ctl->id == 0 && ctl->num_elems == 1) { + cd->process_enabled = ctl->chanv[0].value; + comp_info(dev, "process_enabled = %d", cd->process_enabled); + } else { + comp_err(dev, "Illegal control id = %d, num_elems = %d", + ctl->id, ctl->num_elems); + return -EINVAL; + } + + return 0; + + case SOF_IPC4_ENUM_CONTROL_PARAM_ID: + comp_err(dev, "multiband_drc_set_config(), illegal control."); + return -EINVAL; + } + +#elif CONFIG_IPC_MAJOR_3 struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; if (cdata->cmd != SOF_CTRL_CMD_BINARY) From 0fd9828d0cb9a15fdea46d454879583a31e99a8f Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 1 Sep 2023 12:37:58 +0300 Subject: [PATCH 369/639] Audio: Multiband-DRC: Fix comment for switch control workaround The workaround is preserved but the comment is updated to describe why. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/multiband_drc/multiband_drc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index 9c898f1701b7..1275a4688c75 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -251,11 +251,10 @@ static int multiband_drc_init(struct processing_module *mod) cd->multiband_drc_func = NULL; cd->crossover_split = NULL; #if CONFIG_IPC_MAJOR_4 - /* Note: Currently there is no ALSA switch control in IPC4 to control - * processing on/off. This workaround can be removed after is available. - * Binary control for configuration blob can be used instead. There is - * no processing bypass control in the blob but all processing can be - * switched to neutral with supported min. 2-band mode. + /* Initialize to enabled is a workaround for IPC4 kernel version 6.6 and + * before where the processing is never enabled via switch control. New + * kernel sends the IPC4 switch control and sets this to desired state + * before prepare. */ cd->process_enabled = true; #else From 3eada7c188a773ef7c5cfd884ea7329437ce3116 Mon Sep 17 00:00:00 2001 From: Bard Liao <yung-chuan.liao@linux.intel.com> Date: Thu, 14 Sep 2023 17:47:08 +0800 Subject: [PATCH 370/639] topology1: add sof-rpl-rt711-l0-rt1316-l12.tplg support Adding sof-rpl-rt711-l0-rt1316-l12.tplg. The topology is the same as sof-rpl-rt711-l0-rt1316-l12-rt714-l3, but without local mic (rt714). Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 028c924abaad..7a183519a155 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -56,6 +56,7 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt index 2556c26914e9..46fcfb0b4f85 100644 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt @@ -26,6 +26,7 @@ set(TPLGS_UP "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" + "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" From dec770dd8d3733a33f3ff17767a939d216e09437 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 29 Aug 2023 18:36:23 +0300 Subject: [PATCH 371/639] Tools: Tune: Add tplg2 support to dcblock setup tool This patch adds generate of blob for tplg2 and ipc4 in formats .conf, text, and binary formats. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/tune/dcblock/dcblock_build_blob.m | 8 ++++++-- tools/tune/dcblock/dcblock_get_abi.m | 17 ----------------- tools/tune/dcblock/example_dcblock.m | 22 +++++++++++++++------- 3 files changed, 21 insertions(+), 26 deletions(-) delete mode 100644 tools/tune/dcblock/dcblock_get_abi.m diff --git a/tools/tune/dcblock/dcblock_build_blob.m b/tools/tune/dcblock/dcblock_build_blob.m index 43fa67f5c915..5abbfa80c53b 100644 --- a/tools/tune/dcblock/dcblock_build_blob.m +++ b/tools/tune/dcblock/dcblock_build_blob.m @@ -1,4 +1,4 @@ -function blob8 = dcblock_build_blob(R_coeffs, endian) +function blob8 = dcblock_build_blob(R_coeffs, endian, ipc_ver) %% Settings bits_R = 32; %Q2.30 @@ -8,6 +8,10 @@ endian = 'little' endif +if nargin < 3 + ipc_ver = 3; +endif + %% Shift values for little/big endian switch lower(endian) case 'little' @@ -24,7 +28,7 @@ %% Build Blob data_size = (num_of_coeffs)*4; -[abi_bytes, abi_size] = dcblock_get_abi(data_size); +[abi_bytes, abi_size] = get_abi(data_size, ipc_ver); blob_size = data_size + abi_size; blob8 = uint8(zeros(1, blob_size)); diff --git a/tools/tune/dcblock/dcblock_get_abi.m b/tools/tune/dcblock/dcblock_get_abi.m deleted file mode 100644 index b65988cb99ae..000000000000 --- a/tools/tune/dcblock/dcblock_get_abi.m +++ /dev/null @@ -1,17 +0,0 @@ -function [bytes, nbytes] = dcblock_get_abi(setsize) - -%% Use sof-ctl to write ABI header into a file -abifn = 'dcblock_get_abi.bin'; -cmd = sprintf('sof-ctl -g %d -b -o %s', setsize, abifn); -system(cmd); - -%% Read file and delete it -fh = fopen(abifn, 'r'); -if fh < 0 - error("Failed to get ABI header. Is sof-ctl installed?"); -end -[bytes, nbytes] = fread(fh, inf, 'uint8'); -fclose(fh); -delete(abifn); - -end diff --git a/tools/tune/dcblock/example_dcblock.m b/tools/tune/dcblock/example_dcblock.m index 74490e5ab159..ff3d79e75a1b 100644 --- a/tools/tune/dcblock/example_dcblock.m +++ b/tools/tune/dcblock/example_dcblock.m @@ -1,22 +1,30 @@ function example_dcblock(); % Set the parameters here -tplg_fn = "../../topology/topology1/m4/dcblock_coef_default.m4" % Control Bytes File +tplg1_fn = "../../topology/topology1/m4/dcblock_coef_default.m4" % Control Bytes File +tplg2_fn = "../../topology/topology2/include/components/dcblock/default.conf" % Use those files with sof-ctl to update the component's configuration -blob_fn = "../../ctl/dcblock_coef.blob" % Blob binary file -alsa_fn = "../../ctl/dcblock_coef.txt" % ALSA CSV format file +blob3_fn = "../../ctl/ipc3/dcblock_coef.blob" % Blob binary file +alsa3_fn = "../../ctl/ipc3/dcblock_coef.txt" % ALSA CSV format file +blob4_fn = "../../ctl/ipc4/dcblock_coef.blob" % Blob binary file +alsa4_fn = "../../ctl/ipc4/dcblock_coef.txt" % ALSA CSV format file endian = "little"; R_coeffs = [0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98]; +addpath ./../common + blob8 = dcblock_build_blob(R_coeffs, endian); +blob8_ipc4 = dcblock_build_blob(R_coeffs, endian, 4); % Generate output files -addpath ./../common +tplg_write(tplg1_fn, blob8, "DCBLOCK"); +blob_write(blob3_fn, blob8); +alsactl_write(alsa3_fn, blob8); -tplg_write(tplg_fn, blob8, "DCBLOCK"); -blob_write(blob_fn, blob8); -alsactl_write(alsa_fn, blob8); +tplg2_write(tplg2_fn, blob8_ipc4, "dcblock_config", "Exported with script example_dcblock.m"); +blob_write(blob4_fn, blob8_ipc4); +alsactl_write(alsa4_fn, blob8_ipc4); % Plot Filter's Transfer Function and Step Response % As an example, plot the graphs of the first coefficient From 884bad441e4ba282cfab1ce2f2c6cb3ea6d7a2d9 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 29 Aug 2023 18:48:31 +0300 Subject: [PATCH 372/639] Tools: Tune: dcblock: Avoid warning about ignoring imaginary The abs() function need to be added to plot the correct magnitude response. Matlab warned in this case about ignoring imaginary part. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/tune/dcblock/dcblock_plot_transferfn.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tune/dcblock/dcblock_plot_transferfn.m b/tools/tune/dcblock/dcblock_plot_transferfn.m index 8237222014a6..85ef7c079d5e 100644 --- a/tools/tune/dcblock/dcblock_plot_transferfn.m +++ b/tools/tune/dcblock/dcblock_plot_transferfn.m @@ -7,7 +7,7 @@ f = linspace(1, fs/2, 500); -semilogx(f, 20*log10(freqz(b, a, f, fs))); +semilogx(f, 20*log10(abs(freqz(b, a, f, fs)))); grid on xlabel('Frequency (Hz)'); ylabel('Magnitude (dB)'); From e7816e9e63fc809c22b2a8cc8e239829dafb75d8 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 29 Aug 2023 18:50:53 +0300 Subject: [PATCH 373/639] Tools: Tune: dcblock: Fixes for Matlab compatibility The script can be run in both Matlab and Octave with these changes. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/tune/dcblock/dcblock_build_blob.m | 9 ++++----- tools/tune/dcblock/dcblock_plot_stepfn.m | 4 ++-- tools/tune/dcblock/dcblock_plot_transferfn.m | 4 ++-- tools/tune/dcblock/example_dcblock.m | 18 +++++++++--------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/tune/dcblock/dcblock_build_blob.m b/tools/tune/dcblock/dcblock_build_blob.m index 5abbfa80c53b..0b4293054f57 100644 --- a/tools/tune/dcblock/dcblock_build_blob.m +++ b/tools/tune/dcblock/dcblock_build_blob.m @@ -1,16 +1,15 @@ function blob8 = dcblock_build_blob(R_coeffs, endian, ipc_ver) %% Settings -bits_R = 32; %Q2.30 qy_R = 30; if nargin < 2 - endian = 'little' -endif + endian = 'little'; +end if nargin < 3 ipc_ver = 3; -endif +end %% Shift values for little/big endian switch lower(endian) @@ -44,7 +43,7 @@ j=j+4; end -endfunction +end function bytes = word2byte(word, sh) bytes = uint8(zeros(1,4)); diff --git a/tools/tune/dcblock/dcblock_plot_stepfn.m b/tools/tune/dcblock/dcblock_plot_stepfn.m index 724b4bcfcf40..e0c7c3d14db3 100644 --- a/tools/tune/dcblock/dcblock_plot_stepfn.m +++ b/tools/tune/dcblock/dcblock_plot_stepfn.m @@ -1,4 +1,4 @@ -function dcblock_plot_stepfn(R, fs); +function dcblock_plot_stepfn(R, fs) % Plot the step response of a DC Blocking Filter % For a DC Blocking filter: H(z) = (1-1/z)/(1 - R/z) % Therefore the coefficients are b = [1 -1], a = [1 -R] @@ -13,4 +13,4 @@ tstr = sprintf("DC Blocking Filter Step Response, R = %i", R); title(tstr); -endfunction +end diff --git a/tools/tune/dcblock/dcblock_plot_transferfn.m b/tools/tune/dcblock/dcblock_plot_transferfn.m index 85ef7c079d5e..513a291f666b 100644 --- a/tools/tune/dcblock/dcblock_plot_transferfn.m +++ b/tools/tune/dcblock/dcblock_plot_transferfn.m @@ -1,4 +1,4 @@ -function dcblock_plot_transferfn(R, fs); +function dcblock_plot_transferfn(R, fs) % Plot the transfer function. % For a DC Blocking filter: H(z) = (1-1/z)/(1 - R/z) % Therefore the coefficients are b = [1 -1], a = [1 -R] @@ -14,4 +14,4 @@ tstr = sprintf("DC Blocking Filter Frequency Response, R = %i", R); title(tstr); -endfunction +end diff --git a/tools/tune/dcblock/example_dcblock.m b/tools/tune/dcblock/example_dcblock.m index ff3d79e75a1b..df8500473369 100644 --- a/tools/tune/dcblock/example_dcblock.m +++ b/tools/tune/dcblock/example_dcblock.m @@ -1,13 +1,13 @@ -function example_dcblock(); +function example_dcblock() % Set the parameters here -tplg1_fn = "../../topology/topology1/m4/dcblock_coef_default.m4" % Control Bytes File -tplg2_fn = "../../topology/topology2/include/components/dcblock/default.conf" +tplg1_fn = "../../topology/topology1/m4/dcblock_coef_default.m4"; % Control Bytes File +tplg2_fn = "../../topology/topology2/include/components/dcblock/default.conf"; % Use those files with sof-ctl to update the component's configuration -blob3_fn = "../../ctl/ipc3/dcblock_coef.blob" % Blob binary file -alsa3_fn = "../../ctl/ipc3/dcblock_coef.txt" % ALSA CSV format file -blob4_fn = "../../ctl/ipc4/dcblock_coef.blob" % Blob binary file -alsa4_fn = "../../ctl/ipc4/dcblock_coef.txt" % ALSA CSV format file +blob3_fn = "../../ctl/ipc3/dcblock_coef.blob"; % Blob binary file +alsa3_fn = "../../ctl/ipc3/dcblock_coef.txt"; % ALSA CSV format file +blob4_fn = "../../ctl/ipc4/dcblock_coef.blob"; % Blob binary file +alsa4_fn = "../../ctl/ipc4/dcblock_coef.txt"; % ALSA CSV format file endian = "little"; R_coeffs = [0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98]; @@ -28,11 +28,11 @@ % Plot Filter's Transfer Function and Step Response % As an example, plot the graphs of the first coefficient -fs = 48e3 +fs = 48e3; dcblock_plot_transferfn(R_coeffs(1), fs); figure dcblock_plot_stepfn(R_coeffs(1), fs); rmpath ./../common -endfunction +end From e38f3f7829f1cc736bfbb9243ecc13c93f60fd8d Mon Sep 17 00:00:00 2001 From: Bard Liao <yung-chuan.liao@linux.intel.com> Date: Tue, 29 Aug 2023 15:17:10 +0800 Subject: [PATCH 374/639] topology2: add sof-mtl-rt713-l0-rt1316-l12-rt1713-l3 support Add sof-mtl-rt713-l0-rt1316-l12-rt1713-l3 support. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 58837ccb7a5e..9b24382a4e5e 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -35,6 +35,10 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" USE_CHAIN_DMA=true,NUM_SDW_AMP_LINKS=2,SDW_SPK_STREAM=SDW1-Playback,SDW_SPK_IN_STREAM=SDW1-Capture,\ SDW_DMIC_STREAM=SDW0-Capture" +"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-rt1713-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ +SDW_SPK_STREAM=Playback-SmartAmp,SDW_SPK_IN_STREAM=Capture-SmartAmp,\ +SDW_DMIC_STREAM=Capture-SmartMic,SDW_JACK_OUT_STREAM=Playback-SimpleJack,\ +SDW_JACK_IN_STREAM=Capture-SimpleJack" # Below topologies are used on Chromebooks "cavs-rt5682\;sof-mtl-max98357a-rt5682\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ From 1721f7042638512eca7db076a353121bb537c2fd Mon Sep 17 00:00:00 2001 From: Jakub Dabek <jakub.dabek@intel.com> Date: Wed, 30 Aug 2023 13:02:12 +0200 Subject: [PATCH 375/639] logging: add logging through probes Logging with probes was not implemented. This implements ipc that enables logging with probe configuration. Signed-off-by: Jakub Dabek <jakub.dabek@intel.com> --- app/boards/intel_adsp_ace15_mtpm.conf | 1 + src/include/sof/probe/probe.h | 5 +++ src/ipc/ipc4/logging.c | 62 ++++++++++++++++++++------- src/logging/log_backend_probe.c | 10 +++++ src/probe/probe.c | 2 +- 5 files changed, 64 insertions(+), 16 deletions(-) diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index 8bbcc0278c58..ac1a3c846441 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -67,6 +67,7 @@ CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=38400000 CONFIG_LOG_BACKEND_ADSP_MTRACE=y +CONFIG_LOG_BACKEND_SOF_PROBE=n CONFIG_SOF_LOG_LEVEL_INF=y CONFIG_ZEPHYR_LOG=y CONFIG_LOG_OUTPUT_FORMAT_LINUX_TIMESTAMP=y diff --git a/src/include/sof/probe/probe.h b/src/include/sof/probe/probe.h index 22522fb09fe3..7b6623737895 100644 --- a/src/include/sof/probe/probe.h +++ b/src/include/sof/probe/probe.h @@ -17,6 +17,11 @@ */ typedef void(*probe_logging_hook_t)(uint8_t *buffer, size_t length); +#if CONFIG_LOG_BACKEND_SOF_PROBE +void probe_logging_hook(uint8_t *buffer, size_t length); +const struct log_backend *log_backend_probe_get(void); +#endif + /** * @brief Initialize the probe logging backend. * diff --git a/src/ipc/ipc4/logging.c b/src/ipc/ipc4/logging.c index 08cbfa870727..a6d8e4ccce43 100644 --- a/src/ipc/ipc4/logging.c +++ b/src/ipc/ipc4/logging.c @@ -4,18 +4,26 @@ // // Author: Kai Vehmanen <kai.vehmanen@linux.intel.com> +#if CONFIG_LOG_BACKEND_SOF_PROBE && CONFIG_LOG_BACKEND_ADSP_MTRACE +#error Cannot have both backends enabled +#endif + #include <stdint.h> #include <sof/lib/uuid.h> #include <sof/ipc/common.h> #include <ipc4/base_fw.h> #include <ipc4/error_status.h> #include <ipc4/logging.h> +#include <zephyr/logging/log_backend.h> +#include <zephyr/logging/log.h> + +#if CONFIG_LOG_BACKEND_SOF_PROBE +#include <sof/probe/probe.h> +#endif #ifdef CONFIG_LOG_BACKEND_ADSP_MTRACE -#include <zephyr/logging/log_backend.h> #include <zephyr/logging/log_backend_adsp_mtrace.h> -#include <zephyr/logging/log.h> #include <sof/schedule/edf_schedule.h> #include <sof/schedule/schedule.h> @@ -150,27 +158,51 @@ int ipc4_logging_enable_logs(bool first_block, return 0; } -int ipc4_logging_shutdown(void) -{ - struct ipc4_log_state_info log_state = { 0 }; - - /* log_state.enable set to 0 above */ - - return ipc4_logging_enable_logs(true, true, sizeof(log_state), (char *)&log_state); -} +#endif -#else +#ifdef CONFIG_LOG_BACKEND_SOF_PROBE int ipc4_logging_enable_logs(bool first_block, bool last_block, uint32_t data_offset_or_size, const char *data) { - return IPC4_UNKNOWN_MESSAGE_TYPE; -} + const struct log_backend *log_backend = log_backend_probe_get(); + const struct ipc4_log_state_info *log_state; + + if (!(first_block && last_block)) + return -EINVAL; + + if (data_offset_or_size < sizeof(struct ipc4_log_state_info)) + return -EINVAL; + + /* Make sure we work on correct ipc data by invalidating cache + * data may be taken from different core to the one we are working + * on right now. + */ + dcache_invalidate_region((__sparse_force void __sparse_cache *)data, data_offset_or_size); + + log_state = (const struct ipc4_log_state_info *)data; + + if (log_state->enable) { + if (!probe_is_backend_configured()) + return -EINVAL; + + log_backend_activate(log_backend, probe_logging_hook); + + } else { + log_backend_deactivate(log_backend); + } -int ipc4_logging_shutdown(void) -{ return 0; } #endif + +int ipc4_logging_shutdown(void) +{ + struct ipc4_log_state_info log_state = { 0 }; + + /* log_state.enable set to 0 above */ + + return ipc4_logging_enable_logs(true, true, sizeof(log_state), (char *)&log_state); +} diff --git a/src/logging/log_backend_probe.c b/src/logging/log_backend_probe.c index b99da2e0a795..6baf22df2e14 100644 --- a/src/logging/log_backend_probe.c +++ b/src/logging/log_backend_probe.c @@ -109,3 +109,13 @@ void probe_logging_init(probe_logging_hook_t fn) { probe_hook = fn; } + +const struct log_backend *log_backend_probe_get(void) +{ + return &log_backend_adsp_probe; +} + +bool probe_is_backend_configured(void) +{ + return probe_hook != NULL; +} diff --git a/src/probe/probe.c b/src/probe/probe.c index fe1b8ae9efa1..af37401529a4 100644 --- a/src/probe/probe.c +++ b/src/probe/probe.c @@ -841,7 +841,7 @@ static void kick_probe_task(struct probe_pdata *_probe) } #if CONFIG_LOG_BACKEND_SOF_PROBE -static void probe_logging_hook(uint8_t *buffer, size_t length) +void probe_logging_hook(uint8_t *buffer, size_t length) { struct probe_pdata *_probe = probe_get(); uint64_t checksum; From 036da2ac437c02b838e273c70aee83a2fafb6c59 Mon Sep 17 00:00:00 2001 From: Zhang Peng <peng.zhang_8@nxp.com> Date: Thu, 14 Sep 2023 11:15:17 +0800 Subject: [PATCH 376/639] imx: sai: Fix sof run fail issue on imx8ulp Don't need to enable packed mode for sai on 8ulp. Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com> --- src/drivers/imx/sai.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drivers/imx/sai.c b/src/drivers/imx/sai.c index df9690eb8d7c..2c4c22b01fa7 100644 --- a/src/drivers/imx/sai.c +++ b/src/drivers/imx/sai.c @@ -355,6 +355,7 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ return -EINVAL; } +#ifndef CONFIG_IMX8ULP switch (sai->params.tdm_slot_width) { case 8: val_cr4 |= REG_SAI_CR4_FPACK_8; @@ -365,6 +366,7 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ default: break; } +#endif val_cr4 |= REG_SAI_CR4_FRSZ(sai->params.tdm_slots); val_cr4 |= REG_SAI_CR4_CHMOD; From dd2a64ba1afedb6ec915204ed766ecb8c3964ed9 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Mon, 4 Sep 2023 09:32:29 +0800 Subject: [PATCH 377/639] audio: host-zephyr: remove redundant return there are two return in common update, remove the first to save cycles, test platform is tgl board with debug sof build, it can save cycles from 455 to 452. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/host-zephyr.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 49f64e42179d..793b8f3a93f1 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -247,7 +247,7 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt bool update_mailbox = false; bool send_ipc = false; - if (hd->ipc_host.direction == SOF_IPC_STREAM_PLAYBACK) { + if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { source = buffer_acquire(hd->dma_buffer); sink = buffer_acquire(hd->local_buffer); ret = dma_buffer_copy_from(source, sink, hd->process, bytes); @@ -257,20 +257,14 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt ret = dma_buffer_copy_to(source, sink, hd->process, bytes); } - /* assert dma_buffer_copy succeed */ - if (ret < 0) - comp_err(dev, "host_common_update() dma buffer copy failed, dir %d bytes %d avail %d free %d", - hd->ipc_host.direction, bytes, - audio_stream_get_avail_samples(&source->stream) * - audio_stream_frame_bytes(&source->stream), - audio_stream_get_free_samples(&sink->stream) * - audio_stream_frame_bytes(&sink->stream)); - buffer_release(sink); buffer_release(source); - if (ret < 0) + if (ret < 0) { + comp_err(dev, "host_common_update() copy failed, dir %d bytes %d return: %d", + dev->direction, bytes, ret); return; + } hd->total_data_processed += bytes; From 6bed0f0bdb7192bd9d902d12a91dfd1ef977d77c Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Fri, 1 Sep 2023 10:28:12 +0800 Subject: [PATCH 378/639] audio: host: remove duplicated calculation for sample bytes in parameter, dma sample bytes already was calculated and assigned to dma config, during copy, this can be directly used, cycle saving is quite remarkable, 452 to 425, previous target is 420, we already meet with this patch. note: test platform is tgl board with sof debug build. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/host-zephyr.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 793b8f3a93f1..60a319900fa6 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -374,7 +374,6 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev { struct comp_buffer *buffer = hd->local_buffer; struct comp_buffer *buffer_c; - struct comp_buffer *dma_buf_c; struct dma_status dma_stat; uint32_t avail_samples; uint32_t free_samples; @@ -391,9 +390,7 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev return 0; } - dma_buf_c = buffer_acquire(hd->dma_buffer); - dma_sample_bytes = get_sample_bytes(audio_stream_get_frm_fmt(&dma_buf_c->stream)); - buffer_release(dma_buf_c); + dma_sample_bytes = hd->config.src_width; buffer_c = buffer_acquire(buffer); From dac982aaaa9cef7ac3a5ddf9e660883f44d7eef3 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Fri, 1 Sep 2023 11:48:37 +0800 Subject: [PATCH 379/639] audio: host: remove one buffer usage in host copy during host copy, buffer acuquire and release should be used as less as possible, since it takes a lot of cycles, for this patch, cycle reduction is: 425 to 406, nearly 5% reduced. note: test plafrom is tgl up board with sof debug build, base platform clock is 38.4mhz. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/host-zephyr.c | 10 +++------- src/include/sof/audio/host_copier.h | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index 60a319900fa6..a2918b31e1b6 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -455,7 +455,6 @@ static inline bool stream_sync(struct host_data *hd, struct comp_dev *dev) */ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_callback_t cb) { - struct comp_buffer *buffer_c; uint32_t copy_bytes; const unsigned int threshold = #if CONFIG_HOST_DMA_RELOAD_DELAY_ENABLE @@ -473,7 +472,6 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal cb(dev, copy_bytes); hd->partial_size += copy_bytes; - buffer_c = buffer_acquire(hd->dma_buffer); /* * On large buffers we don't need to reload DMA on every period. When @@ -482,8 +480,8 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal * also adding a 2ms safety margin. */ if (!IS_ENABLED(CONFIG_HOST_DMA_RELOAD_DELAY_ENABLE) || - audio_stream_get_size(&buffer_c->stream) < hd->period_bytes << 3 || - audio_stream_get_size(&buffer_c->stream) - hd->partial_size <= + hd->dma_buffer_size < hd->period_bytes << 3 || + hd->dma_buffer_size - hd->partial_size <= (2 + threshold) * hd->period_bytes) { if (stream_sync(hd, dev)) { ret = dma_reload(hd->chan->dma->z_dev, hd->chan->index, 0, 0, @@ -494,9 +492,6 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal hd->partial_size = 0; } } - - buffer_release(buffer_c); - return ret; } @@ -872,6 +867,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, config->src_width = audio_stream_sample_bytes(&dma_buf_c->stream); config->dest_width = config->src_width; + hd->dma_buffer_size = audio_stream_get_size(&dma_buf_c->stream); buffer_release(dma_buf_c); } diff --git a/src/include/sof/audio/host_copier.h b/src/include/sof/audio/host_copier.h index 60f0dccfdb90..c7ac454bf800 100644 --- a/src/include/sof/audio/host_copier.h +++ b/src/include/sof/audio/host_copier.h @@ -96,6 +96,7 @@ struct host_data { /* stream info */ struct sof_ipc_stream_posn posn; /* TODO: update this */ struct ipc_msg *msg; /**< host notification */ + uint32_t dma_buffer_size; /* dma buffer size */ #if CONFIG_HOST_DMA_STREAM_SYNCHRONIZATION bool is_grouped; uint8_t group_id; From b2ed867ce54cfc6f254ff946bb4806f2bc099278 Mon Sep 17 00:00:00 2001 From: Andrula Song <andrula.song@intel.com> Date: Wed, 13 Sep 2023 15:17:41 +0800 Subject: [PATCH 380/639] Audio: Fix the bugs of dai timestamp ops use the ts_config of struct dai_data as input/output parameter instead a temporary variable while calling the dai timestamp functions. Signed-off-by: Andrula Song <andrula.song@intel.com> --- src/audio/dai-zephyr.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 6f72a68f26d9..96467d044dae 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1669,7 +1669,7 @@ static int dai_copy(struct comp_dev *dev) int dai_common_ts_config_op(struct dai_data *dd, struct comp_dev *dev) { struct ipc_config_dai *dai = &dd->ipc_config; - struct dai_ts_cfg cfg; + struct dai_ts_cfg *cfg = (struct dai_ts_cfg *)&dd->ts_config; comp_dbg(dev, "dai_ts_config()"); if (!dd->chan) { @@ -1679,26 +1679,26 @@ int dai_common_ts_config_op(struct dai_data *dd, struct comp_dev *dev) switch (dai->type) { case SOF_DAI_INTEL_SSP: - cfg.type = DAI_INTEL_SSP; + cfg->type = DAI_INTEL_SSP; break; case SOF_DAI_INTEL_ALH: - cfg.type = DAI_INTEL_ALH; + cfg->type = DAI_INTEL_ALH; break; case SOF_DAI_INTEL_DMIC: - cfg.type = DAI_INTEL_DMIC; + cfg->type = DAI_INTEL_DMIC; break; default: comp_err(dev, "dai_ts_config(), not supported dai type"); return -EINVAL; } - cfg.direction = dai->direction; - cfg.index = dd->dai->index; - cfg.dma_id = dd->dma->plat_data.id; - cfg.dma_chan_index = dd->chan->index; - cfg.dma_chan_count = dd->dma->plat_data.channels; + cfg->direction = dai->direction; + cfg->index = dd->dai->index; + cfg->dma_id = dd->dma->plat_data.id; + cfg->dma_chan_index = dd->chan->index; + cfg->dma_chan_count = dd->dma->plat_data.channels; - return dai_ts_config(dd->dai->dev, &cfg); + return dai_ts_config(dd->dai->dev, cfg); } static int dai_ts_config_op(struct comp_dev *dev) @@ -1710,9 +1710,7 @@ static int dai_ts_config_op(struct comp_dev *dev) int dai_common_ts_start(struct dai_data *dd, struct comp_dev *dev) { - struct dai_ts_cfg cfg; - - return dai_ts_start(dd->dai->dev, &cfg); + return dai_ts_start(dd->dai->dev, (struct dai_ts_cfg *)&dd->ts_config); } static int dai_ts_start_op(struct comp_dev *dev) @@ -1725,11 +1723,10 @@ static int dai_ts_start_op(struct comp_dev *dev) int dai_common_ts_get(struct dai_data *dd, struct comp_dev *dev, struct timestamp_data *tsd) { - struct dai_ts_data tsdata; - struct dai_ts_cfg cfg; + struct dai_ts_data *tsdata = (struct dai_ts_data *)tsd; + struct dai_ts_cfg *cfg = (struct dai_ts_cfg *)&dd->ts_config; - /* TODO: convert to timestamp_data */ - return dai_ts_get(dd->dai->dev, &cfg, &tsdata); + return dai_ts_get(dd->dai->dev, cfg, tsdata); } static int dai_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd) @@ -1743,9 +1740,7 @@ static int dai_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd) int dai_common_ts_stop(struct dai_data *dd, struct comp_dev *dev) { - struct dai_ts_cfg cfg; - - return dai_ts_stop(dd->dai->dev, &cfg); + return dai_ts_stop(dd->dai->dev, (struct dai_ts_cfg *)&dd->ts_config); } static int dai_ts_stop_op(struct comp_dev *dev) From 38be6aa4dd39311301e334374ea8e1a457f75710 Mon Sep 17 00:00:00 2001 From: Andrula Song <andrula.song@intel.com> Date: Thu, 14 Sep 2023 19:33:50 +0800 Subject: [PATCH 381/639] Audio: use struct dai_ts_data replace timestamp_data Use struct dai_ts_data replace timestamp_data if CONFIG_ZEPHYR_NATIVE_DRIVERS is enabled. Signed-off-by: Andrula Song <andrula.song@intel.com> --- src/audio/asrc/asrc.c | 11 ++++-- src/audio/copier/copier.c | 4 +++ src/audio/dai-zephyr.c | 7 ++-- src/audio/module_adapter/module_adapter.c | 4 +++ src/include/sof/audio/component.h | 5 +++ src/include/sof/audio/dai_copier.h | 4 +++ .../sof/audio/module_adapter/module/generic.h | 4 +++ .../module_adapter/module/module_interface.h | 5 +++ src/include/sof/drivers/timestamp.h | 36 ------------------- src/include/sof/lib/dai-zephyr.h | 16 +-------- 10 files changed, 39 insertions(+), 57 deletions(-) delete mode 100644 src/include/sof/drivers/timestamp.h diff --git a/src/audio/asrc/asrc.c b/src/audio/asrc/asrc.c index dbefb7ba14c6..ef8e41ee87a4 100644 --- a/src/audio/asrc/asrc.c +++ b/src/audio/asrc/asrc.c @@ -681,8 +681,11 @@ static int asrc_dai_stop_timestamp(struct comp_data *cd) return -EINVAL; } -static int asrc_dai_get_timestamp(struct comp_data *cd, - struct timestamp_data *tsd) +#if CONFIG_ZEPHYR_NATIVE_DRIVERS + static int asrc_dai_get_timestamp(struct comp_data *cd, struct dai_ts_data *tsd) +#else + static int asrc_dai_get_timestamp(struct comp_data *cd, struct timestamp_data *tsd) +#endif { if (!cd->dai_dev) return -EINVAL; @@ -909,7 +912,11 @@ static int asrc_prepare(struct comp_dev *dev) static int asrc_control_loop(struct comp_dev *dev, struct comp_data *cd) { +#if CONFIG_ZEPHYR_NATIVE_DRIVERS + struct dai_ts_data tsd; +#else struct timestamp_data tsd; +#endif int64_t tmp; int32_t delta_sample; int32_t delta_ts; diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index de45b6273e85..b115a16df212 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -940,7 +940,11 @@ static int copier_dai_ts_start_op(struct comp_dev *dev) return dai_common_ts_start(dd, dev); } +#if CONFIG_ZEPHYR_NATIVE_DRIVERS +static int copier_dai_ts_get_op(struct comp_dev *dev, struct dai_ts_data *tsd) +#else static int copier_dai_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd) +#endif { struct processing_module *mod = comp_get_drvdata(dev); struct copier_data *cd = module_get_private_data(mod); diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index 96467d044dae..c892873420a1 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1721,15 +1721,14 @@ static int dai_ts_start_op(struct comp_dev *dev) return dai_common_ts_start(dd, dev); } -int dai_common_ts_get(struct dai_data *dd, struct comp_dev *dev, struct timestamp_data *tsd) +int dai_common_ts_get(struct dai_data *dd, struct comp_dev *dev, struct dai_ts_data *tsd) { - struct dai_ts_data *tsdata = (struct dai_ts_data *)tsd; struct dai_ts_cfg *cfg = (struct dai_ts_cfg *)&dd->ts_config; - return dai_ts_get(dd->dai->dev, cfg, tsdata); + return dai_ts_get(dd->dai->dev, cfg, tsd); } -static int dai_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd) +static int dai_ts_get_op(struct comp_dev *dev, struct dai_ts_data *tsd) { struct dai_data *dd = comp_get_drvdata(dev); diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index dace298fa5f8..5257d8fa23af 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -1566,7 +1566,11 @@ int module_adapter_ts_stop_op(struct comp_dev *dev) * 0 - success * value < 0 - failure. */ +#if CONFIG_ZEPHYR_NATIVE_DRIVERS +int module_adapter_ts_get_op(struct comp_dev *dev, struct dai_ts_data *tsd) +#else int module_adapter_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd) +#endif { struct processing_module *mod = comp_get_drvdata(dev); struct module_data *md = &mod->priv; diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index b4a61d765e21..01f004ab9fc9 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -48,6 +48,7 @@ struct comp_dev; struct sof_ipc_stream_posn; struct dai_hw_params; struct timestamp_data; +struct dai_ts_data; /** \addtogroup component_api Component API * @{ @@ -455,8 +456,12 @@ struct comp_ops { * * Mandatory for components that allocate DAI. */ +#if CONFIG_ZEPHYR_NATIVE_DRIVERS + int (*dai_ts_get)(struct comp_dev *dev, struct dai_ts_data *tsd); +#else int (*dai_ts_get)(struct comp_dev *dev, struct timestamp_data *tsd); +#endif /** * Bind, atomic - used to notify component of bind event. diff --git a/src/include/sof/audio/dai_copier.h b/src/include/sof/audio/dai_copier.h index 6219b92fb5b7..67165cb6d265 100644 --- a/src/include/sof/audio/dai_copier.h +++ b/src/include/sof/audio/dai_copier.h @@ -44,7 +44,11 @@ int dai_common_ts_start(struct dai_data *dd, struct comp_dev *dev); int dai_common_ts_stop(struct dai_data *dd, struct comp_dev *dev); +#if CONFIG_ZEPHYR_NATIVE_DRIVERS +int dai_common_ts_get(struct dai_data *dd, struct comp_dev *dev, struct dai_ts_data *tsd); +#else int dai_common_ts_get(struct dai_data *dd, struct comp_dev *dev, struct timestamp_data *tsd); +#endif int dai_common_get_hw_params(struct dai_data *dd, struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir); diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index b101e458f6cc..2c9fd2d88afa 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -313,7 +313,11 @@ int module_adapter_position(struct comp_dev *dev, struct sof_ipc_stream_posn *po int module_adapter_ts_config_op(struct comp_dev *dev); int module_adapter_ts_start_op(struct comp_dev *dev); int module_adapter_ts_stop_op(struct comp_dev *dev); +#if CONFIG_ZEPHYR_NATIVE_DRIVERS +int module_adapter_ts_get_op(struct comp_dev *dev, struct dai_ts_data *tsd); +#else int module_adapter_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd); +#endif static inline void module_update_buffer_position(struct input_stream_buffer *input_buffers, struct output_stream_buffer *output_buffers, diff --git a/src/include/sof/audio/module_adapter/module/module_interface.h b/src/include/sof/audio/module_adapter/module/module_interface.h index fab3cefdc0ef..70884e493861 100644 --- a/src/include/sof/audio/module_adapter/module/module_interface.h +++ b/src/include/sof/audio/module_adapter/module/module_interface.h @@ -69,6 +69,7 @@ struct output_stream_buffer { struct comp_dev; struct timestamp_data; +struct dai_ts_data; /** * \struct module_endpoint_ops * \brief Ops relevant only for the endpoint devices such as the host copier or DAI copier. @@ -120,7 +121,11 @@ struct module_endpoint_ops { * * Mandatory for components that allocate DAI. */ +#if CONFIG_ZEPHYR_NATIVE_DRIVERS + int (*dai_ts_get)(struct comp_dev *dev, struct dai_ts_data *tsd); +#else int (*dai_ts_get)(struct comp_dev *dev, struct timestamp_data *tsd); +#endif /** * Fetches hardware stream parameters. diff --git a/src/include/sof/drivers/timestamp.h b/src/include/sof/drivers/timestamp.h deleted file mode 100644 index ff867dc1e33b..000000000000 --- a/src/include/sof/drivers/timestamp.h +++ /dev/null @@ -1,36 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2019 Intel Corporation. All rights reserved. - */ - -#ifndef __SOF_DRIVERS_TIMESTAMP_H__ -#define __SOF_DRIVERS_TIMESTAMP_H__ - -#include <platform/drivers/timestamp.h> - -struct dai; -struct timestamp_cfg; -struct timestamp_data; - -/* HDA */ -int timestamp_hda_config(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_hda_start(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_hda_stop(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_hda_get(struct dai *dai, struct timestamp_cfg *cfg, - struct timestamp_data *tsd); - -/* DMIC */ -int timestamp_dmic_config(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_dmic_start(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_dmic_stop(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_dmic_get(struct dai *dai, struct timestamp_cfg *cfg, - struct timestamp_data *tsd); - -/* SSP */ -int timestamp_ssp_config(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_ssp_start(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_ssp_stop(struct dai *dai, struct timestamp_cfg *cfg); -int timestamp_ssp_get(struct dai *dai, struct timestamp_cfg *cfg, - struct timestamp_data *tsd); - -#endif /* __SOF_DRIVERS_TIMESTAMP_H__ */ diff --git a/src/include/sof/lib/dai-zephyr.h b/src/include/sof/lib/dai-zephyr.h index 49fbd2e02aa8..65ae27ddf9ac 100644 --- a/src/include/sof/lib/dai-zephyr.h +++ b/src/include/sof/lib/dai-zephyr.h @@ -33,6 +33,7 @@ #include <stddef.h> #include <stdint.h> #include <zephyr/device.h> +#include <zephyr/drivers/dai.h> /** \addtogroup sof_dai_drivers DAI Drivers * DAI Drivers API specification. @@ -61,21 +62,6 @@ struct timestamp_cfg { int dma_chan_index; /* Used GPDMA channel */ int dma_chan_count; /* Channels in single GPDMA */ }; - -struct timestamp_data { - uint64_t walclk; /* Wall clock */ - uint64_t sample; /* Sample count */ - uint32_t walclk_rate; /* Rate in Hz, e.g. 19200000 */ -}; - -struct timestamp_ops { - int (*ts_config)(struct dai *dai, struct timestamp_cfg *cfg); - int (*ts_start)(struct dai *dai, struct timestamp_cfg *cfg); - int (*ts_stop)(struct dai *dai, struct timestamp_cfg *cfg); - int (*ts_get)(struct dai *dai, struct timestamp_cfg *cfg, - struct timestamp_data *tsd); -}; - union hdalink_cfg { uint16_t full; struct { From 2ede148444183ef74c29d52afb2bd7c108bb60ee Mon Sep 17 00:00:00 2001 From: Andrula Song <andrula.song@intel.com> Date: Thu, 14 Sep 2023 19:38:23 +0800 Subject: [PATCH 382/639] Audio: use struct dai_ts_cfg replace timestamp_cfg Use struct dai_ts_cfg replace timestamp_cfg of struct dai_data in dai-zephyr.h Signed-off-by: Andrula Song <andrula.song@intel.com> --- src/audio/dai-zephyr.c | 2 +- src/include/sof/lib/dai-zephyr.h | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index c892873420a1..abe6ae075df8 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -1669,7 +1669,7 @@ static int dai_copy(struct comp_dev *dev) int dai_common_ts_config_op(struct dai_data *dd, struct comp_dev *dev) { struct ipc_config_dai *dai = &dd->ipc_config; - struct dai_ts_cfg *cfg = (struct dai_ts_cfg *)&dd->ts_config; + struct dai_ts_cfg *cfg = &dd->ts_config; comp_dbg(dev, "dai_ts_config()"); if (!dd->chan) { diff --git a/src/include/sof/lib/dai-zephyr.h b/src/include/sof/lib/dai-zephyr.h index 65ae27ddf9ac..98e174a43c8d 100644 --- a/src/include/sof/lib/dai-zephyr.h +++ b/src/include/sof/lib/dai-zephyr.h @@ -53,15 +53,6 @@ struct dai { struct k_spinlock lock; /* protect properties */ }; -struct timestamp_cfg { - uint32_t walclk_rate; /* Rate in Hz, e.g. 19200000 */ - int type; /* SSP, DMIC, HDA, etc. */ - int direction; /* Playback, capture */ - int index; /* For SSPx to select correct timestamp register */ - int dma_id; /* GPDMA id*/ - int dma_chan_index; /* Used GPDMA channel */ - int dma_chan_count; /* Channels in single GPDMA */ -}; union hdalink_cfg { uint16_t full; struct { @@ -127,7 +118,7 @@ struct dai_data { struct comp_dev *dai_dev; struct comp_buffer *dma_buffer; struct comp_buffer *local_buffer; - struct timestamp_cfg ts_config; + struct dai_ts_cfg ts_config; struct dai *dai; struct dma *dma; struct dai_group *group; /* NULL if no group assigned */ From 57cb19ececb803b4b7e2d6bb5744b7ef8d93aa00 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Thu, 14 Sep 2023 15:31:39 +0300 Subject: [PATCH 383/639] drivers: imx: sai: Fix frame size computation When I2S-like interface is enabled we must have 2 words in a frame because this is how I2S works (it has 2 channels)! So, even if the user plays a mono file we must configure 2 words per slot and the second slot will be masked so the users will get silence on the second channel. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/sai.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/drivers/imx/sai.c b/src/drivers/imx/sai.c index 2c4c22b01fa7..c6e30f791fb2 100644 --- a/src/drivers/imx/sai.c +++ b/src/drivers/imx/sai.c @@ -229,6 +229,7 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ uint32_t val_cr2 = 0, val_cr4 = 0, val_cr5 = 0; uint32_t mask_cr2 = 0, mask_cr4 = 0, mask_cr5 = 0; uint32_t clk_div; + bool tdm_enable; struct sai_pdata *sai = dai_get_drvdata(dai); sai->config = *config; @@ -251,6 +252,14 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ clk_div = (config->sai.mclk_rate / config->sai.bclk_rate / 2) - 1; } + /* TDM mode is enabled only when fmt is dsp_a or dsp_b and + * we can have from 1 to 32 channels. + * for any other formats we assume I2S like interface where + * audio frames have 2 channels, even for mono scenario. The + * second channel will be masked out. + */ + tdm_enable = false; + switch (config->format & SOF_DAI_FMT_FORMAT_MASK) { case SOF_DAI_FMT_I2S: /* @@ -285,6 +294,7 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ val_cr2 |= REG_SAI_CR2_BCP; val_cr4 |= REG_SAI_CR4_FSE; val_cr4 |= REG_SAI_CR4_SYWD(1U); + tdm_enable = true; break; case SOF_DAI_FMT_DSP_B: /* @@ -293,6 +303,7 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ */ val_cr2 |= REG_SAI_CR2_BCP; val_cr4 |= REG_SAI_CR4_SYWD(1U); + tdm_enable = true; break; case SOF_DAI_FMT_PDM: val_cr2 |= REG_SAI_CR2_BCP; @@ -368,7 +379,12 @@ static inline int sai_set_config(struct dai *dai, struct ipc_config_dai *common_ } #endif - val_cr4 |= REG_SAI_CR4_FRSZ(sai->params.tdm_slots); + if (tdm_enable) + val_cr4 |= REG_SAI_CR4_FRSZ(sai->params.tdm_slots); + else + val_cr4 |= REG_SAI_CR4_FRSZ( + (sai->params.tdm_slots == 1) ? 2 : sai->params.tdm_slots); + val_cr4 |= REG_SAI_CR4_CHMOD; val_cr4 |= REG_SAI_CR4_MF; From 3b31adc259d760ded0be24937c4cf31bbb25010f Mon Sep 17 00:00:00 2001 From: "Kwasowiec, Fabiola" <fabiola.kwasowiec@intel.com> Date: Thu, 14 Sep 2023 08:48:06 +0200 Subject: [PATCH 384/639] helper: add a condition before updating the component direction At the pipeline reset stage, the direction of the components is not always known, resulting in a call to a field that is null and consequently a crash/timeout. Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com> --- src/include/sof/ipc/topology.h | 2 +- src/ipc/ipc4/handler.c | 4 ++-- src/ipc/ipc4/helper.c | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/include/sof/ipc/topology.h b/src/include/sof/ipc/topology.h index 810df643fc13..34748379dbc2 100644 --- a/src/include/sof/ipc/topology.h +++ b/src/include/sof/ipc/topology.h @@ -56,7 +56,7 @@ int ipc4_chain_dma_state(struct comp_dev *dev, struct ipc4_chain_dma *cdma); int ipc4_create_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma); int ipc4_trigger_chain_dma(struct ipc *ipc, struct ipc4_chain_dma *cdma, bool *delay); int ipc4_process_on_core(uint32_t core, bool blocking); -int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id); +int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id, uint32_t cmd); int ipc4_find_dma_config(struct ipc_config_dai *dai, uint8_t *data_buffer, uint32_t size); int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd); int ipc4_pipeline_trigger(struct ipc_comp_dev *ppl_icd, uint32_t cmd, bool *delayed); diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index bb5ad023d06a..bc91c6a3727f 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -274,7 +274,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd) switch (status) { case COMP_STATE_INIT: tr_dbg(&ipc_tr, "pipeline %d: reset from init", ppl_icd->id); - ret = ipc4_pipeline_complete(ipc, ppl_icd->id); + ret = ipc4_pipeline_complete(ipc, ppl_icd->id, cmd); if (ret < 0) ret = IPC4_INVALID_REQUEST; @@ -296,7 +296,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd) switch (status) { case COMP_STATE_INIT: tr_dbg(&ipc_tr, "pipeline %d: pause from init", ppl_icd->id); - ret = ipc4_pipeline_complete(ipc, ppl_icd->id); + ret = ipc4_pipeline_complete(ipc, ppl_icd->id, cmd); if (ret < 0) ret = IPC4_INVALID_REQUEST; diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 206773d23c0c..1f1bcc46e8c4 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -630,7 +630,7 @@ static int ipc4_update_comps_direction(struct ipc *ipc, uint32_t ppl_id) return 0; } -int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id) +int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id, uint32_t cmd) { struct ipc_comp_dev *ipc_pipe; int ret; @@ -649,9 +649,11 @@ int ipc4_pipeline_complete(struct ipc *ipc, uint32_t comp_id) * pipeline w/o connection to gateway, so direction is not configured in binding phase. * Need to update direction for such modules when pipeline is completed. */ - ret = ipc4_update_comps_direction(ipc, comp_id); - if (ret < 0) - return ret; + if (cmd != SOF_IPC4_PIPELINE_STATE_RESET) { + ret = ipc4_update_comps_direction(ipc, comp_id); + if (ret < 0) + return ret; + } return ipc_pipeline_complete(ipc, comp_id); } From 0675b2af33e3a4e466518aff7c29c8227cc9d49f Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Date: Fri, 8 Sep 2023 17:29:12 +0200 Subject: [PATCH 385/639] system-agent: remove an unused variable sys_service_p in src/audio/module_adapter/library/native_system_agent.c is unused, remove it. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> --- src/audio/module_adapter/library/native_system_agent.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/audio/module_adapter/library/native_system_agent.c b/src/audio/module_adapter/library/native_system_agent.c index b2d798c14238..58c24fadf31a 100644 --- a/src/audio/module_adapter/library/native_system_agent.c +++ b/src/audio/module_adapter/library/native_system_agent.c @@ -30,9 +30,6 @@ void *native_system_agent_start(uint32_t *sys_service, native_sys_agent.log_handle = log_handle; void *system_agent_p = &native_sys_agent; - uint32_t **sys_service_p = &sys_service; - - *sys_service_p = (uint32_t *)(&native_sys_agent.system_service); native_create_instance_f ci = (native_create_instance_f)entry_point; From 6f2475b086ce1336a405fea0f9d46429f166b11b Mon Sep 17 00:00:00 2001 From: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com> Date: Thu, 24 Aug 2023 19:44:31 +0530 Subject: [PATCH 386/639] topology1: Use DYNAMIC for ADL and RPL topologies use dynamic for all the adl and rpl topologies except 3p(waves,DTS), excluded Dell sdw topologies which are not tested. Signed-off-by: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com> --- tools/topology/topology1/CMakeLists.txt | 50 ++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 7a183519a155..dc5384985e4f 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -82,34 +82,34 @@ set(TPLGS "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" "sof-ehl-rt5660\;sof-ehl-rt5660-nohdmi" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" + "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves-spk-only\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DWAVES_SPK_ONLY" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2" - "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DDYNAMIC=1" + "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE" + "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" @@ -119,15 +119,15 @@ set(TPLGS "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2\;-DAMP_SSP=2" "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2-xperi\;-DAMP_SSP=2\;-DINCLUDE_IIR_EQ=1" - "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD" - "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" + "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDTS=`DTS'" - "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" - "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000" - "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" - "sof-adl-nau8825\;sof-adl-nau8318-nau8825\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000" + "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" + "sof-adl-nau8825\;sof-adl-nau8318-nau8825\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" - "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl" + "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl\;-DDYNAMIC=1" "sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec" "sof-glk-es8336\;sof-tgl-es8336\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" From c9e0fc8c9afdc3d5e87cf3d6cc908603cf5c8b59 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 4 Sep 2023 15:37:29 +0200 Subject: [PATCH 387/639] module_adapter: ModuleInitialSettingsConcrete: Fix possible null reference The dataAs function can return null if the buffer size is smaller than the size of the target structure. Added handler for this situation. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- .../module_adapter/iadk/module_initial_settings_concrete.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp b/src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp index 2460aaee51b3..bf8909d8b543 100644 --- a/src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp +++ b/src/audio/module_adapter/iadk/module_initial_settings_concrete.cpp @@ -49,6 +49,9 @@ ModuleInitialSettingsConcrete::ModuleInitialSettingsConcrete(DwordArray const &c /* It shall contain BaseModuleCfg + BaseModuleCfgExt + */ /* optionally some InputPinFormat[] + OutputPinFormat[] data */ CompoundCfg const * unvalidated_compound_cfg = cfg_ipc_msg.dataAs<CompoundCfg>(); + if (!unvalidated_compound_cfg) + return; + const size_t computed_msg_size = sizeof(CompoundCfg) - /* CompoundCfg already contains one InputPinFormat and From e4447e272afbc73e076657497611f39700eafe72 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 7 Sep 2023 11:49:44 +0200 Subject: [PATCH 388/639] buf: remove buffer_acquire/release from buffer.c remove unnecessary calls from buffer.c/h this is a continuation of changes from commit 4a036999118cfa7e491cbefc8eb6b737f50b7e33 Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/buffer.c | 14 +++++--------- src/include/sof/audio/buffer.h | 6 ++---- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/audio/buffer.c b/src/audio/buffer.c index 40ef2a914817..02f6c9da0777 100644 --- a/src/audio/buffer.c +++ b/src/audio/buffer.c @@ -31,7 +31,6 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u bool is_shared) { struct comp_buffer *buffer; - struct comp_buffer *buffer_c; void *stream_addr; tr_dbg(&buffer_tr, "buffer_alloc()"); @@ -65,14 +64,11 @@ struct comp_buffer *buffer_alloc(uint32_t size, uint32_t caps, uint32_t flags, u } /* From here no more uncached access to the buffer object, except its list headers */ - buffer_c = buffer_acquire(buffer); - audio_stream_set_addr(&buffer_c->stream, stream_addr); - buffer_init(buffer_c, size, caps); + audio_stream_set_addr(&buffer->stream, stream_addr); + buffer_init(buffer, size, caps); - audio_stream_set_underrun(&buffer_c->stream, !!(flags & SOF_BUF_UNDERRUN_PERMITTED)); - audio_stream_set_overrun(&buffer_c->stream, !!(flags & SOF_BUF_OVERRUN_PERMITTED)); - - buffer_release(buffer_c); + audio_stream_set_underrun(&buffer->stream, !!(flags & SOF_BUF_UNDERRUN_PERMITTED)); + audio_stream_set_overrun(&buffer->stream, !!(flags & SOF_BUF_OVERRUN_PERMITTED)); list_init(&buffer->source_list); list_init(&buffer->sink_list); @@ -203,7 +199,7 @@ void buffer_free(struct comp_buffer *buffer) notifier_unregister_all(NULL, buffer); rfree(buffer->stream.addr); - coherent_free_thread(buffer, c); + rfree(buffer); } void comp_update_buffer_produce(struct comp_buffer *buffer, uint32_t bytes) diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index c461d19c6977..6b08b0f3af91 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -249,10 +249,8 @@ void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir); static inline struct comp_dev *buffer_get_comp(struct comp_buffer *buffer, int dir) { - struct comp_buffer *buffer_c = buffer_acquire(buffer); - struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer_c->sink : - buffer_c->source; - buffer_release(buffer_c); + struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer->sink : + buffer->source; return comp; } From dcc41ffac6548e4be1c76a001ce04693cfa28679 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 7 Sep 2023 12:02:18 +0200 Subject: [PATCH 389/639] comp: remove buffer_acquire from component.h remove 2 inline functions comp_get_copy_limits_with_lock comp_get_copy_limits_with_lock_frame_aligned this is a continuation of changes from commit 4a036999118cfa7e491cbefc8eb6b737f50b7e33 Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/rtnr/rtnr.c | 2 +- src/include/sof/audio/component.h | 53 +------------------------------ 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/src/audio/rtnr/rtnr.c b/src/audio/rtnr/rtnr.c index 270559b0728f..c726c9e64954 100644 --- a/src/audio/rtnr/rtnr.c +++ b/src/audio/rtnr/rtnr.c @@ -832,7 +832,7 @@ static int rtnr_copy(struct comp_dev *dev) comp_dbg(dev, "rtnr_copy() passthrough"); /* Get source, sink, number of frames etc. to process. */ - comp_get_copy_limits_with_lock(source, sink, &cl); + comp_get_copy_limits(source, sink, &cl); buffer_stream_invalidate(source, cl.source_bytes); diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 01f004ab9fc9..3920e9d2d8ae 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -669,9 +669,7 @@ static inline struct comp_dev *comp_alloc(const struct comp_driver *drv, /* * Use uncached address everywhere to access components to rule out - * multi-core failures. In the future we might decide to switch over to - * the latest coherence API for performance. In that case components - * will be acquired for cached access and released afterwards. + * multi-core failures. TODO: verify if cached alias may be used in some cases */ dev = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, bytes); if (!dev) @@ -886,55 +884,6 @@ void comp_get_copy_limits_frame_aligned(const struct comp_buffer *source, const struct comp_buffer *sink, struct comp_copy_limits *cl); -/** - * Version of comp_get_copy_limits that locks both buffers to guarantee - * consistent state readings. - * - * @param[in] source Source buffer. - * @param[in] sink Sink buffer - * @param[out] cl Current copy limits. - */ -static inline -void comp_get_copy_limits_with_lock(struct comp_buffer *source, - struct comp_buffer *sink, - struct comp_copy_limits *cl) -{ - struct comp_buffer *source_c, *sink_c; - - source_c = buffer_acquire(source); - sink_c = buffer_acquire(sink); - - comp_get_copy_limits(source_c, sink_c, cl); - - buffer_release(sink_c); - buffer_release(source_c); -} - -/** - * Version of comp_get_copy_limits_with_lock_frame_aligned that locks both - * buffers to guarantee consistent state readings and the frames aligned with - * the requirement. - * - * @param[in] source Buffer of source. - * @param[in] sink Buffer of sink - * @param[out] cl Current copy limits. - */ -static inline -void comp_get_copy_limits_with_lock_frame_aligned(struct comp_buffer *source, - struct comp_buffer *sink, - struct comp_copy_limits *cl) -{ - struct comp_buffer *source_c, *sink_c; - - source_c = buffer_acquire(source); - sink_c = buffer_acquire(sink); - - comp_get_copy_limits_frame_aligned(source_c, sink_c, cl); - - buffer_release(sink_c); - buffer_release(source_c); -} - /** * Get component state. * From 7ca691dd2445a6843a2c78e08578a4dcd76712ed Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 7 Sep 2023 12:05:06 +0200 Subject: [PATCH 390/639] ipc: remove buffer_acquire from ipc helpers remove buffer_acquire / release from ipc helpers this is a continuation of changes from commit 4a036999118cfa7e491cbefc8eb6b737f50b7e33 Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/ipc/ipc-helper.c | 29 ++++++++--------------------- src/ipc/ipc3/helper.c | 17 ++++++----------- src/ipc/ipc4/helper.c | 22 +++++----------------- 3 files changed, 19 insertions(+), 49 deletions(-) diff --git a/src/ipc/ipc-helper.c b/src/ipc/ipc-helper.c index 5ca3c78c72e6..44983f6e6f95 100644 --- a/src/ipc/ipc-helper.c +++ b/src/ipc/ipc-helper.c @@ -104,7 +104,6 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag, struct list_item *clist; struct comp_buffer *sinkb; struct comp_buffer *buf; - struct comp_buffer *buf_c; int dir = dev->direction; if (!params) { @@ -128,22 +127,18 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag, struct comp_buffer, source_list); - buf_c = buffer_acquire(buf); - /* update specific pcm parameter with buffer parameter if * specific flag is set. */ - comp_update_params(flag, params, buf_c); + comp_update_params(flag, params, buf); /* overwrite buffer parameters with modified pcm * parameters */ - buffer_set_params(buf_c, params, BUFFER_UPDATE_FORCE); + buffer_set_params(buf, params, BUFFER_UPDATE_FORCE); /* set component period frames */ - component_set_nearest_period_frames(dev, audio_stream_get_rate(&buf_c->stream)); - - buffer_release(buf_c); + component_set_nearest_period_frames(dev, audio_stream_get_rate(&buf->stream)); } else { /* for other components we iterate over all downstream buffers * (for playback) or upstream buffers (for capture). @@ -152,19 +147,15 @@ int comp_verify_params(struct comp_dev *dev, uint32_t flag, list_for_item(clist, buffer_list) { buf = buffer_from_list(clist, dir); - buf_c = buffer_acquire(buf); - comp_update_params(flag, params, buf_c); - buffer_set_params(buf_c, params, BUFFER_UPDATE_FORCE); - buffer_release(buf_c); + comp_update_params(flag, params, buf); + buffer_set_params(buf, params, BUFFER_UPDATE_FORCE); } /* fetch sink buffer in order to calculate period frames */ sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - buf_c = buffer_acquire(sinkb); - component_set_nearest_period_frames(dev, audio_stream_get_rate(&buf_c->stream)); - buffer_release(buf_c); + component_set_nearest_period_frames(dev, audio_stream_get_rate(&sinkb->stream)); } return 0; @@ -291,10 +282,8 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id) irq_local_disable(flags); list_for_item_safe(clist, tmp, &icd->cd->bsource_list) { struct comp_buffer *buffer = container_of(clist, struct comp_buffer, sink_list); - struct comp_buffer *buffer_c = buffer_acquire(buffer); - buffer_c->sink = NULL; - buffer_release(buffer_c); + buffer->sink = NULL; /* Also if it isn't shared - we are about to modify uncached data */ dcache_writeback_invalidate_region(uncache_to_cache(buffer), sizeof(*buffer)); @@ -304,10 +293,8 @@ int ipc_comp_free(struct ipc *ipc, uint32_t comp_id) list_for_item_safe(clist, tmp, &icd->cd->bsink_list) { struct comp_buffer *buffer = container_of(clist, struct comp_buffer, source_list); - struct comp_buffer *buffer_c = buffer_acquire(buffer); - buffer_c->source = NULL; - buffer_release(buffer_c); + buffer->source = NULL; /* Also if it isn't shared - we are about to modify uncached data */ dcache_writeback_invalidate_region(uncache_to_cache(buffer), sizeof(*buffer)); diff --git a/src/ipc/ipc3/helper.c b/src/ipc/ipc3/helper.c index 9a9bbf0ac21d..f7b731ffde90 100644 --- a/src/ipc/ipc3/helper.c +++ b/src/ipc/ipc3/helper.c @@ -487,7 +487,6 @@ int ipc_buffer_free(struct ipc *ipc, uint32_t buffer_id) unsigned int core; bool sink_active = false; bool source_active = false; - struct comp_buffer *buffer_c; /* check whether buffer exists */ ibd = ipc_get_buffer_by_id(ipc, buffer_id); @@ -498,8 +497,6 @@ int ipc_buffer_free(struct ipc *ipc, uint32_t buffer_id) if (!cpu_is_me(ibd->core)) return ipc_process_on_core(ibd->core, false); - buffer_c = buffer_acquire(ibd->cb); - /* try to find sink/source components to check if they still exists */ list_for_item(clist, &ipc->comp_list) { icd = container_of(clist, struct ipc_comp_dev, list); @@ -507,21 +504,19 @@ int ipc_buffer_free(struct ipc *ipc, uint32_t buffer_id) continue; /* check comp state if sink and source are valid */ - if (buffer_c->sink == icd->cd) { - sink = buffer_c->sink; - if (buffer_c->sink->state != COMP_STATE_READY) + if (ibd->cb->sink == icd->cd) { + sink = ibd->cb->sink; + if (ibd->cb->sink->state != COMP_STATE_READY) sink_active = true; } - if (buffer_c->source == icd->cd) { - source = buffer_c->source; - if (buffer_c->source->state != COMP_STATE_READY) + if (ibd->cb->source == icd->cd) { + source = ibd->cb->source; + if (ibd->cb->source->state != COMP_STATE_READY) source_active = true; } } - buffer_release(buffer_c); - /* * A buffer could be connected to 2 different pipelines. When one pipeline is freed, the * buffer comp that belongs in this pipeline will need to be freed even when the other diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 1f1bcc46e8c4..d213a8f43fd5 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -241,14 +241,11 @@ static int ipc_pipeline_module_free(uint32_t pipeline_id) /* free sink buffer allocated by current component in bind function */ list_for_item_safe(list, _list, &icd->cd->bsink_list) { - struct comp_buffer *buffer_c; struct comp_dev *sink; buffer = container_of(list, struct comp_buffer, source_list); pipeline_disconnect(icd->cd, buffer, PPL_CONN_DIR_COMP_TO_BUFFER); - buffer_c = buffer_acquire(buffer); - sink = buffer_c->sink; - buffer_release(buffer_c); + sink = buffer->sink; /* free the buffer only when the sink module has also been disconnected */ if (!sink) @@ -257,14 +254,11 @@ static int ipc_pipeline_module_free(uint32_t pipeline_id) /* free source buffer allocated by current component in bind function */ list_for_item_safe(list, _list, &icd->cd->bsource_list) { - struct comp_buffer *buffer_c; struct comp_dev *source; buffer = container_of(list, struct comp_buffer, sink_list); pipeline_disconnect(icd->cd, buffer, PPL_CONN_DIR_BUFFER_TO_COMP); - buffer_c = buffer_acquire(buffer); - source = buffer_c->source; - buffer_release(buffer_c); + source = buffer->source; /* free the buffer only when the source module has also been disconnected */ if (!source) @@ -337,7 +331,6 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) { struct ipc4_module_bind_unbind *bu; struct comp_buffer *buffer; - struct comp_buffer *buffer_c; struct comp_dev *source; struct comp_dev *sink; struct ipc4_base_module_cfg source_src_cfg; @@ -388,10 +381,8 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) * OBS of a buffer is IBS of destination component */ - buffer_c = buffer_acquire(buffer); - source_set_ibs(audio_stream_get_source(&buffer_c->stream), source_src_cfg.obs); - sink_set_obs(audio_stream_get_sink(&buffer_c->stream), sink_src_cfg.ibs); - buffer_release(buffer_c); + source_set_ibs(audio_stream_get_source(&buffer->stream), source_src_cfg.obs); + sink_set_obs(audio_stream_get_sink(&buffer->stream), sink_src_cfg.ibs); /* * Connect and bind the buffer to both source and sink components with the interrupts @@ -490,10 +481,7 @@ int ipc_comp_disconnect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) buffer_id = IPC4_COMP_ID(bu->extension.r.src_queue, bu->extension.r.dst_queue); list_for_item(sink_list, &src->bsink_list) { struct comp_buffer *buf = container_of(sink_list, struct comp_buffer, source_list); - struct comp_buffer *buf_c = buffer_acquire(buf); - bool found = buf_c->id == buffer_id; - - buffer_release(buf_c); + bool found = buf->id == buffer_id; if (found) { buffer = buf; From 4c895a56eb97845211aba1be95d4c7c69a237994 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 7 Sep 2023 12:14:03 +0200 Subject: [PATCH 391/639] mod: remove buffer_acquire from module_adapter This change removes all buffer_acquire/buffer_release from module adapter The change does not contain any optimalizations that now may be easy to do. They will be introduced in separate PR this is a continuation of changes from commit 4a036999118cfa7e491cbefc8eb6b737f50b7e33 Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/module_adapter/module_adapter.c | 213 ++++++++-------------- 1 file changed, 76 insertions(+), 137 deletions(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 5257d8fa23af..fcf02e0ef148 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -175,8 +175,6 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, static int module_adapter_sink_src_prepare(struct comp_dev *dev) { - struct comp_buffer *source_buffers_c[PLATFORM_MAX_STREAMS]; - struct comp_buffer *sinks_buffers_c[PLATFORM_MAX_STREAMS]; struct sof_sink *audio_sink[PLATFORM_MAX_STREAMS]; struct sof_source *audio_src[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); @@ -184,27 +182,24 @@ static int module_adapter_sink_src_prepare(struct comp_dev *dev) uint32_t num_of_sources = 0; uint32_t num_of_sinks = 0; int ret; - int i = 0; /* acquire all sink and source buffers, get handlers to sink/source API */ list_for_item(blist, &dev->bsink_list) { - struct comp_buffer *sink_buffer_uc; + struct comp_buffer *sink_buffer; - sink_buffer_uc = container_of(blist, struct comp_buffer, source_list); - sinks_buffers_c[num_of_sinks] = buffer_acquire(sink_buffer_uc); + sink_buffer = container_of(blist, struct comp_buffer, source_list); audio_sink[num_of_sinks] = - audio_stream_get_sink(&sinks_buffers_c[num_of_sinks]->stream); + audio_stream_get_sink(&sink_buffer->stream); sink_reset_num_of_processed_bytes(audio_sink[num_of_sinks]); num_of_sinks++; } list_for_item(blist, &dev->bsource_list) { - struct comp_buffer *source_buffer_uc; + struct comp_buffer *source_buffer; - source_buffer_uc = container_of(blist, struct comp_buffer, sink_list); - source_buffers_c[num_of_sources] = buffer_acquire(source_buffer_uc); + source_buffer = container_of(blist, struct comp_buffer, sink_list); audio_src[num_of_sources] = - audio_stream_get_source(&source_buffers_c[num_of_sources]->stream); + audio_stream_get_source(&source_buffer->stream); source_reset_num_of_processed_bytes(audio_src[num_of_sources]); num_of_sources++; } @@ -212,14 +207,6 @@ static int module_adapter_sink_src_prepare(struct comp_dev *dev) /* Prepare module */ ret = module_prepare(mod, audio_src, num_of_sources, audio_sink, num_of_sinks); - /* release all source buffers in reverse order */ - for (i = num_of_sources - 1; i >= 0; i--) - buffer_release(source_buffers_c[i]); - - /* release all sink buffers in reverse order */ - for (i = num_of_sinks - 1; i >= 0 ; i--) - buffer_release(sinks_buffers_c[i]); - return ret; } @@ -236,8 +223,6 @@ int module_adapter_prepare(struct comp_dev *dev) int ret; struct processing_module *mod = comp_get_drvdata(dev); struct module_data *md = &mod->priv; - struct comp_buffer *buffer_c; - struct comp_buffer *sink_c; struct comp_buffer *sink; struct list_item *blist, *_blist; uint32_t buff_periods; @@ -286,13 +271,10 @@ int module_adapter_prepare(struct comp_dev *dev) * parameter from sink buffer is settled, and still prior to all references to period_bytes. */ sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - mod->period_bytes = audio_stream_period_bytes(&sink_c->stream, dev->frames); + mod->period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames); comp_dbg(dev, "module_adapter_prepare(): got period_bytes = %u", mod->period_bytes); - buffer_release(sink_c); - /* * compute number of input buffers and make the source_info shared if the module is on a * different core than any of it's sources @@ -460,28 +442,23 @@ int module_adapter_prepare(struct comp_dev *dev) buffer_attach(buffer, &mod->sink_buffer_list, PPL_DIR_UPSTREAM); irq_local_enable(flags); - buffer_c = buffer_acquire(buffer); - buffer_set_params(buffer_c, mod->stream_params, BUFFER_UPDATE_FORCE); - buffer_reset_pos(buffer_c, NULL); - buffer_release(buffer_c); + buffer_set_params(buffer, mod->stream_params, BUFFER_UPDATE_FORCE); + buffer_reset_pos(buffer, NULL); } } else { list_for_item(blist, &mod->sink_buffer_list) { struct comp_buffer *buffer = container_of(blist, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(buffer); - ret = buffer_set_size(buffer_c, buff_size, 0); + ret = buffer_set_size(buffer, buff_size, 0); if (ret < 0) { - buffer_release(buffer_c); comp_err(dev, "module_adapter_prepare(): buffer_set_size() failed, buff_size = %u", buff_size); goto free; } - buffer_set_params(buffer_c, mod->stream_params, BUFFER_UPDATE_FORCE); - buffer_reset_pos(buffer_c, NULL); - buffer_release(buffer_c); + buffer_set_params(buffer, mod->stream_params, BUFFER_UPDATE_FORCE); + buffer_reset_pos(buffer, NULL); } } @@ -503,11 +480,11 @@ int module_adapter_prepare(struct comp_dev *dev) out_data_free: for (i = 0; i < mod->num_output_buffers; i++) - rfree((__sparse_force void *)mod->output_buffers[i].data); + rfree(mod->output_buffers[i].data); in_data_free: for (i = 0; i < mod->num_input_buffers; i++) - rfree((__sparse_force void *)mod->input_buffers[i].data); + rfree(mod->input_buffers[i].data); in_out_free: rfree(mod->output_buffers); @@ -678,7 +655,6 @@ static void module_adapter_process_output(struct comp_dev *dev) { struct processing_module *mod = comp_get_drvdata(dev); struct comp_buffer *sink; - struct comp_buffer *sink_c; struct list_item *blist; int i = 0; @@ -689,15 +665,12 @@ static void module_adapter_process_output(struct comp_dev *dev) list_for_item(blist, &mod->sink_buffer_list) { if (mod->output_buffers[i].size > 0) { struct comp_buffer *buffer; - struct comp_buffer *buffer_c; buffer = container_of(blist, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(buffer); - ca_copy_from_module_to_sink(&buffer_c->stream, mod->output_buffers[i].data, + ca_copy_from_module_to_sink(&buffer->stream, mod->output_buffers[i].data, mod->output_buffers[i].size); - audio_stream_produce(&buffer_c->stream, mod->output_buffers[i].size); - buffer_release(buffer_c); + audio_stream_produce(&buffer->stream, mod->output_buffers[i].size); } i++; } @@ -711,17 +684,12 @@ static void module_adapter_process_output(struct comp_dev *dev) list_for_item(_blist, &mod->sink_buffer_list) { if (i == j) { struct comp_buffer *source; - struct comp_buffer *source_c; sink = container_of(blist, struct comp_buffer, source_list); source = container_of(_blist, struct comp_buffer, sink_list); - sink_c = buffer_acquire(sink); - source_c = buffer_acquire(source); - module_copy_samples(dev, source_c, sink_c, + module_copy_samples(dev, source, sink, mod->output_buffers[i].size); - buffer_release(source_c); - buffer_release(sink_c); mod->output_buffers[i].size = 0; break; @@ -736,8 +704,8 @@ static void module_adapter_process_output(struct comp_dev *dev) static uint32_t module_single_sink_setup(struct comp_dev *dev, - struct comp_buffer **source_c, - struct comp_buffer **sinks_c) + struct comp_buffer **source, + struct comp_buffer **sinks) { struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; @@ -746,14 +714,14 @@ module_single_sink_setup(struct comp_dev *dev, int i = 0; list_for_item(blist, &dev->bsource_list) { - frames = audio_stream_avail_frames_aligned(&source_c[i]->stream, - &sinks_c[0]->stream); + frames = audio_stream_avail_frames_aligned(&source[i]->stream, + &sinks[0]->stream); if (!mod->skip_src_buffer_invalidate) { uint32_t source_frame_bytes; - source_frame_bytes = audio_stream_frame_bytes(&source_c[i]->stream); - buffer_stream_invalidate(source_c[i], frames * source_frame_bytes); + source_frame_bytes = audio_stream_frame_bytes(&source[i]->stream); + buffer_stream_invalidate(source[i], frames * source_frame_bytes); } /* @@ -763,22 +731,22 @@ module_single_sink_setup(struct comp_dev *dev, mod->input_buffers[i].size = frames; mod->input_buffers[i].consumed = 0; - mod->input_buffers[i].data = &source_c[i]->stream; + mod->input_buffers[i].data = &source[i]->stream; i++; } num_input_buffers = i; mod->output_buffers[0].size = 0; - mod->output_buffers[0].data = &sinks_c[0]->stream; + mod->output_buffers[0].data = &sinks[0]->stream; return num_input_buffers; } static uint32_t module_single_source_setup(struct comp_dev *dev, - struct comp_buffer **source_c, - struct comp_buffer **sinks_c) + struct comp_buffer **source, + struct comp_buffer **sinks) { struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; @@ -787,20 +755,20 @@ module_single_source_setup(struct comp_dev *dev, uint32_t source_frame_bytes; int i = 0; - source_frame_bytes = audio_stream_frame_bytes(&source_c[0]->stream); + source_frame_bytes = audio_stream_frame_bytes(&source[0]->stream); if (list_is_empty(&dev->bsink_list)) { - min_frames = audio_stream_get_avail_frames(&source_c[0]->stream); + min_frames = audio_stream_get_avail_frames(&source[0]->stream); } else { uint32_t frames; list_for_item(blist, &dev->bsink_list) { - frames = audio_stream_avail_frames_aligned(&source_c[0]->stream, - &sinks_c[i]->stream); + frames = audio_stream_avail_frames_aligned(&source[0]->stream, + &sinks[i]->stream); min_frames = MIN(min_frames, frames); mod->output_buffers[i].size = 0; - mod->output_buffers[i].data = &sinks_c[i]->stream; + mod->output_buffers[i].data = &sinks[i]->stream; i++; } } @@ -808,12 +776,12 @@ module_single_source_setup(struct comp_dev *dev, num_output_buffers = i; if (!mod->skip_src_buffer_invalidate) - buffer_stream_invalidate(source_c[0], min_frames * source_frame_bytes); + buffer_stream_invalidate(source[0], min_frames * source_frame_bytes); /* note that the size is in number of frames not the number of bytes */ mod->input_buffers[0].size = min_frames; mod->input_buffers[0].consumed = 0; - mod->input_buffers[0].data = &source_c[0]->stream; + mod->input_buffers[0].data = &source[0]->stream; return num_output_buffers; } @@ -821,28 +789,30 @@ module_single_source_setup(struct comp_dev *dev, static int module_adapter_audio_stream_copy_1to1(struct comp_dev *dev) { struct processing_module *mod = comp_get_drvdata(dev); - struct comp_buffer *source_c; - struct comp_buffer *sink_c; uint32_t num_output_buffers = 0; uint32_t frames; int ret; - source_c = buffer_acquire(mod->source_comp_buffer); - sink_c = buffer_acquire(mod->sink_comp_buffer); - frames = audio_stream_avail_frames_aligned(&source_c->stream, &sink_c->stream); + frames = audio_stream_avail_frames_aligned(&mod->source_comp_buffer->stream, + &mod->sink_comp_buffer->stream); mod->input_buffers[0].size = frames; mod->input_buffers[0].consumed = 0; - mod->input_buffers[0].data = &source_c->stream; + mod->input_buffers[0].data = &mod->source_comp_buffer->stream; mod->output_buffers[0].size = 0; - mod->output_buffers[0].data = &sink_c->stream; - if (!mod->skip_src_buffer_invalidate) /* TODO: add mod->is_multi_core && optimization */ - buffer_stream_invalidate(source_c, - frames * audio_stream_frame_bytes(&source_c->stream)); + mod->output_buffers[0].data = &mod->sink_comp_buffer->stream; + + if (!mod->skip_src_buffer_invalidate) { /* TODO: add mod->is_multi_core && optimization */ + /* moved bytes to its own variable to fix checkpatch */ + uint32_t bytes = + frames * audio_stream_frame_bytes(&mod->source_comp_buffer->stream); + buffer_stream_invalidate(mod->source_comp_buffer, + bytes); + } /* Note: Source buffer state is not checked to enable mixout to generate zero * PCM codes when source is not active. */ - if (sink_c->sink->state == dev->state) + if (mod->sink_comp_buffer->sink->state == dev->state) num_output_buffers = 1; ret = module_process_legacy(mod, mod->input_buffers, 1, @@ -851,26 +821,24 @@ static int module_adapter_audio_stream_copy_1to1(struct comp_dev *dev) /* consume from the input buffer */ mod->total_data_consumed += mod->input_buffers[0].consumed; if (mod->input_buffers[0].consumed) - audio_stream_consume(&source_c->stream, mod->input_buffers[0].consumed); + audio_stream_consume(&mod->source_comp_buffer->stream, + mod->input_buffers[0].consumed); /* produce data into the output buffer */ mod->total_data_produced += mod->output_buffers[0].size; if (!mod->skip_sink_buffer_writeback) /* TODO: add mod->is_multi_core && optimization */ - buffer_stream_writeback(sink_c, mod->output_buffers[0].size); + buffer_stream_writeback(mod->sink_comp_buffer, mod->output_buffers[0].size); if (mod->output_buffers[0].size) - comp_update_buffer_produce(sink_c, mod->output_buffers[0].size); + comp_update_buffer_produce(mod->sink_comp_buffer, mod->output_buffers[0].size); - /* release all buffers */ - buffer_release(sink_c); - buffer_release(source_c); return ret; } static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) { - struct comp_buffer *source_c[PLATFORM_MAX_STREAMS]; - struct comp_buffer *sinks_c[PLATFORM_MAX_STREAMS]; + struct comp_buffer *sources[PLATFORM_MAX_STREAMS]; + struct comp_buffer *sinks[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; uint32_t num_input_buffers, num_output_buffers; @@ -892,7 +860,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) struct comp_buffer *sink; sink = container_of(blist, struct comp_buffer, source_list); - sinks_c[i++] = buffer_acquire(sink); + sinks[i++] = sink; } num_output_buffers = i; if (num_output_buffers > mod->max_sinks) { @@ -905,7 +873,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) struct comp_buffer *source; source = container_of(blist, struct comp_buffer, sink_list); - source_c[i++] = buffer_acquire(source); + sources[i++] = source; } num_input_buffers = i; if (num_input_buffers > mod->max_sources) { @@ -915,16 +883,13 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* setup active input/output buffers for processing */ if (num_output_buffers == 1) { - module_single_sink_setup(dev, source_c, sinks_c); - if (sinks_c[0]->sink->state != dev->state) { + module_single_sink_setup(dev, sources, sinks); + if (sinks[0]->sink->state != dev->state) num_output_buffers = 0; - buffer_release(sinks_c[0]); - } } else if (num_input_buffers == 1) { - module_single_source_setup(dev, source_c, sinks_c); - if (source_c[0]->source->state != dev->state) { + module_single_source_setup(dev, sources, sinks); + if (sources[0]->source->state != dev->state) { num_input_buffers = 0; - buffer_release(source_c[0]); } } else { ret = -EINVAL; @@ -946,11 +911,11 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* consume from all active input buffers */ for (i = 0; i < num_input_buffers; i++) { - struct comp_buffer *src_c; + struct comp_buffer *src = + container_of(mod->input_buffers[i].data, struct comp_buffer, stream); - src_c = container_of(mod->input_buffers[i].data, struct comp_buffer, stream); if (mod->input_buffers[i].consumed) - audio_stream_consume(&src_c->stream, mod->input_buffers[i].consumed); + audio_stream_consume(&src->stream, mod->input_buffers[i].consumed); } /* compute data consumed based on pin 0 since it is processed with base config @@ -960,39 +925,35 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* release all source buffers */ for (i = 0; i < num_input_buffers; i++) { - buffer_release(source_c[i]); mod->input_buffers[i].size = 0; mod->input_buffers[i].consumed = 0; } /* produce data into all active output buffers */ for (i = 0; i < num_output_buffers; i++) { - struct comp_buffer *sink_c = + struct comp_buffer *sink = container_of(mod->output_buffers[i].data, struct comp_buffer, stream); if (!mod->skip_sink_buffer_writeback) - buffer_stream_writeback(sink_c, mod->output_buffers[i].size); + buffer_stream_writeback(sink, mod->output_buffers[i].size); if (mod->output_buffers[i].size) - comp_update_buffer_produce(sink_c, mod->output_buffers[i].size); + comp_update_buffer_produce(sink, mod->output_buffers[i].size); } mod->total_data_produced += mod->output_buffers[0].size; /* release all sink buffers */ for (i = 0; i < num_output_buffers; i++) { - buffer_release(sinks_c[i]); mod->output_buffers[i].size = 0; } return 0; out: for (i = 0; i < num_output_buffers; i++) { - buffer_release(sinks_c[i]); mod->output_buffers[i].size = 0; } for (i = 0; i < num_input_buffers; i++) { - buffer_release(source_c[i]); mod->input_buffers[i].size = 0; mod->input_buffers[i].consumed = 0; } @@ -1002,8 +963,6 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) static int module_adapter_sink_source_copy(struct comp_dev *dev) { - struct comp_buffer *source_buffers_c[PLATFORM_MAX_STREAMS]; - struct comp_buffer *sinks_buffers_c[PLATFORM_MAX_STREAMS]; struct sof_sink *audio_sink[PLATFORM_MAX_STREAMS]; struct sof_source *audio_src[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); @@ -1020,9 +979,8 @@ static int module_adapter_sink_source_copy(struct comp_dev *dev) struct comp_buffer *sink_buffer; sink_buffer = container_of(blist, struct comp_buffer, source_list); - sinks_buffers_c[num_of_sinks] = buffer_acquire(sink_buffer); audio_sink[num_of_sinks] = - audio_stream_get_sink(&sinks_buffers_c[num_of_sinks]->stream); + audio_stream_get_sink(&sink_buffer->stream); sink_reset_num_of_processed_bytes(audio_sink[num_of_sinks]); num_of_sinks++; } @@ -1031,9 +989,8 @@ static int module_adapter_sink_source_copy(struct comp_dev *dev) struct comp_buffer *source_buffer; source_buffer = container_of(blist, struct comp_buffer, sink_list); - source_buffers_c[num_of_sources] = buffer_acquire(source_buffer); audio_src[num_of_sources] = - audio_stream_get_source(&source_buffers_c[num_of_sources]->stream); + audio_stream_get_source(&source_buffer->stream); source_reset_num_of_processed_bytes(audio_src[num_of_sources]); num_of_sources++; } @@ -1048,13 +1005,11 @@ static int module_adapter_sink_source_copy(struct comp_dev *dev) /* release all source buffers in reverse order */ for (i = num_of_sources - 1; i >= 0; i--) { mod->total_data_consumed += source_get_num_of_processed_bytes(audio_src[i]); - buffer_release(source_buffers_c[i]); } /* release all sink buffers in reverse order */ for (i = num_of_sinks - 1; i >= 0 ; i--) { mod->total_data_produced += sink_get_num_of_processed_bytes(audio_sink[i]); - buffer_release(sinks_buffers_c[i]); } comp_dbg(dev, "module_adapter_sink_source_copy(): done"); @@ -1067,7 +1022,6 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) struct processing_module *mod = comp_get_drvdata(dev); struct module_data *md = &mod->priv; struct comp_buffer *source, *sink; - struct comp_buffer *sink_c = NULL; struct list_item *blist; size_t size = MAX(mod->deep_buff_bytes, mod->period_bytes); uint32_t min_free_frames = UINT_MAX; @@ -1078,40 +1032,33 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) list_for_item(blist, &mod->sink_buffer_list) { sink = container_of(blist, struct comp_buffer, sink_list); - sink_c = buffer_acquire(sink); min_free_frames = MIN(min_free_frames, - audio_stream_get_free_frames(&sink_c->stream)); - buffer_release(sink_c); + audio_stream_get_free_frames(&sink->stream)); } /* copy source samples into input buffer */ list_for_item(blist, &dev->bsource_list) { - struct comp_buffer *src_c; uint32_t bytes_to_process; int frames, source_frame_bytes; source = container_of(blist, struct comp_buffer, sink_list); - src_c = buffer_acquire(source); /* check if the source dev is in the same state as the dev */ - if (!src_c->source || src_c->source->state != dev->state) { - buffer_release(src_c); + if (!source->source || source->source->state != dev->state) continue; - } frames = MIN(min_free_frames, - audio_stream_get_avail_frames(&src_c->stream)); - source_frame_bytes = audio_stream_frame_bytes(&src_c->stream); + audio_stream_get_avail_frames(&source->stream)); + source_frame_bytes = audio_stream_frame_bytes(&source->stream); bytes_to_process = MIN(frames * source_frame_bytes, md->mpd.in_buff_size); - buffer_stream_invalidate(src_c, bytes_to_process); + buffer_stream_invalidate(source, bytes_to_process); mod->input_buffers[i].size = bytes_to_process; mod->input_buffers[i].consumed = 0; - ca_copy_from_source_to_module(&src_c->stream, mod->input_buffers[i].data, + ca_copy_from_source_to_module(&source->stream, mod->input_buffers[i].data, md->mpd.in_buff_size, bytes_to_process); - buffer_release(src_c); i++; } @@ -1131,13 +1078,10 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) i = 0; /* consume from all input buffers */ list_for_item(blist, &dev->bsource_list) { - struct comp_buffer *src_c; source = container_of(blist, struct comp_buffer, sink_list); - src_c = buffer_acquire(source); - comp_update_buffer_consume(src_c, mod->input_buffers[i].consumed); - buffer_release(src_c); + comp_update_buffer_consume(source, mod->input_buffers[i].consumed); bzero((__sparse_force void *)mod->input_buffers[i].data, size); mod->input_buffers[i].size = 0; @@ -1326,11 +1270,9 @@ static int module_source_status_count(struct comp_dev *dev, uint32_t status) */ struct comp_buffer *source = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer *source_c = buffer_acquire(source); - if (source_c->source && source_c->source->state == status) + if (source->source && source->source->state == status) count++; - buffer_release(source_c); } return count; @@ -1416,10 +1358,7 @@ int module_adapter_reset(struct comp_dev *dev) list_for_item(blist, &mod->sink_buffer_list) { struct comp_buffer *buffer = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer *buffer_c = buffer_acquire(buffer); - - buffer_zero(buffer_c); - buffer_release(buffer_c); + buffer_zero(buffer); } rfree(mod->stream_params); From b608ec840c80b3e27bc8cc4d4d3a401f3929b396 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 7 Sep 2023 12:22:15 +0200 Subject: [PATCH 392/639] pipeline: remove buffer_acquire from pipeline files remove buffer ops from pipeline-graph.c and pipeline-params.c this is a continuation of changes from commit 4a036999118cfa7e491cbefc8eb6b737f50b7e33 Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/pipeline/pipeline-graph.c | 21 +++++---------------- src/audio/pipeline/pipeline-params.c | 12 +++--------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 46b9f9b510f8..5f2131763dd0 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -168,14 +168,10 @@ struct pipeline *pipeline_new(uint32_t pipeline_id, uint32_t priority, uint32_t static void buffer_set_comp(struct comp_buffer *buffer, struct comp_dev *comp, int dir) { - struct comp_buffer *buffer_c = buffer_acquire(buffer); - if (dir == PPL_CONN_DIR_COMP_TO_BUFFER) - buffer_c->source = comp; + buffer->source = comp; else - buffer_c->sink = comp; - - buffer_release(buffer_c); + buffer->sink = comp; } int pipeline_connect(struct comp_dev *comp, struct comp_buffer *buffer, @@ -410,7 +406,6 @@ int pipeline_for_each_comp(struct comp_dev *current, /* run this operation further */ list_for_item(clist, buffer_list) { struct comp_buffer *buffer = buffer_from_list(clist, dir); - struct comp_buffer *buffer_c; struct comp_dev *buffer_comp; int err = 0; @@ -434,28 +429,22 @@ int pipeline_for_each_comp(struct comp_dev *current, buffer_comp = buffer_get_comp(buffer, dir); - buffer_c = buffer_acquire(buffer); - /* execute operation on buffer */ if (ctx->buff_func) - ctx->buff_func(buffer_c, ctx->buff_data); + ctx->buff_func(buffer, ctx->buff_data); /* don't go further if this component is not connected */ if (buffer_comp && (!ctx->skip_incomplete || buffer_comp->pipeline) && ctx->comp_func) { - buffer_c->walking = true; - buffer_release(buffer_c); + buffer->walking = true; err = ctx->comp_func(buffer_comp, buffer, ctx, dir); - buffer_c = buffer_acquire(buffer); - buffer_c->walking = false; + buffer->walking = false; } - buffer_release(buffer_c); - if (err < 0 || err == PPL_STATUS_PATH_STOP) return err; } diff --git a/src/audio/pipeline/pipeline-params.c b/src/audio/pipeline/pipeline-params.c index a0a53749320c..d7a80915c837 100644 --- a/src/audio/pipeline/pipeline-params.c +++ b/src/audio/pipeline/pipeline-params.c @@ -30,7 +30,6 @@ static int pipeline_comp_params_neg(struct comp_dev *current, int dir) { struct pipeline_data *ppl_data = ctx->comp_data; - struct comp_buffer *buf_c = buffer_acquire(calling_buf); int err = 0; pipe_dbg(current->pipeline, "pipeline_comp_params_neg(), current->comp.id = %u, dir = %u", @@ -48,12 +47,12 @@ static int pipeline_comp_params_neg(struct comp_dev *current, * a component who has different channels input/output buffers * should explicitly configure the channels of the branched buffers. */ - err = buffer_set_params(buf_c, &ppl_data->params->params, + err = buffer_set_params(calling_buf, &ppl_data->params->params, BUFFER_UPDATE_FORCE); break; default: /* return 0 if params matches */ - if (!buffer_params_match(buf_c, + if (!buffer_params_match(calling_buf, &ppl_data->params->params, BUFF_PARAMS_FRAME_FMT | BUFF_PARAMS_RATE)) { @@ -66,8 +65,6 @@ static int pipeline_comp_params_neg(struct comp_dev *current, err = -EINVAL; } } - - buffer_release(buf_c); return err; } @@ -188,11 +185,8 @@ static int pipeline_comp_hw_params_buf(struct comp_dev *current, return ret; /* set buffer parameters */ if (calling_buf) { - struct comp_buffer *buf_c = buffer_acquire(calling_buf); - - ret = buffer_set_params(buf_c, &ppl_data->params->params, + ret = buffer_set_params(calling_buf, &ppl_data->params->params, BUFFER_UPDATE_IF_UNSET); - buffer_release(buf_c); if (ret < 0) pipe_err(current->pipeline, "pipeline_comp_hw_params(): buffer_set_params(): %d", ret); From 1b337ef437ffda89f9e0746407b09bbabbcaabb4 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Tue, 12 Sep 2023 15:24:18 +0300 Subject: [PATCH 393/639] imx: sdma: Fix sdma firmware selection CONFIG_SDMA_SCRIPT_CODE is always defined (even if not selected it defaults to empty string) so this is not a good way of including sdma script code header file. Make use of HAVE_SDMA_FIRMWARE boolean config in order to select the sdma script code header. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/Kconfig | 2 +- src/include/sof/drivers/sdma.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drivers/imx/Kconfig b/src/drivers/imx/Kconfig index a74cc8e552e4..82d667a8275c 100644 --- a/src/drivers/imx/Kconfig +++ b/src/drivers/imx/Kconfig @@ -36,7 +36,7 @@ config IMX_INTERRUPT_GENERIC It enables NXP platforms-specific features. config HAVE_SDMA_FIRMWARE - bool + bool "Enable SDMA firmware load" default n help Select this to load SDMA firmware to enable additional functionality diff --git a/src/include/sof/drivers/sdma.h b/src/include/sof/drivers/sdma.h index d3c9668157a8..c5b8d0e1ff25 100644 --- a/src/include/sof/drivers/sdma.h +++ b/src/include/sof/drivers/sdma.h @@ -151,7 +151,7 @@ #define SDMA_SCRIPT_SHP2MCU_OFF 893 #define SDMA_SCRIPT_MCU2SHP_OFF 962 -#ifdef CONFIG_SDMA_SCRIPT_CODE +#if CONFIG_HAVE_SDMA_FIRMWARE #include "sdma_script_code_imx7d_4_5.h" #endif From 7ca9a2eb8aedce1720408772a9d4ef5db3bc36d4 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Mon, 11 Sep 2023 13:39:48 +0300 Subject: [PATCH 394/639] driver: imx: Add PDM MICFIL driver The Pulse Density Modulated Microphone Interface (MICFIL) is a popular way to deliver audio from microphones to the processor in several applications, such as mobile telephones. However, current digital-audio systems use multibit audio signal (also known as multibit PCM) to represent the signal. This block implements the required digital interface to provide a 24-bits audio signal from a PDM microphone bitstream in a configurable output sampling rate. This patch adds initial support for PDM MICFIL IP found on i.MX8MP board. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/CMakeLists.txt | 4 + src/drivers/imx/Kconfig | 9 + src/drivers/imx/micfil.c | 335 ++++++++++++++++++ src/include/ipc/dai-imx.h | 7 + src/include/ipc/dai.h | 4 +- src/include/sof/drivers/micfil.h | 174 +++++++++ src/ipc/ipc3/dai.c | 6 +- src/platform/Kconfig | 1 + .../imx8m/include/platform/lib/memory.h | 3 + src/platform/imx8m/lib/dai.c | 27 ++ src/platform/imx8m/lib/dma.c | 2 +- xtos/include/sof/lib/dma.h | 1 + zephyr/CMakeLists.txt | 1 + 13 files changed, 571 insertions(+), 3 deletions(-) create mode 100644 src/drivers/imx/micfil.c create mode 100644 src/include/sof/drivers/micfil.h diff --git a/src/drivers/imx/CMakeLists.txt b/src/drivers/imx/CMakeLists.txt index 874e8c012190..5fdc480b76c2 100644 --- a/src/drivers/imx/CMakeLists.txt +++ b/src/drivers/imx/CMakeLists.txt @@ -22,6 +22,10 @@ if(CONFIG_IMX_SDMA) endif() endif() +if(CONFIG_IMX_MICFIL) + add_local_sources(sof micfil.c) +endif() + if(CONFIG_IMX_INTERRUPT_IRQSTEER) add_local_sources(sof interrupt-irqsteer.c) elseif(CONFIG_IMX_INTERRUPT_GENERIC) diff --git a/src/drivers/imx/Kconfig b/src/drivers/imx/Kconfig index 82d667a8275c..7874c72c096b 100644 --- a/src/drivers/imx/Kconfig +++ b/src/drivers/imx/Kconfig @@ -21,6 +21,15 @@ config IMX_ESAI help Select this to enable support for i.MX ESAI IP. +config IMX_MICFIL + bool "i.MX MICFIL PDM driver" + default n + depends on IMX + help + Select this to enable support for i.MX MICFIL PDM IP. This block implements + the required digital interface to provide a 24-bits audio signal from a PDM + microphone bitstream in a configurable output sampling rate + config IMX_INTERRUPT_IRQSTEER bool default n diff --git a/src/drivers/imx/micfil.c b/src/drivers/imx/micfil.c new file mode 100644 index 000000000000..20c96b9eb4a8 --- /dev/null +++ b/src/drivers/imx/micfil.c @@ -0,0 +1,335 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright 2023 NXP +// +// Author: Daniel Baluta <daniel.baluta@nxp.com> + +#include <sof/audio/component.h> +#include <sof/audio/format.h> +#include <rtos/alloc.h> +#include <sof/drivers/micfil.h> +#include <sof/lib/dai.h> +#include <sof/lib/dma.h> +#include <sof/lib/memory.h> +#include <sof/lib/pm_runtime.h> +#include <sof/lib/uuid.h> +#include <ipc/dai.h> +#include <errno.h> +#include <stddef.h> +#include <stdint.h> + +LOG_MODULE_REGISTER(micfil_dai, CONFIG_SOF_LOG_LEVEL); + +/* dd400475-35d7-4045-ab03-0c34957d7a08 */ +DECLARE_SOF_UUID("micfil-dai", micfil_uuid, 0xdd400475, 0x35d7, 0x4045, + 0xab, 0x03, 0x0c, 0x34, 0x95, 0x7d, 0x7a, 0x08); + +DECLARE_TR_CTX(micfil_tr, SOF_UUID(micfil_uuid), LOG_LEVEL_INFO); + +#define MICFIL_OSR_DEFAULT 16 +/* set default gain to 2 */ +#define MICFIL_DEFAULT_ADJ_RANGE 0x22222222 +#define MICFIL_CLK_ROOT 24576000 + +enum micfil_quality { + QUALITY_HIGH, + QUALITY_MEDIUM, + QUALITY_LOW, + QUALITY_VLOW0, + QUALITY_VLOW1, + QUALITY_VLOW2, +}; + +static void micfil_reset(struct dai *dai) +{ + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_MDIS, 0); + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_SRES, MICFIL_CTRL1_SRES); + dai_update_bits(dai, REG_MICFIL_STAT, 0xff, 0xff); +} + +static int micfil_get_hw_params(struct dai *dai, + struct sof_ipc_stream_params *params, int dir) +{ + struct micfil_pdata *micfil = dai_get_drvdata(dai); + + dai_err(dai, "micfil_get_hw_params()"); + + params->rate = micfil->params.pdm_rate; + params->channels = micfil->params.pdm_ch; + params->buffer_fmt = SOF_IPC_BUFFER_INTERLEAVED; + params->frame_fmt = SOF_IPC_FRAME_S32_LE; + + return 0; +} + +static int micfil_set_quality(struct dai *dai) +{ + struct micfil_pdata *micfil = dai_get_drvdata(dai); + int qsel; + + switch (micfil->quality) { + case QUALITY_HIGH: + qsel = MICFIL_QSEL_HIGH_QUALITY; + break; + case QUALITY_MEDIUM: + qsel = MICFIL_QSEL_MEDIUM_QUALITY; + break; + case QUALITY_LOW: + qsel = MICFIL_QSEL_LOW_QUALITY; + break; + case QUALITY_VLOW0: + qsel = MICFIL_QSEL_VLOW0_QUALITY; + break; + case QUALITY_VLOW1: + qsel = MICFIL_QSEL_VLOW1_QUALITY; + break; + case QUALITY_VLOW2: + qsel = MICFIL_QSEL_VLOW2_QUALITY; + break; + default: + dai_err(dai, "MICFIL: invalid quality mode %d", micfil->quality); + return -EINVAL; + } + + dai_update_bits(dai, REG_MICFIL_CTRL2, MICFIL_CTRL2_QSEL, + MICFIL_CTRL2_QSEL_BITS(qsel)); + + return 0; +} + +/* get_pdm_clk - computes the product between k-factor and PDM_CLK rate + * @param dai, SOF DAI struct + * @param rate, output sampling rate + * + * PDM_CLK depends on Quality Mode, output sampling rate and quality + * mode + */ +static unsigned int micfil_get_pdm_clk(struct dai *dai, int rate) +{ + unsigned int osr; + unsigned int qsel; + unsigned int ctrl2_reg; + unsigned int pdm_clk = 0; + + ctrl2_reg = dai_read(dai, REG_MICFIL_CTRL2); + osr = 16 - ((ctrl2_reg & MICFIL_CTRL2_CICOSR) >> MICFIL_CTRL2_CICOSR_SHIFT); + qsel = (ctrl2_reg & MICFIL_CTRL2_QSEL) >> MICFIL_CTRL2_QSEL_SHIFT; + + /* See Quality modes chapter in MICFIL documentation */ + switch (qsel) { + case MICFIL_QSEL_HIGH_QUALITY: + pdm_clk = rate * 8 * osr / 2; /* kfactor = 0.5 */ + break; + case MICFIL_QSEL_MEDIUM_QUALITY: + case MICFIL_QSEL_VLOW0_QUALITY: + pdm_clk = rate * 4 * osr; /* kfactor = 1 */ + break; + case MICFIL_QSEL_LOW_QUALITY: + case MICFIL_QSEL_VLOW1_QUALITY: + pdm_clk = rate * 2 * osr * 2; /* kfactor = 2 */ + break; + case MICFIL_QSEL_VLOW2_QUALITY: + pdm_clk = rate * osr; /* kfactor = 4 */ + break; + default: + break; + } + + return pdm_clk; +} + +static int micfil_get_clk_div(struct dai *dai, int rate) +{ + unsigned int pdm_clk; + + pdm_clk = micfil_get_pdm_clk(dai, rate); + if (!pdm_clk) + return -EINVAL; + + /* + * + * See: Clock divider chapter from micfil documentation + * PDM_CLK rate = MICFIL_CLK_ROOT rate / (2 * K * CLKDIV) + * + * this means that if we want to compute CLKDIV then: + * CLKDIV = MICFIL_CLK_ROOT rate / (PDM_CLK rate * K * 2) + * + * micfil_get_pdm_clk function returns K * PDM_CLK rate + */ + return MICFIL_CLK_ROOT / (pdm_clk * 2); +} + +static int micfil_set_clock_params(struct dai *dai, int rate) +{ + int clk_div; + + dai_update_bits(dai, REG_MICFIL_CTRL2, MICFIL_CTRL2_CICOSR, + MICFIL_CTRL2_CICOSR_BITS(MICFIL_OSR_DEFAULT)); + + clk_div = micfil_get_clk_div(dai, rate); + if (clk_div < 0) + return clk_div; + + dai_update_bits(dai, REG_MICFIL_CTRL2, MICFIL_CTRL2_CLKDIV, + MICFIL_CTRL2_CLKDIV_BITS(clk_div)); + + return 0; +} + +static int micfil_set_config(struct dai *dai, struct ipc_config_dai *common_config, + const void *spec_config) +{ + int i, ret; + unsigned int val = 0; + struct micfil_pdata *micfil = dai_get_drvdata(dai); + const struct sof_ipc_dai_config *config = spec_config; + + micfil->params = config->micfil; + + dai_info(dai, "micfil_set_config() dai_idx %d channels %d sampling_freq %d", + common_config->dai_index, micfil->params.pdm_ch, micfil->params.pdm_rate); + + /* disable the module */ + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_PDMIEN, 0); + + micfil_set_quality(dai); + + /* set default gain to 2 */ + dai_write(dai, REG_MICFIL_OUT_CTRL, MICFIL_DEFAULT_ADJ_RANGE); + + /* set DC Remover in bypass mode */ + for (i = 0; i < MICFIL_OUTPUT_CHANNELS; i++) + val |= MICFIL_DC_BYPASS << MICFIL_DC_CHX_SHIFT(i); + dai_update_bits(dai, REG_MICFIL_DC_CTRL, MICFIL_DC_CTRL_CONFIG, val); + + /* FIFO WMK */ + dai_update_bits(dai, REG_MICFIL_FIFO_CTRL, MICFIL_FIFO_CTRL_FIFOWMK, + MICFIL_FIFO_CTRL_FIFOWMK_BITS(31)); + + /* enable channels */ + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_CHNEN, + ((1 << micfil->params.pdm_ch) - 1)); + + ret = micfil_set_clock_params(dai, micfil->params.pdm_rate); + if (ret < 0) + return ret; + + return 0; +} + +static int micfil_get_handshake(struct dai *dai, int direction, int stream_id) +{ + return dai->plat_data.fifo[SOF_IPC_STREAM_CAPTURE].handshake; +} + +static int micfil_get_fifo(struct dai *dai, int direction, int stream_id) +{ + return dai->plat_data.fifo[SOF_IPC_STREAM_CAPTURE].offset; +} + +static int micfil_get_fifo_depth(struct dai *dai, int direction) +{ + return dai->plat_data.fifo[SOF_IPC_STREAM_CAPTURE].depth; +} + +static void micfil_start(struct dai *dai) +{ + dai_info(dai, "micfil_start()"); + + micfil_reset(dai); + + /* DMA Interrupt Selection - DISEL bits + * 00 - DMA and IRQ disabled + * 01 - DMA req enabled + * 10 - IRQ enabled + * 11 - reserved + */ + dai_update_bits(dai, REG_MICFIL_CTRL1, + MICFIL_CTRL1_DISEL, + MICFIL_CTRL1_DISEL_BITS(MICFIL_CTRL1_DISEL_DMA)); + + /* Enable the module */ + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_PDMIEN, MICFIL_CTRL1_PDMIEN); +} + +static void micfil_stop(struct dai *dai) +{ + dai_info(dai, "micfil_stop()"); + + /* Disable the module */ + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_PDMIEN, 0); + + dai_update_bits(dai, REG_MICFIL_CTRL1, MICFIL_CTRL1_DISEL, + MICFIL_CTRL1_DISEL_BITS(MICFIL_CTRL1_DISEL_DISABLE)); +} + +static int micfil_trigger(struct dai *dai, int cmd, int direction) +{ + dai_info(dai, "micfil_trigger() cmd %d dir %d", cmd, direction); + + switch (cmd) { + case COMP_TRIGGER_START: + case COMP_TRIGGER_RELEASE: + micfil_start(dai); + break; + case COMP_TRIGGER_STOP: + case COMP_TRIGGER_PAUSE: + micfil_stop(dai); + case COMP_TRIGGER_PRE_START: + case COMP_TRIGGER_PRE_RELEASE: + break; + default: + dai_err(dai, "MICFIL: invalid trigger cmd %d", cmd); + return -EINVAL; + } + + return 0; +} + +static int micfil_probe(struct dai *dai) +{ + struct micfil_pdata *micfil; + + dai_info(dai, "micfil_probe()"); + + micfil = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*micfil)); + if (!micfil) { + dai_err(dai, "micfil probe failed"); + return -ENOMEM; + } + + micfil->quality = QUALITY_VLOW0; + + dai_set_drvdata(dai, micfil); + + return 0; +} + +static int micfil_remove(struct dai *dai) +{ + struct micfil_pdata *micfil = dai_get_drvdata(dai); + + dai_info(dai, "micfil_remove()"); + + rfree(micfil); + dai_set_drvdata(dai, NULL); + + return 0; +} + +const struct dai_driver micfil_driver = { + .type = SOF_DAI_IMX_MICFIL, + .uid = SOF_UUID(micfil_uuid), + .tctx = &micfil_tr, + .dma_dev = DMA_DEV_MICFIL, + .ops = { + .trigger = micfil_trigger, + .set_config = micfil_set_config, + .get_hw_params = micfil_get_hw_params, + .get_handshake = micfil_get_handshake, + .get_fifo = micfil_get_fifo, + .get_fifo_depth = micfil_get_fifo_depth, + .probe = micfil_probe, + .remove = micfil_remove, + }, +}; diff --git a/src/include/ipc/dai-imx.h b/src/include/ipc/dai-imx.h index bc478f0c97ad..5f9fc4dce837 100644 --- a/src/include/ipc/dai-imx.h +++ b/src/include/ipc/dai-imx.h @@ -54,4 +54,11 @@ struct sof_ipc_dai_sai_params { uint16_t reserved2; /* alignment */ } __attribute__((packed, aligned(4))); + +/* MICFIL Configuration Request - SOF_IPC_DAI_MICFIL_CONFIG */ +struct sof_ipc_dai_micfil_params { + uint32_t pdm_rate; + uint32_t pdm_ch; +} __attribute__((packed, aligned(4))); + #endif /* __IPC_DAI_IMX_H__ */ diff --git a/src/include/ipc/dai.h b/src/include/ipc/dai.h index b0ea6d7f6af5..37bd91fa6c29 100644 --- a/src/include/ipc/dai.h +++ b/src/include/ipc/dai.h @@ -92,7 +92,8 @@ enum sof_ipc_dai_type { SOF_DAI_MEDIATEK_AFE, /**< Mtk AFE */ SOF_DAI_AMD_HS, /**< Amd HS */ SOF_DAI_AMD_SP_VIRTUAL, /**<Amd SP VIRTUAL */ - SOF_DAI_AMD_HS_VIRTUAL /**<Amd HS VIRTUAL */ + SOF_DAI_AMD_HS_VIRTUAL, /**<Amd HS VIRTUAL */ + SOF_DAI_IMX_MICFIL, /**< i.MX MICFIL */ }; /* general purpose DAI configuration */ @@ -122,6 +123,7 @@ struct sof_ipc_dai_config { struct sof_ipc_dai_acpdmic_params acpdmic; struct sof_ipc_dai_acp_params acphs; struct sof_ipc_dai_afe_params afe; + struct sof_ipc_dai_micfil_params micfil; }; } __attribute__((packed, aligned(4))); diff --git a/src/include/sof/drivers/micfil.h b/src/include/sof/drivers/micfil.h new file mode 100644 index 000000000000..5d6828102c97 --- /dev/null +++ b/src/include/sof/drivers/micfil.h @@ -0,0 +1,174 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright 2023 NXP + * + * Author: Daniel Baluta <daniel.baluta@nxp.com> + */ + +#ifndef __SOF_DRIVERS_MICFIL_H__ +#define __SOF_DRIVERS_MICFIL_H__ + +#include <rtos/bit.h> +#include <ipc/dai.h> +#include <ipc/dai-imx.h> +#include <sof/lib/dai.h> +#include <sof/trace/trace.h> +#include <user/trace.h> + +extern const struct dai_driver micfil_driver; + +/* MICFIL private data */ +struct micfil_pdata { + int quality; + struct sof_ipc_dai_config config; + struct sof_ipc_dai_micfil_params params; +}; + +/* MICFIL Register Map */ +#define REG_MICFIL_CTRL1 0x00 +#define REG_MICFIL_CTRL2 0x04 +#define REG_MICFIL_STAT 0x08 +#define REG_MICFIL_FIFO_CTRL 0x10 +#define REG_MICFIL_FIFO_STAT 0x14 +#define REG_MICFIL_DATACH0 0x24 +#define REG_MICFIL_DATACH1 0x28 +#define REG_MICFIL_DATACH2 0x2C +#define REG_MICFIL_DATACH3 0x30 +#define REG_MICFIL_DATACH4 0x34 +#define REG_MICFIL_DATACH5 0x38 +#define REG_MICFIL_DATACH6 0x3C +#define REG_MICFIL_DATACH7 0x40 +#define REG_MICFIL_DC_CTRL 0x64 +#define REG_MICFIL_OUT_CTRL 0x74 +#define REG_MICFIL_OUT_STAT 0x7C +#define REG_MICFIL_VAD0_CTRL1 0x90 +#define REG_MICFIL_VAD0_CTRL2 0x94 + +#define REG_MICFIL_VAD0_STAT 0x98 +#define REG_MICFIL_VAD0_SCONFIG 0x9C +#define REG_MICFIL_VAD0_NCONFIG 0xA0 +#define REG_MICFIL_VAD0_NDATA 0xA4 +#define REG_MICFIL_VAD0_ZCD 0xA8 + +/* MICFIL Control Register 1 -- REG_MICFILL_CTRL1 0x00 */ +#define MICFIL_CTRL1_MDIS BIT(31) +#define MICFIL_CTRL1_DOZEN BIT(30) +#define MICFIL_CTRL1_PDMIEN BIT(29) +#define MICFIL_CTRL1_DBG BIT(28) +#define MICFIL_CTRL1_SRES BIT(27) +#define MICFIL_CTRL1_DBGE BIT(26) +#define MICFIL_CTRL1_CHNEN MASK(7, 0) + +#define MICFIL_CTRL1_DISEL_DISABLE 0 +#define MICFIL_CTRL1_DISEL_DMA 1 +#define MICFIL_CTRL1_DISEL_IRQ 2 +#define MICFIL_CTRL1_DISEL_BITS(x) SET_BITS(25, 24, x) +#define MICFIL_CTRL1_DISEL MASK(25, 24) +#define MICFIL_CTRL1_ERREN BIT(23) +#define MICFIL_CTRL1_CHEN(ch) BIT(ch) + +/* MICFIL Control Register 2 -- REG_MICFILL_CTRL2 0x04 */ +#define MICFIL_CTRL2_QSEL_SHIFT 25 +#define MICFIL_CTRL2_QSEL MASK(27, 25) +#define MICFIL_CTRL2_QSEL_BITS(x) SET_BITS(27, 25, x) +#define MICFIL_QSEL_MEDIUM_QUALITY 0 +#define MICFIL_QSEL_HIGH_QUALITY 1 +#define MICFIL_QSEL_LOW_QUALITY 7 +#define MICFIL_QSEL_VLOW0_QUALITY 6 +#define MICFIL_QSEL_VLOW1_QUALITY 5 +#define MICFIL_QSEL_VLOW2_QUALITY 4 + +#define MICFIL_CTRL2_CICOSR MASK(19, 16) +#define MICFIL_CTRL2_CICOSR_SHIFT 16 +#define MICFIL_CTRL2_CICOSR_BITS(x) SET_BITS(19, 16, x) +#define MICFIL_CTRL2_CLKDIV MASK(7, 0) +#define MICFIL_CTRL2_CLKDIV_BITS(x) SET_BITS(7, 0, x) + +/* MICFIL Status Register -- REG_MICFIL_STAT 0x08 */ +#define MICFIL_STAT_BSY_FIL BIT(31) +#define MICFIL_STAT_FIR_RDY BIT(30) +#define MICFIL_STAT_LOWFREQF BIT(29) +#define MICFIL_STAT_CHXF(ch) BIT(ch) + +/* MICFIL FIFO Control Register -- REG_MICFIL_FIFO_CTRL 0x10 */ +#define MICFIL_FIFO_CTRL_FIFOWMK MASK(2, 0) +#define MICFIL_FIFO_CTRL_FIFOWMK_BITS(x) SET_BITS(2, 0, x) + +/* MICFIL FIFO Status Register -- REG_MICFIL_FIFO_STAT 0x14 */ +#define MICFIL_FIFO_STAT_FIFOX_OVER(ch) BIT(ch) +#define MICFIL_FIFO_STAT_FIFOX_UNDER(ch) BIT((ch) + 8) + +/* MICFIL DC Remover Control Register -- REG_MICFIL_DC_CTRL */ +#define MICFIL_DC_CTRL_CONFIG MASK(15, 0) +#define MICFIL_DC_CHX_SHIFT(ch) ((ch) << 1) +#define MICFIL_DC_CHX(ch) MASK((((ch) << 1) + 1), ((ch) << 1)) +#define MICFIL_DC_CUTOFF_21HZ 0 +#define MICFIL_DC_CUTOFF_83HZ 1 +#define MICFIL_DC_CUTOFF_152Hz 2 +#define MICFIL_DC_BYPASS 3 + +/* MICFIL HWVAD0 Control 1 Register -- REG_MICFIL_VAD0_CTRL1*/ +#define MICFIL_VAD0_CTRL1_CHSEL MASK(26, 24) +#define MICFIL_VAD0_CTRL1_CICOSR MASK(19, 16) +#define MICFIL_VAD0_CTRL1_INITT MASK(12, 8) +#define MICFIL_VAD0_CTRL1_ST10 BIT(4) +#define MICFIL_VAD0_CTRL1_ERIE BIT(3) +#define MICFIL_VAD0_CTRL1_IE BIT(2) +#define MICFIL_VAD0_CTRL1_RST BIT(1) +#define MICFIL_VAD0_CTRL1_EN BIT(0) + +/* MICFIL HWVAD0 Control 2 Register -- REG_MICFIL_VAD0_CTRL2*/ +#define MICFIL_VAD0_CTRL2_FRENDIS BIT(31) +#define MICFIL_VAD0_CTRL2_PREFEN BIT(30) +#define MICFIL_VAD0_CTRL2_FOUTDIS BIT(28) +#define MICFIL_VAD0_CTRL2_FRAMET MASK(21, 16) +#define MICFIL_VAD0_CTRL2_INPGAIN MASK(11, 8) +#define MICFIL_VAD0_CTRL2_HPF MASK(1, 0) + +/* MICFIL HWVAD0 Signal CONFIG Register -- REG_MICFIL_VAD0_SCONFIG */ +#define MICFIL_VAD0_SCONFIG_SFILEN BIT(31) +#define MICFIL_VAD0_SCONFIG_SMAXEN BIT(30) +#define MICFIL_VAD0_SCONFIG_SGAIN MASK(3, 0) + +/* MICFIL HWVAD0 Noise CONFIG Register -- REG_MICFIL_VAD0_NCONFIG */ +#define MICFIL_VAD0_NCONFIG_NFILAUT BIT(31) +#define MICFIL_VAD0_NCONFIG_NMINEN BIT(30) +#define MICFIL_VAD0_NCONFIG_NDECEN BIT(29) +#define MICFIL_VAD0_NCONFIG_NOREN BIT(28) +#define MICFIL_VAD0_NCONFIG_NFILADJ MASK(12, 8) +#define MICFIL_VAD0_NCONFIG_NGAIN MASK(3, 0) + +/* MICFIL HWVAD0 Zero-Crossing Detector - REG_MICFIL_VAD0_ZCD */ +#define MICFIL_VAD0_ZCD_ZCDTH MASK(25, 16) +#define MICFIL_VAD0_ZCD_ZCDADJ MASK(11, 8) +#define MICFIL_VAD0_ZCD_ZCDAND BIT(4) +#define MICFIL_VAD0_ZCD_ZCDAUT BIT(2) +#define MICFIL_VAD0_ZCD_ZCDEN BIT(0) + +/* MICFIL HWVAD0 Status Register - REG_MICFIL_VAD0_STAT */ +#define MICFIL_VAD0_STAT_INITF BIT(31) +#define MICFIL_VAD0_STAT_INSATF BIT(16) +#define MICFIL_VAD0_STAT_EF BIT(15) +#define MICFIL_VAD0_STAT_IF BIT(0) + +/* MICFIL Output Control Register */ +#define MICFIL_OUTGAIN_CHX_SHIFT(v) (4 * (v)) + +/* Constants */ +#define MICFIL_OUTPUT_CHANNELS 8 +#define MICFIL_FIFO_NUM 8 + +#define FIFO_PTRWID 3 +#define FIFO_LEN BIT(FIFO_PTRWID) + +#define MICFIL_IRQ_LINES 4 +#define MICFIL_MAX_RETRY 25 +#define MICFIL_SLEEP_MIN 90000 /* in us */ +#define MICFIL_SLEEP_MAX 100000 /* in us */ +#define MICFIL_DMA_MAXBURST_RX 6 + +/* HWVAD Constants */ +#define MICFIL_HWVAD_ENVELOPE_MODE 0 +#define MICFIL_HWVAD_ENERGY_MODE 1 + +#endif /* __SOF_DRIVERS_MICFIL_H__ */ diff --git a/src/ipc/ipc3/dai.c b/src/ipc/ipc3/dai.c index ccc41524e002..0f323b446192 100644 --- a/src/ipc/ipc3/dai.c +++ b/src/ipc/ipc3/dai.c @@ -65,6 +65,10 @@ int dai_config_dma_channel(struct dai_data *dd, struct comp_dev *dev, const void dd->stream_id); channel = EDMA_HS_GET_CHAN(handshake); break; + case SOF_DAI_IMX_MICFIL: + channel = dai_get_handshake(dd->dai, dai->direction, + dd->stream_id); + break; case SOF_DAI_AMD_BT: channel = dai_get_handshake(dd->dai, dai->direction, dd->stream_id); @@ -156,8 +160,8 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev) */ dd->stream_id = config->alh.stream_id; break; + case SOF_DAI_IMX_MICFIL: case SOF_DAI_IMX_SAI: - COMPILER_FALLTHROUGH; case SOF_DAI_IMX_ESAI: dd->config.burst_elems = dai_get_fifo_depth(dd->dai, dai->direction); break; diff --git a/src/platform/Kconfig b/src/platform/Kconfig index f36c5ac2b7e4..d4787c140293 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -100,6 +100,7 @@ config IMX8M select XT_WAITI_DELAY select IMX select IMX_SDMA + select IMX_MICFIL select SCHEDULE_DMA_MULTI_CHANNEL select IMX_INTERRUPT_IRQSTEER help diff --git a/src/platform/imx8m/include/platform/lib/memory.h b/src/platform/imx8m/include/platform/lib/memory.h index 7d285dbfc463..6b2c00f89bad 100644 --- a/src/platform/imx8m/include/platform/lib/memory.h +++ b/src/platform/imx8m/include/platform/lib/memory.h @@ -59,6 +59,9 @@ #define SAI_7_BASE 0x30c80000 #define SAI_7_SIZE 0x00010000 +#define MICFIL_BASE 0x30ca0000 +#define MICFIL_SIZE 0x00010000 + #define UUID_ENTRY_ELF_BASE 0x1FFFA000 #define UUID_ENTRY_ELF_SIZE 0x6000 diff --git a/src/platform/imx8m/lib/dai.c b/src/platform/imx8m/lib/dai.c index 1096740e4f58..3c684d0c2c6e 100644 --- a/src/platform/imx8m/lib/dai.c +++ b/src/platform/imx8m/lib/dai.c @@ -6,6 +6,8 @@ #include <sof/common.h> #include <sof/drivers/sai.h> +#include <sof/drivers/micfil.h> + #include <sof/lib/dai.h> #include <sof/lib/memory.h> #include <rtos/sof.h> @@ -142,12 +144,37 @@ static SHARED_DATA struct dai sai[] = { }; +static SHARED_DATA struct dai micfil[] = { +{ + .index = 2, + .plat_data = { + .base = MICFIL_BASE, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = 0, /* No playback */ + .handshake = 0, + }, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = MICFIL_BASE + REG_MICFIL_DATACH0, + .handshake = 24, + }, + }, + + .drv = &micfil_driver, +}, +}; + const struct dai_type_info dti[] = { { .type = SOF_DAI_IMX_SAI, .dai_array = cache_to_uncache_init((struct dai *)sai), .num_dais = ARRAY_SIZE(sai) }, + { + .type = SOF_DAI_IMX_MICFIL, + .dai_array = cache_to_uncache_init((struct dai *)micfil), + .num_dais = ARRAY_SIZE(micfil) + }, + }; const struct dai_info lib_dai = { diff --git a/src/platform/imx8m/lib/dma.c b/src/platform/imx8m/lib/dma.c index 12403f92809e..ca02d52904ad 100644 --- a/src/platform/imx8m/lib/dma.c +++ b/src/platform/imx8m/lib/dma.c @@ -31,7 +31,7 @@ static SHARED_DATA struct dma dma[PLATFORM_NUM_DMACS] = { * enabled as it is unneeded */ .dir = DMA_DIR_MEM_TO_DEV | DMA_DIR_DEV_TO_MEM, - .devs = DMA_DEV_SAI, + .devs = DMA_DEV_SAI | DMA_DEV_MICFIL, .base = SDMA3_BASE, .channels = 32, .irq = SDMA3_IRQ, diff --git a/xtos/include/sof/lib/dma.h b/xtos/include/sof/lib/dma.h index 82f4992cbe88..2f0bfe940dea 100644 --- a/xtos/include/sof/lib/dma.h +++ b/xtos/include/sof/lib/dma.h @@ -75,6 +75,7 @@ struct comp_buffer; #define DMA_DEV_SP_VIRTUAL BIT(11) /**< connectable to ACP SP VIRTUAL I2S */ #define DMA_DEV_HS_VIRTUAL BIT(12) /**< connectable to ACP HS VIRTUAL I2S */ #define DMA_DEV_HS BIT(13) /**< connectable to ACP HS I2S */ +#define DMA_DEV_MICFIL BIT(14) /**< connectable to MICFIL fifo */ /* DMA access privilege flag */ #define DMA_ACCESS_EXCLUSIVE 1 diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 7ffa43160927..8ac927ee6eee 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -239,6 +239,7 @@ if (CONFIG_SOC_SERIES_NXP_IMX8M) ${SOF_DRIVERS_PATH}/imx/sdma.c ${SOF_DRIVERS_PATH}/imx/sai.c ${SOF_DRIVERS_PATH}/imx/ipc.c + ${SOF_DRIVERS_PATH}/imx/micfil.c ${SOF_DRIVERS_PATH}/imx/interrupt-irqsteer.c ) From f3c290f14b91755a441f413aa20a90d0fec3ee88 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Mon, 18 Sep 2023 18:38:51 +0300 Subject: [PATCH 395/639] ipc4: logging: fix builds with mtrace and probes both disabled If both SOF_PROBES and MTRACE logging backends are disabled at build time, IPC4 build failed due to undefined ipc4_logging_enable_logs(). Fixes a bug in commit 1721f7042638 ("logging: add logging through probes"). Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- src/ipc/ipc4/logging.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ipc/ipc4/logging.c b/src/ipc/ipc4/logging.c index a6d8e4ccce43..3b06dc1a2fc7 100644 --- a/src/ipc/ipc4/logging.c +++ b/src/ipc/ipc4/logging.c @@ -158,9 +158,8 @@ int ipc4_logging_enable_logs(bool first_block, return 0; } -#endif +#elif CONFIG_LOG_BACKEND_SOF_PROBE -#ifdef CONFIG_LOG_BACKEND_SOF_PROBE int ipc4_logging_enable_logs(bool first_block, bool last_block, uint32_t data_offset_or_size, @@ -196,6 +195,16 @@ int ipc4_logging_enable_logs(bool first_block, return 0; } +#else /* unsupported logging method */ + +int ipc4_logging_enable_logs(bool first_block, + bool last_block, + uint32_t data_offset_or_size, + const char *data) +{ + return IPC4_UNKNOWN_MESSAGE_TYPE; +} + #endif int ipc4_logging_shutdown(void) From fb2727536af5050b81bfa202e367e1637120cdb9 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Wed, 2 Aug 2023 20:34:34 +0200 Subject: [PATCH 396/639] ipc4: Add Vendor Config Set Add Vendor Config Set, a special case of Large Config Set. Large Config Set handling now checks for this case and extracts extended param_id from ipc payload as param_id and handles the rest of the payload as usual. KPB now uses extended param_id. Necessary for fast mode task configuration in KPB. Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/kpb.c | 9 +++- src/include/ipc4/module.h | 15 ++++++ src/ipc/ipc4/handler.c | 96 ++++++++++++++++++++++++++++++++++----- 3 files changed, 108 insertions(+), 12 deletions(-) diff --git a/src/audio/kpb.c b/src/audio/kpb.c index 45a8b7f9b3cc..3187446b47e6 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -2384,9 +2384,16 @@ static int kpb_set_large_config(struct comp_dev *dev, uint32_t param_id, uint32_t data_offset, const char *data) { + /* We can use extended param id for both extended + * and standard param id + */ + union ipc4_extended_param_id extended_param_id; + comp_info(dev, "kpb_set_large_config()"); - switch (param_id) { + extended_param_id.full = param_id; + + switch (extended_param_id.part.parameter_type) { case KP_BUF_CLIENT_MIC_SELECT: return kpb_set_micselect(dev, data, data_offset); default: diff --git a/src/include/ipc4/module.h b/src/include/ipc4/module.h index cf5f60b453bc..8a16889ffe24 100644 --- a/src/include/ipc4/module.h +++ b/src/include/ipc4/module.h @@ -36,6 +36,9 @@ #define SOF_IPC4_DST_QUEUE_ID_BITFIELD_SIZE 3 #define SOF_IPC4_SRC_QUEUE_ID_BITFIELD_SIZE 3 +/* Special large_param_id values */ +#define VENDOR_CONFIG_PARAM 0xFF + enum sof_ipc4_module_type { SOF_IPC4_MOD_INIT_INSTANCE = 0, SOF_IPC4_MOD_CONFIG_GET = 1, @@ -51,6 +54,18 @@ enum sof_ipc4_module_type { SOF_IPC4_MOD_DELETE_INSTANCE = 11, }; +/* + * Structs for Vendor Config Set + */ + +union ipc4_extended_param_id { + uint32_t full; + struct{ + uint32_t parameter_type : 8; + uint32_t parameter_instance : 24; + } part; +} __packed __aligned(4); + /* * Host Driver sends this message to create a new module instance. */ diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index bc91c6a3727f..24cc4635fb7b 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -22,6 +22,7 @@ #include <sof/lib/mailbox.h> #include <sof/lib/pm_runtime.h> #include <sof/math/numbers.h> +#include <sof/tlv.h> #include <sof/trace/trace.h> #include <ipc4/error_status.h> #include <ipc/header.h> @@ -872,7 +873,8 @@ static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ip if (config.primary.r.module_id) { uint32_t comp_id; - comp_id = IPC4_COMP_ID(config.primary.r.module_id, config.primary.r.instance_id); + comp_id = IPC4_COMP_ID(config.primary.r.module_id, + config.primary.r.instance_id); dev = ipc4_get_comp_dev(comp_id); if (!dev) return IPC4_MOD_INVALID_ID; @@ -921,6 +923,69 @@ static int ipc4_get_large_config_module_instance(struct ipc4_message_request *ip return ret; } +static int ipc4_set_vendor_config_module_instance(struct comp_dev *dev, + const struct comp_driver *drv, + uint32_t module_id, + uint32_t instance_id, + bool init_block, + bool final_block, + uint32_t data_off_size, + const char *data) +{ + int ret; + + /* Old FW comment: bursted configs */ + if (init_block && final_block) { + const struct sof_tlv *tlv = (struct sof_tlv *)data; + /* if there is no payload in this large config set + * (4 bytes type | 4 bytes length=0 | no value) + * we do not handle such case + */ + if (data_off_size < sizeof(struct sof_tlv)) + return IPC4_INVALID_CONFIG_DATA_STRUCT; + + /* ===Iterate over payload=== + * Payload can have multiple sof_tlv structures inside, + * You can find how many by checking payload size (data_off_size) + * Here we just set pointer end_offset to the end of data + * and iterate until we reach that + */ + const uint8_t *end_offset = data + data_off_size; + + while ((const uint8_t *)tlv < end_offset) { + /* check for invalid length */ + if (!tlv->length) + return IPC4_INVALID_CONFIG_DATA_LEN; + + ret = drv->ops.set_large_config(dev, tlv->type, init_block, + final_block, tlv->length, tlv->value); + if (ret < 0) { + ipc_cmd_err(&ipc_tr, "failed to set large_config_module_instance %x : %x", + (uint32_t)module_id, (uint32_t)instance_id); + return IPC4_INVALID_RESOURCE_ID; + } + /* Move pointer to the end of this tlv */ + tlv = (struct sof_tlv *)((const uint8_t *)tlv + + sizeof(struct sof_tlv) + ALIGN_UP(tlv->length, 4)); + } + return IPC4_SUCCESS; + } + /* else, !(init_block && final_block) */ + const struct sof_tlv *tlv = (struct sof_tlv *)data; + uint32_t param_id = 0; + + if (init_block) { + /* for initial block use param_id from tlv + * move pointer and size to end of the tlv + */ + param_id = tlv->type; + data += sizeof(struct sof_tlv); + data_off_size -= sizeof(struct sof_tlv); + } + return drv->ops.set_large_config(dev, param_id, init_block, final_block, + data_off_size, (uint8_t *)data); +} + static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ipc4) { struct ipc4_module_large_config config; @@ -956,16 +1021,25 @@ static int ipc4_set_large_config_module_instance(struct ipc4_message_request *ip return ipc4_process_on_core(dev->ipc_config.core, false); } - ret = drv->ops.set_large_config(dev, config.extension.r.large_param_id, - config.extension.r.init_block, - config.extension.r.final_block, - config.extension.r.data_off_size, - (const char *)MAILBOX_HOSTBOX_BASE); - if (ret < 0) { - ipc_cmd_err(&ipc_tr, "failed to set large_config_module_instance %x : %x", - (uint32_t)config.primary.r.module_id, - (uint32_t)config.primary.r.instance_id); - ret = IPC4_INVALID_RESOURCE_ID; + /* check for vendor param first */ + if (config.extension.r.large_param_id == VENDOR_CONFIG_PARAM) { + ret = ipc4_set_vendor_config_module_instance(dev, drv, + (uint32_t)config.primary.r.module_id, + (uint32_t)config.primary.r.instance_id, + config.extension.r.init_block, + config.extension.r.final_block, + config.extension.r.data_off_size, + (const char *)MAILBOX_HOSTBOX_BASE); + } else { + ret = drv->ops.set_large_config(dev, config.extension.r.large_param_id, + config.extension.r.init_block, config.extension.r.final_block, + config.extension.r.data_off_size, (const char *)MAILBOX_HOSTBOX_BASE); + if (ret < 0) { + ipc_cmd_err(&ipc_tr, "failed to set large_config_module_instance %x : %x", + (uint32_t)config.primary.r.module_id, + (uint32_t)config.primary.r.instance_id); + ret = IPC4_INVALID_RESOURCE_ID; + } } return ret; From f070135e0432952591027b0bfef56d5bdfdbae7c Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Wed, 2 Aug 2023 21:05:23 +0200 Subject: [PATCH 397/639] kpb: Implement configuration part of fast mode task This patch implements handling of the configuration IPC for FMT in KPB module. KPB now saves the list of module instances to be processed by FMT. This is the first step for implementing FMT functionality. In case of WoV event, FMT is needed for KPB to drain history buffer and send this data to Host ASAP, as normal tasks are too slow. Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/kpb.c | 203 +++++++++++++++++++++++++++++++++++- src/include/ipc4/kpb.h | 12 +++ src/include/sof/audio/kpb.h | 86 +++++++++++++-- 3 files changed, 291 insertions(+), 10 deletions(-) diff --git a/src/audio/kpb.c b/src/audio/kpb.c index 3187446b47e6..2d52a35d7928 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -38,6 +38,7 @@ #include <rtos/string.h> #include <sof/ut.h> #include <ipc/topology.h> +#include <ipc4/module.h> #include <ipc4/kpb.h> #include <user/kpb.h> #include <user/trace.h> @@ -106,6 +107,8 @@ struct comp_data { uint32_t num_of_in_channels; uint32_t offsets[KPB_MAX_MICSEL_CHANNELS]; struct kpb_micselector_config mic_sel; + struct kpb_fmt_dev_list fmt_device_list; + struct fast_mode_task fmt; #if CONFIG_AMS uint32_t kpd_uuid_id; @@ -141,6 +144,23 @@ static inline bool validate_host_params(struct comp_dev *dev, size_t hb_size_req); static inline void kpb_change_state(struct comp_data *kpb, enum kpb_state state); +#ifdef CONFIG_IPC_MAJOR_4 +/* KpbFastModeTaskModulesList Namespace */ +static inline int alloc_fmt_module_list_item(struct kpb_fmt_dev_list *fmt_device_list, + struct comp_dev *mi_ptr, struct comp_dev ***item); +static int clear_fmt_modules_list(struct kpb_fmt_dev_list *fmt_device_list, + uint32_t outpin_idx); +static int prepare_fmt_modules_list(struct comp_dev *kpb_dev, uint32_t outpin_idx, + const struct kpb_task_params *modules_to_prepare); +/* FMT Namespace */ +static int register_modules_list(struct fast_mode_task *fmt, + struct device_list *new_list, size_t list_idx); +static int unregister_modules_list(struct fast_mode_task *fmt, + struct device_list *list_to_remove, size_t list_idx); +/* Devicelist */ +static int devicelist_push(struct device_list *devlist, struct comp_dev **dev); +static void devicelist_reset(struct device_list *devlist, bool remove_items); +#endif static uint64_t kpb_task_deadline(void *data) { @@ -376,7 +396,8 @@ static int kpb_unbind(struct comp_dev *dev, void *data) else kpb->host_sink = NULL; - return 0; + /* Clear fmt config */ + return clear_fmt_modules_list(&kpb->fmt_device_list, bu->extension.r.src_queue); } #else /* CONFIG_IPC_MAJOR_4 */ @@ -2378,15 +2399,177 @@ static int kpb_set_micselect(struct comp_dev *dev, const void *data, return 0; } +#ifdef CONFIG_IPC_MAJOR_4 + +static int devicelist_push(struct device_list *devlist, struct comp_dev **dev) +{ + if (devlist->count != DEVICE_LIST_SIZE) { + devlist->devs[devlist->count] = dev; + devlist->count++; + return 0; + } + return -EINVAL; +} + +static void devicelist_reset(struct device_list *devlist, bool remove_items) +{ + /* clear items */ + if (remove_items) { + for (int i = 0; i < DEVICE_LIST_SIZE; i++) + *devlist->devs[i] = NULL; + } + /* zero the pointers */ + for (int i = 0; i < DEVICE_LIST_SIZE; i++) + devlist->devs[i] = NULL; + + devlist->count = 0; +} + +static inline int alloc_fmt_module_list_item(struct kpb_fmt_dev_list *fmt_device_list, + struct comp_dev *mi_ptr, struct comp_dev ***item) +{ + /* -1 means we did not find the slot yet */ + int first_empty_slot_idx = -1; + + for (size_t module_slot_idx = 0; module_slot_idx < FAST_MODE_TASK_MAX_MODULES_COUNT; + ++module_slot_idx){ + /* check if module already added */ + if (fmt_device_list->modules_list_item[module_slot_idx] == mi_ptr) + return -EINVAL; + /* finding first available empty slot */ + if (first_empty_slot_idx < 0 && + !fmt_device_list->modules_list_item[module_slot_idx]) + first_empty_slot_idx = module_slot_idx; + } + /* add item to first available empty slot */ + if (first_empty_slot_idx >= 0) { + fmt_device_list->modules_list_item[first_empty_slot_idx] = mi_ptr; + *item = &fmt_device_list->modules_list_item[first_empty_slot_idx]; + return 0; + } + return -ENOMEM; +} + +static int prepare_fmt_modules_list(struct comp_dev *kpb_dev, + uint32_t outpin_idx, + const struct kpb_task_params *modules_to_prepare) +{ + int ret; + struct comp_dev *dev; + struct kpb_fmt_dev_list *fmt_device_list = + &((struct comp_data *)comp_get_drvdata(kpb_dev))->fmt_device_list; + + fmt_device_list->kpb_list_item[outpin_idx] = kpb_dev; + ret = devicelist_push(&fmt_device_list->device_list[outpin_idx], + &fmt_device_list->kpb_list_item[outpin_idx]); + if (ret < 0) + return ret; + + for (size_t mod_idx = 0; mod_idx < modules_to_prepare->number_of_modules; ++mod_idx) { + uint32_t comp_id = IPC4_COMP_ID(modules_to_prepare->dev_ids[mod_idx].module_id, + modules_to_prepare->dev_ids[mod_idx].instance_id); + + dev = ipc4_get_comp_dev(comp_id); + if (!dev) + return -EINVAL; + + struct comp_dev **new_list_item_ptr; + + ret = alloc_fmt_module_list_item(fmt_device_list, dev, &new_list_item_ptr); + if (ret < 0) + return ret; + *new_list_item_ptr = dev; + ret = devicelist_push(&fmt_device_list->device_list[outpin_idx], + new_list_item_ptr); + if (ret < 0) + return ret; + } + return 0; +} + +static int clear_fmt_modules_list(struct kpb_fmt_dev_list *fmt_device_list, + uint32_t outpin_idx) +{ + if (outpin_idx >= KPB_MAX_SINK_CNT) + return -EINVAL; + + devicelist_reset(&fmt_device_list->device_list[outpin_idx], true); + return 0; +} + +static int unregister_modules_list(struct fast_mode_task *fmt, + struct device_list *list_to_remove, size_t list_idx) +{ + if (list_to_remove == fmt->device_list[list_idx]) { + fmt->device_list[list_idx] = NULL; + return 0; + } + if (!fmt->device_list[list_idx]) { + /* Nothing to do here */ + return 0; + } + return -EINVAL; +} + +/* Comment from Old FW, may be outdated: + * Important: function below should be called only from within critical section + * (Goto KPB for more details) + */ +static int register_modules_list(struct fast_mode_task *fmt, + struct device_list *new_list, size_t list_idx) +{ + if (list_idx >= ARRAY_SIZE(fmt->device_list)) + return -EINVAL; + + /* Check if slot is free */ + if (!fmt->device_list[list_idx]) { + fmt->device_list[list_idx] = new_list; + return 0; + } + if (new_list == fmt->device_list[list_idx]) { + /* Already registered. */ + return 0; + } + /* was ADSP_ALREADY_IN_USE */ + return -EINVAL; +} + +static int configure_fast_mode_task(struct comp_dev *kpb_dev, const struct kpb_task_params *cfg, + size_t pin) +{ + if (pin >= KPB_MAX_SINK_CNT || pin == REALTIME_PIN_ID || !cfg) + return -EINVAL; + + struct comp_data *priv_data = (struct comp_data *)comp_get_drvdata(kpb_dev); + int ret = unregister_modules_list(&priv_data->fmt, + &priv_data->fmt_device_list.device_list[pin], + pin); + if (ret) + return -EINVAL; + + ret = clear_fmt_modules_list(&priv_data->fmt_device_list, pin); + if (ret) + return -EINVAL; + + /* When modules count IS 0 we only need to remove modules from Fast Mode. */ + if (cfg->number_of_modules > 0) { + ret = prepare_fmt_modules_list(kpb_dev, pin, cfg); + if (!ret) + ret = register_modules_list(&priv_data->fmt, + &priv_data->fmt_device_list.device_list[pin], + pin); + } + return ret; +} +#endif + static int kpb_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data) { - /* We can use extended param id for both extended - * and standard param id - */ + /* We can use extended param id for both extended and standard param id */ union ipc4_extended_param_id extended_param_id; comp_info(dev, "kpb_set_large_config()"); @@ -2394,6 +2577,18 @@ static int kpb_set_large_config(struct comp_dev *dev, uint32_t param_id, extended_param_id.full = param_id; switch (extended_param_id.part.parameter_type) { +#ifdef CONFIG_IPC_MAJOR_4 + case KP_BUF_CFG_FM_MODULE: { + /* Modules count equals 0 is a special case in which we want to clear list for + * given pin. Reference FW also allowed for cfg/data to be NULL, but this is no + * longer the case. + */ + const struct kpb_task_params *cfg = (struct kpb_task_params *)data; + uint32_t outpin_id = extended_param_id.part.parameter_instance; + + return configure_fast_mode_task(dev, cfg, outpin_id); + } +#endif case KP_BUF_CLIENT_MIC_SELECT: return kpb_set_micselect(dev, data, data_offset); default: diff --git a/src/include/ipc4/kpb.h b/src/include/ipc4/kpb.h index ad558bc4ac25..0c56942313c3 100644 --- a/src/include/ipc4/kpb.h +++ b/src/include/ipc4/kpb.h @@ -19,4 +19,16 @@ struct ipc4_kpb_module_cfg { struct ipc4_base_module_cfg base_cfg; } __packed __aligned(4); + +/* For the sake of compatibility, do not change IDs, only add new ones.*/ +enum ipc4_kpb_module_config_params { + /*! Configure the module ID's which would be part of the Fast mode tasks */ + KP_BUF_CFG_FM_MODULE = 1, + /* Mic selector for client - sets microphone id for real time sink mic selector + * IPC4-compatible ID - please do not change the number + */ + KP_BUF_CLIENT_MIC_SELECT = 11, +}; + #endif + diff --git a/src/include/sof/audio/kpb.h b/src/include/sof/audio/kpb.h index 852659f86c98..dbec1207c467 100644 --- a/src/include/sof/audio/kpb.h +++ b/src/include/sof/audio/kpb.h @@ -43,6 +43,7 @@ struct comp_buffer; (KPB_SAMPLE_CONTAINER_SIZE(sw) / 8) * KPB_MAX_BUFF_TIME * \ (channels_number)) #define KPB_MAX_NO_OF_CLIENTS 2 +#define KPB_MAX_SINK_CNT (1 + KPB_MAX_NO_OF_CLIENTS) #define KPB_NO_OF_HISTORY_BUFFERS 2 /**< no of internal buffers */ #define KPB_ALLOCATION_STEP 0x100 #define KPB_NO_OF_MEM_POOLS 3 @@ -66,6 +67,9 @@ struct comp_buffer; * i.e. number of max supported channels - reference channels) */ #define KPB_MAX_MICSEL_CHANNELS 4 +/* Used in FMT */ +#define FAST_MODE_TASK_MAX_MODULES_COUNT 16 +#define REALTIME_PIN_ID 0 /** All states below as well as relations between them are documented in * the sof-dosc in [kpbm-state-diagram] @@ -159,18 +163,88 @@ struct history_data { struct history_buffer *c_hb; /**< current buffer used for writing */ }; -enum ipc4_kpb_module_config_params { - /* Mic selector for client - sets microphone id for real time sink mic selector - * IPC4-compatible ID - please do not change the number - */ - KP_BUF_CLIENT_MIC_SELECT = 11, -}; +/* moved to ipc4/kpb.h */ +/* enum ipc4_kpb_module_config_params */ /* Stores KPB mic selector config */ struct kpb_micselector_config { /* channel bit set to 1 implies channel selection */ uint32_t mask; }; + +struct kpb_task_params { + /* If largeconfigset is set to KP_POS_IN_BUFFER then number of modules must + * correspond to number of modules between kpb and copier attached to hostdma. + * Once draining path is configured, cannot be reinitialized/changed. + */ + uint32_t number_of_modules; + struct { + uint16_t module_id; + uint16_t instance_id; + } dev_ids[1]; +}; + +/* fmt namespace: */ +#define FAST_MODE_TASK_MAX_LIST_COUNT 5 + +struct fast_mode_task { + /*! Array of pointers to all module lists to be processed. */ + struct device_list *device_list[FAST_MODE_TASK_MAX_LIST_COUNT]; +}; + +/* The +1 is here because we also push the kbp device + * handle in addition to the max number of modules + */ +#define DEVICE_LIST_SIZE (FAST_MODE_TASK_MAX_MODULES_COUNT + 1) + +/* Devicelist type + * In Reference FW KPB used Bi-dir lists to store modules for FMT. It is possible that lists are + * not necessary, but in case it might be wrong, here we use an array + * with a list interface to switch it to a list easily. + */ +struct device_list { + struct comp_dev **devs[DEVICE_LIST_SIZE]; + /* number of items AND index of next empty box */ + size_t count; +}; + +/* + * + * + * KPB FMT config set steps: + * 1. Get dev_ids of module instances from IPC + * 2. Alloc this kpb module instance on kpb_list_item, save address of where it was allocated + * 3. Push the address on dev_list.device_list + * 2. For each dev_id get device handler(module instance) + * 3. Alloc device handler in modules_list_item, save address of where it was allocated + * 4. Register this address in fmt.device_list + * + * Pointer structure: + * + * COMP_DEVS + * ^ + * | + * dev_list.modules_list_item(comp_dev* ) + * ^ + * | + * dev_list.device_list(comp_dev**) + * ^ + * | + * fmt.device_list(device_list*) + * + * + */ + +/* KpbFastModeTaskModulesList Namespace */ +struct kpb_fmt_dev_list { + /*! Array of all module lists to be processed. */ + struct device_list device_list[FAST_MODE_TASK_MAX_LIST_COUNT]; + /* One for each sinkpin. */ + struct comp_dev *kpb_list_item[KPB_MAX_SINK_CNT]; + struct comp_dev *modules_list_item[FAST_MODE_TASK_MAX_MODULES_COUNT]; + struct comp_dev *kpb_mi_ptr; +}; + #ifdef UNIT_TEST void sys_comp_kpb_init(void); #endif From d0d74a477f64a83654bccb3905175584d05d9257 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 15 Sep 2023 14:03:33 +0300 Subject: [PATCH 398/639] Tools: Topology2: Change in capture gain curve_duration to 50 ms This change increases the ramp duration from 20 ms to 50 ms. It lowers the peak load of peak volume component due to longer same gain value blocks. The internal update rate for gain becomes 250 us instead of 125 us. The longer fade-in ramp also conceals better possible analog capture start transients. This changes for 4ch capture for gain.11.1 in sof-hda-generic-4ch.tplg from CPU_PEAK(MAX) = 21.95 PEAK(MAX)/AVG(AVG) = 7.51 to CPU_PEAK(MAX) = 9.07 PEAK(MAX)/AVG(AVG) = 3.12 Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/topology/topology2/cavs-nocodec-multicore.conf | 3 +++ tools/topology/topology2/cavs-nocodec.conf | 6 ++++++ tools/topology/topology2/platform/intel/dmic-generic.conf | 1 + 3 files changed, 10 insertions(+) diff --git a/tools/topology/topology2/cavs-nocodec-multicore.conf b/tools/topology/topology2/cavs-nocodec-multicore.conf index 9c7e9c833b59..d9fae0e3ec4b 100644 --- a/tools/topology/topology2/cavs-nocodec-multicore.conf +++ b/tools/topology/topology2/cavs-nocodec-multicore.conf @@ -335,6 +335,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -396,6 +397,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -454,6 +456,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index bac1fe2118c7..6cc7f0d3753e 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -275,6 +275,7 @@ IncludeByKey.PASSTHROUGH { pcm_id $SSP0_PCM_ID } Object.Widget.gain.1 { + curve_duration 500000 Object.Control.mixer.1 { name 'Post Demux $SSP0_PCM_NAME Capture Volume' } @@ -289,6 +290,7 @@ IncludeByKey.PASSTHROUGH { pcm_id $SSP0_CAPTURE_PCM_ID } Object.Widget.gain.1 { + curve_duration 500000 Object.Control.mixer.1 { name 'Post Demux $SSP0_CAPTURE_PCM Volume' } @@ -329,6 +331,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -394,6 +397,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 Object.Control.mixer.1 { name 'Pre Demux $SSP0_PCM_NAME Capture Volume' } @@ -699,6 +703,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -755,6 +760,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 006505ca011f..9548ab885c72 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -102,6 +102,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { From 1479462824f32f75953d80780a5f375e9bfa5121 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Mon, 18 Sep 2023 15:54:17 +0300 Subject: [PATCH 399/639] topology1: remove Intel CML and EHL topologies These topologies are no longer supported by mainline firmware code for these platforms. The stable-v2.2 branch continues to support these targets. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- tools/topology/topology1/CMakeLists.txt | 2 - .../topology1/sof-cml-demux-rt5682.m4 | 228 ----------------- .../topology/topology1/sof-cml-rt5682-kwd.m4 | 235 ------------------ tools/topology/topology1/sof-cml-rt5682.m4 | 212 ---------------- tools/topology/topology1/sof-ehl-rt5660.m4 | 222 ----------------- 5 files changed, 899 deletions(-) delete mode 100644 tools/topology/topology1/sof-cml-demux-rt5682.m4 delete mode 100644 tools/topology/topology1/sof-cml-rt5682-kwd.m4 delete mode 100644 tools/topology/topology1/sof-cml-rt5682.m4 delete mode 100644 tools/topology/topology1/sof-ehl-rt5660.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index dc5384985e4f..53b4404941b9 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -79,8 +79,6 @@ set(TPLGS "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" ## end SoundWire NOJACK topologies - "sof-ehl-rt5660\;sof-ehl-rt5660\;-DHDMI=1" - "sof-ehl-rt5660\;sof-ehl-rt5660-nohdmi" "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" diff --git a/tools/topology/topology1/sof-cml-demux-rt5682.m4 b/tools/topology/topology1/sof-cml-demux-rt5682.m4 deleted file mode 100644 index ff131dfb75b5..000000000000 --- a/tools/topology/topology1/sof-cml-demux-rt5682.m4 +++ /dev/null @@ -1,228 +0,0 @@ -# -# Topology for Cometlake with rt5682 codec. -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`muxdemux.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include platform specific DSP configuration -include(`platform/intel/'PLATFORM`.m4') - -DEBUG_START - -dnl Configure demux -dnl name, pipeline_id, routing_matrix_rows -dnl Diagonal 1's in routing matrix mean that every input channel is -dnl copied to corresponding output channels in all output streams. -dnl I.e. row index is the input channel, 1 means it is copied to -dnl corresponding output channel (column index), 0 means it is discarded. -dnl There's a separate matrix for all outputs. -define(matrix1, `ROUTE_MATRIX(1, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -define(matrix2, `ROUTE_MATRIX(5, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -dnl name, num_streams, route_matrix list -MUXDEMUX_CONFIG(demux_priv_1, 2, LIST_NONEWLINE(`', `matrix1,', `matrix2')) - -# -# Define the pipelines -# -# PCM0 ----> demux ----> SSP(SSP_INDEX) -# PCM0 <---- volume <----- SSP(SSP_INDEX) -# PCM1 ----> volume -----> DMIC01 (dmic0 capture) -# PCM2 ----> volume -----> iDisp1 -# PCM3 ----> volume -----> iDisp2 -# PCM4 ----> volume -----> iDisp3 -# PCM5 <---- demux -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Demux pipeline 1 on PCM 0 using max 2 channels of s24le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, - 1, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Passthrough capture pipeline 3 on PCM 1 using max 4 channels. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 3, 1, 4, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 4 on PCM 2 using max 2 channels of s32le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 4, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 3 using max 2 channels of s32le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 4 using max 2 channels of s32le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is SSP(SPP_INDEX) using 2 periods -# Buffers use s24le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, SSP_INDEX, SSP_NAME, - PIPELINE_SOURCE_1, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP(SSP_INDEX) using 2 periods -# Buffers use s24le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP,SSP_INDEX, SSP_NAME, - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# Capture pipeline 5 on PCM 5 using max 2 channels of s32le. -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture-sched.m4, - 5, 5, 2, s32le, - 1000, 1, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER) - -# Connect demux to capture -SectionGraph."PIPE_CAP" { - index "0" - - lines [ - # demux to capture - dapm(PIPELINE_SINK_5, PIPELINE_DEMUX_1) - ] -} - -# Connect virtual capture to dai -SectionGraph."PIPE_CAP_VIRT" { - index "5" - - lines [ - # mux to capture - dapm(ECHO REF 5, `SSP'SSP_INDEX`.IN') - ] -} - -# capture DAI is DMIC01 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, DMIC, 0, dmic01, - PIPELINE_SINK_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 4, HDA, 0, iDisp1, - PIPELINE_SOURCE_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 1, iDisp2, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 2, iDisp3, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_DUPLEX_ADD(Port1, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_CAPTURE_ADD(DMIC, 1, PIPELINE_PCM_3) -PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_4) -PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_6) -PCM_CAPTURE_ADD(EchoRef, 5, PIPELINE_PCM_5) - -# -# BE configurations - overrides config in ACPI if present -# - -#SSP SSP_INDEX (ID: 0) -DAI_CONFIG(SSP, SSP_INDEX, 0, SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, SSP_INDEX, 24))) - -# dmic01 (ID: 1) -DAI_CONFIG(DMIC, 0, 1, dmic01, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) - -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 0, 3, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 4, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 5, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) - - -DEBUG_END diff --git a/tools/topology/topology1/sof-cml-rt5682-kwd.m4 b/tools/topology/topology1/sof-cml-rt5682-kwd.m4 deleted file mode 100644 index f05ed9913ae4..000000000000 --- a/tools/topology/topology1/sof-cml-rt5682-kwd.m4 +++ /dev/null @@ -1,235 +0,0 @@ -# -# Topology for Cometlake with rt5682 codec and Keyword Detect. -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -include(`abi.h') -# Include Platform specific DSP configuration -include(`platform/intel/'PLATFORM`.m4') - -define(KWD_PIPE_SCH_DEADLINE_US, 5000) - -DEBUG_START - -# if XPROC is not defined, define with default pipe -ifdef(`HSMICPROC', , `define(HSMICPROC, volume)') -ifdef(`HSEARPROC', , `define(HSEARPROC, volume)') -ifdef(`DMICPROC', , `define(DMICPROC, passthrough)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, passthrough)') - -# FIXME: Using DMIC16kHz instead of DMIC16k, otherwise M4 does not return. -define(DMIC_16k_PCM_NAME, DMIC16kHz) - -# -# Define the pipelines -# -# PCM0 <---> volume <----> SSP(SSP_INDEX, BE link 0) -# PCM1 <---- DMICPROC <--- DMIC01 (dmic0 capture, , BE link 1) -# PCM2 ----> volume -----> iDisp1 (HDMI/DP playback, BE link 3) -# PCM3 ----> volume -----> iDisp2 (HDMI/DP playback, BE link 4) -# PCM4 ----> volume -----> iDisp3 (HDMI/DP playback, BE link 5) -# PCM8 <-------(pipe 8) <------------+- KPBM 0 <----- DMIC1 (dmic16k, BE link 2) -# | -# Detector <--- selector (pipe 9) <---+ -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# Schedule 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# Schedule 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# DMICPROC capture pipeline 3 on PCM 1 using max 4 channels. -# Schedule 1000us deadline with priority 0 on core 0 -ifdef(`DMICPROC_FILTER1', `define(PIPELINE_FILTER1, DMICPROC_FILTER1)') -ifdef(`DMICPROC_FILTER2', `define(PIPELINE_FILTER2, DMICPROC_FILTER2)') - -PIPELINE_PCM_ADD(sof/pipe-DMICPROC-capture.m4, - 3, 1, 4, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') - -# Low Latency playback pipeline 4 on PCM 2 using max 2 channels of s32le. -# Schedule 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 4, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 3 using max 2 channels of s32le. -# Schedule 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 4 using max 2 channels of s32le. -# Schedule 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is SSP(SPP_INDEX) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, SSP_INDEX, SSP_NAME, - PIPELINE_SOURCE_1, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP(SSP_INDEX) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP,SSP_INDEX, SSP_NAME, - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC01 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, DMIC, 0, dmic01, - PIPELINE_SINK_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 4, HDA, 0, iDisp1, - PIPELINE_SOURCE_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 1, iDisp2, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 2, iDisp3, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# -# KWD configuration -# - -# Passthrough capture pipeline 7 on PCM 7 using max 2 channels. -# Schedule 20000us deadline with priority 0 on core 0 -PIPELINE_PCM_DAI_ADD(sof/pipe-kfbm-capture.m4, - 8, 8, 2, s24le, - KWD_PIPE_SCH_DEADLINE_US, 0, 0, DMIC, 1, s32le, 3, - 16000, 16000, 16000) - -# capture DAI is DMIC 1 using 3 periods -# Buffers use s32le format, with 320 frame per 20000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 8, DMIC, 1, dmic16k, - PIPELINE_SINK_8, 3, s32le, - KWD_PIPE_SCH_DEADLINE_US, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_DUPLEX_ADD(Port1, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_CAPTURE_ADD(DMIC, 1, PIPELINE_PCM_3) -PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_4) -PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_6) - -# keyword detector pipe -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp, dynamic) -PIPELINE_PCM_ADD(sof/pipe-detect.m4, - 9, 1, 2, s24le, - KWD_PIPE_SCH_DEADLINE_US, 1, 0, - 16000, 16000, 16000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_SCHED_COMP_8) - -# Connect pipelines together -SectionGraph."pipe-sof-cml-keyword-detect" { - index "0" - - lines [ - # keyword detect - dapm(PIPELINE_SINK_9, PIPELINE_SOURCE_8) - dapm(PIPELINE_PCM_8, PIPELINE_DETECT_9) - ] -} - -# -# BE configurations - overrides config in ACPI if present -# - -#SSP SSP_INDEX (ID: 0) -DAI_CONFIG(SSP, SSP_INDEX, 0, SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, SSP_INDEX, 24))) - -# dmic01 (ID: 1) -DAI_CONFIG(DMIC, 0, 1, dmic01, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) - -# dmic16k (ID: 2) -DAI_CONFIG(DMIC, 1, 2, dmic16k, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, STEREO_PDM0))) - -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 0, 3, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 4, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 5, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) - -DEBUG_END diff --git a/tools/topology/topology1/sof-cml-rt5682.m4 b/tools/topology/topology1/sof-cml-rt5682.m4 deleted file mode 100644 index ac928383ea08..000000000000 --- a/tools/topology/topology1/sof-cml-rt5682.m4 +++ /dev/null @@ -1,212 +0,0 @@ -# -# Topology for Cometlake with rt5682 codec. -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Platform specific DSP configuration -include(`platform/intel/'PLATFORM`.m4') - -DEBUG_START - -# if XPROC is not defined, define with default pipe -ifdef(`HSMICPROC', , `define(HSMICPROC, volume)') -ifdef(`HSEARPROC', , `define(HSEARPROC, volume)') -ifdef(`DMICPROC', , `define(DMICPROC, passthrough)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, passthrough)') - -# -# Define the pipelines -# -`# PCM0 ---> 'HSEARPROC` ----> SSP(SSP_INDEX, BE link 0)' -`# PCM0 <--- 'HSMICPROC` <---- SSP(SSP_INDEX, BE link 0)' -`# PCM1 <--- 'DMICPROC` <----- DMIC01 (dmic0 capture, , BE link 1)' -# PCM2 ----> volume -----> iDisp1 (HDMI/DP playback, BE link 3) -# PCM3 ----> volume -----> iDisp2 (HDMI/DP playback, BE link 4) -# PCM4 ----> volume -----> iDisp3 (HDMI/DP playback, BE link 5) -`# PCM8 <---- 'DMIC16KPROC` <----- DMIC16k (dmic16k, BE link 2)' -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-`HSEARPROC'-playback.m4, - 1, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-`HSMICPROC'-capture.m4, - 2, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Passthrough capture pipeline 3 on PCM 1 using max 4 channels. -# 1000us deadline with priority 0 on core 0 -ifdef(`DMICPROC_FILTER1', `define(PIPELINE_FILTER1, DMICPROC_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`DMICPROC_FILTER2', `define(PIPELINE_FILTER2, DMICPROC_FILTER2)', `undefine(`PIPELINE_FILTER2')') -define(`PGA_NAME', Dmic0) - -PIPELINE_PCM_ADD(sof/pipe-`DMICPROC'-capture.m4, - 3, 1, 4, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -undefine(`PGA_NAME') -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') - -# Low Latency playback pipeline 4 on PCM 2 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 4, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 3 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 4 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Passthrough capture pipeline 7 on PCM 5 using max 2 channels. -# Schedule 1000us deadline with priority 0 on core 0 -ifdef(`DMIC16KPROC_FILTER1', `define(PIPELINE_FILTER1, DMIC16KPROC_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`DMIC16KPROC_FILTER2', `define(PIPELINE_FILTER2, DMIC16KPROC_FILTER2)', `undefine(`PIPELINE_FILTER2')') -define(`PGA_NAME', Dmic1) - -PIPELINE_PCM_ADD(sof/pipe-`DMIC16KPROC'-capture-16khz.m4, - 8, 8, 2, s24le, - 1000, 0, 0, - 16000, 16000, 16000) - -undefine(`PGA_NAME') -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is SSP(SPP_INDEX) using 2 periods -# Buffers use s24le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, SSP_INDEX, SSP_NAME, - PIPELINE_SOURCE_1, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP(SSP_INDEX) using 2 periods -# Buffers use s24le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP,SSP_INDEX, SSP_NAME, - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC01 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, DMIC, 0, dmic01, - PIPELINE_SINK_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 4, HDA, 0, iDisp1, - PIPELINE_SOURCE_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 1, iDisp2, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 2, iDisp3, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC16k using 2 periods -# Buffers use s32le format, with 16 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 8, DMIC, 1, dmic16k, - PIPELINE_SINK_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_DUPLEX_ADD(Port1, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_CAPTURE_ADD(DMIC, 1, PIPELINE_PCM_3) -PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_4) -PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_6) -PCM_CAPTURE_ADD(DMIC16kHz, 8, PIPELINE_PCM_8) - -# -# BE configurations - overrides config in ACPI if present -# - -#SSP SSP_INDEX (ID: 0) -DAI_CONFIG(SSP, SSP_INDEX, 0, SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, SSP_INDEX, 24))) - -# dmic01 (ID: 1) -DAI_CONFIG(DMIC, 0, 1, dmic01, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) - -# dmic16k (ID: 2) -DAI_CONFIG(DMIC, 1, 2, dmic16k, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, STEREO_PDM0))) - -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 0, 3, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 4, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 5, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) - -DEBUG_END diff --git a/tools/topology/topology1/sof-ehl-rt5660.m4 b/tools/topology/topology1/sof-ehl-rt5660.m4 deleted file mode 100644 index 132740bbb10f..000000000000 --- a/tools/topology/topology1/sof-ehl-rt5660.m4 +++ /dev/null @@ -1,222 +0,0 @@ -# -# Topology for ELKHARTLAKE with rt5660 codec -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Elkhartlake DSP configuration -include(`platform/intel/ehl.m4') -include(`platform/intel/dmic.m4') - -DEBUG_START - -# -# Define the pipelines -# -# PCM0 <---> volume <----> SSP0 BE dailink 0 -# PCM1 <---- volume <----- DMIC48k (dmic48k, BE dailink 1) - -ifelse(HDMI, `1', -` -# PCM2 ----> volume -----> iDisp1 (HDMI/DP playback, BE link 5) -# PCM3 ----> volume -----> iDisp2 (HDMI/DP playback, BE link 6) -# PCM4 ----> volume -----> iDisp3 (HDMI/DP playback, BE link 7) -# PCM5 ----> volume -----> iDisp3 (HDMI/DP playback, BE link 8) -') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) -# time_domain and sched_comp is used for a "branched" pipeline, -# which is not applicable in ehl-rt5660. - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 3 on PCM 1 using max 4 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 3, 1, 4, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Passthrough capture pipeline 4 on PCM 3 using max 2 channels. -# Schedule 16 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 4, 3, 2, s16le, - 1000, 0, 0, - 16000, 16000, 16000) - -ifelse(HDMI, `1', -` -# Low Latency playback pipeline 4 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 3 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 4 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -') - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl period , priority, core, time_domain) - -# playback DAI is SSP0 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, 0, SSP0-Codec, - PIPELINE_SOURCE_1, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP0 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, 0, SSP0-Codec, - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC48k using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, DMIC, 0, dmic48k, - PIPELINE_SINK_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC16k using 2 periods -# Buffers use s16le format, with 16 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 4, DMIC, 1, dmic16k, - PIPELINE_SINK_4, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) -ifelse(HDMI, `1', -` -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 0, iDisp1, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 1, iDisp2, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 2, iDisp3, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp4 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 3, iDisp4, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) -') - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_DUPLEX_ADD(Headset, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_CAPTURE_ADD(DMIC, 1, PIPELINE_PCM_3) -PCM_CAPTURE_ADD(DMIC16kHz, 2, PIPELINE_PCM_4) - -ifelse(HDMI, `1', -` -PCM_PLAYBACK_ADD(HDMI1, 3, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI2, 4, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI3, 5, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI4, 6, PIPELINE_PCM_8) -') - -# -# BE configurations - overrides config in ACPI if present -# -#SSP 2 (ID: 0) -DAI_CONFIG(SSP, 0, 0, SSP0-Codec, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 9600000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24))) - -# dmic48k (ID: 1) -DAI_CONFIG(DMIC, 0, 1, dmic48k, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) - -# dmic16k (ID: 2) -DAI_CONFIG(DMIC, 1, 2, dmic16k, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s16le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, STEREO_PDM0))) - -ifelse(HDMI, `1', -` -# 4 HDMI/DP outputs (ID: 5,6,7,8) -DAI_CONFIG(HDA, 0, 5, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 6, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 7, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -DAI_CONFIG(HDA, 3, 8, iDisp4, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) -') - -DEBUG_END From 0912756595d5b89fca02a475c07d19d58c372e0d Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Date: Mon, 18 Sep 2023 09:05:51 -0400 Subject: [PATCH 400/639] topology2: intel: bt-ssp-config: use cardinal clock as source All existing SSP-based topologies use the audio cardinal clock, *EXCEPT* Bluetooth related ones. This doesn't make much sense, let's use the same clock source for all SSPs. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> --- .../topology2/platform/intel/bt-ssp-config-lbm.conf | 6 +++--- tools/topology/topology2/platform/intel/bt-ssp-config.conf | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology2/platform/intel/bt-ssp-config-lbm.conf b/tools/topology/topology2/platform/intel/bt-ssp-config-lbm.conf index 694f6939e2f6..d4060ef53c09 100644 --- a/tools/topology/topology2/platform/intel/bt-ssp-config-lbm.conf +++ b/tools/topology/topology2/platform/intel/bt-ssp-config-lbm.conf @@ -23,7 +23,7 @@ Object.Dai.SSP [ tx_slots 1 rx_slots 1 Object.Base.link_config.1 { - clock_source 0 + clock_source 1 } } Object.Base.hw_config.2 { @@ -41,7 +41,7 @@ Object.Dai.SSP [ tx_slots 1 rx_slots 1 Object.Base.link_config.1 { - clock_source 0 + clock_source 1 } } Object.Base.hw_config.3 { @@ -58,7 +58,7 @@ Object.Dai.SSP [ tx_slots 3 rx_slots 3 Object.Base.link_config.1 { - clock_source 0 + clock_source 1 } } } diff --git a/tools/topology/topology2/platform/intel/bt-ssp-config.conf b/tools/topology/topology2/platform/intel/bt-ssp-config.conf index edce4b8d1399..1a5353890f5e 100644 --- a/tools/topology/topology2/platform/intel/bt-ssp-config.conf +++ b/tools/topology/topology2/platform/intel/bt-ssp-config.conf @@ -22,7 +22,7 @@ Object.Dai.SSP [ tx_slots 1 rx_slots 1 Object.Base.link_config.1 { - clock_source 0 + clock_source 1 } } Object.Base.hw_config.2 { @@ -40,7 +40,7 @@ Object.Dai.SSP [ tx_slots 1 rx_slots 1 Object.Base.link_config.1 { - clock_source 0 + clock_source 1 } } Object.Base.hw_config.3 { @@ -57,7 +57,7 @@ Object.Dai.SSP [ tx_slots 3 rx_slots 0 Object.Base.link_config.1 { - clock_source 0 + clock_source 1 } } } From 5004d0fe1e74a70f64fcea1e1e51b1c8d83b9245 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 19 Sep 2023 09:09:03 +0800 Subject: [PATCH 401/639] zephyr.yml: remove ipc option for zephyr build For TGL and TGL-H, IPC4 is the default build config, remove the '-i IPC4' option as it is not needed anymore. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- .github/workflows/zephyr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index a1cb163c158d..c506f68f8f23 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -111,7 +111,7 @@ jobs: # - IPC4 default mtl, lnl, # Temporary testbed for Zephyr development. - -i IPC4 tgl tgl-h, + tgl tgl-h, ] build_opts: [""] # Sparse matrices are complicated, you must read this page slowly: @@ -217,7 +217,7 @@ jobs: # - IPC4 default mtl, # Very few IPC3 platforms support IPC4 too. - -i IPC4 tgl tgl-h, + tgl tgl-h, ] build_opts: [""] # Sparse matrices are complicated, see comments on Linux matrix above. @@ -397,7 +397,7 @@ jobs: # http://mywiki.wooledge.org/ParsingLs for regdir in 'linux-build *mtl' \ 'windows-build *mtl' \ - 'windows-build *-i IPC4 tgl tgl-h'; do + 'windows-build *tgl tgl-h'; do find . -maxdepth 1 | grep -q "\./${regdir}\$" || { >&2 printf 'Missing %s\n' "${regdir}"; exit 1; } done From a17c2823d376487d1f78ed3f80e6f93e7288bc92 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Mon, 18 Sep 2023 15:39:27 +0800 Subject: [PATCH 402/639] xtensa-build-zephyr: remove ipc option For legacy CAVS platforms (TGL/ADL/EHL), the default build config is IPC4 now, and the overlay file is already emptied. Remove the option in this build script. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- scripts/xtensa-build-zephyr.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 8a2b3532708a..5f8cdd5ce361 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -176,9 +176,6 @@ def parse_args(): help="List of platforms to build") parser.add_argument("-d", "--debug", required=False, action="store_true", help="Shortcut for: -o sof/app/debug_overlay.conf") - parser.add_argument("-i", "--ipc", required=False, choices=["IPC4"], - help="""Applies --overlay <platform>/ipc4_overlay.conf -and a different rimage config. Valid only for IPC3 platforms supporting IPC4 too.""") # NO SOF release will ever user the option --fw-naming. # This option is only for disguising SOF IPC4 as CAVS IPC4 and only in cases where # the kernel 'ipc_type' expects CAVS IPC4. In this way, developers and CI can test @@ -265,10 +262,6 @@ def parse_args(): if not args.use_platform_subdir: args.use_platform_subdir=True warnings.warn("The option '--fw-naming AVS' has to be used with '--use-platform-subdir'. Enable '--use-platform-subdir' automatically.") - if args.ipc != "IPC4": - args.ipc="IPC4" - warnings.warn("The option '--fw-naming AVS' has to be used with '-i IPC4'. Enable '-i IPC4' automatically.") - def execute_command(*run_args, **run_kwargs): """[summary] Provides wrapper for subprocess.run that prints @@ -626,7 +619,7 @@ def rimage_options(platform_dict): # test_00_01_load_fw_and_check_version opts.append(("-b", "1")) - if args.ipc == "IPC4": + if platform_dict.get("IPC4_RIMAGE_DESC", None) is not None: rimage_desc = platform_dict["IPC4_RIMAGE_DESC"] else: rimage_desc = platform_dict["name"] + ".toml" @@ -725,13 +718,6 @@ def build_platforms(): if args.debug: overlays.append(str(pathlib.Path(SOF_TOP, "app", "debug_overlay.conf"))) - # The '-i IPC4' is a shortcut for '-o path_to_ipc4_overlay' (and more), we - # are good if both are provided, because it's no harm to merge the same - # overlay twice. - if args.ipc == "IPC4": - overlays.append(str(pathlib.Path(SOF_TOP, "app", "overlays", platform, - platform_dict["IPC4_CONFIG_OVERLAY"]))) - if overlays: overlays = ";".join(overlays) build_cmd.append(f"-DOVERLAY_CONFIG={overlays}") From b0afa391262e93cab60ab69f595dacb6beb3c2c8 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Mon, 18 Sep 2023 16:05:25 +0800 Subject: [PATCH 403/639] app: overlays: remove tgl and tgl-h ipc4 overlays We build tgl and tgl-h with ipc4 by default, those ipc4 overlays are empty now, can be removed safely. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- app/overlays/tgl-h/ipc4_overlay.conf | 5 ----- app/overlays/tgl/ipc4_overlay.conf | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 app/overlays/tgl-h/ipc4_overlay.conf delete mode 100644 app/overlays/tgl/ipc4_overlay.conf diff --git a/app/overlays/tgl-h/ipc4_overlay.conf b/app/overlays/tgl-h/ipc4_overlay.conf deleted file mode 100644 index fc4739a27eb6..000000000000 --- a/app/overlays/tgl-h/ipc4_overlay.conf +++ /dev/null @@ -1,5 +0,0 @@ -# This file is empty as IPC4 now the default. -# -# The file is kept around for the time being to -# smoothen the transition for users who use -# this overlay file in their build scripts. diff --git a/app/overlays/tgl/ipc4_overlay.conf b/app/overlays/tgl/ipc4_overlay.conf deleted file mode 100644 index fc4739a27eb6..000000000000 --- a/app/overlays/tgl/ipc4_overlay.conf +++ /dev/null @@ -1,5 +0,0 @@ -# This file is empty as IPC4 now the default. -# -# The file is kept around for the time being to -# smoothen the transition for users who use -# this overlay file in their build scripts. From 527e5f7d4b82368ed96bf0728d744ba6c5054b88 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:27:24 +0200 Subject: [PATCH 404/639] copier: remove buffer_acquire from copier remove buffer ops from copier module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/copier/copier.c | 42 +++++++--------------------- src/audio/copier/copier_dai.c | 9 ++---- src/audio/copier/copier_generic.c | 30 +++++++------------- src/audio/copier/copier_host.c | 12 ++------ src/audio/copier/copier_ipcgtw.c | 46 +++++++++++-------------------- 5 files changed, 41 insertions(+), 98 deletions(-) diff --git a/src/audio/copier/copier.c b/src/audio/copier/copier.c index b115a16df212..0bb2306d2a6e 100644 --- a/src/audio/copier/copier.c +++ b/src/audio/copier/copier.c @@ -266,7 +266,6 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd) struct sof_ipc_stream_posn posn; struct comp_dev *dai_copier; struct comp_buffer *buffer; - struct comp_buffer *buffer_c; uint32_t latency; int ret; @@ -358,10 +357,8 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd) } buffer = list_first_item(&dai_copier->bsource_list, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(buffer); pipe_reg.stream_start_offset = posn.dai_posn + - latency * audio_stream_get_size(&buffer_c->stream); - buffer_release(buffer_c); + latency * audio_stream_get_size(&buffer->stream); pipe_reg.stream_end_offset = 0; mailbox_sw_regs_write(cd->pipeline_reg_offset, &pipe_reg, sizeof(pipe_reg)); } else if (cmd == COMP_TRIGGER_PAUSE) { @@ -384,9 +381,7 @@ static int copier_comp_trigger(struct comp_dev *dev, int cmd) } buffer = list_first_item(&dai_copier->bsource_list, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(buffer); - pipe_reg.stream_start_offset += latency * audio_stream_get_size(&buffer_c->stream); - buffer_release(buffer_c); + pipe_reg.stream_start_offset += latency * audio_stream_get_size(&buffer->stream); mailbox_sw_regs_write(cd->pipeline_reg_offset, &pipe_reg.stream_start_offset, sizeof(pipe_reg.stream_start_offset)); } @@ -426,7 +421,6 @@ static int copier_copy_to_sinks(struct copier_data *cd, struct comp_dev *dev, struct comp_buffer *src_c, struct comp_copy_limits *processed_data) { - struct comp_buffer *sink_c; struct list_item *sink_list; struct comp_buffer *sink; int ret = 0; @@ -436,14 +430,12 @@ static int copier_copy_to_sinks(struct copier_data *cd, struct comp_dev *dev, struct comp_dev *sink_dev; sink = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - sink_dev = sink_c->sink; + sink_dev = sink->sink; processed_data->sink_bytes = 0; if (sink_dev->state == COMP_STATE_ACTIVE) { - ret = do_conversion_copy(dev, cd, src_c, sink_c, processed_data); + ret = do_conversion_copy(dev, cd, src_c, sink, processed_data); cd->output_total_data_processed += processed_data->sink_bytes; } - buffer_release(sink_c); if (ret < 0) { comp_err(dev, "failed to copy buffer for comp %x", dev->ipc_config.id); @@ -515,7 +507,6 @@ static int copier_module_copy(struct processing_module *mod, static int copier_multi_endpoint_dai_copy(struct copier_data *cd, struct comp_dev *dev) { - struct comp_buffer *src_c, *sink_c; struct comp_copy_limits processed_data; struct comp_buffer *src; int ret; @@ -529,9 +520,7 @@ static int copier_multi_endpoint_dai_copy(struct copier_data *cd, struct comp_de if (ret < 0) return ret; - src_c = buffer_acquire(cd->multi_endpoint_buffer); - ret = copier_copy_to_sinks(cd, dev, src_c, &processed_data); - buffer_release(src_c); + ret = copier_copy_to_sinks(cd, dev, cd->multi_endpoint_buffer, &processed_data); return ret; } @@ -543,24 +532,18 @@ static int copier_multi_endpoint_dai_copy(struct copier_data *cd, struct comp_de } src = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - src_c = buffer_acquire(src); /* gateway(s) on output */ - sink_c = buffer_acquire(cd->multi_endpoint_buffer); - ret = do_conversion_copy(dev, cd, src_c, sink_c, &processed_data); - buffer_release(sink_c); - + ret = do_conversion_copy(dev, cd, src, cd->multi_endpoint_buffer, &processed_data); if (ret < 0) - goto err; + return ret; ret = dai_zephyr_multi_endpoint_copy(cd->dd, dev, cd->multi_endpoint_buffer, cd->endpoint_num); if (!ret) { - comp_update_buffer_consume(src_c, processed_data.source_bytes); + comp_update_buffer_consume(src, processed_data.source_bytes); cd->input_total_data_processed += processed_data.source_bytes; } -err: - buffer_release(src_c); return ret; } @@ -646,7 +629,6 @@ static int copier_set_sink_fmt(struct comp_dev *dev, const void *data, const struct ipc4_copier_config_set_sink_format *sink_fmt = data; struct processing_module *mod = comp_get_drvdata(dev); struct copier_data *cd = module_get_private_data(mod); - struct comp_buffer *sink_c; struct list_item *sink_list; struct comp_buffer *sink; @@ -683,16 +665,12 @@ static int copier_set_sink_fmt(struct comp_dev *dev, const void *data, int sink_id; sink = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - sink_id = IPC4_SINK_QUEUE_ID(sink_c->id); + sink_id = IPC4_SINK_QUEUE_ID(sink->id); if (sink_id == sink_fmt->sink_id) { - ipc4_update_buffer_format(sink_c, &sink_fmt->sink_fmt); - buffer_release(sink_c); + ipc4_update_buffer_format(sink, &sink_fmt->sink_fmt); break; } - - buffer_release(sink_c); } return 0; diff --git a/src/audio/copier/copier_dai.c b/src/audio/copier/copier_dai.c index d5996848bdcd..8704d3aacb59 100644 --- a/src/audio/copier/copier_dai.c +++ b/src/audio/copier/copier_dai.c @@ -395,7 +395,6 @@ static int copy_single_channel_c32(const struct audio_stream *src, int copier_dai_params(struct copier_data *cd, struct comp_dev *dev, struct sof_ipc_stream_params *params, int dai_index) { - struct comp_buffer *buf_c; struct sof_ipc_stream_params demuxed_params = *params; const struct ipc4_audio_format *in_fmt = &cd->config.base.audio_fmt; const struct ipc4_audio_format *out_fmt = &cd->config.out_fmt; @@ -438,15 +437,11 @@ int copier_dai_params(struct copier_data *cd, struct comp_dev *dev, if (ret < 0) return ret; - buf_c = buffer_acquire(cd->dd[dai_index]->dma_buffer); for (j = 0; j < SOF_IPC_MAX_CHANNELS; j++) - buf_c->chmap[j] = (cd->chan_map[dai_index] >> j * 4) & 0xf; - buffer_release(buf_c); + cd->dd[dai_index]->dma_buffer->chmap[j] = (cd->chan_map[dai_index] >> j * 4) & 0xf; /* set channel copy func */ - buf_c = buffer_acquire(cd->multi_endpoint_buffer); - container_size = audio_stream_sample_bytes(&buf_c->stream); - buffer_release(buf_c); + container_size = audio_stream_sample_bytes(&cd->multi_endpoint_buffer->stream); switch (container_size) { case 2: diff --git a/src/audio/copier/copier_generic.c b/src/audio/copier/copier_generic.c index 67c0e23af636..e8ac1e111510 100644 --- a/src/audio/copier/copier_generic.c +++ b/src/audio/copier/copier_generic.c @@ -62,7 +62,6 @@ void copier_update_params(struct copier_data *cd, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *sink, *source; - struct comp_buffer *sink_c, *source_c; struct list_item *sink_list; memset(params, 0, sizeof(*params)); @@ -85,13 +84,10 @@ void copier_update_params(struct copier_data *cd, struct comp_dev *dev, int j; sink = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - j = IPC4_SINK_QUEUE_ID(sink_c->id); + j = IPC4_SINK_QUEUE_ID(sink->id); - ipc4_update_buffer_format(sink_c, &cd->out_fmt[j]); - - buffer_release(sink_c); + ipc4_update_buffer_format(sink, &cd->out_fmt[j]); } /* @@ -102,12 +98,9 @@ void copier_update_params(struct copier_data *cd, struct comp_dev *dev, struct ipc4_audio_format *in_fmt; source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); in_fmt = &cd->config.base.audio_fmt; - ipc4_update_buffer_format(source_c, in_fmt); - - buffer_release(source_c); + ipc4_update_buffer_format(source, in_fmt); } /* update params for the DMA buffer */ @@ -140,7 +133,6 @@ int create_endpoint_buffer(struct comp_dev *dev, enum sof_ipc_frame valid_fmt; struct sof_ipc_buffer ipc_buf; struct comp_buffer *buffer; - struct comp_buffer *buffer_c; uint32_t buf_size; uint32_t chan_map; int i; @@ -209,19 +201,17 @@ int create_endpoint_buffer(struct comp_dev *dev, if (!buffer) return -ENOMEM; - buffer_c = buffer_acquire(buffer); - audio_stream_set_channels(&buffer_c->stream, copier_cfg->base.audio_fmt.channels_count); - audio_stream_set_rate(&buffer_c->stream, copier_cfg->base.audio_fmt.sampling_frequency); - audio_stream_set_frm_fmt(&buffer_c->stream, config->frame_fmt); - audio_stream_set_valid_fmt(&buffer_c->stream, valid_fmt); - audio_stream_set_buffer_fmt(&buffer_c->stream, + audio_stream_set_channels(&buffer->stream, copier_cfg->base.audio_fmt.channels_count); + audio_stream_set_rate(&buffer->stream, copier_cfg->base.audio_fmt.sampling_frequency); + audio_stream_set_frm_fmt(&buffer->stream, config->frame_fmt); + audio_stream_set_valid_fmt(&buffer->stream, valid_fmt); + audio_stream_set_buffer_fmt(&buffer->stream, copier_cfg->base.audio_fmt.interleaving_style); for (i = 0; i < SOF_IPC_MAX_CHANNELS; i++) - buffer_c->chmap[i] = (chan_map >> i * 4) & 0xf; + buffer->chmap[i] = (chan_map >> i * 4) & 0xf; - buffer_c->hw_params_configured = true; - buffer_release(buffer_c); + buffer->hw_params_configured = true; if (create_multi_endpoint_buffer) cd->multi_endpoint_buffer = buffer; diff --git a/src/audio/copier/copier_host.c b/src/audio/copier/copier_host.c index ab4c2e422c9e..30eda757bf80 100644 --- a/src/audio/copier/copier_host.c +++ b/src/audio/copier/copier_host.c @@ -246,7 +246,6 @@ void copier_host_dma_cb(struct comp_dev *dev, size_t bytes) { struct processing_module *mod = comp_get_drvdata(dev); struct copier_data *cd = module_get_private_data(mod); - struct comp_buffer *sink, *source; int ret, frames; comp_dbg(dev, "copier_host_dma_cb() %p", dev); @@ -263,18 +262,13 @@ void copier_host_dma_cb(struct comp_dev *dev, size_t bytes) * playback scenario. */ if (cd->attenuation && dev->direction == SOF_IPC_STREAM_PLAYBACK) { - source = buffer_acquire(cd->hd->dma_buffer); - sink = buffer_acquire(cd->hd->local_buffer); - frames = bytes / audio_stream_frame_bytes(&source->stream); + frames = bytes / audio_stream_frame_bytes(&cd->hd->dma_buffer->stream); - ret = apply_attenuation(dev, cd, sink, frames); + ret = apply_attenuation(dev, cd, cd->hd->local_buffer, frames); if (ret < 0) comp_dbg(dev, "copier_host_dma_cb() apply attenuation failed! %d", ret); - buffer_stream_writeback(sink, bytes); - - buffer_release(source); - buffer_release(sink); + buffer_stream_writeback(cd->hd->local_buffer, bytes); } } diff --git a/src/audio/copier/copier_ipcgtw.c b/src/audio/copier/copier_ipcgtw.c index 642a934bbfe8..ed3350042ff7 100644 --- a/src/audio/copier/copier_ipcgtw.c +++ b/src/audio/copier/copier_ipcgtw.c @@ -93,7 +93,6 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd, const struct ipc4_ipc_gateway_cmd_data *in; struct comp_dev *dev; struct comp_buffer *buf; - struct comp_buffer *buf_c; uint32_t data_size; struct ipc4_ipc_gateway_cmd_data_reply *out; @@ -110,15 +109,12 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd, buf = get_buffer(dev); - if (buf) { - buf_c = buffer_acquire(buf); - } else { + if (!buf) { /* NOTE: this func is called from IPC processing task and can be potentially * called before pipeline start even before buffer has been attached. In such * case do not report error but return 0 bytes available for GET_DATA and * 0 bytes free for SET_DATA. */ - buf_c = NULL; comp_warn(dev, "copier_ipcgtw_process(): no buffer found"); } @@ -126,13 +122,13 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd, switch (cmd->primary.r.cmd) { case IPC4_IPCGWCMD_GET_DATA: - if (buf_c) { + if (buf) { data_size = MIN(cmd->extension.r.data_size, SOF_IPC_MSG_MAX_SIZE - 4); - data_size = MIN(data_size, audio_stream_get_avail_bytes(&buf_c->stream)); - buffer_stream_invalidate(buf_c, data_size); - audio_stream_copy_bytes_to_linear(&buf_c->stream, out->payload, data_size); - comp_update_buffer_consume(buf_c, data_size); - out->u.size_avail = audio_stream_get_avail_bytes(&buf_c->stream); + data_size = MIN(data_size, audio_stream_get_avail_bytes(&buf->stream)); + buffer_stream_invalidate(buf, data_size); + audio_stream_copy_bytes_to_linear(&buf->stream, out->payload, data_size); + comp_update_buffer_consume(buf, data_size); + out->u.size_avail = audio_stream_get_avail_bytes(&buf->stream); *reply_payload_size = data_size + 4; } else { out->u.size_avail = 0; @@ -141,18 +137,18 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd, break; case IPC4_IPCGWCMD_SET_DATA: - if (buf_c) { + if (buf) { data_size = MIN(cmd->extension.r.data_size, - audio_stream_get_free_bytes(&buf_c->stream)); + audio_stream_get_free_bytes(&buf->stream)); dcache_invalidate_region((__sparse_force void __sparse_cache *) MAILBOX_HOSTBOX_BASE, data_size + offsetof(struct ipc4_ipc_gateway_cmd_data, payload)); - audio_stream_copy_bytes_from_linear(in->payload, &buf_c->stream, + audio_stream_copy_bytes_from_linear(in->payload, &buf->stream, data_size); - buffer_stream_writeback(buf_c, data_size); - comp_update_buffer_produce(buf_c, data_size); + buffer_stream_writeback(buf, data_size); + comp_update_buffer_produce(buf, data_size); out->u.size_consumed = data_size; *reply_payload_size = 4; } else { @@ -163,20 +159,16 @@ int copier_ipcgtw_process(const struct ipc4_ipcgtw_cmd *cmd, case IPC4_IPCGWCMD_FLUSH_DATA: *reply_payload_size = 0; - if (buf_c) - audio_stream_reset(&buf_c->stream); + if (buf) + audio_stream_reset(&buf->stream); break; default: comp_err(dev, "copier_ipcgtw_process(): unexpected cmd: %u", (unsigned int)cmd->primary.r.cmd); - if (buf_c) - buffer_release(buf_c); return -EINVAL; } - if (buf_c) - buffer_release(buf_c); return 0; } @@ -184,7 +176,6 @@ int copier_ipcgtw_params(struct ipcgtw_data *ipcgtw_data, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *buf; - struct comp_buffer *buf_c; int err; comp_dbg(dev, "ipcgtw_params()"); @@ -196,9 +187,7 @@ int copier_ipcgtw_params(struct ipcgtw_data *ipcgtw_data, struct comp_dev *dev, } /* resize buffer to size specified in IPC gateway config blob */ - buf_c = buffer_acquire(buf); - err = buffer_set_size(buf_c, ipcgtw_data->buf_size, 0); - buffer_release(buf_c); + err = buffer_set_size(buf, ipcgtw_data->buf_size, 0); if (err < 0) { comp_err(dev, "ipcgtw_params(): failed to resize buffer to %u bytes", @@ -214,10 +203,7 @@ void copier_ipcgtw_reset(struct comp_dev *dev) struct comp_buffer *buf = get_buffer(dev); if (buf) { - struct comp_buffer *buf_c = buffer_acquire(buf); - - audio_stream_reset(&buf_c->stream); - buffer_release(buf_c); + audio_stream_reset(&buf->stream); } else { comp_warn(dev, "ipcgtw_reset(): no buffer found"); } From f87fa4d6fa4f6119d7cb991eac38fb97b771f173 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:49:49 +0200 Subject: [PATCH 405/639] mixin/mixout: remove buffer_acquire from mixin/mixout remove buffer ops from mixin/mixout module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/mixin_mixout/mixin_mixout.c | 64 +++++++++------------------ 1 file changed, 20 insertions(+), 44 deletions(-) diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index ba68e96a56c1..3aba8583c8e4 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -281,12 +281,11 @@ static int mixin_process(struct processing_module *mod, struct mixout_data *mixout_data; struct processing_module *mixout_mod; struct module_source_info __sparse_cache *mod_source_info; - struct comp_buffer *sink_c; uint32_t free_frames, pending_frames; /* unused buffer between mixin and mixout */ - unused_in_between_buf_c = container_of(output_buffers[i].data, struct comp_buffer, - stream); + unused_in_between_buf_c = container_of(output_buffers[i].data, + struct comp_buffer, stream); mixout = unused_in_between_buf_c->sink; sink_id = IPC4_SRC_QUEUE_ID(unused_in_between_buf_c->id); @@ -305,20 +304,17 @@ static int mixin_process(struct processing_module *mod, return -EINVAL; } - sink_c = buffer_acquire(sink); - /* Normally this should never happen as we checked above * that mixout is in active state and so its sink buffer * should be already initialized in mixout .params(). */ - if (!sink_c->hw_params_configured) { + if (!sink->hw_params_configured) { comp_err(dev, "Uninitialized mixout sink buffer!"); - buffer_release(sink_c); module_source_info_release(mod_source_info); return -EINVAL; } - free_frames = audio_stream_get_free_frames(&sink_c->stream); + free_frames = audio_stream_get_free_frames(&sink->stream); /* mixout sink buffer may still have not yet produced data -- data * consumed and written there by mixin on previous mixin_process() run. @@ -328,7 +324,6 @@ static int mixin_process(struct processing_module *mod, assert(free_frames >= pending_frames); sinks_free_frames = MIN(sinks_free_frames, free_frames - pending_frames); - buffer_release(sink_c); module_source_info_release(mod_source_info); } @@ -361,7 +356,6 @@ static int mixin_process(struct processing_module *mod, struct module_source_info __sparse_cache *mod_source_info; struct processing_module *mixout_mod; uint32_t start_frame; - struct comp_buffer *sink_c; uint32_t writeback_size; mixout = active_mixouts[i]; @@ -383,25 +377,22 @@ static int mixin_process(struct processing_module *mod, */ start_frame = mixout_data->pending_frames[source_index]; - sink_c = buffer_acquire(sink); - /* if source does not produce any data but mixin is in active state -- generate * silence instead of that source data */ if (source_avail_frames == 0) { /* generate silence */ - silence(&sink_c->stream, start_frame, mixout_data->mixed_frames, + silence(&sink->stream, start_frame, mixout_data->mixed_frames, frames_to_copy); } else { /* basically, if sink buffer has no data -- copy source data there, if * sink buffer has some data (written by another mixin) mix that data * with source data. */ - ret = mix_and_remap(dev, mixin_data, sinks_ids[i], &sink_c->stream, + ret = mix_and_remap(dev, mixin_data, sinks_ids[i], &sink->stream, start_frame, mixout_data->mixed_frames, input_buffers[0].data, frames_to_copy); if (ret < 0) { - buffer_release(sink_c); module_source_info_release(mod_source_info); return ret; } @@ -411,11 +402,10 @@ static int mixin_process(struct processing_module *mod, * of frames_to_copy size (converted to bytes, of course). However, seems * there is no appropreate API. Anyway, start_frame would be 0 most of the time. */ - writeback_size = audio_stream_period_bytes(&sink_c->stream, + writeback_size = audio_stream_period_bytes(&sink->stream, frames_to_copy + start_frame); if (writeback_size > 0) - buffer_stream_writeback(sink_c, writeback_size); - buffer_release(sink_c); + buffer_stream_writeback(sink, writeback_size); mixout_data->pending_frames[source_index] += frames_to_copy; @@ -543,15 +533,12 @@ static int mixout_reset(struct processing_module *mod) if (dev->pipeline->source_comp->direction == SOF_IPC_STREAM_PLAYBACK) { list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source; - struct comp_buffer *source_c; bool stop; /* FIXME: this is racy and implicitly protected by serialised IPCs */ source = container_of(blist, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - stop = (dev->pipeline == source_c->source->pipeline && - source_c->source->state > COMP_STATE_PAUSED); - buffer_release(source_c); + stop = (dev->pipeline == source->source->pipeline && + source->source->state > COMP_STATE_PAUSED); if (stop) /* should not reset the downstream components */ @@ -580,28 +567,25 @@ static int mixin_params(struct processing_module *mod) */ list_for_item(blist, &dev->bsink_list) { struct comp_buffer *sink; - struct comp_buffer *sink_c; enum sof_ipc_frame frame_fmt, valid_fmt; uint16_t sink_id; sink = buffer_from_list(blist, PPL_DIR_DOWNSTREAM); - sink_c = buffer_acquire(sink); - audio_stream_set_channels(&sink_c->stream, + audio_stream_set_channels(&sink->stream, mod->priv.cfg.base_cfg.audio_fmt.channels_count); /* Applying channel remapping may produce sink stream with channel count * different from source channel count. */ - sink_id = IPC4_SRC_QUEUE_ID(sink_c->id); + sink_id = IPC4_SRC_QUEUE_ID(sink->id); if (sink_id >= MIXIN_MAX_SINKS) { comp_err(dev, "Sink index out of range: %u, max sink count: %u", (uint32_t)sink_id, MIXIN_MAX_SINKS); - buffer_release(sink_c); return -EINVAL; } if (md->sink_config[sink_id].mixer_mode == IPC4_MIXER_CHANNEL_REMAPPING_MODE) - audio_stream_set_channels(&sink_c->stream, + audio_stream_set_channels(&sink->stream, md->sink_config[sink_id].output_channel_count); /* comp_verify_params() does not modify valid_sample_fmt (a BUG?), @@ -612,10 +596,8 @@ static int mixin_params(struct processing_module *mod) &frame_fmt, &valid_fmt, mod->priv.cfg.base_cfg.audio_fmt.s_type); - audio_stream_set_frm_fmt(&sink_c->stream, frame_fmt); - audio_stream_set_valid_fmt(&sink_c->stream, valid_fmt); - - buffer_release(sink_c); + audio_stream_set_frm_fmt(&sink->stream, frame_fmt); + audio_stream_set_valid_fmt(&sink->stream, valid_fmt); } /* use BUFF_PARAMS_CHANNELS to skip updating channel count */ @@ -643,7 +625,6 @@ static int mixin_prepare(struct processing_module *mod, struct mixin_data *md = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *sink; - struct comp_buffer *sink_c; enum sof_ipc_frame fmt; int ret; @@ -654,9 +635,7 @@ static int mixin_prepare(struct processing_module *mod, return ret; sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - fmt = audio_stream_get_valid_fmt(&sink_c->stream); - buffer_release(sink_c); + fmt = audio_stream_get_valid_fmt(&sink->stream); /* currently inactive so setup mixer */ switch (fmt) { @@ -683,7 +662,6 @@ static int mixout_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; struct comp_buffer *sink; - struct comp_buffer *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame frame_fmt, valid_fmt; uint32_t sink_period_bytes, sink_stream_size; @@ -700,7 +678,6 @@ static int mixout_params(struct processing_module *mod) } sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); /* comp_verify_params() does not modify valid_sample_fmt (a BUG?), let's do this here */ audio_stream_fmt_conversion(mod->priv.cfg.base_cfg.audio_fmt.depth, @@ -708,15 +685,14 @@ static int mixout_params(struct processing_module *mod) &frame_fmt, &valid_fmt, mod->priv.cfg.base_cfg.audio_fmt.s_type); - audio_stream_set_valid_fmt(&sink_c->stream, valid_fmt); - audio_stream_set_channels(&sink_c->stream, params->channels); + audio_stream_set_valid_fmt(&sink->stream, valid_fmt); + audio_stream_set_channels(&sink->stream, params->channels); - sink_stream_size = audio_stream_get_size(&sink_c->stream); + sink_stream_size = audio_stream_get_size(&sink->stream); /* calculate period size based on config */ - sink_period_bytes = audio_stream_period_bytes(&sink_c->stream, + sink_period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames); - buffer_release(sink_c); if (sink_period_bytes == 0) { comp_err(dev, "mixout_params(): period_bytes = 0"); From a0256007e6a60d46691641a3a613fe6a2da0277b Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:00:40 +0200 Subject: [PATCH 406/639] mixer: remove buffer_acquire from mixer remove buffer ops from mixer modules this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/mixer/mixer.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/audio/mixer/mixer.c b/src/audio/mixer/mixer.c index 740f31e142aa..fce964f4da1b 100644 --- a/src/audio/mixer/mixer.c +++ b/src/audio/mixer/mixer.c @@ -174,13 +174,11 @@ static int mixer_reset(struct processing_module *mod) /* FIXME: this is racy and implicitly protected by serialised IPCs */ struct comp_buffer *source = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer *source_c = buffer_acquire(source); bool stop = false; - if (source_c->source && source_c->source->state > COMP_STATE_READY) + if (source->source && source->source->state > COMP_STATE_READY) stop = true; - buffer_release(source_c); /* only mix the sources with the same state with mixer */ if (stop) /* should not reset the downstream components */ @@ -224,22 +222,18 @@ static int mixer_prepare(struct processing_module *mod, struct sof_sink **sinks, int num_of_sinks) { struct mixer_data *md = module_get_private_data(mod); - struct comp_buffer *sink_c; struct comp_dev *dev = mod->dev; struct comp_buffer *sink; struct list_item *blist; sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - md->mix_func = mixer_get_processing_function(dev, sink_c); - mixer_set_frame_alignment(&sink_c->stream); - buffer_release(sink_c); + md->mix_func = mixer_get_processing_function(dev, sink); + mixer_set_frame_alignment(&sink->stream); /* check each mixer source state */ list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source; - struct comp_buffer *source_c; bool stop; /* @@ -251,11 +245,9 @@ static int mixer_prepare(struct processing_module *mod, * done. */ source = container_of(blist, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - mixer_set_frame_alignment(&source_c->stream); - stop = source_c->source && (source_c->source->state == COMP_STATE_PAUSED || - source_c->source->state == COMP_STATE_ACTIVE); - buffer_release(source_c); + mixer_set_frame_alignment(&source->stream); + stop = source->source && (source->source->state == COMP_STATE_PAUSED || + source->source->state == COMP_STATE_ACTIVE); /* only prepare downstream if we have no active sources */ if (stop) From 08c6b7992e0f51de356a47d68c05271a14ac536b Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:08:53 +0200 Subject: [PATCH 407/639] smart_amp: remove buffer_acquire from smart_amp remove buffer ops from smart_amp module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/smart_amp/smart_amp.c | 60 +++++++++++---------------------- 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/src/audio/smart_amp/smart_amp.c b/src/audio/smart_amp/smart_amp.c index 351db6cbf9c6..931acc6ce1be 100644 --- a/src/audio/smart_amp/smart_amp.c +++ b/src/audio/smart_amp/smart_amp.c @@ -518,9 +518,7 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) case COMP_TRIGGER_START: case COMP_TRIGGER_RELEASE: if (sad->feedback_buf) { - struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); - buffer_zero(buf); - buffer_release(buf); + buffer_zero(sad->feedback_buf); } break; case COMP_TRIGGER_PAUSE: @@ -558,10 +556,7 @@ static int smart_amp_process(struct comp_dev *dev, static smart_amp_proc get_smart_amp_process(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer *source_buf = buffer_acquire(sad->source_buf); - enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&source_buf->stream); - - buffer_release(source_buf); + enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sad->source_buf->stream); switch (fmt) { case SOF_IPC_FRAME_S16_LE: @@ -577,8 +572,8 @@ static smart_amp_proc get_smart_amp_process(struct comp_dev *dev) static int smart_amp_copy(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer *source_buf = buffer_acquire(sad->source_buf); - struct comp_buffer *sink_buf = buffer_acquire(sad->sink_buf); + struct comp_buffer *source_buf = sad->source_buf; + struct comp_buffer *sink_buf = sad->sink_buf; uint32_t avail_passthrough_frames; uint32_t avail_feedback_frames; uint32_t avail_frames; @@ -595,7 +590,7 @@ static int smart_amp_copy(struct comp_dev *dev) avail_frames = avail_passthrough_frames; if (sad->feedback_buf) { - struct comp_buffer *feedback_buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *feedback_buf = sad->feedback_buf; if (comp_get_state(dev, feedback_buf->source) == dev->state) { /* feedback */ @@ -619,8 +614,6 @@ static int smart_amp_copy(struct comp_dev *dev) comp_update_buffer_consume(feedback_buf, feedback_bytes); } - - buffer_release(feedback_buf); } /* bytes calculation */ @@ -637,9 +630,6 @@ static int smart_amp_copy(struct comp_dev *dev) comp_update_buffer_consume(source_buf, source_bytes); comp_update_buffer_produce(sink_buf, sink_bytes); - buffer_release(sink_buf); - buffer_release(source_buf); - return 0; } @@ -661,7 +651,6 @@ static int smart_amp_reset(struct comp_dev *dev) static int smart_amp_prepare(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer *source_c, *buf_c; struct list_item *blist; int ret; int bitwidth; @@ -676,45 +665,38 @@ static int smart_amp_prepare(struct comp_dev *dev) list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source_buffer = container_of(blist, struct comp_buffer, sink_list); - source_c = buffer_acquire(source_buffer); - if (source_c->source->ipc_config.type == SOF_COMP_DEMUX) { + if (source_buffer->source->ipc_config.type == SOF_COMP_DEMUX) { sad->feedback_buf = source_buffer; } else { sad->source_buf = source_buffer; - sad->in_channels = audio_stream_get_channels(&source_c->stream); + sad->in_channels = audio_stream_get_channels(&source_buffer->stream); } - - buffer_release(source_c); } sad->sink_buf = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - buf_c = buffer_acquire(sad->sink_buf); - sad->out_channels = audio_stream_get_channels(&buf_c->stream); - buffer_release(buf_c); - - source_c = buffer_acquire(sad->source_buf); + sad->out_channels = audio_stream_get_channels(&sad->sink_buf->stream); if (sad->feedback_buf) { - buf_c = buffer_acquire(sad->feedback_buf); - - audio_stream_set_channels(&buf_c->stream, sad->config.feedback_channels); - audio_stream_set_rate(&buf_c->stream, audio_stream_get_rate(&source_c->stream)); - buffer_release(buf_c); - - ret = smart_amp_check_audio_fmt(audio_stream_get_rate(&source_c->stream), - audio_stream_get_channels(&source_c->stream)); + audio_stream_set_channels(&sad->feedback_buf->stream, + sad->config.feedback_channels); + audio_stream_set_rate(&sad->feedback_buf->stream, + audio_stream_get_rate(&sad->source_buf->stream)); + + ret = smart_amp_check_audio_fmt(audio_stream_get_rate(&sad->source_buf->stream), + audio_stream_get_channels + (&sad->source_buf->stream)); if (ret) { comp_err(dev, "[DSM] Format not supported, sample rate: %d, ch: %d", - audio_stream_get_rate(&source_c->stream), - audio_stream_get_channels(&source_c->stream)); + audio_stream_get_rate(&sad->source_buf->stream), + audio_stream_get_channels(&sad->source_buf->stream)); goto error; } } - switch (audio_stream_get_frm_fmt(&source_c->stream)) { + switch (audio_stream_get_frm_fmt(&sad->source_buf->stream)) { case SOF_IPC_FRAME_S16_LE: bitwidth = 16; break; @@ -726,7 +708,7 @@ static int smart_amp_prepare(struct comp_dev *dev) break; default: comp_err(dev, "[DSM] smart_amp_process() error: not supported frame format %d", - audio_stream_get_frm_fmt(&source_c->stream)); + audio_stream_get_frm_fmt(&sad->source_buf->stream)); goto error; } @@ -751,8 +733,6 @@ static int smart_amp_prepare(struct comp_dev *dev) } error: - buffer_release(source_c); - smart_amp_flush(sad->mod_handle, dev); return ret; } From 9d0f0aad143be4795ca6f7a17c642159297fb8b9 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:42:07 +0200 Subject: [PATCH 408/639] aria: remove buffer_acquire from aria remove buffer ops from aria module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/aria/aria.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/audio/aria/aria.c b/src/audio/aria/aria.c index 0b2b6b763c42..9ca1626e644d 100644 --- a/src/audio/aria/aria.c +++ b/src/audio/aria/aria.c @@ -153,19 +153,14 @@ static int aria_free(struct processing_module *mod) static void aria_set_stream_params(struct comp_buffer *buffer, struct processing_module *mod) { - struct comp_buffer *buffer_c; const struct ipc4_audio_format *audio_fmt = &mod->priv.cfg.base_cfg.audio_fmt; - buffer_c = buffer_acquire(buffer); - - ipc4_update_buffer_format(buffer_c, audio_fmt); + ipc4_update_buffer_format(buffer, audio_fmt); #ifdef ARIA_GENERIC - audio_stream_init_alignment_constants(1, 1, &buffer_c->stream); + audio_stream_init_alignment_constants(1, 1, &buffer->stream); #else - audio_stream_init_alignment_constants(8, 1, &buffer_c->stream); + audio_stream_init_alignment_constants(8, 1, &buffer->stream); #endif - - buffer_release(buffer_c); } static int aria_prepare(struct processing_module *mod, From 4f42a65b66493a2bbb5a439ea92baf64e623e5d5 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:43:42 +0200 Subject: [PATCH 409/639] asrc: remove buffer_acquire from asrc remove buffer ops from asrc module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/asrc/asrc.c | 72 +++++++++++++------------------------------ 1 file changed, 22 insertions(+), 50 deletions(-) diff --git a/src/audio/asrc/asrc.c b/src/audio/asrc/asrc.c index ef8e41ee87a4..fae2cc1f08b9 100644 --- a/src/audio/asrc/asrc.c +++ b/src/audio/asrc/asrc.c @@ -534,7 +534,6 @@ static int asrc_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; int err; comp_info(dev, "asrc_params()"); @@ -554,25 +553,19 @@ static int asrc_params(struct comp_dev *dev, sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - #if CONFIG_IPC_MAJOR_4 /* update the source/sink buffer formats. Sink rate will be modified below */ - ipc4_update_buffer_format(source_c, &cd->ipc_config.base.audio_fmt); - ipc4_update_buffer_format(sink_c, &cd->ipc_config.base.audio_fmt); + ipc4_update_buffer_format(sourceb, &cd->ipc_config.base.audio_fmt); + ipc4_update_buffer_format(sinkb, &cd->ipc_config.base.audio_fmt); #endif /* Don't change sink rate if value from IPC is 0 (auto detect) */ if (asrc_get_sink_rate(&cd->ipc_config)) - audio_stream_set_rate(&sink_c->stream, asrc_get_sink_rate(&cd->ipc_config)); + audio_stream_set_rate(&sinkb->stream, asrc_get_sink_rate(&cd->ipc_config)); /* set source/sink_frames/rate */ - cd->source_rate = audio_stream_get_rate(&source_c->stream); - cd->sink_rate = audio_stream_get_rate(&sink_c->stream); - - buffer_release(sink_c); - buffer_release(source_c); + cd->source_rate = audio_stream_get_rate(&sourceb->stream); + cd->sink_rate = audio_stream_get_rate(&sinkb->stream); if (!cd->sink_rate) { comp_err(dev, "asrc_params(), zero sink rate"); @@ -604,7 +597,6 @@ static int asrc_params(struct comp_dev *dev, static int asrc_dai_find(struct comp_dev *dev, struct comp_data *cd) { struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; int pid; /* Get current pipeline ID and walk to find the DAI */ @@ -615,9 +607,7 @@ static int asrc_dai_find(struct comp_dev *dev, struct comp_data *cd) do { sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - dev = sink_c->sink; - buffer_release(sink_c); + dev = sinkb->sink; if (!dev) { comp_cl_err(&comp_asrc, "At end, no DAI found."); @@ -635,9 +625,7 @@ static int asrc_dai_find(struct comp_dev *dev, struct comp_data *cd) do { sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - dev = source_c->source; - buffer_release(source_c); + dev = sourceb->source; if (!dev) { comp_cl_err(&comp_asrc, "At beginning, no DAI found."); @@ -725,7 +713,6 @@ static int asrc_prepare(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; uint32_t source_period_bytes; uint32_t sink_period_bytes; int sample_bytes; @@ -751,23 +738,20 @@ static int asrc_prepare(struct comp_dev *dev) sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - /* get source data format and period bytes */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); - source_period_bytes = audio_stream_period_bytes(&source_c->stream, + cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream); + source_period_bytes = audio_stream_period_bytes(&sourceb->stream, cd->source_frames); /* get sink data format and period bytes */ - cd->sink_format = audio_stream_get_frm_fmt(&sink_c->stream); - sink_period_bytes = audio_stream_period_bytes(&sink_c->stream, + cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream); + sink_period_bytes = audio_stream_period_bytes(&sinkb->stream, cd->sink_frames); - if (audio_stream_get_size(&sink_c->stream) < + if (audio_stream_get_size(&sinkb->stream) < dev->ipc_config.periods_sink * sink_period_bytes) { comp_err(dev, "asrc_prepare(): sink buffer size %d is insufficient < %d * %d", - audio_stream_get_size(&sink_c->stream), dev->ipc_config.periods_sink, + audio_stream_get_size(&sinkb->stream), dev->ipc_config.periods_sink, sink_period_bytes); ret = -ENOMEM; goto err; @@ -786,7 +770,7 @@ static int asrc_prepare(struct comp_dev *dev) } /* ASRC supports S16_LE, S24_4LE and S32_LE formats */ - switch (audio_stream_get_frm_fmt(&source_c->stream)) { + switch (audio_stream_get_frm_fmt(&sourceb->stream)) { case SOF_IPC_FRAME_S16_LE: cd->asrc_func = src_copy_s16; break; @@ -804,7 +788,7 @@ static int asrc_prepare(struct comp_dev *dev) } /* Allocate input and output data buffer for ASRC processing */ - frame_bytes = audio_stream_frame_bytes(&source_c->stream); + frame_bytes = audio_stream_frame_bytes(&sourceb->stream); cd->buf_size = (cd->source_frames_max + cd->sink_frames_max) * frame_bytes; @@ -818,8 +802,8 @@ static int asrc_prepare(struct comp_dev *dev) goto err; } - sample_bytes = frame_bytes / audio_stream_get_channels(&source_c->stream); - for (i = 0; i < audio_stream_get_channels(&source_c->stream); i++) { + sample_bytes = frame_bytes / audio_stream_get_channels(&sourceb->stream); + for (i = 0; i < audio_stream_get_channels(&sourceb->stream); i++) { cd->ibuf[i] = cd->buf + i * sample_bytes; cd->obuf[i] = cd->ibuf[i] + cd->source_frames_max * frame_bytes; } @@ -827,7 +811,7 @@ static int asrc_prepare(struct comp_dev *dev) /* Get required size and allocate memory for ASRC */ sample_bits = sample_bytes * 8; ret = asrc_get_required_size(dev, &cd->asrc_size, - audio_stream_get_channels(&source_c->stream), + audio_stream_get_channels(&sourceb->stream), sample_bits); if (ret) { comp_err(dev, "asrc_prepare(), get_required_size_bytes failed"); @@ -853,7 +837,7 @@ static int asrc_prepare(struct comp_dev *dev) fs_sec = cd->source_rate; } - ret = asrc_initialise(dev, cd->asrc_obj, audio_stream_get_channels(&source_c->stream), + ret = asrc_initialise(dev, cd->asrc_obj, audio_stream_get_channels(&sourceb->stream), fs_prim, fs_sec, ASRC_IOF_INTERLEAVED, ASRC_IOF_INTERLEAVED, ASRC_BM_LINEAR, cd->frames, sample_bits, @@ -889,9 +873,6 @@ static int asrc_prepare(struct comp_dev *dev) goto err_free_asrc; } - buffer_release(sink_c); - buffer_release(source_c); - return 0; err_free_asrc: @@ -904,8 +885,6 @@ static int asrc_prepare(struct comp_dev *dev) cd->buf = NULL; err: - buffer_release(sink_c); - buffer_release(source_c); comp_set_state(dev, COMP_TRIGGER_RESET); return ret; } @@ -1012,7 +991,6 @@ static int asrc_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *source, *sink; - struct comp_buffer *source_c, *sink_c; int frames_src; int frames_snk; int ret; @@ -1029,11 +1007,8 @@ static int asrc_copy(struct comp_dev *dev) sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(source); - sink_c = buffer_acquire(sink); - - frames_src = audio_stream_get_avail_frames(&source_c->stream); - frames_snk = audio_stream_get_free_frames(&sink_c->stream); + frames_src = audio_stream_get_avail_frames(&source->stream); + frames_snk = audio_stream_get_free_frames(&sink->stream); if (cd->mode == ASRC_OM_PULL) { /* Let ASRC access max number of source frames in pull mode. @@ -1059,10 +1034,7 @@ static int asrc_copy(struct comp_dev *dev) } if (cd->source_frames && cd->sink_frames) - asrc_process(dev, source_c, sink_c); - - buffer_release(sink_c); - buffer_release(source_c); + asrc_process(dev, source, sink); return 0; } From d7957df17e1239967303a3be66a760b08ce9c473 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:44:11 +0200 Subject: [PATCH 410/639] chain_dma: remove buffer_acquire from chain_dma remove buffer ops from chain_dma module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/chain_dma.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/audio/chain_dma.c b/src/audio/chain_dma.c index 41c28fa0c3e0..25cec633728a 100644 --- a/src/audio/chain_dma.c +++ b/src/audio/chain_dma.c @@ -238,12 +238,9 @@ static enum task_state chain_task_run(void *data) * mode task will update read position based on transferred data size to avoid * overwriting valid data and write position by half buffer size. */ - struct comp_buffer *buffer_c = buffer_acquire(cd->dma_buffer); - const size_t buff_size = audio_stream_get_size(&buffer_c->stream); + const size_t buff_size = audio_stream_get_size(&cd->dma_buffer->stream); const size_t half_buff_size = buff_size / 2; - buffer_release(buffer_c); - if (!cd->first_data_received && host_avail_bytes > half_buff_size) { ret = dma_reload(cd->chan_link->dma->z_dev, cd->chan_link->index, 0, 0, @@ -510,7 +507,6 @@ static int chain_task_init(struct comp_dev *dev, uint8_t host_dma_id, uint8_t li uint32_t fifo_size) { struct chain_dma_data *cd = comp_get_drvdata(dev); - struct comp_buffer *buffer_c; uint32_t addr_align; size_t buff_size; void *buff_addr; @@ -598,11 +594,9 @@ static int chain_task_init(struct comp_dev *dev, uint8_t host_dma_id, uint8_t li } /* clear dma buffer */ - buffer_c = buffer_acquire(cd->dma_buffer); - buffer_zero(buffer_c); - buff_addr = audio_stream_get_addr(&buffer_c->stream); - buff_size = audio_stream_get_size(&buffer_c->stream); - buffer_release(buffer_c); + buffer_zero(cd->dma_buffer); + buff_addr = audio_stream_get_addr(&cd->dma_buffer->stream); + buff_size = audio_stream_get_size(&cd->dma_buffer->stream); ret = chain_init(dev, buff_addr, buff_size); if (ret < 0) { From cd7e3d3e4006e9d975ecd399ab2e7e54104f6cfd Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:47:21 +0200 Subject: [PATCH 411/639] kpb: remove buffer_acquire from kpb remove buffer ops from kpb module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/kpb.c | 98 ++++++++++++++++++------------------------------- 1 file changed, 36 insertions(+), 62 deletions(-) diff --git a/src/audio/kpb.c b/src/audio/kpb.c index 2d52a35d7928..48bc6bd3eeec 100644 --- a/src/audio/kpb.c +++ b/src/audio/kpb.c @@ -350,17 +350,14 @@ static int kpb_bind(struct comp_dev *dev, void *data) list_for_item(blist, &dev->bsink_list) { struct comp_buffer *sink = container_of(blist, struct comp_buffer, source_list); - struct comp_buffer *sink_c = buffer_acquire(sink); int sink_buf_id; - if (!sink_c->sink) { + if (!sink->sink) { ret = -EINVAL; - buffer_release(sink_c); break; } - sink_buf_id = sink_c->id; - buffer_release(sink_c); + sink_buf_id = sink->id; if (sink_buf_id == buf_id) { if (sink_buf_id == 0) @@ -869,17 +866,13 @@ static int kpb_prepare(struct comp_dev *dev) list_for_item(blist, &dev->bsink_list) { struct comp_buffer *sink = container_of(blist, struct comp_buffer, source_list); - struct comp_buffer *sink_c = buffer_acquire(sink); enum sof_comp_type type; - if (!sink_c->sink) { + if (!sink->sink) { ret = -EINVAL; - buffer_release(sink_c); break; } - - type = dev_comp_type(sink_c->sink); - buffer_release(sink_c); + type = dev_comp_type(sink->sink); switch (type) { case SOF_COMP_SELECTOR: @@ -907,18 +900,15 @@ static int kpb_prepare(struct comp_dev *dev) list_for_item(sink_list, &dev->bsink_list) { struct comp_buffer *sink = container_of(sink_list, struct comp_buffer, source_list); - struct comp_buffer *sink_c = buffer_acquire(sink); audio_stream_init_alignment_constants(byte_align, frame_align_req, - &sink_c->stream); - sink_id = sink_c->id; + &sink->stream); + sink_id = sink->id; if (sink_id == 0) - audio_stream_set_channels(&sink_c->stream, kpb->num_of_sel_mic); + audio_stream_set_channels(&sink->stream, kpb->num_of_sel_mic); else - audio_stream_set_channels(&sink_c->stream, kpb->config.channels); - - buffer_release(sink_c); + audio_stream_set_channels(&sink->stream, kpb->config.channels); } } #endif /* CONFIG_IPC_MAJOR_4 */ @@ -1188,7 +1178,6 @@ static int kpb_copy(struct comp_dev *dev) int ret = 0; struct comp_data *kpb = comp_get_drvdata(dev); struct comp_buffer *source, *sink; - struct comp_buffer *source_c, *sink_c = NULL; size_t copy_bytes = 0, produced_bytes = 0; size_t sample_width = kpb->config.sampling_width; struct draining_data *dd = &kpb->draining_task_data; @@ -1206,13 +1195,11 @@ static int kpb_copy(struct comp_dev *dev) source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - /* Validate source */ - if (!audio_stream_get_rptr(&source_c->stream)) { + if (!audio_stream_get_rptr(&source->stream)) { comp_err(dev, "kpb_copy(): invalid source pointers."); ret = -EINVAL; - goto out; + return ret; } switch (kpb->state) { @@ -1227,29 +1214,27 @@ static int kpb_copy(struct comp_dev *dev) break; } - sink_c = buffer_acquire(sink); - /* Validate sink */ - if (!audio_stream_get_wptr(&sink_c->stream)) { + if (!audio_stream_get_wptr(&sink->stream)) { comp_err(dev, "kpb_copy(): invalid selector sink pointers."); ret = -EINVAL; break; } - copy_bytes = audio_stream_get_copy_bytes(&source_c->stream, &sink_c->stream); + copy_bytes = audio_stream_get_copy_bytes(&source->stream, &sink->stream); if (!copy_bytes) { comp_err(dev, "kpb_copy(): nothing to copy sink->free %d source->avail %d", - audio_stream_get_free_bytes(&sink_c->stream), - audio_stream_get_avail_bytes(&source_c->stream)); + audio_stream_get_free_bytes(&sink->stream), + audio_stream_get_avail_bytes(&source->stream)); ret = PPL_STATUS_PATH_STOP; break; } if (kpb->num_of_sel_mic == 0) { - kpb_copy_samples(sink_c, source_c, copy_bytes, sample_width, channels); + kpb_copy_samples(sink, source, copy_bytes, sample_width, channels); } else { - uint32_t avail = audio_stream_get_avail_bytes(&source_c->stream); - uint32_t free = audio_stream_get_free_bytes(&sink_c->stream); + uint32_t avail = audio_stream_get_avail_bytes(&source->stream); + uint32_t free = audio_stream_get_free_bytes(&sink->stream); copy_bytes = MIN(avail, free * channels / kpb->num_of_sel_mic); copy_bytes = ROUND_DOWN(copy_bytes, (sample_width >> 3) * channels); @@ -1265,13 +1250,13 @@ static int kpb_copy(struct comp_dev *dev) ret = PPL_STATUS_PATH_STOP; break; } - kpb_micselect_copy(dev, sink_c, source_c, produced_bytes, channels); + kpb_micselect_copy(dev, sink, source, produced_bytes, channels); } /* Buffer source data internally in history buffer for future * use by clients. */ if (copy_bytes <= kpb->hd.buffer_size) { - ret = kpb_buffer_data(dev, source_c, copy_bytes); + ret = kpb_buffer_data(dev, source, copy_bytes); if (ret) { comp_err(dev, "kpb_copy(): internal buffering failed."); @@ -1290,11 +1275,11 @@ static int kpb_copy(struct comp_dev *dev) } if (kpb->num_of_sel_mic == 0) - comp_update_buffer_produce(sink_c, copy_bytes); + comp_update_buffer_produce(sink, copy_bytes); else - comp_update_buffer_produce(sink_c, produced_bytes); + comp_update_buffer_produce(sink, produced_bytes); - comp_update_buffer_consume(source_c, copy_bytes); + comp_update_buffer_consume(source, copy_bytes); break; case KPB_STATE_HOST_COPY: @@ -1307,20 +1292,18 @@ static int kpb_copy(struct comp_dev *dev) break; } - sink_c = buffer_acquire(sink); - /* Validate sink */ - if (!audio_stream_get_wptr(&sink_c->stream)) { + if (!audio_stream_get_wptr(&sink->stream)) { comp_err(dev, "kpb_copy(): invalid host sink pointers."); ret = -EINVAL; break; } - copy_bytes = audio_stream_get_copy_bytes(&source_c->stream, &sink_c->stream); + copy_bytes = audio_stream_get_copy_bytes(&source->stream, &sink->stream); if (!copy_bytes) { comp_err(dev, "kpb_copy(): nothing to copy sink->free %d source->avail %d", - audio_stream_get_free_bytes(&sink_c->stream), - audio_stream_get_avail_bytes(&source_c->stream)); + audio_stream_get_free_bytes(&sink->stream), + audio_stream_get_avail_bytes(&source->stream)); /* NOTE! We should stop further pipeline copy due to * no data availability however due to HW bug * (no HOST DMA IRQs) we need to call host copy @@ -1329,10 +1312,10 @@ static int kpb_copy(struct comp_dev *dev) break; } - kpb_copy_samples(sink_c, source_c, copy_bytes, sample_width, channels); + kpb_copy_samples(sink, source, copy_bytes, sample_width, channels); - comp_update_buffer_produce(sink_c, copy_bytes); - comp_update_buffer_consume(source_c, copy_bytes); + comp_update_buffer_produce(sink, copy_bytes); + comp_update_buffer_consume(source, copy_bytes); break; case KPB_STATE_INIT_DRAINING: @@ -1340,12 +1323,12 @@ static int kpb_copy(struct comp_dev *dev) /* In draining and init draining we only buffer data in * the internal history buffer. */ - avail_bytes = audio_stream_get_avail_bytes(&source_c->stream); + avail_bytes = audio_stream_get_avail_bytes(&source->stream); copy_bytes = MIN(avail_bytes, kpb->hd.free); ret = PPL_STATUS_PATH_STOP; if (copy_bytes) { - buffer_stream_invalidate(source_c, copy_bytes); - ret = kpb_buffer_data(dev, source_c, copy_bytes); + buffer_stream_invalidate(source, copy_bytes); + ret = kpb_buffer_data(dev, source, copy_bytes); dd->buffered_while_draining += copy_bytes; kpb->hd.free -= copy_bytes; @@ -1354,10 +1337,10 @@ static int kpb_copy(struct comp_dev *dev) break; } - comp_update_buffer_consume(source_c, copy_bytes); + comp_update_buffer_consume(source, copy_bytes); } else { comp_warn(dev, "kpb_copy(): buffering skipped (no data to copy, avail %d, free %d", - audio_stream_get_avail_bytes(&source_c->stream), + audio_stream_get_avail_bytes(&source->stream), kpb->hd.free); } @@ -1369,11 +1352,6 @@ static int kpb_copy(struct comp_dev *dev) break; } -out: - if (sink_c) - buffer_release(sink_c); - buffer_release(source_c); - return ret; } @@ -1750,7 +1728,7 @@ static void kpb_init_draining(struct comp_dev *dev, struct kpb_client *cli) static enum task_state kpb_draining_task(void *arg) { struct draining_data *draining_data = (struct draining_data *)arg; - struct comp_buffer *sink = buffer_acquire(draining_data->sink); + struct comp_buffer *sink = draining_data->sink; struct history_buffer *buff = draining_data->hb; size_t drain_req = draining_data->drain_req; size_t sample_width = draining_data->sample_width; @@ -1880,13 +1858,9 @@ static enum task_state kpb_draining_task(void *arg) out: draining_time_end = sof_cycle_get_64(); - buffer_release(sink); - /* Reset host-sink copy mode back to its pre-draining value */ - sink = buffer_acquire(kpb->host_sink); - comp_set_attribute(sink->sink, COMP_ATTR_COPY_TYPE, + comp_set_attribute(kpb->host_sink->sink, COMP_ATTR_COPY_TYPE, &kpb->draining_task_data.copy_type); - buffer_release(sink); draining_time_ms = k_cyc_to_ms_near64(draining_time_end - draining_time_start); if (draining_time_ms <= UINT_MAX) From 4f74ed70187e08daa0d56e05cdc07b940a287577 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:48:15 +0200 Subject: [PATCH 412/639] volume: remove buffer_acquire from volume remove buffer ops from volume module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/volume/volume.c | 23 +++++++---------------- src/audio/volume/volume_ipc3.c | 6 +----- src/audio/volume/volume_ipc4.c | 9 ++------- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index 37c6ad05040b..c71eacba168c 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -638,7 +638,6 @@ static int volume_prepare(struct processing_module *mod, struct module_data *md = &mod->priv; struct comp_dev *dev = mod->dev; struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; uint32_t sink_period_bytes; int ret; int i; @@ -653,20 +652,15 @@ static int volume_prepare(struct processing_module *mod, sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - sink_c = buffer_acquire(sinkb); - source_c = buffer_acquire(sourceb); - - volume_set_alignment(&source_c->stream, &sink_c->stream); - - buffer_release(source_c); + volume_set_alignment(&sourceb->stream, &sinkb->stream); /* get sink period bytes */ - sink_period_bytes = audio_stream_period_bytes(&sink_c->stream, + sink_period_bytes = audio_stream_period_bytes(&sinkb->stream, dev->frames); - if (audio_stream_get_size(&sink_c->stream) < sink_period_bytes) { + if (audio_stream_get_size(&sinkb->stream) < sink_period_bytes) { comp_err(dev, "volume_prepare(): sink buffer size %d is insufficient < %d", - audio_stream_get_size(&sink_c->stream), sink_period_bytes); + audio_stream_get_size(&sinkb->stream), sink_period_bytes); ret = -ENOMEM; goto err; } @@ -680,7 +674,7 @@ static int volume_prepare(struct processing_module *mod, goto err; } - cd->zc_get = vol_get_zc_function(dev, sink_c); + cd->zc_get = vol_get_zc_function(dev, sinkb); if (!cd->zc_get) { comp_err(dev, "volume_prepare(): invalid cd->zc_get"); ret = -EINVAL; @@ -695,16 +689,14 @@ static int volume_prepare(struct processing_module *mod, */ cd->ramp_finished = false; - cd->channels = audio_stream_get_channels(&sink_c->stream); + cd->channels = audio_stream_get_channels(&sinkb->stream); if (cd->channels > SOF_IPC_MAX_CHANNELS) { ret = -EINVAL; goto err; } cd->sample_rate_inv = (int32_t)(1000LL * INT32_MAX / - audio_stream_get_rate(&sink_c->stream)); - - buffer_release(sink_c); + audio_stream_get_rate(&sinkb->stream)); for (i = 0; i < cd->channels; i++) { cd->volume[i] = cd->vol_min; @@ -725,7 +717,6 @@ static int volume_prepare(struct processing_module *mod, return 0; err: - buffer_release(sink_c); comp_set_state(dev, COMP_TRIGGER_RESET); return ret; } diff --git a/src/audio/volume/volume_ipc3.c b/src/audio/volume/volume_ipc3.c index 3881c4ae7f8b..6ab48e33915b 100644 --- a/src/audio/volume/volume_ipc3.c +++ b/src/audio/volume/volume_ipc3.c @@ -37,7 +37,6 @@ LOG_MODULE_DECLARE(volume, CONFIG_SOF_LOG_LEVEL); void set_volume_process(struct vol_data *cd, struct comp_dev *dev, bool source_or_sink) { struct comp_buffer *bufferb; - struct comp_buffer *buffer_c; if (source_or_sink) bufferb = list_first_item(&dev->bsource_list, @@ -46,10 +45,7 @@ void set_volume_process(struct vol_data *cd, struct comp_dev *dev, bool source_o bufferb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - buffer_c = buffer_acquire(bufferb); - cd->scale_vol = vol_get_processing_function(dev, buffer_c, cd); - - buffer_release(buffer_c); + cd->scale_vol = vol_get_processing_function(dev, bufferb, cd); } /** diff --git a/src/audio/volume/volume_ipc4.c b/src/audio/volume/volume_ipc4.c index 23cd6c7281eb..18ef40866c49 100644 --- a/src/audio/volume/volume_ipc4.c +++ b/src/audio/volume/volume_ipc4.c @@ -366,7 +366,6 @@ int volume_get_config(struct processing_module *mod, static int volume_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct comp_dev *dev = mod->dev; @@ -378,14 +377,10 @@ static int volume_params(struct processing_module *mod) /* volume component will only ever have 1 sink buffer */ sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ipc4_update_buffer_format(sink_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(sink_c); + ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - ipc4_update_buffer_format(source_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(source_c); + ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); return 0; } From d7ebc159d0dad8740829f5353d2ad43a2ee94743 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:53:15 +0200 Subject: [PATCH 413/639] crossover: remove buffer_acquire from crossover remove buffer ops from crossover module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/crossover/crossover.c | 38 ++++++++++----------------------- 1 file changed, 11 insertions(+), 27 deletions(-) diff --git a/src/audio/crossover/crossover.c b/src/audio/crossover/crossover.c index 4d75db645132..4e89a9d05042 100644 --- a/src/audio/crossover/crossover.c +++ b/src/audio/crossover/crossover.c @@ -133,7 +133,6 @@ static int crossover_assign_sinks(struct processing_module *mod, struct sof_crossover_config *config = cd->config; struct comp_dev *dev = mod->dev; struct comp_buffer *sink; - struct comp_buffer *sink_c; struct list_item *sink_list; int num_sinks = 0; int i; @@ -143,14 +142,12 @@ static int crossover_assign_sinks(struct processing_module *mod, unsigned int sink_id, state; sink = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); #if CONFIG_IPC_MAJOR_4 sink_id = cd->output_pin_index[j]; #else - sink_id = sink_c->pipeline_id; + sink_id = sink->pipeline_id; #endif - state = sink_c->sink->state; - buffer_release(sink_c); + state = sink->sink->state; if (state != dev->state) { j++; continue; @@ -486,7 +483,6 @@ static int crossover_check_sink_assign(struct processing_module *mod, { struct comp_dev *dev = mod->dev; struct comp_buffer *sink; - struct comp_buffer *sink_c; struct list_item *sink_list; int num_assigned_sinks = 0; uint8_t assigned_sinks[SOF_CROSSOVER_MAX_STREAMS] = {0}; @@ -496,9 +492,7 @@ static int crossover_check_sink_assign(struct processing_module *mod, unsigned int pipeline_id; sink = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - pipeline_id = sink_c->pipeline_id; - buffer_release(sink_c); + pipeline_id = sink->pipeline_id; i = crossover_get_stream_index(mod, config, pipeline_id); if (i < 0) { @@ -691,7 +685,6 @@ static int crossover_process_audio_stream(struct processing_module *mod, static void crossover_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct list_item *sink_list; struct comp_dev *dev = mod->dev; @@ -702,15 +695,11 @@ static void crossover_params(struct processing_module *mod) component_set_nearest_period_frames(dev, params->rate); sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - ipc4_update_buffer_format(source_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(source_c); + ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); list_for_item(sink_list, &dev->bsink_list) { sinkb = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ipc4_update_buffer_format(sink_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(sink_c); + ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); } } #endif @@ -727,7 +716,6 @@ static int crossover_prepare(struct processing_module *mod, struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *source, *sink; - struct comp_buffer *source_c, *sink_c; struct list_item *sink_list; int channels; int ret = 0; @@ -741,27 +729,23 @@ static int crossover_prepare(struct processing_module *mod, /* Crossover has a variable number of sinks */ mod->max_sinks = SOF_CROSSOVER_MAX_STREAMS; source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); /* Get source data format */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); - channels = audio_stream_get_channels(&source_c->stream); - audio_stream_init_alignment_constants(1, 1, &source_c->stream); - buffer_release(source_c); + cd->source_format = audio_stream_get_frm_fmt(&source->stream); + channels = audio_stream_get_channels(&source->stream); + audio_stream_init_alignment_constants(1, 1, &source->stream); /* Validate frame format and buffer size of sinks */ list_for_item(sink_list, &dev->bsink_list) { sink = container_of(sink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - if (cd->source_format == audio_stream_get_frm_fmt(&sink_c->stream)) { - audio_stream_init_alignment_constants(1, 1, &sink_c->stream); + if (cd->source_format == audio_stream_get_frm_fmt(&sink->stream)) { + audio_stream_init_alignment_constants(1, 1, &sink->stream); } else { comp_err(dev, "crossover_prepare(): Source fmt %d and sink fmt %d are different.", - cd->source_format, audio_stream_get_frm_fmt(&sink_c->stream)); + cd->source_format, audio_stream_get_frm_fmt(&sink->stream)); ret = -EINVAL; } - buffer_release(sink_c); if (ret < 0) return ret; } From 75337b41eb5147f8b9d3c82d8051f1832def43ab Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Thu, 21 Sep 2023 14:45:52 +0800 Subject: [PATCH 414/639] topology2: remove duplicated pipeline index attribute definition The pipeline-common.conf helps us to define several common pipeline attributes include pipeline index, there is no need to define pipeline index in each pipeline class definition if pipeline-common.conf is included. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- .../topology2/include/pipelines/cavs/dai-copier-be.conf | 2 -- .../pipelines/cavs/dai-copier-eqiir-module-copier-capture.conf | 2 -- .../include/pipelines/cavs/dai-copier-gain-mixin-capture.conf | 2 -- .../pipelines/cavs/dai-copier-gain-module-copier-capture.conf | 2 -- tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf | 2 -- .../topology2/include/pipelines/cavs/deepbuffer-playback.conf | 2 -- .../topology/topology2/include/pipelines/cavs/gain-capture.conf | 2 -- .../topology2/include/pipelines/cavs/gain-copier-capture.conf | 2 -- .../topology2/include/pipelines/cavs/gain-module-copier.conf | 2 -- .../topology2/include/pipelines/cavs/gain-playback.conf | 2 -- .../include/pipelines/cavs/google-rtc-aec-capture.conf | 2 -- .../topology2/include/pipelines/cavs/highpass-capture-be.conf | 2 -- .../include/pipelines/cavs/host-copier-gain-mixin-playback.conf | 2 -- .../pipelines/cavs/host-copier-gain-src-mixin-playback.conf | 2 -- .../topology2/include/pipelines/cavs/host-gateway-capture.conf | 2 -- .../topology2/include/pipelines/cavs/host-gateway-playback.conf | 2 -- .../topology2/include/pipelines/cavs/io-gateway-capture.conf | 2 -- tools/topology/topology2/include/pipelines/cavs/io-gateway.conf | 2 -- .../include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf | 2 -- .../include/pipelines/cavs/mixout-dai-copier-playback.conf | 2 -- .../pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf | 2 -- .../include/pipelines/cavs/mixout-gain-dai-copier-playback.conf | 2 -- .../pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf | 2 -- .../cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf | 2 -- .../include/pipelines/cavs/mixout-gain-host-copier-capture.conf | 2 -- .../topology/topology2/include/pipelines/cavs/mixout-mixin.conf | 2 -- .../include/pipelines/cavs/src-gain-mixin-playback.conf | 2 -- tools/topology/topology2/include/pipelines/cavs/wov-detect.conf | 2 -- 28 files changed, 56 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf index d17e651316b9..c8e8699f1294 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf @@ -22,8 +22,6 @@ Class.Pipeline."dai-copier-be" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-eqiir-module-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-eqiir-module-copier-capture.conf index 131e5969cd4e..4869a6bb3bd7 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-eqiir-module-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-eqiir-module-copier-capture.conf @@ -25,8 +25,6 @@ Class.Pipeline."dai-copier-eqiir-module-copier-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf index a5ce31f7aa30..7f7a85d4724e 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf @@ -24,8 +24,6 @@ Class.Pipeline."dai-copier-gain-mixin-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf index 072a5f9be1be..2e38db9f0719 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf @@ -23,8 +23,6 @@ Class.Pipeline."dai-copier-gain-module-copier-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf index 70bc4f2c8dba..28d2f8c47d74 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf @@ -24,8 +24,6 @@ Class.Pipeline."dai-kpb-be" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf index fbb19283a9dd..abe5a468ad01 100644 --- a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf @@ -24,8 +24,6 @@ Class.Pipeline."deepbuffer-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf index 57e65070b6db..12dfae7c26fc 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -24,8 +24,6 @@ Class.Pipeline."gain-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf index 86ee039fd90e..6642d28d2858 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf @@ -24,8 +24,6 @@ Class.Pipeline."gain-copier-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf b/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf index 416a4c3b59e1..ff9ef84b6d51 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf @@ -23,8 +23,6 @@ Class.Pipeline."gain-module-copier" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf index 81aedde59f7f..e5e5bc41d9a7 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf @@ -23,8 +23,6 @@ Class.Pipeline."gain-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf index 6699ff23bbd0..69729fa0c1ed 100644 --- a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf @@ -25,8 +25,6 @@ Class.Pipeline."google-rtc-aec-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf b/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf index 6475b9b719c3..7d43f08f1a61 100644 --- a/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf @@ -25,8 +25,6 @@ Class.Pipeline."highpass-capture-be" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf index 814e78252eb8..02f47b204a3b 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf @@ -24,8 +24,6 @@ Class.Pipeline."host-copier-gain-mixin-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf index 05ab5ea46c05..b55f2a18c62f 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-src-mixin-playback.conf @@ -26,8 +26,6 @@ Class.Pipeline."host-copier-gain-src-mixin-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf index deb9df7f9650..392a76c54734 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf @@ -22,8 +22,6 @@ Class.Pipeline."host-gateway-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf index 577513ad77b4..a2d42e5e3d46 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf @@ -22,8 +22,6 @@ Class.Pipeline."host-gateway-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf b/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf index af2094d32ecf..a50b8ed0dd3c 100644 --- a/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf @@ -23,8 +23,6 @@ Class.Pipeline."io-gateway-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/io-gateway.conf b/tools/topology/topology2/include/pipelines/cavs/io-gateway.conf index fd160d0d4721..106a17ec463b 100644 --- a/tools/topology/topology2/include/pipelines/cavs/io-gateway.conf +++ b/tools/topology/topology2/include/pipelines/cavs/io-gateway.conf @@ -24,8 +24,6 @@ Class.Pipeline."io-gateway" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf index 65ae5c009a4e..682b3c47ebe3 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf @@ -25,8 +25,6 @@ Class.Pipeline."mixout-aria-gain-mixin-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf index d426a4d0dac8..ba7997a55006 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf @@ -23,8 +23,6 @@ Class.Pipeline."mixout-dai-copier-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf index a66f846f7d04..ab8ab712c929 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-alh-dai-copier-playback.conf @@ -22,8 +22,6 @@ Class.Pipeline."mixout-gain-alh-dai-copier-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf index c90d71556224..c40c67e1aaf8 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf @@ -24,8 +24,6 @@ Class.Pipeline."mixout-gain-dai-copier-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf index 9d8c9eebad53..66b7b9c8b1a5 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf @@ -29,8 +29,6 @@ Class.Pipeline."mixout-gain-efx-dai-copier-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf index 876d8cf3c46f..87f3e1e34809 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf @@ -29,8 +29,6 @@ Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf index 594251d66062..1c9801d89520 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf @@ -24,8 +24,6 @@ Class.Pipeline."mixout-gain-host-copier-capture" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-mixin.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-mixin.conf index 0b895ae36fed..cdd40b90f9af 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-mixin.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-mixin.conf @@ -20,8 +20,6 @@ Class.Pipeline."mixout-mixin" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf index 36a2e29a7824..46d1a6dfc8b9 100644 --- a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf @@ -26,8 +26,6 @@ Class.Pipeline."src-gain-mixin-playback" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { diff --git a/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf b/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf index b804110a921f..dc7805bd0f3e 100644 --- a/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf +++ b/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf @@ -26,8 +26,6 @@ Class.Pipeline."wov-detect" { - DefineAttribute."index" {} - <include/pipelines/pipeline-common.conf> attributes { From 8eedfe48364f1a8b3a958c70321a517707c7bfbe Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 22 Sep 2023 11:21:31 -0700 Subject: [PATCH 415/639] .github: build-windows: choco install ninja Ninja seems to have just mysteriously disappeared from https://github.com/actions/runner-images/blob/win22/20230918.1/images/win/Windows2022-Readme.md See #8250 for more details. Let's try to install it explicitly. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/zephyr.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index c506f68f8f23..af0b3e553d74 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -329,7 +329,18 @@ jobs: working-directory: ${{ github.workspace }}/workspace run: pip install -r zephyr/scripts/requirements.txt + # Ninja has been coming and going, see #8250 + - name: choco install ninja + run: | + choco install ninja + ninja.exe --version + # MSYS2 provides gcc x64_86 toolchain & openssl + # Installs in D:/a/_temp/msys64 + # + # Note there is already C:/msys64/ provided by + # https://github.com/actions/runner-images/blob/win22/20230918.1/images/win/Windows2022-Readme.md + # Is it not good enough? Maybe it could save 20-30s. - name: Initialize MSYS2 uses: msys2/setup-msys2@v2 with: From e7a1592002dda693ec1e34220b6eac354859d46a Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 25 Sep 2023 13:29:46 +0800 Subject: [PATCH 416/639] topology2: use input|output audio format The old style is not used now. Signed-off-by: Rander Wang <rander.wang@intel.com> --- .../include/pipelines/cavs/gain-capture.conf | 111 +++++++++++------- 1 file changed, 71 insertions(+), 40 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf index 12dfae7c26fc..6330e3c4c77d 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -45,58 +45,89 @@ Class.Pipeline."gain-capture" { Object.Widget { host-copier."1" { type "aif_out" - num_input_audio_formats 3 - num_output_audio_formats 3 + num_input_audio_formats 1 num_input_pins 1 - # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + num_output_audio_formats 3 + num_output_pins 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + node_type $HDA_HOST_INPUT_CLASS } gain."1" { num_input_audio_formats 2 - num_output_audio_formats 2 + num_input_pins 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_output_audio_formats 2 + num_output_pins 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } module-copier."2" { num_input_audio_formats 2 + num_input_pins 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 2 - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_output_pins 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { From beddfb360a5f5a90a8c4d6e6cd9c686ca18bbe97 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Mon, 25 Sep 2023 14:10:52 +0800 Subject: [PATCH 417/639] topology2: Add 4ch audio formats for gain-capture pipeline Add support in gain-capture pipeline to support 4ch DMIC stream. Signed-off-by: Rander Wang <rander.wang@intel.com> --- .../include/pipelines/cavs/gain-capture.conf | 96 +++++++++++++++++-- 1 file changed, 90 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf index 6330e3c4c77d..dbee6b08aec7 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-capture.conf @@ -45,16 +45,23 @@ Class.Pipeline."gain-capture" { Object.Widget { host-copier."1" { type "aif_out" - num_input_audio_formats 1 + num_input_audio_formats 2 num_input_pins 1 Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } ] - num_output_audio_formats 3 + num_output_audio_formats 6 num_output_pins 1 Object.Base.output_audio_format [ { @@ -69,13 +76,34 @@ Class.Pipeline."gain-capture" { out_bit_depth 32 out_valid_bit_depth 32 } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } ] node_type $HDA_HOST_INPUT_CLASS } gain."1" { - num_input_audio_formats 2 + num_input_audio_formats 4 num_input_pins 1 Object.Base.input_audio_format [ { @@ -86,9 +114,23 @@ Class.Pipeline."gain-capture" { in_bit_depth 32 in_valid_bit_depth 32 } + { + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } ] - num_output_audio_formats 2 + num_output_audio_formats 4 num_output_pins 1 Object.Base.output_audio_format [ { @@ -99,11 +141,25 @@ Class.Pipeline."gain-capture" { out_bit_depth 32 out_valid_bit_depth 32 } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } ] } module-copier."2" { - num_input_audio_formats 2 + num_input_audio_formats 4 num_input_pins 1 Object.Base.input_audio_format [ { @@ -114,9 +170,23 @@ Class.Pipeline."gain-capture" { in_bit_depth 32 in_valid_bit_depth 32 } + { + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } ] - num_output_audio_formats 2 + num_output_audio_formats 4 num_output_pins 1 Object.Base.output_audio_format [ { @@ -127,6 +197,20 @@ Class.Pipeline."gain-capture" { out_bit_depth 32 out_valid_bit_depth 32 } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } ] } From 2cdd11a95d663b215e121d65c36d52f6c7f57be3 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 21 Sep 2023 17:23:32 +0300 Subject: [PATCH 418/639] Tools: Topology2: Remove 50 ms curve duration set from nocodec We need to care about audio user experience and peak MCPS usage in production topologies. The alsabat test is disturbed by the longer ramp so the change can be reverted from nocodec topologies. Those topologies are never used by end users. Also the peak MCPS mitigation is not relevant for test topologies, as long as higher MCPS is not triggering error reports. The curve duration is restored without explicit set to the default 20 ms. Fixes: #8238 Fixes: d0d74a477f64a83654bccb3905175584d05d9257 ("Tools: Topology2: Change in capture gain curve_duration to 50 m") Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/topology/topology2/cavs-nocodec-multicore.conf | 3 --- tools/topology/topology2/cavs-nocodec.conf | 6 ------ 2 files changed, 9 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec-multicore.conf b/tools/topology/topology2/cavs-nocodec-multicore.conf index d9fae0e3ec4b..9c7e9c833b59 100644 --- a/tools/topology/topology2/cavs-nocodec-multicore.conf +++ b/tools/topology/topology2/cavs-nocodec-multicore.conf @@ -335,7 +335,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -397,7 +396,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -456,7 +454,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 6cc7f0d3753e..bac1fe2118c7 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -275,7 +275,6 @@ IncludeByKey.PASSTHROUGH { pcm_id $SSP0_PCM_ID } Object.Widget.gain.1 { - curve_duration 500000 Object.Control.mixer.1 { name 'Post Demux $SSP0_PCM_NAME Capture Volume' } @@ -290,7 +289,6 @@ IncludeByKey.PASSTHROUGH { pcm_id $SSP0_CAPTURE_PCM_ID } Object.Widget.gain.1 { - curve_duration 500000 Object.Control.mixer.1 { name 'Post Demux $SSP0_CAPTURE_PCM Volume' } @@ -331,7 +329,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -397,7 +394,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 Object.Control.mixer.1 { name 'Pre Demux $SSP0_PCM_NAME Capture Volume' } @@ -703,7 +699,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -760,7 +755,6 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { - curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { From 2a9473a17be4764b55b7392a6104561f6f2f4da8 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Sat, 23 Sep 2023 08:54:09 +0000 Subject: [PATCH 419/639] app/prj.conf: disable PICOLIBC with CONFIG_MINIMAL_LIBC=y Starting from Zephyr commit f0daf904bb02, CONFIG_PICOLIBC is on by default. PICOLIBC does not seem compatible with sparse yet: https://github.com/zephyrproject-rtos/zephyr/issues/63003 Even if it were compatible with sparse, it seems like a pretty big change that we should not immediately and blindly accept. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- app/prj.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/prj.conf b/app/prj.conf index 49b09f62789b..a5164e1926c6 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -14,6 +14,11 @@ CONFIG_OUTPUT_DISASSEMBLY=y CONFIG_HAVE_AGENT=n +# PICOLIBC does not seem compatible with the "sparse" static analyzer +# yet, see https://github.com/zephyrproject-rtos/zephyr/issues/63003 +# Plus the paint on it is still wet. +CONFIG_MINIMAL_LIBC=y + CONFIG_LOG=y CONFIG_LOG_PRINTK=y # Log processing is offloaded to a low-priority thread. From e4136a4e0ea4a3f7812a8d65428829b85d554aa6 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Fri, 22 Sep 2023 12:58:20 +0200 Subject: [PATCH 420/639] lnl: memory: expand HEAPMEM_SIZE FW infrastructure shall support buffering of historic data from 1ch up to 6 channels 24bit samples in 24bit container. For this reason, the heap should be extended.Increase HEAPMEM_SIZE by 0x90000 because for audio format 16000Hz/6ch/24bit history_buffer_size = 16 * 6 * 3 * 2100s = 604800 bytes (0x93A80) Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- src/platform/lunarlake/include/platform/lib/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/lunarlake/include/platform/lib/memory.h b/src/platform/lunarlake/include/platform/lib/memory.h index 5f7ced26f922..f968da8c50f0 100644 --- a/src/platform/lunarlake/include/platform/lib/memory.h +++ b/src/platform/lunarlake/include/platform/lib/memory.h @@ -56,7 +56,7 @@ /** * size of HPSRAM system heap */ -#define HEAPMEM_SIZE 0x40000 +#define HEAPMEM_SIZE 0xD0000 #endif /* __PLATFORM_LIB_MEMORY_H__ */ From f57e478f4c332a62c2a649ba684f22792ea2a10f Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 25 Sep 2023 17:56:29 +0300 Subject: [PATCH 421/639] Zephyr: Fix path to google_hotword_detect.c The file is found from subdirectory src/audio/google. Without fix if CONFIG_COMP_GOOGLE_HOTWORD_DETECT is enabled build fails: CMake Error at sof/zephyr/cmake/modules/extensions.cmake:424 (add_library): Cannot find source file: /src/audio/google_hotword_detect.c Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- zephyr/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 8ac927ee6eee..7e2b9c46055b 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -705,7 +705,7 @@ zephyr_library_sources_ifdef(CONFIG_COMP_MUX ) zephyr_library_sources_ifdef(CONFIG_COMP_GOOGLE_HOTWORD_DETECT - ${SOF_AUDIO_PATH}/google_hotword_detect.c + ${SOF_AUDIO_PATH}/google/google_hotword_detect.c ) zephyr_library_sources_ifdef(CONFIG_DTS_CODEC From fe91b3c97f71d9926dc5e29deffd1997d16eefb8 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:59:40 +0200 Subject: [PATCH 422/639] eq: remove buffer_acquire from eq_fir and eq_iir remove buffer ops from eq_fir and eq_iir modules this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/eq_fir/eq_fir.c | 16 ++++------------ src/audio/eq_iir/eq_iir.c | 28 +++++++--------------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/src/audio/eq_fir/eq_fir.c b/src/audio/eq_fir/eq_fir.c index 47efd54627ed..baca41e054a4 100644 --- a/src/audio/eq_fir/eq_fir.c +++ b/src/audio/eq_fir/eq_fir.c @@ -174,7 +174,6 @@ static int eq_fir_params(struct processing_module *mod) struct sof_ipc_stream_params comp_params; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb; - struct comp_buffer *sink_c; enum sof_ipc_frame valid_fmt, frame_fmt; int i, ret; @@ -197,9 +196,7 @@ static int eq_fir_params(struct processing_module *mod) component_set_nearest_period_frames(dev, comp_params.rate); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ret = buffer_set_params(sink_c, &comp_params, true); - buffer_release(sink_c); + ret = buffer_set_params(sinkb, &comp_params, true); return ret; } #endif /* CONFIG_IPC_MAJOR_4 */ @@ -570,7 +567,6 @@ static int eq_fir_prepare(struct processing_module *mod, { struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; int channels; enum sof_ipc_frame frame_fmt; @@ -589,13 +585,9 @@ static int eq_fir_prepare(struct processing_module *mod, /* EQ component will only ever have 1 source and 1 sink buffer. */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - eq_fir_set_alignment(&source_c->stream, &sink_c->stream); - channels = audio_stream_get_channels(&sink_c->stream); - frame_fmt = audio_stream_get_frm_fmt(&source_c->stream); - buffer_release(sink_c); - buffer_release(source_c); + eq_fir_set_alignment(&sourceb->stream, &sinkb->stream); + channels = audio_stream_get_channels(&sinkb->stream); + frame_fmt = audio_stream_get_frm_fmt(&sourceb->stream); cd->eq_fir_func = eq_fir_passthrough; cd->config = comp_get_data_blob(cd->model_handler, NULL, NULL); diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index 97421be8840a..76f187ce04f0 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -694,7 +694,6 @@ static int eq_iir_verify_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; uint32_t buffer_flag; int ret; @@ -705,8 +704,6 @@ static int eq_iir_verify_params(struct comp_dev *dev, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); /* we check whether we can support frame_fmt conversion (whether we have * such conversion function) due to source and sink buffer frame_fmt's. @@ -714,14 +711,11 @@ static int eq_iir_verify_params(struct comp_dev *dev, * pcm frame_fmt and will not make any conversion (sink and source * frame_fmt will be equal). */ - buffer_flag = eq_iir_find_func(audio_stream_get_frm_fmt(&source_c->stream), - audio_stream_get_frm_fmt(&sink_c->stream), fm_configured, + buffer_flag = eq_iir_find_func(audio_stream_get_frm_fmt(&sourceb->stream), + audio_stream_get_frm_fmt(&sinkb->stream), fm_configured, ARRAY_SIZE(fm_configured)) ? BUFF_PARAMS_FRAME_FMT : 0; - buffer_release(sink_c); - buffer_release(source_c); - ret = comp_verify_params(dev, buffer_flag, params); if (ret < 0) { comp_err(dev, "eq_iir_verify_params(): comp_verify_params() failed."); @@ -838,7 +832,6 @@ static int eq_iir_params(struct processing_module *mod) struct sof_ipc_stream_params comp_params; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb; - struct comp_buffer *sink_c; enum sof_ipc_frame valid_fmt, frame_fmt; int i, ret; @@ -860,9 +853,7 @@ static int eq_iir_params(struct processing_module *mod) component_set_nearest_period_frames(dev, comp_params.rate); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ret = buffer_set_params(sink_c, &comp_params, true); - buffer_release(sink_c); + ret = buffer_set_params(sinkb, &comp_params, true); return ret; } #endif @@ -885,7 +876,6 @@ static int eq_iir_prepare(struct processing_module *mod, { struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame source_format; enum sof_ipc_frame sink_format; @@ -910,16 +900,12 @@ static int eq_iir_prepare(struct processing_module *mod, /* EQ component will only ever have 1 source and 1 sink buffer */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - eq_iir_set_alignment(&source_c->stream, &sink_c->stream); + eq_iir_set_alignment(&sourceb->stream, &sinkb->stream); /* get source and sink data format */ - channels = audio_stream_get_channels(&sink_c->stream); - source_format = audio_stream_get_frm_fmt(&source_c->stream); - sink_format = audio_stream_get_frm_fmt(&sink_c->stream); - buffer_release(sink_c); - buffer_release(source_c); + channels = audio_stream_get_channels(&sinkb->stream); + source_format = audio_stream_get_frm_fmt(&sourceb->stream); + sink_format = audio_stream_get_frm_fmt(&sinkb->stream); cd->config = comp_get_data_blob(cd->model_handler, NULL, NULL); From 352a46575990e3790732dbdba0cb7c2de729d7f9 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:00:04 +0200 Subject: [PATCH 423/639] igo_nr: remove buffer_acquire from igo_nr remove buffer ops from igo_nr module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/igo_nr/igo_nr.c | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/src/audio/igo_nr/igo_nr.c b/src/audio/igo_nr/igo_nr.c index aaea52ed2178..19d0cc01db46 100644 --- a/src/audio/igo_nr/igo_nr.c +++ b/src/audio/igo_nr/igo_nr.c @@ -379,7 +379,6 @@ static int32_t igo_nr_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb, *sourceb; - struct comp_buffer *sink_c, *source_c; int32_t err; comp_info(dev, "igo_nr_params()"); @@ -395,22 +394,16 @@ static int32_t igo_nr_params(struct comp_dev *dev, sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - /* set source/sink_frames/rate */ - cd->source_rate = audio_stream_get_rate(&source_c->stream); - cd->sink_rate = audio_stream_get_rate(&sink_c->stream); + cd->source_rate = audio_stream_get_rate(&sourceb->stream); + cd->sink_rate = audio_stream_get_rate(&sinkb->stream); - if (audio_stream_get_channels(&source_c->stream) != - audio_stream_get_channels(&sink_c->stream)) { + if (audio_stream_get_channels(&sourceb->stream) != + audio_stream_get_channels(&sinkb->stream)) { comp_err(dev, "igo_nr_params(), mismatch source/sink stream channels"); cd->invalid_param = true; } - buffer_release(sink_c); - buffer_release(source_c); - if (!cd->sink_rate) { comp_err(dev, "igo_nr_params(), zero sink rate"); return -EINVAL; @@ -701,7 +694,6 @@ static int32_t igo_nr_copy(struct comp_dev *dev) { struct comp_copy_limits cl; struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; struct comp_data *cd = comp_get_drvdata(dev); int32_t src_frames; int32_t sink_frames; @@ -713,27 +705,21 @@ static int32_t igo_nr_copy(struct comp_dev *dev) sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - /* Check for changed configuration */ if (comp_is_new_data_blob_available(cd->model_handler)) igo_nr_set_igo_params(dev); /* Get source, sink, number of frames etc. to process. */ - comp_get_copy_limits(source_c, sink_c, &cl); + comp_get_copy_limits(sourceb, sinkb, &cl); - src_frames = audio_stream_get_avail_frames(&source_c->stream); - sink_frames = audio_stream_get_free_frames(&sink_c->stream); + src_frames = audio_stream_get_avail_frames(&sourceb->stream); + sink_frames = audio_stream_get_free_frames(&sinkb->stream); comp_dbg(dev, "src_frames = %d, sink_frames = %d.", src_frames, sink_frames); /* Process only when frames count is enough. */ if (src_frames >= IGO_FRAME_SIZE && sink_frames >= IGO_FRAME_SIZE) - igo_nr_process(dev, source_c, sink_c, &cl, IGO_FRAME_SIZE); - - buffer_release(sink_c); - buffer_release(source_c); + igo_nr_process(dev, sourceb, sinkb, &cl, IGO_FRAME_SIZE); return 0; } From 989a13c94c260445fe47a0d17a204f45db601044 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:00:25 +0200 Subject: [PATCH 424/639] mfcc: remove buffer_acquire from mfcc remove buffer ops from mfcc modules this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/mfcc/mfcc.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/audio/mfcc/mfcc.c b/src/audio/mfcc/mfcc.c index 89621ede49b7..109c3636a4a1 100644 --- a/src/audio/mfcc/mfcc.c +++ b/src/audio/mfcc/mfcc.c @@ -193,8 +193,6 @@ static int mfcc_prepare(struct processing_module *mod, struct mfcc_comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb; struct comp_buffer *sinkb; - struct comp_buffer *source_c; - struct comp_buffer *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame source_format; enum sof_ipc_frame sink_format; @@ -206,23 +204,21 @@ static int mfcc_prepare(struct processing_module *mod, /* MFCC component will only ever have 1 source and 1 sink buffer */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); /* get source data format */ - source_format = audio_stream_get_frm_fmt(&source_c->stream); + source_format = audio_stream_get_frm_fmt(&sourceb->stream); /* set align requirements */ - mfcc_set_alignment(&source_c->stream, &sink_c->stream); + mfcc_set_alignment(&sourceb->stream, &sinkb->stream); /* get sink data format and period bytes */ - sink_format = audio_stream_get_frm_fmt(&sink_c->stream); - sink_period_bytes = audio_stream_period_bytes(&sink_c->stream, dev->frames); + sink_format = audio_stream_get_frm_fmt(&sinkb->stream); + sink_period_bytes = audio_stream_period_bytes(&sinkb->stream, dev->frames); comp_info(dev, "mfcc_prepare(), source_format = %d, sink_format = %d", source_format, sink_format); - if (audio_stream_get_size(&sink_c->stream) < sink_period_bytes) { + if (audio_stream_get_size(&sinkb->stream) < sink_period_bytes) { comp_err(dev, "mfcc_prepare(): sink buffer size %d is insufficient < %d", - audio_stream_get_size(&sink_c->stream), sink_period_bytes); + audio_stream_get_size(&sinkb->stream), sink_period_bytes); ret = -ENOMEM; goto err; } @@ -231,8 +227,8 @@ static int mfcc_prepare(struct processing_module *mod, /* Initialize MFCC, max_frames is set to dev->frames + 4 */ if (cd->config) { - ret = mfcc_setup(mod, dev->frames + 4, audio_stream_get_rate(&source_c->stream), - audio_stream_get_channels(&source_c->stream)); + ret = mfcc_setup(mod, dev->frames + 4, audio_stream_get_rate(&sourceb->stream), + audio_stream_get_channels(&sourceb->stream)); if (ret < 0) { comp_err(dev, "mfcc_prepare(), setup failed."); goto err; @@ -246,13 +242,9 @@ static int mfcc_prepare(struct processing_module *mod, goto err; } - buffer_release(sink_c); - buffer_release(source_c); return 0; err: - buffer_release(sink_c); - buffer_release(source_c); comp_set_state(dev, COMP_TRIGGER_RESET); return ret; } From b0f4605d97de5b193ba2e1c509349360f9e819ca Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:03:09 +0200 Subject: [PATCH 425/639] multiband_drc: remove buffer_acquire from multiband_drc remove buffer ops from multiband_drc module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/multiband_drc/multiband_drc.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/audio/multiband_drc/multiband_drc.c b/src/audio/multiband_drc/multiband_drc.c index 1275a4688c75..fe1c11f3cdab 100644 --- a/src/audio/multiband_drc/multiband_drc.c +++ b/src/audio/multiband_drc/multiband_drc.c @@ -458,7 +458,6 @@ static int multiband_drc_params(struct processing_module *mod) struct sof_ipc_stream_params comp_params; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb; - struct comp_buffer *sink_c; enum sof_ipc_frame valid_fmt, frame_fmt; int i, ret; @@ -481,9 +480,8 @@ static int multiband_drc_params(struct processing_module *mod) component_set_nearest_period_frames(dev, comp_params.rate); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ret = buffer_set_params(sink_c, &comp_params, true); - buffer_release(sink_c); + ret = buffer_set_params(sinkb, &comp_params, true); + return ret; } #endif /* CONFIG_IPC_MAJOR_4 */ @@ -495,7 +493,6 @@ static int multiband_drc_prepare(struct processing_module *mod, struct multiband_drc_comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; int channels; int rate; int ret = 0; @@ -512,17 +509,12 @@ static int multiband_drc_prepare(struct processing_module *mod, sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - multiband_drc_set_alignment(&source_c->stream, &sink_c->stream); + multiband_drc_set_alignment(&sourceb->stream, &sinkb->stream); /* get source data format */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); - channels = audio_stream_get_channels(&source_c->stream); - rate = audio_stream_get_rate(&source_c->stream); - - buffer_release(sink_c); - buffer_release(source_c); + cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream); + channels = audio_stream_get_channels(&sourceb->stream); + rate = audio_stream_get_rate(&sourceb->stream); /* Initialize DRC */ comp_dbg(dev, "multiband_drc_prepare(), source_format=%d, sink_format=%d", From 1d4cca5610dcada37a141795604ef1684a28d92a Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:03:25 +0200 Subject: [PATCH 426/639] mux: remove buffer_acquire from mux remove buffer ops from mux module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/mux/mux.c | 66 +++++++++++-------------------------- src/audio/mux/mux_generic.c | 8 ++--- 2 files changed, 22 insertions(+), 52 deletions(-) diff --git a/src/audio/mux/mux.c b/src/audio/mux/mux.c index cd0176766cfa..92d278a22186 100644 --- a/src/audio/mux/mux.c +++ b/src/audio/mux/mux.c @@ -274,7 +274,6 @@ static void set_mux_params(struct processing_module *mod) struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *sink, *source; - struct comp_buffer *sink_c, *source_c; struct list_item *source_list; int j; const uint32_t byte_align = 1; @@ -298,15 +297,13 @@ static void set_mux_params(struct processing_module *mod) /* update sink format */ if (!list_is_empty(&dev->bsink_list)) { sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); audio_stream_init_alignment_constants(byte_align, frame_align_req, - &sink_c->stream); + &sink->stream); - if (!sink_c->hw_params_configured) { - ipc4_update_buffer_format(sink_c, &cd->md.output_format); - params->frame_fmt = audio_stream_get_frm_fmt(&sink_c->stream); + if (!sink->hw_params_configured) { + ipc4_update_buffer_format(sink, &cd->md.output_format); + params->frame_fmt = audio_stream_get_frm_fmt(&sink->stream); } - buffer_release(sink_c); } /* update each source format */ @@ -316,18 +313,16 @@ static void set_mux_params(struct processing_module *mod) list_for_item(source_list, &dev->bsource_list) { source = container_of(source_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); audio_stream_init_alignment_constants(byte_align, frame_align_req, - &source_c->stream); - j = source_c->id; - cd->config.streams[j].pipeline_id = source_c->pipeline_id; + &source->stream); + j = source->id; + cd->config.streams[j].pipeline_id = source->pipeline_id; if (j == BASE_CFG_QUEUED_ID) audio_fmt = &cd->md.base_cfg.audio_fmt; else audio_fmt = &cd->md.reference_format; - ipc4_update_buffer_format(source_c, audio_fmt); - buffer_release(source_c); + ipc4_update_buffer_format(source, audio_fmt); } } @@ -429,7 +424,6 @@ static int demux_process(struct processing_module *mod, struct comp_dev *dev = mod->dev; struct list_item *clist; struct comp_buffer *sink; - struct comp_buffer *sink_c; struct audio_stream *sinks_stream[MUX_MAX_STREAMS] = { NULL }; struct mux_look_up *look_ups[MUX_MAX_STREAMS] = { NULL }; int frames; @@ -442,20 +436,16 @@ static int demux_process(struct processing_module *mod, /* align sink streams with their respective configurations */ list_for_item(clist, &dev->bsink_list) { sink = container_of(clist, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - if (sink_c->sink->state == dev->state) { - i = get_stream_index(dev, cd, sink_c->pipeline_id); + if (sink->sink->state == dev->state) { + i = get_stream_index(dev, cd, sink->pipeline_id); /* return if index wrong */ if (i < 0) { - buffer_release(sink_c); return i; } - look_ups[i] = get_lookup_table(dev, cd, sink_c->pipeline_id); - sinks_stream[i] = &sink_c->stream; + look_ups[i] = get_lookup_table(dev, cd, sink->pipeline_id); + sinks_stream[i] = &sink->stream; } - - buffer_release(sink_c); } /* if there are no sinks active, then sinks[] is also empty */ @@ -487,7 +477,6 @@ static int mux_process(struct processing_module *mod, struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; struct comp_buffer *source; - struct comp_buffer *source_c; struct list_item *clist; const struct audio_stream *sources_stream[MUX_MAX_STREAMS] = { NULL }; int frames = 0; @@ -501,23 +490,20 @@ static int mux_process(struct processing_module *mod, j = 0; list_for_item(clist, &dev->bsource_list) { source = container_of(clist, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - if (source_c->source->state == dev->state) { + if (source->source->state == dev->state) { if (frames) frames = MIN(frames, input_buffers[j].size); else frames = input_buffers[j].size; - i = get_stream_index(dev, cd, source_c->pipeline_id); + i = get_stream_index(dev, cd, source->pipeline_id); /* return if index wrong */ if (i < 0) { - buffer_release(source_c); return i; } - sources_stream[i] = &source_c->stream; + sources_stream[i] = &source->stream; } - buffer_release(source_c); j++; } @@ -536,11 +522,8 @@ static int mux_process(struct processing_module *mod, j = 0; list_for_item(clist, &dev->bsource_list) { source = container_of(clist, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - if (source_c->source->state == dev->state) + if (source->source->state == dev->state) mod->input_buffers[j].consumed = source_bytes; - - buffer_release(source_c); j++; } mod->output_buffers[0].size = sink_bytes; @@ -560,10 +543,7 @@ static int mux_reset(struct processing_module *mod) list_for_item(blist, &dev->bsource_list) { struct comp_buffer *source = container_of(blist, struct comp_buffer, sink_list); - struct comp_buffer *source_c = buffer_acquire(source); - int state = source_c->source->state; - - buffer_release(source_c); + int state = source->source->state; /* only mux the sources with the same state with mux */ if (state > COMP_STATE_READY) @@ -586,8 +566,6 @@ static int mux_prepare(struct processing_module *mod, struct list_item *blist; struct comp_buffer *source; struct comp_buffer *sink; - struct comp_buffer *source_c; - struct comp_buffer *sink_c; struct sof_mux_config *config; size_t blob_size; int state; @@ -628,10 +606,8 @@ static int mux_prepare(struct processing_module *mod, /* check each mux source state, set source align to 1 byte, 1 frame */ list_for_item(blist, &dev->bsource_list) { source = container_of(blist, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - state = source_c->source->state; - audio_stream_init_alignment_constants(1, 1, &source_c->stream); - buffer_release(source_c); + state = source->source->state; + audio_stream_init_alignment_constants(1, 1, &source->stream); /* only prepare downstream if we have no active sources */ if (state == COMP_STATE_PAUSED || state == COMP_STATE_ACTIVE) @@ -641,9 +617,7 @@ static int mux_prepare(struct processing_module *mod, /* set sink align to 1 byte, 1 frame */ list_for_item(blist, &dev->bsink_list) { sink = container_of(blist, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - audio_stream_init_alignment_constants(1, 1, &sink_c->stream); - buffer_release(sink_c); + audio_stream_init_alignment_constants(1, 1, &sink->stream); } /* prepare downstream */ diff --git a/src/audio/mux/mux_generic.c b/src/audio/mux/mux_generic.c index 51d5bcd70e9a..f2b513759f61 100644 --- a/src/audio/mux/mux_generic.c +++ b/src/audio/mux/mux_generic.c @@ -530,8 +530,7 @@ mux_func mux_get_processing_function(struct processing_module *mod) source_list); for (i = 0; i < ARRAY_SIZE(mux_func_map); i++) { - struct comp_buffer *sink_c = buffer_acquire(sinkb); - enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sink_c->stream); + enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sinkb->stream); if (fmt == mux_func_map[i].frame_format) @@ -554,10 +553,7 @@ demux_func demux_get_processing_function(struct processing_module *mod) sink_list); for (i = 0; i < ARRAY_SIZE(mux_func_map); i++) { - struct comp_buffer *source_c = buffer_acquire(sourceb); - enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&source_c->stream); - - buffer_release(source_c); + enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sourceb->stream); if (fmt == mux_func_map[i].frame_format) return mux_func_map[i].demux_proc_func; From dc3169aa5a5a09a115b9e5efc27ad2585b2addff Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:08:04 +0200 Subject: [PATCH 427/639] rtnr: remove buffer_acquire from rtnr.c remove buffer ops from rtnr.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/rtnr/rtnr.c | 49 ++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 31 deletions(-) diff --git a/src/audio/rtnr/rtnr.c b/src/audio/rtnr/rtnr.c index c726c9e64954..49db44eac1cb 100644 --- a/src/audio/rtnr/rtnr.c +++ b/src/audio/rtnr/rtnr.c @@ -325,7 +325,6 @@ static int rtnr_params(struct comp_dev *dev, struct sof_ipc_stream_params *param int ret; struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb, *sourceb; - struct comp_buffer *sink_c, *source_c; bool channels_valid; comp_info(dev, "rtnr_params()"); @@ -341,21 +340,17 @@ static int rtnr_params(struct comp_dev *dev, struct sof_ipc_stream_params *param sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - /* set source/sink_frames/rate */ - cd->source_rate = audio_stream_get_rate(&source_c->stream); - cd->sink_rate = audio_stream_get_rate(&sink_c->stream); - cd->sources_stream[0].rate = audio_stream_get_rate(&source_c->stream); - cd->sink_stream.rate = audio_stream_get_rate(&sink_c->stream); - channels_valid = audio_stream_get_channels(&source_c->stream) == - audio_stream_get_channels(&sink_c->stream); + cd->source_rate = audio_stream_get_rate(&sourceb->stream); + cd->sink_rate = audio_stream_get_rate(&sinkb->stream); + cd->sources_stream[0].rate = audio_stream_get_rate(&sourceb->stream); + cd->sink_stream.rate = audio_stream_get_rate(&sinkb->stream); + channels_valid = audio_stream_get_channels(&sourceb->stream) == + audio_stream_get_channels(&sinkb->stream); if (!cd->sink_rate) { comp_err(dev, "rtnr_nr_params(), zero sink rate"); - ret = -EINVAL; - goto out; + return -EINVAL; } /* Currently support 16kHz sample rate only. */ @@ -369,31 +364,25 @@ static int rtnr_params(struct comp_dev *dev, struct sof_ipc_stream_params *param default: comp_err(dev, "rtnr_nr_params(), invalid sample rate(%d kHz)", cd->source_rate); - ret = -EINVAL; - goto out; + return -EINVAL; } if (!channels_valid) { comp_err(dev, "rtnr_params(), source/sink stream must have same channels"); - ret = -EINVAL; - goto out; + return -EINVAL; } /* set source/sink stream channels */ - cd->sources_stream[0].channels = audio_stream_get_channels(&source_c->stream); - cd->sink_stream.channels = audio_stream_get_channels(&sink_c->stream); + cd->sources_stream[0].channels = audio_stream_get_channels(&sourceb->stream); + cd->sink_stream.channels = audio_stream_get_channels(&sinkb->stream); /* set source/sink stream overrun/underrun permitted */ - cd->sources_stream[0].overrun_permitted = audio_stream_get_overrun(&source_c->stream); - cd->sink_stream.overrun_permitted = audio_stream_get_overrun(&sink_c->stream); - cd->sources_stream[0].underrun_permitted = audio_stream_get_underrun(&source_c->stream); - cd->sink_stream.underrun_permitted = audio_stream_get_underrun(&sink_c->stream); - -out: - buffer_release(sink_c); - buffer_release(source_c); + cd->sources_stream[0].overrun_permitted = audio_stream_get_overrun(&sourceb->stream); + cd->sink_stream.overrun_permitted = audio_stream_get_overrun(&sinkb->stream); + cd->sources_stream[0].underrun_permitted = audio_stream_get_underrun(&sourceb->stream); + cd->sink_stream.underrun_permitted = audio_stream_get_underrun(&sinkb->stream); - return ret; + return 0; } static int rtnr_get_comp_config(struct comp_data *cd, struct sof_ipc_ctrl_data *cdata, @@ -874,10 +863,8 @@ static int rtnr_prepare(struct comp_dev *dev) /* Get sink data format */ sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - cd->sink_format = audio_stream_get_frm_fmt(&sink_c->stream); - cd->sink_stream.frame_fmt = audio_stream_get_frm_fmt(&sink_c->stream); - buffer_release(sink_c); + cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream); + cd->sink_stream.frame_fmt = audio_stream_get_frm_fmt(&sinkb->stream); /* Check source and sink PCM format and get processing function */ comp_info(dev, "rtnr_prepare(), sink_format=%d", cd->sink_format); From a63f6b61ebb85f87efb4e0f8e289b311e1659549 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Tue, 19 Sep 2023 12:51:50 +0200 Subject: [PATCH 428/639] dcblock: remove buffer_acquire from dcblock remove buffer ops from dcblock module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/dcblock/dcblock.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/src/audio/dcblock/dcblock.c b/src/audio/dcblock/dcblock.c index cc5024156eaa..8e52820341ba 100644 --- a/src/audio/dcblock/dcblock.c +++ b/src/audio/dcblock/dcblock.c @@ -221,7 +221,6 @@ static inline void dcblock_set_frame_alignment(struct audio_stream *source, static void dcblock_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct comp_dev *dev = mod->dev; @@ -231,14 +230,10 @@ static void dcblock_params(struct processing_module *mod) component_set_nearest_period_frames(dev, params->rate); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ipc4_update_buffer_format(sink_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(sink_c); + ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - ipc4_update_buffer_format(source_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(source_c); + ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); } #endif /* CONFIG_IPC_MAJOR_4 */ @@ -253,7 +248,6 @@ static int dcblock_prepare(struct processing_module *mod, { struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; comp_info(dev, "dcblock_prepare()"); @@ -266,18 +260,13 @@ static int dcblock_prepare(struct processing_module *mod, sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - /* get source data format */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); + cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream); /* get sink data format and period bytes */ - cd->sink_format = audio_stream_get_frm_fmt(&sink_c->stream); + cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream); - dcblock_set_frame_alignment(&source_c->stream, &sink_c->stream); - buffer_release(sink_c); - buffer_release(source_c); + dcblock_set_frame_alignment(&sourceb->stream, &sinkb->stream); dcblock_init_state(cd); cd->dcblock_func = dcblock_find_func(cd->source_format); From 5f47509b6757d260a22d1bf8f3e1e15be13b009f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 13:10:10 +0200 Subject: [PATCH 429/639] elf_file: Set of new functions for reading elf files A structure was created to represent a file, a section and a strings section. Created a new functions to read a elf file, retrieve a section header based on index or name, read a section contents based on a header or name, retrieve section name and functions that print file, section and program headers. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 1 + src/elf_file.c | 571 ++++++++++++++++++++++++++++++++++ src/include/rimage/elf_file.h | 178 +++++++++++ 3 files changed, 750 insertions(+) create mode 100644 src/elf_file.c create mode 100644 src/include/rimage/elf_file.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f8b0c56a6f2..6413713617c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,7 @@ add_executable(rimage src/adsp_config.c src/misc_utils.c src/file_utils.c + src/elf_file.c tomlc99/toml.c ) diff --git a/src/elf_file.c b/src/elf_file.c new file mode 100644 index 000000000000..efb9cc912b4e --- /dev/null +++ b/src/elf_file.c @@ -0,0 +1,571 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> + +#include <rimage/elf_file.h> +#include <rimage/file_utils.h> +#include <rimage/misc_utils.h> + + /* Values for e_type. */ +static struct name_val e_type[] = { + NAME_VAL_ENTRY(ET_NONE), /* Unknown type. */ + NAME_VAL_ENTRY(ET_REL), /* Relocatable. */ + NAME_VAL_ENTRY(ET_EXEC), /* Executable. */ + NAME_VAL_ENTRY(ET_DYN), /* Shared object. */ + NAME_VAL_ENTRY(ET_CORE), /* Core file. */ + NAME_VAL_END +}; + +static struct name_val sh_types[] = { + NAME_VAL_ENTRY(SHT_NULL), /* inactive */ + NAME_VAL_ENTRY(SHT_PROGBITS), /* program defined information */ + NAME_VAL_ENTRY(SHT_SYMTAB), /* symbol table section */ + NAME_VAL_ENTRY(SHT_STRTAB), /* string table section */ + NAME_VAL_ENTRY(SHT_RELA), /* relocation section with addends */ + NAME_VAL_ENTRY(SHT_HASH), /* symbol hash table section */ + NAME_VAL_ENTRY(SHT_DYNAMIC), /* dynamic section */ + NAME_VAL_ENTRY(SHT_NOTE), /* note section */ + NAME_VAL_ENTRY(SHT_NOBITS), /* no space section */ + NAME_VAL_ENTRY(SHT_REL), /* relocation section - no addends */ + NAME_VAL_ENTRY(SHT_SHLIB), /* reserved - purpose unknown */ + NAME_VAL_ENTRY(SHT_DYNSYM), /* dynamic symbol table section */ + NAME_VAL_ENTRY(SHT_INIT_ARRAY), /* Initialization function pointers. */ + NAME_VAL_ENTRY(SHT_FINI_ARRAY), /* Termination function pointers. */ + NAME_VAL_ENTRY(SHT_PREINIT_ARRAY), /* Pre-initialization function ptrs. */ + NAME_VAL_ENTRY(SHT_GROUP), /* Section group. */ + NAME_VAL_ENTRY(SHT_SYMTAB_SHNDX), /* Section indexes (see SHN_XINDEX). */ + NAME_VAL_ENTRY(SHT_LOOS), /* First of OS specific semantics */ + NAME_VAL_ENTRY(SHT_HIOS), /* Last of OS specific semantics */ + NAME_VAL_ENTRY(SHT_GNU_VERDEF), + NAME_VAL_ENTRY(SHT_GNU_VERNEED), + NAME_VAL_ENTRY(SHT_GNU_VERSYM), + NAME_VAL_ENTRY(SHT_LOPROC), /* reserved range for processor */ + NAME_VAL_ENTRY(SHT_HIPROC), /* specific section header types */ + NAME_VAL_ENTRY(SHT_LOUSER), /* reserved range for application */ + NAME_VAL_ENTRY(SHT_HIUSER), /* specific indexes */ + NAME_VAL_END +}; + +/* Flags for sh_flags. */ +static struct name_val sh_flags[] = { + NAME_VAL_ENTRY(SHF_WRITE), /* Section contains writable data. */ + NAME_VAL_ENTRY(SHF_ALLOC), /* Section occupies memory. */ + NAME_VAL_ENTRY(SHF_EXECINSTR), /* Section contains instructions. */ + NAME_VAL_ENTRY(SHF_MERGE), /* Section may be merged. */ + NAME_VAL_ENTRY(SHF_STRINGS), /* Section contains strings. */ + NAME_VAL_ENTRY(SHF_INFO_LINK), /* sh_info holds section index. */ + NAME_VAL_ENTRY(SHF_LINK_ORDER), /* Special ordering requirements. */ + NAME_VAL_ENTRY(SHF_OS_NONCONFORMING), /* OS-specific processing required. */ + NAME_VAL_ENTRY(SHF_GROUP), /* Member of section group. */ + NAME_VAL_ENTRY(SHF_TLS), /* Section contains TLS data. */ + NAME_VAL_END +}; + +/* Values for p_type. */ +static struct name_val p_type[] = { + NAME_VAL_ENTRY(PT_NULL), /* Unused entry. */ + NAME_VAL_ENTRY(PT_LOAD), /* Loadable segment. */ + NAME_VAL_ENTRY(PT_DYNAMIC), /* Dynamic linking information segment. */ + NAME_VAL_ENTRY(PT_INTERP), /* Pathname of interpreter. */ + NAME_VAL_ENTRY(PT_NOTE), /* Auxiliary information. */ + NAME_VAL_ENTRY(PT_SHLIB), /* Reserved (not used). */ + NAME_VAL_ENTRY(PT_PHDR), /* Location of program header itself. */ + NAME_VAL_ENTRY(PT_TLS), /* Thread local storage segment */ + NAME_VAL_END +}; + +/* Values for p_flags. */ +static struct name_val p_flags[] = { + NAME_VAL_ENTRY(PF_X), /* Executable. */ + NAME_VAL_ENTRY(PF_W), /* Writable. */ + NAME_VAL_ENTRY(PF_R), /* Readable. */ + NAME_VAL_END +}; + +/** + * Print elf related error message + * + * @param elf elf file structure + * @param msg error message + * @param error error code to return + * @return error code + */ +static int elf_error(const struct elf_file *elf, const char *msg, int error) +{ + fprintf(stderr, "Error: %s: %s\n", elf->filename, msg); + return -error; +} + +/** + * Read elf header + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_header_read(struct elf_file *elf) +{ + size_t count; + + /* read in elf header */ + count = fread(&elf->header, sizeof(elf->header), 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read elf header", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + + if (strncmp((char *)elf->header.ident, "\177ELF\001\001", 5)) + return elf_error(elf, "Not a 32 bits ELF-LE file", EILSEQ); + + if (elf->header.version != EV_CURRENT) + return elf_error(elf, "Unsupported file version.", EINVAL); + + if (elf->header.ehsize < sizeof(Elf32_Ehdr)) + return elf_error(elf, "Invalid file header size.", EINVAL); + + if (elf->header.phoff >= elf->file_size) + return elf_error(elf, "Invalid program header file offset.", EINVAL); + + if (elf->header.phentsize < sizeof(Elf32_Phdr)) + return elf_error(elf, "Invalid program header size.", EINVAL); + + if (elf->header.phoff + elf->header.phnum * sizeof(Elf32_Phdr) > elf->file_size) + return elf_error(elf, "Invalid number of program header entries.", EINVAL); + + if (elf->header.shoff >= elf->file_size) + return elf_error(elf, "Invalid section header file offset.", EINVAL); + + if (elf->header.shentsize < sizeof(Elf32_Shdr)) + return elf_error(elf, "Invalid section header size.", EINVAL); + + if (elf->header.shoff + elf->header.shnum * sizeof(Elf32_Shdr) > elf->file_size) + return elf_error(elf, "Invalid number of section header entries.", EINVAL); + + if (elf->header.shstrndx >= elf->header.shnum) + return elf_error(elf, "Invalid section name strings section index.", EINVAL); + + return 0; +} + +void elf_header_print(const struct elf_file *elf) +{ + fprintf(stdout, "\tfile type\t 0x%8.8x ", elf->header.type); + print_enum(elf->header.type, e_type); + fprintf(stdout, "\tarchitecture\t 0x%8.8x\n", elf->header.machine); + fprintf(stdout, "\tformat version\t 0x%8.8x\n", elf->header.version); + fprintf(stdout, "\tarch flags\t 0x%8.8x\n", elf->header.flags); + fprintf(stdout, "\theader size\t 0x%8.8x\n", elf->header.ehsize); + fprintf(stdout, "\tentry point\t 0x%8.8x\n", elf->header.entry); + fprintf(stdout, "\tprogram offset\t 0x%8.8x\n", elf->header.phoff); + fprintf(stdout, "\tsection offset\t 0x%8.8x\n", elf->header.shoff); + fprintf(stdout, "\tprogram size\t 0x%8.8x\n", elf->header.phentsize); + fprintf(stdout, "\tprogram count\t 0x%8.8x\n", elf->header.phnum); + fprintf(stdout, "\tsection size\t 0x%8.8x\n", elf->header.shentsize); + fprintf(stdout, "\tsection count\t 0x%8.8x\n", elf->header.shnum); + fprintf(stdout, "\tstring index\t 0x%8.8x\n\n", elf->header.shstrndx); +} + +/** + * Read sections headers from elf file + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_section_headers_read(struct elf_file *elf) +{ + int i, ret; + size_t offset, count; + + elf->sections = calloc(elf->header.shnum, sizeof(struct elf_section_header)); + if (!elf->sections) + return elf_error(elf, "Cannot allocate section array.", ENOMEM); + + /* In case of error, sections memory are released in elf_open function. */ + + offset = elf->header.shoff; + for (i = 0; i < elf->header.shnum; i++, offset += elf->header.shentsize) { + ret = fseek(elf->file, offset, SEEK_SET); + if (ret) + return file_error("unable to seek to section header", elf->filename); + + count = fread(&elf->sections[i].data, sizeof(Elf32_Shdr), 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read section header", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + } + + elf->sections_count = elf->header.shnum; + return 0; +} + +/** + * Update name of a section in the section headers + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_set_sections_names(struct elf_file *elf, const struct elf_strings *strings) +{ + int ret, i; + + for (i = 0; i < elf->sections_count; i++) { + ret = elf_strings_get(strings, elf->sections[i].data.name, &elf->sections[i].name); + if (ret) + return ret; + } + + return 0; +} + +void elf_print_sections(const struct elf_file *elf) +{ + int i; + + for (i = 0; i < elf->sections_count; i++) { + fprintf(stdout, "Section %d:\n", i); + elf_section_header_print(&elf->sections[i]); + } +} + +/** + * Read program headers from elf file + * + * @param elf elf file structure + * @return error code, 0 when success + */ +static int elf_program_headers_read(struct elf_file *elf) +{ + int i, ret; + size_t offset, count; + + elf->programs = calloc(elf->header.phnum, sizeof(Elf32_Phdr)); + if (!elf->programs) + return elf_error(elf, "Cannot allocate program array.", ENOMEM); + + /* In case of error, programs memory are released in elf_open function. */ + + offset = elf->header.phoff; + for (i = 0; i < elf->header.phnum; i++, offset += elf->header.phentsize) { + ret = fseek(elf->file, offset, SEEK_SET); + if (ret) + return file_error("unable to seek to program header", elf->filename); + + count = fread(&elf->programs[i], sizeof(Elf32_Phdr), 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read program header", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + } + + elf->programs_count = elf->header.phnum; + return 0; +} + +void elf_print_programs(const struct elf_file *elf) +{ + int i; + + for (i = 0; i < elf->programs_count; i++) { + fprintf(stdout, "\nProgram %d:\n", i); + elf_program_header_print(&elf->programs[i]); + } +} + +/** + * Copy elf_header structure. Allocates a new copy of the name string. + * + * @param [in]src Source section header structure + * @param [out]dst Destination section header structure + * @return error code, 0 when success + */ +static int elf_section_header_copy(const struct elf_section_header *src, + struct elf_section_header *dst) +{ + if (src->name) { + dst->name = strdup(src->name); + if (!dst->name) + return -ENOMEM; + } else { + dst->name = NULL; + } + + memcpy(&dst->data, &src->data, sizeof(dst->data)); + return 0; +} + +int elf_section_header_get_by_index(const struct elf_file *elf, int index, + const struct elf_section_header **header) +{ + if (index >= elf->sections_count) + return elf_error(elf, "Invalid section index.", EINVAL); + + *header = &elf->sections[index]; + + return 0; +} + +int elf_section_header_get_by_name(const struct elf_file *elf, const char* name, + const struct elf_section_header **header) +{ + int i; + + *header = NULL; + + for (i = 0; i < elf->sections_count; i++) + if (strcmp(elf->sections[i].name, name) == 0) { + *header = &elf->sections[i]; + return 0; + } + + return -ENOENT; +} + +void elf_section_header_print(const struct elf_section_header *header) +{ + fprintf(stdout, "\tname\t\t0x%8.8x\n", header->data.name); + fprintf(stdout, "\tname\t\t%s\n", header->name); + fprintf(stdout, "\ttype\t\t0x%8.8x ", header->data.type); + print_enum(header->data.type, sh_types); + fprintf(stdout, "\tflags\t\t0x%8.8x ", header->data.flags); + print_flags(header->data.flags, sh_flags); + fprintf(stdout, "\taddr\t\t0x%8.8x\n", header->data.vaddr); + fprintf(stdout, "\toffset\t\t0x%8.8x\n", header->data.off); + fprintf(stdout, "\tsize\t\t0x%8.8x\n", header->data.size); + fprintf(stdout, "\tlink\t\t0x%8.8x\n", header->data.link); + fprintf(stdout, "\tinfo\t\t0x%8.8x\n", header->data.info); + fprintf(stdout, "\taddralign\t0x%8.8x\n", header->data.addralign); + fprintf(stdout, "\tentsize\t\t0x%8.8x\n\n", header->data.entsize); +} + +/** + * Release section header structure + * + * @param sec_hdr Section header structure + */ +static void elf_section_header_free(struct elf_section_header *sec_hdr) +{ + free(sec_hdr->name); + sec_hdr->name = NULL; +} + + +int elf_open(struct elf_file *elf, const char *filename) +{ + struct elf_strings names; + int ret = -ENOMEM; + + memset(elf, 0, sizeof(*elf)); + elf->filename = strdup(filename); + if (!elf->filename) { + ret = -ENOMEM; + goto err; + } + + elf->file = fopen(filename, "rb"); + if (!elf->file) { + ret = file_error("Unable to open elf file", elf->filename); + goto err; + } + + ret = get_file_size(elf->file, elf->filename, &elf->file_size); + if (ret) + goto err; + + ret = elf_header_read(elf); + if (ret) + goto err; + + ret = elf_program_headers_read(elf); + if (ret) + goto err; + + ret = elf_section_headers_read(elf); + if (ret) + goto err; + + ret = elf_strings_read_by_index(elf, elf->header.shstrndx, &names); + if (ret) + goto err; + + ret = elf_set_sections_names(elf, &names); + if (ret) { + elf_strings_free(&names); + goto err; + } + elf_strings_free(&names); + + return 0; + +err: + free(elf->filename); + free(elf->programs); + + if (elf->file) + fclose(elf->file); + + if (elf->sections) { + for (int i = 0; i < elf->sections_count; i++) + elf_section_header_free(&elf->sections[i]); + + free(elf->sections); + } + + return ret; +} + +/** +* Close elf file and release resources +* @param elf elf file structure +*/ +void elf_free(struct elf_file *elf) +{ + int i; + + free(elf->filename); + fclose(elf->file); + + for (i = 0; i < elf->sections_count; i++) + elf_section_header_free(&elf->sections[i]); + + free(elf->sections); + free(elf->programs); +} + +int elf_section_read_content(const struct elf_file *elf, const struct elf_section_header *header, + void *buffer, const size_t size) +{ + int ret; + size_t count; + + if ((header->data.type == SHT_NOBITS) || (header->data.type == SHT_NULL) || + !header->data.size) + return elf_error(elf, "Can't read section without data.", ENODATA); + + if (!header->data.off || (header->data.off + header->data.size) > elf->file_size) + return elf_error(elf, "Invalid section position in file.", ENFILE); + + if (header->data.size > size) + return elf_error(elf, "Output buffer too small.", ENOSPC); + + ret = fseek(elf->file, header->data.off, SEEK_SET); + if (ret) + return file_error("unable to seek to section data", elf->filename); + + count = fread(buffer, header->data.size, 1, elf->file); + if (count != 1) { + if (count < 0) + return file_error("failed to read section data", elf->filename); + else + return elf_error(elf, "Corrupted file.", ENODATA); + } + + return 0; +} + +int elf_section_read(const struct elf_file *elf, const struct elf_section_header *header, + struct elf_section *section) +{ + int ret; + + section->data = malloc(header->data.size); + if (!section->data) + return elf_error(elf, "No memory for section buffer.", ENOMEM); + + ret = elf_section_header_copy(header, §ion->header); + if (ret) + goto err; + + ret = elf_section_read_content(elf, header, section->data, header->data.size); + if (ret) + goto err; + + return 0; + +err: + elf_section_header_free(§ion->header); + free(section->data); + return ret; +} + +int elf_section_read_by_name(const struct elf_file *elf, const char *name, + struct elf_section *section) +{ + const struct elf_section_header *header; + int ret; + + ret = elf_section_header_get_by_name(elf, name, &header); + + if (ret) + return ret; + + return elf_section_read(elf, header, section); +} + +void elf_section_free(struct elf_section *section) +{ + free(section->data); +} + +int elf_strings_read_by_index(const struct elf_file *elf, int index, struct elf_strings *strings) +{ + const struct elf_section_header *header; + int ret; + + ret = elf_section_header_get_by_index(elf, index, &header); + if (ret) + return ret; + + if (header->data.type != SHT_STRTAB) + return elf_error(elf, "Invalid section type.", EINVAL); + + ret = elf_section_read(elf, header, &strings->section); + if (ret) + return elf_error(elf, "Unable to read section names section.", ret); + + return 0; +} + +int elf_strings_get(const struct elf_strings *strings, int index, char **str) +{ + if (index >= strings->section.header.data.size) + return -EINVAL; + + *str = strdup((const char *)strings->section.data + index); + if (!*str) + return -ENOMEM; + + return 0; +} + +void elf_strings_free(struct elf_strings *strings) +{ + elf_section_free(&strings->section); +} + +void elf_program_header_print(const Elf32_Phdr *header) +{ + fprintf(stdout, "\ttype\t 0x%8.8x ", header->type); + print_enum(header->type, p_type); + fprintf(stdout, "\tflags\t 0x%8.8x ", header->flags); + print_flags(header->flags, p_flags); + fprintf(stdout, "\toffset\t 0x%8.8x\n", header->off); + fprintf(stdout, "\tvaddr\t 0x%8.8x\n", header->vaddr); + fprintf(stdout, "\tpaddr\t 0x%8.8x\n", header->paddr); + fprintf(stdout, "\tfilesz\t 0x%8.8x\n", header->filesz); + fprintf(stdout, "\tmemsz\t 0x%8.8x\n", header->memsz); + fprintf(stdout, "\talign\t 0x%8.8x\n\n", header->align); +} diff --git a/src/include/rimage/elf_file.h b/src/include/rimage/elf_file.h new file mode 100644 index 000000000000..13bfe98cf1f7 --- /dev/null +++ b/src/include/rimage/elf_file.h @@ -0,0 +1,178 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#ifndef __ELF_FILE_H__ +#define __ELF_FILE_H__ + +#include <stddef.h> + +#include "elf.h" + +struct elf_section_header { + Elf32_Shdr data; + char *name; +}; + +struct elf_section { + struct elf_section_header header; + void *data; +}; + +struct elf_strings { + struct elf_section section; +}; + +struct elf_file { + FILE *file; + char *filename; + size_t file_size; + Elf32_Ehdr header; + struct elf_section_header *sections; + Elf32_Phdr *programs; + uint16_t sections_count; + uint16_t programs_count; +}; + +/** + * Open elf file + * + * @param [out]elf elf file structure + * @param [in]filename File name to open + * @return error code, 0 when success + */ +int elf_open(struct elf_file *elf, const char *filename); + +/** + * Close elf file and release resources + * + * @param elf elf file structure + */ +void elf_free(struct elf_file *elf); + +/** + * Print elf file header + * + * @param elf elf file structure + */ +void elf_header_print(const struct elf_file *elf); + +/** + * Print program headers + * + * @param elf elf file structure + */ +void elf_print_programs(const struct elf_file *elf); + +/** + * Print single program header + * + * @param header program header structure + */ +void elf_program_header_print(const Elf32_Phdr *header); + +/** + * Print elf sections headers + * + * @param elf elf file structure + */ +void elf_print_sections(const struct elf_file *elf); + +/** + * Return section header by index + * + * @param [in]elf elf file structure + * @param [in]index section index + * @param [out]header section header data + * @return error code, 0 when success + */ +int elf_section_header_get_by_index(const struct elf_file *elf, int index, + const struct elf_section_header **header); + +/** + * Return section header by index + * + * @param [in]elf elf file structure + * @param [in]index section index + * @param [out]header section header data + * @return error code, 0 when success + */ +int elf_section_header_get_by_name(const struct elf_file *elf, const char* name, + const struct elf_section_header **header); +/** + * Print elf section header + * + * @param header section header structure + */ +void elf_section_header_print(const struct elf_section_header *header); + +/** + * Read elf section using given header + * + * @param [in]elf elf file structure + * @param [in]header section header + * @param [out]section section data + * @return error code, 0 when success + */ +int elf_section_read(const struct elf_file *elf, const struct elf_section_header *header, + struct elf_section *section); + +/** +* Read elf section using given header to specified buffer +* +* @param [in]elf elf file structure +* @param [in]header section header +* @param [out]buffer buffer for a section data +* @param [in]size buffer size +* @return error code, 0 when success +*/ +int elf_section_read_content(const struct elf_file *elf, const struct elf_section_header *header, + void *buffer, const size_t size); + +/** + * Read elf section with given name + * + * @param [in]elf elf file structure + * @param [in]name section name + * @param [out]section section data + * @return error code, 0 when success + */ +int elf_section_read_by_name(const struct elf_file *elf, const char *name, struct elf_section *section); + +/** + * Release section + * + * @param [in]section section structure + */ +void elf_section_free(struct elf_section *section); + +/** + * Read elf strings section with given index + * + * @param [in]elf elf file structure + * @param [in]index strings section index + * @param [out]strings strings section data + * @return error code, 0 when success + */ +int elf_strings_read_by_index(const struct elf_file *elf, int index, struct elf_strings *strings); + +/** + * Get string value. Allocate new copy using strdup. + * + * @param [in]strings strings section structure + * @param [in]index string index + * @param [out]str Pointer to the variable in which the pointer to the allocated string will be placed + * @return error code, 0 when success + */ +int elf_strings_get(const struct elf_strings *strings, int index, char **str); + +/** + * Release string section + * @param [in]strings strings section structure + */ +void elf_strings_free(struct elf_strings *strings); + +#endif /* __ELF_FILE_H__ */ From 539c2b388cc54ef6e7427ea55c6a77d7636bf99b Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 13:10:50 +0200 Subject: [PATCH 430/639] module: Set of a new functions to parse modules A structure was created to represent the module, module section and section informations. Added a set of new functions for parsing a module and reading its contents. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/include/rimage/module.h | 190 ++++++++++++++ src/module.c | 503 ++++++++++++++++++++++++++++++++++++ 2 files changed, 693 insertions(+) create mode 100644 src/include/rimage/module.h create mode 100644 src/module.c diff --git a/src/include/rimage/module.h b/src/include/rimage/module.h new file mode 100644 index 000000000000..3c265b20823b --- /dev/null +++ b/src/include/rimage/module.h @@ -0,0 +1,190 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#ifndef __MODULE_H__ +#define __MODULE_H__ + +#include <stdint.h> +#include <stdbool.h> +#include <stdio.h> + +#include <rimage/elf_file.h> + +enum module_section_type { + MST_UNKNOWN, MST_DATA, MST_TEXT, MST_BSS, MST_NOTE +}; + +struct module_section { + const struct elf_section_header *header; + enum module_section_type type; + + /* The contents of the section lie in the rom memory space */ + bool rom; + + /* ADSP devices have their RAM regions mapped twice. The first mapping is set in the CPU + * to bypass the L1 cache, and so access through pointers in that region is coherent between + * CPUs (but slow). The second region accesses the same memory through the L1 cache and + * requires careful flushing when used with shared data. + * + * This distinction is exposed in the linker script, where some symbols (e.g. stack regions) + * are linked into cached memory, but others (general kernel memory) are not. + * + * Addresses of sections belonging to a rom memory are not converted. */ + + /* section virtual address, converted to cached address space */ + uint32_t address; + + /* section physical load address, converted to cached address space */ + uint32_t load_address; + + size_t size; + + /* next section of this type */ + struct module_section *next_section; +}; + +struct module_sections_info { + /* start address */ + uint32_t start; + + /* end address */ + uint32_t end; + + /* size without any gaps */ + size_t size; + + /* size include gap to nearest page */ + size_t file_size; + + /* sections count */ + unsigned int count; + + /* First section */ + struct module_section *first_section; +}; + +/* + * ELF module data + */ +struct module { + struct elf_file elf; + + /* Array of valid sections */ + struct module_section *sections; + + /* Number of valid sections */ + unsigned int num_sections; + + struct module_sections_info text; + struct module_sections_info data; + struct module_sections_info bss; +}; + +struct image; +struct memory_alias; +struct memory_config; + +/** + * Convert uncached memory address to cached + * + * @param alias alias memory configration + * @param address address to be converted + * @return cached address + */ +unsigned long uncache_to_cache(const struct memory_alias *alias, unsigned long address); + + +/** + * Load module file + * + * @param module module structure + * @param filename module file name + * @param verbose verbose logging selection + * @return error code + */ +int module_open(struct module *module, const char *filename, const bool verbose); + +/** + * Unloads module + * + * @param module module structure + */ +void module_close(struct module *module); + +/** + * Parse module sections + * + * @param module module structure + * @param mem_cfg memory configration structure + * @param verbose verbose logging selection + * @return error code + */ +void module_parse_sections(struct module *module, const struct memory_config *mem_cfg, + bool verbose); + +/** + * Read module section to memory buffer + * + * @param [in]module module structure + * @param [in]section module section structure + * @param [out]buffer destination buffer + * @param [in]size destination buffer size + * @return error code + */ +int module_read_section(const struct module *module, const struct module_section *section, + void *buffer, const size_t size); + +/** + * Read module section and write it to a file + * + * @param module module structure + * @param section module section structure + * @param padding count of padding bytes to write after section content + * @param out_file destination file handle + * @param filename output file name used to print error message + * @return error code + */ +int module_write_section(const struct module *module, const struct module_section *section, + const int padding, FILE *out_file, const char *filename); + +/** + * Read whole module elf file to a memory buffer + * + * @param [in]module module structure + * @param [out]buffer destination buffer + * @param [in]size destination buffer size + * @return error code + */ +int module_read_whole_elf(const struct module *module, void *buffer, size_t size); + +/** + * Read whore module elf file and write it to a file + * + * @param module module structure + * @param out_file destination file handle + * @param filename output file name used to print error message + * @return error code + */ +int module_write_whole_elf(const struct module *module, FILE *out_file, const char *filename); + +/** + * Displays information about the occupancy of each memory zone + * + * @param module module structure + */ +void module_print_zones(const struct module *module); + +/** + * Checks all modules to make sure their sections do not overlap with each other + * + * @param module module structure + * @param image program global structure + * @return error code + */ +int modules_validate(const struct image *image); + +#endif /* __MODULE_H__ */ diff --git a/src/module.c b/src/module.c new file mode 100644 index 000000000000..0fb4de075de7 --- /dev/null +++ b/src/module.c @@ -0,0 +1,503 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Adrian Warecki <adrian.warecki@intel.com> + */ + +#include <string.h> +#include <stdlib.h> +#include <errno.h> +#include <assert.h> + +#include <rimage/module.h> +#include <rimage/elf_file.h> +#include <rimage/file_utils.h> +#include <rimage/rimage.h> + + +int module_read_section(const struct module *module, const struct module_section *section, + void *buffer, const size_t size) +{ + return elf_section_read_content(&module->elf, section->header, buffer, size); +} + +int module_write_section(const struct module *module, const struct module_section *section, + const int padding, FILE *out_file, const char *filename) +{ + int ret; + struct elf_section section_data; + size_t count; + char padding_buf[4]; + + ret = elf_section_read(&module->elf, section->header, §ion_data); + if (ret) + return ret; + + /* write out section data */ + count = fwrite(section_data.data, section->size, 1, out_file); + if (count != 1) { + ret = file_error("cant write section", filename); + goto out; + } + + /* write padding data */ + if (padding) { + assert(padding <= sizeof(padding_buf)); + + memset(padding_buf, 0, padding); + count = fwrite(padding_buf, padding, 1, out_file); + if (count != 1) { + ret = file_error("cant write padding", filename); + goto out; + } + } + +out: + elf_section_free(§ion_data); + return ret; +} + +int module_read_whole_elf(const struct module *module, void *buffer, size_t size) +{ + int ret; + size_t count; + + if (module->elf.file_size > size) { + fprintf(stderr, "error: Output buffer too small.\n"); + return -ENOSPC; + } + + /* read in file data */ + ret = fseek(module->elf.file, 0, SEEK_SET); + if (ret) + return file_error("can't seek set", module->elf.filename); + + count = fread(buffer, module->elf.file_size, 1, module->elf.file); + if (count != 1) + return file_error("can't read data", module->elf.filename); + + return ret; +} + +int module_write_whole_elf(const struct module *module, FILE *out_file, const char *filename) +{ + int ret; + char *buffer; + size_t count; + + /* alloc data data */ + buffer = calloc(1, module->elf.file_size); + if (!buffer) + return -ENOMEM; + + ret = module_read_whole_elf(module, buffer, module->elf.file_size); + if (ret) + goto out; + + /* write out section data */ + count = fwrite(buffer, module->elf.file_size, 1, out_file); + if (count != 1) { + ret = file_error("can't write data", "");// TODO: image->out_file); + goto out; + } + +out: + free(buffer); + return ret; +} + +void module_print_zones(const struct module *module) +{ + fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + + fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->text.start, module->text.end, + module->text.end - module->text.start); + fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", + module->data.start, module->data.end, + module->data.end - module->data.start); + fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n", + module->bss.start, module->bss.end, + module->bss.end - module->bss.start); +} + +/** + * Print a list of valid program headers + * + * @param module pointer to a module structure + */ +static void module_print_programs(const struct module *module) +{ + const Elf32_Phdr *header; + int i; + + /* check each program */ + for (i = 0; i < module->elf.header.phnum; i++) { + header = &module->elf.programs[i]; + + if (header->filesz == 0 || header->type != PT_LOAD) + continue; + + fprintf(stdout, "%s program-%d:\n", module->elf.filename, i); + elf_program_header_print(header); + } +} + +/** + * Goes through program headers array to find the physical address based on the virtual address. + * + * @param elf elf file structure + * @param vaddr virtual address + * @return physical address when success, virtual address on error + */ +static uint32_t find_physical_address(struct elf_file *file, size_t vaddr) +{ + uint16_t i; + const Elf32_Phdr *prog; + + for (i = 0; i < file->programs_count; i++) { + prog = &file->programs[i]; + + if (prog->type != PT_LOAD) + continue; + + if (vaddr >= prog->vaddr && vaddr < (prog->vaddr + file->programs[i].memsz)) + return file->programs[i].paddr + vaddr - prog->vaddr; + } + + return vaddr; +} + +unsigned long uncache_to_cache(const struct memory_alias *alias, unsigned long address) +{ + return (address & ~alias->mask) | alias->cached; +} + +/** + * Checks if the section is placed in the rom memory address space + * + * @param config Memory configuration structure + * @param section section to be checked + * @return true if section is placed in rom memory address space + */ +static bool section_is_rom(const struct memory_config *config, + const struct elf_section_header *section) +{ + uint32_t sect_start, sect_end; + uint32_t rom_start, rom_end; + + sect_start = section->data.vaddr; + sect_end = sect_start + section->data.size; + + rom_start = config->zones[SOF_FW_BLK_TYPE_ROM].base; + rom_end = rom_start + config->zones[SOF_FW_BLK_TYPE_ROM].size; + + if (sect_end <= rom_start || sect_start >= rom_end) + return false; + if (sect_start >= rom_start && sect_end <= rom_end) + return true; + + fprintf(stderr, "Warning! Section %s partially overlaps with rom memory.\n", section->name); + return false; +} + +/** + * Initialize module_sections_info structure + * + * @param info Pointer to a module_sections_info structure + */ +static void sections_info_init(struct module_sections_info *info) +{ + memset(info, 0, sizeof(*info)); + + info->start = UINT32_MAX; +} + +/** + * Adds section to module_sections_info structure + * + * @param info Pointer to a module_sections_info structure + * @param address section address + * @param size section size + */ +static void sections_info_add(struct module_sections_info *info, const uint32_t address, + const size_t size) +{ + const uint32_t end = address + size; + + if (address < info->start) + info->start = address; + + if (end > info->end) + info->end = end; + + info->size += size; + info->count++; +} + +/** + * Calculates file size after adding all sections + * + * @param info Pointer to a module_sections_info structure + */ +static void sections_info_finalize(struct module_sections_info *info) +{ + info->file_size = info->end - info->start; + + /* file sizes round up to nearest page */ + info->file_size = (info->file_size + MAN_PAGE_SIZE - 1) & ~(MAN_PAGE_SIZE - 1); +} + +/** + * Checks the section header (type and flags) to determine the section type. + * + * @param section section header + * @return enum module_section_type + */ +static enum module_section_type get_section_type(const struct elf_section_header *section) +{ + switch (section->data.type) { + case SHT_INIT_ARRAY: + /* fall through */ + case SHT_PROGBITS: + /* text or data */ + return (section->data.flags & SHF_EXECINSTR) ? MST_TEXT : MST_DATA; + + case SHT_NOBITS: + /* bss or heap */ + return MST_BSS; + + case SHT_NOTE: + return MST_NOTE; + + default: + return MST_UNKNOWN; + } +} + +void module_parse_sections(struct module *module, const struct memory_config *mem_cfg, bool verbose) +{ + const uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + uint16_t i; + + struct module_section *out_section = module->sections; + + fprintf(stdout, " Found %d sections, listing valid sections...\n", + module->elf.sections_count); + + fprintf(stdout, "\tNo\tLMA\t\tVMA\t\tEnd\t\tSize\tType\tName\n"); + + /* parse each section */ + for (i = 0; i < module->elf.sections_count; i++) { + const struct elf_section_header *sect = &module->elf.sections[i]; + struct module_sections_info *info = NULL; + + /* only write valid sections */ + if (!(sect->data.flags & valid)) + continue; + + /* Comment from fix_elf_addrs.py: + * The sof-derived linker scripts currently emit some zero-length sections + * at address zero. This is benign, and the linker is happy + * + * So we gleefully skip them. */ + if (sect->data.size == 0) + continue; + + out_section->header = sect; + out_section->size = sect->data.size; + out_section->type = get_section_type(sect); + out_section->rom = section_is_rom(mem_cfg, sect); + out_section->address = sect->data.vaddr; + out_section->load_address = find_physical_address(&module->elf, sect->data.vaddr); + + /* Don't convert ROM addresses, ROM sections aren't included in the output image */ + if (!out_section->rom) { + /* Walk the sections in the ELF file, changing the VMA/LMA of each uncached section + * to the equivalent address in the cached area of memory. */ + out_section->address = uncache_to_cache(&mem_cfg->alias, + out_section->address); + out_section->load_address = uncache_to_cache(&mem_cfg->alias, + out_section->load_address); + } + + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8zx\t0x%zx", i, + out_section->load_address, out_section->address, + out_section->address + out_section->size, out_section->size); + + + switch (out_section->type) { + case MST_DATA: + info = &module->data; + fprintf(stdout, "\tDATA"); + break; + + case MST_TEXT: + info = &module->text; + fprintf(stdout, "\tTEXT"); + break; + + case MST_BSS: + info = &module->bss; + fprintf(stdout, "\tBSS"); + break; + + case MST_NOTE: + fprintf(stdout, "\tNOTE"); + break; + + default: + break; + } + + if (out_section->rom) { + /* ROM sections aren't included in the output image */ + fprintf(stdout, " ROM"); + } else { + /* Add section to list */ + if (info) { + sections_info_add(info, out_section->load_address, out_section->size); + out_section->next_section = info->first_section; + info->first_section = out_section; + } + } + + module->num_sections++; + out_section++; + + /* section name */ + fprintf(stdout, "\t%s\n", sect->name); + + if (verbose) { + fprintf(stdout, "%s section-%d:\n", module->elf.filename, i); + elf_section_header_print(sect); + } + } + + sections_info_finalize(&module->text); + sections_info_finalize(&module->data); + sections_info_finalize(&module->bss); + + size_t fw_size = module->data.size + module->text.size; + + fprintf(stdout, " module: input size %zd (0x%zx) bytes %d sections\n", + fw_size, fw_size, module->num_sections); + fprintf(stdout, " module: text %zu (0x%zx) bytes\n" + "\tdata %zu (0x%zx) bytes\n" + "\tbss %zu (0x%zx) bytes\n\n", + module->text.size, module->text.size, + module->data.size, module->data.size, + module->bss.size, module->bss.size); +} + +int module_open(struct module *module, const char *filename, const bool verbose) +{ + int ret; + + memset(module, 0, sizeof(*module)); + + ret = elf_open(&module->elf, filename); + if (ret) + return ret; + + if (verbose) { + fprintf(stdout, "%s elf header:\n", module->elf.filename); + elf_header_print(&module->elf); + module_print_programs(module); + } + + module->sections = calloc(module->elf.sections_count, sizeof(struct module_section)); + if (!module->sections) { + elf_free(&module->elf); + return -ENOMEM; + } + + sections_info_init(&module->data); + sections_info_init(&module->bss); + sections_info_init(&module->text); + + return 0; +} + +void module_close(struct module *module) +{ + elf_free(&module->elf); +} + +/** + * Checks if the contents of the section overlaps + * + * @param a first section to check + * @param b second section to check + * @return true if space of a sections overlap + */ +static bool section_check_overlap(const struct module_section *a, const struct module_section *b) +{ + uint32_t a_start = a->address; + uint32_t a_end = a_start + a->size; + + uint32_t b_start = b->address; + uint32_t b_end = b_start + b->size; + + /* is section start overlapping ? */ + return (a_start >= b_start && a_start < b_end) || + /* is section end overlapping ? */ + (a_end > b_start && a_end <= b_end); +} + +/** + * Checks if the contents of the modules overlaps + * + * @param mod first module to check + * @param mod2 second module to check + * @return error code + */ +static int module_check_overlap(const struct module *mod, const struct module *mod2) +{ + unsigned int i, j; + + /* for each section from first module */ + for (i = 0; i < mod->num_sections; i++) { + /* and for each section from second module */ + for (j = 0; j < mod2->num_sections; j++) { + const struct module_section *section = &mod->sections[i]; + const struct module_section *section2 = &mod2->sections[j]; + + /* don't compare section with itself */ + if (section == section2) + continue; + + /* check section overlapping */ + if (section_check_overlap(section, section2)) { + + fprintf(stderr, "error: Detected overlapping sections:\n"); + fprintf(stderr, "\t[0x%x : 0x%zx] %s from %s\n", section->address, + section->address + section->size - 1, + section->header->name, mod->elf.filename); + fprintf(stderr, "\t[0x%x : 0x%zx] %s from %s\n", section2->address, + section2->address + section2->size - 1, + section2->header->name, mod2->elf.filename); + + return -EINVAL; + } + } + } + + return 0; +} + +int modules_validate(const struct image *image) +{ + int i, j, ret; + + for (i = 0; i < image->num_modules; i++) { + for (j = 0; j < image->num_modules; j++) { + ret = module_check_overlap(&image->module[i].file, &image->module[j].file); + if (ret) + return ret; + } + } + + return 0; +} From 71553274b5690b672a8955afcf8a0f9bb52f98ee Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Fri, 31 Mar 2023 13:15:35 +0200 Subject: [PATCH 431/639] Switch to new elf reader and module parse functions. Moved the module information to the new module structure. Used new functions to parse module. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- CMakeLists.txt | 2 +- src/ext_manifest.c | 74 +++---- src/file_simple.c | 189 +++++++----------- src/include/rimage/manifest.h | 38 +--- src/include/rimage/misc_utils.h | 2 + src/manifest.c | 337 ++++++++++++-------------------- src/rimage.c | 26 ++- 7 files changed, 257 insertions(+), 411 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6413713617c7..8e0a5da7d267 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,13 +18,13 @@ add_executable(rimage src/pkcs1_5.c src/manifest.c src/ext_manifest.c - src/elf.c src/rimage.c src/toml_utils.c src/adsp_config.c src/misc_utils.c src/file_utils.c src/elf_file.c + src/module.c tomlc99/toml.c ) diff --git a/src/ext_manifest.c b/src/ext_manifest.c index fb021e3dc270..c6d3c02e887e 100644 --- a/src/ext_manifest.c +++ b/src/ext_manifest.c @@ -41,7 +41,8 @@ static int ext_man_open_file(struct image *image) return 0; } -static const struct manifest_module *ext_man_find_module(const struct image *image) +static const struct elf_file *ext_man_find_module(const struct image *image, + const struct elf_section_header **section) { const struct manifest_module *module; int i; @@ -52,8 +53,9 @@ static const struct manifest_module *ext_man_find_module(const struct image *ima if (module->is_bootloader) continue; - if (elf_find_section(module, EXT_MAN_DATA_SECTION) >= 0) - return module; + if (!elf_section_header_get_by_name(&module->file.elf, EXT_MAN_DATA_SECTION, + section)) + return &module->file.elf; } return NULL; @@ -89,57 +91,45 @@ static int ext_man_validate(uint32_t section_size, const void *section_data) } } -static int ext_man_build(const struct manifest_module *module, +static int ext_man_build(const struct elf_file *file, const struct elf_section_header *section, struct ext_man_header **dst_buff) { - struct ext_man_header ext_man; - const Elf32_Shdr *section; - uint8_t *sec_buffer = NULL; - size_t offset; + struct ext_man_header *ext_man; + size_t size; int ret; - ret = elf_read_section(module, EXT_MAN_DATA_SECTION, §ion, - (void **)&sec_buffer); - if (ret < 0) { - fprintf(stderr, - "error: failed to read %s section content, code %d\n", - EXT_MAN_DATA_SECTION, ret); - goto out; + size = ext_man_template.header_size + section->data.size; + if (size % 4) { + fprintf(stderr, "error: extended manifest size must be aligned to 4\n"); + return -EINVAL; } - ret = 0; + + ext_man = calloc(1, size); + if (!ext_man) + return -ENOMEM; /* fill ext_man struct, size aligned to 4 to avoid unaligned accesses */ - memcpy(&ext_man, &ext_man_template, sizeof(struct ext_man_header)); - ext_man.full_size = ext_man.header_size; - ext_man.full_size += section->size; - if (ext_man.full_size % 4) { - fprintf(stderr, - "error: extended manifest size must be aligned to 4\n"); - ret = -EINVAL; - goto out; - } + memcpy(ext_man, &ext_man_template, ext_man_template.header_size); + ext_man->full_size = size; - *dst_buff = calloc(1, ext_man.full_size); - if (!*dst_buff) { - ret = -ENOMEM; - goto out; + ret = elf_section_read_content(file, section, ext_man + 1, + size - ext_man_template.header_size); + if (ret < 0) { + fprintf(stderr, "error: failed to read %s section content, code %d\n", + EXT_MAN_DATA_SECTION, ret); + free(ext_man); + return ret; } - /* fill buffer with ext_man and section content */ - memcpy(*dst_buff, &ext_man, ext_man.header_size); - offset = ext_man.header_size; - - memcpy(((char *)*dst_buff) + offset, sec_buffer, section->size); - -out: - free(sec_buffer); - return ret; + *dst_buff = ext_man; + return 0; } int ext_man_write(struct image *image) { - const struct manifest_module *module; + const struct elf_file *file; struct ext_man_header *ext_man = NULL; + const struct elf_section_header *section; int count; int ret; @@ -147,13 +137,13 @@ int ext_man_write(struct image *image) if (ret) goto out; - module = ext_man_find_module(image); - if (!module) { + file = ext_man_find_module(image, §ion); + if (!file) { ret = -ECANCELED; goto out; } - ret = ext_man_build(module, &ext_man); + ret = ext_man_build(file, section, &ext_man); if (ret) goto out; diff --git a/src/file_simple.c b/src/file_simple.c index f79cc4b50365..e87689f44133 100644 --- a/src/file_simple.c +++ b/src/file_simple.c @@ -12,17 +12,18 @@ #include <rimage/manifest.h> #include <rimage/file_utils.h> -static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *section) +static int get_mem_zone_type(const struct memory_config *memory, + const struct module_section *section) { uint32_t start, end, base, size; int i; - start = section->vaddr; - end = section->vaddr + section->size; + start = section->load_address; + end = start + section->size; for (i = SOF_FW_BLK_TYPE_START; i < SOF_FW_BLK_TYPE_NUM; i++) { - base = memory->zones[i].base; - size = memory->zones[i].size; + base = memory->zones[i].base; + size = memory->zones[i].size; if (start < base) continue; @@ -38,13 +39,12 @@ static int get_mem_zone_type(const struct memory_config *memory, Elf32_Shdr *sec static int block_idx; static int write_block(struct image *image, struct manifest_module *module, - Elf32_Shdr *section) + const struct module_section *section) { const struct adsp *adsp = image->adsp; struct snd_sof_blk_hdr block; uint32_t padding = 0; size_t count; - void *buffer; int ret; block.size = section->size; @@ -54,14 +54,14 @@ static int write_block(struct image *image, struct manifest_module *module, block.size += padding; } - ret = get_mem_zone_type(&image->adsp->mem, section); + ret = get_mem_zone_type(&adsp->mem, section); if (ret != SOF_FW_BLK_TYPE_INVALID) { block.type = ret; - block.offset = section->vaddr - adsp->mem.zones[ret].base + block.offset = section->load_address - adsp->mem.zones[ret].base + adsp->mem.zones[ret].host_offset; } else { - fprintf(stderr, "error: invalid block address/size 0x%x/0x%x\n", - section->vaddr, section->size); + fprintf(stderr, "error: invalid block address/size 0x%x/0x%zx\n", + section->load_address, section->size); return -EINVAL; } @@ -70,38 +70,19 @@ static int write_block(struct image *image, struct manifest_module *module, if (count != 1) return file_error("Write header failed", image->out_file); - /* alloc data data */ - buffer = calloc(1, block.size); - if (!buffer) - return -ENOMEM; - - /* read in section data */ - ret = fseek(module->fd, section->off, SEEK_SET); - if (ret) { - ret = file_error("seek to section failed", module->elf_file); - goto out; - } - count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) { - ret = file_error("cant read section", module->elf_file); - goto out; - } - /* write out section data */ - count = fwrite(buffer, 1, block.size, image->out_fd); - if (count != block.size) { - ret = file_error("cant write section", image->out_file); - fprintf(stderr, " foffset %d size 0x%x mem addr 0x%x\n", - section->off, section->size, section->vaddr); - goto out; + ret = module_write_section(&module->file, section, padding, image->out_fd, image->out_file); + if (ret) { + fprintf(stderr, "error: cant write section data. foffset %d size 0x%zx mem addr 0x%x\n", + section->header->data.off, section->size, section->load_address); + return ret; } - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8lx\t%s\n", block_idx++, - section->vaddr, section->size, ftell(image->out_fd), - block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); + fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%8.8lx\t%s\t%s\n", block_idx++, + section->load_address, section->size, ftell(image->out_fd), + block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA", + section->header->name); -out: - free(buffer); /* return padding size */ if (ret >= 0) return padding; @@ -109,18 +90,44 @@ static int write_block(struct image *image, struct manifest_module *module, return ret; } +/** + * Write all linked sections + * + * @param image program global structure + * @param module modules manifest description + * @param section module section descriptor + * @return size of used padding, error code on error + */ +static int write_blocks(struct image *image, struct manifest_module *module, + const struct module_section *section) +{ + int ret, padding = 0; + + while (section) { + ret = write_block(image, module, section); + if (ret < 0) { + fprintf(stderr, "error: failed to write section %s\n", + section->header->name); + return ret; + } + + padding += ret; + section = section->next_section; + } + + return padding; +} + static int simple_write_module(struct image *image, struct manifest_module *module) { struct snd_sof_mod_hdr hdr; - Elf32_Shdr *section; size_t count; - int i, err; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); + int err; int ptr_hdr, ptr_cur; - uint32_t padding = 0; + uint32_t padding; - hdr.num_blocks = module->num_sections - module->num_bss; - hdr.size = module->text_size + module->data_size + + hdr.num_blocks = module->file.text.count + module->file.data.count; + hdr.size = module->file.text.size + module->file.data.size + sizeof(struct snd_sof_blk_hdr) * hdr.num_blocks; hdr.type = SOF_FW_BASE; @@ -133,40 +140,22 @@ static int simple_write_module(struct image *image, struct manifest_module *modu if (count != 1) return file_error("failed to write section header", image->out_file); - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); + module_print_zones(&module->file); - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\tName\n"); - fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); - - for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; - - /* only write valid sections */ - if (!(module->section[i].flags & valid)) - continue; - - /* dont write bss */ - if (section->type == SHT_NOBITS) - continue; + /* Write text sections */ + err = write_blocks(image, module, module->file.text.first_section); + if (err < 0) + return err; + padding = err; - err = write_block(image, module, section); - if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", - i); + /* Write data sections */ + err = write_blocks(image, module, module->file.data.first_section); + if (err < 0) return err; - } - /* write_block will return padding size */ padding += err; - } + hdr.size += padding; /* Record current pointer, will set it back after overwriting hdr */ ptr_cur = ftell(image->out_fd); @@ -195,10 +184,9 @@ static int write_block_reloc(struct image *image, struct manifest_module *module { struct snd_sof_blk_hdr block; size_t count; - void *buffer; int ret; - block.size = module->file_size; + block.size = module->file.elf.file_size; block.type = SOF_FW_BLK_TYPE_DRAM; block.offset = 0; @@ -207,36 +195,14 @@ static int write_block_reloc(struct image *image, struct manifest_module *module if (count != 1) return file_error("cant write header", image->out_file); - /* alloc data data */ - buffer = calloc(1, module->file_size); - if (!buffer) - return -ENOMEM; - - /* read in section data */ - ret = fseek(module->fd, 0, SEEK_SET); - if (ret) { - ret = file_error("can't seek to section", module->elf_file); - goto out; - } - count = fread(buffer, 1, module->file_size, module->fd); - if (count != module->file_size) { - ret = file_error("can't read section", module->elf_file); - goto out; - } - - /* write out section data */ - count = fwrite(buffer, 1, module->file_size, image->out_fd); - if (count != module->file_size) { - ret = file_error("can't write section", image->out_file); - goto out; - } + ret = module_write_whole_elf(&module->file, image->out_fd, image->out_file); + if (ret) + return ret; fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%8.8lx\t%s\n", block_idx++, - 0, module->file_size, ftell(image->out_fd), + 0, module->file.elf.file_size, ftell(image->out_fd), block.type == SOF_FW_BLK_TYPE_IRAM ? "TEXT" : "DATA"); -out: - free(buffer); return ret; } @@ -247,24 +213,14 @@ static int simple_write_module_reloc(struct image *image, struct manifest_module int err; hdr.num_blocks = 1; - hdr.size = module->text_size + module->data_size; + hdr.size = module->file.text.size + module->file.data.size; hdr.type = SOF_FW_BASE; // module count = fwrite(&hdr, sizeof(hdr), 1, image->out_fd); if (count != 1) return file_error("failed to write section header", image->out_file); - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module_print_zones(&module->file); fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\t\tType\n"); @@ -294,8 +250,9 @@ int simple_write_firmware(struct image *image) for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; + module->output_size = module->file.data.size + module->file.text.size; module->output_size += sizeof(struct snd_sof_blk_hdr) * - (module->num_sections - module->num_bss); + (module->file.data.count + module->file.text.count); module->output_size += sizeof(struct snd_sof_mod_hdr) * hdr.num_modules; hdr.file_size += module->output_size; @@ -308,7 +265,7 @@ int simple_write_firmware(struct image *image) for (i = 0; i < image->num_modules; i++) { module = &image->module[i]; - fprintf(stdout, "writing module %d %s\n", i, module->elf_file); + fprintf(stdout, "writing module %d %s\n", i, module->file.elf.filename); if (image->reloc) ret = simple_write_module_reloc(image, module); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index c1f820c5a624..840cd7d797bf 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -7,54 +7,20 @@ #define __MANIFEST_H__ #include <stdint.h> -#include <stdio.h> #include <stdbool.h> #include <rimage/sof/user/manifest.h> #include <rimage/css.h> #include <rimage/cse.h> #include <rimage/plat_auth.h> -#include <rimage/elf.h> +#include <rimage/module.h> /* * Manifest module data */ struct manifest_module { - /* This fields will be moved to module structure */ - const char *elf_file; - FILE *fd; - - Elf32_Ehdr hdr; - Elf32_Shdr *section; - Elf32_Phdr *prg; - char *strings; - - uint32_t text_start; - uint32_t text_end; - uint32_t data_start; - uint32_t data_end; - uint32_t bss_start; - uint32_t bss_end; - - int num_sections; - int num_bss; - int bss_index; - - /* sizes do not include any gaps */ - int bss_size; - int text_size; - int data_size; - - /* sizes do include gaps to nearest page */ - int bss_file_size; - int text_file_size; - int data_file_size; - - /* total file size */ - size_t file_size; + struct module file; /* Following fields are used in manifest creation process */ - int fw_size; - bool is_bootloader; /* Size of the module in the output image. diff --git a/src/include/rimage/misc_utils.h b/src/include/rimage/misc_utils.h index 8ec051d74e91..e3432d57a391 100644 --- a/src/include/rimage/misc_utils.h +++ b/src/include/rimage/misc_utils.h @@ -8,6 +8,8 @@ #include <stdint.h> +#define DIV_ROUND_UP(val, div) (((val) + (div) - 1) / (div)) + /** * Reverses the order of bytes in the array * @param ptr pointer to a array diff --git a/src/manifest.c b/src/manifest.c index 673740ecaa87..19b73ee38e35 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -139,107 +139,58 @@ static int man_init_image_v2_5(struct image *image) return 0; } -/* we should call this after all segments size set up via iterate */ -static uint32_t elf_to_file_offset(struct image *image, - struct manifest_module *module, - struct sof_man_module *man_module, - Elf32_Shdr *section) -{ - uint32_t elf_addr = section->vaddr, file_offset = 0, i; - - if (section->type == SHT_PROGBITS || section->type == SHT_INIT_ARRAY) { - /* check programs for lma/vma change */ - for (i = 0; i < module->hdr.phnum; i++) { - if (section->vaddr == module->prg[i].vaddr) { - elf_addr = module->prg[i].paddr; - break; - } - } - if (section->flags & SHF_EXECINSTR) { - /* text segment */ - file_offset = elf_addr - module->text_start + - module->foffset; - } else { - /* rodata segment, append to text segment */ - file_offset = elf_addr - module->data_start + - module->foffset + module->text_fixup_size; - } - } else if (section->type == SHT_NOBITS) { - /* bss segment */ - file_offset = 0; - } - - return file_offset; -} - /* write SRAM sections */ -static int man_copy_sram(struct image *image, Elf32_Shdr *section, - struct manifest_module *module, - struct sof_man_module *man_module, - int section_idx) +static int man_copy_sram(struct image *image, const struct manifest_module *module, + const struct sof_man_segment_desc *segment, + const struct module_section *section) { - uint32_t offset = elf_to_file_offset(image, module, - man_module, section); - uint32_t end = offset + section->size; - int seg_type = -1; - void *buffer = image->fw_image + offset; - size_t count; + uint32_t offset, end; + int ret; + assert(section->load_address >= segment->v_base_addr); + offset = segment->file_offset + section->load_address - segment->v_base_addr; + end = offset + section->size; assert((uint64_t)offset + section->size <= image->adsp->image_size); - switch (section->type) { - case SHT_INIT_ARRAY: - /* fall through */ - case SHT_PROGBITS: - /* text or data */ - if (section->flags & SHF_EXECINSTR) - seg_type = SOF_MAN_SEGMENT_TEXT; - else - seg_type = SOF_MAN_SEGMENT_RODATA; - break; - case SHT_NOBITS: - seg_type = SOF_MAN_SEGMENT_BSS; - /* FALLTHRU */ - default: - return 0; - } - - /* file_offset for segment should not be 0s, we set it to - * the smallest offset of its modules ATM. - */ - if (man_module->segment[seg_type].file_offset > offset || - man_module->segment[seg_type].file_offset == 0) - man_module->segment[seg_type].file_offset = offset; - - count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) - return file_error("cant read section", module->elf_file); + ret = module_read_section(&module->file, section, image->fw_image + offset, + image->adsp->image_size - offset); + if (ret) + return ret; /* get module end offset ? */ if (end > image->image_end) image->image_end = end; - fprintf(stdout, "\t%d\t0x%x\t0x%x\t\t0x%x\t%s\n", section_idx, - section->vaddr, section->size, offset, - seg_type == SOF_MAN_SEGMENT_TEXT ? "TEXT" : "DATA"); + fprintf(stdout, "\t0x%x\t0x%zx\t\t0x%x\t%s\t%s\n", section->load_address, section->size, + offset, section->type == MST_TEXT ? "TEXT" : "DATA", section->header->name); return 0; } -static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, - struct manifest_module *module, - struct sof_man_module *man_module, int idx) +/** + * Write all linked sections + * + * @param image program global structure + * @param module modules manifest description + * @param section module section descriptor + * @return error code on error, 0 on success + */ +static int man_copy_elf_sections(struct image *image, struct manifest_module *module, + const struct sof_man_segment_desc *segment, + const struct module_section *section) { int ret; - /* seek to ELF section */ - ret = fseek(module->fd, section->off, SEEK_SET); - if (ret) - return file_error("can't seek to section", module->elf_file); + while (section) { + ret = man_copy_sram(image, module, segment, section); + if (ret < 0) { + fprintf(stderr, "error: failed to write section %s\n", + section->header->name); + return ret; + } - /* write data to DRAM or ROM image */ - if (!elf_is_rom(image, section)) - return man_copy_sram(image, section, module, man_module, idx); + section = section->next_section; + } return 0; } @@ -247,48 +198,40 @@ static int man_copy_elf_section(struct image *image, Elf32_Shdr *section, static int man_get_module_manifest(struct image *image, struct manifest_module *module, struct sof_man_module *man_module) { - Elf32_Shdr *section; + struct elf_section section; struct sof_man_segment_desc *segment; - struct sof_man_module_manifest sof_mod; - size_t count; - int ret, man_section_idx; - - fprintf(stdout, "Module Write: %s\n", module->elf_file); - - /* find manifest module data */ - man_section_idx = elf_find_section(module, ".module"); - if (man_section_idx < 0) - return -EINVAL; - - fprintf(stdout, " Manifest module metadata section at index %d\n", - man_section_idx); - section = &module->section[man_section_idx]; + const struct sof_man_module_manifest *sof_mod; + int ret; - /* load in manifest data */ - ret = fseek(module->fd, section->off, SEEK_SET); + fprintf(stdout, "Module Write: %s\n", module->file.elf.filename); - if (ret < 0) { - fprintf(stderr, "error: can't seek to section %d\n", ret); + /* load in module manifest data */ + ret = elf_section_read_by_name(&module->file.elf, ".module", §ion); + if (ret) { + fprintf(stderr, "error: can't read module manifest from '.module' section.\n"); return ret; } - count = fread(&sof_mod, 1, sizeof(sof_mod), module->fd); - if (count != sizeof(sof_mod)) - return file_error("can't read section", module->elf_file); + if (sizeof(*sof_mod) > section.header.data.size) { + fprintf(stderr, "error: Invalid module manifest in '.module' section.\n"); + ret = -ENODATA; + goto error; + } + sof_mod = section.data; /* configure man_module with sofmod data */ memcpy(man_module->struct_id, "$AME", 4); - man_module->entry_point = sof_mod.module.entry_point; - memcpy(man_module->name, sof_mod.module.name, SOF_MAN_MOD_NAME_LEN); - memcpy(man_module->uuid, sof_mod.module.uuid, 16); - man_module->affinity_mask = sof_mod.module.affinity_mask; - man_module->type.auto_start = sof_mod.module.type.auto_start; - man_module->type.domain_dp = sof_mod.module.type.domain_dp; - man_module->type.domain_ll = sof_mod.module.type.domain_ll; - man_module->type.load_type = sof_mod.module.type.load_type; + man_module->entry_point = sof_mod->module.entry_point; + memcpy(man_module->name, sof_mod->module.name, SOF_MAN_MOD_NAME_LEN); + memcpy(man_module->uuid, sof_mod->module.uuid, 16); + man_module->affinity_mask = sof_mod->module.affinity_mask; + man_module->type.auto_start = sof_mod->module.type.auto_start; + man_module->type.domain_dp = sof_mod->module.type.domain_dp; + man_module->type.domain_ll = sof_mod->module.type.domain_ll; + man_module->type.load_type = sof_mod->module.type.load_type; /* read out text_fixup_size from memory mapping */ - module->text_fixup_size = sof_mod.text_size; + module->text_fixup_size = sof_mod->text_size; /* text segment */ segment = &man_module->segment[SOF_MAN_SEGMENT_TEXT]; @@ -314,7 +257,9 @@ static int man_get_module_manifest(struct image *image, struct manifest_module * fprintf(stdout, " Entry point 0x%8.8x\n", man_module->entry_point); - return 0; +error: + elf_section_free(§ion); + return ret; } static inline const char *segment_name(int i) @@ -375,10 +320,9 @@ static int man_module_create(struct image *image, struct manifest_module *module struct sof_man_module *man_module) { /* create module and segments */ - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - Elf32_Shdr *section; - int i, err; + int err; unsigned int pages; + const struct elf_section_header *bss; image->image_end = 0; @@ -392,93 +336,92 @@ static int man_module_create(struct image *image, struct manifest_module *module /* max number of instances of this module ?? */ man_module->instance_max_count = 1; - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module_print_zones(&module->file); /* main module */ + fprintf(stdout, "\tAddress\t\tSize\t\tFile\tType\tName\n"); + /* text section is first */ - man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = - module->foffset; - man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = - module->text_start; + man_module->segment[SOF_MAN_SEGMENT_TEXT].file_offset = module->foffset; + man_module->segment[SOF_MAN_SEGMENT_TEXT].v_base_addr = module->file.text.start; /* calculates those padding 0s by the start of next segment */ - pages = module->text_file_size / MAN_PAGE_SIZE; - if (module->text_file_size % MAN_PAGE_SIZE) - pages += 1; + /* file_size is already aligned to MAN_PAGE_SIZE */ + pages = module->file.text.file_size / MAN_PAGE_SIZE; if (module->text_fixup_size == 0) - module->text_fixup_size = module->text_file_size; + module->text_fixup_size = module->file.text.file_size; /* check if text_file_size is bigger then text_fixup_size */ - if (module->text_file_size > module->text_fixup_size) { + if (module->file.text.file_size > module->text_fixup_size) { fprintf(stderr, "error: too small text size assigned!\n"); return -EINVAL; } man_module->segment[SOF_MAN_SEGMENT_TEXT].flags.r.length = pages; + /* Copy text sections content */ + err = man_copy_elf_sections(image, module, &man_module->segment[SOF_MAN_SEGMENT_TEXT], + module->file.text.first_section); + if (err) + return err; + + /* data section */ - man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = - module->data_start; - man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = - module->foffset + module->text_fixup_size; - pages = module->data_file_size / MAN_PAGE_SIZE; - if (module->data_file_size % MAN_PAGE_SIZE) - pages += 1; + man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = module->file.data.start; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = module->foffset + + module->text_fixup_size; + + /* file_size is already aligned to MAN_PAGE_SIZE */ + pages = module->file.data.file_size / MAN_PAGE_SIZE; man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + /* Copy data sections content */ + err = man_copy_elf_sections(image, module, &man_module->segment[SOF_MAN_SEGMENT_RODATA], + module->file.data.first_section); + if (err) + return err; + /* bss is last */ + + /* I do not understand why only the section named .bss was taken into account. Other + * sections of the same type were ignored (type = SHT_NOBITS, flags = SHF_ALLOC). I added + * the reading of the .bss section here, to not change the behavior of the program. + */ + bss = NULL; + + if (module->is_bootloader) { + /* Bootloader should not have .bss section. */ + fprintf(stdout, "info: ignore .bss section for bootloader module\n"); + } else { + err = elf_section_header_get_by_name(&module->file.elf, ".bss", &bss); + if (err) + fprintf(stderr, "warning: can't find '.bss' section in module %s.\n", + module->file.elf.filename); + + } + man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = - module->bss_start; - pages = (module->bss_end - module->bss_start) / MAN_PAGE_SIZE; - if ((module->bss_end - module->bss_start) % MAN_PAGE_SIZE) - pages += 1; + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = 0; + pages = 0; + + if (bss) { + man_module->segment[SOF_MAN_SEGMENT_BSS].v_base_addr = + uncache_to_cache(&image->adsp->mem.alias, bss->data.vaddr); + + pages = DIV_ROUND_UP(bss->data.size, MAN_PAGE_SIZE); + } + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.length = pages; if (pages == 0) { man_module->segment[SOF_MAN_SEGMENT_BSS].flags.ul = 0; - man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.type = - SOF_MAN_SEGMENT_EMPTY; + man_module->segment[SOF_MAN_SEGMENT_BSS].flags.r.type = SOF_MAN_SEGMENT_EMPTY; } - fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); - if (man_module_validate(man_module) < 0) return -EINVAL; - /* find all sections and copy to corresponding segments */ - for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; - - /* only check valid sections */ - if (!(section->flags & valid)) - continue; - - if (section->size == 0) - continue; - - /* text or data section */ - if (!elf_is_rom(image, section)) - err = man_copy_elf_section(image, section, module, - man_module, i); - - if (err < 0) { - fprintf(stderr, "error: failed to write section #%d\n", - i); - return err; - } - } fprintf(stdout, "\n"); /* no need to update end for exec headers */ @@ -507,9 +450,6 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * { /* create module and segments */ int err; - unsigned int pages; - void *buffer = image->fw_image + module->foffset; - size_t count; image->image_end = 0; @@ -523,17 +463,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * /* max number of instances of this module ?? */ man_module->instance_max_count = 1; - fprintf(stdout, "\n\tTotals\tStart\t\tEnd\t\tSize"); - - fprintf(stdout, "\n\tTEXT\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->text_start, module->text_end, - module->text_end - module->text_start); - fprintf(stdout, "\tDATA\t0x%8.8x\t0x%8.8x\t0x%x\n", - module->data_start, module->data_end, - module->data_end - module->data_start); - fprintf(stdout, "\tBSS\t0x%8.8x\t0x%8.8x\t0x%x\n\n ", - module->bss_start, module->bss_end, - module->bss_end - module->bss_start); + module_print_zones(&module->file); /* main module */ /* text section is first */ @@ -544,13 +474,9 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * /* data section */ man_module->segment[SOF_MAN_SEGMENT_RODATA].v_base_addr = 0; - man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = - module->foffset; - pages = module->data_file_size / MAN_PAGE_SIZE; - if (module->data_file_size % MAN_PAGE_SIZE) - pages += 1; - - man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = pages; + man_module->segment[SOF_MAN_SEGMENT_RODATA].file_offset = module->foffset; + man_module->segment[SOF_MAN_SEGMENT_RODATA].flags.r.length = module->file.data.file_size / + MAN_PAGE_SIZE; /* bss is last */ man_module->segment[SOF_MAN_SEGMENT_BSS].file_offset = 0; @@ -559,20 +485,17 @@ static int man_module_create_reloc(struct image *image, struct manifest_module * fprintf(stdout, "\tNo\tAddress\t\tSize\t\tFile\tType\n"); - /* seek to beginning of file */ - err = fseek(module->fd, 0, SEEK_SET); + assert((module->file.elf.file_size + module->foffset) <= image->adsp->image_size); + err = module_read_whole_elf(&module->file, image->fw_image + module->foffset, + image->image_end - module->foffset); if (err) - return file_error("can't seek to section", module->elf_file); - - count = fread(buffer, 1, module->file_size, module->fd); - if (count != module->file_size) - return file_error("can't read section", module->elf_file); + return err; fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8zx\t0x%x\t%s\n", 0, - 0, module->file_size, 0, "DATA"); + 0, module->file.elf.file_size, 0, "DATA"); fprintf(stdout, "\n"); - image->image_end = module->foffset + module->file_size; + image->image_end = module->foffset + module->file.elf.file_size; /* round module end up to nearest page */ if (image->image_end % MAN_PAGE_SIZE) { @@ -645,7 +568,7 @@ static int man_create_modules(struct image *image, struct sof_man_fw_desc *desc, module = &image->module[0]; fprintf(stdout, "Module: %s used as executable header\n", - module->elf_file); + module->file.elf.filename); module->exec_header = 1; /* set module file offset */ diff --git a/src/rimage.c b/src/rimage.c index 7c89e0921d18..735075c130cc 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -214,20 +214,23 @@ int main(int argc, char *argv[]) } /* getopt reorders argv[] */ - for (i = first_non_opt; i < argc; i++) { - /* When there is more than one module, then first one is bootloader. - * Does not apply to building a image of a loadable module. */ - image.module[i - first_non_opt].is_bootloader = image.num_modules > 1 && - i == first_non_opt && !image.loadable_module; - - fprintf(stdout, "\nModule Reading %s\n", argv[i]); - ret = elf_parse_module(&image, i - first_non_opt, argv[i]); + for (opt = first_non_opt; opt < argc; opt++) { + i = opt - first_non_opt; + fprintf(stdout, "\nModule Reading %s\n", argv[opt]); + ret = module_open(&image.module[i].file, argv[opt], image.verbose); if (ret < 0) goto out; + + module_parse_sections(&image.module[i].file, &image.adsp->mem, image.verbose); + + /* When there is more than one module, then first one is bootloader. + * Does not apply to building a image of a loadable module. */ + image.module[i].is_bootloader = image.num_modules > 1 && i == 0 && + !image.loadable_module; } /* validate all modules */ - ret = elf_validate_modules(&image); + ret = modules_validate(&image); if (ret < 0) goto out; @@ -272,5 +275,10 @@ int main(int argc, char *argv[]) if (image.out_fd) fclose(image.out_fd); + /* Free loaded modules */ + for (i = 0; i < image.num_modules; i++) { + module_close(&image.module[i].file); + } + return ret; } From 4fc431b355e1e818be19f5d533356cf21d80bfd3 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 30 Mar 2023 16:26:48 +0200 Subject: [PATCH 432/639] elf: Remove unused elf.c Removed elf.c file that is no longer in use. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- src/elf.c | 685 ------------------------------------ src/include/rimage/rimage.h | 10 - 2 files changed, 695 deletions(-) delete mode 100644 src/elf.c diff --git a/src/elf.c b/src/elf.c deleted file mode 100644 index 3843635d469f..000000000000 --- a/src/elf.c +++ /dev/null @@ -1,685 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// -// Copyright(c) 2017 Intel Corporation. All rights reserved. -// -// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> -// Keyon Jie <yang.jie@linux.intel.com> - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <errno.h> -#include <rimage/rimage.h> -#include <rimage/cse.h> -#include <rimage/manifest.h> -#include <rimage/file_utils.h> - -static unsigned long uncache_to_cache(const struct image *image, unsigned long address) -{ - return (address & ~image->adsp->mem.alias.mask) | image->adsp->mem.alias.cached; -} - -static int elf_read_sections(struct image *image, struct manifest_module *module, - int module_index) -{ - Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section = module->section; - size_t count; - int i, ret; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - unsigned long rom_base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; - size_t rom_size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; - - /* read in section header */ - ret = fseek(module->fd, hdr->shoff, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to %s section header %d\n", - module->elf_file, ret); - return ret; - } - - /* allocate space for each section header */ - section = calloc(hdr->shnum, sizeof(Elf32_Shdr)); - if (!section) - return -ENOMEM; - module->section = section; - - /* read in sections */ - count = fread(section, sizeof(Elf32_Shdr), hdr->shnum, module->fd); - if (count != hdr->shnum) { - fprintf(stderr, "error: failed to read %s section header %d\n", - module->elf_file, -errno); - return -errno; - } - - /* read in strings */ - assert(hdr->shstrndx < count); - module->strings = calloc(1, section[hdr->shstrndx].size); - if (!module->strings) { - fprintf(stderr, "error: failed %s to read ELF strings for %d\n", - module->elf_file, -errno); - return -errno; - } - - ret = fseek(module->fd, section[hdr->shstrndx].off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: can't seek to %s stringss %d\n", - module->elf_file, ret); - return ret; - } - - count = fread(module->strings, 1, section[hdr->shstrndx].size, - module->fd); - if (count != section[hdr->shstrndx].size) { - fprintf(stderr, "error: failed to read %s strings %d\n", - module->elf_file, -errno); - return -errno; - } - - if (module->is_bootloader) { - /* In case of multiple modules first one should be bootloader, - * that should not have these sections. - */ - fprintf(stdout, "info: ignore .bss" - " section for bootloader module\n"); - - module->bss_start = 0; - module->bss_end = 0; - } else { - /* find manifest module data */ - module->bss_index = elf_find_section(module, ".bss"); - if (module->bss_index < 0) - return module->bss_index; - } - - /* parse each section */ - for (i = 0; i < hdr->shnum; i++) { - /* only write valid sections */ - if (!(section[i].flags & valid)) - continue; - - switch (section[i].type) { - case SHT_NOBITS: - /* bss */ - module->bss_size += section[i].size; - module->num_bss++; - break; - case SHT_INIT_ARRAY: - /* fall through */ - case SHT_PROGBITS: - /* text or data */ - module->output_size += section[i].size; - - if (section[i].flags & SHF_EXECINSTR) - module->text_size += section[i].size; - else - module->data_size += section[i].size; - break; - default: - continue; - } - - /* - * Don't convert ROM addresses, ROM sections aren't included in - * the output image - */ - if (section[i].vaddr < rom_base || section[i].vaddr >= rom_base + rom_size) - section[i].vaddr = uncache_to_cache(image, section[i].vaddr); - - module->num_sections++; - - if (!image->verbose) - continue; - - fprintf(stdout, " %s section-%d: \ttype\t 0x%8.8x\n", - module->elf_file, i, section[i].type); - fprintf(stdout, " %s section-%d: \tflags\t 0x%8.8x\n", - module->elf_file, i, section[i].flags); - fprintf(stdout, " %s section-%d: \taddr\t 0x%8.8x\n", - module->elf_file, i, section[i].vaddr); - fprintf(stdout, " %s section-%d: \toffset\t 0x%8.8x\n", - module->elf_file, i, section[i].off); - fprintf(stdout, " %s section-%d: \tsize\t 0x%8.8x\n", - module->elf_file, i, section[i].size); - fprintf(stdout, " %s section-%d: \tlink\t 0x%8.8x\n", - module->elf_file, i, section[i].link); - fprintf(stdout, " %s section-%d: \tinfo\t 0x%8.8x\n\n", - module->elf_file, i, section[i].info); - } - - return 0; -} - -static int elf_read_programs(struct image *image, struct manifest_module *module) -{ - Elf32_Ehdr *hdr = &module->hdr; - Elf32_Phdr *prg = module->prg; - size_t count; - int i, ret; - - /* read in program header */ - ret = fseek(module->fd, hdr->phoff, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: cant seek to %s program header %d\n", - module->elf_file, ret); - return ret; - } - - /* allocate space for programs */ - prg = calloc(sizeof(Elf32_Phdr), hdr->phnum); - if (!prg) - return -ENOMEM; - module->prg = prg; - - /* read in programs */ - count = fread(prg, sizeof(Elf32_Phdr), hdr->phnum, module->fd); - if (count != hdr->phnum) { - fprintf(stderr, "error: failed to read %s program header %d\n", - module->elf_file, -errno); - return -errno; - } - - /* check each program */ - for (i = 0; i < hdr->phnum; i++) { - if (prg[i].filesz == 0) - continue; - - if (!image->verbose) - continue; - - fprintf(stdout, "%s program-%d: \ttype\t 0x%8.8x\n", - module->elf_file, i, prg[i].type); - fprintf(stdout, "%s program-%d: \toffset\t 0x%8.8x\n", - module->elf_file, i, prg[i].off); - fprintf(stdout, "%s program-%d: \tvaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].vaddr); - fprintf(stdout, "%s program-%d: \tpaddr\t 0x%8.8x\n", - module->elf_file, i, prg[i].paddr); - fprintf(stdout, "%s program-%d: \tfsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].filesz); - fprintf(stdout, "%s program-%d: \tmsize\t 0x%8.8x\n", - module->elf_file, i, prg[i].memsz); - fprintf(stdout, "%s program-%d: \tflags\t 0x%8.8x\n\n", - module->elf_file, i, prg[i].flags); - } - - return 0; -} - -static int elf_read_hdr(struct image *image, struct manifest_module *module) -{ - Elf32_Ehdr *hdr = &module->hdr; - size_t count; - - /* read in elf header */ - count = fread(hdr, sizeof(*hdr), 1, module->fd); - if (count != 1) { - fprintf(stderr, "error: failed to read %s elf header %d\n", - module->elf_file, -errno); - return -errno; - } - - if (strncmp((char *)hdr->ident, "\177ELF\001\001", 5)) { - fprintf(stderr, "Not a 32 bits ELF-LE file\n"); - return -EINVAL; - } - - if (!image->verbose) - return 0; - - fprintf(stdout, "%s elf: \tentry point\t 0x%8.8x\n", - module->elf_file, hdr->entry); - fprintf(stdout, "%s elf: \tprogram offset\t 0x%8.8x\n", - module->elf_file, hdr->phoff); - fprintf(stdout, "%s elf: \tsection offset\t 0x%8.8x\n", - module->elf_file, hdr->shoff); - fprintf(stdout, "%s elf: \tprogram size\t 0x%8.8x\n", - module->elf_file, hdr->phentsize); - fprintf(stdout, "%s elf: \tprogram count\t 0x%8.8x\n", - module->elf_file, hdr->phnum); - fprintf(stdout, "%s elf: \tsection size\t 0x%8.8x\n", - module->elf_file, hdr->shentsize); - fprintf(stdout, "%s elf: \tsection count\t 0x%8.8x\n", - module->elf_file, hdr->shnum); - fprintf(stdout, "%s elf: \tstring index\t 0x%8.8x\n\n", - module->elf_file, hdr->shstrndx); - - return 0; -} - -int elf_is_rom(struct image *image, Elf32_Shdr *section) -{ - uint32_t start, end; - uint32_t base, size; - - start = section->vaddr; - end = section->vaddr + section->size; - - base = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].base; - size = image->adsp->mem.zones[SOF_FW_BLK_TYPE_ROM].size; - - if (start < base || start > base + size) - return 0; - if (end < base || end > base + size) - return 0; - return 1; -} - -static void elf_module_size(struct image *image, struct manifest_module *module, - Elf32_Shdr *section, uint32_t lma, int index) -{ - switch (section->type) { - case SHT_INIT_ARRAY: - /* fall through */ - case SHT_PROGBITS: - /* text or data */ - if (section->flags & SHF_EXECINSTR) { - /* text */ - if (module->text_start > lma) - module->text_start = lma; - if (module->text_end < lma + section->size) - module->text_end = lma + section->size; - fprintf(stdout, "\tTEXT\t"); - } else { - /* initialized data, also calc the writable sections */ - if (module->data_start > lma) - module->data_start = lma; - if (module->data_end < lma + section->size) - module->data_end = lma + section->size; - - fprintf(stdout, "\tDATA\t"); - } - break; - case SHT_NOBITS: - /* bss */ - if (index == module->bss_index) { - /* updated the .bss segment */ - module->bss_start = section->vaddr; - module->bss_end = section->vaddr + section->size; - fprintf(stdout, "\tBSS\t"); - } else { - fprintf(stdout, "\tHEAP\t"); - } - break; - case SHT_NOTE: - fprintf(stdout, "\tNOTE\t"); - break; - default: - break; - } -} - -static void elf_module_size_reloc(struct image *image, struct manifest_module *module, - Elf32_Shdr *section, int index) -{ - switch (section->type) { - case SHT_PROGBITS: - /* text or data */ - if (section->flags & SHF_EXECINSTR) { - /* text */ - module->text_start = 0; - module->text_end += section->size; - - fprintf(stdout, "\tTEXT\t"); - } else { - /* initialized data, also calc the writable sections */ - module->data_start = 0; - module->data_end += section->size; - - fprintf(stdout, "\tDATA\t"); - } - break; - case SHT_NOBITS: - /* bss */ - if (index == module->bss_index) { - /* updated the .bss segment */ - module->bss_start = section->vaddr; - module->bss_end = section->vaddr + section->size; - fprintf(stdout, "\tBSS\t"); - } else { - fprintf(stdout, "\tHEAP\t"); - } - break; - default: - break; - } -} - -static void elf_module_limits(struct image *image, struct manifest_module *module) -{ - Elf32_Shdr *section; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - uint32_t section_lma; - int i, j; - - module->text_start = 0xffffffff; - module->data_start = 0xffffffff; - module->bss_start = 0; - module->text_end = 0; - module->data_end = 0; - module->bss_end = 0; - - fprintf(stdout, " Found %d sections, listing valid sections......\n", - module->hdr.shnum); - - fprintf(stdout, "\tNo\tLMA\t\tVMA\t\tEnd\t\tSize\tType\tName\n"); - - /* iterate all sections and get size of segments */ - for (i = 0; i < module->hdr.shnum; i++) { - section = &module->section[i]; - - /* module bss can sometimes be missed */ - if (i != module->bss_index) { - /* only check valid sections */ - if (!(section->flags & valid)) - continue; - - if (section->size == 0) - continue; - - if (elf_is_rom(image, section)) - continue; - } - /* check programs to get LMA */ - section_lma = section->vaddr; - for (j = 0; j < module->hdr.phnum; j++) { - if (section->vaddr == uncache_to_cache(image, module->prg[j].vaddr)) { - section_lma = uncache_to_cache(image, module->prg[j].paddr); - break; - } - } - - fprintf(stdout, "\t%d\t0x%8.8x\t0x%8.8x\t0x%8.8x\t0x%x", i, - section_lma, section->vaddr, - section->vaddr + section->size, section->size); - - /* text or data section */ - if (image->reloc) - elf_module_size_reloc(image, module, section, i); - else - elf_module_size(image, module, section, section_lma, i); - - /* section name */ - fprintf(stdout, "%s\n", module->strings + section->name); - } - - fprintf(stdout, "\n"); -} - -/* make sure no section overlap from any modules */ -int elf_validate_section(struct image *image, struct manifest_module *module, - Elf32_Shdr *section, int index) -{ - struct manifest_module *m; - Elf32_Shdr *s; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int i, j; - - /* for each module */ - for (i = 0; i < image->num_modules; i++) { - m = &image->module[i]; - - /* for each section */ - for (j = 0; j < m->hdr.shnum; j++) { - s = &m->section[j]; - - if (s == section) - continue; - - /* only check valid sections */ - if (!(s->flags & valid)) - continue; - - if (s->size == 0) - continue; - - /* is section start non overlapping ? */ - if (section->vaddr >= s->vaddr && - section->vaddr < - s->vaddr + s->size) { - goto err; - } - - /* is section end non overlapping ? */ - if (section->vaddr + section->size > s->vaddr && - section->vaddr + section->size <= - s->vaddr + s->size) { - goto err; - } - } - } - - return 0; - -err: - fprintf(stderr, "error: section overlap between %s:%d and %s:%d\n", - module->elf_file, index, m->elf_file, j); - fprintf(stderr, " [0x%x : 0x%x] overlaps with [0x%x :0x%x]\n", - section->vaddr, section->vaddr + section->size, - s->vaddr, s->vaddr + s->size); - return -EINVAL; -} - -/* make sure no section overlaps from any modules */ -int elf_validate_modules(struct image *image) -{ - struct manifest_module *module; - Elf32_Shdr *section; - uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); - int i, j, ret; - - /* relocatable modules have no physical addresses until runtime */ - if (image->reloc) - return 0; - - /* for each module */ - for (i = 0; i < image->num_modules; i++) { - module = &image->module[i]; - - /* for each section */ - for (j = 0; j < module->hdr.shnum; j++) { - section = &module->section[j]; - - /* only check valid sections */ - if (!(section->flags & valid)) - continue; - - if (section->size == 0) - continue; - - /* is section non overlapping ? */ - ret = elf_validate_section(image, module, section, j); - if (ret < 0) - return ret; - } - } - - return 0; -} - -int elf_find_section(const struct manifest_module *module, const char *name) -{ - const Elf32_Ehdr *hdr = &module->hdr; - const Elf32_Shdr *section, *s; - char *buffer; - size_t count; - int ret, i; - - section = &module->section[hdr->shstrndx]; - - /* alloc data data */ - buffer = calloc(1, section->size); - if (!buffer) - return -ENOMEM; - - /* read in section string data */ - ret = fseek(module->fd, section->off, SEEK_SET); - if (ret < 0) { - fprintf(stderr, "error: cant seek to string section %d\n", ret); - goto out; - } - - count = fread(buffer, 1, section->size, module->fd); - if (count != section->size) { - fprintf(stderr, "error: can't read string section %d\n", - -errno); - ret = -errno; - goto out; - } - - /* find section with name */ - for (i = 0; i < hdr->shnum; i++) { - s = &module->section[i]; - if (!strcmp(name, buffer + s->name)) { - ret = i; - goto out; - } - } - - fprintf(stderr, "warning: can't find section named '%s' in module %s\n", - name, module->elf_file); - ret = -EINVAL; - -out: - free(buffer); - return ret; -} - -int elf_read_section(const struct manifest_module *module, const char *section_name, - const Elf32_Shdr **dst_section, void **dst_buff) -{ - const Elf32_Shdr *section; - int section_index = -1; - int read; - - section_index = elf_find_section(module, section_name); - if (section_index < 0) { - fprintf(stderr, "error: section %s can't be found\n", - section_name); - return -EINVAL; - } - - section = &module->section[section_index]; - if (dst_section) - *dst_section = section; - - /* alloc buffer for section content */ - *dst_buff = calloc(1, section->size); - if (!*dst_buff) - return -ENOMEM; - - /* fill buffer with section content */ - fseek(module->fd, section->off, SEEK_SET); - read = fread(*dst_buff, 1, section->size, module->fd); - if (read != section->size) { - fprintf(stderr, - "error: can't read %s section %d\n", section_name, - -errno); - free(*dst_buff); - return -errno; - } - - return section->size; -} - -int elf_parse_module(struct image *image, int module_index, const char *name) -{ - struct manifest_module *module; - uint32_t rem; - int ret = 0; - - /* validate module index */ - if (module_index >= MAX_MODULES) { - fprintf(stderr, "error: too any modules\n"); - return -EINVAL; - } - - module = &image->module[module_index]; - - /* open the elf input file */ - module->fd = fopen(name, "rb"); - if (!module->fd) { - fprintf(stderr, "error: unable to open %s for reading %d\n", - name, errno); - return -EINVAL; - } - module->elf_file = name; - - /* get file size */ - ret = get_file_size(module->fd, name, &module->file_size); - if (ret < 0) - goto hdr_err; - - /* read in elf header */ - ret = elf_read_hdr(image, module); - if (ret < 0) - goto hdr_err; - - /* read in programs */ - ret = elf_read_programs(image, module); - if (ret < 0) { - fprintf(stderr, "error: failed to read program sections %d\n", - ret); - goto hdr_err; - } - - /* read sections */ - ret = elf_read_sections(image, module, module_index); - if (ret < 0) { - fprintf(stderr, "error: failed to read base sections %d\n", - ret); - goto sec_err; - } - - /* check limits */ - elf_module_limits(image, module); - - elf_find_section(module, ""); - - fprintf(stdout, " module: input size %zu (0x%zx) bytes %d sections\n", - module->output_size, module->output_size, module->num_sections); - fprintf(stdout, " module: text %d (0x%x) bytes\n" - " data %d (0x%x) bytes\n" - " bss %d (0x%x) bytes\n\n", - module->text_size, module->text_size, - module->data_size, module->data_size, - module->bss_size, module->bss_size); - - /* file sizes round up to nearest page */ - module->text_file_size = module->text_end - module->text_start; - rem = module->text_file_size % MAN_PAGE_SIZE; - if (rem) - module->text_file_size += MAN_PAGE_SIZE - rem; - - /* data section */ - module->data_file_size = module->data_end - module->data_start; - rem = module->data_file_size % MAN_PAGE_SIZE; - if (rem) - module->data_file_size += MAN_PAGE_SIZE - rem; - - /* bss section */ - module->bss_file_size = module->bss_end - module->bss_start; - rem = module->bss_file_size % MAN_PAGE_SIZE; - if (rem) - module->bss_file_size += MAN_PAGE_SIZE - rem; - - return 0; - -sec_err: - free(module->prg); -hdr_err: - fclose(module->fd); - - return ret; -} - -void elf_free_module(struct image *image, int module_index) -{ - struct manifest_module *module = &image->module[module_index]; - - free(module->prg); - free(module->section); - free(module->strings); - fclose(module->fd); -} diff --git a/src/include/rimage/rimage.h b/src/include/rimage/rimage.h index 2b9a26ef5b41..61bc77bfca42 100644 --- a/src/include/rimage/rimage.h +++ b/src/include/rimage/rimage.h @@ -172,14 +172,4 @@ int pkcs_v1_5_verify_man_ace_v1_5(struct image *image, int resign_image(struct image *image); int get_key_size(struct image *image); -int elf_parse_module(struct image *image, int module_index, const char *name); -void elf_free_module(struct image *image, int module_index); -int elf_is_rom(struct image *image, Elf32_Shdr *section); -int elf_validate_modules(struct image *image); -int elf_find_section(const struct manifest_module *module, const char *name); -int elf_read_section(const struct manifest_module *module, const char *name, - const Elf32_Shdr **dst_section, void **dst_buff); -int elf_validate_section(struct image *image, struct manifest_module *manifest_module, - Elf32_Shdr *section, int index); - #endif From 877079af471dad5ef9329749cbedfa99ea6056bb Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:08:26 +0200 Subject: [PATCH 433/639] smex: elf: Removed unnecessary initialization of local variables The values assigned when declaring variables were overwritten in the code. Redundant initialization was removed. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- smex/elf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smex/elf.c b/smex/elf.c index bd088716691d..3aeb62e3d4fc 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -17,7 +17,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Shdr *section = module->section; + Elf32_Shdr *section; size_t count; int i, ret; uint32_t valid = (SHF_WRITE | SHF_ALLOC | SHF_EXECINSTR); @@ -128,7 +128,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) static int elf_read_programs(struct elf_module *module, bool verbose) { Elf32_Ehdr *hdr = &module->hdr; - Elf32_Phdr *prg = module->prg; + Elf32_Phdr *prg; size_t count; int i, ret; @@ -431,7 +431,7 @@ int elf_read_section(const struct elf_module *module, const char *section_name, const Elf32_Shdr **dst_section, void **dst_buff) { const Elf32_Shdr *section; - int section_index = -1; + int section_index; int read; section_index = elf_find_section(module, section_name); From 71418367e780f34568bef70deee3d2bc49b979ff Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:10:11 +0200 Subject: [PATCH 434/639] smex: elf: Added checking of value returned by file operation function Added checking of the value returned by fseek function and added memory release when an error is detected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- smex/elf.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/smex/elf.c b/smex/elf.c index 3aeb62e3d4fc..0683df2ffe14 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -432,7 +432,7 @@ int elf_read_section(const struct elf_module *module, const char *section_name, { const Elf32_Shdr *section; int section_index; - int read; + int ret; section_index = elf_find_section(module, section_name); if (section_index < 0) { @@ -451,17 +451,25 @@ int elf_read_section(const struct elf_module *module, const char *section_name, return -ENOMEM; /* fill buffer with section content */ - fseek(module->fd, section->off, SEEK_SET); - read = fread(*dst_buff, 1, section->size, module->fd); - if (read != section->size) { - fprintf(stderr, - "error: can't read %s section %d\n", section_name, - -errno); - free(*dst_buff); - return -errno; + ret = fseek(module->fd, section->off, SEEK_SET); + if (ret) { + fprintf(stderr, "error: can't seek to %s section %d\n", section_name, -errno); + ret = -errno; + goto error; + } + + ret = fread(*dst_buff, 1, section->size, module->fd); + if (ret != section->size) { + fprintf(stderr, "error: can't read %s section %d\n", section_name, -errno); + ret = ret < 0 ? -errno : -ENODATA; + goto error; } return section->size; + +error: + free(*dst_buff); + return ret; } int elf_read_module(struct elf_module *module, const char *name, bool verbose) From e5f337ba70a5c4154e803917f35d7416d1705763 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 21 Sep 2023 16:20:42 +0200 Subject: [PATCH 435/639] smex: elf: Fixed an error code returned when a file operation fails If fseek reports an error, the error code set in errno is returned. Improved handling an error during reading from a file. Now it distinguishes between an error reported by the fread and insufficient data in a file. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- smex/elf.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/smex/elf.c b/smex/elf.c index 0683df2ffe14..9cafa0d1214c 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -27,7 +27,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: can't seek to %s section header %d\n", module->elf_file, ret); - return ret; + return -errno; } /* allocate space for each section header */ @@ -41,7 +41,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (count != hdr->shnum) { fprintf(stderr, "error: failed to read %s section header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } /* read in strings */ @@ -56,7 +56,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: can't seek to %s stringss %d\n", module->elf_file, ret); - return ret; + return -errno; } count = fread(module->strings, 1, section[hdr->shstrndx].size, @@ -64,7 +64,7 @@ static int elf_read_sections(struct elf_module *module, bool verbose) if (count != section[hdr->shstrndx].size) { fprintf(stderr, "error: failed to read %s strings %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } module->bss_index = elf_find_section(module, ".bss"); @@ -137,7 +137,7 @@ static int elf_read_programs(struct elf_module *module, bool verbose) if (ret < 0) { fprintf(stderr, "error: cant seek to %s program header %d\n", module->elf_file, ret); - return ret; + return -errno; } /* allocate space for programs */ @@ -151,7 +151,7 @@ static int elf_read_programs(struct elf_module *module, bool verbose) if (count != hdr->phnum) { fprintf(stderr, "error: failed to read %s program header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } /* check each program */ @@ -191,7 +191,7 @@ static int elf_read_hdr(struct elf_module *module, bool verbose) if (count != 1) { fprintf(stderr, "error: failed to read %s elf header %d\n", module->elf_file, -errno); - return -errno; + return count < 0 ? -errno : -ENODATA; } if (!verbose) @@ -398,6 +398,7 @@ int elf_find_section(const struct elf_module *module, const char *name) ret = fseek(module->fd, section->off, SEEK_SET); if (ret < 0) { fprintf(stderr, "error: cant seek to string section %d\n", ret); + ret = -errno; goto out; } @@ -405,7 +406,7 @@ int elf_find_section(const struct elf_module *module, const char *name) if (count != section->size) { fprintf(stderr, "error: can't read string section %d\n", -errno); - ret = -errno; + ret = count < 0 ? -errno : -ENODATA; goto out; } @@ -487,12 +488,16 @@ int elf_read_module(struct elf_module *module, const char *name, bool verbose) /* get file size */ ret = fseek(module->fd, 0, SEEK_END); - if (ret < 0) + if (ret < 0) { + ret = -errno; goto hdr_err; + } module->file_size = ftell(module->fd); ret = fseek(module->fd, 0, SEEK_SET); - if (ret < 0) + if (ret < 0) { + ret = -errno; goto hdr_err; + } /* read in elf header */ ret = elf_read_hdr(module, verbose); From 5c016bc9e78b8cef0f6e755ad66e17107feb10d7 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:11:09 +0200 Subject: [PATCH 436/639] smex: elf: elf_find_section: Check function input data String terminator was added to the buffer with a list of section names in the elf file. Added check to the section name index to make sure it doesn't go beyond the buffer size. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- smex/elf.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smex/elf.c b/smex/elf.c index 9cafa0d1214c..0d0e976dcb8a 100644 --- a/smex/elf.c +++ b/smex/elf.c @@ -409,10 +409,17 @@ int elf_find_section(const struct elf_module *module, const char *name) ret = count < 0 ? -errno : -ENODATA; goto out; } + buffer[section->size - 1] = '\0'; /* find section with name */ for (i = 0; i < hdr->shnum; i++) { s = &module->section[i]; + if (s->name >= section->size) { + fprintf(stderr, "error: invalid section name string index %d\n", s->name); + ret = -EINVAL; + goto out; + } + if (!strcmp(name, buffer + s->name)) { ret = i; goto out; From f882c301f1555433e13fb6d16babfc40445cabe6 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:23:36 +0200 Subject: [PATCH 437/639] logger: convert: Fixed handling of an error reported by clock_gettime The clock_gettime function only returns information that an error occurred. The error code should be taken from the errno variable. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/convert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 417d3ee6e8b4..bf26f758e188 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -349,7 +349,7 @@ static inline void print_table_header(void) if (gettime_ret) { log_err("clock_gettime() failed: %s\n", - strerror(gettime_ret)); + strerror(errno)); exit(1); } From 9f36a5dc11683a57ad2c448ba6125c070f4b08f2 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:26:37 +0200 Subject: [PATCH 438/639] logger: convert: Added error handling for file operation functions. Added checking of value returned by file operation functions. In case of an error, message is printed and error code is returned. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/convert.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index bf26f758e188..0977108c6219 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -624,7 +624,13 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ entry->params = NULL; /* set file position to beginning of processed entry */ - fseek(global_config->ldc_fd, entry_offset, SEEK_SET); + ret = fseek(global_config->ldc_fd, entry_offset, SEEK_SET); + if (ret) { + log_err("Failed to seek to entry header for offset 0x%x in dictionary.\n", + entry_offset); + ret = -errno; + goto out; + } /* fetching elf header params */ ret = fread(&entry->header, sizeof(entry->header), 1, global_config->ldc_fd); @@ -915,8 +921,13 @@ static int logger_read(void) /* When the address is not correct, move forward by one DWORD (not * entire struct dma_log) */ - fseek(global_config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), - SEEK_CUR); + ret = fseek(global_config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), + SEEK_CUR); + if (ret) { + log_err("fetch_entry() failed on seek, aborting\n"); + ret = -errno; + break; + } skipped_dwords++; continue; @@ -1013,7 +1024,7 @@ static int dump_ldc_info(void) if (global_config->version_fd) { struct sof_ipc_fw_version ver; - if (fread(&ver, sizeof(ver), 1, global_config->version_fd)) + if (fread(&ver, sizeof(ver), 1, global_config->version_fd) == 1) fprintf(out_fd, "Loaded FW expects checksum\t0x%08x\n", ver.src_hash); } @@ -1101,7 +1112,12 @@ int convert(void) } /* read uuid section header */ - fseek(config->ldc_fd, logs_hdr->data_offset + logs_hdr->data_length, SEEK_SET); + ret = fseek(config->ldc_fd, logs_hdr->data_offset + logs_hdr->data_length, SEEK_SET); + if (ret) { + log_err("Error while seeking to uuids header from %s.\n", config->ldc_file); + return -errno; + } + count = fread(&uids_hdr, sizeof(uids_hdr), 1, config->ldc_fd); if (!count) { log_err("Error while reading uuids header from %s.\n", config->ldc_file); From 4c905f5234faf2cb32b0663dfd0b1c494b0a2a93 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:31:28 +0200 Subject: [PATCH 439/639] logger: convert: Simplified printing of a timestamp The timestamp printing process has been simplified by eliminating the dynamic creation of the formatting string. All necessary parameters are now passed directly to the printing function. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/convert.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 0977108c6219..7ed2772aed00 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -339,7 +339,6 @@ static inline void print_table_header(void) { FILE *out_fd = global_config->out_fd; int hide_location = global_config->hide_location; - char time_fmt[32]; char date_string[64]; const time_t epoc_secs = time(NULL); @@ -354,11 +353,9 @@ static inline void print_table_header(void) } if (global_config->time_precision >= 0) { - const unsigned int ts_width = - timestamp_width(global_config->time_precision); - snprintf(time_fmt, sizeof(time_fmt), "%%-%ds(us)%%%ds ", - ts_width, ts_width); - fprintf(out_fd, time_fmt, " TIMESTAMP", "DELTA"); + const unsigned int ts_width = timestamp_width(global_config->time_precision); + + fprintf(out_fd, "%*s(us)%*s ", -ts_width, " TIMESTAMP", ts_width, "DELTA"); } fprintf(out_fd, "%2s %-18s ", "C#", "COMPONENT"); @@ -476,7 +473,6 @@ static void print_entry_params(const struct log_entry_header *dma_log, char ids[TRACE_MAX_IDS_STR]; float dt = to_usecs(dma_log->timestamp - last_timestamp); struct proc_ldc_entry proc_entry; - static char time_fmt[64]; int ret; if (raw_output) @@ -517,13 +513,7 @@ static void print_entry_params(const struct log_entry_header *dma_log, ids[0] = '\0'; if (raw_output) { /* "raw" means script-friendly (not all hex) */ - const char *entry_fmt = "%s%u %u %s%s%s "; - - if (time_precision >= 0) - snprintf(time_fmt, sizeof(time_fmt), "%%.%df %%.%df ", - time_precision, time_precision); - - fprintf(out_fd, entry_fmt, + fprintf(out_fd, "%s%u %u %s%s%s ", entry->header.level == use_colors ? (LOG_LEVEL_CRITICAL ? KRED : KNRM) : "", dma_log->core_id, @@ -531,9 +521,12 @@ static void print_entry_params(const struct log_entry_header *dma_log, get_component_name(entry->header.component_class, dma_log->uid), raw_output && strlen(ids) ? "-" : "", ids); + if (time_precision >= 0) - fprintf(out_fd, time_fmt, - to_usecs(dma_log->timestamp - timestamp_origin), dt); + fprintf(out_fd, "%.*f %.*f ", + time_precision, to_usecs(dma_log->timestamp - timestamp_origin), + time_precision, dt); + if (!hide_location) fprintf(out_fd, "(%s:%u) ", format_file_name(entry->file_name, raw_output), @@ -542,13 +535,11 @@ static void print_entry_params(const struct log_entry_header *dma_log, if (time_precision >= 0) { const unsigned int ts_width = timestamp_width(time_precision); - snprintf(time_fmt, sizeof(time_fmt), - "%%s[%%%d.%df] (%%%d.%df)%%s ", - ts_width, time_precision, ts_width, time_precision); - - fprintf(out_fd, time_fmt, + fprintf(out_fd, "%s[%*.*f] (%*.*f)%s ", use_colors ? KGRN : "", - to_usecs(dma_log->timestamp - timestamp_origin), dt, + ts_width, time_precision, + to_usecs(dma_log->timestamp - timestamp_origin), + ts_width, time_precision, dt, use_colors ? KNRM : ""); } From 30a2855d48c87aa039d77c7618bb5d97ee5cbaae Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:35:11 +0200 Subject: [PATCH 440/639] logger: convert: read_entry_from_ldc_file: Make sure string null terminated Added a null string terminator to be sure that strings read from a file are terminated correctly. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/convert.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index 7ed2772aed00..b5d750341d39 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -637,7 +637,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -EINVAL; goto out; } - entry->file_name = (char *)malloc(entry->header.file_name_len); + entry->file_name = (char *)malloc(entry->header.file_name_len + 1); if (!entry->file_name) { log_err("can't allocate %d byte for entry.file_name\n", @@ -648,6 +648,8 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = fread(entry->file_name, sizeof(char), entry->header.file_name_len, global_config->ldc_fd); + entry->file_name[entry->header.file_name_len] = '\0'; + if (ret != entry->header.file_name_len) { log_err("Failed to read source filename for offset 0x%x in dictionary.\n", entry_offset); @@ -661,7 +663,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -EINVAL; goto out; } - entry->text = (char *)malloc(entry->header.text_len); + entry->text = (char *)malloc(entry->header.text_len + 1); if (!entry->text) { log_err("can't allocate %d byte for entry.text\n", entry->header.text_len); ret = -ENOMEM; @@ -674,6 +676,7 @@ static int read_entry_from_ldc_file(struct ldc_entry *entry, uint32_t log_entry_ ret = -1; goto out; } + entry->text[entry->header.text_len] = '\0'; return 0; From 56a135216394a85cfe9d6f8474ee511335241ff4 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:37:12 +0200 Subject: [PATCH 441/639] logger: convert: Code quality improvements The precision check condition has been simplified, the unsigned value cannot be negative. Added definitions containing an error message instead of using a constant variable. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/convert.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/logger/convert.c b/tools/logger/convert.c index b5d750341d39..e393f828e1b1 100644 --- a/tools/logger/convert.c +++ b/tools/logger/convert.c @@ -60,8 +60,7 @@ struct proc_ldc_entry { uintptr_t params[TRACE_MAX_PARAMS_COUNT]; }; -static const char *BAD_PTR_STR = "<bad uid ptr 0x%.8x>"; - +#define BAD_PTR_STR "<bad uid ptr 0x%.8x>" #define UUID_LOWER "%s%s%s<%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x>%s%s%s" #define UUID_UPPER "%s%s%s<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>%s%s%s" @@ -325,7 +324,7 @@ static unsigned int timestamp_width(unsigned int precision) * gcc 9.3, this avoids a very long precision causing snprintf() * to truncate time_fmt */ - assert(precision >= 0 && precision < 20); + assert(precision < 20); /* * 12 digits for units is enough for 1M seconds = 11 days which * should be enough for most test runs. From 651af68384cb872676ac8c14f4bcdf1df7c4ff0f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:42:56 +0200 Subject: [PATCH 442/639] tools: logger: Use a safe variant of the string manipulation functions Used string manipulation functions that check the size of the available buffer. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/logger.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 14f3fc88f657..5991289ee296 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -104,8 +104,8 @@ static int snapshot(const char *name) for (i = 0; i < ARRAY_SIZE(debugfs); i++) { - sprintf(pinname, "%s/%s", path, debugfs[i]); - sprintf(poutname, "%s.%s.txt", name, debugfs[i]); + snprintf(pinname, sizeof(pinname), "%s/%s", path, debugfs[i]); + snprintf(poutname, sizeof(poutname), "%s.%s.txt", name, debugfs[i]); /* open debugfs for reading */ in_fd = fopen(pinname, "rb"); @@ -132,7 +132,7 @@ static int snapshot(const char *name) if (count != 4) break; - sprintf(buffer, "0x%6.6x: 0x%8.8x\n", addr, val); + snprintf(buffer, sizeof(buffer), "0x%6.6x: 0x%8.8x\n", addr, val); count = fwrite(buffer, 1, strlen(buffer), out_fd); @@ -220,17 +220,15 @@ static void *wait_open(const char *watched_dir, const char *expected_file) const int dwatch = inotify_add_watch(iqueue, watched_dir, IN_CREATE); struct stat expected_stat; void *ret_stream = NULL; - - char * const fpath = malloc(strlen(watched_dir) + 1 + strlen(expected_file) + 1); + const int fpath_len = strlen(watched_dir) + 1 + strlen(expected_file) + 1; + char * const fpath = malloc(fpath_len); if (!fpath) { fprintf(stderr, "error: can't allocate memory\n"); exit(EXIT_FAILURE); } - strcpy(fpath, watched_dir); - strcat(fpath, "/"); - strcat(fpath, expected_file); + snprintf(fpath, fpath_len, "%s/%s", watched_dir, expected_file); /* Not racy because the inotify watch was set first. */ if (!access(fpath, F_OK)) From 966ad48e7ed87ff4117e5d54af5d6c95e2d4bff3 Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Mon, 18 Sep 2023 15:52:14 +0200 Subject: [PATCH 443/639] tools: logger: Fix resources release Improved release of resources when an error is detected. Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/logger/logger.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/tools/logger/logger.c b/tools/logger/logger.c index 5991289ee296..b6c2b26bd629 100644 --- a/tools/logger/logger.c +++ b/tools/logger/logger.c @@ -134,7 +134,12 @@ static int snapshot(const char *name) snprintf(buffer, sizeof(buffer), "0x%6.6x: 0x%8.8x\n", addr, val); - count = fwrite(buffer, 1, strlen(buffer), out_fd); + i = strlen(buffer); + count = fwrite(buffer, 1, i, out_fd); + if (count != i) { + fprintf(stderr, "error: an error occurred during write to %s: %s\n", + poutname, strerror(errno)); + } addr += 4; } @@ -164,7 +169,12 @@ static int configure_uart(const char *file, unsigned int baud) tio.c_cc[VMIN] = 1; ret = tcsetattr(fd, TCSANOW, &tio); - return ret < 0 ? -errno : fd; + if (ret < 0) { + close(fd); + return -errno; + } + + return fd; } /* Concantenate `config->filter_config` with `input` + `\n` */ @@ -266,7 +276,9 @@ static void *wait_open(const char *watched_dir, const char *expected_file) } fopenit: - stat(fpath, &expected_stat); + if (stat(fpath, &expected_stat)) + goto cleanup; + if ((expected_stat.st_mode & S_IFMT) == S_IFDIR) ret_stream = opendir(fpath); else @@ -362,7 +374,8 @@ int main(int argc, char *argv[]) if (i < 0 || 1 < i) { fprintf(stderr, "%s: invalid option: -e %s\n", APP_NAME, optarg); - return -EINVAL; + ret = -EINVAL; + goto out; } config.relative_timestamps = i; break; @@ -371,7 +384,8 @@ int main(int argc, char *argv[]) config.time_precision = atoi(optarg); if (config.time_precision < 0) { usage(); - return -EINVAL; + ret = -EINVAL; + goto out; } break; case 'g': @@ -401,8 +415,10 @@ int main(int argc, char *argv[]) usage(); } - if (snapshot_file) - return baud ? EINVAL : -snapshot(snapshot_file); + if (snapshot_file) { + ret = baud ? EINVAL : -snapshot(snapshot_file); + goto out; + } if (!config.ldc_file) { fprintf(stderr, "error: Missing ldc file\n"); From 46a9d87f1f75dd72076018691b76de020e8176f6 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 20 Sep 2023 12:57:58 +0200 Subject: [PATCH 444/639] sink/src: change IBS/OBS in API to more meaningful names there's a big confusion in naming: meaning IBS/OBS from module point of view is opposite to meaning of OBS/IBS from buffer or queue point of view This PR changes - IBS to min_available - OBS to min_free_space names like this are less likely to cause confusions Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/dp_queue.c | 15 ++++++++------- src/audio/sink_api_helper.c | 8 ++++---- src/audio/source_api_helper.c | 8 ++++---- src/include/sof/audio/dp_queue.h | 12 +++++------- .../sof/audio/module_adapter/module/generic.h | 4 ++-- src/include/sof/audio/sink_api.h | 4 ++-- src/include/sof/audio/sink_api_implementation.h | 4 +++- src/include/sof/audio/source_api.h | 4 ++-- .../sof/audio/source_api_implementation.h | 6 +++++- src/ipc/ipc4/helper.c | 16 ++++++++++------ 10 files changed, 45 insertions(+), 36 deletions(-) diff --git a/src/audio/dp_queue.c b/src/audio/dp_queue.c index 62ca3e85f894..07fa67fc0169 100644 --- a/src/audio/dp_queue.c +++ b/src/audio/dp_queue.c @@ -245,7 +245,7 @@ static const struct sink_ops dp_queue_sink_ops = { .audio_set_ipc_params = dp_queue_set_ipc_params_sink, }; -struct dp_queue *dp_queue_create(size_t ibs, size_t obs, uint32_t flags) +struct dp_queue *dp_queue_create(size_t min_available, size_t min_free_space, uint32_t flags) { struct dp_queue *dp_queue; @@ -269,11 +269,11 @@ struct dp_queue *dp_queue_create(size_t ibs, size_t obs, uint32_t flags) &dp_queue->audio_stream_params); /* set obs/ibs in sink/source interfaces */ - sink_set_obs(&dp_queue->_sink_api, obs); - source_set_ibs(&dp_queue->_source_api, ibs); + sink_set_min_free_space(&dp_queue->_sink_api, min_free_space); + source_set_min_available(&dp_queue->_source_api, min_available); - uint32_t max_ibs_obs = MAX(ibs, obs); - uint32_t min_ibs_obs = MIN(ibs, obs); + uint32_t max_ibs_obs = MAX(min_available, min_free_space); + uint32_t min_ibs_obs = MIN(min_available, min_free_space); /* calculate required buffer size */ if (max_ibs_obs % min_ibs_obs == 0) @@ -288,8 +288,9 @@ struct dp_queue *dp_queue_create(size_t ibs, size_t obs, uint32_t flags) if (!dp_queue->_data_buffer) goto err; - tr_info(&dp_queue_tr, "DpQueue created, shared: %u ibs: %u obs %u, size %u", - dp_queue_is_shared(dp_queue), ibs, obs, dp_queue->data_buffer_size); + tr_info(&dp_queue_tr, "DpQueue created, shared: %u min_available: %u min_free_space %u, size %u", + dp_queue_is_shared(dp_queue), min_available, min_free_space, + dp_queue->data_buffer_size); /* return a pointer to allocated structure */ return dp_queue; diff --git a/src/audio/sink_api_helper.c b/src/audio/sink_api_helper.c index 519912e49967..46ffbfd6b860 100644 --- a/src/audio/sink_api_helper.c +++ b/src/audio/sink_api_helper.c @@ -176,12 +176,12 @@ int sink_set_alignment_constants(struct sof_sink *sink, return 0; } -void sink_set_obs(struct sof_sink *sink, size_t obs) +void sink_set_min_free_space(struct sof_sink *sink, size_t min_free_space) { - sink->obs = obs; + sink->min_free_space = min_free_space; } -size_t sink_get_obs(struct sof_sink *sink) +size_t sink_get_min_free_space(struct sof_sink *sink) { - return sink->obs; + return sink->min_free_space; } diff --git a/src/audio/source_api_helper.c b/src/audio/source_api_helper.c index f71cf5bdc7e1..91eb026812a9 100644 --- a/src/audio/source_api_helper.c +++ b/src/audio/source_api_helper.c @@ -166,12 +166,12 @@ int source_set_alignment_constants(struct sof_source *source, return 0; } -void source_set_ibs(struct sof_source *source, size_t ibs) +void source_set_min_available(struct sof_source *source, size_t min_available) { - source->ibs = ibs; + source->min_available = min_available; } -size_t source_get_ibs(struct sof_source *source) +size_t source_get_min_available(struct sof_source *source) { - return source->ibs; + return source->min_available; } diff --git a/src/include/sof/audio/dp_queue.h b/src/include/sof/audio/dp_queue.h index 64409abed6cd..ed56ed3ceb0d 100644 --- a/src/include/sof/audio/dp_queue.h +++ b/src/include/sof/audio/dp_queue.h @@ -98,18 +98,16 @@ struct dp_queue { }; /** - * @param ibs input buffer size - * the size of data to be produced in 1 cycle - * the data producer declares here how much data it will produce in single cycle * - * @param obs output buffer size - * the size of data to be consumed in 1 cycle - * the data receiver declares here how much data it will consume in single cycle + * @param min_available minimum data available in queue required by the module using + * dp_queue's source api + * @param min_free_space minimum buffer space in queue required by the module using + * dp_queue's sink api * * @param flags a combinatin of DP_QUEUE_MODE_* flags determining working mode * */ -struct dp_queue *dp_queue_create(size_t ibs, size_t obs, uint32_t flags); +struct dp_queue *dp_queue_create(size_t min_available, size_t min_free_space, uint32_t flags); /** * @brief free dp queue memory diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 2c9fd2d88afa..ce7a3d347806 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -267,8 +267,8 @@ bool module_is_ready_to_process(struct processing_module *mod, /* default action - the module is ready if there's enough data for processing and enough * space to store result. IBS/OBS as declared in init_instance */ - return (source_get_data_available(sources[0]) >= source_get_ibs(sources[0]) && - sink_get_free_size(sinks[0]) >= sink_get_obs(sinks[0])); + return (source_get_data_available(sources[0]) >= source_get_min_available(sources[0]) && + sink_get_free_size(sinks[0]) >= sink_get_min_free_space(sinks[0])); } int module_process_sink_src(struct processing_module *mod, diff --git a/src/include/sof/audio/sink_api.h b/src/include/sof/audio/sink_api.h index 83aeae514317..bb279166c167 100644 --- a/src/include/sof/audio/sink_api.h +++ b/src/include/sof/audio/sink_api.h @@ -129,8 +129,8 @@ int sink_set_rate(struct sof_sink *sink, unsigned int rate); int sink_set_channels(struct sof_sink *sink, unsigned int channels); int sink_set_overrun(struct sof_sink *sink, bool overrun_permitted); int sink_set_buffer_fmt(struct sof_sink *sink, uint32_t buffer_fmt); -void sink_set_obs(struct sof_sink *sink, size_t obs); -size_t sink_get_obs(struct sof_sink *sink); +void sink_set_min_free_space(struct sof_sink *sink, size_t min_free_space); +size_t sink_get_min_free_space(struct sof_sink *sink); /** * initial set of audio parameters, provided in sof_ipc_stream_params diff --git a/src/include/sof/audio/sink_api_implementation.h b/src/include/sof/audio/sink_api_implementation.h index 71c694d8a774..23cec8dbb30e 100644 --- a/src/include/sof/audio/sink_api_implementation.h +++ b/src/include/sof/audio/sink_api_implementation.h @@ -72,7 +72,9 @@ struct sof_sink { const struct sink_ops *ops; /** operations interface */ size_t requested_write_frag_size; /** keeps number of bytes requested by get_buffer() */ size_t num_of_bytes_processed; /** processed bytes counter */ - size_t obs; /** output buffer size as declared in module bind IPC */ + size_t min_free_space; /** minimum buffer space required by the module using sink + * it is module's OBS as declared in module bind IPC + */ struct sof_audio_stream_params *audio_stream_params; /** pointer to audio params */ }; diff --git a/src/include/sof/audio/source_api.h b/src/include/sof/audio/source_api.h index e4bd132a8ada..70b3ce38c909 100644 --- a/src/include/sof/audio/source_api.h +++ b/src/include/sof/audio/source_api.h @@ -140,8 +140,8 @@ int source_set_rate(struct sof_source *source, unsigned int rate); int source_set_channels(struct sof_source *source, unsigned int channels); int source_set_underrun(struct sof_source *source, bool underrun_permitted); int source_set_buffer_fmt(struct sof_source *source, uint32_t buffer_fmt); -void source_set_ibs(struct sof_source *source, size_t ibs); -size_t source_get_ibs(struct sof_source *source); +void source_set_min_available(struct sof_source *source, size_t min_available); +size_t source_get_min_available(struct sof_source *source); /** * initial set of audio parameters, provided in sof_ipc_stream_params diff --git a/src/include/sof/audio/source_api_implementation.h b/src/include/sof/audio/source_api_implementation.h index 5f2a9ffb4803..606141c92dfb 100644 --- a/src/include/sof/audio/source_api_implementation.h +++ b/src/include/sof/audio/source_api_implementation.h @@ -72,7 +72,11 @@ struct sof_source { const struct source_ops *ops; size_t requested_read_frag_size; /** keeps size of data obtained by get_data() */ size_t num_of_bytes_processed; /** processed bytes counter */ - size_t ibs; /** input buffer size as declared in module bind IPC */ + size_t min_available; /** minimum data available required by the module using + * source + * it is module's IBS as declared in module bind IPC + */ + struct sof_audio_stream_params *audio_stream_params; }; diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index d213a8f43fd5..73e9c6d1a787 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -376,13 +376,17 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) } /* - * set ibs and obs in sink/src api of created buffer - * IBS of a buffer is OBS of source component - * OBS of a buffer is IBS of destination component + * set min_free_space and min_available in sink/src api of created buffer. + * buffer is connected like: + * source_module -> (sink_ifc) BUFFER (source_ifc) -> sink_module + * + * source_module needs to set its OBS (out buffer size) + * as min_free_space in buffer's sink ifc + * sink_module needs to set its IBS (input buffer size) + * as min_available in buffer's source ifc */ - - source_set_ibs(audio_stream_get_source(&buffer->stream), source_src_cfg.obs); - sink_set_obs(audio_stream_get_sink(&buffer->stream), sink_src_cfg.ibs); + sink_set_min_free_space(audio_stream_get_sink(&buffer->stream), source_src_cfg.obs); + source_set_min_available(audio_stream_get_source(&buffer->stream), sink_src_cfg.ibs); /* * Connect and bind the buffer to both source and sink components with the interrupts From e6c3decd38fdaa773e0c06db61a0b8dee2850fb2 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Fri, 15 Sep 2023 14:32:48 +0200 Subject: [PATCH 445/639] dp_queue: buf calculation size, add list, cosmetic changes buf calculation size has been changed to be always 2xmax(IBS,OBS) to allow free read/write in various data chunk sizes and execution periods (of course in/out data rates must be same) detailed examples in dp_queue.h file method and fields allowing connection dp_queues to a list added Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/dp_queue.c | 22 +++++----- src/include/sof/audio/dp_queue.h | 69 +++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 18 deletions(-) diff --git a/src/audio/dp_queue.c b/src/audio/dp_queue.c index 07fa67fc0169..8001594a27bc 100644 --- a/src/audio/dp_queue.c +++ b/src/audio/dp_queue.c @@ -73,7 +73,7 @@ static inline void dp_queue_writeback_shared(struct dp_queue *dp_queue, } static inline -uint8_t __sparse_cache *dp_queue_get_pointer(struct dp_queue *dp_queue, uint32_t offset) +uint8_t __sparse_cache *dp_queue_get_pointer(struct dp_queue *dp_queue, size_t offset) { /* check if offset is not in "double area" * lines below do a quicker version of offset %= dp_queue->data_buffer_size; @@ -84,7 +84,7 @@ uint8_t __sparse_cache *dp_queue_get_pointer(struct dp_queue *dp_queue, uint32_t } static inline -uint32_t dp_queue_inc_offset(struct dp_queue *dp_queue, uint32_t offset, uint32_t inc) +size_t dp_queue_inc_offset(struct dp_queue *dp_queue, size_t offset, size_t inc) { assert(inc <= dp_queue->data_buffer_size); offset += inc; @@ -161,20 +161,20 @@ static int dp_queue_get_data(struct sof_source *source, size_t req_size, void const **data_ptr, void const **buffer_start, size_t *buffer_size) { struct dp_queue *dp_queue = dp_queue_from_source(source); - __sparse_cache void *_data_ptr; + __sparse_cache void *data_ptr_c; CORE_CHECK_STRUCT(dp_queue); if (req_size > dp_queue_get_data_available(source)) return -ENODATA; - _data_ptr = dp_queue_get_pointer(dp_queue, dp_queue->_read_offset); + data_ptr_c = dp_queue_get_pointer(dp_queue, dp_queue->_read_offset); /* clean cache in provided data range */ - dp_queue_invalidate_shared(dp_queue, _data_ptr, req_size); + dp_queue_invalidate_shared(dp_queue, data_ptr_c, req_size); *buffer_start = (__sparse_force void *)dp_queue->_data_buffer; *buffer_size = dp_queue->data_buffer_size; - *data_ptr = (__sparse_force void *)_data_ptr; + *data_ptr = (__sparse_force void *)data_ptr_c; return 0; } @@ -262,24 +262,22 @@ struct dp_queue *dp_queue_create(size_t min_available, size_t min_free_space, ui CORE_CHECK_STRUCT_INIT(dp_queue, flags & DP_QUEUE_MODE_SHARED); - /* initiate sink/source */ + /* initiate structures */ source_init(dp_queue_get_source(dp_queue), &dp_queue_source_ops, &dp_queue->audio_stream_params); sink_init(dp_queue_get_sink(dp_queue), &dp_queue_sink_ops, &dp_queue->audio_stream_params); + list_init(&dp_queue->list); + /* set obs/ibs in sink/source interfaces */ sink_set_min_free_space(&dp_queue->_sink_api, min_free_space); source_set_min_available(&dp_queue->_source_api, min_available); uint32_t max_ibs_obs = MAX(min_available, min_free_space); - uint32_t min_ibs_obs = MIN(min_available, min_free_space); /* calculate required buffer size */ - if (max_ibs_obs % min_ibs_obs == 0) - dp_queue->data_buffer_size = 2 * max_ibs_obs; - else - dp_queue->data_buffer_size = 3 * max_ibs_obs; + dp_queue->data_buffer_size = 2 * max_ibs_obs; /* allocate data buffer - always in cached memory alias */ dp_queue->data_buffer_size = ALIGN_UP(dp_queue->data_buffer_size, PLATFORM_DCACHE_ALIGN); diff --git a/src/include/sof/audio/dp_queue.h b/src/include/sof/audio/dp_queue.h index ed56ed3ceb0d..b187eb7a6f86 100644 --- a/src/include/sof/audio/dp_queue.h +++ b/src/include/sof/audio/dp_queue.h @@ -25,9 +25,38 @@ * 1) incoming and outgoing data rate MUST be the same * 2) Both data consumer and data producer declare max chunk sizes they want to use (IBS/OBS) * - * required Buffer size: - * - 2*MAX(IBS,OBS) if the larger of IBS/OBS is multiplication of smaller - * - 3*MAX(IBS,OBS) otherwise + * required Buffer size is 2*MAX(IBS,OBS) to allow free read/write in various data chunk sizes + * and execution periods (of course in/out data rates must be same) + * example: + * Consumer reads 5bytes each 3 cycles (IBS = 5) + * producer writes 3bytes every 5 cycles (OBS = 3) + * - cycle0 buffer empty, producer starting processing, consumer must wait + * - cycle3 produce 3 bytes (buf occupation = 3) + * - cycle6 produce 3 bytes (buf occupation = 6), consumer becomes ready + * in DP thread will start now - asyn to LL cycles + * in this example assuming it consumes data in next cycle + * - cycle7 consume 5 bytes, (buf occupation = 1) + * - cycle9 produce 3 bytes (buf occupation = 4) + * - cycle12 (producer goes first) produce 3 bytes (buf occupation = 7) + * consume 5 bytes (buf occupation = 2) + * - cycle15 produce 3 bytes (buf occupation = 5) + * consumer has enough data, but is busy processing prev data + * - cycle15 consume 5 bytes (buf occupation = 0) + * + * ===> max buf occupation = 7 + * + * The worst case is when IBS=OBS and equal periods of consumer/producer + * the buffer must be 2*MAX(IBS,OBS) as we do not know who goes first - consumer or producer, + * especially when both are located on separate cores and EDF scheduling is used + * + * Consumer reads 5 bytes every cycle (IBS = 5) + * producer writes 5 bytes every cycle (OBS = 5) + * - cycle0 consumer goes first - must wait (buf occupation = 0) + * producer produce 5 bytes (buf occupation = 5) + * - cycle1 producer goes first - produce 5 bytes (buf occupation = 10) + * consumer consumes 5 bytes (buf occupation = 5) + * ===> max buf occupation = 10 + * * * The queue may work in 2 modes * 1) local mode @@ -80,6 +109,9 @@ struct sof_audio_stream_params; struct dp_queue { CORE_CHECK_STRUCT_FIELD; + /* public */ + struct list_item list; /**< fields for connection queues in a list */ + /* public: read only */ struct sof_audio_stream_params audio_stream_params; size_t data_buffer_size; @@ -91,8 +123,8 @@ struct dp_queue { uint32_t _flags; /* DP_QUEUE_MODE_* */ uint8_t __sparse_cache *_data_buffer; - uint32_t _write_offset; /* private: to be modified by data producer using API */ - uint32_t _read_offset; /* private: to be modified by data consumer using API */ + size_t _write_offset; /* private: to be modified by data producer using API */ + size_t _read_offset; /* private: to be modified by data consumer using API */ bool _hw_params_configured; }; @@ -110,12 +142,13 @@ struct dp_queue { struct dp_queue *dp_queue_create(size_t min_available, size_t min_free_space, uint32_t flags); /** - * @brief free dp queue memory + * @brief remove the queue from the list, free dp queue memory */ static inline void dp_queue_free(struct dp_queue *dp_queue) { CORE_CHECK_STRUCT(dp_queue); + list_item_del(&dp_queue->list); rfree((__sparse_force void *)dp_queue->_data_buffer); rfree(dp_queue); } @@ -164,4 +197,28 @@ bool dp_queue_is_shared(struct dp_queue *dp_queue) return !!(dp_queue->_flags & DP_QUEUE_MODE_SHARED); } +/** + * @brief append a dp_queue to the list + */ +static inline void dp_queue_append_to_list(struct dp_queue *item, struct list_item *list) +{ + list_item_append(&item->list, list); +} + +/** + * @brief return a pointer to the first dp_queue on the list + */ +static inline struct dp_queue *dp_queue_get_first_item(struct list_item *list) +{ + return list_first_item(list, struct dp_queue, list); +} + +/** + * @brief return a pointer to the next dp_queue on the list + */ +static inline struct dp_queue *dp_queue_get_next_item(struct dp_queue *item) +{ + return list_next_item(item, list); +} + #endif /* __SOF_DP_QUEUE_H__ */ From 1ea43cafe75fc7c6fe864abd63e40adeef2a724b Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Tue, 19 Sep 2023 13:24:19 +0200 Subject: [PATCH 446/639] DP: bugfix, set pointer to NULL after free There should not be any pointers left pointing to a freed structures. Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/include/sof/audio/component_ext.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/include/sof/audio/component_ext.h b/src/include/sof/audio/component_ext.h index 4aa65bf61fcd..2c51943413c3 100644 --- a/src/include/sof/audio/component_ext.h +++ b/src/include/sof/audio/component_ext.h @@ -55,6 +55,7 @@ static inline void comp_free(struct comp_dev *dev) dev->task) { schedule_task_free(dev->task); rfree(dev->task); + dev->task = NULL; } dev->drv->ops.free(dev); From e441f17674160aeadebfd00911bf09d5e14c439b Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Thu, 31 Aug 2023 16:44:03 +0200 Subject: [PATCH 447/639] module: add pointers to sink/src to module structure Sink and source is the main interface for DP processing in current pipeline and the main interface for all processing in pipeline 2.0 Pointers to them must be available to modules directly. This commit adds pointers to sink/sources to module structure Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/module_adapter/module_adapter.c | 130 ++++++++---------- .../sof/audio/module_adapter/module/generic.h | 13 +- 2 files changed, 71 insertions(+), 72 deletions(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index fcf02e0ef148..177f755dc2ff 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -14,6 +14,8 @@ #include <sof/audio/component.h> #include <sof/audio/ipc-config.h> #include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/sink_api.h> +#include <sof/audio/source_api.h> #include <sof/audio/pipeline.h> #include <sof/common.h> #include <sof/platform.h> @@ -175,37 +177,33 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, static int module_adapter_sink_src_prepare(struct comp_dev *dev) { - struct sof_sink *audio_sink[PLATFORM_MAX_STREAMS]; - struct sof_source *audio_src[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); struct list_item *blist; - uint32_t num_of_sources = 0; - uint32_t num_of_sinks = 0; int ret; + int i; /* acquire all sink and source buffers, get handlers to sink/source API */ + i = 0; list_for_item(blist, &dev->bsink_list) { - struct comp_buffer *sink_buffer; - - sink_buffer = container_of(blist, struct comp_buffer, source_list); - audio_sink[num_of_sinks] = - audio_stream_get_sink(&sink_buffer->stream); - sink_reset_num_of_processed_bytes(audio_sink[num_of_sinks]); - num_of_sinks++; + struct comp_buffer *sink_buffer = + container_of(blist, struct comp_buffer, source_list); + mod->sinks[i] = audio_stream_get_sink(&sink_buffer->stream); + i++; } + mod->num_of_sinks = i; + i = 0; list_for_item(blist, &dev->bsource_list) { - struct comp_buffer *source_buffer; + struct comp_buffer *source_buffer = + container_of(blist, struct comp_buffer, sink_list); - source_buffer = container_of(blist, struct comp_buffer, sink_list); - audio_src[num_of_sources] = - audio_stream_get_source(&source_buffer->stream); - source_reset_num_of_processed_bytes(audio_src[num_of_sources]); - num_of_sources++; + mod->sources[i] = audio_stream_get_source(&source_buffer->stream); + i++; } + mod->num_of_sources = i; /* Prepare module */ - ret = module_prepare(mod, audio_src, num_of_sources, audio_sink, num_of_sinks); + ret = module_prepare(mod, mod->sources, mod->num_of_sources, mod->sinks, mod->num_of_sinks); return ret; } @@ -275,6 +273,9 @@ int module_adapter_prepare(struct comp_dev *dev) mod->period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames); comp_dbg(dev, "module_adapter_prepare(): got period_bytes = %u", mod->period_bytes); + mod->num_of_sources = 0; + mod->num_of_sinks = 0; + /* * compute number of input buffers and make the source_info shared if the module is on a * different core than any of it's sources @@ -289,14 +290,14 @@ int module_adapter_prepare(struct comp_dev *dev) if (source->pipeline && source->pipeline->core != dev->pipeline->core) coherent_shared_thread(mod->source_info, c); - mod->num_input_buffers++; + mod->num_of_sources++; } /* compute number of output buffers */ list_for_item(blist, &dev->bsink_list) - mod->num_output_buffers++; + mod->num_of_sinks++; - if (!mod->num_input_buffers && !mod->num_output_buffers) { + if (!mod->num_of_sources && !mod->num_of_sinks) { comp_err(dev, "module_adapter_prepare(): no source and sink buffers connected!"); return -EINVAL; } @@ -311,8 +312,8 @@ int module_adapter_prepare(struct comp_dev *dev) /* Check if audio stream client has only one source and one sink buffer to use a * simplified copy function. */ - if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->num_input_buffers == 1 && - mod->num_output_buffers == 1) { + if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->num_of_sources == 1 && + mod->num_of_sinks == 1) { mod->source_comp_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); mod->sink_comp_buffer = sink; @@ -426,7 +427,7 @@ int module_adapter_prepare(struct comp_dev *dev) /* allocate buffer for all sinks */ if (list_is_empty(&mod->sink_buffer_list)) { - for (i = 0; i < mod->num_output_buffers; i++) { + for (i = 0; i < mod->num_of_sinks; i++) { /* allocate not shared buffer */ struct comp_buffer *buffer = buffer_alloc(buff_size, SOF_MEM_CAPS_RAM, 0, PLATFORM_DCACHE_ALIGN, false); @@ -479,16 +480,18 @@ int module_adapter_prepare(struct comp_dev *dev) } out_data_free: - for (i = 0; i < mod->num_output_buffers; i++) + for (i = 0; i < mod->num_of_sinks; i++) rfree(mod->output_buffers[i].data); in_data_free: - for (i = 0; i < mod->num_input_buffers; i++) + for (i = 0; i < mod->num_of_sources; i++) rfree(mod->input_buffers[i].data); in_out_free: rfree(mod->output_buffers); + mod->output_buffers = NULL; rfree(mod->input_buffers); + mod->input_buffers = NULL; return ret; } @@ -963,54 +966,33 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) static int module_adapter_sink_source_copy(struct comp_dev *dev) { - struct sof_sink *audio_sink[PLATFORM_MAX_STREAMS]; - struct sof_source *audio_src[PLATFORM_MAX_STREAMS]; struct processing_module *mod = comp_get_drvdata(dev); - struct list_item *blist; - uint32_t num_of_sources = 0; - uint32_t num_of_sinks = 0; int ret; int i = 0; comp_dbg(dev, "module_adapter_sink_source_copy(): start"); - /* acquire all sink and source buffers, get handlers to sink/source API */ - list_for_item(blist, &dev->bsink_list) { - struct comp_buffer *sink_buffer; - - sink_buffer = container_of(blist, struct comp_buffer, source_list); - audio_sink[num_of_sinks] = - audio_stream_get_sink(&sink_buffer->stream); - sink_reset_num_of_processed_bytes(audio_sink[num_of_sinks]); - num_of_sinks++; - } + /* reset number of processed bytes */ + for (i = 0; i < mod->num_of_sources; i++) + source_reset_num_of_processed_bytes(mod->sources[i]); - list_for_item(blist, &dev->bsource_list) { - struct comp_buffer *source_buffer; + for (i = 0; i < mod->num_of_sinks; i++) + sink_reset_num_of_processed_bytes(mod->sinks[i]); - source_buffer = container_of(blist, struct comp_buffer, sink_list); - audio_src[num_of_sources] = - audio_stream_get_source(&source_buffer->stream); - source_reset_num_of_processed_bytes(audio_src[num_of_sources]); - num_of_sources++; - } - - ret = module_process_sink_src(mod, audio_src, num_of_sources, audio_sink, num_of_sinks); + ret = module_process_sink_src(mod, mod->sources, mod->num_of_sources, + mod->sinks, mod->num_of_sinks); if (ret != -ENOSPC && ret != -ENODATA && ret) { comp_err(dev, "module_adapter_sink_source_copy() process failed with error: %x", ret); } - /* release all source buffers in reverse order */ - for (i = num_of_sources - 1; i >= 0; i--) { - mod->total_data_consumed += source_get_num_of_processed_bytes(audio_src[i]); - } + /* count number of processed data. To be removed in pipeline 2.0 */ + for (i = 0; i < mod->num_of_sources; i++) + mod->total_data_consumed += source_get_num_of_processed_bytes(mod->sources[i]); - /* release all sink buffers in reverse order */ - for (i = num_of_sinks - 1; i >= 0 ; i--) { - mod->total_data_produced += sink_get_num_of_processed_bytes(audio_sink[i]); - } + for (i = 0; i < mod->num_of_sinks; i++) + mod->total_data_produced += sink_get_num_of_processed_bytes(mod->sinks[i]); comp_dbg(dev, "module_adapter_sink_source_copy(): done"); @@ -1062,8 +1044,8 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) i++; } - ret = module_process_legacy(mod, mod->input_buffers, mod->num_input_buffers, - mod->output_buffers, mod->num_output_buffers); + ret = module_process_legacy(mod, mod->input_buffers, mod->num_of_sources, + mod->output_buffers, mod->num_of_sinks); if (ret) { if (ret != -ENOSPC && ret != -ENODATA) { comp_err(dev, @@ -1099,10 +1081,10 @@ static int module_adapter_raw_data_type_copy(struct comp_dev *dev) return 0; out: - for (i = 0; i < mod->num_output_buffers; i++) + for (i = 0; i < mod->num_of_sinks; i++) mod->output_buffers[i].size = 0; - for (i = 0; i < mod->num_input_buffers; i++) { + for (i = 0; i < mod->num_of_sources; i++) { bzero((__sparse_force void *)mod->input_buffers[i].data, size); mod->input_buffers[i].size = 0; mod->input_buffers[i].consumed = 0; @@ -1302,7 +1284,7 @@ int module_adapter_trigger(struct comp_dev *dev, int cmd) } #if CONFIG_IPC_MAJOR_3 - if (mod->num_input_buffers > 1) { + if (mod->num_of_sources > 1) { bool sources_active; int ret; @@ -1341,16 +1323,24 @@ int module_adapter_reset(struct comp_dev *dev) } if (IS_PROCESSING_MODE_RAW_DATA(mod)) { - for (i = 0; i < mod->num_output_buffers; i++) + for (i = 0; i < mod->num_of_sinks; i++) rfree((__sparse_force void *)mod->output_buffers[i].data); - for (i = 0; i < mod->num_input_buffers; i++) + for (i = 0; i < mod->num_of_sources; i++) rfree((__sparse_force void *)mod->input_buffers[i].data); } - rfree(mod->output_buffers); - rfree(mod->input_buffers); - mod->num_input_buffers = 0; - mod->num_output_buffers = 0; + if (IS_PROCESSING_MODE_RAW_DATA(mod) || IS_PROCESSING_MODE_AUDIO_STREAM(mod)) { + rfree(mod->output_buffers); + rfree(mod->input_buffers); + + mod->num_of_sources = 0; + mod->num_of_sinks = 0; + } else if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { + for (int i = 0; i < mod->num_of_sources; i++) + mod->sources[i] = NULL; + for (int i = 0; i < mod->num_of_sinks; i++) + mod->sinks[i] = NULL; + } mod->total_data_consumed = 0; mod->total_data_produced = 0; diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index ce7a3d347806..6e80c8d53e39 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -15,6 +15,8 @@ #include <sof/audio/component.h> #include <sof/ut.h> #include <sof/lib/memory.h> +#include <sof/audio/sink_api.h> +#include <sof/audio/source_api.h> #include "module_interface.h" #if CONFIG_INTEL_MODULES @@ -186,10 +188,17 @@ struct processing_module { uint32_t period_bytes; /** pipeline period bytes */ uint32_t deep_buff_bytes; /**< copy start threshold */ uint32_t output_buffer_size; /**< size of local buffer to save produced samples */ + + /* number of sinks / sources and (when in use) input_buffers / input_buffers */ + uint32_t num_of_sources; + uint32_t num_of_sinks; + + /* sink and source handlers for the module */ + struct sof_sink *sinks[MODULE_MAX_SOURCES]; + struct sof_source *sources[MODULE_MAX_SOURCES]; struct input_stream_buffer *input_buffers; struct output_stream_buffer *output_buffers; - uint32_t num_input_buffers; /**< number of input buffers */ - uint32_t num_output_buffers; /**< number of output buffers */ + struct comp_buffer *source_comp_buffer; /**< single source component buffer */ struct comp_buffer *sink_comp_buffer; /**< single sink compoonent buffer */ From cbc04be53f0c52a3b48cacd4c47e96b6bc3ceefe Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 30 Aug 2023 18:56:44 +0200 Subject: [PATCH 448/639] DP: connect dp_queue to processing DP modules DP components need to work flawlessly when run on a different core than that of its connected peer modules. To achieve this, a cross core producer-consumer safe dp_queue should be used DP queue can only be connected to modules that use sink/src interface, so DP modules need to use it obligatory. To connect dp_queue into modules chain, double buffering method is used: - in LL task DP module is processed as an LL module, but the copy method is copying data from/to audio_streams to/from dp_queues - the main DP module processing takes place in DP task (in separate Zephyr thread). The tread may be bind to separate core Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/component.c | 22 +- src/audio/module_adapter/module_adapter.c | 265 +++++++++++++++++- src/audio/pipeline/pipeline-params.c | 31 +- src/audio/pipeline/pipeline-schedule.c | 10 +- src/idc/idc.c | 4 +- .../sof/audio/module_adapter/module/generic.h | 21 +- src/include/sof/schedule/dp_schedule.h | 9 +- src/ipc/ipc4/helper.c | 33 ++- src/schedule/zephyr_dp_schedule.c | 53 ++-- 9 files changed, 355 insertions(+), 93 deletions(-) diff --git a/src/audio/component.c b/src/audio/component.c index 1d30801221dd..e51f8ec461b2 100644 --- a/src/audio/component.c +++ b/src/audio/component.c @@ -328,9 +328,25 @@ int comp_copy(struct comp_dev *dev) assert(dev->drv->ops.copy); - /* copy only if we are the owner of the LL component */ - if (dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL && - cpu_is_me(dev->ipc_config.core)) { + /* copy only if we are the owner of component OR this is DP component + * + * DP components (modules) require two stage processing: + * + * LL_mod -> [comp_buffer -> dp_queue] -> dp_mod -> [dp_queue -> comp_buffer] -> LL_mod + * + * - in first step (it means - now) the pipeline must copy source data from comp_buffer + * to dp_queue and result data from dp_queue to comp_buffer + * + * - second step will be performed by a thread specific to the DP module - DP module + * will take data from input dpQueue (using source API) , process it + * and put in output DP queue (using sink API) + * + * this allows the current pipeline structure to see a DP module as a "normal" LL + * + * to be removed when pipeline 2.0 is ready + */ + if (cpu_is_me(dev->ipc_config.core) || + dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) { #if CONFIG_PERFORMANCE_COUNTERS perf_cnt_init(&dev->pcd); #endif diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 177f755dc2ff..8dd907a80d77 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -16,6 +16,8 @@ #include <sof/audio/module_adapter/module/generic.h> #include <sof/audio/sink_api.h> #include <sof/audio/source_api.h> +#include <sof/audio/sink_source_utils.h> +#include <sof/audio/dp_queue.h> #include <sof/audio/pipeline.h> #include <sof/common.h> #include <sof/platform.h> @@ -71,7 +73,16 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, dev->ipc_config = *config; dev->drv = drv; - mod = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*mod)); + /* allocate module information. + * for DP shared modules this struct must be accessible from all cores + * Unfortunately at this point there's no information of components the module + * will be bound to. So we need to allocate shared memory for each DP module + * To be removed when pipeline 2.0 is ready + */ + enum mem_zone zone = config->proc_domain == COMP_PROCESSING_DOMAIN_DP ? + SOF_MEM_ZONE_RUNTIME_SHARED : SOF_MEM_ZONE_RUNTIME; + + mod = rzalloc(zone, 0, SOF_MEM_CAPS_RAM, sizeof(*mod)); if (!mod) { comp_err(dev, "module_adapter_new(), failed to allocate memory for module"); rfree(dev); @@ -161,6 +172,12 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, goto err; } +#if CONFIG_ZEPHYR_DP_SCHEDULER + /* create a task for DP processing */ + if (config->proc_domain == COMP_PROCESSING_DOMAIN_DP) + pipeline_comp_dp_task_init(dev); +#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ + #if CONFIG_IPC_MAJOR_4 dst->init_data = NULL; #endif @@ -208,6 +225,133 @@ static int module_adapter_sink_src_prepare(struct comp_dev *dev) return ret; } +#if CONFIG_ZEPHYR_DP_SCHEDULER +static int module_adapter_dp_queue_prepare(struct comp_dev *dev) +{ + int dp_mode = dev->is_shared ? DP_QUEUE_MODE_SHARED : DP_QUEUE_MODE_LOCAL; + struct processing_module *mod = comp_get_drvdata(dev); + struct dp_queue *dp_queue; + struct list_item *blist; + int ret; + int i; + + /* for DP processing we need to create a DP QUEUE for each module input/output + * till pipeline2.0 is ready, DP processing requires double buffering + * + * first, set all parameters by calling "module prepare" with pointers to + * "main" audio_stream buffers + */ + ret = module_adapter_sink_src_prepare(dev); + if (ret) + return ret; + + /* + * second step - create a "shadow" cross-core DpQueue for existing buffers + * and copy stream parameters to shadow buffers + */ + i = 0; + list_init(&mod->dp_queue_ll_to_dp_list); + list_for_item(blist, &dev->bsource_list) { + struct comp_buffer *source_buffer = + container_of(blist, struct comp_buffer, sink_list); + + /* copy IBS & OBS from buffer to be shadowed */ + size_t min_available = + source_get_min_available(audio_stream_get_source(&source_buffer->stream)); + size_t min_free_space = + sink_get_min_free_space(audio_stream_get_sink(&source_buffer->stream)); + + /* create a shadow dp queue */ + dp_queue = dp_queue_create(min_available, min_free_space, dp_mode); + + if (!dp_queue) + goto err; + dp_queue_append_to_list(dp_queue, &mod->dp_queue_ll_to_dp_list); + + /* it will override source pointers set by module_adapter_sink_src_prepare + * module will use shadow dpQueue for processing + */ + mod->sources[i] = dp_queue_get_source(dp_queue); + + /* copy parameters from buffer to be shadowed */ + memcpy_s(&dp_queue->audio_stream_params, + sizeof(dp_queue->audio_stream_params), + &source_buffer->stream.runtime_stream_params, + sizeof(source_buffer->stream.runtime_stream_params)); + i++; + } + mod->num_of_sources = i; + + i = 0; + list_init(&mod->dp_queue_dp_to_ll_list); + list_for_item(blist, &dev->bsink_list) { + struct comp_buffer *sink_buffer = + container_of(blist, struct comp_buffer, source_list); + + /* copy IBS & OBS from buffer to be shadowed */ + size_t min_available = + source_get_min_available(audio_stream_get_source(&sink_buffer->stream)); + size_t min_free_space = + sink_get_min_free_space(audio_stream_get_sink(&sink_buffer->stream)); + + /* create a shadow dp queue */ + dp_queue = dp_queue_create(min_available, min_free_space, dp_mode); + + if (!dp_queue) + goto err; + + dp_queue_append_to_list(dp_queue, &mod->dp_queue_dp_to_ll_list); + /* it will override sink pointers set by module_adapter_sink_src_prepare + * module will use shadow dpQueue for processing + */ + mod->sinks[i] = dp_queue_get_sink(dp_queue); + + /* copy parameters from buffer to be shadowed */ + memcpy_s(&dp_queue->audio_stream_params, + sizeof(dp_queue->audio_stream_params), + &sink_buffer->stream.runtime_stream_params, + sizeof(sink_buffer->stream.runtime_stream_params)); + + i++; + } + mod->num_of_sinks = i; + + return 0; + +err:; + struct list_item *dp_queue_list_item; + struct list_item *tmp; + + i = 0; + list_for_item_safe(dp_queue_list_item, tmp, &mod->dp_queue_dp_to_ll_list) { + struct dp_queue *dp_queue = + container_of(dp_queue_list_item, struct dp_queue, list); + + /* dp free will also remove the queue from a list */ + dp_queue_free(dp_queue); + mod->sources[i++] = NULL; + } + mod->num_of_sources = 0; + + i = 0; + list_for_item_safe(dp_queue_list_item, tmp, &mod->dp_queue_ll_to_dp_list) { + struct dp_queue *dp_queue = + container_of(dp_queue_list_item, struct dp_queue, list); + + dp_queue_free(dp_queue); + mod->sinks[i++] = NULL; + } + mod->num_of_sinks = 0; + + return -ENOMEM; +} +#else +static inline int module_adapter_dp_queue_prepare(struct comp_dev *dev) +{ + return -EINVAL; +} +#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ + /* * \brief Prepare the module * \param[in] dev - component device pointer. @@ -230,11 +374,21 @@ int module_adapter_prepare(struct comp_dev *dev) comp_dbg(dev, "module_adapter_prepare() start"); /* Prepare module */ - if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) + if (IS_PROCESSING_MODE_SINK_SOURCE(mod) && + mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) + ret = module_adapter_dp_queue_prepare(dev); + + else if (IS_PROCESSING_MODE_SINK_SOURCE(mod) && + mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) ret = module_adapter_sink_src_prepare(dev); - else + + else if ((IS_PROCESSING_MODE_RAW_DATA(mod) || IS_PROCESSING_MODE_AUDIO_STREAM(mod)) && + mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) ret = module_prepare(mod, NULL, 0, NULL, 0); + else + ret = -EINVAL; + if (ret) { if (ret != PPL_STATUS_PATH_STOP) comp_err(dev, "module_adapter_prepare() error %x: module prepare failed", @@ -273,13 +427,15 @@ int module_adapter_prepare(struct comp_dev *dev) mod->period_bytes = audio_stream_period_bytes(&sink->stream, dev->frames); comp_dbg(dev, "module_adapter_prepare(): got period_bytes = %u", mod->period_bytes); - mod->num_of_sources = 0; - mod->num_of_sinks = 0; + /* no more to do for sink/source mode */ + if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) + return 0; /* * compute number of input buffers and make the source_info shared if the module is on a * different core than any of it's sources */ + mod->num_of_sources = 0; list_for_item(blist, &dev->bsource_list) { struct comp_buffer *buf; struct comp_dev *source; @@ -294,6 +450,7 @@ int module_adapter_prepare(struct comp_dev *dev) } /* compute number of output buffers */ + mod->num_of_sinks = 0; list_for_item(blist, &dev->bsink_list) mod->num_of_sinks++; @@ -964,6 +1121,67 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) return ret; } +#if CONFIG_ZEPHYR_DP_SCHEDULER +static int module_adapter_copy_dp_queues(struct comp_dev *dev) +{ + /* + * copy data from component audio streams to dp_queue + * DP module processing itself will take place in DP thread + * This is an adapter, to be removed when pipeline2.0 is ready + */ + struct processing_module *mod = comp_get_drvdata(dev); + struct dp_queue *dp_queue; + struct list_item *blist; + int err; + + dp_queue = dp_queue_get_first_item(&mod->dp_queue_ll_to_dp_list); + list_for_item(blist, &dev->bsource_list) { + /* input - we need to copy data from audio_stream (as source) + * to dp_queue (as sink) + */ + assert(dp_queue); + struct comp_buffer *buffer = + container_of(blist, struct comp_buffer, sink_list); + struct sof_source *data_src = audio_stream_get_source(&buffer->stream); + struct sof_sink *data_sink = dp_queue_get_sink(dp_queue); + uint32_t to_copy = MIN(sink_get_free_size(data_sink), + source_get_data_available(data_src)); + + err = source_to_sink_copy(data_src, data_sink, true, to_copy); + if (err) + return err; + + dp_queue = dp_queue_get_next_item(dp_queue); + } + + dp_queue = dp_queue_get_first_item(&mod->dp_queue_dp_to_ll_list); + list_for_item(blist, &dev->bsink_list) { + /* output - we need to copy data from dp_queue (as source) + * to audio_stream (as sink) + */ + assert(dp_queue); + struct comp_buffer *buffer = + container_of(blist, struct comp_buffer, source_list); + struct sof_sink *data_sink = audio_stream_get_sink(&buffer->stream); + struct sof_source *data_src = dp_queue_get_source(dp_queue); + uint32_t to_copy = MIN(sink_get_free_size(data_sink), + source_get_data_available(data_src)); + + err = source_to_sink_copy(data_src, data_sink, true, to_copy); + if (err) + return err; + + dp_queue = dp_queue_get_next_item(dp_queue); + } + return 0; +} +#else +static inline int module_adapter_copy_dp_queues(struct comp_dev *dev) +{ + return -ENOTSUP; +} +#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ + static int module_adapter_sink_source_copy(struct comp_dev *dev) { struct processing_module *mod = comp_get_drvdata(dev); @@ -1105,8 +1323,13 @@ int module_adapter_copy(struct comp_dev *dev) if (IS_PROCESSING_MODE_RAW_DATA(mod)) return module_adapter_raw_data_type_copy(dev); - if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) - return module_adapter_sink_source_copy(dev); + if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { + if (mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) + return module_adapter_copy_dp_queues(dev); + else + return module_adapter_sink_source_copy(dev); + + } comp_err(dev, "module_adapter_copy(): unknown processing_data_type"); return -EINVAL; @@ -1335,11 +1558,37 @@ int module_adapter_reset(struct comp_dev *dev) mod->num_of_sources = 0; mod->num_of_sinks = 0; - } else if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { + } +#if CONFIG_ZEPHYR_DP_SCHEDULER + if (IS_PROCESSING_MODE_SINK_SOURCE(mod) && + mod->dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) { + /* for DP processing - free DP Queues */ + struct list_item *dp_queue_list_item; + struct list_item *tmp; + + list_for_item_safe(dp_queue_list_item, tmp, &mod->dp_queue_dp_to_ll_list) { + struct dp_queue *dp_queue = + container_of(dp_queue_list_item, struct dp_queue, list); + + /* dp free will also remove the queue from a list */ + dp_queue_free(dp_queue); + } + list_for_item_safe(dp_queue_list_item, tmp, &mod->dp_queue_ll_to_dp_list) { + struct dp_queue *dp_queue = + container_of(dp_queue_list_item, struct dp_queue, list); + + dp_queue_free(dp_queue); + } + } +#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ + if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { + /* for both LL and DP processing */ for (int i = 0; i < mod->num_of_sources; i++) mod->sources[i] = NULL; for (int i = 0; i < mod->num_of_sinks; i++) mod->sinks[i] = NULL; + mod->num_of_sinks = 0; + mod->num_of_sources = 0; } mod->total_data_consumed = 0; diff --git a/src/audio/pipeline/pipeline-params.c b/src/audio/pipeline/pipeline-params.c index d7a80915c837..ecf27bfa3d3c 100644 --- a/src/audio/pipeline/pipeline-params.c +++ b/src/audio/pipeline/pipeline-params.c @@ -311,36 +311,13 @@ static int pipeline_comp_prepare(struct comp_dev *current, } } - switch (current->ipc_config.proc_domain) { - case COMP_PROCESSING_DOMAIN_LL: - /* this is a LL scheduled module */ + if (current->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) { + /* init a task for LL module, DP task has been created in during init_instance */ err = pipeline_comp_ll_task_init(current->pipeline); - break; - -#if CONFIG_ZEPHYR_DP_SCHEDULER - case COMP_PROCESSING_DOMAIN_DP: - /* this is a DP scheduled module */ - - /* - * workaround - because of some issues with cache, currently we can allow DP - * modules to run on the same core as LL pipeline only. - * to be removed once buffering is fixed - */ - if (current->pipeline->core != current->ipc_config.core) - err = -EINVAL; - else - err = pipeline_comp_dp_task_init(current); - - break; -#endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ - - default: - err = -EINVAL; + if (err < 0) + return err; } - if (err < 0) - return err; - err = comp_prepare(current); if (err < 0 || err == PPL_STATUS_PATH_STOP) return err; diff --git a/src/audio/pipeline/pipeline-schedule.c b/src/audio/pipeline/pipeline-schedule.c index a4a7a71da50f..0a61752079e9 100644 --- a/src/audio/pipeline/pipeline-schedule.c +++ b/src/audio/pipeline/pipeline-schedule.c @@ -14,6 +14,7 @@ #include <sof/schedule/ll_schedule.h> #include <sof/schedule/dp_schedule.h> #include <sof/schedule/schedule.h> +#include <sof/audio/module_adapter/module/generic.h> #include <rtos/task.h> #include <rtos/spinlock.h> #include <rtos/string.h> @@ -378,15 +379,18 @@ int pipeline_comp_ll_task_init(struct pipeline *p) #if CONFIG_ZEPHYR_DP_SCHEDULER static enum task_state dp_task_run(void *data) { - struct comp_dev *comp = data; + struct processing_module *mod = data; + + module_process_sink_src(mod, mod->sources, mod->num_of_sources, + mod->sinks, mod->num_of_sinks); - comp->drv->ops.copy(comp); return SOF_TASK_STATE_RESCHEDULE; } int pipeline_comp_dp_task_init(struct comp_dev *comp) { int ret; + struct processing_module *mod = comp_get_drvdata(comp); struct task_ops ops = { .run = dp_task_run, .get_deadline = NULL, @@ -397,7 +401,7 @@ int pipeline_comp_dp_task_init(struct comp_dev *comp) ret = scheduler_dp_task_init(&comp->task, SOF_UUID(dp_task_uuid), &ops, - comp, + mod, comp->ipc_config.core, TASK_DP_STACK_SIZE, ZEPHYR_DP_THREAD_PRIORITY); diff --git a/src/idc/idc.c b/src/idc/idc.c index 9a630ca6fbf7..860f427a551d 100644 --- a/src/idc/idc.c +++ b/src/idc/idc.c @@ -227,8 +227,8 @@ static int idc_prepare(uint32_t comp_id) dev = ipc_dev->cd; - /* we're running on different core, so allocate our own task */ - if (!dev->task) { + /* we're running LL on different core, so allocate our own task */ + if (!dev->task && dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) { /* allocate task for shared component */ dev->task = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*dev->task)); diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 6e80c8d53e39..1cdfc6a61e9c 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -17,6 +17,7 @@ #include <sof/lib/memory.h> #include <sof/audio/sink_api.h> #include <sof/audio/source_api.h> +#include <sof/audio/dp_queue.h> #include "module_interface.h" #if CONFIG_INTEL_MODULES @@ -196,9 +197,25 @@ struct processing_module { /* sink and source handlers for the module */ struct sof_sink *sinks[MODULE_MAX_SOURCES]; struct sof_source *sources[MODULE_MAX_SOURCES]; - struct input_stream_buffer *input_buffers; - struct output_stream_buffer *output_buffers; + union { + struct { + /* this is used in case of raw data or audio_stream mode + * number of buffers described by fields: + * input_buffers - num_of_sources + * output_buffers - num_of_sinks + */ + struct input_stream_buffer *input_buffers; + struct output_stream_buffer *output_buffers; + }; + struct { + /* this is used in case of DP processing + * dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP + */ + struct list_item dp_queue_ll_to_dp_list; + struct list_item dp_queue_dp_to_ll_list; + }; + }; struct comp_buffer *source_comp_buffer; /**< single source component buffer */ struct comp_buffer *sink_comp_buffer; /**< single sink compoonent buffer */ diff --git a/src/include/sof/schedule/dp_schedule.h b/src/include/sof/schedule/dp_schedule.h index 81650c563d80..9b7f85c7e798 100644 --- a/src/include/sof/schedule/dp_schedule.h +++ b/src/include/sof/schedule/dp_schedule.h @@ -13,6 +13,8 @@ #include <user/trace.h> #include <stdint.h> +struct processing_module; + /** * * DP scheduler is a scheduler that creates a separate preemptible Zephyr thread for each SOF task @@ -49,9 +51,6 @@ * */ -/** \brief tell the scheduler to run the task immediately, even if LL tick is not yet running */ -#define SCHEDULER_DP_RUN_TASK_IMMEDIATELY ((uint64_t)-1) - /** * \brief Init the Data Processing scheduler */ @@ -64,7 +63,7 @@ int scheduler_dp_init(void); * \param[out] task pointer, pointer to allocated task structure will be return * \param[in] uid pointer to UUID of the task * \param[in] ops pointer to task functions - * \param[in] data pointer to the thread private data + * \param[in] mod pointer to the module to be run * \param[in] core CPU the thread should run on * \param[in] stack_size size of stack for a zephyr task * \param[in] task_priority priority of the zephyr task @@ -72,7 +71,7 @@ int scheduler_dp_init(void); int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid, const struct task_ops *ops, - void *data, + struct processing_module *mod, uint16_t core, size_t stack_size, uint32_t task_priority); diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 73e9c6d1a787..d01efe6f4fc4 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -310,14 +310,10 @@ int ipc_pipeline_free(struct ipc *ipc, uint32_t comp_id) } static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, bool is_shared, - uint32_t src_obs, uint32_t src_queue, + uint32_t buf_size, uint32_t src_queue, uint32_t dst_queue) { struct sof_ipc_buffer ipc_buf; - int buf_size; - - /* double it since obs is single buffer size */ - buf_size = src_obs * 2; memset(&ipc_buf, 0, sizeof(ipc_buf)); ipc_buf.size = buf_size; @@ -337,7 +333,6 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) struct ipc4_base_module_cfg sink_src_cfg; uint32_t flags; int src_id, sink_id; - bool is_shared; int ret; bu = (struct ipc4_module_bind_unbind *)_connect; @@ -351,10 +346,13 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) return IPC4_INVALID_RESOURCE_ID; } - /* Pass IPC to target core if both modules has the same target core */ - if (!cpu_is_me(source->ipc_config.core) && source->ipc_config.core == sink->ipc_config.core) + bool is_shared = source->ipc_config.core != sink->ipc_config.core; + + /* Pass IPC to target core if the buffer won't be shared and will be used + * on different core + */ + if (!cpu_is_me(source->ipc_config.core) && !is_shared) return ipc4_process_on_core(source->ipc_config.core, false); - is_shared = (source->ipc_config.core != sink->ipc_config.core); ret = comp_get_attribute(source, COMP_ATTR_BASE_CONFIG, &source_src_cfg); if (ret < 0) { @@ -368,8 +366,21 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) return IPC4_FAILURE; } - buffer = ipc4_create_buffer(source, is_shared, source_src_cfg.obs, - bu->extension.r.src_queue, bu->extension.r.dst_queue); + /* create a buffer + * in case of LL -> LL or LL->DP + * size = 2*obs of source module (obs is single buffer size) + * in case of DP -> LL + * size = 2*ibs of destination (LL) module. DP queue will handle obs of DP module + */ + uint32_t buf_size; + + if (source->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) + buf_size = source_src_cfg.obs * 2; + else + buf_size = sink_src_cfg.ibs * 2; + + buffer = ipc4_create_buffer(source, is_shared, buf_size, bu->extension.r.src_queue, + bu->extension.r.dst_queue); if (!buffer) { tr_err(&ipc_tr, "failed to allocate buffer to bind %d to %d", src_id, sink_id); return IPC4_OUT_OF_MEMORY; diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index a51304e9a6db..3ced95814658 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -6,6 +6,7 @@ */ #include <sof/audio/component.h> +#include <sof/audio/module_adapter/module/generic.h> #include <rtos/task.h> #include <stdint.h> #include <sof/schedule/dp_schedule.h> @@ -34,10 +35,10 @@ struct scheduler_dp_data { struct task_dp_pdata { k_tid_t thread_id; /* zephyr thread ID */ + uint32_t period; /* period the task should be scheduled in us */ k_thread_stack_t __sparse_cache *p_stack; /* pointer to thread stack */ - uint32_t ticks_period; /* period the task should be scheduled in LL ticks */ - uint32_t ticks_to_trigger; /* number of ticks the task should be triggered after */ struct k_sem sem; /* semaphore for task scheduling */ + struct processing_module *mod; /* the module to be scheduled */ }; /* Single CPU-wide lock @@ -62,10 +63,6 @@ static enum task_state scheduler_dp_ll_tick_dummy(void *data) /* * function called after every LL tick - * - * TODO: - * the scheduler should here calculate deadlines of all task and tell Zephyr about them - * Currently there's an assumption that the task is always ready to run */ void scheduler_dp_ll_tick(void *receiver_data, enum notify_id event_type, void *caller_data) { @@ -81,20 +78,23 @@ void scheduler_dp_ll_tick(void *receiver_data, enum notify_id event_type, void * lock_key = scheduler_dp_lock(); list_for_item(tlist, &dp_sch->tasks) { curr_task = container_of(tlist, struct task, list); - pdata = curr_task->priv_data; - if (pdata->ticks_to_trigger == 0) { - if (curr_task->state == SOF_TASK_STATE_QUEUED) { - /* set new trigger time, start the thread */ - pdata->ticks_to_trigger = pdata->ticks_period; + /* step 1 - check if the module is ready for processing */ + if (curr_task->state == SOF_TASK_STATE_QUEUED) { + pdata = curr_task->priv_data; + struct processing_module *mod = pdata->mod; + bool mod_ready; + + mod_ready = module_is_ready_to_process(mod, mod->sources, + mod->num_of_sources, + mod->sinks, + mod->num_of_sinks); + if (mod_ready) { + /* TODO: step 2 - caclulate deadlines */ + /* trigger the task */ curr_task->state = SOF_TASK_STATE_RUNNING; k_sem_give(&pdata->sem); } - } else { - if (curr_task->state == SOF_TASK_STATE_QUEUED || - curr_task->state == SOF_TASK_STATE_RUNNING) - /* decrease num of ticks to re-schedule */ - pdata->ticks_to_trigger--; } } scheduler_dp_unlock(lock_key); @@ -212,23 +212,11 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta return -EINVAL; } - /* calculate period and start time in LL ticks */ - pdata->ticks_period = period / LL_TIMER_PERIOD_US; - /* add a task to DP scheduler list */ + task->state = SOF_TASK_STATE_QUEUED; list_item_prepend(&task->list, &dp_sch->tasks); - if (start == SCHEDULER_DP_RUN_TASK_IMMEDIATELY) { - /* trigger the task immediately, don't wait for LL tick */ - pdata->ticks_to_trigger = 0; - task->state = SOF_TASK_STATE_RUNNING; - k_sem_give(&pdata->sem); - } else { - /* wait for tick */ - pdata->ticks_to_trigger = start / LL_TIMER_PERIOD_US; - task->state = SOF_TASK_STATE_QUEUED; - } - + pdata->period = period; scheduler_dp_unlock(lock_key); /* start LL task - run DP tick start and period are irrelevant for LL (that's bad)*/ @@ -272,7 +260,7 @@ int scheduler_dp_init(void) int scheduler_dp_task_init(struct task **task, const struct sof_uuid_entry *uid, const struct task_ops *ops, - void *data, + struct processing_module *mod, uint16_t core, size_t stack_size, uint32_t task_priority) @@ -335,7 +323,7 @@ int scheduler_dp_task_init(struct task **task, /* internal SOF task init */ ret = schedule_task_init(&task_memory->task, uid, SOF_SCHEDULE_DP, 0, ops->run, - data, core, 0); + mod, core, 0); if (ret < 0) { tr_err(&dp_tr, "zephyr_dp_task_init(): schedule_task_init failed"); goto err; @@ -354,6 +342,7 @@ int scheduler_dp_task_init(struct task **task, task_memory->task.priv_data = &task_memory->pdata; task_memory->pdata.thread_id = thread_id; task_memory->pdata.p_stack = p_stack; + task_memory->pdata.mod = mod; *task = &task_memory->task; /* start the thread - it will immediately stop at a semaphore */ From 9ca86c9fd6534c096191d2801c9339def0a2470e Mon Sep 17 00:00:00 2001 From: Pin-chih Lin <johnylin@google.com> Date: Tue, 15 Aug 2023 21:48:16 +0800 Subject: [PATCH 449/639] smart_amp: revamp to two-layer modular design structure The motivation is depicted in https://github.com/thesofproject/sof/pull/7801 This commit revamps smart_amp component design to two-layer structure, i.e. generic layer and inner model layer. Generic layer is the common part of smart amp process which can be regarded as the glue code interacting between SOF component ops and inner model. While inner model may have various implementations respectively for solution suppliers in a modular way. Signed-off-by: Pin-chih Lin <johnylin@google.com> --- src/audio/smart_amp/CMakeLists.txt | 2 + src/audio/smart_amp/Kconfig | 29 +- src/audio/smart_amp/smart_amp.c | 619 +++++++++-------- src/audio/smart_amp/smart_amp_generic.c | 463 ++++++++----- src/audio/smart_amp/smart_amp_maxim_dsm.c | 713 +++++++++++--------- src/audio/smart_amp/smart_amp_passthru.c | 147 ++++ src/include/sof/audio/format.h | 15 + src/include/sof/audio/smart_amp/smart_amp.h | 424 ++++++++---- 8 files changed, 1506 insertions(+), 906 deletions(-) create mode 100644 src/audio/smart_amp/smart_amp_passthru.c diff --git a/src/audio/smart_amp/CMakeLists.txt b/src/audio/smart_amp/CMakeLists.txt index 89048004f16b..387381057804 100644 --- a/src/audio/smart_amp/CMakeLists.txt +++ b/src/audio/smart_amp/CMakeLists.txt @@ -10,4 +10,6 @@ else() sof_add_static_library(dsm ${CMAKE_CURRENT_LIST_DIR}/lib/release/dsm_lib/libdsm.a) endif() target_include_directories(sof PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include/dsm_api/inc) +else() +add_local_sources(sof smart_amp_passthru.c) endif() diff --git a/src/audio/smart_amp/Kconfig b/src/audio/smart_amp/Kconfig index 4cbbffbc51d2..02cc6fadc0c5 100644 --- a/src/audio/smart_amp/Kconfig +++ b/src/audio/smart_amp/Kconfig @@ -1,12 +1,30 @@ # SPDX-License-Identifier: BSD-3-Clause -menu "Smart amplifier solutions" - visible if COMP_SMART_AMP +if COMP_SMART_AMP + +choice + prompt "Smart Amplifier solution applied" + default PASSTHRU_AMP + help + The selection for Smart Amplifier component implementation + will depend on the Amplifier solution supplier. It is fair + to treat the supported solutions as mutually exclusive ones. + There should be no more than one solution selected per build + config. When Smart Amplifier is present but no solution is + supported, the passthrough mode will be applied as default. + + config PASSTHRU_AMP + bool "Stream Passthrough" + help + The default option as the passthrough mode while no other + solution is applied. While selected, the feed-forward input + frames will be passed to output after channel remapping. No + gain or latency will be produced. In the meanwhile, the + feedback input frames will be consumed but dropped directly. config MAXIM_DSM bool "Maxim DSM solution" select MAXIM_DSM_STUB if COMP_STUBS - default n help Select to apply Maxim DSM(Dynamic Speaker Management) solution for Smart Amplifier. As the third-party supply, the @@ -14,6 +32,8 @@ menu "Smart amplifier solutions" building the FW binary with this option enabled. The library itself should be statically linked with the SoF FW binary image. +endchoice + config MAXIM_DSM_STUB bool "Maxim DSM solution" depends on MAXIM_DSM @@ -22,5 +42,4 @@ menu "Smart amplifier solutions" Select to build the Maxim DSM adapter with a stub library. This should only be used for CI and testing. -endmenu - +endif diff --git a/src/audio/smart_amp/smart_amp.c b/src/audio/smart_amp/smart_amp.c index 931acc6ce1be..ecf0e3a5d7ce 100644 --- a/src/audio/smart_amp/smart_amp.c +++ b/src/audio/smart_amp/smart_amp.c @@ -3,6 +3,12 @@ // Copyright(c) 2020 Maxim Integrated All rights reserved. // // Author: Ryan Lee <ryans.lee@maximintegrated.com> +// +// Copyright(c) 2023 Google LLC. +// +// Author: Pin-chih Lin <johnylin@google.com> + +#include <sys/types.h> #include <rtos/init.h> #include <sof/trace/trace.h> @@ -14,201 +20,151 @@ static const struct comp_driver comp_smart_amp; +#if CONFIG_MAXIM_DSM /* 0cd84e80-ebd3-11ea-adc1-0242ac120002 */ -DECLARE_SOF_RT_UUID("Maxim DSM", maxim_dsm_comp_uuid, 0x0cd84e80, 0xebd3, +DECLARE_SOF_RT_UUID("Maxim DSM", smart_amp_comp_uuid, 0x0cd84e80, 0xebd3, 0x11ea, 0xad, 0xc1, 0x02, 0x42, 0xac, 0x12, 0x00, 0x02); -DECLARE_TR_CTX(maxim_dsm_comp_tr, SOF_UUID(maxim_dsm_comp_uuid), +#else /* Passthrough */ +/* 64a794f0-55d3-4bca-9d5b-7b588badd037 */ +DECLARE_SOF_RT_UUID("Passthru Amp", smart_amp_comp_uuid, 0x64a794f0, 0x55d3, + 0x4bca, 0x9d, 0x5b, 0x7b, 0x58, 0x8b, 0xad, 0xd0, 0x37); + +#endif +DECLARE_TR_CTX(smart_amp_comp_tr, SOF_UUID(smart_amp_comp_uuid), LOG_LEVEL_INFO); /* Amp configuration & model calibration data for tuning/debug */ #define SOF_SMART_AMP_CONFIG 0 #define SOF_SMART_AMP_MODEL 1 -typedef int(*smart_amp_proc)(struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, uint32_t frames, - int8_t *chan_map, bool is_feedback); - struct smart_amp_data { struct sof_smart_amp_config config; struct comp_data_blob_handler *model_handler; struct comp_buffer *source_buf; /**< stream source buffer */ struct comp_buffer *feedback_buf; /**< feedback source buffer */ struct comp_buffer *sink_buf; /**< sink buffer */ - smart_amp_proc process; - uint32_t in_channels; - uint32_t out_channels; - /* module handle for speaker protection algorithm */ - struct smart_amp_mod_struct_t *mod_handle; + struct ipc_config_process ipc_config; + + smart_amp_src_func ff_get_frame; /**< function to get stream source */ + smart_amp_src_func fb_get_frame; /**< function to get feedback source */ + smart_amp_sink_func ff_set_frame; /**< function to set sink */ + struct smart_amp_mod_stream ff_mod; /**< feed-forward buffer for mod */ + struct smart_amp_mod_stream fb_mod; /**< feedback buffer for mod */ + struct smart_amp_mod_stream out_mod; /**< output buffer for mod */ + + struct smart_amp_buf mod_mems[MOD_MEMBLK_MAX]; /**< memory blocks for mod */ + + struct smart_amp_mod_data_base *mod_data; /**< inner model data */ }; -static inline void smart_amp_free_memory(struct smart_amp_data *sad, - struct comp_dev *dev) +/* smart_amp_free_mod_memories will be called promptly once getting error on + * internal functions. That is, it may be called multiple times by the hierarchical + * model when an error occurs in the lower function and propagates level-wise to + * the function on top. Always set the pointer to NULL after freed to avoid the + * double-freeing error. + */ +static inline void smart_amp_free_mod_memories(struct smart_amp_data *sad) { - struct smart_amp_mod_struct_t *hspk = sad->mod_handle; - - /* buffer : sof -> spk protection feed forward process */ - rfree(hspk->buf.frame_in); - /* buffer : sof <- spk protection feed forward process */ - rfree(hspk->buf.frame_out); - /* buffer : sof -> spk protection feedback process */ - rfree(hspk->buf.frame_iv); - /* buffer : feed forward process input */ - rfree(hspk->buf.input); - /* buffer : feed forward process output */ - rfree(hspk->buf.output); - /* buffer : feedback voltage */ - rfree(hspk->buf.voltage); - /* buffer : feedback current */ - rfree(hspk->buf.current); - /* buffer : feed forward variable length -> fixed length */ - rfree(hspk->buf.ff.buf); - /* buffer : feed forward variable length <- fixed length */ - rfree(hspk->buf.ff_out.buf); - /* buffer : feedback variable length -> fixed length */ - rfree(hspk->buf.fb.buf); - /* Module handle release */ - rfree(hspk); + /* sof -> mod feed-forward data re-mapping and format conversion */ + rfree(sad->ff_mod.buf.data); + sad->ff_mod.buf.data = NULL; + /* sof -> mod feedback data re-mapping and format conversion */ + rfree(sad->fb_mod.buf.data); + sad->fb_mod.buf.data = NULL; + /* mod -> sof processed data format conversion */ + rfree(sad->out_mod.buf.data); + sad->out_mod.buf.data = NULL; + + /* mem block for mod private data usage */ + rfree(sad->mod_mems[MOD_MEMBLK_PRIVATE].data); + sad->mod_mems[MOD_MEMBLK_PRIVATE].data = NULL; + /* mem block for mod audio frame data usage */ + rfree(sad->mod_mems[MOD_MEMBLK_FRAME].data); + sad->mod_mems[MOD_MEMBLK_FRAME].data = NULL; + /* mem block for mod parameter blob usage */ + rfree(sad->mod_mems[MOD_MEMBLK_PARAM].data); + sad->mod_mems[MOD_MEMBLK_PARAM].data = NULL; + + /* inner model data struct */ + rfree(sad->mod_data); + sad->mod_data = NULL; } -static inline int smart_amp_alloc_memory(struct smart_amp_data *sad, - struct comp_dev *dev) +static inline int smart_amp_buf_alloc(struct smart_amp_buf *buf, size_t size) { - struct smart_amp_mod_struct_t *hspk; - int mem_sz; - int size; - - /* memory allocation for module handle */ - mem_sz = sizeof(struct smart_amp_mod_struct_t); - sad->mod_handle = rballoc(0, SOF_MEM_CAPS_RAM, mem_sz); - if (!sad->mod_handle) - goto err; - memset(sad->mod_handle, 0, mem_sz); - - hspk = sad->mod_handle; + buf->data = rballoc(0, SOF_MEM_CAPS_RAM, size); + if (!buf->data) + return -ENOMEM; + buf->size = size; + return 0; +} - /* buffer : sof -> spk protection feed forward process */ - size = SMART_AMP_FF_BUF_DB_SZ * sizeof(int32_t); - hspk->buf.frame_in = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.frame_in) - goto err; - mem_sz += size; +static ssize_t smart_amp_alloc_mod_memblk(struct smart_amp_data *sad, + enum smart_amp_mod_memblk blk) +{ + struct smart_amp_mod_data_base *mod = sad->mod_data; + int ret; + size_t size; - /* buffer : sof <- spk protection feed forward process */ - size = SMART_AMP_FF_BUF_DB_SZ * sizeof(int32_t); - hspk->buf.frame_out = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.frame_out) - goto err; - mem_sz += size; + /* query the required size from inner model. */ + ret = mod->mod_ops->query_memblk_size(mod, blk); + if (ret <= 0) + goto error; - /* buffer : sof -> spk protection feedback process */ - size = SMART_AMP_FB_BUF_DB_SZ * sizeof(int32_t); - hspk->buf.frame_iv = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.frame_iv) - goto err; - mem_sz += size; - - /* buffer : feed forward process input */ - size = DSM_FF_BUF_SZ * sizeof(int32_t); - hspk->buf.input = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.input) - goto err; - mem_sz += size; - - /* buffer : feed forward process output */ - size = DSM_FF_BUF_SZ * sizeof(int32_t); - hspk->buf.output = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.output) - goto err; - mem_sz += size; - - /* buffer : feedback voltage */ - size = DSM_FF_BUF_SZ * sizeof(int32_t); - hspk->buf.voltage = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.voltage) - goto err; - mem_sz += size; - - /* buffer : feedback current */ - size = DSM_FF_BUF_SZ * sizeof(int32_t); - hspk->buf.current = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.current) - goto err; - mem_sz += size; - - /* buffer : feed forward variable length -> fixed length */ - size = DSM_FF_BUF_DB_SZ * sizeof(int32_t); - hspk->buf.ff.buf = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.ff.buf) - goto err; - mem_sz += size; - - /* buffer : feed forward variable length <- fixed length */ - size = DSM_FF_BUF_DB_SZ * sizeof(int32_t); - hspk->buf.ff_out.buf = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.ff_out.buf) - goto err; - mem_sz += size; - - /* buffer : feedback variable length -> fixed length */ - size = DSM_FB_BUF_DB_SZ * sizeof(int32_t); - hspk->buf.fb.buf = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->buf.fb.buf) - goto err; - mem_sz += size; - - /* memory allocation of DSM handle */ - size = smart_amp_get_memory_size(hspk, dev); - hspk->dsmhandle = rballoc(0, SOF_MEM_CAPS_RAM, size); - if (!hspk->dsmhandle) - goto err; - memset(hspk->dsmhandle, 0, size); - mem_sz += size; - - comp_dbg(dev, "[DSM] module:%p (%d bytes used)", - hspk, mem_sz); + /* allocate the memory block when returned size > 0. */ + size = ret; + ret = smart_amp_buf_alloc(&sad->mod_mems[blk], size); + if (ret < 0) + goto error; - return 0; -err: - smart_amp_free_memory(sad, dev); - return -ENOMEM; -} + /* provide the memory block information to inner model. */ + ret = mod->mod_ops->set_memblk(mod, blk, &sad->mod_mems[blk]); + if (ret < 0) + goto error; -static void smart_amp_free_caldata(struct comp_dev *dev, - struct smart_amp_caldata *caldata) -{ - if (!caldata->data) - return; + return size; - rfree(caldata->data); - caldata->data = NULL; - caldata->data_size = 0; - caldata->data_pos = 0; +error: + smart_amp_free_mod_memories(sad); + return ret; } -static inline int smart_amp_alloc_caldata(struct comp_dev *dev, - struct smart_amp_caldata *caldata, - uint32_t size) +static int smart_amp_alloc_data_buffers(struct comp_dev *dev, + struct smart_amp_data *sad) { - smart_amp_free_caldata(dev, caldata); - - if (!size) - return 0; + size_t total_size; + int ret; + size_t size; - caldata->data = rballoc(0, SOF_MEM_CAPS_RAM, size); + /* sof -> mod feed-forward data re-mapping and format conversion */ + size = SMART_AMP_FF_BUF_DB_SZ * sizeof(int32_t); + ret = smart_amp_buf_alloc(&sad->ff_mod.buf, size); + if (ret < 0) + goto error; + total_size = size; - if (!caldata->data) { - comp_err(dev, "smart_amp_alloc_caldata(): model->data rballoc failed"); - return -ENOMEM; - } + /* sof -> mod feedback data re-mapping and format conversion */ + size = SMART_AMP_FB_BUF_DB_SZ * sizeof(int32_t); + ret = smart_amp_buf_alloc(&sad->fb_mod.buf, size); + if (ret < 0) + goto error; + total_size += size; - bzero(caldata->data, size); - caldata->data_size = size; - caldata->data_pos = 0; + /* mod -> sof processed data format conversion */ + size = SMART_AMP_FF_BUF_DB_SZ * sizeof(int32_t); + ret = smart_amp_buf_alloc(&sad->out_mod.buf, size); + if (ret < 0) + goto error; + total_size += size; + comp_dbg(dev, "smart_amp_alloc(): used data buffer %zu bytes", total_size); return 0; + +error: + smart_amp_free_mod_memories(sad); + return ret; } static struct comp_dev *smart_amp_new(const struct comp_driver *drv, @@ -220,7 +176,6 @@ static struct comp_dev *smart_amp_new(const struct comp_driver *drv, struct smart_amp_data *sad; struct sof_smart_amp_config *cfg; size_t bs; - int sz_caldata; int ret; dev = comp_alloc(drv, sizeof(*dev)); @@ -248,39 +203,57 @@ static struct comp_dev *smart_amp_new(const struct comp_driver *drv, memcpy_s(&sad->config, sizeof(struct sof_smart_amp_config), cfg, bs); - if (smart_amp_alloc_memory(sad, dev) != 0) + /* allocate inner model data struct */ + sad->mod_data = mod_data_create(dev); + if (!sad->mod_data) { + comp_err(dev, "smart_amp_new(): failed to allocate nner model data"); goto error; + } - /* Bitwidth information is not available. Use 16bit as default. - * Re-initialize in the prepare function if ncessary - */ - sad->mod_handle->bitwidth = 16; - if (smart_amp_init(sad->mod_handle, dev)) + /* allocate stream buffers for mod */ + ret = smart_amp_alloc_data_buffers(dev, sad); + if (ret) { + comp_err(dev, "smart_amp_new(): failed to allocate data buffers, ret:%d", ret); goto error; + } - /* Get the max. number of parameter to allocate memory for model data */ - sad->mod_handle->param.max_param = - smart_amp_get_num_param(sad->mod_handle, dev); - sz_caldata = sad->mod_handle->param.max_param * DSM_SINGLE_PARAM_SZ; + /* (before init) allocate mem block for mod private data usage */ + ret = smart_amp_alloc_mod_memblk(sad, MOD_MEMBLK_PRIVATE); + if (ret < 0) { + comp_err(dev, "smart_amp_new(): failed to allocate mod private, ret:%d", ret); + goto error; + } + comp_dbg(dev, "smart_amp_new(): used mod private buffer %d bytes", ret); - if (sz_caldata > 0) { - ret = smart_amp_alloc_caldata(dev, &sad->mod_handle->param.caldata, - sz_caldata * sizeof(int32_t)); - if (ret < 0) { - comp_err(dev, "smart_amp_new(): caldata initial failed"); - goto error; - } + /* init model */ + ret = sad->mod_data->mod_ops->init(sad->mod_data); + if (ret) { + comp_err(dev, "smart_amp_new(): failed to init inner model, ret:%d", ret); + goto error; } - /* update full parameter values */ - if (smart_amp_get_all_param(sad->mod_handle, dev) < 0) + /* (after init) allocate mem block for mod audio frame data usage */ + ret = smart_amp_alloc_mod_memblk(sad, MOD_MEMBLK_FRAME); + if (ret < 0) { + comp_err(dev, "smart_amp_new(): failed to allocate mod buffer, ret:%d", ret); goto error; + } + comp_dbg(dev, "smart_amp_new(): used mod data buffer %d bytes", ret); + + /* (after init) allocate mem block for mod parameter blob usage */ + ret = smart_amp_alloc_mod_memblk(sad, MOD_MEMBLK_PARAM); + if (ret < 0) { + comp_err(dev, "smart_amp_new(): failed to allocate mod config, ret:%d", ret); + goto error; + } + comp_dbg(dev, "smart_amp_new(): used mod config buffer %d bytes", ret); dev->state = COMP_STATE_READY; return dev; error: + smart_amp_free_mod_memories(sad); rfree(sad); rfree(dev); return NULL; @@ -295,14 +268,14 @@ static int smart_amp_set_config(struct comp_dev *dev, /* Copy new config, find size from header */ cfg = (struct sof_smart_amp_config *) - ASSUME_ALIGNED(&cdata->data->data, sizeof(uint32_t)); + ASSUME_ALIGNED(&cdata->data->data, sizeof(uint32_t)); bs = cfg->size; - comp_dbg(dev, "smart_amp_set_config(), actual blob size = %u, expected blob size = %u", + comp_dbg(dev, "smart_amp_set_config(), actual blob size = %zu, expected blob size = %zu", bs, sizeof(struct sof_smart_amp_config)); if (bs != sizeof(struct sof_smart_amp_config)) { - comp_err(dev, "smart_amp_set_config(): invalid blob size, actual blob size = %u, expected blob size = %u", + comp_err(dev, "smart_amp_set_config(): invalid blob size, actual blob size = %zu, expected blob size = %zu", bs, sizeof(struct sof_smart_amp_config)); return -EINVAL; } @@ -323,7 +296,7 @@ static int smart_amp_get_config(struct comp_dev *dev, /* Copy back to user space */ bs = sad->config.size; - comp_dbg(dev, "smart_amp_get_config(), actual blob size = %u, expected blob size = %u", + comp_dbg(dev, "smart_amp_get_config(), actual blob size = %zu, expected blob size = %zu", bs, sizeof(struct sof_smart_amp_config)); if (bs == 0 || bs > size) @@ -343,18 +316,20 @@ static int smart_amp_ctrl_get_bin_data(struct comp_dev *dev, int size) { struct smart_amp_data *sad = comp_get_drvdata(dev); + struct smart_amp_mod_data_base *mod; int ret = 0; assert(sad); + mod = sad->mod_data; switch (cdata->data->type) { case SOF_SMART_AMP_CONFIG: ret = smart_amp_get_config(dev, cdata, size); break; case SOF_SMART_AMP_MODEL: - ret = maxim_dsm_get_param(sad->mod_handle, dev, cdata, size); + ret = mod->mod_ops->get_config(mod, cdata, size); if (ret < 0) { - comp_err(dev, "smart_amp_ctrl_get_bin_data(): parameter read error!"); + comp_err(dev, "smart_amp_ctrl_get_bin_data(): failed to read inner model!"); return ret; } break; @@ -389,9 +364,11 @@ static int smart_amp_ctrl_set_bin_data(struct comp_dev *dev, struct sof_ipc_ctrl_data *cdata) { struct smart_amp_data *sad = comp_get_drvdata(dev); + struct smart_amp_mod_data_base *mod; int ret = 0; assert(sad); + mod = sad->mod_data; if (dev->state < COMP_STATE_READY) { comp_err(dev, "smart_amp_ctrl_set_bin_data(): driver in init!"); @@ -403,9 +380,9 @@ static int smart_amp_ctrl_set_bin_data(struct comp_dev *dev, ret = smart_amp_set_config(dev, cdata); break; case SOF_SMART_AMP_MODEL: - ret = maxim_dsm_set_param(sad->mod_handle, dev, cdata); + ret = mod->mod_ops->set_config(mod, cdata); if (ret < 0) { - comp_err(dev, "smart_amp_ctrl_set_bin_data(): parameter write error!"); + comp_err(dev, "smart_amp_ctrl_set_bin_data(): failed to write inner model!"); return ret; } break; @@ -466,11 +443,12 @@ static void smart_amp_free(struct comp_dev *dev) comp_dbg(dev, "smart_amp_free()"); - smart_amp_free_caldata(dev, &sad->mod_handle->param.caldata); - smart_amp_free_memory(sad, dev); + smart_amp_free_mod_memories(sad); rfree(sad); + sad = NULL; rfree(dev); + dev = NULL; } static int smart_amp_verify_params(struct comp_dev *dev, @@ -531,42 +509,72 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) return ret; } -static int smart_amp_process(struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - uint32_t frames, int8_t *chan_map, - bool is_feedback) +static int smart_amp_ff_process(struct comp_dev *dev, + const struct audio_stream *source, + const struct audio_stream *sink, + uint32_t frames, const int8_t *chan_map) { struct smart_amp_data *sad = comp_get_drvdata(dev); + struct smart_amp_mod_data_base *mod = sad->mod_data; int ret; - if (!is_feedback) - ret = smart_amp_ff_copy(dev, frames, - source, sink, - chan_map, sad->mod_handle, - sad->in_channels, sad->out_channels); - else - ret = smart_amp_fb_copy(dev, frames, - source, sink, - chan_map, sad->mod_handle, - audio_stream_get_channels(source)); - return ret; + sad->ff_mod.consumed = 0; + sad->out_mod.produced = 0; + + if (frames == 0) { + comp_warn(dev, "smart_amp_copy(): feed forward frame size zero warning."); + return 0; + } + + if (frames > SMART_AMP_FF_BUF_DB_SZ) { + comp_err(dev, "smart_amp_copy(): feed forward frame size overflow: %u", frames); + sad->ff_mod.consumed = frames; + return -EINVAL; + } + + sad->ff_get_frame(&sad->ff_mod, frames, source, chan_map); + + ret = mod->mod_ops->ff_proc(mod, frames, &sad->ff_mod, &sad->out_mod); + if (ret) { + comp_err(dev, "smart_amp_copy(): feed forward inner model process error"); + return ret; + } + + sad->ff_set_frame(&sad->out_mod, sad->out_mod.produced, sink); + + return 0; } -static smart_amp_proc get_smart_amp_process(struct comp_dev *dev) +static int smart_amp_fb_process(struct comp_dev *dev, + const struct audio_stream *source, + uint32_t frames, const int8_t *chan_map) { struct smart_amp_data *sad = comp_get_drvdata(dev); - enum sof_ipc_frame fmt = audio_stream_get_frm_fmt(&sad->source_buf->stream); + struct smart_amp_mod_data_base *mod = sad->mod_data; + int ret; - switch (fmt) { - case SOF_IPC_FRAME_S16_LE: - case SOF_IPC_FRAME_S24_4LE: - case SOF_IPC_FRAME_S32_LE: - return smart_amp_process; - default: - comp_err(dev, "smart_amp_process() error: not supported frame format"); - return NULL; + sad->fb_mod.consumed = 0; + + if (frames == 0) { + comp_warn(dev, "smart_amp_copy(): feedback frame size zero warning."); + return 0; } + + if (frames > SMART_AMP_FB_BUF_DB_SZ) { + comp_err(dev, "smart_amp_copy(): feedback frame size overflow: %u", frames); + sad->fb_mod.consumed = frames; + return -EINVAL; + } + + sad->fb_get_frame(&sad->fb_mod, frames, source, chan_map); + + ret = mod->mod_ops->fb_proc(mod, frames, &sad->fb_mod); + if (ret) { + comp_err(dev, "smart_amp_copy(): feedback inner model process error"); + return ret; + } + + return 0; } static int smart_amp_copy(struct comp_dev *dev) @@ -603,27 +611,39 @@ static int smart_amp_copy(struct comp_dev *dev) feedback_bytes = avail_feedback_frames * audio_stream_frame_bytes(&feedback_buf->stream); - comp_dbg(dev, "smart_amp_copy(): processing %d feedback frames (avail_passthrough_frames: %d)", + comp_dbg(dev, "smart_amp_copy(): processing %u feedback frames (avail_passthrough_frames: %u)", avail_feedback_frames, avail_passthrough_frames); /* perform buffer writeback after source_buf process */ buffer_stream_invalidate(feedback_buf, feedback_bytes); - sad->process(dev, &feedback_buf->stream, - &sink_buf->stream, avail_feedback_frames, - sad->config.feedback_ch_map, true); + smart_amp_fb_process(dev, &feedback_buf->stream, + avail_feedback_frames, + sad->config.feedback_ch_map); + + comp_dbg(dev, "smart_amp_copy(): consumed %u feedback frames", + sad->fb_mod.consumed); + if (sad->fb_mod.consumed < avail_feedback_frames) { + feedback_bytes = sad->fb_mod.consumed * + audio_stream_frame_bytes(&feedback_buf->stream); + } comp_update_buffer_consume(feedback_buf, feedback_bytes); } } - /* bytes calculation */ + /* process data */ source_bytes = avail_frames * audio_stream_frame_bytes(&source_buf->stream); - sink_bytes = avail_frames * audio_stream_frame_bytes(&sink_buf->stream); - /* process data */ buffer_stream_invalidate(source_buf, source_bytes); - sad->process(dev, &source_buf->stream, &sink_buf->stream, - avail_frames, sad->config.source_ch_map, false); + smart_amp_ff_process(dev, &source_buf->stream, &sink_buf->stream, + avail_frames, sad->config.source_ch_map); + + comp_dbg(dev, "smart_amp_copy(): processing %u feed forward frames (consumed: %u, produced: %u)", + avail_frames, sad->ff_mod.consumed, sad->out_mod.produced); + if (sad->ff_mod.consumed < avail_frames) + source_bytes = sad->ff_mod.consumed * audio_stream_frame_bytes(&source_buf->stream); + + sink_bytes = sad->out_mod.produced * audio_stream_frame_bytes(&sink_buf->stream); buffer_stream_writeback(sink_buf, sink_bytes); /* source/sink buffer pointers update */ @@ -636,24 +656,79 @@ static int smart_amp_copy(struct comp_dev *dev) static int smart_amp_reset(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); + struct smart_amp_mod_data_base *mod = sad->mod_data; + int ret; comp_dbg(dev, "smart_amp_reset()"); - sad->process = NULL; - sad->in_channels = 0; - sad->out_channels = 0; + sad->ff_get_frame = NULL; + sad->fb_get_frame = NULL; + sad->ff_set_frame = NULL; + + /* reset inner model */ + ret = mod->mod_ops->reset(mod); + if (ret) + return ret; comp_set_state(dev, COMP_TRIGGER_RESET); return 0; } +/* supported formats: {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE} + * which are enumerated as 0, 1, and 2. Simply check if supported while fmt <= 2. + */ +static inline bool is_supported_fmt(uint16_t fmt) +{ + return fmt <= SOF_IPC_FRAME_S32_LE; +} + +static int smart_amp_resolve_mod_fmt(struct comp_dev *dev, uint32_t least_req_depth) +{ + struct smart_amp_data *sad = comp_get_drvdata(dev); + struct smart_amp_mod_data_base *mod = sad->mod_data; + const uint16_t *mod_fmts; + int num_mod_fmts; + int ret; + int i; + + /* get supported formats from mod */ + ret = mod->mod_ops->get_supported_fmts(mod, &mod_fmts, &num_mod_fmts); + if (ret) { + comp_err(dev, "smart_amp_resolve_mod_fmt(): failed to get supported formats"); + return ret; + } + + for (i = 0; i < num_mod_fmts; i++) { + if (get_sample_bitdepth(mod_fmts[i]) >= least_req_depth && + is_supported_fmt(mod_fmts[i])) { + /* set frame format to inner model */ + comp_dbg(dev, "smart_amp_resolve_mod_fmt(): set mod format to %u", + mod_fmts[i]); + ret = mod->mod_ops->set_fmt(mod, mod_fmts[i]); + if (ret) { + comp_err(dev, + "smart_amp_resolve_mod_fmt(): failed setting format %u", + mod_fmts[i]); + return ret; + } + /* return the resolved format for later settings. */ + return mod_fmts[i]; + } + } + + comp_err(dev, "smart_amp_resolve_mod_fmt(): failed to resolve the frame format for mod"); + return -EINVAL; +} + static int smart_amp_prepare(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); struct list_item *blist; + uint16_t ff_src_fmt, fb_src_fmt, resolved_mod_fmt; + uint32_t least_req_depth; + uint32_t rate; int ret; - int bitwidth; comp_dbg(dev, "smart_amp_prepare()"); @@ -674,73 +749,67 @@ static int smart_amp_prepare(struct comp_dev *dev) } } + /* sink buffer */ sad->sink_buf = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sad->out_channels = audio_stream_get_channels(&sad->sink_buf->stream); + /* get frame format and channels param of stream and feedback source */ + ff_src_fmt = audio_stream_get_frm_fmt(&sad->source_buf->stream); + sad->ff_mod.channels = MIN(SMART_AMP_FF_MAX_CH_NUM, + audio_stream_get_channels(&sad->source_buf->stream)); + sad->out_mod.channels = sad->ff_mod.channels; + /* the least bitdepth required for inner model, which should not be lower than the bitdepth + * for input samples of feed-forward, and feedback if exists. + */ + least_req_depth = get_sample_bitdepth(ff_src_fmt); if (sad->feedback_buf) { + /* forward set channels and rate param to feedback source */ audio_stream_set_channels(&sad->feedback_buf->stream, sad->config.feedback_channels); audio_stream_set_rate(&sad->feedback_buf->stream, audio_stream_get_rate(&sad->source_buf->stream)); + fb_src_fmt = audio_stream_get_frm_fmt(&sad->feedback_buf->stream); + sad->fb_mod.channels = MIN(SMART_AMP_FB_MAX_CH_NUM, + audio_stream_get_channels(&sad->feedback_buf->stream)); - ret = smart_amp_check_audio_fmt(audio_stream_get_rate(&sad->source_buf->stream), - audio_stream_get_channels - (&sad->source_buf->stream)); - if (ret) { - comp_err(dev, "[DSM] Format not supported, sample rate: %d, ch: %d", - audio_stream_get_rate(&sad->source_buf->stream), - audio_stream_get_channels(&sad->source_buf->stream)); - goto error; - } + least_req_depth = MAX(least_req_depth, get_sample_bitdepth(fb_src_fmt)); } - switch (audio_stream_get_frm_fmt(&sad->source_buf->stream)) { - case SOF_IPC_FRAME_S16_LE: - bitwidth = 16; - break; - case SOF_IPC_FRAME_S24_4LE: - bitwidth = 24; - break; - case SOF_IPC_FRAME_S32_LE: - bitwidth = 32; - break; - default: - comp_err(dev, "[DSM] smart_amp_process() error: not supported frame format %d", - audio_stream_get_frm_fmt(&sad->source_buf->stream)); - goto error; - } + /* resolve the frame format for inner model. The return value will be the applied format + * or the negative error code. + */ + ret = smart_amp_resolve_mod_fmt(dev, least_req_depth); + if (ret < 0) + return ret; - sad->mod_handle->bitwidth = bitwidth; - comp_info(dev, "[DSM] Re-initialized for %d bit processing", bitwidth); + resolved_mod_fmt = ret; - ret = smart_amp_init(sad->mod_handle, dev); - if (ret) { - comp_err(dev, "[DSM] Re-initialization error."); - goto error; - } - ret = maxim_dsm_restore_param(sad->mod_handle, dev); - if (ret) { - comp_err(dev, "[DSM] Restoration error."); - goto error; - } + /* set format to mod buffers and get the corresponding src/sink function of channel + * remapping and format conversion. + */ + sad->ff_mod.frame_fmt = resolved_mod_fmt; + sad->out_mod.frame_fmt = resolved_mod_fmt; + sad->ff_get_frame = smart_amp_get_src_func(ff_src_fmt, sad->ff_mod.frame_fmt); + sad->ff_set_frame = smart_amp_get_sink_func(ff_src_fmt, sad->out_mod.frame_fmt); + comp_dbg(dev, "smart_amp_prepare(): ff mod buffer channels:%u fmt_conv:%u -> %u", + sad->ff_mod.channels, ff_src_fmt, sad->ff_mod.frame_fmt); + comp_dbg(dev, "smart_amp_prepare(): output mod buffer channels:%u fmt_conv:%u -> %u", + sad->out_mod.channels, sad->out_mod.frame_fmt, ff_src_fmt); - sad->process = get_smart_amp_process(dev); - if (!sad->process) { - comp_err(dev, "smart_amp_prepare(): get_smart_amp_process failed"); - ret = -EINVAL; + if (sad->feedback_buf) { + sad->fb_mod.frame_fmt = resolved_mod_fmt; + sad->fb_get_frame = smart_amp_get_src_func(fb_src_fmt, sad->fb_mod.frame_fmt); + comp_dbg(dev, "smart_amp_prepare(): fb mod buffer channels:%u fmt_conv:%u -> %u", + sad->fb_mod.channels, fb_src_fmt, sad->fb_mod.frame_fmt); } - -error: - smart_amp_flush(sad->mod_handle, dev); - return ret; + return 0; } static const struct comp_driver comp_smart_amp = { .type = SOF_COMP_SMART_AMP, - .uid = SOF_RT_UUID(maxim_dsm_comp_uuid), - .tctx = &maxim_dsm_comp_tr, + .uid = SOF_RT_UUID(smart_amp_comp_uuid), + .tctx = &smart_amp_comp_tr, .ops = { .create = smart_amp_new, .free = smart_amp_free, diff --git a/src/audio/smart_amp/smart_amp_generic.c b/src/audio/smart_amp/smart_amp_generic.c index 35dffeb0e449..5f6a1698d16b 100644 --- a/src/audio/smart_amp/smart_amp_generic.c +++ b/src/audio/smart_amp/smart_amp_generic.c @@ -3,200 +3,357 @@ // Copyright(c) 2020 Maxim Integrated All rights reserved. // // Author: Ryan Lee <ryans.lee@maximintegrated.com> +// +// Copyright(c) 2023 Google LLC. +// +// Author: Pin-chih Lin <johnylin@google.com> #include <stdint.h> #include <sof/audio/component.h> #include <sof/audio/format.h> #include <sof/audio/smart_amp/smart_amp.h> -#ifdef CONFIG_GENERIC - -static int32_t smart_amp_ff_generic(int32_t x) +static void remap_s32_to_s32(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map) { - /* Add speaker protection feed forward process here */ - return x; + int num_samples_remaining; + int nmax, n, ch, i; + int n_mod = 0; + int src_ch = audio_stream_get_channels(src); + int32_t *src_ptr_base = audio_stream_get_rptr(src); + int32_t *mod_ptr_base = (int32_t *)src_mod->buf.data; + int32_t *src_ptr; + int32_t *mod_ptr; + + /* clean up dst buffer to make sure all 0s on the unmapped channel */ + bzero(mod_ptr_base, src_mod->buf.size); + + num_samples_remaining = frames * src_ch; + while (num_samples_remaining) { + nmax = audio_stream_samples_without_wrap_s32(src, src_ptr_base); + n = MIN(num_samples_remaining, nmax); + + for (ch = 0; ch < src_mod->channels; ch++) { + if (chan_map[ch] == -1) + continue; + + mod_ptr = mod_ptr_base + ch; + src_ptr = src_ptr_base + chan_map[ch]; + n_mod = 0; + for (i = 0; i < n; i += src_ch) { + *mod_ptr = *src_ptr; + mod_ptr += src_mod->channels; + src_ptr += src_ch; + n_mod += src_mod->channels; + } + } + /* update base pointers by forwarding (n / src_ch) frames */ + mod_ptr_base += n_mod; + src_ptr_base += n; + + num_samples_remaining -= n; + src_ptr_base = audio_stream_wrap(src, src_ptr_base); + } } -static void smart_amp_fb_generic(int32_t x) +static void remap_s24_to_s24(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map) { - /* Add speaker protection feedback process here */ + remap_s32_to_s32(src_mod, frames, src, chan_map); } -#if CONFIG_FORMAT_S16LE -static void smart_amp_s16_ff_default(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames) -{ - int16_t *x; - int16_t *y; - int32_t tmp; - int idx; - int ch; +static void remap_s24_to_s32(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map) +{ int i; - int nch = audio_stream_get_channels(source); - - for (ch = 0; ch < nch; ch++) { - idx = ch; - for (i = 0; i < frames; i++) { - x = audio_stream_read_frag_s16(source, idx); - y = audio_stream_read_frag_s16(sink, idx); - tmp = smart_amp_ff_generic(*x << 16); - *y = sat_int16(Q_SHIFT_RND(tmp, 31, 15)); - idx += nch; - } + int n_mod = frames * src_mod->channels; + int32_t *mod_ptr = (int32_t *)src_mod->buf.data; + + remap_s32_to_s32(src_mod, frames, src, chan_map); + + /* one loop for in-place lshift (s24-to-s32) after remapping */ + for (i = 0; i < n_mod; i++) { + *mod_ptr = *mod_ptr << 8; + mod_ptr++; } } -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S24LE -static void smart_amp_s24_ff_default(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames) -{ - int32_t *x; - int32_t *y; - int32_t tmp; - int idx; - int ch; - int i; - int nch = audio_stream_get_channels(source); - - for (ch = 0; ch < nch; ch++) { - idx = ch; - for (i = 0; i < frames; i++) { - x = audio_stream_read_frag_s32(source, idx); - y = audio_stream_read_frag_s32(sink, idx); - tmp = smart_amp_ff_generic(*x << 8); - *y = sat_int24(Q_SHIFT_RND(tmp, 31, 23)); - idx += nch; +static void remap_s16_to_s16(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map) +{ + int num_samples_remaining; + int nmax, n, ch, i; + int n_mod = 0; + int src_ch = audio_stream_get_channels(src); + int16_t *src_ptr_base = audio_stream_get_rptr(src); + int16_t *mod_ptr_base = (int16_t *)src_mod->buf.data; + int16_t *src_ptr; + int16_t *mod_ptr; + + /* clean up mod buffer (dst) to keep all-0 data on the unmapped channel */ + bzero(mod_ptr_base, src_mod->buf.size); + + num_samples_remaining = frames * src_ch; + while (num_samples_remaining) { + nmax = audio_stream_samples_without_wrap_s16(src, src_ptr_base); + n = MIN(num_samples_remaining, nmax); + + for (ch = 0; ch < src_mod->channels; ch++) { + if (chan_map[ch] == -1) + continue; + + mod_ptr = mod_ptr_base + ch; + src_ptr = src_ptr_base + chan_map[ch]; + n_mod = 0; + for (i = 0; i < n; i += src_ch) { + *mod_ptr = *src_ptr; + mod_ptr += src_mod->channels; + src_ptr += src_ch; + n_mod += src_mod->channels; + } } + /* update base pointers by forwarding (n / src_ch) frames */ + mod_ptr_base += n_mod; + src_ptr_base += n; + + num_samples_remaining -= n; + src_ptr_base = audio_stream_wrap(src, src_ptr_base); } } -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S32LE -static void smart_amp_s32_ff_default(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames) -{ - int32_t *x; - int32_t *y; - int idx; - int ch; - int i; - int nch = audio_stream_get_channels(source); - - for (ch = 0; ch < nch; ch++) { - idx = ch; - for (i = 0; i < frames; i++) { - x = audio_stream_read_frag_s32(source, idx); - y = audio_stream_read_frag_s32(sink, idx); - *y = smart_amp_ff_generic(*x); - idx += nch; +static void remap_s16_to_b32(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map, int lshift) +{ + int num_samples_remaining; + int nmax, n, ch, i; + int n_mod = 0; + int src_ch = audio_stream_get_channels(src); + int16_t *src_ptr_base = audio_stream_get_rptr(src); + int32_t *mod_ptr_base = (int32_t *)src_mod->buf.data; + int16_t *src_ptr; + int32_t *mod_ptr; + + /* clean up dst buffer to make sure all 0s on the unmapped channel */ + bzero(mod_ptr_base, src_mod->buf.size); + + num_samples_remaining = frames * src_ch; + while (num_samples_remaining) { + nmax = audio_stream_samples_without_wrap_s16(src, src_ptr_base); + n = MIN(num_samples_remaining, nmax); + + for (ch = 0; ch < src_mod->channels; ch++) { + if (chan_map[ch] == -1) + continue; + + mod_ptr = mod_ptr_base + ch; + src_ptr = src_ptr_base + chan_map[ch]; + n_mod = 0; + for (i = 0; i < n; i += src_ch) { + *mod_ptr = (int32_t)*src_ptr << lshift; + mod_ptr += src_mod->channels; + src_ptr += src_ch; + n_mod += src_mod->channels; + } } + /* update base pointers by forwarding (n / src_ch) frames */ + mod_ptr_base += n_mod; + src_ptr_base += n; + + num_samples_remaining -= n; + src_ptr_base = audio_stream_wrap(src, src_ptr_base); } } -#endif /* CONFIG_FORMAT_S32LE */ -#if CONFIG_FORMAT_S16LE -static void smart_amp_s16_fb_default(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames) -{ - int16_t *x; - int idx; - int ch; - int i; - int nch = audio_stream_get_channels(source); - - for (ch = 0; ch < nch; ch++) { - idx = ch; - for (i = 0; i < frames; i++) { - x = audio_stream_read_frag_s16(feedback, idx); - smart_amp_fb_generic(*x << 16); - idx += nch; +static void remap_s16_to_s24(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map) +{ + remap_s16_to_b32(src_mod, frames, src, chan_map, 8 /* lshift */); +} + +static void remap_s16_to_s32(struct smart_amp_mod_stream *src_mod, uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map) +{ + remap_s16_to_b32(src_mod, frames, src, chan_map, 16 /* lshift */); +} + +static void feed_s32_to_s32(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink) +{ + int num_samples_remaining; + int nmax, n, ch, i; + int sink_ch = audio_stream_get_channels(sink); + int feed_channels = MIN(sink_ch, sink_mod->channels); + int32_t *sink_ptr = audio_stream_get_wptr(sink); + int32_t *mod_ptr = (int32_t *)sink_mod->buf.data; + + num_samples_remaining = frames * sink_ch; + while (num_samples_remaining) { + nmax = audio_stream_samples_without_wrap_s32(sink, sink_ptr); + n = MIN(num_samples_remaining, nmax); + + for (i = 0; i < n; i += sink_ch) { + for (ch = 0; ch < feed_channels; ch++) + *(sink_ptr + ch) = *(mod_ptr + ch); + + sink_ptr += sink_ch; + mod_ptr += sink_mod->channels; } + + num_samples_remaining -= n; + sink_ptr = audio_stream_wrap(sink, sink_ptr); } } -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S24LE -static void smart_amp_s24_fb_default(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames) -{ - int32_t *x; - int idx; - int ch; +static void feed_s24_to_s24(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink) +{ + feed_s32_to_s32(sink_mod, frames, sink); +} + +static void feed_s32_to_s24(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink) +{ int i; - int nch = audio_stream_get_channels(source); - - for (ch = 0; ch < nch; ch++) { - idx = ch; - for (i = 0; i < frames; i++) { - x = audio_stream_read_frag_s32(feedback, idx); - smart_amp_fb_generic(*x << 8); - idx += nch; + int sink_ch = audio_stream_get_channels(sink); + int n_mod = frames * sink_mod->channels; + int32_t *mod_ptr = (int32_t *)sink_mod->buf.data; + + /* one loop for in-place rshift (s32-to-s24) before feeding */ + for (i = 0; i < n_mod; i++) { + *mod_ptr = sat_int24(Q_SHIFT_RND(*mod_ptr, 31, 23)); + mod_ptr++; + } + + feed_s32_to_s32(sink_mod, frames, sink); +} + +static void feed_s16_to_s16(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink) +{ + int num_samples_remaining; + int nmax, n, ch, i; + int sink_ch = audio_stream_get_channels(sink); + int feed_channels = MIN(sink_ch, sink_mod->channels); + int16_t *sink_ptr = audio_stream_get_wptr(sink); + int16_t *mod_ptr = (int16_t *)sink_mod->buf.data; + + num_samples_remaining = frames * sink_ch; + while (num_samples_remaining) { + nmax = audio_stream_samples_without_wrap_s16(sink, sink_ptr); + n = MIN(num_samples_remaining, nmax); + + for (i = 0; i < n; i += sink_ch) { + for (ch = 0; ch < feed_channels; ch++) + *(sink_ptr + ch) = *(mod_ptr + ch); + + sink_ptr += sink_ch; + mod_ptr += sink_mod->channels; } + + num_samples_remaining -= n; + sink_ptr = audio_stream_wrap(sink, sink_ptr); } } -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S32LE -static void smart_amp_s32_fb_default(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames) -{ - int32_t *x; - int idx; - int ch; - int i; - int nch = audio_stream_get_channels(source); - - for (ch = 0; ch < nch; ch++) { - idx = ch; - for (i = 0; i < frames; i++) { - x = audio_stream_read_frag_s32(feedback, idx); - smart_amp_ff_generic(*x); - idx += nch; +static void feed_b32_to_s16(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink, int mod_fbits) +{ + int num_samples_remaining; + int nmax, n, ch, i; + int sink_ch = audio_stream_get_channels(sink); + int feed_channels = MIN(sink_ch, sink_mod->channels); + int16_t *sink_ptr = audio_stream_get_wptr(sink); + int32_t *mod_ptr = (int32_t *)sink_mod->buf.data; + + num_samples_remaining = frames * sink_ch; + while (num_samples_remaining) { + nmax = audio_stream_samples_without_wrap_s16(sink, sink_ptr); + n = MIN(num_samples_remaining, nmax); + + for (i = 0; i < n; i += sink_ch) { + for (ch = 0; ch < feed_channels; ch++) { + *(sink_ptr + ch) = sat_int16(Q_SHIFT_RND(*(mod_ptr + ch), + mod_fbits, 15)); + } + sink_ptr += sink_ch; + mod_ptr += sink_mod->channels; } + + num_samples_remaining -= n; + sink_ptr = audio_stream_wrap(sink, sink_ptr); } } -#endif /* CONFIG_FORMAT_S32LE */ -const struct smart_amp_func_map smart_amp_function_map[] = { -/* { SOURCE_FORMAT , PROCESSING FUNCTION } */ +static void feed_s24_to_s16(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink) +{ + feed_b32_to_s16(sink_mod, frames, sink, 23 /* mod_fbits */); +} + +static void feed_s32_to_s16(const struct smart_amp_mod_stream *sink_mod, uint32_t frames, + const struct audio_stream __sparse_cache *sink) +{ + feed_b32_to_s16(sink_mod, frames, sink, 31 /* mod_fbits */); +} + +const struct smart_amp_func_map src_sink_func_map[] = { + /* { comp_fmt, mod_fmt, src_func, sink_func } + * cases are valid only if comp_fmt <= mod_fmt + */ #if CONFIG_FORMAT_S16LE - { SOF_IPC_FRAME_S16_LE, smart_amp_s16_ff_default }, -#endif /* CONFIG_FORMAT_S16LE */ + { SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S16_LE, &remap_s16_to_s16, &feed_s16_to_s16 }, + #if CONFIG_FORMAT_S24LE - { SOF_IPC_FRAME_S24_4LE, smart_amp_s24_ff_default }, -#endif /* CONFIG_FORMAT_S24LE */ + { SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, &remap_s16_to_s24, &feed_s24_to_s16 }, +#endif /* CONFIG_FORMAT_S24LE */ + #if CONFIG_FORMAT_S32LE - { SOF_IPC_FRAME_S32_LE, smart_amp_s32_ff_default }, -#endif /* CONFIG_FORMAT_S32LE */ -#if CONFIG_FORMAT_S16LE - { SOF_IPC_FRAME_S16_LE, smart_amp_s16_fb_default }, -#endif /* CONFIG_FORMAT_S16LE */ + { SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S32_LE, &remap_s16_to_s32, &feed_s32_to_s16 }, +#endif /* CONFIG_FORMAT_S32LE */ +#endif /* CONFIG_FORMAT_S16LE */ + #if CONFIG_FORMAT_S24LE - { SOF_IPC_FRAME_S24_4LE, smart_amp_s24_fb_default }, -#endif /* CONFIG_FORMAT_S24LE */ + { SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S24_4LE, &remap_s24_to_s24, &feed_s24_to_s24 }, + +#if CONFIG_FORMAT_S32LE + { SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE, &remap_s24_to_s32, &feed_s32_to_s24 }, +#endif /* CONFIG_FORMAT_S32LE */ +#endif /* CONFIG_FORMAT_S24LE */ + #if CONFIG_FORMAT_S32LE - { SOF_IPC_FRAME_S32_LE, smart_amp_s32_fb_default }, -#endif /* CONFIG_FORMAT_S32LE */ + { SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S32_LE, &remap_s32_to_s32, &feed_s32_to_s32 }, +#endif /* CONFIG_FORMAT_S32LE */ }; -const size_t smart_amp_func_count = ARRAY_SIZE(smart_amp_function_map); -#endif +smart_amp_src_func smart_amp_get_src_func(uint16_t comp_fmt, uint16_t mod_fmt) +{ + uint32_t i; + + for (i = 0; i < ARRAY_SIZE(src_sink_func_map); i++) { + if (comp_fmt == src_sink_func_map[i].comp_fmt && + mod_fmt == src_sink_func_map[i].mod_fmt) + return src_sink_func_map[i].src_func; + } + + return NULL; +} + +smart_amp_sink_func smart_amp_get_sink_func(uint16_t comp_fmt, uint16_t mod_fmt) +{ + uint32_t i; + + for (i = 0; i < ARRAY_SIZE(src_sink_func_map); i++) { + if (comp_fmt == src_sink_func_map[i].comp_fmt && + mod_fmt == src_sink_func_map[i].mod_fmt) + return src_sink_func_map[i].sink_func; + } + + return NULL; +} diff --git a/src/audio/smart_amp/smart_amp_maxim_dsm.c b/src/audio/smart_amp/smart_amp_maxim_dsm.c index 165d159678dc..e45620248dd4 100644 --- a/src/audio/smart_amp/smart_amp_maxim_dsm.c +++ b/src/audio/smart_amp/smart_amp_maxim_dsm.c @@ -20,8 +20,119 @@ #include <sof/audio/smart_amp/smart_amp.h> #include "dsm_api_public.h" -static int maxim_dsm_init(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev) +/* Maxim DSM(Dynamic Speaker Management) process buffer size */ +#define DSM_FRM_SZ 48 +#define DSM_FF_BUF_SZ (DSM_FRM_SZ * SMART_AMP_FF_MAX_CH_NUM) +#define DSM_FB_BUF_SZ (DSM_FRM_SZ * SMART_AMP_FB_MAX_CH_NUM) + +#define DSM_FF_BUF_DB_SZ (DSM_FF_BUF_SZ * SMART_AMP_FF_MAX_CH_NUM) +#define DSM_FB_BUF_DB_SZ (DSM_FB_BUF_SZ * SMART_AMP_FB_MAX_CH_NUM) + +/* DSM parameter table structure + * +--------------+-----------------+---------------------------------+ + * | ID (4 bytes) | VALUE (4 bytes) | 1st channel : | + * | | | 8 bytes per single parameter | + * +--------------+-----------------+---------------------------------+ + * | ... | ... | Repeat N times for N parameters | + * +--------------+-----------------+---------------------------------+ + * | ID (4 bytes) | VALUE (4 bytes) | 2nd channel : | + * | | | 8 bytes per single parameter | + * +--------------+-----------------+---------------------------------+ + * | ... | ... | Repeat N times for N parameters | + * +--------------+-----------------+---------------------------------+ + */ +enum dsm_param { + DSM_PARAM_ID = 0, + DSM_PARAM_VALUE, + DSM_PARAM_MAX +}; + +#define DSM_SINGLE_PARAM_SZ (DSM_PARAM_MAX * SMART_AMP_FF_MAX_CH_NUM) + +static const int supported_fmt_count = 3; +static const uint16_t supported_fmts[] = { + SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE +}; + +union maxim_dsm_buf { + int16_t *buf16; + int32_t *buf32; +}; + +struct maxim_dsm_ff_buf_struct_t { + int32_t *buf; + int avail; +}; + +struct maxim_dsm_fb_buf_struct_t { + int32_t *buf; + int avail; + int rdy; +}; + +struct smart_amp_buf_struct_t { + /* buffer : feed forward process input */ + int32_t *input; + /* buffer : feed forward process output */ + int32_t *output; + /* buffer : feedback voltage */ + int32_t *voltage; + /* buffer : feedback current */ + int32_t *current; + /* buffer : feed forward variable length -> fixed length */ + struct maxim_dsm_ff_buf_struct_t ff; + /* buffer : feed forward variable length <- fixed length */ + struct maxim_dsm_ff_buf_struct_t ff_out; + /* buffer : feedback variable length -> fixed length */ + struct maxim_dsm_fb_buf_struct_t fb; +}; + +struct param_buf_struct_t { + int id; + int value; +}; + +struct smart_amp_caldata { + uint32_t data_size; /* size of component's model data */ + void *data; /* model data pointer */ + uint32_t data_pos; /* data position for read/write */ +}; + +struct smart_amp_param_struct_t { + struct param_buf_struct_t param; /* variable to keep last parameter ID/value */ + struct smart_amp_caldata caldata; /* model data buffer */ + int pos; /* data position for read/write */ + int max_param; /* keep max number of DSM parameters */ +}; + +/* self-declared inner model data struct */ +struct smart_amp_mod_struct_t { + struct smart_amp_mod_data_base base; + struct smart_amp_buf_struct_t buf; + void *dsmhandle; + /* DSM variables for the initialization */ + int delayedsamples[SMART_AMP_FF_MAX_CH_NUM << 2]; + int circularbuffersize[SMART_AMP_FF_MAX_CH_NUM << 2]; + /* Number of samples of feed forward and feedback frame */ + int ff_fr_sz_samples; + int fb_fr_sz_samples; + int channelmask; + /* Number of channels of DSM */ + int nchannels; + /* Number of samples of feed forward channel */ + int ifsamples; + /* Number of samples of feedback channel */ + int ibsamples; + /* Number of processed samples */ + int ofsamples; + /* Channel bit dempth */ + int bitwidth; + struct smart_amp_param_struct_t param; +}; + +static int maxim_dsm_init(struct smart_amp_mod_struct_t *hspk) { + const struct comp_dev *dev = hspk->base.dev; int *circularbuffersize = hspk->circularbuffersize; int *delayedsamples = hspk->delayedsamples; struct dsm_api_init_ext_t initparam; @@ -33,11 +144,16 @@ static int maxim_dsm_init(struct smart_amp_mod_struct_t *hspk, struct comp_dev * initparam.ipdelayedsamples = delayedsamples; initparam.isamplingrate = DSM_DEFAULT_SAMPLE_RATE; + if (!hspk->dsmhandle) { + comp_err(dev, "[DSM] Initialization failed: dsmhandle not allocated"); + return -EINVAL; + } + retcode = dsm_api_init(hspk->dsmhandle, &initparam, sizeof(struct dsm_api_init_ext_t)); if (retcode != DSM_API_OK) { goto exit; - } else { + } else { hspk->ff_fr_sz_samples = initparam.off_framesizesamples; hspk->fb_fr_sz_samples = @@ -60,8 +176,62 @@ static int maxim_dsm_init(struct smart_amp_mod_struct_t *hspk, struct comp_dev * return (int)retcode; } -static int maxim_dsm_get_all_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) +static int maxim_dsm_get_num_param(struct smart_amp_mod_struct_t *hspk) +{ + enum DSM_API_MESSAGE retcode; + int cmdblock[DSM_GET_PARAM_SZ_PAYLOAD]; + + /* Get number of parameters */ + cmdblock[DSM_GET_ID_IDX] = DSM_SET_CMD_ID(DSM_API_GET_MAXIMUM_CMD_ID); + retcode = dsm_api_get_params(hspk->dsmhandle, 1, (void *)cmdblock); + if (retcode != DSM_API_OK) + return 0; + + return MIN(DSM_DEFAULT_MAX_NUM_PARAM, cmdblock[DSM_GET_CH1_IDX]); +} + +static int maxim_dsm_get_handle_size(struct smart_amp_mod_struct_t *hspk) +{ + enum DSM_API_MESSAGE retcode; + struct dsm_api_memory_size_ext_t memsize; + int *circularbuffersize = hspk->circularbuffersize; + + memsize.ichannels = DSM_DEFAULT_NUM_CHANNEL; + memsize.ipcircbuffersizebytes = circularbuffersize; + memsize.isamplingrate = DSM_DEFAULT_SAMPLE_RATE; + memsize.omemsizerequestedbytes = 0; + memsize.numeqfilters = DSM_DEFAULT_NUM_EQ; + retcode = dsm_api_get_mem(&memsize, + sizeof(struct dsm_api_memory_size_ext_t)); + if (retcode != DSM_API_OK) + return 0; + + return memsize.omemsizerequestedbytes; +} + +static int maxim_dsm_flush(struct smart_amp_mod_struct_t *hspk) +{ + const struct comp_dev *dev = hspk->base.dev; + + memset(hspk->buf.input, 0, DSM_FF_BUF_SZ * sizeof(int32_t)); + memset(hspk->buf.output, 0, DSM_FF_BUF_SZ * sizeof(int32_t)); + memset(hspk->buf.voltage, 0, DSM_FF_BUF_SZ * sizeof(int32_t)); + memset(hspk->buf.current, 0, DSM_FF_BUF_SZ * sizeof(int32_t)); + + memset(hspk->buf.ff.buf, 0, DSM_FF_BUF_DB_SZ * sizeof(int32_t)); + memset(hspk->buf.ff_out.buf, 0, DSM_FF_BUF_DB_SZ * sizeof(int32_t)); + memset(hspk->buf.fb.buf, 0, DSM_FB_BUF_DB_SZ * sizeof(int32_t)); + + hspk->buf.ff.avail = DSM_FF_BUF_SZ; + hspk->buf.ff_out.avail = 0; + hspk->buf.fb.avail = 0; + + comp_dbg(dev, "[DSM] Reset (handle:%p)", hspk); + + return 0; +} + +static int maxim_dsm_get_all_param(struct smart_amp_mod_struct_t *hspk) { struct smart_amp_caldata *caldata = &hspk->param.caldata; int32_t *db = (int32_t *)caldata->data; @@ -96,7 +266,7 @@ static int maxim_dsm_get_all_param(struct smart_amp_mod_struct_t *hspk, } static int maxim_dsm_get_volatile_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) + const struct comp_dev *dev) { struct smart_amp_caldata *caldata = &hspk->param.caldata; int32_t *db = (int32_t *)caldata->data; @@ -125,42 +295,10 @@ static int maxim_dsm_get_volatile_param(struct smart_amp_mod_struct_t *hspk, return 0; } -int maxim_dsm_get_param_forced(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) -{ - struct smart_amp_caldata *caldata = &hspk->param.caldata; - int32_t *db = (int32_t *)caldata->data; - enum DSM_API_MESSAGE retcode; - int cmdblock[DSM_GET_PARAM_SZ_PAYLOAD]; - int num_param = hspk->param.max_param; - int idx; - - /* Update all parameter values from the DSM component */ - for (idx = 0 ; idx <= num_param ; idx++) { - cmdblock[0] = DSM_SET_CMD_ID(idx); - retcode = dsm_api_get_params(hspk->dsmhandle, 1, (void *)cmdblock); - if (retcode != DSM_API_OK) { - /* set zero if the parameter is not readable */ - cmdblock[DSM_GET_CH1_IDX] = 0; - cmdblock[DSM_GET_CH2_IDX] = 0; - } - /* fill the data for the 1st channel 4 byte ID + 4 byte value */ - db[idx * DSM_PARAM_MAX + DSM_PARAM_ID] = DSM_CH1_BITMASK | idx; - db[idx * DSM_PARAM_MAX + DSM_PARAM_VALUE] = cmdblock[DSM_GET_CH1_IDX]; - /* fill the data for the 2nd channel 4 byte ID + 4 byte value - * 2nd channel data have offset for num_param * DSM_PARAM_MAX - */ - db[(idx + num_param) * DSM_PARAM_MAX + DSM_PARAM_ID] = DSM_CH2_BITMASK | idx; - db[(idx + num_param) * DSM_PARAM_MAX + DSM_PARAM_VALUE] = cmdblock[DSM_GET_CH2_IDX]; - } - - return 0; -} - -int maxim_dsm_get_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev, - struct sof_ipc_ctrl_data *cdata, int size) +static int maxim_dsm_get_param(struct smart_amp_mod_struct_t *hspk, + struct sof_ipc_ctrl_data *cdata, int size) { + const struct comp_dev *dev = hspk->base.dev; struct smart_amp_caldata *caldata = &hspk->param.caldata; size_t bs; int ret; @@ -203,10 +341,10 @@ int maxim_dsm_get_param(struct smart_amp_mod_struct_t *hspk, return 0; } -int maxim_dsm_set_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev, - struct sof_ipc_ctrl_data *cdata) +static int maxim_dsm_set_param(struct smart_amp_mod_struct_t *hspk, + struct sof_ipc_ctrl_data *cdata) { + const struct comp_dev *dev = hspk->base.dev; struct smart_amp_param_struct_t *param = &hspk->param; struct smart_amp_caldata *caldata = &hspk->param.caldata; /* Model database */ @@ -265,9 +403,9 @@ int maxim_dsm_set_param(struct smart_amp_mod_struct_t *hspk, return 0; } -int maxim_dsm_restore_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) +static int maxim_dsm_restore_param(struct smart_amp_mod_struct_t *hspk) { + const struct comp_dev *dev = hspk->base.dev; struct smart_amp_caldata *caldata = &hspk->param.caldata; int32_t *db = (int32_t *)caldata->data; int num_param = hspk->param.max_param; @@ -290,42 +428,74 @@ int maxim_dsm_restore_param(struct smart_amp_mod_struct_t *hspk, return 0; } -static void maxim_dsm_ff_proc(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev, void *in, void *out, - int nsamples, int szsample) +/** + * mod_ops implementation. + */ + +static int maxim_dsm_get_config(struct smart_amp_mod_data_base *mod, + struct sof_ipc_ctrl_data *cdata, uint32_t size) { - union smart_amp_buf buf, buf_out; + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; + + return maxim_dsm_get_param(hspk, cdata, size); +} + +static int maxim_dsm_set_config(struct smart_amp_mod_data_base *mod, + struct sof_ipc_ctrl_data *cdata) +{ + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; + + return maxim_dsm_set_param(hspk, cdata); +} + +static int maxim_dsm_ff_proc(struct smart_amp_mod_data_base *mod, + uint32_t frames, + struct smart_amp_mod_stream *in, + struct smart_amp_mod_stream *out) +{ + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; + union maxim_dsm_buf buf, buf_out; int16_t *input = (int16_t *)hspk->buf.input; int16_t *output = (int16_t *)hspk->buf.output; int32_t *input32 = hspk->buf.input; int32_t *output32 = hspk->buf.output; int *w_ptr = &hspk->buf.ff.avail; int *r_ptr = &hspk->buf.ff_out.avail; - bool is_16bit = szsample == 2 ? true : false; + bool is_16bit = (in->frame_fmt == SOF_IPC_FRAME_S16_LE); + int szsample = (is_16bit ? 2 : 4); + int nsamples = frames * in->channels; int remain; int idx; + int ret = 0; buf.buf16 = (int16_t *)hspk->buf.ff.buf; buf.buf32 = (int32_t *)hspk->buf.ff.buf; buf_out.buf16 = (int16_t *)hspk->buf.ff_out.buf; buf_out.buf32 = (int32_t *)hspk->buf.ff_out.buf; + /* Report all frames consumed even if buffer overflow to prevent source + * congestion. Same for frames produced to keep the stream rolling. + */ + in->consumed = frames; + out->produced = frames; + /* Current pointer(w_ptr) + number of input frames(nsamples) * must be smaller than buffer size limit */ if (*w_ptr + nsamples <= DSM_FF_BUF_DB_SZ) { if (is_16bit) memcpy_s(&buf.buf16[*w_ptr], nsamples * szsample, - in, nsamples * szsample); + in->buf.data, nsamples * szsample); else memcpy_s(&buf.buf32[*w_ptr], nsamples * szsample, - in, nsamples * szsample); + in->buf.data, nsamples * szsample); *w_ptr += nsamples; } else { - comp_warn(dev, + comp_warn(mod->dev, "[DSM] Feed Forward buffer overflow. (w_ptr : %d + %d > %d)", *w_ptr, nsamples, DSM_FF_BUF_DB_SZ); - return; + ret = -EOVERFLOW; + goto error; } /* Run DSM Feedforward process if the buffer is ready */ @@ -387,10 +557,10 @@ static void maxim_dsm_ff_proc(struct smart_amp_mod_struct_t *hspk, /* Output buffer preparation */ if (*r_ptr >= nsamples) { if (is_16bit) - memcpy_s(out, nsamples * szsample, + memcpy_s(out->buf.data, nsamples * szsample, buf_out.buf16, nsamples * szsample); else - memcpy_s(out, nsamples * szsample, + memcpy_s(out->buf.data, nsamples * szsample, buf_out.buf32, nsamples * szsample); remain = (*r_ptr - nsamples); @@ -405,47 +575,65 @@ static void maxim_dsm_ff_proc(struct smart_amp_mod_struct_t *hspk, remain * szsample); } *r_ptr -= nsamples; - } else { - memset(out, 0, nsamples * szsample); - comp_err(dev, - "[DSM] DSM FF process underrun. r_ptr : %d", - *r_ptr); + return ret; } + /* else { */ + comp_err(mod->dev, "[DSM] DSM FF process underrun. r_ptr : %d", *r_ptr); + ret = -ENODATA; + +error: + /* TODO(Maxim): undefined behavior when buffer overflow in previous code. + * It leads to early return and no sample written to output + * buffer. However the sink buffer will still writeback + * avail_frames data copied from output buffer. + */ + /* set all-zero output when buffer overflow or process underrun. */ + memset_s(out->buf.data, out->buf.size, 0, nsamples * szsample); + return ret; } -static void maxim_dsm_fb_proc(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev, void *in, - int nsamples, int szsample) +static int maxim_dsm_fb_proc(struct smart_amp_mod_data_base *mod, + uint32_t frames, + struct smart_amp_mod_stream *in) { - union smart_amp_buf buf; + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; + union maxim_dsm_buf buf; int *w_ptr = &hspk->buf.fb.avail; int16_t *v = (int16_t *)hspk->buf.voltage; int16_t *i = (int16_t *)hspk->buf.current; int32_t *v32 = hspk->buf.voltage; int32_t *i32 = hspk->buf.current; - bool is_16bit = szsample == 2 ? true : false; + bool is_16bit = (in->frame_fmt == SOF_IPC_FRAME_S16_LE); + int szsample = (is_16bit ? 2 : 4); + int nsamples = frames * in->channels; int remain; int idx; buf.buf16 = (int16_t *)hspk->buf.fb.buf; buf.buf32 = hspk->buf.fb.buf; + /* Set all frames consumed even if buffer overflow to prevent source + * congestion. + */ + in->consumed = frames; + /* Current pointer(w_ptr) + number of input frames(nsamples) * must be smaller than buffer size limit */ if (*w_ptr + nsamples <= DSM_FB_BUF_DB_SZ) { if (is_16bit) memcpy_s(&buf.buf16[*w_ptr], nsamples * szsample, - in, nsamples * szsample); + in->buf.data, nsamples * szsample); else memcpy_s(&buf.buf32[*w_ptr], nsamples * szsample, - in, nsamples * szsample); + in->buf.data, nsamples * szsample); *w_ptr += nsamples; } else { - comp_warn(dev, "[DSM] Feedback buffer overflow. w_ptr : %d", + comp_warn(mod->dev, "[DSM] Feedback buffer overflow. w_ptr : %d", *w_ptr); - return; + return -EOVERFLOW; } + /* Run DSM Feedback process if the buffer is ready */ if (*w_ptr >= DSM_FB_BUF_SZ) { if (is_16bit) { @@ -490,189 +678,99 @@ static void maxim_dsm_fb_proc(struct smart_amp_mod_struct_t *hspk, hspk->channelmask, (short *)i32, (short *)v32, &hspk->ibsamples); } -} - -int smart_amp_flush(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev) -{ - memset(hspk->buf.frame_in, 0, - SMART_AMP_FF_BUF_DB_SZ * sizeof(int32_t)); - memset(hspk->buf.frame_out, 0, - SMART_AMP_FF_BUF_DB_SZ * sizeof(int32_t)); - memset(hspk->buf.frame_iv, 0, - SMART_AMP_FB_BUF_DB_SZ * sizeof(int32_t)); - - memset(hspk->buf.input, 0, DSM_FF_BUF_SZ * sizeof(int16_t)); - memset(hspk->buf.output, 0, DSM_FF_BUF_SZ * sizeof(int16_t)); - memset(hspk->buf.voltage, 0, DSM_FF_BUF_SZ * sizeof(int16_t)); - memset(hspk->buf.current, 0, DSM_FF_BUF_SZ * sizeof(int16_t)); - - memset(hspk->buf.ff.buf, 0, DSM_FF_BUF_DB_SZ * sizeof(int32_t)); - memset(hspk->buf.ff_out.buf, 0, DSM_FF_BUF_DB_SZ * sizeof(int32_t)); - memset(hspk->buf.fb.buf, 0, DSM_FB_BUF_DB_SZ * sizeof(int32_t)); - - hspk->buf.ff.avail = DSM_FF_BUF_SZ; - hspk->buf.ff_out.avail = 0; - hspk->buf.fb.avail = 0; - - comp_dbg(dev, "[DSM] Reset (handle:%p)", hspk); - - return 0; -} - -int smart_amp_init(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev) -{ - return maxim_dsm_init(hspk, dev); -} - -int smart_amp_get_all_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) -{ - if (maxim_dsm_get_all_param(hspk, dev) < 0) - return -EINVAL; return 0; } -int smart_amp_get_num_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) +static int maxim_dsm_preinit(struct smart_amp_mod_data_base *mod) { - enum DSM_API_MESSAGE retcode; - int cmdblock[DSM_GET_PARAM_SZ_PAYLOAD]; + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; - /* Get number of parameters */ - cmdblock[DSM_GET_ID_IDX] = DSM_SET_CMD_ID(DSM_API_GET_MAXIMUM_CMD_ID); - retcode = dsm_api_get_params(hspk->dsmhandle, 1, (void *)cmdblock); - if (retcode != DSM_API_OK) - return 0; - - return MIN(DSM_DEFAULT_MAX_NUM_PARAM, cmdblock[DSM_GET_CH1_IDX]); -} - -int smart_amp_get_memory_size(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev) -{ - enum DSM_API_MESSAGE retcode; - struct dsm_api_memory_size_ext_t memsize; - int *circularbuffersize = hspk->circularbuffersize; - - memsize.ichannels = DSM_DEFAULT_NUM_CHANNEL; - memsize.ipcircbuffersizebytes = circularbuffersize; - memsize.isamplingrate = DSM_DEFAULT_SAMPLE_RATE; - memsize.omemsizerequestedbytes = 0; - memsize.numeqfilters = DSM_DEFAULT_NUM_EQ; - retcode = dsm_api_get_mem(&memsize, - sizeof(struct dsm_api_memory_size_ext_t)); - if (retcode != DSM_API_OK) - return 0; - - return memsize.omemsizerequestedbytes; + /* Bitwidth information is not available. Use 16bit as default. + * Re-initialize in the prepare function if ncessary + */ + hspk->bitwidth = 16; + return maxim_dsm_init(hspk); } -int smart_amp_check_audio_fmt(int sample_rate, int ch_num) +static int maxim_dsm_query_memblk_size(struct smart_amp_mod_data_base *mod, + enum smart_amp_mod_memblk blk) { - /* Return error if the format is not supported by DSM component */ - if (sample_rate != DSM_DEFAULT_SAMPLE_RATE) - return -EINVAL; - if (ch_num > DSM_DEFAULT_NUM_CHANNEL) - return -EINVAL; - - return 0; -} + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; + int ret; -static int smart_amp_get_buffer(int32_t *buf, uint32_t frames, - const struct audio_stream *stream, - int8_t *chan_map, uint32_t num_ch) -{ - int idx, ch; - uint32_t in_frag = 0; - union smart_amp_buf input, output; - int index; - - input.buf16 = audio_stream_get_rptr(stream); - input.buf32 = audio_stream_get_rptr(stream); - output.buf16 = (int16_t *)buf; - output.buf32 = (int32_t *)buf; - - switch (audio_stream_get_frm_fmt(stream)) { - case SOF_IPC_FRAME_S16_LE: - for (idx = 0 ; idx < frames ; idx++) { - for (ch = 0 ; ch < num_ch; ch++) { - if (chan_map[ch] == -1) - continue; - index = in_frag + chan_map[ch]; - input.buf16 = - audio_stream_read_frag_s16(stream, - index); - output.buf16[num_ch * idx + ch] = *input.buf16; - } - in_frag += audio_stream_get_channels(stream); - } + switch (blk) { + case MOD_MEMBLK_PRIVATE: + /* Memory size for private data block - dsmhandle */ + ret = maxim_dsm_get_handle_size(hspk); + if (ret <= 0) + comp_err(mod->dev, "[DSM] Get handle size error"); break; - case SOF_IPC_FRAME_S24_4LE: - case SOF_IPC_FRAME_S32_LE: - for (idx = 0 ; idx < frames ; idx++) { - for (ch = 0 ; ch < num_ch ; ch++) { - if (chan_map[ch] == -1) - continue; - index = in_frag + chan_map[ch]; - input.buf32 = - audio_stream_read_frag_s32(stream, - index); - output.buf32[num_ch * idx + ch] = *input.buf32; - } - in_frag += audio_stream_get_channels(stream); + case MOD_MEMBLK_FRAME: + /* Memory size for frame buffer block - smart_amp_buf_struct_t */ + /* smart_amp_buf_struct_t -> input, output, voltage, current */ + ret = 4 * DSM_FF_BUF_SZ * sizeof(int32_t); + /* smart_amp_buf_struct_t -> ff, ff_out, fb */ + ret += 2 * DSM_FF_BUF_DB_SZ * sizeof(int32_t) + DSM_FB_BUF_DB_SZ * sizeof(int32_t); + break; + case MOD_MEMBLK_PARAM: + /* Memory size for param blob block - caldata */ + /* Get the max. number of parameter to allocate memory for model data */ + ret = maxim_dsm_get_num_param(hspk); + if (ret < 0) { + comp_err(mod->dev, "[DSM] Get parameter size error"); + return -EINVAL; } + hspk->param.max_param = ret; + ret = hspk->param.max_param * DSM_SINGLE_PARAM_SZ * sizeof(int32_t); break; default: - return -EINVAL; + ret = -EINVAL; + break; } - return 0; + + return ret; } -static int smart_amp_put_buffer(int32_t *buf, uint32_t frames, - const struct audio_stream *stream, - int8_t *chan_map, uint32_t num_ch_in, - uint32_t num_ch_out) +static int maxim_dsm_set_memblk(struct smart_amp_mod_data_base *mod, + enum smart_amp_mod_memblk blk, + struct smart_amp_buf *buf) { - union smart_amp_buf input, output; - uint32_t out_frag = 0; - int idx, ch; - - input.buf16 = (int16_t *)buf; - input.buf32 = (int32_t *)buf; - output.buf16 = audio_stream_get_wptr(stream); - output.buf32 = audio_stream_get_wptr(stream); - - switch (audio_stream_get_frm_fmt(stream)) { - case SOF_IPC_FRAME_S16_LE: - for (idx = 0 ; idx < frames ; idx++) { - for (ch = 0 ; ch < num_ch_out; ch++) { - if (chan_map[ch] == -1) { - out_frag++; - continue; - } - output.buf16 = - audio_stream_write_frag_s16(stream, - out_frag); - *output.buf16 = input.buf16[num_ch_in * idx + ch]; - out_frag++; - } - } + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; + int32_t *mem_ptr; + + switch (blk) { + case MOD_MEMBLK_PRIVATE: + /* Assign memory to private data */ + hspk->dsmhandle = buf->data; + bzero(hspk->dsmhandle, buf->size); break; - case SOF_IPC_FRAME_S24_4LE: - case SOF_IPC_FRAME_S32_LE: - for (idx = 0 ; idx < frames ; idx++) { - for (ch = 0 ; ch < num_ch_out; ch++) { - if (chan_map[ch] == -1) { - out_frag++; - continue; - } - output.buf32 = - audio_stream_write_frag_s32(stream, - out_frag); - *output.buf32 = input.buf32[num_ch_in * idx + ch]; - out_frag++; - } - } + case MOD_MEMBLK_FRAME: + /* Assign memory to frame buffers */ + mem_ptr = (int32_t *)buf->data; + hspk->buf.input = mem_ptr; + mem_ptr += DSM_FF_BUF_SZ; + hspk->buf.output = mem_ptr; + mem_ptr += DSM_FF_BUF_SZ; + hspk->buf.voltage = mem_ptr; + mem_ptr += DSM_FF_BUF_SZ; + hspk->buf.current = mem_ptr; + mem_ptr += DSM_FF_BUF_SZ; + hspk->buf.ff.buf = mem_ptr; + mem_ptr += DSM_FF_BUF_DB_SZ; + hspk->buf.ff_out.buf = mem_ptr; + mem_ptr += DSM_FF_BUF_DB_SZ; + hspk->buf.fb.buf = mem_ptr; + break; + case MOD_MEMBLK_PARAM: + /* Assign memory to config caldata */ + hspk->param.caldata.data = buf->data; + hspk->param.caldata.data_size = buf->size; + bzero(hspk->param.caldata.data, hspk->param.caldata.data_size); + hspk->param.caldata.data_pos = 0; + + /* update full parameter values */ + if (maxim_dsm_get_all_param(hspk) < 0) + return -EINVAL; break; default: return -EINVAL; @@ -680,110 +778,71 @@ static int smart_amp_put_buffer(int32_t *buf, uint32_t frames, return 0; } -int smart_amp_ff_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream *source, - const struct audio_stream *sink, int8_t *chan_map, - struct smart_amp_mod_struct_t *hspk, - uint32_t num_ch_in, uint32_t num_ch_out) +static int maxim_dsm_get_supported_fmts(struct smart_amp_mod_data_base *mod, + const uint16_t **mod_fmts, int *num_mod_fmts) +{ + *num_mod_fmts = supported_fmt_count; + *mod_fmts = supported_fmts; + return 0; +} + +static int maxim_dsm_set_fmt(struct smart_amp_mod_data_base *mod, uint16_t mod_fmt) { + struct smart_amp_mod_struct_t *hspk = (struct smart_amp_mod_struct_t *)mod; int ret; - if (frames == 0) { - comp_warn(dev, "[DSM] feed forward frame size zero warning."); - return 0; - } + comp_dbg(mod->dev, "[DSM] smart_amp_mod_set_fmt(): %u", mod_fmt); - if (frames > SMART_AMP_FF_BUF_DB_SZ) { - comp_err(dev, "[DSM] feed forward frame size overflow : %d", - frames); - return -EINVAL; - } + hspk->bitwidth = get_sample_bitdepth(mod_fmt); - num_ch_in = MIN(num_ch_in, SMART_AMP_FF_MAX_CH_NUM); - num_ch_out = MIN(num_ch_out, SMART_AMP_FF_OUT_MAX_CH_NUM); - - ret = smart_amp_get_buffer(hspk->buf.frame_in, - frames, source, chan_map, - num_ch_in); - if (ret) - goto err; - - switch (audio_stream_get_frm_fmt(source)) { - case SOF_IPC_FRAME_S16_LE: - maxim_dsm_ff_proc(hspk, dev, - hspk->buf.frame_in, - hspk->buf.frame_out, - frames * num_ch_in, sizeof(int16_t)); - break; - case SOF_IPC_FRAME_S24_4LE: - case SOF_IPC_FRAME_S32_LE: - maxim_dsm_ff_proc(hspk, dev, - hspk->buf.frame_in, - hspk->buf.frame_out, - frames * num_ch_in, sizeof(int32_t)); - break; - default: - ret = -EINVAL; - goto err; + ret = maxim_dsm_init(hspk); + if (ret) { + comp_err(mod->dev, "[DSM] Re-initialization error."); + goto error; + } + ret = maxim_dsm_restore_param(hspk); + if (ret) { + comp_err(mod->dev, "[DSM] Restoration error."); + goto error; } - ret = smart_amp_put_buffer(hspk->buf.frame_out, - frames, sink, chan_map, - MIN(num_ch_in, SMART_AMP_FF_MAX_CH_NUM), - MIN(num_ch_out, SMART_AMP_FF_OUT_MAX_CH_NUM)); - if (ret) - goto err; - - return 0; -err: - comp_err(dev, "[DSM] Not supported frame format"); +error: + maxim_dsm_flush(hspk); return ret; } -int smart_amp_fb_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream *source, - const struct audio_stream *sink, int8_t *chan_map, - struct smart_amp_mod_struct_t *hspk, - uint32_t num_ch) +static int maxim_dsm_reset(struct smart_amp_mod_data_base *mod) { - int ret; - - if (frames == 0) { - comp_warn(dev, "[DSM] feedback frame size zero warning."); - return 0; - } - - if (frames > SMART_AMP_FB_BUF_DB_SZ) { - comp_err(dev, "[DSM] feedback frame size overflow : %d", - frames); - return -EINVAL; - } + /* no-op for reset */ + return 0; +} - num_ch = MIN(num_ch, SMART_AMP_FB_MAX_CH_NUM); +static const struct inner_model_ops maxim_dsm_ops = { + .init = maxim_dsm_preinit, + .query_memblk_size = maxim_dsm_query_memblk_size, + .set_memblk = maxim_dsm_set_memblk, + .get_supported_fmts = maxim_dsm_get_supported_fmts, + .set_fmt = maxim_dsm_set_fmt, + .ff_proc = maxim_dsm_ff_proc, + .fb_proc = maxim_dsm_fb_proc, + .set_config = maxim_dsm_set_config, + .get_config = maxim_dsm_get_config, + .reset = maxim_dsm_reset +}; + +/** + * mod_data_create() implementation. + */ + +struct smart_amp_mod_data_base *mod_data_create(const struct comp_dev *dev) +{ + struct smart_amp_mod_struct_t *hspk; - ret = smart_amp_get_buffer(hspk->buf.frame_iv, - frames, source, - chan_map, num_ch); - if (ret) - goto err; + hspk = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*hspk)); + if (!hspk) + return NULL; - switch (audio_stream_get_frm_fmt(source)) { - case SOF_IPC_FRAME_S16_LE: - maxim_dsm_fb_proc(hspk, dev, hspk->buf.frame_iv, - frames * num_ch, sizeof(int16_t)); - break; - case SOF_IPC_FRAME_S24_4LE: - case SOF_IPC_FRAME_S32_LE: - maxim_dsm_fb_proc(hspk, dev, hspk->buf.frame_iv, - frames * num_ch, sizeof(int32_t)); - break; - default: - ret = -EINVAL; - goto err; - } - return 0; -err: - comp_err(dev, "[DSM] Not supported frame format : %d", - audio_stream_get_frm_fmt(source)); - return ret; + hspk->base.dev = dev; + hspk->base.mod_ops = &maxim_dsm_ops; + return &hspk->base; } diff --git a/src/audio/smart_amp/smart_amp_passthru.c b/src/audio/smart_amp/smart_amp_passthru.c new file mode 100644 index 000000000000..dd5c2fe3d789 --- /dev/null +++ b/src/audio/smart_amp/smart_amp_passthru.c @@ -0,0 +1,147 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Google LLC. +// +// Author: Pin-chih Lin <johnylin@google.com> + +#include <sof/audio/component.h> +#include <sof/trace/trace.h> +#include <sof/ipc/msg.h> + +#include <sof/trace/trace.h> +#include <user/trace.h> +#include <sof/bit.h> +#include <sof/common.h> +#include <stdint.h> +#include <stdlib.h> +#include <sof/audio/smart_amp/smart_amp.h> + +/* self-declared inner model data struct */ +struct passthru_mod_data { + struct smart_amp_mod_data_base base; + uint16_t ff_fmt; + uint16_t fb_fmt; +}; + +static const int supported_fmt_count = 3; +static const uint16_t supported_fmts[] = { + SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE +}; + +/** + * mod ops implementation. + */ + +static int passthru_mod_init(struct smart_amp_mod_data_base *mod) +{ + comp_info(mod->dev, "[PassThru Amp] init"); + return 0; +} + +static int passthru_mod_query_memblk_size(struct smart_amp_mod_data_base *mod, + enum smart_amp_mod_memblk blk) +{ + return 0; +} + +static int passthru_mod_set_memblk(struct smart_amp_mod_data_base *mod, + enum smart_amp_mod_memblk blk, + struct smart_amp_buf *buf) +{ + return 0; +} + +static int passthru_mod_get_supported_fmts(struct smart_amp_mod_data_base *mod, + const uint16_t **mod_fmts, int *num_mod_fmts) +{ + *num_mod_fmts = supported_fmt_count; + *mod_fmts = supported_fmts; + return 0; +} + +static int passthru_mod_set_fmt(struct smart_amp_mod_data_base *mod, uint16_t mod_fmt) +{ + struct passthru_mod_data *pmd = (struct passthru_mod_data *)mod; + + comp_info(mod->dev, "[PassThru Amp] set fmt:%u", mod_fmt); + pmd->ff_fmt = mod_fmt; + pmd->fb_fmt = mod_fmt; + return 0; +} + +static int passthru_mod_ff_proc(struct smart_amp_mod_data_base *mod, + uint32_t frames, + struct smart_amp_mod_stream *in, + struct smart_amp_mod_stream *out) +{ + struct passthru_mod_data *pmd = (struct passthru_mod_data *)mod; + bool is_16bit = (pmd->ff_fmt == SOF_IPC_FRAME_S16_LE); + uint32_t szsample = (is_16bit ? 2 : 4); + uint32_t size = frames * in->channels * szsample; + + comp_dbg(mod->dev, "[PassThru Amp] bypass %u frames", frames); + + /* passthrough all frames */ + memcpy_s(out->buf.data, out->buf.size, in->buf.data, size); + in->consumed = frames; + out->produced = frames; + return 0; +} + +static int passthru_mod_fb_proc(struct smart_amp_mod_data_base *mod, + uint32_t frames, + struct smart_amp_mod_stream *in) +{ + in->consumed = frames; + return 0; +} + +static int passthru_mod_get_config(struct smart_amp_mod_data_base *mod, + struct sof_ipc_ctrl_data *cdata, uint32_t size) +{ + cdata->data->abi = SOF_ABI_VERSION; + cdata->data->size = 0; + return 0; +} + +static int passthru_mod_set_config(struct smart_amp_mod_data_base *mod, + struct sof_ipc_ctrl_data *cdata) +{ + return 0; +} + +static int passthru_mod_reset(struct smart_amp_mod_data_base *mod) +{ + comp_info(mod->dev, "[PassThru Amp] reset"); + return 0; +} + +static const struct inner_model_ops passthru_mod_ops = { + .init = passthru_mod_init, + .query_memblk_size = passthru_mod_query_memblk_size, + .set_memblk = passthru_mod_set_memblk, + .get_supported_fmts = passthru_mod_get_supported_fmts, + .set_fmt = passthru_mod_set_fmt, + .ff_proc = passthru_mod_ff_proc, + .fb_proc = passthru_mod_fb_proc, + .set_config = passthru_mod_set_config, + .get_config = passthru_mod_get_config, + .reset = passthru_mod_reset +}; + +/** + * mod_data_create() implementation. + */ + +struct smart_amp_mod_data_base *mod_data_create(const struct comp_dev *dev) +{ + struct passthru_mod_data *mod; + + mod = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*mod)); + if (!mod) + return NULL; + + mod->base.dev = dev; + mod->base.mod_ops = &passthru_mod_ops; + return &mod->base; +} diff --git a/src/include/sof/audio/format.h b/src/include/sof/audio/format.h index 55b0c8a5debf..a33d3c60fce4 100644 --- a/src/include/sof/audio/format.h +++ b/src/include/sof/audio/format.h @@ -179,6 +179,21 @@ static inline uint32_t get_sample_bytes(enum sof_ipc_frame fmt) } } +static inline uint32_t get_sample_bitdepth(enum sof_ipc_frame fmt) +{ + switch (fmt) { + case SOF_IPC_FRAME_S16_LE: + return 16; + case SOF_IPC_FRAME_S24_4LE: + case SOF_IPC_FRAME_S24_3LE: + return 24; + case SOF_IPC_FRAME_U8: + return 8; + default: + return 32; + } +} + static inline uint32_t get_frame_bytes(enum sof_ipc_frame fmt, uint32_t channels) { diff --git a/src/include/sof/audio/smart_amp/smart_amp.h b/src/include/sof/audio/smart_amp/smart_amp.h index d19f2e00e627..6417d17726a0 100644 --- a/src/include/sof/audio/smart_amp/smart_amp.h +++ b/src/include/sof/audio/smart_amp/smart_amp.h @@ -1,8 +1,12 @@ /* SPDX-License-Identifier: BSD-3-Clause * - * Copyright(c) 2020 Maxim Integrated. All rights reserved. + * Copyright(c) 2020 Maxim Integrated All rights reserved. * * Author: Ryan Lee <ryans.lee@maximintegrated.com> + * + * Copyright(c) 2023 Google LLC. + * + * Author: Pin-chih Lin <johnylin@google.com> */ #ifndef __SOF_AUDIO_DSM_H__ @@ -11,6 +15,46 @@ #include <sof/platform.h> #include <sof/audio/component.h> +/* Smart Amplifier component is a two-layer structured design, i.e. generic + * layer and inner model layer. The latter can have various implementations + * respectively for Amplifier solution suppliers, while the former is the common + * part of Smart Amp process adaptable for all solutions. + * + * In structural aspect, one can regard generic layer as the glue code that + * wraps inner model in a SOF component. Ops are defined for interaction between + * two layers. Inner model is the solution-specific modular code, which may have + * static libraries linked as needed. The structure is figured below: + * + * SRC(FF) SINK(OUT) +-SRC(FB) bytectl + * +- SMART_AMP |^ comp ops | ^ | ^| + * | +------------------v|-------------v---------|------v-----------|v---------+ + * | | Generic Layer (chan remap/fmt conv) || | + * | | (memory mgr)--+------> :::::::::BUFFERS::::::::::::: |+> CONFIG | + * | +------------------|-|^-----------|---------^------|-----------^|---------+ + * | | || mod ops | | | || + * | +------------------v-v|-----------v---------|------v-----------|v---------+ + * | | Inner Model :::::::::::::::::::::BUFFERS::::::::::::::::::::::: | + * | | (solution-specific impl/wrapper) |+> MODEL | + * | +------------------------------|^------------------------------^----------+ + * +--- v| lib ops | CALDATA + * Static Libs (as needed) ----------+ + * Note: + * - FF(Feed-Forward): un-processed playback frame source + * - FB(Feedback): feedback reference frame source (from the capture pipeline) + * + * As illustrated above, generic layer handles the cross-communication for inner + * model and SOF pipeline flow, as well as the smart-amp common tasks including: + * 1. Channel remapping for input/output frames + * 2. Frame format conversion for input/output frames. It allows inner model to + * work with different format from SOF audio stream. + * (Now it only allows the bitdepth of inner model format >= SOF stream, + * e.g. inner model: S32_LE, SOF stream: S16_LE) + * 3. Full-management of runtime memory. That is, dynamic memory buffers either + * required by generic layer or inner model will be allocated/owned/released + * by generic layer. + * More details are stated in the comment of each struct/function later. + */ + /* Maximum number of channels for algorithm in */ #define SMART_AMP_FF_MAX_CH_NUM 2 /* Maximum number of channels for algorithm out */ @@ -18,173 +62,261 @@ /* Maximum number of channels for feedback */ #define SMART_AMP_FB_MAX_CH_NUM 4 -#define SMART_AMP_FRM_SZ 48 /* samples per 1ms */ +#define SMART_AMP_FRM_SZ 48 /* frames per 1ms */ #define SMART_AMP_FF_BUF_SZ (SMART_AMP_FRM_SZ * SMART_AMP_FF_MAX_CH_NUM) #define SMART_AMP_FB_BUF_SZ (SMART_AMP_FRM_SZ * SMART_AMP_FB_MAX_CH_NUM) -/* Maxim DSM(Dynamic Speaker Manangement) process buffer size */ -#define DSM_FRM_SZ 48 -#define DSM_FF_BUF_SZ (DSM_FRM_SZ * SMART_AMP_FF_MAX_CH_NUM) -#define DSM_FB_BUF_SZ (DSM_FRM_SZ * SMART_AMP_FB_MAX_CH_NUM) - #define SMART_AMP_FF_BUF_DB_SZ\ (SMART_AMP_FF_BUF_SZ * SMART_AMP_FF_MAX_CH_NUM) #define SMART_AMP_FB_BUF_DB_SZ\ (SMART_AMP_FB_BUF_SZ * SMART_AMP_FB_MAX_CH_NUM) -#define DSM_FF_BUF_DB_SZ (DSM_FF_BUF_SZ * SMART_AMP_FF_MAX_CH_NUM) -#define DSM_FB_BUF_DB_SZ (DSM_FB_BUF_SZ * SMART_AMP_FB_MAX_CH_NUM) - -/* DSM parameter table structure - * +--------------+-----------------+---------------------------------+ - * | ID (4 bytes) | VALUE (4 bytes) | 1st channel : | - * | | | 8 bytes per single parameter | - * +--------------+-----------------+---------------------------------+ - * | ... | ... | Repeat N times for N parameters | - * +--------------+-----------------+---------------------------------+ - * | ID (4 bytes) | VALUE (4 bytes) | 2nd channel : | - * | | | 8 bytes per single parameter | - * +--------------+-----------------+---------------------------------+ - * | ... | ... | Repeat N times for N parameters | - * +--------------+-----------------+---------------------------------+ - */ -enum dsm_param { - DSM_PARAM_ID = 0, - DSM_PARAM_VALUE, - DSM_PARAM_MAX -}; -#define DSM_SINGLE_PARAM_SZ (DSM_PARAM_MAX * SMART_AMP_FF_MAX_CH_NUM) +struct inner_model_ops; -union smart_amp_buf { - int16_t *buf16; - int32_t *buf32; +/* The common base for inner model data structs. Inner model should declare its + * model data struct while putting this base as the leading member of struct, e.g. + * struct solution_foo_mod_data { + * struct smart_amp_mod_data_base base; + * uint32_t foo_version; + * struct foo_parameter_set; + * ... + * }; + * + * Then implement mod_data_create() in its own C file, e.g. + * struct smart_amp_mod_data_base *mod_data_create(const struct comp_dev *dev) + * { + * struct solution_foo_mod_data *foo; + * foo = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*foo)); + * assert(foo); + * foo->base.dev = dev; + * foo->base.mod_ops = foo_ops; // declared somewhere as static const + * ... + * return &foo->base; + * } + */ +struct smart_amp_mod_data_base { + const struct comp_dev *dev; /* for logger tracing use only */ + const struct inner_model_ops *mod_ops; }; -struct smart_amp_ff_buf_struct_t { - int32_t *buf; - int avail; +/* The struct of memory buffer managed by generic layer. */ +struct smart_amp_buf { + void *data; + uint32_t size; }; -struct smart_amp_fb_buf_struct_t { - int32_t *buf; - int avail; - int rdy; +/* For memory allocation, generic layer plays the active role that queries the + * required memory size for inner model (then allocate and assign back) in + * some specific moments, i.e. once before and after model initialized. Inner + * model should consider buffers located and allocated onto 3 memory blocks in + * terms of usage: + * PRIVATE - allocated before model init - for libraries internal usage + * FRAME - allocated after model init - for audio frame buffer usage + * PARAM - allocated after model init - for parameter blob usage + */ +enum smart_amp_mod_memblk { + MOD_MEMBLK_PRIVATE = 0, + MOD_MEMBLK_FRAME, + MOD_MEMBLK_PARAM, + MOD_MEMBLK_MAX }; -struct smart_amp_buf_struct_t { - /* buffer : sof -> spk protection feed forward process */ - int32_t *frame_in; - /* buffer : sof <- spk protection feed forward process */ - int32_t *frame_out; - /* buffer : sof -> spk protection feedback process */ - int32_t *frame_iv; - /* buffer : feed forward process input */ - int32_t *input; - /* buffer : feed forward process output */ - int32_t *output; - /* buffer : feedback voltage */ - int32_t *voltage; - /* buffer : feedback current */ - int32_t *current; - /* buffer : feed forward variable length -> fixed length */ - struct smart_amp_ff_buf_struct_t ff; - /* buffer : feed forward variable length <- fixed length */ - struct smart_amp_ff_buf_struct_t ff_out; - /* buffer : feedback variable length -> fixed length */ - struct smart_amp_fb_buf_struct_t fb; +/* The intermediate audio data buffer in generic layer. */ +struct smart_amp_mod_stream { + struct smart_amp_buf buf; + uint32_t channels; + uint16_t frame_fmt; + union { + uint32_t consumed; /* for source (in frames) */ + uint32_t produced; /* for sink (in frames) */ + }; }; -struct param_buf_struct_t { - int id; - int value; -}; +/****************************************************************************** + * Generic functions: * + * The implementation is placed in smart_amp_generic.c * + ******************************************************************************/ -struct smart_amp_caldata { - uint32_t data_size; /* size of component's model data */ - void *data; /* model data pointer */ - uint32_t data_pos; /* data position for read/write */ -}; +typedef void (*smart_amp_src_func)(struct smart_amp_mod_stream *src_mod, + uint32_t frames, + const struct audio_stream __sparse_cache *src, + const int8_t *chan_map); -struct smart_amp_param_struct_t { - struct param_buf_struct_t param; /* variable to keep last parameter ID/value */ - struct smart_amp_caldata caldata; /* model data buffer */ - int pos; /* data position for read/write */ - int max_param; /* keep max number of DSM parameters */ -}; +typedef void (*smart_amp_sink_func)(const struct smart_amp_mod_stream *sink_mod, + uint32_t frames, + const struct audio_stream __sparse_cache *sink); -struct smart_amp_mod_struct_t { - struct smart_amp_buf_struct_t buf; - void *dsmhandle; - /* DSM variables for the initialization */ - int delayedsamples[SMART_AMP_FF_MAX_CH_NUM << 2]; - int circularbuffersize[SMART_AMP_FF_MAX_CH_NUM << 2]; - /* Number of samples of feed forward and feedback frame */ - int ff_fr_sz_samples; - int fb_fr_sz_samples; - int channelmask; - /* Number of channels of DSM */ - int nchannels; - /* Number of samples of feed forward channel */ - int ifsamples; - /* Number of samples of feedback channel */ - int ibsamples; - /* Number of processed samples */ - int ofsamples; - /* Channel bit dempth */ - int bitwidth; - struct smart_amp_param_struct_t param; +struct smart_amp_func_map { + uint16_t comp_fmt; + uint16_t mod_fmt; + smart_amp_src_func src_func; + smart_amp_sink_func sink_func; }; -typedef void (*smart_amp_func)(const struct comp_dev *dev, - const struct audio_stream *source, - const struct audio_stream *sink, - const struct audio_stream *feedback, - uint32_t frames); -struct smart_amp_func_map { - uint16_t frame_fmt; - smart_amp_func func; +extern const struct smart_amp_func_map src_sink_func_map[]; + +smart_amp_src_func smart_amp_get_src_func(uint16_t comp_fmt, uint16_t mod_fmt); +smart_amp_sink_func smart_amp_get_sink_func(uint16_t comp_fmt, uint16_t mod_fmt); + +/****************************************************************************** + * Inner model operations (mod ops): * + * Model implementations are mutual exclusive (separated by Kconfig). It * + * must be only one solution applicable per build. The solution-specific * + * implementation is placed in its own C file smart_amp_${SOLUTION}.c * + ******************************************************************************/ + +/** + * Creates the self-declared model data struct. + * Refer to "struct smart_amp_mod_data_base" for details of declaration. + * Args: + * dev - the comp_dev object for logger tracing use only. + * Returns: + * The pointer of "smart_amp_mod_data_base" which is the leading member in + * the created model data struct. + */ +struct smart_amp_mod_data_base *mod_data_create(const struct comp_dev *dev); + +/* All ops are mandatory. */ +struct inner_model_ops { + /** + * Initializes model. + * It will be called on comp_ops.create() by generic layer. + * Args: + * mod - the pointer of model data struct object. + * Returns: + * 0 or negative error code. + */ + int (*init)(struct smart_amp_mod_data_base *mod); + + /** + * Returns the required bytesize for the specific memblk. + * It will be called on comp_ops.create() by generic layer, before or after + * mod_ops.init() according to the memblk usage. + * Args: + * mod - the pointer of model data struct object. + * blk - the memblk usage type. + * Returns: + * The bytesize or negative error code. + */ + int (*query_memblk_size)(struct smart_amp_mod_data_base *mod, + enum smart_amp_mod_memblk blk); + + /** + * Sets the allocated memblk info. + * It should be called in sequence after mod_ops.query_memblk_size(). + * Args: + * mod - the pointer of model data struct object. + * blk - the memblk usage type. + * buf - the pointer of smart_amp_buf object including allocated memory. + * Returns: + * 0 or negative error code. + */ + int (*set_memblk)(struct smart_amp_mod_data_base *mod, + enum smart_amp_mod_memblk blk, + struct smart_amp_buf *buf); + + /** + * Returns the list of supported frame formats. + * It will be called on comp_ops.prepare() by generic layer. + * + * Inner model should report all supported formats in the list at once. + * Generic layer will resolve the applicable format according to this list and + * the formats requested from external source/sink stream buffers. If it turns + * out to be no format applicable, generic layer will report errors which will + * force the early-termination of the starting process for the whole pipeline. + * Args: + * mod - the pointer of model data struct object. + * mod_fmts - the pointer for returning the supported format list. + * Format values should be aligned to "enum sof_ipc_frame" and + * put in ascending order. + * num_mod_fmts - the pointer for returning the length of mod_fmts. + * Returns: + * 0 or negative error code. + */ + int (*get_supported_fmts)(struct smart_amp_mod_data_base *mod, + const uint16_t **mod_fmts, int *num_mod_fmts); + + /** + * Sets the frame format after resolved. + * It will be called on comp_ops.prepare() by generic layer, in sequence after + * mod_ops.get_supported_fmts() if the format is resolvable. + * + * Inner model should honor the received format on processing. The FF and FB + * frames (if available) will be put to the input buffers in the same format. + * It will be the last function called before audio stream starts processing. + * needed, inner model should execute the preparing tasks as soon as it is + * called. + * Args: + * mod - the pointer of model data struct object. + * mod_fmt - the frame format to be applied.. + * Returns: + * 0 or negative error code. + */ + int (*set_fmt)(struct smart_amp_mod_data_base *mod, uint16_t mod_fmt); + + /** + * Runs the feed-forward process. + * Args: + * mod - the pointer of model data struct object. + * frames - the number of frames to be processed. + * in - the pointer of input stream buffer object. Inner model should set + * "consumed" to the number of conusmed frames. + * out - the pointer of output stream buffer object. Inner model should set + * "produced" to the number of produced frames. + * Returns: + * 0 or negative error code. + */ + int (*ff_proc)(struct smart_amp_mod_data_base *mod, + uint32_t frames, + struct smart_amp_mod_stream *in, + struct smart_amp_mod_stream *out); + + /** + * Runs the feedback process. + * Args: + * mod - the pointer of model data struct object. + * frames - the number of frames to be processed. + * in - the pointer of input stream buffer object. Inner model should set + * "consumed" to the number of conusmed frames. + * Returns: + * 0 or negative error code. + */ + int (*fb_proc)(struct smart_amp_mod_data_base *mod, + uint32_t frames, + struct smart_amp_mod_stream *in); + + /** + * Gets config data from model. + * Args: + * mod - the pointer of model data struct object. + * cdata - the pointer of sof_ipc_ctrl_data object. + * size - the maximal size for config data to read. + * Returns: + * 0 or negative error code. + */ + int (*get_config)(struct smart_amp_mod_data_base *mod, + struct sof_ipc_ctrl_data *cdata, uint32_t size); + + /** + * Sets config data to model. + * Args: + * mod - the pointer of model data struct object. + * cdata - the pointer of sof_ipc_ctrl_data object. + * Returns: + * 0 or negative error code. + */ + int (*set_config)(struct smart_amp_mod_data_base *mod, + struct sof_ipc_ctrl_data *cdata); + + /** + * Resets model. + * It will be called on comp_ops.reset() by generic layer. + * Args: + * mod - the pointer of model data struct object. + * Returns: + * 0 or negative error code. + */ + int (*reset)(struct smart_amp_mod_data_base *mod); }; -/* Component initialization */ -int smart_amp_init(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev); -/* Component memory flush */ -int smart_amp_flush(struct smart_amp_mod_struct_t *hspk, struct comp_dev *dev); -/* Feed forward processing function */ -int smart_amp_ff_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream *source, - const struct audio_stream *sink, int8_t *chan_map, - struct smart_amp_mod_struct_t *hspk, - uint32_t num_ch_in, uint32_t num_ch_out); -/* Feedback processing function */ -int smart_amp_fb_copy(struct comp_dev *dev, uint32_t frames, - const struct audio_stream *source, - const struct audio_stream *sink, int8_t *chan_map, - struct smart_amp_mod_struct_t *hspk, - uint32_t num_ch); -/* memory usage calculation for the component */ -int smart_amp_get_memory_size(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev); -/* supported audio format check */ -int smart_amp_check_audio_fmt(int sample_rate, int ch_num); - -/* this function return number of parameters supported */ -int smart_amp_get_num_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev); -/* this function update whole parameter table */ -int smart_amp_get_all_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev); -/* parameter read function */ -int maxim_dsm_get_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev, - struct sof_ipc_ctrl_data *cdata, int size); -/* parameter write function */ -int maxim_dsm_set_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev, - struct sof_ipc_ctrl_data *cdata); -/* parameter restoration */ -int maxim_dsm_restore_param(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev); -/* parameter forced read, ignore cache */ -int maxim_dsm_get_param_forced(struct smart_amp_mod_struct_t *hspk, - struct comp_dev *dev); #endif From dfb30f3b73f96844ec156120ce6355d605a36514 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Date: Tue, 26 Sep 2023 15:42:59 +0300 Subject: [PATCH 450/639] tools/probe: Fix WAV header creation for extracted audio streams The finalize_wave_files() should be called to update the WAV header to be valid. This should be only done when demuxing to files. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> --- tools/probes/probes_demux.c | 3 ++- tools/probes/probes_demux.h | 2 ++ tools/probes/probes_main.c | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/probes/probes_demux.c b/tools/probes/probes_demux.c index 3db021e8a6e3..a411eef117b9 100644 --- a/tools/probes/probes_demux.c +++ b/tools/probes/probes_demux.c @@ -139,8 +139,9 @@ int init_wave(struct dma_frame_parser *p, uint32_t buffer_id, uint32_t format) return i; } -void finalize_wave_files(struct wave_files *files) +void finalize_wave_files(struct dma_frame_parser *p) { + struct wave_files *files = p->files; uint32_t i, chunk_size; /* fill the header at the beginning of each file */ diff --git a/tools/probes/probes_demux.h b/tools/probes/probes_demux.h index a656d4c7af47..93aa89119a5e 100644 --- a/tools/probes/probes_demux.h +++ b/tools/probes/probes_demux.h @@ -24,4 +24,6 @@ void parser_fetch_free_buffer(struct dma_frame_parser *p, uint8_t **d, size_t *l int parser_parse_data(struct dma_frame_parser *p, size_t d_len); +void finalize_wave_files(struct dma_frame_parser *p); + #endif diff --git a/tools/probes/probes_main.c b/tools/probes/probes_main.c index 7b553709a446..cdba2c6347d5 100644 --- a/tools/probes/probes_main.c +++ b/tools/probes/probes_main.c @@ -66,6 +66,10 @@ void parse_data(const char *file_in, bool log_to_stdout) len = fread(data, 1, len, fd_in); ret = parser_parse_data(p, len); } while (!ret && !feof(fd_in)); + + if (!log_to_stdout) + finalize_wave_files(p); + } int main(int argc, char *argv[]) From 659088e7209d70593904ec4bbb6d1dda27afa1b2 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:45:40 +0200 Subject: [PATCH 451/639] drc: remove buffer_acquire from drc remove buffer ops from drc module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/drc/drc.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/audio/drc/drc.c b/src/audio/drc/drc.c index b0326bf31e42..c69b3a742ea6 100644 --- a/src/audio/drc/drc.c +++ b/src/audio/drc/drc.c @@ -272,7 +272,6 @@ static int drc_process(struct processing_module *mod, static void drc_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; - struct comp_buffer *sink_c, *source_c; struct comp_buffer *sinkb, *sourceb; struct comp_dev *dev = mod->dev; @@ -282,14 +281,10 @@ static void drc_params(struct processing_module *mod) component_set_nearest_period_frames(dev, params->rate); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sinkb); - ipc4_update_buffer_format(sink_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(sink_c); + ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - ipc4_update_buffer_format(source_c, &mod->priv.cfg.base_cfg.audio_fmt); - buffer_release(source_c); + ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); } #endif /* CONFIG_IPC_MAJOR_4 */ @@ -299,7 +294,6 @@ static int drc_prepare(struct processing_module *mod, { struct drc_comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; int channels; int rate; @@ -314,16 +308,12 @@ static int drc_prepare(struct processing_module *mod, /* DRC component will only ever have 1 source and 1 sink buffer */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - drc_set_alignment(&source_c->stream, &sink_c->stream); + drc_set_alignment(&sourceb->stream, &sinkb->stream); /* get source data format */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); - channels = audio_stream_get_channels(&sink_c->stream); - rate = audio_stream_get_rate(&sink_c->stream); - buffer_release(sink_c); - buffer_release(source_c); + cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream); + channels = audio_stream_get_channels(&sinkb->stream); + rate = audio_stream_get_rate(&sinkb->stream); /* Initialize DRC */ comp_info(dev, "drc_prepare(), source_format=%d", cd->source_format); From 23086814ac44b2ed65a7b41ae4c0de7182af5913 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:56:20 +0200 Subject: [PATCH 452/639] google_hotword_detect: remove buffer_acquire from google_hotword_detect remove buffer ops from google_hotword_detect module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/google/google_hotword_detect.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/audio/google/google_hotword_detect.c b/src/audio/google/google_hotword_detect.c index 766a26b0616e..cf2c4ea3f00c 100644 --- a/src/audio/google/google_hotword_detect.c +++ b/src/audio/google/google_hotword_detect.c @@ -159,7 +159,6 @@ static int ghd_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct comp_buffer *sourceb; - struct comp_buffer *source_c; int ret; /* Detector is used only in KPB topology. It always requires channels @@ -176,21 +175,18 @@ static int ghd_params(struct comp_dev *dev, /* This detector component will only ever have 1 source */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - if (audio_stream_get_channels(source_c->stream) != 1) { + if (audio_stream_get_channels(sourceb->stream) != 1) { comp_err(dev, "ghd_params(): Only single-channel supported"); ret = -EINVAL; - } else if (audio_stream_get_frm_fmt(&source_c->stream) != SOF_IPC_FRAME_S16_LE) { + } else if (audio_stream_get_frm_fmt(&sourceb->stream) != SOF_IPC_FRAME_S16_LE) { comp_err(dev, "ghd_params(): Only S16_LE supported"); ret = -EINVAL; - } else if (source_c->stream.rate != KPB_SAMPLNG_FREQUENCY) { + } else if (sourceb->stream.rate != KPB_SAMPLNG_FREQUENCY) { comp_err(dev, "ghd_params(): Only 16KHz supported"); ret = -EINVAL; } - buffer_release(source_c); - return ret; } @@ -383,7 +379,6 @@ static int ghd_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *source; - struct comp_buffer *source_c; struct audio_stream *stream; uint32_t bytes, tail_bytes, head_bytes = 0; int ret; @@ -399,8 +394,7 @@ static int ghd_copy(struct comp_dev *dev) /* keyword components will only ever have 1 source */ source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - stream = &source_c->stream; + stream = &sourceb->stream; bytes = audio_stream_get_avail_bytes(stream); @@ -411,7 +405,7 @@ static int ghd_copy(struct comp_dev *dev) (uint32_t)audio_stream_get_end_addr(stream)); /* copy and perform detection */ - buffer_stream_invalidate(source_c, bytes); + buffer_stream_invalidate(sourceb, bytes); tail_bytes = (char *)audio_stream_get_end_addr(stream) - (char *)audio_stream_get_rptr(stream); @@ -426,9 +420,7 @@ static int ghd_copy(struct comp_dev *dev) ghd_detect(dev, stream, audio_stream_get_addr(stream), head_bytes); /* calc new available */ - comp_update_buffer_consume(source_c, bytes); - - buffer_release(source_c); + comp_update_buffer_consume(sourceb, bytes); return 0; } From 7112246d4fef43e3a5caffbbd0c1d58f14c02303 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:57:56 +0200 Subject: [PATCH 453/639] google_rtc_audio_processing: remove buffer_acquire remove buffer ops from google_rtc_audio_processing module this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- .../google/google_rtc_audio_processing.c | 78 +++++++------------ 1 file changed, 30 insertions(+), 48 deletions(-) diff --git a/src/audio/google/google_rtc_audio_processing.c b/src/audio/google/google_rtc_audio_processing.c index 3a5bbe3dfa65..87d270e71e11 100644 --- a/src/audio/google/google_rtc_audio_processing.c +++ b/src/audio/google/google_rtc_audio_processing.c @@ -89,7 +89,6 @@ static int google_rtc_audio_processing_params( int ret; #if CONFIG_IPC_MAJOR_4 struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer *sink_c; struct comp_buffer *sink; /* update sink buffer format */ @@ -108,9 +107,7 @@ static int google_rtc_audio_processing_params( enum sof_ipc_frame valid_fmt, frame_fmt; sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - ipc4_update_buffer_format(sink_c, out_fmt); - buffer_release(sink_c); + ipc4_update_buffer_format(sink, out_fmt); } #endif @@ -502,7 +499,6 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) { struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); struct list_item *source_buffer_list_item; - struct comp_buffer *output_c; unsigned int aec_channels = 0, frame_fmt, rate; int ret; @@ -512,19 +508,17 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) list_for_item(source_buffer_list_item, &dev->bsource_list) { struct comp_buffer *source = container_of(source_buffer_list_item, struct comp_buffer, sink_list); - struct comp_buffer *source_c = buffer_acquire(source); #if CONFIG_IPC_MAJOR_4 - if (IPC4_SINK_QUEUE_ID(source_c->id) == SOF_AEC_FEEDBACK_QUEUE_ID) { + if (IPC4_SINK_QUEUE_ID(source->id) == SOF_AEC_FEEDBACK_QUEUE_ID) { #else - if (source_c->source->pipeline->pipeline_id != dev->pipeline->pipeline_id) { + if (source->source->pipeline->pipeline_id != dev->pipeline->pipeline_id) { #endif cd->aec_reference = source; - aec_channels = audio_stream_get_channels(&source_c->stream); + aec_channels = audio_stream_get_channels(&source->stream); } else { cd->raw_microphone = source; } - buffer_release(source_c); } cd->output = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); @@ -539,11 +533,8 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) return -EINVAL; } - output_c = buffer_acquire(cd->output); - frame_fmt = audio_stream_get_frm_fmt(&output_c->stream); - rate = audio_stream_get_rate(&output_c->stream); - buffer_release(output_c); - + frame_fmt = audio_stream_get_frm_fmt(&cd->output->stream); + rate = audio_stream_get_rate(&cd->output->stream); if (cd->num_capture_channels > audio_stream_get_channels(&cd->raw_microphone->stream)) { comp_err(dev, "unsupported number of microphone channels: %d", @@ -592,8 +583,8 @@ static int google_rtc_audio_processing_reset(struct comp_dev *dev) static int google_rtc_audio_processing_copy(struct comp_dev *dev) { struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer *buffer_c, *mic_buf, *output_buf; struct comp_copy_limits cl; + struct comp_buffer *buffer; int16_t *src, *dst, *ref; uint32_t num_aec_reference_frames; uint32_t num_aec_reference_bytes; @@ -609,27 +600,26 @@ static int google_rtc_audio_processing_copy(struct comp_dev *dev) if (ret) return ret; } + buffer = cd->aec_reference; - buffer_c = buffer_acquire(cd->aec_reference); - - ref = audio_stream_get_rptr(&buffer_c->stream); + ref = audio_stream_get_rptr(&buffer->stream); - num_aec_reference_frames = audio_stream_get_avail_frames(&buffer_c->stream); - num_aec_reference_bytes = audio_stream_get_avail_bytes(&buffer_c->stream); + num_aec_reference_frames = audio_stream_get_avail_frames(&buffer->stream); + num_aec_reference_bytes = audio_stream_get_avail_bytes(&buffer->stream); - buffer_stream_invalidate(buffer_c, num_aec_reference_bytes); + buffer_stream_invalidate(buffer, num_aec_reference_bytes); num_samples_remaining = num_aec_reference_frames * - audio_stream_get_channels(&buffer_c->stream); + audio_stream_get_channels(&buffer->stream); while (num_samples_remaining) { - nmax = audio_stream_samples_without_wrap_s16(&buffer_c->stream, ref); + nmax = audio_stream_samples_without_wrap_s16(&buffer->stream, ref); n = MIN(num_samples_remaining, nmax); for (i = 0; i < n; i += cd->num_aec_reference_channels) { j = cd->num_aec_reference_channels * cd->aec_reference_frame_index; for (channel = 0; channel < cd->num_aec_reference_channels; ++channel) cd->aec_reference_buffer[j++] = ref[channel]; - ref += audio_stream_get_channels(&buffer_c->stream); + ref += audio_stream_get_channels(&buffer->stream); ++cd->aec_reference_frame_index; if (cd->aec_reference_frame_index == cd->num_frames) { @@ -639,26 +629,21 @@ static int google_rtc_audio_processing_copy(struct comp_dev *dev) } } num_samples_remaining -= n; - ref = audio_stream_wrap(&buffer_c->stream, ref); + ref = audio_stream_wrap(&buffer->stream, ref); } - comp_update_buffer_consume(buffer_c, num_aec_reference_bytes); - - buffer_release(buffer_c); + comp_update_buffer_consume(buffer, num_aec_reference_bytes); - mic_buf = buffer_acquire(cd->raw_microphone); - output_buf = buffer_acquire(cd->output); + src = audio_stream_get_rptr(&cd->raw_microphone->stream); + dst = audio_stream_get_wptr(&cd->output->stream); - src = audio_stream_get_rptr(&mic_buf->stream); - dst = audio_stream_get_wptr(&output_buf->stream); - - comp_get_copy_limits(mic_buf, output_buf, &cl); - buffer_stream_invalidate(mic_buf, cl.source_bytes); + comp_get_copy_limits(cd->raw_microphone, cd->output, &cl); + buffer_stream_invalidate(cd->raw_microphone, cl.source_bytes); num_frames_remaining = cl.frames; while (num_frames_remaining) { - nmax = audio_stream_frames_without_wrap(&mic_buf->stream, src); + nmax = audio_stream_frames_without_wrap(&cd->raw_microphone->stream, src); n = MIN(num_frames_remaining, nmax); - nmax = audio_stream_frames_without_wrap(&output_buf->stream, dst); + nmax = audio_stream_frames_without_wrap(&cd->output->stream, dst); n = MIN(n, nmax); for (i = 0; i < n; i++) { memcpy_s(&(cd->raw_mic_buffer[cd->raw_mic_buffer_frame_index * @@ -684,21 +669,18 @@ static int google_rtc_audio_processing_copy(struct comp_dev *dev) cd->raw_mic_buffer_frame_index = 0; } - src += audio_stream_get_channels(&mic_buf->stream); - dst += audio_stream_get_channels(&output_buf->stream); + src += audio_stream_get_channels(&cd->raw_microphone->stream); + dst += audio_stream_get_channels(&cd->output->stream); } num_frames_remaining -= n; - src = audio_stream_wrap(&mic_buf->stream, src); - dst = audio_stream_wrap(&output_buf->stream, dst); + src = audio_stream_wrap(&cd->raw_microphone->stream, src); + dst = audio_stream_wrap(&cd->output->stream, dst); } - buffer_stream_writeback(output_buf, cl.sink_bytes); - - comp_update_buffer_produce(output_buf, cl.sink_bytes); - comp_update_buffer_consume(mic_buf, cl.source_bytes); + buffer_stream_writeback(cd->output, cl.sink_bytes); - buffer_release(output_buf); - buffer_release(mic_buf); + comp_update_buffer_produce(cd->output, cl.sink_bytes); + comp_update_buffer_consume(cd->raw_microphone, cl.source_bytes); return 0; } From bdc83167689228ad7741840468fc34a37a48f030 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:06:12 +0200 Subject: [PATCH 454/639] cadence: remove buffer_acquire from cadence.c remove buffer ops from cadence.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/module_adapter/module/cadence.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/audio/module_adapter/module/cadence.c b/src/audio/module_adapter/module/cadence.c index 0de9d8040ae1..14a849cebe85 100644 --- a/src/audio/module_adapter/module/cadence.c +++ b/src/audio/module_adapter/module/cadence.c @@ -716,7 +716,6 @@ cadence_codec_process(struct processing_module *mod, struct output_stream_buffer *output_buffers, int num_output_buffers) { struct comp_buffer *local_buff; - struct comp_buffer *buffer_c; struct comp_dev *dev = mod->dev; struct module_data *codec = &mod->priv; struct cadence_codec_data *cd = codec->private; @@ -747,9 +746,7 @@ cadence_codec_process(struct processing_module *mod, /* do not proceed with processing if not enough free space left in the local buffer */ local_buff = list_first_item(&mod->sink_buffer_list, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(local_buff); - free_bytes = audio_stream_get_free(&buffer_c->stream); - buffer_release(buffer_c); + free_bytes = audio_stream_get_free(&local_buff->stream); if (free_bytes < output_bytes) return -ENOSPC; From 252381238b559793049ea9375e5887c732fa1125 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:06:30 +0200 Subject: [PATCH 455/639] dts: remove buffer_acquire from dts.c remove buffer ops from dts.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/module_adapter/module/dts/dts.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/audio/module_adapter/module/dts/dts.c b/src/audio/module_adapter/module/dts/dts.c index ac4ee9034683..01eb8063e70d 100644 --- a/src/audio/module_adapter/module/dts/dts.c +++ b/src/audio/module_adapter/module/dts/dts.c @@ -78,7 +78,6 @@ static int dts_effect_populate_buffer_configuration(struct comp_dev *dev, { struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - struct comp_buffer *source_c; const struct audio_stream *stream; DtsSofInterfaceBufferLayout buffer_layout; DtsSofInterfaceBufferFormat buffer_format; @@ -89,16 +88,12 @@ static int dts_effect_populate_buffer_configuration(struct comp_dev *dev, if (!source) return -EINVAL; - source_c = buffer_acquire(source); - - stream = &source_c->stream; + stream = &source->stream; buffer_fmt = audio_stream_get_buffer_fmt(stream); frame_fmt = audio_stream_get_frm_fmt(stream); rate = audio_stream_get_rate(stream); channels = audio_stream_get_channels(stream); - buffer_release(source_c); - switch (buffer_fmt) { case SOF_IPC_BUFFER_INTERLEAVED: buffer_layout = DTS_SOF_INTERFACE_BUFFER_LAYOUT_INTERLEAVED; From e848406ec7c03d03feec46dfaeb3192f603cb785 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:06:45 +0200 Subject: [PATCH 456/639] waves: remove buffer_acquire from waves.c remove buffer ops from waves.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/module_adapter/module/waves/waves.c | 60 ++++++------------- 1 file changed, 17 insertions(+), 43 deletions(-) diff --git a/src/audio/module_adapter/module/waves/waves.c b/src/audio/module_adapter/module/waves/waves.c index e32f8d5c95f5..ab178b022eb9 100644 --- a/src/audio/module_adapter/module/waves/waves.c +++ b/src/audio/module_adapter/module/waves/waves.c @@ -220,11 +220,8 @@ static int waves_effect_check(struct comp_dev *dev) source_list); struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - struct comp_buffer *source_c = buffer_acquire(source); - struct comp_buffer *sink_c = buffer_acquire(sink); - const struct audio_stream *src_fmt = &source_c->stream; - const struct audio_stream *snk_fmt = &sink_c->stream; - int ret = 0; + const struct audio_stream *src_fmt = &source->stream; + const struct audio_stream *snk_fmt = &sink->stream; /* Init sink & source buffers */ comp_dbg(dev, "waves_effect_check() start"); @@ -235,66 +232,53 @@ static int waves_effect_check(struct comp_dev *dev) if (audio_stream_get_rate(src_fmt) != audio_stream_get_rate(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d rate mismatch", audio_stream_get_rate(src_fmt), audio_stream_get_rate(snk_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } /* upmix/downmix not supported */ if (audio_stream_get_channels(src_fmt) != audio_stream_get_channels(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d channels mismatch", audio_stream_get_channels(src_fmt), audio_stream_get_channels(snk_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } /* different frame format not supported */ if (audio_stream_get_frm_fmt(src_fmt) != audio_stream_get_frm_fmt(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d sample format mismatch", audio_stream_get_frm_fmt(src_fmt), audio_stream_get_frm_fmt(snk_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } /* different interleaving is not supported */ if (audio_stream_get_buffer_fmt(src_fmt) != audio_stream_get_buffer_fmt(snk_fmt)) { comp_err(dev, "waves_effect_check() source %d sink %d buffer format mismatch"); - ret = -EINVAL; - goto out; + return -EINVAL; } if (!format_is_supported(audio_stream_get_frm_fmt(src_fmt))) { comp_err(dev, "waves_effect_check() float samples not supported"); - ret = -EINVAL; - goto out; + return -EINVAL; } if (!layout_is_supported(audio_stream_get_buffer_fmt(src_fmt))) { comp_err(dev, "waves_effect_check() non interleaved format not supported"); - ret = -EINVAL; - goto out; + return -EINVAL; } if (!rate_is_supported(audio_stream_get_rate(src_fmt))) { comp_err(dev, "waves_effect_check() rate %d not supported", audio_stream_get_rate(src_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } if (audio_stream_get_channels(src_fmt) != 2) { comp_err(dev, "waves_effect_check() channels %d not supported", audio_stream_get_channels(src_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } comp_dbg(dev, "waves_effect_check() done"); - -out: - buffer_release(sink_c); - buffer_release(source_c); - - return ret; + return 0; } /* initializes MaxxEffect based on stream parameters */ @@ -303,17 +287,15 @@ static int waves_effect_init(struct processing_module *mod) struct comp_dev *dev = mod->dev; struct comp_buffer *source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - struct comp_buffer *source_c = buffer_acquire(source); struct module_data *codec = &mod->priv; struct waves_codec_data *waves_codec = codec->private; - const struct audio_stream *src_fmt = &source_c->stream; + const struct audio_stream *src_fmt = &source->stream; MaxxStatus_t status; MaxxBuffer_Format_t sample_format; MaxxBuffer_Layout_t buffer_format; int32_t sample_bytes; MaxxStreamFormat_t *i_formats[NUM_IO_STREAMS] = { &waves_codec->i_format }; MaxxStreamFormat_t *o_formats[NUM_IO_STREAMS] = { &waves_codec->o_format }; - int ret = 0; comp_dbg(dev, "waves_effect_init() start"); @@ -321,24 +303,21 @@ static int waves_effect_init(struct processing_module *mod) if (sample_format < 0) { comp_err(dev, "waves_effect_init() sof sample format %d not supported", audio_stream_get_frm_fmt(src_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } buffer_format = layout_convert_sof_to_me(audio_stream_get_buffer_fmt(src_fmt)); if (buffer_format < 0) { comp_err(dev, "waves_effect_init() sof buffer format %d not supported", audio_stream_get_buffer_fmt(src_fmt)); - ret = -EINVAL; - goto out; + return -EINVAL; } sample_bytes = sample_format_convert_to_bytes(sample_format); if (sample_bytes < 0) { comp_err(dev, "waves_effect_init() sample_format %d not supported", sample_format); - ret = -EINVAL; - goto out; + return -EINVAL; } waves_codec->request_max_bytes = 0; @@ -373,16 +352,11 @@ static int waves_effect_init(struct processing_module *mod) if (status) { comp_err(dev, "waves_effect_init() MaxxEffect_Initialize returned %d", status); - ret = -EINVAL; - goto out; + return -EINVAL; } comp_dbg(dev, "waves_effect_init() done"); - -out: - buffer_release(source_c); - - return ret; + return 0; } /* allocate additional buffers for MaxxEffect */ From 29b2f0eeccd9535e1cbc3d0da151dc281485de10 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:11:48 +0200 Subject: [PATCH 457/639] probe: remove buffer_acquire from probe.c remove buffer ops from probe.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/probe/probe.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/probe/probe.c b/src/probe/probe.c index af37401529a4..933cea584f6d 100644 --- a/src/probe/probe.c +++ b/src/probe/probe.c @@ -1066,7 +1066,6 @@ static bool probe_purpose_needs_ext_dma(uint32_t purpose) static struct comp_buffer *ipc4_get_buffer(struct ipc_comp_dev *dev, probe_point_id_t probe_point) { struct comp_buffer *buf; - struct comp_buffer *buf_c; struct list_item *sink_list, *source_list; unsigned int queue_id; @@ -1074,9 +1073,7 @@ static struct comp_buffer *ipc4_get_buffer(struct ipc_comp_dev *dev, probe_point case PROBE_TYPE_INPUT: list_for_item(source_list, &dev->cd->bsource_list) { buf = container_of(source_list, struct comp_buffer, sink_list); - buf_c = buffer_acquire(buf); - queue_id = IPC4_SRC_QUEUE_ID(buf_c->id); - buffer_release(buf_c); + queue_id = IPC4_SRC_QUEUE_ID(buf->id); if (queue_id == probe_point.fields.index) return buf; @@ -1085,9 +1082,7 @@ static struct comp_buffer *ipc4_get_buffer(struct ipc_comp_dev *dev, probe_point case PROBE_TYPE_OUTPUT: list_for_item(sink_list, &dev->cd->bsink_list) { buf = container_of(sink_list, struct comp_buffer, source_list); - buf_c = buffer_acquire(buf); - queue_id = IPC4_SINK_QUEUE_ID(buf_c->id); - buffer_release(buf_c); + queue_id = IPC4_SINK_QUEUE_ID(buf->id); if (queue_id == probe_point.fields.index) return buf; From 64af017dff3b6646f87387c76f9e94ecb9a06392 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:08:35 +0200 Subject: [PATCH 458/639] selector: remove buffer_acquire from selector.c remove buffer ops from selector.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/selector/selector.c | 123 ++++++++++------------------------ 1 file changed, 37 insertions(+), 86 deletions(-) diff --git a/src/audio/selector/selector.c b/src/audio/selector/selector.c index 19adb3c29402..97126168ac77 100644 --- a/src/audio/selector/selector.c +++ b/src/audio/selector/selector.c @@ -60,7 +60,6 @@ static int selector_verify_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *buffer, *sinkb; - struct comp_buffer *buffer_c, *sink_c; uint32_t in_channels; uint32_t out_channels; @@ -86,15 +85,13 @@ static int selector_verify_params(struct comp_dev *dev, } in_channels = cd->config.in_channels_count; - buffer_c = buffer_acquire(buffer); - /* if cd->config.out_channels_count are equal to 0 * (it can vary), we set params->channels to sink buffer * channels, which were previously set in * pipeline_comp_hw_params() */ out_channels = cd->config.out_channels_count ? - cd->config.out_channels_count : audio_stream_get_channels(&buffer_c->stream); + cd->config.out_channels_count : audio_stream_get_channels(&buffer->stream); params->channels = out_channels; } else { /* fetch source buffer for capture */ @@ -107,27 +104,21 @@ static int selector_verify_params(struct comp_dev *dev, } out_channels = cd->config.out_channels_count; - buffer_c = buffer_acquire(buffer); - /* if cd->config.in_channels_count are equal to 0 * (it can vary), we set params->channels to source buffer * channels, which were previously set in * pipeline_comp_hw_params() */ in_channels = cd->config.in_channels_count ? - cd->config.in_channels_count : audio_stream_get_channels(&buffer_c->stream); + cd->config.in_channels_count : audio_stream_get_channels(&buffer->stream); params->channels = in_channels; } /* Set buffer params */ - buffer_set_params(buffer_c, params, BUFFER_UPDATE_FORCE); - - buffer_release(buffer_c); + buffer_set_params(buffer, params, BUFFER_UPDATE_FORCE); /* set component period frames */ - sink_c = buffer_acquire(sinkb); - component_set_nearest_period_frames(dev, audio_stream_get_rate(&sink_c->stream)); - buffer_release(sink_c); + component_set_nearest_period_frames(dev, audio_stream_get_rate(&sinkb->stream)); /* verify input channels */ switch (in_channels) { @@ -358,7 +349,6 @@ static int selector_cmd(struct comp_dev *dev, int cmd, void *data, static int selector_trigger(struct comp_dev *dev, int cmd) { struct comp_buffer *sourceb; - struct comp_buffer *source_c; enum sof_comp_type type; int ret; @@ -367,17 +357,13 @@ static int selector_trigger(struct comp_dev *dev, int cmd) sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - ret = comp_set_state(dev, cmd); /* TODO: remove in the future after adding support for case when * kpb_init_draining() and kpb_draining_task() are interrupted by * new pipeline_task() */ - type = dev_comp_type(source_c->source); - - buffer_release(source_c); + type = dev_comp_type(sourceb->source); return type == SOF_COMP_KPB ? PPL_STATUS_PATH_TERMINATE : ret; } @@ -391,7 +377,6 @@ static int selector_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sink, *source; - struct comp_buffer *sink_c, *source_c; uint32_t frames; uint32_t source_bytes; uint32_t sink_bytes; @@ -404,33 +389,24 @@ static int selector_copy(struct comp_dev *dev) sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(source); - - if (!audio_stream_get_avail(&source_c->stream)) { - buffer_release(source_c); + if (!audio_stream_get_avail(&source->stream)) return PPL_STATUS_PATH_STOP; - } - sink_c = buffer_acquire(sink); - - frames = audio_stream_avail_frames(&source_c->stream, &sink_c->stream); - source_bytes = frames * audio_stream_frame_bytes(&source_c->stream); - sink_bytes = frames * audio_stream_frame_bytes(&sink_c->stream); + frames = audio_stream_avail_frames(&source->stream, &sink->stream); + source_bytes = frames * audio_stream_frame_bytes(&source->stream); + sink_bytes = frames * audio_stream_frame_bytes(&sink->stream); comp_dbg(dev, "selector_copy(), source_bytes = 0x%x, sink_bytes = 0x%x", source_bytes, sink_bytes); /* copy selected channels from in to out */ - buffer_stream_invalidate(source_c, source_bytes); - cd->sel_func(dev, &sink_c->stream, &source_c->stream, frames); - buffer_stream_writeback(sink_c, sink_bytes); + buffer_stream_invalidate(source, source_bytes); + cd->sel_func(dev, &sink->stream, &source->stream, frames); + buffer_stream_writeback(sink, sink_bytes); /* calculate new free and available */ - comp_update_buffer_produce(sink_c, sink_bytes); - comp_update_buffer_consume(source_c, source_bytes); - - buffer_release(sink_c); - buffer_release(source_c); + comp_update_buffer_produce(sink, sink_bytes); + comp_update_buffer_consume(source, source_bytes); return 0; } @@ -444,7 +420,6 @@ static int selector_prepare(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sinkb, *sourceb; - struct comp_buffer *sink_c, *source_c; size_t sink_size; int ret; @@ -463,30 +438,24 @@ static int selector_prepare(struct comp_dev *dev) sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - /* get source data format and period bytes */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); - cd->source_period_bytes = audio_stream_period_bytes(&source_c->stream, dev->frames); + cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream); + cd->source_period_bytes = audio_stream_period_bytes(&sourceb->stream, dev->frames); /* get sink data format and period bytes */ - cd->sink_format = audio_stream_get_frm_fmt(&sink_c->stream); - cd->sink_period_bytes = audio_stream_period_bytes(&sink_c->stream, dev->frames); + cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream); + cd->sink_period_bytes = audio_stream_period_bytes(&sinkb->stream, dev->frames); /* There is an assumption that sink component will report out * proper number of channels [1] for selector to actually * reduce channel count between source and sink */ comp_dbg(dev, "selector_prepare(): sourceb->schannels = %u", - audio_stream_get_channels(&source_c->stream)); + audio_stream_get_channels(&sourceb->stream)); comp_dbg(dev, "selector_prepare(): sinkb->channels = %u", - audio_stream_get_channels(&sink_c->stream)); - - sink_size = audio_stream_get_size(&sink_c->stream); + audio_stream_get_channels(&sinkb->stream)); - buffer_release(sink_c); - buffer_release(source_c); + sink_size = audio_stream_get_size(&sinkb->stream); if (sink_size < cd->sink_period_bytes) { comp_err(dev, "selector_prepare(): sink buffer size %d is insufficient < %d", @@ -673,7 +642,6 @@ static void set_selector_params(struct processing_module *mod, { struct comp_dev *dev = mod->dev; struct comp_data *cd = module_get_private_data(mod); - struct comp_buffer *source; const struct sof_selector_ipc4_config *sel_cfg = &cd->sel_ipc4_cfg; const struct ipc4_audio_format *out_fmt = NULL; struct comp_buffer *src_buf; @@ -700,12 +668,10 @@ static void set_selector_params(struct processing_module *mod, list_for_item(sink_list, &dev->bsink_list) { struct comp_buffer *sink_buf = container_of(sink_list, struct comp_buffer, source_list); - struct comp_buffer *sink = buffer_acquire(sink_buf); - ipc4_update_buffer_format(sink, out_fmt); - audio_stream_set_channels(&sink->stream, params->channels); - audio_stream_set_rate(&sink->stream, params->rate); - buffer_release(sink); + ipc4_update_buffer_format(sink_buf, out_fmt); + audio_stream_set_channels(&sink_buf->stream, params->channels); + audio_stream_set_rate(&sink_buf->stream, params->rate); } /* update the source format @@ -715,12 +681,9 @@ static void set_selector_params(struct processing_module *mod, * and the first one is not ready yet along with sink buffers params */ src_buf = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source = buffer_acquire(src_buf); - if (!source->hw_params_configured) - ipc4_update_buffer_format(source, &mod->priv.cfg.base_cfg.audio_fmt); - - buffer_release(source); + if (!src_buf->hw_params_configured) + ipc4_update_buffer_format(src_buf, &mod->priv.cfg.base_cfg.audio_fmt); } static int selector_verify_params(struct processing_module *mod, @@ -729,7 +692,6 @@ static int selector_verify_params(struct processing_module *mod, struct comp_dev *dev = mod->dev; struct comp_data *cd = module_get_private_data(mod); struct comp_buffer *buffer; - struct comp_buffer *buffer_c; uint32_t in_channels = cd->config.in_channels_count; uint32_t out_channels = cd->config.out_channels_count; @@ -755,15 +717,11 @@ static int selector_verify_params(struct processing_module *mod, params->channels = in_channels; buffer = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); } - buffer_c = buffer_acquire(buffer); - buffer_set_params(buffer_c, params, BUFFER_UPDATE_FORCE); - buffer_release(buffer_c); + buffer_set_params(buffer, params, BUFFER_UPDATE_FORCE); /* set component period frames */ buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - buffer_c = buffer_acquire(buffer); - component_set_nearest_period_frames(dev, audio_stream_get_rate(&buffer_c->stream)); - buffer_release(buffer_c); + component_set_nearest_period_frames(dev, audio_stream_get_rate(&buffer->stream)); return 0; } @@ -869,7 +827,6 @@ static int selector_prepare(struct processing_module *mod, struct module_data *md = &mod->priv; struct comp_dev *dev = mod->dev; struct comp_buffer *sinkb, *sourceb; - struct comp_buffer *sink_c, *source_c; size_t sink_size; int ret; @@ -886,36 +843,30 @@ static int selector_prepare(struct processing_module *mod, sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - - audio_stream_init_alignment_constants(4, 1, &source_c->stream); - audio_stream_init_alignment_constants(4, 1, &sink_c->stream); + audio_stream_init_alignment_constants(4, 1, &sourceb->stream); + audio_stream_init_alignment_constants(4, 1, &sinkb->stream); /* get source data format and period bytes */ - cd->source_format = audio_stream_get_frm_fmt(&source_c->stream); - cd->source_period_bytes = audio_stream_period_bytes(&source_c->stream, dev->frames); + cd->source_format = audio_stream_get_frm_fmt(&sourceb->stream); + cd->source_period_bytes = audio_stream_period_bytes(&sourceb->stream, dev->frames); /* get sink data format and period bytes */ - cd->sink_format = audio_stream_get_frm_fmt(&sink_c->stream); - cd->sink_period_bytes = audio_stream_period_bytes(&sink_c->stream, dev->frames); + cd->sink_format = audio_stream_get_frm_fmt(&sinkb->stream); + cd->sink_period_bytes = audio_stream_period_bytes(&sinkb->stream, dev->frames); /* There is an assumption that sink component will report out * proper number of channels [1] for selector to actually * reduce channel count between source and sink */ comp_info(dev, "selector_prepare(): source sink channel = %u %u", - audio_stream_get_channels(&source_c->stream), - audio_stream_get_channels(&sink_c->stream)); + audio_stream_get_channels(&sourceb->stream), + audio_stream_get_channels(&sinkb->stream)); - sink_size = audio_stream_get_size(&sink_c->stream); + sink_size = audio_stream_get_size(&sinkb->stream); md->mpd.in_buff_size = cd->source_period_bytes; md->mpd.out_buff_size = cd->sink_period_bytes; - buffer_release(sink_c); - buffer_release(source_c); - if (sink_size < cd->sink_period_bytes) { comp_err(dev, "selector_prepare(): sink buffer size %d is insufficient < %d", sink_size, cd->sink_period_bytes); From 9a1d95fc94f41c7044c54cc86c2ca11544164202 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:09:33 +0200 Subject: [PATCH 459/639] tone: remove buffer_acquire from tone.c remove buffer ops from tone.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/tone.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/src/audio/tone.c b/src/audio/tone.c index 0f744cb75d4d..c669698bd13e 100644 --- a/src/audio/tone.c +++ b/src/audio/tone.c @@ -429,7 +429,6 @@ static int tone_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); @@ -444,18 +443,12 @@ static int tone_params(struct comp_dev *dev, if (dev->ipc_config.frame_fmt != SOF_IPC_FRAME_S32_LE) return -EINVAL; - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - - audio_stream_set_frm_fmt(&source_c->stream, dev->ipc_config.frame_fmt); - audio_stream_set_frm_fmt(&sink_c->stream, dev->ipc_config.frame_fmt); + audio_stream_set_frm_fmt(&sourceb->stream, dev->ipc_config.frame_fmt); + audio_stream_set_frm_fmt(&sinkb->stream, dev->ipc_config.frame_fmt); /* calculate period size based on config */ cd->period_bytes = dev->frames * - audio_stream_frame_bytes(&source_c->stream); - - buffer_release(sink_c); - buffer_release(source_c); + audio_stream_frame_bytes(&sourceb->stream); return 0; } @@ -634,7 +627,6 @@ static int tone_trigger(struct comp_dev *dev, int cmd) static int tone_copy(struct comp_dev *dev) { struct comp_buffer *sink; - struct comp_buffer *sink_c; struct comp_data *cd = comp_get_drvdata(dev); uint32_t free; int ret = 0; @@ -645,25 +637,22 @@ static int tone_copy(struct comp_dev *dev) sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - free = audio_stream_get_free_bytes(&sink_c->stream); + free = audio_stream_get_free_bytes(&sink->stream); /* Test that sink has enough free frames. Then run once to maintain * low latency and steady load for tones. */ if (free >= cd->period_bytes) { /* create tone */ - cd->tone_func(dev, &sink_c->stream, dev->frames); - buffer_stream_writeback(sink_c, cd->period_bytes); + cd->tone_func(dev, &sink->stream, dev->frames); + buffer_stream_writeback(sink, cd->period_bytes); /* calc new free and available */ - comp_update_buffer_produce(sink_c, cd->period_bytes); + comp_update_buffer_produce(sink, cd->period_bytes); ret = dev->frames; } - buffer_release(sink_c); - return ret; } From edf85fffb64766534b1993bf5e82273f762396a2 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:09:12 +0200 Subject: [PATCH 460/639] tdfb: remove buffer_acquire from tdfb.c remove buffer ops from tdfb.c this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/tdfb/tdfb.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/audio/tdfb/tdfb.c b/src/audio/tdfb/tdfb.c index 339b9da6b57c..7aaee17958d5 100644 --- a/src/audio/tdfb/tdfb.c +++ b/src/audio/tdfb/tdfb.c @@ -731,7 +731,6 @@ static int tdfb_prepare(struct processing_module *mod, { struct tdfb_comp_data *cd = module_get_private_data(mod); struct comp_buffer *sourceb, *sinkb; - struct comp_buffer *source_c, *sink_c; struct comp_dev *dev = mod->dev; enum sof_ipc_frame frame_fmt; int source_channels; @@ -744,16 +743,12 @@ static int tdfb_prepare(struct processing_module *mod, /* Find source and sink buffers */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - source_c = buffer_acquire(sourceb); - sink_c = buffer_acquire(sinkb); - tdfb_set_alignment(&source_c->stream, &sink_c->stream); - - frame_fmt = audio_stream_get_frm_fmt(&source_c->stream); - source_channels = audio_stream_get_channels(&source_c->stream); - sink_channels = audio_stream_get_channels(&sink_c->stream); - rate = audio_stream_get_rate(&source_c->stream); - buffer_release(sink_c); - buffer_release(source_c); + tdfb_set_alignment(&sourceb->stream, &sinkb->stream); + + frame_fmt = audio_stream_get_frm_fmt(&sourceb->stream); + source_channels = audio_stream_get_channels(&sourceb->stream); + sink_channels = audio_stream_get_channels(&sinkb->stream); + rate = audio_stream_get_rate(&sourceb->stream); /* Initialize filter */ cd->config = comp_get_data_blob(cd->model_handler, NULL, NULL); From ba344b520b7afb56f38dd972390acbb0dee9bb65 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Fri, 15 Sep 2023 16:12:41 +0200 Subject: [PATCH 461/639] dp: add calcultion of DP module period For LL modules it is very straightforward - all LL modules are called one by one in every LL pipeline tick, so module's period is always equal to LL pipeline period For DP modules a period has different meaning. As DP is called "on demand" - whenever it is ready, it may not be scheduled at every LL tick (and usually is not) A period meaning for DP is "a time when the module must finish its job and provide data to next module in pipeline or the data flow will be corrupted (a glitch)" In common case the period is calculation is based on module's OBS - if module provides OBS bytes of data in each cycle, it MUST finish at least before the next module drains the buffer In some special cases - modules producing a variable bitrate (like MPEG) or not producing audio data at all (phrase detector, speech recognition, etc.) - the module may set the period itself during prepare operation This commit adds calculation of DP period. This value will be used in following commit as a base for deadlines calculation in EDF Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/audio/module_adapter/module_adapter.c | 18 ++++++++++++++++++ src/audio/pipeline/pipeline-graph.c | 9 ++++++++- src/audio/src/src_ipc4.c | 14 ++++++++++++-- src/include/sof/audio/component.h | 7 ++++++- 4 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 8dd907a80d77..90c4b7547c8a 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -281,6 +281,7 @@ static int module_adapter_dp_queue_prepare(struct comp_dev *dev) i++; } mod->num_of_sources = i; + unsigned int period = UINT32_MAX; i = 0; list_init(&mod->dp_queue_dp_to_ll_list); @@ -311,10 +312,27 @@ static int module_adapter_dp_queue_prepare(struct comp_dev *dev) sizeof(dp_queue->audio_stream_params), &sink_buffer->stream.runtime_stream_params, sizeof(sink_buffer->stream.runtime_stream_params)); + /* calculate time required the module to provide OBS data portion - a period */ + unsigned int sink_period = 1000000 * sink_get_min_free_space(mod->sinks[i]) / + (sink_get_frame_bytes(mod->sinks[i]) * + sink_get_rate(mod->sinks[i])); + /* note the minimal period for the module */ + if (period > sink_period) + period = sink_period; i++; } mod->num_of_sinks = i; + /* set the period for the module unless it has already been calculated by the + * module itself during prepare + * It may happen i.e. for modules like phrase detect that do not produce audio data + * but events and therefore don't have any deadline for processing + * Second example is a module with variable data rate on output (like MPEG encoder) + */ + if (!dev->period) { + comp_info(dev, "DP Module period set to %u", period); + dev->period = period; + } return 0; diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 5f2131763dd0..8b64e5f9527f 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -260,7 +260,14 @@ static int pipeline_comp_complete(struct comp_dev *current, /* complete component init */ current->pipeline = ppl_data->p; - current->period = ppl_data->p->period; + /* LL module has its period always eq period of the pipeline + * DP period is set to 0 as sink format may not yet been set + * It will be calculated during module prepare operation + * either by the module or to default value based on module's OBS + */ + if (current->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_LL) + current->period = ppl_data->p->period; + current->priority = ppl_data->p->priority; return pipeline_for_each_comp(current, ctx, dir); diff --git a/src/audio/src/src_ipc4.c b/src/audio/src/src_ipc4.c index 8b55c10bc500..cf87bde47554 100644 --- a/src/audio/src/src_ipc4.c +++ b/src/audio/src/src_ipc4.c @@ -100,10 +100,20 @@ int src_set_params(struct processing_module *mod, struct sof_sink *sink) mod->priv.cfg.base_cfg.audio_fmt.s_type); src_params.frame_fmt = valid_fmt; - component_set_nearest_period_frames(dev, src_params.rate); - ret = sink_set_params(sink, &src_params, true); + /* if module is to be run as DP, calculate module period + * according to OBS size and data rate + * as SRC uses period value to calculate its internal buffers, + * it must be done here, right after setting sink parameters + */ + if (dev->ipc_config.proc_domain == COMP_PROCESSING_DOMAIN_DP) + dev->period = 1000000 * sink_get_min_free_space(sink) / + (sink_get_frame_bytes(sink) * sink_get_rate(sink)); + + comp_info(dev, "SRC DP period calculated as: %u", dev->period); + + component_set_nearest_period_frames(dev, src_params.rate); /* Update module stream_params */ params->rate = cd->ipc_config.sink_rate; return ret; diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 3920e9d2d8ae..4a24d08ffb28 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -581,7 +581,12 @@ struct comp_dev { * 2) for all DP tasks */ uint32_t size; /**< component's allocated size */ - uint32_t period; /**< component's processing period */ + uint32_t period; /**< component's processing period + * for LL modules is set to LL pipeline's period + * for DP module its meaning is "the time the module MUST + * provide data that allows the following module to perform + * without glitches" + */ uint32_t priority; /**< component's processing priority */ bool is_shared; /**< indicates whether component is shared * across cores From 59bc4a751b0fff6f961904c1222afab9693a2dd1 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Mon, 11 Sep 2023 11:43:38 +0200 Subject: [PATCH 462/639] DP: add calculation of EDF to DP scheduling Earliest deadline first scheduling added, based on module period Detailed description in zephyr_dp_schedule.c Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/schedule/zephyr_dp_schedule.c | 166 +++++++++++++++++++++++++++++- 1 file changed, 163 insertions(+), 3 deletions(-) diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index 3ced95814658..dae00f63239e 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -35,7 +35,7 @@ struct scheduler_dp_data { struct task_dp_pdata { k_tid_t thread_id; /* zephyr thread ID */ - uint32_t period; /* period the task should be scheduled in us */ + uint32_t period_clock_ticks; /* period the task should be scheduled in Zephyr ticks */ k_thread_stack_t __sparse_cache *p_stack; /* pointer to thread stack */ struct k_sem sem; /* semaphore for task scheduling */ struct processing_module *mod; /* the module to be scheduled */ @@ -63,6 +63,155 @@ static enum task_state scheduler_dp_ll_tick_dummy(void *data) /* * function called after every LL tick + * + * This function checks if the queued DP tasks are ready to processing (meaning + * the module run by the task has enough data at all sources and enough free space + * on all sinks) + * + * if the task becomes ready, a deadline is set allowing Zephyr to schedule threads + * in right order + * + * TODO: currently there's a limitation - DP module must be surrounded by LL modules. + * it simplifies algorithm - there's no need to browse through DP chains calculating + * deadlines for each module in function of all modules execution status. + * Now is simple - modules deadline is its start + tick time. + * + * example: + * Lets assume we do have a pipeline: + * + * LL1 -> DP1 -> LL2 -> DP2 -> LL3 -> DP3 -> LL4 + * + * all LLs starts in 1ms tick + * + * for simplification lets assume + * - all LLs are on primary core, all DPs on secondary (100% CPU is for DP) + * - context switching requires 0 cycles + * + * DP1 - starts every 1ms, needs 0.5ms to finish processing + * DP2 - starts every 2ms, needs 0.6ms to finish processing + * DP3 - starts every 10ms, needs 0.3ms to finish processing + * + * TICK0 + * only LL1 is ready to run + * LL1 processing (producing data chunk for DP1) + * + * TICK1 + * LL1 is ready to run + * DP1 is ready tu run (has data from LL1) set deadline to TICK2 + * LL1 processing (producing second data chunk for DP1) + * DP1 processing for 0.5ms (consuming first data chunk, producing data chunk for LL2) + * CPU is idle for 0.5ms + * + * TICK2 + * LL1 is ready to run + * DP1 is ready tu run set deadline to TICK3 + * LL2 is ready to run + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing 50% data chunk for DP2) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * CPU is idle for 0.5ms + * + * TICK3 + * LL1 is ready to run + * DP1 is ready tu run set deadline to TICK4 + * LL2 is ready to run + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing rest of data chunk for DP2) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * CPU is idle for 0.5ms + * + * TICK4 + * LL1 is ready to run + * DP1 is ready tu run set deadline to TICK5 + * LL2 is ready to run + * DP2 is ready to run set deadline to TICK6 + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing 50% of second data chunk for DP2) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * DP2 processing for 0.5ms (no data produced as DP2 has 0.1ms to go) + * 100% CPU used + * + * !!!!!! Note here - DP1 must do before DP2 as it MUST finish in this tick. DP2 can wait + * >>>>>>> this is what we call EDF - EARIEST DEADLINE FIRST <<<<<< + * + * TICK5 + * LL1 is ready to run + * DP1 is ready tu run set deadline to TICK6 + * LL2 is ready to run + * DP2 is in progress, deadline is set to TICK6 + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing rest of second data chunk for DP2) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * DP2 processing for 0.1ms (producing TWO data chunks for LL3) + * CPU is idle for 0.4ms (60% used) + * + * TICK6 + * LL1 is ready to run + * DP1 is ready tu run set deadline to TICK7 + * LL2 is ready to run + * DP2 is ready to run set deadline to TICK8 + * LL3 is ready to run + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing 50% of second data chunk for DP2) + * LL3 processing (producing 10% of first data chunk for DP3) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * DP2 processing for 0.5ms (no data produced as DP2 has 0.1ms to go) + * 100% CPU used + * + * + * + * (........ 9 more cycles - LL3 procuces 100% of data for DP3......) + * + * + * TICK15 + * LL1 is ready to run + * DP1 is ready tu run set deadline to TICK16 + * LL2 is ready to run + * DP2 is ready to run set deadline to TICK17 + * LL3 is ready to run + * DP3 is ready to run set deadline to TICK25 + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing 50% of data chunk for DP2) + * LL3 processing (producing 10% of second data chunk for DP3) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * DP2 processing for 0.5ms (no data produced as DP2 has 0.1ms to go) + * 100% CPU used - + * !!! note that DP3 is ready but has no chance to get CPU in this cycle + * + * TICK16 + * LL1 is ready to run set deadline to TICK17 + * DP1 is ready tu run + * LL2 is ready to run + * DP2 is in progress, deadline is set to TICK17 + * LL3 is ready to run + * DP3 is in progress, deadline is set to TICK25 + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing rest of data chunk for DP2) + * LL3 processing (producing 10% of second data chunk for DP3) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * DP2 processing for 0.1ms (producing data) + * DP3 processing for 0.2ms (producing 10 data chunks for LL4) + * 90% CPU used + * + * TICK17 + * LL1 is ready to run + * DP1 is ready tu run + * LL2 is ready to run + * DP2 is ready to run + * LL3 is ready to run + * LL4 is ready to run + * !! NOTE that DP3 is not ready - it will be ready again in TICK25 + * LL1 processing (producing data chunk for DP1) + * LL2 processing (producing rest of data chunk for DP2) + * LL3 processing (producing next 10% of second data chunk for DP3) + * LL4 processing (consuming 10% of data prepared by DP3) + * DP1 processing for 0.5ms (producing data chunk for LL2) + * DP2 processing for 0.5ms (no data produced as DP2 has 0.1ms to go) + * 100% CPU used + * + * + * Now - pipeline is in stable state, CPU used almost in 100% (it would be 100% if DP3 + * needed 1.2ms for processing - but the example would be too complicated) */ void scheduler_dp_ll_tick(void *receiver_data, enum notify_id event_type, void *caller_data) { @@ -90,7 +239,9 @@ void scheduler_dp_ll_tick(void *receiver_data, enum notify_id event_type, void * mod->sinks, mod->num_of_sinks); if (mod_ready) { - /* TODO: step 2 - caclulate deadlines */ + /* set a deadline for given num of ticks, starting now */ + k_thread_deadline_set(pdata->thread_id, pdata->period_clock_ticks); + /* trigger the task */ curr_task->state = SOF_TASK_STATE_RUNNING; k_sem_give(&pdata->sem); @@ -202,6 +353,7 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta struct scheduler_dp_data *dp_sch = (struct scheduler_dp_data *)data; struct task_dp_pdata *pdata = task->priv_data; unsigned int lock_key; + uint64_t period_clock_ticks; lock_key = scheduler_dp_lock(); @@ -216,11 +368,19 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta task->state = SOF_TASK_STATE_QUEUED; list_item_prepend(&task->list, &dp_sch->tasks); - pdata->period = period; + period_clock_ticks = period * CONFIG_SYS_CLOCK_TICKS_PER_SEC; + /* period is in us - convert to seconds in next step + * or it always will be zero because of fixed point calculation + */ + period_clock_ticks /= 1000000; + + pdata->period_clock_ticks = period_clock_ticks; scheduler_dp_unlock(lock_key); /* start LL task - run DP tick start and period are irrelevant for LL (that's bad)*/ schedule_task(&dp_sch->task, 0, 0); + + tr_dbg(&dp_tr, "DP task scheduled with period %u [us]", (uint32_t)period); return 0; } From 0061953a595b18c12a5962edced12d9ac9ac1ce2 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 26 Sep 2023 10:27:37 -0700 Subject: [PATCH 463/639] .github/sparse-zephyr: add -DCONFIG_MINIMAL_LIBC to avoid picolibc Add a sparse-specific workaround for the incompatibility with picolibc (the new Zephyr default) https://github.com/zephyrproject-rtos/zephyr/issues/63003 Also fix comment in commit 2a9473a17be4 ("app/prj.conf: disable PICOLIBC with CONFIG_MINIMAL_LIBC=y"): we don't need to disable PICOLIBC _everywhere_; we only need to disable it when using sparse. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/sparse-zephyr.yml | 3 +++ app/prj.conf | 5 ++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sparse-zephyr.yml b/.github/workflows/sparse-zephyr.yml index a0e7c8f3a0e7..9c63e11586fd 100644 --- a/.github/workflows/sparse-zephyr.yml +++ b/.github/workflows/sparse-zephyr.yml @@ -57,12 +57,15 @@ jobs: # --pristine is important to reproduce _warnings_. It makes no # difference for github but it's useful for anyone trying to # reproduce and copying the command from the logs. + # "sparse" is currently incompatible with PICOLIBC (the new Zephyr default), + # see https://github.com/zephyrproject-rtos/zephyr/issues/63003 - name: analyze zephyr working-directory: ./workspace run: | ./sof/zephyr/docker-run.sh \ ./sof/zephyr/docker-build.sh ${{ matrix.platform }} \ --cmake-args=-DZEPHYR_SCA_VARIANT=sparse --cmake-args=-DCONFIG_LOG_USE_VLA=n \ + --cmake-args=-DCONFIG_MINIMAL_LIBC=y \ --pristine 2>&1 | tee _.log printf '\n\n\t\t\t ---- Messages below are treated as sparse errors --- \n\n\n' diff --git a/app/prj.conf b/app/prj.conf index a5164e1926c6..b3f1016620ea 100644 --- a/app/prj.conf +++ b/app/prj.conf @@ -14,9 +14,8 @@ CONFIG_OUTPUT_DISASSEMBLY=y CONFIG_HAVE_AGENT=n -# PICOLIBC does not seem compatible with the "sparse" static analyzer -# yet, see https://github.com/zephyrproject-rtos/zephyr/issues/63003 -# Plus the paint on it is still wet. +# Since Zephyr commit f0daf904bb0202c PICOLIBC is the new default. +# We need more time to test and evaluate. CONFIG_MINIMAL_LIBC=y CONFIG_LOG=y From b98e912fff563a24774135698d626fc40ee5999b Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Fri, 22 Sep 2023 10:10:36 +0200 Subject: [PATCH 464/639] platform: posix: clk: add lowest freq index This patch adds CPU_LOWEST_FREQ_IDX definition to keep compliance with changes in base_fw. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- src/platform/posix/include/platform/lib/clk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/posix/include/platform/lib/clk.h b/src/platform/posix/include/platform/lib/clk.h index 3c9ff3b96950..7d396330a0cb 100644 --- a/src/platform/posix/include/platform/lib/clk.h +++ b/src/platform/posix/include/platform/lib/clk.h @@ -5,6 +5,7 @@ #define CLK_MAX_CPU_HZ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC #define CPU_LPRO_FREQ_IDX 1 +#define CPU_LOWEST_FREQ_IDX CPU_LPRO_FREQ_IDX /* This is not a platform function, it's defined in src/lib/clk.c. * But the declaration has historically been in the platform layer, so From 99c53d90f9748158012d725e27de1490e524c445 Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Thu, 14 Sep 2023 14:22:57 +0200 Subject: [PATCH 465/639] base_fw: get fw config This patch is changing value of slow clock in response for FwConfigGet from LP clock to the lowest clock is section "slow clock". Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- src/audio/base_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/base_fw.c b/src/audio/base_fw.c index 05e99194e608..ce7b5ca7778e 100644 --- a/src/audio/base_fw.c +++ b/src/audio/base_fw.c @@ -51,7 +51,7 @@ static int basefw_config(uint32_t *data_offset, char *data) tuple = tlv_next(tuple); tlv_value_uint32_set(tuple, IPC4_SLOW_CLOCK_FREQ_HZ_FW_CFG, - clock_get_freq(CPU_LPRO_FREQ_IDX)); + clock_get_freq(CPU_LOWEST_FREQ_IDX)); tuple = tlv_next(tuple); tlv_value_uint32_set(tuple, IPC4_SLOW_CLOCK_FREQ_HZ_FW_CFG, IPC4_ALH_CAVS_1_8); From 837f7715f27b4056cc6d35e121978363923f4a5b Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Wed, 6 Sep 2023 15:34:39 +0200 Subject: [PATCH 466/639] ace: clock: update clock definitions ACE_1.5 and ACE_2.0 use only two clocks for DSP cores. First is WOVRCO and second is ACE IPLL. IPLL allows to configure it to work like LP RING Oscillator Clock or HP RING Oscillator Clock. Currently, the driver does not allow this, so I remove the frequency that cannot be achieved anyway. Clocks frequencies: WOV: 38.4 MHz IPLL: 393.216 MHz Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- src/platform/lunarlake/include/platform/lib/clk.h | 10 ++++------ src/platform/lunarlake/lib/clk.c | 5 ++--- src/platform/meteorlake/include/platform/lib/clk.h | 10 ++++------ src/platform/meteorlake/lib/clk.c | 5 ++--- 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/src/platform/lunarlake/include/platform/lib/clk.h b/src/platform/lunarlake/include/platform/lib/clk.h index fe8f140ff0a6..77e72d8c6ccd 100644 --- a/src/platform/lunarlake/include/platform/lib/clk.h +++ b/src/platform/lunarlake/include/platform/lib/clk.h @@ -14,21 +14,19 @@ #include <ace/lib/clk.h> -#define CLK_MAX_CPU_HZ 400000000 +#define CLK_MAX_CPU_HZ CONFIG_XTENSA_CCOUNT_HZ #define CPU_WOVCRO_FREQ_IDX 0 -#define CPU_LPRO_FREQ_IDX 1 - -#define CPU_HPRO_FREQ_IDX 2 +#define CPU_IPLL_FREQ_IDX 1 #define CPU_LOWEST_FREQ_IDX CPU_WOVCRO_FREQ_IDX -#define CPU_DEFAULT_IDX CPU_HPRO_FREQ_IDX +#define CPU_DEFAULT_IDX CPU_IPLL_FREQ_IDX #define SSP_DEFAULT_IDX 1 -#define NUM_CPU_FREQ 3 +#define NUM_CPU_FREQ 2 #define NUM_SSP_FREQ 3 diff --git a/src/platform/lunarlake/lib/clk.c b/src/platform/lunarlake/lib/clk.c index ed2936b5efc4..7ad664c94118 100644 --- a/src/platform/lunarlake/lib/clk.c +++ b/src/platform/lunarlake/lib/clk.c @@ -9,9 +9,8 @@ #include <rtos/clk.h> static const struct freq_table platform_cpu_freq[] = { - { 38400000, 38400 }, - { 120000000, 120000 }, - { CLK_MAX_CPU_HZ, 400000 }, + { CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC, CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / 1000 }, + { CLK_MAX_CPU_HZ, CLK_MAX_CPU_HZ / 1000 }, }; STATIC_ASSERT(ARRAY_SIZE(platform_cpu_freq) == NUM_CPU_FREQ, invalid_number_of_cpu_frequencies); diff --git a/src/platform/meteorlake/include/platform/lib/clk.h b/src/platform/meteorlake/include/platform/lib/clk.h index 2eb1732aad55..fec0a582ab7e 100644 --- a/src/platform/meteorlake/include/platform/lib/clk.h +++ b/src/platform/meteorlake/include/platform/lib/clk.h @@ -14,21 +14,19 @@ #include <ace/lib/clk.h> -#define CLK_MAX_CPU_HZ 400000000 +#define CLK_MAX_CPU_HZ CONFIG_XTENSA_CCOUNT_HZ #define CPU_WOVCRO_FREQ_IDX 0 -#define CPU_LPRO_FREQ_IDX 1 - -#define CPU_HPRO_FREQ_IDX 2 +#define CPU_IPLL_FREQ_IDX 1 #define CPU_LOWEST_FREQ_IDX CPU_WOVCRO_FREQ_IDX -#define CPU_DEFAULT_IDX CPU_HPRO_FREQ_IDX +#define CPU_DEFAULT_IDX CPU_IPLL_FREQ_IDX #define SSP_DEFAULT_IDX 1 -#define NUM_CPU_FREQ 3 +#define NUM_CPU_FREQ 2 #define NUM_SSP_FREQ 3 diff --git a/src/platform/meteorlake/lib/clk.c b/src/platform/meteorlake/lib/clk.c index 227bc9fd9366..20221b89d790 100644 --- a/src/platform/meteorlake/lib/clk.c +++ b/src/platform/meteorlake/lib/clk.c @@ -9,9 +9,8 @@ #include <rtos/clk.h> static const struct freq_table platform_cpu_freq[] = { - { 38400000, 38400 }, - { 120000000, 120000 }, - { CLK_MAX_CPU_HZ, 400000 }, + { CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC, CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC / 1000 }, + { CLK_MAX_CPU_HZ, CLK_MAX_CPU_HZ / 1000 }, }; STATIC_ASSERT(ARRAY_SIZE(platform_cpu_freq) == NUM_CPU_FREQ, invalid_number_of_cpu_frequencies); From 5b8ba30694ee5aeca3efb53e43866bb3c5972c5e Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Wed, 6 Sep 2023 16:04:43 +0200 Subject: [PATCH 467/639] ace: overlay: update clock frequency Changing max clock frequency for FPGA configuration. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- app/overlays/lnl/fpga_overlay.conf | 1 + app/overlays/mtl/fpga_overlay.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/app/overlays/lnl/fpga_overlay.conf b/app/overlays/lnl/fpga_overlay.conf index 0fc3ac375789..eebbfee72648 100644 --- a/app/overlays/lnl/fpga_overlay.conf +++ b/app/overlays/lnl/fpga_overlay.conf @@ -1,2 +1,3 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=19200000 CONFIG_DAI_DMIC_HW_IOCLK=19200000 +CONFIG_XTENSA_CCOUNT_HZ=40000000 diff --git a/app/overlays/mtl/fpga_overlay.conf b/app/overlays/mtl/fpga_overlay.conf index 0fc3ac375789..eebbfee72648 100644 --- a/app/overlays/mtl/fpga_overlay.conf +++ b/app/overlays/mtl/fpga_overlay.conf @@ -1,2 +1,3 @@ CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=19200000 CONFIG_DAI_DMIC_HW_IOCLK=19200000 +CONFIG_XTENSA_CCOUNT_HZ=40000000 From 48259d866305073e96f7163cf846f7f77969ee78 Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Tue, 26 Sep 2023 23:21:43 +0200 Subject: [PATCH 468/639] west.yml: update zephyr to b2f7ea0523 Zepych update: total of 736 commits. 492517b918 west.yml: Update NXP HAL SDK to 2.14 a5d1fd9857 soc: adsp: clk: update clock switch flow 9656056b19 dts: adsp: ace20: remove lp clock 50f0e223e8 dts: adsp: ace15: remove lp clock cf6d5f95b6 adsp: clk: ace: select ipll if wovrco is unavailable 2d835e1b29 dts: adsp: ace20: replace hp with ipll clock dcecda859c dts: adsp: ace15: replace hp with ipll clock 2f2689e3d3 intel_adsp: ace15: shim: update wovrco request bit ea9dd59460 yamllint: bindings: add ipll clock index 1ddabfa8d8 dai: intel: dmic: fix shadow variable b26921d776 dai: intel: dmic: New functions for writing fir coefficients cba9ec10c3 dai: intel: tgl: dmic: Refactor of dai_nhlt_dmic_dai_params_get function c28e8ba9ba dai: intel: dmic: Add pdm_base and pdm_idx variables in blob parser 2452aaad50 dai: intel: dmic: Separate fir configuration code into function f74fd8edaf dai: intel: ace: dmic: Add dai_dmic_start_fifo_packers function 76d03e798f dai: intel: ace: dmic: Using the WAIT_FOR macro in waiting functions 3fbaed4de9 dai: intel: ace: dmic: Refactor of dai_nhlt_dmic_dai_params_get function d7672af838 dai: intel: dmic: Combine PDM registers definitions 8ea53d49b6 dai: intel: dmic: nhlt: Move debug print code to a separate functions 81944c5c62 dai: intel: dmic: Move definitions of nhlt structures to a new file Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 5f4db594af5d..8543b993e2b1 100644 --- a/west.yml +++ b/west.yml @@ -45,7 +45,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 2f90ef488a4e97c94c2cc5b95dacd1b15de32216 + revision: 492517b918d267f553688cd6b9d59b92ffc10f91 remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision From 61dc4e84f3af8e81428ba844d95b0d80e08aa3e4 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 19:49:01 +0200 Subject: [PATCH 469/639] sample: remove buffer_acquire from samples remove buffer ops from samples this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/samples/audio/detect_test.c | 25 +++++---------- src/samples/audio/smart_amp_test_ipc3.c | 42 +++++++------------------ src/samples/audio/smart_amp_test_ipc4.c | 27 ++++++---------- 3 files changed, 30 insertions(+), 64 deletions(-) diff --git a/src/samples/audio/detect_test.c b/src/samples/audio/detect_test.c index 632ad4a6a00d..88a32301cf2a 100644 --- a/src/samples/audio/detect_test.c +++ b/src/samples/audio/detect_test.c @@ -797,7 +797,6 @@ static int test_keyword_params(struct comp_dev *dev, { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *sourceb; - struct comp_buffer *source_c; unsigned int channels, rate; enum sof_ipc_frame frame_fmt; int err; @@ -815,11 +814,9 @@ static int test_keyword_params(struct comp_dev *dev, /* keyword components will only ever have 1 source */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(sourceb); - channels = audio_stream_get_channels(&source_c->stream); - frame_fmt = audio_stream_get_frm_fmt(&source_c->stream); - rate = audio_stream_get_rate(&source_c->stream); - buffer_release(source_c); + channels = audio_stream_get_channels(&sourceb->stream); + frame_fmt = audio_stream_get_frm_fmt(&sourceb->stream); + rate = audio_stream_get_rate(&sourceb->stream); if (channels != 1) { comp_err(dev, "test_keyword_params(): only single-channel supported"); @@ -881,7 +878,6 @@ static int test_keyword_copy(struct comp_dev *dev) { struct comp_data *cd = comp_get_drvdata(dev); struct comp_buffer *source; - struct comp_buffer *source_c; uint32_t frames; comp_dbg(dev, "test_keyword_copy()"); @@ -889,23 +885,18 @@ static int test_keyword_copy(struct comp_dev *dev) /* keyword components will only ever have 1 source */ source = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - source_c = buffer_acquire(source); - if (!audio_stream_get_avail(&source_c->stream)) { - buffer_release(source_c); + if (!audio_stream_get_avail(&source->stream)) return PPL_STATUS_PATH_STOP; - } - frames = audio_stream_get_avail_frames(&source_c->stream); + frames = audio_stream_get_avail_frames(&source->stream); /* copy and perform detection */ - buffer_stream_invalidate(source_c, audio_stream_get_avail_bytes(&source_c->stream)); - cd->detect_func(dev, &source_c->stream, frames); + buffer_stream_invalidate(source, audio_stream_get_avail_bytes(&source->stream)); + cd->detect_func(dev, &source->stream, frames); /* calc new available */ - comp_update_buffer_consume(source_c, audio_stream_get_avail_bytes(&source_c->stream)); - - buffer_release(source_c); + comp_update_buffer_consume(source, audio_stream_get_avail_bytes(&source->stream)); return 0; } diff --git a/src/samples/audio/smart_amp_test_ipc3.c b/src/samples/audio/smart_amp_test_ipc3.c index dc58cd0727d9..ce03381d5bbe 100644 --- a/src/samples/audio/smart_amp_test_ipc3.c +++ b/src/samples/audio/smart_amp_test_ipc3.c @@ -316,9 +316,7 @@ static int smart_amp_trigger(struct comp_dev *dev, int cmd) case COMP_TRIGGER_START: case COMP_TRIGGER_RELEASE: if (sad->feedback_buf) { - struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); - buffer_zero(buf); - buffer_release(buf); + buffer_zero(sad->feedback_buf); } break; case COMP_TRIGGER_PAUSE: @@ -414,8 +412,8 @@ static smart_amp_proc get_smart_amp_process(struct comp_dev *dev, static int smart_amp_copy(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); - struct comp_buffer *source_buf = buffer_acquire(sad->source_buf); - struct comp_buffer *sink_buf = buffer_acquire(sad->sink_buf); + struct comp_buffer *source_buf = sad->source_buf; + struct comp_buffer *sink_buf = sad->sink_buf; uint32_t avail_passthrough_frames; uint32_t avail_feedback_frames; uint32_t avail_frames = 0; @@ -431,7 +429,7 @@ static int smart_amp_copy(struct comp_dev *dev) &sink_buf->stream); if (sad->feedback_buf) { - struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); + struct comp_buffer *buf = sad->feedback_buf; if (buf->source && comp_get_state(dev, buf->source) == dev->state) { /* feedback */ @@ -454,8 +452,6 @@ static int smart_amp_copy(struct comp_dev *dev) comp_update_buffer_consume(buf, feedback_bytes); } - - buffer_release(buf); } if (!avail_frames) @@ -477,9 +473,6 @@ static int smart_amp_copy(struct comp_dev *dev) comp_update_buffer_consume(source_buf, source_bytes); comp_update_buffer_produce(sink_buf, sink_bytes); - buffer_release(sink_buf); - buffer_release(source_buf); - return 0; } @@ -496,7 +489,6 @@ static int smart_amp_prepare(struct comp_dev *dev) { struct smart_amp_data *sad = comp_get_drvdata(dev); struct comp_buffer *source_buffer; - struct comp_buffer *buffer_c; struct list_item *blist; int ret; @@ -513,43 +505,33 @@ static int smart_amp_prepare(struct comp_dev *dev) list_for_item(blist, &dev->bsource_list) { source_buffer = container_of(blist, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(source_buffer); /* FIXME: how often can this loop be run? */ - if (buffer_c->source->ipc_config.type == SOF_COMP_DEMUX) + if (source_buffer->source->ipc_config.type == SOF_COMP_DEMUX) sad->feedback_buf = source_buffer; else sad->source_buf = source_buffer; - - buffer_release(buffer_c); } sad->sink_buf = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - buffer_c = buffer_acquire(sad->sink_buf); - sad->out_channels = audio_stream_get_channels(&buffer_c->stream); - buffer_release(buffer_c); + sad->out_channels = audio_stream_get_channels(&sad->sink_buf->stream); - buffer_c = buffer_acquire(sad->source_buf); - sad->in_channels = audio_stream_get_channels(&buffer_c->stream); + sad->in_channels = audio_stream_get_channels(&sad->source_buf->stream); if (sad->feedback_buf) { - struct comp_buffer *buf = buffer_acquire(sad->feedback_buf); - - audio_stream_set_channels(&buf->stream, sad->config.feedback_channels); - audio_stream_set_rate(&buf->stream, audio_stream_get_rate(&buffer_c->stream)); - buffer_release(buf); + audio_stream_set_channels(&sad->feedback_buf->stream, + sad->config.feedback_channels); + audio_stream_set_rate(&sad->feedback_buf->stream, + audio_stream_get_rate(&sad->source_buf->stream)); } - sad->process = get_smart_amp_process(dev, buffer_c); + sad->process = get_smart_amp_process(dev, sad->source_buf); if (!sad->process) { comp_err(dev, "smart_amp_prepare(): get_smart_amp_process failed"); ret = -EINVAL; } - - buffer_release(buffer_c); - return ret; } diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index 8e6058160b58..02f6e6b0016b 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -92,7 +92,6 @@ static void smart_amp_set_params(struct processing_module *mod) struct comp_dev *dev = mod->dev; struct smart_amp_data *sad = module_get_private_data(mod); struct comp_buffer *sink; - struct comp_buffer *sink_c; ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); @@ -102,11 +101,9 @@ static void smart_amp_set_params(struct processing_module *mod) struct ipc4_audio_format out_fmt = sink_fmt->audio_fmt; sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - sink_c = buffer_acquire(sink); - ipc4_update_buffer_format(sink_c, &out_fmt); - params->frame_fmt = audio_stream_get_frm_fmt(&sink_c->stream); - buffer_release(sink_c); + ipc4_update_buffer_format(sink, &out_fmt); + params->frame_fmt = audio_stream_get_frm_fmt(&sink->stream); } } @@ -350,7 +347,6 @@ static int smart_amp_prepare(struct processing_module *mod, struct comp_dev *dev = mod->dev; struct comp_buffer *source_buffer; struct comp_buffer *sink_buffer; - struct comp_buffer *buffer_c; struct list_item *blist; int ret; @@ -363,22 +359,19 @@ static int smart_amp_prepare(struct processing_module *mod, list_for_item(blist, &dev->bsource_list) { source_buffer = container_of(blist, struct comp_buffer, sink_list); - buffer_c = buffer_acquire(source_buffer); - audio_stream_init_alignment_constants(1, 1, &buffer_c->stream); - if (IPC4_SINK_QUEUE_ID(buffer_c->id) == SOF_SMART_AMP_FEEDBACK_QUEUE_ID) { - audio_stream_set_channels(&buffer_c->stream, sad->config.feedback_channels); - audio_stream_set_rate(&buffer_c->stream, + audio_stream_init_alignment_constants(1, 1, &source_buffer->stream); + if (IPC4_SINK_QUEUE_ID(source_buffer->id) == SOF_SMART_AMP_FEEDBACK_QUEUE_ID) { + audio_stream_set_channels(&source_buffer->stream, + sad->config.feedback_channels); + audio_stream_set_rate(&source_buffer->stream, mod->priv.cfg.base_cfg.audio_fmt.sampling_frequency); } - buffer_release(buffer_c); } sink_buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - buffer_c = buffer_acquire(sink_buffer); - sad->out_channels = audio_stream_get_channels(&buffer_c->stream); - audio_stream_init_alignment_constants(1, 1, &buffer_c->stream); - sad->process = get_smart_amp_process(dev, buffer_c); - buffer_release(buffer_c); + sad->out_channels = audio_stream_get_channels(&sink_buffer->stream); + audio_stream_init_alignment_constants(1, 1, &sink_buffer->stream); + sad->process = get_smart_amp_process(dev, sink_buffer); if (!sad->process) { comp_err(dev, "smart_amp_prepare(): get_smart_amp_process failed"); From c78301ed263d5fdb0be242651a78be319eb953f9 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:01:46 +0200 Subject: [PATCH 470/639] dai: remove buffer_acquire from dai (zephyr and legacy also) remove buffer ops from dai, dai-legacy, dai-zephyr this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/dai-legacy.c | 101 +++++--------------- src/audio/dai-zephyr.c | 203 +++++++++++++---------------------------- src/ipc/ipc3/dai.c | 18 ++-- 3 files changed, 95 insertions(+), 227 deletions(-) diff --git a/src/audio/dai-legacy.c b/src/audio/dai-legacy.c index 933d23d43fdb..ccbe72f4062b 100644 --- a/src/audio/dai-legacy.c +++ b/src/audio/dai-legacy.c @@ -97,7 +97,6 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) struct comp_dev *dev = arg; struct dai_data *dd = comp_get_drvdata(dev); uint32_t bytes = next->elem.size; - struct comp_buffer *local_buf, *dma_buf; int ret; comp_dbg(dev, "dai_dma_cb()"); @@ -113,26 +112,21 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) next->status = DMA_CB_STATUS_END; } - dma_buf = buffer_acquire(dd->dma_buffer); - /* is our pipeline handling an XRUN ? */ if (dd->xrun) { /* make sure we only playback silence during an XRUN */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) /* fill buffer with silence */ - buffer_zero(dma_buf); - buffer_release(dma_buf); + buffer_zero(dd->dma_buffer); return; } - local_buf = buffer_acquire(dd->local_buffer); - if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - ret = dma_buffer_copy_to(local_buf, dma_buf, + ret = dma_buffer_copy_to(dd->local_buffer, dd->dma_buffer, dd->process, bytes); } else { - ret = dma_buffer_copy_from(dma_buf, local_buf, + ret = dma_buffer_copy_from(dd->dma_buffer, dd->local_buffer, dd->process, bytes); } @@ -141,9 +135,9 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) struct comp_buffer *source_c, *sink_c; source_c = dev->direction == SOF_IPC_STREAM_PLAYBACK ? - local_buf : dma_buf; + dd->local_buffer : dd->dma_buffer; sink_c = dev->direction == SOF_IPC_STREAM_PLAYBACK ? - dma_buf : local_buf; + dd->dma_buffer : dd->local_buffer; comp_err(dev, "dai_dma_cb() dma buffer copy failed, dir %d bytes %d avail %d free %d", dev->direction, bytes, audio_stream_get_avail_samples(&source_c->stream) * @@ -154,9 +148,6 @@ static void dai_dma_cb(void *arg, enum notify_id type, void *data) /* update host position (in bytes offset) for drivers */ dd->total_data_processed += bytes; } - - buffer_release(local_buf); - buffer_release(dma_buf); } int dai_common_new(struct dai_data *dd, struct comp_dev *dev, const struct ipc_config_dai *dai) @@ -357,23 +348,18 @@ static int dai_playback_params(struct comp_dev *dev, uint32_t period_bytes, { struct dai_data *dd = comp_get_drvdata(dev); struct dma_sg_config *config = &dd->config; - struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), - *local_buf = buffer_acquire(dd->local_buffer); - uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); - uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); + uint32_t local_fmt = audio_stream_get_frm_fmt(&dd->local_buffer->stream); + uint32_t dma_fmt = audio_stream_get_frm_fmt(&dd->dma_buffer->stream); uint32_t fifo; int err = 0; /* set processing function */ dd->process = pcm_get_conversion_function(local_fmt, dma_fmt); - buffer_release(local_buf); - if (!dd->process) { comp_err(dev, "dai_playback_params(): converter function NULL: local fmt %d dma fmt %d\n", local_fmt, dma_fmt); - err = -EINVAL; - goto out; + return -EINVAL; } /* set up DMA configuration */ @@ -401,16 +387,13 @@ static int dai_playback_params(struct comp_dev *dev, uint32_t period_bytes, config->direction, period_count, period_bytes, - (uintptr_t)(audio_stream_get_addr(&dma_buf->stream)), + (uintptr_t)(audio_stream_get_addr(&dd->dma_buffer->stream)), fifo); if (err < 0) comp_err(dev, "dai_playback_params(): dma_sg_alloc() for period_count %d period_bytes %d failed with err = %d", period_count, period_bytes, err); } -out: - buffer_release(dma_buf); - return err; } @@ -419,23 +402,18 @@ static int dai_capture_params(struct comp_dev *dev, uint32_t period_bytes, { struct dai_data *dd = comp_get_drvdata(dev); struct dma_sg_config *config = &dd->config; - struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), - *local_buf = buffer_acquire(dd->local_buffer); - uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); - uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); + uint32_t local_fmt = audio_stream_get_frm_fmt(&dd->local_buffer->stream); + uint32_t dma_fmt = audio_stream_get_frm_fmt(&dd->dma_buffer->stream); uint32_t fifo; int err = 0; /* set processing function */ dd->process = pcm_get_conversion_function(dma_fmt, local_fmt); - buffer_release(local_buf); - if (!dd->process) { comp_err(dev, "dai_capture_params(): converter function NULL: local fmt %d dma fmt %d\n", local_fmt, dma_fmt); - err = -EINVAL; - goto out; + return -EINVAL; } /* set up DMA configuration */ @@ -474,16 +452,13 @@ static int dai_capture_params(struct comp_dev *dev, uint32_t period_bytes, config->direction, period_count, period_bytes, - (uintptr_t)(audio_stream_get_addr(&dma_buf->stream)), + (uintptr_t)(audio_stream_get_addr(&dd->dma_buffer->stream)), fifo); if (err < 0) comp_err(dev, "dai_capture_params(): dma_sg_alloc() for period_count %d period_bytes %d failed with err = %d", period_count, period_bytes, err); } -out: - buffer_release(dma_buf); - return err; } @@ -491,7 +466,6 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct sof_ipc_stream_params hw_params = *params; - struct comp_buffer *buffer_c; uint32_t frame_size; uint32_t period_count; uint32_t period_bytes; @@ -565,13 +539,9 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, return -EINVAL; } - buffer_c = buffer_acquire(dd->local_buffer); - /* calculate frame size */ frame_size = get_frame_bytes(dev->ipc_config.frame_fmt, - audio_stream_get_channels(&buffer_c->stream)); - - buffer_release(buffer_c); + audio_stream_get_channels(&dd->local_buffer->stream)); /* calculate period size */ period_bytes = dev->frames * frame_size; @@ -589,9 +559,7 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, /* alloc DMA buffer or change its size if exists */ if (dd->dma_buffer) { - buffer_c = buffer_acquire(dd->dma_buffer); - err = buffer_set_size(buffer_c, buffer_size, addr_align); - buffer_release(buffer_c); + err = buffer_set_size(dd->dma_buffer, buffer_size, addr_align); if (err < 0) { comp_err(dev, "dai_params(): buffer_set_size() failed, buffer_size = %u", @@ -613,10 +581,8 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, * frame_fmt's (using pcm converter). */ hw_params.frame_fmt = dev->ipc_config.frame_fmt; - buffer_c = buffer_acquire(dd->dma_buffer); - buffer_set_params(buffer_c, &hw_params, + buffer_set_params(dd->dma_buffer, &hw_params, BUFFER_UPDATE_FORCE); - buffer_release(buffer_c); } return dev->direction == SOF_IPC_STREAM_PLAYBACK ? @@ -685,7 +651,6 @@ int dai_common_config_prepare(struct dai_data *dd, struct comp_dev *dev) int dai_common_prepare(struct dai_data *dd, struct comp_dev *dev) { - struct comp_buffer *buffer_c; int ret; dd->total_data_processed = 0; @@ -703,9 +668,7 @@ int dai_common_prepare(struct dai_data *dd, struct comp_dev *dev) } /* clear dma buffer to avoid pop noise */ - buffer_c = buffer_acquire(dd->dma_buffer); - buffer_zero(buffer_c); - buffer_release(buffer_c); + buffer_zero(dd->dma_buffer); /* dma reconfig not required if XRUN handling */ if (dd->xrun) { @@ -815,11 +778,7 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, * this is only supported at capture mode. */ if (dev->direction == SOF_IPC_STREAM_CAPTURE) { - struct comp_buffer *buffer_c = - buffer_acquire(dd->dma_buffer); - - buffer_zero(buffer_c); - buffer_release(buffer_c); + buffer_zero(dd->dma_buffer); } /* only start the DAI if we are not XRUN handling */ @@ -947,17 +906,14 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd) static void dai_report_xrun(struct comp_dev *dev, uint32_t bytes) { struct dai_data *dd = comp_get_drvdata(dev); - struct comp_buffer *buf_c = buffer_acquire(dd->local_buffer); if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { comp_err(dev, "dai_report_xrun(): underrun due to no data available"); - comp_underrun(dev, buf_c, bytes); + comp_underrun(dev, dd->local_buffer, bytes); } else { comp_err(dev, "dai_report_xrun(): overrun due to no space available"); - comp_overrun(dev, buf_c, bytes); + comp_overrun(dev, dd->local_buffer, bytes); } - - buffer_release(buf_c); } /* copy and process stream data from source to sink buffers */ @@ -965,7 +921,6 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun { uint32_t dma_fmt; uint32_t sampling; - struct comp_buffer *buf_c; uint32_t avail_bytes = 0; uint32_t free_bytes = 0; uint32_t copy_bytes = 0; @@ -981,23 +936,17 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun return ret; } - buf_c = buffer_acquire(dd->dma_buffer); - - dma_fmt = audio_stream_get_frm_fmt(&buf_c->stream); + dma_fmt = audio_stream_get_frm_fmt(&dd->dma_buffer->stream); sampling = get_sample_bytes(dma_fmt); - buffer_release(buf_c); - - buf_c = buffer_acquire(dd->local_buffer); - /* calculate minimum size to copy */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - src_samples = audio_stream_get_avail_samples(&buf_c->stream); + src_samples = audio_stream_get_avail_samples(&dd->local_buffer->stream); sink_samples = free_bytes / sampling; samples = MIN(src_samples, sink_samples); } else { src_samples = avail_bytes / sampling; - sink_samples = audio_stream_get_free_samples(&buf_c->stream); + sink_samples = audio_stream_get_free_samples(&dd->local_buffer->stream); samples = MIN(src_samples, sink_samples); } @@ -1010,9 +959,7 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun comp_dbg(dev, "dai_common_copy(), dir: %d copy_bytes= 0x%x, frames= %d", dev->direction, copy_bytes, - samples / audio_stream_get_channels(&buf_c->stream)); - - buffer_release(buf_c); + samples / audio_stream_get_channels(&dd->local_buffer->stream)); /* Check possibility of glitch occurrence */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK && diff --git a/src/audio/dai-zephyr.c b/src/audio/dai-zephyr.c index abe6ae075df8..6a0694519235 100644 --- a/src/audio/dai-zephyr.c +++ b/src/audio/dai-zephyr.c @@ -226,7 +226,6 @@ static enum dma_cb_status dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, pcm_converter_func *converter) { - struct comp_buffer *local_buf, *dma_buf; enum dma_cb_status dma_status = DMA_CB_STATUS_RELOAD; int ret; @@ -241,33 +240,29 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, dma_status = DMA_CB_STATUS_END; } - dma_buf = buffer_acquire(dd->dma_buffer); - /* is our pipeline handling an XRUN ? */ if (dd->xrun) { /* make sure we only playback silence during an XRUN */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) /* fill buffer with silence */ - buffer_zero(dma_buf); - buffer_release(dma_buf); + buffer_zero(dd->dma_buffer); return dma_status; } - local_buf = buffer_acquire(dd->local_buffer); - if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - ret = dma_buffer_copy_to(local_buf, dma_buf, + ret = dma_buffer_copy_to(dd->local_buffer, dd->dma_buffer, dd->process, bytes); } else { struct list_item *sink_list; - audio_stream_invalidate(&dma_buf->stream, bytes); + audio_stream_invalidate(&dd->dma_buffer->stream, bytes); /* * The PCM converter functions used during DMA buffer copy can never fail, * so no need to check the return value of dma_buffer_copy_from_no_consume(). */ - ret = dma_buffer_copy_from_no_consume(dma_buf, local_buf, dd->process, bytes); + ret = dma_buffer_copy_from_no_consume(dd->dma_buffer, dd->local_buffer, + dd->process, bytes); #if CONFIG_IPC_MAJOR_4 /* Skip in case of endpoint DAI devices created by the copier */ if (converter) { @@ -276,7 +271,6 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, * function */ list_for_item(sink_list, &dev->bsink_list) { - struct comp_buffer *sink_c; struct comp_dev *sink_dev; struct comp_buffer *sink; int j; @@ -287,33 +281,31 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, if (sink == dd->local_buffer) continue; - sink_c = buffer_acquire(sink); - sink_dev = sink_c->sink; + sink_dev = sink->sink; - j = IPC4_SINK_QUEUE_ID(sink_c->id); + j = IPC4_SINK_QUEUE_ID(sink->id); if (j >= IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT) { comp_err(dev, "Sink queue ID: %d >= max output pin count: %d\n", j, IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT); ret = -EINVAL; - goto err; + continue; } if (!converter[j]) { comp_err(dev, "No PCM converter for sink queue %d\n", j); ret = -EINVAL; - goto err; + continue; } if (sink_dev && sink_dev->state == COMP_STATE_ACTIVE) - ret = dma_buffer_copy_from_no_consume(dma_buf, sink_c, - converter[j], bytes); -err: - buffer_release(sink_c); + ret = dma_buffer_copy_from_no_consume(dd->dma_buffer, + sink, converter[j], + bytes); } } #endif - audio_stream_consume(&dma_buf->stream, bytes); + audio_stream_consume(&dd->dma_buffer->stream, bytes); } /* assert dma_buffer_copy succeed */ @@ -321,9 +313,9 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, struct comp_buffer *source_c, *sink_c; source_c = dev->direction == SOF_IPC_STREAM_PLAYBACK ? - local_buf : dma_buf; + dd->local_buffer : dd->dma_buffer; sink_c = dev->direction == SOF_IPC_STREAM_PLAYBACK ? - dma_buf : local_buf; + dd->dma_buffer : dd->local_buffer; comp_err(dev, "dai_dma_cb() dma buffer copy failed, dir %d bytes %d avail %d free %d", dev->direction, bytes, audio_stream_get_avail_samples(&source_c->stream) * @@ -335,9 +327,6 @@ dai_dma_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes, dd->total_data_processed += bytes; } - buffer_release(local_buf); - buffer_release(dma_buf); - return dma_status; } @@ -346,7 +335,6 @@ static enum dma_cb_status dai_dma_multi_endpoint_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t frames, struct comp_buffer *multi_endpoint_buffer) { - struct comp_buffer *multi_buf_c, *dma_buf; enum dma_cb_status dma_status = DMA_CB_STATUS_RELOAD; uint32_t i, bytes; @@ -361,48 +349,41 @@ dai_dma_multi_endpoint_cb(struct dai_data *dd, struct comp_dev *dev, uint32_t fr dma_status = DMA_CB_STATUS_END; } - dma_buf = buffer_acquire(dd->dma_buffer); - /* is our pipeline handling an XRUN ? */ if (dd->xrun) { /* make sure we only playback silence during an XRUN */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) /* fill buffer with silence */ - buffer_zero(dma_buf); - buffer_release(dma_buf); + buffer_zero(dd->dma_buffer); return dma_status; } - multi_buf_c = buffer_acquire(multi_endpoint_buffer); - - bytes = frames * audio_stream_frame_bytes(&dma_buf->stream); + bytes = frames * audio_stream_frame_bytes(&dd->dma_buffer->stream); if (dev->direction == SOF_IPC_STREAM_CAPTURE) - audio_stream_invalidate(&dma_buf->stream, bytes); + audio_stream_invalidate(&dd->dma_buffer->stream, bytes); /* copy all channels one by one */ - for (i = 0; i < audio_stream_get_channels(&dma_buf->stream); i++) { - uint32_t multi_buf_channel = dma_buf->chmap[i]; + for (i = 0; i < audio_stream_get_channels(&dd->dma_buffer->stream); i++) { + uint32_t multi_buf_channel = dd->dma_buffer->chmap[i]; if (dev->direction == SOF_IPC_STREAM_PLAYBACK) - dd->process(&multi_buf_c->stream, multi_buf_channel, - &dma_buf->stream, i, frames); + dd->process(&multi_endpoint_buffer->stream, multi_buf_channel, + &dd->dma_buffer->stream, i, frames); else - dd->process(&dma_buf->stream, i, &multi_buf_c->stream, + dd->process(&dd->dma_buffer->stream, i, &multi_endpoint_buffer->stream, multi_buf_channel, frames); } if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - audio_stream_writeback(&dma_buf->stream, bytes); - audio_stream_produce(&dma_buf->stream, bytes); + audio_stream_writeback(&dd->dma_buffer->stream, bytes); + audio_stream_produce(&dd->dma_buffer->stream, bytes); } else { - audio_stream_consume(&dma_buf->stream, bytes); + audio_stream_consume(&dd->dma_buffer->stream, bytes); } /* update host position (in bytes offset) for drivers */ dd->total_data_processed += bytes; - buffer_release(multi_buf_c); - buffer_release(dma_buf); return dma_status; } @@ -592,23 +573,18 @@ static int dai_playback_params(struct dai_data *dd, struct comp_dev *dev, uint32 struct dma_config *dma_cfg; struct dma_block_config *dma_block_cfg; struct dma_block_config *prev = NULL; - struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), - *local_buf = buffer_acquire(dd->local_buffer); - uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); - uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); + uint32_t local_fmt = audio_stream_get_frm_fmt(&dd->local_buffer->stream); + uint32_t dma_fmt = audio_stream_get_frm_fmt(&dd->dma_buffer->stream); uint32_t fifo, max_block_count, buf_size; int i, err = 0; - buffer_release(local_buf); - /* set processing function */ dd->process = pcm_get_conversion_function(local_fmt, dma_fmt); if (!dd->process) { comp_err(dev, "dai_playback_params(): converter function NULL: local fmt %d dma fmt %d\n", local_fmt, dma_fmt); - err = -EINVAL; - goto out; + return -EINVAL; } /* set up DMA configuration */ @@ -635,12 +611,12 @@ static int dai_playback_params(struct dai_data *dd, struct comp_dev *dev, uint32 &max_block_count); if (err < 0) { comp_err(dev, "dai_playback_params(): could not get dma attr max block count, err = %d", err); - goto out; + return err; } if (!max_block_count) { comp_err(dev, "dai_playback_params(): invalid max-block-count of zero"); - goto out; + return err; } if (max_block_count < period_count) { @@ -661,12 +637,12 @@ static int dai_playback_params(struct dai_data *dd, struct comp_dev *dev, uint32 config->direction, period_count, period_bytes, - (uintptr_t)audio_stream_get_addr(&dma_buf->stream), + (uintptr_t)audio_stream_get_addr(&dd->dma_buffer->stream), fifo); if (err < 0) { comp_err(dev, "dai_playback_params(): dma_sg_alloc() for period_count %d period_bytes %d failed with err = %d", period_count, period_bytes, err); - goto out; + return err; } } @@ -721,8 +697,6 @@ static int dai_playback_params(struct dai_data *dd, struct comp_dev *dev, uint32 free: if (err < 0) dma_sg_free(&config->elem_array); -out: - buffer_release(dma_buf); return err; } @@ -734,23 +708,18 @@ static int dai_capture_params(struct dai_data *dd, struct comp_dev *dev, uint32_ struct dma_config *dma_cfg; struct dma_block_config *dma_block_cfg; struct dma_block_config *prev = NULL; - struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer), - *local_buf = buffer_acquire(dd->local_buffer); - uint32_t local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); - uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); + uint32_t local_fmt = audio_stream_get_frm_fmt(&dd->local_buffer->stream); + uint32_t dma_fmt = audio_stream_get_frm_fmt(&dd->dma_buffer->stream); uint32_t fifo, max_block_count, buf_size; int i, err = 0; - buffer_release(local_buf); - /* set processing function */ dd->process = pcm_get_conversion_function(dma_fmt, local_fmt); if (!dd->process) { comp_err(dev, "dai_capture_params(): converter function NULL: local fmt %d dma fmt %d\n", local_fmt, dma_fmt); - err = -EINVAL; - goto out; + return -EINVAL; } /* set up DMA configuration */ @@ -789,12 +758,12 @@ static int dai_capture_params(struct dai_data *dd, struct comp_dev *dev, uint32_ &max_block_count); if (err < 0) { comp_err(dev, "dai_capture_params(): could not get dma attr max block count, err = %d", err); - goto out; + return err; } if (!max_block_count) { comp_err(dev, "dai_capture_params(): invalid max-block-count of zero"); - goto out; + return err; } if (max_block_count < period_count) { @@ -815,12 +784,12 @@ static int dai_capture_params(struct dai_data *dd, struct comp_dev *dev, uint32_ config->direction, period_count, period_bytes, - (uintptr_t)audio_stream_get_addr(&dma_buf->stream), + (uintptr_t)audio_stream_get_addr(&dd->dma_buffer->stream), fifo); if (err < 0) { comp_err(dev, "dai_capture_params(): dma_sg_alloc() for period_count %d period_bytes %d failed with err = %d", period_count, period_bytes, err); - goto out; + return err; } } @@ -875,8 +844,6 @@ static int dai_capture_params(struct dai_data *dd, struct comp_dev *dev, uint32_ free: if (err < 0) dma_sg_free(&config->elem_array); -out: - buffer_release(dma_buf); return err; } @@ -885,7 +852,6 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, struct sof_ipc_stream_params *params) { struct sof_ipc_stream_params hw_params = *params; - struct comp_buffer *buffer_c; uint32_t frame_size; uint32_t period_count; uint32_t period_bytes; @@ -967,9 +933,7 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, /* alloc DMA buffer or change its size if exists */ if (dd->dma_buffer) { - buffer_c = buffer_acquire(dd->dma_buffer); - err = buffer_set_size(buffer_c, buffer_size, addr_align); - buffer_release(buffer_c); + err = buffer_set_size(dd->dma_buffer, buffer_size, addr_align); if (err < 0) { comp_err(dev, "dai_common_params(): buffer_set_size() failed, buffer_size = %u", @@ -992,11 +956,10 @@ int dai_common_params(struct dai_data *dd, struct comp_dev *dev, * frame_fmt's (using pcm converter). */ hw_params.frame_fmt = dev->ipc_config.frame_fmt; - buffer_c = buffer_acquire(dd->dma_buffer); - buffer_set_params(buffer_c, &hw_params, + buffer_set_params(dd->dma_buffer, &hw_params, BUFFER_UPDATE_FORCE); + dd->sampling = get_sample_bytes(hw_params.frame_fmt); - buffer_release(buffer_c); } dd->fast_mode = dd->ipc_config.feature_mask & BIT(IPC4_COPIER_FAST_MODE); @@ -1064,7 +1027,6 @@ int dai_common_config_prepare(struct dai_data *dd, struct comp_dev *dev) int dai_common_prepare(struct dai_data *dd, struct comp_dev *dev) { - struct comp_buffer *buffer_c; int ret; dd->total_data_processed = 0; @@ -1082,9 +1044,7 @@ int dai_common_prepare(struct dai_data *dd, struct comp_dev *dev) } /* clear dma buffer to avoid pop noise */ - buffer_c = buffer_acquire(dd->dma_buffer); - buffer_zero(buffer_c); - buffer_release(buffer_c); + buffer_zero(dd->dma_buffer); /* dma reconfig not required if XRUN handling */ if (dd->xrun) { @@ -1193,11 +1153,7 @@ static int dai_comp_trigger_internal(struct dai_data *dd, struct comp_dev *dev, * this is only supported at capture mode. */ if (dev->direction == SOF_IPC_STREAM_CAPTURE) { - struct comp_buffer *buffer_c = - buffer_acquire(dd->dma_buffer); - - buffer_zero(buffer_c); - buffer_release(buffer_c); + buffer_zero(dd->dma_buffer); } /* only start the DAI if we are not XRUN handling */ @@ -1339,17 +1295,13 @@ static int dai_comp_trigger(struct comp_dev *dev, int cmd) /* report xrun occurrence */ static void dai_report_xrun(struct dai_data *dd, struct comp_dev *dev, uint32_t bytes) { - struct comp_buffer *buf_c = buffer_acquire(dd->local_buffer); - if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { comp_err(dev, "dai_report_xrun(): underrun due to no data available"); - comp_underrun(dev, buf_c, bytes); + comp_underrun(dev, dd->local_buffer, bytes); } else { comp_err(dev, "dai_report_xrun(): overrun due to no space available"); - comp_overrun(dev, buf_c, bytes); + comp_overrun(dev, dd->local_buffer, bytes); } - - buffer_release(buf_c); } /* process and copy stream data from multiple DMA source buffers to sink buffer */ @@ -1357,7 +1309,6 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, struct comp_buffer *multi_endpoint_buffer, int num_endpoints) { - struct comp_buffer *buf_c; uint32_t avail_bytes = UINT32_MAX; uint32_t free_bytes = UINT32_MAX; uint32_t frames; @@ -1369,9 +1320,7 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, if (!num_endpoints || !dd || !multi_endpoint_buffer) return 0; - buf_c = buffer_acquire(dd[0]->dma_buffer); - frame_bytes = audio_stream_frame_bytes(&buf_c->stream); - buffer_release(buf_c); + frame_bytes = audio_stream_frame_bytes(&dd[0]->dma_buffer->stream); direction = dev->direction; @@ -1401,16 +1350,14 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, free_bytes = MIN(free_bytes, stat.free); } - buf_c = buffer_acquire(multi_endpoint_buffer); /* calculate minimum size to copy */ if (direction == SOF_IPC_STREAM_PLAYBACK) { - src_frames = audio_stream_get_avail_frames(&buf_c->stream); + src_frames = audio_stream_get_avail_frames(&multi_endpoint_buffer->stream); sink_frames = free_bytes / frame_bytes; } else { src_frames = avail_bytes / frame_bytes; - sink_frames = audio_stream_get_free_frames(&buf_c->stream); + sink_frames = audio_stream_get_free_frames(&multi_endpoint_buffer->stream); } - buffer_release(buf_c); frames = MIN(src_frames, sink_frames); @@ -1430,10 +1377,8 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, } if (direction == SOF_IPC_STREAM_PLAYBACK) { - buf_c = buffer_acquire(multi_endpoint_buffer); - frame_bytes = audio_stream_frame_bytes(&buf_c->stream); - buffer_stream_invalidate(buf_c, frames * frame_bytes); - buffer_release(buf_c); + frame_bytes = audio_stream_frame_bytes(&multi_endpoint_buffer->stream); + buffer_stream_invalidate(multi_endpoint_buffer, frames * frame_bytes); } for (i = 0; i < num_endpoints; i++) { @@ -1449,9 +1394,7 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, if (status == DMA_CB_STATUS_END) dma_stop(dd[i]->chan->dma->z_dev, dd[i]->chan->index); - buf_c = buffer_acquire(dd[i]->dma_buffer); - copy_bytes = frames * audio_stream_frame_bytes(&buf_c->stream); - buffer_release(buf_c); + copy_bytes = frames * audio_stream_frame_bytes(&dd[i]->dma_buffer->stream); ret = dma_reload(dd[i]->chan->dma->z_dev, dd[i]->chan->index, 0, 0, copy_bytes); if (ret < 0) { dai_report_xrun(dd[i], dev, copy_bytes); @@ -1461,28 +1404,22 @@ int dai_zephyr_multi_endpoint_copy(struct dai_data **dd, struct comp_dev *dev, dai_dma_position_update(dd[i], dev); } - buf_c = buffer_acquire(multi_endpoint_buffer); - frame_bytes = audio_stream_frame_bytes(&buf_c->stream); + frame_bytes = audio_stream_frame_bytes(&multi_endpoint_buffer->stream); if (direction == SOF_IPC_STREAM_PLAYBACK) { - comp_update_buffer_consume(buf_c, frames * frame_bytes); + comp_update_buffer_consume(multi_endpoint_buffer, frames * frame_bytes); } else { - buffer_stream_writeback(buf_c, frames * frame_bytes); - comp_update_buffer_produce(buf_c, frames * frame_bytes); + buffer_stream_writeback(multi_endpoint_buffer, frames * frame_bytes); + comp_update_buffer_produce(multi_endpoint_buffer, frames * frame_bytes); } - buffer_release(buf_c); return 0; } static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev) { - struct comp_buffer *dma_buf = buffer_acquire(dd->dma_buffer); - struct comp_buffer *local_buf; - uint32_t dma_fmt = audio_stream_get_frm_fmt(&dma_buf->stream); + uint32_t dma_fmt = audio_stream_get_frm_fmt(&dd->dma_buffer->stream); uint32_t local_fmt; - buffer_release(dma_buf); - if (dev->direction == SOF_IPC_STREAM_PLAYBACK) dd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, @@ -1492,9 +1429,7 @@ static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev) struct comp_buffer, source_list); - local_buf = buffer_acquire(dd->local_buffer); - local_fmt = audio_stream_get_frm_fmt(&local_buf->stream); - buffer_release(local_buf); + local_fmt = audio_stream_get_frm_fmt(&dd->local_buffer->stream); dd->process = pcm_get_conversion_function(local_fmt, dma_fmt); @@ -1509,7 +1444,6 @@ static void set_new_local_buffer(struct dai_data *dd, struct comp_dev *dev) int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_func *converter) { uint32_t sampling = dd->sampling; - struct comp_buffer *buf_c; struct dma_status stat; uint32_t avail_bytes; uint32_t free_bytes; @@ -1552,11 +1486,9 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun /* calculate minimum size to copy */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - buf_c = buffer_acquire(dd->local_buffer); - src_samples = audio_stream_get_avail_samples(&buf_c->stream); + src_samples = audio_stream_get_avail_samples(&dd->local_buffer->stream); sink_samples = free_bytes / sampling; samples = MIN(src_samples, sink_samples); - buffer_release(buf_c); } else { struct list_item *sink_list; @@ -1567,10 +1499,8 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun * a DAI copier and it is chosen as the dd->local buffer */ if (!converter) { - buf_c = buffer_acquire(dd->local_buffer); - sink_samples = audio_stream_get_free_samples(&buf_c->stream); + sink_samples = audio_stream_get_free_samples(&dd->local_buffer->stream); samples = MIN(samples, sink_samples); - buffer_release(buf_c); } else { /* * In the case of capture DAI's with multiple sink buffers, compute the @@ -1582,15 +1512,13 @@ int dai_common_copy(struct dai_data *dd, struct comp_dev *dev, pcm_converter_fun struct comp_buffer *sink; sink = container_of(sink_list, struct comp_buffer, source_list); - buf_c = buffer_acquire(sink); - sink_dev = buf_c->sink; + sink_dev = sink->sink; if (sink_dev && sink_dev->state == COMP_STATE_ACTIVE) { sink_samples = - audio_stream_get_free_samples(&buf_c->stream); + audio_stream_get_free_samples(&sink->stream); samples = MIN(samples, sink_samples); } - buffer_release(buf_c); } } @@ -1786,7 +1714,6 @@ static uint64_t dai_get_processed_data(struct comp_dev *dev, uint32_t stream_no, #ifdef CONFIG_IPC_MAJOR_4 int dai_zephyr_unbind(struct dai_data *dd, struct comp_dev *dev, void *data) { - struct comp_buffer *local_buf_c; struct ipc4_module_bind_unbind *bu; int buf_id; @@ -1794,12 +1721,10 @@ int dai_zephyr_unbind(struct dai_data *dd, struct comp_dev *dev, void *data) buf_id = IPC4_COMP_ID(bu->extension.r.src_queue, bu->extension.r.dst_queue); if (dd && dd->local_buffer) { - local_buf_c = buffer_acquire(dd->local_buffer); - if (local_buf_c->id == buf_id) { + if (dd->local_buffer->id == buf_id) { comp_dbg(dev, "dai_zephyr_unbind: local_buffer %x unbound", buf_id); dd->local_buffer = NULL; } - buffer_release(local_buf_c); } return 0; diff --git a/src/ipc/ipc3/dai.c b/src/ipc/ipc3/dai.c index 0f323b446192..ab5143f64d13 100644 --- a/src/ipc/ipc3/dai.c +++ b/src/ipc/ipc3/dai.c @@ -107,7 +107,6 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev) { struct ipc_config_dai *dai = &dd->ipc_config; struct sof_ipc_dai_config *config = ipc_from_dai_config(dd->dai_spec_config); - struct comp_buffer *buffer_c; if (!config) { comp_err(dev, "dai_data_config(): no config set for dai %d type %d", @@ -149,11 +148,10 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev) * all formats, such as 8/16/24/32 bits. */ dev->ipc_config.frame_fmt = SOF_IPC_FRAME_S32_LE; - if (dd->dma_buffer) { - buffer_c = buffer_acquire(dd->dma_buffer); - audio_stream_set_frm_fmt(&buffer_c->stream, dev->ipc_config.frame_fmt); - buffer_release(buffer_c); - } + if (dd->dma_buffer) + audio_stream_set_frm_fmt(&dd->dma_buffer->stream, + dev->ipc_config.frame_fmt); + dd->config.burst_elems = dai_get_fifo_depth(dd->dai, dai->direction); /* As with HDA, the DMA channel is assigned in runtime, * not during topology parsing. @@ -174,11 +172,9 @@ int ipc_dai_data_config(struct dai_data *dd, struct comp_dev *dev) break; case SOF_DAI_AMD_DMIC: dev->ipc_config.frame_fmt = SOF_IPC_FRAME_S32_LE; - if (dd->dma_buffer) { - buffer_c = buffer_acquire(dd->dma_buffer); - audio_stream_set_frm_fmt(&buffer_c->stream, dev->ipc_config.frame_fmt); - buffer_release(buffer_c); - } + if (dd->dma_buffer) + audio_stream_set_frm_fmt(&dd->dma_buffer->stream, + dev->ipc_config.frame_fmt); break; case SOF_DAI_AMD_HS: case SOF_DAI_AMD_HS_VIRTUAL: From 04d37beb5522bcfb160962eafbf77048fa870909 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:02:30 +0200 Subject: [PATCH 471/639] host: remove buffer_acquire from host legacy/zephyr remove buffer ops from host-legacy, host-zephyr this is a continuation of changes from commit 4a03699 Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/audio/host-legacy.c | 68 +++++++++-------------------- src/audio/host-zephyr.c | 94 ++++++++++++----------------------------- 2 files changed, 48 insertions(+), 114 deletions(-) diff --git a/src/audio/host-legacy.c b/src/audio/host-legacy.c index 2574e3b54467..83cf3c8cd3c4 100644 --- a/src/audio/host-legacy.c +++ b/src/audio/host-legacy.c @@ -105,16 +105,13 @@ static int host_dma_set_config_and_copy(struct host_data *hd, struct comp_dev *d */ static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd, struct comp_dev *dev) { - struct comp_buffer *buffer_c = buffer_acquire(hd->local_buffer); uint32_t copy_bytes; /* calculate minimum size to copy */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) - copy_bytes = audio_stream_get_free_bytes(&buffer_c->stream); + copy_bytes = audio_stream_get_free_bytes(&hd->local_buffer->stream); else - copy_bytes = audio_stream_get_avail_bytes(&buffer_c->stream); - - buffer_release(buffer_c); + copy_bytes = audio_stream_get_avail_bytes(&hd->local_buffer->stream); /* copy_bytes should be aligned to minimum possible chunk of * data to be copied by dma. @@ -168,17 +165,14 @@ static int host_copy_one_shot(struct host_data *hd, struct comp_dev *dev, copy_c static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd, struct comp_dev *dev) { struct dma_sg_elem *local_elem = hd->config.elem_array.elems; - struct comp_buffer *buffer_c = buffer_acquire(hd->local_buffer); uint32_t copy_bytes; uint32_t split_value; /* calculate minimum size to copy */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) - copy_bytes = audio_stream_get_free_bytes(&buffer_c->stream); + copy_bytes = audio_stream_get_free_bytes(&hd->local_buffer->stream); else - copy_bytes = audio_stream_get_avail_bytes(&buffer_c->stream); - - buffer_release(buffer_c); + copy_bytes = audio_stream_get_avail_bytes(&hd->local_buffer->stream); /* copy_bytes should be aligned to minimum possible chunk of * data to be copied by dma. @@ -239,12 +233,12 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt bool send_ipc = false; if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - source = buffer_acquire(hd->dma_buffer); - sink = buffer_acquire(hd->local_buffer); + source = hd->dma_buffer; + sink = hd->local_buffer; ret = dma_buffer_copy_from(source, sink, hd->process, bytes); } else { - source = buffer_acquire(hd->local_buffer); - sink = buffer_acquire(hd->dma_buffer); + source = hd->local_buffer; + sink = hd->dma_buffer; ret = dma_buffer_copy_to(source, sink, hd->process, bytes); } @@ -257,9 +251,6 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt audio_stream_get_free_samples(&sink->stream) * audio_stream_frame_bytes(&sink->stream)); - buffer_release(sink); - buffer_release(source); - if (ret < 0) return; @@ -372,7 +363,6 @@ static void host_dma_cb(void *arg, enum notify_id type, void *data) */ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev *dev) { - struct comp_buffer *buffer_c; uint32_t avail_bytes = 0; uint32_t free_bytes = 0; uint32_t copy_bytes = 0; @@ -387,28 +377,24 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev return 0; } - buffer_c = buffer_acquire(hd->local_buffer); - /* calculate minimum size to copy */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { /* limit bytes per copy to one period for the whole pipeline * in order to avoid high load spike */ - free_bytes = audio_stream_get_free_bytes(&buffer_c->stream); + free_bytes = audio_stream_get_free_bytes(&hd->local_buffer->stream); copy_bytes = MIN(hd->period_bytes, MIN(avail_bytes, free_bytes)); if (!copy_bytes) comp_info(dev, "no bytes to copy, %d free in buffer, %d available in DMA", free_bytes, avail_bytes); } else { - avail_bytes = audio_stream_get_avail_bytes(&buffer_c->stream); + avail_bytes = audio_stream_get_avail_bytes(&hd->local_buffer->stream); copy_bytes = MIN(avail_bytes, free_bytes); if (!copy_bytes) comp_info(dev, "no bytes to copy, %d avail in buffer, %d free in DMA", avail_bytes, free_bytes); } - buffer_release(buffer_c); - /* copy_bytes should be aligned to minimum possible chunk of * data to be copied by dma. */ @@ -446,7 +432,6 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal static int create_local_elems(struct host_data *hd, struct comp_dev *dev, uint32_t buffer_count, uint32_t buffer_bytes) { - struct comp_buffer *dma_buf_c; struct dma_sg_elem_array *elem_array; uint32_t dir; int err; @@ -469,11 +454,9 @@ static int create_local_elems(struct host_data *hd, struct comp_dev *dev, uint32 elem_array = &hd->config.elem_array; } - dma_buf_c = buffer_acquire(hd->dma_buffer); err = dma_sg_alloc(elem_array, SOF_MEM_ZONE_RUNTIME, dir, buffer_count, buffer_bytes, - (uintptr_t)(audio_stream_get_addr(&dma_buf_c->stream)), 0); - buffer_release(dma_buf_c); + (uintptr_t)(audio_stream_get_addr(&hd->dma_buffer->stream)), 0); if (err < 0) { comp_err(dev, "create_local_elems(): dma_sg_alloc() failed"); return err; @@ -690,8 +673,6 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, struct sof_ipc_stream_params *params, notifier_callback_t cb) { struct dma_sg_config *config = &hd->config; - struct comp_buffer *host_buf_c; - struct comp_buffer *dma_buf_c; uint32_t period_count; uint32_t period_bytes; uint32_t buffer_size; @@ -740,10 +721,9 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, hd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - host_buf_c = buffer_acquire(hd->local_buffer); period_bytes = dev->frames * - audio_stream_frame_bytes(&host_buf_c->stream); + audio_stream_frame_bytes(&hd->local_buffer->stream); if (!period_bytes) { comp_err(dev, "host_params(): invalid period_bytes"); @@ -778,9 +758,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, * but we have to write back caches after we finish anyway */ if (hd->dma_buffer) { - dma_buf_c = buffer_acquire(hd->dma_buffer); - err = buffer_set_size(dma_buf_c, buffer_size, addr_align); - buffer_release(dma_buf_c); + err = buffer_set_size(hd->dma_buffer, buffer_size, addr_align); if (err < 0) { comp_err(dev, "host_params(): buffer_set_size() failed, buffer_size = %u", buffer_size); @@ -795,9 +773,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, goto out; } - dma_buf_c = buffer_acquire(hd->dma_buffer); - buffer_set_params(dma_buf_c, params, BUFFER_UPDATE_FORCE); - buffer_release(dma_buf_c); + buffer_set_params(hd->dma_buffer, params, BUFFER_UPDATE_FORCE); } /* create SG DMA elems for local DMA buffer */ @@ -806,8 +782,8 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, goto out; /* set up DMA configuration - copy in sample bytes. */ - config->src_width = audio_stream_sample_bytes(&host_buf_c->stream); - config->dest_width = audio_stream_sample_bytes(&host_buf_c->stream); + config->src_width = audio_stream_sample_bytes(&hd->local_buffer->stream); + config->dest_width = audio_stream_sample_bytes(&hd->local_buffer->stream); config->cyclic = 0; config->irq_disabled = pipeline_is_timer_driven(dev->pipeline); config->is_scheduling_source = comp_is_scheduling_source(dev); @@ -851,11 +827,11 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, host_copy_normal; /* set processing function */ - hd->process = pcm_get_conversion_function(audio_stream_get_frm_fmt(&host_buf_c->stream), - audio_stream_get_frm_fmt(&host_buf_c->stream)); + hd->process = + pcm_get_conversion_function(audio_stream_get_frm_fmt(&hd->local_buffer->stream), + audio_stream_get_frm_fmt(&hd->local_buffer->stream)); out: - buffer_release(host_buf_c); hd->cb_dev = dev; @@ -886,11 +862,7 @@ static int host_params(struct comp_dev *dev, int host_common_prepare(struct host_data *hd) { - struct comp_buffer *buf_c = buffer_acquire(hd->dma_buffer); - - buffer_zero(buf_c); - buffer_release(buf_c); - + buffer_zero(hd->dma_buffer); return 0; } diff --git a/src/audio/host-zephyr.c b/src/audio/host-zephyr.c index a2918b31e1b6..4016a8be82a4 100644 --- a/src/audio/host-zephyr.c +++ b/src/audio/host-zephyr.c @@ -109,18 +109,13 @@ static int host_dma_set_config_and_copy(struct host_data *hd, struct comp_dev *d static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd) { struct comp_buffer *buffer = hd->local_buffer; - struct comp_buffer *buffer_c; uint32_t copy_bytes; - buffer_c = buffer_acquire(buffer); - /* calculate minimum size to copy */ if (hd->ipc_host.direction == SOF_IPC_STREAM_PLAYBACK) - copy_bytes = audio_stream_get_free_bytes(&buffer_c->stream); + copy_bytes = audio_stream_get_free_bytes(&buffer->stream); else - copy_bytes = audio_stream_get_avail_bytes(&buffer_c->stream); - - buffer_release(buffer_c); + copy_bytes = audio_stream_get_avail_bytes(&buffer->stream); /* copy_bytes should be aligned to minimum possible chunk of * data to be copied by dma. @@ -175,19 +170,14 @@ static uint32_t host_get_copy_bytes_one_shot(struct host_data *hd) { struct dma_sg_elem *local_elem = hd->config.elem_array.elems; struct comp_buffer *buffer = hd->local_buffer; - struct comp_buffer *buffer_c; uint32_t copy_bytes; uint32_t split_value; - buffer_c = buffer_acquire(buffer); - /* calculate minimum size to copy */ if (hd->ipc_host.direction == SOF_IPC_STREAM_PLAYBACK) - copy_bytes = audio_stream_get_free_bytes(&buffer_c->stream); + copy_bytes = audio_stream_get_free_bytes(&buffer->stream); else - copy_bytes = audio_stream_get_avail_bytes(&buffer_c->stream); - - buffer_release(buffer_c); + copy_bytes = audio_stream_get_avail_bytes(&buffer->stream); /* copy_bytes should be aligned to minimum possible chunk of * data to be copied by dma. @@ -248,18 +238,15 @@ void host_common_update(struct host_data *hd, struct comp_dev *dev, uint32_t byt bool send_ipc = false; if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { - source = buffer_acquire(hd->dma_buffer); - sink = buffer_acquire(hd->local_buffer); + source = hd->dma_buffer; + sink = hd->local_buffer; ret = dma_buffer_copy_from(source, sink, hd->process, bytes); } else { - source = buffer_acquire(hd->local_buffer); - sink = buffer_acquire(hd->dma_buffer); + source = hd->local_buffer; + sink = hd->dma_buffer; ret = dma_buffer_copy_to(source, sink, hd->process, bytes); } - buffer_release(sink); - buffer_release(source); - if (ret < 0) { comp_err(dev, "host_common_update() copy failed, dir %d bytes %d return: %d", dev->direction, bytes, ret); @@ -373,7 +360,6 @@ static void host_dma_cb(struct comp_dev *dev, size_t bytes) static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev *dev) { struct comp_buffer *buffer = hd->local_buffer; - struct comp_buffer *buffer_c; struct dma_status dma_stat; uint32_t avail_samples; uint32_t free_samples; @@ -392,14 +378,12 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev dma_sample_bytes = hd->config.src_width; - buffer_c = buffer_acquire(buffer); - /* calculate minimum size to copy */ if (dev->direction == SOF_IPC_STREAM_PLAYBACK) { avail_samples = (dma_stat.pending_length - hd->partial_size) / dma_sample_bytes; - free_samples = audio_stream_get_free_samples(&buffer_c->stream); + free_samples = audio_stream_get_free_samples(&buffer->stream); } else { - avail_samples = audio_stream_get_avail_samples(&buffer_c->stream); + avail_samples = audio_stream_get_avail_samples(&buffer->stream); free_samples = (dma_stat.free - hd->partial_size) / dma_sample_bytes; } @@ -416,8 +400,6 @@ static uint32_t host_get_copy_bytes_normal(struct host_data *hd, struct comp_dev comp_info(dev, "no bytes to copy, available samples: %d, free_samples: %d", avail_samples, free_samples); - buffer_release(buffer_c); - /* dma_copy_bytes should be aligned to minimum possible chunk of * data to be copied by dma. */ @@ -498,7 +480,6 @@ static int host_copy_normal(struct host_data *hd, struct comp_dev *dev, copy_cal static int create_local_elems(struct host_data *hd, struct comp_dev *dev, uint32_t buffer_count, uint32_t buffer_bytes, uint32_t direction) { - struct comp_buffer *dma_buf_c; struct dma_sg_elem_array *elem_array; uint32_t dir; int err; @@ -521,11 +502,9 @@ static int create_local_elems(struct host_data *hd, struct comp_dev *dev, uint32 elem_array = &hd->config.elem_array; } - dma_buf_c = buffer_acquire(hd->dma_buffer); err = dma_sg_alloc(elem_array, SOF_MEM_ZONE_RUNTIME, dir, buffer_count, buffer_bytes, - (uintptr_t)audio_stream_get_addr(&dma_buf_c->stream), 0); - buffer_release(dma_buf_c); + (uintptr_t)audio_stream_get_addr(&hd->dma_buffer->stream), 0); if (err < 0) { comp_err(dev, "create_local_elems(): dma_sg_alloc() failed"); return err; @@ -745,8 +724,6 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, struct dma_sg_elem *sg_elem; struct dma_config *dma_cfg = &hd->z_config; struct dma_block_config dma_block_cfg; - struct comp_buffer *host_buf_c; - struct comp_buffer *dma_buf_c; uint32_t period_count; uint32_t period_bytes; uint32_t buffer_size; @@ -795,14 +772,12 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, hd->local_buffer = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); - host_buf_c = buffer_acquire(hd->local_buffer); period_bytes = dev->frames * get_frame_bytes(params->frame_fmt, params->channels); if (!period_bytes) { comp_err(dev, "host_params(): invalid period_bytes"); - err = -EINVAL; - goto out; + return -EINVAL; } /* determine source and sink buffer elements */ @@ -834,13 +809,11 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, * but we have to write back caches after we finish anywae */ if (hd->dma_buffer) { - dma_buf_c = buffer_acquire(hd->dma_buffer); - err = buffer_set_size(dma_buf_c, buffer_size, addr_align); - buffer_release(dma_buf_c); + err = buffer_set_size(hd->dma_buffer, buffer_size, addr_align); if (err < 0) { comp_err(dev, "host_params(): buffer_set_size() failed, buffer_size = %u", buffer_size); - goto out; + return err; } } else { /* allocate not shared buffer */ @@ -848,34 +821,31 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, addr_align, false); if (!hd->dma_buffer) { comp_err(dev, "host_params(): failed to alloc dma buffer"); - err = -ENOMEM; - goto out; + return -ENOMEM; } - dma_buf_c = buffer_acquire(hd->dma_buffer); - buffer_set_params(dma_buf_c, params, BUFFER_UPDATE_FORCE); + buffer_set_params(hd->dma_buffer, params, BUFFER_UPDATE_FORCE); /* set processing function */ if (params->direction == SOF_IPC_STREAM_CAPTURE) hd->process = pcm_get_conversion_function( - audio_stream_get_frm_fmt(&host_buf_c->stream), - audio_stream_get_frm_fmt(&dma_buf_c->stream)); + audio_stream_get_frm_fmt(&hd->local_buffer->stream), + audio_stream_get_frm_fmt(&hd->dma_buffer->stream)); else hd->process = pcm_get_conversion_function( - audio_stream_get_frm_fmt(&dma_buf_c->stream), - audio_stream_get_frm_fmt(&host_buf_c->stream)); + audio_stream_get_frm_fmt(&hd->dma_buffer->stream), + audio_stream_get_frm_fmt(&hd->local_buffer->stream)); - config->src_width = audio_stream_sample_bytes(&dma_buf_c->stream); + config->src_width = audio_stream_sample_bytes(&hd->dma_buffer->stream); config->dest_width = config->src_width; - hd->dma_buffer_size = audio_stream_get_size(&dma_buf_c->stream); - buffer_release(dma_buf_c); + hd->dma_buffer_size = audio_stream_get_size(&hd->dma_buffer->stream); } /* create SG DMA elems for local DMA buffer */ err = create_local_elems(hd, dev, period_count, buffer_size / period_count, params->direction); if (err < 0) - goto out; + return err; /* set up DMA configuration - copy in sample bytes. */ config->cyclic = 0; @@ -893,8 +863,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, channel = dma_request_channel(hd->dma->z_dev, &hda_chan); if (channel < 0) { comp_err(dev, "host_params(): requested channel %d is busy", hda_chan); - err = -ENODEV; - goto out; + return -ENODEV; } hd->chan = &hd->dma->chan[channel]; @@ -948,7 +917,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, comp_err(dev, "host_params(): dma_config() failed"); dma_release_channel(hd->dma->z_dev, hd->chan->index); hd->chan = NULL; - goto out; + return err; } err = dma_get_attribute(hd->dma->z_dev, DMA_ATTR_COPY_ALIGNMENT, @@ -956,8 +925,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, if (err < 0) { comp_err(dev, "host_params(): dma_get_attribute()"); - - goto out; + return err; } /* minimal copied data shouldn't be less than alignment */ @@ -970,9 +938,7 @@ int host_common_params(struct host_data *hd, struct comp_dev *dev, hd->copy = hd->copy_type == COMP_COPY_ONE_SHOT ? host_copy_one_shot : host_copy_normal; -out: - buffer_release(host_buf_c); - return err; + return 0; } static int host_params(struct comp_dev *dev, @@ -994,11 +960,7 @@ static int host_params(struct comp_dev *dev, int host_common_prepare(struct host_data *hd) { - struct comp_buffer *buf_c = buffer_acquire(hd->dma_buffer); - - buffer_zero(buf_c); - buffer_release(buf_c); - + buffer_zero(hd->dma_buffer); return 0; } From c274607de0f239b9e0d294ca7b69b05a36f726d0 Mon Sep 17 00:00:00 2001 From: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> Date: Fri, 15 Sep 2023 20:10:41 +0200 Subject: [PATCH 472/639] buffer: cosmetic change in buffer.h remove one unneeded newline Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com> --- src/include/sof/audio/buffer.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index 6b08b0f3af91..d929fd9971b5 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -249,8 +249,7 @@ void buffer_detach(struct comp_buffer *buffer, struct list_item *head, int dir); static inline struct comp_dev *buffer_get_comp(struct comp_buffer *buffer, int dir) { - struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer->sink : - buffer->source; + struct comp_dev *comp = dir == PPL_DIR_DOWNSTREAM ? buffer->sink : buffer->source; return comp; } From deb7a097e3cf0fd0c71315aa9083493931e6ea9e Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Tue, 26 Sep 2023 15:50:48 +0800 Subject: [PATCH 473/639] github action: remove duplicate build for TGL/TGL-H At the beginning, we have two build jobs in github action to build IPC3 and IPC4 firmware for TGL/TGL-H. The PR https://github.com/thesofproject/sof/pull/8048 switches cAVS2.5 configs to use IPC4 by default and empties the cAVS2.5 overlay files. After the change, the xtensa-build-zephyr.py script is building the same IPC4 firmware with or without '-i IPC4' option. So we have two jobs running different build command but build the same IPC4 firmware. Recently, commit 5004d0fe1e74 ("zephyr.yml: remove ipc option for zephyr build") removes '-i IPC4' option in github action for TGL/TGL-H IPC4 build. So we have duplicated jobs to build firmware for TGL and TGL-H in the end. This patch removes the duplicated build job which previously is used to build IPC3 firmware for TGL/TGL-H and obsolete comments. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- .github/workflows/zephyr.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index af0b3e553d74..25af4e96cd8a 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -107,7 +107,6 @@ jobs: IPC_platforms: [ # - IPC3 default imx8 imx8x imx8m, - tgl tgl-h, # UNSUPPORTED! Will be removed # - IPC4 default mtl, lnl, # Temporary testbed for Zephyr development. @@ -213,10 +212,8 @@ jobs: platforms: [ # - IPC3 default imx8 imx8x imx8m, - tgl tgl-h, # UNSUPPORTED! Will be removed # - IPC4 default mtl, - # Very few IPC3 platforms support IPC4 too. tgl tgl-h, ] build_opts: [""] From 545ab19ff5f8b4760c2ef79ebd25fd1299cebca9 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Mon, 18 Sep 2023 18:56:19 -0700 Subject: [PATCH 474/639] ipc4: logging: fix library build Fix build with CONFIG_LIBRARY. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/include/ipc4/logging.h | 10 ++++++++++ src/ipc/ipc4/logging.c | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/include/ipc4/logging.h b/src/include/ipc4/logging.h index 55f4a5edbffc..bbb913677231 100644 --- a/src/include/ipc4/logging.h +++ b/src/include/ipc4/logging.h @@ -8,10 +8,20 @@ #define SOF_IPC4_LOGGING_MTRACE_PAGE_SIZE 0x1000 +#if CONFIG_LIBRARY +static inline int ipc4_logging_enable_logs(bool first_block, + bool last_block, + uint32_t data_offset_or_size, + const char *data) +{ + return 0; +} +#else int ipc4_logging_enable_logs(bool first_block, bool last_block, uint32_t data_offset_or_size, const char *data); +#endif int ipc4_logging_shutdown(void); diff --git a/src/ipc/ipc4/logging.c b/src/ipc/ipc4/logging.c index 3b06dc1a2fc7..15ee85560f4b 100644 --- a/src/ipc/ipc4/logging.c +++ b/src/ipc/ipc4/logging.c @@ -14,9 +14,10 @@ #include <ipc4/base_fw.h> #include <ipc4/error_status.h> #include <ipc4/logging.h> +#if !CONFIG_LIBRARY #include <zephyr/logging/log_backend.h> #include <zephyr/logging/log.h> - +#endif #if CONFIG_LOG_BACKEND_SOF_PROBE #include <sof/probe/probe.h> #endif From 72553fa5e5c3bc1858284cc2d0db3cc19ea9c382 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Tue, 19 Sep 2023 09:04:52 -0700 Subject: [PATCH 475/639] ipc4: handler: Add compier fallthrough to prevent compilation error Add the fallthrough to prevent the error seen with shared library build: "handler.c:312:20: error: this statement may fall through [-Werror=implicit-fallthrough=]" Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/ipc/ipc4/handler.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index 24cc4635fb7b..c0d3ed2c0a5d 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -312,6 +312,7 @@ int ipc4_pipeline_prepare(struct ipc_comp_dev *ppl_icd, uint32_t cmd) case SOF_IPC4_PIPELINE_STATE_EOS: if (status != COMP_STATE_ACTIVE) return IPC4_INVALID_REQUEST; + COMPILER_FALLTHROUGH; case SOF_IPC4_PIPELINE_STATE_SAVED: case SOF_IPC4_PIPELINE_STATE_ERROR_STOP: default: From 640f71f45f510390d29319c5faa3db6af8c90215 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Tue, 19 Sep 2023 12:03:46 -0700 Subject: [PATCH 476/639] ipc4: Add support for IPC4 shared library Add support for the SOF shared library modules to work with IPC4. The main changes in the patch involve support for triggering pipelines in the IPC context when running on the host and support for fetch the component driver with the INIT_MODULE_INSTANCE IPC. Currently, we use a hardcoded table to match the module ID with UUIDs. This will be modified in the future to make it scale for all modules. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/audio/pipeline/pipeline-graph.c | 2 + src/audio/pipeline/pipeline-stream.c | 32 +++++++++++++ src/ipc/ipc4/handler.c | 63 ++++++++++++++++++++++---- src/ipc/ipc4/helper.c | 67 +++++++++++++++++++++++++++- 4 files changed, 154 insertions(+), 10 deletions(-) diff --git a/src/audio/pipeline/pipeline-graph.c b/src/audio/pipeline/pipeline-graph.c index 8b64e5f9527f..82fe49bbed20 100644 --- a/src/audio/pipeline/pipeline-graph.c +++ b/src/audio/pipeline/pipeline-graph.c @@ -227,7 +227,9 @@ int pipeline_free(struct pipeline *p) /* remove from any scheduling */ if (p->pipe_task) { +#if !CONFIG_LIBRARY || UNIT_TEST schedule_task_free(p->pipe_task); +#endif rfree(p->pipe_task); } diff --git a/src/audio/pipeline/pipeline-stream.c b/src/audio/pipeline/pipeline-stream.c index 6fe795cf54f5..547b3198f311 100644 --- a/src/audio/pipeline/pipeline-stream.c +++ b/src/audio/pipeline/pipeline-stream.c @@ -147,6 +147,37 @@ int pipeline_copy(struct pipeline *p) return ret; } +#if CONFIG_LIBRARY && !CONFIG_LIBRARY_STATIC +/* trigger pipeline immediately in IPC context. TODO: Add support for XRUN */ +int pipeline_trigger(struct pipeline *p, struct comp_dev *host, int cmd) +{ + int ret; + + pipe_info(p, "pipe trigger cmd %d", cmd); + + p->trigger.aborted = false; + + ret = pipeline_trigger_run(p, host, cmd); + if (ret < 0) + return ret; + + switch (cmd) { + case COMP_TRIGGER_PRE_START: + case COMP_TRIGGER_START: + case COMP_TRIGGER_PRE_RELEASE: + p->status = COMP_STATE_ACTIVE; + break; + case COMP_TRIGGER_STOP: + case COMP_TRIGGER_PAUSE: + p->status = COMP_STATE_PAUSED; + break; + default: + break; + } + + return 0; +} +#else /* only collect scheduling components */ static int pipeline_comp_list(struct comp_dev *current, struct comp_buffer *calling_buf, @@ -304,6 +335,7 @@ int pipeline_trigger(struct pipeline *p, struct comp_dev *host, int cmd) return 0; } +#endif /* Runs in IPC or in pipeline task context */ static int pipeline_comp_trigger(struct comp_dev *current, diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index c0d3ed2c0a5d..209bddf65097 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -70,6 +70,56 @@ static struct ipc_msg msg_reply = {0, 0, 0, 0, LIST_INIT(msg_reply.list)}; static struct ipc_msg msg_notify = {0, 0, 0, 0, LIST_INIT(msg_notify.list)}; +#if CONFIG_LIBRARY +static inline struct ipc4_message_request *ipc4_get_message_request(void) +{ + struct ipc *ipc = ipc_get(); + + return (struct ipc4_message_request *)ipc->comp_data; +} + +static inline void ipc4_send_reply(struct ipc4_message_reply *reply) +{ + struct ipc *ipc = ipc_get(); + + memcpy((char *)ipc->comp_data, reply, sizeof(*reply)); +} + +static inline const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data(void) +{ + const struct ipc4_pipeline_set_state_data *ppl_data; + struct ipc *ipc = ipc_get(); + + ppl_data = (const struct ipc4_pipeline_set_state_data *)ipc->comp_data; + + return ppl_data; +} +#else +static inline struct ipc4_message_request *ipc4_get_message_request(void) +{ + /* ignoring _hdr as it does not contain valid data in IPC4/IDC case */ + return ipc_from_hdr(&msg_data.msg_in); +} + +static inline void ipc4_send_reply(struct ipc4_message_reply *reply) +{ + struct ipc *ipc = ipc_get(); + char *data = ipc->comp_data; + + ipc_msg_send(&msg_reply, data, true); +} + +static inline const struct ipc4_pipeline_set_state_data *ipc4_get_pipeline_data(void) +{ + const struct ipc4_pipeline_set_state_data *ppl_data; + + ppl_data = (const struct ipc4_pipeline_set_state_data *)MAILBOX_HOSTBOX_BASE; + dcache_invalidate_region((__sparse_force void __sparse_cache *)ppl_data, + sizeof(*ppl_data)); + + return ppl_data; +} +#endif /* * Global IPC Operations. */ @@ -477,7 +527,8 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4) struct ipc4_pipeline_set_state state; struct ipc_comp_dev *ppl_icd; struct ipc *ipc = ipc_get(); - uint32_t cmd, ppl_count, id; + uint32_t cmd, ppl_count; + uint32_t id = 0; const uint32_t *ppl_id; bool use_idc = false; uint32_t idx; @@ -487,10 +538,8 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4) state.primary.dat = ipc4->primary.dat; state.extension.dat = ipc4->extension.dat; cmd = state.primary.r.ppl_state; + ppl_data = ipc4_get_pipeline_data(); - ppl_data = (const struct ipc4_pipeline_set_state_data *)MAILBOX_HOSTBOX_BASE; - dcache_invalidate_region((__sparse_force void __sparse_cache *)ppl_data, - sizeof(*ppl_data)); if (state.extension.r.multi_ppl) { ppl_count = ppl_data->pipelines_count; ppl_id = ppl_data->ppl_id; @@ -1350,8 +1399,7 @@ void ipc_msg_reply(struct sof_ipc_reply *reply) void ipc_cmd(struct ipc_cmd_hdr *_hdr) { - /* ignoring _hdr as it does not contain valid data in IPC4/IDC case */ - struct ipc4_message_request *in = ipc_from_hdr(&msg_data.msg_in); + struct ipc4_message_request *in = ipc4_get_message_request(); enum ipc4_message_target target; int err; @@ -1387,7 +1435,6 @@ void ipc_cmd(struct ipc_cmd_hdr *_hdr) /* FW sends an ipc message to host if request bit is clear */ if (in->primary.r.rsp == SOF_IPC4_MESSAGE_DIR_MSG_REQUEST) { struct ipc *ipc = ipc_get(); - char *data = ipc->comp_data; struct ipc4_message_reply reply; /* Process flow and time stamp for IPC4 msg processed on secondary core : @@ -1474,6 +1521,6 @@ void ipc_cmd(struct ipc_cmd_hdr *_hdr) tr_dbg(&ipc_tr, "tx-reply\t: %#x|%#x", msg_reply.header, msg_reply.extension); - ipc_msg_send(&msg_reply, data, true); + ipc4_send_reply(&reply); } } diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index d01efe6f4fc4..91babe75b97d 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -74,12 +74,28 @@ void ipc_build_trace_posn(struct sof_ipc_dma_trace_posn *posn) posn->rhdr.hdr.size = 0; } +#if CONFIG_LIBRARY +static inline char *ipc4_get_comp_new_data(void) +{ + struct ipc *ipc = ipc_get(); + char *data = (char *)ipc->comp_data + sizeof(struct ipc4_module_init_instance); + + return data; +} +#else +static inline char *ipc4_get_comp_new_data(void) +{ + return (char *)MAILBOX_HOSTBOX_BASE; +} +#endif + struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_init) { struct comp_ipc_config ipc_config; const struct comp_driver *drv; struct comp_dev *dev; uint32_t comp_id; + char *data; comp_id = IPC4_COMP_ID(module_init->primary.r.module_id, module_init->primary.r.instance_id); @@ -119,15 +135,17 @@ struct comp_dev *comp_new_ipc4(struct ipc4_module_init_instance *module_init) dcache_invalidate_region((__sparse_force void __sparse_cache *)MAILBOX_HOSTBOX_BASE, MAILBOX_HOSTBOX_SIZE); + data = ipc4_get_comp_new_data(); if (drv->type == SOF_COMP_MODULE_ADAPTER) { const struct ipc_config_process spec = { - .data = (const unsigned char *)MAILBOX_HOSTBOX_BASE, + .data = (const unsigned char *)data, /* spec_size in IPC4 is in DW. Convert to bytes. */ .size = module_init->extension.r.param_block_size * sizeof(uint32_t), }; + dev = drv->ops.create(drv, &ipc_config, (const void *)&spec); } else { - dev = drv->ops.create(drv, &ipc_config, (const void *)MAILBOX_HOSTBOX_BASE); + dev = drv->ops.create(drv, &ipc_config, (const void *)data); } if (!dev) return NULL; @@ -717,6 +735,47 @@ const struct comp_driver *ipc4_get_drv(uint8_t *uuid) return drv; } +#if CONFIG_LIBRARY +struct ipc4_module_uuid { + int module_id; + struct sof_uuid uuid; +}; + +/* Hardcoded table mapping UUIDs with module ID's. TODO: replace this with a scalable solution */ +static const struct ipc4_module_uuid uuid_map[] = { + {0x6, {.a = 0x61bca9a8, .b = 0x18d0, .c = 0x4a18, + .d = { 0x8e, 0x7b, 0x26, 0x39, 0x21, 0x98, 0x04, 0xb7 }}}, /* gain */ + {0x2, {.a = 0x39656eb2, .b = 0x3b71, .c = 0x4049, + .d = { 0x8d, 0x3f, 0xf9, 0x2c, 0xd5, 0xc4, 0x3c, 0x09 }}}, /* mixin */ + {0x3, {.a = 0x3c56505a, .b = 0x24d7, .c = 0x418f, + .d = { 0xbd, 0xdc, 0xc1, 0xf5, 0xa3, 0xac, 0x2a, 0xe0 }}}, /* mixout */ + {0x96, {.a = 0xe2b6031c, .b = 0x47e8, .c = 0x11ed, + .d = { 0x07, 0xa9, 0x7f, 0x80, 0x1b, 0x6e, 0xfa, 0x6c }}}, /* host SHM write */ + {0x98, {.a = 0xdabe8814, .b = 0x47e8, .c = 0x11ed, + .d = { 0xa5, 0x8b, 0xb3, 0x09, 0x97, 0x4f, 0xec, 0xce }}}, /* host SHM read */ + {0x97, {.a = 0x72cee996, .b = 0x39f2, .c = 0x11ed, + .d = { 0xa0, 0x8f, 0x97, 0xfc, 0xc4, 0x2e, 0xaa, 0xeb }}}, /* ALSA aplay */ + {0x99, {.a = 0x66def9f0, .b = 0x39f2, .c = 0x11ed, + .d = { 0xf7, 0x89, 0xaf, 0x98, 0xa6, 0x44, 0x0c, 0xc4 }}}, /* ALSA arecord */ +}; + +static const struct comp_driver *ipc4_library_get_drv(int module_id) +{ + const struct ipc4_module_uuid *mod_uuid; + int i; + + for (i = 0; i < ARRAY_SIZE(uuid_map); i++) { + mod_uuid = &uuid_map[i]; + + if (mod_uuid->module_id == module_id) + return ipc4_get_drv((uint8_t *)&mod_uuid->uuid); + } + + tr_err(&comp_tr, "ipc4_library_get_drv(): Unsupported module ID %#x\n", module_id); + return NULL; +} +#endif + const struct comp_driver *ipc4_get_comp_drv(int module_id) { struct sof_man_fw_desc *desc = NULL; @@ -724,6 +783,10 @@ const struct comp_driver *ipc4_get_comp_drv(int module_id) struct sof_man_module *mod; int entry_index; +#if CONFIG_LIBRARY + return ipc4_library_get_drv(module_id); +#endif + #ifdef RIMAGE_MANIFEST desc = (struct sof_man_fw_desc *)IMR_BOOT_LDR_MANIFEST_BASE; #else From aa981cc7a4e1a47faaf01c9d22251595dbf133cd Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Tue, 19 Sep 2023 12:17:01 -0700 Subject: [PATCH 477/639] arch: host: configs: Add config for alsa plugin Add the deconfig file for building the SOF ALSA plugin with IPC4. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- src/arch/host/configs/plugin_ipc4_defconfig | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/arch/host/configs/plugin_ipc4_defconfig diff --git a/src/arch/host/configs/plugin_ipc4_defconfig b/src/arch/host/configs/plugin_ipc4_defconfig new file mode 100644 index 000000000000..43529dc87726 --- /dev/null +++ b/src/arch/host/configs/plugin_ipc4_defconfig @@ -0,0 +1,22 @@ +CONFIG_IPC_MAJOR_4=y +CONFIG_LIBRARY=y +CONFIG_TRACEV=y +CONFIG_DEBUG_MEMORY_USAGE_SCAN=n +CONFIG_COMP_CROSSOVER=y +CONFIG_COMP_DRC=y +CONFIG_COMP_MULTIBAND_DRC=y +CONFIG_COMP_SRC=y +CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y +CONFIG_COMP_MFCC=y +CONFIG_COMP_GAIN=y +CONFIG_COMP_VOLUME_WINDOWS_FADE=y +CONFIG_COMP_MODULES_SO=y +CONFIG_COMP_MODULE_ADAPTER=y +CONFIG_COMP_MIXER=y +CONFIG_IPC4_GATEWAY=n +CONFIG_COMP_DAI_GROUP=n +CONFIG_FORMAT_S16LE=y +CONFIG_FORMAT_S32LE=y +CONFIG_FORMAT_S24LE=y +CONFIG_COMP_PEAK_VOL=n +CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD=y From 7266a73cbfb6fddb3d303336dd5e68963ddb4256 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Tue, 19 Sep 2023 12:42:21 -0700 Subject: [PATCH 478/639] tplg_parser: topology: Introduce new structures and update existing ones for IPC4 Update the struct tplg_comp_info to add some new fields needed for parsing module information for IPC4. Also, introduce a couple of new structures to save the pipeline info and fix the path to the peak_volum header. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- tools/testbench/CMakeLists.txt | 1 + tools/tplg_parser/CMakeLists.txt | 1 + .../include/tplg_parser/topology.h | 33 +++++++++++++++++-- tools/tplg_parser/pga.c | 2 +- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/tools/testbench/CMakeLists.txt b/tools/testbench/CMakeLists.txt index f68f6418399f..3d4e622c08bf 100644 --- a/tools/testbench/CMakeLists.txt +++ b/tools/testbench/CMakeLists.txt @@ -27,6 +27,7 @@ set(sof_binary_directory "${PROJECT_BINARY_DIR}/sof_ep/build") set(config_h ${sof_binary_directory}/library_autoconfig.h) target_include_directories(testbench PRIVATE "${sof_source_directory}/src/platform/library/include") +target_include_directories(testbench PRIVATE "${sof_source_directory}/src/audio") # Configuration time, make copy configure_file(${default_asoc_h} ${CMAKE_CURRENT_BINARY_DIR}/include/alsa/sound/asoc.h) diff --git a/tools/tplg_parser/CMakeLists.txt b/tools/tplg_parser/CMakeLists.txt index fbe1b6669ee4..f27dd8297d14 100644 --- a/tools/tplg_parser/CMakeLists.txt +++ b/tools/tplg_parser/CMakeLists.txt @@ -39,6 +39,7 @@ sof_append_relative_path_definitions(sof_tplg_parser) target_include_directories(sof_tplg_parser PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/include) +target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/arch/host/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/platform/library/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio) diff --git a/tools/tplg_parser/include/tplg_parser/topology.h b/tools/tplg_parser/include/tplg_parser/topology.h index 83ddce2ced02..806af047e6f2 100644 --- a/tools/tplg_parser/include/tplg_parser/topology.h +++ b/tools/tplg_parser/include/tplg_parser/topology.h @@ -11,13 +11,16 @@ #define _COMMON_TPLG_H #include <stdbool.h> -#include<stdarg.h> +#include <stdarg.h> #include <stddef.h> #include <ipc/dai.h> #include <ipc/topology.h> #include <ipc/stream.h> +#include <ipc4/copier.h> +#include <ipc4/module.h> #include <kernel/tokens.h> #include <sof/list.h> +#include <volume/peak_volume.h> #ifdef TPLG_DEBUG #define DEBUG_MAX_LENGTH 256 @@ -46,6 +49,7 @@ static inline void tplg_debug(char *fmt, ...) {} #define TPLG_PARSER_SOF_DEV 1 #define TPLG_PARSER_FUZZER_DEV 2 +#define TPLG_MAX_PCM_PIPELINES 16 #define MOVE_POINTER_BY_BYTES(p, b) ((typeof(p))((uint8_t *)(p) + (b))) @@ -95,15 +99,31 @@ struct sof_ipc4_available_audio_format { uint32_t num_output_formats; }; +struct tplg_pipeline_info { + int id; + int instance_id; + int usage_count; + int mem_usage; + char *name; + struct list_item item; /* item in a list */ +}; + struct tplg_comp_info { + struct list_item item; /* item in a list */ + struct sof_ipc4_available_audio_format available_fmt; /* available formats in tplg */ + struct ipc4_module_init_instance module_init; + struct ipc4_base_module_cfg basecfg; + struct tplg_pipeline_info *pipe_info; + struct sof_uuid uuid; char *name; char *stream_name; int id; int type; int pipeline_id; void *ipc_payload; - struct list_item item; /* item in a list */ - struct sof_ipc4_available_audio_format available_fmt; /* available formats in tplg */ + int ipc_size; + int instance_id; + int module_id; }; struct tplg_route_info { @@ -112,12 +132,19 @@ struct tplg_route_info { struct list_item item; /* item in a list */ }; +struct tplg_pipeline_list { + int count; + struct tplg_pipeline_info *pipelines[TPLG_MAX_PCM_PIPELINES]; +}; + struct tplg_pcm_info { char *name; int id; struct tplg_comp_info *playback_host; struct tplg_comp_info *capture_host; struct list_item item; /* item in a list */ + struct tplg_pipeline_list playback_pipeline_list; + struct tplg_pipeline_list capture_pipeline_list; }; /* diff --git a/tools/tplg_parser/pga.c b/tools/tplg_parser/pga.c index 0a65cafa5cbb..5a23f349d679 100644 --- a/tools/tplg_parser/pga.c +++ b/tools/tplg_parser/pga.c @@ -14,11 +14,11 @@ #include <string.h> #include <math.h> #include <ipc/topology.h> -#include <volume/peak_volume.h> #include <sof/lib/uuid.h> #include <sof/ipc/topology.h> #include <tplg_parser/topology.h> #include <tplg_parser/tokens.h> +#include <volume/peak_volume.h> #define SOF_IPC4_VOL_ZERO_DB 0x7fffffff From 87148abf1ec2d80a436d652b258d8a67c72bc6cf Mon Sep 17 00:00:00 2001 From: Liam Girdwood <liam.r.girdwood@linux.intel.com> Date: Tue, 19 Sep 2023 13:32:58 -0700 Subject: [PATCH 479/639] tools: Introduce the SOF ALSA plugin The SOF ALSA plugin allows SOF topologies to be run on the host. The plugin is still WIP with many rough edges that need refined before production deployment, however the plugin is usable today as a rapid development framework for SOF infrastructure and processing. Features that are function in the current implementation * aplay & arecord usage working today * modules are loaded as SO shared libraries. * topology is parsed by the plugin and pipelines associated with the requested PCM ID are loaded * pipelines run as individual userspace threads * pipelines can be pinned to efficency cores * pipelines can use realtime priority. * alsa sink and alsa source modules available. * pipelines can block (non blocking and mmap todo) * 16-bit playback and capture support. Other formats to be added soon Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> --- tools/plugin/CMakeLists.txt | 72 ++ tools/plugin/README.md | 83 ++ tools/plugin/alsaconf/50-sof.conf | 84 ++ tools/plugin/alsaconf/CMakeLists.txt | 5 + tools/plugin/alsaplug/CMakeLists.txt | 68 ++ tools/plugin/alsaplug/conf.c | 47 + tools/plugin/alsaplug/ctl.c | 685 ++++++++++++ tools/plugin/alsaplug/pcm.c | 1038 ++++++++++++++++++ tools/plugin/alsaplug/plugin.c | 452 ++++++++ tools/plugin/alsaplug/plugin.h | 66 ++ tools/plugin/alsaplug/tplg.c | 1479 ++++++++++++++++++++++++++ tools/plugin/common.c | 180 ++++ tools/plugin/common.h | 316 ++++++ tools/plugin/modules/CMakeLists.txt | 57 + tools/plugin/modules/alsa.c | 790 ++++++++++++++ tools/plugin/modules/shm.c | 451 ++++++++ tools/plugin/pipe/CMakeLists.txt | 27 + tools/plugin/pipe/cpu.c | 186 ++++ tools/plugin/pipe/ctl.c | 91 ++ tools/plugin/pipe/ipc4.c | 444 ++++++++ tools/plugin/pipe/main.c | 377 +++++++ tools/plugin/pipe/pipe.h | 126 +++ tools/plugin/pipe/pipeline.c | 380 +++++++ tools/tplg_parser/CMakeLists.txt | 9 +- 24 files changed, 7511 insertions(+), 2 deletions(-) create mode 100644 tools/plugin/CMakeLists.txt create mode 100644 tools/plugin/README.md create mode 100644 tools/plugin/alsaconf/50-sof.conf create mode 100644 tools/plugin/alsaconf/CMakeLists.txt create mode 100644 tools/plugin/alsaplug/CMakeLists.txt create mode 100644 tools/plugin/alsaplug/conf.c create mode 100644 tools/plugin/alsaplug/ctl.c create mode 100644 tools/plugin/alsaplug/pcm.c create mode 100644 tools/plugin/alsaplug/plugin.c create mode 100644 tools/plugin/alsaplug/plugin.h create mode 100644 tools/plugin/alsaplug/tplg.c create mode 100644 tools/plugin/common.c create mode 100644 tools/plugin/common.h create mode 100644 tools/plugin/modules/CMakeLists.txt create mode 100644 tools/plugin/modules/alsa.c create mode 100644 tools/plugin/modules/shm.c create mode 100644 tools/plugin/pipe/CMakeLists.txt create mode 100644 tools/plugin/pipe/cpu.c create mode 100644 tools/plugin/pipe/ctl.c create mode 100644 tools/plugin/pipe/ipc4.c create mode 100644 tools/plugin/pipe/main.c create mode 100644 tools/plugin/pipe/pipe.h create mode 100644 tools/plugin/pipe/pipeline.c diff --git a/tools/plugin/CMakeLists.txt b/tools/plugin/CMakeLists.txt new file mode 100644 index 000000000000..f5a8ade5f8cc --- /dev/null +++ b/tools/plugin/CMakeLists.txt @@ -0,0 +1,72 @@ +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.13) + +project(SOF_PLUGIN C) + +include(../../scripts/cmake/misc.cmake) +include(CheckCCompilerFlag) + +set(sof_source_directory "${PROJECT_SOURCE_DIR}/../..") +set(sof_install_directory "${PROJECT_BINARY_DIR}/sof_ep/install") +set(sof_binary_directory "${PROJECT_BINARY_DIR}/sof_ep/build") + +set(config_h ${sof_binary_directory}/library_autoconfig.h) + +set(parser_source_directory "${PROJECT_SOURCE_DIR}/../tplg_parser") +set(parser_install_dir "${PROJECT_BINARY_DIR}/sof_parser/install") + +message("ipc4 build") +set(tplg_ipc plugin_ipc4_defconfig) + +include(ExternalProject) + +# External project for SOF library +ExternalProject_Add(sof_ep + DOWNLOAD_COMMAND "" + SOURCE_DIR "${sof_source_directory}" + PREFIX "${PROJECT_BINARY_DIR}/sof_ep" + BINARY_DIR "${sof_binary_directory}" + CMAKE_ARGS -DCONFIG_LIBRARY=ON + -DCMAKE_INSTALL_PREFIX=${sof_install_directory} + -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} + -DINIT_CONFIG=${tplg_ipc} + -DCONFIG_H_PATH=${config_h} + -DCONFIG_LIBRARY_STATIC=ON + -DOPTIMIZE_FOR_DEBUG=ON + BUILD_ALWAYS 1 + BUILD_BYPRODUCTS "${sof_install_directory}/lib/libsof.a" +) + +add_library(sof_library STATIC IMPORTED) +set_target_properties(sof_library PROPERTIES IMPORTED_LOCATION "${sof_install_directory}/lib/libsof.a") +add_dependencies(sof_library sof_ep) + +# External project for topology parser +ExternalProject_Add(parser_ep + SOURCE_DIR "${parser_source_directory}" + PREFIX "${PROJECT_BINARY_DIR}/sof_parser" + BINARY_DIR "${PROJECT_BINARY_DIR}/sof_parser/build" + CMAKE_ARGS -DCONFIG_LIBRARY=ON + -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/sof_parser/install + -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE_MAKEFILE} + -DCONFIG_LIBRARY_STATIC=ON + -DOPTIMIZE_FOR_DEBUG=ON + BUILD_ALWAYS 1 + BUILD_BYPRODUCTS "${parser_install_dir}/lib/libsof_tplg_parser.a" +) + +add_library(sof_parser_lib STATIC IMPORTED) +set_target_properties(sof_parser_lib PROPERTIES IMPORTED_LOCATION "${parser_install_dir}/lib/libsof_tplg_parser.a") +add_dependencies(sof_parser_lib parser_ep) + +add_subdirectory(alsaconf) +add_subdirectory(alsaplug) +add_subdirectory(modules) +add_subdirectory(pipe) + +add_dependencies(asound_module_pcm_sof sof_parser_lib) +add_dependencies(asound_module_ctl_sof sof_parser_lib) + +add_dependencies(sof-pipe sof_mod_shm) +add_dependencies(sof-pipe sof_mod_alsa) diff --git a/tools/plugin/README.md b/tools/plugin/README.md new file mode 100644 index 000000000000..0d4822388e70 --- /dev/null +++ b/tools/plugin/README.md @@ -0,0 +1,83 @@ +##ALSA Plugin + +The SOF ALSA plugin allows SOF topologies to be run on the host. The plugin +is still WIP with many rough edges that need refined before production +deployment, however the plugin is usable today as a rapid development +framework for SOF infrastructure and processing. + +#Features + * aplay & arecord usage working today + * alsamixer & amixer usage not working today + * modules are loaded as SO shared libraries. + * topology is parsed by the plugin and pipelines associated with the requested PCM ID are loaded + * pipelines run as individual userspace threads + * pipelines can be pinned to efficency cores + * pipelines can use realtime priority. + * alsa sink and alsa source modules available. + * pipelines can block (non blocking and mmap todo) + +#License +Code is a mixture of LGPL and BSD 3c. + +#Usage +Please build as cmake project, for IPC4 (functional) +IPC3 is not functional and not supported + +``` +cd sof +mkdir build_plugin +cd build_plugin +cmake ../tools/plugin -DPLUGIN_IPC4=ON +``` +then (use default ALSA prefix atm) + +``` +sudo make install <ALSA prefix> + +Make sure to set the LD_LIBRARY_PATH to include directory where the SOF modules are installed +Ex: "~/work/sof/sof/build_plugin/sof_ep/install/lib:~/work/sof/sof/build_plugin/modules/" +And set the environment variable SOF_PLUGIN_TOPOLOGY_PATH to point to the directory containing the topology binary +``` + +Code can then be run by starting sof-pipe with your desired topology + +``` + ./sof-pipe -T sof-tgl-nocodec.tplg +``` + +At this point the sof-pipe daemon is waiting for IPC. Audio applications can now invoke sof-pipe processing via + +``` +aplay -Dsof:tgl-nocodec:1:default:default:48k2c16b -f dat some48kHz.wav +``` +The command line is parsed as follows: +- "sof" is the plugin name +- "tgl-nocodec" is the topology name. The "sof-" prefix and ".tplg" suffix will be appended by the plugin +- "1" is the PCM ID for render/capture +- "default": The first default is the card name +- "default": The second default is the device name +- "48k2c16b" is the config name for 48K, stereo, 16bit + +This renders audio to the sof-pipe daemon using the tgl-nocodec topology playback PCM ID 1. +The above example needs to be 48k as example pipe has no SRC/ASRC. + +Likewise + +``` +arecord -Dsof:tgl-nocodec:1:default:default:48k2c16b -f dat file.wav +``` +Will record audio using the tgl-nocodec topology and PCM ID 1. + +Mixer settings can be adjusted for bdw-nocodec by (Not functional yet) + +``` +alsamixer -Dsof:tgl-nocodec:1 +``` + +#TODO Items (and T-shirt size) for single pipeline E2E audio + * IPC4 support in tplg parser (M) + * IPC4 support in plugin (pipe/ipc4.c) (M) + * Fix ALSA -Dhw: device support (S), currently only default ALSA device works + * Deprecate POSIX message queues for IPC and use UNIX sockets.(S) + * Make better build system for modules i.e. remove hack-install.sh (S) + * Need a simpler aplay/arecord cmd line. diff --git a/tools/plugin/alsaconf/50-sof.conf b/tools/plugin/alsaconf/50-sof.conf new file mode 100644 index 000000000000..4d0232ecc596 --- /dev/null +++ b/tools/plugin/alsaconf/50-sof.conf @@ -0,0 +1,84 @@ +# Invoke a SOF pipeline and route it to a sound card or another plugin +# To use the PCM 0 on the SOF "volume" topology and route it to hw:1,2 then run +# aplay -Dsof:volume:0,hw,1,2 +# tplg:pipe:[pipe:card:dev:config[pipe:card:dev:config]...] +# +# TPLG SOF topology configuration (mandatory) + +pcm.sof { + @args [ TPLG ] + @args.TPLG { + type string + default "passthrough" + } + + type sof + tplg $TPLG + + hint { + show { + @func refer + name defaults.namehint.basic + } + description "SOF Topology and PCM" + } + + config.48k2c16b { + rate 48000 + channels 2 + format S16_LE + period_time 0 + period_frames 48 + buffer_time 0 + buffer_frames 192 + } + + config.48k8c16b { + rate 48000 + channels 8 + format S16_LE + period_time 0 + period_frames 1024 + buffer_time 0 + buffer_frames 5120 + } + + config.8k8c16b { + rate 8000 + channels 8 + format S16_LE + period_time 0 + period_frames 1024 + buffer_time 0 + buffer_frames 5120 + } + + config.48k2c32b { + rate 48000 + channels 2 + format S32_LE + period_time 0 + period_frames 6000 + buffer_time 0 + buffer_frames 24000 + } +} + +ctl.sof { + @args [ TPLG ] + @args.TPLG { + type string + default "passthrough" + } + + type sof + tplg $TPLG + + hint { + show { + @func refer + name defaults.namehint.basic + } + description "SOF Topology" + } +} diff --git a/tools/plugin/alsaconf/CMakeLists.txt b/tools/plugin/alsaconf/CMakeLists.txt new file mode 100644 index 000000000000..3a58c514f522 --- /dev/null +++ b/tools/plugin/alsaconf/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause + +install(FILES 50-sof.conf DESTINATION /usr/share/alsa/alsa.conf.d) +# HACK needs to link to above +install(FILES 50-sof.conf DESTINATION /etc/alsa/conf.d) diff --git a/tools/plugin/alsaplug/CMakeLists.txt b/tools/plugin/alsaplug/CMakeLists.txt new file mode 100644 index 000000000000..c982d90d6106 --- /dev/null +++ b/tools/plugin/alsaplug/CMakeLists.txt @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: BSD-3-Clause + +# PCM ALSA module +add_library(asound_module_pcm_sof MODULE + pcm.c + plugin.c + ../common.c + tplg.c +) + +sof_append_relative_path_definitions(asound_module_pcm_sof) + +target_include_directories(asound_module_pcm_sof PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${sof_source_directory}/src/audio) + +target_compile_options(asound_module_pcm_sof PRIVATE -DPIC -g -O3 -Wl,-EL -Wmissing-prototypes + -Wimplicit-fallthrough -DCONFIG_LIBRARY -imacros${config_h}) + +install(TARGETS asound_module_pcm_sof DESTINATION /usr/lib/x86_64-linux-gnu/alsa-lib) + +target_link_options(asound_module_pcm_sof PRIVATE -Wl,--export-dynamic,--no-undefined) +target_link_libraries(asound_module_pcm_sof PRIVATE sof_library) +target_link_libraries(asound_module_pcm_sof PRIVATE sof_parser_lib) +target_link_libraries(asound_module_pcm_sof PRIVATE pthread) +target_link_libraries(asound_module_pcm_sof PRIVATE -lasound -ldl -lm -lasound -lrt) + +target_include_directories(asound_module_pcm_sof PRIVATE ${sof_install_directory}/include) +target_include_directories(asound_module_pcm_sof PRIVATE ${parser_install_dir}/include) + +set_target_properties(asound_module_pcm_sof + PROPERTIES + INSTALL_RPATH "${sof_install_directory}/alsa-lib" + INSTALL_RPATH_USE_LINK_PATH TRUE +) + +# CTL ALSA module +add_library(asound_module_ctl_sof MODULE + ctl.c + plugin.c + ../common.c +) +sof_append_relative_path_definitions(asound_module_ctl_sof) +target_include_directories(asound_module_ctl_sof PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${sof_source_directory}/src/audio) + +target_compile_options(asound_module_ctl_sof PRIVATE -DPIC -g -O3 -Wl,-EL -Wmissing-prototypes + -Wimplicit-fallthrough -Wall -Werror -DCONFIG_LIBRARY -imacros${config_h}) + +install(TARGETS asound_module_ctl_sof DESTINATION /usr/lib/x86_64-linux-gnu/alsa-lib) + +target_link_options(asound_module_ctl_sof PRIVATE -Wl,--export-dynamic,--no-undefined) +target_link_libraries(asound_module_ctl_sof PRIVATE sof_library) +target_link_libraries(asound_module_ctl_sof PRIVATE sof_parser_lib) +target_link_libraries(asound_module_ctl_sof PRIVATE pthread) +target_link_libraries(asound_module_ctl_sof PRIVATE -lasound -ldl -lm -lasound -lrt) + +target_include_directories(asound_module_ctl_sof PRIVATE ${sof_install_directory}/include) +target_include_directories(asound_module_ctl_sof PRIVATE ${parser_install_dir}/include) + +set_target_properties(asound_module_ctl_sof + PROPERTIES + INSTALL_RPATH "${sof_install_directory}/alsa-lib" + INSTALL_RPATH_USE_LINK_PATH TRUE +) diff --git a/tools/plugin/alsaplug/conf.c b/tools/plugin/alsaplug/conf.c new file mode 100644 index 000000000000..5b259bf6885a --- /dev/null +++ b/tools/plugin/alsaplug/conf.c @@ -0,0 +1,47 @@ +/*-*- linux-c -*-*/ + +/* + * ALSA <-> SOF Config plugin + * + * Copyright(c) 2022 Intel Corporation. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + * 02111-1307 USA + * + */ + +#include <stdio.h> +#include <alsa/asoundlib.h> +#include "plugin.h" + +/* Not actually part of the alsa api.... */ +extern int +snd_config_hook_load(snd_config_t *root, snd_config_t *config, + snd_config_t **dst, snd_config_t *private_data); + +/* manifest file could be loaded as a hook */ +int sofplug_load_hook(snd_config_t *root, snd_config_t *config, + snd_config_t **dst, snd_config_t *private_data) +{ + int ret = 0; + + *dst = NULL; + + /* TODO: load hook when SOF ready */ + return snd_config_hook_load(root, config, dst, private_data); +} + +SND_DLSYM_BUILD_VERSION(sofplug_load_hook, + SND_CONFIG_DLSYM_VERSION_HOOK); diff --git a/tools/plugin/alsaplug/ctl.c b/tools/plugin/alsaplug/ctl.c new file mode 100644 index 000000000000..7e4f34e4cbda --- /dev/null +++ b/tools/plugin/alsaplug/ctl.c @@ -0,0 +1,685 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> + +// TODO remove parsing and read ctls from sof-pipe SHM glb context +#include <ipc/control.h> + +#include <alsa/asoundlib.h> +#include <alsa/control_external.h> + +#include "plugin.h" +#include "common.h" + +typedef struct snd_sof_ctl { + struct plug_shm_glb_state *glb; + snd_ctl_ext_t ext; + struct plug_mq_desc ipc; + struct plug_shm_desc shm_ctx; + int subscribed; + int updated[MAX_CTLS]; + +} snd_sof_ctl_t; + +#define CTL_GET_TPLG_HDR(_ctl, _key) \ + (&_ctl->glb->ctl[_key].mixer_ctl.hdr) + +#define CTL_GET_TPLG_MIXER(_ctl, _key) \ + (&_ctl->glb->ctl[_key].mixer_ctl) + +#define CTL_GET_TPLG_ENUM(_ctl, _key) \ + (&_ctl->glb->ctl[_key].enum_ctl) + +#define CTL_GET_TPLG_BYTES(_ctl, _key) \ + (&_ctl->glb->ctl[_key].bytes_ctl) + +/* number of ctls */ +static int plug_ctl_elem_count(snd_ctl_ext_t *ext) +{ + snd_sof_ctl_t *ctl = ext->private_data; + + /* TODO: get count of elems from topology */ + return ctl->glb->num_ctls; +} + +static int plug_ctl_elem_list(snd_ctl_ext_t *ext, unsigned int offset, snd_ctl_elem_id_t *id) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_ctl_hdr *hdr; + + if (offset >= ctl->glb->num_ctls) + return -EINVAL; + + hdr = CTL_GET_TPLG_HDR(ctl, offset); + + snd_ctl_elem_id_set_interface(id, SND_CTL_ELEM_IFACE_MIXER); + snd_ctl_elem_id_set_name(id, hdr->name); + + return 0; +} + +static snd_ctl_ext_key_t plug_ctl_find_elem(snd_ctl_ext_t *ext, const snd_ctl_elem_id_t *id) +{ + snd_sof_ctl_t *ctl = ext->private_data; + unsigned int numid; + + numid = snd_ctl_elem_id_get_numid(id); + + if (numid > ctl->glb->num_ctls) + return SND_CTL_EXT_KEY_NOT_FOUND; + + return numid - 1; +} + +static int plug_ctl_get_attribute(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + int *type, unsigned int *acc, unsigned int *count) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_ctl_hdr *hdr = CTL_GET_TPLG_HDR(ctl, key); + struct snd_soc_tplg_mixer_control *mixer_ctl; + struct snd_soc_tplg_enum_control *enum_ctl; + struct snd_soc_tplg_bytes_control *bytes_ctl; + int err = 0; + + switch (hdr->type) { + case SND_SOC_TPLG_CTL_VOLSW: + case SND_SOC_TPLG_CTL_VOLSW_SX: + case SND_SOC_TPLG_CTL_VOLSW_XR_SX: + mixer_ctl = (struct snd_soc_tplg_mixer_control *)hdr; + + /* check for type - boolean should be binary values */ + if (mixer_ctl->max == 1 && mixer_ctl->min == 0) + *type = SND_CTL_ELEM_TYPE_BOOLEAN; + else + *type = SND_CTL_ELEM_TYPE_INTEGER; + *count = 2;//mixer_ctl->num_channels; ///// WRONG is 0 !!! + + //printf("mixer %d %d\n", __LINE__, mixer_ctl->num_channels); + break; + case SND_SOC_TPLG_CTL_ENUM: + case SND_SOC_TPLG_CTL_ENUM_VALUE: + enum_ctl = (struct snd_soc_tplg_enum_control *)hdr; + *type = SND_CTL_ELEM_TYPE_ENUMERATED; + *count = enum_ctl->num_channels; + break; + case SND_SOC_TPLG_CTL_RANGE: + case SND_SOC_TPLG_CTL_STROBE: + // TODO: ?? + break; + case SND_SOC_TPLG_CTL_BYTES: + printf("%s %d\n", __func__, __LINE__); + bytes_ctl = (struct snd_soc_tplg_bytes_control *)hdr; + *type = SND_CTL_ELEM_TYPE_BYTES; + *count = bytes_ctl->size; // Not sure if size is correct + break; + } + + *acc = hdr->access; + + /* access needs the callback to decode the data */ + if ((hdr->access & SND_CTL_EXT_ACCESS_TLV_READ) || + (hdr->access & SND_CTL_EXT_ACCESS_TLV_WRITE)) + *acc |= SND_CTL_EXT_ACCESS_TLV_CALLBACK; + return err; +} + +/* + * Integer ops + */ +static int plug_ctl_get_integer_info(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *imin, + long *imax, long *istep) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_ctl_hdr *hdr = CTL_GET_TPLG_HDR(ctl, key); + struct snd_soc_tplg_mixer_control *mixer_ctl = + CTL_GET_TPLG_MIXER(ctl, key); + int err = 0; + + switch (hdr->type) { + case SND_SOC_TPLG_CTL_VOLSW: + case SND_SOC_TPLG_CTL_VOLSW_SX: + case SND_SOC_TPLG_CTL_VOLSW_XR_SX: + /* TLV uses the fields differently */ + if ((hdr->access & SND_CTL_EXT_ACCESS_TLV_READ) || + (hdr->access & SND_CTL_EXT_ACCESS_TLV_WRITE)) { + *istep = mixer_ctl->hdr.tlv.scale.step; + *imin = (int32_t)mixer_ctl->hdr.tlv.scale.min; + *imax = mixer_ctl->max; + } else { + *istep = 1; + *imin = mixer_ctl->min; + *imax = mixer_ctl->max; + } + break; + default: + SNDERR("invalid ctl type for integer using key %d", key); + err = -EINVAL; + break; + } + + return err; +} + +static int plug_ctl_read_integer(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_mixer_control *mixer_ctl = + CTL_GET_TPLG_MIXER(ctl, key); + struct sof_ipc_ctrl_data *ctl_data; + struct sof_ipc_ctrl_value_chan *chanv; + int err, i; + + // TODO: set generic max size + ctl_data = calloc(IPC3_MAX_MSG_SIZE, 1); + if (!ctl_data) + return -ENOMEM; + chanv = ctl_data->chanv; + + /* setup the IPC message */ + ctl_data->comp_id = ctl->glb->ctl[key].comp_id; + ctl_data->cmd = SOF_CTRL_CMD_VOLUME; + ctl_data->type = SOF_CTRL_TYPE_VALUE_COMP_GET; + ctl_data->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | SOF_IPC_COMP_GET_VALUE; + ctl_data->rhdr.hdr.size = sizeof(ctl_data); + ctl_data->num_elems = mixer_ctl->num_channels; + + /* send message and wait for reply */ + err = plug_mq_cmd(&ctl->ipc, ctl_data, IPC3_MAX_MSG_SIZE, ctl_data, IPC3_MAX_MSG_SIZE); + if (err < 0) { + SNDERR("error: can't read CTL %d message\n", + ctl_data->comp_id); + return err; + } + + /* did IPC succeed ? */ + if (ctl_data->rhdr.error != 0) { + SNDERR("error: can't read CTL %d failed: error %d\n", + ctl_data->comp_id, ctl_data->rhdr.error); + return ctl_data->rhdr.error; + } + + /* get data from IPC */ + for (i = 0; i < mixer_ctl->num_channels; i++) + value[i] = chanv[i].value; + + free(ctl_data); + + return err; +} + +static int plug_ctl_write_integer(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, long *value) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_mixer_control *mixer_ctl = + CTL_GET_TPLG_MIXER(ctl, key); + struct sof_ipc_ctrl_data *ctl_data; + struct sof_ipc_ctrl_value_chan *chanv; + int err; + int i; + + // TODO: set generic max size + ctl_data = calloc(IPC3_MAX_MSG_SIZE, 1); + if (!ctl_data) + return -ENOMEM; + chanv = ctl_data->chanv; + + /* setup the IPC message */ + ctl_data->comp_id = ctl->glb->ctl[key].comp_id; + ctl_data->cmd = SOF_CTRL_CMD_VOLUME; + ctl_data->type = SOF_CTRL_TYPE_VALUE_COMP_SET; + ctl_data->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | SOF_IPC_COMP_SET_VALUE; + ctl_data->rhdr.hdr.size = sizeof(ctl_data); + ctl_data->num_elems = mixer_ctl->num_channels; + + /* set data for IPC */ + for (i = 0; i < mixer_ctl->num_channels; i++) + chanv[i].value = value[i]; + + err = plug_mq_cmd(&ctl->ipc, ctl_data, IPC3_MAX_MSG_SIZE, + ctl_data, IPC3_MAX_MSG_SIZE); + if (err < 0) { + SNDERR("error: can't write CTL %d message\n", ctl_data->comp_id); + return err; + } + + /* did IPC succeed ? */ + if (ctl_data->rhdr.error != 0) { + SNDERR("error: can't write CTL %d failed: error %d\n", + ctl_data->comp_id, ctl_data->rhdr.error); + return ctl_data->rhdr.error; + } + + free(ctl_data); + + return err; +} + +/* + * Enum ops + */ +static int plug_ctl_get_enumerated_info(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + unsigned int *items) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_ctl_hdr *hdr = CTL_GET_TPLG_HDR(ctl, key); + struct snd_soc_tplg_enum_control *enum_ctl = + (struct snd_soc_tplg_enum_control *)hdr; + int err = 0; + + switch (hdr->type) { + case SND_SOC_TPLG_CTL_ENUM: + case SND_SOC_TPLG_CTL_ENUM_VALUE: + *items = enum_ctl->items; + break; + default: + SNDERR("invalid ctl type for enum using key %d", key); + err = -EINVAL; + break; + } + + return err; +} + +static int plug_ctl_get_enumerated_name(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + unsigned int item, char *name, size_t name_max_len) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_ctl_hdr *hdr = CTL_GET_TPLG_HDR(ctl, key); + struct snd_soc_tplg_enum_control *enum_ctl = + (struct snd_soc_tplg_enum_control *)hdr; + + printf("%s %d\n", __func__, __LINE__); + + if (item >= enum_ctl->count) { + SNDERR("invalid item %d for enum using key %d", item, key); + return -EINVAL; + } + + strncpy(name, enum_ctl->texts[item], name_max_len); + return 0; +} + +static int plug_ctl_read_enumerated(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + unsigned int *items) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_enum_control *enum_ctl = + CTL_GET_TPLG_ENUM(ctl, key); + struct sof_ipc_ctrl_data *ctl_data; + struct sof_ipc_ctrl_value_comp *compv; + int err, i; + + // TODO: set generic max size + ctl_data = calloc(IPC3_MAX_MSG_SIZE, 1); + if (!ctl_data) + return -ENOMEM; + compv = ctl_data->compv; + + /* setup the IPC message */ + ctl_data->comp_id = ctl->glb->ctl[key].comp_id; + ctl_data->cmd = SOF_CTRL_CMD_ENUM; + ctl_data->type = SOF_CTRL_TYPE_VALUE_COMP_GET; + ctl_data->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | SOF_IPC_COMP_GET_VALUE; + ctl_data->rhdr.hdr.size = sizeof(ctl_data); + + /* send message and wait for reply */ + err = plug_mq_cmd(&ctl->ipc, ctl_data, IPC3_MAX_MSG_SIZE, + ctl_data, IPC3_MAX_MSG_SIZE); + if (err < 0) { + SNDERR("error: can't read CTL %d message\n", ctl_data->comp_id); + return err; + } + + /* did IPC succeed ? */ + if (ctl_data->rhdr.error != 0) { + SNDERR("error: can't read CTL %d failed: error %d\n", + ctl_data->comp_id, ctl_data->rhdr.error); + return ctl_data->rhdr.error; + } + + /* get data from IPC */ + for (i = 0; i < enum_ctl->num_channels; i++) + items[i] = compv[i].uvalue; + + free(ctl_data); + + return err; +} + +static int plug_ctl_write_enumerated(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + unsigned int *items) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_enum_control *enum_ctl = + CTL_GET_TPLG_ENUM(ctl, key); + struct sof_ipc_ctrl_data *ctl_data; + struct sof_ipc_ctrl_value_comp *compv; + int err, i; + + // TODO: set generic max size + ctl_data = calloc(IPC3_MAX_MSG_SIZE, 1); + if (!ctl_data) + return -ENOMEM; + compv = ctl_data->compv; + + printf("%s %d\n", __func__, __LINE__); + + /* setup the IPC message */ + ctl_data->comp_id = ctl->glb->ctl[key].comp_id; + ctl_data->cmd = SOF_CTRL_CMD_ENUM; + ctl_data->type = SOF_CTRL_TYPE_VALUE_COMP_SET; + ctl_data->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | SOF_IPC_COMP_SET_VALUE; + ctl_data->rhdr.hdr.size = sizeof(ctl_data); + + /* set data for IPC */ + for (i = 0; i < enum_ctl->num_channels; i++) + compv[i].uvalue = items[i]; + + /* send message and wait for reply */ + err = plug_mq_cmd(&ctl->ipc, ctl_data, IPC3_MAX_MSG_SIZE, + ctl_data, IPC3_MAX_MSG_SIZE); + if (err < 0) { + SNDERR("error: can't read CTL %d message\n", ctl_data->comp_id); + goto out; + } + + /* did IPC succeed ? */ + if (ctl_data->rhdr.error != 0) { + SNDERR("error: can't read CTL %d failed: error %d\n", + ctl_data->comp_id, ctl_data->rhdr.error); + err = ctl_data->rhdr.error; + } + +out: + free(ctl_data); + return err; +} + +/* + * Bytes ops - TODO handle large blobs + */ + +static int plug_ctl_read_bytes(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + unsigned char *data, size_t max_bytes) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_bytes_control *binary_ctl = + CTL_GET_TPLG_BYTES(ctl, key); + struct sof_ipc_ctrl_data *ctl_data; + int err; + + // TODO: set generic max size + ctl_data = calloc(IPC3_MAX_MSG_SIZE, 1); + if (!ctl_data) + return -ENOMEM; + + /* setup the IPC message */ + ctl_data->comp_id = ctl->glb->ctl[key].comp_id; + ctl_data->cmd = SOF_CTRL_CMD_BINARY; + ctl_data->type = SOF_CTRL_TYPE_VALUE_COMP_GET; + ctl_data->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | SOF_IPC_COMP_GET_VALUE; + ctl_data->rhdr.hdr.size = sizeof(ctl_data); + + /* send message and wait for reply */ + err = plug_mq_cmd(&ctl->ipc, ctl_data, IPC3_MAX_MSG_SIZE, + ctl_data, IPC3_MAX_MSG_SIZE); + if (err < 0) { + SNDERR("error: can't read CTL %d message\n", ctl_data->comp_id); + return err; + } + + /* did IPC succeed ? */ + if (ctl_data->rhdr.error != 0) { + SNDERR("error: can't read CTL %d failed: error %d\n", + ctl_data->comp_id, ctl_data->rhdr.error); + return ctl_data->rhdr.error; + } + + /* get data for IPC */ + memcpy(data, &ctl_data->data, MIN(binary_ctl->max, max_bytes)); + free(ctl_data); + + return err; +} + +static int plug_ctl_write_bytes(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, + unsigned char *data, size_t max_bytes) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_bytes_control *binary_ctl = + CTL_GET_TPLG_BYTES(ctl, key); + struct sof_ipc_ctrl_data *ctl_data; + int err; + + // TODO: set generic max size + ctl_data = calloc(IPC3_MAX_MSG_SIZE, 1); + if (!ctl_data) + return -ENOMEM; + + printf("%s %d\n", __func__, __LINE__); + + /* setup the IPC message */ + ctl_data->comp_id = ctl->glb->ctl[key].comp_id; + ctl_data->cmd = SOF_CTRL_CMD_BINARY; + ctl_data->type = SOF_CTRL_TYPE_VALUE_COMP_SET; + ctl_data->rhdr.hdr.cmd = SOF_IPC_GLB_COMP_MSG | SOF_IPC_COMP_SET_VALUE; + ctl_data->rhdr.hdr.size = sizeof(ctl_data); + + /* set data for IPC */ + memcpy(&ctl_data->data, data, MIN(binary_ctl->max, max_bytes)); + + /* send message and wait for reply */ + err = plug_mq_cmd(&ctl->ipc, ctl_data, IPC3_MAX_MSG_SIZE, + ctl_data, IPC3_MAX_MSG_SIZE); + if (err < 0) { + SNDERR("error: can't read CTL %d message\n", ctl_data->comp_id); + return err; + } + + /* did IPC succeed ? */ + if (ctl_data->rhdr.error != 0) { + SNDERR("error: can't read CTL %d failed: error %d\n", + ctl_data->comp_id, ctl_data->rhdr.error); + return ctl_data->rhdr.error; + } + + free(ctl_data); + + return err; +} + +/* + * TLV ops + * + * The format of an array of \a tlv argument is: + * tlv[0]: Type. One of SND_CTL_TLVT_XXX. + * tlv[1]: Length. The length of value in units of byte. + * tlv[2..]: Value. Depending on the type. + */ +static int plug_tlv_rw(snd_ctl_ext_t *ext, snd_ctl_ext_key_t key, int op_flag, + unsigned int numid, unsigned int *tlv, unsigned int tlv_size) +{ + snd_sof_ctl_t *ctl = ext->private_data; + struct snd_soc_tplg_ctl_hdr *hdr = CTL_GET_TPLG_HDR(ctl, key); + + //TODO: alsamixer showing wrong dB scales + tlv[0] = hdr->tlv.type; + tlv[1] = hdr->tlv.size - sizeof(uint32_t) * 2; + memcpy(&tlv[2], hdr->tlv.data, hdr->tlv.size - sizeof(uint32_t) * 2); + + return 0; +} + +static void plug_ctl_subscribe_events(snd_ctl_ext_t *ext, int subscribe) +{ + snd_sof_ctl_t *ctl = ext->private_data; + + ctl->subscribed = !!(subscribe & SND_CTL_EVENT_MASK_VALUE); +} + +static int plug_ctl_read_event(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id, + unsigned int *event_mask) +{ + snd_sof_ctl_t *ctl = ext->private_data; + int numid; + int err = 0; + + numid = snd_ctl_elem_id_get_numid(id); + + // TODO: we need a notify() or listening thread to take async/volatile ctl + // notifications from sof-pipe and notify userspace via events of the ctl change. + if (!ctl->updated[numid - 1] || !ctl->subscribed) { + err = -EAGAIN; + goto out; + } + + *event_mask = SND_CTL_EVENT_MASK_VALUE; +out: + return err; +} + +static int plug_ctl_poll_revents(snd_ctl_ext_t *ext, struct pollfd *pfd, + unsigned int nfds, unsigned short *revents) +{ + snd_sof_ctl_t *ctl = ext->private_data; + int i; + + *revents = 0; + + for (i = 0; i < ctl->glb->num_ctls; i++) { + if (ctl->updated[i]) { + *revents = POLLIN; + break; + } + } + + return 0; +} + +static void plug_ctl_close(snd_ctl_ext_t *ext) +{ + snd_sof_ctl_t *ctl = ext->private_data; + + /* TODO: munmap */ + free(ctl); +} + +static const snd_ctl_ext_callback_t sof_ext_callback = { + .elem_count = plug_ctl_elem_count, + .elem_list = plug_ctl_elem_list, + .find_elem = plug_ctl_find_elem, + .get_attribute = plug_ctl_get_attribute, + .get_integer_info = plug_ctl_get_integer_info, + .read_integer = plug_ctl_read_integer, + .write_integer = plug_ctl_write_integer, + .get_enumerated_info = plug_ctl_get_enumerated_info, + .get_enumerated_name = plug_ctl_get_enumerated_name, + .read_enumerated = plug_ctl_read_enumerated, + .write_enumerated = plug_ctl_write_enumerated, + .read_bytes = plug_ctl_read_bytes, + .write_bytes = plug_ctl_write_bytes, + .subscribe_events = plug_ctl_subscribe_events, + .read_event = plug_ctl_read_event, + .poll_revents = plug_ctl_poll_revents, + .close = plug_ctl_close, +}; + +SND_CTL_PLUGIN_DEFINE_FUNC(sof) +{ + snd_sof_plug_t *plug; + int err; + snd_sof_ctl_t *ctl; + + /* create context */ + plug = calloc(1, sizeof(*plug)); + if (!plug) + return -ENOMEM; + + ctl = calloc(1, sizeof(*ctl)); + if (!ctl) + return -ENOMEM; + plug->module_prv = ctl; + + /* parse the ALSA configuration file for sof plugin */ + err = plug_parse_conf(plug, name, root, conf); + if (err < 0) { + SNDERR("failed to parse config: %s", strerror(err)); + goto error; + } + + /* create message queue for IPC */ + err = plug_mq_init(&ctl->ipc, plug->tplg_file, "ipc", 0); + if (err < 0) + goto error; + + /* open message queue for IPC */ + err = plug_mq_open(&ctl->ipc); + if (err < 0) { + SNDERR("failed to open IPC message queue: %s", strerror(err)); + SNDERR("The PCM needs to be open for mixers to connect to pipeline"); + goto error; + } + + /* create a SHM mapping for low latency stream position */ + err = plug_shm_init(&ctl->shm_ctx, plug->tplg_file, "ctx", 0); + if (err < 0) + goto error; + + // TODO: make this open/close per operation for shared access + /* create a SHM mapping for low latency stream position */ + err = plug_shm_open(&ctl->shm_ctx); + if (err < 0) + goto error; + + /* get global context for kcontrol lookup */ + ctl->glb = ctl->shm_ctx.addr; + + /* TODO: add some flavour to the names based on the topology */ + ctl->ext.version = SND_CTL_EXT_VERSION; + ctl->ext.card_idx = 0; + strncpy(ctl->ext.id, "sof", sizeof(ctl->ext.id) - 1); + strncpy(ctl->ext.driver, "SOF plugin", + sizeof(ctl->ext.driver) - 1); + strncpy(ctl->ext.name, "SOF", sizeof(ctl->ext.name) - 1); + strncpy(ctl->ext.mixername, "SOF", + sizeof(ctl->ext.mixername) - 1); + + /* polling on message queue - supported on Linux but not portable */ + ctl->ext.poll_fd = ctl->ipc.mq; + + ctl->ext.callback = &sof_ext_callback; + ctl->ext.private_data = ctl; + ctl->ext.tlv.c = plug_tlv_rw; + + err = snd_ctl_ext_create(&ctl->ext, name, mode); + if (err < 0) + goto error; + + *handlep = ctl->ext.handle; + + return 0; + +error: + free(ctl); + + return err; +} + +SND_CTL_PLUGIN_SYMBOL(sof); diff --git a/tools/plugin/alsaplug/pcm.c b/tools/plugin/alsaplug/pcm.c new file mode 100644 index 000000000000..f6aef645ce56 --- /dev/null +++ b/tools/plugin/alsaplug/pcm.c @@ -0,0 +1,1038 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <math.h> + +#include <alsa/asoundlib.h> +#include <alsa/pcm_external.h> + +#include <rtos/sof.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/component.h> +#include <ipc/stream.h> +#include <tplg_parser/topology.h> + +#include "plugin.h" +#include "common.h" + +typedef struct snd_sof_pcm { + snd_pcm_ioplug_t io; + size_t frame_size; + struct timespec wait_timeout; + int capture; + int events; + + /* PCM flow control */ + struct plug_sem_desc ready[TPLG_MAX_PCM_PIPELINES]; + struct plug_sem_desc done[TPLG_MAX_PCM_PIPELINES]; + /* pipeline IPC tx queues */ + struct plug_mq_desc pipeline_ipc_tx[TPLG_MAX_PCM_PIPELINES]; + /* pipeline IPC response queues */ + struct plug_mq_desc pipeline_ipc_rx[TPLG_MAX_PCM_PIPELINES]; + + struct plug_shm_desc glb_ctx; + struct plug_shm_desc shm_pcm; + + int frame_us; +} snd_sof_pcm_t; + +static int plug_pipeline_set_state(snd_sof_plug_t *plug, int state, + struct ipc4_pipeline_set_state *pipe_state, + struct tplg_pipeline_info *pipe_info, + struct plug_mq_desc *ipc_tx, struct plug_mq_desc *ipc_rx) +{ + struct ipc4_message_reply reply = {{ 0 }}; + int ret; + + pipe_state->primary.r.ppl_id = pipe_info->instance_id; + + ret = plug_mq_cmd_tx_rx(ipc_tx, ipc_rx, pipe_state, sizeof(*pipe_state), + &reply, sizeof(reply)); + if (ret < 0) + SNDERR("failed pipeline %d set state %d\n", pipe_info->instance_id, state); + + return ret; +} + +static int plug_pipelines_set_state(snd_sof_plug_t *plug, int state) +{ + snd_sof_pcm_t *pcm = plug->module_prv; + struct ipc4_pipeline_set_state pipe_state = {{ 0 }}; + struct tplg_pipeline_list *pipeline_list; + int i; + + if (pcm->capture) + pipeline_list = &plug->pcm_info->capture_pipeline_list; + else + pipeline_list = &plug->pcm_info->playback_pipeline_list; + + pipe_state.primary.r.ppl_state = state; + pipe_state.primary.r.type = SOF_IPC4_GLB_SET_PIPELINE_STATE; + pipe_state.primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG; + pipe_state.primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; + + /* + * pipeline list is populated starting from the host to DAI. So traverse the list in + * the reverse order for capture to start the source pipeline first. + */ + if (pcm->capture) { + for (i = pipeline_list->count - 1; i >= 0; i--) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + int ret; + + ret = plug_pipeline_set_state(plug, state, &pipe_state, pipe_info, + &pcm->pipeline_ipc_tx[i], + &pcm->pipeline_ipc_rx[i]); + if (ret < 0) + return ret; + } + + return 0; + } + + for (i = 0; i < pipeline_list->count; i++) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + int ret; + + ret = plug_pipeline_set_state(plug, state, &pipe_state, pipe_info, + &pcm->pipeline_ipc_tx[i], &pcm->pipeline_ipc_rx[i]); + if (ret < 0) + return ret; + } + + return 0; +} + +static int plug_pcm_start(snd_pcm_ioplug_t *io) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + int err; + + switch (ctx->state) { + case SOF_PLUGIN_STATE_READY: + err = plug_pipelines_set_state(plug, SOF_IPC4_PIPELINE_STATE_RUNNING); + if (err < 0) + return err; + break; + case SOF_PLUGIN_STATE_STREAM_RUNNING: + { + struct tplg_pipeline_list *pipeline_list; + int i, delay; + + if (!pcm->capture) + break; + + pipeline_list = &plug->pcm_info->capture_pipeline_list; + + /* start the first period copy for capture */ + for (i = pipeline_list->count - 1; i >= 0; i--) { + sem_post(pcm->ready[i].sem); + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &pcm->wait_timeout); + if (err == -1) { + SNDERR("write: cant get time: %s", strerror(errno)); + return -EPIPE; + } + + /* work out delay TODO: fix ALSA reader */ + delay = pcm->frame_us * io->period_size / 500; + plug_timespec_add_ms(&pcm->wait_timeout, delay); + + /* wait for sof-pipe writer to produce data or timeout */ + err = sem_timedwait(pcm->done[i].sem, &pcm->wait_timeout); + if (err == -1) { + SNDERR("read: waited %d ms for %ld frames fatal timeout: %s", + delay, io->period_size, strerror(errno)); + return -errno; + } + } + } + break; + case SOF_PLUGIN_STATE_INIT: + case SOF_PLUGIN_STATE_STREAM_ERROR: + case SOF_PLUGIN_STATE_DEAD: + default: + /* some error */ + SNDERR("pcm start: invalid pipe state: %d", ctx->state); + return -EINVAL; + } + + return 0; +} + +static int plug_pcm_stop(snd_pcm_ioplug_t *io) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + int err; + + printf("%s %d state %ld\n", __func__, __LINE__, ctx->state); + switch (ctx->state) { + case SOF_PLUGIN_STATE_STREAM_ERROR: + case SOF_PLUGIN_STATE_STREAM_RUNNING: + { + err = plug_pipelines_set_state(plug, SOF_IPC4_PIPELINE_STATE_PAUSED); + if (err < 0) + return err; + break; + } + case SOF_PLUGIN_STATE_READY: + /* already stopped */ + break; + case SOF_PLUGIN_STATE_INIT: + case SOF_PLUGIN_STATE_DEAD: + default: + /* some error */ + SNDERR("pcm stop: invalid pipe state: %d", ctx->state); + return -EINVAL; + } + + return 0; +} + +/* buffer position up to buffer_size */ +static snd_pcm_sframes_t plug_pcm_pointer(snd_pcm_ioplug_t *io) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + snd_pcm_sframes_t ptr = 0; + int err; + + if (io->state == SND_PCM_STATE_XRUN) + return -EPIPE; + + if (io->state != SND_PCM_STATE_RUNNING) + return 0; + + switch (ctx->state) { + case SOF_PLUGIN_STATE_STREAM_RUNNING: + case SOF_PLUGIN_STATE_STREAM_ERROR: + if (pcm->capture) + ptr = ctx->wtotal / pcm->frame_size; + else + ptr = ctx->rtotal / pcm->frame_size; + break; + case SOF_PLUGIN_STATE_READY: + /* not running */ + return 0; + case SOF_PLUGIN_STATE_INIT: + case SOF_PLUGIN_STATE_DEAD: + default: + /* some error */ + SNDERR("pointer: invalid pipe state: %d", ctx->state); + ptr = -EPIPE; + } + + return ptr; +} + +/* get the delay for the running PCM; optional; since v1.0.1 */ +static int plug_pcm_delay(snd_pcm_ioplug_t *io, snd_pcm_sframes_t *delayp) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + int err = 0; + + switch (ctx->state) { + case SOF_PLUGIN_STATE_STREAM_RUNNING: + case SOF_PLUGIN_STATE_READY: + // TODO: is capture delay correct here ??? + if (pcm->capture) + *delayp = (ctx->wtotal - ctx->rtotal) / pcm->frame_size; + else + *delayp = (ctx->rtotal - ctx->wtotal) / pcm->frame_size; + /* sanitize delay */ + if (*delayp < pcm->io.period_size || *delayp > io->buffer_size) + *delayp = pcm->io.period_size; + return 0; + case SOF_PLUGIN_STATE_STREAM_ERROR: + snd_pcm_ioplug_set_state(io, SND_PCM_STATE_XRUN); + return 0; + case SOF_PLUGIN_STATE_INIT: + case SOF_PLUGIN_STATE_DEAD: + default: + /* some error */ + SNDERR("delay: invalid pipe state: %d", ctx->state); + return -EPIPE; + } +} + +/* return frames written */ +static snd_pcm_sframes_t plug_pcm_write(snd_pcm_ioplug_t *io, const snd_pcm_channel_area_t *areas, + snd_pcm_uframes_t offset, snd_pcm_uframes_t size) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + struct tplg_pipeline_list *pipeline_list; + snd_pcm_sframes_t frames = 0; + int i; + ssize_t bytes; + const char *buf; + int err, delay; + + pipeline_list = &plug->pcm_info->playback_pipeline_list; + + /* calculate the buffer position and size from application */ + buf = (char *)areas->addr + (areas->first + areas->step * offset) / 8; + bytes = size * pcm->frame_size; + + /* now check what the pipe has free */ + bytes = MIN(plug_ep_get_free(ctx), bytes); + + frames = bytes / pcm->frame_size; + + if (frames == 0) + return frames; + + /* write audio data to the pipe */ + memcpy(plug_ep_wptr(ctx), buf, bytes); + + plug_ep_produce(ctx, bytes); + + /* tell the pipelines data is ready starting at the source pipeline */ + for (i = 0; i < pipeline_list->count; i++) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + + sem_post(pcm->ready[i].sem); + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &pcm->wait_timeout); + if (err == -1) { + SNDERR("write: cant get time: %s", strerror(errno)); + return -EPIPE; + } + + /* work out delay */ + delay = pcm->frame_us * frames / 500; + plug_timespec_add_ms(&pcm->wait_timeout, delay); + + /* now block caller on pipeline IO to PCM device */ + err = sem_timedwait(pcm->done[i].sem, &pcm->wait_timeout); + if (err == -1) { + SNDERR("write: waited %d ms for %ld frames, fatal timeout: %s", + delay, frames, strerror(errno)); + return -errno; + } + } + + return frames; +} + +/* return frames read */ +static snd_pcm_sframes_t plug_pcm_read(snd_pcm_ioplug_t *io, const snd_pcm_channel_area_t *areas, + snd_pcm_uframes_t offset, snd_pcm_uframes_t size) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + snd_pcm_sframes_t frames; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + struct tplg_pipeline_list *pipeline_list; + ssize_t bytes; + char *buf; + int err, delay, i; + + pipeline_list = &plug->pcm_info->capture_pipeline_list; + + /* calculate the buffer position and size */ + buf = (char *)areas->addr + (areas->first + areas->step * offset) / 8; + bytes = size * pcm->frame_size; + + /* check what the pipe has avail */ + bytes = MIN(plug_ep_get_avail(ctx), bytes); + frames = bytes / pcm->frame_size; + + if (!frames) + return 0; + + /* tell the pipe ready we are ready for next period */ + for (i = pipeline_list->count - 1; i >= 0; i--) { + sem_post(pcm->ready[i].sem); + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &pcm->wait_timeout); + if (err == -1) { + SNDERR("write: cant get time: %s", strerror(errno)); + return -EPIPE; + } + + /* work out delay TODO: fix ALSA reader */ + delay = pcm->frame_us * frames / 500; + plug_timespec_add_ms(&pcm->wait_timeout, delay); + + /* wait for sof-pipe writer to produce data or timeout */ + err = sem_timedwait(pcm->done[i].sem, &pcm->wait_timeout); + if (err == -1) { + SNDERR("read: waited %d ms for %ld frames fatal timeout: %s", + delay, frames, strerror(errno)); + return -errno; + } + } + + /* copy audio data from pipe */ + memcpy(buf, plug_ep_rptr(ctx), bytes); + plug_ep_consume(ctx, bytes); + + return frames; +} + +static int plug_pcm_prepare(snd_pcm_ioplug_t *io) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + int err = 0; + + ctx->wtotal = 0; + ctx->rtotal = 0; + ctx->rpos = 0; + ctx->rwrap = 0; + ctx->wpos = 0; + ctx->wwrap = 0; + + /* start the pipeline threads + * + * We do this during prepare so that pipelines can consume/produce + * any start threshold worth of data with the pipeline in a running + * state + */ + switch (ctx->state) { + case SOF_PLUGIN_STATE_INIT: + /* set pipelines to PAUSED state to prepare them */ + err = plug_pipelines_set_state(plug, SOF_IPC4_PIPELINE_STATE_PAUSED); + if (err < 0) + return err; + + fprintf(stdout, "pipelines complete now\n"); + + /* set pipelines to RUNNING state */ + err = plug_pipelines_set_state(plug, SOF_IPC4_PIPELINE_STATE_RUNNING); + if (err < 0) + return err; + break; + case SOF_PLUGIN_STATE_STREAM_ERROR: + case SOF_PLUGIN_STATE_DEAD: + /* some error */ + SNDERR("write: invalid pipe state: %d", ctx->state); + return -EINVAL; + case SOF_PLUGIN_STATE_READY: + case SOF_PLUGIN_STATE_STREAM_RUNNING: + default: + /* do nothing */ + break; + } + + fprintf(stdout, "PCM prepare done\n"); + + return err; +} + +static int plug_init_shm_ctx(snd_sof_plug_t *plug); + +static int plug_pcm_hw_params(snd_pcm_ioplug_t *io, snd_pcm_hw_params_t *params) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_endpoint *ctx; + struct tplg_pipeline_list *pipeline_list; + int i, err; + + pcm->frame_size = (snd_pcm_format_physical_width(io->format) * io->channels) / 8; + + plug->period_size = io->period_size; + + /* used for wait timeouts */ + pcm->frame_us = ceil(1000000.0 / io->rate); + + /* now send IPCs to set up widgets */ + err = plug_set_up_pipelines(plug, pcm->capture); + if (err < 0) { + fprintf(stderr, "error setting up pipelines\n"); + return err; + } + + if (pcm->capture) + pipeline_list = &plug->pcm_info->capture_pipeline_list; + else + pipeline_list = &plug->pcm_info->playback_pipeline_list; + + /* init and open for PCM ready lock for all pipelines */ + for (i = 0; i < pipeline_list->count; i++) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + + /* init IPC message queue name */ + err = plug_mq_init(&pcm->pipeline_ipc_tx[i], plug->tplg_file, "pcm-tx", + pipe_info->instance_id); + if (err < 0) { + SNDERR("error: invalid name for pipeline IPC mq %s\n", plug->tplg_file); + return err; + } + + /* open the sof-pipe IPC message queue */ + err = plug_mq_open(&pcm->pipeline_ipc_tx[i]); + if (err < 0) { + SNDERR("error: failed to open sof-pipe IPC mq %s: %s", + pcm->pipeline_ipc_tx[i].queue_name, strerror(err)); + return -errno; + } + + /* init IPC message queue name */ + err = plug_mq_init(&pcm->pipeline_ipc_rx[i], plug->tplg_file, "pcm-rx", + pipe_info->instance_id); + if (err < 0) { + SNDERR("error: invalid name for pipeline IPC mq %s\n", plug->tplg_file); + return err; + } + + /* open the sof-pipe IPC message queue */ + err = plug_mq_open(&pcm->pipeline_ipc_rx[i]); + if (err < 0) { + SNDERR("error: failed to open sof-pipe IPC mq %s: %s", + pcm->pipeline_ipc_tx[i].queue_name, strerror(err)); + return -errno; + } + + /* init name for pipeline ready lock */ + err = plug_lock_init(&pcm->ready[i], plug->tplg_file, "ready", + pipe_info->instance_id); + if (err < 0) { + SNDERR("error: invalid name for PCM ready lock %s\n", + pipe_info->instance_id); + return err; + } + + /* init name for pipeline done lock */ + err = plug_lock_init(&pcm->done[i], plug->tplg_file, "done", + pipe_info->instance_id); + if (err < 0) { + SNDERR("error: invalid name for PCM done lock %s\n", + pipe_info->instance_id); + return err; + } + + /* open lock "ready" for pipeline audio data */ + err = plug_lock_open(&pcm->ready[i]); + if (err < 0) { + SNDERR("error: failed to open sof-pipe ready lock %s: %s", + pcm->ready[i].name, strerror(err)); + return -errno; + } + + /* open lock "done" for pipeline audio data */ + err = plug_lock_open(&pcm->done[i]); + if (err < 0) { + SNDERR("error: failed to open sof-pipe done lock %s: %s", + pcm->done[i].name, strerror(err)); + return -errno; + } + } + + /* init global status shm name */ + err = plug_shm_init(&pcm->glb_ctx, plug->tplg_file, "ctx", 0); + if (err < 0) { + SNDERR("error: invalid name for global SHM %s\n", plug->tplg_file); + return err; + } + + /* init PCM shm name */ + err = plug_shm_init(&pcm->shm_pcm, plug->tplg_file, "pcm", plug->pcm_id); + if (err < 0) { + SNDERR("error: invalid name for PCM SHM %s\n", plug->tplg_file); + return err; + } + + /* open the global sof-pipe context via SHM */ + pcm->glb_ctx.size = 128 * 1024; + err = plug_shm_open(&pcm->glb_ctx); + if (err < 0) { + SNDERR("error: failed to open sof-pipe context: %s:%s", + pcm->glb_ctx.name, strerror(err)); + return err; + } + + /* open audio PCM SHM data endpoint */ + err = plug_shm_open(&pcm->shm_pcm); + if (err < 0) { + SNDERR("error: failed to open sof-pipe PCM SHM %s: %s", + pcm->shm_pcm.name, strerror(err)); + return -errno; + } + + /* set up the endpoint configs */ + err = plug_init_shm_ctx(plug); + if (err < 0) { + SNDERR("error: failed to init sof-pipe ep context: %s:%s", + pcm->glb_ctx.name, strerror(err)); + return -err; + } + + ctx = pcm->shm_pcm.addr; + ctx->frame_size = pcm->frame_size; + + /* needs to be set here and NOT in SW params as SW params not + * called in capture flow ? + */ + ctx->buffer_size = io->buffer_size * ctx->frame_size; + + if (!ctx->buffer_size) { + SNDERR("Invalid buffer_size io buffer_size %d ctx->frame_size %d\n", + io->buffer_size, ctx->frame_size); + return -EINVAL; + } + + fprintf(stdout, "PCM hw_params done\n"); + + return 0; +} + +// TODO: why not called for arecord +static int plug_pcm_sw_params(snd_pcm_ioplug_t *io, snd_pcm_sw_params_t *params) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + snd_pcm_uframes_t start_threshold; + struct plug_shm_endpoint *ctx = pcm->shm_pcm.addr; + int err; + + /* get the stream start threshold */ + err = snd_pcm_sw_params_get_start_threshold(params, &start_threshold); + if (err < 0) { + SNDERR("sw params: failed to get start threshold: %s", strerror(err)); + return err; + } + + /* TODO: this seems to be ignored or overridden by application params ??? */ + if (start_threshold < io->period_size) { + start_threshold = io->period_size; + err = snd_pcm_sw_params_set_start_threshold(pcm->io.pcm, + params, start_threshold); + if (err < 0) { + SNDERR("sw params: failed to set start threshold %d: %s", + start_threshold, strerror(err)); + return err; + } + } + + /* keep running as long as we can */ + err = snd_pcm_sw_params_set_avail_min(pcm->io.pcm, params, 1); + if (err < 0) { + SNDERR("sw params: failed to set avail min %d: %s", 1, strerror(err)); + return err; + } + + fprintf(stdout, "sw_params done\n"); + + return 0; +} + +static int plug_pcm_close(snd_pcm_ioplug_t *io) +{ + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_glb_state *ctx = pcm->glb_ctx.addr; + int err = 0; + + printf("%s %d\n", __func__, __LINE__); + + ctx->state = SOF_PLUGIN_STATE_INIT; + + plug_free_topology(plug); + + free(plug->tplg_file); + free(plug->module_prv); + free(plug); + + return err; +} + +static int plug_pcm_hw_free(snd_pcm_ioplug_t *io) +{ + struct tplg_pipeline_list *pipeline_list; + snd_sof_plug_t *plug = io->private_data; + snd_sof_pcm_t *pcm = plug->module_prv; + int ret, i; + + /* reset all pipelines */ + ret = plug_pipelines_set_state(plug, SOF_IPC4_PIPELINE_STATE_RESET); + if (ret < 0) { + fprintf(stderr, "failed to reset pipelines\n"); + return ret; + } + + if (pcm->capture) + pipeline_list = &plug->pcm_info->capture_pipeline_list; + else + pipeline_list = &plug->pcm_info->playback_pipeline_list; + + ret = plug_free_pipelines(plug, pipeline_list, pcm->capture); + if (ret < 0) + return ret; + + close(pcm->shm_pcm.fd); + close(pcm->glb_ctx.fd); + + for (i = 0; i < pipeline_list->count; i++) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + + mq_close(pcm->pipeline_ipc_tx[pipe_info->instance_id].mq); + mq_close(pcm->pipeline_ipc_rx[pipe_info->instance_id].mq); + sem_close(pcm->ready[pipe_info->instance_id].sem); + sem_close(pcm->done[pipe_info->instance_id].sem); + } +} + +static const snd_pcm_ioplug_callback_t sof_playback_callback = { + .start = plug_pcm_start, + .stop = plug_pcm_stop, + .pointer = plug_pcm_pointer, + .transfer = plug_pcm_write, + .delay = plug_pcm_delay, + .prepare = plug_pcm_prepare, + .hw_params = plug_pcm_hw_params, + .hw_free = plug_pcm_hw_free, + .sw_params = plug_pcm_sw_params, + .close = plug_pcm_close, +}; + +static const snd_pcm_ioplug_callback_t sof_capture_callback = { + .start = plug_pcm_start, + .stop = plug_pcm_stop, + .pointer = plug_pcm_pointer, + .transfer = plug_pcm_read, + .delay = plug_pcm_delay, + .prepare = plug_pcm_prepare, + .hw_params = plug_pcm_hw_params, + .sw_params = plug_pcm_sw_params, + .hw_free = plug_pcm_hw_free, + .close = plug_pcm_close, +}; + +static const snd_pcm_access_t access_list[] = { + SND_PCM_ACCESS_RW_INTERLEAVED +}; + +static const unsigned int formats[] = { + SND_PCM_FORMAT_S16_LE, + SND_PCM_FORMAT_FLOAT_LE, + SND_PCM_FORMAT_S32_LE, + SND_PCM_FORMAT_S24_LE, +}; + +/* + * Set HW constraints for the SOF plugin. This needs to be quite unrestrictive atm + * as we really need to parse topology before the HW constraints can be narrowed + * to a range that will work with the specified pipeline. + * TODO: Align with topology. + */ +static int plug_hw_constraint(snd_sof_plug_t *plug) +{ + snd_sof_pcm_t *pcm = plug->module_prv; + snd_pcm_ioplug_t *io = &pcm->io; + int err; + + err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_ACCESS, + ARRAY_SIZE(access_list), + access_list); + if (err < 0) { + SNDERR("constraints: failed to set access: %s", strerror(err)); + return err; + } + + err = snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_FORMAT, + ARRAY_SIZE(formats), formats); + if (err < 0) { + SNDERR("constraints: failed to set format: %s", strerror(err)); + return err; + } + + err = + snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_CHANNELS, + 1, 8); + if (err < 0) { + SNDERR("constraints: failed to set channels: %s", strerror(err)); + return err; + } + + err = snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_RATE, + 1, 192000); + if (err < 0) { + SNDERR("constraints: failed to set rate: %s", strerror(err)); + return err; + } + + err = + snd_pcm_ioplug_set_param_minmax(io, + SND_PCM_IOPLUG_HW_BUFFER_BYTES, + 1, 4 * 1024 * 1024); + if (err < 0) { + SNDERR("constraints: failed to set buffer bytes: %s", strerror(err)); + return err; + } + + err = + snd_pcm_ioplug_set_param_minmax(io, + SND_PCM_IOPLUG_HW_PERIOD_BYTES, + 128, 2 * 1024 * 1024); + if (err < 0) { + SNDERR("constraints: failed to set period bytes: %s", strerror(err)); + return err; + } + + err = + snd_pcm_ioplug_set_param_minmax(io, SND_PCM_IOPLUG_HW_PERIODS, 1, 4); + if (err < 0) { + SNDERR("constraints: failed to set period count: %s", strerror(err)); + return err; + } + + return 0; +} + +/* + * Register the plugin with ALSA and make available for use. + * TODO: setup all audio params + * TODO: setup polling fd for RW or mmap IOs + */ +static int plug_create(snd_sof_plug_t *plug, snd_pcm_t **pcmp, const char *name, + snd_pcm_stream_t stream, int mode) +{ + snd_sof_pcm_t *pcm = plug->module_prv; + int err; + + pcm->io.version = SND_PCM_IOPLUG_VERSION; + pcm->io.name = "ALSA <-> SOF PCM I/O Plugin"; + pcm->io.poll_fd = pcm->shm_pcm.fd; + pcm->io.poll_events = POLLIN; + pcm->io.mmap_rw = 0; + + if (stream == SND_PCM_STREAM_PLAYBACK) + pcm->io.callback = &sof_playback_callback; + else + pcm->io.callback = &sof_capture_callback; + + pcm->io.private_data = plug; + + /* create the plugin */ + err = snd_pcm_ioplug_create(&pcm->io, name, stream, mode); + if (err < 0) { + SNDERR("failed to register plugin %s: %s\n", name, strerror(err)); + return err; + } + + /* set the HW constrainst */ + err = plug_hw_constraint(plug); + if (err < 0) { + snd_pcm_ioplug_delete(&pcm->io); + return err; + } + + *pcmp = pcm->io.pcm; + return 0; +} + +static int plug_init_shm_ctx(snd_sof_plug_t *plug) +{ + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_glb_state *glb = pcm->glb_ctx.addr; + struct endpoint_hw_config *ep; + struct plug_cmdline_item *ci; + struct plug_config *pc; + int i, j; + + glb->num_ep_configs = 0; + + for (i = 0; i < plug->num_cmdline; i++) { + bool found = false; + + if (glb->num_ep_configs >= NUM_EP_CONFIGS - 1) { + SNDERR("error: too many endpoint configs\n"); + return -EINVAL; + } + + ci = &plug->cmdline[i]; + + for (j = 0; j < plug->num_configs; j++) { + pc = &plug->config[j]; + if (strcmp(pc->name, ci->config_name)) + continue; + + ep = &glb->ep_config[glb->num_ep_configs++]; + ep->buffer_frames = pc->buffer_frames; + ep->buffer_time = pc->buffer_time; + ep->channels = pc->channels; + ep->format = pc->format; + ep->period_frames = pc->period_frames; + ep->period_time = pc->period_time; + ep->rate = pc->rate; + ep->pipeline = ci->pcm; + strncpy(ep->card_name, ci->card_name, + sizeof(ep->card_name)); + strncpy(ep->dev_name, ci->dev_name, + sizeof(ep->dev_name)); + strncpy(ep->config_name, ci->config_name, + sizeof(ep->config_name)); + found = true; + break; + } + + if (!found) { + SNDERR("error: config %s not found\n", ci->config_name); + return -EINVAL; + } + } + + return 0; +} + +/* + * Complete parent initialisation. + * 1. Check if pipe already ready by opening SHM context and IPC. + * 2. TODO: check context state and load topology is needed for core. + */ +static int plug_init_sof_pipe(snd_sof_plug_t *plug, snd_pcm_t **pcmp, + const char *name, snd_pcm_stream_t stream, int mode) +{ + snd_sof_pcm_t *pcm = plug->module_prv; + struct plug_shm_glb_state *ctx; + struct timespec delay; + int err, i; + + /* initialize widget, route and pcm lists */ + list_init(&plug->widget_list); + list_init(&plug->route_list); + list_init(&plug->pcm_list); + + plug->tplg.tplg_file = plug->tplg_file; + + /* plugin only works with IPC4 */ + plug->tplg.ipc_major = 4; + + /* parse topology file */ + err = plug_parse_topology(plug); + if (err < 0) { + fprintf(stderr, "error parsing topology %s\n", plug->tplg.tplg_file); + return err; + } + + fprintf(stdout, "topology parsing complete\n"); + + /* init IPC message queue name */ + err = plug_mq_init(&plug->ipc_tx, "sof", "ipc-tx", 0); + if (err < 0) { + SNDERR("error: invalid name for IPC mq %s\n", plug->tplg_file); + return err; + } + + /* open the sof-pipe IPC message queue */ + err = plug_mq_open(&plug->ipc_tx); + if (err < 0) { + SNDERR("error: failed to open sof-pipe IPC mq %s: %s", + plug->ipc_tx.queue_name, strerror(err)); + return -errno; + } + + err = plug_mq_init(&plug->ipc_rx, "sof", "ipc-rx", 0); + if (err < 0) { + SNDERR("error: invalid name for IPC mq %s\n", plug->tplg_file); + return err; + } + + /* open the sof-pipe IPC message queue */ + err = plug_mq_open(&plug->ipc_rx); + if (err < 0) { + SNDERR("error: failed to open sof-pipe IPC mq %s: %s", + plug->ipc_rx.queue_name, strerror(err)); + return -errno; + } + + /* now register the plugin */ + err = plug_create(plug, pcmp, name, stream, mode); + if (err < 0) { + SNDERR("failed to create plugin: %s", strerror(err)); + return -errno; + } + + return 0; +} + +/* + * ALSA PCM plugin entry point. + */ +SND_PCM_PLUGIN_DEFINE_FUNC(sof) +{ + snd_sof_plug_t *plug; + snd_sof_pcm_t *pcm; + int err; + + fprintf(stdout, "This code is WIP. Cmd args & config will possible change over time\n"); + fprintf(stdout, "\nThe 50-sonf.conf file is parsed for PCM configurations which can\n"); + fprintf(stdout, "be mapped on the cmd line to pipeline endpoints.\n"); + fprintf(stdout, "\ni.e. aplay -Dsof:<topology>:<pcm id><card>:<device>:<config> file.wav\n"); + fprintf(stdout, "\nwhich can be used as\n"); + fprintf(stdout, "\ne.g. aplay -Dsof:bdw-nocodec:1:default:default:48k2c16b -f dat ~/audiodump.wav\n\n"); + + /* create context */ + plug = calloc(1, sizeof(*plug)); + if (!plug) + return -ENOMEM; + + pcm = calloc(1, sizeof(*pcm)); + if (!pcm) { + free(plug); + return -ENOMEM; + } + plug->module_prv = pcm; + + if (stream == SND_PCM_STREAM_CAPTURE) + pcm->capture = 1; + + /* parse the ALSA configuration file for sof plugin */ + err = plug_parse_conf(plug, name, root, conf); + if (err < 0) { + SNDERR("failed to parse config: %s", strerror(err)); + goto parse_conf_err; + } + + /* now try and connect to the sof-pipe for this topology */ + err = plug_init_sof_pipe(plug, pcmp, name, stream, mode); + if (err < 0) { + SNDERR("failed to complete plugin init: %s", strerror(err)); + goto pipe_error; + } + + /* everything is good */ + return 0; + +pipe_error: + free(plug->tplg_file); +parse_conf_err: + free(plug->module_prv); +dev_error: + free(plug); + return err; +} + +SND_PCM_PLUGIN_SYMBOL(sof); diff --git a/tools/plugin/alsaplug/plugin.c b/tools/plugin/alsaplug/plugin.c new file mode 100644 index 000000000000..b21e728c69fa --- /dev/null +++ b/tools/plugin/alsaplug/plugin.c @@ -0,0 +1,452 @@ +/*-*- linux-c -*-*/ + +/* + * ALSA <-> SOF PCM I/O plugin + * + * Copyright(c) 2022 Intel Corporation. All rights reserved. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stddef.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <alsa/asoundlib.h> +#include <alsa/pcm_external.h> + +#include "plugin.h" +#include "common.h" + +int plug_mq_cmd_tx_rx(struct plug_mq_desc *ipc_tx, struct plug_mq_desc *ipc_rx, + void *msg, size_t len, void *reply, size_t rlen) +{ + struct timespec ts; + ssize_t ipc_size; + char mailbox[IPC3_MAX_MSG_SIZE]; + int err; + + if (len > IPC3_MAX_MSG_SIZE) { + SNDERR("ipc: message too big %d\n", len); + return -EINVAL; + } + memset(mailbox, 0, IPC3_MAX_MSG_SIZE); + memcpy(mailbox, msg, len); + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &ts); + if (err == -1) { + SNDERR("ipc: cant get time: %s", strerror(errno)); + return -errno; + } + + /* IPCs should be read under 10ms */ + plug_timespec_add_ms(&ts, 10); + + /* now return message completion status */ + err = mq_timedsend(ipc_tx->mq, mailbox, IPC3_MAX_MSG_SIZE, 0, &ts); + if (err == -1) { + SNDERR("error: timeout can't send IPC message queue %s : %s\n", + ipc_tx->queue_name, strerror(errno)); + return -errno; + } + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &ts); + if (err == -1) { + SNDERR("ipc: cant get time: %s", strerror(errno)); + return -errno; + } + + /* IPCs should be processed under 20ms, but wait longer as + * some can take longer especially in valgrind + */ + plug_timespec_add_ms(&ts, 20); + + ipc_size = mq_timedreceive(ipc_rx->mq, mailbox, IPC3_MAX_MSG_SIZE, NULL, &ts); + if (ipc_size == -1) { + //fprintf(stderr, "dbg: timeout can't read IPC message queue %s : %s retrying\n", + // ipc->queue_name, strerror(errno)); + + /* ok, its a long IPC or valgrind, wait longer */ + plug_timespec_add_ms(&ts, 800); + + ipc_size = mq_timedreceive(ipc_rx->mq, mailbox, IPC3_MAX_MSG_SIZE, NULL, &ts); + if (ipc_size == -1) { + SNDERR("error: timeout can't read IPC message queue %s : %s\n", + ipc_rx->queue_name, strerror(errno)); + return -errno; + } + + /* needed for valgrind to complete MQ op before next client IPC */ + ts.tv_nsec = 20 * 1000 * 1000; + ts.tv_sec = 0; + nanosleep(&ts, NULL); + } + + /* do the message work */ + if (rlen && reply) + memcpy(reply, mailbox, rlen); + + return 0; +} + +int plug_mq_cmd(struct plug_mq_desc *ipc, void *msg, size_t len, void *reply, size_t rlen) +{ + return plug_mq_cmd_tx_rx(ipc, ipc, msg, len, reply, rlen); +} + +/* + * Open an existing message queue using IPC object. + */ +int plug_mq_open(struct plug_mq_desc *ipc) +{ + /* now open new queue for Tx and Rx */ + ipc->mq = mq_open(ipc->queue_name, O_RDWR); + if (ipc->mq < 0) { + // SNDERR("failed to open IPC queue %s: %s\n", + // ipc->queue_name, strerror(errno)); + return -errno; + } + + return 0; +} + +/* + * Open an existing semaphore using lock object. + */ +int plug_lock_open(struct plug_sem_desc *lock) +{ + lock->sem = sem_open(lock->name, O_RDWR); + if (lock->sem == SEM_FAILED) { + SNDERR("failed to open semaphore %s: %s\n", lock->name, strerror(errno)); + return -errno; + } + + return 0; +} + +#define itemsize(type, member) sizeof(((type *)0)->member) + +static int parse_conf_long(snd_config_t *cfg, void *obj, size_t size) +{ + long val; + + if (snd_config_get_integer(cfg, &val) < 0) + return -EINVAL; + + *((long *)obj) = val; + return 0; +} + +static int parse_conf_str(snd_config_t *cfg, void *obj, size_t size) +{ + const char *id; + + if (snd_config_get_id(cfg, &id) < 0) + return -EINVAL; + strncpy(obj, id, size); + + return 0; +} + +static int parse_conf_format(snd_config_t *cfg, void *obj, size_t size) +{ + const char *id; + + if (snd_config_get_string(cfg, &id) < 0) + return -EINVAL; + + if (!strcmp("S16_LE", id)) { + *((long *)obj) = SND_PCM_FORMAT_S16_LE; + return 0; + } + if (!strcmp("S32_LE", id)) { + *((long *)obj) = SND_PCM_FORMAT_S32_LE; + return 0; + } + if (!strcmp("S24_4LE", id)) { + *((long *)obj) = SND_PCM_FORMAT_S24_LE; + return 0; + } + if (!strcmp("FLOAT", id)) { + *((long *)obj) = SND_PCM_FORMAT_FLOAT_LE; + return 0; + } + + /* not found */ + SNDERR("error: cant find format: %s", id); + return -EINVAL; +} + +struct config_item { + char *name; + size_t size; + size_t offset; + int (*copy)(snd_config_t *cfg, void *obj, size_t size); +}; + +struct config_item config_items[] = { + {"name", itemsize(struct plug_config, name), + offsetof(struct plug_config, name), parse_conf_str}, + {"rate", itemsize(struct plug_config, rate), + offsetof(struct plug_config, rate), parse_conf_long}, + {"format", itemsize(struct plug_config, format), + offsetof(struct plug_config, format), parse_conf_format}, + {"channels", itemsize(struct plug_config, channels), + offsetof(struct plug_config, channels), parse_conf_long}, + {"period_time", itemsize(struct plug_config, period_time), + offsetof(struct plug_config, period_time), parse_conf_long}, + {"period_frames", itemsize(struct plug_config, period_frames), + offsetof(struct plug_config, period_frames), parse_conf_long}, + {"buffer_time", itemsize(struct plug_config, buffer_time), + offsetof(struct plug_config, buffer_time), parse_conf_long}, + {"buffer_frames", itemsize(struct plug_config, buffer_frames), + offsetof(struct plug_config, buffer_frames), parse_conf_long}, +}; + +static int parse_item(snd_config_t *cfg, const char *id, struct plug_config *dest_cfg) +{ + void *dest = dest_cfg; + int i; + + for (i = 0; i < ARRAY_SIZE(config_items); i++) { + /* does ID match */ + if (strcmp(id, config_items[i].name)) + continue; + + /* now get the value */ + return config_items[i].copy(cfg, dest + config_items[i].offset, + config_items[i].size); + } + + /* not found - non fatal */ + return 0; +} + +static int parse_slave_configs(snd_sof_plug_t *plug, snd_config_t *n) +{ + snd_config_iterator_t si1, si2, snext1, snext2; + struct plug_config *config; + const char *id; + + fprintf(stdout, "Parsing ALSA conf for configs\n"); + + snd_config_for_each(si1, snext1, n) { + snd_config_t *sn1 = snd_config_iterator_entry(si1); + + config = &plug->config[plug->num_configs]; + + /* get config name */ + if (parse_item(sn1, "name", config) < 0) { + SNDERR("error: cant find config name"); + return -EINVAL; + } + + /* now get item values in each config */ + snd_config_for_each(si2, snext2, sn1) { + snd_config_t *sn2 = snd_config_iterator_entry(si2); + + if (snd_config_get_id(sn2, &id) < 0) + continue; + + if (parse_item(sn2, id, config) < 0) { + SNDERR("error: malformed config: %s", id); + return -EINVAL; + } + } + + fprintf(stdout, " config %d: %s\n", plug->num_configs, + config->name); + + /* next config */ + plug->num_configs++; + if (plug->num_configs >= PLUG_MAX_CONFIG) { + SNDERR("error: too many configs"); + return -EINVAL; + } + } + + return 0; +} + +/* + * Parse the client cmdline. Format is + * tplg:pcm:card:dev:config[dai_pipe:card:dev:config]...] + */ +static int parse_client_cmdline(snd_sof_plug_t *plug, char *cmdline) +{ + struct plug_cmdline_item *cmd_item; + char *tplg, *next, *card, *dev, *config, *pcm; + char *tplg_path = getenv("SOF_PLUGIN_TOPOLOGY_PATH"); + char tplg_file[128]; + int ret; + int i; + + if (!tplg_path) { + SNDERR("Invalid topology path. Please set the SOF_PLUGIN_TOPOLOGY_PATH env variable\n"); + return -EINVAL; + } + + /* get topology file */ + tplg = strtok_r(cmdline, ":", &next); + if (!tplg) { + SNDERR("invalid cmdline, cant find topology %s", cmdline); + return -EINVAL; + } + + /* now convert to filename and add the topology path */ + ret = snprintf(tplg_file, sizeof(tplg_file), "%ssof-%s.tplg", tplg_path, tplg); + if (ret < 0) { + SNDERR("invalid cmdline topology file %s", tplg); + return -EINVAL; + } + plug->tplg_file = strdup(tplg_file); + if (!plug->tplg_file) + return -ENOMEM; + + /* get PCM ID */ + pcm = strtok_r(next, ":", &next); + if (!pcm) { + SNDERR("invalid cmdline, cant find PCM %s", pcm); + return -EINVAL; + } + plug->pcm_id = atoi(pcm); + + fprintf(stdout, "Parsing cmd line\n"); + + cmd_item = &plug->cmdline[plug->num_cmdline]; + card = strtok_r(next, ":", &next); + if (!card) { + SNDERR("Invalid card name\n"); + return -EINVAL; + } + dev = strtok_r(next, ":", &next); + if (!dev) { + SNDERR("Invalid dev name\n"); + return -EINVAL; + } + config = strtok_r(next, ":", &next); + + /* tuple needs all three, any missing ? */ + if (!config) { + SNDERR("invalid cmdline, expected pcm(%s):card(%s):dev(%s):config(%s) from %s", + pcm, card, dev, config, tplg); + return -EINVAL; + } + + cmd_item->pcm = atoi(pcm); + strncpy(cmd_item->card_name, card, sizeof(cmd_item->card_name)); + strncpy(cmd_item->dev_name, dev, sizeof(cmd_item->dev_name)); + strncpy(cmd_item->config_name, config, sizeof(cmd_item->config_name)); + + /* + * dev name is special, we cant use "," in the command line + * so need to replace it with a "." and then later change it + * back to "," + */ + for (i = 0; i < sizeof(cmd_item->dev_name); i++) { + if (cmd_item->dev_name[i] != '.') + continue; + cmd_item->dev_name[i] = ','; + break; + } + + fprintf(stdout, " cmd %d: for pcm %d uses %s with PCM %s:%s\n", + plug->num_cmdline, cmd_item->pcm, cmd_item->config_name, + cmd_item->card_name, cmd_item->dev_name); + + plug->num_cmdline++; + + printf("plug: topology file %s with pipe %ld\n", plug->tplg_file, plug->tplg_pipeline); + return 0; +} + +/* + * Parse the ALSA conf for the SOF plugin and construct the command line options + * to be passed into the SOF pipe executable. + * TODO: verify all args + * TODO: validate all args. + * TODO: contruct sof pipe cmd line. + */ +int plug_parse_conf(snd_sof_plug_t *plug, const char *name, snd_config_t *root, + snd_config_t *conf) +{ + snd_config_iterator_t i, next; + const char *tplg = NULL; + + /* + * The topology filename and topology PCM need to be passed in. + * i.e. aplay -Dsof:tplg:pcm:[card:dev:config]...] + */ + snd_config_for_each(i, next, conf) { + snd_config_t *n = snd_config_iterator_entry(i); + const char *id; + + if (snd_config_get_id(n, &id) < 0) + continue; + + /* dont care */ + if (strcmp(id, "comment") == 0 || strcmp(id, "type") == 0 || + strcmp(id, "hint") == 0) + continue; + + /* client command line topology */ + if (strcmp(id, "tplg") == 0) { + if (snd_config_get_string(n, &tplg) < 0) { + SNDERR("Invalid type for %s", id); + return -EINVAL; + } else if (!*tplg) { + tplg = NULL; + } + continue; + } + + /* topology PCM configurations */ + if (strcmp(id, "config") == 0) { + if (parse_slave_configs(plug, n)) + return -EINVAL; + continue; + } + + /* not fatal - carry on and verify later */ + SNDERR("Unknown field %s", id); + } + + /* verify mandatory inputs are specified */ + if (!tplg) { + SNDERR("Missing topology topology"); + return -EINVAL; + } + + /* parse the client command line */ + if (parse_client_cmdline(plug, (char *)tplg)) { + SNDERR("invalid sof cmd line"); + return -EINVAL; + } + + return 0; +} diff --git a/tools/plugin/alsaplug/plugin.h b/tools/plugin/alsaplug/plugin.h new file mode 100644 index 000000000000..d0f6c85a1653 --- /dev/null +++ b/tools/plugin/alsaplug/plugin.h @@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022-2023 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __SOF_PLUGIN_PLUGIN_H__ +#define __SOF_PLUGIN_PLUGIN_H__ + +#include <alsa/asoundlib.h> +#include <sof/list.h> +#include "common.h" + +#include <tplg_parser/topology.h> + +#define PLUG_MAX_CONFIG 128 + +typedef struct snd_sof_plug { + /* conf data */ + char *device; + + /* topology info */ + char *tplg_file; + long tplg_pipeline; // HACK, use configs + + /* number of configurations in plugin conf */ + struct plug_config config[PLUG_MAX_CONFIG]; + int num_configs; + + /* command line arguments */ + struct plug_cmdline_item cmdline[PLUG_MAX_CONFIG]; + int num_cmdline; + + /* topology */ + struct tplg_context tplg; + struct list_item widget_list; + struct list_item route_list; + struct list_item pcm_list; + struct list_item pipeline_list; + int instance_ids[SND_SOC_TPLG_DAPM_LAST]; + struct plug_mq_desc ipc_tx; + struct plug_mq_desc ipc_rx; + + int pcm_id; + struct tplg_pcm_info *pcm_info; + + snd_pcm_uframes_t period_size; + + void *module_prv; /* module private data */ +} snd_sof_plug_t; + +/* + * ALSA Conf + */ +int sofplug_load_hook(snd_config_t *root, snd_config_t *config, + snd_config_t **dst, snd_config_t *private_data); + +int plug_parse_conf(snd_sof_plug_t *plug, const char *name, + snd_config_t *root, snd_config_t *conf); +int plug_parse_topology(snd_sof_plug_t *plug); +int plug_set_up_pipelines(snd_sof_plug_t *plug, int dir); +int plug_free_pipelines(snd_sof_plug_t *plug, struct tplg_pipeline_list *pipeline_list, int dir); +void plug_free_topology(snd_sof_plug_t *plug); + +#endif diff --git a/tools/plugin/alsaplug/tplg.c b/tools/plugin/alsaplug/tplg.c new file mode 100644 index 000000000000..5b67b47aedfc --- /dev/null +++ b/tools/plugin/alsaplug/tplg.c @@ -0,0 +1,1479 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2018 Intel Corporation. All rights reserved. +// +// Author: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> +// Liam Girdwood <liam.r.girdwood@linux.intel.com> + +/* Topology loader to set up components and pipeline */ + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <signal.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <dlfcn.h> + +#include <ipc4/error_status.h> + +#include <tplg_parser/topology.h> +#include <tplg_parser/tokens.h> + +#include <alsa/asoundlib.h> +#include <alsa/control_external.h> +#include <alsa/pcm_external.h> + +#include "plugin.h" + +#define FILE_READ 0 +#define FILE_WRITE 1 + +#define MAX_TPLG_OBJECT_SIZE 4096 + +//#include <sound/asound.h> + +/* temporary - current MAXLEN is not define in UAPI header - fix pending */ +#ifndef SNDRV_CTL_ELEM_ID_NAME_MAXLEN +#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44 +#endif +#include <alsa/sound/asoc.h> + +#define SOF_IPC4_FW_PAGE(x) ((((x) + BIT(12) - 1) & ~(BIT(12) - 1)) >> 12) +#define SOF_IPC4_FW_ROUNDUP(x) (((x) + BIT(6) - 1) & (~(BIT(6) - 1))) +#define SOF_IPC4_MODULE_INSTANCE_LIST_ITEM_SIZE 12 +#define SOF_IPC4_PIPELINE_OBJECT_SIZE 448 +#define SOF_IPC4_DATA_QUEUE_OBJECT_SIZE 128 +#define SOF_IPC4_LL_TASK_OBJECT_SIZE 72 +#define SOF_IPC4_LL_TASK_LIST_ITEM_SIZE 12 +#define SOF_IPC4_FW_MAX_QUEUE_COUNT 8 + +static const struct sof_topology_token ipc4_comp_tokens[] = { + {SOF_TKN_COMP_IS_PAGES, SND_SOC_TPLG_TUPLE_TYPE_WORD, tplg_token_get_uint32_t, + offsetof(struct ipc4_base_module_cfg, is_pages)}, +}; + +static int plug_parse_ipc4_comp_tokens(snd_sof_plug_t *plug, struct ipc4_base_module_cfg *base_cfg) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + struct snd_soc_tplg_vendor_array *array = &ctx->widget->priv.array[0]; + int size = ctx->widget->priv.size; + int ret; + + ret = sof_parse_token_sets(base_cfg, ipc4_comp_tokens, ARRAY_SIZE(ipc4_comp_tokens), + array, size, 1, 0); + if (ret < 0) + return ret; + + return sof_parse_tokens(&comp_info->uuid, comp_ext_tokens, + ARRAY_SIZE(comp_ext_tokens), array, size); +} + +static void plug_setup_widget_ipc_msg(struct tplg_comp_info *comp_info) +{ + struct ipc4_module_init_instance *module_init = &comp_info->module_init; + + module_init->primary.r.type = SOF_IPC4_MOD_INIT_INSTANCE; + module_init->primary.r.module_id = comp_info->module_id; + module_init->primary.r.instance_id = comp_info->instance_id; + module_init->primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_MODULE_MSG; + module_init->primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; +} + +static int plug_aif_in_out(snd_sof_plug_t *plug, int dir) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + int ret; + + ret = tplg_parse_widget_audio_formats(ctx); + if (ret < 0) + return ret; + + comp_info->ipc_payload = calloc(sizeof(struct ipc4_base_module_cfg), 1); + if (!comp_info->ipc_payload) + return -ENOMEM; + + comp_info->ipc_size = sizeof(struct ipc4_base_module_cfg); + + if (dir == SOF_IPC_STREAM_PLAYBACK) { + comp_info->module_id = 0x96; + plug_setup_widget_ipc_msg(comp_info); + } else { + comp_info->module_id = 0x98; + plug_setup_widget_ipc_msg(comp_info); + } + + return 0; +} + +static int plug_dai_in_out(snd_sof_plug_t *plug, int dir) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + int ret; + + ret = tplg_parse_widget_audio_formats(ctx); + if (ret < 0) + return ret; + + comp_info->ipc_payload = calloc(sizeof(struct ipc4_base_module_cfg), 1); + if (!comp_info->ipc_payload) + return -ENOMEM; + + comp_info->ipc_size = sizeof(struct ipc4_base_module_cfg); + + if (dir == SOF_IPC_STREAM_PLAYBACK) { + comp_info->module_id = 0x97; + plug_setup_widget_ipc_msg(comp_info); + } else { + comp_info->module_id = 0x99; + plug_setup_widget_ipc_msg(comp_info); + } + + return 0; +} + +static int plug_new_src_ipc(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + char tplg_object[MAX_TPLG_OBJECT_SIZE] = {0}; + struct sof_ipc_comp_src *src = + (struct sof_ipc_comp_src *)tplg_object; + struct snd_soc_tplg_ctl_hdr *tplg_ctl; + int ret; + + tplg_ctl = calloc(ctx->hdr->payload_size, 1); + if (!tplg_ctl) + return -ENOMEM; + + ret = tplg_new_src(ctx, &src->comp, MAX_TPLG_OBJECT_SIZE, + tplg_ctl, ctx->hdr->payload_size); + if (ret < 0) { + SNDERR("error: failed to create src\n"); + goto out; + } + +out: + free(tplg_ctl); + return ret; +} + +static int plug_new_asrc_ipc(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + char tplg_object[MAX_TPLG_OBJECT_SIZE] = {0}; + struct sof_ipc_comp_asrc *asrc = + (struct sof_ipc_comp_asrc *)tplg_object; + struct snd_soc_tplg_ctl_hdr *tplg_ctl; + int ret; + + tplg_ctl = calloc(ctx->hdr->payload_size, 1); + if (!tplg_ctl) + return -ENOMEM; + + ret = tplg_new_asrc(ctx, &asrc->comp, MAX_TPLG_OBJECT_SIZE, + tplg_ctl, ctx->hdr->payload_size); + if (ret < 0) { + SNDERR("error: failed to create PGA\n"); + goto out; + } + +out: + free(tplg_ctl); + return ret; +} + +static int plug_new_mixer(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + char tplg_object[MAX_TPLG_OBJECT_SIZE] = {0}; + struct sof_ipc_comp_mixer *mixer = + (struct sof_ipc_comp_mixer *)tplg_object; + struct snd_soc_tplg_ctl_hdr *tplg_ctl; + int ret; + + tplg_ctl = calloc(ctx->hdr->payload_size, 1); + if (!tplg_ctl) + return -ENOMEM; + + comp_info->instance_id = plug->instance_ids[SND_SOC_TPLG_DAPM_MIXER]++; + comp_info->ipc_size = sizeof(struct ipc4_base_module_cfg); + comp_info->ipc_payload = calloc(comp_info->ipc_size, 1); + if (!comp_info->ipc_payload) + return -ENOMEM; + + ret = tplg_new_mixer(ctx, &mixer->comp, MAX_TPLG_OBJECT_SIZE, + tplg_ctl, ctx->hdr->payload_size); + if (ret < 0) { + SNDERR("error: failed to create mixer\n"); + goto out; + } + + if (strstr(comp_info->name, "mixin")) { + comp_info->module_id = 0x2; + plug_setup_widget_ipc_msg(comp_info); + } else { + comp_info->module_id = 0x3; + plug_setup_widget_ipc_msg(comp_info); + } +out: + free(tplg_ctl); + return ret; +} + +static int plug_new_pga(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + struct ipc4_peak_volume_config volume; + struct snd_soc_tplg_ctl_hdr *tplg_ctl; + int ret; + + comp_info->ipc_size = + sizeof(struct ipc4_peak_volume_config) + sizeof(struct ipc4_base_module_cfg); + comp_info->ipc_payload = calloc(comp_info->ipc_size, 1); + if (!comp_info->ipc_payload) + return -ENOMEM; + + /* FIXME: move this to when the widget is actually set up */ + comp_info->instance_id = plug->instance_ids[SND_SOC_TPLG_DAPM_PGA]++; + comp_info->module_id = 0x6; + + tplg_ctl = calloc(ctx->hdr->payload_size, 1); + if (!tplg_ctl) { + free(comp_info->ipc_payload); + return -ENOMEM; + } + + ret = tplg_new_pga(ctx, &volume, sizeof(struct ipc4_peak_volume_config), + tplg_ctl, ctx->hdr->payload_size); + if (ret < 0) { + SNDERR("%s: failed to create PGA\n", __func__); + goto out; + } + + /* copy volume data to ipc_payload */ + memcpy(comp_info->ipc_payload + sizeof(struct ipc4_base_module_cfg), + &volume, sizeof(struct ipc4_peak_volume_config)); + + /* skip kcontrols for now */ + if (tplg_create_controls(ctx, ctx->widget->num_kcontrols, + tplg_ctl, ctx->hdr->payload_size, &volume) < 0) { + SNDERR("error: loading controls\n"); + goto out; + } + + plug_setup_widget_ipc_msg(comp_info); + + free(tplg_ctl); + + return ret; + +out: + free(tplg_ctl); + free(comp_info->ipc_payload); + + return ret; +} + +static int plug_new_process(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + struct sof_ipc_comp_process *process; + struct snd_soc_tplg_ctl_hdr *tplg_ctl; + int ret; + + process = calloc(MAX_TPLG_OBJECT_SIZE, 1); + if (!process) + return -ENOMEM; + + comp_info->ipc_payload = process; + + tplg_ctl = calloc(ctx->hdr->payload_size, 1); + if (!tplg_ctl) { + free(process); + return -ENOMEM; + } + + ret = tplg_new_process(ctx, process, MAX_TPLG_OBJECT_SIZE, + tplg_ctl, ctx->hdr->payload_size); + if (ret < 0) { + SNDERR("error: failed to create PGA\n"); + goto out; + } +out: + free(tplg_ctl); + return ret; +} + +static int plug_new_pipeline(snd_sof_plug_t *plug) +{ + struct tplg_pipeline_info *pipe_info; + struct sof_ipc_pipe_new pipeline = {0}; + struct snd_soc_tplg_ctl_hdr *tplg_ctl; + struct tplg_context *ctx = &plug->tplg; + int ret; + + tplg_ctl = calloc(ctx->hdr->payload_size, 1); + if (!tplg_ctl) + return -ENOMEM; + + pipe_info = calloc(sizeof(struct tplg_pipeline_info), 1); + if (!pipe_info) { + ret = -ENOMEM; + goto out; + } + + pipe_info->name = strdup(ctx->widget->name); + if (!pipe_info->name) { + free(pipe_info); + goto out; + } + + pipe_info->id = ctx->pipeline_id; + + ret = tplg_new_pipeline(ctx, &pipeline, sizeof(pipeline), tplg_ctl); + if (ret < 0) { + SNDERR("error: failed to create pipeline\n"); + free(pipe_info->name); + free(pipe_info); + goto out; + } + + list_item_append(&pipe_info->item, &plug->pipeline_list); + tplg_debug("loading pipeline %s\n", pipe_info->name); +out: + free(tplg_ctl); + return ret; +} + +static int plug_new_buffer(snd_sof_plug_t *plug) +{ + struct ipc4_copier_module_cfg *copier = calloc(sizeof(struct ipc4_copier_module_cfg), 1); + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info = ctx->current_comp_info; + int ret; + + if (!copier) + return -ENOMEM; + + comp_info->ipc_payload = copier; + + ret = tplg_new_buffer(ctx, copier, sizeof(copier), NULL, 0); + if (ret < 0) { + SNDERR("error: failed to create pipeline\n"); + free(copier); + } + + return ret; +} + +/* Insert new comp info into the list of widgets */ +static inline int plug_insert_comp(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + struct tplg_comp_info *comp_info; + int comp_id = ctx->comp_id; + int ret; + + if (ctx->widget->id == SND_SOC_TPLG_DAPM_SCHEDULER) + return 0; + + comp_info = calloc(sizeof(struct tplg_comp_info), 1); + if (!comp_info) + return -ENOMEM; + + comp_info->name = strdup(ctx->widget->name); + if (!comp_info->name) { + ret = -ENOMEM; + goto err; + } + + comp_info->stream_name = strdup(ctx->widget->sname); + if (!comp_info->stream_name) { + ret = -ENOMEM; + goto sname_err; + } + + comp_info->id = comp_id; + comp_info->type = ctx->widget->id; + comp_info->pipeline_id = ctx->pipeline_id; + ctx->current_comp_info = comp_info; + + ret = plug_parse_ipc4_comp_tokens(plug, &comp_info->basecfg); + if (ret < 0) + goto sname_err; + + list_item_append(&comp_info->item, &plug->widget_list); + + tplg_debug("debug: loading comp_id %d: widget %s type %d size %d at offset %ld is_pages %d\n", + comp_id, ctx->widget->name, ctx->widget->id, ctx->widget->size, + ctx->tplg_offset, comp_info->basecfg.is_pages); + + return 0; +sname_err: + free(comp_info->name); +err: + free(comp_info); + return ret; +} + +/* load dapm widget */ +static int plug_load_widget(snd_sof_plug_t *plug) +{ + struct tplg_context *ctx = &plug->tplg; + int ret = 0; + + /* get next widget */ + ctx->widget = tplg_get_widget(ctx); + ctx->widget_size = ctx->widget->size; + + /* insert widget into mapping */ + ret = plug_insert_comp(plug); + if (ret < 0) { + SNDERR("plug_load_widget: invalid widget index\n"); + return ret; + } + + /* load widget based on type */ + switch (ctx->widget->id) { + /* load pga widget */ + case SND_SOC_TPLG_DAPM_PGA: + if (plug_new_pga(plug) < 0) { + SNDERR("error: load pga\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_AIF_IN: + if (plug_aif_in_out(plug, SOF_IPC_STREAM_PLAYBACK) < 0) { + SNDERR("error: load AIF IN failed\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_AIF_OUT: + if (plug_aif_in_out(plug, SOF_IPC_STREAM_CAPTURE) < 0) { + SNDERR("error: load AIF OUT failed\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_DAI_IN: + if (plug_dai_in_out(plug, SOF_IPC_STREAM_PLAYBACK) < 0) { + SNDERR("error: load filewrite\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_DAI_OUT: + if (plug_dai_in_out(plug, SOF_IPC_STREAM_CAPTURE) < 0) { + SNDERR("error: load filewrite\n"); + ret = -EINVAL; + goto exit; + } + break; + + case SND_SOC_TPLG_DAPM_BUFFER: + if (plug_new_buffer(plug) < 0) { + SNDERR("error: load pipeline\n"); + ret = -EINVAL; + goto exit; + } + break; + + case SND_SOC_TPLG_DAPM_SCHEDULER: + if (plug_new_pipeline(plug) < 0) { + SNDERR("error: load pipeline\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_SRC: + if (plug_new_src_ipc(plug) < 0) { + SNDERR("error: load src\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_ASRC: + if (plug_new_asrc_ipc(plug) < 0) { + SNDERR("error: load asrc\n"); + ret = -EINVAL; + goto exit; + } + break; + + case SND_SOC_TPLG_DAPM_MIXER: + if (plug_new_mixer(plug) < 0) { + SNDERR("error: load mixer\n"); + ret = -EINVAL; + goto exit; + } + break; + case SND_SOC_TPLG_DAPM_EFFECT: + if (plug_new_process(plug) < 0) { + SNDERR("error: load effect\n"); + ret = -EINVAL; + goto exit; + } + break; + + /* unsupported widgets */ + default: + tplg_debug("info: Widget %s id %d unsupported and skipped: size %d priv size %d\n", + ctx->widget->name, ctx->widget->id, + ctx->widget->size, ctx->widget->priv.size); + +#if 0 + if (fseek(ctx->file, ctx->widget->priv.size, SEEK_CUR)) { + SNDERR("error: fseek unsupported widget\n"); + ret = -errno; + goto exit; + } + ret = tplg_create_controls(ctx->widget->num_kcontrols, ctx->file, NULL, 0); + if (ret < 0) { + SNDERR("error: loading controls\n"); + //goto exit; + } +#endif + ret = 0; + break; + } + + ret = 1; + +exit: + return ret; +} + +static int plug_register_graph(snd_sof_plug_t *plug, int count) +{ + struct tplg_context *ctx = &plug->tplg; + int ret = 0; + int i; + + for (i = 0; i < count; i++) { + ret = tplg_parse_graph(ctx, &plug->widget_list, &plug->route_list); + if (ret < 0) + return ret; + } + + return ret; +} + +static int plug_parse_pcm(snd_sof_plug_t *plug, int count) +{ + struct tplg_context *ctx = &plug->tplg; + int ret, i; + + for (i = 0; i < count; i++) { + ret = tplg_parse_pcm(ctx, &plug->widget_list, &plug->pcm_list); + if (ret < 0) + return ret; + } + + return 0; +} + +static void +plug_pipeline_update_resource_usage(snd_sof_plug_t *plug, struct tplg_comp_info *comp_info) +{ + struct ipc4_base_module_cfg *base_config = &comp_info->basecfg; + struct tplg_pipeline_info *pipe_info = comp_info->pipe_info; + int task_mem, queue_mem; + int ibs, bss, total; + + ibs = base_config->ibs; + bss = base_config->is_pages; + + task_mem = SOF_IPC4_PIPELINE_OBJECT_SIZE; + task_mem += SOF_IPC4_MODULE_INSTANCE_LIST_ITEM_SIZE + bss; + + /* LL modules */ + task_mem += SOF_IPC4_FW_ROUNDUP(SOF_IPC4_LL_TASK_OBJECT_SIZE); + task_mem += SOF_IPC4_FW_MAX_QUEUE_COUNT * SOF_IPC4_MODULE_INSTANCE_LIST_ITEM_SIZE; + task_mem += SOF_IPC4_LL_TASK_LIST_ITEM_SIZE; + + ibs = SOF_IPC4_FW_ROUNDUP(ibs); + queue_mem = SOF_IPC4_FW_MAX_QUEUE_COUNT * (SOF_IPC4_DATA_QUEUE_OBJECT_SIZE + ibs); + + total = SOF_IPC4_FW_PAGE(task_mem + queue_mem); + + pipe_info->mem_usage += total; +} + +static int plug_is_single_format(struct sof_ipc4_pin_format *fmts, int num_formats) +{ + struct sof_ipc4_pin_format *fmt = &fmts[0]; + uint32_t _rate, _channels, _valid_bits; + int i; + + _rate = fmt->audio_fmt.sampling_frequency; + _channels = fmt->audio_fmt.fmt_cfg & MASK(7, 0); + _valid_bits = (fmt->audio_fmt.fmt_cfg & MASK(15, 8)) >> 8; + for (i = 1; i < num_formats; i++) { + struct sof_ipc4_pin_format *fmt = &fmts[i]; + uint32_t rate, channels, valid_bits; + + rate = fmt->audio_fmt.sampling_frequency; + channels = fmt->audio_fmt.fmt_cfg & MASK(7, 0); + valid_bits = (fmt->audio_fmt.fmt_cfg & MASK(15, 8)) >> 8; + if (rate != _rate || channels != _channels || valid_bits != _valid_bits) + return false; + } + + return true; +} + +static int plug_match_audio_format(snd_sof_plug_t *plug, struct tplg_comp_info *comp_info, + struct plug_config *config) +{ + struct sof_ipc4_available_audio_format *available_fmt = &comp_info->available_fmt; + struct ipc4_base_module_cfg *base_cfg = &comp_info->basecfg; + struct sof_ipc4_pin_format *fmt; + int config_valid_bits; + int i; + + switch (config->format) { + case SND_PCM_FORMAT_S16_LE: + config_valid_bits = 16; + break; + case SND_PCM_FORMAT_S32_LE: + config_valid_bits = 32; + break; + case SND_PCM_FORMAT_S24_LE: + config_valid_bits = 24; + break; + default: + break; + } + + if (plug_is_single_format(available_fmt->input_pin_fmts, + available_fmt->num_input_formats)) { + fmt = &available_fmt->input_pin_fmts[0]; + goto out; + } + + for (i = 0; i < available_fmt->num_input_formats; i++) { + uint32_t rate, channels, valid_bits; + + fmt = &available_fmt->input_pin_fmts[i]; + + rate = fmt->audio_fmt.sampling_frequency; + channels = fmt->audio_fmt.fmt_cfg & MASK(7, 0); + valid_bits = (fmt->audio_fmt.fmt_cfg & MASK(15, 8)) >> 8; + + if (rate == config->rate && channels == config->channels && + valid_bits == config_valid_bits) + break; + } + + if (i == available_fmt->num_input_formats) { + SNDERR("Cannot find matching format for rate %d channels %d valid_bits %d for %s\n", + config->rate, config->channels, config_valid_bits, comp_info->name); + return -EINVAL; + } +out: + + base_cfg->audio_fmt.sampling_frequency = fmt->audio_fmt.sampling_frequency; + base_cfg->audio_fmt.depth = fmt->audio_fmt.bit_depth; + base_cfg->audio_fmt.ch_map = fmt->audio_fmt.ch_map; + base_cfg->audio_fmt.ch_cfg = fmt->audio_fmt.ch_cfg; + base_cfg->audio_fmt.interleaving_style = fmt->audio_fmt.interleaving_style; + base_cfg->audio_fmt.channels_count = fmt->audio_fmt.fmt_cfg & MASK(7, 0); + base_cfg->audio_fmt.valid_bit_depth = + (fmt->audio_fmt.fmt_cfg & MASK(15, 8)) >> 8; + base_cfg->audio_fmt.s_type = + (fmt->audio_fmt.fmt_cfg & MASK(23, 16)) >> 16; + base_cfg->ibs = fmt->buffer_size; + + /* + * FIXME: is this correct? Choose ALSA period size for obs so that the buffer sizes + * will set accodingly. Need to get channel count and format from output format + */ + base_cfg->obs = plug->period_size * 2 * 2; + + return 0; +} + +static int plug_set_up_widget_base_config(snd_sof_plug_t *plug, struct tplg_comp_info *comp_info) +{ + struct plug_cmdline_item *cmd_item = &plug->cmdline[0]; + struct plug_config *config; + bool config_found = false; + int ret, i; + + for (i < 0; i < plug->num_configs; i++) { + config = &plug->config[i]; + + if (!strcmp(config->name, cmd_item->config_name)) { + config_found = true; + break; + } + } + + if (!config_found) { + SNDERR("unsupported config requested %s\n", cmd_item->config_name); + return -ENOTSUP; + } + + /* match audio formats and populate base config */ + ret = plug_match_audio_format(plug, comp_info, config); + if (ret < 0) + return ret; + + /* copy the basecfg into the ipc payload */ + memcpy(comp_info->ipc_payload, &comp_info->basecfg, sizeof(struct ipc4_base_module_cfg)); + + return 0; +} + +/* parse topology file and set up pipeline */ +int plug_parse_topology(snd_sof_plug_t *plug) + +{ + struct tplg_context *ctx = &plug->tplg; + struct snd_soc_tplg_hdr *hdr; + struct list_item *item; + char pipeline_string[256] = {0}; + int i; + int ret = 0; + FILE *file; + size_t size; + + tplg_debug("parsing topology file %s\n", ctx->tplg_file); + + /* TODO: ctl callback */ +// ctx->ctl_arg = sp; +// ctx->ctl_cb = pipe_kcontrol_cb_new; + + /* open topology file */ + file = fopen(ctx->tplg_file, "rb"); + if (!file) { + SNDERR("error: can't open topology %s : %s\n", ctx->tplg_file, strerror(errno)); + return -errno; + } + + /* file size */ + if (fseek(file, 0, SEEK_END)) { + SNDERR("error: can't seek to end of topology: %s\n", strerror(errno)); + fclose(file); + return -errno; + } + ctx->tplg_size = ftell(file); + if (fseek(file, 0, SEEK_SET)) { + SNDERR("error: can't seek to beginning of topology: %s\n", strerror(errno)); + fclose(file); + return -errno; + } + + /* load whole topology into memory */ + ctx->tplg_base = calloc(ctx->tplg_size, 1); + if (!ctx->tplg_base) { + SNDERR("error: can't alloc buffer for topology %zu bytes\n", ctx->tplg_size); + fclose(file); + return -ENOMEM; + } + ret = fread(ctx->tplg_base, ctx->tplg_size, 1, file); + if (ret != 1) { + SNDERR("error: can't read topology: %s\n", + strerror(errno)); + fclose(file); + return -errno; + } + fclose(file); + + /* initialize widget, route, pipeline and pcm lists */ + list_init(&plug->widget_list); + list_init(&plug->route_list); + list_init(&plug->pcm_list); + list_init(&plug->pipeline_list); + + while (ctx->tplg_offset < ctx->tplg_size) { + /* read next topology header */ + hdr = tplg_get_hdr(ctx); + + tplg_debug("type: %x, size: 0x%x count: %d index: %d\n", + hdr->type, hdr->payload_size, hdr->count, hdr->index); + + ctx->hdr = hdr; + + /* parse header and load the next block based on type */ + switch (hdr->type) { + /* load dapm widget */ + case SND_SOC_TPLG_TYPE_DAPM_WIDGET: + tplg_debug("number of DAPM widgets %d\n", hdr->count); + + /* update max pipeline_id */ + ctx->pipeline_id = hdr->index; + + for (i = 0; i < hdr->count; i++) { + ret = plug_load_widget(plug); + if (ret < 0) { + SNDERR("error: loading widget\n"); + return ret; + } + ctx->comp_id++; + } + break; + /* set up component connections from pipeline graph */ + case SND_SOC_TPLG_TYPE_DAPM_GRAPH: + if (plug_register_graph(plug, hdr->count) < 0) { + SNDERR("error: pipeline graph\n"); + return -EINVAL; + } + break; + /* parse PCM info */ + case SND_SOC_TPLG_TYPE_PCM: + ret = plug_parse_pcm(plug, hdr->count); + if (ret < 0) + goto out; + break; + default: + tplg_debug("%s %d\n", __func__, __LINE__); + tplg_skip_hdr_payload(ctx); + break; + } + } + + /* assign pipeline to every widget in the widget list */ + list_for_item(item, &plug->widget_list) { + struct tplg_comp_info *comp_info = container_of(item, struct tplg_comp_info, item); + struct list_item *pipe_item; + + list_for_item(pipe_item, &plug->pipeline_list) { + struct tplg_pipeline_info *pipe_info; + + pipe_info = container_of(pipe_item, struct tplg_pipeline_info, item); + if (pipe_info->id == comp_info->pipeline_id) { + comp_info->pipe_info = pipe_info; + break; + } + } + + if (!comp_info->pipe_info) { + SNDERR("Error assigning pipeline for %s\n", comp_info->name); + return -EINVAL; + } + } +out: + return ret; +} + +static int plug_set_up_widget_ipc(snd_sof_plug_t *plug, struct tplg_comp_info *comp_info) +{ + struct ipc4_module_init_instance *module_init = &comp_info->module_init; + struct ipc4_message_reply reply; + void *msg; + int size, ret; + + module_init->extension.r.param_block_size = comp_info->ipc_size >> 2; + module_init->extension.r.ppl_instance_id = comp_info->pipe_info->instance_id; + + size = sizeof(*module_init) + comp_info->ipc_size; + msg = calloc(size, 1); + if (!msg) + return -ENOMEM; + + memcpy(msg, module_init, sizeof(*module_init)); + memcpy(msg + sizeof(*module_init), comp_info->ipc_payload, comp_info->ipc_size); + + ret = plug_mq_cmd_tx_rx(&plug->ipc_tx, &plug->ipc_rx, + msg, size, &reply, sizeof(reply)); + free(msg); + if (ret < 0) { + SNDERR("error: can't set up widget %s\n", comp_info->name); + return ret; + } + + if (reply.primary.r.status != IPC4_SUCCESS) { + SNDERR("widget %s set up failed with status %d\n", + comp_info->name, reply.primary.r.status); + return -EINVAL; + } + return 0; +} + +static int plug_set_up_pipeline(snd_sof_plug_t *plug, struct tplg_pipeline_info *pipe_info) +{ + struct ipc4_pipeline_create msg; + struct ipc4_message_reply reply; + int ret; + + msg.primary.r.type = SOF_IPC4_GLB_CREATE_PIPELINE; + msg.primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG; + msg.primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; + pipe_info->instance_id = plug->instance_ids[SND_SOC_TPLG_DAPM_SCHEDULER]++; + msg.primary.r.instance_id = pipe_info->instance_id; + msg.primary.r.ppl_mem_size = pipe_info->mem_usage; + + ret = plug_mq_cmd_tx_rx(&plug->ipc_tx, &plug->ipc_rx, + &msg, sizeof(msg), &reply, sizeof(reply)); + if (ret < 0) { + SNDERR("error: can't set up pipeline %s\n", pipe_info->name); + return ret; + } + + if (reply.primary.r.status != IPC4_SUCCESS) { + SNDERR("pipeline %s instance ID %d set up failed with status %d\n", + pipe_info->name, pipe_info->instance_id, reply.primary.r.status); + return -EINVAL; + } + + tplg_debug("pipeline %s instance_id %d mem_usage %d set up\n", pipe_info->name, + pipe_info->instance_id, pipe_info->mem_usage); + + return 0; +} + +static int plug_prepare_widget(snd_sof_plug_t *plug, struct tplg_pcm_info *pcm_info, + struct tplg_comp_info *comp_info, int dir) +{ + struct tplg_pipeline_list *pipeline_list; + int ret, i; + + if (dir) + pipeline_list = &pcm_info->capture_pipeline_list; + else + pipeline_list = &pcm_info->playback_pipeline_list; + + /* populate base config */ + ret = plug_set_up_widget_base_config(plug, comp_info); + if (ret < 0) + return ret; + + plug_pipeline_update_resource_usage(plug, comp_info); + + /* add pipeline to pcm pipeline_list if needed */ + for (i = 0; i < pipeline_list->count; i++) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + + if (pipe_info == comp_info->pipe_info) + break; + } + + if (i == pipeline_list->count) { + pipeline_list->pipelines[pipeline_list->count] = comp_info->pipe_info; + pipeline_list->count++; + } + + tplg_debug("widget %s prepared\n", comp_info->name); + return 0; +} + +static int plug_prepare_widgets(snd_sof_plug_t *plug, struct tplg_pcm_info *pcm_info, + struct tplg_comp_info *starting_comp_info, + struct tplg_comp_info *current_comp_info) +{ + struct list_item *item; + int ret; + + /* for playback */ + list_for_item(item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + if (route_info->source != current_comp_info) + continue; + + /* set up source widget if it is the starting widget */ + if (starting_comp_info == current_comp_info) { + ret = plug_prepare_widget(plug, pcm_info, current_comp_info, 0); + if (ret < 0) + return ret; + } + + /* set up the sink widget */ + ret = plug_prepare_widget(plug, pcm_info, route_info->sink, 0); + if (ret < 0) + return ret; + + /* and then continue down the path */ + if (route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_IN || + route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_OUT) { + ret = plug_prepare_widgets(plug, pcm_info, starting_comp_info, + route_info->sink); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static int plug_prepare_widgets_capture(snd_sof_plug_t *plug, struct tplg_pcm_info *pcm_info, + struct tplg_comp_info *starting_comp_info, + struct tplg_comp_info *current_comp_info) +{ + struct list_item *item; + int ret; + + /* for playback */ + list_for_item(item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + if (route_info->sink != current_comp_info) + continue; + + /* set up sink widget if it is the starting widget */ + if (starting_comp_info == current_comp_info) { + ret = plug_prepare_widget(plug, pcm_info, current_comp_info, 1); + if (ret < 0) + return ret; + } + + /* set up the source widget */ + ret = plug_prepare_widget(plug, pcm_info, route_info->source, 1); + if (ret < 0) + return ret; + + /* and then continue up the path */ + if (route_info->source->type != SND_SOC_TPLG_DAPM_DAI_IN && + route_info->source->type != SND_SOC_TPLG_DAPM_DAI_OUT) { + ret = plug_prepare_widgets(plug, pcm_info, starting_comp_info, + route_info->source); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static int plug_set_up_route(snd_sof_plug_t *plug, struct tplg_route_info *route_info) +{ + struct tplg_comp_info *src_comp_info = route_info->source; + struct tplg_comp_info *sink_comp_info = route_info->sink; + struct ipc4_module_bind_unbind bu; + struct ipc4_message_reply reply; + int ret; + + bu.primary.r.module_id = src_comp_info->module_id; + bu.primary.r.instance_id = src_comp_info->instance_id; + bu.primary.r.type = SOF_IPC4_MOD_BIND; + bu.primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_MODULE_MSG; + bu.primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; + + bu.extension.r.dst_module_id = sink_comp_info->module_id; + bu.extension.r.dst_instance_id = sink_comp_info->instance_id; + + /* FIXME: assign queue ID for components with multiple inputs/outputs */ + bu.extension.r.dst_queue = 0; + bu.extension.r.src_queue = 0; + + ret = plug_mq_cmd_tx_rx(&plug->ipc_tx, &plug->ipc_rx, + &bu, sizeof(bu), &reply, sizeof(reply)); + if (ret < 0) { + SNDERR("error: can't set up route %s -> %s\n", src_comp_info->name, + sink_comp_info->name); + return ret; + } + + if (reply.primary.r.status != IPC4_SUCCESS) { + SNDERR("route %s -> %s ID set up failed with status %d\n", + src_comp_info->name, sink_comp_info->name, reply.primary.r.status); + return -EINVAL; + } + + tplg_debug("route %s -> %s set up\n", src_comp_info->name, sink_comp_info->name); + + return 0; +} + +static int plug_set_up_widget(snd_sof_plug_t *plug, struct tplg_comp_info *comp_info) +{ + struct tplg_pipeline_info *pipe_info = comp_info->pipe_info; + int ret; + + pipe_info->usage_count++; + + /* first set up pipeline if needed, only done once for the first pipeline widget */ + if (pipe_info->usage_count == 1) { + ret = plug_set_up_pipeline(plug, pipe_info); + if (ret < 0) { + pipe_info->usage_count--; + return ret; + } + } + + /* now set up the widget */ + ret = plug_set_up_widget_ipc(plug, comp_info); + if (ret < 0) + return ret; + + tplg_debug("widget %s set up\n", comp_info->name); + + return 0; +} + +static int plug_set_up_widgets(snd_sof_plug_t *plug, struct tplg_comp_info *starting_comp_info, + struct tplg_comp_info *current_comp_info) +{ + struct list_item *item; + int ret; + + /* for playback */ + list_for_item(item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + if (route_info->source != current_comp_info) + continue; + + /* set up source widget if it is the starting widget */ + if (starting_comp_info == current_comp_info) { + ret = plug_set_up_widget(plug, current_comp_info); + if (ret < 0) + return ret; + } + + /* set up the sink widget */ + ret = plug_set_up_widget(plug, route_info->sink); + if (ret < 0) + return ret; + + /* source and sink widgets are up, so set up route now */ + ret = plug_set_up_route(plug, route_info); + if (ret < 0) + return ret; + + /* and then continue down the path */ + if (route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_IN || + route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_OUT) { + ret = plug_set_up_widgets(plug, starting_comp_info, route_info->sink); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static int plug_set_up_widgets_capture(snd_sof_plug_t *plug, + struct tplg_comp_info *starting_comp_info, + struct tplg_comp_info *current_comp_info) +{ + struct list_item *item; + int ret; + + /* for playback */ + list_for_item(item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + if (route_info->sink != current_comp_info) + continue; + + /* set up source widget if it is the starting widget */ + if (starting_comp_info == current_comp_info) { + ret = plug_set_up_widget(plug, current_comp_info); + if (ret < 0) + return ret; + } + + /* set up the sink widget */ + ret = plug_set_up_widget(plug, route_info->source); + if (ret < 0) + return ret; + + /* source and sink widgets are up, so set up route now */ + ret = plug_set_up_route(plug, route_info); + if (ret < 0) + return ret; + + /* and then continue down the path */ + if (route_info->source->type != SND_SOC_TPLG_DAPM_DAI_IN && + route_info->source->type != SND_SOC_TPLG_DAPM_DAI_OUT) { + ret = plug_set_up_widgets(plug, starting_comp_info, route_info->source); + if (ret < 0) + return ret; + } + } + + return 0; +} + +int plug_set_up_pipelines(snd_sof_plug_t *plug, int dir) +{ + struct tplg_comp_info *host = NULL; + struct tplg_pcm_info *pcm_info; + struct list_item *item; + int ret; + + list_for_item(item, &plug->pcm_list) { + pcm_info = container_of(item, struct tplg_pcm_info, item); + + if (pcm_info->id == plug->pcm_id) { + if (dir) + host = pcm_info->capture_host; + else + host = pcm_info->playback_host; + break; + } + } + + if (!host) { + SNDERR("No host component found for PCM ID: %d\n", plug->pcm_id); + return -EINVAL; + } + + plug->pcm_info = pcm_info; + + if (dir) { + ret = plug_prepare_widgets_capture(plug, pcm_info, host, host); + if (ret < 0) + return ret; + + ret = plug_set_up_widgets_capture(plug, host, host); + if (ret < 0) + return ret; + + tplg_debug("Setting up capture pipelines complete\n"); + + return 0; + } + + ret = plug_prepare_widgets(plug, pcm_info, host, host); + if (ret < 0) + return ret; + + ret = plug_set_up_widgets(plug, host, host); + if (ret < 0) + return ret; + + tplg_debug("Setting up playback pipelines complete\n"); + + return 0; +} + +static int plug_delete_pipeline(snd_sof_plug_t *plug, struct tplg_pipeline_info *pipe_info) +{ + struct ipc4_pipeline_delete msg; + struct ipc4_message_reply reply; + int ret; + + msg.primary.r.type = SOF_IPC4_GLB_DELETE_PIPELINE; + msg.primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG; + msg.primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; + msg.primary.r.instance_id = pipe_info->instance_id; + + ret = plug_mq_cmd_tx_rx(&plug->ipc_tx, &plug->ipc_rx, + &msg, sizeof(msg), &reply, sizeof(reply)); + if (ret < 0) { + SNDERR("error: can't delete pipeline %s\n", pipe_info->name); + return ret; + } + + if (reply.primary.r.status != IPC4_SUCCESS) { + SNDERR("pipeline %s instance ID %d delete failed with status %d\n", + pipe_info->name, pipe_info->instance_id, reply.primary.r.status); + return -EINVAL; + } + + tplg_debug("pipeline %s instance_id %d freed\n", pipe_info->name, + pipe_info->instance_id); + + return 0; +} + +static int plug_free_route(snd_sof_plug_t *plug, struct tplg_route_info *route_info) +{ + struct tplg_comp_info *src_comp_info = route_info->source; + struct tplg_comp_info *sink_comp_info = route_info->sink; + struct ipc4_module_bind_unbind bu; + struct ipc4_message_reply reply; + int ret; + + /* only unbind when widgets belong to separate pipelines */ + if (src_comp_info->pipeline_id == sink_comp_info->pipeline_id) + return 0; + + bu.primary.r.module_id = src_comp_info->module_id; + bu.primary.r.instance_id = src_comp_info->instance_id; + bu.primary.r.type = SOF_IPC4_MOD_UNBIND; + bu.primary.r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_MODULE_MSG; + bu.primary.r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; + + bu.extension.r.dst_module_id = sink_comp_info->module_id; + bu.extension.r.dst_instance_id = sink_comp_info->instance_id; + + /* FIXME: assign queue ID for components with multiple inputs/outputs */ + bu.extension.r.dst_queue = 0; + bu.extension.r.src_queue = 0; + + ret = plug_mq_cmd_tx_rx(&plug->ipc_tx, &plug->ipc_rx, + &bu, sizeof(bu), &reply, sizeof(reply)); + if (ret < 0) { + SNDERR("error: can't set up route %s -> %s\n", src_comp_info->name, + sink_comp_info->name); + return ret; + } + + if (reply.primary.r.status != IPC4_SUCCESS) { + SNDERR("route %s -> %s ID set up failed with status %d\n", + src_comp_info->name, sink_comp_info->name, reply.primary.r.status); + return -EINVAL; + } + + tplg_debug("route %s -> %s freed\n", src_comp_info->name, sink_comp_info->name); + + return 0; +} + +static int plug_free_widgets(snd_sof_plug_t *plug, struct tplg_comp_info *starting_comp_info, + struct tplg_comp_info *current_comp_info) +{ + struct list_item *item; + int ret; + + /* for playback */ + list_for_item(item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + if (route_info->source != current_comp_info) + continue; + + /* Widgets will be freed when the pipeline is deleted, so just unbind modules */ + ret = plug_free_route(plug, route_info); + if (ret < 0) + return ret; + + /* and then continue down the path */ + if (route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_IN || + route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_OUT) { + ret = plug_free_widgets(plug, starting_comp_info, route_info->sink); + if (ret < 0) + return ret; + } + } + + return 0; +} + +static int plug_free_widgets_capture(snd_sof_plug_t *plug, + struct tplg_comp_info *starting_comp_info, + struct tplg_comp_info *current_comp_info) +{ + struct list_item *item; + int ret; + + /* for playback */ + list_for_item(item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + if (route_info->sink != current_comp_info) + continue; + + /* Widgets will be freed when the pipeline is deleted, so just unbind modules */ + ret = plug_free_route(plug, route_info); + if (ret < 0) + return ret; + + /* and then continue down the path */ + if (route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_IN && + route_info->sink->type != SND_SOC_TPLG_DAPM_DAI_OUT) { + ret = plug_free_widgets(plug, starting_comp_info, route_info->source); + if (ret < 0) + return ret; + } + } + + return 0; +} + +int plug_free_pipelines(snd_sof_plug_t *plug, struct tplg_pipeline_list *pipeline_list, int dir) +{ + struct tplg_comp_info *host = NULL; + struct tplg_pcm_info *pcm_info; + struct list_item *item; + int ret, i; + + list_for_item(item, &plug->pcm_list) { + pcm_info = container_of(item, struct tplg_pcm_info, item); + + if (pcm_info->id == plug->pcm_id) { + host = pcm_info->playback_host; /* FIXME */ + break; + } + } + + if (!host) { + SNDERR("No host component found for PCM ID: %d\n", plug->pcm_id); + return -EINVAL; + } + + if (dir) { + } else { + ret = plug_free_widgets(plug, host, host); + if (ret < 0) { + SNDERR("failed to free widgets for PCM %d\n", plug->pcm_id); + return ret; + } + } + + for (i = 0; i < pipeline_list->count; i++) { + struct tplg_pipeline_info *pipe_info = pipeline_list->pipelines[i]; + + ret = plug_delete_pipeline(plug, pipe_info); + if (ret < 0) + return ret; + } + + plug->instance_ids[SND_SOC_TPLG_DAPM_SCHEDULER] = 0; + return 0; +} + +void plug_free_topology(snd_sof_plug_t *plug) +{ + struct list_item *item, *_item; + + list_for_item_safe(item, _item, &plug->pcm_list) { + struct tplg_pcm_info *pcm_info = container_of(item, struct tplg_pcm_info, item); + + free(pcm_info->name); + free(pcm_info); + } + + list_for_item_safe(item, _item, &plug->widget_list) { + struct tplg_comp_info *comp_info = container_of(item, struct tplg_comp_info, item); + + free(comp_info->name); + free(comp_info->stream_name); + free(comp_info->ipc_payload); + free(comp_info); + } + + list_for_item_safe(item, _item, &plug->route_list) { + struct tplg_route_info *route_info = container_of(item, struct tplg_route_info, + item); + + free(route_info); + } + + list_for_item_safe(item, _item, &plug->pipeline_list) { + struct tplg_pipeline_info *pipe_info = container_of(item, struct tplg_pipeline_info, + item); + + free(pipe_info->name); + free(pipe_info); + } + + tplg_debug("freed all pipelines, widgets, routes and pcms\n"); +} diff --git a/tools/plugin/common.c b/tools/plugin/common.c new file mode 100644 index 000000000000..d9bb1c7bb6ba --- /dev/null +++ b/tools/plugin/common.c @@ -0,0 +1,180 @@ +/*-*- linux-c -*-*/ + +/* + * ALSA <-> SOF PCM I/O plugin + * + * Copyright (c) 2022 by Liam Girdwood <liam.r.girdwood@intel.com> + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <stdio.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <assert.h> +#include <errno.h> +#include <sys/mman.h> +#include <sys/stat.h> + +#include "common.h" + +/* + * Timing + */ +void plug_timespec_add_ms(struct timespec *ts, unsigned long ms) +{ + long ns; + long secs = ms / 1000; + + /* get ms remainder */ + ms = ms - (secs * 1000); + ns = ms * 1000000; + + ts->tv_nsec += ns; + if (ts->tv_nsec > 1000000000) { + secs++; + ts->tv_nsec -= 1000000000; + } + ts->tv_sec += (secs + DEBUG_TV_SECS); +} + +long plug_timespec_delta_ns(struct timespec *before, struct timespec *after) +{ + long ns; + + ns = (after->tv_sec - before->tv_sec) * 1000000000; + ns += after->tv_nsec - before->tv_nsec; + + return ns; +} + +static const char *suffix_name(const char *longname) +{ + size_t len = strlen(longname); + int i = len; + + /* longname name invalid */ + if (len < 1) { + SNDERR("invalid topology long name\n"); + return NULL; + } + + /* find the last '/' in the longname topology path */ + while (--i >= 0) { + if (longname[i] == '/') { + i += 1; /* skip / */ + return &longname[i]; + } + } + + /* no / in topology path, so use full path */ + return longname; +} + +/* + * IPC + * + * POSIX message queues are used for interprocess IPC messaging. + */ + +/* + * Initialise the IPC object. + */ +int plug_mq_init(struct plug_mq_desc *ipc, const char *tplg, const char *type, int index) +{ + const char *name = suffix_name(tplg); + + if (!name) + return -EINVAL; + + snprintf(ipc->queue_name, NAME_SIZE, "/mq-%s-%s-%d", type, name, index); + return 0; +} + +/* + * Locking + * + * POSIX semaphores are used to block and synchronise audio between + * different threads and processes. + */ + +/* + * Initialise the lock object. + */ +int plug_lock_init(struct plug_sem_desc *lock, const char *tplg, const char *type, int index) +{ + const char *name = suffix_name(tplg); + + if (!name) + return -EINVAL; + + /* semaphores need the leading / */ + snprintf(lock->name, NAME_SIZE, "/lock-%s-%s-%d", name, type, index); + + return 0; +} + +/* + * SHM + * + * Shared memory is used for audio data and audio context sharing between + * threads and processes. + */ + +/* + * Initialise the SHM object. + */ +int plug_shm_init(struct plug_shm_desc *shm, const char *tplg, const char *type, int index) +{ + const char *name = suffix_name(tplg); + + if (!name) + return -EINVAL; + + snprintf(shm->name, NAME_SIZE, "/shm-%s-%s-%d", name, type, index); + shm->size = SHM_SIZE; + + return 0; +} + +/* + * Open an existing shared memory region using the SHM object. + */ +int plug_shm_open(struct plug_shm_desc *shm) +{ + struct stat status; + + /* open SHM to be used for low latency position */ + shm->fd = shm_open(shm->name, O_RDWR, + S_IRWXU | S_IRWXG); + if (shm->fd < 0) { + //SNDERR("failed to open SHM position %s: %s\n", + // shm->name, strerror(errno)); + return -errno; + } + + fstat(shm->fd, &status); + /* map it locally for context readback */ + shm->addr = mmap(NULL, status.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, shm->fd, 0); + if (!shm->addr) { + SNDERR("failed to mmap SHM position%s: %s\n", shm->name, strerror(errno)); + return -errno; + } + + return 0; +} + diff --git a/tools/plugin/common.h b/tools/plugin/common.h new file mode 100644 index 000000000000..c6e9225567d4 --- /dev/null +++ b/tools/plugin/common.h @@ -0,0 +1,316 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022-2023 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __SOF_PLUGIN_COMMON_H__ +#define __SOF_PLUGIN_COMMON_H__ + +#include <stdint.h> +#include <mqueue.h> +#include <semaphore.h> +#include <alsa/asoundlib.h> + +/* temporary - current MAXLEN is not define in UAPI header - fix pending */ +#ifndef SNDRV_CTL_ELEM_ID_NAME_MAXLEN +#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44 +#endif + +#include <alsa/sound/uapi/asoc.h> + +#define IPC3_MAX_MSG_SIZE 384 +#define NAME_SIZE 256 + +#define MAX_CTLS 256 + +#define MS_TO_US(_msus) (_msus * 1000) +#define MS_TO_NS(_msns) (MS_TO_US(_msns * 1000)) + +#define MS_TO_US(_msus) (_msus * 1000) +#define MS_TO_NS(_msns) (MS_TO_US(_msns * 1000)) + +#define SEM_PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) + +#define SHM_SIZE (4096 * 64) /* get from topology - and set for context */ + +#define NUM_EP_CONFIGS 8 + +/* + * Run with valgrind + * valgrind --trace-children=yes aplay -v -Dsof:blah.tplg,1,hw:1,2 -f dat /dev/zero + */ +//#define VALGRIND +#ifdef VALGRIND +#define DEBUG_TV_SECS 10 +#define DEBUG_RETRIES 1000 +#else +#define DEBUG_RETRIES 10 +#define DEBUG_TV_SECS 0 +#endif + +#define SOF_MAGIC "sofpipe" + +enum plugin_state { + SOF_PLUGIN_STATE_INIT = 0, + SOF_PLUGIN_STATE_READY = 1, + SOF_PLUGIN_STATE_DEAD = 2, + SOF_PLUGIN_STATE_STREAM_RUNNING = 3, + SOF_PLUGIN_STATE_STREAM_ERROR = 5, +}; + +struct plug_shm_ctl { + unsigned int comp_id; + unsigned int type; + union { + struct snd_soc_tplg_mixer_control mixer_ctl; + struct snd_soc_tplg_enum_control enum_ctl; + struct snd_soc_tplg_bytes_control bytes_ctl; + }; +}; + +/* + * config.48k2c { + * rate 48000 + * channels 2 + * period_time 0 + * period_frames 6000 + * buffer_time 0 + * buffer_frames 24000 + * } + */ +struct plug_config { + char name[44]; + unsigned long buffer_frames; + unsigned long buffer_time; + unsigned long period_frames; + unsigned long period_time; + int rate; + int channels; + unsigned long format; +}; + +/* + * :[pcm:card:dev:config[pcm:card:dev:config]...] + */ +struct plug_cmdline_item { + int pcm; + char card_name[44]; + char dev_name[44]; + char config_name[44]; +}; + +/* + * Endpoint pipeline configuration + */ +struct endpoint_hw_config { + int pipeline; + char card_name[44]; + char dev_name[44]; + char config_name[44]; + unsigned long buffer_frames; + unsigned long buffer_time; + unsigned long period_frames; + unsigned long period_time; + int rate; + int channels; + unsigned long format; +}; + +struct plug_shm_endpoint { + char magic[8]; /* SOF_MAGIC */ + uint64_t state; + uint32_t pipeline_id; + uint32_t comp_id; + uint32_t idx; + unsigned long rpos; /* current position in ring buffer */ + unsigned long rwrap; + unsigned long wpos; /* current position in ring buffer */ + unsigned long wwrap; + unsigned long buffer_size; /* buffer size */ + unsigned long wtotal; /* total frames copied */ + unsigned long rtotal; /* total frames copied */ + int frame_size; + char data[0]; // TODO: align this on SIMD/cache +}; + +struct plug_shm_glb_state { + char magic[8]; /* SOF_MAGIC */ + uint64_t size; /* size of this structure in bytes */ + uint64_t state; /* enum plugin_state */ + struct endpoint_hw_config ep_config[NUM_EP_CONFIGS]; + int num_ep_configs; + uint64_t num_ctls; /* number of ctls */ + struct plug_shm_ctl ctl[]; +}; + +struct plug_shm_desc { + /* SHM for stream context sync */ + int fd; + int size; + char name[NAME_SIZE]; + void *addr; +}; + +struct plug_mq_desc { + /* IPC message queue */ + mqd_t mq; + struct mq_attr attr; + char queue_name[NAME_SIZE]; +}; + +struct plug_sem_desc { + char name[NAME_SIZE]; + sem_t *sem; +}; + +struct plug_ctl_container { + struct snd_soc_tplg_ctl_hdr *tplg[MAX_CTLS]; + int updated[MAX_CTLS]; + int count; +}; + +static inline void *plug_ep_rptr(struct plug_shm_endpoint *ep) +{ + return ep->data + ep->rpos; +} + +static inline void *plug_ep_wptr(struct plug_shm_endpoint *ep) +{ + return ep->data + ep->wpos; +} + +static inline int plug_ep_wrap_rsize(struct plug_shm_endpoint *ep) +{ + return ep->buffer_size - ep->rpos; +} + +static inline int plug_ep_wrap_wsize(struct plug_shm_endpoint *ep) +{ + return ep->buffer_size - ep->wpos; +} + +static inline int plug_ep_get_free(struct plug_shm_endpoint *ep) +{ + if (ep->rwrap == ep->wwrap) { + /* calculate available bytes */ + if (ep->rpos < ep->wpos) + return ep->buffer_size - (ep->wpos - ep->rpos); + else + return ep->buffer_size; + } else { + return ep->rpos - ep->wpos; + } +} + +static inline int plug_ep_get_avail(struct plug_shm_endpoint *ep) +{ + if (ep->rwrap == ep->wwrap) { + /* calculate available bytes */ + if (ep->rpos < ep->wpos) + return ep->wpos - ep->rpos; + else + return 0; + } else { + return (ep->buffer_size - ep->rpos) + ep->wpos; + } +} + +static inline void *plug_ep_consume(struct plug_shm_endpoint *ep, unsigned int bytes) +{ + ep->rtotal += bytes; + ep->rpos += bytes; + + if (ep->rpos >= ep->buffer_size) { + ep->rpos -= ep->buffer_size; + ep->rwrap++; + } + + return ep->data + ep->rpos; +} + +static inline void *plug_ep_produce(struct plug_shm_endpoint *ep, unsigned int bytes) +{ + ep->wtotal += bytes; + ep->wpos += bytes; + + if (ep->wpos >= ep->buffer_size) { + ep->wpos -= ep->buffer_size; + ep->wwrap++; + } + + return ep->data + ep->wpos; +} + +/* + * SHM + */ +int plug_shm_init(struct plug_shm_desc *shm, const char *tplg, const char *type, int index); + +int plug_shm_create(struct plug_shm_desc *shm); + +int plug_shm_open(struct plug_shm_desc *shm); + +void plug_shm_free(struct plug_shm_desc *shm); + +/* + * IPC + */ +int plug_mq_create(struct plug_mq_desc *ipc); + +int plug_mq_open(struct plug_mq_desc *ipc); + +int plug_mq_init(struct plug_mq_desc *ipc, const char *tplg, const char *type, int index); + +void plug_mq_free(struct plug_mq_desc *ipc); + +int plug_mq_cmd(struct plug_mq_desc *ipc, void *msg, size_t len, void *reply, size_t rlen); + +int plug_mq_cmd_tx_rx(struct plug_mq_desc *ipc_tx, struct plug_mq_desc *ipc_rx, + void *msg, size_t len, void *reply, size_t rlen); + +/* + * Locking + */ +int plug_lock_create(struct plug_sem_desc *lock); + +void plug_lock_free(struct plug_sem_desc *lock); + +int plug_lock_init(struct plug_sem_desc *lock, const char *tplg, const char *type, int index); + +int plug_lock_open(struct plug_sem_desc *lock); + +/* + * Timing. + */ +void plug_timespec_add_ms(struct timespec *ts, unsigned long ms); + +long plug_timespec_delta_ns(struct timespec *before, struct timespec *after); + +/* dump the IPC data - dont print lines of 0s */ +static inline void data_dump(void *vdata, size_t bytes) +{ + uint32_t *data = vdata; + size_t words = bytes >> 2; + int i; + + for (i = 0; i < words; i++) { + /* 4 words per line */ + if (i % 4 == 0) { + /* delete lines with all 0s */ + if (i > 0 && data[i - 3] == 0 && data[i - 2] == 0 && + data[i - 1] == 0 && data[i - 0] == 0) + printf("\r"); + else + printf("\n"); + + printf("0x%4.4x: 0x%8.8x", i, data[i]); + } else { + printf(" 0x%8.8x", data[i]); + } + } + printf("\n"); +} + +#endif diff --git a/tools/plugin/modules/CMakeLists.txt b/tools/plugin/modules/CMakeLists.txt new file mode 100644 index 000000000000..dfd7105c072e --- /dev/null +++ b/tools/plugin/modules/CMakeLists.txt @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: BSD-3-Clause + +# File SHM pipe module +add_library(sof_mod_shm MODULE + shm.c +) +sof_append_relative_path_definitions(sof_mod_shm) +target_include_directories(sof_mod_shm PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../pipe + ${sof_source_directory}/src/audio) + +target_compile_options(sof_mod_shm PRIVATE -DPIC -g -O3 -Wl,-EL -Wall -Werror -DCONFIG_LIBRARY -imacros${config_h}) + +install(TARGETS sof_mod_shm + DESTINATION /usr/lib/x86_64-linux-gnu/alsa-lib) + +target_link_options(sof_mod_shm PRIVATE -Wl,--export-dynamic) + +target_include_directories(sof_mod_shm PRIVATE ${sof_install_directory}/include) +target_include_directories(sof_mod_shm PRIVATE ${parser_install_dir}/include) + +set_target_properties(sof_mod_shm + PROPERTIES + INSTALL_RPATH "${sof_install_directory}/alsa-lib" + INSTALL_RPATH_USE_LINK_PATH TRUE +) + + +# ALSA SOF pipe module +add_library(sof_mod_alsa MODULE + alsa.c +) +sof_append_relative_path_definitions(sof_mod_alsa) +target_include_directories(sof_mod_alsa PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../pipe + ${sof_source_directory}/src/audio) + +target_compile_options(sof_mod_alsa PRIVATE -DPIC -g -O3 -Wl,-EL -Wmissing-prototypes + -Wimplicit-fallthrough -Wall -Werror -DCONFIG_LIBRARY -imacros${config_h}) + +install(TARGETS sof_mod_alsa + DESTINATION /usr/lib/x86_64-linux-gnu/alsa-lib) + +target_link_options(sof_mod_alsa PRIVATE -Wl,--export-dynamic) + +target_include_directories(sof_mod_alsa PRIVATE ${sof_install_directory}/include) +target_include_directories(sof_mod_alsa PRIVATE ${parser_install_dir}/include) + +set_target_properties(sof_mod_alsa + PROPERTIES + INSTALL_RPATH "${sof_install_directory}/alsa-lib" + INSTALL_RPATH_USE_LINK_PATH TRUE +) diff --git a/tools/plugin/modules/alsa.c b/tools/plugin/modules/alsa.c new file mode 100644 index 000000000000..a00ca95d759f --- /dev/null +++ b/tools/plugin/modules/alsa.c @@ -0,0 +1,790 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. + +/* file component for reading/writing pcm samples to/from a file */ + +#include <stdio.h> +#include <stdint.h> +#include <stddef.h> +#include <stdlib.h> +#include <errno.h> +#include <inttypes.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +#include <rtos/sof.h> +#include <sof/list.h> +#include <sof/audio/stream.h> +#include <sof/audio/ipc-config.h> +#include <sof/ipc/driver.h> +#include <sof/audio/component.h> +#include <sof/audio/format.h> +#include <sof/audio/pipeline.h> +#include <ipc/stream.h> +#include <ipc/topology.h> +#include <ipc/dai.h> + +#include <alsa/asoundlib.h> + +#include "pipe.h" + +/* 66def9f0-39f2-11ed-89f7-af98a6440cc4 */ +DECLARE_SOF_RT_UUID("arecord", arecord_uuid, 0x66def9f0, 0x39f2, 0x11ed, + 0xf7, 0x89, 0xaf, 0x98, 0xa6, 0x44, 0x0c, 0xc4); +DECLARE_TR_CTX(arecord_tr, SOF_UUID(arecord_uuid), LOG_LEVEL_INFO); + +/* 72cee996-39f2-11ed-a08f-97fcc42eaaeb */ +DECLARE_SOF_RT_UUID("aplay", aplay_uuid, 0x72cee996, 0x39f2, 0x11ed, + 0xa0, 0x8f, 0x97, 0xfc, 0xc4, 0x2e, 0xaa, 0xeb); +DECLARE_TR_CTX(aplay_tr, SOF_UUID(aplay_uuid), LOG_LEVEL_INFO); + +static const struct comp_driver comp_arecord; +static const struct comp_driver comp_aplay; + +/* ALSA comp data */ +struct alsa_comp_data { + snd_pcm_t *handle; + snd_pcm_info_t *info; + snd_pcm_hw_params_t *hw_params; + snd_pcm_sw_params_t *sw_params; + snd_pcm_uframes_t period_frames; + snd_pcm_uframes_t buffer_frames; + char *pcm_name; + struct sof_ipc_stream_params params; + struct plug_shm_desc pcm; + struct plug_shm_endpoint *ctx; + struct plug_shm_desc glb; + struct plug_shm_glb_state *glb_ctx; + struct endpoint_hw_config *ep_hw; +#if CONFIG_IPC_MAJOR_4 + struct ipc4_base_module_cfg base_cfg; +#endif +}; + +static struct endpoint_hw_config *alsa_get_hw_config(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_glb_state *glb = cd->glb_ctx; + + if (!glb->num_ep_configs) + return NULL; + + return glb->ep_config; +} + +static int alsa_alloc(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + int err; + + /* get ALSA ready */ + err = snd_pcm_info_malloc(&cd->info); + if (err < 0) + goto error; + + err = snd_pcm_hw_params_malloc(&cd->hw_params); + if (err < 0) + goto error; + + err = snd_pcm_sw_params_malloc(&cd->sw_params); + if (err < 0) + goto error; + + comp_dbg(dev, "open done"); + return 0; + +error: + return err; +} + +static int alsa_close(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + int ret = 0; + + comp_dbg(dev, "close"); + if (cd->handle) { + ret = snd_pcm_hw_free(cd->handle); + if (ret < 0) + comp_err(dev, "error: failed to snd_pcm_hw_free: %s\n", snd_strerror(ret)); + + ret = snd_pcm_close(cd->handle); + if (ret < 0) + comp_err(dev, "error: failed to snd_pcm_close: %s\n", snd_strerror(ret)); + + cd->handle = NULL; + } + + return ret; +} + +static void alsa_free(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + + comp_dbg(dev, "alsa_free()"); + + snd_pcm_sw_params_free(cd->sw_params); + snd_pcm_hw_params_free(cd->hw_params); + snd_pcm_info_free(cd->info); + plug_shm_free(&cd->pcm); + free(cd); + free(dev); +} + +static struct comp_dev *alsa_new(const struct comp_driver *drv, + const struct comp_ipc_config *config, + const void *spec) +{ +#if CONFIG_IPC_MAJOR_4 + const struct ipc4_base_module_cfg *base_cfg = (struct ipc4_base_module_cfg *)spec; +#endif + struct comp_dev *dev; + struct alsa_comp_data *cd; + int err; + + dev = comp_alloc(drv, sizeof(*dev)); + if (!dev) + return NULL; + dev->ipc_config = *config; + + /* allocate memory for file comp data */ + cd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*cd)); + if (!cd) + goto error; + + comp_set_drvdata(dev, cd); + memcpy(&cd->base_cfg, base_cfg, sizeof(struct ipc4_base_module_cfg)); + + /* use PCM ID to create shm */ + err = plug_shm_init(&cd->pcm, _sp->topology_name, "pcm", 1); + if (err < 0) { + comp_err(dev, "Error initializing pcm\n"); + goto error; + } + + // TODO: get the shm size for the buffer using a better method + //cd->pcm.size = 128 * 1024; + + /* mmap the SHM PCM */ + err = plug_shm_open(&cd->pcm); + if (err < 0) { + comp_err(dev, "Error open pcm shm"); + goto error; + } + cd->ctx = cd->pcm.addr; + + err = plug_shm_init(&cd->glb, _sp->topology_name, "ctx", 0); + if (err < 0) { + comp_err(dev, "Error initializing ctx\n"); + goto error; + } + + // TODO: get the shm size for the buffer using a better method + //cd->pcm.size = 128 * 1024; + + /* mmap the GLB ctx */ + err = plug_shm_open(&cd->glb); + if (err < 0) { + comp_err(dev, "Error opening glb ctx\n"); + goto error; + } + cd->glb_ctx = cd->glb.addr; + + /* alloc alsa context */ + err = alsa_alloc(dev); + if (err < 0) { + comp_err(dev, "Error allocating alsa context\n"); + goto error; + } + + return dev; + +error: + free(cd); + free(dev); + return NULL; +} + +static struct comp_dev *arecord_new(const struct comp_driver *drv, + const struct comp_ipc_config *config, const void *spec) +{ + struct comp_dev *dev; + struct alsa_comp_data *cd; + + comp_dbg(dev, "arecord_new()"); + + dev = alsa_new(drv, config, spec); + if (!dev) + return NULL; + + cd = comp_get_drvdata(dev); + cd->params.direction = SND_PCM_STREAM_CAPTURE; + + dev->state = COMP_STATE_READY; + return dev; +} + +static struct comp_dev *aplay_new(const struct comp_driver *drv, + const struct comp_ipc_config *config, + const void *spec) +{ + struct comp_dev *dev; + struct alsa_comp_data *cd; + + comp_dbg(dev, "aplay_new()"); + + dev = alsa_new(drv, config, spec); + if (!dev) + return NULL; + + cd = comp_get_drvdata(dev); + cd->params.direction = SND_PCM_STREAM_PLAYBACK; + + dev->state = COMP_STATE_READY; + return dev; +} + +static int set_params(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + struct sof_ipc_stream_params *params = &cd->params; + int frame_fmt; + int err; + + err = snd_pcm_open(&cd->handle, cd->pcm_name, cd->params.direction, 0); + if (err < 0) { + comp_err(dev, "error: cant open PCM %s: %s\n", cd->pcm_name, snd_strerror(err)); + return err; + } + + err = snd_pcm_info(cd->handle, cd->info); + if (err < 0) { + comp_err(dev, "error: cant get PCM info: %s\n", snd_strerror(err)); + return err; + } + + /* is sound card HW configuration valid ? */ + err = snd_pcm_hw_params_any(cd->handle, cd->hw_params); + if (err < 0) { + comp_err(dev, "error: cant get PCM hw_params: %s\n", snd_strerror(err)); + return err; + } + + /* set interleaved buffer format */ + err = snd_pcm_hw_params_set_access(cd->handle, cd->hw_params, + SND_PCM_ACCESS_RW_INTERLEAVED); + if (err < 0) { + comp_err(dev, "error: PCM can't set interleaved: %s\n", snd_strerror(err)); + return err; + } + + /* set sample format */ + /* set all topology configuration */ + switch (params->frame_fmt) { + case SOF_IPC_FRAME_S16_LE: + frame_fmt = SND_PCM_FORMAT_S16_LE; + break; + case SOF_IPC_FRAME_S24_4LE: + frame_fmt = SND_PCM_FORMAT_S24_LE; + break; + case SOF_IPC_FRAME_S32_LE: + frame_fmt = SND_PCM_FORMAT_S32_LE; + break; + case SOF_IPC_FRAME_FLOAT: + frame_fmt = SND_PCM_FORMAT_FLOAT_LE; + break; + case SOF_IPC_FRAME_S24_3LE: + frame_fmt = SND_PCM_FORMAT_S24_3LE; + break; + default: + comp_err(dev, "error: invalid frame format %d for ALSA PCM\n", params->frame_fmt); + return -EINVAL; + } + err = snd_pcm_hw_params_set_format(cd->handle, cd->hw_params, frame_fmt); + if (err < 0) { + comp_err(dev, "error: PCM can't set format %d: %s\n", + frame_fmt, snd_strerror(err)); + return err; + } + + /* set number of channels */ + err = snd_pcm_hw_params_set_channels(cd->handle, cd->hw_params, params->channels); + if (err < 0) { + comp_err(dev, "error: PCM can't set channels %d: %s\n", + params->channels, snd_strerror(err)); + return err; + } + + /* set sample rate */ + err = snd_pcm_hw_params_set_rate(cd->handle, cd->hw_params, params->rate, 0); + if (err < 0) { + comp_err(dev, "error: PCM can't set rate %d: %s\n", + params->rate, snd_strerror(err)); + return err; + } + + /* set period size TODO: get from topology */ + err = snd_pcm_hw_params_set_period_size(cd->handle, cd->hw_params, + cd->period_frames, 0); + if (err < 0) { + comp_err(dev, "error: PCM can't set period size %ld frames: %s\n", + cd->period_frames, snd_strerror(err)); + return err; + } + + /* set buffer size: TODO: get from topology */ + err = snd_pcm_hw_params_set_buffer_size_near(cd->handle, cd->hw_params, + &cd->buffer_frames); + if (err < 0) { + comp_err(dev, "error: PCM can't set buffer size %ld frames: %s\n", + cd->buffer_frames, snd_strerror(err)); + return err; + } + + /* commit the hw params */ + err = snd_pcm_hw_params(cd->handle, cd->hw_params); + if (err < 0) { + comp_err(dev, "error: PCM can't commit hw_params: %s\n", snd_strerror(err)); + snd_pcm_hw_params_dump(cd->hw_params, SND_OUTPUT_STDIO); + return err; + } + + /* get the initial SW params */ + err = snd_pcm_sw_params_current(cd->handle, cd->sw_params); + if (err < 0) { + comp_err(dev, "error: PCM can't get sw params: %s\n", snd_strerror(err)); + return err; + } + + /* set the avail min to the period size */ + err = snd_pcm_sw_params_set_avail_min(cd->handle, cd->sw_params, cd->period_frames); + if (err < 0) { + comp_err(dev, "error: PCM can't set avail min: %s\n", snd_strerror(err)); + return err; + } + + /* PCM should start after receiving first periods worth of data */ + err = snd_pcm_sw_params_set_start_threshold(cd->handle, cd->sw_params, cd->period_frames); + if (err < 0) { + comp_err(dev, "error: PCM can't set start threshold: %s\n", snd_strerror(err)); + return err; + } + + /* PCM should stop if only 1/4 period worth of data is available */ + err = snd_pcm_sw_params_set_stop_threshold(cd->handle, cd->sw_params, + cd->period_frames / 4); + if (err < 0) { + comp_err(dev, "error: PCM can't set stop threshold: %s\n", snd_strerror(err)); + return err; + } + + /* commit the sw params */ + if (snd_pcm_sw_params(cd->handle, cd->sw_params) < 0) { + comp_err(dev, "error: PCM can't commit sw_params: %s\n", snd_strerror(err)); + snd_pcm_sw_params_dump(cd->sw_params, SND_OUTPUT_STDIO); + return err; + } + + comp_dbg(dev, "params set"); + return 0; +} + +static int alsa_dai_get_hw_params(struct comp_dev *dev, + struct sof_ipc_stream_params *params, int dir); + +/** + * \brief Sets file component audio stream parameters. + * \param[in,out] dev Volume base component device. + * \param[in] params Audio (PCM) stream parameters (ignored for this component) + * \return Error code. + * + * All done in prepare() since we need to know source and sink component params. + */ +static int arecord_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) +{ + struct comp_buffer *buffer; + struct alsa_comp_data *cd = comp_get_drvdata(dev); + struct comp_buffer __sparse_cache *buf_c; + int ret; + + comp_dbg(dev, "arecord params"); + + ret = alsa_dai_get_hw_params(dev, params, cd->params.direction); + + if (params->direction != SND_PCM_STREAM_CAPTURE) { + comp_err(dev, "alsa_params(): pcm params invalid direction."); + return -EINVAL; + } + + /* params can be aligned to match pipeline here */ + ret = comp_verify_params(dev, 0, params); + if (ret < 0) { + comp_err(dev, "alsa_params(): pcm params verification failed."); + return ret; + } + memcpy(&cd->params, params, sizeof(*params)); + + /* file component sink/source buffer period count */ + buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + buf_c = buffer_acquire(buffer); + buffer_reset_pos(buf_c, NULL); + buffer_release(buf_c); + + comp_dbg(dev, "prepare done ret = %d", ret); + + return 0; +} + +static int aplay_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) +{ + struct comp_buffer *buffer; + struct alsa_comp_data *cd = comp_get_drvdata(dev); + int ret; + + comp_dbg(dev, "aplay params"); + + ret = alsa_dai_get_hw_params(dev, params, cd->params.direction); + + if (params->direction != SND_PCM_STREAM_PLAYBACK) { + comp_err(dev, "alsa_params(): pcm params invalid direction."); + return -EINVAL; + } + + /* params can be aligned to match pipeline here */ + ret = comp_verify_params(dev, 0, params); + if (ret < 0) { + comp_err(dev, "alsa_params(): pcm params verification failed."); + return ret; + } + memcpy(&cd->params, params, sizeof(*params)); + + /* file component sink/source buffer period count */ + buffer = list_first_item(&dev->bsource_list, struct comp_buffer, + sink_list); + buffer_reset_pos(buffer, NULL); + + comp_dbg(dev, "prepare done ret = %d", ret); + return 0; +} + +static int alsa_trigger(struct comp_dev *dev, int cmd) +{ + int err; + + /* trigger is handled automatically by ALSA start threshold */ + comp_dbg(dev, "trigger cmd %d", cmd); + + switch (cmd) { + case COMP_TRIGGER_PAUSE: + case COMP_TRIGGER_STOP: + err = alsa_close(dev); + if (err < 0) { + comp_err(dev, "error: cant stop pipeline"); + return err; + } + break; + case COMP_TRIGGER_RELEASE: + case COMP_TRIGGER_START: + err = set_params(dev); + if (err < 0) { + comp_err(dev, "error: cant stop pipeline"); + return err; + } + break; + default: + break; + } + + return comp_set_state(dev, cmd); +} + +/* used to pass standard and bespoke commands (with data) to component */ +static int alsa_cmd(struct comp_dev *dev, int cmd, void *data, + int max_data_size) +{ + return 0; +} + +/* + * copy and process stream samples + * returns the number of bytes copied + */ +static int arecord_copy(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + struct comp_buffer __sparse_cache *buf_c; + struct comp_buffer *buffer; + struct audio_stream *sink; + snd_pcm_sframes_t frames; + snd_pcm_uframes_t free; + snd_pcm_uframes_t total = 0; + unsigned int frame_bytes; + void *pos; + + switch (dev->state) { + case COMP_STATE_ACTIVE: + break; + default: + return -EINVAL; + } + + /* file component sink buffer */ + buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + buf_c = buffer_acquire(buffer); + sink = &buf_c->stream; + pos = sink->w_ptr; + + //FIX: this will fill buffer and higher latency, use period size + free = MIN(audio_stream_get_free_frames(sink), cd->period_frames); + frame_bytes = audio_stream_frame_bytes(sink); + + while (free) { + frames = MIN(free, audio_stream_frames_without_wrap(sink, pos)); + + /* read PCM samples from file */ + frames = snd_pcm_readi(cd->handle, pos, frames); + if (frames < 0) { + comp_err(dev, "failed to read: %s: %s\n", + cd->pcm_name, snd_strerror(frames)); + buffer_release(buf_c); + return frames; + } + + free -= frames; + pos = audio_stream_wrap(sink, pos + frames * frame_bytes); + total += frames; + } + + /* update sink buffer pointers */ + comp_update_buffer_produce(buffer, total * frame_bytes); + comp_dbg(dev, "read %d frames", total); + buffer_release(buf_c); + + return 0; +} + +/* + * copy and process stream samples + * returns the number of bytes copied + */ +static int aplay_copy(struct comp_dev *dev) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + struct comp_buffer *buffer; + struct audio_stream *source; + snd_pcm_sframes_t frames; + snd_pcm_sframes_t avail; + snd_pcm_uframes_t total = 0; + unsigned int frame_bytes; + void *pos; + + switch (dev->state) { + case COMP_STATE_ACTIVE: + break; + default: + return -EINVAL; + } + + /* file component source buffer */ + buffer = list_first_item(&dev->bsource_list, struct comp_buffer, + sink_list); + source = &buffer->stream; + pos = source->r_ptr; + avail = MIN(audio_stream_get_avail_frames(source), cd->period_frames); + avail = audio_stream_get_avail_frames(source); + frame_bytes = audio_stream_frame_bytes(source); + + while (avail > 0) { + frames = MIN(avail, audio_stream_frames_without_wrap(source, pos)); + + /* write PCM samples to PCM */ + frames = snd_pcm_writei(cd->handle, pos, frames); + if (frames < 0) { + comp_err(dev, "failed to write: %s: %s\n", + cd->pcm_name, snd_strerror(frames)); + return frames; + } + + avail -= frames; + pos = audio_stream_wrap(source, pos + frames * frame_bytes); + total += frames; + } + + /* update sink buffer pointers */ + comp_update_buffer_consume(buffer, total * frame_bytes); + comp_dbg(dev, "wrote %d bytes", total * frame_bytes); + + return 0; +} + +static int alsa_prepare(struct comp_dev *dev) +{ + int ret = 0; + + comp_dbg(dev, "prepare"); + ret = comp_set_state(dev, COMP_TRIGGER_PREPARE); + if (ret < 0) + return ret; + + if (ret == COMP_STATUS_STATE_ALREADY_SET) + return PPL_STATUS_PATH_STOP; + + return ret; +} + +static int alsa_reset(struct comp_dev *dev) +{ + comp_dbg(dev, "reset"); + + comp_set_state(dev, COMP_TRIGGER_RESET); + + return 0; +} + +/* + * TODO: we pass the DAI topology config back up the pipeline so + * that upstream/downstream can be configured. Needs to be configured + * at stream runtime instead of at topology load time. + */ +static int alsa_dai_get_hw_params(struct comp_dev *dev, struct sof_ipc_stream_params *params, + int dir) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + struct endpoint_hw_config *ep_hw; + char pcm_name[128]; + + comp_dbg(dev, "get_hw_params"); + + /* get our hw config from cmdline and conf file */ + ep_hw = alsa_get_hw_config(dev); + if (!ep_hw) { + comp_err(dev, "error: failed to get hw config %d\n"); + return -EINVAL; + } + cd->ep_hw = ep_hw; + + /* PCM name comes from cmd line - "default" dev means dont use dev */ + if (!strncmp(cd->ep_hw->dev_name, "default", sizeof(cd->ep_hw->dev_name))) { + snprintf(pcm_name, sizeof(pcm_name), "%s", cd->ep_hw->card_name); + } else { + snprintf(pcm_name, sizeof(pcm_name), "%s:%s", + cd->ep_hw->card_name, cd->ep_hw->dev_name); + } + cd->pcm_name = strdup(pcm_name); + comp_dbg(dev, "using ALSA card %s", cd->pcm_name); + + /* set default config - get from cmdline and plugin config */ + cd->params.rate = cd->ep_hw->rate; + cd->params.channels = cd->ep_hw->channels; + cd->buffer_frames = cd->ep_hw->buffer_frames; + cd->period_frames = cd->ep_hw->period_frames; + + /* ALSA API uses frames, SOF buffer uses bytes */ + switch (cd->ep_hw->format) { + case SND_PCM_FORMAT_S16_LE: + cd->params.frame_fmt = SOF_IPC_FRAME_S16_LE; + cd->params.buffer.size = cd->ep_hw->buffer_frames * 2; + break; + case SND_PCM_FORMAT_S24_LE: + cd->params.frame_fmt = SOF_IPC_FRAME_S24_4LE; + cd->params.buffer.size = cd->ep_hw->buffer_frames * 4; + break; + case SND_PCM_FORMAT_S32_LE: + cd->params.frame_fmt = SOF_IPC_FRAME_S32_LE; + cd->params.buffer.size = cd->ep_hw->buffer_frames * 4; + break; + case SND_PCM_FORMAT_FLOAT: + cd->params.frame_fmt = SOF_IPC_FRAME_FLOAT; + cd->params.buffer.size = cd->ep_hw->buffer_frames * 4; + break; + case SND_PCM_FORMAT_S24_3LE: + cd->params.frame_fmt = SOF_IPC_FRAME_S24_3LE; + cd->params.buffer.size = cd->ep_hw->buffer_frames * 3; + break; + default: + comp_err(dev, "error: invalid frame format %d for ALSA PCM\n", params->frame_fmt); + return -EINVAL; + } + + memcpy(params, &cd->params, sizeof(*params)); + + comp_dbg(dev, "rate %d", params->rate); + comp_dbg(dev, "frame format %d", params->frame_fmt); + comp_dbg(dev, "channels %d", params->channels); + comp_dbg(dev, "buffer frames %d", cd->buffer_frames); + comp_dbg(dev, "period frames %d", cd->period_frames); + comp_dbg(dev, "direction %d", params->direction); + + return 0; +} + +static int alsa_get_attribute(struct comp_dev *dev, uint32_t type, void *value) +{ + struct alsa_comp_data *cd = comp_get_drvdata(dev); + + switch (type) { + case COMP_ATTR_BASE_CONFIG: + memcpy_s(value, sizeof(struct ipc4_base_module_cfg), + &cd->base_cfg, sizeof(struct ipc4_base_module_cfg)); + break; + default: + return -EINVAL; + } + + return 0; +} + +static const struct comp_driver comp_arecord = { + .type = SOF_COMP_FILEREAD, + .uid = SOF_RT_UUID(arecord_uuid), + .tctx = &arecord_tr, + .ops = { + .create = arecord_new, + .free = alsa_free, + .params = arecord_params, + .cmd = alsa_cmd, + .trigger = alsa_trigger, + .copy = arecord_copy, + .prepare = alsa_prepare, + .reset = alsa_reset, + .dai_get_hw_params = alsa_dai_get_hw_params, + .get_attribute = alsa_get_attribute, + }, +}; + +static const struct comp_driver comp_aplay = { + .type = SOF_COMP_FILEWRITE, + .uid = SOF_RT_UUID(aplay_uuid), + .tctx = &aplay_tr, + .ops = { + .create = aplay_new, + .free = alsa_free, + .params = aplay_params, + .cmd = alsa_cmd, + .trigger = alsa_trigger, + .copy = aplay_copy, + .prepare = alsa_prepare, + .reset = alsa_reset, + .dai_get_hw_params = alsa_dai_get_hw_params, + .get_attribute = alsa_get_attribute, + }, +}; + +static struct comp_driver_info comp_arecord_info = { + .drv = &comp_arecord, +}; + +static struct comp_driver_info comp_aplay_info = { + .drv = &comp_aplay, +}; + +static void sys_comp_alsa_init(void) +{ + comp_register(&comp_arecord_info); + comp_register(&comp_aplay_info); +} + +DECLARE_MODULE(sys_comp_alsa_init); diff --git a/tools/plugin/modules/shm.c b/tools/plugin/modules/shm.c new file mode 100644 index 000000000000..d59db6694902 --- /dev/null +++ b/tools/plugin/modules/shm.c @@ -0,0 +1,451 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. + +/* shm component for reading/writing pcm samples to/from a shm */ + +#include <stdio.h> +#include <stdint.h> +#include <stddef.h> +#include <stdlib.h> +#include <errno.h> +#include <inttypes.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/mman.h> +#include <fcntl.h> +#include <semaphore.h> + +#include <rtos/sof.h> +#include <sof/list.h> +#include <sof/audio/stream.h> +#include <sof/audio/ipc-config.h> +#include <sof/ipc/driver.h> +#include <sof/audio/component.h> +#include <sof/audio/format.h> +#include <sof/audio/pipeline.h> +#include <ipc/stream.h> +#include <ipc/topology.h> + +#include "pipe.h" + +/* 1488beda-e847-ed11-b309-a58b974fecce */ +DECLARE_SOF_RT_UUID("shmread", shmread_uuid, 0xdabe8814, 0x47e8, 0x11ed, + 0xa5, 0x8b, 0xb3, 0x09, 0x97, 0x4f, 0xec, 0xce); +DECLARE_TR_CTX(shmread_tr, SOF_UUID(shmread_uuid), LOG_LEVEL_INFO); + +/* 1c03b6e2-e847-ed11-7f80-07a91b6efa6c */ +DECLARE_SOF_RT_UUID("shmwrite", shmwrite_uuid, 0xe2b6031c, 0x47e8, 0x11ed, + 0x07, 0xa9, 0x7f, 0x80, 0x1b, 0x6e, 0xfa, 0x6c); +DECLARE_TR_CTX(shmwrite_tr, SOF_UUID(shmwrite_uuid), LOG_LEVEL_INFO); + +static const struct comp_driver comp_shmread; +static const struct comp_driver comp_shmwrite; + +/* shm comp data */ +struct shm_comp_data { + /* PCM data */ + struct plug_shm_desc pcm; + struct plug_shm_endpoint *ctx; +#if CONFIG_IPC_MAJOR_4 + struct ipc4_base_module_cfg base_cfg; +#endif +}; + +static int shm_process_new(struct comp_dev *dev, + const struct comp_ipc_config *config, + const void *spec) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx; + int ret; + + comp_dbg(dev, "shm new()"); + + /* FIXME: use PCM ID to create shm */ + ret = plug_shm_init(&cd->pcm, _sp->topology_name, "pcm", 1); + if (ret < 0) + return ret; + + // TODO: get the shm size for the buffer using a better method + cd->pcm.size = 128 * 1024; + + /* mmap the SHM PCM */ + ret = plug_shm_create(&cd->pcm); + if (ret < 0) + return ret; + + cd->ctx = cd->pcm.addr; + ctx = cd->ctx; + ctx->buffer_size = cd->pcm.size; + memset(ctx, 0, sizeof(*ctx)); + ctx->comp_id = config->id; + ctx->pipeline_id = config->pipeline_id; + ctx->state = SOF_PLUGIN_STATE_INIT; + dev->state = COMP_STATE_READY; + + return 0; +} + +static void shm_free(struct comp_dev *dev) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + + cd->ctx = NULL; + + plug_shm_free(&cd->pcm); + shm_unlink(cd->pcm.name); + + free(cd); + free(dev); +} + +static struct comp_dev *shm_new(const struct comp_driver *drv, + const struct comp_ipc_config *config, + const void *spec, int direction) +{ + struct comp_dev *dev; +#if CONFIG_IPC_MAJOR_4 + const struct ipc4_base_module_cfg *base_cfg = (struct ipc4_base_module_cfg *)spec; +#endif + struct shm_comp_data *cd; + int err; + + dev = comp_alloc(drv, sizeof(*dev)); + if (!dev) + return NULL; + dev->ipc_config = *config; + + /* allocate memory for shm comp data */ + cd = rzalloc(SOF_MEM_ZONE_RUNTIME_SHARED, 0, SOF_MEM_CAPS_RAM, sizeof(*cd)); + if (!cd) + goto error; + + comp_set_drvdata(dev, cd); + memcpy(&cd->base_cfg, base_cfg, sizeof(struct ipc4_base_module_cfg)); + + dev->direction = direction; + err = shm_process_new(dev, config, spec); + if (err < 0) { + free(cd); + free(dev); + return NULL; + } + dev->direction_set = true; + + dev->state = COMP_STATE_READY; + return dev; + +error: + free(dev); + return NULL; +} + +static struct comp_dev *shmwrite_new(const struct comp_driver *drv, + const struct comp_ipc_config *config, + const void *spec) +{ + return shm_new(drv, config, spec, SOF_IPC_STREAM_PLAYBACK); +} + +static struct comp_dev *shmread_new(const struct comp_driver *drv, + const struct comp_ipc_config *config, + const void *spec) +{ + return shm_new(drv, config, spec, SOF_IPC_STREAM_CAPTURE); +} + +/** + * \brief Sets shm component audio stream parameters. + * \param[in,out] dev Volume base component device. + * \param[in] params Audio (PCM) stream parameters (ignored for this component) + * \return Error code. + * + * All done in prepare() since we need to know source and sink component params. + */ +static int shmread_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + int ret; + +#if CONFIG_IPC_MAJOR_4 + ipc4_base_module_cfg_to_stream_params(&cd->base_cfg, params); +#endif + + comp_err(dev, "forme_fmt %d channels %d", params->frame_fmt, params->channels); + + ret = comp_verify_params(dev, 0, params); + if (ret < 0) { + comp_err(dev, "shm_params(): pcm params verification failed."); + return ret; + } + ctx->state = SOF_PLUGIN_STATE_READY; + + return 0; +} + +static int shmwrite_params(struct comp_dev *dev, struct sof_ipc_stream_params *params) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + int ret; + + ret = comp_verify_params(dev, 0, params); + if (ret < 0) { + comp_err(dev, "shm_params(): pcm params verification failed."); + return ret; + } + ctx->state = SOF_PLUGIN_STATE_READY; + + return 0; +} + +static int shm_trigger(struct comp_dev *dev, int cmd) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + + comp_dbg(dev, "shm_trigger(%d)", cmd); + + switch (cmd) { + case COMP_TRIGGER_START: + case COMP_TRIGGER_RELEASE: + ctx->state = SOF_PLUGIN_STATE_STREAM_RUNNING; + break; + case COMP_TRIGGER_STOP: + case COMP_TRIGGER_PAUSE: + ctx->state = SOF_PLUGIN_STATE_READY; + break; + case COMP_TRIGGER_RESET: + ctx->state = SOF_PLUGIN_STATE_INIT; + break; + case COMP_TRIGGER_XRUN: + ctx->state = SOF_PLUGIN_STATE_STREAM_ERROR; + break; + default: + break; + } + + return comp_set_state(dev, cmd); +} + +static int shm_cmd(struct comp_dev *dev, int cmd, void *data, int max_data_size) +{ + return 0; +} + +/* + * copy from local SOF buffer to remote SHM buffer + */ +static int shmread_copy(struct comp_dev *dev) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + struct comp_buffer *buffer; + struct audio_stream *source; + unsigned int copy_bytes; + unsigned int remaining; + unsigned int total = 0; + void *rptr; + void *dest; + + /* local SOF source buffer */ + buffer = list_first_item(&dev->bsource_list, struct comp_buffer, + sink_list); + source = &buffer->stream; + rptr = source->r_ptr; + + /* remote SHM sink buffer */ + dest = plug_ep_wptr(ctx); + + /* maximum byte count that can be copied this iteration */ + remaining = MIN(audio_stream_get_avail_bytes(source), plug_ep_get_free(ctx)); + + while (remaining) { + /* min bytes from source pipe */ + copy_bytes = MIN(remaining, plug_ep_wrap_wsize(ctx)); + + /* min bytes from source and sink */ + copy_bytes = MIN(copy_bytes, audio_stream_bytes_without_wrap(source, rptr)); + + /* anything to copy ? */ + if (copy_bytes == 0) + break; + + /* copy to local buffer from SHM buffer */ + memcpy(dest, rptr, copy_bytes); + + /* update SHM pointer with wrap */ + dest = plug_ep_produce(ctx, copy_bytes); + + /* update local pointers */ + rptr = audio_stream_wrap(source, rptr + copy_bytes); + + /* update avail and totals */ + remaining -= copy_bytes; + total += copy_bytes; + } + + /* update sink buffer pointers */ + comp_update_buffer_consume(buffer, total); + comp_dbg(dev, "wrote %d bytes", total); + + return 0; +} + +/* + * copy to local SOF buffer from remote SHM buffer + */ +static int shmwrite_copy(struct comp_dev *dev) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + struct comp_buffer *buffer; + struct audio_stream *sink; + unsigned int copy_bytes; + unsigned int remaining; + unsigned int total = 0; + void *wptr; + void *src; + + /* local SOF sink buffer */ + buffer = list_first_item(&dev->bsink_list, struct comp_buffer, + source_list); + sink = &buffer->stream; + wptr = sink->w_ptr; + + /* remote SHM source buffer */ + src = plug_ep_rptr(ctx); + + /* maximum byte count that can be copied this iteration */ + remaining = MIN(audio_stream_get_free_bytes(sink), plug_ep_get_avail(ctx)); + + while (remaining > 0) { + /* min bytes free bytes in local sink */ + copy_bytes = MIN(remaining, plug_ep_wrap_rsize(ctx)); + + /* min bytes to wrap */ + copy_bytes = MIN(copy_bytes, audio_stream_bytes_without_wrap(sink, wptr)); + + /* nothing to copy ? */ + if (copy_bytes == 0) + break; + + /* copy to SHM from local buffer */ + memcpy(wptr, src, copy_bytes); + + /* update local pointers */ + wptr = audio_stream_wrap(sink, wptr + copy_bytes); + + /* update SHM pointer with wrap */ + src = plug_ep_consume(ctx, copy_bytes); + + /* update avail and totals */ + remaining -= copy_bytes; + total += copy_bytes; + } + + /* update sink buffer pointers */ + comp_update_buffer_produce(buffer, total); + comp_dbg(dev, "read %d bytes", total); + + return 0; +} + +static int shm_prepare(struct comp_dev *dev) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + int ret = 0; + + comp_dbg(dev, "shm prepare_copy()"); + + ret = comp_set_state(dev, COMP_TRIGGER_PREPARE); + if (ret < 0) + return ret; + + ctx->state = SOF_PLUGIN_STATE_READY; + + if (ret == COMP_STATUS_STATE_ALREADY_SET) + return PPL_STATUS_PATH_STOP; + + return ret; +} + +static int shm_reset(struct comp_dev *dev) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + struct plug_shm_endpoint *ctx = cd->ctx; + + comp_set_state(dev, COMP_TRIGGER_RESET); + ctx->state = SOF_PLUGIN_STATE_INIT; + + return 0; +} + +int shm_get_attribute(struct comp_dev *dev, uint32_t type, void *value) +{ + struct shm_comp_data *cd = comp_get_drvdata(dev); + + switch (type) { + case COMP_ATTR_BASE_CONFIG: + memcpy_s(value, sizeof(struct ipc4_base_module_cfg), + &cd->base_cfg, sizeof(struct ipc4_base_module_cfg)); + break; + default: + return -EINVAL; + } + + return 0; +} + +static const struct comp_driver comp_shmread = { + .type = SOF_COMP_HOST, + .uid = SOF_RT_UUID(shmread_uuid), + .tctx = &shmread_tr, + .ops = { + .create = shmread_new, + .free = shm_free, + .params = shmread_params, + .cmd = shm_cmd, + .trigger = shm_trigger, + .copy = shmread_copy, + .prepare = shm_prepare, + .reset = shm_reset, + .get_attribute = shm_get_attribute, + }, +}; + +static const struct comp_driver comp_shmwrite = { + .type = SOF_COMP_HOST, + .uid = SOF_RT_UUID(shmwrite_uuid), + .tctx = &shmwrite_tr, + .ops = { + .create = shmwrite_new, + .free = shm_free, + .params = shmwrite_params, + .cmd = shm_cmd, + .trigger = shm_trigger, + .copy = shmwrite_copy, + .prepare = shm_prepare, + .reset = shm_reset, + .get_attribute = shm_get_attribute, + }, +}; + +static struct comp_driver_info comp_shmread_info = { + .drv = &comp_shmread, +}; + +static struct comp_driver_info comp_shmwrite_info = { + .drv = &comp_shmwrite, +}; + +static void sys_comp_shm_init(void) +{ + comp_register(&comp_shmread_info); + comp_register(&comp_shmwrite_info); +} + +DECLARE_MODULE(sys_comp_shm_init); diff --git a/tools/plugin/pipe/CMakeLists.txt b/tools/plugin/pipe/CMakeLists.txt new file mode 100644 index 000000000000..69f6245cfab2 --- /dev/null +++ b/tools/plugin/pipe/CMakeLists.txt @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: BSD-3-Clause + +add_executable(sof-pipe + main.c + cpu.c + pipeline.c + ctl.c + ipc4.c + ../common.c +) + +sof_append_relative_path_definitions(sof-pipe) + +target_include_directories(sof-pipe PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${sof_source_directory}/src/audio) + +target_compile_options(sof-pipe PRIVATE -DPIC -g -O3 -Wl,-EL -Wall -Werror -DCONFIG_LIBRARY -imacros${config_h}) + +target_include_directories(sof-pipe PRIVATE ${sof_install_directory}/include) +target_include_directories(sof-pipe PRIVATE ${parser_install_dir}/include) + +target_link_libraries(sof-pipe PRIVATE -Wl,-whole-archive sof_library -Wl,-no-whole-archive) +target_link_libraries(sof-pipe PRIVATE sof_parser_lib) +target_link_libraries(sof-pipe PRIVATE pthread) +target_link_libraries(sof-pipe PRIVATE -rdynamic -lasound -ldl -lm -lasound -lrt) diff --git a/tools/plugin/pipe/cpu.c b/tools/plugin/pipe/cpu.c new file mode 100644 index 000000000000..ea7e5d0645e2 --- /dev/null +++ b/tools/plugin/pipe/cpu.c @@ -0,0 +1,186 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +/* + * SOF pipeline in userspace. + */ + +#define _GNU_SOURCE + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <assert.h> +#include <errno.h> +#include <pthread.h> +#include <limits.h> +#include <dlfcn.h> + +#include "common.h" +#include "pipe.h" + +/* read the CPU ID register data on x86 */ +static inline void x86_cpuid(unsigned int *eax, unsigned int *ebx, + unsigned int *ecx, unsigned int *edx) +{ + /* data type is passed in on eax (and sometimes ecx) */ + asm volatile("cpuid" + : "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx) + : "0" (*eax), "2" (*ecx)); +} + +/* + * Check core type for E cores. If non hybrid then it does not matter. + */ +static inline int use_this_core(struct sof_pipe *sp) +{ + /* CPUID - set eax to 0x1a for hybrid core types */ + unsigned int eax = 0x1a, ebx = 0, ecx = 0, edx = 0; + char core_mask; + + /* get the processor core type we are running on now */ + x86_cpuid(&eax, &ebx, &ecx, &edx); + + /* core type 0x20 is atom, 0x40 is core */ + core_mask = (eax >> 24) & 0xFF; + switch (core_mask) { + case 0x20: + fprintf(sp->log, "found E core\n"); + if (sp->use_E_core) + return 1; + return 0; + case 0x40: + fprintf(sp->log, "found P core\n"); + if (sp->use_P_core) + return 1; + return 0; + default: + /* non hybrid arch, just use first core */ + fprintf(sp->log, "found non hybrid core topology\n"); + return 1; + } +} + +/* sof-pipe needs to be sticky to the current core for low latency */ +int pipe_set_affinity(struct sof_pipe *sp) +{ + cpu_set_t cpuset; + pthread_t thread; + long core_count = sysconf(_SC_NPROCESSORS_ONLN); + int i; + int err; + + /* Set affinity mask to core */ + thread = pthread_self(); + CPU_ZERO(&cpuset); + + /* find the first E core (usually come after the P cores ?) */ + for (i = core_count - 1; i >= 0; i--) { + CPU_ZERO(&cpuset); + CPU_SET(i, &cpuset); + + /* change our core to i */ + err = pthread_setaffinity_np(thread, sizeof(cpuset), &cpuset); + if (err != 0) { + fprintf(sp->log, "error: failed to set CPU affinity to core %d: %s\n", + i, strerror(err)); + return err; + } + + /* should we use this core ? */ + if (use_this_core(sp)) + break; + } + + return 0; +} + +/* set ipc thread to low priority */ +int pipe_set_ipc_lowpri(struct sof_pipe *sp) +{ + pthread_attr_t attr; + struct sched_param param; + int err; + + /* attempt to set thread priority - needs suid */ + fprintf(sp->log, "pipe: set IPC low priority\n"); + + err = pthread_attr_init(&attr); + if (err < 0) { + fprintf(sp->log, "error: can't create thread attr %d %s\n", err, strerror(errno)); + return err; + } + + err = pthread_attr_setschedpolicy(&attr, SCHED_OTHER); + if (err < 0) { + fprintf(sp->log, "error: can't set thread policy %d %s\n", err, strerror(errno)); + return err; + } + param.sched_priority = 0; + err = pthread_attr_setschedparam(&attr, ¶m); + if (err < 0) { + fprintf(sp->log, "error: can't set thread sched param %d %s\n", + err, strerror(errno)); + return err; + } + + return 0; +} + +/* set pipeline to realtime priority */ +int pipe_set_rt(struct sof_pipe *sp) +{ + pthread_attr_t attr; + struct sched_param param; + int err; + uid_t uid = getuid(); + uid_t euid = geteuid(); + + /* do we have elevated privileges to attempt RT priority */ + if (uid < 0 || uid != euid) { + /* attempt to set thread priority - needs suid */ + fprintf(sp->log, "pipe: set RT priority\n"); + + err = pthread_attr_init(&attr); + if (err < 0) { + fprintf(sp->log, "error: can't create thread attr %d %s\n", + err, strerror(errno)); + return err; + } + + err = pthread_attr_setschedpolicy(&attr, SCHED_FIFO); + if (err < 0) { + fprintf(sp->log, "error: can't set thread policy %d %s\n", + err, strerror(errno)); + return err; + } + param.sched_priority = 80; + err = pthread_attr_setschedparam(&attr, ¶m); + if (err < 0) { + fprintf(sp->log, "error: can't set thread sched param %d %s\n", + err, strerror(errno)); + return err; + } + err = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + if (err < 0) { + fprintf(sp->log, "error: can't set thread inherit %d %s\n", + err, strerror(errno)); + return err; + } + } else { + fprintf(sp->log, "error: no elevated privileges for RT. uid %d euid %d\n", + uid, euid); + } + + return 0; +} diff --git a/tools/plugin/pipe/ctl.c b/tools/plugin/pipe/ctl.c new file mode 100644 index 000000000000..c2c806621927 --- /dev/null +++ b/tools/plugin/pipe/ctl.c @@ -0,0 +1,91 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +/* + * SOF pipeline in userspace. + */ + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <signal.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <pthread.h> +#include <limits.h> + +#include "common.h" +#include "pipe.h" + +int pipe_kcontrol_cb_new(struct snd_soc_tplg_ctl_hdr *tplg_ctl, + void *_comp, void *arg) +{ + struct sof_pipe *sp = arg; + struct sof_ipc_comp *comp = _comp; + struct plug_shm_glb_state *glb = sp->glb; + struct plug_shm_ctl *ctl; + + if (glb->num_ctls >= MAX_CTLS) { + fprintf(sp->log, "error: too many ctls\n"); + return -EINVAL; + } + + switch (tplg_ctl->type) { + case SND_SOC_TPLG_CTL_VOLSW: + case SND_SOC_TPLG_CTL_VOLSW_SX: + case SND_SOC_TPLG_CTL_VOLSW_XR_SX: + { + struct snd_soc_tplg_mixer_control *tplg_mixer = + (struct snd_soc_tplg_mixer_control *)tplg_ctl; + + glb->size += sizeof(struct plug_shm_ctl); + ctl = &glb->ctl[glb->num_ctls++]; + ctl->comp_id = comp->id; + ctl->mixer_ctl = *tplg_mixer; + break; + } + case SND_SOC_TPLG_CTL_ENUM: + case SND_SOC_TPLG_CTL_ENUM_VALUE: + { + struct snd_soc_tplg_enum_control *tplg_enum = + (struct snd_soc_tplg_enum_control *)tplg_ctl; + + glb->size += sizeof(struct plug_shm_ctl); + ctl = &glb->ctl[glb->num_ctls++]; + ctl->comp_id = comp->id; + ctl->enum_ctl = *tplg_enum; + break; + } + case SND_SOC_TPLG_CTL_BYTES: + { + struct snd_soc_tplg_bytes_control *tplg_bytes = + (struct snd_soc_tplg_bytes_control *)tplg_ctl; + + glb->size += sizeof(struct plug_shm_ctl); + ctl = &glb->ctl[glb->num_ctls++]; + ctl->comp_id = comp->id; + ctl->bytes_ctl = *tplg_bytes; + break; + } + case SND_SOC_TPLG_CTL_RANGE: + case SND_SOC_TPLG_CTL_STROBE: + default: + fprintf(sp->log, "error: invalid ctl type %d\n", + tplg_ctl->type); + return -EINVAL; + } + + return 0; +} diff --git a/tools/plugin/pipe/ipc4.c b/tools/plugin/pipe/ipc4.c new file mode 100644 index 000000000000..9320eeef1999 --- /dev/null +++ b/tools/plugin/pipe/ipc4.c @@ -0,0 +1,444 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +/* + * SOF pipeline in userspace. + */ + +#define _GNU_SOURCE + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <signal.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <pthread.h> +#include <limits.h> +#include <getopt.h> +#include <dlfcn.h> + +#include <rtos/sof.h> +#include <rtos/task.h> +#include <sof/lib/notifier.h> +#include <sof/ipc/driver.h> +#include <sof/ipc/topology.h> +#include <sof/lib/agent.h> +#include <sof/lib/dai.h> +#include <sof/lib/dma.h> +#include <sof/schedule/edf_schedule.h> +#include <sof/schedule/ll_schedule.h> +#include <sof/schedule/ll_schedule_domain.h> +#include <sof/schedule/schedule.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/component.h> +#include <sof/audio/component_ext.h> + +#include "common.h" +#include "pipe.h" + +// TODO: take prefix from ALSA prefix +#define COMP_PREFIX "./sof_ep/install/lib/libsof_" +#define COMP_SUFFIX ".so" +#define UUID_STR_SIZE 32 + +struct sof_pipe_module_library_map { + int module_id; + const char *name; +}; + +static const struct sof_pipe_module_library_map library_map[] = { + {0x6, "libsof_volume.so"}, + {0x2, "libsof_mixer.so"}, + {0x3, "libsof_mixer.so"}, + /*FIXME: hack for now to set up ALSA and SHM components */ + {0x96, "libsof_mod_shm.so"}, /* host playback */ + {0x97, "libsof_mod_alsa.so"}, /* dai playback */ + {0x98, "libsof_mod_shm.so"}, /* host capture */ + {0x99, "libsof_mod_alsa.so"}, /* dai capture */ +}; + +static int pipe_register_comp(struct sof_pipe *sp, uint16_t module_id) +{ + const struct sof_pipe_module_library_map *lib; + int i; + + /* check if module already loaded */ + for (i = 0; i < sp->mod_idx; i++) { + if (sp->module[i].module_id == module_id) + return 0; /* module found and already loaded */ + } + + for (i = 0; i < ARRAY_SIZE(library_map); i++) { + lib = &library_map[i]; + + if (module_id == lib->module_id) + break; + } + + if (i == ARRAY_SIZE(library_map)) { + fprintf(stderr, "module ID: %d not supported\n", module_id); + return -ENOTSUP; + } + + /* not loaded, so load module */ + sp->module[sp->mod_idx].handle = dlopen(lib->name, RTLD_NOW); + if (!sp->module[sp->mod_idx].handle) { + fprintf(stderr, "error: cant load module %s: %s\n", + lib->name, dlerror()); + return -errno; + } + + sp->mod_idx++; + + return 0; +} + +#define iCS(x) ((x) & SOF_CMD_TYPE_MASK) +#define iGS(x) ((x) & SOF_GLB_TYPE_MASK) + +static int pipe_sof_ipc_cmd_before(struct sof_pipe *sp, void *mailbox, size_t bytes) +{ + struct ipc4_message_request *in = mailbox; + enum ipc4_message_target target = in->primary.r.msg_tgt; + int ret = 0; + + switch (target) { + case SOF_IPC4_MESSAGE_TARGET_MODULE_MSG: + { + uint32_t type = in->primary.r.type; + + switch (type) { + case SOF_IPC4_MOD_INIT_INSTANCE: + struct ipc4_module_init_instance *module_init = + (struct ipc4_module_init_instance *)in; + + ret = pipe_register_comp(sp, module_init->primary.r.module_id); + break; + default: + break; + } + break; + } + case SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG: + { + uint32_t type = in->primary.r.type; + + switch (type) { + case SOF_IPC4_GLB_SET_PIPELINE_STATE: + { + struct ipc4_pipeline_set_state *state; + struct ipc_comp_dev *ipc_pipe; + struct ipc *ipc = ipc_get(); + unsigned int pipeline_id; + + state = (struct ipc4_pipeline_set_state *)in; + pipeline_id = (unsigned int)state->primary.r.ppl_id; + + if (state->primary.r.ppl_state == SOF_IPC4_PIPELINE_STATE_PAUSED) { + ipc_pipe = ipc_get_pipeline_by_id(ipc, pipeline_id); + if (!ipc_pipe) { + fprintf(stderr, "No pipeline with instance_id = %u", + pipeline_id); + return -EINVAL; + } + + /* stop the pipeline thread */ + ret = pipe_thread_stop(sp, ipc_pipe->pipeline); + if (ret < 0) { + printf("error: can't start pipeline %d thread\n", + ipc_pipe->pipeline->comp_id); + return ret; + } + } + break; + } + default: + break; + } + break; + } + default: + fprintf(sp->log, "ipc: unknown command target %u size %ld", + target, bytes); + ret = -EINVAL; + break; + } + + return ret; +} + +static int pipe_sof_ipc_cmd_after(struct sof_pipe *sp, void *mailbox, size_t bytes) +{ + struct ipc4_message_request *in = mailbox; + enum ipc4_message_target target = in->primary.r.msg_tgt; + int ret = 0; + + switch (target) { + case SOF_IPC4_MESSAGE_TARGET_MODULE_MSG: + break; + case SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG: + { + uint32_t type = in->primary.r.type; + + switch (type) { + case SOF_IPC4_GLB_CREATE_PIPELINE: + { + struct ipc4_pipeline_create *pipe_desc = (struct ipc4_pipeline_create *)in; + struct ipc_comp_dev *ipc_pipe; + struct ipc *ipc = ipc_get(); + unsigned int pipeline_id = (unsigned int)pipe_desc->primary.r.instance_id; + + ipc_pipe = ipc_get_pipeline_by_id(ipc, pipeline_id); + if (!ipc_pipe) { + fprintf(stderr, "No pipeline with instance_id = %u\n", + pipeline_id); + return -EINVAL; + } + + /* create new pipeline thread */ + ret = pipe_thread_new(sp, ipc_pipe->pipeline); + if (ret < 0) { + printf("error: can't create pipeline %d thread\n", + ipc_pipe->pipeline->pipeline_id); + return ret; + } + break; + } + case SOF_IPC4_GLB_SET_PIPELINE_STATE: + { + struct ipc4_pipeline_set_state *state; + struct ipc_comp_dev *ipc_pipe; + struct ipc *ipc = ipc_get(); + unsigned int pipeline_id; + + state = (struct ipc4_pipeline_set_state *)in; + pipeline_id = (unsigned int)state->primary.r.ppl_id; + + if (state->primary.r.ppl_state == SOF_IPC4_PIPELINE_STATE_RUNNING) { + ipc_pipe = ipc_get_pipeline_by_id(ipc, pipeline_id); + if (!ipc_pipe) { + fprintf(stderr, "No pipeline with instance_id = %u\n", + pipeline_id); + return -EINVAL; + } + + /* start the pipeline thread */ + ret = pipe_thread_start(sp, ipc_pipe->pipeline); + if (ret < 0) { + printf("error: can't start pipeline %d thread\n", + ipc_pipe->pipeline->comp_id); + return ret; + } + } + break; + } + case SOF_IPC4_GLB_DELETE_PIPELINE: + { + struct ipc4_pipeline_create *pipe_desc = (struct ipc4_pipeline_create *)in; + unsigned int pipeline_id = (unsigned int)pipe_desc->primary.r.instance_id; + + /* free pipeline thread */ + ret = pipe_thread_free(sp, pipeline_id); + if (ret < 0) { + printf("error: can't free pipeline %d thread\n", + pipeline_id); + return ret; + } + + break; + } + default: + break; + } + break; + } + default: + fprintf(sp->log, "ipc: unknown command target %u size %ld", + target, bytes); + ret = -EINVAL; + break; + } + + return ret; +} + +int pipe_ipc_do(struct sof_pipe *sp, void *mailbox, size_t bytes) +{ + char mailbox_copy[IPC3_MAX_MSG_SIZE] = {0}; + int err = 0; + + /* preserve mailbox contents for local "after" config */ + memcpy(mailbox_copy, mailbox, bytes); + + /* some IPCs require pipe to perform actions before core */ + /* mailbox can be re-written here by local pipe if needed */ + err = pipe_sof_ipc_cmd_before(sp, mailbox, bytes); + if (err < 0) { + fprintf(sp->log, "error: local IPC processing failed\n"); + return err; + } + + /* is the IPC local only or do we need send to infra ? */ + err = pipe_ipc_message(sp, mailbox, bytes); + if (err < 0) { + fprintf(sp->log, "error: infra IPC processing failed\n"); + return err; + } + + /* some IPCs require pipe to perform actions before core */ + err = pipe_sof_ipc_cmd_after(sp, mailbox_copy, bytes); + if (err < 0) { + fprintf(sp->log, "error: local IPC processing failed\n"); + return err; + } + + return err; +} + +int pipe_ipc_process(struct sof_pipe *sp, struct plug_mq_desc *tx_mq, struct plug_mq_desc *rx_mq) +{ + ssize_t ipc_size; + char mailbox[IPC3_MAX_MSG_SIZE] = {0}; + int err; + struct timespec ts; + + /* IPC thread should not preempt processing thread */ + err = pipe_set_ipc_lowpri(sp); + if (err < 0) + fprintf(sp->log, "error: cant set PCM IPC thread to low priority"); + + /* create the IPC message queue */ + err = plug_mq_create(tx_mq); + if (err < 0) { + fprintf(sp->log, "error: can't create TX IPC message queue : %s\n", + strerror(errno)); + return -errno; + } + + /* create the IPC message queue */ + err = plug_mq_create(rx_mq); + if (err < 0) { + fprintf(sp->log, "error: can't create PCM IPC message queue : %s\n", + strerror(errno)); + return -errno; + } + + /* let main() know we are ready */ + fprintf(sp->log, "sof-pipe: IPC TX %s thread ready\n", tx_mq->queue_name); + fprintf(sp->log, "sof-pipe: IPC RX %s thread ready\n", rx_mq->queue_name); + + /* main PCM IPC handling loop */ + while (1) { + memset(mailbox, 0, IPC3_MAX_MSG_SIZE); + + /* is client dead ? */ + if (sp->glb->state == SOF_PLUGIN_STATE_DEAD) { + fprintf(sp->log, "sof-pipe: IPC %s client complete\n", tx_mq->queue_name); + break; + } + + ipc_size = mq_receive(tx_mq->mq, mailbox, IPC3_MAX_MSG_SIZE, NULL); + if (ipc_size < 0) { + fprintf(sp->log, "error: can't read PCM IPC message queue %s : %s\n", + tx_mq->queue_name, strerror(errno)); + break; + } + + /* TODO: properly validate message and continue if garbage */ + if (*((uint32_t *)mailbox) == 0) { + fprintf(sp->log, "sof-pipe: IPC %s garbage read\n", tx_mq->queue_name); + ts.tv_sec = 0; + ts.tv_nsec = 20 * 1000 * 1000; /* 20 ms */ + nanosleep(&ts, NULL); + continue; + } + + /* do the message work */ + //data_dump(mailbox, IPC3_MAX_MSG_SIZE); + + err = pipe_ipc_do(sp, mailbox, ipc_size); + if (err < 0) + fprintf(sp->log, "error: local IPC processing failed\n"); + + /* now return message completion status found in mailbox */ + err = mq_send(rx_mq->mq, mailbox, IPC3_MAX_MSG_SIZE, 0); + if (err < 0) { + fprintf(sp->log, "error: can't send PCM IPC message queue %s : %s\n", + rx_mq->queue_name, strerror(errno)); + break; + } + } + + fprintf(sp->log, "***sof-pipe: IPC %s thread finished !!\n", tx_mq->queue_name); + return 0; +} + +int plug_mq_cmd(struct plug_mq_desc *ipc, void *msg, size_t len, void *reply, size_t rlen) +{ + struct timespec ts; + ssize_t ipc_size; + char mailbox[IPC3_MAX_MSG_SIZE]; + int err; + + if (len > IPC3_MAX_MSG_SIZE) { + SNDERR("ipc: message too big %d\n", len); + return -EINVAL; + } + memset(mailbox, 0, IPC3_MAX_MSG_SIZE); + memcpy(mailbox, msg, len); + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &ts); + if (err == -1) { + SNDERR("ipc: cant get time: %s", strerror(errno)); + return -errno; + } + + /* IPCs should be read under 10ms */ + plug_timespec_add_ms(&ts, 10); + + /* now return message completion status */ + err = mq_timedsend(ipc->mq, mailbox, IPC3_MAX_MSG_SIZE, 0, &ts); + if (err < 0) { + SNDERR("error: can't send IPC message queue %s : %s\n", + ipc->queue_name, strerror(errno)); + return -errno; + } + + /* wait for sof-pipe reader to consume data or timeout */ + err = clock_gettime(CLOCK_REALTIME, &ts); + if (err == -1) { + SNDERR("ipc: cant get time: %s", strerror(errno)); + return -errno; + } + + /* IPCs should be processed under 20ms */ + plug_timespec_add_ms(&ts, 20); + + ipc_size = mq_timedreceive(ipc->mq, mailbox, IPC3_MAX_MSG_SIZE, NULL, &ts); + if (ipc_size < 0) { + SNDERR("error: can't read IPC message queue %s : %s\n", + ipc->queue_name, strerror(errno)); + return -errno; + } + + /* do the message work */ + //printf("cmd got IPC %ld reply bytes\n", ipc_size); + if (rlen && reply) + memcpy(reply, mailbox, rlen); + + return 0; +} diff --git a/tools/plugin/pipe/main.c b/tools/plugin/pipe/main.c new file mode 100644 index 000000000000..3d9c831dba0b --- /dev/null +++ b/tools/plugin/pipe/main.c @@ -0,0 +1,377 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +/* + * SOF pipeline in userspace. + */ + +#define _GNU_SOURCE + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <signal.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <pthread.h> +#include <limits.h> +#include <getopt.h> +#include <dlfcn.h> + +#include "common.h" +#include "pipe.h" + +#define VERSION "v0.1" + +/* global needed for signal handler */ +struct sof_pipe *_sp; + +static void shutdown(struct sof_pipe *sp) +{ + struct pipethread_data *pipeline_ctx = sp->pipeline_ctx; + int i; + + /* free everything */ + munmap(sp->shm_context.addr, sp->shm_context.size); + shm_unlink(sp->shm_context.name); + + /* cancel all threads, free locks and message queues */ + for (i = 0; i < sp->pipe_thread_count; i++) { + struct pipethread_data *pd = &pipeline_ctx[i]; + + pthread_cancel(pd->ipc_thread); + pthread_cancel(pd->pcm_thread); + plug_mq_free(&pd->ipc_tx_mq); + plug_mq_free(&pd->ipc_rx_mq); + plug_lock_free(&pd->ready); + plug_lock_free(&pd->done); + } + + /* free the sof-pipe IPC tx/rx message queues */ + plug_mq_free(&sp->ipc_tx_mq); + plug_mq_free(&sp->ipc_rx_mq); + + pthread_mutex_destroy(&sp->ipc_lock); + + fflush(sp->log); + fflush(stdout); + fflush(stderr); +} + +/* signals from the ALSA PCM plugin or something has gone wrong */ +static void signal_handler(int sig) +{ + switch (sig) { + case SIGTERM: + fprintf(_sp->log, "Pipe caught SIGTERM - shutdown\n"); + break; + case SIGINT: + fprintf(_sp->log, "Pipe caught SIGINT - shutdown\n"); + break; + default: + fprintf(_sp->log, "Pipe caught signal %d, something went wrong\n", sig); + break; + } + fprintf(_sp->log, "Pipe shutdown signal\n"); + + /* try and clean up if we can */ + shutdown(_sp); + exit(EXIT_FAILURE); +} + +static int pipe_init_signals(struct sof_pipe *sp) +{ + struct sigaction *action = &sp->action; + int err; + + /* + * signals - currently only check for SIGCHLD. TODO: handle more + */ + sigemptyset(&action->sa_mask); + action->sa_handler = signal_handler; + err = sigaction(SIGTERM, action, NULL); + if (err < 0) { + fprintf(sp->log, "failed to register signal action: %s", + strerror(errno)); + return err; + } + + err = sigaction(SIGSEGV, action, NULL); + if (err < 0) { + fprintf(sp->log, "failed to register signal action: %s", + strerror(errno)); + return err; + } + + err = sigaction(SIGINT, action, NULL); + if (err < 0) { + fprintf(sp->log, "failed to register signal action: %s", + strerror(errno)); + return err; + } + + return 0; +} + +int pipe_ipc_message(struct sof_pipe *sp, void *mailbox, size_t bytes) +{ + struct ipc *ipc = ipc_get(); + + /* reply is copied back to mailbox */ + pthread_mutex_lock(&sp->ipc_lock); + memcpy(ipc->comp_data, mailbox, bytes); + ipc_cmd(mailbox); + memcpy(mailbox, ipc->comp_data, bytes); + pthread_mutex_unlock(&sp->ipc_lock); + + return 0; +} + +/* + * Create and open a new semaphore using the lock object. + */ +int plug_lock_create(struct plug_sem_desc *lock) +{ + /* delete any old stale resources that use our resource name */ + sem_unlink(lock->name); + + /* RW blocking lock */ + lock->sem = sem_open(lock->name, O_CREAT | O_RDWR | O_EXCL, SEM_PERMS, 0); + if (lock->sem == SEM_FAILED) { + SNDERR("failed to create semaphore %s: %s", lock->name, strerror(errno)); + return -errno; + } + + return 0; +} + +/* + * Free and delete semaphore resourses in lock object. + */ +void plug_lock_free(struct plug_sem_desc *lock) +{ + sem_close(lock->sem); + sem_unlink(lock->name); +} + +/* + * Create and open a new shared memory region using the SHM object. + */ +int plug_shm_create(struct plug_shm_desc *shm) +{ + int err; + + /* delete any old stale resources that use our resource name */ + shm_unlink(shm->name); + + /* open SHM to be used for low latency position */ + shm->fd = shm_open(shm->name, O_RDWR | O_CREAT, S_IRWXU | S_IRWXG); + if (shm->fd < 0) { + SNDERR("failed to create SHM position %s: %s", shm->name, strerror(errno)); + return -errno; + } + + /* set SHM size */ + err = ftruncate(shm->fd, shm->size); + if (err < 0) { + SNDERR("failed to truncate SHM position %s: %s", shm->name, strerror(errno)); + shm_unlink(shm->name); + return -errno; + } + + /* map it locally for context readback */ + shm->addr = mmap(NULL, shm->size, PROT_READ | PROT_WRITE, MAP_SHARED, shm->fd, 0); + if (!shm->addr) { + SNDERR("failed to mmap SHM position%s: %s", shm->name, strerror(errno)); + shm_unlink(shm->name); + return -errno; + } + + return 0; +} + +/* + * Free and delete shared memory region resourses in SHM object. + */ +void plug_shm_free(struct plug_shm_desc *shm) +{ + close(shm->fd); + shm_unlink(shm->name); +} + +/* + * Create and open a new message queue using the IPC object. + */ +int plug_mq_create(struct plug_mq_desc *ipc) +{ + /* delete any old stale resources that use our resource name */ + mq_unlink(ipc->queue_name); + + memset(&ipc->attr, 0, sizeof(ipc->attr)); + ipc->attr.mq_msgsize = IPC3_MAX_MSG_SIZE; + ipc->attr.mq_maxmsg = 1; + + /* now open new queue for Tx/Rx */ + ipc->mq = mq_open(ipc->queue_name, O_CREAT | O_RDWR | O_EXCL, + S_IRWXU | S_IRWXG, &ipc->attr); + if (ipc->mq < 0) { + fprintf(stderr, "failed to create IPC queue %s: %s\n", + ipc->queue_name, strerror(errno)); + return -errno; + } + + return 0; +} + +/* + * Free and delete message queue resources in IPC object. + */ +void plug_mq_free(struct plug_mq_desc *ipc) +{ + mq_close(ipc->mq); + mq_unlink(ipc->queue_name); +} + +/* + * -D ALSA device. e.g. + * -R realtime (needs parent to set uid) + * -p Force run on P core + * -e Force run on E core + * -t topology name. + * -L log file (otherwise stdout) + * -h help + */ +static void usage(char *name) +{ + fprintf(stdout, "Usage: %s -D ALSA device -T topology\n", name); +} + +int main(int argc, char *argv[], char *env[]) +{ + struct sof_pipe sp = {0}; + int option = 0; + int ret = 0; + + /* default config */ + sp.log = stdout; + sp.alsa_name = "default"; /* default sound device */ + _sp = &sp; + + /* parse all args */ + while ((option = getopt(argc, argv, "hD:RpeT:")) != -1) { + switch (option) { + /* Alsa device */ + case 'D': + sp.alsa_name = strdup(optarg); + break; + case 'R': + sp.realtime = 1; + break; + case 'p': + sp.use_P_core = 1; + sp.use_E_core = 0; + break; + case 'e': + sp.use_E_core = 1; + sp.use_P_core = 0; + break; + case 'T': + snprintf(sp.topology_name, NAME_SIZE, "%s", optarg); + break; + + /* print usage */ + default: + fprintf(sp.log, "unknown option %c\n", option); + __attribute__ ((fallthrough)); + case 'h': + usage(argv[0]); + exit(EXIT_SUCCESS); + } + } + + /* validate cmd line params */ + if (strlen(sp.topology_name) == 0) { + fprintf(sp.log, "error: no IPC topology name specified\n"); + exit(EXIT_FAILURE); + } + + /* global IPC access serialisation mutex */ + ret = pthread_mutex_init(&sp.ipc_lock, NULL); + if (ret < 0) { + fprintf(sp.log, "error: cant create mutex %s\n", strerror(errno)); + exit(EXIT_FAILURE); + } + + fprintf(sp.log, "sof-pipe-%s: using topology %s\n", VERSION, sp.topology_name); + + /* set CPU affinity */ + if (sp.use_E_core || sp.use_P_core) { + ret = pipe_set_affinity(&sp); + if (ret < 0) + goto out; + } + + /* initialize ipc and scheduler */ + if (pipe_sof_setup(sof_get()) < 0) { + fprintf(stderr, "error: pipeline init\n"); + exit(EXIT_FAILURE); + } + + /* global context - plugin clients open this first */ + ret = plug_shm_init(&sp.shm_context, sp.topology_name, "ctx", 0); + if (ret < 0) + goto out; + + /* cleanup any lingering global IPC files */ + shm_unlink(sp.shm_context.name); + + /* make sure we can cleanly shutdown */ + ret = pipe_init_signals(&sp); + if (ret < 0) + goto out; + + /* mmap context on successful topology load */ + ret = plug_shm_create(&sp.shm_context); + if (ret < 0) + goto out; + + /* now prep the global context for client plugin access */ + sp.glb = sp.shm_context.addr; + memset(sp.glb, 0, sizeof(*sp.glb)); + sprintf(sp.glb->magic, "%s", SOF_MAGIC); + sp.glb->size = sizeof(*sp.glb); + sp.glb->state = SOF_PLUGIN_STATE_INIT; + sp.tplg.tplg_file = sp.topology_name; + sp.tplg.ipc_major = 4; //HACK hard code to v4 + + /* sofpipe is now ready */ + sp.glb->state = SOF_PLUGIN_STATE_INIT; + + ret = plug_mq_init(&sp.ipc_tx_mq, "sof", "ipc-tx", 0); + if (ret < 0) + goto out; + + ret = plug_mq_init(&sp.ipc_rx_mq, "sof", "ipc-rx", 0); + if (ret < 0) + goto out; + + /* now process IPCs as they arrive from plugins */ + ret = pipe_ipc_process(&sp, &sp.ipc_tx_mq, &sp.ipc_rx_mq); + +out: + fprintf(sp.log, "shutdown main\n"); + shutdown(&sp); + return ret; +} diff --git a/tools/plugin/pipe/pipe.h b/tools/plugin/pipe/pipe.h new file mode 100644 index 000000000000..3cc95bf8401e --- /dev/null +++ b/tools/plugin/pipe/pipe.h @@ -0,0 +1,126 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2022-2023 Intel Corporation. All rights reserved. + * + * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + */ + +#ifndef __SOF_PLUGIN_PIPE_H__ +#define __SOF_PLUGIN_PIPE_H__ + +#include <stdatomic.h> +#include <stdint.h> +#include <mqueue.h> +#include <pthread.h> +#include <signal.h> + +#include <alsa/asoundlib.h> +#include <tplg_parser/topology.h> +#include <tplg_parser/tokens.h> +#include "common.h" + +struct sof_pipe; + +#define MAX_MODULE_ID 256 +#define MAX_PIPE_THREADS 128 +#define MAX_PIPELINES 32 + +struct pipethread_data { + pthread_t pcm_thread; + pthread_t ipc_thread; + struct sof_pipe *sp; + struct plug_mq_desc ipc_tx_mq; + struct plug_mq_desc ipc_rx_mq; + struct pipeline *pcm_pipeline; + /* PCM flow control */ + struct plug_sem_desc ready; + struct plug_sem_desc done; + atomic_int pipe_users; +}; + +struct sof_pipe_module { + void *handle; + char uuid[SOF_UUID_SIZE]; + int module_id; +}; + +struct sof_pipe { + const char *alsa_name; + char topology_name[NAME_SIZE]; + int realtime; + int use_P_core; + int use_E_core; + int capture; + int file_mode; + int pipe_thread_count; + + struct sigaction action; + + /* SHM for stream context sync */ + struct plug_shm_desc shm_context; + struct plug_shm_glb_state *glb; + + FILE *log; + pthread_mutex_t ipc_lock; + struct tplg_context tplg; + struct tplg_comp_info *comp_list; + struct list_item widget_list; /* list of widgets */ + struct list_item route_list; /* list of widget connections */ + struct list_item pcm_list; /* list of PCMs */ + int info_elems; + int info_index; + + /* IPC */ + pthread_t ipc_pcm_thread; + struct plug_mq_desc ipc_tx_mq; /* queue used by plugin to send IPCs */ + struct plug_mq_desc ipc_rx_mq; /* queue used by plugin to receive the IPC response */ + + /* module SO handles */ + struct sof_pipe_module module[MAX_MODULE_ID]; + int mod_idx; + + /* pipeline context */ + struct pipethread_data pipeline_ctx[MAX_PIPELINES]; +}; + +/* global needed for signal handler */ +extern struct sof_pipe *_sp; + +int pipe_thread_new(struct sof_pipe *sp, struct pipeline *p); +int pipe_thread_free(struct sof_pipe *sp, int pipeline_id); +int pipe_thread_start(struct sof_pipe *sp, struct pipeline *p); +int pipe_thread_stop(struct sof_pipe *sp, struct pipeline *p); +int pipe_sof_setup(struct sof *sof); +int pipe_kcontrol_cb_new(struct snd_soc_tplg_ctl_hdr *tplg_ctl, + void *comp, void *arg); + +/* set pipeline to realtime priority */ +int pipe_set_rt(struct sof_pipe *sp); + +/* set ipc thread to low priority */ +int pipe_set_ipc_lowpri(struct sof_pipe *sp); + +int pipe_ipc_process(struct sof_pipe *sp, struct plug_mq_desc *tx_mq, struct plug_mq_desc *rx_mq); + +int pipe_ipc_new(struct sof_pipe *sp, int pri, int core); +void pipe_ipc_free(struct sof_pipe *sp); + +int pipe_set_affinity(struct sof_pipe *sp); + +int pipe_ipc_message(struct sof_pipe *sp, void *mailbox, size_t bytes); + +int pipe_ipc_do(struct sof_pipe *sp, void *mailbox, size_t bytes); + +/* + * Topology + */ +int plug_parse_topology(struct sof_pipe *sp, struct tplg_context *ctx); + +int plug_load_widget(struct sof_pipe *sp, struct tplg_context *ctx); + +int plug_register_graph(struct sof_pipe *sp, struct tplg_context *ctx, + struct tplg_comp_info *temp_comp_list, + char *pipeline_string, + int count, int num_comps, int pipeline_id); + +#endif diff --git a/tools/plugin/pipe/pipeline.c b/tools/plugin/pipe/pipeline.c new file mode 100644 index 000000000000..831b60a3b6a9 --- /dev/null +++ b/tools/plugin/pipe/pipeline.c @@ -0,0 +1,380 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2022 Intel Corporation. All rights reserved. +// +// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com> + +/* + * SOF pipeline in userspace. + */ + +#include <stdio.h> +#include <sys/poll.h> +#include <string.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdlib.h> +#include <sys/wait.h> +#include <sys/stat.h> +#include <signal.h> +#include <mqueue.h> +#include <fcntl.h> +#include <sys/mman.h> +#include <semaphore.h> +#include <assert.h> +#include <errno.h> +#include <pthread.h> +#include <limits.h> +#include <dlfcn.h> + +#include <rtos/sof.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/component.h> +#include <sof/audio/component_ext.h> +#include <rtos/task.h> +#include <sof/lib/notifier.h> +#include <sof/schedule/edf_schedule.h> +#include <sof/schedule/ll_schedule.h> +#include <sof/schedule/ll_schedule_domain.h> +#include <sof/schedule/schedule.h> +#include <stdatomic.h> + +#include "common.h" +#include "pipe.h" + +#define MAX_PIPE_USERS 8 + +static struct ll_schedule_domain domain = {0}; + +// TODO: all these steps are probably not needed - i.e we only need IPC and pipeline. +int pipe_sof_setup(struct sof *sof) +{ + /* register modules */ + + domain.next_tick = 0; + + /* init components */ + sys_comp_init(sof); + + /* other necessary initializations, todo: follow better SOF init */ + pipeline_posn_init(sof); + init_system_notify(sof); + + /* init IPC */ + if (ipc_init(sof) < 0) { + fprintf(stderr, "error: IPC init\n"); + return -EINVAL; + } + + /* init LL scheduler */ + if (scheduler_init_ll(&domain) < 0) { + fprintf(stderr, "error: edf scheduler init\n"); + return -EINVAL; + } + + /* init EDF scheduler */ + if (scheduler_init_edf() < 0) { + fprintf(stderr, "error: edf scheduler init\n"); + return -EINVAL; + } + + return 0; +} + +static inline int pipe_copy_ready(struct pipethread_data *pd) +{ + struct timespec delay; + int err; + + /* get the current time for source delay */ + err = clock_gettime(CLOCK_REALTIME, &delay); + if (err == -1) { + fprintf(_sp->log, "shm: cant get time: %s", strerror(errno)); + return -errno; + } + + // TODO get from rate + plug_timespec_add_ms(&delay, 2000); + + /* wait for data from source */ + err = sem_timedwait(pd->ready.sem, &delay); + if (err == -1) { + fprintf(_sp->log, "%s %d: fatal timeout: %s on %s\n", __FILE__, __LINE__, + strerror(errno), pd->ready.name); + return -errno; + } + + return 0; +} + +static inline void pipe_copy_done(struct pipethread_data *pd) +{ + /* tell peer we are done */ + sem_post(pd->done.sem); +} + +static void *pipe_process_thread(void *arg) +{ + struct pipethread_data *pd = arg; + int err; + + fprintf(_sp->log, "pipe thread started for pipeline %d\n", + pd->pcm_pipeline->pipeline_id); + + do { + if (pd->pcm_pipeline->status != COMP_STATE_ACTIVE) { + fprintf(_sp->log, "pipe state non active %d\n", + pd->pcm_pipeline->status); + break; + } + + if (pd->pipe_users <= 0) { + fprintf(_sp->log, "pipe no users.\n"); + break; + } + + /* wait for pipe to be ready */ + err = pipe_copy_ready(pd); + if (err < 0) { + fprintf(_sp->log, "pipe ready timeout on pipeline %d state %d users %d\n", + pd->pcm_pipeline->pipeline_id, pd->pcm_pipeline->status, + pd->pipe_users); + break; + } + + /* sink has read data so now generate more it */ + err = pipeline_copy(pd->pcm_pipeline); + + pipe_copy_done(pd); + + if (err < 0) { + fprintf(_sp->log, "pipe thread error %d\n", err); + break; + } else if (err > 0) { + fprintf(_sp->log, "pipe thread complete %d\n", err); + break; + } + + } while (1); + + fprintf(_sp->log, "pipe complete for pipeline %d\n", + pd->pcm_pipeline->pipeline_id); + return 0; +} + +static void *pipe_ipc_process_thread(void *arg) +{ + struct pipethread_data *pd = arg; + int err; + + /* initialise semaphores to default starting value */ + err = sem_init(pd->done.sem, 1, 0); + if (err < 0) { + fprintf(_sp->log, "failed to reset DONE: %s\n", + strerror(errno)); + return NULL; + } + err = sem_init(pd->ready.sem, 1, 0); + if (err < 0) { + fprintf(_sp->log, "failed to reset READY: %s\n", + strerror(errno)); + return NULL; + } + + err = pipe_ipc_process(pd->sp, &pd->ipc_tx_mq, &pd->ipc_rx_mq); + if (err < 0) { + fprintf(_sp->log, "pipe IPC thread error for pipeline %d\n", + pd->pcm_pipeline->pipeline_id); + } + + return NULL; +} + +int pipe_thread_start(struct sof_pipe *sp, struct pipeline *p) +{ + struct pipethread_data *pipeline_ctx = sp->pipeline_ctx; + struct pipethread_data *pd; + int pipeline_id; + int ret, pipe_users; + + pipeline_id = p->pipeline_id; + + if (pipeline_id >= MAX_PIPELINES) { + fprintf(_sp->log, "error: pipeline ID %d out of range\n", pipeline_id); + return -EINVAL; + } + + if (!pipeline_ctx[pipeline_id].sp) { + fprintf(_sp->log, "error: pipeline ID %d not in use\n", pipeline_id); + return -EINVAL; + } + pd = &pipeline_ctx[pipeline_id]; + + /* only create thread if not active */ + pipe_users = atomic_fetch_add(&pd->pipe_users, 1); + if (pipe_users > 0) { + fprintf(_sp->log, "pipeline ID %d thread already running %d users\n", + pipeline_id, pipe_users); + return 0; + } + + fprintf(_sp->log, "pipeline ID %d thread not running so starting...\n", pipeline_id); + + /* first user so start the PCM pipeline thread */ + ret = pthread_create(&pd->pcm_thread, NULL, pipe_process_thread, pd); + if (ret < 0) { + fprintf(_sp->log, "failed to create PCM thread: %s\n", strerror(errno)); + return -errno; + } + + return ret; +} + +int pipe_thread_stop(struct sof_pipe *sp, struct pipeline *p) +{ + struct pipethread_data *pipeline_ctx = sp->pipeline_ctx; + struct pipethread_data *pd; + int pipeline_id; + int ret, pipe_users; + + pipeline_id = p->pipeline_id; + + /* this is called when the pipeline is PAUSED for the first time before RUNNING */ + if (p->status == COMP_STATE_INIT) + return 0; + + if (pipeline_id >= MAX_PIPELINES) { + fprintf(_sp->log, "error: pipeline ID %d out of range\n", pipeline_id); + return -EINVAL; + } + + if (!pipeline_ctx[pipeline_id].sp) { + fprintf(_sp->log, "error: pipeline ID %d not in use\n", pipeline_id); + return -EINVAL; + } + pd = &pipeline_ctx[pipeline_id]; + + /* only join thread if not active */ + pipe_users = atomic_fetch_sub(&pd->pipe_users, 1); + if (pipe_users != 1) { + fprintf(_sp->log, "pipeline ID %d thread has multiple %d users\n", + pipeline_id, pipe_users); + return 0; + } + + fprintf(_sp->log, "pipeline ID %d thread can be stopped...\n", pipeline_id); + + ret = pthread_cancel(pd->pcm_thread); + if (ret < 0) { + fprintf(_sp->log, "failed to cancel PCM thread: %s\n", strerror(errno)); + return -errno; + } + + return ret; +} + +int pipe_thread_new(struct sof_pipe *sp, struct pipeline *p) +{ + struct pipethread_data *pipeline_ctx = sp->pipeline_ctx; + struct pipethread_data *pd; + int ret; + + if (!p) { + fprintf(_sp->log, "error: invalid pipeline\n"); + return -EINVAL; + } + + if (p->pipeline_id >= MAX_PIPELINES) { + fprintf(_sp->log, "error: pipeline ID %d out of range\n", p->pipeline_id); + return -EINVAL; + } + + if (pipeline_ctx[p->pipeline_id].sp) { + fprintf(_sp->log, "error: pipeline ID %d in use\n", p->pipeline_id); + return -EINVAL; + } + pd = &pipeline_ctx[p->pipeline_id]; + pd->sp = _sp; + pd->pcm_pipeline = p; + + /* initialise global IPC data */ + /* TODO: change the PCM name to tplg or make it per PID*/ + ret = plug_mq_init(&pd->ipc_tx_mq, pd->sp->topology_name, "pcm-tx", p->pipeline_id); + if (ret < 0) + return -EINVAL; + mq_unlink(pd->ipc_tx_mq.queue_name); + + ret = plug_mq_init(&pd->ipc_rx_mq, pd->sp->topology_name, "pcm-rx", p->pipeline_id); + if (ret < 0) + return -EINVAL; + mq_unlink(pd->ipc_rx_mq.queue_name); + + /* init names of shared resources */ + ret = plug_lock_init(&pd->ready, _sp->topology_name, "ready", p->pipeline_id); + if (ret < 0) + return ret; + + ret = plug_lock_init(&pd->done, _sp->topology_name, "done", p->pipeline_id); + if (ret) + return ret; + + /* open semaphores */ + ret = plug_lock_create(&pd->ready); + if (ret < 0) + return ret; + ret = plug_lock_create(&pd->done); + if (ret < 0) + goto lock_err; + + /* start IPC pipeline thread */ + ret = pthread_create(&pd->ipc_thread, NULL, pipe_ipc_process_thread, pd); + if (ret < 0) { + fprintf(_sp->log, "failed to create IPC thread: %s\n", strerror(errno)); + ret = -errno; + goto lock2_err; + } + + return 0; + +lock2_err: + plug_lock_free(&pd->done); +lock_err: + plug_lock_free(&pd->ready); + return ret; +} + +int pipe_thread_free(struct sof_pipe *sp, int pipeline_id) +{ + struct pipethread_data *pipeline_ctx = sp->pipeline_ctx; + struct pipethread_data *pd; + int err; + + if (pipeline_id >= MAX_PIPELINES) { + fprintf(_sp->log, "error: pipeline ID %d out of range\n", pipeline_id); + return -EINVAL; + } + + if (!pipeline_ctx[pipeline_id].sp) { + fprintf(_sp->log, "error: pipeline ID %d not in use\n", pipeline_id); + return -EINVAL; + } + + pd = &pipeline_ctx[pipeline_id]; + + err = pthread_cancel(pd->ipc_thread); + if (err < 0) { + fprintf(_sp->log, "failed to create IPC thread: %s\n", strerror(errno)); + return -errno; + } + + plug_mq_free(&pd->ipc_tx_mq); + mq_unlink(pd->ipc_tx_mq.queue_name); + plug_mq_free(&pd->ipc_rx_mq); + mq_unlink(pd->ipc_rx_mq.queue_name); + + plug_lock_free(&pd->ready); + plug_lock_free(&pd->done); + + pd->sp = NULL; + return 0; +} diff --git a/tools/tplg_parser/CMakeLists.txt b/tools/tplg_parser/CMakeLists.txt index f27dd8297d14..749868fd2dd2 100644 --- a/tools/tplg_parser/CMakeLists.txt +++ b/tools/tplg_parser/CMakeLists.txt @@ -17,6 +17,12 @@ else() add_library(sof_tplg_parser SHARED "") endif() +if (CONFIG_IPC4) + set(tplg_ipc CONFIG_IPC_MAJOR_4) +else() + set(tplg_ipc CONFIG_IPC_MAJOR_3) +endif() + target_sources(sof_tplg_parser PUBLIC tokens.c process.c @@ -42,7 +48,6 @@ target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/i target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/arch/host/include) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/platform/library/include) -target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/src/audio) target_include_directories(sof_tplg_parser PRIVATE ${sof_source_directory}/posix/include) # Configuration time, make copy @@ -61,7 +66,7 @@ endif() target_compile_options(sof_tplg_parser PRIVATE -g -O -Wall -Werror -Wl,-EL -fPIC -DPIC -Wmissing-prototypes ${implicit_fallthrough} - -DCONFIG_LIBRARY -DCONFIG_IPC_MAJOR_3) + -DCONFIG_LIBRARY -D${tplg_ipc}) target_link_libraries(sof_tplg_parser PRIVATE -lm) From f9afd6ac9db07c8900793556b0c8a953d16aa0f8 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 30 Aug 2023 13:10:21 +0200 Subject: [PATCH 480/639] buf: remove buffer_acquire/buffer_release buffer_acquire and buffer_release are no longer in use remove stubs from the code Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/include/sof/audio/buffer.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/include/sof/audio/buffer.h b/src/include/sof/audio/buffer.h index d929fd9971b5..568a121db575 100644 --- a/src/include/sof/audio/buffer.h +++ b/src/include/sof/audio/buffer.h @@ -220,16 +220,6 @@ static inline void buffer_stream_writeback(struct comp_buffer *buffer, uint32_t audio_stream_writeback(&buffer->stream, bytes); } -/* stubs for acquire/release for compilation, to be removed at last step */ -__must_check static inline struct comp_buffer *buffer_acquire(struct comp_buffer *buffer) -{ - return (struct comp_buffer *)buffer; -} - -static inline void buffer_release(struct comp_buffer *buffer) -{ - (void)buffer; -} /* * Attach a new buffer at the beginning of the list. Note, that "head" must From d89b7d28f6367f1ec66c1d9f0e4d8ed5b9bc41c2 Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Wed, 11 Jan 2023 10:41:50 +0800 Subject: [PATCH 481/639] ipc4: add google rtc AEC support for mtl Signed-off-by: Rander Wang <rander.wang@intel.com> --- config/mtl.toml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config/mtl.toml b/config/mtl.toml index 4a246dcf140d..b9decdefc4ac 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 23 +count = 24 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -597,3 +597,20 @@ count = 23 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "RTC_AEC" + uuid = "B780A0A6-269F-466F-B477-23DFA05AF758" + affinity_mask = "0x3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "10" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0x8, 0x2, 0x2, 0x1, + 0, 0, 0x8, 0x2, 0x2, 0x4, + 1, 0, 0x8, 0x2, 0x2, 0x1] From 405d48dbeaf7f5ff27fb37cb05558585a4c03264 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 25 Sep 2023 18:26:23 +0300 Subject: [PATCH 482/639] Audio: Module adapter: Fix error message typo sinks -> sources This patch fixes a confusing error message typo in module_adapter.c. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/module_adapter/module_adapter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 90c4b7547c8a..295c8080dccb 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -1055,7 +1055,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) } num_input_buffers = i; if (num_input_buffers > mod->max_sources) { - comp_err(dev, "Invalid number of sinks %d\n", num_input_buffers); + comp_err(dev, "Invalid number of sources %d\n", num_input_buffers); return -EINVAL; } From ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 10:38:00 +0300 Subject: [PATCH 483/639] Congfig: Add TDFB to TGL, TGL-H, MTL, and LNL This patch enables load the of Time domain fixed beamformer (TDFB). Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- config/lnl.toml | 18 +++++++++++++++++- config/mtl.toml | 18 +++++++++++++++++- config/tgl-cavs.toml | 18 +++++++++++++++++- config/tgl-h-cavs.toml | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/config/lnl.toml b/config/lnl.toml index 30e567b060ec..9c245b9ca8e9 100644 --- a/config/lnl.toml +++ b/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 23 +count = 24 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -553,3 +553,19 @@ count = 23 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/mtl.toml b/config/mtl.toml index b9decdefc4ac..2d2742c91c83 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 24 +count = 25 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -614,3 +614,19 @@ count = 24 pin = [0, 0, 0x8, 0x2, 0x2, 0x1, 0, 0, 0x8, 0x2, 0x2, 0x4, 1, 0, 0x8, 0x2, 0x2, 0x1] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-cavs.toml b/config/tgl-cavs.toml index 15638424c9fe..320c1f3531e4 100644 --- a/config/tgl-cavs.toml +++ b/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -480,3 +480,19 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/config/tgl-h-cavs.toml b/config/tgl-h-cavs.toml index 04a0df56a861..61c3c01ad464 100644 --- a/config/tgl-h-cavs.toml +++ b/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 20 +count = 21 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -480,3 +480,19 @@ count = 20 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # TDFB module config + [[module.entry]] + name = "TDFB" + uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] From f873a99dd7ccc7fe1f9620775669ff7f7ac47416 Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba <serhiy.katsyuba@intel.com> Date: Fri, 29 Sep 2023 15:20:29 +0200 Subject: [PATCH 484/639] ipc4: mixin/mixout: Remove redundant source_info stuff Mutex protected module_source_info was an old failed attempt to support cross-core connection of mixin and mixout. That functionality was never properly tested as FW did not support cross-core connections there. For connected mixin and mixout located on same core, that functionality is not needed. For cross-core connection, that functionality creates dead-lock. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com> --- src/audio/mixin_mixout/mixin_mixout.c | 213 ++++++++++++------ src/audio/module_adapter/module_adapter.c | 96 +------- .../sof/audio/module_adapter/module/generic.h | 43 ---- src/samples/audio/smart_amp_test_ipc4.c | 4 - 4 files changed, 146 insertions(+), 210 deletions(-) diff --git a/src/audio/mixin_mixout/mixin_mixout.c b/src/audio/mixin_mixout/mixin_mixout.c index 3aba8583c8e4..ba3184c66e12 100644 --- a/src/audio/mixin_mixout/mixin_mixout.c +++ b/src/audio/mixin_mixout/mixin_mixout.c @@ -79,10 +79,22 @@ struct mixin_data { struct mixin_sink_config sink_config[MIXIN_MAX_SINKS]; }; -/* mixout component private data. This can be accessed from different cores. */ +/* + * Mixin calls "consume" on its source data but never calls "produce" -- that one is called + * by mixout for its sink data. So between mixin_process() and mixout_process() a number of + * consumed (in mixin) yet not produced (in mixout) frames should be stored for each mixin + * and mixout pair. + */ +struct pending_frames { + struct comp_dev *mixin; + uint32_t frames; +}; + +/* mixout component private data */ struct mixout_data { /* number of currently mixed frames in mixout sink buffer */ uint32_t mixed_frames; + /* * Source data is consumed by mixins in mixin_process() but sink data cannot be * immediately produced. Sink data is produced by mixout in mixout_process() after @@ -90,9 +102,22 @@ struct mixout_data { * So for each connected mixin, mixout keeps knowledge of data already consumed * by mixin but not yet produced in mixout. */ - uint32_t pending_frames[MIXOUT_MAX_SOURCES]; + struct pending_frames pending_frames[MIXOUT_MAX_SOURCES]; }; +/* NULL is also a valid mixin argument: in such case the function returns first unused entry */ +static struct pending_frames *get_mixin_pending_frames(struct mixout_data *mixout_data, + const struct comp_dev *mixin) +{ + int i; + + for (i = 0; i < MIXOUT_MAX_SOURCES; i++) + if (mixout_data->pending_frames[i].mixin == mixin) + return &mixout_data->pending_frames[i]; + + return NULL; +} + static int mixin_init(struct processing_module *mod) { struct module_data *mod_data = &mod->priv; @@ -121,7 +146,6 @@ static int mixin_init(struct processing_module *mod) static int mixout_init(struct processing_module *mod) { - struct module_source_info __sparse_cache *mod_source_info; struct comp_dev *dev = mod->dev; struct mixout_data *mo_data; @@ -131,9 +155,7 @@ static int mixout_init(struct processing_module *mod) if (!mo_data) return -ENOMEM; - mod_source_info = module_source_info_acquire(mod->source_info); - mod_source_info->private = mo_data; - module_source_info_release(mod_source_info); + mod->priv.private = mo_data; mod->skip_sink_buffer_writeback = true; @@ -154,14 +176,8 @@ static int mixin_free(struct processing_module *mod) static int mixout_free(struct processing_module *mod) { - struct module_source_info __sparse_cache *mod_source_info; - comp_dbg(mod->dev, "mixout_free()"); - - mod_source_info = module_source_info_acquire(mod->source_info); - rfree(mod_source_info->private); - mod_source_info->private = NULL; - module_source_info_release(mod_source_info); + rfree(module_get_private_data(mod)); return 0; } @@ -236,9 +252,9 @@ static void silence(struct audio_stream *stream, uint32_t start_frame, * Since there is no garantie that mixout processing is done in time we have * to account for a possibility having not yet produced data in mixout sink * buffer that was written there on previous run(s) of mixin_process(). So for each - * mixin <--> mixout pair we track consumed_yet_not_produced data amount. - * That value is also used in mixout_process() to calculate how many data was - * actually mixed and so xxx_produce() is called for that amount. + * mixin <--> mixout pair we track consumed yet not produced (pending_frames) data + * amount. That value is also used in mixout_process() to calculate how many data + * was actually mixed and so xxx_produce() is called for that amount. */ static int mixin_process(struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, @@ -251,7 +267,7 @@ static int mixin_process(struct processing_module *mod, uint16_t sinks_ids[MIXIN_MAX_SINKS]; uint32_t bytes_to_consume_from_source_buf; uint32_t frames_to_copy; - int source_index; + struct pending_frames *pending_frames; int i, ret; comp_dbg(dev, "mixin_process()"); @@ -280,8 +296,7 @@ static int mixin_process(struct processing_module *mod, struct comp_buffer *sink; struct mixout_data *mixout_data; struct processing_module *mixout_mod; - struct module_source_info __sparse_cache *mod_source_info; - uint32_t free_frames, pending_frames; + uint32_t free_frames; /* unused buffer between mixin and mixout */ unused_in_between_buf_c = container_of(output_buffers[i].data, @@ -295,12 +310,10 @@ static int mixin_process(struct processing_module *mod, sink = list_first_item(&mixout->bsink_list, struct comp_buffer, source_list); mixout_mod = comp_get_drvdata(mixout); - mod_source_info = module_source_info_acquire(mixout_mod->source_info); - mixout_data = mod_source_info->private; - source_index = find_module_source_index(mod_source_info, dev); - if (source_index < 0) { + mixout_data = module_get_private_data(mixout_mod); + pending_frames = get_mixin_pending_frames(mixout_data, dev); + if (!pending_frames) { comp_err(dev, "No source info"); - module_source_info_release(mod_source_info); return -EINVAL; } @@ -310,7 +323,6 @@ static int mixin_process(struct processing_module *mod, */ if (!sink->hw_params_configured) { comp_err(dev, "Uninitialized mixout sink buffer!"); - module_source_info_release(mod_source_info); return -EINVAL; } @@ -320,11 +332,8 @@ static int mixin_process(struct processing_module *mod, * consumed and written there by mixin on previous mixin_process() run. * We do NOT want to overwrite that data. */ - pending_frames = mixout_data->pending_frames[source_index]; - assert(free_frames >= pending_frames); - sinks_free_frames = MIN(sinks_free_frames, free_frames - pending_frames); - - module_source_info_release(mod_source_info); + assert(free_frames >= pending_frames->frames); + sinks_free_frames = MIN(sinks_free_frames, free_frames - pending_frames->frames); } if (source_avail_frames > 0) { @@ -353,7 +362,6 @@ static int mixin_process(struct processing_module *mod, struct comp_dev *mixout; struct comp_buffer *sink; struct mixout_data *mixout_data; - struct module_source_info __sparse_cache *mod_source_info; struct processing_module *mixout_mod; uint32_t start_frame; uint32_t writeback_size; @@ -362,12 +370,10 @@ static int mixin_process(struct processing_module *mod, sink = list_first_item(&mixout->bsink_list, struct comp_buffer, source_list); mixout_mod = comp_get_drvdata(mixout); - mod_source_info = module_source_info_acquire(mixout_mod->source_info); - mixout_data = mod_source_info->private; - source_index = find_module_source_index(mod_source_info, dev); - if (source_index < 0) { + mixout_data = module_get_private_data(mixout_mod); + pending_frames = get_mixin_pending_frames(mixout_data, dev); + if (!pending_frames) { comp_err(dev, "No source info"); - module_source_info_release(mod_source_info); return -EINVAL; } @@ -375,7 +381,7 @@ static int mixin_process(struct processing_module *mod, * Normally start_frame would be 0 unless mixout pipeline has serious * performance problems with processing data on time in mixout. */ - start_frame = mixout_data->pending_frames[source_index]; + start_frame = pending_frames->frames; /* if source does not produce any data but mixin is in active state -- generate * silence instead of that source data @@ -393,7 +399,6 @@ static int mixin_process(struct processing_module *mod, start_frame, mixout_data->mixed_frames, input_buffers[0].data, frames_to_copy); if (ret < 0) { - module_source_info_release(mod_source_info); return ret; } } @@ -407,12 +412,10 @@ static int mixin_process(struct processing_module *mod, if (writeback_size > 0) buffer_stream_writeback(sink, writeback_size); - mixout_data->pending_frames[source_index] += frames_to_copy; + pending_frames->frames += frames_to_copy; if (frames_to_copy + start_frame > mixout_data->mixed_frames) mixout_data->mixed_frames = frames_to_copy + start_frame; - - module_source_info_release(mod_source_info); } return 0; @@ -425,18 +428,16 @@ static int mixout_process(struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, struct output_stream_buffer *output_buffers, int num_output_buffers) { - struct module_source_info __sparse_cache *mod_source_info; struct comp_dev *dev = mod->dev; struct mixout_data *md; uint32_t frames_to_produce = INT32_MAX; - uint32_t pending_frames; + struct pending_frames *pending_frames; uint32_t sink_bytes; int i; comp_dbg(dev, "mixout_process()"); - mod_source_info = module_source_info_acquire(mod->source_info); - md = mod_source_info->private; + md = module_get_private_data(mod); /* iterate over all connected mixins to find minimal value of frames they consumed * (i.e., mixed into mixout sink buffer). That is the amount that can/should be @@ -446,7 +447,6 @@ static int mixout_process(struct processing_module *mod, const struct audio_stream *source_stream; struct comp_buffer *unused_in_between_buf; struct comp_dev *source; - int source_index; source_stream = input_buffers[i].data; unused_in_between_buf = container_of(source_stream, struct comp_buffer, @@ -454,15 +454,12 @@ static int mixout_process(struct processing_module *mod, source = unused_in_between_buf->source; - source_index = find_module_source_index(mod_source_info, source); - /* this shouldn't happen but skip even if it does and move to the next source */ - if (source_index < 0) + pending_frames = get_mixin_pending_frames(md, source); + if (!pending_frames) continue; - pending_frames = md->pending_frames[source_index]; - - if (source->state == COMP_STATE_ACTIVE || pending_frames) - frames_to_produce = MIN(frames_to_produce, pending_frames); + if (source->state == COMP_STATE_ACTIVE || pending_frames->frames) + frames_to_produce = MIN(frames_to_produce, pending_frames->frames); } if (frames_to_produce > 0 && frames_to_produce < INT32_MAX) { @@ -470,8 +467,6 @@ static int mixout_process(struct processing_module *mod, const struct audio_stream *source_stream; struct comp_buffer *unused_in_between_buf; struct comp_dev *source; - int source_index; - uint32_t pending_frames; source_stream = input_buffers[i].data; unused_in_between_buf = container_of(source_stream, @@ -479,15 +474,14 @@ static int mixout_process(struct processing_module *mod, source = unused_in_between_buf->source; - source_index = find_module_source_index(mod_source_info, source); - if (source_index < 0) + pending_frames = get_mixin_pending_frames(md, source); + if (!pending_frames) continue; - pending_frames = md->pending_frames[source_index]; - if (pending_frames >= frames_to_produce) - md->pending_frames[source_index] -= frames_to_produce; + if (pending_frames->frames >= frames_to_produce) + pending_frames->frames -= frames_to_produce; else - md->pending_frames[source_index] = 0; + pending_frames->frames = 0; } assert(md->mixed_frames >= frames_to_produce); @@ -504,8 +498,6 @@ static int mixout_process(struct processing_module *mod, output_buffers[0].size = 0; } - module_source_info_release(mod_source_info); - return 0; } @@ -712,7 +704,6 @@ static int mixout_prepare(struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) { - struct module_source_info __sparse_cache *mod_source_info; struct comp_dev *dev = mod->dev; struct mixout_data *md; int ret, i; @@ -727,13 +718,95 @@ static int mixout_prepare(struct processing_module *mod, * Since mixout sink buffer stream is reset on .prepare(), let's * reset counters for not yet produced frames in that buffer. */ - mod_source_info = module_source_info_acquire(mod->source_info); - md = mod_source_info->private; + md = module_get_private_data(mod); md->mixed_frames = 0; for (i = 0; i < MIXOUT_MAX_SOURCES; i++) - md->pending_frames[i] = 0; - module_source_info_release(mod_source_info); + md->pending_frames[i].frames = 0; + + return 0; +} + +int mixout_bind(struct processing_module *mod, void *data) +{ + struct ipc4_module_bind_unbind *bu; + struct comp_dev *mixin; + struct pending_frames *pending_frames; + int src_id; + struct mixout_data *mixout_data; + + comp_dbg(mod->dev, "mixout_bind() %p", data); + + bu = (struct ipc4_module_bind_unbind *)data; + src_id = IPC4_COMP_ID(bu->primary.r.module_id, bu->primary.r.instance_id); + + /* we are only interested in bind for mixin -> mixout pair */ + if (mod->dev->ipc_config.id == src_id) + return 0; + + mixin = ipc4_get_comp_dev(src_id); + if (!mixin) { + comp_err(mod->dev, "mixout_bind: no mixin with ID %d found", src_id); + return -EINVAL; + } + + mixout_data = module_get_private_data(mod); + + pending_frames = get_mixin_pending_frames(mixout_data, mixin); + /* + * this should never happen as pending_frames info for a particular mixin and mixout pair + * should have been already cleared in mixout_unbind() + */ + if (pending_frames) { + pending_frames->mixin = NULL; + pending_frames->frames = 0; + } + + /* find an empty slot in the pending_frames array */ + pending_frames = get_mixin_pending_frames(mixout_data, NULL); + if (!pending_frames) { + /* no free slot in pending_frames array */ + comp_err(mod->dev, "Too many inputs!"); + return -ENOMEM; + } + + pending_frames->frames = 0; + pending_frames->mixin = mixin; + + return 0; +} + +int mixout_unbind(struct processing_module *mod, void *data) +{ + struct ipc4_module_bind_unbind *bu; + struct comp_dev *mixin; + struct pending_frames *pending_frames; + int src_id; + struct mixout_data *mixout_data; + + comp_dbg(mod->dev, "mixout_unbind()"); + + bu = (struct ipc4_module_bind_unbind *)data; + src_id = IPC4_COMP_ID(bu->primary.r.module_id, bu->primary.r.instance_id); + + /* we are only interested in unbind for mixin -> mixout pair */ + if (mod->dev->ipc_config.id == src_id) + return 0; + + mixin = ipc4_get_comp_dev(src_id); + if (!mixin) { + comp_err(mod->dev, "mixout_bind: no mixin with ID %d found", src_id); + return -EINVAL; + } + + mixout_data = module_get_private_data(mod); + + /* remove mixin from pending_frames array */ + pending_frames = get_mixin_pending_frames(mixout_data, mixin); + if (pending_frames) { + pending_frames->mixin = NULL; + pending_frames->frames = 0; + } return 0; } @@ -845,7 +918,9 @@ static const struct module_interface mixout_interface = { .prepare = mixout_prepare, .process_audio_stream = mixout_process, .reset = mixout_reset, - .free = mixout_free + .free = mixout_free, + .bind = mixout_bind, + .unbind = mixout_unbind }; DECLARE_MODULE_ADAPTER(mixout_interface, mixout_uuid, mixout_tr); diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index 295c8080dccb..ff6b9e8e086a 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -89,14 +89,6 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, return NULL; } - /* align the allocation size to a cache line for the coherent API */ - mod->source_info = coherent_init_thread(struct module_source_info, c); - if (!mod->source_info) { - rfree(dev); - rfree(mod); - return NULL; - } - dst = &mod->priv.cfg; mod->dev = dev; @@ -186,7 +178,6 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, comp_dbg(dev, "module_adapter_new() done"); return dev; err: - coherent_free_thread(mod->source_info, c); rfree(mod); rfree(dev); return NULL; @@ -449,23 +440,10 @@ int module_adapter_prepare(struct comp_dev *dev) if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) return 0; - /* - * compute number of input buffers and make the source_info shared if the module is on a - * different core than any of it's sources - */ + /* compute number of input buffers */ mod->num_of_sources = 0; - list_for_item(blist, &dev->bsource_list) { - struct comp_buffer *buf; - struct comp_dev *source; - - buf = buffer_from_list(blist, PPL_DIR_UPSTREAM); - source = buffer_get_comp(buf, PPL_DIR_UPSTREAM); - - if (source->pipeline && source->pipeline->core != dev->pipeline->core) - coherent_shared_thread(mod->source_info, c); - + list_for_item(blist, &dev->bsource_list) mod->num_of_sources++; - } /* compute number of output buffers */ mod->num_of_sinks = 0; @@ -1649,7 +1627,6 @@ void module_adapter_free(struct comp_dev *dev) buffer_free(buffer); } - coherent_free_thread(mod->source_info, c); rfree(mod); rfree(dev); } @@ -1885,98 +1862,29 @@ static bool module_adapter_multi_sink_source_check(struct comp_dev *dev) int module_adapter_bind(struct comp_dev *dev, void *data) { - struct module_source_info __sparse_cache *mod_source_info; struct processing_module *mod = comp_get_drvdata(dev); - struct ipc4_module_bind_unbind *bu; - struct comp_dev *source_dev; - int source_index; - int src_id; int ret; ret = module_bind(mod, data); if (ret < 0) return ret; - bu = (struct ipc4_module_bind_unbind *)data; - src_id = IPC4_COMP_ID(bu->primary.r.module_id, bu->primary.r.instance_id); - mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_check(dev); - /* nothing to do if this module is the source during bind */ - if (dev->ipc_config.id == src_id) - return 0; - - source_dev = ipc4_get_comp_dev(src_id); - if (!source_dev) { - comp_err(dev, "module_adapter_bind: no source with ID %d found", src_id); - return -EINVAL; - } - - mod_source_info = module_source_info_acquire(mod->source_info); - - source_index = find_module_source_index(mod_source_info, source_dev); - /* - * this should never happen as source_info should have been already cleared in - * module_adapter_unbind() - */ - if (source_index >= 0) - mod_source_info->sources[source_index] = NULL; - - /* find an empty slot in the source_info array */ - source_index = find_module_source_index(mod_source_info, NULL); - if (source_index < 0) { - /* no free slot in module source_info array */ - comp_err(dev, "Too many inputs!"); - module_source_info_release(mod_source_info); - return -ENOMEM; - } - - /* set the source dev pointer */ - mod_source_info->sources[source_index] = source_dev; - - module_source_info_release(mod_source_info); - return 0; } int module_adapter_unbind(struct comp_dev *dev, void *data) { - struct module_source_info __sparse_cache *mod_source_info; struct processing_module *mod = comp_get_drvdata(dev); - struct ipc4_module_bind_unbind *bu; - struct comp_dev *source_dev; - int source_index; - int src_id; int ret; ret = module_unbind(mod, data); if (ret < 0) return ret; - bu = (struct ipc4_module_bind_unbind *)data; - src_id = IPC4_COMP_ID(bu->primary.r.module_id, bu->primary.r.instance_id); - mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_check(dev); - /* nothing to do if this module is the source during unbind */ - if (dev->ipc_config.id == src_id) - return 0; - - source_dev = ipc4_get_comp_dev(src_id); - if (!source_dev) { - comp_err(dev, "module_adapter_bind: no source with ID %d found", src_id); - return -EINVAL; - } - - mod_source_info = module_source_info_acquire(mod->source_info); - - /* find the index of the source in the sources array and clear it */ - source_index = find_module_source_index(mod_source_info, source_dev); - if (source_index >= 0) - mod_source_info->sources[source_index] = NULL; - - module_source_info_release(mod_source_info); - return 0; } diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index 1cdfc6a61e9c..d2145d096135 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -165,16 +165,6 @@ struct module_data { uint32_t module_entry_point; /**<loadable module entry point address */ }; -/* - * Used by the module to keep track of the number of sources bound to it and can be accessed - * from different cores - */ -struct module_source_info { - struct coherent c; - struct comp_dev *sources[MODULE_MAX_SOURCES]; - void *private; /**< additional module-specific private info */ -}; - /* module_adapter private, runtime data */ struct processing_module { struct module_data priv; /**< module private data */ @@ -250,9 +240,6 @@ struct processing_module { /* pointer to system services for loadable modules */ uint32_t *sys_service; - /* table containing the list of connected sources */ - struct module_source_info *source_info; - /* total processed data after stream started */ uint64_t total_data_consumed; uint64_t total_data_produced; @@ -356,36 +343,6 @@ static inline void module_update_buffer_position(struct input_stream_buffer *inp output_buffers->size += audio_stream_frame_bytes(sink) * frames; } -__must_check static inline -struct module_source_info __sparse_cache *module_source_info_acquire(struct module_source_info *msi) -{ - struct coherent __sparse_cache *c; - - c = coherent_acquire_thread(&msi->c, sizeof(*msi)); - - return attr_container_of(c, struct module_source_info __sparse_cache, c, __sparse_cache); -} - -static inline void module_source_info_release(struct module_source_info __sparse_cache *msi) -{ - coherent_release_thread(&msi->c, sizeof(*msi)); -} - -/* when source argument is NULL, this function returns the first unused entry */ -static inline -int find_module_source_index(struct module_source_info __sparse_cache *msi, - const struct comp_dev *source) -{ - int i; - - for (i = 0; i < MODULE_MAX_SOURCES; i++) { - if (msi->sources[i] == source) - return i; - } - - return -EINVAL; -} - static inline int module_process_stream(struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index 02f6e6b0016b..c743513b1ad5 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -277,7 +277,6 @@ static int smart_amp_process(struct processing_module *mod, struct comp_dev *dev = mod->dev; struct comp_buffer *fb_buf_c; struct comp_buffer *buf; - struct module_source_info __sparse_cache *mod_source_info; struct input_stream_buffer *fb_input = NULL; /* if there is only one input stream, it should be the source input */ struct input_stream_buffer *src_input = &input_buffers[0]; @@ -286,8 +285,6 @@ static int smart_amp_process(struct processing_module *mod, uint32_t sink_bytes; uint32_t i; - mod_source_info = module_source_info_acquire(mod->source_info); - if (num_input_buffers == SMART_AMP_NUM_IN_PINS) for (i = 0; i < num_input_buffers; i++) { buf = container_of(input_buffers[i].data, struct comp_buffer, stream); @@ -326,7 +323,6 @@ static int smart_amp_process(struct processing_module *mod, output_buffers[0].size = sink_bytes; - module_source_info_release(mod_source_info); return 0; } From 9f2d19d30cd9adad203f116e888af2c27a777531 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Mon, 2 Oct 2023 14:43:18 +0300 Subject: [PATCH 485/639] vmh_free: cosmetic changes to local variable The_very_long_variable names make it hard to modify the code and keep to under-100-characters coding guidelines of the codebase. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- zephyr/lib/regions_mm.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/zephyr/lib/regions_mm.c b/zephyr/lib/regions_mm.c index cbf94e7f8fc8..feb1f55d48a4 100644 --- a/zephyr/lib/regions_mm.c +++ b/zephyr/lib/regions_mm.c @@ -492,24 +492,24 @@ int vmh_free(struct vmh_heap *heap, void *ptr) if (heap->core_id != cpu_get_id()) return -EINVAL; - size_t mem_block_iterator, i, size_to_free, block_size, ptr_bit_array_offset, + size_t mem_block_iter, i, size_to_free, block_size, ptr_bit_array_offset, ptr_bit_array_position, physical_block_count, check_offset, check_position, check_size; uintptr_t phys_aligned_ptr, phys_aligned_alloc_end, phys_block_ptr; bool ptr_range_found; /* Get allocator from which ptr was allocated */ - for (mem_block_iterator = 0, ptr_range_found = false; - mem_block_iterator < MAX_MEMORY_ALLOCATORS_COUNT; - mem_block_iterator++) { + for (mem_block_iter = 0, ptr_range_found = false; + mem_block_iter < MAX_MEMORY_ALLOCATORS_COUNT; + mem_block_iter++) { block_size = - 1 << heap->physical_blocks_allocators[mem_block_iterator]->blk_sz_shift; + 1 << heap->physical_blocks_allocators[mem_block_iter]->blk_sz_shift; if (vmh_is_ptr_in_memory_range((uintptr_t)ptr, (uintptr_t)heap->physical_blocks_allocators - [mem_block_iterator]->buffer, + [mem_block_iter]->buffer, heap->physical_blocks_allocators - [mem_block_iterator]->num_blocks * block_size)) { + [mem_block_iter]->num_blocks * block_size)) { ptr_range_found = true; break; } @@ -528,19 +528,19 @@ int vmh_free(struct vmh_heap *heap, void *ptr) /* Not sure if that is fastest way to find the size comments welcome */ ptr_bit_array_offset = (uintptr_t)ptr - - (uintptr_t)heap->physical_blocks_allocators[mem_block_iterator]->buffer; + - (uintptr_t)heap->physical_blocks_allocators[mem_block_iter]->buffer; ptr_bit_array_position = ptr_bit_array_offset / block_size; /* Allocation bit array check */ int bit_value, prev_bit_value = 0; - sys_bitarray_test_bit(heap->allocation_sizes[mem_block_iterator], + sys_bitarray_test_bit(heap->allocation_sizes[mem_block_iter], ptr_bit_array_position, &bit_value); /* If checked bit is in position 0 we assume it is valid * and assigned 0 for further logic */ if (ptr_bit_array_position) - sys_bitarray_test_bit(heap->allocation_sizes[mem_block_iterator], + sys_bitarray_test_bit(heap->allocation_sizes[mem_block_iter], ptr_bit_array_position - 1, &prev_bit_value); /* If bit is 1 we know we could be at the start of the allocation, @@ -556,7 +556,7 @@ int vmh_free(struct vmh_heap *heap, void *ptr) */ size_t bits_to_check = heap->physical_blocks_allocators - [mem_block_iterator]->num_blocks - ptr_bit_array_position; + [mem_block_iter]->num_blocks - ptr_bit_array_position; /* Neeeeeeeds optimization - thinking how to do it properly * each set bit in order after another means one allocated block. @@ -567,7 +567,7 @@ int vmh_free(struct vmh_heap *heap, void *ptr) i < bits_to_check; i++) { - sys_bitarray_test_bit(heap->allocation_sizes[mem_block_iterator], i, + sys_bitarray_test_bit(heap->allocation_sizes[mem_block_iter], i, &bit_value); if (bit_value) size_to_free += block_size; @@ -582,10 +582,10 @@ int vmh_free(struct vmh_heap *heap, void *ptr) } retval = sys_mem_blocks_free_contiguous( - heap->physical_blocks_allocators[mem_block_iterator], ptr, + heap->physical_blocks_allocators[mem_block_iter], ptr, size_to_free / block_size); } else { - retval = sys_mem_blocks_free(heap->physical_blocks_allocators[mem_block_iterator], + retval = sys_mem_blocks_free(heap->physical_blocks_allocators[mem_block_iter], 1, &ptr); } @@ -610,13 +610,13 @@ int vmh_free(struct vmh_heap *heap, void *ptr) phys_block_ptr = phys_aligned_ptr + i * CONFIG_MM_DRV_PAGE_SIZE; check_offset = phys_block_ptr - - (uintptr_t)heap->physical_blocks_allocators[mem_block_iterator]->buffer; + - (uintptr_t)heap->physical_blocks_allocators[mem_block_iter]->buffer; check_position = check_offset / block_size; check_size = CONFIG_MM_DRV_PAGE_SIZE / block_size; if (sys_bitarray_is_region_cleared( - heap->physical_blocks_allocators[mem_block_iterator]->bitmap, + heap->physical_blocks_allocators[mem_block_iter]->bitmap, check_size, check_offset)) sys_mm_drv_unmap_region((void *)phys_block_ptr, CONFIG_MM_DRV_PAGE_SIZE); From 6d2352a107d9cbc325e71142a8c73e608d683607 Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Thu, 28 Sep 2023 13:30:29 +0200 Subject: [PATCH 486/639] west.yml: update zephyr to 3.5.0-rc1 Zepych update: total of 853 commits. Changes include: i8c4eec7ac6 intel_adsp: boot_complete must be done PRE_KERNEL_1 1fc16e6565 release: Zephyr 3.5.0-rc1 c910dc81a6 sys_clock: header: minor cleanup and doxygenization b9f8b91692 kernel: sys_clock: remove stray z_enable_sys_clock prototype cc2a558707 kernel: move more internal smp calls into internal domain a1c7bfbc63 kernel: remove unused z_init_thread_base from kernel.h 209ff606be kernel: move internal smp calls to a internal header e19f21cb27 kernel: move z_is_thread_essential out of public kernel header f0c7fbf0f1 kernel: move sched_priq.h to internal/ folder e6f1090553 kernel: Integrate object core statistics 1d5d674e0d kernel: Add initial k_obj_core_stats infrastructure 6df8efe354 kernel: Integrate object cores into kernel 55db86e512 kernel: Add initial obj_core infrastructure eb1e5a161d kernel: FIFO and LIFO have their own sections 9bedfd82a2 kernel: Refactor CPU usage baea37aeb4 kernel: Re-factor sys_mem_blocks definition 2f003e59e4 kernel: Re-factor k_mem_slab definition 41e0a4a371 llext: Linkable loadable extensions 4289359eb2 modules: mcux: fix HAS_CMSIS_CORE selection 1194a35aa2 xtensa: cast char* to void* during stack dump with %p fcf22e59b8 xtensa: mark arch_switch ALWAYS_INLINE b2f7ea0523 soc: xtensa/intel_adsp/ace: fix _end location e560bd6b8c boards: intel_adsp: fix board compatible b4998c357e mm_drv: tlb: Fix compile time warning 759e07bebe intel_adsp: move memory window setup to PRE_KERNEL_1 Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- west.yml | 2 +- zephyr/lib/regions_mm.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/west.yml b/west.yml index 8543b993e2b1..5046cf4c4e51 100644 --- a/west.yml +++ b/west.yml @@ -45,7 +45,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 492517b918d267f553688cd6b9d59b92ffc10f91 + revision: 8c4eec7ac6e37be89af89e021c6f5c96e1ac1e0a remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision diff --git a/zephyr/lib/regions_mm.c b/zephyr/lib/regions_mm.c index feb1f55d48a4..dbb1aa087b26 100644 --- a/zephyr/lib/regions_mm.c +++ b/zephyr/lib/regions_mm.c @@ -132,8 +132,8 @@ struct vmh_heap *vmh_init_heap(const struct vmh_heap_config *cfg, new_heap->physical_blocks_allocators[i] = new_allocator; /* Fill allocators data based on config and virtual region data */ - new_allocator->num_blocks = cfg->block_bundles_table[i].number_of_blocks; - new_allocator->blk_sz_shift = ilog2(cfg->block_bundles_table[i].block_size); + new_allocator->info.num_blocks = cfg->block_bundles_table[i].number_of_blocks; + new_allocator->info.blk_sz_shift = ilog2(cfg->block_bundles_table[i].block_size); new_allocator->buffer = (uint8_t *)new_heap->virtual_region->addr + offset; /* Create bit array that is a part of mem_block kept as a ptr */ @@ -270,11 +270,11 @@ void *vmh_alloc(struct vmh_heap *heap, uint32_t alloc_size) * mem_block. */ block_size = - 1 << heap->physical_blocks_allocators[mem_block_iterator]->blk_sz_shift; + 1 << heap->physical_blocks_allocators[mem_block_iterator]->info.blk_sz_shift; block_count = SOF_DIV_ROUND_UP((uint64_t)alloc_size, (uint64_t)block_size); if (block_count > - heap->physical_blocks_allocators[mem_block_iterator]->num_blocks) + heap->physical_blocks_allocators[mem_block_iterator]->info.num_blocks) continue; /* Try span alloc on first available mem_block for non span * check if block size is sufficient. @@ -455,7 +455,7 @@ int vmh_free_heap(struct vmh_heap *heap) if (!heap->physical_blocks_allocators[i]) continue; if (!sys_bitarray_is_region_cleared(heap->physical_blocks_allocators[i]->bitmap, - heap->physical_blocks_allocators[i]->num_blocks, 0)) + heap->physical_blocks_allocators[i]->info.num_blocks, 0)) return -ENOTEMPTY; } @@ -503,13 +503,13 @@ int vmh_free(struct vmh_heap *heap, void *ptr) mem_block_iter < MAX_MEMORY_ALLOCATORS_COUNT; mem_block_iter++) { block_size = - 1 << heap->physical_blocks_allocators[mem_block_iter]->blk_sz_shift; + 1 << heap->physical_blocks_allocators[mem_block_iter]->info.blk_sz_shift; if (vmh_is_ptr_in_memory_range((uintptr_t)ptr, (uintptr_t)heap->physical_blocks_allocators [mem_block_iter]->buffer, heap->physical_blocks_allocators - [mem_block_iter]->num_blocks * block_size)) { + [mem_block_iter]->info.num_blocks * block_size)) { ptr_range_found = true; break; } @@ -556,7 +556,7 @@ int vmh_free(struct vmh_heap *heap, void *ptr) */ size_t bits_to_check = heap->physical_blocks_allocators - [mem_block_iter]->num_blocks - ptr_bit_array_position; + [mem_block_iter]->info.num_blocks - ptr_bit_array_position; /* Neeeeeeeds optimization - thinking how to do it properly * each set bit in order after another means one allocated block. From 9e21d8ba6239bb07b2dd0f919c1c63b7b82f0bdb Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Fri, 15 Sep 2023 16:44:51 +0800 Subject: [PATCH 487/639] topology2: set pipeline priority for google aec stream Set priority for aec stream so that driver can trigger pipeline based on pipeline priority. Signed-off-by: Rander Wang <rander.wang@intel.com> --- tools/topology/topology2/cavs-rt5682.conf | 4 ++++ tools/topology/topology2/platform/intel/dmic-default.conf | 1 + tools/topology/topology2/platform/intel/dmic-generic.conf | 1 + .../topology2/platform/intel/google-rtc-aec-reference.conf | 2 ++ tools/topology/topology2/platform/intel/speaker-echo-ref.conf | 3 ++- 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index f3cdc8d47aeb..ab1afe660c44 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -103,6 +103,10 @@ Define { SPEAKER_PCM_NAME "Speakers" SPEAKER_PCM_ID 1 INCLUDE_BT_OFFLOAD true + GOOGLE_AEC_HOST_PIPELINE_PRIORITY 3 + GOOGLE_AEC_PIPELINE_PRIORITY 2 + DMIC_PIPELINE_PRIORITY 1 + ECHO_REF_PIPELINE_PRIORITY 0 } # override defaults with platform-specific config diff --git a/tools/topology/topology2/platform/intel/dmic-default.conf b/tools/topology/topology2/platform/intel/dmic-default.conf index 3f1e23526bc5..0bbb288e9e03 100644 --- a/tools/topology/topology2/platform/intel/dmic-default.conf +++ b/tools/topology/topology2/platform/intel/dmic-default.conf @@ -35,4 +35,5 @@ Define { DMIC1_PCM_CAPS 'Passthrough Capture 18' DMIC_CORE_ID 0 PASSTHROUGH "false" + DMIC_PIPELINE_PRIORITY 0 } diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 9548ab885c72..6c6ae7ec2da2 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -181,6 +181,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.pipeline."1" { core $DMIC_CORE_ID + priority $DMIC_PIPELINE_PRIORITY } } ] diff --git a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf index b2e9a88ec1e9..38f0e9077f87 100644 --- a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf +++ b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf @@ -6,6 +6,7 @@ Object.Pipeline.google-rtc-aec-capture [ Object.Widget.pipeline.1 { stream_name "DMIC0 RTC AEC" core $GOOGLE_AEC_CORE_ID + priority $GOOGLE_AEC_PIPELINE_PRIORITY } Object.Widget.google-rtc-aec.1 { @@ -31,6 +32,7 @@ Object.Pipeline.host-gateway-capture[ } Object.Widget.pipeline."1" { core $GOOGLE_AEC_CORE_ID + priority $GOOGLE_AEC_HOST_PIPELINE_PRIORITY } } ] diff --git a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf index 2ff5f3e22e5e..7299b7e149f7 100644 --- a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf +++ b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf @@ -41,7 +41,8 @@ Object.Pipeline { } } Object.Widget.pipeline."1" { - core $ECHO_REF_CORE_ID + core $ECHO_REF_CORE_ID + priority $ECHO_REF_PIPELINE_PRIORITY } } ] From 18595e9cd3ab78e0b83633bc6ae45cd64a67e4a4 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 25 Aug 2023 14:58:29 -0700 Subject: [PATCH 488/639] topology2: speaker-echo-ref: Remove the echo ref PCM The echo-ref pipeline ie the DAI capture pipeline involving the speaker codec is already part of the list of pipelines that gets set up and triggered when the DMIC capture starts. Therefore, there's no need for the echo-ref PCM to explicitly start the reference capture. So, remove it and connect the codec DAI to the google-rts-aec module directly. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- tools/topology/topology2/cavs-rt5682.conf | 2 - .../intel/google-rtc-aec-reference.conf | 4 +- .../platform/intel/speaker-echo-ref.conf | 67 +++++-------------- 3 files changed, 17 insertions(+), 56 deletions(-) diff --git a/tools/topology/topology2/cavs-rt5682.conf b/tools/topology/topology2/cavs-rt5682.conf index ab1afe660c44..721c97afe94e 100644 --- a/tools/topology/topology2/cavs-rt5682.conf +++ b/tools/topology/topology2/cavs-rt5682.conf @@ -87,7 +87,6 @@ Define { INCLUDE_ECHO_REF false ECHO_REF_HOST_PIPELINE_ID 7 ECHO_REF_DAI_PIPELINE_ID 8 - ECHO_REF_COPIER_MODULE 'module-copier.8.2' ECHO_REF_PCM_ID 29 ECHO_REF_CORE_ID 0 # override BT default definitions @@ -96,7 +95,6 @@ Define { BT_PB_DAI_PIPELINE_SRC "copier.host.9.1" BT_PB_PIPELINE_STREAM_NAME "dai-copier.SSP.10.1" GOOGLE_RTC_AEC_SUPPORT 0 - GOOGLE_RTC_AEC_REF_SOURCE 'module-copier.8.2' GOOGLE_AEC_CORE_ID 0 HEADSET_PCM_NAME "Headset" HEADSET_PCM_ID 0 diff --git a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf index 38f0e9077f87..336d31aac2e0 100644 --- a/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf +++ b/tools/topology/topology2/platform/intel/google-rtc-aec-reference.conf @@ -15,7 +15,7 @@ Object.Pipeline.google-rtc-aec-capture [ } Object.Base.input_pin_binding.2 { - input_pin_binding_name $GOOGLE_RTC_AEC_REF_SOURCE + input_pin_binding_name "dai-copier.SSP.$SPEAKER_CODEC_NAME.capture" } } } @@ -99,7 +99,7 @@ Object.Base.route [ sink module-copier.18.1 } { - source $GOOGLE_RTC_AEC_REF_SOURCE + source "dai-copier.SSP.$SPEAKER_CODEC_NAME.capture" sink "google-rtc-aec.18.1" } { diff --git a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf index 7299b7e149f7..6a0d7ff4d33a 100644 --- a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf +++ b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf @@ -1,25 +1,5 @@ -Define { - ECHO_REF_STREAM_NAME "Echo reference" -} - Object.Pipeline { - host-gateway-capture [ - { - index $ECHO_REF_HOST_PIPELINE_ID - core_id $ECHO_REF_CORE_ID - - Object.Widget.host-copier.1 { - core_id $ECHO_REF_CORE_ID - stream_name $ECHO_REF_STREAM_NAME - pcm_id $ECHO_REF_PCM_ID - } - Object.Widget.pipeline."1" { - core $ECHO_REF_CORE_ID - } - } - ] - - dai-copier-be [ + io-gateway-capture [ { index $ECHO_REF_DAI_PIPELINE_ID core_id $ECHO_REF_CORE_ID @@ -33,12 +13,20 @@ Object.Pipeline { copier_type "SSP" stream_name $SPEAKER_CODEC_NAME node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } Object.Widget.pipeline."1" { core $ECHO_REF_CORE_ID @@ -47,28 +35,3 @@ Object.Pipeline { } ] } - -Object.PCM.pcm [ - { - name "EchoRef" - id $ECHO_REF_PCM_ID - direction "capture" - Object.Base.fe_dai.1 {} - - Object.PCM.pcm_caps.1 { - name $ECHO_REF_STREAM_NAME - formats 'S16_LE,S24_LE,S32_LE' - } - } -] - -Object.Base.route [ - { - source "dai-copier.SSP.$SPEAKER_CODEC_NAME.capture" - sink $ECHO_REF_COPIER_MODULE - } - { - source $ECHO_REF_COPIER_MODULE - sink "host-copier.$ECHO_REF_PCM_ID.capture" - } -] From 351fe7e3efa66e4d468290938eb018459a508029 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Thu, 31 Aug 2023 10:19:58 -0700 Subject: [PATCH 489/639] topology2: google-rtc-aec: Add 4ch audio formats The DMIC capture path should support both 4ch and 2ch audio formats. Also, since the Google AEC module only support 16-bit input format, modify the output of the refeence capture DAI accordingly. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../include/components/google-rtc-aec.conf | 42 ++++++---- .../cavs/google-rtc-aec-capture.conf | 82 ++++++++++++++----- .../platform/intel/speaker-echo-ref.conf | 4 +- 3 files changed, 92 insertions(+), 36 deletions(-) diff --git a/tools/topology/topology2/include/components/google-rtc-aec.conf b/tools/topology/topology2/include/components/google-rtc-aec.conf index e2df7a9dbeac..2d6ed613b469 100644 --- a/tools/topology/topology2/include/components/google-rtc-aec.conf +++ b/tools/topology/topology2/include/components/google-rtc-aec.conf @@ -87,35 +87,47 @@ Class.Widget."google-rtc-aec" { unique "instance" } - num_audio_formats 2 - num_input_audio_formats 2 - num_output_audio_formats 1 + num_input_audio_formats 3 + num_output_audio_formats 2 # pin0 is the data captured by DMIC and pin1 is the ref data from playback stream - Object.Base.input_audio_format { - 1 { + Object.Base.input_audio_format [ + # 2ch 16-bit on Pin 0 + { input_pin_index 0 in_bit_depth 16 in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 } - 2 { + # 4ch 16-bit on Pin 0 + { + input_pin_index 0 + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + # 2ch 16-bit on Pin 1 + { input_pin_index 1 in_bit_depth 16 in_valid_bit_depth 16 + } + ] + + Object.Base.output_audio_format [ + { out_bit_depth 16 out_valid_bit_depth 16 } - } - - Object.Base.output_audio_format { - 1 { - in_bit_depth 16 - in_valid_bit_depth 16 + # 4ch 16-bit + { out_bit_depth 16 out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 } - } + ] # Default attribute values for google-rtc-aec widget # UUID: B780A0A6-269F-466F-B477-23DFA05AF758 diff --git a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf index 69729fa0c1ed..4680f8efda6b 100644 --- a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf @@ -53,15 +53,38 @@ Class.Pipeline."google-rtc-aec-capture" { period_sink_count 1 period_source_count 1 num_audio_formats 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 16 - out_valid_bit_depth 16 - } + num_input_audio_formats 2 + num_output_audio_formats 2 + + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 4ch 32-bit on Pin 0 + { + input_pin_index 0 + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + + ] } google-rtc-aec."1" { @@ -87,16 +110,37 @@ Class.Pipeline."google-rtc-aec-capture" { module-copier."2" { period_sink_count 1 period_source_count 1 - num_audio_formats 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - - Object.Base.audio_format.1 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_input_audio_formats 2 + num_output_audio_formats 2 + + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 16 + in_valid_bit_depth 16 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + # 2ch 32-bit + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + # 4ch 32-bit + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } } diff --git a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf index 6a0d7ff4d33a..7119dd1568ad 100644 --- a/tools/topology/topology2/platform/intel/speaker-echo-ref.conf +++ b/tools/topology/topology2/platform/intel/speaker-echo-ref.conf @@ -23,8 +23,8 @@ Object.Pipeline { num_output_audio_formats 1 Object.Base.output_audio_format [ { - out_bit_depth 32 - out_valid_bit_depth 32 + out_bit_depth 16 + out_valid_bit_depth 16 } ] } From 9e9120a1549f48e8365a90a6bb0b65d9b36b5456 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 8 Sep 2023 08:00:00 -0700 Subject: [PATCH 490/639] topology2: google-rtc-aec: Remove byte control The blob contains the input/output audio formats but these are already passed during module init based on hw_params. So no need to have the byte control for it. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../google-rtc-aec/rtc-aec-blob.conf | 19 ------------------ .../cavs/google-rtc-aec-capture.conf | 20 ------------------- 2 files changed, 39 deletions(-) delete mode 100644 tools/topology/topology2/include/components/google-rtc-aec/rtc-aec-blob.conf diff --git a/tools/topology/topology2/include/components/google-rtc-aec/rtc-aec-blob.conf b/tools/topology/topology2/include/components/google-rtc-aec/rtc-aec-blob.conf deleted file mode 100644 index f31ed7a0a747..000000000000 --- a/tools/topology/topology2/include/components/google-rtc-aec/rtc-aec-blob.conf +++ /dev/null @@ -1,19 +0,0 @@ -# aec blob data - -Object.Base.data."google-rtc-aec_blob" { - bytes " - 0x53, 0x4f, 0x46, 0x34, 0x00, 0x00, 0x00, 0x00, - 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - - 0x80, 0xbb, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x10, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, - - 0x80, 0xbb, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x10, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, - - 0x00, 0x00, 0x00, 0x00" -} diff --git a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf index 4680f8efda6b..443113559ffe 100644 --- a/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/google-rtc-aec-capture.conf @@ -87,26 +87,6 @@ Class.Pipeline."google-rtc-aec-capture" { ] } - google-rtc-aec."1" { - Object.Control.bytes."1" { - name google-rtc-aec_blob - access [ - tlv_read - tlv_callback - ] - - Object.Base.extops."extctl" { - get 258 - put 0 - } - max 4096 - - IncludeByKey.GOOGLE_RTC_AEC_SUPPORT { - "[1]" "include/components/google-rtc-aec/rtc-aec-blob.conf" - } - } - } - module-copier."2" { period_sink_count 1 period_source_count 1 From 4b9d10e5f129fc6daf50029f76eb86e39ec427ae Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 18 Sep 2023 12:44:10 +0300 Subject: [PATCH 491/639] Audio: Volume: Support all volume ramp types in IPC4 mode This patch adds to enum ipc4_curve_type in peak_volume.h ramp types for linear and logarithmic with and without zero crossings detect. The conversion function ipc4_curve_type_convert() converts the type into enum sof_volume_ramp for use in volume.c. The set_volume_ipc4() is changed to use the convert function and the restriction to select other than windows fade type also is removed. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/volume/peak_volume.h | 31 ++++++++++++++++++++++++++++++- src/audio/volume/volume_ipc4.c | 9 +++------ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/src/audio/volume/peak_volume.h b/src/audio/volume/peak_volume.h index fd4a078f0ad5..057db458277a 100644 --- a/src/audio/volume/peak_volume.h +++ b/src/audio/volume/peak_volume.h @@ -24,6 +24,7 @@ #ifndef __SOF_IPC4_PEAK_VOL_H__ #define __SOF_IPC4_PEAK_VOL_H__ +#include <ipc/topology.h> #include <ipc4/base-config.h> enum ipc4_vol_mode { @@ -43,7 +44,11 @@ enum ipc4_peak_volume_param { enum ipc4_curve_type { IPC4_AUDIO_CURVE_TYPE_NONE = 0, - IPC4_AUDIO_CURVE_TYPE_WINDOWS_FADE + IPC4_AUDIO_CURVE_TYPE_WINDOWS_FADE, + IPC4_AUDIO_CURVE_TYPE_LINEAR, + IPC4_AUDIO_CURVE_TYPE_LOG, + IPC4_AUDIO_CURVE_TYPE_LINEAR_ZC, + IPC4_AUDIO_CURVE_TYPE_LOG_ZC, }; static const uint32_t IPC4_ALL_CHANNELS_MASK = 0xffffffff; @@ -74,4 +79,28 @@ struct ipc4_peak_volume_module_cfg { struct ipc4_base_module_cfg base_cfg; struct ipc4_peak_volume_config config[]; } __packed __aligned(8); + +static inline enum sof_volume_ramp ipc4_curve_type_convert(enum ipc4_curve_type ipc4_type) +{ + switch (ipc4_type) { + case IPC4_AUDIO_CURVE_TYPE_WINDOWS_FADE: + return SOF_VOLUME_WINDOWS_FADE; + + case IPC4_AUDIO_CURVE_TYPE_LINEAR: + return SOF_VOLUME_LINEAR; + + case IPC4_AUDIO_CURVE_TYPE_LOG: + return SOF_VOLUME_LOG; + + case IPC4_AUDIO_CURVE_TYPE_LINEAR_ZC: + return SOF_VOLUME_LINEAR_ZC; + + case IPC4_AUDIO_CURVE_TYPE_LOG_ZC: + return SOF_VOLUME_LOG_ZC; + + case IPC4_AUDIO_CURVE_TYPE_NONE: + default: + return SOF_VOLUME_WINDOWS_NO_FADE; + } +} #endif diff --git a/src/audio/volume/volume_ipc4.c b/src/audio/volume/volume_ipc4.c index 18ef40866c49..8823bd2cbb79 100644 --- a/src/audio/volume/volume_ipc4.c +++ b/src/audio/volume/volume_ipc4.c @@ -58,13 +58,10 @@ static int set_volume_ipc4(struct vol_data *cd, uint32_t const channel, cd->mvolume[channel] = 0; /* set muted as false*/ cd->muted[channel] = false; -#if CONFIG_COMP_VOLUME_WINDOWS_FADE + /* ATM there is support for the same ramp for all channels */ - if (curve_type == IPC4_AUDIO_CURVE_TYPE_WINDOWS_FADE) - cd->ramp_type = SOF_VOLUME_WINDOWS_FADE; - else - cd->ramp_type = SOF_VOLUME_WINDOWS_NO_FADE; -#endif + cd->ramp_type = ipc4_curve_type_convert((enum ipc4_curve_type)curve_type); + return 0; } From 8f9c68ae57dbeb1958756a9def803fbadf86c8f3 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 20 Sep 2023 15:25:42 +0300 Subject: [PATCH 492/639] Audio: Volume: Handle all volume ramp types The windows fade, windows no fade, and linear and handled the switch-case statement change into volume.c. In IPC4 the ramp can be disabled with zero curve duration or with no fade type. The ramp duration convert multiplication can be passed with the no fade type. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/volume/volume.c | 22 +++++++++++++--------- src/audio/volume/volume_ipc4.c | 9 +++++++-- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index c71eacba168c..30896fd87a33 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -283,18 +283,22 @@ static inline void volume_ramp(struct processing_module *mod) * calculated from previous gain and ramp time. The slope * coefficient is calculated in volume_set_chan(). */ -#if defined CONFIG_COMP_VOLUME_WINDOWS_FADE && defined CONFIG_COMP_VOLUME_LINEAR_RAMP - if (cd->ramp_type == SOF_VOLUME_WINDOWS_FADE) + switch (cd->ramp_type) { +#if CONFIG_COMP_VOLUME_WINDOWS_FADE + case SOF_VOLUME_WINDOWS_FADE: new_vol = volume_windows_fade_ramp(cd, ramp_time, i); - else + break; +#endif +#if CONFIG_COMP_VOLUME_LINEAR_RAMP + case SOF_VOLUME_LINEAR: + case SOF_VOLUME_LINEAR_ZC: new_vol = volume_linear_ramp(cd, ramp_time, i); -#elif defined CONFIG_COMP_VOLUME_WINDOWS_FADE - new_vol = volume_windows_fade_ramp(cd, ramp_time, i); -#elif defined CONFIG_COMP_VOLUME_LINEAR_RAMP - new_vol = volume_linear_ramp(cd, ramp_time, i); -#else - new_vol = tvolume; + break; #endif + default: + new_vol = tvolume; + } + if (volume < tvolume) { /* ramp up, check if ramp completed */ if (new_vol < tvolume) diff --git a/src/audio/volume/volume_ipc4.c b/src/audio/volume/volume_ipc4.c index 8823bd2cbb79..b54e52c39a53 100644 --- a/src/audio/volume/volume_ipc4.c +++ b/src/audio/volume/volume_ipc4.c @@ -86,8 +86,13 @@ static void init_ramp(struct vol_data *cd, uint32_t curve_duration, uint32_t tar /* In IPC4 driver sends curve_duration in hundred of ns - it should be * converted into ms value required by firmware */ - cd->initial_ramp = Q_MULTSR_32X32((int64_t)curve_duration, - Q_CONVERT_FLOAT(1.0 / 10000, 31), 0, 31, 0); + if (cd->ramp_type == SOF_VOLUME_WINDOWS_NO_FADE) { + cd->initial_ramp = 0; + cd->ramp_finished = true; + } else { + cd->initial_ramp = Q_MULTSR_32X32((int64_t)curve_duration, + Q_CONVERT_FLOAT(1.0 / 10000, 31), 0, 31, 0); + } if (!cd->initial_ramp) { /* In case when initial ramp time is equal to zero, vol_min and From 51159d80e4c329f20c9c402f8a4758c79f9e430c Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 15 Sep 2023 14:58:33 +0300 Subject: [PATCH 493/639] Tools: Topology2: Fix the gain.conf curve_type values This patch adds the other SOF volume ramp types linear and logarithmic with and without zero crossings detect mode to gain widget class. The names of fade values are changed to be similar as in enum sof_volume_ramp, since there is a specific curve shape required for Windows OS. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/include/components/gain.conf | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/topology/topology2/include/components/gain.conf b/tools/topology/topology2/include/components/gain.conf index 395edb64ba94..bfaecc54a545 100644 --- a/tools/topology/topology2/include/components/gain.conf +++ b/tools/topology/topology2/include/components/gain.conf @@ -45,12 +45,20 @@ Class.Widget."gain" { token_ref "gain.word" constraints { !valid_values [ - "no_fade" - "fade" + "windows_no_fade" + "windows_fade" + "linear" + "log" + "linear_zc" + "log_zc" ] !tuple_values [ 0 1 + 2 + 3 + 4 + 5 ] } } @@ -151,7 +159,7 @@ Class.Widget."gain" { uuid "A8:A9:BC:61:D0:18:18:4A:8E:7B:26:39:21:98:04:B7" no_pm "true" cpc 10183 - curve_type "fade" + curve_type "windows_fade" curve_duration 200000 # 20 ms init_value 0x7fffffff num_input_pins 1 From 2e7296f17f7082b7de77889e86335f529d90c948 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 16:42:11 -0700 Subject: [PATCH 494/639] cmake: add new ${RIMAGE_TOP} constant In preparation for changing it, see https://github.com/thesofproject/sof/issues/8178 No functional change yet. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 6 ++++-- src/arch/xtensa/CMakeLists.txt | 6 +++--- src/ipc/ipc4/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d951e86a2de..c7b0ddd8ddd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,8 @@ project(SOF C ASM) set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}") set(SOF_ROOT_BINARY_DIRECTORY "${PROJECT_BINARY_DIR}") +set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/rimage") + # check git hooks include(scripts/cmake/git-hooks.cmake) @@ -159,8 +161,8 @@ install( ${PROJECT_SOURCE_DIR}/src/include/ipc ${PROJECT_SOURCE_DIR}/src/include/kernel ${PROJECT_SOURCE_DIR}/src/include/user - ${PROJECT_SOURCE_DIR}/rimage/src/include/sof/kernel - ${PROJECT_SOURCE_DIR}/rimage/src/include/sof/user + ${RIMAGE_TOP}/src/include/sof/kernel + ${RIMAGE_TOP}/src/include/sof/user DESTINATION include/sof PATTERN "*.h" ) diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index 474be5988727..ba045fe6ccb1 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -330,7 +330,7 @@ add_custom_target( ExternalProject_Add(rimage_ep DEPENDS check_version_h - SOURCE_DIR "${PROJECT_SOURCE_DIR}/rimage" + SOURCE_DIR "${RIMAGE_TOP}" PREFIX "${PROJECT_BINARY_DIR}/rimage_ep" BINARY_DIR "${PROJECT_BINARY_DIR}/rimage_ep/build" EXCLUDE_FROM_ALL TRUE @@ -386,7 +386,7 @@ if(MEU_PATH OR DEFINED MEU_NO_SIGN) # Don't sign with rimage run_rimage COMMAND ${PROJECT_BINARY_DIR}/rimage_ep/build/rimage -o sof-${fw_name}.ri - -c "${PROJECT_SOURCE_DIR}/rimage/config/${fw_name}.toml" + -c "${RIMAGE_TOP}/config/${fw_name}.toml" -s ${MEU_OFFSET} -k ${RIMAGE_PRIVATE_KEY} -i ${RIMAGE_IMR_TYPE} @@ -427,7 +427,7 @@ else() # sign with rimage run_rimage COMMAND ${PROJECT_BINARY_DIR}/rimage_ep/build/rimage -o sof-${fw_name}.ri - -c "${PROJECT_SOURCE_DIR}/rimage/config/${fw_name}.toml" + -c "${RIMAGE_TOP}/config/${fw_name}.toml" -k ${RIMAGE_PRIVATE_KEY} -i ${RIMAGE_IMR_TYPE} -f ${SOF_MAJOR}.${SOF_MINOR}.${SOF_MICRO} diff --git a/src/ipc/ipc4/CMakeLists.txt b/src/ipc/ipc4/CMakeLists.txt index 7f9d75f654be..2e162e702672 100644 --- a/src/ipc/ipc4/CMakeLists.txt +++ b/src/ipc/ipc4/CMakeLists.txt @@ -9,4 +9,4 @@ add_local_sources(sof ams_helpers.c ) -target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/rimage/src/include) +target_include_directories(sof_options INTERFACE ${RIMAGE_TOP}/src/include) From e08b2c2043f2ea7b9a9189e07dc9458cddbe9c74 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 17:04:01 -0700 Subject: [PATCH 495/639] zephyr/cmake: add new ${RIMAGE_TOP} constant In preparation for changing it, see https://github.com/thesofproject/sof/issues/8178 No functional change yet. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- zephyr/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 7e2b9c46055b..a618f966eee6 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -58,11 +58,11 @@ set(SOF_IPC_PATH "${SOF_SRC_PATH}/ipc") set(SOF_DEBUG_PATH "${SOF_SRC_PATH}/debug") set(SOF_MATH_PATH "${SOF_SRC_PATH}/math") set(SOF_TRACE_PATH "${SOF_SRC_PATH}/trace") +set(RIMAGE_TOP ${sof_top_dir}/rimage) # Save path to rimage configuration files in cmake cache for later use by # rimage during the "west sign" stage -get_filename_component(RIMAGE_CONFIG "../rimage/config" ABSOLUTE) -set(RIMAGE_CONFIG_PATH ${RIMAGE_CONFIG} CACHE PATH +set(RIMAGE_CONFIG_PATH ${RIMAGE_TOP}/config} CACHE PATH " Path to rimage board configuration files") include(ExternalProject) @@ -87,7 +87,7 @@ ExternalProject_Add(sof_logger_ep ) # default SOF includes -target_include_directories(SOF INTERFACE ${sof_top_dir}/rimage/src/include) +target_include_directories(SOF INTERFACE ${RIMAGE_TOP}/src/include) target_include_directories(SOF INTERFACE ${SOF_SRC_PATH}/include) target_include_directories(SOF INTERFACE ${SOF_SRC_PATH}/arch/${ARCH}/include) target_include_directories(SOF INTERFACE ${sof_top_dir}/third_party/include) From b5f3ed9fa5186e91278eeb2cb77fd105f0a22e00 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 17:53:34 -0700 Subject: [PATCH 496/639] rimage: move everything down to subdir tools/rimage/, prepare move to sof Preparation to move everything back into the https://github.com/thesofproject/sof/ repo, see https://github.com/thesofproject/sof/issues/8178 for details. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .checkpatch.conf => tools/rimage/.checkpatch.conf | 0 {.github => tools/rimage/.github}/workflows/build.yml | 0 {.github => tools/rimage/.github}/workflows/cppcheck.yml | 0 {.github => tools/rimage/.github}/workflows/pull-request.yml | 0 .gitignore => tools/rimage/.gitignore | 0 .gitmodules => tools/rimage/.gitmodules | 0 CMakeLists.txt => tools/rimage/CMakeLists.txt | 0 LICENSE => tools/rimage/LICENSE | 0 README.md => tools/rimage/README.md | 0 {config => tools/rimage/config}/apl.toml | 0 {config => tools/rimage/config}/bdw.toml | 0 {config => tools/rimage/config}/bsw.toml | 0 {config => tools/rimage/config}/byt.toml | 0 {config => tools/rimage/config}/cht.toml | 0 {config => tools/rimage/config}/cnl.toml | 0 {config => tools/rimage/config}/hsw.toml | 0 {config => tools/rimage/config}/icl.toml | 0 {config => tools/rimage/config}/imx8.toml | 0 {config => tools/rimage/config}/imx8m.toml | 0 {config => tools/rimage/config}/imx8ulp.toml | 0 {config => tools/rimage/config}/imx8x.toml | 0 {config => tools/rimage/config}/jsl.toml | 0 {config => tools/rimage/config}/kbl.toml | 0 {config => tools/rimage/config}/lnl.toml | 0 {config => tools/rimage/config}/mt8186.toml | 0 {config => tools/rimage/config}/mt8188.toml | 0 {config => tools/rimage/config}/mt8195.toml | 0 {config => tools/rimage/config}/mtl.toml | 0 {config => tools/rimage/config}/rmb.toml | 0 {config => tools/rimage/config}/rn.toml | 0 {config => tools/rimage/config}/skl.toml | 0 {config => tools/rimage/config}/sue.toml | 0 {config => tools/rimage/config}/tgl-cavs.toml | 0 {config => tools/rimage/config}/tgl-h-cavs.toml | 0 {config => tools/rimage/config}/tgl-h.toml | 0 {config => tools/rimage/config}/tgl.toml | 0 {config => tools/rimage/config}/vangogh.toml | 0 {scripts => tools/rimage/scripts}/checkpatch.pl | 0 {scripts => tools/rimage/scripts}/const_structs.checkpatch | 0 {scripts => tools/rimage/scripts}/spelling.txt | 0 {src => tools/rimage/src}/adsp_config.c | 0 {src => tools/rimage/src}/cse.c | 0 {src => tools/rimage/src}/css.c | 0 {src => tools/rimage/src}/elf_file.c | 0 {src => tools/rimage/src}/ext_manifest.c | 0 {src => tools/rimage/src}/file_simple.c | 0 {src => tools/rimage/src}/file_utils.c | 0 {src => tools/rimage/src}/hash.c | 0 {src => tools/rimage/src}/include/rimage/adsp_config.h | 0 {src => tools/rimage/src}/include/rimage/cavs/cavs_ext_manifest.h | 0 {src => tools/rimage/src}/include/rimage/cse.h | 0 {src => tools/rimage/src}/include/rimage/css.h | 0 {src => tools/rimage/src}/include/rimage/elf.h | 0 {src => tools/rimage/src}/include/rimage/elf_file.h | 0 {src => tools/rimage/src}/include/rimage/ext_manifest_gen.h | 0 {src => tools/rimage/src}/include/rimage/file_utils.h | 0 {src => tools/rimage/src}/include/rimage/hash.h | 0 {src => tools/rimage/src}/include/rimage/manifest.h | 0 {src => tools/rimage/src}/include/rimage/misc_utils.h | 0 {src => tools/rimage/src}/include/rimage/module.h | 0 {src => tools/rimage/src}/include/rimage/plat_auth.h | 0 {src => tools/rimage/src}/include/rimage/rimage.h | 0 .../rimage/src}/include/rimage/sof/kernel/ext_manifest.h | 0 {src => tools/rimage/src}/include/rimage/sof/kernel/fw.h | 0 {src => tools/rimage/src}/include/rimage/sof/user/manifest.h | 0 {src => tools/rimage/src}/include/rimage/toml_utils.h | 0 {src => tools/rimage/src}/manifest.c | 0 {src => tools/rimage/src}/misc_utils.c | 0 {src => tools/rimage/src}/module.c | 0 {src => tools/rimage/src}/pkcs1_5.c | 0 {src => tools/rimage/src}/plat_auth.c | 0 {src => tools/rimage/src}/rimage.c | 0 {src => tools/rimage/src}/toml_utils.c | 0 tomlc99 => tools/rimage/tomlc99 | 0 74 files changed, 0 insertions(+), 0 deletions(-) rename .checkpatch.conf => tools/rimage/.checkpatch.conf (100%) rename {.github => tools/rimage/.github}/workflows/build.yml (100%) rename {.github => tools/rimage/.github}/workflows/cppcheck.yml (100%) rename {.github => tools/rimage/.github}/workflows/pull-request.yml (100%) rename .gitignore => tools/rimage/.gitignore (100%) rename .gitmodules => tools/rimage/.gitmodules (100%) rename CMakeLists.txt => tools/rimage/CMakeLists.txt (100%) rename LICENSE => tools/rimage/LICENSE (100%) rename README.md => tools/rimage/README.md (100%) rename {config => tools/rimage/config}/apl.toml (100%) rename {config => tools/rimage/config}/bdw.toml (100%) rename {config => tools/rimage/config}/bsw.toml (100%) rename {config => tools/rimage/config}/byt.toml (100%) rename {config => tools/rimage/config}/cht.toml (100%) rename {config => tools/rimage/config}/cnl.toml (100%) rename {config => tools/rimage/config}/hsw.toml (100%) rename {config => tools/rimage/config}/icl.toml (100%) rename {config => tools/rimage/config}/imx8.toml (100%) rename {config => tools/rimage/config}/imx8m.toml (100%) rename {config => tools/rimage/config}/imx8ulp.toml (100%) rename {config => tools/rimage/config}/imx8x.toml (100%) rename {config => tools/rimage/config}/jsl.toml (100%) rename {config => tools/rimage/config}/kbl.toml (100%) rename {config => tools/rimage/config}/lnl.toml (100%) rename {config => tools/rimage/config}/mt8186.toml (100%) rename {config => tools/rimage/config}/mt8188.toml (100%) rename {config => tools/rimage/config}/mt8195.toml (100%) rename {config => tools/rimage/config}/mtl.toml (100%) rename {config => tools/rimage/config}/rmb.toml (100%) rename {config => tools/rimage/config}/rn.toml (100%) rename {config => tools/rimage/config}/skl.toml (100%) rename {config => tools/rimage/config}/sue.toml (100%) rename {config => tools/rimage/config}/tgl-cavs.toml (100%) rename {config => tools/rimage/config}/tgl-h-cavs.toml (100%) rename {config => tools/rimage/config}/tgl-h.toml (100%) rename {config => tools/rimage/config}/tgl.toml (100%) rename {config => tools/rimage/config}/vangogh.toml (100%) rename {scripts => tools/rimage/scripts}/checkpatch.pl (100%) rename {scripts => tools/rimage/scripts}/const_structs.checkpatch (100%) rename {scripts => tools/rimage/scripts}/spelling.txt (100%) rename {src => tools/rimage/src}/adsp_config.c (100%) rename {src => tools/rimage/src}/cse.c (100%) rename {src => tools/rimage/src}/css.c (100%) rename {src => tools/rimage/src}/elf_file.c (100%) rename {src => tools/rimage/src}/ext_manifest.c (100%) rename {src => tools/rimage/src}/file_simple.c (100%) rename {src => tools/rimage/src}/file_utils.c (100%) rename {src => tools/rimage/src}/hash.c (100%) rename {src => tools/rimage/src}/include/rimage/adsp_config.h (100%) rename {src => tools/rimage/src}/include/rimage/cavs/cavs_ext_manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/cse.h (100%) rename {src => tools/rimage/src}/include/rimage/css.h (100%) rename {src => tools/rimage/src}/include/rimage/elf.h (100%) rename {src => tools/rimage/src}/include/rimage/elf_file.h (100%) rename {src => tools/rimage/src}/include/rimage/ext_manifest_gen.h (100%) rename {src => tools/rimage/src}/include/rimage/file_utils.h (100%) rename {src => tools/rimage/src}/include/rimage/hash.h (100%) rename {src => tools/rimage/src}/include/rimage/manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/misc_utils.h (100%) rename {src => tools/rimage/src}/include/rimage/module.h (100%) rename {src => tools/rimage/src}/include/rimage/plat_auth.h (100%) rename {src => tools/rimage/src}/include/rimage/rimage.h (100%) rename {src => tools/rimage/src}/include/rimage/sof/kernel/ext_manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/sof/kernel/fw.h (100%) rename {src => tools/rimage/src}/include/rimage/sof/user/manifest.h (100%) rename {src => tools/rimage/src}/include/rimage/toml_utils.h (100%) rename {src => tools/rimage/src}/manifest.c (100%) rename {src => tools/rimage/src}/misc_utils.c (100%) rename {src => tools/rimage/src}/module.c (100%) rename {src => tools/rimage/src}/pkcs1_5.c (100%) rename {src => tools/rimage/src}/plat_auth.c (100%) rename {src => tools/rimage/src}/rimage.c (100%) rename {src => tools/rimage/src}/toml_utils.c (100%) rename tomlc99 => tools/rimage/tomlc99 (100%) diff --git a/.checkpatch.conf b/tools/rimage/.checkpatch.conf similarity index 100% rename from .checkpatch.conf rename to tools/rimage/.checkpatch.conf diff --git a/.github/workflows/build.yml b/tools/rimage/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build.yml rename to tools/rimage/.github/workflows/build.yml diff --git a/.github/workflows/cppcheck.yml b/tools/rimage/.github/workflows/cppcheck.yml similarity index 100% rename from .github/workflows/cppcheck.yml rename to tools/rimage/.github/workflows/cppcheck.yml diff --git a/.github/workflows/pull-request.yml b/tools/rimage/.github/workflows/pull-request.yml similarity index 100% rename from .github/workflows/pull-request.yml rename to tools/rimage/.github/workflows/pull-request.yml diff --git a/.gitignore b/tools/rimage/.gitignore similarity index 100% rename from .gitignore rename to tools/rimage/.gitignore diff --git a/.gitmodules b/tools/rimage/.gitmodules similarity index 100% rename from .gitmodules rename to tools/rimage/.gitmodules diff --git a/CMakeLists.txt b/tools/rimage/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to tools/rimage/CMakeLists.txt diff --git a/LICENSE b/tools/rimage/LICENSE similarity index 100% rename from LICENSE rename to tools/rimage/LICENSE diff --git a/README.md b/tools/rimage/README.md similarity index 100% rename from README.md rename to tools/rimage/README.md diff --git a/config/apl.toml b/tools/rimage/config/apl.toml similarity index 100% rename from config/apl.toml rename to tools/rimage/config/apl.toml diff --git a/config/bdw.toml b/tools/rimage/config/bdw.toml similarity index 100% rename from config/bdw.toml rename to tools/rimage/config/bdw.toml diff --git a/config/bsw.toml b/tools/rimage/config/bsw.toml similarity index 100% rename from config/bsw.toml rename to tools/rimage/config/bsw.toml diff --git a/config/byt.toml b/tools/rimage/config/byt.toml similarity index 100% rename from config/byt.toml rename to tools/rimage/config/byt.toml diff --git a/config/cht.toml b/tools/rimage/config/cht.toml similarity index 100% rename from config/cht.toml rename to tools/rimage/config/cht.toml diff --git a/config/cnl.toml b/tools/rimage/config/cnl.toml similarity index 100% rename from config/cnl.toml rename to tools/rimage/config/cnl.toml diff --git a/config/hsw.toml b/tools/rimage/config/hsw.toml similarity index 100% rename from config/hsw.toml rename to tools/rimage/config/hsw.toml diff --git a/config/icl.toml b/tools/rimage/config/icl.toml similarity index 100% rename from config/icl.toml rename to tools/rimage/config/icl.toml diff --git a/config/imx8.toml b/tools/rimage/config/imx8.toml similarity index 100% rename from config/imx8.toml rename to tools/rimage/config/imx8.toml diff --git a/config/imx8m.toml b/tools/rimage/config/imx8m.toml similarity index 100% rename from config/imx8m.toml rename to tools/rimage/config/imx8m.toml diff --git a/config/imx8ulp.toml b/tools/rimage/config/imx8ulp.toml similarity index 100% rename from config/imx8ulp.toml rename to tools/rimage/config/imx8ulp.toml diff --git a/config/imx8x.toml b/tools/rimage/config/imx8x.toml similarity index 100% rename from config/imx8x.toml rename to tools/rimage/config/imx8x.toml diff --git a/config/jsl.toml b/tools/rimage/config/jsl.toml similarity index 100% rename from config/jsl.toml rename to tools/rimage/config/jsl.toml diff --git a/config/kbl.toml b/tools/rimage/config/kbl.toml similarity index 100% rename from config/kbl.toml rename to tools/rimage/config/kbl.toml diff --git a/config/lnl.toml b/tools/rimage/config/lnl.toml similarity index 100% rename from config/lnl.toml rename to tools/rimage/config/lnl.toml diff --git a/config/mt8186.toml b/tools/rimage/config/mt8186.toml similarity index 100% rename from config/mt8186.toml rename to tools/rimage/config/mt8186.toml diff --git a/config/mt8188.toml b/tools/rimage/config/mt8188.toml similarity index 100% rename from config/mt8188.toml rename to tools/rimage/config/mt8188.toml diff --git a/config/mt8195.toml b/tools/rimage/config/mt8195.toml similarity index 100% rename from config/mt8195.toml rename to tools/rimage/config/mt8195.toml diff --git a/config/mtl.toml b/tools/rimage/config/mtl.toml similarity index 100% rename from config/mtl.toml rename to tools/rimage/config/mtl.toml diff --git a/config/rmb.toml b/tools/rimage/config/rmb.toml similarity index 100% rename from config/rmb.toml rename to tools/rimage/config/rmb.toml diff --git a/config/rn.toml b/tools/rimage/config/rn.toml similarity index 100% rename from config/rn.toml rename to tools/rimage/config/rn.toml diff --git a/config/skl.toml b/tools/rimage/config/skl.toml similarity index 100% rename from config/skl.toml rename to tools/rimage/config/skl.toml diff --git a/config/sue.toml b/tools/rimage/config/sue.toml similarity index 100% rename from config/sue.toml rename to tools/rimage/config/sue.toml diff --git a/config/tgl-cavs.toml b/tools/rimage/config/tgl-cavs.toml similarity index 100% rename from config/tgl-cavs.toml rename to tools/rimage/config/tgl-cavs.toml diff --git a/config/tgl-h-cavs.toml b/tools/rimage/config/tgl-h-cavs.toml similarity index 100% rename from config/tgl-h-cavs.toml rename to tools/rimage/config/tgl-h-cavs.toml diff --git a/config/tgl-h.toml b/tools/rimage/config/tgl-h.toml similarity index 100% rename from config/tgl-h.toml rename to tools/rimage/config/tgl-h.toml diff --git a/config/tgl.toml b/tools/rimage/config/tgl.toml similarity index 100% rename from config/tgl.toml rename to tools/rimage/config/tgl.toml diff --git a/config/vangogh.toml b/tools/rimage/config/vangogh.toml similarity index 100% rename from config/vangogh.toml rename to tools/rimage/config/vangogh.toml diff --git a/scripts/checkpatch.pl b/tools/rimage/scripts/checkpatch.pl similarity index 100% rename from scripts/checkpatch.pl rename to tools/rimage/scripts/checkpatch.pl diff --git a/scripts/const_structs.checkpatch b/tools/rimage/scripts/const_structs.checkpatch similarity index 100% rename from scripts/const_structs.checkpatch rename to tools/rimage/scripts/const_structs.checkpatch diff --git a/scripts/spelling.txt b/tools/rimage/scripts/spelling.txt similarity index 100% rename from scripts/spelling.txt rename to tools/rimage/scripts/spelling.txt diff --git a/src/adsp_config.c b/tools/rimage/src/adsp_config.c similarity index 100% rename from src/adsp_config.c rename to tools/rimage/src/adsp_config.c diff --git a/src/cse.c b/tools/rimage/src/cse.c similarity index 100% rename from src/cse.c rename to tools/rimage/src/cse.c diff --git a/src/css.c b/tools/rimage/src/css.c similarity index 100% rename from src/css.c rename to tools/rimage/src/css.c diff --git a/src/elf_file.c b/tools/rimage/src/elf_file.c similarity index 100% rename from src/elf_file.c rename to tools/rimage/src/elf_file.c diff --git a/src/ext_manifest.c b/tools/rimage/src/ext_manifest.c similarity index 100% rename from src/ext_manifest.c rename to tools/rimage/src/ext_manifest.c diff --git a/src/file_simple.c b/tools/rimage/src/file_simple.c similarity index 100% rename from src/file_simple.c rename to tools/rimage/src/file_simple.c diff --git a/src/file_utils.c b/tools/rimage/src/file_utils.c similarity index 100% rename from src/file_utils.c rename to tools/rimage/src/file_utils.c diff --git a/src/hash.c b/tools/rimage/src/hash.c similarity index 100% rename from src/hash.c rename to tools/rimage/src/hash.c diff --git a/src/include/rimage/adsp_config.h b/tools/rimage/src/include/rimage/adsp_config.h similarity index 100% rename from src/include/rimage/adsp_config.h rename to tools/rimage/src/include/rimage/adsp_config.h diff --git a/src/include/rimage/cavs/cavs_ext_manifest.h b/tools/rimage/src/include/rimage/cavs/cavs_ext_manifest.h similarity index 100% rename from src/include/rimage/cavs/cavs_ext_manifest.h rename to tools/rimage/src/include/rimage/cavs/cavs_ext_manifest.h diff --git a/src/include/rimage/cse.h b/tools/rimage/src/include/rimage/cse.h similarity index 100% rename from src/include/rimage/cse.h rename to tools/rimage/src/include/rimage/cse.h diff --git a/src/include/rimage/css.h b/tools/rimage/src/include/rimage/css.h similarity index 100% rename from src/include/rimage/css.h rename to tools/rimage/src/include/rimage/css.h diff --git a/src/include/rimage/elf.h b/tools/rimage/src/include/rimage/elf.h similarity index 100% rename from src/include/rimage/elf.h rename to tools/rimage/src/include/rimage/elf.h diff --git a/src/include/rimage/elf_file.h b/tools/rimage/src/include/rimage/elf_file.h similarity index 100% rename from src/include/rimage/elf_file.h rename to tools/rimage/src/include/rimage/elf_file.h diff --git a/src/include/rimage/ext_manifest_gen.h b/tools/rimage/src/include/rimage/ext_manifest_gen.h similarity index 100% rename from src/include/rimage/ext_manifest_gen.h rename to tools/rimage/src/include/rimage/ext_manifest_gen.h diff --git a/src/include/rimage/file_utils.h b/tools/rimage/src/include/rimage/file_utils.h similarity index 100% rename from src/include/rimage/file_utils.h rename to tools/rimage/src/include/rimage/file_utils.h diff --git a/src/include/rimage/hash.h b/tools/rimage/src/include/rimage/hash.h similarity index 100% rename from src/include/rimage/hash.h rename to tools/rimage/src/include/rimage/hash.h diff --git a/src/include/rimage/manifest.h b/tools/rimage/src/include/rimage/manifest.h similarity index 100% rename from src/include/rimage/manifest.h rename to tools/rimage/src/include/rimage/manifest.h diff --git a/src/include/rimage/misc_utils.h b/tools/rimage/src/include/rimage/misc_utils.h similarity index 100% rename from src/include/rimage/misc_utils.h rename to tools/rimage/src/include/rimage/misc_utils.h diff --git a/src/include/rimage/module.h b/tools/rimage/src/include/rimage/module.h similarity index 100% rename from src/include/rimage/module.h rename to tools/rimage/src/include/rimage/module.h diff --git a/src/include/rimage/plat_auth.h b/tools/rimage/src/include/rimage/plat_auth.h similarity index 100% rename from src/include/rimage/plat_auth.h rename to tools/rimage/src/include/rimage/plat_auth.h diff --git a/src/include/rimage/rimage.h b/tools/rimage/src/include/rimage/rimage.h similarity index 100% rename from src/include/rimage/rimage.h rename to tools/rimage/src/include/rimage/rimage.h diff --git a/src/include/rimage/sof/kernel/ext_manifest.h b/tools/rimage/src/include/rimage/sof/kernel/ext_manifest.h similarity index 100% rename from src/include/rimage/sof/kernel/ext_manifest.h rename to tools/rimage/src/include/rimage/sof/kernel/ext_manifest.h diff --git a/src/include/rimage/sof/kernel/fw.h b/tools/rimage/src/include/rimage/sof/kernel/fw.h similarity index 100% rename from src/include/rimage/sof/kernel/fw.h rename to tools/rimage/src/include/rimage/sof/kernel/fw.h diff --git a/src/include/rimage/sof/user/manifest.h b/tools/rimage/src/include/rimage/sof/user/manifest.h similarity index 100% rename from src/include/rimage/sof/user/manifest.h rename to tools/rimage/src/include/rimage/sof/user/manifest.h diff --git a/src/include/rimage/toml_utils.h b/tools/rimage/src/include/rimage/toml_utils.h similarity index 100% rename from src/include/rimage/toml_utils.h rename to tools/rimage/src/include/rimage/toml_utils.h diff --git a/src/manifest.c b/tools/rimage/src/manifest.c similarity index 100% rename from src/manifest.c rename to tools/rimage/src/manifest.c diff --git a/src/misc_utils.c b/tools/rimage/src/misc_utils.c similarity index 100% rename from src/misc_utils.c rename to tools/rimage/src/misc_utils.c diff --git a/src/module.c b/tools/rimage/src/module.c similarity index 100% rename from src/module.c rename to tools/rimage/src/module.c diff --git a/src/pkcs1_5.c b/tools/rimage/src/pkcs1_5.c similarity index 100% rename from src/pkcs1_5.c rename to tools/rimage/src/pkcs1_5.c diff --git a/src/plat_auth.c b/tools/rimage/src/plat_auth.c similarity index 100% rename from src/plat_auth.c rename to tools/rimage/src/plat_auth.c diff --git a/src/rimage.c b/tools/rimage/src/rimage.c similarity index 100% rename from src/rimage.c rename to tools/rimage/src/rimage.c diff --git a/src/toml_utils.c b/tools/rimage/src/toml_utils.c similarity index 100% rename from src/toml_utils.c rename to tools/rimage/src/toml_utils.c diff --git a/tomlc99 b/tools/rimage/tomlc99 similarity index 100% rename from tomlc99 rename to tools/rimage/tomlc99 From a44ddbe777df8b1167fe6a3c332653a25f6b6dab Mon Sep 17 00:00:00 2001 From: Iuliana Prodan <iuliana.prodan@nxp.com> Date: Thu, 5 Oct 2023 11:54:51 +0300 Subject: [PATCH 497/639] ipc: don't propagate commands across pipelines for IPC4 When IPC4_MOD_ID was introduced it returned a non-zero module ID under IPC4 and 0 under IPC3. After commit "45ca3d430 (include: ipc4: module: fix component ID macros)", the IPC4_MOD_ID, under IPC3, is not 0 anymore. Therefore, in order to not propagate the commands across pipelines for IPC4, define IPC4_MOD_ID always to 0 for IPC3. This fixes playback with mixer. Without this patch, with IPC3, we get: src/audio/component.c:130 ERROR comp_set_state(): wrong state = 1, COMP_TRIGGER_PRE_START ../pipeline-stream.c:436 ERROR pipeline_trigger_run(): ret = -22, host->comp.id = 12, cmd = 7 src/ipc/ipc3/handler.c:540 ERROR ipc: comp 12 trigger 0x40000 failed -22 That's because, at some point, the trigger command is not propagated across pipeline and the component state remains unmodified Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> --- src/include/ipc4/module.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/ipc4/module.h b/src/include/ipc4/module.h index 8a16889ffe24..86279567cb85 100644 --- a/src/include/ipc4/module.h +++ b/src/include/ipc4/module.h @@ -423,7 +423,7 @@ struct ipc4_module_load_library { } __packed __aligned(4); #define IPC4_COMP_ID(x, y) ((y) << 16 | (x)) -#define IPC4_MOD_ID(x) ((x) & 0xffff) +#define IPC4_MOD_ID(x) (IS_ENABLED(CONFIG_IPC_MAJOR_4) ? ((x) & 0xffff) : 0) #define IPC4_INST_ID(x) ((x) >> 16) #define IPC4_SRC_QUEUE_ID(x) ((x) & 0xffff) #define IPC4_SINK_QUEUE_ID(x) (((x) >> 16) & 0xffff) From 0bd8c3b070ab9dadc09878637eaa6f5e223b516a Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 5 Oct 2023 18:46:41 +0000 Subject: [PATCH 498/639] Upgrade rimage submodule and west submodule to ac487e09ca5b Add the following rimage commits: ac487e09ca5b Congfig: Add TDFB to TGL, TGL-H, MTL, and LNL d89b7d28f636 ipc4: add google rtc AEC support for mtl 4fc431b355e1 elf: Remove unused elf.c 71553274b569 Switch to new elf reader and module parse functions. 539c2b388cc5 module: Set of a new functions to parse modules 5f47509b6757 elf_file: Set of new functions for reading elf files 7bc2958ba4fd Config: Add DCblock to TGL, TGL-H, MTL, and LNL e8b380d4aec2 Config: Add Multiband-DRC component to TGL, TGL-H, MTL, LNL 8bcf1fc91147 mtl: fill in cps and cpc data for COPIER & GAIN modules 4a36634db612 mtl: fill in cps and cpc data for EQIIR module fea2a30e5691 mtl: fill in cps and cpc data for smart_amp_test module 476d63608bcc mtl: fill in cps and cpc data for ASRC module 352f01fee4ba mtl: fill in subsequent measured cps and mcps data c183ce273943 mtl: add measured cps and cpc values 43eb2a435c29 Config: Add crossover component for MTL and LNL platforms Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- rimage | 2 +- west.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rimage b/rimage index 4fb9fe00575b..ac487e09ca5b 160000 --- a/rimage +++ b/rimage @@ -1 +1 @@ -Subproject commit 4fb9fe00575bc2e9f14570803d811987fb27f010 +Subproject commit ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a diff --git a/west.yml b/west.yml index 5046cf4c4e51..e90e99d134bc 100644 --- a/west.yml +++ b/west.yml @@ -36,7 +36,7 @@ manifest: - name: rimage repo-path: rimage path: sof/rimage - revision: 4fb9fe00575bc2e9f14570803d811987fb27f010 + revision: ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a - name: tomlc99 repo-path: tomlc99 From cada9501dd897e33d1d6f5b4b439d508fa740463 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 6 Oct 2023 10:55:33 +0300 Subject: [PATCH 499/639] Arch: Host: Fix testbench xt build fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds "-std=c99 -std=gnu99 -fgnu89-inline options" to host architecture build to prevent error with "scripts/rebuild-testbench -p tgl". src/audio/module_adapter/module_adapter.c: In function ‘module_adapter_reset’: src/audio/module_adapter/module_adapter.c:1582: error: ‘for’ loop initial declaration used outside C99 mode src/audio/module_adapter/module_adapter.c:1584: error: redefinition of ‘i’ Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/arch/host/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/arch/host/CMakeLists.txt b/src/arch/host/CMakeLists.txt index 7ec47e59c668..75314f00f556 100644 --- a/src/arch/host/CMakeLists.txt +++ b/src/arch/host/CMakeLists.txt @@ -18,8 +18,9 @@ if (supports_implicit_fallthrough) endif() # C & ASM flags -target_compile_options(sof_options INTERFACE -g -O3 -fPIC -DPIC -Wall -Werror -Wmissing-prototypes - ${implicit_fallthrough} -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast -Wpointer-arith +target_compile_options(sof_options INTERFACE -g -O3 -fPIC -DPIC -std=c99 -std=gnu99 -fgnu89-inline + -Wall -Werror -Wmissing-prototypes ${implicit_fallthrough} -Wno-pointer-to-int-cast + -Wno-int-to-pointer-cast -Wpointer-arith -DCONFIG_LIBRARY "-imacros${CONFIG_H_PATH}") if(NOT BUILD_UNIT_TESTS_HOST) From 09e1b87b1089b2591adcff9ad35581e75e82a648 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 5 Oct 2023 16:22:33 +0300 Subject: [PATCH 500/639] Audio: MFCC: Fix testbench xt build fail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build with "scripts/rebuild-testbench -p tgl" fails to error: src/audio/mfcc/mfcc_hifi3.c: In function ‘mfcc_source_copy_s16’: src/audio/mfcc/mfcc_hifi3.c:91: warning: assignment from incompatible pointer type src/audio/mfcc/mfcc_hifi3.c: In function ‘mfcc_fill_prev_samples’: src/audio/mfcc/mfcc_hifi3.c:124: warning: assignment from incompatible pointer type src/audio/mfcc/mfcc_hifi3.c: In function ‘mfcc_fill_fft_buffer’: src/audio/mfcc/mfcc_hifi3.c:159: warning: assignment from incompatible pointer type fixes: d0cb478007 ("Audio: MFCC: Add HiFi3 implementation of MFCC") Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/mfcc/mfcc_hifi3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/audio/mfcc/mfcc_hifi3.c b/src/audio/mfcc/mfcc_hifi3.c index 41062e014893..76f0a79da668 100644 --- a/src/audio/mfcc/mfcc_hifi3.c +++ b/src/audio/mfcc/mfcc_hifi3.c @@ -88,7 +88,7 @@ void mfcc_source_copy_s16(struct input_stream_buffer *bsource, struct mfcc_buffe } buf->s_avail += copied; buf->s_free -= copied; - buf->w_ptr = out; + buf->w_ptr = (int16_t *)out; } void mfcc_fill_prev_samples(struct mfcc_buffer *buf, int16_t *prev_data, @@ -121,7 +121,7 @@ void mfcc_fill_prev_samples(struct mfcc_buffer *buf, int16_t *prev_data, buf->s_avail -= prev_data_length; buf->s_free += prev_data_length; - buf->r_ptr = in; + buf->r_ptr = (void *)in; /* int16_t pointer but direct cast is not possible */ } void mfcc_fill_fft_buffer(struct mfcc_state *state) @@ -156,7 +156,7 @@ void mfcc_fill_fft_buffer(struct mfcc_state *state) buf->s_avail -= fft->fft_hop_size; buf->s_free += fft->fft_hop_size; - buf->r_ptr = in; + buf->r_ptr = (int16_t *)in; /* Copy for next time data back to overlap buffer */ idx = fft->fft_fill_start_idx + fft->fft_hop_size; From 4d3934248f31a6d658e7434702e0228d716cf19a Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Mon, 8 May 2023 23:37:33 +0300 Subject: [PATCH 501/639] topology2: doc: topology2-filter.py: Add topology2 Doxygen filter This is the second version of topology2 to C Doxygen filter. Its far from perfect, but it should get us started. The purpose of the translated C code is not to document actual topology2 code, but only to provide anchors for Doxygen to form a network of links through which to navigate the topology sources and find the pieces of related Doxygen documentation. The filter also creates separate pages of the original code and adds links next to the pages in the C struct definition, instance documentation and their possible Doxygen documentation. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../topology2/doc/topology2-filter.py | 745 ++++++++++++++++++ 1 file changed, 745 insertions(+) create mode 100755 tools/topology/topology2/doc/topology2-filter.py diff --git a/tools/topology/topology2/doc/topology2-filter.py b/tools/topology/topology2/doc/topology2-filter.py new file mode 100755 index 000000000000..7ff465c66be7 --- /dev/null +++ b/tools/topology/topology2/doc/topology2-filter.py @@ -0,0 +1,745 @@ +#!/usr/bin/python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023 Intel Corporation. All rights reserved. +# +# The usage of this command is simple. It takes one argument, a path +# to a SOF topology2 source file, and it produces to stdout something +# that can be parsed by Doxygen as C source. Produced output contains +# C struct definitions and instantiations analogous to the topology2 +# classes and object instances. +# +# The purpose of the translated C code is not to document actual +# topology2 code, but only to provide anchors for Doxygen to form a +# network of links through which to navigate the topology sources and +# find the pieces of related Doxygen documentation. The filter also +# creates separate pages of the original code and adds links next to the +# pages in the C struct definition, instance documentation and their +# possible Doxygen documentation. + +import sys +import os +import re +import io +import logging + +logging.basicConfig(filename='filter_debug.txt', filemode='a', encoding='utf-8', + level=logging.DEBUG) + +def fname(): + try: + name = sys._getframe(1).f_code.co_name + except (IndexError, TypeError, AttributeError): + name = "<unknown>" + return name + +def cbracket_count(line): + val = line.count("{") - line.count("}") + return val + +def sbracket_count(line): + val = line.count("[") - line.count("]") + return val + +def doxy_check_add(doxy, line): + if line.find("##") >= 0: + doxy = doxy + line[line.find("##"):].replace("##", "//!", 1) + if line.find("#") >= 0: + line = line[0:line.find("#")] + return (doxy, line) + +def print_doxy(doxy, file = sys.stdout): + if len(doxy): + print(doxy, file=file) + return "" + return doxy + +def parse_include_str(line): + if re.search(r"^\s*\<[A-Za-z0-9\/_\-\.]+\>\s*", line): + tok = line.split() + return "#include " + tok[0] + "\n" + return None + +def parse_include(line): + str = parse_include_str(line) + if str: + print(str) + return True + return False + +def parse_define_block(fline, instream): + """Parses topology2 Define { } block and outputs C-preprocessor #define macros + + Parameters: + fline (string): First input line that was read by the caller + instream (stream): Input stream of topology2 file we are decoding + + Returns: + string: The original code that was translated + """ + if re.search(r"^\s*Define\s+\{", fline): + logging.debug("fline: %s", fline) + doxy = "" + for line in instream: + if cbracket_count(line) < 0: + break + (doxy, line) = doxy_check_add(doxy, line) + doxy = print_doxy(doxy) + tok = line.split(maxsplit = 2) + if len(tok) < 2: + continue + val = trim_value(line[line.find(tok[0]) + len(tok[0]):]) + print("#define %s\t%s" % (trim_c_id(tok[0]), val)) + return True + return False + +def parse_include_by_key(fline, instream, file): # For now just skip + """Handles IncludeByKey { } blocks, currently handles only actual + includes, not nested {} blocks but everything is included into + raw_code return value. + + Parameters: + fline (string): First input line that was read by the caller + instream (stream): Input stream of topology2 file we are decoding + file (stream): Output stream for the translated output + + Returns: + string: The original code that was translated + + """ + if re.search(r"^\s*IncludeByKey\.", fline): + logging.debug("fline: %s", fline) + bsum = cbracket_count(fline) + if bsum == 1: + # Assume IncludeByKey.<variable> { + tok = fline.split() + tok = tok[0].split(".") + name = tok[1] + raw_code = "" + ifstr = "if" + for line in instream: + raw_code = raw_code + line + bsum = bsum + cbracket_count(line) + tok = line.split("\"") + if len(tok) >= 4: + print("#%s %s == \"%s\"\n#include <%s>" % + (ifstr, name, tok[1], tok[3]), file = file) + if ifstr == "if": + ifstr = "elif" + if bsum < 1: + if ifstr != "if": + print("#endif", file = file) + return raw_code + return None + +def trim_value(val): + val = val.strip(" \t\n$") + end = len(val) - 1 + if val[0:1] == "\"" and val[end:] == "\"": + return val + if val.isidentifier() or val.isnumeric(): + return val + if val[0:1] == "\'" and val[end:] == "\'": + val = val.strip("\'") + return "\"" + val + "\"" + +def trim_c_id(name): + name = name.strip(" \t\n\"\'") + name = name.replace("-", "_") + name = name.replace(" ", "_") + return name + + +def parse_attribute_constraints(instream, name): + """Parses a Constraints { } block and produces a C enum definition if possible + + Parameters: + instream (stream): Input stream of topology2 file we are decoding + name (string): Attribute name of this constraints block belongs to + + Returns: + string: C enum definition or an empty string + + """ + logging.debug("name: %s", name) + valid_values = [] + tuple_values = [] + doxy = "" # This is thrown away since there is no C anchror to connect it- + raw_code = "" + enum = "" + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if cbracket_count(line) < 0: + break + if re.search(r"^\s*\!valid_values\s+\[", line): + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if sbracket_count(line) < 0: + break + valid_values.append(trim_c_id(line)) + if re.search(r"^\s*\!tuple_values\s+\[", line): + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if sbracket_count(line) < 0: + break + tuple_values.append(trim_value(line)) + if len(valid_values) > 1 and len(valid_values) == len(tuple_values): + enum = "enum " + name + " {\n" + for i in range(len(valid_values)): + enum = enum + "\t\t" + valid_values[i] + " =\t" + tuple_values[i] + ",\n" + enum = enum + "\t}" + elif len(valid_values) > 1 and len(tuple_values) == 0: + enum = "enum " + name + " {\n" + for i in range(len(valid_values)): + enum = enum + "\t\t" + valid_values[i] + "," + if valid_values[i][0:1] == "$": # If its a variable add a reference to it + enum = enum + " //!< \\ref " + valid_values[i][1:] + enum = enum + "\n" + enum = enum + "\t}" + return (raw_code, enum) + +def parse_class_attribute(attributes, doxy, instream, fline): + """Parses a DefineAttribute { } block and collects the information into + attributes dict. Any already accumulated Doxygen documentation is + also stored there under the attribute name- + + Parameters: + attributes (dict): A dictionary where data about the attribute is stored + doxy (strung): Doxygen documentation collected just before the attribute + instream (stream): Input stream of topology2 file we are decoding + fline (string): First input line that was read by the caller + + Returns: + string: The original code that was translated + """ + logging.debug("fline: %s", fline) + tok = fline.split("\"") + if len(tok) > 1: + name = tok[1] + else: + tok = fline.split(".") + tok = tok[1].split(" ") + name = tok[0] + (doxy, fline) = doxy_check_add(doxy, fline) + bsum = cbracket_count(fline) + typestr = "" + token_ref = "" + ref_type = "" + enum = "" + raw_code = "" + if bsum < 1: + # Assume: DefineAttribute.name {} + typestr = "int" + else: + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + bsum = bsum + cbracket_count(line) + if bsum < 1: + break + if re.search(r"^\s*constraints\s+\{", line) and bsum == 2: + (code, enum) = parse_attribute_constraints(instream, name) + raw_code = raw_code + code + bsum = 1 + elif re.search(r"^\s*type\s", line): + tok = line.split() + typestr = tok[1].strip(" \t\n\"\'") + elif re.search(r"^\s*token_ref\s", line): + tok = line.split() + token_ref = tok[1].strip(" \t\n\"\'") + tok = token_ref.split(".") + ref_type = tok[1] + logging.debug("type %s token_ref %s ref_type %s enum %s", + typestr, token_ref, ref_type, enum) + if enum != "" and ref_type != "bool": + typestr = enum + if ref_type == "string": + doxy = doxy + "//! \\em string type\n" + elif typestr == "" or ref_type == "bool": + typestr = ref_type + attributes[name] = { "type": typestr, "doxy": doxy, "token_ref": token_ref } + return raw_code + +def print_attributes(attributes): + """Print out struct members and their doxygen documentation from attributes dict. + + Parameters: + attributes (dict): A dictionary where data about the attributes was stored + """ + for name in attributes: + doxy = "" + if attributes[name].get("doxy"): + doxy = attributes[name]["doxy"] + "\n" + if attributes[name].get("type"): + typestr = attributes[name]["type"] + print("%s\t%s %s;\n" % (doxy, typestr, name)) + +def set_attribute_flag(attributes, attribute, flag): + if not attributes.get(attribute): + attributes[attribute] = {} + attributes[attribute][flag] = True + +def parse_attributes_block(instream, attributes, attrib_doxy): + """Parse attributes block inside class definition and store the flags in attributes dict + + Parameters: + instream (stream): Input stream of topology2 file we are decoding + attributes (dict): Dict where data about the attributes is stored + attrib_doxy (dict): Dict to store doxygen docs associated with the attributes block + + Returns: + string: The original code that was translated + """ + logging.debug("called") + raw_code = "" + doxy = "" + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if cbracket_count(line) < 0: + break + if re.search(r"^\s*\!constructor\s+\[", line): + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if sbracket_count(line) < 0: + break + set_attribute_flag(attributes, trim_c_id(line), "constructor") + attrib_doxy["constructor"] = doxy + doxy = "" + elif re.search(r"^\s*\!mandatory\s+\[", line): + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if sbracket_count(line) < 0: + break + set_attribute_flag(attributes, trim_c_id(line), "mandatory") + attrib_doxy["mandatory"] = doxy + doxy = "" + elif re.search(r"^\s*\!immutable\s+\[", line): + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if sbracket_count(line) < 0: + break + set_attribute_flag(attributes, trim_c_id(line), "immutable") + attrib_doxy["immutable"] = doxy + doxy = "" + elif re.search(r"^\s*\!deprecated\s+\[", line): + attrib_doxy["deprecated"] = doxy + doxy = "" + for line in instream: + raw_code = raw_code + line + (doxy, line) = doxy_check_add(doxy, line) + if sbracket_count(line) < 0: + break + set_attribute_flag(attributes, trim_c_id(line), "deprecated") + elif re.search(r"^\s*unique\s+", line): + tok = line.split() + attrib_doxy["unique"] = doxy + doxy = "" + set_attribute_flag(attributes, trim_c_id(tok[1]), "unique") + return raw_code + +def attribute_block_print(class_name, attributes, attrib_doxy): + """Generates a Doxygen documentation section from attribute flags + and doxygen docs stored to attrib_doxy + + Parameters: + class_name (string): Name of the class we are processing + attributes (dict): Dict where data about the attributes was stored + attrib_doxy (dict): Dict where doxygen docs of the attributes block was stored + + """ + logging.debug("class_name \'%s\'", class_name) + for field in attrib_doxy: + # Only add attribute paragraph if there are doxygen comment for it + if attrib_doxy[field] != "": + print("//! \\par %s attributes:\n//!" % field.capitalize()) + for attr in attributes: + if attributes[attr].get(field): + print("//! \\link %s::%s \\endlink \\n" % (class_name, attr)) + print("//! \\n\n%s" % attrib_doxy[field]) + +def attribute_block_info_add(attributes, attrib_doxy): + """Add simple bullets in the attribute (= struct members) documentation if + the attribute has constructor, mandatory, immutable, deprecated, or unique + property. + + Parameters: + attributes (dict): Dict where data about the attributes was stored + attrib_doxy (dict): Dict where doxygen docs of the attributes block was stored + + """ + # TODO: Add short documentation about the attribute properties and link to it. + for field in attrib_doxy: + for attr in attributes: + if attributes[attr].get(field): + if not attributes[attr].get("doxy"): + attributes[attr]["doxy"] = "" + attributes[attr]["doxy"] = "//! - \\em " + field + " attribute.\\n\n" + attributes[attr]["doxy"] + +def parse_class_contents(class_name, attributes, attrib_doxy, objs, defaults, + instream, includef = ""): + """Translates the contents inside a class definition { } block + + Parameters: + class_name (string): Class name + attributes (dict): Dict where data about the attributes is stored + attrib_doxy (dict): Dict to store doxygen docs associated with the attributes block + objs (dict): Dict to store fist level contained objects with Docxyge docs + defaults (streaM): Stream where the instances of the objects are printed + instream (stream): Input stream of topology2 file we are decoding + includef (string): Include file from where the attributes and objects inline included from + + Returns: + string: The original code that was translated + """ + bsum = 1 + doxy_addition = "" + if includef != "": + doxy_addition = "//! - Included from <" + includef + ">\\n\n" + doxy = "" + raw_code = "" + for line in instream: + raw_code = raw_code + line + if parse_include_str(line): + # Inline files that are included from within a class definition + filename = line[line.find("<") + 1:line.find(">")] + logging.debug("try to inline include \'%s\' from \'%s\'", + filename, os.getcwd()) + # NOTE: The path is relative to when the script exists so + # two levels up and we are at topology2 root + with open("../../" + filename, "r+", encoding="ascii") as ifile: + parse_class_contents(class_name, attributes, attrib_doxy, objs, + defaults, ifile, filename) + continue + if (code := parse_include_by_key(line, instream, sys.stdout)): + raw_code = raw_code + code + continue + if re.search(r"^\s*DefineAttribute\.", line): + doxy = doxy_addition + doxy + raw_code = raw_code + parse_class_attribute(attributes, doxy, instream, line) + doxy = "" + elif re.search(r"^\s*DefineArgument\.", line): + for line in instream: # Just skip, this is only used in bytes.conf + if cbracket_count(line) < 0: + break + elif re.search(r"^\s*attributes\s+\{", line): + doxy = "" # Doxy comments before attributes block end in weird places + raw_code = raw_code + parse_attributes_block(instream, attributes, attrib_doxy) + elif re.search(r"^\s*Object\.", line): + # TODO: Pass collected doxy comments to parse_object and store in objs + doxy = "" + raw_code = raw_code + parse_object(instream, line, file = defaults, + objects = objs, tabs = "\t", ending = ",") + else: # If nothing else matched, assume a default value definition for an attribute + (doxy, line) = doxy_check_add(doxy, line) + tok = line.split() + if len(tok) == 2 and tok[0].isidentifier(): + if doxy != "": + print(doxy, file = defaults) + doxy = "" + val = trim_value(line[line.find(tok[0]) + len(tok[0]):]) + print("\t.%s =\t%s," % (trim_c_id(tok[0]), val), + file = defaults) + bsum = bsum + cbracket_count(line) + if bsum < 1: + break + return raw_code + +def parse_class(instream, fline): + """Parse class definition and print out C struct definition + + Parameters: + fline (string): First input line that was read by the caller + instream (stream): Input stream of topology2 file we are decoding + """ + logging.debug("fline: %s", fline) + tok = fline.split(maxsplit = 2) + cdef = tok[0].split(".") + # base = cdef[1] # Just in case we go back to C++ tralation + class_name = cdef[2] + class_name = trim_c_id(class_name) + attributes = {} + attrib_doxy = {} + defaults = io.StringIO() + objs = {} + raw_code = fline + parse_class_contents(class_name, attributes, attrib_doxy, + objs, defaults, instream) + attribute_block_print(class_name, attributes, attrib_doxy) + attribute_block_info_add(attributes, attrib_doxy) + print("//! \\ref %s_rawcode" % class_name) + print("struct %s {" % class_name) + print_attributes(attributes) + for obj in objs: + if objs[obj]["count"] > 1: + for i in range(objs[obj]["count"]): + print(objs[obj]["doxy"][i]) + print("\tstruct %s %s%d;" % (obj, obj, i)) + else: + print(objs[obj]["doxy"][0]) + print("\tstruct %s %s;" % (obj, obj)) + print("};\n") + print("/*! \\page %s_rawcode The %s class definition in topology2 code\n\t\\code{.unparsed}" % + (class_name, class_name)) + print(raw_code) + print("\t\\endcode\n*/") + print("//! \\var struct %s %s_defaults" % (class_name, class_name)) + print("//! \\brief %s class default values" % class_name) + print("struct %s %s_defaults = {\n" % (class_name, class_name)) + print(defaults.getvalue()) + print("};\n") + defaults.close() + +def parse_members(instream, cbsum, tabs, file): + """Parse attribute initializations from object instantiation + + Parameters: + instream (stream): Input stream of topology2 file we are decoding + cbsum (int): The amount of curly brackets "{" WE HAVE OPEN + tabs (string): Current level of indentation + + Returns: + string: The original code that was translated + """ + doxy = "" + raw_code = "" + for line in instream: + raw_code = raw_code + line + if (code := parse_include_by_key(line, instream, file)): + raw_code = raw_code + code + continue + cbsum = cbsum + cbracket_count(line) + (doxy, line) = doxy_check_add(doxy, line) + # Assume ending } to be alone on its own line + if cbsum < 1: + break + if re.search(r"^\s*Object\.", line): + logging.debug("object-line: %s", line) + obj = line.split(".") + if cbsum == 2: + # Assume Object.Base.name.1 { + doxy = print_doxy(doxy, file = file) + raw_code = raw_code + parse_object(instream, line, file = file, tabs = tabs, ending = ",") + cbsum = 1 + elif cbsum == 1: + # Assume Object.Base.name.1 {} + doxy = print_doxy(doxy, file = file) + print("%s.%s = {}," % (tabs, obj[2]), file = file) + else: + tok = line.split(maxsplit = 1) + if len(tok) >=2: + name = tok[0] + val = trim_value(tok[1]) + doxy = print_doxy(doxy, file = file) + print("%s.%s = %s," % (tabs, name, val), file = file) + return raw_code + +# +def object_instance_prefix(name, ending): + """Decide "struct name name =" or ".name =" based on instantiation ending in ',' or ';' + + Parameters: + name (string): Name of the object instance + ending (string): Either ',' or ';' indication if this is an instance or a definition + + """ + if ending == ";": + return "struct " + name + " " + return "." + +def parse_object(instream, fline, file = sys.stdout, objects = {}, tabs = "", ending = ";"): + """Translates all Object instatiation into initialized C structs + Note that dict arguments in python are passed as reference + + Parameters: + instream (stream): Input stream of topology2 file we are decoding + fline (string): First input line that was read by the caller + file (stream): Where the C struct instance or definition is printed + objects (dict): Dict to store fist level contained objects with Docxyge docs + ending (string): Either ',' or ';' indication if this is an instance or a definition + tabs (string): Current level of indentation + + Returns: + string: The original code that was translated + """ + logging.debug("fline: %s", fline) + tok = fline.split(maxsplit = 2) + obj = tok[0].split(".") + cbsum = cbracket_count(fline) + sbsum = sbracket_count(fline) + name = "" + doxy = "" + raw_code = "" + if len(obj) == 4 and sbsum == 0 and cbsum == 0: + # Assume Object.Base.name.1 { } + name = obj[2] + name = trim_c_id(name) + doxy = print_doxy(doxy, file = file) + prefix = object_instance_prefix(name, ending) + print("%s%s = {}%s" % (prefix, name, ending), file = file) + objects[name] = { "count": 1, "doxy": [doxy] } + elif len(obj) == 4 and sbsum == 0 and cbsum == 1: + # Assume Object.Base.name.1 { + name = obj[2] + name = trim_c_id(name) + doxy = print_doxy(doxy, file = file) + prefix = object_instance_prefix(name, ending) + print("%s%s%s = {" % (tabs, prefix, name), file = file) + raw_code = raw_code + parse_members(instream, cbsum, tabs + "\t", file) + print("%s}%s" % (tabs, ending), file = file) + objects[name] = { "count": 1, "doxy": [doxy] } + elif len(obj) == 3 and sbsum == 1 and cbsum == 0: + # Assume Object.Base.name [ + name = obj[2] + name = trim_c_id(name) + doxy = print_doxy(doxy, file = file) + prefix = object_instance_prefix(name, ending) + print("%s%s%s[] = {" % (tabs, prefix, name), file = file) + objects[name] = { "count": 0, "doxy": [] } + for line in instream: + raw_code = raw_code + line + if parse_include(line): + continue + if (code := parse_include_by_key(line, instream, sys.stdout)): + raw_code = raw_code + code + continue + sbsum = sbsum + sbracket_count(line) + cbsum = cbsum + cbracket_count(line) + (doxy, line) = doxy_check_add(doxy, line) + if sbsum < 1: + print("%s}%s" % (tabs, ending), file = file) + break + if cbsum == 1: # Assume starting { on its own line + objects[name]["count"] = objects[name]["count"] + 1 + objects[name]["doxy"].append(doxy) + doxy = print_doxy(doxy, file = file) + print("%s\t{" % tabs, file = file) + raw_code = raw_code + parse_members(instream, cbsum, tabs + "\t\t", file) + cbsum = 0 + print("%s\t}," % tabs, file = file) + elif len(obj) == 2 and sbsum == 0 and cbsum == 1: + # Assume Object.Base { + for line in instream: + raw_code = raw_code + line + if parse_include(line): + continue + if (code := parse_include_by_key(line, instream, file)): + raw_code = raw_code + code + continue + sbsum = sbsum + sbracket_count(line) + cbsum = cbsum + cbracket_count(line) + (doxy, line) = doxy_check_add(doxy, line) + if cbsum < 1: # Ending } found + break + if sbsum == 1 and cbsum == 1 and sbracket_count(line) > 0: + # Assume Class_name [ + tok = line.split() + name = trim_c_id(tok[0]) + objects[name] = { "count": 0, "doxy": [] } + doxy = print_doxy(doxy, file = file) + prefix = object_instance_prefix(name, ending) + print("%s%s%s[] = {" % (tabs, prefix, name), file = file) + elif sbsum == 1 and cbsum == 2: + # Assume class_name [ \n { \n + objects[name]["count"] = objects[name]["count"] + 1 + objects[name]["doxy"].append(doxy) + doxy = print_doxy(doxy, file = file) + print("%s\t{" % tabs, file = file) + raw_code = raw_code + parse_members(instream, 1, tabs + "\t\t", file) + print("%s\t}," % tabs, file = file) + cbsum = 1 + elif sbsum == 0 and cbsum == 1 and sbracket_count(line) < 0: + # Assume ending ] of class table alone one its own line + print("%s}%s" % (tabs, ending), file = file) + elif sbsum == 0 and cbsum == 1 and line.count("}") == 1: + # Assume name."1" {} + # No init values, so no instantiation code needed, but we still need + # to store the object into objexts dict. + tok = line.split() + tok = tok[0].split(".") + name = trim_c_id(tok[0]) + if not objects.get(name): + objects[name] = { "count": 0, "doxy": [] } + objects[name]["count"] = objects[name]["count"] + 1 + objects[name]["doxy"].append(doxy) + doxy = print_doxy(doxy, file = file) + elif sbsum == 0 and cbsum == 2 and cbracket_count(line) == 1: + # Assume name."1" { + tok = line.split() + tok = tok[0].split(".") + name = trim_c_id(tok[0]) + mname = name + if len(tok) > 1: + idx = tok[1].strip(" \"\'") + if idx.isidentifier() or idx.isnumeric(): + mname = mname + "_" + idx + if not objects.get(name): + objects[name] = { "count": 0, "doxy": [] } + objects[name]["count"] = objects[name]["count"] + 1 + objects[name]["doxy"].append(doxy) + doxy = print_doxy(doxy, file = file) + prefix = object_instance_prefix(name, ending) + print("%s%s%s = {" % (tabs, prefix, mname), file = file) + raw_code = raw_code + parse_members(instream, 1, tabs + "\t", file) + cbsum = 1 + print("%s}%s" % (tabs, ending), file = file) + return raw_code + +def parse_object_and_make_raw_code_page(filename, index, instream, fline): + """Parses an object instance outputs its C equivalent, and creates a raw code page of + of it and prints a reference to it. Handles an "Object.... {}" instance completely + and produces possibly multiple initialized C structs, but always just one raw code + block containing the "Object.... {}" block completely. + + Parameters: + filename (stream): Name of the file we are paring + index (int): The index of the decoded Object block in this file we are handling + instream (stream): Input stream of topology2 file we are decoding + fline (string): First input line that was read by the caller + + """ + tok = filename.split("/") + filename = fname = tok[len(tok)-1] + fname = fname.replace("-", "_") + fname = fname.replace(".", "_") + c_instances = io.StringIO() + raw_code = fline + parse_object(instream, fline, c_instances) + print("/*! \\page %s_%d_rawcode The %s instances #%d in topology2 code\n\t\\code{.unparsed}" % + (fname, index, filename, index)) + print(raw_code) + print("\t\\endcode\n*/") + print("//! \\brief \\ref %s_%d_rawcode" % (fname, index)) + print(c_instances.getvalue()) + c_instances.close() + +# Main starts here, apart from debug file opening +filename = sys.argv[1] +logging.info("file: %s", filename) +with open(filename, "r+", encoding="ascii") as instream: + block_idx = 0 + + shortfname = filename[filename.find("/topology2/"):] + print("//! \\file %s" % shortfname[11:]) + print("//! Source file can be found " + + "<a href=\"https://github.com/thesofproject/sof/tree/main/tools/topology%s\">here</a>." + % shortfname) + for line in instream: + if parse_include(line): + continue + if parse_define_block(line, instream): + continue + if parse_include_by_key(line, instream, sys.stdout): + continue + if re.search(r"^\s*Class\.", line): + parse_class(instream, line) + elif re.search(r"^\s*Object\.", line): + parse_object_and_make_raw_code_page(filename, block_idx, instream, line) + block_idx = block_idx + 1 + elif line.find("##") >= 0: + sys.stdout.write(line.replace("##", "//!", 1)) + else: + sys.stdout.write("\n") From cfa4d44ffa13a3dade309875703f3236d5619b01 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Thu, 11 May 2023 17:02:20 +0300 Subject: [PATCH 502/639] topology2: doc: Add initial sof.doxygen.in Includes all *.conf files under topology2 to the Doxygen documentation and points directly to mainpage Doxygen source. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- tools/topology/topology2/doc/sof.doxygen.in | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 tools/topology/topology2/doc/sof.doxygen.in diff --git a/tools/topology/topology2/doc/sof.doxygen.in b/tools/topology/topology2/doc/sof.doxygen.in new file mode 100644 index 000000000000..17068b4a91c3 --- /dev/null +++ b/tools/topology/topology2/doc/sof.doxygen.in @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: BSD-3-Clause +PROJECT_NAME = "Sound Open Firmware Topology2" +OUTPUT_DIRECTORY = doxygen +GENERATE_LATEX = NO +GENERATE_RTF = NO +GENERATE_MAN = NO +GENERATE_XML = YES + +CASE_SENSE_NAMES = NO +INPUT = @top_srcdir@ + +RECURSIVE = YES +FILE_PATTERNS = *.conf +IMAGE_PATH = +QUIET = YES +WARN_LOGFILE = doxygen_warnings.txt + +EXTRACT_ALL = YES +EXTRACT_STATIC = YES +WARN_IF_UNDOCUMENTED = NO +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = YES +INHERIT_DOCS = YES + +MACRO_EXPANSION = YES +EXPAND_ONLY_PREDEF = YES +OPTIMIZE_OUTPUT_FOR_C = YES + +HTML_TIMESTAMP = NO + +EXTENSION_MAPPING = conf=C +FILTER_PATTERNS = *.conf=@top_srcdir@/doc/topology2-filter.py From 3e0fdf5eba43bda3b00b46aa6cc59c3836199ff0 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Thu, 31 Aug 2023 20:28:01 +0300 Subject: [PATCH 503/639] topology2: doc: Initial cmake build rules for doxygen documentation Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- tools/topology/topology2/doc/CMakeLists.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/topology/topology2/doc/CMakeLists.txt diff --git a/tools/topology/topology2/doc/CMakeLists.txt b/tools/topology/topology2/doc/CMakeLists.txt new file mode 100644 index 000000000000..e5b9e4a5211c --- /dev/null +++ b/tools/topology/topology2/doc/CMakeLists.txt @@ -0,0 +1,20 @@ +# SPDX-License-Identifier: BSD-3-Clause + +cmake_minimum_required(VERSION 3.13) + +project(SOF_TOPOLOGY2_DOC NONE) + +set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") + +set(top_srcdir "${SOF_ROOT_SOURCE_DIRECTORY}") + +configure_file( + "${PROJECT_SOURCE_DIR}/sof.doxygen.in" + "${PROJECT_BINARY_DIR}/sof.doxygen" +) + +add_custom_target("doc" ALL + COMMAND doxygen sof.doxygen + VERBATIM + USES_TERMINAL +) From 23a74a382cfb3ee7809b372513ca3de2402fbdd0 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Thu, 28 Sep 2023 22:56:49 +0300 Subject: [PATCH 504/639] topology2: doc: Add README instructing how to build the documentation Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- tools/topology/topology2/doc/README | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tools/topology/topology2/doc/README diff --git a/tools/topology/topology2/doc/README b/tools/topology/topology2/doc/README new file mode 100644 index 000000000000..a412e1d2d707 --- /dev/null +++ b/tools/topology/topology2/doc/README @@ -0,0 +1,7 @@ +To build the topology2 source documentation do following steps: + +cd tools/topology/topology2/doc +cmake -B build/ +cmake --build build/ -v + +After the last command you should find the html documentation under: sof/tools/topology/topology2/doc/build/doxygen/html From 59dd233c43c585f160816ad9c78a9fcbae19fa94 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Wed, 27 Sep 2023 19:01:26 +0300 Subject: [PATCH 505/639] topology2: doc: topology2-generate-contents.sh: Script to generate contents This commit adds topology2-generate-contents.sh the script to generate the contents page that will be inline included to the mainpage added in the next commit. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../doc/topology2-generate-contents.sh | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 tools/topology/topology2/doc/topology2-generate-contents.sh diff --git a/tools/topology/topology2/doc/topology2-generate-contents.sh b/tools/topology/topology2/doc/topology2-generate-contents.sh new file mode 100755 index 000000000000..ea5b4ed059cb --- /dev/null +++ b/tools/topology/topology2/doc/topology2-generate-contents.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023 Intel Corporation. All rights reserved. +# This script generates the contents page and stores it in extra-contents/contents.doxy + +set -e +cd "$(dirname "$0")" + +generate_contents () +{ + cat <<EOF +# This contents list is automatically generated by $0. +/*! \page doc_contents + \section doc_classes Classes +EOF + for ctype in Base Widget Control Dai Pipeline + do + echo " \subsection doc_${ctype,}_classes $ctype Classes" + find .. -name \*.conf -print0 | + xargs -0 awk "/^Class\.$ctype\./ "'{ + split($1, a, "\\."); + name = a[3]; gsub("\"", "", name); gsub("-", "_", name); + print "\t\\li \\ref " name + }' | sort -u + echo + done + + echo '*/' +} + +generate_contents From 30143809097f871d4147fc81432ded8ec9471ae2 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Tue, 5 Sep 2023 00:15:23 +0300 Subject: [PATCH 506/639] topology2: doc: mainpage.doxy: Add simple main-page with contents The initial main-page contains a short introduction into topology2 Doxygen documentation, and an inline reference to automatically generated contents page. The commit also adds more advanced cmake rules to track all document dependencies. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- tools/topology/topology2/doc/CMakeLists.txt | 29 ++++++++++++++++- .../doc/extra-contents/mainpage.doxy | 32 +++++++++++++++++++ tools/topology/topology2/doc/sof.doxygen.in | 6 ++-- 3 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 tools/topology/topology2/doc/extra-contents/mainpage.doxy diff --git a/tools/topology/topology2/doc/CMakeLists.txt b/tools/topology/topology2/doc/CMakeLists.txt index e5b9e4a5211c..303d06da3d15 100644 --- a/tools/topology/topology2/doc/CMakeLists.txt +++ b/tools/topology/topology2/doc/CMakeLists.txt @@ -7,14 +7,41 @@ project(SOF_TOPOLOGY2_DOC NONE) set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}/..") set(top_srcdir "${SOF_ROOT_SOURCE_DIRECTORY}") +set(top_bindir "${PROJECT_BINARY_DIR}") configure_file( "${PROJECT_SOURCE_DIR}/sof.doxygen.in" "${PROJECT_BINARY_DIR}/sof.doxygen" ) -add_custom_target("doc" ALL +file(GLOB_RECURSE topology2_sources "${SOF_ROOT_SOURCE_DIRECTORY}/*.conf") +file(GLOB_RECURSE extra_sources "${PROJECT_SOURCE_DIR}/extra-contents/*.doxy") + +add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/contents.doxy + COMMAND ${PROJECT_SOURCE_DIR}/topology2-generate-contents.sh > ${PROJECT_BINARY_DIR}/contents.doxy + DEPENDS ${PROJECT_SOURCE_DIR}/topology2-generate-contents.sh + DEPENDS ${topology2_sources} + VERBATIM +) + +add_custom_target(doc-contents + DEPENDS ${PROJECT_BINARY_DIR}/contents.doxy +) + +add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/doxygen/html/index.html COMMAND doxygen sof.doxygen + DEPENDS ${PROJECT_BINARY_DIR}/sof.doxygen + DEPENDS ${PROJECT_SOURCE_DIR}/topology2-filter.py + DEPENDS doc-contents + DEPENDS ${extra_sources} + DEPENDS ${topology2_sources} VERBATIM USES_TERMINAL ) + +add_custom_target(doc ALL + DEPENDS ${PROJECT_BINARY_DIR}/doxygen/html/index.html + VERBATIM +) diff --git a/tools/topology/topology2/doc/extra-contents/mainpage.doxy b/tools/topology/topology2/doc/extra-contents/mainpage.doxy new file mode 100644 index 000000000000..4b2a2bfcabc8 --- /dev/null +++ b/tools/topology/topology2/doc/extra-contents/mainpage.doxy @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: BSD-3-Clause */ +/* Copyright(c) 2023 Intel Corporation. All rights reserved. */ +/*! \mainpage Sound Open Firmware Topology2 + * + * \section this_document This Document + * + * This document is generated from SOF topology2 sources and its + * purpose is provide examples of how SOF ALSA topologies are built + * through instantiating toppology2 classes. + * + * The documentation is provided using Doxygen package and a Doxygen + * filter that translates the topology2 classes into C-structures. The + * filter is implemented in python and can be found from + * tools/topology/topology2/doc/topology2-filter.py + * + * The topology2 language syntax is described in detail <a + * href="https://thesofproject.github.io/latest/developer_guides/topology2/topology2.html">here</a>. + * + * \subsection doc_reading Reading the document + * + * The purpose of the translated C code is not to document actual + * topology2 code, but only to provide anchors for Doxygen to form a + * network of links through which to navigate the topology sources and + * find the pieces of related Doxygen documentation. The filter also + * creates separate pages of the original code and add links next to + * the pages in the C struct definition and instance documentation. + * + * The most essential part of the documentation is the documentation of + * classes that shown as C structs in this Doxygen documentation. + * + * \copydoc doc_contents + */ diff --git a/tools/topology/topology2/doc/sof.doxygen.in b/tools/topology/topology2/doc/sof.doxygen.in index 17068b4a91c3..d964c58258da 100644 --- a/tools/topology/topology2/doc/sof.doxygen.in +++ b/tools/topology/topology2/doc/sof.doxygen.in @@ -7,7 +7,9 @@ GENERATE_MAN = NO GENERATE_XML = YES CASE_SENSE_NAMES = NO -INPUT = @top_srcdir@ +INPUT = @top_srcdir@ \ + @top_srcdir@/doc/extra-contents/ \ + @top_bindir@/contents.doxy RECURSIVE = YES FILE_PATTERNS = *.conf @@ -28,5 +30,5 @@ OPTIMIZE_OUTPUT_FOR_C = YES HTML_TIMESTAMP = NO -EXTENSION_MAPPING = conf=C +EXTENSION_MAPPING = conf=C,doxy=C FILTER_PATTERNS = *.conf=@top_srcdir@/doc/topology2-filter.py From 080dc5a340ab635370936b4c89ee7c6e84562d13 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Thu, 31 Aug 2023 17:39:53 +0300 Subject: [PATCH 507/639] topology2: doc: gain.conf: Convert comments to Doxygen documentation Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../topology2/include/components/gain.conf | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/tools/topology/topology2/include/components/gain.conf b/tools/topology/topology2/include/components/gain.conf index bfaecc54a545..9167c7df546b 100644 --- a/tools/topology/topology2/include/components/gain.conf +++ b/tools/topology/topology2/include/components/gain.conf @@ -1,29 +1,29 @@ -# -# Common pipeline gain (volume) -# -# A generic gain (volume) widget. All attributes defined herein are namespaced -# by alsatplg to "Object.Widget.gain.N.attribute_name" -# -# Usage: this component can be used by declaring int a parent object. i.e. -# -# Object.Widget.gain."N" { -# index 1 -# format s24le -# no_pm "true" -# } -# -# Where N is the unique instance number for gain widget in the same alsaconf node. +## \struct gain +## \brief Common pipeline gain (volume) +## +## A generic gain (volume) widget. All attributes defined herein are namespaced +## by alsatplg to "Object.Widget.gain.N.attribute_name" +## +## Usage: this component can be used by declaring int a parent object. i.e. +## +## Object.Widget.gain."N" { +## index 1 +## format s24le +## no_pm "true" +## } +## +## Where N is the unique instance number for gain widget in the same alsaconf node. <include/controls/mixer.conf> Class.Widget."gain" { # - # Pipeline ID for the gain widget object + ## Pipeline ID for the gain widget object # DefineAttribute."index" {} # - # gain object instance + ## gain object instance # DefineAttribute."instance" {} @@ -35,9 +35,9 @@ Class.Widget."gain" { # # - # Gain curve type. The values provided will be translated to integer values - # as specified in the tuple_values array. - # For example: "linear" is translated to 0, "log" to 1 etc. + ## Gain curve type. The values provided will be translated to integer values + ## as specified in the tuple_values array. + ## For example: "linear" is translated to 0, "log" to 1 etc. # DefineAttribute."curve_type" { type "string" @@ -64,7 +64,7 @@ Class.Widget."gain" { } # - # Gain curve in milliseconds + ## Gain curve in milliseconds # DefineAttribute."curve_duration" { # Token set reference name @@ -79,8 +79,8 @@ Class.Widget."gain" { # Attribute categories attributes { # - # The PGA widget name would be constructed using the index and instance attributes. - # For ex: "gain.1.1" or "gain.10.2" etc. + ## The PGA widget name would be constructed using the index and instance attributes. + ## For ex: "gain.1.1" or "gain.10.2" etc. # !constructor [ "index" @@ -122,9 +122,9 @@ Class.Widget."gain" { # gain widget mixer controls # Object.Control { - # gain mixer control + ## gain mixer control mixer."1" { - #Channel register and shift for Front Left/Right + ## Channel register and shift for Front Left/Right Object.Base.channel.1 { name "fl" shift 0 @@ -136,7 +136,7 @@ Class.Widget."gain" { Object.Base.ops.1 { name "ctl" info "volsw" - #256 binds the mixer control to volume get/put handlers + ## get = 256 binds the mixer control to volume get/put handlers get 256 put 256 } From 37ac9fcc6ac51adbf9c751caaa959df8d5c00b75 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Fri, 18 Aug 2023 12:52:58 +0300 Subject: [PATCH 508/639] topology2: doc: common.conf: Doxygenify the existing comments Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../topology2/include/controls/common.conf | 92 ++++++++++++------- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/tools/topology/topology2/include/controls/common.conf b/tools/topology/topology2/include/controls/common.conf index 77593fccc1fb..0cf249914070 100644 --- a/tools/topology/topology2/include/controls/common.conf +++ b/tools/topology/topology2/include/controls/common.conf @@ -1,15 +1,19 @@ -# Common class definitions for controls - -# -# Class for channel objects. These are instantiated as: -# Object.Base.channel."fl" { -# reg 1 -# shift 0 -# } -# +## \file common.conf +## \brief Common class definitions for controls. + +## \struct channel +## \brief Class for channel objects. +## These are instantiated as: +## +## Object.Base.channel."fl" { +## reg 1 +## shift 0 +## } +## + Class.Base."channel" { DefineAttribute."instance" {} - # name of the channel + ## name of the channel DefineAttribute."name" { type "string" } @@ -33,13 +37,18 @@ Class.Base."channel" { shift 1 } -# Class definition for control ops. These are instantiated as: -# Object.Base.ops."ctl" { -# info "volsw" -# get "259" -# put "259" -# } -# +## \struct ops +## \brief Class definition for control ops. +## +## These are instantiated as: +## +## Object.Base.ops."ctl" { +## info "volsw" +## get "259" +## put "259" +## } +## + Class.Base."ops" { DefineAttribute."instance" {} # ops name @@ -68,13 +77,17 @@ Class.Base."ops" { } } -# Class definition for control extops. These are instantiated as: -# Object.Base.extops."ctl" { -# info "volsw" -# get "258" -# put "258" -# } -# +## \struct extops +## \brief Class definition for control extops. +## These are instantiated as: +## +## Object.Base.extops."ctl" { +## info "volsw" +## get "258" +## put "258" +## } +## + Class.Base."extops" { DefineAttribute."instance" {} # extops name @@ -104,12 +117,15 @@ Class.Base."extops" { } } -# -# Class definition for scale objects. These are instantiated as follows: -# Object.Base.scale."name" { -# mute 1 -# } -# +## \struct scale +## \brief Class definition for scale objects. +## These are instantiated as follows: +## +## Object.Base.scale."name" { +## mute 1 +## } +## + Class.Base."scale" { DefineAttribute."instance" {} DefineAttribute."name" { @@ -139,11 +155,17 @@ Class.Base."scale" { mute 1 } -# -# Class definition for tlv objects. These are instantiated as follows: -# Object.Base.tlv."vtlv_m64s2" { -# Object.Base.scale."0" {} -# } +## \struct tlv +## \brief Class definition for tlv objects. +## These are instantiated as follows: +## +## Object.Base.tlv."vtlv_m64s2" { +## Object.Base.scale."0" {} +## } +## +## The linked object instance is \link scale \endlink . +## + Class.Base."tlv" { DefineAttribute."instance" {} DefineAttribute."name" { From 13cf2a27522aa64242b38f22d7e19d47bd0dfd15 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Thu, 11 May 2023 17:52:27 +0300 Subject: [PATCH 509/639] topology2: doc: mixer.conf: Doxygenify and improve the existing comments Improve and convert comments to doxygen documentation. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../topology2/include/controls/mixer.conf | 72 ++++++++++--------- 1 file changed, 38 insertions(+), 34 deletions(-) diff --git a/tools/topology/topology2/include/controls/mixer.conf b/tools/topology/topology2/include/controls/mixer.conf index 66b5085cf857..191230ec5bdc 100644 --- a/tools/topology/topology2/include/controls/mixer.conf +++ b/tools/topology/topology2/include/controls/mixer.conf @@ -1,41 +1,45 @@ -# -# Mixer kcontrol class. All attributes defined herein are namespaced -# by alsatplg to "Object.Control.mixer.N.attribute_name" -# -# Usage: this component can be used by instantiating it in the parent object. i.e. -# -# Object.Control.mixer."N" { -# index 1 -# name "1 Master Playback Volume" -# mas 32 -# Object.Base.channel.1 { -# name "fl" -# shift 0 -# reg 0 -# } -# Object.Base.channel.2 { -# name "fr" -# shift 1 -# reg 1 -# } -# Object.Base.ops."ctl" { -# info "volsw" -# get "258" -# put "258" -# } -# } -# -# Where N is the unique instance number for the buffer object within the same alsaconf node. -# The mixer control object should also include the ops, channels and tlv objects in the object -# instance +## \struct mixer +## \brief Topology Mixer class +## +## All attributes defined herein are namespaced +## by alsatplg to "Object.Control.mixer.N.attribute_name" +## +## Usage: this component can be used by instantiating it in the parent object. i.e. +## +## Object.Control.mixer."N" { +## index 1 +## name "1 Master Playback Volume" +## max 32 +## Object.Base.channel.1 { +## name "fl" +## shift 0 +## reg 0 +## } +## Object.Base.channel.2 { +## name "fr" +## shift 1 +## reg 1 +## } +## Object.Base.ops."ctl" { +## info "volsw" +## get "258" +## put "258" +## } +## } +## +## The linked object instaces are \link channel \endlink and \link ops \endlink . +## +## Where N is the unique instance number for the buffer object within the same alsaconf node. +## The mixer control object should also include the ops, channels and tlv objects in the object +## instance <include/controls/common.conf> Class.Control."mixer" { - # - # Pipeline ID for the mixer object - # - DefineAttribute."index" {} + ## + ## @ Pipeline ID for the mixer object + ## + DefineAttribute."index" {} ##< Automatically given unique index # # Instance of mixer object in the same alsaconf node From 2e9589069a6c75abbbdf3b188d8304b7d5ecf955 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Fri, 1 Sep 2023 13:06:10 +0300 Subject: [PATCH 510/639] topology2: doc: volume-playback.conf: Doxygenify existing comments Doxygenify all comments that are correctly placed near the attribute's or objects C-translation. This is not the case for comments before Object.Base { } definition or comment before including pipeline-common.conf, which is inlined by the topology2 filter, does not end up in any relevant place, so its better just leave those comments as they are. They can anyway be read from topology2 source snippets. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../include/pipelines/volume-playback.conf | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/volume-playback.conf b/tools/topology/topology2/include/pipelines/volume-playback.conf index d04830b2168a..fa007609ab4c 100644 --- a/tools/topology/topology2/include/pipelines/volume-playback.conf +++ b/tools/topology/topology2/include/pipelines/volume-playback.conf @@ -1,24 +1,26 @@ -# -# Volume playback pipeline -# -# A simple pipeline. All attributes defined herein are namespaced by alsatplg to -# "Object.Pipeline.volume-playback.N.attribute_name" -# -# Usage: this component can be used by declaring in the top-level topology conf file as follows: -# -# Object.Pipeline.volume-playback."N" { -# format "s16le" -# period 1000 -# time_domain "timer" -# channels 2 -# rate 48000 -# } -# -# where N is the unique pipeline_id for this pipeline object within the same alsaconf node. -# -# -# (source) host.N.playback -> buffer.N.1 -> volume.N.1 -> buffer.N.2 (sink endpoint) -# +## \struct volume_playback +## \brief Volume playback pipeline +## +## \par Instantiating volume-playback pipeline +## +## A simple pipeline. All attributes defined herein are namespaced by alsatplg +## to "Object.Pipeline.volume-playback.N.attribute_name" +## +## Usage: this component can be used by declaring in the top-level topology conf file as follows: +## +## Object.Pipeline.volume-playback."N" { +## format "s16le" +## period 1000 +## time_domain "timer" +## channels 2 +## rate 48000 +## } +## +## where N is the unique pipeline_id for this pipeline object within the same alsaconf node. +## +## +## (source) host.N.playback -> buffer.N.1 -> volume.N.1 -> buffer.N.2 (sink endpoint) +## <include/common/route.conf> <include/components/buffer.conf> @@ -31,7 +33,7 @@ Class.Pipeline."volume-playback" { <include/pipelines/pipeline-common.conf> attributes { - # pipeline name is constructed as "volume-playback.1" + ## pipeline name is constructed as "volume-playback.1" !constructor [ "index" ] @@ -49,9 +51,11 @@ Class.Pipeline."volume-playback" { } Object.Widget { + ## The pipeline object for captured playback pipeline."1" {} host."playback" { + ## "aif_in" is for playback type "aif_in" } From c7f0e930f228f9a6a0585c7aaaac7586f93e5152 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Tue, 19 Sep 2023 12:32:18 +0300 Subject: [PATCH 511/639] topology2: doc: widget-common.conf: Attribute comments to Doxygen Change attribute comments to Doxygen comments. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../include/components/widget-common.conf | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/tools/topology/topology2/include/components/widget-common.conf b/tools/topology/topology2/include/components/widget-common.conf index af87e4e70f7d..3c398300ef89 100644 --- a/tools/topology/topology2/include/components/widget-common.conf +++ b/tools/topology/topology2/include/components/widget-common.conf @@ -2,12 +2,12 @@ # Common widget attribute definitions # -# instance of the widget object +## instance of the widget object DefineAttribute."instance" {} # -# no_pm - maps to the DAPM widget's reg field -# "false" value indicates that there is no direct DAPM for this widget +## no_pm - maps to the DAPM widget's reg field +## "false" value indicates that there is no direct DAPM for this widget # DefineAttribute."no_pm" { type "string" @@ -20,26 +20,26 @@ DefineAttribute."no_pm" { } # -# Widget Type - maps to the widget ID with values of type enum SND_SOC_TPLG_DAPM_* +## Widget Type - maps to the widget ID with values of type enum SND_SOC_TPLG_DAPM_* # DefineAttribute."type" { type "string" } # -# Stream name - maps to the DAPM widget's stream name +## Stream name - maps to the DAPM widget's stream name # DefineAttribute."stream_name" { type "string" } # -# Event type widget binds to +## Event type widget binds to # DefineAttribute.event_type {} # -# Widget event flags +## Widget event flags # DefineAttribute.event_flags {} @@ -47,7 +47,7 @@ DefineAttribute.event_flags {} # Attributes with a "token_ref" value will be added to widget's private data # -# widget format +## widget format DefineAttribute."format" { type "string" # Token set reference name and type @@ -62,49 +62,50 @@ DefineAttribute."format" { } } -# ID of the core this widget should be scheduled on +## ID of the core this widget should be scheduled on DefineAttribute."core_id" { # Token set reference name and type token_ref "comp.word" } -# number of periods to preload +## number of periods to preload DefineAttribute."preload_count" { # Token set reference name and type token_ref "comp.word" } -# Number of sink pins a widget can support +## Number of sink pins a widget can support DefineAttribute."num_input_pins" { # Token set reference name and type token_ref "comp.word" } -# Number of source pins a widget can support +## Number of source pins a widget can support DefineAttribute."num_output_pins" { # Token set reference name and type token_ref "comp.word" } -# Number of supported sink(input) audio formats +## Number of supported sink(input) audio formats DefineAttribute."num_input_audio_formats" { # Token set reference name and type token_ref "comp.word" } -# Number of supported source(output) audio formats +## Number of supported source(output) audio formats DefineAttribute."num_output_audio_formats" { # Token set reference name and type token_ref "comp.word" } -# Widget UUID +## Widget UUID DefineAttribute.uuid { type "string" # Token set reference name and type token_ref "comp.uuid" } +## Whether to add this widget's name to the beginning of all its associated mixer names DefineAttribute."no_wname_in_kcontrol_name" { type "string" # Token set reference name From 22ec5b381136ba70d2a487a94050c529b4003b10 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Tue, 26 Sep 2023 22:55:30 +0300 Subject: [PATCH 512/639] topology2: doc: audio_format.conf: Translate comments to Doxygen Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../include/common/audio_format.conf | 73 ++++++++++--------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/tools/topology/topology2/include/common/audio_format.conf b/tools/topology/topology2/include/common/audio_format.conf index 8ee2e6bed86c..d572f3c00085 100644 --- a/tools/topology/topology2/include/common/audio_format.conf +++ b/tools/topology/topology2/include/common/audio_format.conf @@ -1,43 +1,44 @@ -# Class definition for audio format object -# audio_format objects can be instantiated as: -# -# Object.Base.audio_format."0" { -# in_rate 48000 -# in_sample_container_size 16 -# in_valid_bit_depth 16 -# in_interleaving_style "interleaved" -# out_rate 48000 -# out_sample_container_size 16 -# out_valid_bit_depth 16 -# out_interleaving_style "interleaved" - -# } -# +## \struct audio_format +## \brief Class definition for audio format object +## +## audio_format objects can be instantiated as: +## +## Object.Base.audio_format."0" { +## in_rate 48000 +## in_sample_container_size 16 +## in_valid_bit_depth 16 +## in_interleaving_style "interleaved" +## out_rate 48000 +## out_sample_container_size 16 +## out_valid_bit_depth 16 +## out_interleaving_style "interleaved" +## } +## Class.Base."audio_format" { DefineAttribute."instance" { } - # input sampling rate + ## input sampling rate DefineAttribute."in_rate" { # Token set reference name token_ref "cavs_audio_format.word" } - # input bit depth + # #input bit depth DefineAttribute."in_bit_depth" { # Token set reference name token_ref "cavs_audio_format.word" } - # input valid bit depth + ## input valid bit depth DefineAttribute."in_valid_bit_depth" { # Token set reference name token_ref "cavs_audio_format.word" } - # input channel count + ## input channel count DefineAttribute."in_channels" { # Token set reference name token_ref "cavs_audio_format.word" @@ -47,19 +48,19 @@ Class.Base."audio_format" { } } - # input channel map + ## input channel map DefineAttribute."in_ch_map" { # Token set reference name token_ref "cavs_audio_format.word" } - # input channel config + ## input channel config DefineAttribute."in_ch_cfg" { # Token set reference name token_ref "cavs_audio_format.word" } - # input interleaving style + ## input interleaving style DefineAttribute."in_interleaving_style" { type "string" # Token set reference name @@ -76,19 +77,20 @@ Class.Base."audio_format" { } } - # input format config + ## input format config DefineAttribute."in_fmt_cfg" { # Token set reference name token_ref "cavs_audio_format.word" } - # output sampling rate + ## output sampling rate DefineAttribute."out_rate" { # Token set reference name token_ref "cavs_audio_format.word" } - # input sample_type + ## Input sample_type. + ## Valid values for sample type are defined in common_definitions.conf. DefineAttribute."in_sample_type" { type string # Token set reference name @@ -104,19 +106,19 @@ Class.Base."audio_format" { } } - # output bit depth + ## output bit depth DefineAttribute."out_bit_depth" { # Token set reference name token_ref "cavs_audio_format.word" } - # output valid bit depth + ## output valid bit depth DefineAttribute."out_valid_bit_depth" { # Token set reference name token_ref "cavs_audio_format.word" } - # output channel count + ## output channel count DefineAttribute."out_channels" { # Token set reference name token_ref "cavs_audio_format.word" @@ -126,19 +128,19 @@ Class.Base."audio_format" { } } - # output channel map + ## output channel map DefineAttribute."out_ch_map" { # Token set reference name token_ref "cavs_audio_format.word" } - # output channel config + ## output channel config DefineAttribute."out_ch_cfg" { # Token set reference name token_ref "cavs_audio_format.word" } - # output interleaving style + ## output interleaving style DefineAttribute."out_interleaving_style" { type "string" # Token set reference name @@ -155,14 +157,14 @@ Class.Base."audio_format" { } } - # output format config + ## output format config DefineAttribute."out_fmt_cfg" { # Token set reference name token_ref "cavs_audio_format.word" } # - # input buffer size + ## input buffer size # DefineAttribute."ibs" { # Token set reference name and type @@ -170,14 +172,15 @@ Class.Base."audio_format" { } # - # output buffer size + ## output buffer size # DefineAttribute."obs" { # Token set reference name and type token_ref "cavs_audio_format.word" } - #output sample_type + ## Output sample_type. + ## Valid values for sample type are defined in common_definitions.conf. DefineAttribute."out_sample_type" { type string # Token set reference name From a3e6cf7aac59aa48dcf4001b02990d5970fbf69a Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Tue, 26 Sep 2023 23:01:06 +0300 Subject: [PATCH 513/639] topology2: doc: data.conf: Change comments to Doxygen Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../topology/topology2/include/common/data.conf | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/topology/topology2/include/common/data.conf b/tools/topology/topology2/include/common/data.conf index 84655302224e..02900ee192a4 100644 --- a/tools/topology/topology2/include/common/data.conf +++ b/tools/topology/topology2/include/common/data.conf @@ -1,10 +1,12 @@ -# Class definition for data object -# Data objects can be instantiated as: -# -# Object.Base.data."SOF ABI" { -# bytes "0x3, 0x12,0x1" -# } -# +## \struct data +## \brief Class definition for data object +## +## Data objects can be instantiated as: +## +## Object.Base.data."SOF ABI" { +## bytes "0x3, 0x12,0x1" +## } +## Class.Base."data" { DefineAttribute."instance" {} From 215d7b3a07ec5b6f9718d2a4c4967c1b833bdfc2 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Tue, 26 Sep 2023 23:04:05 +0300 Subject: [PATCH 514/639] topology2: doc: fe_dai.conf: Change comments to Doxygen Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../topology2/include/common/fe_dai.conf | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/topology/topology2/include/common/fe_dai.conf b/tools/topology/topology2/include/common/fe_dai.conf index 8310c298c73b..e67d8aa4d22b 100644 --- a/tools/topology/topology2/include/common/fe_dai.conf +++ b/tools/topology/topology2/include/common/fe_dai.conf @@ -1,15 +1,17 @@ -# -# FE DAI Class definition. All attributes defined herein are namespaced -# by alsatplg to "Object.Base.fe_dai.instance.attribute_name". -# -# Usage: FE DAI objects can be instantiated as -# -# Object.Base.fe_dai.1 { -# id 0 -# } -# -# where NAME is the unique instance name for the FE DAI object within the -# same alsaconf node. +## \struct fe_dai +## \brief FE DAI Class definition +## +## All attributes defined herein are namespaced by alsatplg to +## "Object.Base.fe_dai.instance.attribute_name". +## +## Usage: FE DAI objects can be instantiated as +## +## Object.Base.fe_dai.1 { +## id 0 +## } +## +## where NAME is the unique instance name for the FE DAI object within the +## same alsaconf node. Class.Base."fe_dai" { From 649ac7d2d2b655c5eb37f5694b8eb6c70472881f Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Wed, 27 Sep 2023 18:56:55 +0300 Subject: [PATCH 515/639] topology2: doc: input_audio_format.conf: Translate comments to Doxygen Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- .../include/common/input_audio_format.conf | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/tools/topology/topology2/include/common/input_audio_format.conf b/tools/topology/topology2/include/common/input_audio_format.conf index f5b9956d841b..795f3cdb46b0 100644 --- a/tools/topology/topology2/include/common/input_audio_format.conf +++ b/tools/topology/topology2/include/common/input_audio_format.conf @@ -1,14 +1,16 @@ -# Class definition for input pin audio format object -# audio_format objects can be instantiated as: -# -# Object.Base.input_audio_format."0" { -# in_rate 48000 -# in_sample_container_size 16 -# in_valid_bit_depth 16 -# in_interleaving_style "interleaved" - -# } -# +## \struct input_audio_format +## \brief Volume playback pipeline +## +## Class definition for input pin audio format object +## audio_format objects can be instantiated as: +## +## Object.Base.input_audio_format."0" { +## in_rate 48000 +## in_sample_container_size 16 +## in_valid_bit_depth 16 +## in_interleaving_style "interleaved" +## } +## Class.Base."input_audio_format" { @@ -20,25 +22,25 @@ Class.Base."input_audio_format" { token_ref "cavs_audio_format.word" } - # input sampling rate + ## input sampling rate DefineAttribute."in_rate" { # Token set reference name token_ref "cavs_audio_format.word" } - # input bit depth + ## input bit depth DefineAttribute."in_bit_depth" { # Token set reference name token_ref "cavs_audio_format.word" } - # input valid bit depth + ## input valid bit depth DefineAttribute."in_valid_bit_depth" { # Token set reference name token_ref "cavs_audio_format.word" } - # input channel count + ## input channel count DefineAttribute."in_channels" { # Token set reference name token_ref "cavs_audio_format.word" @@ -48,19 +50,19 @@ Class.Base."input_audio_format" { } } - # input channel map + ## input channel map DefineAttribute."in_ch_map" { # Token set reference name token_ref "cavs_audio_format.word" } - # input channel config + ## input channel config DefineAttribute."in_ch_cfg" { # Token set reference name token_ref "cavs_audio_format.word" } - # input interleaving style + ## input interleaving style DefineAttribute."in_interleaving_style" { type "string" # Token set reference name @@ -77,13 +79,14 @@ Class.Base."input_audio_format" { } } - # input format config + ## input format config DefineAttribute."in_fmt_cfg" { # Token set reference name token_ref "cavs_audio_format.word" } - # input sample_type + ## Input sample_type. + ## Valid values for sample type are defined in common_definitions.conf. DefineAttribute."in_sample_type" { type string # Token set reference name @@ -100,7 +103,7 @@ Class.Base."input_audio_format" { } # - # input buffer size + ## input buffer size # DefineAttribute."ibs" { # Token set reference name and type From c1996e01e1c479748831f9e99a550908b7766b96 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Fri, 29 Sep 2023 18:03:05 +0300 Subject: [PATCH 516/639] topology2: doc: Little fixes to make all classes show correctly There were couple of classes that did not have their topology2 snippets showing. Probably the essential problem was just the class definition starting from the first line of the file. There was nothing obviously wrong in the output of the filter, but the way the doxygen works is sometimes hard to anticipate. Adding \struct before the definition fixed the problem. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- tools/topology/topology2/include/dais/mic_extension.conf | 3 +++ tools/topology/topology2/include/dais/pdm_config.conf | 3 +++ tools/topology/topology2/platform/intel/ssp_aux_config.conf | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tools/topology/topology2/include/dais/mic_extension.conf b/tools/topology/topology2/include/dais/mic_extension.conf index 6dc12a1f21b2..31628e9b2241 100644 --- a/tools/topology/topology2/include/dais/mic_extension.conf +++ b/tools/topology/topology2/include/dais/mic_extension.conf @@ -1,3 +1,6 @@ +## \brief Mic extension class +## \struct mic_extension + Class.Base."mic_extension" { DefineAttribute."id" {} diff --git a/tools/topology/topology2/include/dais/pdm_config.conf b/tools/topology/topology2/include/dais/pdm_config.conf index 2a8759a7742c..3745bea7998e 100644 --- a/tools/topology/topology2/include/dais/pdm_config.conf +++ b/tools/topology/topology2/include/dais/pdm_config.conf @@ -1,3 +1,6 @@ +## \brief Class for PDM config +## \struct pdm_config + Class.Base."pdm_config" { DefineAttribute."instance" {} # diff --git a/tools/topology/topology2/platform/intel/ssp_aux_config.conf b/tools/topology/topology2/platform/intel/ssp_aux_config.conf index 1a814edef07e..c084faa4195c 100644 --- a/tools/topology/topology2/platform/intel/ssp_aux_config.conf +++ b/tools/topology/topology2/platform/intel/ssp_aux_config.conf @@ -1,3 +1,5 @@ +## \struct mn_config + Class.Base."mn_config" { DefineAttribute."id" {} From 99206de401e6c42ae1d07b61b0e2028ea24a74a8 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 5 Oct 2023 10:45:29 -0700 Subject: [PATCH 517/639] Clean just inherited tools/rimage/.gitmodules file (for tomlc99) .gitmodules files have no effect unless they're at the top-level. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/.gitmodules | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 tools/rimage/.gitmodules diff --git a/tools/rimage/.gitmodules b/tools/rimage/.gitmodules deleted file mode 100644 index 5ade8be2a063..000000000000 --- a/tools/rimage/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "tomlc99"] - path = tomlc99 - url = https://github.com/thesofproject/tomlc99.git - branch = master From 9b31875318a2640d1047f26976fe402b0bb68388 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 18:05:23 -0700 Subject: [PATCH 518/639] Add new sof/tools/rimage/tomlc99 submodule to west.yml too Add it both as a git submodule and west submodule to minimize disruption. The current focus is on rimage and that's a dramatic enough change; one problem at at time. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- west.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e90e99d134bc..edc522eab8c0 100644 --- a/west.yml +++ b/west.yml @@ -38,11 +38,20 @@ manifest: path: sof/rimage revision: ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a - - name: tomlc99 + # To be removed in the next commits + - name: tomlc99-old-location repo-path: tomlc99 path: sof/rimage/tomlc99 revision: e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 + # West convenience for Zephyr people who forgot --recursive when + # cloning sof.git. This adds the burden of keeping both tomlc99 + # SHA1s synchronized but in practice it barely ever moves. + - name: tomlc99 + repo-path: tomlc99 + path: sof/tools/rimage/tomlc99 + revision: e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 + - name: zephyr repo-path: zephyr revision: 8c4eec7ac6e37be89af89e021c6f5c96e1ac1e0a From f55338a985acf0d54aaa1c93a784217492291ea1 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 3 Oct 2023 16:38:36 -0700 Subject: [PATCH 519/639] Switch Zephyr build to new sof/tools/rimage location Switch away from the independent rimage submodule. Long story in https://github.com/thesofproject/sof/issues/8178 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- scripts/xtensa-build-zephyr.py | 15 ++++++--------- zephyr/CMakeLists.txt | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/xtensa-build-zephyr.py b/scripts/xtensa-build-zephyr.py index 5f8cdd5ce361..0d8e28921c3d 100755 --- a/scripts/xtensa-build-zephyr.py +++ b/scripts/xtensa-build-zephyr.py @@ -512,7 +512,7 @@ def clean_staging(platform): # for now we must stick to `sof/rimage/[tomlc99]` for # backwards-compatibility with XTOS platforms and git submodules, see more # detailed comments in west.yml -RIMAGE_SOURCE_DIR = west_top / "sof" / "rimage" +RIMAGE_SOURCE_DIR = west_top / "sof" / "tools" / "rimage" def rimage_west_configuration(platform_dict, dest_dir): @@ -563,14 +563,11 @@ def rimage_west_configuration(platform_dict, dest_dir): def build_rimage(): - # Detect non-west rimage duplicates, example: git submdule - # SOF_TOP/rimage = sof2/rimage - nested_rimage = pathlib.Path(SOF_TOP, "rimage") - if nested_rimage.is_dir() and not nested_rimage.samefile(RIMAGE_SOURCE_DIR): - raise RuntimeError( - f"""Two rimage source directories found. - Move non-west {nested_rimage} out of west workspace {west_top}. - See output of 'west list'.""" + old_rimage_loc = SOF_TOP / "rimage" + # Don't warn on empty directories + if ( old_rimage_loc / "CMakeLists.txt" ).exists(): + warnings.warn(f"""{old_rimage_loc} is now ignored, + new location is {RIMAGE_SOURCE_DIR}""" ) rimage_dir_name = RIMAGE_BUILD_DIR.name # CMake build rimage module diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index a618f966eee6..a087b216217d 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -58,7 +58,7 @@ set(SOF_IPC_PATH "${SOF_SRC_PATH}/ipc") set(SOF_DEBUG_PATH "${SOF_SRC_PATH}/debug") set(SOF_MATH_PATH "${SOF_SRC_PATH}/math") set(SOF_TRACE_PATH "${SOF_SRC_PATH}/trace") -set(RIMAGE_TOP ${sof_top_dir}/rimage) +set(RIMAGE_TOP ${sof_top_dir}/tools/rimage) # Save path to rimage configuration files in cmake cache for later use by # rimage during the "west sign" stage From 157457c1273927976212590804e0acb6659d6bd1 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 3 Oct 2023 17:36:55 -0700 Subject: [PATCH 520/639] Switch smex and sof-logger to new sof/tools/rimage location Switch away from the independent rimage submodule. Long story in https://github.com/thesofproject/sof/issues/8178 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- smex/CMakeLists.txt | 2 +- tools/logger/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smex/CMakeLists.txt b/smex/CMakeLists.txt index 5d198832f472..23eeb3a775f3 100644 --- a/smex/CMakeLists.txt +++ b/smex/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_options(smex PRIVATE target_include_directories(smex PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" - "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include" + "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include" ) # TODO: smex should not need RTOS headers: FIX. diff --git a/tools/logger/CMakeLists.txt b/tools/logger/CMakeLists.txt index 0c7b2d8d914b..271f54e559c9 100644 --- a/tools/logger/CMakeLists.txt +++ b/tools/logger/CMakeLists.txt @@ -35,7 +35,7 @@ target_compile_options(sof-logger PRIVATE target_include_directories(sof-logger PRIVATE "${SOF_ROOT_SOURCE_DIRECTORY}/src/include" - "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/src/include" + "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/src/include" "${SOF_ROOT_SOURCE_DIRECTORY}" ) From 98ee39f44cad36e582d53d50babb5890f5802196 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Tue, 3 Oct 2023 16:38:36 -0700 Subject: [PATCH 521/639] cmake: switch XTOS build to sof/tools/rimage Switch away from the independent rimage submodule. Long story in https://github.com/thesofproject/sof/issues/8178 and others. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- CMakeLists.txt | 2 +- scripts/cmake/git-submodules.cmake | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c7b0ddd8ddd2..075d1a33c636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ project(SOF C ASM) set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}") set(SOF_ROOT_BINARY_DIRECTORY "${PROJECT_BINARY_DIR}") -set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/rimage") +set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/tools/rimage") # check git hooks include(scripts/cmake/git-hooks.cmake) diff --git a/scripts/cmake/git-submodules.cmake b/scripts/cmake/git-submodules.cmake index 5b486e4af87c..56c559491b90 100644 --- a/scripts/cmake/git-submodules.cmake +++ b/scripts/cmake/git-submodules.cmake @@ -1,11 +1,17 @@ # SPDX-License-Identifier: BSD-3-Clause -find_package(Git) -set(RIMAGE_CMAKE "${SOF_ROOT_SOURCE_DIRECTORY}/rimage/CMakeLists.txt") +set(RIMAGE_SUBMODULE "${SOF_ROOT_SOURCE_DIRECTORY}/rimage") +if(EXISTS "${RIMAGE_SUBMODULE}/CMakeLists.txt") + message(WARNING + "${RIMAGE_SUBMODULE} is deprecated and ignored" + ) +endif() +find_package(Git) +set(TOMLC99_MAKE "${SOF_ROOT_SOURCE_DIRECTORY}/tools/rimage/tomlc99/Makefile") if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git") - if(EXISTS "${RIMAGE_CMAKE}") + if(EXISTS "${TOMLC99_MAKE}") # As incredible as it sounds, some people run neither # "git status" nor "git diff" every few minutes and not @@ -36,10 +42,10 @@ if(GIT_FOUND AND EXISTS "${SOF_ROOT_SOURCE_DIRECTORY}/.git") NOT CONFIG_LIBRARY) message(FATAL_ERROR -"${RIMAGE_CMAKE} not found. You should have used 'git clone --recursive'. \ +"${TOMLC99_MAKE} not found. You should have used 'git clone --recursive'. \ To fix this existing git clone run: -git submodule update --init --merge --recursive +git submodule update --init --merge tools/rimage/tomlc99 ") - endif() # rimage/CMakeLists.txt + endif() # tomlc99/Makefile endif() # .git/ From e330fb4ec727c3a060ad6b1fb6e8c21a4afe7357 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 4 Oct 2023 18:05:23 -0700 Subject: [PATCH 522/639] Delete old rimage submodule and old rimage west module Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .gitmodules | 22 ---------------------- rimage | 1 - west.yml | 11 ----------- 3 files changed, 34 deletions(-) delete mode 160000 rimage diff --git a/.gitmodules b/.gitmodules index 62ccbac18f36..99bed093e833 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,25 +1,3 @@ - -# Old, independent rimage submodule. To be removed. -[submodule "rimage"] - path = rimage -# This is a _relative_ submodule URL. In some use cases it's better than -# an _absolute_ submodule URL, in other cases it's not. One size does -# unfortunately not fit all. -# -# Among other pages, http://blog.tremily.us/posts/Relative_submodules/ -# has a good comparison -# -# If you use Zephyr you must also look at the comments in sof/west.yml. -# -# If you want to fork or mirror sof.git _without_ doing the same for -# rimage.git then your automation may want you to change and git commit -# an absolute URL in your branch. No need to git commit for interactive -# use; a local and temporary edit of this file is enough for interactive -# use because .gitmodules is used only once to --init[ialize] -# .git/config the first time. Then .gitmodules is never used again after -# cloning. - url = ../rimage - # This is required for non-Zephyr ("XTOS") configurations. Zephyr # configs also get it from sof/west.yml which adds the burden of keeping # both tomlc99 SHA1s synchronized but in practice this barely ever moves. diff --git a/rimage b/rimage deleted file mode 160000 index ac487e09ca5b..000000000000 --- a/rimage +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a diff --git a/west.yml b/west.yml index edc522eab8c0..876ae1b41df5 100644 --- a/west.yml +++ b/west.yml @@ -33,17 +33,6 @@ manifest: # https://github.com/zephyrproject-rtos/zephyr/issues/58212 projects: - - name: rimage - repo-path: rimage - path: sof/rimage - revision: ac487e09ca5bb34a2eebd2f3d1cfeb9e792c501a - - # To be removed in the next commits - - name: tomlc99-old-location - repo-path: tomlc99 - path: sof/rimage/tomlc99 - revision: e3a03f5ec7d8d33be705c5ce8a632d998ce9b4d1 - # West convenience for Zephyr people who forgot --recursive when # cloning sof.git. This adds the burden of keeping both tomlc99 # SHA1s synchronized but in practice it barely ever moves. From da08c1a6b162d26f7017ebddf03cc3af5a9732cc Mon Sep 17 00:00:00 2001 From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> Date: Fri, 6 Oct 2023 17:34:31 +0300 Subject: [PATCH 523/639] west.yml: Bump up Zephyr revision This commit bumps up the Zephyr revision to contain the fix for the i.MX93 CI build failure. Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com> --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index e90e99d134bc..b4d8ae367431 100644 --- a/west.yml +++ b/west.yml @@ -45,7 +45,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 8c4eec7ac6e37be89af89e021c6f5c96e1ac1e0a + revision: 3563347b108a8fe323595060576572fccdb81be6 remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision From 3e368fefeeddcb3533ccd6b81d074f9fee954ead Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 10:59:56 +0300 Subject: [PATCH 524/639] IPC4: Add header to support user space ALSA notifications This patch adds struct sof_ipc4_notify_module_data that matches the Linux kernel handler for notifications from firmware to ALSA user space. The SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL event_id is used to identify the notifications for ALSA controls like switch and enum. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/include/ipc4/header.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/include/ipc4/header.h b/src/include/ipc4/header.h index 5aaa361283bc..5abef50342b0 100644 --- a/src/include/ipc4/header.h +++ b/src/include/ipc4/header.h @@ -173,6 +173,7 @@ struct ipc4_message_reply { #define SOF_IPC4_SWITCH_CONTROL_PARAM_ID 200 #define SOF_IPC4_ENUM_CONTROL_PARAM_ID 201 +#define SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL ((uint32_t)(0xA15A << 16)) /** * struct sof_ipc4_ctrl_value_chan: generic channel mapped value data @@ -198,4 +199,20 @@ struct sof_ipc4_control_msg_payload { struct sof_ipc4_ctrl_value_chan chanv[]; } __attribute((packed, aligned(4))); +/** + * struct sof_ipc4_notify_module_data - payload for module notification + * @instance_id: instance ID of the originator module of the notification + * @module_id: module ID of the originator of the notification + * @event_id: module specific event id + * @event_data_size: Size of the @event_data (if any) in bytes + * @event_data: Optional notification data, module and notification dependent + */ +struct sof_ipc4_notify_module_data { + uint16_t instance_id; + uint16_t module_id; + uint32_t event_id; + uint32_t event_data_size; + uint8_t event_data[]; +} __attribute((packed, aligned(4))); + #endif From a8ee62a15c12c1db5519e96c4f3cb88b0b5ddca4 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 11:25:16 +0300 Subject: [PATCH 525/639] Audio: TDFB: Update component for IPC4 This patch updates the Time domain fixed beamformer (TDFB) module prepare() to set in tdfb_params() IPC4 sink and source parameters from initialization IPC. The notifications send to user space for sound direction of arrival is updated to work with IPC4 ALSA notifications. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/tdfb/tdfb.c | 175 ++++++++++++++++++++++++- src/include/sof/audio/tdfb/tdfb_comp.h | 12 ++ 2 files changed, 183 insertions(+), 4 deletions(-) diff --git a/src/audio/tdfb/tdfb.c b/src/audio/tdfb/tdfb.c index 7aaee17958d5..38ff7ee240d8 100644 --- a/src/audio/tdfb/tdfb.c +++ b/src/audio/tdfb/tdfb.c @@ -40,6 +40,12 @@ #include <stddef.h> #include <stdint.h> +#if CONFIG_IPC_MAJOR_4 +#include <ipc4/header.h> +#include <ipc4/module.h> +#include <ipc4/notification.h> +#endif + /* The driver assigns running numbers for control index. If there's single control of * type switch, enum, binary they all have index 0. */ @@ -57,10 +63,60 @@ DECLARE_SOF_RT_UUID("tdfb", tdfb_uuid, 0xdd511749, 0xd9fa, 0x455c, 0xb3, 0xa7, DECLARE_TR_CTX(tdfb_tr, SOF_UUID(tdfb_uuid), LOG_LEVEL_INFO); -/* IPC */ +/* IPC helpers for control update to user space */ -/* TODO: ALSA control update to user space need to be moved to module adapter */ +#if CONFIG_IPC_MAJOR_4 +static struct ipc_msg *tdfb_notification_init(struct processing_module *mod, + uint32_t control_type_param_id, + uint32_t control_id) +{ + struct ipc_msg msg_proto; + struct comp_dev *dev = mod->dev; + struct comp_ipc_config *ipc_config = &dev->ipc_config; + union ipc4_notification_header *primary = + (union ipc4_notification_header *)&msg_proto.header; + struct ipc_msg *msg; + struct tdfb_notification_payload *payload; + + /* Clear header, extension, and other ipc_msg members */ + memset_s(&msg_proto, sizeof(msg_proto), 0, sizeof(msg_proto)); + primary->r.notif_type = SOF_IPC4_MODULE_NOTIFICATION; + primary->r.type = SOF_IPC4_GLB_NOTIFICATION; + primary->r.rsp = SOF_IPC4_MESSAGE_DIR_MSG_REQUEST; + primary->r.msg_tgt = SOF_IPC4_MESSAGE_TARGET_FW_GEN_MSG; + msg = ipc_msg_w_ext_init(msg_proto.header, msg_proto.extension, + sizeof(struct tdfb_notification_payload)); + if (!msg) + return NULL; + + payload = (struct tdfb_notification_payload *)msg->tx_data; + payload->module_data.instance_id = IPC4_INST_ID(ipc_config->id); + payload->module_data.module_id = IPC4_MOD_ID(ipc_config->id); + payload->module_data.event_id = SOF_IPC4_NOTIFY_MODULE_EVENTID_ALSA_MAGIC_VAL | + control_type_param_id; + payload->module_data.event_data_size = sizeof(struct sof_ipc4_control_msg_payload) + + sizeof(struct sof_ipc4_ctrl_value_chan); + payload->control_msg.id = control_id; + payload->control_msg.num_elems = 1; + payload->control_value.channel = 0; + + comp_dbg(dev, "instance_id = 0x%08x, module_id = 0x%08x", + payload->module_data.instance_id, payload->module_data.module_id); + return msg; +} + +static void tdfb_send_notification(struct ipc_msg *msg, uint32_t val) +{ + struct tdfb_notification_payload *ipc_payload; + + ipc_payload = (struct tdfb_notification_payload *)msg->tx_data; + ipc_payload->control_value.value = val; + ipc_msg_send(msg, NULL, false); +} +/* end CONFIG_IPC_MAJOR_4 */ + +#elif CONFIG_IPC_MAJOR_3 static int init_get_ctl_ipc(struct processing_module *mod) { struct tdfb_comp_data *cd = module_get_private_data(mod); @@ -94,6 +150,7 @@ static void send_get_ctl_ipc(struct processing_module *mod) ipc_msg_send(cd->msg, cd->ctrl_data, false); } +#endif /* CONFIG_IPC_MAJOR_3 */ /* * The optimized FIR functions variants need to be updated into function @@ -447,9 +504,19 @@ static int tdfb_init(struct processing_module *mod) */ /* Initialize IPC for direction of arrival estimate update */ +#if CONFIG_IPC_MAJOR_4 + cd->msg = tdfb_notification_init(mod, SOF_IPC4_ENUM_CONTROL_PARAM_ID, + CTRL_INDEX_AZIMUTH_ESTIMATE); + if (!cd->msg) { + comp_err(dev, "Failed to initialize control notification."); + ret = -EINVAL; + goto err_free_cd; + } +#elif CONFIG_IPC_MAJOR_3 ret = init_get_ctl_ipc(mod); if (ret) goto err_free_cd; +#endif /* Handler for configuration data */ cd->model_handler = comp_data_blob_handler_new(dev); @@ -476,7 +543,9 @@ static int tdfb_init(struct processing_module *mod) return 0; err: + /* These are null if not used for IPC version */ rfree(cd->ctrl_data); + ipc_msg_free(cd->msg); err_free_cd: rfree(cd); @@ -503,6 +572,7 @@ static int tdfb_free(struct processing_module *mod) * Module commands handling */ +#if CONFIG_IPC_MAJOR_3 static int tdfb_cmd_switch_get(struct sof_ipc_ctrl_data *cdata, struct tdfb_comp_data *cd) { int j; @@ -557,11 +627,16 @@ static int tdfb_cmd_get_value(struct processing_module *mod, struct sof_ipc_ctrl comp_err(mod->dev, "tdfb_cmd_get_value() error: invalid cdata->cmd"); return -EINVAL; } +#endif /* CONFIG_IPC_MAJOR_3 */ static int tdfb_get_config(struct processing_module *mod, - uint32_t config_id, uint32_t *data_offset_size, + uint32_t param_id, uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size) { +#if CONFIG_IPC_MAJOR_4 + comp_err(mod->dev, "tdfb_get_config(), Not supported, should not happen"); + return -EINVAL; +#elif CONFIG_IPC_MAJOR_3 struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; struct tdfb_comp_data *cd = module_get_private_data(mod); @@ -570,8 +645,10 @@ static int tdfb_get_config(struct processing_module *mod, comp_dbg(mod->dev, "tdfb_get_config(), binary"); return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size); +#endif /* CONFIG_IPC_MAJOR_3 */ } +#if CONFIG_IPC_MAJOR_3 static int tdfb_cmd_enum_set(struct sof_ipc_ctrl_data *cdata, struct tdfb_comp_data *cd) { if (cdata->num_elems != 1) @@ -634,16 +711,80 @@ static int tdfb_cmd_set_value(struct processing_module *mod, struct sof_ipc_ctrl return -EINVAL; } -static int tdfb_set_config(struct processing_module *mod, uint32_t config_id, +/* end CONFIG_IPC_MAJOR_3 */ + +#elif CONFIG_IPC_MAJOR_4 +static int tdfb_cmd_enum_set(struct sof_ipc4_control_msg_payload *ctl, struct tdfb_comp_data *cd) +{ + if (ctl->num_elems != 1) + return -EINVAL; + + if (ctl->chanv[0].value > SOF_TDFB_MAX_ANGLES) + return -EINVAL; + + switch (ctl->id) { + case CTRL_INDEX_AZIMUTH: + cd->az_value = ctl->chanv[0].value; + cd->update = true; + break; + case CTRL_INDEX_AZIMUTH_ESTIMATE: + cd->az_value_estimate = ctl->chanv[0].value; + break; + default: + return -EINVAL; + } + + return 0; +} + +static int tdfb_cmd_switch_set(struct sof_ipc4_control_msg_payload *ctl, struct tdfb_comp_data *cd) +{ + if (ctl->num_elems != 1) + return -EINVAL; + + switch (ctl->id) { + case CTRL_INDEX_PROCESS: + cd->beam_on = ctl->chanv[0].value; + cd->update = true; + break; + case CTRL_INDEX_DIRECTION: + cd->direction_updates = ctl->chanv[0].value; + break; + default: + return -EINVAL; + } + + return 0; +} +#endif + +static int tdfb_set_config(struct processing_module *mod, uint32_t param_id, enum module_cfg_fragment_position pos, uint32_t data_offset_size, const uint8_t *fragment, size_t fragment_size, uint8_t *response, size_t response_size) { struct tdfb_comp_data *cd = module_get_private_data(mod); + +#if CONFIG_IPC_MAJOR_4 + struct sof_ipc4_control_msg_payload *ctl = (struct sof_ipc4_control_msg_payload *)fragment; + + switch (param_id) { + case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: + comp_info(mod->dev, "SOF_IPC4_SWITCH_CONTROL_PARAM_ID id = %d, num_elems = %d", + ctl->id, ctl->num_elems); + return tdfb_cmd_switch_set(ctl, cd); + + case SOF_IPC4_ENUM_CONTROL_PARAM_ID: + comp_info(mod->dev, "SOF_IPC4_ENUM_CONTROL_PARAM_ID id = %d, num_elems = %d", + ctl->id, ctl->num_elems); + return tdfb_cmd_enum_set(ctl, cd); + } +#elif CONFIG_IPC_MAJOR_3 struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; if (cdata->cmd != SOF_CTRL_CMD_BINARY) return tdfb_cmd_set_value(mod, cdata); +#endif /* CONFIG_IPC_MAJOR_3 */ comp_dbg(mod->dev, "tdfb_set_config(), binary"); return comp_data_blob_set(cd->model_handler, pos, data_offset_size, @@ -705,7 +846,11 @@ static int tdfb_process(struct processing_module *mod, (int32_t)(cd->direction.level_ambient >> 32), cd->direction.az_slow); if (cd->direction_updates && cd->direction_change) { +#if CONFIG_IPC_MAJOR_3 send_get_ctl_ipc(mod); +#elif CONFIG_IPC_MAJOR_4 + tdfb_send_notification(cd->msg, cd->az_value_estimate); +#endif cd->direction_change = false; comp_dbg(dev, "tdfb_dupd %d %d", cd->az_value_estimate, cd->direction.az_slow); @@ -725,6 +870,24 @@ static void tdfb_set_alignment(struct audio_stream *source, audio_stream_init_alignment_constants(byte_align, frame_align_req, sink); } +#if CONFIG_IPC_MAJOR_4 +static void tdfb_params(struct processing_module *mod) +{ + struct sof_ipc_stream_params *params = mod->stream_params; + struct comp_buffer *sinkb, *sourceb; + struct comp_dev *dev = mod->dev; + + ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); + component_set_nearest_period_frames(dev, params->rate); + + sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); + ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); + + sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); +} +#endif + static int tdfb_prepare(struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) @@ -740,6 +903,10 @@ static int tdfb_prepare(struct processing_module *mod, comp_info(dev, "tdfb_prepare()"); +#if CONFIG_IPC_MAJOR_4 + tdfb_params(mod); +#endif + /* Find source and sink buffers */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); diff --git a/src/include/sof/audio/tdfb/tdfb_comp.h b/src/include/sof/audio/tdfb/tdfb_comp.h index ce48760e22a6..bd229c80f211 100644 --- a/src/include/sof/audio/tdfb/tdfb_comp.h +++ b/src/include/sof/audio/tdfb/tdfb_comp.h @@ -17,6 +17,10 @@ #include <sof/platform.h> #include <user/tdfb.h> +#if CONFIG_IPC_MAJOR_4 +#include <ipc4/header.h> +#endif + /* Select optimized code variant when xt-xcc compiler is used */ #if defined __XCC__ #include <xtensa/config/core-isa.h> @@ -110,6 +114,14 @@ struct tdfb_comp_data { int frames); }; +#if CONFIG_IPC_MAJOR_4 +struct tdfb_notification_payload { + struct sof_ipc4_notify_module_data module_data; + struct sof_ipc4_control_msg_payload control_msg; + struct sof_ipc4_ctrl_value_chan control_value; /* One channel value */ +}; +#endif + #if CONFIG_FORMAT_S16LE void tdfb_fir_s16(struct tdfb_comp_data *cd, struct input_stream_buffer *bsource, From 48616b20925b6eeed786d8ad1ca892055df32132 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Mon, 4 Sep 2023 14:37:31 +0800 Subject: [PATCH 526/639] audio: module adapter: create ipc3 and ipc4 specific source file create ipc3 and ipc4 specific source file, these files will only be used to store specific code accordingly. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/module_adapter/CMakeLists.txt | 6 +- src/audio/module_adapter/module/generic.c | 11 + src/audio/module_adapter/module_adapter.c | 330 +----------------- .../module_adapter/module_adapter_ipc3.c | 161 +++++++++ .../module_adapter/module_adapter_ipc4.c | 226 ++++++++++++ .../sof/audio/module_adapter/module/generic.h | 117 +++++-- test/cmocka/src/audio/eq_fir/CMakeLists.txt | 1 + test/cmocka/src/audio/eq_iir/CMakeLists.txt | 1 + test/cmocka/src/audio/mixer/CMakeLists.txt | 1 + test/cmocka/src/audio/mux/CMakeLists.txt | 1 + test/cmocka/src/audio/volume/CMakeLists.txt | 1 + zephyr/CMakeLists.txt | 9 + 12 files changed, 521 insertions(+), 344 deletions(-) create mode 100644 src/audio/module_adapter/module_adapter_ipc3.c create mode 100644 src/audio/module_adapter/module_adapter_ipc4.c diff --git a/src/audio/module_adapter/CMakeLists.txt b/src/audio/module_adapter/CMakeLists.txt index c49ea576ef0d..72dc1492b3ff 100644 --- a/src/audio/module_adapter/CMakeLists.txt +++ b/src/audio/module_adapter/CMakeLists.txt @@ -1,7 +1,11 @@ # SPDX-License-Identifier: BSD-3-Clause -add_local_sources(sof module_adapter.c module/generic.c) +if(CONFIG_IPC_MAJOR_3) + add_local_sources(sof module_adapter.c module_adapter_ipc3.c module/generic.c) +elseif(CONFIG_IPC_MAJOR_4) + add_local_sources(sof module_adapter.c module_adapter_ipc4.c module/generic.c) +endif() if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD) if(CONFIG_CADENCE_CODEC) diff --git a/src/audio/module_adapter/module/generic.c b/src/audio/module_adapter/module/generic.c index f43a776de136..3cba00e5b7bc 100644 --- a/src/audio/module_adapter/module/generic.c +++ b/src/audio/module_adapter/module/generic.c @@ -519,3 +519,14 @@ int module_unbind(struct processing_module *mod, void *data) return md->ops->unbind(mod, data); return 0; } + +void module_update_buffer_position(struct input_stream_buffer *input_buffers, + struct output_stream_buffer *output_buffers, + uint32_t frames) +{ + struct audio_stream *source = input_buffers->data; + struct audio_stream *sink = output_buffers->data; + + input_buffers->consumed += audio_stream_frame_bytes(source) * frames; + output_buffers->size += audio_stream_frame_bytes(sink) * frames; +} diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index ff6b9e8e086a..e7e4619ad840 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -28,19 +28,6 @@ LOG_MODULE_REGISTER(module_adapter, CONFIG_SOF_LOG_LEVEL); -/* - * helpers to determine processing type - * Needed till all the modules use PROCESSING_MODE_SINK_SOURCE - */ -#define IS_PROCESSING_MODE_AUDIO_STREAM(mod) \ - (!!((struct module_data *)&(mod)->priv)->ops->process_audio_stream) - -#define IS_PROCESSING_MODE_RAW_DATA(mod) \ - (!!((struct module_data *)&(mod)->priv)->ops->process_raw_data) - -#define IS_PROCESSING_MODE_SINK_SOURCE(mod) \ - (!!((struct module_data *)&(mod)->priv)->ops->process) - /* * \brief Create a module adapter component. * \param[in] drv - component driver pointer. @@ -95,62 +82,12 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, comp_set_drvdata(dev, mod); list_init(&mod->sink_buffer_list); -#if CONFIG_IPC_MAJOR_3 - const unsigned char *data; - uint32_t size; - - switch (config->type) { - case SOF_COMP_VOLUME: - { - const struct ipc_config_volume *ipc_volume = spec; - - size = sizeof(*ipc_volume); - data = spec; - break; - } - case SOF_COMP_SRC: - { - const struct ipc_config_src *ipc_src = spec; - - size = sizeof(*ipc_src); - data = spec; - break; - } - default: - { - const struct ipc_config_process *ipc_module_adapter = spec; - - size = ipc_module_adapter->size; - data = ipc_module_adapter->data; - break; - } - } - - /* Copy initial config */ - if (size) { - ret = module_load_config(dev, data, size); - if (ret) { - comp_err(dev, "module_adapter_new() error %d: config loading has failed.", - ret); - goto err; - } - dst->init_data = dst->data; - } else { + ret = module_adapter_init_data(dev, dst, config, spec); + if (ret) { + comp_err(dev, "module_adapter_new() %d: module init data failed", + ret); goto err; } -#else - if (drv->type == SOF_COMP_MODULE_ADAPTER) { - const struct ipc_config_process *ipc_module_adapter = spec; - - dst->init_data = ipc_module_adapter->data; - dst->size = ipc_module_adapter->size; - dst->avail = true; - - memcpy(&dst->base_cfg, ipc_module_adapter->data, sizeof(dst->base_cfg)); - } else { - dst->init_data = spec; - } -#endif /* Modules must modify them if they support more than 1 source/sink */ mod->max_sources = 1; @@ -170,9 +107,8 @@ struct comp_dev *module_adapter_new(const struct comp_driver *drv, pipeline_comp_dp_task_init(dev); #endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ -#if CONFIG_IPC_MAJOR_4 - dst->init_data = NULL; -#endif + module_adapter_reset_data(dst); + dev->state = COMP_STATE_READY; comp_dbg(dev, "module_adapter_new() done"); @@ -461,18 +397,7 @@ int module_adapter_prepare(struct comp_dev *dev) return -EINVAL; } -#if CONFIG_IPC_MAJOR_3 - /* Check if audio stream client has only one source and one sink buffer to use a - * simplified copy function. - */ - if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->num_of_sources == 1 && - mod->num_of_sinks == 1) { - mod->source_comp_buffer = list_first_item(&dev->bsource_list, - struct comp_buffer, sink_list); - mod->sink_comp_buffer = sink; - mod->stream_copy_single_to_single = true; - } -#endif + module_adapter_check_data(mod, dev, sink); /* allocate memory for input buffers */ if (mod->max_sources) { @@ -682,10 +607,7 @@ int module_adapter_params(struct comp_dev *dev, struct sof_ipc_stream_params *pa return ret; } -#if CONFIG_IPC_MAJOR_4 - ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); - ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, mod->stream_params); -#endif + module_adapter_set_params(mod, params); return 0; } @@ -1002,11 +924,7 @@ static int module_adapter_audio_stream_type_copy(struct comp_dev *dev) /* handle special case of HOST/DAI type components */ if (dev->ipc_config.type == SOF_COMP_HOST || dev->ipc_config.type == SOF_COMP_DAI) -#if CONFIG_IPC_MAJOR_3 - return module_process_legacy(mod, NULL, 0, NULL, 0); -#else - return module_process_stream(mod, NULL, 0, NULL, 0); -#endif + return module_process_endpoint(mod, NULL, 0, NULL, 0); if (mod->stream_copy_single_to_single) return module_adapter_audio_stream_copy_1to1(dev); @@ -1454,32 +1372,6 @@ int module_adapter_cmd(struct comp_dev *dev, int cmd, void *data, int max_data_s return ret; } -#if CONFIG_IPC_MAJOR_3 -static int module_source_status_count(struct comp_dev *dev, uint32_t status) -{ - struct list_item *blist; - int count = 0; - - /* count source with state == status */ - list_for_item(blist, &dev->bsource_list) { - /* - * FIXME: this is racy, state can be changed by another core. - * This is implicitly protected by serialised IPCs. Even when - * IPCs are processed in the pipeline thread, the next IPC will - * not be sent until the thread has processed and replied to the - * current one. - */ - struct comp_buffer *source = container_of(blist, struct comp_buffer, - sink_list); - - if (source->source && source->source->state == status) - count++; - } - - return count; -} -#endif - int module_adapter_trigger(struct comp_dev *dev, int cmd) { struct processing_module *mod = comp_get_drvdata(dev); @@ -1502,28 +1394,7 @@ int module_adapter_trigger(struct comp_dev *dev, int cmd) return PPL_STATUS_PATH_STOP; } -#if CONFIG_IPC_MAJOR_3 - if (mod->num_of_sources > 1) { - bool sources_active; - int ret; - - sources_active = module_source_status_count(dev, COMP_STATE_ACTIVE) || - module_source_status_count(dev, COMP_STATE_PAUSED); - - /* don't stop/start module if one of the sources is active/paused */ - if ((cmd == COMP_TRIGGER_STOP || cmd == COMP_TRIGGER_PRE_START) && sources_active) { - dev->state = COMP_STATE_ACTIVE; - return PPL_STATUS_PATH_STOP; - } - - ret = comp_set_state(dev, cmd); - if (ret == COMP_STATUS_STATE_ALREADY_SET) - return PPL_STATUS_PATH_STOP; - - return ret; - } -#endif - return comp_set_state(dev, cmd); + return module_adapter_set_state(mod, dev, cmd); } int module_adapter_reset(struct comp_dev *dev) @@ -1754,184 +1625,3 @@ int module_adapter_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd) return -EOPNOTSUPP; } -#if CONFIG_IPC_MAJOR_4 -int module_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, - bool last_block, uint32_t data_offset_size, const char *data) -{ - struct processing_module *mod = comp_get_drvdata(dev); - struct module_data *md = &mod->priv; - enum module_cfg_fragment_position pos; - size_t fragment_size; - - /* set fragment position */ - pos = first_last_block_to_frag_pos(first_block, last_block); - - switch (pos) { - case MODULE_CFG_FRAGMENT_SINGLE: - fragment_size = data_offset_size; - break; - case MODULE_CFG_FRAGMENT_MIDDLE: - fragment_size = MAILBOX_DSPBOX_SIZE; - break; - case MODULE_CFG_FRAGMENT_FIRST: - md->new_cfg_size = data_offset_size; - fragment_size = MAILBOX_DSPBOX_SIZE; - break; - case MODULE_CFG_FRAGMENT_LAST: - fragment_size = md->new_cfg_size - data_offset_size; - break; - default: - comp_err(dev, "module_set_large_config(): invalid fragment position"); - return -EINVAL; - } - - if (md->ops->set_configuration) - return md->ops->set_configuration(mod, param_id, pos, data_offset_size, - (const uint8_t *)data, - fragment_size, NULL, 0); - return 0; -} - -int module_get_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, - bool last_block, uint32_t *data_offset_size, char *data) -{ - struct processing_module *mod = comp_get_drvdata(dev); - struct module_data *md = &mod->priv; - size_t fragment_size; - - /* set fragment size */ - if (first_block) { - if (last_block) - fragment_size = md->cfg.size; - else - fragment_size = SOF_IPC_MSG_MAX_SIZE; - } else { - if (!last_block) - fragment_size = SOF_IPC_MSG_MAX_SIZE; - else - fragment_size = md->cfg.size - *data_offset_size; - } - - if (md->ops->get_configuration) - return md->ops->get_configuration(mod, param_id, data_offset_size, - (uint8_t *)data, fragment_size); - return 0; -} - -int module_adapter_get_attribute(struct comp_dev *dev, uint32_t type, void *value) -{ - struct processing_module *mod = comp_get_drvdata(dev); - - switch (type) { - case COMP_ATTR_BASE_CONFIG: - memcpy_s(value, sizeof(struct ipc4_base_module_cfg), - &mod->priv.cfg.base_cfg, sizeof(mod->priv.cfg.base_cfg)); - break; - default: - return -EINVAL; - } - - return 0; -} - -static bool module_adapter_multi_sink_source_check(struct comp_dev *dev) -{ - struct processing_module *mod = comp_get_drvdata(dev); - struct list_item *blist; - int num_sources = 0; - int num_sinks = 0; - - list_for_item(blist, &dev->bsource_list) - num_sources++; - - list_for_item(blist, &dev->bsink_list) - num_sinks++; - - comp_dbg(dev, "num_sources=%d num_sinks=%d", num_sources, num_sinks); - - if (num_sources != 1 || num_sinks != 1) - return true; - - /* re-assign the source/sink modules */ - mod->sink_comp_buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - mod->source_comp_buffer = list_first_item(&dev->bsource_list, - struct comp_buffer, sink_list); - - return false; -} - -int module_adapter_bind(struct comp_dev *dev, void *data) -{ - struct processing_module *mod = comp_get_drvdata(dev); - int ret; - - ret = module_bind(mod, data); - if (ret < 0) - return ret; - - mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_check(dev); - - return 0; -} - -int module_adapter_unbind(struct comp_dev *dev, void *data) -{ - struct processing_module *mod = comp_get_drvdata(dev); - int ret; - - ret = module_unbind(mod, data); - if (ret < 0) - return ret; - - mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_check(dev); - - return 0; -} - -uint64_t module_adapter_get_total_data_processed(struct comp_dev *dev, - uint32_t stream_no, bool input) -{ - struct processing_module *mod = comp_get_drvdata(dev); - struct module_data *md = &mod->priv; - - if (md->ops->endpoint_ops && md->ops->endpoint_ops->get_total_data_processed) - return md->ops->endpoint_ops->get_total_data_processed(dev, stream_no, input); - - if (input) - return mod->total_data_produced; - else - return mod->total_data_consumed; -} -#else -int module_adapter_get_attribute(struct comp_dev *dev, uint32_t type, void *value) -{ - return -EINVAL; -} -int module_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, - bool last_block, uint32_t data_offset, const char *data) -{ - return 0; -} - -int module_get_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, - bool last_block, uint32_t *data_offset, char *data) -{ - return 0; -} - -int module_adapter_bind(struct comp_dev *dev, void *data) -{ - return 0; -} - -int module_adapter_unbind(struct comp_dev *dev, void *data) -{ - return 0; -} - -uint64_t module_adapter_get_total_data_processed(struct comp_dev *dev, - uint32_t stream_no, bool input) -{ - return 0; -} -#endif diff --git a/src/audio/module_adapter/module_adapter_ipc3.c b/src/audio/module_adapter/module_adapter_ipc3.c new file mode 100644 index 000000000000..cf11e5aeb7da --- /dev/null +++ b/src/audio/module_adapter/module_adapter_ipc3.c @@ -0,0 +1,161 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Intel Corporation. All rights reserved. +// +// Author: Baofeng Tian <baofeng.tian@intel.com> + +/** + * \file + * \brief Module Adapter ipc3: module adapter ipc3 specific code + * \author Baofeng Tian <baofeng.tian@intel.com> + */ + +#include <sof/audio/buffer.h> +#include <sof/audio/component.h> +#include <sof/audio/ipc-config.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/pipeline.h> +#include <sof/common.h> +#include <sof/platform.h> +#include <sof/ut.h> +#include <rtos/interrupt.h> +#include <limits.h> +#include <stdint.h> + +LOG_MODULE_DECLARE(module_adapter, CONFIG_SOF_LOG_LEVEL); + +/* + * \module adapter data initialize. + * \param[in] dev - device. + * \param[in] config - component ipc descriptor pointer. + * \param[in] dst - module adapter config data. + * \param[in] spec - passdowned data from driver. + * + * \return: 0 - no error; < 0, error happened. + */ +int module_adapter_init_data(struct comp_dev *dev, + struct module_config *dst, + const struct comp_ipc_config *config, + const void *spec) +{ + int ret; + + const unsigned char *data; + uint32_t size; + + switch (config->type) { + case SOF_COMP_VOLUME: + { + const struct ipc_config_volume *ipc_volume = spec; + + size = sizeof(*ipc_volume); + data = spec; + break; + } + case SOF_COMP_SRC: + { + const struct ipc_config_src *ipc_src = spec; + + size = sizeof(*ipc_src); + data = spec; + break; + } + default: + { + const struct ipc_config_process *ipc_module_adapter = spec; + + size = ipc_module_adapter->size; + data = ipc_module_adapter->data; + break; + } + } + + /* Copy initial config */ + if (size) { + ret = module_load_config(dev, data, size); + if (ret < 0) { + comp_err(dev, "module_adapter_new() error %d: config loading has failed.", + ret); + return ret; + } + dst->init_data = dst->data; + } else { + return -EINVAL; + } + + return 0; +} + +void module_adapter_reset_data(struct module_config *dst) +{ +} + +void module_adapter_check_data(struct processing_module *mod, struct comp_dev *dev, + struct comp_buffer *sink) +{ + /* Check if audio stream client has only one source and one sink buffer to use a + * simplified copy function. + */ + if (IS_PROCESSING_MODE_AUDIO_STREAM(mod) && mod->num_of_sources == 1 && + mod->num_of_sinks == 1) { + mod->source_comp_buffer = list_first_item(&dev->bsource_list, + struct comp_buffer, sink_list); + mod->sink_comp_buffer = sink; + mod->stream_copy_single_to_single = true; + } +} + +void module_adapter_set_params(struct processing_module *mod, struct sof_ipc_stream_params *params) +{ +} + +static int module_source_status_count(struct comp_dev *dev, uint32_t status) +{ + struct list_item *blist; + int count = 0; + + /* count source with state == status */ + list_for_item(blist, &dev->bsource_list) { + /* + * FIXME: this is racy, state can be changed by another core. + * This is implicitly protected by serialised IPCs. Even when + * IPCs are processed in the pipeline thread, the next IPC will + * not be sent until the thread has processed and replied to the + * current one. + */ + struct comp_buffer *source = container_of(blist, struct comp_buffer, + sink_list); + + if (source->source && source->source->state == status) + count++; + } + + return count; +} + +int module_adapter_set_state(struct processing_module *mod, struct comp_dev *dev, + int cmd) +{ + if (mod->num_of_sources > 1) { + bool sources_active; + int ret; + + sources_active = module_source_status_count(dev, COMP_STATE_ACTIVE) || + module_source_status_count(dev, COMP_STATE_PAUSED); + + /* don't stop/start module if one of the sources is active/paused */ + if ((cmd == COMP_TRIGGER_STOP || cmd == COMP_TRIGGER_PRE_START) && sources_active) { + dev->state = COMP_STATE_ACTIVE; + return PPL_STATUS_PATH_STOP; + } + + ret = comp_set_state(dev, cmd); + if (ret == COMP_STATUS_STATE_ALREADY_SET) + return PPL_STATUS_PATH_STOP; + + return ret; + } + + return comp_set_state(dev, cmd); +} + diff --git a/src/audio/module_adapter/module_adapter_ipc4.c b/src/audio/module_adapter/module_adapter_ipc4.c new file mode 100644 index 000000000000..65ca8e806e3f --- /dev/null +++ b/src/audio/module_adapter/module_adapter_ipc4.c @@ -0,0 +1,226 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Intel Corporation. All rights reserved. +// +// Author: Baofeng Tian <baofeng.tian@intel.com> + +/** + * \file + * \brief Module Adapter ipc4: module adapter ipc4 specific code + * \author Baofeng Tian <baofeng.tian@intel.com> + */ + +#include <sof/audio/buffer.h> +#include <sof/audio/component.h> +#include <sof/audio/ipc-config.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/pipeline.h> +#include <sof/common.h> +#include <sof/platform.h> +#include <sof/ut.h> +#include <rtos/interrupt.h> +#include <limits.h> +#include <stdint.h> + +LOG_MODULE_DECLARE(module_adapter, CONFIG_SOF_LOG_LEVEL); + +/* + * \module adapter data initialize. + * \param[in] dev - device. + * \param[in] config - component ipc descriptor pointer. + * \param[in] dst - module adapter config data. + * \param[in] spec - passdowned data from driver. + * + * \return: 0 - no error; < 0, error happened. + */ +int module_adapter_init_data(struct comp_dev *dev, + struct module_config *dst, + const struct comp_ipc_config *config, + const void *spec) +{ + if (dev->drv->type == SOF_COMP_MODULE_ADAPTER) { + const struct ipc_config_process *ipc_module_adapter = spec; + + dst->init_data = ipc_module_adapter->data; + dst->size = ipc_module_adapter->size; + dst->avail = true; + + memcpy_s(&dst->base_cfg, sizeof(dst->base_cfg), ipc_module_adapter->data, + sizeof(dst->base_cfg)); + } else { + dst->init_data = spec; + } + + return 0; +} + +void module_adapter_reset_data(struct module_config *dst) +{ + dst->init_data = NULL; +} + +void module_adapter_check_data(struct processing_module *mod, struct comp_dev *dev, + struct comp_buffer *sink) +{ +} + +void module_adapter_set_params(struct processing_module *mod, struct sof_ipc_stream_params *params) +{ + ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); + ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, mod->stream_params); +} + +int module_adapter_set_state(struct processing_module *mod, struct comp_dev *dev, + int cmd) +{ + return comp_set_state(dev, cmd); +} + +int module_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, + bool last_block, uint32_t data_offset_size, const char *data) +{ + struct processing_module *mod = comp_get_drvdata(dev); + struct module_data *md = &mod->priv; + enum module_cfg_fragment_position pos; + size_t fragment_size; + + /* set fragment position */ + pos = first_last_block_to_frag_pos(first_block, last_block); + + switch (pos) { + case MODULE_CFG_FRAGMENT_SINGLE: + fragment_size = data_offset_size; + break; + case MODULE_CFG_FRAGMENT_MIDDLE: + fragment_size = MAILBOX_DSPBOX_SIZE; + break; + case MODULE_CFG_FRAGMENT_FIRST: + md->new_cfg_size = data_offset_size; + fragment_size = MAILBOX_DSPBOX_SIZE; + break; + case MODULE_CFG_FRAGMENT_LAST: + fragment_size = md->new_cfg_size - data_offset_size; + break; + default: + comp_err(dev, "module_set_large_config(): invalid fragment position"); + return -EINVAL; + } + + if (md->ops->set_configuration) + return md->ops->set_configuration(mod, param_id, pos, data_offset_size, + (const uint8_t *)data, + fragment_size, NULL, 0); + return 0; +} + +int module_get_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, + bool last_block, uint32_t *data_offset_size, char *data) +{ + struct processing_module *mod = comp_get_drvdata(dev); + struct module_data *md = &mod->priv; + size_t fragment_size; + + /* set fragment size */ + if (first_block) { + if (last_block) + fragment_size = md->cfg.size; + else + fragment_size = SOF_IPC_MSG_MAX_SIZE; + } else { + if (!last_block) + fragment_size = SOF_IPC_MSG_MAX_SIZE; + else + fragment_size = md->cfg.size - *data_offset_size; + } + + if (md->ops->get_configuration) + return md->ops->get_configuration(mod, param_id, data_offset_size, + (uint8_t *)data, fragment_size); + return 0; +} + +int module_adapter_get_attribute(struct comp_dev *dev, uint32_t type, void *value) +{ + struct processing_module *mod = comp_get_drvdata(dev); + + switch (type) { + case COMP_ATTR_BASE_CONFIG: + memcpy_s(value, sizeof(struct ipc4_base_module_cfg), + &mod->priv.cfg.base_cfg, sizeof(mod->priv.cfg.base_cfg)); + break; + default: + return -EINVAL; + } + + return 0; +} + +static bool module_adapter_multi_sink_source_check(struct comp_dev *dev) +{ + struct processing_module *mod = comp_get_drvdata(dev); + struct list_item *blist; + int num_sources = 0; + int num_sinks = 0; + + list_for_item(blist, &dev->bsource_list) + num_sources++; + + list_for_item(blist, &dev->bsink_list) + num_sinks++; + + comp_dbg(dev, "num_sources=%d num_sinks=%d", num_sources, num_sinks); + + if (num_sources != 1 || num_sinks != 1) + return true; + + /* re-assign the source/sink modules */ + mod->sink_comp_buffer = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + mod->source_comp_buffer = list_first_item(&dev->bsource_list, + struct comp_buffer, sink_list); + + return false; +} + +int module_adapter_bind(struct comp_dev *dev, void *data) +{ + struct processing_module *mod = comp_get_drvdata(dev); + int ret; + + ret = module_bind(mod, data); + if (ret < 0) + return ret; + + mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_check(dev); + + return 0; +} + +int module_adapter_unbind(struct comp_dev *dev, void *data) +{ + struct processing_module *mod = comp_get_drvdata(dev); + int ret; + + ret = module_unbind(mod, data); + if (ret < 0) + return ret; + + mod->stream_copy_single_to_single = !module_adapter_multi_sink_source_check(dev); + + return 0; +} + +uint64_t module_adapter_get_total_data_processed(struct comp_dev *dev, + uint32_t stream_no, bool input) +{ + struct processing_module *mod = comp_get_drvdata(dev); + struct module_data *md = &mod->priv; + + if (md->ops->endpoint_ops && md->ops->endpoint_ops->get_total_data_processed) + return md->ops->endpoint_ops->get_total_data_processed(dev, stream_no, input); + + if (input) + return mod->total_data_produced; + else + return mod->total_data_consumed; +} + diff --git a/src/include/sof/audio/module_adapter/module/generic.h b/src/include/sof/audio/module_adapter/module/generic.h index d2145d096135..90f91ab0cef7 100644 --- a/src/include/sof/audio/module_adapter/module/generic.h +++ b/src/include/sof/audio/module_adapter/module/generic.h @@ -24,6 +24,19 @@ #include "modules.h" #endif +/* + * helpers to determine processing type + * Needed till all the modules use PROCESSING_MODE_SINK_SOURCE + */ +#define IS_PROCESSING_MODE_AUDIO_STREAM(mod) \ + (!!((struct module_data *)&(mod)->priv)->ops->process_audio_stream) + +#define IS_PROCESSING_MODE_RAW_DATA(mod) \ + (!!((struct module_data *)&(mod)->priv)->ops->process_raw_data) + +#define IS_PROCESSING_MODE_SINK_SOURCE(mod) \ + (!!((struct module_data *)&(mod)->priv)->ops->process) + #define module_get_private_data(mod) (mod->priv.private) #define MAX_BLOB_SIZE 8192 #define MODULE_MAX_SOURCES 8 @@ -311,6 +324,58 @@ int module_adapter_cmd(struct comp_dev *dev, int cmd, void *data, int max_data_s int module_adapter_trigger(struct comp_dev *dev, int cmd); void module_adapter_free(struct comp_dev *dev); int module_adapter_reset(struct comp_dev *dev); + +#if CONFIG_IPC_MAJOR_3 +static inline +int module_adapter_get_attribute(struct comp_dev *dev, uint32_t type, void *value) +{ + return -EINVAL; +} + +static inline +int module_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, + bool last_block, uint32_t data_offset, const char *data) +{ + return 0; +} + +static inline +int module_get_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, + bool last_block, uint32_t *data_offset, char *data) +{ + return 0; +} + +static inline +int module_adapter_bind(struct comp_dev *dev, void *data) +{ + return 0; +} + +static inline +int module_adapter_unbind(struct comp_dev *dev, void *data) +{ + return 0; +} + +static inline +uint64_t module_adapter_get_total_data_processed(struct comp_dev *dev, + uint32_t stream_no, bool input) +{ + return 0; +} + +static inline int module_process_endpoint(struct processing_module *mod, + struct input_stream_buffer *input_buffers, + int num_input_buffers, + struct output_stream_buffer *output_buffers, + int num_output_buffers) +{ + return module_process_legacy(mod, input_buffers, num_input_buffers, + output_buffers, num_output_buffers); +} + +#else int module_set_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, bool last_block, uint32_t data_offset, const char *data); int module_get_large_config(struct comp_dev *dev, uint32_t param_id, bool first_block, @@ -320,6 +385,21 @@ int module_adapter_bind(struct comp_dev *dev, void *data); int module_adapter_unbind(struct comp_dev *dev, void *data); uint64_t module_adapter_get_total_data_processed(struct comp_dev *dev, uint32_t stream_no, bool input); + +static inline int module_process_endpoint(struct processing_module *mod, + struct input_stream_buffer *input_buffers, + int num_input_buffers, + struct output_stream_buffer *output_buffers, + int num_output_buffers) +{ + struct module_data *md = &mod->priv; + + return md->ops->process_audio_stream(mod, input_buffers, num_input_buffers, + output_buffers, num_output_buffers); +} + +#endif + int module_adapter_get_hw_params(struct comp_dev *dev, struct sof_ipc_stream_params *params, int dir); int module_adapter_position(struct comp_dev *dev, struct sof_ipc_stream_posn *posn); @@ -332,27 +412,18 @@ int module_adapter_ts_get_op(struct comp_dev *dev, struct dai_ts_data *tsd); int module_adapter_ts_get_op(struct comp_dev *dev, struct timestamp_data *tsd); #endif -static inline void module_update_buffer_position(struct input_stream_buffer *input_buffers, - struct output_stream_buffer *output_buffers, - uint32_t frames) -{ - struct audio_stream *source = input_buffers->data; - struct audio_stream *sink = output_buffers->data; - - input_buffers->consumed += audio_stream_frame_bytes(source) * frames; - output_buffers->size += audio_stream_frame_bytes(sink) * frames; -} - -static inline int module_process_stream(struct processing_module *mod, - struct input_stream_buffer *input_buffers, - int num_input_buffers, - struct output_stream_buffer *output_buffers, - int num_output_buffers) -{ - struct module_data *md = &mod->priv; - - return md->ops->process_audio_stream(mod, input_buffers, num_input_buffers, - output_buffers, num_output_buffers); -} - +void module_update_buffer_position(struct input_stream_buffer *input_buffers, + struct output_stream_buffer *output_buffers, + uint32_t frames); + +int module_adapter_init_data(struct comp_dev *dev, + struct module_config *dst, + const struct comp_ipc_config *config, + const void *spec); +void module_adapter_reset_data(struct module_config *dst); +void module_adapter_check_data(struct processing_module *mod, struct comp_dev *dev, + struct comp_buffer *sink); +void module_adapter_set_params(struct processing_module *mod, struct sof_ipc_stream_params *params); +int module_adapter_set_state(struct processing_module *mod, struct comp_dev *dev, + int cmd); #endif /* __SOF_AUDIO_MODULE_GENERIC__ */ diff --git a/test/cmocka/src/audio/eq_fir/CMakeLists.txt b/test/cmocka/src/audio/eq_fir/CMakeLists.txt index af9fa80d0b60..3369f2b97b06 100644 --- a/test/cmocka/src/audio/eq_fir/CMakeLists.txt +++ b/test/cmocka/src/audio/eq_fir/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(audio_for_eq_fir STATIC ${PROJECT_SOURCE_DIR}/src/math/fir_hifi3.c ${PROJECT_SOURCE_DIR}/src/math/numbers.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c + ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter_ipc3.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c ${PROJECT_SOURCE_DIR}/src/audio/buffer.c ${PROJECT_SOURCE_DIR}/src/audio/source_api_helper.c diff --git a/test/cmocka/src/audio/eq_iir/CMakeLists.txt b/test/cmocka/src/audio/eq_iir/CMakeLists.txt index a72903d1c1df..a520a22fa441 100644 --- a/test/cmocka/src/audio/eq_iir/CMakeLists.txt +++ b/test/cmocka/src/audio/eq_iir/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(audio_for_eq_iir STATIC ${PROJECT_SOURCE_DIR}/src/math/iir_df2t_hifi3.c ${PROJECT_SOURCE_DIR}/src/math/numbers.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c + ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter_ipc3.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c ${PROJECT_SOURCE_DIR}/src/audio/buffer.c ${PROJECT_SOURCE_DIR}/src/audio/source_api_helper.c diff --git a/test/cmocka/src/audio/mixer/CMakeLists.txt b/test/cmocka/src/audio/mixer/CMakeLists.txt index e422dd6ebf96..01aebc99223e 100644 --- a/test/cmocka/src/audio/mixer/CMakeLists.txt +++ b/test/cmocka/src/audio/mixer/CMakeLists.txt @@ -11,6 +11,7 @@ cmocka_test(mixer ${PROJECT_SOURCE_DIR}/src/ipc/ipc-common.c ${PROJECT_SOURCE_DIR}/src/ipc/ipc-helper.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c + ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter_ipc3.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c ${PROJECT_SOURCE_DIR}/src/audio/buffer.c ${PROJECT_SOURCE_DIR}/src/audio/source_api_helper.c diff --git a/test/cmocka/src/audio/mux/CMakeLists.txt b/test/cmocka/src/audio/mux/CMakeLists.txt index 59e3752599fc..c6f67ae89127 100644 --- a/test/cmocka/src/audio/mux/CMakeLists.txt +++ b/test/cmocka/src/audio/mux/CMakeLists.txt @@ -23,6 +23,7 @@ add_library( ${PROJECT_SOURCE_DIR}/src/ipc/ipc-helper.c ${PROJECT_SOURCE_DIR}/test/cmocka/src/notifier_mocks.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c + ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter_ipc3.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c ) sof_append_relative_path_definitions(audio_mux) diff --git a/test/cmocka/src/audio/volume/CMakeLists.txt b/test/cmocka/src/audio/volume/CMakeLists.txt index a1cd1fd8cab2..f6530bc2b3b0 100644 --- a/test/cmocka/src/audio/volume/CMakeLists.txt +++ b/test/cmocka/src/audio/volume/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(audio_for_volume STATIC ${PROJECT_SOURCE_DIR}/src/audio/volume/volume_hifi3_with_peakvol.c ${PROJECT_SOURCE_DIR}/src/audio/volume/volume_hifi4_with_peakvol.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter.c + ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module_adapter_ipc3.c ${PROJECT_SOURCE_DIR}/src/audio/module_adapter/module/generic.c ${PROJECT_SOURCE_DIR}/src/audio/buffer.c ${PROJECT_SOURCE_DIR}/src/audio/source_api_helper.c diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index a618f966eee6..a2e2a4978956 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -525,10 +525,19 @@ elseif(CONFIG_IPC_MAJOR_4) ) endif() +if(CONFIG_IPC_MAJOR_3) zephyr_library_sources_ifdef(CONFIG_COMP_MODULE_ADAPTER ${SOF_AUDIO_PATH}/module_adapter/module_adapter.c + ${SOF_AUDIO_PATH}/module_adapter/module_adapter_ipc3.c ${SOF_AUDIO_PATH}/module_adapter/module/generic.c ) +elseif(CONFIG_IPC_MAJOR_4) +zephyr_library_sources_ifdef(CONFIG_COMP_MODULE_ADAPTER + ${SOF_AUDIO_PATH}/module_adapter/module_adapter.c + ${SOF_AUDIO_PATH}/module_adapter/module_adapter_ipc4.c + ${SOF_AUDIO_PATH}/module_adapter/module/generic.c +) +endif() zephyr_library_sources_ifdef(CONFIG_LIBRARY_MANAGER ${SOF_SRC_PATH}/library_manager/lib_manager.c From a83df4944675a8dc7d5310fbf87b8b94a12427c2 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Mon, 18 Sep 2023 16:16:16 +0800 Subject: [PATCH 527/639] audio: volume: enable linear ramp for ipc4 volume previously, linear ramp is only applicable for ipc3, however, linear is also applicable for chrome/linux with ipc4, so remove this ipc3 restriction. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/module_adapter/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/src/audio/module_adapter/Kconfig b/src/audio/module_adapter/Kconfig index 1bd6da3e5cf9..731d5acea872 100644 --- a/src/audio/module_adapter/Kconfig +++ b/src/audio/module_adapter/Kconfig @@ -172,7 +172,6 @@ config COMP_VOLUME_WINDOWS_FADE config COMP_VOLUME_LINEAR_RAMP bool "Linear ramp volume transitions support" default y - depends on IPC_MAJOR_3 help This option enables volume linear ramp shape. From d24abbc6aee114c6e509b608050f5adbf80d31f4 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 21 Sep 2023 20:51:27 +0800 Subject: [PATCH 528/639] audio: volume: move volume related config to component config volume related config are missed to move during volume move out from module adapter, move volume kconfig from module adapter folder to volume folder with a specific volume kconfig file. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/Kconfig | 2 + src/audio/module_adapter/Kconfig | 79 -------------------------------- src/audio/volume/Kconfig | 79 ++++++++++++++++++++++++++++++++ 3 files changed, 81 insertions(+), 79 deletions(-) create mode 100644 src/audio/volume/Kconfig diff --git a/src/audio/Kconfig b/src/audio/Kconfig index d92e2ce5872a..8c533713419a 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -2,6 +2,8 @@ menu "Audio components" +rsource "volume/Kconfig" + config COMP_BASEFW_IPC4 bool "BASEFW component" default y diff --git a/src/audio/module_adapter/Kconfig b/src/audio/module_adapter/Kconfig index 731d5acea872..ba8370bf6f6e 100644 --- a/src/audio/module_adapter/Kconfig +++ b/src/audio/module_adapter/Kconfig @@ -150,85 +150,6 @@ if CADENCE_CODEC endif # Cadence - config COMP_VOLUME - bool "Volume component" - default y - depends on COMP_MODULE_ADAPTER - help - Select for Volume component - -if COMP_VOLUME - -config COMP_VOLUME_WINDOWS_FADE - bool "Windows Fade shape volume transitions support" - help - This option enables volume ramp shape that follows - power of 1.75. The shape is not linear, not logarithmic. - The power function uses a lookup table that consumes - 256 bytes. The topology must set volume ramp token to - SOF_VOLUME_WINDOWS_FADE for the volume instance to use - this ramp shape. - -config COMP_VOLUME_LINEAR_RAMP - bool "Linear ramp volume transitions support" - default y - help - This option enables volume linear ramp shape. - -config COMP_PEAK_VOL - bool "Report peak vol data to host" - default y - depends on IPC_MAJOR_4 - help - This option enables reporting to host peak vol regs. - See: struct ipc4_peak_volume_regs - -choice "PEAK_METER_UPDATE_PERIOD_CHOICE" - prompt "The periods(ms) of updating peak meter value" - default PEAK_METER_UPDATE_10MS - depends on COMP_PEAK_VOL - - config PEAK_METER_UPDATE_1MS - bool "1ms" - help - Update the peak meter value every 1ms - - config PEAK_METER_UPDATE_10MS - bool "10ms" - help - Update the peak meter value every 10ms - - config PEAK_METER_UPDATE_100MS - bool "100ms" - help - Update the peak meter value every 100ms - - config PEAK_METER_UPDATE_1000MS - bool "1000ms" - help - Update the peak meter value every 1000ms - endchoice - -config PEAK_METER_UPDATE_PERIOD - int - depends on COMP_PEAK_VOL - default 1 if PEAK_METER_UPDATE_1MS - default 10 if PEAK_METER_UPDATE_10MS - default 100 if PEAK_METER_UPDATE_100MS - default 1000 if PEAK_METER_UPDATE_1000MS - help - Decide which period of update the peak volume meter value - -config COMP_GAIN - bool "GAIN component" - default y - depends on IPC_MAJOR_4 - help - This option enables gain to change volume. It works - as peak volume without updating peak vol to host - -endif # volume - config PASSTHROUGH_CODEC bool "Passthrough codec" default n diff --git a/src/audio/volume/Kconfig b/src/audio/volume/Kconfig new file mode 100644 index 000000000000..a0daa89a2940 --- /dev/null +++ b/src/audio/volume/Kconfig @@ -0,0 +1,79 @@ +# SPDX-License-Identifier: BSD-3-Clause + + config COMP_VOLUME + bool "Volume component" + default y + help + Select for Volume component + +if COMP_VOLUME + +config COMP_VOLUME_WINDOWS_FADE + bool "Windows Fade shape volume transitions support" + help + This option enables volume ramp shape that follows + power of 1.75. The shape is not linear, not logarithmic. + The power function uses a lookup table that consumes + 256 bytes. The topology must set volume ramp token to + SOF_VOLUME_WINDOWS_FADE for the volume instance to use + this ramp shape. + +config COMP_VOLUME_LINEAR_RAMP + bool "Linear ramp volume transitions support" + default y + help + This option enables volume linear ramp shape. + +config COMP_PEAK_VOL + bool "Report peak vol data to host" + default y + depends on IPC_MAJOR_4 + help + This option enables reporting to host peak vol regs. + See: struct ipc4_peak_volume_regs + +choice "PEAK_METER_UPDATE_PERIOD_CHOICE" + prompt "The periods(ms) of updating peak meter value" + default PEAK_METER_UPDATE_10MS + depends on COMP_PEAK_VOL + + config PEAK_METER_UPDATE_1MS + bool "1ms" + help + Update the peak meter value every 1ms + + config PEAK_METER_UPDATE_10MS + bool "10ms" + help + Update the peak meter value every 10ms + + config PEAK_METER_UPDATE_100MS + bool "100ms" + help + Update the peak meter value every 100ms + + config PEAK_METER_UPDATE_1000MS + bool "1000ms" + help + Update the peak meter value every 1000ms + endchoice + +config PEAK_METER_UPDATE_PERIOD + int + depends on COMP_PEAK_VOL + default 1 if PEAK_METER_UPDATE_1MS + default 10 if PEAK_METER_UPDATE_10MS + default 100 if PEAK_METER_UPDATE_100MS + default 1000 if PEAK_METER_UPDATE_1000MS + help + Decide which period of update the peak volume meter value + +config COMP_GAIN + bool "GAIN component" + default y + depends on IPC_MAJOR_4 + help + This option enables gain to change volume. It works + as peak volume without updating peak vol to host + +endif # volume \ No newline at end of file From 689e8e999f220356f69b8532216790fed18a9da4 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Tue, 10 Oct 2023 12:58:54 +0200 Subject: [PATCH 529/639] dp: LL tick source start/stop fix as DP uses LL as a tick source, it starts an empty LL task to ensure that an instance of LL is running This applies to mostly to secondary cores, but is may happen that there's no LL instance started on primary This commit fixes 2 problems - LL tick source was stated once for every DP module - LL tick source wasn't stopped when there were no DP modules running anymore Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/schedule/zephyr_dp_schedule.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index dae00f63239e..faa47adcf314 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -30,7 +30,7 @@ DECLARE_TR_CTX(dp_tr, SOF_UUID(dp_sched_uuid), LOG_LEVEL_INFO); struct scheduler_dp_data { struct list_item tasks; /* list of active dp tasks */ - struct task task; /* LL task - source of DP tick */ + struct task ll_tick_src; /* LL task - source of DP tick */ }; struct task_dp_pdata { @@ -254,6 +254,7 @@ void scheduler_dp_ll_tick(void *receiver_data, enum notify_id event_type, void * static int scheduler_dp_task_cancel(void *data, struct task *task) { unsigned int lock_key; + struct scheduler_dp_data *dp_sch = (struct scheduler_dp_data *)data; /* this is asyn cancel - mark the task as canceled and remove it from scheduling */ lock_key = scheduler_dp_lock(); @@ -261,6 +262,10 @@ static int scheduler_dp_task_cancel(void *data, struct task *task) task->state = SOF_TASK_STATE_CANCEL; list_item_del(&task->list); + /* if there're no more DP task, stop LL tick source */ + if (list_is_empty(&dp_sch->tasks)) + schedule_task_cancel(&dp_sch->ll_tick_src); + scheduler_dp_unlock(lock_key); return 0; @@ -268,18 +273,12 @@ static int scheduler_dp_task_cancel(void *data, struct task *task) static int scheduler_dp_task_free(void *data, struct task *task) { - unsigned int lock_key; struct task_dp_pdata *pdata = task->priv_data; + scheduler_dp_task_cancel(data, task); + /* abort the execution of the thread */ k_thread_abort(pdata->thread_id); - - lock_key = scheduler_dp_lock(); - list_item_del(&task->list); - task->priv_data = NULL; - task->state = SOF_TASK_STATE_FREE; - scheduler_dp_unlock(lock_key); - /* free task stack */ rfree((__sparse_force void *)pdata->p_stack); @@ -364,6 +363,10 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta return -EINVAL; } + /* if there's no DP tasks scheduled yet, run ll tick source task */ + if (list_is_empty(&task->list)) + schedule_task(&dp_sch->ll_tick_src, 0, 0); + /* add a task to DP scheduler list */ task->state = SOF_TASK_STATE_QUEUED; list_item_prepend(&task->list, &dp_sch->tasks); @@ -377,9 +380,6 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta pdata->period_clock_ticks = period_clock_ticks; scheduler_dp_unlock(lock_key); - /* start LL task - run DP tick start and period are irrelevant for LL (that's bad)*/ - schedule_task(&dp_sch->task, 0, 0); - tr_dbg(&dp_tr, "DP task scheduled with period %u [us]", (uint32_t)period); return 0; } @@ -403,7 +403,7 @@ int scheduler_dp_init(void) scheduler_init(SOF_SCHEDULE_DP, &schedule_dp_ops, dp_sch); /* init src of DP tick */ - ret = schedule_task_init_ll(&dp_sch->task, + ret = schedule_task_init_ll(&dp_sch->ll_tick_src, SOF_UUID(dp_sched_uuid), SOF_SCHEDULE_LL_TIMER, 0, scheduler_dp_ll_tick_dummy, dp_sch, From 5b5566f534941c842489c68eb888a05a5e5c4837 Mon Sep 17 00:00:00 2001 From: Anas Nashif <anas.nashif@intel.com> Date: Wed, 11 Oct 2023 12:07:43 +0000 Subject: [PATCH 530/639] zephyr: remove stray } from RIMAGE_CONFIG_PATH A stray } is at the end of RIMAGE_CONFIG_PATH causing issues when signing images. Signed-off-by: Anas Nashif <anas.nashif@intel.com> --- zephyr/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index a2e2a4978956..15ce7504a4c5 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -62,7 +62,7 @@ set(RIMAGE_TOP ${sof_top_dir}/rimage) # Save path to rimage configuration files in cmake cache for later use by # rimage during the "west sign" stage -set(RIMAGE_CONFIG_PATH ${RIMAGE_TOP}/config} CACHE PATH +set(RIMAGE_CONFIG_PATH ${RIMAGE_TOP}/config CACHE PATH " Path to rimage board configuration files") include(ExternalProject) From 7a11e27bf2a19e9acf643d416fc079f479fd2748 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Wed, 11 Oct 2023 11:30:14 -0700 Subject: [PATCH 531/639] topology2: host-gateway-capture: Replace audio_format objects With input_audio_format/output_audio_format objects in preparation to deprecate the audio_format class. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../topology2/cavs-sdw-src-gain-mixin.conf | 5 - .../pipelines/cavs/host-gateway-capture.conf | 110 +++++++++--------- 2 files changed, 52 insertions(+), 63 deletions(-) diff --git a/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf b/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf index b4c5cc4244dd..17acf2ceac4f 100644 --- a/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf +++ b/tools/topology/topology2/cavs-sdw-src-gain-mixin.conf @@ -120,11 +120,6 @@ Object.Pipeline { Object.Widget.host-copier.1 { stream_name "Passthrough Capture 0" pcm_id 1 - Object.Base.audio_format.1 { - # 32 -> 16 bits conversion is done here, - # so in_bit_depth is 32 (and out_bit_depth is 16). - in_bit_depth 32 - } } } ] diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf index 392a76c54734..84a4cc46cf7f 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-capture.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/host-copier.conf> <include/components/pipeline.conf> @@ -45,64 +46,57 @@ Class.Pipeline."host-gateway-capture" { type "aif_out" node_type $HDA_HOST_INPUT_CLASS num_input_pins 1 - num_input_audio_formats 6 + num_input_audio_formats 2 num_output_audio_formats 6 - # 16-bit output format 48KHz 2ch. Input sample format is always 32-bit for capture - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 16-bit output format 48KHz 4ch. Input sample format is always 32-bit for capture - Object.Base.audio_format.4 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.5 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 24 - out_channels 4 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } - # 32-bit 48KHz 4ch - Object.Base.audio_format.6 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - out_channels 4 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + # Input sample format is always 32-bit for capture + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + out_channels 4 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } pipeline."1" { From bb8d6baf45e012b500a8558cac859340af97cef9 Mon Sep 17 00:00:00 2001 From: Iuliana Prodan <iuliana.prodan@nxp.com> Date: Wed, 11 Oct 2023 01:32:48 +0300 Subject: [PATCH 532/639] Revert "module_adapter: avoid module init crash in case of ipc data invalid" This reverts 'commit e847c8b27015 ("module_adapter: avoid module init crash in case of ipc data invalid")'. No data is not an invalid case for mixer, for example. Fixes: #8265 Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com> --- src/audio/module_adapter/module_adapter_ipc3.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/audio/module_adapter/module_adapter_ipc3.c b/src/audio/module_adapter/module_adapter_ipc3.c index cf11e5aeb7da..0f9a31be4139 100644 --- a/src/audio/module_adapter/module_adapter_ipc3.c +++ b/src/audio/module_adapter/module_adapter_ipc3.c @@ -79,8 +79,6 @@ int module_adapter_init_data(struct comp_dev *dev, return ret; } dst->init_data = dst->data; - } else { - return -EINVAL; } return 0; From 269d8d592488d9f4bc1ba3ec4fc9dc57d9090418 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 4 Sep 2023 12:35:39 +0300 Subject: [PATCH 533/639] Tools: Topology2: Add DC block component This patch adds the widget class dcblock and a sample bytes configuration blobs. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/include/components/dcblock.conf | 65 +++++++++++++++++++ .../components/dcblock/100hz_16khz.conf | 13 ++++ .../components/dcblock/100hz_48khz.conf | 13 ++++ .../components/dcblock/200hz_16khz.conf | 13 ++++ .../components/dcblock/200hz_48khz.conf | 13 ++++ .../components/dcblock/20hz_16khz.conf | 13 ++++ .../components/dcblock/20hz_48khz.conf | 13 ++++ .../components/dcblock/30hz_16khz.conf | 13 ++++ .../components/dcblock/30hz_48khz.conf | 13 ++++ .../components/dcblock/40hz_16khz.conf | 13 ++++ .../components/dcblock/40hz_48khz.conf | 13 ++++ .../components/dcblock/50hz_16khz.conf | 13 ++++ .../components/dcblock/50hz_48khz.conf | 13 ++++ .../components/dcblock/80hz_16khz.conf | 13 ++++ .../components/dcblock/80hz_48khz.conf | 13 ++++ .../include/components/dcblock/default.conf | 13 ++++ 16 files changed, 260 insertions(+) create mode 100644 tools/topology/topology2/include/components/dcblock.conf create mode 100644 tools/topology/topology2/include/components/dcblock/100hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/100hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/200hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/200hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/20hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/20hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/30hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/30hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/40hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/40hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/50hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/50hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/80hz_16khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/80hz_48khz.conf create mode 100644 tools/topology/topology2/include/components/dcblock/default.conf diff --git a/tools/topology/topology2/include/components/dcblock.conf b/tools/topology/topology2/include/components/dcblock.conf new file mode 100644 index 000000000000..4b0815173db3 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock.conf @@ -0,0 +1,65 @@ +# +# +# A generic dcblock component. All attributes defined herein are namespaced +# by alsatplg to "Object.Widget.dcblock.attribute_name" +# +# Usage: this component can be used by declaring in the parent object. i.e. +# +# Object.Widget.dcblock."N" { +# index 1 +# } +# } + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +Class.Widget."dcblock" { + # + # Pipeline ID + # + DefineAttribute."index" { + type "integer" + } + + # + # Unique instance for EQ IIR widget + # + DefineAttribute."instance" { + type "integer" + } + + # Include common widget attributes definition + <include/components/widget-common.conf> + + attributes { + !constructor [ + "index" + "instance" + ] + !mandatory [ + "num_input_pins" + "num_output_pins" + "num_input_audio_formats" + "num_output_audio_formats" + ] + + !immutable [ + "uuid" + "type" + ] + !deprecated [ + "preload_count" + ] + unique "instance" + } + + # + # Default attributes for dcblock + # + # b809efaf-5681-42b1-9ed6-04bb012dd384 + uuid "af:ef:09:b8:81:56:b1:42:9e:d6:04:bb:01:2d:d3:84" + type "effect" + no_pm "true" + num_input_pins 1 + num_output_pins 1 +} diff --git a/tools/topology/topology2/include/components/dcblock/100hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/100hz_16khz.conf new file mode 100644 index 000000000000..9bda1ed41447 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/100hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x41,0xe3,0x6f,0x3d,0x41,0xe3,0x6f,0x3d, + 0x41,0xe3,0x6f,0x3d,0x41,0xe3,0x6f,0x3d, + 0x41,0xe3,0x6f,0x3d,0x41,0xe3,0x6f,0x3d, + 0x41,0xe3,0x6f,0x3d,0x41,0xe3,0x6f,0x3d" +} diff --git a/tools/topology/topology2/include/components/dcblock/100hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/100hz_48khz.conf new file mode 100644 index 000000000000..82c09e90b9c3 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/100hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x92,0x20,0x28,0x3f,0x92,0x20,0x28,0x3f, + 0x92,0x20,0x28,0x3f,0x92,0x20,0x28,0x3f, + 0x92,0x20,0x28,0x3f,0x92,0x20,0x28,0x3f, + 0x92,0x20,0x28,0x3f,0x92,0x20,0x28,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/200hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/200hz_16khz.conf new file mode 100644 index 000000000000..cc869bb12fd5 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/200hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x73,0x09,0xc6,0x3a,0x73,0x09,0xc6,0x3a, + 0x73,0x09,0xc6,0x3a,0x73,0x09,0xc6,0x3a, + 0x73,0x09,0xc6,0x3a,0x73,0x09,0xc6,0x3a, + 0x73,0x09,0xc6,0x3a,0x73,0x09,0xc6,0x3a" +} diff --git a/tools/topology/topology2/include/components/dcblock/200hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/200hz_48khz.conf new file mode 100644 index 000000000000..c4c9046f82ea --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/200hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xd4,0x6d,0x4d,0x3e,0xd4,0x6d,0x4d,0x3e, + 0xd4,0x6d,0x4d,0x3e,0xd4,0x6d,0x4d,0x3e, + 0xd4,0x6d,0x4d,0x3e,0xd4,0x6d,0x4d,0x3e, + 0xd4,0x6d,0x4d,0x3e,0xd4,0x6d,0x4d,0x3e" +} diff --git a/tools/topology/topology2/include/components/dcblock/20hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/20hz_16khz.conf new file mode 100644 index 000000000000..165ae2968d23 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/20hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x7c,0xd0,0x7e,0x3f,0x7c,0xd0,0x7e,0x3f, + 0x7c,0xd0,0x7e,0x3f,0x7c,0xd0,0x7e,0x3f, + 0x7c,0xd0,0x7e,0x3f,0x7c,0xd0,0x7e,0x3f, + 0x7c,0xd0,0x7e,0x3f,0x7c,0xd0,0x7e,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/20hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/20hz_48khz.conf new file mode 100644 index 000000000000..d7b8198218ad --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/20hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf6,0x0c,0xd5,0x3f,0xf6,0x0c,0xd5,0x3f, + 0xf6,0x0c,0xd5,0x3f,0xf6,0x0c,0xd5,0x3f, + 0xf6,0x0c,0xd5,0x3f,0xf6,0x0c,0xd5,0x3f, + 0xf6,0x0c,0xd5,0x3f,0xf6,0x0c,0xd5,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/30hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/30hz_16khz.conf new file mode 100644 index 000000000000..bc5013ac9acd --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/30hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x63,0xd7,0x3d,0x3f,0x63,0xd7,0x3d,0x3f, + 0x63,0xd7,0x3d,0x3f,0x63,0xd7,0x3d,0x3f, + 0x63,0xd7,0x3d,0x3f,0x63,0xd7,0x3d,0x3f, + 0x63,0xd7,0x3d,0x3f,0x63,0xd7,0x3d,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/30hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/30hz_48khz.conf new file mode 100644 index 000000000000..c4a21f83a10c --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/30hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xa6,0x88,0xbf,0x3f,0xa6,0x88,0xbf,0x3f, + 0xa6,0x88,0xbf,0x3f,0xa6,0x88,0xbf,0x3f, + 0xa6,0x88,0xbf,0x3f,0xa6,0x88,0xbf,0x3f, + 0xa6,0x88,0xbf,0x3f,0xa6,0x88,0xbf,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/40hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/40hz_16khz.conf new file mode 100644 index 000000000000..5552350b9da3 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/40hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x3c,0x9d,0xfc,0x3e,0x3c,0x9d,0xfc,0x3e, + 0x3c,0x9d,0xfc,0x3e,0x3c,0x9d,0xfc,0x3e, + 0x3c,0x9d,0xfc,0x3e,0x3c,0x9d,0xfc,0x3e, + 0x3c,0x9d,0xfc,0x3e,0x3c,0x9d,0xfc,0x3e" +} diff --git a/tools/topology/topology2/include/components/dcblock/40hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/40hz_48khz.conf new file mode 100644 index 000000000000..77b497ba73a1 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/40hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x22,0xfd,0xa9,0x3f,0x22,0xfd,0xa9,0x3f, + 0x22,0xfd,0xa9,0x3f,0x22,0xfd,0xa9,0x3f, + 0x22,0xfd,0xa9,0x3f,0x22,0xfd,0xa9,0x3f, + 0x22,0xfd,0xa9,0x3f,0x22,0xfd,0xa9,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/50hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/50hz_16khz.conf new file mode 100644 index 000000000000..81e6cf5db9ea --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/50hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe6,0x21,0xbb,0x3e,0xe6,0x21,0xbb,0x3e, + 0xe6,0x21,0xbb,0x3e,0xe6,0x21,0xbb,0x3e, + 0xe6,0x21,0xbb,0x3e,0xe6,0x21,0xbb,0x3e, + 0xe6,0x21,0xbb,0x3e,0xe6,0x21,0xbb,0x3e" +} diff --git a/tools/topology/topology2/include/components/dcblock/50hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/50hz_48khz.conf new file mode 100644 index 000000000000..ced86dd64d0e --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/50hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x6a,0x6a,0x94,0x3f,0x6a,0x6a,0x94,0x3f, + 0x6a,0x6a,0x94,0x3f,0x6a,0x6a,0x94,0x3f, + 0x6a,0x6a,0x94,0x3f,0x6a,0x6a,0x94,0x3f, + 0x6a,0x6a,0x94,0x3f,0x6a,0x6a,0x94,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/80hz_16khz.conf b/tools/topology/topology2/include/components/dcblock/80hz_16khz.conf new file mode 100644 index 000000000000..0bb539df5288 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/80hz_16khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x96,0x27,0xf5,0x3d,0x96,0x27,0xf5,0x3d, + 0x96,0x27,0xf5,0x3d,0x96,0x27,0xf5,0x3d, + 0x96,0x27,0xf5,0x3d,0x96,0x27,0xf5,0x3d, + 0x96,0x27,0xf5,0x3d,0x96,0x27,0xf5,0x3d" +} diff --git a/tools/topology/topology2/include/components/dcblock/80hz_48khz.conf b/tools/topology/topology2/include/components/dcblock/80hz_48khz.conf new file mode 100644 index 000000000000..7be93fe17c22 --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/80hz_48khz.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfa,0x86,0x53,0x3f,0xfa,0x86,0x53,0x3f, + 0xfa,0x86,0x53,0x3f,0xfa,0x86,0x53,0x3f, + 0xfa,0x86,0x53,0x3f,0xfa,0x86,0x53,0x3f, + 0xfa,0x86,0x53,0x3f,0xfa,0x86,0x53,0x3f" +} diff --git a/tools/topology/topology2/include/components/dcblock/default.conf b/tools/topology/topology2/include/components/dcblock/default.conf new file mode 100644 index 000000000000..cbadfc6c6cbd --- /dev/null +++ b/tools/topology/topology2/include/components/dcblock/default.conf @@ -0,0 +1,13 @@ +# Exported with script example_dcblock.m 04-Oct-2023 +# cd tools/tune/dcblock; octave example_dcblock.m +Object.Base.data."dcblock_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0x51,0xb8,0x3e,0xec,0x51,0xb8,0x3e, + 0xec,0x51,0xb8,0x3e,0xec,0x51,0xb8,0x3e, + 0xec,0x51,0xb8,0x3e,0xec,0x51,0xb8,0x3e, + 0xec,0x51,0xb8,0x3e,0xec,0x51,0xb8,0x3e" +} From a292c9cf257d1dbbc0fec516ec678b7c6014aebc Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 30 Aug 2023 15:49:28 +0300 Subject: [PATCH 534/639] Tools: Topology2: Build topologies to test processing components This patch uses cavs-benchmark-hda.conf to build topologies to test components in a simple playback and capture configuration. host copier --> component --> DAI copier host copier <-- component <-- DAI copier The built topologies are sof-hda-benchmark-dcblock16/24/32-tgl.tplg The shell script bench_comp_generate.sh is added to conveniently generate include files needed to build new test topologies for component with s16/s24/s32 format. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/cavs-benchmark-hda.conf | 292 ++++++++++-------- .../topology2/development/tplg-targets.cmake | 11 +- .../include/bench/bench_comp_generate.sh | 104 +++++++ .../bench/dcblock_control_bytes_capture.conf | 8 + .../bench/dcblock_control_bytes_playback.conf | 8 + .../include/bench/dcblock_hda_route.conf | 19 ++ .../topology2/include/bench/dcblock_s16.conf | 13 + .../topology2/include/bench/dcblock_s24.conf | 13 + .../topology2/include/bench/dcblock_s32.conf | 13 + .../bench/host_io_gateway_pipelines_s16.conf | 126 ++++++++ .../bench/host_io_gateway_pipelines_s24.conf | 126 ++++++++ .../bench/host_io_gateway_pipelines_s32.conf | 126 ++++++++ .../bench/one_input_output_format_s16.conf | 13 + .../bench/one_input_output_format_s24.conf | 13 + .../bench/one_input_output_format_s32.conf | 13 + 15 files changed, 758 insertions(+), 140 deletions(-) create mode 100755 tools/topology/topology2/include/bench/bench_comp_generate.sh create mode 100644 tools/topology/topology2/include/bench/dcblock_control_bytes_capture.conf create mode 100644 tools/topology/topology2/include/bench/dcblock_control_bytes_playback.conf create mode 100644 tools/topology/topology2/include/bench/dcblock_hda_route.conf create mode 100644 tools/topology/topology2/include/bench/dcblock_s16.conf create mode 100644 tools/topology/topology2/include/bench/dcblock_s24.conf create mode 100644 tools/topology/topology2/include/bench/dcblock_s32.conf create mode 100644 tools/topology/topology2/include/bench/host_io_gateway_pipelines_s16.conf create mode 100644 tools/topology/topology2/include/bench/host_io_gateway_pipelines_s24.conf create mode 100644 tools/topology/topology2/include/bench/host_io_gateway_pipelines_s32.conf create mode 100644 tools/topology/topology2/include/bench/one_input_output_format_s16.conf create mode 100644 tools/topology/topology2/include/bench/one_input_output_format_s24.conf create mode 100644 tools/topology/topology2/include/bench/one_input_output_format_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index e47866791af5..9cdb563846db 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -1,12 +1,9 @@ +<include/components/dcblock.conf> + Define { ANALOG_PLAYBACK_PCM 'Analog Playback' ANALOG_CAPTURE_PCM 'Analog Capture' - HDA_ANALOG_DAI_NAME 'Analog' - DEEP_BUFFER_PIPELINE_ID 15 - DEEP_BUFFER_PCM_ID 31 - DEEP_BUFFER_PIPELINE_SRC 'mixin.15.1' - DEEP_BUFFER_PIPELINE_SINK 'mixout.2.1' - DEEP_BUFFER_PCM_NAME 'Deepbuffer HDA Analog' + HDA_ANALOG_DAI_NAME 'Analog' } Object.Dai.HDA [ @@ -22,114 +19,6 @@ Object.Dai.HDA [ } ] -Object.Pipeline { - mixout-dai-copier-playback [ - { - index 3 - - Object.Widget.dai-copier.1 { - node_type $HDA_LINK_OUTPUT_CLASS - stream_name $HDA_ANALOG_DAI_NAME - dai_type "HDA" - copier_type "HDA" - } - } - ] - - mixout-aria-gain-mixin-playback [ - { - index 2 - - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume' - } - } - Object.Widget.aria.1 { - num_input_audio_formats 1 - num_output_audio_formats 1 - # 32-bit 48KHz 2ch - Object.Base.input_audio_format [ - { - in_bit_depth 32 - in_valid_bit_depth 32 - } - ] - Object.Base.output_audio_format [ - { - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - Object.Control.bytes."1" { - name "SSP2 Aria Control" - } - } - } - ] - - host-copier-gain-mixin-playback [ - { - index 1 - - Object.Widget.host-copier.1 { - stream_name $ANALOG_PLAYBACK_PCM - pcm_id 0 - } - - Object.Widget.gain.1 { - Object.Control.mixer.1 { - name 'Pre Mixer $ANALOG_PLAYBACK_PCM Volume' - } - } - } - ] - - host-gateway-capture [ - { - index 3 - Object.Widget.host-copier.1 { - stream_name $ANALOG_CAPTURE_PCM - pcm_id 0 - } - } - ] - - highpass-capture-be [ - { - index 4 - direction capture - - Object.Widget.dai-copier."1" { - dai_type "HDA" - type "dai_out" - copier_type "HDA" - stream_name $HDA_ANALOG_DAI_NAME - node_type $HDA_LINK_INPUT_CLASS - num_output_pins 1 - num_input_audio_formats 1 - num_output_audio_formats 1 - Object.Base.input_audio_format [ - { - in_bit_depth 32 - in_valid_bit_depth 32 - } - ] - Object.Base.output_audio_format [ - { - out_bit_depth 32 - out_valid_bit_depth 32 - } - ] - } - Object.Widget.eqiir.1 { - Object.Control.bytes."1" { - name '$ANALOG_CAPTURE_PCM IIR Eq' - } - } - } - ] -} Object.PCM.pcm [ { id 0 @@ -151,30 +40,159 @@ Object.PCM.pcm [ } ] -# top-level pipeline connections -Object.Base.route [ - { - sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' - source 'mixout.3.1' - } - { - source 'mixin.2.1' - sink 'mixout.3.1' - } - { - source 'mixin.1.1' - sink 'mixout.2.1' +IncludeByKey.BENCH_CONFIG { + "benchmark" { + Object.Pipeline { + mixout-dai-copier-playback [ + { + index 3 + + Object.Widget.dai-copier.1 { + node_type $HDA_LINK_OUTPUT_CLASS + stream_name $HDA_ANALOG_DAI_NAME + dai_type "HDA" + copier_type "HDA" + } + } + ] + + mixout-aria-gain-mixin-playback [ + { + index 2 + + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Post Mixer $ANALOG_PLAYBACK_PCM Volume' + } + } + Object.Widget.aria.1 { + num_input_audio_formats 1 + num_output_audio_formats 1 + # 32-bit 48KHz 2ch + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + Object.Control.bytes."1" { + name "SSP2 Aria Control" + } + } + } + ] + + host-copier-gain-mixin-playback [ + { + index 1 + + Object.Widget.host-copier.1 { + stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 + } + + Object.Widget.gain.1 { + Object.Control.mixer.1 { + name 'Pre Mixer $ANALOG_PLAYBACK_PCM Volume' + } + } + } + ] + + host-gateway-capture [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 + } + } + ] + + highpass-capture-be [ + { + index 4 + direction capture + + Object.Widget.dai-copier."1" { + dai_type "HDA" + type "dai_out" + copier_type "HDA" + stream_name $HDA_ANALOG_DAI_NAME + node_type $HDA_LINK_INPUT_CLASS + num_output_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + Object.Widget.eqiir.1 { + Object.Control.bytes."1" { + name '$ANALOG_CAPTURE_PCM IIR Eq' + } + } + } + ] + } + + # top-level pipeline connections + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'mixout.3.1' + } + { + source 'mixin.2.1' + sink 'mixout.3.1' + } + { + source 'mixin.1.1' + sink 'mixout.2.1' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'eqiir.4.1' + } + { + source 'eqiir.4.1' + sink 'host-copier.0.capture' + } + { + source 'host-copier.0.playback' + sink 'gain.1.1' + } + ] } - { - source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' - sink 'eqiir.4.1' + + # + # DCblock component + # + + "dcblock16" { + <include/bench/dcblock_s16.conf> } - { - source 'eqiir.4.1' - sink 'host-copier.0.capture' + + "dcblock24" { + <include/bench/dcblock_s24.conf> } - { - source 'host-copier.0.playback' - sink 'gain.1.1' + + "dcblock32" { + <include/bench/dcblock_s32.conf> } -] +} diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 27e9aab73f7b..6923eb51bff9 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -116,9 +116,14 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-nocodec-bt-mtl-lbm.bin" # CAVS HDA topology for benchmarking performance # Copier - peak volume - mixin - mixout - aria - peak volume - mixin - mixout - copier -"sof-hda-generic\;sof-hda-benchmark-generic-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,USE_CHAIN_DMA=true" -"sof-hda-generic\;sof-hda-benchmark-generic-mtl\;PLATFORM=MTL,HDA_CONFIG=benchmark,USE_CHAIN_DMA=true" -"sof-hda-generic\;sof-hda-benchmark-generic-lnl\;PLATFORM=LNL,HDA_CONFIG=benchmark,USE_CHAIN_DMA=true" +"sof-hda-generic\;sof-hda-benchmark-generic-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,USE_CHAIN_DMA=true,BENCH_CONFIG=benchmark" +"sof-hda-generic\;sof-hda-benchmark-generic-mtl\;PLATFORM=MTL,HDA_CONFIG=benchmark,USE_CHAIN_DMA=true,BENCH_CONFIG=benchmark" +"sof-hda-generic\;sof-hda-benchmark-generic-lnl\;PLATFORM=LNL,HDA_CONFIG=benchmark,USE_CHAIN_DMA=true,BENCH_CONFIG=benchmark" + +# Test topologies for simple one source and sink processing components +"sof-hda-generic\;sof-hda-benchmark-dcblock16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=dcblock16,BENCH_DCBLOCK_PARAMS=default" +"sof-hda-generic\;sof-hda-benchmark-dcblock24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=dcblock24,BENCH_DCBLOCK_PARAMS=default" +"sof-hda-generic\;sof-hda-benchmark-dcblock32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=dcblock32,BENCH_DCBLOCK_PARAMS=default" # Topology to test IPC4 Crossover "development/cavs-nocodec-crossover\;sof-tgl-nocodec-crossover-2way\;PLATFORM=tgl,\ diff --git a/tools/topology/topology2/include/bench/bench_comp_generate.sh b/tools/topology/topology2/include/bench/bench_comp_generate.sh new file mode 100755 index 000000000000..2fe84698360b --- /dev/null +++ b/tools/topology/topology2/include/bench/bench_comp_generate.sh @@ -0,0 +1,104 @@ +#!/bin/bash + +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2023 Intel Corporation. All rights reserved. + +set -e + +main () { + if [ "$#" -ne 1 ]; then + echo "Usage: $0 <component>" + exit 1 + fi + comp=$1 + FULL_CMD=( "$0" "$@" ) + generate_comp "s16" + generate_comp "s24" + generate_comp "s32" + generate_route + generate_playback_controls + generate_capture_controls +} + +generate_comp () +{ + format=$1 + fn=${comp}_${format}.conf + echo Creating file "$fn" + cat > "$fn" <<EOF_COMP + # Created with script "${FULL_CMD[@]}" + Object.Widget.${comp}.1 { + index 1 + <include/bench/one_input_output_format_${format}.conf> + <include/bench/${comp}_control_bytes_playback.conf> + } + Object.Widget.${comp}.2 { + index 3 + <include/bench/one_input_output_format_${format}.conf> + <include/bench/${comp}_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_${format}.conf> + <include/bench/${comp}_hda_route.conf> +EOF_COMP +} + +generate_route () +{ + fn=${comp}_hda_route.conf + echo Creating file "$fn" + cat > "$fn" <<EOF_ROUTE + # Created with script "${FULL_CMD[@]}" + Object.Base.route [ + { + sink 'dai-copier.HDA.\$HDA_ANALOG_DAI_NAME.playback' + source '${comp}.1.1' + } + { + sink '${comp}.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.\$HDA_ANALOG_DAI_NAME.capture' + sink '${comp}.3.2' + } + { + source '${comp}.3.2' + sink 'host-copier.0.capture' + } + ] +EOF_ROUTE +} + +generate_playback_controls () +{ + fn=${comp}_control_bytes_playback.conf + echo Creating file "$fn" + cat > "$fn" <<EOF_PLAYBACK_BYTES + # Created initially with script "${FULL_CMD[@]}" + # may need edits to modify controls + Object.Control.bytes."1" { + name '\$ANALOG_PLAYBACK_PCM ${comp^^} bytes' + IncludeByKey.BENCH_${comp^^}_PARAMS { + "default" "include/components/${comp}/default.conf" + } + } +EOF_PLAYBACK_BYTES +} + +generate_capture_controls () +{ + fn=${comp}_control_bytes_capture.conf + echo Creating file "$fn" + cat > "$fn" <<EOF_CAPTURE_BYTES + # Created initially with script "${FULL_CMD[@]}" + # may need edits to modify controls + Object.Control.bytes."1" { + name '\$ANALOG_CAPTURE_PCM ${comp^^} bytes' + IncludeByKey.BENCH_${comp^^}_PARAMS { + "default" "include/components/${comp}/default.conf" + } + } +EOF_CAPTURE_BYTES +} + +main "$@" diff --git a/tools/topology/topology2/include/bench/dcblock_control_bytes_capture.conf b/tools/topology/topology2/include/bench/dcblock_control_bytes_capture.conf new file mode 100644 index 000000000000..3d39d5cc8874 --- /dev/null +++ b/tools/topology/topology2/include/bench/dcblock_control_bytes_capture.conf @@ -0,0 +1,8 @@ + # Created initially with script "./bench_comp_generate.sh dcblock" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_CAPTURE_PCM DCBLOCK bytes' + IncludeByKey.BENCH_DCBLOCK_PARAMS { + "default" "include/components/dcblock/default.conf" + } + } diff --git a/tools/topology/topology2/include/bench/dcblock_control_bytes_playback.conf b/tools/topology/topology2/include/bench/dcblock_control_bytes_playback.conf new file mode 100644 index 000000000000..09885bcf561f --- /dev/null +++ b/tools/topology/topology2/include/bench/dcblock_control_bytes_playback.conf @@ -0,0 +1,8 @@ + # Created initially with script "./bench_comp_generate.sh dcblock" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_PLAYBACK_PCM DCBLOCK bytes' + IncludeByKey.BENCH_DCBLOCK_PARAMS { + "default" "include/components/dcblock/default.conf" + } + } diff --git a/tools/topology/topology2/include/bench/dcblock_hda_route.conf b/tools/topology/topology2/include/bench/dcblock_hda_route.conf new file mode 100644 index 000000000000..2b494c67e839 --- /dev/null +++ b/tools/topology/topology2/include/bench/dcblock_hda_route.conf @@ -0,0 +1,19 @@ + # Created with script "./bench_comp_generate.sh dcblock" + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'dcblock.1.1' + } + { + sink 'dcblock.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'dcblock.3.2' + } + { + source 'dcblock.3.2' + sink 'host-copier.0.capture' + } + ] diff --git a/tools/topology/topology2/include/bench/dcblock_s16.conf b/tools/topology/topology2/include/bench/dcblock_s16.conf new file mode 100644 index 000000000000..ae90114a2a16 --- /dev/null +++ b/tools/topology/topology2/include/bench/dcblock_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh dcblock" + Object.Widget.dcblock.1 { + index 1 + <include/bench/one_input_output_format_s16.conf> + <include/bench/dcblock_control_bytes_playback.conf> + } + Object.Widget.dcblock.2 { + index 3 + <include/bench/one_input_output_format_s16.conf> + <include/bench/dcblock_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s16.conf> + <include/bench/dcblock_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/dcblock_s24.conf b/tools/topology/topology2/include/bench/dcblock_s24.conf new file mode 100644 index 000000000000..ae24936a05a9 --- /dev/null +++ b/tools/topology/topology2/include/bench/dcblock_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh dcblock" + Object.Widget.dcblock.1 { + index 1 + <include/bench/one_input_output_format_s24.conf> + <include/bench/dcblock_control_bytes_playback.conf> + } + Object.Widget.dcblock.2 { + index 3 + <include/bench/one_input_output_format_s24.conf> + <include/bench/dcblock_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s24.conf> + <include/bench/dcblock_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/dcblock_s32.conf b/tools/topology/topology2/include/bench/dcblock_s32.conf new file mode 100644 index 000000000000..37bea24dd7a3 --- /dev/null +++ b/tools/topology/topology2/include/bench/dcblock_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh dcblock" + Object.Widget.dcblock.1 { + index 1 + <include/bench/one_input_output_format_s32.conf> + <include/bench/dcblock_control_bytes_playback.conf> + } + Object.Widget.dcblock.2 { + index 3 + <include/bench/one_input_output_format_s32.conf> + <include/bench/dcblock_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s32.conf> + <include/bench/dcblock_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s16.conf b/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s16.conf new file mode 100644 index 000000000000..b6ecea830367 --- /dev/null +++ b/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s16.conf @@ -0,0 +1,126 @@ + Object.Pipeline { + host-gateway-playback [ + { + index 1 + + Object.Widget.host-copier.1 { + stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 + num_input_audio_formats 3 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } + ] + + io-gateway [ + { + index 2 + direction playback + + Object.Widget.dai-copier.1 { + node_type $HDA_LINK_OUTPUT_CLASS + stream_name $HDA_ANALOG_DAI_NAME + dai_type "HDA" + copier_type "HDA" + num_input_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + host-gateway-capture [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 + num_input_audio_formats 1 + num_output_audio_formats 3 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + io-gateway-capture [ + { + index 4 + direction capture + + Object.Widget.dai-copier."1" { + dai_type "HDA" + type "dai_out" + copier_type "HDA" + stream_name $HDA_ANALOG_DAI_NAME + node_type $HDA_LINK_INPUT_CLASS + num_output_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } + ] + } + diff --git a/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s24.conf b/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s24.conf new file mode 100644 index 000000000000..4cac2acd2b8b --- /dev/null +++ b/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s24.conf @@ -0,0 +1,126 @@ + Object.Pipeline { + host-gateway-playback [ + { + index 1 + + Object.Widget.host-copier.1 { + stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 + num_input_audio_formats 3 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + ] + } + } + ] + + io-gateway [ + { + index 2 + direction playback + + Object.Widget.dai-copier.1 { + node_type $HDA_LINK_OUTPUT_CLASS + stream_name $HDA_ANALOG_DAI_NAME + dai_type "HDA" + copier_type "HDA" + num_input_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + host-gateway-capture [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 + num_input_audio_formats 1 + num_output_audio_formats 3 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + io-gateway-capture [ + { + index 4 + direction capture + + Object.Widget.dai-copier."1" { + dai_type "HDA" + type "dai_out" + copier_type "HDA" + stream_name $HDA_ANALOG_DAI_NAME + node_type $HDA_LINK_INPUT_CLASS + num_output_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + ] + } + } + ] + } + diff --git a/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s32.conf b/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s32.conf new file mode 100644 index 000000000000..c598efcd3e06 --- /dev/null +++ b/tools/topology/topology2/include/bench/host_io_gateway_pipelines_s32.conf @@ -0,0 +1,126 @@ + Object.Pipeline { + host-gateway-playback [ + { + index 1 + + Object.Widget.host-copier.1 { + stream_name $ANALOG_PLAYBACK_PCM + pcm_id 0 + num_input_audio_formats 3 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + io-gateway [ + { + index 2 + direction playback + + Object.Widget.dai-copier.1 { + node_type $HDA_LINK_OUTPUT_CLASS + stream_name $HDA_ANALOG_DAI_NAME + dai_type "HDA" + copier_type "HDA" + num_input_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + host-gateway-capture [ + { + index 3 + Object.Widget.host-copier.1 { + stream_name $ANALOG_CAPTURE_PCM + pcm_id 0 + num_input_audio_formats 1 + num_output_audio_formats 3 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + + io-gateway-capture [ + { + index 4 + direction capture + + Object.Widget.dai-copier."1" { + dai_type "HDA" + type "dai_out" + copier_type "HDA" + stream_name $HDA_ANALOG_DAI_NAME + node_type $HDA_LINK_INPUT_CLASS + num_output_pins 1 + num_input_audio_formats 1 + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + ] + } + diff --git a/tools/topology/topology2/include/bench/one_input_output_format_s16.conf b/tools/topology/topology2/include/bench/one_input_output_format_s16.conf new file mode 100644 index 000000000000..2f23335b7c6d --- /dev/null +++ b/tools/topology/topology2/include/bench/one_input_output_format_s16.conf @@ -0,0 +1,13 @@ + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + diff --git a/tools/topology/topology2/include/bench/one_input_output_format_s24.conf b/tools/topology/topology2/include/bench/one_input_output_format_s24.conf new file mode 100644 index 000000000000..4d83f5426dc1 --- /dev/null +++ b/tools/topology/topology2/include/bench/one_input_output_format_s24.conf @@ -0,0 +1,13 @@ + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 24 + out_bit_depth 32 + out_valid_bit_depth 24 + } + ] + diff --git a/tools/topology/topology2/include/bench/one_input_output_format_s32.conf b/tools/topology/topology2/include/bench/one_input_output_format_s32.conf new file mode 100644 index 000000000000..5ef867327013 --- /dev/null +++ b/tools/topology/topology2/include/bench/one_input_output_format_s32.conf @@ -0,0 +1,13 @@ + num_input_audio_formats 1 + num_output_audio_formats 1 + + # 32-bit 48KHz 2ch + Object.Base.audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + From 501816a90a6ff25e3cd5a9b9f3c76e32b079c8ad Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 27 Sep 2023 16:54:47 +0300 Subject: [PATCH 535/639] Tools: Topology2: Add sof-hda-benchmark-drc16/24/32-tgl build This patch adds DRC test topologies build. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/cavs-benchmark-hda.conf | 16 ++++++++++++++++ .../topology2/development/tplg-targets.cmake | 3 +++ .../bench/drc_control_bytes_capture.conf | 10 ++++++++++ .../bench/drc_control_bytes_playback.conf | 10 ++++++++++ .../include/bench/drc_hda_route.conf | 19 +++++++++++++++++++ .../topology2/include/bench/drc_s16.conf | 13 +++++++++++++ .../topology2/include/bench/drc_s24.conf | 13 +++++++++++++ .../topology2/include/bench/drc_s32.conf | 13 +++++++++++++ 8 files changed, 97 insertions(+) create mode 100644 tools/topology/topology2/include/bench/drc_control_bytes_capture.conf create mode 100644 tools/topology/topology2/include/bench/drc_control_bytes_playback.conf create mode 100644 tools/topology/topology2/include/bench/drc_hda_route.conf create mode 100644 tools/topology/topology2/include/bench/drc_s16.conf create mode 100644 tools/topology/topology2/include/bench/drc_s24.conf create mode 100644 tools/topology/topology2/include/bench/drc_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index 9cdb563846db..3cbfd0ce3ac5 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -195,4 +195,20 @@ IncludeByKey.BENCH_CONFIG { "dcblock32" { <include/bench/dcblock_s32.conf> } + + # + # DRC component + # + + "drc16" { + <include/bench/drc_s16.conf> + } + + "drc24" { + <include/bench/drc_s24.conf> + } + + "drc32" { + <include/bench/drc_s32.conf> + } } diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 6923eb51bff9..7f3cde6a2956 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -124,6 +124,9 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-nocodec-bt-mtl-lbm.bin" "sof-hda-generic\;sof-hda-benchmark-dcblock16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=dcblock16,BENCH_DCBLOCK_PARAMS=default" "sof-hda-generic\;sof-hda-benchmark-dcblock24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=dcblock24,BENCH_DCBLOCK_PARAMS=default" "sof-hda-generic\;sof-hda-benchmark-dcblock32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=dcblock32,BENCH_DCBLOCK_PARAMS=default" +"sof-hda-generic\;sof-hda-benchmark-drc16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=drc16,BENCH_DRC_PARAMS=enabled" +"sof-hda-generic\;sof-hda-benchmark-drc24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=drc24,BENCH_DRC_PARAMS=enabled" +"sof-hda-generic\;sof-hda-benchmark-drc32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=drc32,BENCH_DRC_PARAMS=enabled" # Topology to test IPC4 Crossover "development/cavs-nocodec-crossover\;sof-tgl-nocodec-crossover-2way\;PLATFORM=tgl,\ diff --git a/tools/topology/topology2/include/bench/drc_control_bytes_capture.conf b/tools/topology/topology2/include/bench/drc_control_bytes_capture.conf new file mode 100644 index 000000000000..f688576394ac --- /dev/null +++ b/tools/topology/topology2/include/bench/drc_control_bytes_capture.conf @@ -0,0 +1,10 @@ + # Created initially with script "./bench_comp_generate.sh drc" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_CAPTURE_PCM DRC bytes' + IncludeByKey.BENCH_DRC_PARAMS { + "default" "include/components/drc/default.conf" + "enabled" "include/components/drc/enabled.conf" + "passthrough" "include/components/drc/passthrough.conf" + } + } diff --git a/tools/topology/topology2/include/bench/drc_control_bytes_playback.conf b/tools/topology/topology2/include/bench/drc_control_bytes_playback.conf new file mode 100644 index 000000000000..ce7438e91410 --- /dev/null +++ b/tools/topology/topology2/include/bench/drc_control_bytes_playback.conf @@ -0,0 +1,10 @@ + # Created initially with script "./bench_comp_generate.sh drc" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_PLAYBACK_PCM DRC bytes' + IncludeByKey.BENCH_DRC_PARAMS { + "default" "include/components/drc/default.conf" + "enabled" "include/components/drc/enabled.conf" + "passthrough" "include/components/drc/passthrough.conf" + } + } diff --git a/tools/topology/topology2/include/bench/drc_hda_route.conf b/tools/topology/topology2/include/bench/drc_hda_route.conf new file mode 100644 index 000000000000..8e9f475bd777 --- /dev/null +++ b/tools/topology/topology2/include/bench/drc_hda_route.conf @@ -0,0 +1,19 @@ + # Created with script "./bench_comp_generate.sh drc" + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'drc.1.1' + } + { + sink 'drc.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'drc.3.2' + } + { + source 'drc.3.2' + sink 'host-copier.0.capture' + } + ] diff --git a/tools/topology/topology2/include/bench/drc_s16.conf b/tools/topology/topology2/include/bench/drc_s16.conf new file mode 100644 index 000000000000..7d02416c1eac --- /dev/null +++ b/tools/topology/topology2/include/bench/drc_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh drc" + Object.Widget.drc.1 { + index 1 + <include/bench/one_input_output_format_s16.conf> + <include/bench/drc_control_bytes_playback.conf> + } + Object.Widget.drc.2 { + index 3 + <include/bench/one_input_output_format_s16.conf> + <include/bench/drc_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s16.conf> + <include/bench/drc_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/drc_s24.conf b/tools/topology/topology2/include/bench/drc_s24.conf new file mode 100644 index 000000000000..c0d9689a7908 --- /dev/null +++ b/tools/topology/topology2/include/bench/drc_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh drc" + Object.Widget.drc.1 { + index 1 + <include/bench/one_input_output_format_s24.conf> + <include/bench/drc_control_bytes_playback.conf> + } + Object.Widget.drc.2 { + index 3 + <include/bench/one_input_output_format_s24.conf> + <include/bench/drc_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s24.conf> + <include/bench/drc_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/drc_s32.conf b/tools/topology/topology2/include/bench/drc_s32.conf new file mode 100644 index 000000000000..0ca828c30ec4 --- /dev/null +++ b/tools/topology/topology2/include/bench/drc_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh drc" + Object.Widget.drc.1 { + index 1 + <include/bench/one_input_output_format_s32.conf> + <include/bench/drc_control_bytes_playback.conf> + } + Object.Widget.drc.2 { + index 3 + <include/bench/one_input_output_format_s32.conf> + <include/bench/drc_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s32.conf> + <include/bench/drc_hda_route.conf> From 311c03026f1569f77f38788a995e6b6fe2940b84 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 5 Sep 2023 13:37:38 +0300 Subject: [PATCH 536/639] Tools: Topology2: Add sof-hda-benchmark-eqiir16/24/32-tgl generate This patch adds IIR EQ topologies build. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/cavs-benchmark-hda.conf | 16 ++++++++++++++++ .../topology2/development/tplg-targets.cmake | 3 +++ .../bench/eqiir_control_bytes_capture.conf | 9 +++++++++ .../bench/eqiir_control_bytes_playback.conf | 9 +++++++++ .../include/bench/eqiir_hda_route.conf | 19 +++++++++++++++++++ .../topology2/include/bench/eqiir_s16.conf | 13 +++++++++++++ .../topology2/include/bench/eqiir_s24.conf | 13 +++++++++++++ .../topology2/include/bench/eqiir_s32.conf | 13 +++++++++++++ 8 files changed, 95 insertions(+) create mode 100644 tools/topology/topology2/include/bench/eqiir_control_bytes_capture.conf create mode 100644 tools/topology/topology2/include/bench/eqiir_control_bytes_playback.conf create mode 100644 tools/topology/topology2/include/bench/eqiir_hda_route.conf create mode 100644 tools/topology/topology2/include/bench/eqiir_s16.conf create mode 100644 tools/topology/topology2/include/bench/eqiir_s24.conf create mode 100644 tools/topology/topology2/include/bench/eqiir_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index 3cbfd0ce3ac5..4e2ce8ebcf96 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -211,4 +211,20 @@ IncludeByKey.BENCH_CONFIG { "drc32" { <include/bench/drc_s32.conf> } + + # + # EQIIR component + # + + "eqiir16" { + <include/bench/eqiir_s16.conf> + } + + "eqiir24" { + <include/bench/eqiir_s24.conf> + } + + "eqiir32" { + <include/bench/eqiir_s32.conf> + } } diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 7f3cde6a2956..6296d4bae51e 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -127,6 +127,9 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-nocodec-bt-mtl-lbm.bin" "sof-hda-generic\;sof-hda-benchmark-drc16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=drc16,BENCH_DRC_PARAMS=enabled" "sof-hda-generic\;sof-hda-benchmark-drc24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=drc24,BENCH_DRC_PARAMS=enabled" "sof-hda-generic\;sof-hda-benchmark-drc32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=drc32,BENCH_DRC_PARAMS=enabled" +"sof-hda-generic\;sof-hda-benchmark-eqiir16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqiir16,BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" +"sof-hda-generic\;sof-hda-benchmark-eqiir24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqiir24,BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" +"sof-hda-generic\;sof-hda-benchmark-eqiir32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqiir32,BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" # Topology to test IPC4 Crossover "development/cavs-nocodec-crossover\;sof-tgl-nocodec-crossover-2way\;PLATFORM=tgl,\ diff --git a/tools/topology/topology2/include/bench/eqiir_control_bytes_capture.conf b/tools/topology/topology2/include/bench/eqiir_control_bytes_capture.conf new file mode 100644 index 000000000000..a8b72846b969 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqiir_control_bytes_capture.conf @@ -0,0 +1,9 @@ + # Created initially with script "./bench_comp_generate.sh eqiir" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_CAPTURE_PCM EQIIR bytes' + IncludeByKey.BENCH_EQIIR_PARAMS { + "default" "include/components/eqiir/default.conf" + "highpass_50hz_0db_48khz" "include/components/eqiir/highpass_50hz_0db_48khz.conf" + } + } diff --git a/tools/topology/topology2/include/bench/eqiir_control_bytes_playback.conf b/tools/topology/topology2/include/bench/eqiir_control_bytes_playback.conf new file mode 100644 index 000000000000..5ae6ad905ee4 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqiir_control_bytes_playback.conf @@ -0,0 +1,9 @@ + # Created initially with script "./bench_comp_generate.sh eqiir" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_PLAYBACK_PCM EQIIR bytes' + IncludeByKey.BENCH_EQIIR_PARAMS { + "default" "include/components/eqiir/default.conf" + "highpass_50hz_0db_48khz" "include/components/eqiir/highpass_50hz_0db_48khz.conf" + } + } diff --git a/tools/topology/topology2/include/bench/eqiir_hda_route.conf b/tools/topology/topology2/include/bench/eqiir_hda_route.conf new file mode 100644 index 000000000000..5f066b741969 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqiir_hda_route.conf @@ -0,0 +1,19 @@ + # Created with script "./bench_comp_generate.sh eqiir" + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'eqiir.1.1' + } + { + sink 'eqiir.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'eqiir.3.2' + } + { + source 'eqiir.3.2' + sink 'host-copier.0.capture' + } + ] diff --git a/tools/topology/topology2/include/bench/eqiir_s16.conf b/tools/topology/topology2/include/bench/eqiir_s16.conf new file mode 100644 index 000000000000..bcb01383e3d5 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqiir_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh eqiir" + Object.Widget.eqiir.1 { + index 1 + <include/bench/one_input_output_format_s16.conf> + <include/bench/eqiir_control_bytes_playback.conf> + } + Object.Widget.eqiir.2 { + index 3 + <include/bench/one_input_output_format_s16.conf> + <include/bench/eqiir_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s16.conf> + <include/bench/eqiir_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/eqiir_s24.conf b/tools/topology/topology2/include/bench/eqiir_s24.conf new file mode 100644 index 000000000000..aa327545beec --- /dev/null +++ b/tools/topology/topology2/include/bench/eqiir_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh eqiir" + Object.Widget.eqiir.1 { + index 1 + <include/bench/one_input_output_format_s24.conf> + <include/bench/eqiir_control_bytes_playback.conf> + } + Object.Widget.eqiir.2 { + index 3 + <include/bench/one_input_output_format_s24.conf> + <include/bench/eqiir_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s24.conf> + <include/bench/eqiir_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/eqiir_s32.conf b/tools/topology/topology2/include/bench/eqiir_s32.conf new file mode 100644 index 000000000000..c6bf9b4e0fb7 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqiir_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh eqiir" + Object.Widget.eqiir.1 { + index 1 + <include/bench/one_input_output_format_s32.conf> + <include/bench/eqiir_control_bytes_playback.conf> + } + Object.Widget.eqiir.2 { + index 3 + <include/bench/one_input_output_format_s32.conf> + <include/bench/eqiir_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s32.conf> + <include/bench/eqiir_hda_route.conf> From df8f9dfc09aedb50dcb62984a928efcd83a03927 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 27 Sep 2023 18:53:18 +0300 Subject: [PATCH 537/639] Tools: Topology2: Add sof-hda-benchmark-eqfir16/24/32-tgl build This patch adds FIR EQ topologies build. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/cavs-benchmark-hda.conf | 16 ++++++++++++++++ .../topology2/development/tplg-targets.cmake | 3 +++ .../bench/eqfir_control_bytes_capture.conf | 10 ++++++++++ .../bench/eqfir_control_bytes_playback.conf | 10 ++++++++++ .../include/bench/eqfir_hda_route.conf | 19 +++++++++++++++++++ .../topology2/include/bench/eqfir_s16.conf | 13 +++++++++++++ .../topology2/include/bench/eqfir_s24.conf | 13 +++++++++++++ .../topology2/include/bench/eqfir_s32.conf | 13 +++++++++++++ 8 files changed, 97 insertions(+) create mode 100644 tools/topology/topology2/include/bench/eqfir_control_bytes_capture.conf create mode 100644 tools/topology/topology2/include/bench/eqfir_control_bytes_playback.conf create mode 100644 tools/topology/topology2/include/bench/eqfir_hda_route.conf create mode 100644 tools/topology/topology2/include/bench/eqfir_s16.conf create mode 100644 tools/topology/topology2/include/bench/eqfir_s24.conf create mode 100644 tools/topology/topology2/include/bench/eqfir_s32.conf diff --git a/tools/topology/topology2/cavs-benchmark-hda.conf b/tools/topology/topology2/cavs-benchmark-hda.conf index 4e2ce8ebcf96..ee6470447659 100644 --- a/tools/topology/topology2/cavs-benchmark-hda.conf +++ b/tools/topology/topology2/cavs-benchmark-hda.conf @@ -212,6 +212,22 @@ IncludeByKey.BENCH_CONFIG { <include/bench/drc_s32.conf> } + # + # EQFIR component + # + + "eqfir16" { + <include/bench/eqfir_s16.conf> + } + + "eqfir24" { + <include/bench/eqfir_s24.conf> + } + + "eqfir32" { + <include/bench/eqfir_s32.conf> + } + # # EQIIR component # diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 6296d4bae51e..528b9af59450 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -130,6 +130,9 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-nocodec-bt-mtl-lbm.bin" "sof-hda-generic\;sof-hda-benchmark-eqiir16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqiir16,BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" "sof-hda-generic\;sof-hda-benchmark-eqiir24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqiir24,BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" "sof-hda-generic\;sof-hda-benchmark-eqiir32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqiir32,BENCH_EQIIR_PARAMS=highpass_50hz_0db_48khz" +"sof-hda-generic\;sof-hda-benchmark-eqfir16-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqfir16,BENCH_EQFIR_PARAMS=loudness" +"sof-hda-generic\;sof-hda-benchmark-eqfir24-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqfir24,BENCH_EQFIR_PARAMS=loudness" +"sof-hda-generic\;sof-hda-benchmark-eqfir32-tgl\;PLATFORM=TGL,HDA_CONFIG=benchmark,BENCH_CONFIG=eqfir32,BENCH_EQFIR_PARAMS=loudness" # Topology to test IPC4 Crossover "development/cavs-nocodec-crossover\;sof-tgl-nocodec-crossover-2way\;PLATFORM=tgl,\ diff --git a/tools/topology/topology2/include/bench/eqfir_control_bytes_capture.conf b/tools/topology/topology2/include/bench/eqfir_control_bytes_capture.conf new file mode 100644 index 000000000000..a63e00c85ad9 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqfir_control_bytes_capture.conf @@ -0,0 +1,10 @@ + # Created initially with script "./bench_comp_generate.sh eqfir" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_CAPTURE_PCM EQFIR bytes' + IncludeByKey.BENCH_EQFIR_PARAMS { + "default" "include/components/eqfir/default.conf" + "loudness" "include/components/eqfir/loudness.conf" + "passthrough" "include/components/eqfir/passthrough.conf" + } + } diff --git a/tools/topology/topology2/include/bench/eqfir_control_bytes_playback.conf b/tools/topology/topology2/include/bench/eqfir_control_bytes_playback.conf new file mode 100644 index 000000000000..aa0c0c8da8ea --- /dev/null +++ b/tools/topology/topology2/include/bench/eqfir_control_bytes_playback.conf @@ -0,0 +1,10 @@ + # Created initially with script "./bench_comp_generate.sh eqfir" + # may need edits to modify controls + Object.Control.bytes."1" { + name '$ANALOG_PLAYBACK_PCM EQFIR bytes' + IncludeByKey.BENCH_EQFIR_PARAMS { + "default" "include/components/eqfir/default.conf" + "loudness" "include/components/eqfir/loudness.conf" + "passthrough" "include/components/eqfir/passthrough.conf" + } + } diff --git a/tools/topology/topology2/include/bench/eqfir_hda_route.conf b/tools/topology/topology2/include/bench/eqfir_hda_route.conf new file mode 100644 index 000000000000..fd30c793326c --- /dev/null +++ b/tools/topology/topology2/include/bench/eqfir_hda_route.conf @@ -0,0 +1,19 @@ + # Created with script "./bench_comp_generate.sh eqfir" + Object.Base.route [ + { + sink 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.playback' + source 'eqfir.1.1' + } + { + sink 'eqfir.1.1' + source 'host-copier.0.playback' + } + { + source 'dai-copier.HDA.$HDA_ANALOG_DAI_NAME.capture' + sink 'eqfir.3.2' + } + { + source 'eqfir.3.2' + sink 'host-copier.0.capture' + } + ] diff --git a/tools/topology/topology2/include/bench/eqfir_s16.conf b/tools/topology/topology2/include/bench/eqfir_s16.conf new file mode 100644 index 000000000000..461323944062 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqfir_s16.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh eqfir" + Object.Widget.eqfir.1 { + index 1 + <include/bench/one_input_output_format_s16.conf> + <include/bench/eqfir_control_bytes_playback.conf> + } + Object.Widget.eqfir.2 { + index 3 + <include/bench/one_input_output_format_s16.conf> + <include/bench/eqfir_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s16.conf> + <include/bench/eqfir_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/eqfir_s24.conf b/tools/topology/topology2/include/bench/eqfir_s24.conf new file mode 100644 index 000000000000..ce2b303fe8f3 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqfir_s24.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh eqfir" + Object.Widget.eqfir.1 { + index 1 + <include/bench/one_input_output_format_s24.conf> + <include/bench/eqfir_control_bytes_playback.conf> + } + Object.Widget.eqfir.2 { + index 3 + <include/bench/one_input_output_format_s24.conf> + <include/bench/eqfir_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s24.conf> + <include/bench/eqfir_hda_route.conf> diff --git a/tools/topology/topology2/include/bench/eqfir_s32.conf b/tools/topology/topology2/include/bench/eqfir_s32.conf new file mode 100644 index 000000000000..0e3dfa3732b4 --- /dev/null +++ b/tools/topology/topology2/include/bench/eqfir_s32.conf @@ -0,0 +1,13 @@ + # Created with script "./bench_comp_generate.sh eqfir" + Object.Widget.eqfir.1 { + index 1 + <include/bench/one_input_output_format_s32.conf> + <include/bench/eqfir_control_bytes_playback.conf> + } + Object.Widget.eqfir.2 { + index 3 + <include/bench/one_input_output_format_s32.conf> + <include/bench/eqfir_control_bytes_capture.conf> + } + <include/bench/host_io_gateway_pipelines_s32.conf> + <include/bench/eqfir_hda_route.conf> From c1b74bac9b2293213cd47e1138adfa357596a0bc Mon Sep 17 00:00:00 2001 From: Bard Liao <yung-chuan.liao@linux.intel.com> Date: Wed, 11 Oct 2023 16:28:42 +0800 Subject: [PATCH 538/639] topology2: sof-mtl-rt713-l0-rt1316-l12-rt1713-l3: use default stream name rt713 and rt1713 are in different SoundWire links. So, no DAI type will be appended to DAI link name. We should use default stream name in the topology. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 9b24382a4e5e..f505b1e4a4e9 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -35,10 +35,7 @@ SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" USE_CHAIN_DMA=true,NUM_SDW_AMP_LINKS=2,SDW_SPK_STREAM=SDW1-Playback,SDW_SPK_IN_STREAM=SDW1-Capture,\ SDW_DMIC_STREAM=SDW0-Capture" -"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-rt1713-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ -SDW_SPK_STREAM=Playback-SmartAmp,SDW_SPK_IN_STREAM=Capture-SmartAmp,\ -SDW_DMIC_STREAM=Capture-SmartMic,SDW_JACK_OUT_STREAM=Playback-SimpleJack,\ -SDW_JACK_IN_STREAM=Capture-SimpleJack" +"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-rt1713-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1" # Below topologies are used on Chromebooks "cavs-rt5682\;sof-mtl-max98357a-rt5682\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ From 868711c579914088670effe9bfb4d78ea175cc78 Mon Sep 17 00:00:00 2001 From: Marcin Szkudlinski <marcin.szkudlinski@intel.com> Date: Wed, 11 Oct 2023 10:23:50 +0200 Subject: [PATCH 539/639] dp: start DP tick fixup This is fixup for 689e8e999f220356f69b8532216790fed18a9da4 Incorrect list pointer has been used Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com> --- src/schedule/zephyr_dp_schedule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/schedule/zephyr_dp_schedule.c b/src/schedule/zephyr_dp_schedule.c index faa47adcf314..cdc5e6a8ad32 100644 --- a/src/schedule/zephyr_dp_schedule.c +++ b/src/schedule/zephyr_dp_schedule.c @@ -364,7 +364,7 @@ static int scheduler_dp_task_shedule(void *data, struct task *task, uint64_t sta } /* if there's no DP tasks scheduled yet, run ll tick source task */ - if (list_is_empty(&task->list)) + if (list_is_empty(&dp_sch->tasks)) schedule_task(&dp_sch->ll_tick_src, 0, 0); /* add a task to DP scheduler list */ From 15507ec9efbae5897fae9b296e56fc1dd1af63e8 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Mon, 11 Sep 2023 13:36:01 +0300 Subject: [PATCH 540/639] topology: Add MICFIL topology for imx8mp Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- tools/topology/topology1/CMakeLists.txt | 1 + tools/topology/topology1/m4/dai.m4 | 2 +- .../topology1/platform/common/micfil.m4 | 24 +++++++++++++ tools/topology/topology1/sof-imx8mp-micfil.m4 | 35 +++++++++++++++++++ tools/topology/topology1/sof/tokens.m4 | 4 +++ 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 tools/topology/topology1/platform/common/micfil.m4 create mode 100644 tools/topology/topology1/sof-imx8mp-micfil.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 53b4404941b9..4dce10b304a1 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -185,6 +185,7 @@ set(TPLGS "sof-imx8-wm8960-mixer\;sof-imx8mp-wm8960-mixer\;-DCODEC=wm8960\;-DRATE=48000\;-DSAI_INDEX=3" "sof-imx8-wm8960-mixer\;sof-imx8mp-wm8962-mixer\;-DCODEC=wm8962\;-DRATE=48000\;-DSAI_INDEX=3" "sof-imx8mp-wm8960-kwd\;sof-imx8mp-wm8960-kwd" + "sof-imx8mp-micfil\;sof-imx8mp-micfil" "sof-imx8mp-btsco-dual-8ch\;sof-imx8mp-btsco-dual-8ch" "sof-imx8-wm8960\;sof-imx8mp-wm8960\;-DCODEC=wm8960\;-DRATE=48000\;-DPPROC=volume\;-DSAI_INDEX=3" "sof-imx8-wm8960\;sof-imx8mp-wm8904\;-DCODEC=wm8904\;-DRATE=44100\;-DPPROC=volume\;-DSAI_INDEX=3" diff --git a/tools/topology/topology1/m4/dai.m4 b/tools/topology/topology1/m4/dai.m4 index 8f13db1504af..e4452c7376f0 100644 --- a/tools/topology/topology1/m4/dai.m4 +++ b/tools/topology/topology1/m4/dai.m4 @@ -155,7 +155,7 @@ define(`DO_DAI_CONFIG', `' ` id "'$3`"' `' -` ifelse($1, `SSP', $5, $1, `HDA', $5, $1, `ALH', $5, $1, `ESAI', $5, $1, `SAI', $5, $1, `AFE', $5, $1, `ACP', $5, $1, `ACPSP', $5, $1,`ACPSP_VIRTUAL', $5, $1, `ACPHS', $5, $1, `ACPHS_VIRTUAL', $5, $1, `ACPDMIC', $5, `}')' +` ifelse($1, `SSP', $5, $1, `HDA', $5, $1, `ALH', $5, $1, `ESAI', $5, $1, `SAI', $5, $1, `MICFIL', $5, $1, `AFE', $5, $1, `ACP', $5, $1, `ACPSP', $5, $1,`ACPSP_VIRTUAL', $5, $1, `ACPHS', $5, $1, `ACPHS_VIRTUAL', $5, $1, `ACPDMIC', $5, `}')' `ifelse($1, `DMIC', $5, `')' `SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_common" {' ` tokens "sof_dai_tokens"' diff --git a/tools/topology/topology1/platform/common/micfil.m4 b/tools/topology/topology1/platform/common/micfil.m4 new file mode 100644 index 000000000000..0adad8446afb --- /dev/null +++ b/tools/topology/topology1/platform/common/micfil.m4 @@ -0,0 +1,24 @@ +divert(-1) + +dnl MICFIL related macros + +define(`MICFIL_CONFIG', +`}' +$1 +) +dnl MICFIL_CONFIG_DATA(type, idx, rate, channel) +define(`MICFIL_CONFIG_DATA', +`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {' +` tokens "sof_micfil_tokens"' +` tuples."word" {' +` SOF_TKN_IMX_MICFIL_RATE' STR($3) +` SOF_TKN_IMX_MICFIL_CH' STR($4) +` }' +`}' +`SectionData."'N_DAI_CONFIG($1$2)`_data" {' +` tuples "'N_DAI_CONFIG($1$2)`_tuples"' +`}' +) + +divert(0)dnl + diff --git a/tools/topology/topology1/sof-imx8mp-micfil.m4 b/tools/topology/topology1/sof-imx8mp-micfil.m4 new file mode 100644 index 000000000000..f8bf88bb5335 --- /dev/null +++ b/tools/topology/topology1/sof-imx8mp-micfil.m4 @@ -0,0 +1,35 @@ +# +# Topology for i.MX8M with MICFIL found on IMX-AUD-HAT +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`micfil.m4') +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +#Include DSP configuration +include(`platform/imx/imx8.m4') + +#DMIC +# Capture pipeline 3 on PCM 1 using max 4 channels of s32le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 1, 0, 4, s32le, + 2000, 0, 0, + 48000, 48000, 48000) + +DAI_ADD(sof/pipe-dai-capture.m4, 1, MICFIL, 2, micfil-dmic-hifi, +PIPELINE_SINK_1, 2, s32le, 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +dnl DAI_CONFIG(type, dai_index, link_id, name, acpdmic_config) +DAI_CONFIG(MICFIL, 0, 0, micfil-dmic-hifi, + MICFIL_CONFIG(MICFIL_CONFIG_DATA(MICFIL, 0, 48000, 4))) + +# PCM id 1 +PCM_CAPTURE_ADD(MICFIL, 0, PIPELINE_PCM_1) +#/**********************************************************************************/ diff --git a/tools/topology/topology1/sof/tokens.m4 b/tools/topology/topology1/sof/tokens.m4 index 728b7478f538..d70ea05cc096 100644 --- a/tools/topology/topology1/sof/tokens.m4 +++ b/tools/topology/topology1/sof/tokens.m4 @@ -148,3 +148,7 @@ SectionVendorTokens."sof_acpdmic_tokens" { SOF_TKN_AMD_ACPDMIC_CH "1801" } +SectionVendorTokens."sof_micfil_tokens" { + SOF_TKN_IMX_MICFIL_RATE "2000" + SOF_TKN_IMX_MICFIL_CH "2001" +} From 52c4da5c9545f29a9e97d32bce5aab18c52845d2 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Thu, 5 Oct 2023 14:29:04 +0300 Subject: [PATCH 541/639] drivers: imx: sdma: Introduce new SDMA channel type Based on this we select proper firmware in order to support multi-fifo. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/sdma.c | 3 +++ src/include/sof/drivers/sdma.h | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/drivers/imx/sdma.c b/src/drivers/imx/sdma.c index 70d801f97f20..a68777d6f322 100644 --- a/src/drivers/imx/sdma.c +++ b/src/drivers/imx/sdma.c @@ -760,6 +760,9 @@ static int sdma_prep_desc(struct dma_chan_data *channel, case SDMA_CHAN_TYPE_SHP2MCU: sdma_script_addr = SDMA_SCRIPT_SHP2MCU_OFF; break; + case SDMA_CHAN_TYPE_SAI2MCU: + sdma_script_addr = SDMA_SCRIPT_SAI2MCU_OFF; + break; default: /* This case doesn't happen; we need to assign the other cases * for AP2MCU and MCU2AP diff --git a/src/include/sof/drivers/sdma.h b/src/include/sof/drivers/sdma.h index c5b8d0e1ff25..9aaefade044a 100644 --- a/src/include/sof/drivers/sdma.h +++ b/src/include/sof/drivers/sdma.h @@ -143,6 +143,8 @@ /* SHP2MCU is host to DAI, faster but only works with SDRAM */ #define SDMA_CHAN_TYPE_SHP2MCU 3 #define SDMA_CHAN_TYPE_MCU2SHP 4 +/* used for multi-fifo script */ +#define SDMA_CHAN_TYPE_SAI2MCU 5 /* TODO check and move these to platform data */ #define SDMA_SCRIPT_AP2AP_OFF 644 @@ -150,6 +152,7 @@ #define SDMA_SCRIPT_MCU2AP_OFF 749 #define SDMA_SCRIPT_SHP2MCU_OFF 893 #define SDMA_SCRIPT_MCU2SHP_OFF 962 +#define SDMA_SCRIPT_SAI2MCU_OFF 6710 #if CONFIG_HAVE_SDMA_FIRMWARE #include "sdma_script_code_imx7d_4_5.h" From fb1d4f80b5e1dbd50d140f2e1c513c705ba87cf6 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Thu, 5 Oct 2023 15:21:49 +0300 Subject: [PATCH 542/639] drivers: imx: sdma: Enable multi-fifo script for micfil MICFIL can support up to 8 channels. In order for this to work we need to use multi-fifo script. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/sdma.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/drivers/imx/sdma.c b/src/drivers/imx/sdma.c index a68777d6f322..393ec497c0a8 100644 --- a/src/drivers/imx/sdma.c +++ b/src/drivers/imx/sdma.c @@ -589,6 +589,7 @@ static int sdma_status(struct dma_chan_data *channel, break; case SDMA_CHAN_TYPE_AP2MCU: case SDMA_CHAN_TYPE_MCU2SHP: + case SDMA_CHAN_TYPE_SAI2MCU: status->r_pos = bd->buf_addr; status->w_pos = pdata->fifo_paddr; /* We cannot see the target address */ @@ -607,6 +608,8 @@ static int sdma_read_config(struct dma_chan_data *channel, { int i; struct sdma_chan *pdata = dma_chan_get_data(channel); + struct dai_data *dd = channel->dev_data; + uint32_t dma_dev = dd->dai->drv->dma_dev; switch (config->direction) { case DMA_DIR_MEM_TO_DEV: @@ -616,7 +619,10 @@ static int sdma_read_config(struct dma_chan_data *channel, break; case DMA_DIR_DEV_TO_MEM: pdata->hw_event = config->src_dev; - pdata->sdma_chan_type = SDMA_CHAN_TYPE_SHP2MCU; + if (dma_dev == DMA_DEV_MICFIL) + pdata->sdma_chan_type = SDMA_CHAN_TYPE_SAI2MCU; + else + pdata->sdma_chan_type = SDMA_CHAN_TYPE_SHP2MCU; pdata->fifo_paddr = config->elem_array.elems[0].src; break; case DMA_DIR_MEM_TO_MEM: From 5f0d6222e74540a8dd8b88aa420be60754df1821 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Tue, 10 Oct 2023 14:42:04 +0300 Subject: [PATCH 543/639] platform: imx8m: dai: Set FIFO depth for PDM On i.MX8MP PDM fifo has 32 entries (each with 4 bytes). Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/platform/imx8m/lib/dai.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/imx8m/lib/dai.c b/src/platform/imx8m/lib/dai.c index 3c684d0c2c6e..1293cdc6fd7f 100644 --- a/src/platform/imx8m/lib/dai.c +++ b/src/platform/imx8m/lib/dai.c @@ -156,6 +156,7 @@ static SHARED_DATA struct dai micfil[] = { .fifo[SOF_IPC_STREAM_CAPTURE] = { .offset = MICFIL_BASE + REG_MICFIL_DATACH0, .handshake = 24, + .depth = 32, /* in 4 bytes words */ }, }, From 4c7b69b1c4862a57a5c4b78932441bb66e869d14 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Fri, 13 Oct 2023 15:18:36 +0300 Subject: [PATCH 544/639] drivers: sdma: Set watermark level for PDM In order to enable PDM we need to use Multi-fifo support and mcu_2_sai RAM script. This script defines watermark level as follows: r7 = Watermark bit0~11: watermark level(wml*fifo_number) bit15~12: to do-fifo number bit16~19: fifo offset bit27~24: sw done selector bit28~31: # audio channels in one frame, 0: 1 channel,1: 2 channels bit23: sw done enabled Configuration parameters should come from DAI (PDM in our specific case) but there is no easy way to forward such information so we just make use of some default configuration, 4 fifos, 1 channel per fifo, sw done enabled. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/sdma.c | 51 ++++++++++++++++++++++++++++++++++ src/include/sof/drivers/sdma.h | 6 ++++ 2 files changed, 57 insertions(+) diff --git a/src/drivers/imx/sdma.c b/src/drivers/imx/sdma.c index 393ec497c0a8..937d6fdc699a 100644 --- a/src/drivers/imx/sdma.c +++ b/src/drivers/imx/sdma.c @@ -69,6 +69,9 @@ struct sdma_chan { int next_bd; int sdma_chan_type; int fifo_paddr; + + unsigned int watermark_level; + unsigned int sw_done_sel; /* software done selector */ }; /* Private data for the whole controller */ @@ -603,6 +606,47 @@ static int sdma_status(struct dma_chan_data *channel, return 0; } +static void sdma_set_watermarklevel(struct dma_chan_data *chan) +{ + struct sdma_chan *pdata = dma_chan_get_data(chan); + + /* TODO: retrieve this information from DAI */ + unsigned int n_fifos = 4; /* number of HW fifos used */ + unsigned int words_per_fifo = 1; /* number of audio channels per frame */ + + /* sw_done_sel mimics software done configuration from Linux + * see Documentation/devicetree/bindings/fsl-imx-sdma.txt + */ + unsigned int sw_done_sel = 0; + + /* sw_done_sel configuration + * - bit31: sw_done + * - bit15:8 selector + * - bit7-0 priority + */ + sw_done_sel |= BIT(31); + + /* watermark level: + * bit0~11: wartermark level(wml*fifo_number) + * bit15~12: to do-fifo number + * bit16~19: fifo offset + * bit27~24: sw done selector + * bit28~31: numbers of audio channels in one frame, 0: 1 channel,1: 2 channels + * bit23: sw done enable + */ + + pdata->watermark_level |= SDMA_WATERMARK_LEVEL_SW_DONE | + (sw_done_sel & 0xff) << SDMA_WATERMARK_LEVEL_SW_DONE_SEL_OFF; + + pdata->watermark_level |= + SDMA_WATERMARK_LEVEL_N_FIFOS(n_fifos); + + pdata->watermark_level |= + SDMA_WATERMARK_LEVEL_WORDS_PER_FIFO(words_per_fifo - 1); + + pdata->sw_done_sel = sw_done_sel; +} + static int sdma_read_config(struct dma_chan_data *channel, struct dma_sg_config *config) { @@ -779,6 +823,13 @@ static int sdma_prep_desc(struct dma_chan_data *channel, watermark = (config->burst_elems * width) / 8; + if (pdata->sdma_chan_type == SDMA_CHAN_TYPE_SAI2MCU) { + sdma_set_watermarklevel(channel); + watermark |= pdata->watermark_level; + } else { + watermark = (config->burst_elems * width) / 8; + } + memset(pdata->ctx, 0, sizeof(*pdata->ctx)); pdata->ctx->pc = sdma_script_addr; diff --git a/src/include/sof/drivers/sdma.h b/src/include/sof/drivers/sdma.h index 9aaefade044a..f084551d90ef 100644 --- a/src/include/sof/drivers/sdma.h +++ b/src/include/sof/drivers/sdma.h @@ -89,6 +89,12 @@ #define SDMA_DONE0_CONFIG 0x1000 #define SDMA_DONE1_CONFIG 0x1004 +#define SDMA_WATERMARK_LEVEL_N_FIFOS(x) SET_BITS(15, 12, x) +#define SDMA_WATERMARK_LEVEL_OFF_FIFOS(x) SET_BITS(19, 16, x) +#define SDMA_WATERMARK_LEVEL_WORDS_PER_FIFO(x) SET_BITS(31, 28, x) +#define SDMA_WATERMARK_LEVEL_SW_DONE BIT(23) +#define SDMA_WATERMARK_LEVEL_SW_DONE_SEL_OFF 24 + /* Buffer descriptor first word */ /* Count: Data buffer size, in words */ #define SDMA_BD_COUNT_MASK MASK(15, 0) From 8819667b0703623b32069bd0c5745fe87f4628d6 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Fri, 13 Oct 2023 15:23:17 +0300 Subject: [PATCH 545/639] drivers: imx: Select DONE bit from software With multi-fifo we need to enable done bit from software as we have multiple fifos. For this we make use of sw_done_sel configurations bits and write proper bits into SDMA_DONE0 register. For more information see `SDMA DONE0 Configuration (SDMAARMx_DONE0_CONFIG)` SDMA register from i.MX8 reference manual. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/sdma.c | 9 +++++++++ src/include/sof/drivers/sdma.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/src/drivers/imx/sdma.c b/src/drivers/imx/sdma.c index 937d6fdc699a..902bb03eb245 100644 --- a/src/drivers/imx/sdma.c +++ b/src/drivers/imx/sdma.c @@ -441,6 +441,8 @@ static struct dma_chan_data *sdma_channel_get(struct dma *dma, static void sdma_enable_event(struct dma_chan_data *channel, int eventnum) { + struct sdma_chan *pdata = dma_chan_get_data(channel); + tr_dbg(&sdma_tr, "sdma_enable_event(%d, %d)", channel->index, eventnum); if (eventnum < 0 || eventnum > SDMA_HWEVENTS_COUNT) @@ -448,6 +450,13 @@ static void sdma_enable_event(struct dma_chan_data *channel, int eventnum) dma_reg_update_bits(channel->dma, SDMA_CHNENBL(eventnum), BIT(channel->index), BIT(channel->index)); + + if (pdata->sw_done_sel & BIT(31)) { + unsigned int done0; + + done0 = SDMA_DONE0_CONFIG_DONE_SEL | ~SDMA_DONE0_CONFIG_DONE_DIS; + dma_reg_update_bits(channel->dma, SDMA_DONE0_CONFIG, 0xFF, done0); + } } static void sdma_disable_event(struct dma_chan_data *channel, int eventnum) diff --git a/src/include/sof/drivers/sdma.h b/src/include/sof/drivers/sdma.h index f084551d90ef..b00cf89316f0 100644 --- a/src/include/sof/drivers/sdma.h +++ b/src/include/sof/drivers/sdma.h @@ -89,6 +89,9 @@ #define SDMA_DONE0_CONFIG 0x1000 #define SDMA_DONE1_CONFIG 0x1004 +#define SDMA_DONE0_CONFIG_DONE_SEL BIT(7) +#define SDMA_DONE0_CONFIG_DONE_DIS BIT(6) + #define SDMA_WATERMARK_LEVEL_N_FIFOS(x) SET_BITS(15, 12, x) #define SDMA_WATERMARK_LEVEL_OFF_FIFOS(x) SET_BITS(19, 16, x) #define SDMA_WATERMARK_LEVEL_WORDS_PER_FIFO(x) SET_BITS(31, 28, x) From 64fcebbd64bf8e8be4ec7098215d7281fa6a4791 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 25 Sep 2023 16:24:30 +0300 Subject: [PATCH 546/639] Tools: Topology2: Add nocodec topology to test google-rtc-aec The first playback PCM is for AEC mic input via SSP0 LBM. The second playback PCM is for AEC reference via SSP2 LBM. The first capture PCM is the AEC output. The AEC (mockup) can be run and tested with the topology like this: $ aplay -Dhw:0,0 mic_clip.wav & $ aplay -Dhw:0,2 ref_clip.wav & $ arecord -Dhw:0,0 -f dat -d 10 output.wav With AEC mockup version output.wav is mix of microphone and reference. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../development/cavs-nocodec-rtcaec.conf | 378 ++++++++++++++++++ .../topology2/development/tplg-targets.cmake | 4 + 2 files changed, 382 insertions(+) create mode 100644 tools/topology/topology2/development/cavs-nocodec-rtcaec.conf diff --git a/tools/topology/topology2/development/cavs-nocodec-rtcaec.conf b/tools/topology/topology2/development/cavs-nocodec-rtcaec.conf new file mode 100644 index 000000000000..b79ca37ad4f2 --- /dev/null +++ b/tools/topology/topology2/development/cavs-nocodec-rtcaec.conf @@ -0,0 +1,378 @@ +<searchdir:include> +<searchdir:include/common> +<searchdir:include/components> +<searchdir:include/dais> +<searchdir:include/pipelines/cavs> +<searchdir:platform> +<searchdir:platform/intel> + +<vendor-token.conf> +<manifest.conf> +<tokens.conf> +<virtual.conf> +<host-gateway-capture.conf> +<host-gateway-playback.conf> +<io-gateway-capture.conf> +<io-gateway.conf> +<data.conf> +<pcm.conf> +<pcm_caps.conf> +<fe_dai.conf> +<ssp.conf> +<intel/hw_config_cardinal_clk.conf> +<manifest.conf> +<route.conf> +<intel/common_definitions.conf> +<dai-copier.conf> +<module-copier.conf> +<pipeline.conf> +<dai.conf> +<host.conf> +<input_pin_binding.conf> +<output_pin_binding.conf> +<input_audio_format.conf> +<output_audio_format.conf> + +<controls/bytes.conf> +<google-rtc-aec.conf> + +Define { + MCLK 24576000 + PLATFORM "none" + SSP0_PCM_ID 0 + SSP0_PCM_NAME "Port0" + SSP1_PCM_NAME "Port1" + SSP2_PCM_NAME "Port2" +} + +# override defaults with platform-specific config +IncludeByKey.PLATFORM { + "tgl" "platform/intel/tgl.conf" + "adl" "platform/intel/tgl.conf" + "mtl" "platform/intel/mtl.conf" + "lnl" "platform/intel/mtl.conf" +} + +# +# List of all DAIs +# +Object.Dai.SSP [ + { + id 0 + dai_index 0 + direction "duplex" + name NoCodec-0 + default_hw_conf_id 0 + sample_bits 32 + quirks "lbm_mode" + io_clk $MCLK + + Object.Base.hw_config.1 { + name "SSP0" + id 0 + bclk_freq 3072000 + tdm_slot_width 32 + # TODO: remove this. Needs alsaptlg change. + Object.Base.link_config.1 { + clock_source 1 + } + } + } + { + id 2 + dai_index 2 + direction "duplex" + name NoCodec-2 + default_hw_conf_id 0 + sample_bits 32 + quirks "lbm_mode" + io_clk $MCLK + + Object.Base.hw_config.1 { + name "SSP2" + id 0 + bclk_freq 3072000 + tdm_slot_width 32 + # TODO: remove this. Needs alsaptlg change. + Object.Base.link_config.1 { + clock_source 1 + } + } + } +] + +# +# Pipeline definitions +# +# PCM0 --(1)----------------(2)--> SSP0 +# +# PCM2 --(5)----------------(6)--> SSP2 +# +# SSP0 --(8)---> RTCAEC ----(7)--> PCM0 +# ^ +# | +# SSP2 --(12)------+ + +Object.Pipeline.io-gateway [ + { + index 2 + direction playback + + Object.Widget.dai-copier.1 { + dai_index 0 + dai_type "SSP" + copier_type "SSP" + stream_name "NoCodec-0" + node_type $I2S_LINK_OUTPUT_CLASS + num_input_pins 1 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } + { + index 6 + direction playback + + Object.Widget.dai-copier.1 { + dai_index 2 + dai_type "SSP" + copier_type "SSP" + stream_name "NoCodec-2" + node_type $I2S_LINK_OUTPUT_CLASS + num_input_pins 1 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] + } + } +] + +Object.Pipeline.host-gateway-playback [ + { + index 1 + Object.Widget.host-copier.1 { + stream_name 'SSP0 Playback' + pcm_id 0 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } + { + index 5 + Object.Widget.host-copier.1 { + stream_name 'SSP2 Playback' + pcm_id 2 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } +] + +Object.Pipeline.host-gateway-capture [ + { + index 7 + + Object.Widget.host-copier.1 { + stream_name 'SSP0 Capture' + pcm_id 0 + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } +] + +Object.Pipeline.io-gateway-capture [ + { + index 8 + direction capture + + Object.Widget.dai-copier.1 { + dai_index 0 + dai_type "SSP" + type dai_out + copier_type "SSP" + stream_name "NoCodec-0" + node_type $I2S_LINK_INPUT_CLASS + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } + { + index 12 + direction capture + + Object.Widget.dai-copier.1 { + dai_index 2 + dai_type "SSP" + type dai_out + copier_type "SSP" + stream_name "NoCodec-2" + node_type $I2S_LINK_INPUT_CLASS + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] + } + } +] + +Object.PCM.pcm [ + { + name "$SSP0_PCM_NAME" + id $SSP0_PCM_ID + direction "duplex" + Object.Base.fe_dai.1 { + name "$SSP0_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + direction "playback" + name "SSP0 Playback" + formats 'S16_LE' + } + + Object.PCM.pcm_caps.2 { + direction "capture" + name "SSP0 Capture" + formats 'S16_LE' + } + } + { + name "$SSP2_PCM_NAME" + id 2 + direction "playback" + Object.Base.fe_dai.1 { + name "$SSP2_PCM_NAME" + } + + Object.PCM.pcm_caps.1 { + direction "playback" + name "SSP2 Playback" + formats 'S16_LE' + } + } +] + +Object.Widget.google-rtc-aec [ + { + index 7 + name "google-rtc-aec.7.1" + + Object.Base.input_pin_binding.1 { + input_pin_binding_name "dai-copier.SSP.NoCodec-0.capture" + } + + Object.Base.input_pin_binding.2 { + input_pin_binding_name "dai-copier.SSP.NoCodec-2.capture" + } + + Object.Control.bytes."1" { + name 'google-rtc-aec bytes' + <include/components/google-rtc-aec/rtc-aec-blob.conf> + } + } +] + +Object.Base.route [ + { + source "host-copier.0.playback" + sink "dai-copier.SSP.NoCodec-0.playback" + } + { + source "host-copier.2.playback" + sink "dai-copier.SSP.NoCodec-2.playback" + } + { + source "dai-copier.SSP.NoCodec-0.capture" + sink "google-rtc-aec.7.1" + } + { + source "dai-copier.SSP.NoCodec-2.capture" + sink "google-rtc-aec.7.1" + } + { + source "google-rtc-aec.7.1" + sink "host-copier.0.capture" + } +] diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 528b9af59450..7a77c715bd8f 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -137,4 +137,8 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-nocodec-bt-mtl-lbm.bin" # Topology to test IPC4 Crossover "development/cavs-nocodec-crossover\;sof-tgl-nocodec-crossover-2way\;PLATFORM=tgl,\ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-crossover.bin,EFX_CROSSOVER_PARAMS=2way" + +# Topology to test RTC AEC +"development/cavs-nocodec-rtcaec\;sof-tgl-nocodec-rtcaec\;PLATFORM=tgl,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-tgl-nocodec-rtcaec.bin" ) From d3b7e54f3f68fd694fa38d037d7c84bdf5d58fe0 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 3 Oct 2023 15:33:49 +0300 Subject: [PATCH 547/639] Tools: Tune: dcblock: Create set of cut-off frequencies This patch modifies script example_dblock.m to create in addition to existing default coefficients blob with parameter R=0.98 a set of blobs those provide (-3 dB) cut-off frequencies 20, 30, 40, 50, 100, 200 Hz for 16 kHz and 48 kHz for various usages. Human understandable parameters for blobs helps to select the configuration for the needed dcblock usage. The parameter value R for given frequencies is calculated with iterative function dcblock_rval_calculate(). A closed form equation might be possible to derive from the transfer function. If such is found this function can be replaced with quicker equation -- or with more advanced faster converging iteration. The topology blob export functions are also modified to add comment line for exact build command. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/tune/common/tplg2_write.m | 8 +- tools/tune/common/tplg_write.m | 9 ++- tools/tune/dcblock/example_dcblock.m | 108 ++++++++++++++++++++++++--- 3 files changed, 114 insertions(+), 11 deletions(-) diff --git a/tools/tune/common/tplg2_write.m b/tools/tune/common/tplg2_write.m index 9453c5d7dd7b..1bb28b05e5c6 100644 --- a/tools/tune/common/tplg2_write.m +++ b/tools/tune/common/tplg2_write.m @@ -1,4 +1,4 @@ -function tplg2_write(fn, blob8, component, comment) +function tplg2_write(fn, blob8, component, comment, howto) % SPDX-License-Identifier: BSD-3-Clause % @@ -9,6 +9,9 @@ function tplg2_write(fn, blob8, component, comment) if nargin < 4 comment = 'Exported Control Bytes'; end +if nargin < 5 + howto = []; +end %% Check that blob length is multiple of 32 bits n_blob = length(blob8); @@ -23,6 +26,9 @@ function tplg2_write(fn, blob8, component, comment) fh = fopen(fn, 'w'); nl = 8; fprintf(fh, '# %s %s\n', comment, date()); +if ~isempty(howto) + fprintf(fh, '# %s\n', howto); +end fprintf(fh, 'Object.Base.data.\"%s\" {\n', component); fprintf(fh, '\tbytes \"\n'); for i = 1:nl:n_blob diff --git a/tools/tune/common/tplg_write.m b/tools/tune/common/tplg_write.m index 079aea77fd10..15692cfab295 100644 --- a/tools/tune/common/tplg_write.m +++ b/tools/tune/common/tplg_write.m @@ -1,8 +1,11 @@ -function tplg_write(fn, blob8, name, comment) +function tplg_write(fn, blob8, name, comment, howto) if nargin < 4 comment = 'Exported Control Bytes'; end +if nargin < 5 + howto = []; +end %% Pad blob length to multiple of four bytes n_orig = length(blob8); @@ -14,6 +17,9 @@ function tplg_write(fn, blob8, name, comment) fh = fopen(fn, 'w'); nl = 8; fprintf(fh, '# %s %s\n', comment, date()); +if ~isempty(howto) + fprintf(fh, '# %s\n', howto); +end fprintf(fh, 'CONTROLBYTES_PRIV(%s_priv,\n', name); fprintf(fh, '` bytes "'); for i = 1:nl:n_new @@ -33,5 +39,6 @@ function tplg_write(fn, blob8, name, comment) end fprintf(fh, ')\n'); fclose(fh); +fprintf('Blob size %d was written to file %s\n', n_new, fn); end diff --git a/tools/tune/dcblock/example_dcblock.m b/tools/tune/dcblock/example_dcblock.m index df8500473369..6ffa179e5485 100644 --- a/tools/tune/dcblock/example_dcblock.m +++ b/tools/tune/dcblock/example_dcblock.m @@ -1,16 +1,53 @@ function example_dcblock() +% Default blob, about 150 Hz cut-off @ 48 kHz +prm.fc = []; +prm.fs = []; +prm.R_coeffs = [0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98]; +prm.id = "default"; +dcblock_blob_calculate(prm) + +% Generate a set configuration blobs for 16 and 48 kHz rate +% The selected high-pass cut-off frequencies are in range 20 - 200 Hz: +% 20, 30, 40, 50, 80, 100, and 200 Hz +% +% Select for applications one that is best tradeoff between DC level +% settle time and the lowest frequency that should pass without +% much attenuation. Cut-off frequency by definition is the point where +% the attenuation is 3.01 dB. + +prm.R_coeffs = []; +for fs = [16e3 48e3] + for fc = [20 30 40 50 80 100 200] + prm.id = sprintf("%dhz_%dkhz", round(fc), round(fs / 1000)); + prm.fs = fs; + prm.fc = fc; + dcblock_blob_calculate(prm) + end +end + +end + +function dcblock_blob_calculate(prm) + % Set the parameters here -tplg1_fn = "../../topology/topology1/m4/dcblock_coef_default.m4"; % Control Bytes File -tplg2_fn = "../../topology/topology2/include/components/dcblock/default.conf"; +tplg1_fn = sprintf("../../topology/topology1/m4/dcblock_coef_%s.m4", prm.id); % Control Bytes File +tplg2_fn = sprintf("../../topology/topology2/include/components/dcblock/%s.conf", prm.id); % Use those files with sof-ctl to update the component's configuration -blob3_fn = "../../ctl/ipc3/dcblock_coef.blob"; % Blob binary file -alsa3_fn = "../../ctl/ipc3/dcblock_coef.txt"; % ALSA CSV format file -blob4_fn = "../../ctl/ipc4/dcblock_coef.blob"; % Blob binary file -alsa4_fn = "../../ctl/ipc4/dcblock_coef.txt"; % ALSA CSV format file +blob3_fn = sprintf("../../ctl/ipc3/dcblock/coef_%s.blob", prm.id); % Blob binary file +alsa3_fn = sprintf("../../ctl/ipc3/dcblock/coef_%s.txt", prm.id); % ALSA CSV format file +blob4_fn = sprintf("../../ctl/ipc4/dcblock/coef_%s.blob", prm.id); % Blob binary file +alsa4_fn = sprintf("../../ctl/ipc4/dcblock/coef_%s.txt", prm.id); % ALSA CSV format file endian = "little"; -R_coeffs = [0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98]; + +if isempty(prm.fc) + R_coeffs = prm.R_coeffs; +else + channels = 8; + R = dcblock_rval_calculate(prm.fs, prm.fc); + R_coeffs = R * ones(1, channels); +end addpath ./../common @@ -18,11 +55,15 @@ function example_dcblock() blob8_ipc4 = dcblock_build_blob(R_coeffs, endian, 4); % Generate output files -tplg_write(tplg1_fn, blob8, "DCBLOCK"); +tplg_write(tplg1_fn, blob8, "DCBLOCK", ... + "Exported with script example_dcblock.m", ... + "cd tools/tune/dcblock; octave example_dcblock.m"); blob_write(blob3_fn, blob8); alsactl_write(alsa3_fn, blob8); -tplg2_write(tplg2_fn, blob8_ipc4, "dcblock_config", "Exported with script example_dcblock.m"); +tplg2_write(tplg2_fn, blob8_ipc4, "dcblock_config", ... + "Exported with script example_dcblock.m" , ... + "cd tools/tune/dcblock; octave example_dcblock.m"); blob_write(blob4_fn, blob8_ipc4); alsactl_write(alsa4_fn, blob8_ipc4); @@ -36,3 +77,52 @@ function example_dcblock() rmpath ./../common end + +% Finds with iterative search parameter R for given cutoff frequency +function R = dcblock_rval_calculate(fs, fc_target) + +if (fc_target / fs < 10 / 48e3 || fc_target / fs > 1000 / 48e3) + error("Illegal fc_target"); +end + +h_target = 1 / sqrt(2); % -3.01 dB +R = 0.5; +R_step = 0.005; +sign = 1; +w = 2 * pi * fc_target / fs; +j = sqrt(-1); +z = exp(j * w); + +% Iteration 0 +h = (1 - z^-1) / (1 - R * z^-1); +err_prev = (h_target - abs(h))^2; +R = R + sign * R_step; + +% Do more iterations +for n = 1 : 200 + h = (1 - z^-1) / (1 - R * z^-1); + err = (h_target - abs(h))^2; + if (err > err_prev) + sign = -sign; + R_step = R_step / 2; + end + R = R + sign * R_step; + err_prev = err; +end + +% Sane result? +if R < eps || R > 1 - eps + error("Calculate of R iteration failed"); +end + +% Sane high-pass function? +f = [1 fc_target fs/2]; +b = [ 1 -1 ]; a = [ 1 -R ]; +h = freqz(b, a, f, fs); +h_db = 20*log10(abs(h)); +err_hfc = abs(20*log10(1/sqrt(2)) - h_db(2)); +if err_hfc > 0.01 || h_db(1) > -10 || h_db(3) < 0 || h_db(3) > 1 + error("Failed high-pass response"); +end + +end From aadbfa0a3b75f3d7be680499a845b14c88c3404d Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 11 Oct 2023 21:51:20 +0000 Subject: [PATCH 548/639] tools/rimage/README.md: update following transfer to sof.git We still have tomlc99 as a git submodule for now. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/README.md | 60 +++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/tools/rimage/README.md b/tools/rimage/README.md index 64fe71e11ce5..9f32fffa5cb1 100644 --- a/tools/rimage/README.md +++ b/tools/rimage/README.md @@ -24,49 +24,49 @@ PATH. Zephyr users can run `west config rimage.path /path/to/rimage/build/rimage`; Zephyr documentation and `west sign -h` have more details. -## Testing rimage changes with SOF Continuous Integration +## Testing tomlc99 changes with SOF Continuous Integration -This section is about leveraging SOF validation to test rimage changes -_before_ submitting them to the rimage repository. +This section is about leveraging SOF validation to test tomlc99 changes +_before_ submitting them to the tomlc99 repository. -Nothing here is actually specific to SOF and rimage; you can apply the +Nothing here is actually specific to SOF and tomlc99; you can apply the same test logic to any submodule and parent on Github. In fact the same logic applies to submodule alternatives. Github is the only requirement. ### Get familiar with git submodules -This is unfortunately not optional for SOF and rimage. +This is unfortunately not optional for SOF and tomlc99. For various reasons submodules seem to confuse many git users. Maybe because the versions of the submodules are not directly visible in some configuration file like with most alternatives? Either way, an -unfortunate prerequisite before doing any rimage work is to get familiar +unfortunate prerequisite before doing any tomlc99 work is to get familiar with git submodules in general. As submodules are built-in there are many resources about them on the Internet. One possible starting point is https://git-scm.com/book/en/v2/Git-Tools-Submodules but feel free to use any other good tutorial instead. Make sure you actually practice a tutorial; don't just read it. Practicing on a temporary and throw-away -copy of SOF + rimage is a great idea. +copy of SOF + tomlc99 is a great idea. Obviously, you also need to be familiar with regular Github pull requests. -### Run SOF tests on unmerged rimage commits +### Run SOF tests on unmerged tomlc99 commits -First, push the rimage commits you want to be tested to any branch of -your rimage fork on Github. Do _not_ submit an rimage pull request yet. +First, push the tomlc99 commits you want to be tested to any branch of +your tomlc99 fork on Github. Do _not_ submit an tomlc99 pull request yet. -Note your rimage fork must have been created using the actual "fork" +Note your tomlc99 fork must have been created using the actual "fork" button on Github so Github is aware of the connection with the upstream -rimage repo. In the top-left corner you should see `forked from -thesofproject/rimage` under the name of your fork. If not then search +tomlc99 repo. In the top-left corner you should see `forked from +thesofproject/tomlc99` under the name of your fork. If not then search the Internet for "re-attach detached github fork". -Then, **pretend** these rimage commits have already been accepted and +Then, **pretend** these tomlc99 commits have already been accepted and merged (they have been neither) and submit to SOF a draft pull request -that updates the main SOF branch with your brand new rimage commits to +that updates the main SOF branch with your brand new tomlc99 commits to test. The only SOF commit in this SOF TEST pull request is an SOF commit -that updates the rimage pointer to the SHA of your last rimage +that updates the tomlc99 pointer to the SHA of your last tomlc99 commit. If you're not sure how to do this then you must go back to the previous section and practice submodules more. @@ -82,24 +82,24 @@ time but you can never "un-notify" reviewers. Github has very good support for submodules and will display your SOF TEST pull request better than what the git command line can show. For -instance Github will list your rimage changes directly in the SOF Pull +instance Github will list your tomlc99 changes directly in the SOF Pull Request. So if something looks unexpected on Github then it means you did something wrong. Stop immediately (except for switching to draft if you forgot) and ask the closest git guru for help. Search for "Submodule" in the build logs and make sure the last of your -new rimage commits has been checked out. - -Iterate and force-push your rimage branch and your SOF TEST pull request -until all the SOF tests pass. Then you can submit your rimage pull -request as usual. In the comments section of the rimage pull request, -point at your test results on the SOF side to impress the rimage -reviewers and get your rimage changes merged faster. - -Finally, after your rimage changes have been merged, you can if you want -submit one final SOF pull request that points to the final rimage -SHA. Or, if your rimage change is not urgently needed, you can just wait -for someone else to do it later. If you do it, copy the rimage git log +new tomlc99 commits has been checked out. + +Iterate and force-push your tomlc99 branch and your SOF TEST pull request +until all the SOF tests pass. Then you can submit your tomlc99 pull +request as usual. In the comments section of the tomlc99 pull request, +point at your test results on the SOF side to impress the tomlc99 +reviewers and get your tomlc99 changes merged faster. + +Finally, after your tomlc99 changes have been merged, you can if you want +submit one final SOF pull request that points to the final tomlc99 +SHA. Or, if your tomlc99 change is not urgently needed, you can just wait +for someone else to do it later. If you do it, copy the tomlc99 git log --oneline in the SOF commit message. Find some good (and less good) -rimage commit message examples at +commit message examples for submodule updates at https://github.com/thesofproject/sof/commits/main/rimage From 93c63bd34080cfd385cea6eea553d2fec74f41c8 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Mon, 16 Oct 2023 15:25:39 +0300 Subject: [PATCH 549/639] drivers: sdma: Add sdma script code in header file For ease of use add sdma script code directly in the sdma header file. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/CMakeLists.txt | 4 - src/drivers/imx/Kconfig | 8 -- src/include/sof/drivers/sdma.h | 178 ++++++++++++++++++++++++++++++++- 3 files changed, 177 insertions(+), 13 deletions(-) diff --git a/src/drivers/imx/CMakeLists.txt b/src/drivers/imx/CMakeLists.txt index 5fdc480b76c2..b5dc724256c7 100644 --- a/src/drivers/imx/CMakeLists.txt +++ b/src/drivers/imx/CMakeLists.txt @@ -16,10 +16,6 @@ endif() if(CONFIG_IMX_SDMA) add_local_sources(sof sdma.c) - - if (CONFIG_HAVE_SDMA_FIRMWARE) - target_include_directories(sof PRIVATE ${CONFIG_SDMA_SCRIPT_CODE}) - endif() endif() if(CONFIG_IMX_MICFIL) diff --git a/src/drivers/imx/Kconfig b/src/drivers/imx/Kconfig index 7874c72c096b..5f3d9b225c07 100644 --- a/src/drivers/imx/Kconfig +++ b/src/drivers/imx/Kconfig @@ -50,11 +50,3 @@ config HAVE_SDMA_FIRMWARE help Select this to load SDMA firmware to enable additional functionality for SDMA controller. - -if HAVE_SDMA_FIRMWARE - config SDMA_SCRIPT_CODE - string "SDMA script code path" - help - This option is a string and provides the path where to find the sdma script - code header. -endif diff --git a/src/include/sof/drivers/sdma.h b/src/include/sof/drivers/sdma.h index b00cf89316f0..62f1f1c4101d 100644 --- a/src/include/sof/drivers/sdma.h +++ b/src/include/sof/drivers/sdma.h @@ -164,7 +164,183 @@ #define SDMA_SCRIPT_SAI2MCU_OFF 6710 #if CONFIG_HAVE_SDMA_FIRMWARE -#include "sdma_script_code_imx7d_4_5.h" + +/* + * From "sdma_script_code_imx7d_4_5.h" + */ + +/* SDMA RAM image start address and size */ +#define RAM_CODE_START_ADDR 6144 +#define RAM_CODE_SIZE 1315 + +/* buffer that holds the SDMA RAM image */ +static const short sdma_code[] = { +0xc1e5, 0x57db, 0x52f3, 0x6a01, 0x52fb, 0x6ad3, 0x52fb, 0x1a1c, +0x6ac3, 0x62e8, 0x0211, 0x3aff, 0x0830, 0x02d0, 0x7c3f, 0x008f, +0x003f, 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5deb, 0x0478, 0x7d03, +0x0479, 0x7d1c, 0x7c20, 0x0479, 0x7c15, 0x56ee, 0x0660, 0x7d05, +0x6509, 0x7e33, 0x620a, 0x7e31, 0x9829, 0x620a, 0x7e2e, 0x6509, +0x7e2c, 0x0512, 0x0512, 0x02ad, 0x6ac8, 0x7f27, 0x2003, 0x4800, +0x7ced, 0x9841, 0x7802, 0x6209, 0x6ac8, 0x9840, 0x0015, 0x7802, +0x620a, 0x6ac8, 0x9840, 0x0015, 0x0015, 0x7802, 0x620b, 0x6ac8, +0x7c14, 0x6ddf, 0x7f12, 0x077f, 0x7d09, 0x52fb, 0x1a04, 0x6ac3, +0x6ad3, 0x62c8, 0x2a04, 0x6ac8, 0x52fb, 0x6ad3, 0x0000, 0x55eb, +0x4d00, 0x7d07, 0xc1fc, 0x57db, 0x9806, 0x0007, 0x68cc, 0x680c, +0xc215, 0xc20c, 0x9801, 0xc1d9, 0xc1e5, 0x57db, 0x52f3, 0x6a01, +0x080f, 0x0011, 0x18ff, 0x00bf, 0x5ce3, 0x00d5, 0x7d01, 0x008d, +0x05a0, 0x5deb, 0x56fb, 0x0478, 0x7d03, 0x0479, 0x7d28, 0x7c33, +0x0479, 0x7c1a, 0x0b70, 0x0311, 0x53eb, 0x0360, 0x7d05, 0x6509, +0x7e5f, 0x620a, 0x7e5d, 0x9880, 0x620a, 0x7e5a, 0x6509, 0x7e58, +0x0512, 0x0512, 0x02ad, 0x5a06, 0x7f53, 0x2003, 0x4800, 0x7ced, +0x0b70, 0x0311, 0x5313, 0x98b0, 0xd8c8, 0x6209, 0x5a06, 0x069c, +0x2701, 0x2001, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x98af, 0x0015, +0xd8c8, 0x620a, 0x5a06, 0x069c, 0x2701, 0x2001, 0x4f00, 0x7cf9, +0x4800, 0x7cf6, 0x98af, 0x0015, 0x0015, 0xd8c8, 0x620b, 0x5a06, +0x069c, 0x2701, 0x2001, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x7c28, +0x57db, 0x0777, 0x7c0c, 0x0710, 0x3f0f, 0x0717, 0x0717, 0x0e70, +0x0611, 0x0c70, 0x0411, 0x069c, 0x069f, 0x0c01, 0x5c06, 0x0000, +0x54e3, 0x57db, 0x55eb, 0x4d00, 0x7d16, 0xc1fc, 0x57db, 0x9860, +0x56fb, 0x57db, 0x048f, 0x0711, 0x3ff0, 0x0715, 0x0715, 0x0715, +0x0715, 0x0410, 0x0411, 0x3c0f, 0x1c01, 0x0417, 0x0417, 0x0006, +0x0007, 0x680c, 0xc215, 0xc20c, 0x985d, 0xc1d9, 0xc1e5, 0x57db, +0x5fe3, 0x57e3, 0x52f3, 0x6a21, 0x008f, 0x00d5, 0x7d01, 0x008d, +0x05a0, 0x5deb, 0x56fb, 0x0478, 0x7d03, 0x0479, 0x7d2a, 0x7c31, +0x0479, 0x7c20, 0x0b70, 0x0311, 0x53eb, 0x0f00, 0x0360, 0x7d05, +0x6509, 0x7e37, 0x620a, 0x7e35, 0x9901, 0x620a, 0x7e32, 0x6509, +0x7e30, 0x0512, 0x0512, 0x02ad, 0x0760, 0x7c02, 0x5a06, 0x9909, +0x5a26, 0x7f27, 0x1f01, 0x2003, 0x4800, 0x7ce8, 0x0b70, 0x0311, +0x5313, 0x992a, 0x0015, 0x7804, 0x6209, 0x5a06, 0x6209, 0x5a26, +0x9929, 0x0015, 0x0015, 0x7804, 0x620a, 0x5a06, 0x620a, 0x5a26, +0x9929, 0x0015, 0x0015, 0x0015, 0x7804, 0x620b, 0x5a06, 0x620b, +0x5a26, 0x7c07, 0x0000, 0x55eb, 0x4d00, 0x7d06, 0xc1fc, 0x57e3, +0x98e4, 0x0007, 0x680c, 0xc215, 0xc20c, 0x98e1, 0x0b70, 0x0311, +0x5313, 0x076c, 0x7c01, 0xc1d9, 0x5efb, 0x068a, 0x076b, 0x7c01, +0xc1d9, 0x5ef3, 0x59db, 0x58d3, 0x018f, 0x0110, 0x390f, 0x008b, +0xc13c, 0x7d2b, 0x5ac0, 0x5bc8, 0xc14e, 0x7c27, 0x0388, 0x0689, +0x5ce3, 0x0dff, 0x0511, 0x1dff, 0x05bc, 0x073e, 0x4d00, 0x7d18, +0x0870, 0x0011, 0x077e, 0x7d09, 0x077d, 0x7d02, 0x5228, 0x9961, +0x52f8, 0x54db, 0x02bc, 0x02cc, 0x7c09, 0x077c, 0x7d02, 0x5228, +0x996a, 0x52f8, 0x54d3, 0x02bc, 0x02cc, 0x7d09, 0x0400, 0x9958, +0x008b, 0x52c0, 0x53c8, 0xc159, 0x7dd6, 0x0200, 0x9948, 0x08ff, +0x00bf, 0x077f, 0x7d15, 0x0488, 0x00d5, 0x7d01, 0x008d, 0x05a0, +0x5deb, 0x028f, 0x0212, 0x0212, 0x3aff, 0x05da, 0x7c02, 0x073e, +0x9995, 0x02a4, 0x02dd, 0x7d02, 0x073e, 0x9995, 0x075e, 0x9995, +0x55eb, 0x4d00, 0x7c02, 0x0598, 0x5deb, 0x52f3, 0x54fb, 0x076a, +0x7d26, 0x076c, 0x7d01, 0x99d2, 0x076b, 0x7c57, 0x0769, 0x7d04, +0x0768, 0x7d02, 0x0e01, 0x99ac, 0x5893, 0x00d6, 0x7d01, 0x008e, +0x5593, 0x05a0, 0x5d93, 0x06a0, 0x7802, 0x5502, 0x5d04, 0x7c1d, +0x4e00, 0x7c08, 0x0769, 0x7d03, 0x5502, 0x7e17, 0x99b9, 0x5d04, +0x7f14, 0x0689, 0x5093, 0x4800, 0x7d01, 0x99a4, 0x9a1d, 0x0015, +0x7806, 0x5502, 0x5d04, 0x074f, 0x5502, 0x5d24, 0x072f, 0x7c01, +0x9a1d, 0x0017, 0x076f, 0x7c01, 0x2001, 0x5593, 0x009d, 0x0007, +0xda24, 0x9970, 0x6cd3, 0x0769, 0x7d04, 0x0768, 0x7d02, 0x0e01, +0x99e1, 0x5893, 0x00d6, 0x7d01, 0x008e, 0x5593, 0x05a0, 0x5d93, +0x06a0, 0x7802, 0x5502, 0x6dc8, 0x7c0f, 0x4e00, 0x7c08, 0x0769, +0x7d03, 0x5502, 0x7e09, 0x99ee, 0x6dc8, 0x7f06, 0x0689, 0x5093, +0x4800, 0x7d01, 0x99d9, 0x9a1d, 0x9a17, 0x6ac3, 0x0769, 0x7d04, +0x0768, 0x7d02, 0x0e01, 0x9a04, 0x5893, 0x00d6, 0x7d01, 0x008e, +0x5593, 0x05a0, 0x5d93, 0x06a0, 0x7802, 0x65c8, 0x5d04, 0x7c0f, +0x4e00, 0x7c08, 0x0769, 0x7d03, 0x65c8, 0x7e09, 0x9a11, 0x5d04, +0x7f06, 0x0689, 0x5093, 0x4800, 0x7d01, 0x99fc, 0x9a1d, 0x5593, +0x009d, 0x0007, 0x6cff, 0xda24, 0x9970, 0x0000, 0x54e3, 0x55eb, +0x4d00, 0x7c01, 0x9970, 0x9958, 0x54e3, 0x55eb, 0x0aff, 0x0211, +0x1aff, 0x077f, 0x7c02, 0x05a0, 0x9a31, 0x009d, 0x058c, 0x05ba, +0x05a0, 0x0210, 0x04ba, 0x04ad, 0x0454, 0x0006, 0xc1d9, 0xc1e5, +0x57db, 0x52f3, 0x6a05, 0x5ce3, 0x080f, 0x0011, 0x18ff, 0x00bf, +0x00d5, 0x7d01, 0x008d, 0x05a0, 0x56fb, 0x0478, 0x7d03, 0x0479, +0x7d28, 0x7c1a, 0x0479, 0x7c31, 0x0b70, 0x0311, 0x53eb, 0x5206, +0x7e60, 0x0360, 0x7d02, 0x0210, 0x0212, 0x6a09, 0x7f5a, 0x0212, +0x6a09, 0x7f57, 0x0212, 0x6a09, 0x7f54, 0x2003, 0x4800, 0x7cef, +0x0b70, 0x0311, 0x5313, 0x9a88, 0x0015, 0x0015, 0xdaa1, 0x5206, +0x6a0b, 0x069c, 0x2001, 0x2701, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, +0x9a87, 0x0015, 0xdaa1, 0x5206, 0x6a0a, 0x069c, 0x2001, 0x2701, +0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x9a87, 0xdaa1, 0x5206, 0x6a09, +0x069c, 0x2001, 0x2701, 0x4f00, 0x7cf9, 0x4800, 0x7cf6, 0x7c29, +0x6a28, 0x7f27, 0x57db, 0x0777, 0x7c0c, 0x0710, 0x3f0f, 0x0717, +0x0717, 0x0e70, 0x0611, 0x0c70, 0x0411, 0x069c, 0x069f, 0x0c01, +0x5c06, 0x0000, 0x54e3, 0x57db, 0x4d00, 0x7d15, 0xc1fc, 0x57db, +0x9a3b, 0x56fb, 0x57db, 0x048f, 0x0711, 0x3ff0, 0x0715, 0x0715, +0x0715, 0x0715, 0x0410, 0x0411, 0x3c0f, 0x1c01, 0x0417, 0x0417, +0x0006, 0xc279, 0x0454, 0xc20c, 0x9a38, 0xc1d9, 0xc1e5, 0x57db, +0x52f3, 0x6a05, 0x008f, 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x56fb, +0x0478, 0x7d03, 0x0479, 0x7d29, 0x7c1f, 0x0479, 0x7c2e, 0x5de3, +0x0d70, 0x0511, 0x55ed, 0x0f00, 0x0760, 0x7d02, 0x5206, 0x9ad1, +0x5226, 0x7e33, 0x0560, 0x7d02, 0x0210, 0x0212, 0x6a09, 0x7f2d, +0x0212, 0x6a09, 0x7f2a, 0x0212, 0x6a09, 0x7f27, 0x1f01, 0x2003, +0x4800, 0x7cea, 0x55e3, 0x9afc, 0x0015, 0x0015, 0x0015, 0x7804, +0x5206, 0x6a0b, 0x5226, 0x6a0b, 0x9afb, 0x0015, 0x0015, 0x7804, +0x5206, 0x6a0a, 0x5226, 0x6a0a, 0x9afb, 0x0015, 0x7804, 0x5206, +0x6a09, 0x5226, 0x6a09, 0x7c09, 0x6a28, 0x7f07, 0x0000, 0x57db, +0x4d00, 0x7d05, 0xc1fc, 0x57db, 0x9aba, 0xc279, 0x0454, 0xc20c, +0x9ab7, 0xc1e5, 0x57db, 0x52f3, 0x6a05, 0x56fb, 0x028e, 0x1a94, +0x6ac3, 0x62c8, 0x0269, 0x7d26, 0x1e94, 0x6ec3, 0x6ed3, 0x62c8, +0x0a01, 0x0211, 0x6ac8, 0x2694, 0x1e98, 0x6ec3, 0x62c8, 0x2698, +0x6ec3, 0x0260, 0x7d0f, 0x1e98, 0x6ec3, 0x62c8, 0x026c, 0x7d03, +0x2698, 0x6ec3, 0x9b48, 0x0a10, 0x0211, 0x6ed3, 0x6ac8, 0x2698, +0x6ec3, 0x9b58, 0x62c8, 0x9b34, 0x6a09, 0x7f18, 0x2501, 0x4d00, +0x7d1f, 0x9b1c, 0x6ee3, 0x008f, 0x05d8, 0x7d01, 0x008d, 0x62c8, +0x6a09, 0x7f0c, 0x2501, 0x2001, 0x7cfa, 0x57db, 0x4d00, 0x7d10, +0x6a28, 0x7f04, 0x0000, 0xc1fc, 0x57db, 0x9b0d, 0x0007, 0x6204, +0x6a0c, 0x9b55, 0x6a28, 0x7ffa, 0x6204, 0xc27c, 0x0458, 0x0454, +0x08ff, 0x0011, 0x18ff, 0x00bc, 0x00cd, 0x7c01, 0x9b48, 0x6a28, +0x7fed, 0x6204, 0xc27c, 0xc20c, 0x9b0a, 0xc1d9, 0xc1e5, 0x57db, +0x52f3, 0x6a05, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d1d, +0x1e94, 0x5206, 0x0248, 0x5a06, 0x2694, 0x1e98, 0x5206, 0x024c, +0x5a06, 0x2698, 0x1e98, 0x5206, 0x0260, 0x7c0a, 0x2698, 0x5206, +0x026e, 0x7d23, 0x6a09, 0x7f1d, 0x2501, 0x4d00, 0x7d24, 0x9b7a, +0x6a28, 0x7f17, 0x6204, 0xc27c, 0x9bab, 0x008f, 0x05d8, 0x7d01, +0x008d, 0x05a0, 0x5206, 0x026e, 0x7d10, 0x6a09, 0x7f0a, 0x2001, +0x7cf9, 0x6a28, 0x7f06, 0x0000, 0x4d00, 0x7d0d, 0xc1fc, 0x57db, +0x9b6a, 0x0007, 0x6204, 0x6a0c, 0x9ba8, 0x6a28, 0x7ffa, 0x6204, +0xc27c, 0x0458, 0x0454, 0x6a28, 0x7ff4, 0xc20c, 0x9b67, 0xdbf3, +0x57db, 0x52f3, 0x6a05, 0x69c7, 0x008f, 0x00d5, 0x7d01, 0x008d, +0x05a0, 0x0478, 0x7d03, 0x0479, 0x7d1c, 0x7c15, 0x0479, 0x7c1e, +0x56ee, 0x62c8, 0x7e28, 0x0660, 0x7d02, 0x0210, 0x0212, 0x6a09, +0x7f22, 0x0212, 0x6a09, 0x7f1f, 0x0212, 0x6a09, 0x7f1c, 0x2003, +0x4800, 0x7cef, 0x9be2, 0x0015, 0x0015, 0x7802, 0x62c8, 0x6a0b, +0x9be1, 0x0015, 0x7802, 0x62c8, 0x6a0a, 0x9be1, 0x7802, 0x62c8, +0x6a09, 0x7c09, 0x6a28, 0x7f07, 0x4d00, 0x7d07, 0x52d3, 0x0801, +0x5802, 0x0400, 0x9bb3, 0xc279, 0x0454, 0x52d3, 0x0801, 0x5802, +0x0401, 0xdc0b, 0x9bb0, 0x0b70, 0x0311, 0x5313, 0x5fdb, 0x070a, +0x58d3, 0x008b, 0x5efb, 0xc13c, 0x7d15, 0x5ac0, 0x5bc8, 0xc14e, +0x7c11, 0x0388, 0x5df0, 0x0dff, 0x0511, 0x1dff, 0x05bc, 0x4d00, +0x7d04, 0x9c0a, 0x0708, 0x5fdb, 0x070a, 0x008b, 0x52c3, 0x53cb, +0xc159, 0x7dec, 0x0200, 0x9bfb, 0x6e01, 0x610b, 0x7e2f, 0x620b, +0x7e2d, 0x630b, 0x7e2b, 0x0d0c, 0x0417, 0x0417, 0x0417, 0x049d, +0x1d08, 0x05cc, 0x7c01, 0x0d0c, 0x6ad1, 0x0f00, 0x0742, 0x6fc8, +0x6fdd, 0x7f1c, 0x008e, 0x009d, 0x6801, 0x670b, 0x7e17, 0x6bd5, +0x0804, 0x7802, 0x6fc8, 0x0712, 0x7c11, 0x670b, 0x7e0f, 0x0804, +0x7802, 0x6fc8, 0x0712, 0x7c0a, 0x6fdd, 0x7f08, 0x69d1, 0x0f01, +0x6fc8, 0x6fdd, 0x7f03, 0x0101, 0x0400, 0x9c20, 0x0007, 0x68ff, +0x680c, 0x0200, 0x9c20, 0xdc90, 0x57db, 0x52f3, 0x6a05, 0x52fb, +0x6ac7, 0x008f, 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x0478, 0x7d03, +0x0479, 0x7d1c, 0x7c15, 0x0479, 0x7c1e, 0x56ee, 0x62c8, 0x7e28, +0x0660, 0x7d02, 0x0210, 0x0212, 0x6a09, 0x7f22, 0x0212, 0x6a09, +0x7f1f, 0x0212, 0x6a09, 0x7f1c, 0x2003, 0x4800, 0x7cef, 0x9c7f, +0x0015, 0x0015, 0x7802, 0x62c8, 0x6a0b, 0x9c7e, 0x0015, 0x7802, +0x62c8, 0x6a0a, 0x9c7e, 0x7802, 0x62c8, 0x6a09, 0x7c09, 0x6a28, +0x7f07, 0x4d00, 0x7d07, 0x52d3, 0x0801, 0x5802, 0x0400, 0x9c4f, +0xc279, 0x0454, 0x52d3, 0x0801, 0x5802, 0x0401, 0xdca8, 0x9c4c, +0x0b70, 0x0311, 0x5313, 0x5fdb, 0x070a, 0x58d3, 0x008b, 0x5efb, +0xc13c, 0x7d15, 0x5ac0, 0x5bc8, 0xc14e, 0x7c11, 0x0388, 0x5df0, +0x0dff, 0x0511, 0x1dff, 0x05bc, 0x4d00, 0x7d04, 0x9ca7, 0x0708, +0x5fdb, 0x070a, 0x008b, 0x52c3, 0x53cb, 0xc159, 0x7dec, 0x0200, +0x9c98, 0xdd02, 0x52f3, 0x6a01, 0x57db, 0x52fb, 0x077f, 0x7d02, +0x6ad3, 0x9cbb, 0x6ad7, 0x008f, 0x38ff, 0x00d5, 0x7d01, 0x008d, +0x05a0, 0x5deb, 0x0478, 0x7d03, 0x0479, 0x7d1c, 0x7c20, 0x0479, +0x7c15, 0x56ee, 0x0660, 0x7d05, 0x6509, 0x7e2a, 0x620a, 0x7e28, +0x9cd5, 0x620a, 0x7e25, 0x6509, 0x7e23, 0x0512, 0x0512, 0x02ad, +0x6ac8, 0x7f1e, 0x2003, 0x4800, 0x7ced, 0x9ced, 0x7802, 0x6209, +0x6ac8, 0x9cec, 0x0015, 0x7802, 0x620a, 0x6ac8, 0x9cec, 0x0015, +0x0015, 0x7802, 0x620b, 0x6ac8, 0x7c0b, 0x6ddf, 0x7f09, 0x0000, +0x55eb, 0x4d00, 0x7d09, 0x52d3, 0x0801, 0x5802, 0x0400, 0x9cb4, +0x0007, 0x68cc, 0x680c, 0xc215, 0x52d3, 0x0801, 0x5802, 0x0401, +0xdd1a, 0x9cb2, 0x0b70, 0x0311, 0x5313, 0x5fdb, 0x070a, 0x58d3, +0x008b, 0x5efb, 0xc13c, 0x7d15, 0x5ac0, 0x5bc8, 0xc14e, 0x7c11, +0x0388, 0x5df0, 0x0dff, 0x0511, 0x1dff, 0x05bc, 0x4d00, 0x7d04, +0x9d19, 0x0708, 0x5fdb, 0x070a, 0x008b, 0x52c3, 0x53cb, 0xc159, +0x7dec, 0x0200, 0x9d0a +}; #endif #endif /* __SOF_DRIVERS_SDMA_H__ */ From 8eeaf5aea57e64880d620b0b144c1659132affc0 Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Mon, 16 Oct 2023 16:51:17 +0300 Subject: [PATCH 550/639] drivers: imx: Select HAVE_SDMA_FIRMWARE when using MICFIL MICFIL needs multi-fifo SDMA script so select HAVE_SDMA_FIRMWARE. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drivers/imx/Kconfig b/src/drivers/imx/Kconfig index 5f3d9b225c07..85f2a50a1162 100644 --- a/src/drivers/imx/Kconfig +++ b/src/drivers/imx/Kconfig @@ -25,6 +25,7 @@ config IMX_MICFIL bool "i.MX MICFIL PDM driver" default n depends on IMX + select HAVE_SDMA_FIRMWARE help Select this to enable support for i.MX MICFIL PDM IP. This block implements the required digital interface to provide a 24-bits audio signal from a PDM From 457142ea1e37e47f830b793e73194472291357cb Mon Sep 17 00:00:00 2001 From: Mac Chiang <mac.chiang@intel.com> Date: Mon, 16 Oct 2023 05:06:21 -0400 Subject: [PATCH 551/639] mtl: add dts-codec support Signed-off-by: Mac Chiang <mac.chiang@intel.com> --- tools/rimage/config/mtl.toml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tools/rimage/config/mtl.toml b/tools/rimage/config/mtl.toml index 2d2742c91c83..453b0df89dbd 100644 --- a/tools/rimage/config/mtl.toml +++ b/tools/rimage/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 25 +count = 26 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -630,3 +630,22 @@ count = 25 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + # dts codec module config + [[module.entry]] + name = "DTS" + uuid = "D95FC34F-370F-4AC7-BC86-BFDC5BE241E6" + affinity_mask = "0x1" + instance_count = "40" + domain_types = "0" + load_type = "0" + module_type = "9" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, + 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 296, 5000000, 384, 384, 0, 5000, 0] From b0b5958875bb8e21f0317c88c94a725e1d15b09a Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 13 Oct 2023 08:27:43 -0700 Subject: [PATCH 552/639] topology2: sdw-amp/dmic-generic: Remove incorrect audio format Setting the in bit depth for the second audio format in the host-gateway-capture object results in resetting the channel count to 2. The in_bit_depth is set to 32-bit by default for all audio formats in host-gateway-capture class already. Fixes: 7a11e27bf2a1 ('topology2: host-gateway-capture: Replace audio_format objects') Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- tools/topology/topology2/platform/intel/sdw-amp-generic.conf | 5 ----- .../topology/topology2/platform/intel/sdw-dmic-generic.conf | 5 ----- 2 files changed, 10 deletions(-) diff --git a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf index 57f3a089101d..c19423d62f2f 100644 --- a/tools/topology/topology2/platform/intel/sdw-amp-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-amp-generic.conf @@ -350,11 +350,6 @@ IncludeByKey.SDW_AMP_FEEDBACK { Object.Widget.host-copier.1 { stream_name "amp feedback" pcm_id 3 - Object.Base.audio_format.1 { - # 32 -> 16 bits conversion is done here, - # so in_bit_depth is 32 (and out_bit_depth is 16). - in_bit_depth 32 - } } } ] diff --git a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf index 2d7e7e54f27f..e8b0ca2dbb31 100644 --- a/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-dmic-generic.conf @@ -30,11 +30,6 @@ Object.Pipeline { Object.Widget.host-copier.1 { stream_name "sdw dmic" pcm_id 4 - Object.Base.audio_format.1 { - # 32 -> 16 bits conversion is done here, - # so in_bit_depth is 32 (and out_bit_depth is 16). - in_bit_depth 32 - } } } ] From 6850be91ba481c1f26aa3e6b91dfb2c86fc4a914 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Thu, 12 Oct 2023 09:12:10 -0700 Subject: [PATCH 553/639] topology2: deepbuffer-playback: Replace audio_format objects Use the input_audio_format/output_audio_format objects explicitly. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../pipelines/cavs/deepbuffer-playback.conf | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf index abe5a468ad01..f63f77ad13be 100644 --- a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/host-copier.conf> <include/components/mixin.conf> <include/components/pipeline.conf> @@ -47,28 +48,31 @@ Class.Pipeline."deepbuffer-playback" { type "aif_in" node_type $HDA_HOST_OUTPUT_CLASS num_input_audio_formats 3 - num_output_audio_formats 3 + num_output_audio_formats 1 num_output_pins 1 deep_buffer_dma_ms $DEEPBUFFER_FW_DMA_MS # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } gain."1" { From aeb83eccc4d2525fbdf25f54988c694ee2b4faa0 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Thu, 12 Oct 2023 09:32:46 -0700 Subject: [PATCH 554/639] topology2: sdw-jack-generic: Replace audio_format objects Use input_output_format/output_audio_format explicitly. Additionally, this patch introduces the used of the CombineArrays feature in the topology2 compiler to generate multiple audio format objects from the attribute array combinations. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../platform/intel/sdw-jack-generic.conf | 163 +++++++++++------- 1 file changed, 102 insertions(+), 61 deletions(-) diff --git a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf index a05a441e5db2..1b7a4494728b 100644 --- a/tools/topology/topology2/platform/intel/sdw-jack-generic.conf +++ b/tools/topology/topology2/platform/intel/sdw-jack-generic.conf @@ -186,56 +186,85 @@ Object.Pipeline.host-gateway-capture [ Object.Widget.host-copier.1 { stream_name "Passthrough Capture 0" pcm_id 1 - num_input_audio_formats 9 + num_input_audio_formats 3 num_output_audio_formats 9 - Object.Base.audio_format.1 { - # 32/32 -> 16/16 bits conversion is done here - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 32-bit 48KHz 1ch - Object.Base.input_audio_format.7 { - in_channels 1 - in_bit_depth 32 - in_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - } - Object.Base.output_audio_format.7 { - out_bit_depth 32 - out_valid_bit_depth 32 - out_channels 1 - out_ch_cfg $CHANNEL_CONFIG_MONO - out_ch_map $CHANNEL_MAP_MONO - } - # 24-bit 48KHz 1ch - Object.Base.input_audio_format.8 { - in_channels 1 - in_bit_depth 32 - in_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - } - Object.Base.output_audio_format.8 { - out_bit_depth 32 - out_valid_bit_depth 24 - out_channels 1 - out_ch_cfg $CHANNEL_CONFIG_MONO - out_ch_map $CHANNEL_MAP_MONO - } - # 16-bit 48KHz 1ch - Object.Base.input_audio_format.9 { - in_channels 1 - in_bit_depth 32 - in_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_MONO - in_ch_map $CHANNEL_MAP_MONO - } - Object.Base.output_audio_format.9 { - out_channels 1 - out_ch_cfg $CHANNEL_CONFIG_MONO - out_ch_map $CHANNEL_MAP_MONO - } + Object.Base.input_audio_format [ + # 32-bit 48KHz 2ch + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + # 32-bit 48KHz 4ch + { + in_bit_depth 32 + in_valid_bit_depth 32 + in_channels 4 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + # 32-bit 48KHz 1ch + { + in_channels 1 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_MONO + in_ch_map $CHANNEL_MAP_MONO + } + ] + + CombineArrays.Object.Base.output_audio_format [ + # array of 2ch formats with range of out valid bit depths + { + out_bit_depth [ 32 ] + out_valid_bit_depth [ + 24 + 32 + ] + } + # array of 4ch formats with range of out valid bit depths + { + out_bit_depth [ 32 ] + out_valid_bit_depth [ + 24 + 32 + ] + out_channels [ 4 ] + out_ch_cfg [ $CHANNEL_CONFIG_3_POINT_1 ] + out_ch_map [ $CHANNEL_MAP_3_POINT_1 ] + } + # array of 1ch formats with range of out valid bit depths + { + out_bit_depth [ 32 ] + out_valid_bit_depth [ + 24 + 32 + ] + out_channels [ 1 ] + out_ch_cfg [ $CHANNEL_CONFIG_MONO ] + out_ch_map [ $CHANNEL_MAP_MONO ] + } + # 16-bit 2ch + { + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + } + # 16-bit 4ch + { + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + out_channels [ 4 ] + out_ch_cfg [ $CHANNEL_CONFIG_3_POINT_1 ] + out_ch_map [ $CHANNEL_MAP_3_POINT_1 ] + } + # 16-bit 1ch + { + out_channels [ 1 ] + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + out_ch_cfg [ $CHANNEL_CONFIG_MONO ] + out_ch_map [ $CHANNEL_MAP_MONO ] + } + ] } } ] @@ -253,12 +282,18 @@ Object.Widget { num_output_audio_formats 1 num_output_pins 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } ] @@ -279,12 +314,18 @@ IncludeByKey.PASSTHROUGH { num_input_audio_formats 1 num_output_audio_formats 1 index 11 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] Object.Control.bytes."1" { <include/components/eqiir/highpass_40hz_0db_48khz.conf> From 9aadd197ab882ca4510fddd90dc178094c12a0b1 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 13 Oct 2023 14:29:43 +0300 Subject: [PATCH 555/639] Tools: Topology2: Change gain default curve type to linear This change can drop in TGL platform 2ch 48 kHz gain component peak load e.g. from 16.7 to 7.09 MCPS CPU_PEAK(MAX) reported by sof_perf_analyzer.py. The peak varies a bit time. If several gain instances ramp simulatenously in stream start, the peak MCPS consumption could be source for xruns and glitches if overall load is high. The change with linear curve is barely audible. The computationally heavier Windows fade exponential curve is required only with Windows OS. Since Windows is not using ALSA topologies this change does not impact it. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/topology/topology2/include/components/gain.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology2/include/components/gain.conf b/tools/topology/topology2/include/components/gain.conf index 9167c7df546b..3343365880fd 100644 --- a/tools/topology/topology2/include/components/gain.conf +++ b/tools/topology/topology2/include/components/gain.conf @@ -159,7 +159,7 @@ Class.Widget."gain" { uuid "A8:A9:BC:61:D0:18:18:4A:8E:7B:26:39:21:98:04:B7" no_pm "true" cpc 10183 - curve_type "windows_fade" + curve_type "linear" curve_duration 200000 # 20 ms init_value 0x7fffffff num_input_pins 1 From c22e3f438dab9ae8e4ee3b7e3b4a803f55370f50 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Fri, 13 Oct 2023 14:44:40 +0300 Subject: [PATCH 556/639] Tools: Topology2: Use windows_fade in nocodec topologies This patch changes all cavs-nocodec.conf based topologies to use exponential Windows fade curve_type in gain components. It is done to ensure the ramp gets tested after change of gain curve_type default to linear. The gain in included deep buffer playback pipeline (hw:0,31) and in mixer pipeline (hw:0,41) are not changed because they are used also in normal topologies. Also in capture direction DMIC raw (hw:0,10) remains curve_type 2. Other gains are curve_type 1 Windows fade. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/topology/topology2/cavs-nocodec.conf | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index bac1fe2118c7..f57837fa3ce9 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -188,6 +188,7 @@ IncludeByKey.PASSTHROUGH { pcm_id 0 } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Pre Mixer $SSP0_PCM_NAME Playback Volume' } @@ -204,6 +205,7 @@ IncludeByKey.PASSTHROUGH { pcm_id 2 } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Pre Mixer $SSP2_PCM_NAME Playback Volume' } @@ -224,6 +226,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Post Mixer $SSP0_PCM_NAME Playback Volume' } @@ -259,6 +262,7 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Post Mixer $SSP2_PCM_NAME Playback Volume' } @@ -275,6 +279,7 @@ IncludeByKey.PASSTHROUGH { pcm_id $SSP0_PCM_ID } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Post Demux $SSP0_PCM_NAME Capture Volume' } @@ -289,6 +294,7 @@ IncludeByKey.PASSTHROUGH { pcm_id $SSP0_CAPTURE_PCM_ID } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Post Demux $SSP0_CAPTURE_PCM Volume' } @@ -329,6 +335,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_type "windows_fade" num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -394,6 +401,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Pre Demux $SSP0_PCM_NAME Capture Volume' } @@ -699,6 +707,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_type "windows_fade" num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -755,6 +764,7 @@ IncludeByKey.PASSTHROUGH { } } Object.Widget.gain.1 { + curve_type "windows_fade" num_input_audio_formats 2 num_output_audio_formats 2 Object.Base.audio_format.1 { @@ -1101,6 +1111,7 @@ IncludeByKey.SSP1_ENABLED { pcm_id 1 } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Pre Mixer $SSP1_PCM_NAME Playback Volume' } @@ -1121,6 +1132,7 @@ IncludeByKey.SSP1_ENABLED { } Object.Widget.gain.1 { + curve_type "windows_fade" Object.Control.mixer.1 { name 'Post Mixer $SSP1_PCM_NAME Playback Volume' } From 4dad5c2d5c56bd19cd90034ce2110317edfa250e Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Wed, 11 Oct 2023 15:44:57 +0800 Subject: [PATCH 557/639] topolog2: nocodec: set output_pin number The num_output_pins was set for pass-through path but missed in normal path. Without it Linux kernel driver wouldn't set second output pin format for dai copier which connects smart amp and gain module. Signed-off-by: Rander Wang <rander.wang@intel.com> --- tools/topology/topology2/cavs-nocodec.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index f57837fa3ce9..6682da9b9006 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -382,6 +382,7 @@ IncludeByKey.PASSTHROUGH { out_valid_bit_depth 32 } + num_output_pins 2 Object.Base.output_pin_binding.1 { output_pin_binding_name "gain.8.1" } From 1fc1d2858425f214628cc9365b075f59801331ea Mon Sep 17 00:00:00 2001 From: Rander Wang <rander.wang@intel.com> Date: Thu, 12 Oct 2023 13:18:08 +0800 Subject: [PATCH 558/639] topology2: clean up audio format Separate the input & output audio format. Signed-off-by: Rander Wang <rander.wang@intel.com> --- tools/topology/topology2/cavs-nocodec.conf | 358 +++++++++++++-------- 1 file changed, 226 insertions(+), 132 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec.conf b/tools/topology/topology2/cavs-nocodec.conf index 6682da9b9006..7284769c5194 100644 --- a/tools/topology/topology2/cavs-nocodec.conf +++ b/tools/topology/topology2/cavs-nocodec.conf @@ -313,49 +313,68 @@ IncludeByKey.PASSTHROUGH { } Object.Widget.module-copier.1 { stream_name 'Gain Capture 19' + num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { curve_type "windows_fade" num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] Object.Control.mixer.1 { name 'Pre Demux $DMIC0_PCM_0_NAME Capture Volume' } @@ -375,12 +394,22 @@ IncludeByKey.PASSTHROUGH { copier_type "SSP" stream_name "NoCodec-0" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] num_output_pins 2 Object.Base.output_pin_binding.1 { @@ -394,12 +423,21 @@ IncludeByKey.PASSTHROUGH { Object.Widget.module-copier."2" { stream_name "NoCodec-0" - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } Object.Widget.gain.1 { curve_type "windows_fade" @@ -642,12 +680,21 @@ Object.Pipeline.io-gateway-capture [ copier_type "SSP" stream_name "NoCodec-2" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } } ] @@ -687,48 +734,67 @@ IncludeByKey.PASSTHROUGH { stream_name "Gain Capture 18" pcm_id 27 num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { curve_type "windows_fade" num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Control.mixer.1 { name 'Post Demux $DMIC0_PCM_0_NAME Capture Volume' } @@ -744,48 +810,67 @@ IncludeByKey.PASSTHROUGH { stream_name "Gain Capture 20" pcm_id 28 num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { curve_type "windows_fade" num_input_audio_formats 2 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Control.mixer.1 { name 'Post Demux $DMIC0_PCM_1_NAME Capture Volume' } @@ -1080,12 +1165,21 @@ IncludeByKey.SSP1_ENABLED { copier_type "SSP" stream_name "NoCodec-1" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + + num_input_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + num_output_audio_formats 1 + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } } ] From 1012cea3d6088793910ab2a8b2851c551b0ed51a Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 14 Sep 2023 15:51:24 +0800 Subject: [PATCH 559/639] audio: volume: remove one space in volume code remove space to align with coding standard. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/volume/volume_ipc4.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/volume/volume_ipc4.c b/src/audio/volume/volume_ipc4.c index b54e52c39a53..2265accf0a01 100644 --- a/src/audio/volume/volume_ipc4.c +++ b/src/audio/volume/volume_ipc4.c @@ -159,7 +159,7 @@ int volume_init(struct processing_module *mod) md->private = cd; - for (channel = 0; channel < channels_count ; channel++) { + for (channel = 0; channel < channels_count; channel++) { if (vol->config[0].channel_id == IPC4_ALL_CHANNELS_MASK) channel_cfg = 0; else From 8fc405d1196c09b43ac2920e87de36274ccbd41b Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Fri, 8 Sep 2023 14:48:14 +0800 Subject: [PATCH 560/639] audio: volume: reduce ramp volume calculation Will first check whether have same target volume, if same, then only calculate one channel and copy to other channels. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/volume/volume.c | 23 ++++++++++++++++++++++- src/audio/volume/volume.h | 3 +++ src/audio/volume/volume_ipc3.c | 4 ++++ src/audio/volume/volume_ipc4.c | 4 ++++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index 30896fd87a33..4088c27cda7d 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -243,6 +243,24 @@ static inline int32_t volume_windows_fade_ramp(struct vol_data *cd, int32_t ramp } #endif +void volume_set_ramp_channel_counter(struct vol_data *cd, uint32_t channels_count) +{ + int i; + bool is_same_volume = true; + + for (i = 1; i < channels_count; i++) { + if (cd->tvolume[0] != cd->tvolume[i]) { + is_same_volume = false; + break; + } + } + + if (is_same_volume) + cd->ramp_channel_counter = 1; + else + cd->ramp_channel_counter = channels_count; +} + /** * \brief Ramps volume changes over time. * \param[in,out] vol_data Volume component data @@ -272,7 +290,7 @@ static inline void volume_ramp(struct processing_module *mod) #endif /* Update each volume if it's not at target for active channels */ - for (i = 0; i < cd->channels; i++) { + for (i = 0; i < cd->ramp_channel_counter; i++) { /* skip if target reached */ volume = cd->volume[i]; tvolume = cd->tvolume[i]; @@ -315,6 +333,9 @@ static inline void volume_ramp(struct processing_module *mod) cd->volume[i] = new_vol; } + for (i = cd->ramp_channel_counter; i < cd->channels; i++) + cd->volume[i] = cd->volume[0]; + cd->is_passthrough = cd->ramp_finished; for (i = 0; i < cd->channels; i++) { if (cd->volume[i] != VOL_ZERO_DB) { diff --git a/src/audio/volume/volume.h b/src/audio/volume/volume.h index 140ec3e7af2f..5e8f46a54389 100644 --- a/src/audio/volume/volume.h +++ b/src/audio/volume/volume.h @@ -176,6 +176,7 @@ struct vol_data { bool copy_gain; /**< control copy gain or not */ uint32_t attenuation; /**< peakmeter adjustment in range [0 - 31] */ bool is_passthrough; /**< is passthrough or do gain multiplication */ + uint32_t ramp_channel_counter; /**< channels need new ramp volume */ }; /** \brief Volume processing functions map. */ @@ -308,4 +309,6 @@ void volume_set_chan_mute(struct processing_module *mod, int chan); void volume_set_chan_unmute(struct processing_module *mod, int chan); +void volume_set_ramp_channel_counter(struct vol_data *cd, uint32_t channels_count); + #endif /* __SOF_AUDIO_VOLUME_H__ */ diff --git a/src/audio/volume/volume_ipc3.c b/src/audio/volume/volume_ipc3.c index 6ab48e33915b..4a68d4a6d2df 100644 --- a/src/audio/volume/volume_ipc3.c +++ b/src/audio/volume/volume_ipc3.c @@ -145,6 +145,9 @@ int volume_init(struct processing_module *mod) cd->muted[i] = false; } + /* all target volume are same */ + cd->ramp_channel_counter = 1; + switch (cd->ramp_type) { #if CONFIG_COMP_VOLUME_LINEAR_RAMP case SOF_VOLUME_LINEAR: @@ -217,6 +220,7 @@ int volume_set_config(struct processing_module *mod, uint32_t config_id, return ret; } } + volume_set_ramp_channel_counter(cd, cd->channels); volume_ramp_check(mod); break; diff --git a/src/audio/volume/volume_ipc4.c b/src/audio/volume/volume_ipc4.c index 2265accf0a01..f5826501f256 100644 --- a/src/audio/volume/volume_ipc4.c +++ b/src/audio/volume/volume_ipc4.c @@ -176,6 +176,8 @@ int volume_init(struct processing_module *mod) init_ramp(cd, vol->config[0].curve_duration, target_volume[0]); + volume_set_ramp_channel_counter(cd, channels_count); + cd->mailbox_offset = offsetof(struct ipc4_fw_registers, peak_vol_regs); cd->mailbox_offset += instance_id * sizeof(struct ipc4_peak_volume_regs); @@ -258,6 +260,8 @@ static int volume_set_volume(struct processing_module *mod, const uint8_t *data, } } + volume_set_ramp_channel_counter(cd, channels_count); + cd->scale_vol = vol_get_processing_function(dev, cd); volume_prepare_ramp(dev, cd); From 19c26ea9f4bfe40147693f11e96990fc676b9c27 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 14 Sep 2023 16:09:34 +0800 Subject: [PATCH 561/639] audio: volume: add config for peak volume Add config to control peak volume code need build or not. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/volume/volume.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/audio/volume/volume.c b/src/audio/volume/volume.c index 4088c27cda7d..002ceff9d852 100644 --- a/src/audio/volume/volume.c +++ b/src/audio/volume/volume.c @@ -332,7 +332,7 @@ static inline void volume_ramp(struct processing_module *mod) } cd->volume[i] = new_vol; } - + /* assign other channel volume as the first calculated volume with same volume case */ for (i = cd->ramp_channel_counter; i < cd->channels; i++) cd->volume[i] = cd->volume[0]; @@ -557,8 +557,9 @@ static int volume_process(struct processing_module *mod, comp_dbg(mod->dev, "volume_process()"); while (avail_frames) { +#if CONFIG_COMP_PEAK_VOL volume_update_current_vol_ipc4(cd); - +#endif if (cd->ramp_finished || cd->vol_ramp_frames > avail_frames) { /* without ramping process all at once */ frames = avail_frames; From 13a9c2558de670b0d7055455f8e80a4bf4c91b3c Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 16 Oct 2023 13:40:28 -0700 Subject: [PATCH 562/639] Delete inherited rimage/.github/ workflows yamllint and checkpatch We already have these checks in sof.git so they don't need to be migrated. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .../rimage/.github/workflows/pull-request.yml | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 tools/rimage/.github/workflows/pull-request.yml diff --git a/tools/rimage/.github/workflows/pull-request.yml b/tools/rimage/.github/workflows/pull-request.yml deleted file mode 100644 index c0400490b276..000000000000 --- a/tools/rimage/.github/workflows/pull-request.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -# SPDX-License-Identifier: BSD-3-Clause -# Tools that can save round-trips to github and a lot of time: -# -# yamllint -f parsable this.yml -# pip3 install ruamel.yaml.cmd -# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml -# -# github.com also has a powerful web editor that can be used without -# committing. - -name: codestyle - -# yamllint disable-line rule:truthy -on: [pull_request] - -jobs: - yamllint: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 50 - submodules: recursive - - - name: run yamllint - run: yamllint .github/workflows/*.yml - checkpatch: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - fetch-depth: ${{ env.PR_FETCH_DEPTH }} - - - name: install codespell - run: sudo apt update && sudo apt install -y codespell - - - name: checkpatch.pl PR review - uses: webispy/checkpatch-action@v9 - env: - CHECKPATCH_COMMAND: ./scripts/checkpatch.pl From 8bbad9f263f7403682565aa9e9d000d3c50837c9 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 16 Oct 2023 13:59:30 -0700 Subject: [PATCH 563/639] .github: re-enable rimage workflows Migrate rimage build and cppcheck workflows from sof/tools/rimage/.github/workflows/ (where they're ignored) to sof/.github/workflows/ Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/rimage.yml | 60 +++++++++++++++++++++ tools/rimage/.github/workflows/build.yml | 25 --------- tools/rimage/.github/workflows/cppcheck.yml | 30 ----------- 3 files changed, 60 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/rimage.yml delete mode 100644 tools/rimage/.github/workflows/build.yml delete mode 100644 tools/rimage/.github/workflows/cppcheck.yml diff --git a/.github/workflows/rimage.yml b/.github/workflows/rimage.yml new file mode 100644 index 000000000000..1806fab5f0cf --- /dev/null +++ b/.github/workflows/rimage.yml @@ -0,0 +1,60 @@ +--- +# SPDX-License-Identifier: BSD-3-Clause +# Tools that can save round-trips to github and a lot of time: +# +# yamllint -f parsable this.yml +# pip3 install ruamel.yaml.cmd +# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml +# +# github.com also has a powerful web editor that can be used without +# committing. + +name: rimage + +# yamllint disable-line rule:truthy +on: + workflow_dispatch: + pull_request: + paths: + - tools/rimage/** + push: + paths: + - tools/rimage/** + +jobs: + + # Basic build test + build: + runs-on: ubuntu-22.04 + env: + # FIXME: add -Wpointer-arith + _CFLGS: -Werror -Wall -Wmissing-prototypes + -Wimplicit-fallthrough=3 + + + steps: + - uses: actions/checkout@v4 + with: {submodules: recursive, fetch-depth: 0, filter: 'tree:0'} + + - run: cmake -B build-rimage/ -S tools/rimage/ -DCMAKE_C_FLAGS="${_CFLGS}" + + # VERBOSE because CFLAGS (and -Wpointer-arith) used to be ignored + # for years and no one noticed + - run: cmake --build build-rimage/ -- -j$(nproc) VERBOSE=1 + + + # cppcheck + cppcheck: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: {submodules: recursive, fetch-depth: 0, filter: 'tree:0'} + + - name: apt install cppcheck + run: sudo apt update && sudo apt-get -y install cppcheck + + # TODO enable more types of checks as they are fixed + - name: run cppcheck + run: cppcheck --platform=unix32 --force --max-configs=1024 + --inconclusive --inline-suppr + --error-exitcode=1 tools/rimage/ diff --git a/tools/rimage/.github/workflows/build.yml b/tools/rimage/.github/workflows/build.yml deleted file mode 100644 index 2102fae4f8f0..000000000000 --- a/tools/rimage/.github/workflows/build.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -# Basic build test - -name: build - -# yamllint disable-line rule:truthy -on: [pull_request, push, workflow_dispatch] - -env: - CMAKE_C_FLAGS: "-Werror -Wall -Wmissing-prototypes\ - -Wimplicit-fallthrough=3 -Wpointer-arith" - -jobs: - build-test: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - with: {fetch-depth: 50, submodules: recursive} - - - name: install tools - run: sudo apt update && sudo apt install -y ninja-build - - - name: build - run: cmake -B build/ -G Ninja - - run: cmake --build build/ diff --git a/tools/rimage/.github/workflows/cppcheck.yml b/tools/rimage/.github/workflows/cppcheck.yml deleted file mode 100644 index 211e4004692c..000000000000 --- a/tools/rimage/.github/workflows/cppcheck.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -# SPDX-License-Identifier: BSD-3-Clause -# Tools that can save round-trips to github and a lot of time: -# -# yamllint -f parsable this.yml -# pip3 install ruamel.yaml.cmd -# yaml merge-expand this.yml exp.yml && diff -w -u this.yml exp.yml -# -# github.com also has a powerful web editor that can be used without -# committing. - -name: cppcheck - -# yamllint disable-line rule:truthy -on: [pull_request, push] - -jobs: - cppcheck: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: {fetch-depth: 50, submodules: recursive} - - - name: apt install cppcheck - run: sudo apt update && sudo apt-get -y install cppcheck - - # TODO enable more types of checks as they are fixed - - name: run cppcheck - run: cppcheck --platform=unix32 --force --max-configs=1024 - --inconclusive --quiet --inline-suppr . From fab0f7290174999bdb5a07b6d647267b5ff0871a Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 12 Oct 2023 11:18:03 +0300 Subject: [PATCH 564/639] Tools: Rimage: Config: Add RTC_AEC to TGL. TGL-H, and LNL This patch adds same RTC_AEC module entry as added earlier to config/mtl.toml. The purpose is enable testing the component in other platforms. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/rimage/config/lnl.toml | 19 ++++++++++++++++++- tools/rimage/config/tgl-cavs.toml | 19 ++++++++++++++++++- tools/rimage/config/tgl-h-cavs.toml | 19 ++++++++++++++++++- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/tools/rimage/config/lnl.toml b/tools/rimage/config/lnl.toml index 9c245b9ca8e9..04f9cb18b75e 100644 --- a/tools/rimage/config/lnl.toml +++ b/tools/rimage/config/lnl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 24 +count = 25 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -554,6 +554,23 @@ count = 24 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + [[module.entry]] + name = "RTC_AEC" + uuid = "B780A0A6-269F-466F-B477-23DFA05AF758" + affinity_mask = "0x3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "10" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0x8, 0x2, 0x2, 0x1, + 0, 0, 0x8, 0x2, 0x2, 0x4, + 1, 0, 0x8, 0x2, 0x2, 0x1] + # TDFB module config [[module.entry]] name = "TDFB" diff --git a/tools/rimage/config/tgl-cavs.toml b/tools/rimage/config/tgl-cavs.toml index 320c1f3531e4..3811e2e170c7 100644 --- a/tools/rimage/config/tgl-cavs.toml +++ b/tools/rimage/config/tgl-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 21 +count = 22 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -496,3 +496,20 @@ count = 21 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "RTC_AEC" + uuid = "B780A0A6-269F-466F-B477-23DFA05AF758" + affinity_mask = "0x3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "10" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0x8, 0x2, 0x2, 0x1, + 0, 0, 0x8, 0x2, 0x2, 0x4, + 1, 0, 0x8, 0x2, 0x2, 0x1] diff --git a/tools/rimage/config/tgl-h-cavs.toml b/tools/rimage/config/tgl-h-cavs.toml index 61c3c01ad464..e84736ea1fa0 100644 --- a/tools/rimage/config/tgl-h-cavs.toml +++ b/tools/rimage/config/tgl-h-cavs.toml @@ -60,7 +60,7 @@ name = "ADSPFW" load_offset = "0x30000" [module] -count = 21 +count = 22 [[module.entry]] name = "BRNGUP" uuid = "61EB0CB9-34D8-4F59-A21D-04C54C21D3A4" @@ -496,3 +496,20 @@ count = 21 pin = [0, 0, 0xfeef, 0xf, 0xf, 0x45ff, 1, 0, 0xfeef, 0xf, 0xf, 0x1ff] # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] + + [[module.entry]] + name = "RTC_AEC" + uuid = "B780A0A6-269F-466F-B477-23DFA05AF758" + affinity_mask = "0x3" + instance_count = "1" + domain_types = "0" + load_type = "1" + module_type = "10" + init_config = "1" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0x8, 0x2, 0x2, 0x1, + 0, 0, 0x8, 0x2, 0x2, 0x4, + 1, 0, 0x8, 0x2, 0x2, 0x1] From 56dae244aeeb96a0a6b175248e040179c34bc149 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Fri, 22 Sep 2023 20:50:13 +0800 Subject: [PATCH 565/639] audio: perf: enable dsp clock for performance measurement previously, performance measurement based on platform clock, source clock is 38.4mhz, for better align with CPC calculation, change clock to dsp clock, this will be done through enable config: CONFIG_TIMING_FUNCTIONS, and this config only be used with perf_cnt header file, so this change only have impact on performance build. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- app/perf_overlay.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/app/perf_overlay.conf b/app/perf_overlay.conf index 5c031fe97c59..cd7c16127788 100644 --- a/app/perf_overlay.conf +++ b/app/perf_overlay.conf @@ -1,2 +1,3 @@ CONFIG_PERFORMANCE_COUNTERS=y CONFIG_SYS_HEAP_RUNTIME_STATS=y +CONFIG_TIMING_FUNCTIONS=y \ No newline at end of file From ec3ca41b60d6b5c6ebb6411fc755063d6f3f2854 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Tue, 17 Oct 2023 11:22:26 +0200 Subject: [PATCH 566/639] DP: fix DP thread priority After enabling deadline calculation DP threads began to lose priority in relation to logger thread which currently is set to the same priority but has zeroed deadline. Since processing should be not disturbed by logging operations, the ZEPHYR_DP_THREAD_PRIORITY must be set to lower value than logger. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- src/audio/pipeline/pipeline-schedule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/audio/pipeline/pipeline-schedule.c b/src/audio/pipeline/pipeline-schedule.c index 0a61752079e9..e354ff0f79dc 100644 --- a/src/audio/pipeline/pipeline-schedule.c +++ b/src/audio/pipeline/pipeline-schedule.c @@ -48,7 +48,7 @@ DECLARE_SOF_UUID("dp-task", dp_task_uuid, 0xee755917, 0x96b9, 0x4130, /** * \brief a priority of the DP threads in the system. */ -#define ZEPHYR_DP_THREAD_PRIORITY (CONFIG_NUM_PREEMPT_PRIORITIES - 1) +#define ZEPHYR_DP_THREAD_PRIORITY (CONFIG_NUM_PREEMPT_PRIORITIES - 2) #endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ From e3fc9c1c8e79b6b0e545f8aa20c34b10a6359671 Mon Sep 17 00:00:00 2001 From: Mac Chiang <mac.chiang@intel.com> Date: Wed, 4 Oct 2023 22:56:50 -0400 Subject: [PATCH 567/639] topology2: add rt713_rt1316, no sdw_dmic config This is additional HW board: No SDW_DMIC connection SDW0: rt713 Jack codec SDW1: rt1316 smart amp l SDW2: rt1316 smart amp r Signed-off-by: Mac Chiang <mac.chiang@intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index f505b1e4a4e9..2f40b2e38e91 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -36,6 +36,10 @@ USE_CHAIN_DMA=true,NUM_SDW_AMP_LINKS=2,SDW_SPK_STREAM=SDW1-Playback,SDW_SPK_IN_S SDW_DMIC_STREAM=SDW0-Capture" "cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-rt1713-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1" + +# Jack codec + SmartAmp topology. No SDW_DMIC connection +"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2" + # Below topologies are used on Chromebooks "cavs-rt5682\;sof-mtl-max98357a-rt5682\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ From 02a7c9853429d20ca980ee1aa395b85b15fdf482 Mon Sep 17 00:00:00 2001 From: Keqiao Zhang <keqiao.zhang@intel.com> Date: Wed, 18 Oct 2023 18:07:36 +0800 Subject: [PATCH 568/639] topology: add test TPLGs for LNL-RVP There're no differences for SSP and SoundWire TPLGs between MTL and LNL, we can reuse MTL TPLGs for LNL. Signed-off-by: Keqiao Zhang <keqiao.zhang@intel.com> --- tools/topology/topology2/development/tplg-targets.cmake | 5 +++++ tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tools/topology/topology2/development/tplg-targets.cmake b/tools/topology/topology2/development/tplg-targets.cmake index 7a77c715bd8f..c7c0134ae959 100644 --- a/tools/topology/topology2/development/tplg-targets.cmake +++ b/tools/topology/topology2/development/tplg-targets.cmake @@ -50,6 +50,11 @@ SSP2_CORE_ID=1,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-nocodec-multicore-s SSP0_CORE_ID=0,DMIC_CORE_ID=1,SSP2_CORE_ID=2,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ PASSTHROUGH=false,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-nocodec.bin" +# SSP topology for LNL +"cavs-nocodec\;sof-lnl-nocodec\;PLATFORM=lnl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-nocodec.bin,DEEPBUFFER_FW_DMA_MS=100,\ +DEEPBUFFER_D0I3_COMPATIBLE=true" + # SSP topology for LNL FPGA with lower DMIC IO clock of 19.2MHz, 2ch PDM1 enabled "cavs-nocodec\;sof-lnl-nocodec-fpga-2ch-pdm1\;PLATFORM=lnl,NUM_DMICS=2,PDM1_MIC_A_ENABLE=1,\ PDM1_MIC_B_ENABLE=1,PDM0_MIC_A_ENABLE=0,PDM0_MIC_B_ENABLE=0,PREPROCESS_PLUGINS=nhlt,\ diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 2f40b2e38e91..ffc97bffc8e4 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -75,4 +75,9 @@ PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2.bin,\ BT_NAME=SSP1-BT,BT_INDEX=1,BT_PCM_ID=20,BT_ID=8,BT_PCM_NAME=Bluetooth,ADD_BT=true,\ NUM_SDW_AMP_LINKS=1,SDW_SPK_STREAM=SDW2-Playback,SDW_AMP_FEEDBACK=false,\ SDW_JACK_CAPTURE_CH=1,DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" + +# SDW topology for LNL RVP +"cavs-sdw\;sof-lnl-rt711-4ch\;PLATFORM=lnl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ +DMIC0_ID=2,DMIC1_ID=3,NUM_HDMIS=0,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt711-4ch.bin,\ +DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" ) From f64cc8f528581539b02adf4861ef8e048cf9e0b6 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 13 Oct 2023 08:41:31 -0700 Subject: [PATCH 569/639] topology2: dmic-generic: Replace use of audio_format objects Use input_audio_format/output_audio_format explicitly in preparation for deprecating the audio_format class. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../platform/intel/dmic-generic.conf | 132 +++++++++++------- 1 file changed, 78 insertions(+), 54 deletions(-) diff --git a/tools/topology/topology2/platform/intel/dmic-generic.conf b/tools/topology/topology2/platform/intel/dmic-generic.conf index 6c6ae7ec2da2..5ca0ec27c79b 100644 --- a/tools/topology/topology2/platform/intel/dmic-generic.conf +++ b/tools/topology/topology2/platform/intel/dmic-generic.conf @@ -82,47 +82,63 @@ IncludeByKey.PASSTHROUGH { pcm_id $DMIC0_PCM_ID num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { curve_duration 500000 num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] Object.Control.mixer.1 { name '$DMIC0_PCM_NAME Capture Volume' } @@ -131,24 +147,32 @@ IncludeByKey.PASSTHROUGH { Object.Widget.module-copier."2" { num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.pipeline."1" { core $DMIC_CORE_ID From 1125fe06bc2440f40a4b87a048ac68a64122af61 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 13 Oct 2023 08:53:01 -0700 Subject: [PATCH 570/639] topology2: gain-copier-capture: Replace use of audio_format objects Use input_audio_format/output_audio_format explicitly in preparation for deprecating the audio_format class. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../pipelines/cavs/gain-copier-capture.conf | 111 +++++++++++------- 1 file changed, 71 insertions(+), 40 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf index 6642d28d2858..c63b01b7361b 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-copier-capture.conf @@ -17,7 +17,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/host-copier.conf> <include/components/gain.conf> <include/components/pipeline.conf> @@ -45,59 +46,89 @@ Class.Pipeline."gain-copier-capture" { Object.Widget { host-copier."1" { type "aif_out" - num_input_audio_formats 3 + num_input_audio_formats 1 num_output_audio_formats 3 num_input_pins 1 - # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + # 32-bit 48KHz 2ch + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + ] node_type $HDA_HOST_INPUT_CLASS } gain."1" { num_input_audio_formats 2 num_output_audio_formats 2 - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + #16-bit 48KHz 2ch + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 32-bit 48KHz 2ch + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } module-copier."2" { num_input_audio_formats 2 num_output_audio_formats 2 - #16-bit 48KHz 2ch - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + #16-bit 48KHz 2ch + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + # 32-bit 48KHz 2ch + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } pipeline."1" { From 5945235b4245d40a7af99482e3d5bed94ff47149 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 13 Oct 2023 08:55:23 -0700 Subject: [PATCH 571/639] topology2: mixout-gain-dai-copier-playback: Replace audio_format objects Use input_audio_format/output_audio_format explicitly in preparation for deprecating the audio_format class. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../cavs/mixout-gain-dai-copier-playback.conf | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf index c40c67e1aaf8..06887d0cd9ab 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-dai-copier-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/mixout.conf> @@ -51,10 +52,14 @@ Class.Pipeline."mixout-gain-dai-copier-playback" { num_input_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -64,11 +69,14 @@ Class.Pipeline."mixout-gain-dai-copier-playback" { num_input_audio_formats 1 num_output_audio_formats 1 - # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } From 054003f2926b835d7e7ca2db8e602a7f2f9faeab Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 13 Oct 2023 09:01:58 -0700 Subject: [PATCH 572/639] topology2: host-gateway-playback: Replace audio_format objects Use input_audio_format/output_audio_format explicitly in preparation for deprecating the audio_format class. Fixes: 7a11e27bf2a1 ('topology2: host-gateway-capture: Replace audio_format objects') Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../pipelines/cavs/host-gateway-playback.conf | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf index a2d42e5e3d46..29417fcc3b25 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-gateway-playback.conf @@ -18,7 +18,8 @@ <include/components/host-copier.conf> <include/components/pipeline.conf> -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> Class.Pipeline."host-gateway-playback" { @@ -46,26 +47,28 @@ Class.Pipeline."host-gateway-playback" { type "aif_in" num_output_pins 1 num_input_audio_formats 3 - num_output_audio_formats 3 - # 16-bit input format 48KHz 2ch. Output sample format is always 32-bit for playback - Object.Base.audio_format.1 { - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + num_output_audio_formats 1 + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + # Output sample format is always 32-bit for playback + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { From 82e05a6d615d947a131c302b1b3f794351ace2d6 Mon Sep 17 00:00:00 2001 From: Anas Nashif <anas.nashif@intel.com> Date: Wed, 18 Oct 2023 11:22:27 +0000 Subject: [PATCH 573/639] platform: INTEL_HDA does not exist in the kconfig namespace INTEL_HDA was removed in 59028ad3d136d1ff5030009e9727295363d1db9f Signed-off-by: Anas Nashif <anas.nashif@intel.com> --- src/platform/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/src/platform/Kconfig b/src/platform/Kconfig index d4787c140293..78983d460ef2 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -280,7 +280,6 @@ config CAVS select INTEL select XT_INTERRUPT_LEVEL_2 select XT_INTERRUPT_LEVEL_5 - select INTEL_HDA if !ZEPHYR_NATIVE_DRIVERS select INTEL_MN select WAKEUP_HOOK select SCHEDULE_DMA_SINGLE_CHANNEL From b593e33af6b9a594616a0ad0578da51c1939c13a Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Fri, 18 Aug 2023 16:28:18 +0530 Subject: [PATCH 574/639] scripts: add support for ACP_6_3 platform Add support for ACP_6_3 in build scripts. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- scripts/xtensa-build-all.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/xtensa-build-all.sh b/scripts/xtensa-build-all.sh index e8cae4417964..e54298dcd56a 100755 --- a/scripts/xtensa-build-all.sh +++ b/scripts/xtensa-build-all.sh @@ -20,6 +20,9 @@ SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" ) # Waiting for container work in progress SUPPORTED_PLATFORMS+=( mt8188 ) +# Container work is in progress +SUPPORTED_PLATFORMS+=( acp_6_3 ) + BUILD_ROM=no BUILD_DEBUG=no BUILD_FORCE_UP=no @@ -242,6 +245,13 @@ do HOST="xtensa-vangogh-elf" XTENSA_TOOLS_VERSION="RI-2019.1-linux" ;; + acp_6_3) + PLATFORM="acp_6_3" + ARCH="xtensa" + XTENSA_CORE="ACP_6_3_HiFi5_PROD_Linux" + HOST="xtensa-acp_6_3-elf" + XTENSA_TOOLS_VERSION="RI-2021.6-linux" + ;; mt8186) PLATFORM="mt8186" XTENSA_CORE="hifi5_7stg_I64D128" From 2c4d02df1e952ad234a0ac2d006e152cba6048aa Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Fri, 18 Aug 2023 16:42:22 +0530 Subject: [PATCH 575/639] src: arch: xtensa: configs: add ACP_6_3 defconfig Add defconfig for ACP_6_3 platform. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- src/arch/xtensa/configs/acp_6_3_defconfig | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/arch/xtensa/configs/acp_6_3_defconfig diff --git a/src/arch/xtensa/configs/acp_6_3_defconfig b/src/arch/xtensa/configs/acp_6_3_defconfig new file mode 100644 index 000000000000..4a4646306ba4 --- /dev/null +++ b/src/arch/xtensa/configs/acp_6_3_defconfig @@ -0,0 +1,36 @@ +CONFIG_ACP_6_3=y +CONFIG_RIMAGE_SIGNING_SCHEMA="acp_6_3" +CONFIG_TRACE_CHANNEL=7 +CONFIG_WRAP_ACTUAL_POSITION=y +CONFIG_AMD_BT=n +CONFIG_AMD_SP=n +CONFIG_CORE_COUNT=1 +CONFIG_LP_MEMORY_BANKS=0 +CONFIG_HP_MEMORY_BANKS=10 +CONFIG_FORMAT_CONVERT_HIFI3=n +CONFIG_LP_SRAM=n +CONFIG_HAVE_AGENT=n +CONFIG_COMP_VOLUME=n +CONFIG_COMP_SRC=n +CONFIG_COMP_FIR=n +CONFIG_COMP_IIR=n +CONFIG_COMP_DCBLOCK=n +CONFIG_COMP_CROSSOVER=n +CONFIG_COMP_DRC=n +CONFIG_COMP_MULTIBAND_DRC=n +CONFIG_COMP_TONE=n +CONFIG_COMP_SWITCH=n +CONFIG_COMP_KPB=n +CONFIG_MAXIM_DSM=n +CONFIG_COMP_ASRC=n +CONFIG_COMP_IGO_NR=n +CONFIG_COMP_COPIER=n +CONFIG_COMP_RTNR=n +CONFIG_COMP_ARIA=n +CONFIG_COMP_BASEFW_IPC4=n +CONFIG_COMP_UP_DOWN_MIXER=n +CONFIG_COMP_DCBLOCK=n +CONFIG_COMP_TDFB=n +#CONFIG_COMP_MUX=n +CONFIG_COMP_SEL=n +CONFIG_COMP_MIXER=n From 2e5703d7d7b3438189285e7ca00898aa14caac59 Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Tue, 22 Aug 2023 18:15:15 +0530 Subject: [PATCH 576/639] amd: acp_6_3: add build support for ACP_6_3 Add build support to enable ACP_6_3 platform. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- src/arch/xtensa/CMakeLists.txt | 4 +++- src/drivers/amd/CMakeLists.txt | 2 +- src/platform/Kconfig | 14 ++++++++++++++ src/platform/amd/CMakeLists.txt | 2 ++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index ba045fe6ccb1..45d6782cc22e 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -16,6 +16,8 @@ elseif(CONFIG_REMBRANDT) set(platform_folder amd/rembrandt) elseif(CONFIG_VANGOGH) set(platform_folder amd/vangogh) +elseif(CONFIG_ACP_6_3) + set(platform_folder amd/acp_6_3) elseif(CONFIG_MT8186) set(platform_folder mt8186) elseif(CONFIG_MT8188) @@ -472,7 +474,7 @@ add_custom_target( # NXP set(UNSIGNED_RI imx8 imx8x imx8m imx8ulp) # AMD -list(APPEND UNSIGNED_RI rn rmb vangogh) +list(APPEND UNSIGNED_RI rn rmb vangogh acp_6_3) # MediaTek list(APPEND UNSIGNED_RI mt8186 mt8188 mt8195) diff --git a/src/drivers/amd/CMakeLists.txt b/src/drivers/amd/CMakeLists.txt index f3c352bb17fc..962104a1fc3a 100644 --- a/src/drivers/amd/CMakeLists.txt +++ b/src/drivers/amd/CMakeLists.txt @@ -2,7 +2,7 @@ add_subdirectory(common) if(CONFIG_RENOIR) add_subdirectory(renoir) -elseif(CONFIG_REMBRANDT) +elseif(CONFIG_REMBRANDT OR CONFIG_ACP_6_3) add_subdirectory(rembrandt) elseif(CONFIG_VANGOGH) add_subdirectory(vangogh) diff --git a/src/platform/Kconfig b/src/platform/Kconfig index 78983d460ef2..18836cb23d3f 100644 --- a/src/platform/Kconfig +++ b/src/platform/Kconfig @@ -170,6 +170,19 @@ config VANGOGH help Select if your target platform is vangogh-compatible +config ACP_6_3 + bool "Build for ACP_6_3" + select XT_INTERRUPT_LEVEL_5 + select XT_INTERRUPT_LEVEL_3 + select XT_INTERRUPT_LEVEL_1 + select XT_INTERRUPT_LEVEL_4 + select XT_WAITI_DELAY + select XTENSA_EXCLUSIVE + select AMD + select SCHEDULE_DMA_MULTI_CHANNEL + help + Select if your target platform is acp_6_3-compatible + config MT8186 bool "Build for MTK MT8186" select XT_INTERRUPT_LEVEL_1 @@ -399,6 +412,7 @@ config RIMAGE_SIGNING_SCHEMA default "rn" if RENOIR default "rmb" if REMBRANDT default "vangogh" if VANGOGH + default "acp_6_3" if ACP_6_3 default "mt8186" if MT8186 default "mt8188" if MT8188 default "mt8195" if MT8195 diff --git a/src/platform/amd/CMakeLists.txt b/src/platform/amd/CMakeLists.txt index f3c352bb17fc..b9095b3845f2 100644 --- a/src/platform/amd/CMakeLists.txt +++ b/src/platform/amd/CMakeLists.txt @@ -6,4 +6,6 @@ elseif(CONFIG_REMBRANDT) add_subdirectory(rembrandt) elseif(CONFIG_VANGOGH) add_subdirectory(vangogh) +elseif(CONFIG_ACP_6_3) + add_subdirectory(acp_6_3) endif() From 559f3ffdb9fef94d1a5d3cc60030646e6477429c Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Wed, 23 Aug 2023 11:43:59 +0530 Subject: [PATCH 577/639] tools: topology: add ACP_6_3 topology support Add ACP_6_3 platform topology. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- tools/topology/topology1/CMakeLists.txt | 3 +- tools/topology/topology1/sof-acp_6_3.m4 | 98 +++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 tools/topology/topology1/sof-acp_6_3.m4 diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 4dce10b304a1..344285efe539 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -222,13 +222,14 @@ set(TPLGS "sof-rn-rt5682-rt1019\;sof-rn-rt5682-rt1019" "sof-rn-rt5682-rt1019\;sof-rn-rt5682-rt1019-dts\;-DDTS=`DTS'" "sof-rn-rt5682-max98360\;sof-rn-rt5682-max98360" - "sof-acp-rmb\;sof-acp-rmb" "sof-acp-vangogh\;sof-vangogh-nau8821-max" + "sof-acp-rmb\;sof-acp-rmb" "sof-acp-rmb-dmic4ch\;sof-acp-rmb-dmic4ch" "sof-acp-rmb-tdm8ch-dmic4ch-rt5682-rt1019\;sof-acp-rmb-tdm8ch-dmic4ch-rt5682-rt1019" "sof-acp-rmb-tdm8ch-dmic2ch-nau8825-max98360\;sof-acp-rmb-tdm8ch-dmic2ch-nau8825-max98360" "sof-acp-rmb\;sof-rmb-rt5682s-rt1019" "sof-acp-rmb\;sof-rmb-nau8825-max98360" + "sof-acp_6_3\;sof-acp_6_3" ) # This empty 'production/' source subdirectory exists only to create the diff --git a/tools/topology/topology1/sof-acp_6_3.m4 b/tools/topology/topology1/sof-acp_6_3.m4 new file mode 100644 index 000000000000..88204638d9ac --- /dev/null +++ b/tools/topology/topology1/sof-acp_6_3.m4 @@ -0,0 +1,98 @@ +# +# Topology for ACP_6_3 with I2SHS and DMIC. +# + +# Include topology builder +include(`utils.m4') +include(`dai.m4') +include(`pipeline.m4') +include(`acp-hs.m4') +include(`acp-dmic.m4') + +# Include TLV library +include(`common/tlv.m4') + +# Include Token library +include(`sof/tokens.m4') + +# Include ACP DSP configuration +include(`platform/amd/acp.m4') + +DEBUG_START +#====================================================================== +# Playback pipeline 1 on PCM 0 using max 2 channels of s16le. + +dnl PIPELINE_PCM_ADD(pipeline, +dnl pipe id, pcm, max channels, format, +dnl period, priority, core, +dnl pcm_min_rate, pcm_max_rate, pipeline_rate) + +# Schedule 96 frames per 2000us deadline on core 0 with priority 0 +PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4, + 1, 0, 2, s16le, + 2000, 0, 0, + 48000, 48000, 48000) + +dnl DAI_ADD(pipeline, +dnl pipe id, dai type, dai_index, dai_be, +dnl buffer, periods, format, +dnl deadline, priority, core, time_domain) + +# playback DAI is ACPHS using 2 periods +DAI_ADD(sof/pipe-dai-playback.m4, + 1, ACPHS, 0, acp-headset-codec, + PIPELINE_SOURCE_1, 2, s16le, + 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +dnl DAI_CONFIG(type, dai_index, link_id, name, acphs_config/acpdmic_config) +dnl ACPHS_CONFIG(format, mclk, bclk, fsync, tdm, acphs_config_data) +dnl ACP_CLOCK(clock, freq, codec_master, polarity) +dnl ACPHS_CONFIG_DATA(type, idx, valid bits, mclk_id) +dnl mclk_id is optional + +DAI_CONFIG(ACPHS, 0, 0, acp-headset-codec, + ACPHS_CONFIG(I2S, ACP_CLOCK(mclk, 49152000, codec_mclk_in), + ACP_CLOCK(bclk, 3072000, codec_slave), + ACP_CLOCK(fsync, 48000, codec_slave), + ACP_TDM(2, 32, 3, 3),ACPHS_CONFIG_DATA(ACPHS, 0, 48000, 2, 0))) + +#=========================================================================== +# Capture pipeline 2 on PCM 0 using max 2 channels of s16le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 2, 0, 2, s16le, + 2000, 0, 0, + 48000, 48000, 48000) + +# Capture DAI is ACPHS using 2 periods +DAI_ADD(sof/pipe-dai-capture.m4, + 2, ACPHS, 0, acp-headset-codec, + PIPELINE_SINK_2, 2, s16le, + 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +#=========================================================================== +# PCM id 0 +PCM_DUPLEX_ADD(I2SHS, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) + +#========================================================================== +# Capture pipeline 3 on PCM 1 using max 2 channels of s32le. +PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, + 4, 2, 2, s32le, + 2000, 0, 0, + 48000, 48000, 48000) + +DAI_ADD(sof/pipe-dai-capture.m4, + 4, ACPDMIC, 0, acp-dmic-codec, + PIPELINE_SINK_4, 2, s32le, + 2000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) + +#dnl DAI_CONFIG(type, dai_index, link_id, name, acpdmic_config) +DAI_CONFIG(ACPDMIC, 3, 2, acp-dmic-codec, + ACPDMIC_CONFIG(ACPDMIC_CONFIG_DATA(ACPDMIC, 3, 48000, 2))) + +#========================================================================== +# PCM id 2 +PCM_CAPTURE_ADD(DMIC, 2, PIPELINE_PCM_4) + +#========================================================================== + +DEBUG_END From 8fab6f22366c5a9f8342bd3324aa3ff74027a1c8 Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Wed, 23 Aug 2023 12:49:55 +0530 Subject: [PATCH 578/639] platform: Add ACP_6_3 platform support Add ACP_6_3 platform support Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- src/platform/amd/acp_6_3/CMakeLists.txt | 5 + src/platform/amd/acp_6_3/acp_6_3.x.in | 581 +++++++++ .../include/arch/xtensa/config/core-isa.h | 714 +++++++++++ .../include/arch/xtensa/config/core-matmap.h | 317 +++++ .../acp_6_3/include/arch/xtensa/config/defs.h | 38 + .../include/arch/xtensa/config/specreg.h | 108 ++ .../include/arch/xtensa/config/system.h | 262 ++++ .../include/arch/xtensa/config/tie-asm.h | 366 ++++++ .../acp_6_3/include/arch/xtensa/config/tie.h | 211 ++++ .../include/arch/xtensa/tie/xt_datacache.h | 132 ++ .../include/platform/chip_offset_byte.h | 195 +++ .../acp_6_3/include/platform/chip_registers.h | 1062 +++++++++++++++++ .../include/platform/drivers/interrupt.h | 109 ++ .../acp_6_3/include/platform/fw_scratch_mem.h | 120 ++ .../amd/acp_6_3/include/platform/lib/memory.h | 185 +++ .../amd/acp_6_3/include/platform/platform.h | 101 ++ src/platform/amd/acp_6_3/lib/CMakeLists.txt | 8 + src/platform/amd/acp_6_3/lib/clk.c | 494 ++++++++ src/platform/amd/acp_6_3/lib/dai.c | 198 +++ src/platform/amd/acp_6_3/lib/dma.c | 132 ++ src/platform/amd/acp_6_3/lib/memory.c | 95 ++ src/platform/amd/acp_6_3/platform.c | 210 ++++ 22 files changed, 5643 insertions(+) create mode 100644 src/platform/amd/acp_6_3/CMakeLists.txt create mode 100644 src/platform/amd/acp_6_3/acp_6_3.x.in create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/core-isa.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/core-matmap.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/defs.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/specreg.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/system.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/tie-asm.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/config/tie.h create mode 100644 src/platform/amd/acp_6_3/include/arch/xtensa/tie/xt_datacache.h create mode 100644 src/platform/amd/acp_6_3/include/platform/chip_offset_byte.h create mode 100644 src/platform/amd/acp_6_3/include/platform/chip_registers.h create mode 100644 src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h create mode 100644 src/platform/amd/acp_6_3/include/platform/fw_scratch_mem.h create mode 100644 src/platform/amd/acp_6_3/include/platform/lib/memory.h create mode 100644 src/platform/amd/acp_6_3/include/platform/platform.h create mode 100644 src/platform/amd/acp_6_3/lib/CMakeLists.txt create mode 100644 src/platform/amd/acp_6_3/lib/clk.c create mode 100644 src/platform/amd/acp_6_3/lib/dai.c create mode 100644 src/platform/amd/acp_6_3/lib/dma.c create mode 100644 src/platform/amd/acp_6_3/lib/memory.c create mode 100644 src/platform/amd/acp_6_3/platform.c diff --git a/src/platform/amd/acp_6_3/CMakeLists.txt b/src/platform/amd/acp_6_3/CMakeLists.txt new file mode 100644 index 000000000000..ec909d60035f --- /dev/null +++ b/src/platform/amd/acp_6_3/CMakeLists.txt @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: BSD-3-Clause + +add_subdirectory(lib) + +add_local_sources(sof platform.c) diff --git a/src/platform/amd/acp_6_3/acp_6_3.x.in b/src/platform/amd/acp_6_3/acp_6_3.x.in new file mode 100644 index 000000000000..44de135f96f3 --- /dev/null +++ b/src/platform/amd/acp_6_3/acp_6_3.x.in @@ -0,0 +1,581 @@ +/* + * Linker Script for AMD ACP_6_3 + * + * This script is run through the GNU C preprocessor to align the memory + * offsets with headers. + * + * Use spaces for formatting as cpp ignore tab sizes. + */ + +#include <sof/lib/memory.h> +#include <xtensa/config/core-isa.h> + +OUTPUT_ARCH(xtensa) + +MEMORY +{ + vector_reset_text : + org = XCHAL_RESET_VECTOR_PADDR, + len = SOF_MEM_RESET_TEXT_SIZE + vector_reset_lit : + org = XCHAL_RESET_VECTOR_PADDR + SOF_MEM_RESET_TEXT_SIZE, + len = SOF_MEM_RESET_LIT_SIZE + vector_base_text : + org = XCHAL_WINDOW_VECTORS_VADDR, //XCHAL_VECBASE_RESET_PADDR, + len = SOF_MEM_VECBASE_LIT_SIZE + vector_int2_lit : + org = XCHAL_INTLEVEL2_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_int2_text : + org = XCHAL_INTLEVEL2_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_int3_lit : + org = XCHAL_INTLEVEL3_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_int3_text : + org = XCHAL_INTLEVEL3_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_int4_lit : + org = XCHAL_INTLEVEL4_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_int4_text : + org = XCHAL_INTLEVEL4_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_int5_lit : + org = XCHAL_INTLEVEL5_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_int5_text : + org = XCHAL_INTLEVEL5_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_int6_lit : + org = XCHAL_INTLEVEL6_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_int6_text : + org = XCHAL_INTLEVEL6_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + + vector_int7_lit : + org = XCHAL_INTLEVEL7_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_int7_text : + org = XCHAL_INTLEVEL7_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_kernel_lit : + org = XCHAL_KERNEL_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_kernel_text : + org = XCHAL_KERNEL_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_user_lit : + org = XCHAL_USER_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_user_text : + org = XCHAL_USER_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + vector_double_lit : + org = XCHAL_DOUBLEEXC_VECTOR_PADDR - SOF_MEM_VECT_LIT_SIZE, + len = SOF_MEM_VECT_LIT_SIZE + vector_double_text : + org = XCHAL_DOUBLEEXC_VECTOR_PADDR, + len = SOF_MEM_VECT_TEXT_SIZE + sof_iram_text_start : + org = XCHAL_DOUBLEEXC_VECTOR_PADDR + SOF_MEM_VECT_TEXT_SIZE, + len = IRAM_BASE + (XCHAL_DOUBLEEXC_VECTOR_PADDR + SOF_MEM_VECT_TEXT_SIZE) + sof_sdram0 : + org = DRAM0_BASE, + len = DRAM0_SIZE + DRAM1_SIZE - SOF_STACK_SIZE + system_heap : + org = HEAP_SYSTEM_BASE, + len = HEAP_SYSTEM_SIZE + system_runtime_heap : + org = HEAP_SYS_RUNTIME_BASE, + len = HEAP_SYS_RUNTIME_SIZE + runtime_heap : + org = HEAP_RUNTIME_BASE, + len = HEAP_RUNTIME_SIZE + buffer_heap : + org = HEAP_BUFFER_BASE, + len = HEAP_BUFFER_SIZE + sof_stack : + org = SOF_STACK_END, + len = SOF_STACK_BASE - SOF_STACK_END, +sof_sdram1 : + org = DRAM1_BASE, + len = DRAM1_SIZE +sof_sram1 : + org = SRAM1_BASE, + len = SRAM1_SIZE + static_uuid_entries_seg (!ari) : + org = UUID_ENTRY_ELF_BASE, + len = UUID_ENTRY_ELF_SIZE + static_log_entries_seg (!ari) : + org = LOG_ENTRY_ELF_BASE, + len = LOG_ENTRY_ELF_SIZE + fw_metadata_seg (!ari) : + org = EXT_MANIFEST_ELF_BASE, + len = EXT_MANIFEST_ELF_SIZE +} + +PHDRS +{ + vector_reset_text_phdr PT_LOAD; + vector_reset_lit_phdr PT_LOAD; + vector_base_text_phdr PT_LOAD; + vector_base_lit_phdr PT_LOAD; + vector_int2_text_phdr PT_LOAD; + vector_int2_lit_phdr PT_LOAD; + vector_int3_text_phdr PT_LOAD; + vector_int3_lit_phdr PT_LOAD; + vector_int4_text_phdr PT_LOAD; + vector_int4_lit_phdr PT_LOAD; + vector_int5_text_phdr PT_LOAD; + vector_int5_lit_phdr PT_LOAD; + vector_int6_text_phdr PT_LOAD; + vector_int6_lit_phdr PT_LOAD; + vector_int7_text_phdr PT_LOAD; + vector_int7_lit_phdr PT_LOAD; + vector_kernel_text_phdr PT_LOAD; + vector_kernel_lit_phdr PT_LOAD; + vector_user_text_phdr PT_LOAD; + vector_user_lit_phdr PT_LOAD; + vector_double_text_phdr PT_LOAD; + vector_double_lit_phdr PT_LOAD; + sof_iram_text_start_phdr PT_LOAD; + sof_sdram0_phdr PT_LOAD; + sof_sram1_phdr PT_LOAD; + sof_stack_phdr PT_LOAD; + system_heap_phdr PT_LOAD; + system_runtime_heap_phdr PT_LOAD; + runtime_heap_phdr PT_LOAD; + buffer_heap_phdr PT_LOAD; + sof_sdram1_phdr PT_LOAD; + static_uuid_entries_phdr PT_NOTE; + static_log_entries_phdr PT_NOTE; + metadata_entries_phdr PT_NOTE; +} + +/* Default entry point: */ +ENTRY(_ResetVector) +_rom_store_table = 0; + +/* ABI0 does not use Window base */ +PROVIDE(_memmap_vecbase_reset = XCHAL_WINDOW_VECTORS_VADDR); + +/* Various memory-map dependent cache attribute settings: */ +_memmap_cacheattr_wb_base = 0x20004400; +_memmap_cacheattr_wt_base = 0x20001100; +_memmap_cacheattr_bp_base = 0x20002200; +_memmap_cacheattr_unused_mask = 0x0FFF00FF; +_memmap_cacheattr_wb_trapnull = 0x2222442F; +_memmap_cacheattr_wba_trapnull = 0x2222442F; +_memmap_cacheattr_wbna_trapnull = 0x2222552F; +_memmap_cacheattr_wt_trapnull = 0x2222112F; +_memmap_cacheattr_bp_trapnull = 0x2222222F; +_memmap_cacheattr_wb_strict = 0x2FFF44FF; +_memmap_cacheattr_wt_strict = 0x2FFF11FF; +_memmap_cacheattr_bp_strict = 0x2FFF22FF; +_memmap_cacheattr_wb_allvalid = 0x22224422; +_memmap_cacheattr_wt_allvalid = 0x22221122; +_memmap_cacheattr_bp_allvalid = 0x22222222; +PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wbna_trapnull); +_EXT_MAN_ALIGN_ = 16; +EXTERN(ext_man_fw_ver) + + +SECTIONS +{ + .ResetVector.text : ALIGN(4) + { + _ResetVector_text_start = ABSOLUTE(.); + KEEP (*(.ResetVector.text)) + _ResetVector_text_end = ABSOLUTE(.); + } >vector_reset_text :vector_reset_text_phdr + + .ResetVector.literal : ALIGN(4) + { + _ResetVector_literal_start = ABSOLUTE(.); + *(.ResetVector.literal) + _ResetVector_literal_end = ABSOLUTE(.); + } >vector_reset_lit :vector_reset_lit_phdr + + .WindowVectors.text : ALIGN(4) + { + _WindowVectors_text_start = ABSOLUTE(.); + KEEP (*(.WindowVectors.text)) + _WindowVectors_text_end = ABSOLUTE(.); + } >vector_base_text :vector_base_text_phdr + + .Level2InterruptVector.literal : ALIGN(4) + { + _Level2InterruptVector_literal_start = ABSOLUTE(.); + *(.Level2InterruptVector.literal) + _Level2InterruptVector_literal_end = ABSOLUTE(.); + } >vector_int2_lit :vector_int2_lit_phdr + + .Level2InterruptVector.text : ALIGN(4) + { + _Level2InterruptVector_text_start = ABSOLUTE(.); + KEEP (*(.Level2InterruptVector.text)) + _Level2InterruptVector_text_end = ABSOLUTE(.); + } >vector_int2_text :vector_int2_text_phdr + + .Level3InterruptVector.literal : ALIGN(4) + { + _Level3InterruptVector_literal_start = ABSOLUTE(.); + *(.Level3InterruptVector.literal) + _Level3InterruptVector_literal_end = ABSOLUTE(.); + } >vector_int3_lit :vector_int3_lit_phdr + + .Level3InterruptVector.text : ALIGN(4) + { + _Level3InterruptVector_text_start = ABSOLUTE(.); + KEEP (*(.Level3InterruptVector.text)) + _Level3InterruptVector_text_end = ABSOLUTE(.); + } >vector_int3_text :vector_int3_text_phdr + + .Level4InterruptVector.literal : ALIGN(4) + { + _Level4InterruptVector_literal_start = ABSOLUTE(.); + *(.Level4InterruptVector.literal) + _Level4InterruptVector_literal_end = ABSOLUTE(.); + } >vector_int4_lit :vector_int4_lit_phdr + + .Level4InterruptVector.text : ALIGN(4) + { + _Level4InterruptVector_text_start = ABSOLUTE(.); + KEEP (*(.Level4InterruptVector.text)) + _Level4InterruptVector_text_end = ABSOLUTE(.); + } >vector_int4_text :vector_int4_text_phdr + + .Level5InterruptVector.literal : ALIGN(4) + { + _Level5InterruptVector_literal_start = ABSOLUTE(.); + *(.Level5InterruptVector.literal) + _Level5InterruptVector_literal_end = ABSOLUTE(.); + } >vector_int5_lit :vector_int5_lit_phdr + + .Level5InterruptVector.text : ALIGN(4) + { + _Level5InterruptVector_text_start = ABSOLUTE(.); + KEEP (*(.Level5InterruptVector.text)) + _Level5InterruptVector_text_end = ABSOLUTE(.); + } >vector_int5_text :vector_int5_text_phdr + + .DebugExceptionVector.literal : ALIGN(4) + { + _DebugExceptionVector_literal_start = ABSOLUTE(.); + *(.DebugExceptionVector.literal) + _DebugExceptionVector_literal_end = ABSOLUTE(.); + } >vector_int6_lit :vector_int6_lit_phdr + + .DebugExceptionVector.text : ALIGN(4) + { + _DebugExceptionVector_text_start = ABSOLUTE(.); + KEEP (*(.DebugExceptionVector.text)) + _DebugExceptionVector_text_end = ABSOLUTE(.); + } >vector_int6_text :vector_int6_text_phdr + + .NMIExceptionVector.literal : ALIGN(4) + { + _NMIExceptionVector_literal_start = ABSOLUTE(.); + *(.NMIExceptionVector.literal) + _NMIExceptionVector_literal_end = ABSOLUTE(.); + } >vector_int7_lit :vector_int5_lit_phdr + + .NMIExceptionVector.text : ALIGN(4) + { + _NMIExceptionVector_text_start = ABSOLUTE(.); + KEEP (*(.NMIExceptionVector.text)) + _NMIExceptionVector_text_end = ABSOLUTE(.); + } >vector_int7_text :vector_int5_text_phdr + + .KernelExceptionVector.literal : ALIGN(4) + { + _KernelExceptionVector_literal_start = ABSOLUTE(.); + *(.KernelExceptionVector.literal) + _KernelExceptionVector_literal_end = ABSOLUTE(.); + } >vector_kernel_lit :vector_kernel_lit_phdr + + .KernelExceptionVector.text : ALIGN(4) + { + _KernelExceptionVector_text_start = ABSOLUTE(.); + KEEP (*(.KernelExceptionVector.text)) + _KernelExceptionVector_text_end = ABSOLUTE(.); + } >vector_kernel_text :vector_kernel_text_phdr + + .UserExceptionVector.literal : ALIGN(4) + { + _UserExceptionVector_literal_start = ABSOLUTE(.); + *(.UserExceptionVector.literal) + _UserExceptionVector_literal_end = ABSOLUTE(.); + } >vector_user_lit :vector_user_lit_phdr + + .UserExceptionVector.text : ALIGN(4) + { + _UserExceptionVector_text_start = ABSOLUTE(.); + KEEP (*(.UserExceptionVector.text)) + _UserExceptionVector_text_end = ABSOLUTE(.); + } >vector_user_text :vector_user_text_phdr + + .DoubleExceptionVector.literal : ALIGN(4) + { + _DoubleExceptionVector_literal_start = ABSOLUTE(.); + *(.DoubleExceptionVector.literal) + _DoubleExceptionVector_literal_end = ABSOLUTE(.); + } >vector_double_lit :vector_double_lit_phdr + + .DoubleExceptionVector.text : ALIGN(4) + { + _DoubleExceptionVector_text_start = ABSOLUTE(.); + KEEP (*(.DoubleExceptionVector.text)) + _DoubleExceptionVector_text_end = ABSOLUTE(.); + } >vector_double_text :vector_double_text_phdr + + .iram.text : ALIGN(4) + { + _stext = .; + _iram_text_start = ABSOLUTE(.); + *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text) + _iram_text_end = ABSOLUTE(.); + } >sof_iram_text_start :sof_iram_text_start_phdr + + /* stack */ + _end = SOF_STACK_END; + PROVIDE(end = SOF_STACK_END); + _stack_sentry = SOF_STACK_END; + __stack = SOF_STACK_BASE; + + .text : ALIGN(4) + { + _stext = .; + _text_start = ABSOLUTE(.); + *(.entry.text) + *(.init.literal) + KEEP(*(.init)) + *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) + *(.fini.literal) + KEEP(*(.fini)) + *(.gnu.version) + _text_end = ABSOLUTE(.); + _etext = .; + } >sof_iram_text_start :sof_iram_text_start_phdr + + .rodata : ALIGN(4) + { + _rodata_start = ABSOLUTE(.); + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r.*) + *(.rodata1) + __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); + KEEP (*(.xt_except_table)) + KEEP (*(.gcc_except_table)) + *(.gnu.linkonce.e.*) + *(.gnu.version_r) + KEEP (*(.eh_frame)) + /* C++ constructor and destructor tables, properly ordered: */ + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + /* C++ exception handlers table: */ + __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); + *(.xt_except_desc) + *(.gnu.linkonce.h.*) + __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); + *(.xt_except_desc_end) + *(.dynamic) + *(.gnu.version_d) + . = ALIGN(4); /* this table MUST be 4-byte aligned */ + _bss_table_start = ABSOLUTE(.); + LONG(_bss_start) + LONG(_bss_end) + _bss_table_end = ABSOLUTE(.); + _rodata_end = ABSOLUTE(.); + } >sof_sram1 :sof_sram1_phdr + + .module_init : ALIGN(4) + { + _module_init_start = ABSOLUTE(.); + *(*.initcall) + _module_init_end = ABSOLUTE(.); + } >sof_sram1 :sof_sram1_phdr + + .data : ALIGN(4) + { + _data_start = ABSOLUTE(.); + *(.data) + *(.data.*) + *(.gnu.linkonce.d.*) + KEEP(*(.gnu.linkonce.d.*personality*)) + *(.data1) + *(.sdata) + *(.sdata.*) + *(.gnu.linkonce.s.*) + *(.sdata2) + *(.sdata2.*) + *(.gnu.linkonce.s2.*) + KEEP(*(.jcr)) + _trace_ctx_start = ABSOLUTE(.); + *(.trace_ctx) + _trace_ctx_end = ABSOLUTE(.); + _data_end = ABSOLUTE(.); + } >sof_sram1 :sof_sram1_phdr + + .lit4 : ALIGN(4) + { + _lit4_start = ABSOLUTE(.); + *(*.lit4) + *(.lit4.*) + *(.gnu.linkonce.lit4.*) + _lit4_end = ABSOLUTE(.); + } >sof_sram1 :sof_sram1_phdr + + .fw_ready : ALIGN(4) + { + KEEP (*(.fw_ready)) + } >sof_sram1 :sof_sram1_phdr + + + .bss (NOLOAD) : ALIGN(8) + { + . = ALIGN (8); + _bss_start = ABSOLUTE(.); + *(.dynsbss) + *(.sbss) + *(.sbss.*) + *(.gnu.linkonce.sb.*) + *(.scommon) + *(.sbss2) + *(.sbss2.*) + *(.gnu.linkonce.sb2.*) + *(.dynbss) + *(.bss) + *(.bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + . = ALIGN (8); + _bss_end = ABSOLUTE(.); + } >sof_sram1 :sof_sram1_phdr + + +.sof_stack (NOLOAD) : ALIGN(8) + { + . = ALIGN (4096); + _sof_stack_start = ABSOLUTE(.); + . = . + SOF_STACK_TOTAL_SIZE; + _sof_stack_end = ABSOLUTE(.); + } >sof_stack :sof_stack_phdr + + .reset.rodata : ALIGN(4) + { + _reset_rodata_start = ABSOLUTE(.); + *(.reset.rodata) + _reset_rodata_end = ABSOLUTE(.); + } >sof_sram1 :sof_sram1_phdr + + + .system_heap (NOLOAD) : ALIGN(8) + { + . = ALIGN (32); + _system_heap_start = ABSOLUTE(.); + . = . + HEAP_SYSTEM_SIZE; + _system_heap_end = ABSOLUTE(.); + } >system_heap :system_heap_phdr + + .system_runtime_heap (NOLOAD) : ALIGN(8) + { + . = ALIGN (HEAP_BUF_ALIGNMENT); + _system_runtime_heap_start = ABSOLUTE(.); + . = . + HEAP_SYS_RUNTIME_SIZE; + _system_runtime_heap_end = ABSOLUTE(.); + } >system_runtime_heap :system_runtime_heap_phdr + + .runtime_heap (NOLOAD) : ALIGN(8) + { + . = ALIGN (32); + _runtime_heap_start = ABSOLUTE(.); + . = . + HEAP_RUNTIME_SIZE; + _runtime_heap_end = ABSOLUTE(.); + } >runtime_heap :runtime_heap_phdr + + .buffer_heap (NOLOAD) : ALIGN(8) + { + . = ALIGN (HEAP_BUF_ALIGNMENT); + _buffer_heap_start = ABSOLUTE(.); + . = . + HEAP_BUFFER_SIZE; + _buffer_heap_end = ABSOLUTE(.); + } >buffer_heap :buffer_heap_phdr + + .static_uuid_entries (COPY) : ALIGN(1024) + { + *(*.static_uuids) + } > static_uuid_entries_seg :static_uuid_entries_phdr + + .static_log_entries (COPY) : ALIGN(1024) + { + *(*.static_log*) + } > static_log_entries_seg :static_log_entries_phdr + + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_info 0 : { *(.debug_info) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + .debug_weaknames 0 : { *(.debug_weaknames) } + .debug_funcnames 0 : { *(.debug_funcnames) } + .debug_typenames 0 : { *(.debug_typenames) } + .debug_varnames 0 : { *(.debug_varnames) } + + .xt.insn 0 : + { + KEEP (*(.xt.insn)) + KEEP (*(.gnu.linkonce.x.*)) + } + .xt.prop 0 : + { + KEEP (*(.xt.prop)) + KEEP (*(.xt.prop.*)) + KEEP (*(.gnu.linkonce.prop.*)) + } + .xt.lit 0 : + { + KEEP (*(.xt.lit)) + KEEP (*(.xt.lit.*)) + KEEP (*(.gnu.linkonce.p.*)) + } + .xt.profile_range 0 : + { + KEEP (*(.xt.profile_range)) + KEEP (*(.gnu.linkonce.profile_range.*)) + } + .xt.profile_ranges 0 : + { + KEEP (*(.xt.profile_ranges)) + KEEP (*(.gnu.linkonce.xt.profile_ranges.*)) + } + .xt.profile_files 0 : + { + KEEP (*(.xt.profile_files)) + KEEP (*(.gnu.linkonce.xt.profile_files.*)) + } + + .fw_metadata (COPY) : ALIGN(1024) + { + KEEP (*(.fw_metadata)) + . = ALIGN(_EXT_MAN_ALIGN_); + } >fw_metadata_seg :metadata_entries_phdr + +} diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/core-isa.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/core-isa.h new file mode 100644 index 000000000000..e006725edc39 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/core-isa.h @@ -0,0 +1,714 @@ +/* + * xtensa/config/core-isa.h -- HAL definitions that are dependent on Xtensa + * processor CORE configuration + * + * See <xtensa/config/core.h>, which includes this file, for more details. + */ + +/* Xtensa processor core configuration information. + + Customer ID=7490; Build=0xa28f5; Copyright (c) 1999-2022 Tensilica Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef XTENSA_CORE_CONFIGURATION_H_ +#define XTENSA_CORE_CONFIGURATION_H_ + + +/**************************************************************************** + Parameters Useful for Any Code, USER or PRIVILEGED + ****************************************************************************/ + +/* + * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is + * configured, and a value of 0 otherwise. These macros are always defined. + */ + + +/*---------------------------------------------------------------------- + ISA + ----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_BE 0 /* big-endian byte ordering */ +#define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */ +#define XCHAL_NUM_AREGS 64 /* num of physical addr regs */ +#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */ +#define XCHAL_MAX_INSTRUCTION_SIZE 16 /* max instr bytes (3..8) */ +#define XCHAL_HAVE_DEBUG 1 /* debug option */ +#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ +#define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */ +#define XCHAL_LOOP_BUFFER_SIZE 256 /* zero-ov. loop instr buffer size */ +#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */ +#define XCHAL_HAVE_MINMAX 1 /* MIN/MAX instructions */ +#define XCHAL_HAVE_SEXT 1 /* SEXT instruction */ +#define XCHAL_HAVE_DEPBITS 0 /* DEPBITS instruction */ +#define XCHAL_HAVE_CLAMPS 1 /* CLAMPS instruction */ +#define XCHAL_HAVE_MUL16 1 /* MUL16S/MUL16U instructions */ +#define XCHAL_HAVE_MUL32 1 /* MULL instruction */ +#define XCHAL_HAVE_MUL32_HIGH 1 /* MULUH/MULSH instructions */ +#define XCHAL_HAVE_DIV32 1 /* QUOS/QUOU/REMS/REMU instructions */ +#define XCHAL_HAVE_L32R 1 /* L32R instruction */ +#define XCHAL_HAVE_ABSOLUTE_LITERALS 0 /* non-PC-rel (extended) L32R */ +#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */ +#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */ +#define XCHAL_HAVE_EXCLUSIVE 0 /* L32EX/S32EX instructions */ +#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */ +#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */ +#define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */ +#define XCHAL_HAVE_ABS 1 /* ABS instruction */ +#define XCHAL_HAVE_RELEASE_SYNC 1 /* L32AI/S32RI instructions */ +#define XCHAL_HAVE_S32C1I 1 /* S32C1I instruction */ +#define XCHAL_HAVE_SPECULATION 0 /* speculation */ +#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */ +#define XCHAL_NUM_CONTEXTS 1 /* */ +#define XCHAL_NUM_MISC_REGS 2 /* num of scratch regs (0..4) */ +#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */ +#define XCHAL_HAVE_PRID 0 /* processor ID register */ +#define XCHAL_HAVE_EXTERN_REGS 1 /* WER/RER instructions */ +#define XCHAL_HAVE_MX 0 /* MX core (Tensilica internal) */ +#define XCHAL_HAVE_MP_INTERRUPTS 0 /* interrupt distributor port */ +#define XCHAL_HAVE_MP_RUNSTALL 0 /* core RunStall control port */ +#define XCHAL_HAVE_PSO 0 /* Power Shut-Off */ +#define XCHAL_HAVE_PSO_CDM 0 /* core/debug/mem pwr domains */ +#define XCHAL_HAVE_PSO_FULL_RETENTION 0 /* all regs preserved on PSO */ +#define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */ +#define XCHAL_HAVE_BOOLEANS 1 /* boolean registers */ +#define XCHAL_HAVE_CP 1 /* CPENABLE reg (coprocessor) */ +#define XCHAL_CP_MAXCFG 2 /* max allowed cp id plus one */ +#define XCHAL_HAVE_MAC16 0 /* MAC16 package */ +#define XCHAL_HAVE_LX 1 /* LX core */ +#define XCHAL_HAVE_NX 0 /* NX core (starting RH) */ + +#define XCHAL_HAVE_SUPERGATHER 0 /* SuperGather */ + +#define XCHAL_HAVE_FUSION 0 /* Fusion*/ +#define XCHAL_HAVE_FUSION_FP 0 /* Fusion FP option */ +#define XCHAL_HAVE_FUSION_LOW_POWER 0 /* Fusion Low Power option */ +#define XCHAL_HAVE_FUSION_AES 0 /* Fusion BLE/Wifi AES-128 CCM option */ +#define XCHAL_HAVE_FUSION_CONVENC 0 /* Fusion Conv Encode option */ +#define XCHAL_HAVE_FUSION_LFSR_CRC 0 /* Fusion LFSR-CRC option */ +#define XCHAL_HAVE_FUSION_BITOPS 0 /* Fusion Bit Operations Support option */ +#define XCHAL_HAVE_FUSION_AVS 0 /* Fusion AVS option */ +#define XCHAL_HAVE_FUSION_16BIT_BASEBAND 0 /* Fusion 16-bit Baseband option */ +#define XCHAL_HAVE_FUSION_VITERBI 0 /* Fusion Viterbi option */ +#define XCHAL_HAVE_FUSION_SOFTDEMAP 0 /* Fusion Soft Bit Demap option */ +#define XCHAL_HAVE_HIFIPRO 0 /* HiFiPro Audio Engine pkg */ +#define XCHAL_HAVE_HIFI5 1 /* HiFi5 Audio Engine pkg */ +#define XCHAL_HAVE_HIFI5_NN_MAC 1 /* HiFi5 Audio Engine NN-MAC option */ +#define XCHAL_HAVE_HIFI5_VFPU 1 /* HiFi5 Audio Engine Single-Precision VFPU option */ +#define XCHAL_HAVE_HIFI5_HP_VFPU 1 /* HiFi5 Audio Engine Half-Precision VFPU option */ +#define XCHAL_HAVE_HIFI4 0 /* HiFi4 Audio Engine pkg */ +#define XCHAL_HAVE_HIFI4_VFPU 1 /* HiFi4 Audio Engine VFPU option */ +#define XCHAL_HAVE_HIFI3 1 /* HiFi3 Audio Engine pkg */ +#define XCHAL_HAVE_HIFI3_VFPU 1 /* HiFi3 Audio Engine VFPU option */ +#define XCHAL_HAVE_HIFI3Z 0 /* HiFi3Z Audio Engine pkg */ +#define XCHAL_HAVE_HIFI3Z_VFPU 0 /* HiFi3Z Audio Engine VFPU option */ +#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */ +#define XCHAL_HAVE_HIFI2EP 0 /* HiFi2EP */ +#define XCHAL_HAVE_HIFI_MINI 0 + + + +#define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */ +#define XCHAL_HAVE_USER_DPFPU 0 /* user DP floating-point pkg */ +#define XCHAL_HAVE_USER_SPFPU 1 /* user SP floating-point pkg */ +#define XCHAL_HAVE_FP 1 /* single prec floating point */ +#define XCHAL_HAVE_FP_DIV 1 /* FP with DIV instructions */ +#define XCHAL_HAVE_FP_RECIP 1 /* FP with RECIP instructions */ +#define XCHAL_HAVE_FP_SQRT 1 /* FP with SQRT instructions */ +#define XCHAL_HAVE_FP_RSQRT 1 /* FP with RSQRT instructions */ +#define XCHAL_HAVE_DFP 0 /* double precision FP pkg */ +#define XCHAL_HAVE_DFP_DIV 0 /* DFP with DIV instructions */ +#define XCHAL_HAVE_DFP_RECIP 0 /* DFP with RECIP instructions*/ +#define XCHAL_HAVE_DFP_SQRT 0 /* DFP with SQRT instructions */ +#define XCHAL_HAVE_DFP_RSQRT 0 /* DFP with RSQRT instructions*/ +#define XCHAL_HAVE_DFP_ACCEL 0 /* double precision FP acceleration pkg */ +#define XCHAL_HAVE_DFP_accel XCHAL_HAVE_DFP_ACCEL /* for backward compatibility */ + +#define XCHAL_HAVE_DFPU_SINGLE_ONLY 0 /* DFPU Coprocessor, single precision only */ +#define XCHAL_HAVE_DFPU_SINGLE_DOUBLE 0 /* DFPU Coprocessor, single and double precision */ +#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */ +#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */ + +#define XCHAL_HAVE_FUSIONG 0 /* FusionG */ +#define XCHAL_HAVE_FUSIONG3 0 /* FusionG3 */ +#define XCHAL_HAVE_FUSIONG6 0 /* FusionG6 */ +#define XCHAL_HAVE_FUSIONG_SP_VFPU 0 /* sp_vfpu option on FusionG */ +#define XCHAL_HAVE_FUSIONG_DP_VFPU 0 /* dp_vfpu option on FusionG */ +#define XCHAL_FUSIONG_SIMD32 0 /* simd32 for FusionG */ + +#define XCHAL_HAVE_FUSIONJ 0 /* FusionJ */ +#define XCHAL_HAVE_FUSIONJ6 0 /* FusionJ6 */ +#define XCHAL_HAVE_FUSIONJ_SP_VFPU 0 /* sp_vfpu option on FusionJ */ +#define XCHAL_HAVE_FUSIONJ_DP_VFPU 0 /* dp_vfpu option on FusionJ */ +#define XCHAL_FUSIONJ_SIMD32 0 /* simd32 for FusionJ */ + +#define XCHAL_HAVE_PDX 0 /* PDX-LX */ +#define XCHAL_PDX_SIMD32 0 /* simd32 for PDX */ +#define XCHAL_HAVE_PDX4 0 /* PDX4-LX */ +#define XCHAL_HAVE_PDX8 0 /* PDX8-LX */ +#define XCHAL_HAVE_PDX16 0 /* PDX16-LX */ +#define XCHAL_HAVE_PDXNX 0 /* PDX-NX */ + +#define XCHAL_HAVE_CONNXD2 0 /* ConnX D2 pkg */ +#define XCHAL_HAVE_CONNXD2_DUALLSFLIX 0 /* ConnX D2 & Dual LoadStore Flix */ +#define XCHAL_HAVE_BALL 0 +#define XCHAL_HAVE_BALLAP 0 +#define XCHAL_HAVE_BBE16 0 /* ConnX BBE16 pkg */ +#define XCHAL_HAVE_BBE16_RSQRT 0 /* BBE16 & vector recip sqrt */ +#define XCHAL_HAVE_BBE16_VECDIV 0 /* BBE16 & vector divide */ +#define XCHAL_HAVE_BBE16_DESPREAD 0 /* BBE16 & despread */ +#define XCHAL_HAVE_CONNX_B10 0 /* ConnX B10 pkg*/ +#define XCHAL_HAVE_CONNX_B20 0 /* ConnX B20 pkg*/ +#define XCHAL_HAVE_CONNX_B_DP_VFPU 0 /* Double-precision Vector Floating-point option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_SP_VFPU 0 /* Single-precision Vector Floating-point option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_SPX_VFPU 0 /* Single-precision Extended Vector Floating-point option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_HPX_VFPU 0 /* Half-precision Extended Vector Floating-point option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_32B_MAC 0 /* 32-bit vector MAC (real and complex), FIR & FFT option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_VITERBI 0 /* Viterbi option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_TURBO 0 /* Turbo option on ConnX B10 & B20 */ +#define XCHAL_HAVE_CONNX_B_LDPC 0 /* LDPC option on ConnX B10 & B20 */ +#define XCHAL_HAVE_BBENEP 0 /* ConnX BBENEP pkgs */ +#define XCHAL_HAVE_BBENEP_SP_VFPU 0 /* sp_vfpu option on BBE-EP */ +#define XCHAL_HAVE_BSP3 0 /* ConnX BSP3 pkg */ +#define XCHAL_HAVE_BSP3_TRANSPOSE 0 /* BSP3 & transpose32x32 */ +#define XCHAL_HAVE_SSP16 0 /* ConnX SSP16 pkg */ +#define XCHAL_HAVE_SSP16_VITERBI 0 /* SSP16 & viterbi */ +#define XCHAL_HAVE_TURBO16 0 /* ConnX Turbo16 pkg */ +#define XCHAL_HAVE_BBP16 0 /* ConnX BBP16 pkg */ +#define XCHAL_HAVE_FLIX3 0 /* basic 3-way FLIX option */ +#define XCHAL_HAVE_GRIVPEP 0 /* General Release of IVPEP */ +#define XCHAL_HAVE_GRIVPEP_HISTOGRAM 0 /* Histogram option on GRIVPEP */ + +#define XCHAL_HAVE_VISION 0 /* Vision P5/P6 */ +#define XCHAL_VISION_SIMD16 0 /* simd16 for Vision P5/P6 */ +#define XCHAL_VISION_TYPE 0 /* Vision P5, P6, Q6, Q7 or Q8 */ +#define XCHAL_VISION_QUAD_MAC_TYPE 0 /* quad_mac option on Vision P6 */ +#define XCHAL_HAVE_VISION_HISTOGRAM 0 /* histogram option on Vision P5/P6 */ +#define XCHAL_HAVE_VISION_DP_VFPU 0 /* dp_vfpu option on Vision Q7/Q8 */ +#define XCHAL_HAVE_VISION_SP_VFPU 0 /* sp_vfpu option on Vision P5/P6/Q6/Q7 */ +#define XCHAL_HAVE_VISION_SP_VFPU_2XFMAC 0 /* sp_vfpu_2xfma option on Vision Q7 */ +#define XCHAL_HAVE_VISION_HP_VFPU 0 /* hp_vfpu option on Vision P6/Q6 */ +#define XCHAL_HAVE_VISION_HP_VFPU_2XFMAC 0 /* hp_vfpu_2xfma option on Vision Q7 */ + +#define XCHAL_HAVE_VISIONC 0 /* Vision C */ + +#define XCHAL_HAVE_XNNE 0 /* XNNE */ + +/*---------------------------------------------------------------------- + MISC + ----------------------------------------------------------------------*/ + +#define XCHAL_NUM_LOADSTORE_UNITS 2 /* load/store units */ +#define XCHAL_NUM_WRITEBUFFER_ENTRIES 16 /* size of write buffer */ +#define XCHAL_INST_FETCH_WIDTH 16 /* instr-fetch width in bytes */ +#define XCHAL_DATA_WIDTH 16 /* data width in bytes */ +#define XCHAL_DATA_PIPE_DELAY 2 /* d-side pipeline delay + (1 = 5-stage, 2 = 7-stage) */ +#define XCHAL_CLOCK_GATING_GLOBAL 1 /* global clock gating */ +#define XCHAL_CLOCK_GATING_FUNCUNIT 1 /* funct. unit clock gating */ +/* In T1050, applies to selected core load and store instructions (see ISA): */ +#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */ +#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/ +#define XCHAL_UNALIGNED_LOAD_HW 0 /* unaligned loads work in hw */ +#define XCHAL_UNALIGNED_STORE_HW 0 /* unaligned stores work in hw*/ + +#define XCHAL_UNIFIED_LOADSTORE 0 + +#define XCHAL_SW_VERSION 1406000 /* sw version of this header */ +#define XCHAL_SW_VERSION_MAJOR 14000 /* major ver# of sw */ +#define XCHAL_SW_VERSION_MINOR 6 /* minor ver# of sw */ +#define XCHAL_SW_VERSION_MICRO 0 /* micro ver# of sw */ +#define XCHAL_SW_MINOR_VERSION 1406000 /* with zeroed micro */ +#define XCHAL_SW_MICRO_VERSION 1406000 + +#define XCHAL_CORE_ID "ACP_6_3_HiFi5_PROD_Linux" /* alphanum core name + (CoreID) set in the Xtensa + Processor Generator */ + +#define XCHAL_BUILD_UNIQUE_ID 0x000A28F5 /* 22-bit sw build ID */ + +/* + * These definitions describe the hardware targeted by this software. + */ +#define XCHAL_HW_CONFIGID0 0xC3038286 /* ConfigID hi 32 bits*/ +#define XCHAL_HW_CONFIGID1 0x29892812 /* ConfigID lo 32 bits*/ +#define XCHAL_HW_VERSION_NAME "LX7.1.6" /* full version name */ +#define XCHAL_HW_VERSION_MAJOR 2810 /* major ver# of targeted hw */ +#define XCHAL_HW_VERSION_MINOR 6 /* minor ver# of targeted hw */ +#define XCHAL_HW_VERSION_MICRO 0 /* subdot ver# of targeted hw */ +#define XCHAL_HW_VERSION 281060 /* major*100+(major<2810 ? minor : minor*10+micro) */ +#define XCHAL_HW_REL_LX7 1 +#define XCHAL_HW_REL_LX7_1 1 +#define XCHAL_HW_REL_LX7_1_6 1 +#define XCHAL_HW_CONFIGID_RELIABLE 1 +/* If software targets a *range* of hardware versions, these are the bounds: */ +#define XCHAL_HW_MIN_VERSION_MAJOR 2810 /* major v of earliest tgt hw */ +#define XCHAL_HW_MIN_VERSION_MINOR 6 /* minor v of earliest tgt hw */ +#define XCHAL_HW_MIN_VERSION_MICRO 0 /* micro v of earliest tgt hw */ +#define XCHAL_HW_MIN_VERSION 281060 /* earliest targeted hw */ +#define XCHAL_HW_MAX_VERSION_MAJOR 2810 /* major v of latest tgt hw */ +#define XCHAL_HW_MAX_VERSION_MINOR 6 /* minor v of latest tgt hw */ +#define XCHAL_HW_MAX_VERSION_MICRO 0 /* micro v of latest tgt hw */ +#define XCHAL_HW_MAX_VERSION 281060 /* latest targeted hw */ + +/* Config is enabled for functional safety: */ +#define XCHAL_HAVE_FUNC_SAFETY 0 + +/* Config is enabled for secure operation: */ +#define XCHAL_HAVE_SECURE 0 + +#define XCHAL_HAVE_APB 0 + +/*---------------------------------------------------------------------- + CACHE + ----------------------------------------------------------------------*/ + +#define XCHAL_ICACHE_LINESIZE 128 /* I-cache line size in bytes */ +#define XCHAL_DCACHE_LINESIZE 128 /* D-cache line size in bytes */ +#define XCHAL_ICACHE_LINEWIDTH 7 /* log2(I line size in bytes) */ +#define XCHAL_DCACHE_LINEWIDTH 7 /* log2(D line size in bytes) */ + +#define XCHAL_ICACHE_SIZE 131072 /* I-cache size in bytes or 0 */ +#define XCHAL_ICACHE_SIZE_LOG2 17 +#define XCHAL_DCACHE_SIZE 131072 /* D-cache size in bytes or 0 */ +#define XCHAL_DCACHE_SIZE_LOG2 17 + +#define XCHAL_DCACHE_IS_WRITEBACK 1 /* writeback feature */ +#define XCHAL_DCACHE_IS_COHERENT 0 /* MP coherence feature */ + +#define XCHAL_HAVE_PREFETCH 1 /* PREFCTL register */ +#define XCHAL_HAVE_PREFETCH_L1 1 /* prefetch to L1 cache */ +#define XCHAL_PREFETCH_CASTOUT_LINES 1 /* dcache pref. castout bufsz */ +#define XCHAL_PREFETCH_ENTRIES 16 /* cache prefetch entries */ +#define XCHAL_PREFETCH_BLOCK_ENTRIES 8 /* prefetch block streams */ +#define XCHAL_HAVE_CACHE_BLOCKOPS 1 /* block prefetch for caches */ +#define XCHAL_HAVE_CME_DOWNGRADES 0 +#define XCHAL_HAVE_ICACHE_TEST 1 /* Icache test instructions */ +#define XCHAL_HAVE_DCACHE_TEST 1 /* Dcache test instructions */ +#define XCHAL_HAVE_ICACHE_DYN_WAYS 1 /* Icache dynamic way support */ +#define XCHAL_HAVE_DCACHE_DYN_WAYS 1 /* Dcache dynamic way support */ +#define XCHAL_HAVE_ICACHE_DYN_ENABLE 1 /* Icache enabled via MEMCTL */ +#define XCHAL_HAVE_DCACHE_DYN_ENABLE 1 /* Dcache enabled via MEMCTL */ + +#define XCHAL_L1SCACHE_SIZE 0 +#define XCHAL_L1SCACHE_SIZE_LOG2 0 +#define XCHAL_L1SCACHE_WAYS 1 +#define XCHAL_L1SCACHE_WAYS_LOG2 0 +#define XCHAL_L1SCACHE_ACCESS_SIZE 0 +#define XCHAL_L1SCACHE_BANKS 1 + +#define XCHAL_L1VCACHE_SIZE 0 + +#define XCHAL_HAVE_L2 0 /* NX L2 cache controller */ +#define XCHAL_HAVE_L2_CACHE 0 +#define XCHAL_NUM_CORES_IN_CLUSTER 0 + +/* PRID_ID macros are for internal use only ... subject to removal */ +#define PRID_ID_SHIFT 0 +#define PRID_ID_BITS 4 +#define PRID_ID_MASK 0x0000000F + +/* This one is a form of caching, though not architecturally visible: */ +#define XCHAL_HAVE_BRANCH_PREDICTION 0 /* branch [target] prediction */ + + + + +/**************************************************************************** + Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code + ****************************************************************************/ + + +#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY + +/*---------------------------------------------------------------------- + CACHE + ----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_PIF 1 /* any outbound bus present */ + +#define XCHAL_HAVE_AXI 1 /* AXI bus */ +#define XCHAL_HAVE_AXI_ECC 1 /* ECC on AXI bus */ +#define XCHAL_HAVE_ACELITE 0 /* ACELite bus */ + +#define XCHAL_HAVE_PIF_WR_RESP 1 /* pif write response */ +#define XCHAL_HAVE_PIF_REQ_ATTR 1 /* pif attribute */ + +/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ + +/* Number of cache sets in log2(lines per way): */ +#define XCHAL_ICACHE_SETWIDTH 8 +#define XCHAL_DCACHE_SETWIDTH 8 + +/* Cache set associativity (number of ways): */ +#define XCHAL_ICACHE_WAYS 4 +#define XCHAL_ICACHE_WAYS_LOG2 2 +#define XCHAL_DCACHE_WAYS 4 +#define XCHAL_DCACHE_WAYS_LOG2 2 + +/* Cache features: */ +#define XCHAL_ICACHE_LINE_LOCKABLE 1 +#define XCHAL_DCACHE_LINE_LOCKABLE 1 +#define XCHAL_ICACHE_ECC_PARITY 0 +#define XCHAL_DCACHE_ECC_PARITY 0 +#define XCHAL_ICACHE_ECC_WIDTH 4 +#define XCHAL_DCACHE_ECC_WIDTH 1 + +/* Cache access size in bytes (affects operation of SICW instruction): */ +#define XCHAL_ICACHE_ACCESS_SIZE 16 +#define XCHAL_DCACHE_ACCESS_SIZE 16 + +#define XCHAL_DCACHE_BANKS 2 /* number of banks */ + +/* The number of Cache lines associated with a single cache tag */ +#define XCHAL_DCACHE_LINES_PER_TAG_LOG2 0 + +/* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */ +#define XCHAL_CA_BITS 4 + + +/*---------------------------------------------------------------------- + INTERNAL I/D RAM/ROMs and XLMI + ----------------------------------------------------------------------*/ +#define XCHAL_NUM_INSTROM 0 /* number of core instr. ROMs */ +#define XCHAL_NUM_INSTRAM 1 /* number of core instr. RAMs */ +#define XCHAL_NUM_DATAROM 0 /* number of core data ROMs */ +#define XCHAL_NUM_DATARAM 1 /* number of core data RAMs */ +#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/ +#define XCHAL_NUM_XLMI 0 /* number of core XLMI ports */ +#define XCHAL_HAVE_IRAMCFG 0 /* IRAMxCFG register present */ +#define XCHAL_HAVE_DRAMCFG 0 /* DRAMxCFG register present */ + +/* Instruction RAM 0: */ +#define XCHAL_INSTRAM0_VADDR 0x7F000000 /* virtual address */ +#define XCHAL_INSTRAM0_PADDR 0x7F000000 /* physical address */ +#define XCHAL_INSTRAM0_SIZE 524288 /* size in bytes */ +#define XCHAL_INSTRAM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ +#define XCHAL_HAVE_INSTRAM0 1 +#define XCHAL_INSTRAM0_HAVE_IDMA 0 /* idma supported by this local memory */ + +/* Data RAM 0: */ +#define XCHAL_DATARAM0_VADDR 0xE0000000 /* virtual address */ +#define XCHAL_DATARAM0_PADDR 0xE0000000 /* physical address */ +#define XCHAL_DATARAM0_SIZE 524288 /* size in bytes */ +#define XCHAL_DATARAM0_ECC_PARITY 0 /* ECC/parity type, 0=none */ +#define XCHAL_DATARAM0_BANKS 2 /* number of banks */ +#define XCHAL_HAVE_DATARAM0 1 +#define XCHAL_DATARAM0_HAVE_IDMA 0 /* idma supported by this local memory */ + +#define XCHAL_HAVE_IMEM_LOADSTORE 1 /* can load/store to IROM/IRAM*/ + + +/*---------------------------------------------------------------------- + IDMA + ----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_IDMA 0 + + + +/*---------------------------------------------------------------------- + INTERRUPTS and TIMERS + ----------------------------------------------------------------------*/ + +#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */ +#define XCHAL_HAVE_NMI 1 /* non-maskable interrupt */ +#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */ +#define XCHAL_NUM_TIMERS 2 /* number of CCOMPAREn regs */ +#define XCHAL_NUM_INTERRUPTS 9 /* number of interrupts */ +#define XCHAL_NUM_INTERRUPTS_LOG2 4 /* ceil(log2(NUM_INTERRUPTS)) */ +#define XCHAL_NUM_EXTINTERRUPTS 5 /* num of external interrupts */ +#define XCHAL_NUM_INTLEVELS 6 /* number of interrupt levels + (not including level zero) */ + + +#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */ +#define XCHAL_EXCM_LEVEL 5 /* level masked by PS.EXCM */ + /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ + +/* Masks of interrupts at each interrupt level: */ +#define XCHAL_INTLEVEL1_MASK 0x00000143 +#define XCHAL_INTLEVEL2_MASK 0x00000004 +#define XCHAL_INTLEVEL3_MASK 0x00000008 +#define XCHAL_INTLEVEL4_MASK 0x00000010 +#define XCHAL_INTLEVEL5_MASK 0x00000020 +#define XCHAL_INTLEVEL6_MASK 0x00000000 +#define XCHAL_INTLEVEL7_MASK 0x00000080 + +/* Masks of interrupts at each range 1..n of interrupt levels: */ +#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x00000143 +#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x00000147 +#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0000014F +#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0000015F +#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0000017F +#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0000017F +#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x000001FF + +/* Level of each interrupt: */ +#define XCHAL_INT0_LEVEL 1 +#define XCHAL_INT1_LEVEL 1 +#define XCHAL_INT2_LEVEL 2 +#define XCHAL_INT3_LEVEL 3 +#define XCHAL_INT4_LEVEL 4 +#define XCHAL_INT5_LEVEL 5 +#define XCHAL_INT6_LEVEL 1 +#define XCHAL_INT7_LEVEL 7 +#define XCHAL_INT8_LEVEL 1 +#define XCHAL_DEBUGLEVEL 6 /* debug interrupt level */ +#define XCHAL_HAVE_DEBUG_EXTERN_INT 1 /* OCD external db interrupt */ +#define XCHAL_NMILEVEL 7 /* NMI "level" (for use with + EXCSAVE/EPS/EPC_n, RFI n) */ + +/* Type of each interrupt: */ +#define XCHAL_INT0_TYPE XTHAL_INTTYPE_TIMER +#define XCHAL_INT1_TYPE XTHAL_INTTYPE_SOFTWARE +#define XCHAL_INT2_TYPE XTHAL_INTTYPE_WRITE_ERROR +#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL +#define XCHAL_INT6_TYPE XTHAL_INTTYPE_TIMER +#define XCHAL_INT7_TYPE XTHAL_INTTYPE_NMI +#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_LEVEL + +/* Masks of interrupts for each type of interrupt: */ +#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFFFE00 +#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x00000138 +#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000000 +#define XCHAL_INTTYPE_MASK_NMI 0x00000080 +#define XCHAL_INTTYPE_MASK_SOFTWARE 0x00000002 +#define XCHAL_INTTYPE_MASK_TIMER 0x00000041 +#define XCHAL_INTTYPE_MASK_ETIE 0x00000000 +#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000004 +#define XCHAL_INTTYPE_MASK_DBG_REQUEST 0x00000000 +#define XCHAL_INTTYPE_MASK_BREAKIN 0x00000000 +#define XCHAL_INTTYPE_MASK_TRAX 0x00000000 +#define XCHAL_INTTYPE_MASK_PROFILING 0x00000000 +#define XCHAL_INTTYPE_MASK_IDMA_DONE 0x00000000 +#define XCHAL_INTTYPE_MASK_IDMA_ERR 0x00000000 +#define XCHAL_INTTYPE_MASK_GS_ERR 0x00000000 +#define XCHAL_INTTYPE_MASK_L2_ERR 0x00000000 +#define XCHAL_INTTYPE_MASK_L2_STATUS 0x00000000 +#define XCHAL_INTTYPE_MASK_COR_ECC_ERR 0x00000000 +#define XCHAL_INTTYPE_MASK_WWDT 0x00000000 +#define XCHAL_INTTYPE_MASK_FXLK 0x00000000 + +/* Interrupt numbers assigned to specific interrupt sources: */ +#define XCHAL_TIMER0_INTERRUPT 0 /* CCOMPARE0 */ +#define XCHAL_TIMER1_INTERRUPT 6 /* CCOMPARE1 */ +#define XCHAL_TIMER2_INTERRUPT XTHAL_TIMER_UNCONFIGURED +#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED +#define XCHAL_NMI_INTERRUPT 7 /* non-maskable interrupt */ +#define XCHAL_WRITE_ERROR_INTERRUPT 2 + +/* Interrupt numbers for levels at which only one interrupt is configured: */ +#define XCHAL_INTLEVEL2_NUM 2 +#define XCHAL_INTLEVEL3_NUM 3 +#define XCHAL_INTLEVEL4_NUM 4 +#define XCHAL_INTLEVEL5_NUM 5 +#define XCHAL_INTLEVEL7_NUM 7 +/* (There are many interrupts each at level(s) 1.) */ + + +/* + * External interrupt mapping. + * These macros describe how Xtensa processor interrupt numbers + * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) + * map to external BInterrupt<n> pins, for those interrupts + * configured as external (level-triggered, edge-triggered, or NMI). + * See the Xtensa processor databook for more details. + */ + +/* Core interrupt numbers mapped to each EXTERNAL BInterrupt pin number: */ +#define XCHAL_EXTINT0_NUM 3 /* (intlevel 3) */ +#define XCHAL_EXTINT1_NUM 4 /* (intlevel 4) */ +#define XCHAL_EXTINT2_NUM 5 /* (intlevel 5) */ +#define XCHAL_EXTINT3_NUM 7 /* (intlevel 7) */ +#define XCHAL_EXTINT4_NUM 8 /* (intlevel 1) */ +/* EXTERNAL BInterrupt pin numbers mapped to each core interrupt number: */ +#define XCHAL_INT3_EXTNUM 0 /* (intlevel 3) */ +#define XCHAL_INT4_EXTNUM 1 /* (intlevel 4) */ +#define XCHAL_INT5_EXTNUM 2 /* (intlevel 5) */ +#define XCHAL_INT7_EXTNUM 3 /* (intlevel 7) */ +#define XCHAL_INT8_EXTNUM 4 /* (intlevel 1) */ + +#define XCHAL_HAVE_ISB 0 /* No ISB */ +#define XCHAL_ISB_VADDR 0 /* N/A */ +#define XCHAL_HAVE_ITB 0 /* No ITB */ +#define XCHAL_ITB_VADDR 0 /* N/A */ + +#define XCHAL_HAVE_KSL 0 /* Kernel Stack Limit */ +#define XCHAL_HAVE_ISL 0 /* Interrupt Stack Limit */ +#define XCHAL_HAVE_PSL 0 /* Pageable Stack Limit */ + + +/*---------------------------------------------------------------------- + EXCEPTIONS and VECTORS + ----------------------------------------------------------------------*/ + +#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture + number: 1 == XEA1 (until T1050) + 2 == XEA2 (T1040 onwards) + 3 == XEA3 (LX8/NX/SX onwards) + 0 == XEAX (extern) or TX */ +#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */ +#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */ +#define XCHAL_HAVE_XEA3 0 /* Exception Architecture 3 */ +#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */ +#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */ +#define XCHAL_HAVE_IMPRECISE_EXCEPTIONS 0 /* imprecise exception option */ +#define XCHAL_EXCCAUSE_NUM 64 /* Number of exceptions */ +#define XCHAL_HAVE_HALT 0 /* halt architecture option */ +#define XCHAL_HAVE_BOOTLOADER 0 /* boot loader (for TX) */ +#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */ +#define XCHAL_HAVE_VECTOR_SELECT 0 /* relocatable vectors */ +#define XCHAL_HAVE_VECBASE 0 /* relocatable vectors */ + +#define XCHAL_RESET_VECOFS 0x00000000 +#define XCHAL_RESET_VECTOR_VADDR 0x7F000000 +#define XCHAL_RESET_VECTOR_PADDR 0x7F000000 +#define XCHAL_USER_VECOFS 0x00000000 +#define XCHAL_USER_VECTOR_VADDR 0x7F000740 +#define XCHAL_USER_VECTOR_PADDR 0x7F000740 +#define XCHAL_KERNEL_VECOFS 0x00000000 +#define XCHAL_KERNEL_VECTOR_VADDR 0x7F000700 +#define XCHAL_KERNEL_VECTOR_PADDR 0x7F000700 +#define XCHAL_DOUBLEEXC_VECOFS 0x00000000 +#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0x7F0007C0 +#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x7F0007C0 +#define XCHAL_WINDOW_OF4_VECOFS 0x00000000 +#define XCHAL_WINDOW_UF4_VECOFS 0x00000040 +#define XCHAL_WINDOW_OF8_VECOFS 0x00000080 +#define XCHAL_WINDOW_UF8_VECOFS 0x000000C0 +#define XCHAL_WINDOW_OF12_VECOFS 0x00000100 +#define XCHAL_WINDOW_UF12_VECOFS 0x00000140 +#define XCHAL_WINDOW_VECTORS_VADDR 0x7F000400 +#define XCHAL_WINDOW_VECTORS_PADDR 0x7F000400 +#define XCHAL_INTLEVEL2_VECOFS 0x00000000 +#define XCHAL_INTLEVEL2_VECTOR_VADDR 0x7F000580 +#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x7F000580 +#define XCHAL_INTLEVEL3_VECOFS 0x00000000 +#define XCHAL_INTLEVEL3_VECTOR_VADDR 0x7F0005C0 +#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x7F0005C0 +#define XCHAL_INTLEVEL4_VECOFS 0x00000000 +#define XCHAL_INTLEVEL4_VECTOR_VADDR 0x7F000600 +#define XCHAL_INTLEVEL4_VECTOR_PADDR 0x7F000600 +#define XCHAL_INTLEVEL5_VECOFS 0x00000000 +#define XCHAL_INTLEVEL5_VECTOR_VADDR 0x7F000640 +#define XCHAL_INTLEVEL5_VECTOR_PADDR 0x7F000640 +#define XCHAL_INTLEVEL6_VECOFS 0x00000000 +#define XCHAL_INTLEVEL6_VECTOR_VADDR 0x7F000680 +#define XCHAL_INTLEVEL6_VECTOR_PADDR 0x7F000680 +#define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL6_VECOFS +#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL6_VECTOR_VADDR +#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL6_VECTOR_PADDR +#define XCHAL_NMI_VECOFS 0x00000000 +#define XCHAL_NMI_VECTOR_VADDR 0x7F0006C0 +#define XCHAL_NMI_VECTOR_PADDR 0x7F0006C0 +#define XCHAL_INTLEVEL7_VECOFS XCHAL_NMI_VECOFS +#define XCHAL_INTLEVEL7_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR +#define XCHAL_INTLEVEL7_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR + + +/*---------------------------------------------------------------------- + DEBUG MODULE + ----------------------------------------------------------------------*/ + +/* Misc */ +#define XCHAL_HAVE_DEBUG_ERI 0 /* ERI to debug module */ +#define XCHAL_HAVE_DEBUG_APB 0 /* APB to debug module */ +#define XCHAL_HAVE_DEBUG_JTAG 1 /* JTAG to debug module */ + +/* On-Chip Debug (OCD) */ +#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */ +#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */ +#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */ +#define XCHAL_HAVE_OCD_DIR_ARRAY 0 /* faster OCD option (to LX4) */ +#define XCHAL_HAVE_OCD_LS32DDR 1 /* L32DDR/S32DDR (faster OCD) */ + +/* TRAX (in core) */ +#define XCHAL_HAVE_TRAX 0 /* TRAX in debug module */ +#define XCHAL_TRAX_MEM_SIZE 0 /* TRAX memory size in bytes */ +#define XCHAL_TRAX_MEM_SHAREABLE 0 /* start/end regs; ready sig. */ +#define XCHAL_TRAX_ATB_WIDTH 0 /* ATB width (bits), 0=no ATB */ +#define XCHAL_TRAX_TIME_WIDTH 0 /* timestamp bitwidth, 0=none */ + +/* Perf counters */ +#define XCHAL_NUM_PERF_COUNTERS 0 /* performance counters */ + + +/*---------------------------------------------------------------------- + MMU + ----------------------------------------------------------------------*/ + +/* See core-matmap.h header file for more details. */ + +#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */ +#define XCHAL_HAVE_SPANNING_WAY 1 /* one way maps I+D 4GB vaddr */ +#define XCHAL_SPANNING_WAY 0 /* TLB spanning way number */ +#define XCHAL_HAVE_IDENTITY_MAP 0 /* vaddr == paddr always */ +#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */ +#define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* region protection */ +#define XCHAL_HAVE_XLT_CACHEATTR 1 /* region prot. w/translation */ +#define XCHAL_HAVE_PTP_MMU 0 /* full MMU (with page table + [autorefill] and protection) + usable for an MMU-based OS */ + +/* If none of the above last 5 are set, it's a custom TLB configuration. */ + +#define XCHAL_MMU_ASID_BITS 0 /* number of bits in ASIDs */ +#define XCHAL_MMU_RINGS 1 /* number of rings (1..4) */ +#define XCHAL_MMU_RING_BITS 0 /* num of bits in RING field */ + +/*---------------------------------------------------------------------- + MPU + ----------------------------------------------------------------------*/ +#define XCHAL_HAVE_MPU 0 +#define XCHAL_MPU_ENTRIES 0 +#define XCHAL_MPU_LOCK 0 + +#define XCHAL_MPU_ALIGN_REQ 1 /* MPU requires alignment of entries to background map */ +#define XCHAL_MPU_BACKGROUND_ENTRIES 0 /* number of entries in bg map*/ +#define XCHAL_MPU_BG_CACHEADRDIS 0 /* default CACHEADRDIS for bg */ + +#define XCHAL_MPU_ALIGN_BITS 0 +#define XCHAL_MPU_ALIGN 0 + +/*----------------------------------------------------------------------- + CSR Parity +------------------------------------------------------------------------*/ +#define XCHAL_HAVE_CSR_PARITY 0 + + +/*---------------------------------------------------------------------- + FLEX-LOCK +------------------------------------------------------------------------*/ + +#define XCHAL_HAVE_FXLK 0 + +/*---------------------------------------------------------------------- + WWDT (Windowed Watchdog Timer) +------------------------------------------------------------------------*/ +#define XCHAL_HAVE_WWDT 0 +#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ + + +#endif /* XTENSA_CORE_CONFIGURATION_H_ */ + diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/core-matmap.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/core-matmap.h new file mode 100644 index 000000000000..5195b5230905 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/core-matmap.h @@ -0,0 +1,317 @@ +/* + * xtensa/config/core-matmap.h -- Memory access and translation mapping + * parameters (CHAL) of the Xtensa processor core configuration. + * + * If you are using Xtensa Tools, see <xtensa/config/core.h> (which includes + * this file) for more details. + * + * In the Xtensa processor products released to date, all parameters + * defined in this file are derivable (at least in theory) from + * information contained in the core-isa.h header file. + * In particular, the following core configuration parameters are relevant: + * XCHAL_HAVE_CACHEATTR + * XCHAL_HAVE_MIMIC_CACHEATTR + * XCHAL_HAVE_XLT_CACHEATTR + * XCHAL_HAVE_PTP_MMU + * XCHAL_ITLB_ARF_ENTRIES_LOG2 + * XCHAL_DTLB_ARF_ENTRIES_LOG2 + * XCHAL_DCACHE_IS_WRITEBACK + * XCHAL_ICACHE_SIZE (presence of I-cache) + * XCHAL_DCACHE_SIZE (presence of D-cache) + * XCHAL_HW_VERSION_MAJOR + * XCHAL_HW_VERSION_MINOR + */ + +/* Customer ID=7490; Build=0xa28f5; Copyright (c) 1999-2022 Tensilica Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + +#ifndef XTENSA_CONFIG_CORE_MATMAP_H +#define XTENSA_CONFIG_CORE_MATMAP_H + + +/*---------------------------------------------------------------------- + CACHE (MEMORY ACCESS) ATTRIBUTES + ----------------------------------------------------------------------*/ + + + +/* Cache Attribute encodings -- lists of access modes for each cache attribute: */ +#define XCHAL_FCA_LIST XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_CACHED XCHAL_SEP \ + XTHAL_FAM_BYPASS XCHAL_SEP \ + XTHAL_FAM_CACHED XCHAL_SEP \ + XTHAL_FAM_CACHED XCHAL_SEP \ + XTHAL_FAM_CACHED XCHAL_SEP \ + XTHAL_FAM_BYPASS XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION XCHAL_SEP \ + XTHAL_FAM_EXCEPTION +#define XCHAL_LCA_LIST XTHAL_LAM_CACHED_NOALLOC XCHAL_SEP \ + XTHAL_LAM_CACHED XCHAL_SEP \ + XTHAL_LAM_BYPASSG XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_CACHED XCHAL_SEP \ + XTHAL_LAM_CACHED XCHAL_SEP \ + XTHAL_LAM_BYPASSG XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION XCHAL_SEP \ + XTHAL_LAM_EXCEPTION +#define XCHAL_SCA_LIST XTHAL_SAM_WRITETHRU XCHAL_SEP \ + XTHAL_SAM_WRITETHRU XCHAL_SEP \ + XTHAL_SAM_BYPASS XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_WRITEBACK XCHAL_SEP \ + XTHAL_SAM_WRITEBACK_NOALLOC XCHAL_SEP \ + XTHAL_SAM_BYPASS XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION XCHAL_SEP \ + XTHAL_SAM_EXCEPTION + +#define XCHAL_CA_R (0xC0 | 0x40000000) +#define XCHAL_CA_RX (0xD0 | 0x40000000) +#define XCHAL_CA_RW (0xE0 | 0x40000000) +#define XCHAL_CA_RWX (0xF0 | 0x40000000) + +/* + * Specific encoded cache attribute values of general interest. + * If a specific cache mode is not available, the closest available + * one is returned instead (eg. writethru instead of writeback, + * bypass instead of writethru). + */ +#define XCHAL_CA_BYPASS 2 /* cache disabled (bypassed) mode */ +#define XCHAL_CA_BYPASSBUF 6 /* cache disabled (bypassed) bufferable mode */ +#define XCHAL_CA_WRITETHRU 1 /* cache enabled (write-through) mode */ +#define XCHAL_CA_WRITEBACK 4 /* cache enabled (write-back) mode */ +#define XCHAL_HAVE_CA_WRITEBACK_NOALLOC 1 /* write-back no-allocate availability */ +#define XCHAL_CA_WRITEBACK_NOALLOC 5 /* cache enabled (write-back no-allocate) mode */ +#define XCHAL_CA_ILLEGAL 15 /* no access allowed (all cause exceptions) mode */ + +/*---------------------------------------------------------------------- + MMU + ----------------------------------------------------------------------*/ + +/* + * General notes on MMU parameters. + * + * Terminology: + * ASID = address-space ID (acts as an "extension" of virtual addresses) + * VPN = virtual page number + * PPN = physical page number + * CA = encoded cache attribute (access modes) + * TLB = translation look-aside buffer (term is stretched somewhat here) + * I = instruction (fetch accesses) + * D = data (load and store accesses) + * way = each TLB (ITLB and DTLB) consists of a number of "ways" + * that simultaneously match the virtual address of an access; + * a TLB successfully translates a virtual address if exactly + * one way matches the vaddr; if none match, it is a miss; + * if multiple match, one gets a "multihit" exception; + * each way can be independently configured in terms of number of + * entries, page sizes, which fields are writable or constant, etc. + * set = group of contiguous ways with exactly identical parameters + * ARF = auto-refill; hardware services a 1st-level miss by loading a PTE + * from the page table and storing it in one of the auto-refill ways; + * if this PTE load also misses, a miss exception is posted for s/w. + * min-wired = a "min-wired" way can be used to map a single (minimum-sized) + * page arbitrarily under program control; it has a single entry, + * is non-auto-refill (some other way(s) must be auto-refill), + * all its fields (VPN, PPN, ASID, CA) are all writable, and it + * supports the XCHAL_MMU_MIN_PTE_PAGE_SIZE page size (a current + * restriction is that this be the only page size it supports). + * + * TLB way entries are virtually indexed. + * TLB ways that support multiple page sizes: + * - must have all writable VPN and PPN fields; + * - can only use one page size at any given time (eg. setup at startup), + * selected by the respective ITLBCFG or DTLBCFG special register, + * whose bits n*4+3 .. n*4 index the list of page sizes for way n + * (XCHAL_xTLB_SETm_PAGESZ_LOG2_LIST for set m corresponding to way n); + * this list may be sparse for auto-refill ways because auto-refill + * ways have independent lists of supported page sizes sharing a + * common encoding with PTE entries; the encoding is the index into + * this list; unsupported sizes for a given way are zero in the list; + * selecting unsupported sizes results in undefine hardware behaviour; + * - is only possible for ways 0 thru 7 (due to ITLBCFG/DTLBCFG definition). + */ + +#define XCHAL_MMU_ASID_INVALID 0 /* ASID value indicating invalid address space */ +#define XCHAL_MMU_ASID_KERNEL 0 /* ASID value indicating kernel (ring 0) address space */ +#define XCHAL_MMU_SR_BITS 0 /* number of size-restriction bits supported */ +#define XCHAL_MMU_CA_BITS 4 /* number of bits needed to hold cache attribute encoding */ +#define XCHAL_MMU_MAX_PTE_PAGE_SIZE 29 /* max page size in a PTE structure (log2) */ +#define XCHAL_MMU_MIN_PTE_PAGE_SIZE 29 /* min page size in a PTE structure (log2) */ + + +/*** Instruction TLB: ***/ + +#define XCHAL_ITLB_WAY_BITS 0 /* number of bits holding the ways */ +#define XCHAL_ITLB_WAYS 1 /* number of ways (n-way set-associative TLB) */ +#define XCHAL_ITLB_ARF_WAYS 0 /* number of auto-refill ways */ +#define XCHAL_ITLB_SETS 1 /* number of sets (groups of ways with identical settings) */ + +/* Way set to which each way belongs: */ +#define XCHAL_ITLB_WAY0_SET 0 + +/* Ways sets that are used by hardware auto-refill (ARF): */ +#define XCHAL_ITLB_ARF_SETS 0 /* number of auto-refill sets */ + +/* Way sets that are "min-wired" (see terminology comment above): */ +#define XCHAL_ITLB_MINWIRED_SETS 0 /* number of "min-wired" sets */ + + +/* ITLB way set 0 (group of ways 0 thru 0): */ +#define XCHAL_ITLB_SET0_WAY 0 /* index of first way in this way set */ +#define XCHAL_ITLB_SET0_WAYS 1 /* number of (contiguous) ways in this way set */ +#define XCHAL_ITLB_SET0_ENTRIES_LOG2 3 /* log2(number of entries in this way) */ +#define XCHAL_ITLB_SET0_ENTRIES 8 /* number of entries in this way (always a power of 2) */ +#define XCHAL_ITLB_SET0_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ +#define XCHAL_ITLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */ +#define XCHAL_ITLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */ +#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MIN 29 /* log2(minimum supported page size) */ +#define XCHAL_ITLB_SET0_PAGESZ_LOG2_MAX 29 /* log2(maximum supported page size) */ +#define XCHAL_ITLB_SET0_PAGESZ_LOG2_LIST 29 /* list of log2(page size)s, separated by XCHAL_SEP; + 2^PAGESZ_BITS entries in list, unsupported entries are zero */ +#define XCHAL_ITLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ +#define XCHAL_ITLB_SET0_VPN_CONSTMASK 0x00000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ +#define XCHAL_ITLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ +#define XCHAL_ITLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ +#define XCHAL_ITLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ +#define XCHAL_ITLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ +#define XCHAL_ITLB_SET0_PPN_RESET 1 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ +#define XCHAL_ITLB_SET0_CA_RESET 1 /* 1 if CA reset values defined (and all writable); 0 otherwise */ +/* Constant VPN values for each entry of ITLB way set 0 (because VPN_CONSTMASK is non-zero): */ +#define XCHAL_ITLB_SET0_E0_VPN_CONST 0x00000000 +#define XCHAL_ITLB_SET0_E1_VPN_CONST 0x20000000 +#define XCHAL_ITLB_SET0_E2_VPN_CONST 0x40000000 +#define XCHAL_ITLB_SET0_E3_VPN_CONST 0x60000000 +#define XCHAL_ITLB_SET0_E4_VPN_CONST 0x80000000 +#define XCHAL_ITLB_SET0_E5_VPN_CONST 0xA0000000 +#define XCHAL_ITLB_SET0_E6_VPN_CONST 0xC0000000 +#define XCHAL_ITLB_SET0_E7_VPN_CONST 0xE0000000 +/* Reset PPN values for each entry of ITLB way set 0 (because SET0_PPN_RESET is non-zero): */ +#define XCHAL_ITLB_SET0_E0_PPN_RESET 0x00000000 +#define XCHAL_ITLB_SET0_E1_PPN_RESET 0x20000000 +#define XCHAL_ITLB_SET0_E2_PPN_RESET 0x40000000 +#define XCHAL_ITLB_SET0_E3_PPN_RESET 0x60000000 +#define XCHAL_ITLB_SET0_E4_PPN_RESET 0x80000000 +#define XCHAL_ITLB_SET0_E5_PPN_RESET 0xA0000000 +#define XCHAL_ITLB_SET0_E6_PPN_RESET 0xC0000000 +#define XCHAL_ITLB_SET0_E7_PPN_RESET 0xE0000000 +/* Reset CA values for each entry of ITLB way set 0 (because SET0_CA_RESET is non-zero): */ +#define XCHAL_ITLB_SET0_E0_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E1_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E2_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E3_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E4_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E5_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E6_CA_RESET 0x02 +#define XCHAL_ITLB_SET0_E7_CA_RESET 0x02 + + +/*** Data TLB: ***/ + +#define XCHAL_DTLB_WAY_BITS 0 /* number of bits holding the ways */ +#define XCHAL_DTLB_WAYS 1 /* number of ways (n-way set-associative TLB) */ +#define XCHAL_DTLB_ARF_WAYS 0 /* number of auto-refill ways */ +#define XCHAL_DTLB_SETS 1 /* number of sets (groups of ways with identical settings) */ + +/* Way set to which each way belongs: */ +#define XCHAL_DTLB_WAY0_SET 0 + +/* Ways sets that are used by hardware auto-refill (ARF): */ +#define XCHAL_DTLB_ARF_SETS 0 /* number of auto-refill sets */ + +/* Way sets that are "min-wired" (see terminology comment above): */ +#define XCHAL_DTLB_MINWIRED_SETS 0 /* number of "min-wired" sets */ + + +/* DTLB way set 0 (group of ways 0 thru 0): */ +#define XCHAL_DTLB_SET0_WAY 0 /* index of first way in this way set */ +#define XCHAL_DTLB_SET0_WAYS 1 /* number of (contiguous) ways in this way set */ +#define XCHAL_DTLB_SET0_ENTRIES_LOG2 3 /* log2(number of entries in this way) */ +#define XCHAL_DTLB_SET0_ENTRIES 8 /* number of entries in this way (always a power of 2) */ +#define XCHAL_DTLB_SET0_ARF 0 /* 1=autorefill by h/w, 0=non-autorefill (wired/constant/static) */ +#define XCHAL_DTLB_SET0_PAGESIZES 1 /* number of supported page sizes in this way */ +#define XCHAL_DTLB_SET0_PAGESZ_BITS 0 /* number of bits to encode the page size */ +#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MIN 29 /* log2(minimum supported page size) */ +#define XCHAL_DTLB_SET0_PAGESZ_LOG2_MAX 29 /* log2(maximum supported page size) */ +#define XCHAL_DTLB_SET0_PAGESZ_LOG2_LIST 29 /* list of log2(page size)s, separated by XCHAL_SEP; + 2^PAGESZ_BITS entries in list, unsupported entries are zero */ +#define XCHAL_DTLB_SET0_ASID_CONSTMASK 0 /* constant ASID bits; 0 if all writable */ +#define XCHAL_DTLB_SET0_VPN_CONSTMASK 0x00000000 /* constant VPN bits, not including entry index bits; 0 if all writable */ +#define XCHAL_DTLB_SET0_PPN_CONSTMASK 0 /* constant PPN bits, including entry index bits; 0 if all writable */ +#define XCHAL_DTLB_SET0_CA_CONSTMASK 0 /* constant CA bits; 0 if all writable */ +#define XCHAL_DTLB_SET0_ASID_RESET 0 /* 1 if ASID reset values defined (and all writable); 0 otherwise */ +#define XCHAL_DTLB_SET0_VPN_RESET 0 /* 1 if VPN reset values defined (and all writable); 0 otherwise */ +#define XCHAL_DTLB_SET0_PPN_RESET 1 /* 1 if PPN reset values defined (and all writable); 0 otherwise */ +#define XCHAL_DTLB_SET0_CA_RESET 1 /* 1 if CA reset values defined (and all writable); 0 otherwise */ +/* Constant VPN values for each entry of DTLB way set 0 (because VPN_CONSTMASK is non-zero): */ +#define XCHAL_DTLB_SET0_E0_VPN_CONST 0x00000000 +#define XCHAL_DTLB_SET0_E1_VPN_CONST 0x20000000 +#define XCHAL_DTLB_SET0_E2_VPN_CONST 0x40000000 +#define XCHAL_DTLB_SET0_E3_VPN_CONST 0x60000000 +#define XCHAL_DTLB_SET0_E4_VPN_CONST 0x80000000 +#define XCHAL_DTLB_SET0_E5_VPN_CONST 0xA0000000 +#define XCHAL_DTLB_SET0_E6_VPN_CONST 0xC0000000 +#define XCHAL_DTLB_SET0_E7_VPN_CONST 0xE0000000 +/* Reset PPN values for each entry of DTLB way set 0 (because SET0_PPN_RESET is non-zero): */ +#define XCHAL_DTLB_SET0_E0_PPN_RESET 0x00000000 +#define XCHAL_DTLB_SET0_E1_PPN_RESET 0x20000000 +#define XCHAL_DTLB_SET0_E2_PPN_RESET 0x40000000 +#define XCHAL_DTLB_SET0_E3_PPN_RESET 0x60000000 +#define XCHAL_DTLB_SET0_E4_PPN_RESET 0x80000000 +#define XCHAL_DTLB_SET0_E5_PPN_RESET 0xA0000000 +#define XCHAL_DTLB_SET0_E6_PPN_RESET 0xC0000000 +#define XCHAL_DTLB_SET0_E7_PPN_RESET 0xE0000000 +/* Reset CA values for each entry of DTLB way set 0 (because SET0_CA_RESET is non-zero): */ +#define XCHAL_DTLB_SET0_E0_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E1_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E2_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E3_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E4_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E5_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E6_CA_RESET 0x02 +#define XCHAL_DTLB_SET0_E7_CA_RESET 0x02 + + + + +#endif /*XTENSA_CONFIG_CORE_MATMAP_H*/ + diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/defs.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/defs.h new file mode 100644 index 000000000000..0da4586ce0d3 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/defs.h @@ -0,0 +1,38 @@ +/* Definitions for Xtensa instructions, types, and protos. */ + +/* Customer ID=12153; Build=0x878bf; Copyright (c) 2003-2004 Tensilica Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +/* NOTE: This file exists only for backward compatibility with T1050 + and earlier Xtensa releases. It includes only a subset of the + available header files. */ + +#ifndef _XTENSA_BASE_HEADER +#define _XTENSA_BASE_HEADER + +#ifdef __XTENSA__ + +#include <xtensa/tie/xt_core.h> +#include <xtensa/tie/xt_misc.h> +#include <xtensa/tie/xt_booleans.h> + +#endif /* __XTENSA__ */ +#endif /* !_XTENSA_BASE_HEADER */ diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/specreg.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/specreg.h new file mode 100644 index 000000000000..0c54c7290dd6 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/specreg.h @@ -0,0 +1,108 @@ +/* + * Xtensa Special Register symbolic names + */ + +/* $Id: //depot/rel/Homewood/ib.6/Xtensa/SWConfig/hal/specreg.h.tpp#1 $ */ + +/* Customer ID=7490; Build=0xa28f5; Copyright (c) 1998-2002 Tensilica Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef XTENSA_SPECREG_H +#define XTENSA_SPECREG_H + +/* Include these special register bitfield definitions, for historical reasons: */ +#include <xtensa/corebits.h> + + +/* Special registers: */ +#define LBEG 0 +#define LEND 1 +#define LCOUNT 2 +#define SAR 3 +#define BR 4 +#define SCOMPARE1 12 +#define PREFCTL 40 +#define WINDOWBASE 72 +#define WINDOWSTART 73 +#define IBREAKENABLE 96 +#define MEMCTL 97 +#define ATOMCTL 99 +#define DDR 104 +#define IBREAKA_0 128 +#define IBREAKA_1 129 +#define DBREAKA_0 144 +#define DBREAKA_1 145 +#define DBREAKC_0 160 +#define DBREAKC_1 161 +#define EPC_1 177 +#define EPC_2 178 +#define EPC_3 179 +#define EPC_4 180 +#define EPC_5 181 +#define EPC_6 182 +#define EPC_7 183 +#define DEPC 192 +#define EPS_2 194 +#define EPS_3 195 +#define EPS_4 196 +#define EPS_5 197 +#define EPS_6 198 +#define EPS_7 199 +#define EXCSAVE_1 209 +#define EXCSAVE_2 210 +#define EXCSAVE_3 211 +#define EXCSAVE_4 212 +#define EXCSAVE_5 213 +#define EXCSAVE_6 214 +#define EXCSAVE_7 215 +#define CPENABLE 224 +#define INTERRUPT 226 +#define INTENABLE 228 +#define PS 230 +#define EXCCAUSE 232 +#define DEBUGCAUSE 233 +#define CCOUNT 234 +#define PRID 235 +#define ICOUNT 236 +#define ICOUNTLEVEL 237 +#define EXCVADDR 238 +#define CCOMPARE_0 240 +#define CCOMPARE_1 241 +#define MISC_REG_0 244 +#define MISC_REG_1 245 + + +/* Special cases (bases of special register series): */ +#define IBREAKA 128 +#define DBREAKA 144 +#define DBREAKC 160 +#define EPC 176 +#define EPS 192 +#define EXCSAVE 208 +#define CCOMPARE 240 + +/* Special names for read-only and write-only interrupt registers: */ +#define INTREAD 226 +#define INTSET 226 +#define INTCLEAR 227 + +#endif /* XTENSA_SPECREG_H */ + diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/system.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/system.h new file mode 100644 index 000000000000..31459310d3d7 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/system.h @@ -0,0 +1,262 @@ +/* + * xtensa/config/system.h -- HAL definitions that are dependent on SYSTEM configuration + * + * NOTE: The location and contents of this file are highly subject to change. + * + * Source for configuration-independent binaries (which link in a + * configuration-specific HAL library) must NEVER include this file. + * The HAL itself has historically included this file in some instances, + * but this is not appropriate either, because the HAL is meant to be + * core-specific but system independent. + */ + +/* Customer ID=7490; Build=0xa28f5; Copyright (c) 2000-2010 Tensilica Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + + +#ifndef XTENSA_CONFIG_SYSTEM_H +#define XTENSA_CONFIG_SYSTEM_H + + +/*---------------------------------------------------------------------- + CONFIGURED SOFTWARE OPTIONS + ----------------------------------------------------------------------*/ + +#define XSHAL_USE_ABSOLUTE_LITERALS 0 /* (sw-only option, whether software uses absolute literals) */ +#define XSHAL_HAVE_TEXT_SECTION_LITERALS 1 /* Set if there is some memory that allows both code and literals. */ + +#define XSHAL_ABI XTHAL_ABI_WINDOWED /* (sw-only option, selected ABI) */ +/* The above maps to one of the following constants: */ +#define XTHAL_ABI_WINDOWED 0 +#define XTHAL_ABI_CALL0 1 + +#define XSHAL_CLIB XTHAL_CLIB_XCLIB /* (sw-only option, selected C library) */ +/* The above maps to one of the following constants: */ +#define XTHAL_CLIB_NEWLIB 0 +#define XTHAL_CLIB_UCLIBC 1 +#define XTHAL_CLIB_XCLIB 2 + +#define XSHAL_USE_FLOATING_POINT 1 + +#define XSHAL_FLOATING_POINT_ABI 1 + +/* SW workarounds enabled for HW errata: */ + +/*---------------------------------------------------------------------- + DEVICE ADDRESSES + ----------------------------------------------------------------------*/ + +/* + * Strange place to find these, but the configuration GUI + * allows moving these around to account for various core + * configurations. Specific boards (and their BSP software) + * will have specific meanings for these components. + */ + +/* I/O Block areas: */ +#define XSHAL_IOBLOCK_CACHED_VADDR 0x70000000 +#define XSHAL_IOBLOCK_CACHED_PADDR 0x70000000 +#define XSHAL_IOBLOCK_CACHED_SIZE 0x0E000000 + +#define XSHAL_IOBLOCK_BYPASS_VADDR 0x90000000 +#define XSHAL_IOBLOCK_BYPASS_PADDR 0x90000000 +#define XSHAL_IOBLOCK_BYPASS_SIZE 0x0E000000 + +/* System ROM: */ +#define XSHAL_ROM_VADDR 0x50000000 +#define XSHAL_ROM_PADDR 0x50000000 +#define XSHAL_ROM_SIZE 0x00020000 +/* Largest available area (free of vectors): */ +#define XSHAL_ROM_AVAIL_VADDR 0x50000000 +#define XSHAL_ROM_AVAIL_VSIZE 0x00020000 + +/* System RAM: */ +#define XSHAL_RAM_VADDR 0x60000000 +#define XSHAL_RAM_PADDR 0x60000000 +#define XSHAL_RAM_VSIZE 0x1F000000 +#define XSHAL_RAM_PSIZE 0x1F000000 +#define XSHAL_RAM_SIZE XSHAL_RAM_PSIZE +/* Largest available area (free of vectors): */ +#define XSHAL_RAM_AVAIL_VADDR 0x60000000 +#define XSHAL_RAM_AVAIL_VSIZE 0x1F000000 + +/* + * Shadow system RAM (same device as system RAM, at different address). + * (Emulation boards need this for the SONIC Ethernet driver + * when data caches are configured for writeback mode.) + * NOTE: on full MMU configs, this points to the BYPASS virtual address + * of system RAM, ie. is the same as XSHAL_RAM_* except that virtual + * addresses are viewed through the BYPASS static map rather than + * the CACHED static map. + */ +#define XSHAL_RAM_BYPASS_VADDR 0x20000000 +#define XSHAL_RAM_BYPASS_PADDR 0x20000000 +#define XSHAL_RAM_BYPASS_PSIZE 0x1F000000 + +/* Alternate system RAM (different device than system RAM): */ + +/* Some available location in which to place devices in a simulation (eg. XTMP): */ +#define XSHAL_SIMIO_CACHED_VADDR 0xC0000000 +#define XSHAL_SIMIO_BYPASS_VADDR 0xC0000000 +#define XSHAL_SIMIO_PADDR 0xC0000000 +#define XSHAL_SIMIO_SIZE 0x20000000 + + +/*---------------------------------------------------------------------- + * For use by reference testbench exit and diagnostic routines. + */ +#define XSHAL_MAGIC_EXIT 0xc0000000 +#define XSHAL_STL_INFO_LOCATION 0x9ffffffc + +/*---------------------------------------------------------------------- + * DEVICE-ADDRESS DEPENDENT... + * + * Values written to CACHEATTR special register (or its equivalent) + * to enable and disable caches in various modes. + *----------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------- + BACKWARD COMPATIBILITY ... + ----------------------------------------------------------------------*/ + +/* + * NOTE: the following two macros are DEPRECATED. Use the latter + * board-specific macros instead, which are specially tuned for the + * particular target environments' memory maps. + */ +#define XSHAL_CACHEATTR_BYPASS XSHAL_XT2000_CACHEATTR_BYPASS /* disable caches in bypass mode */ +#define XSHAL_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_DEFAULT /* default setting to enable caches (no writeback!) */ + +/*---------------------------------------------------------------------- + GENERIC + ----------------------------------------------------------------------*/ + +/* For the following, a 512MB region is used if it contains a system (PIF) RAM, + * system (PIF) ROM, local memory, or XLMI. */ + +/* These set any unused 512MB region to cache-BYPASS attribute: */ +#define XSHAL_ALLVALID_CACHEATTR_WRITEBACK 0x42224422 /* enable caches in write-back mode */ +#define XSHAL_ALLVALID_CACHEATTR_WRITEALLOC 0x12221122 /* enable caches in write-allocate mode */ +#define XSHAL_ALLVALID_CACHEATTR_WRITETHRU 0x12221122 /* enable caches in write-through mode */ +#define XSHAL_ALLVALID_CACHEATTR_BYPASS 0x22222222 /* disable caches in bypass mode */ +#define XSHAL_ALLVALID_CACHEATTR_DEFAULT XSHAL_ALLVALID_CACHEATTR_WRITEBACK /* default setting to enable caches */ + +/* These set any unused 512MB region to ILLEGAL attribute: */ +#define XSHAL_STRICT_CACHEATTR_WRITEBACK 0x4FFF44FF /* enable caches in write-back mode */ +#define XSHAL_STRICT_CACHEATTR_WRITEALLOC 0x1FFF11FF /* enable caches in write-allocate mode */ +#define XSHAL_STRICT_CACHEATTR_WRITETHRU 0x1FFF11FF /* enable caches in write-through mode */ +#define XSHAL_STRICT_CACHEATTR_BYPASS 0x2FFF22FF /* disable caches in bypass mode */ +#define XSHAL_STRICT_CACHEATTR_DEFAULT XSHAL_STRICT_CACHEATTR_WRITEBACK /* default setting to enable caches */ + +/* These set the first 512MB, if unused, to ILLEGAL attribute to help catch + * NULL-pointer dereference bugs; all other unused 512MB regions are set + * to cache-BYPASS attribute: */ +#define XSHAL_TRAPNULL_CACHEATTR_WRITEBACK 0x4222442F /* enable caches in write-back mode */ +#define XSHAL_TRAPNULL_CACHEATTR_WRITEALLOC 0x1222112F /* enable caches in write-allocate mode */ +#define XSHAL_TRAPNULL_CACHEATTR_WRITETHRU 0x1222112F /* enable caches in write-through mode */ +#define XSHAL_TRAPNULL_CACHEATTR_BYPASS 0x2222222F /* disable caches in bypass mode */ +#define XSHAL_TRAPNULL_CACHEATTR_DEFAULT XSHAL_TRAPNULL_CACHEATTR_WRITEBACK /* default setting to enable caches */ + +/*---------------------------------------------------------------------- + ISS (Instruction Set Simulator) SPECIFIC ... + ----------------------------------------------------------------------*/ + +/* For now, ISS defaults to the TRAPNULL settings: */ +#define XSHAL_ISS_CACHEATTR_WRITEBACK XSHAL_TRAPNULL_CACHEATTR_WRITEBACK +#define XSHAL_ISS_CACHEATTR_WRITEALLOC XSHAL_TRAPNULL_CACHEATTR_WRITEALLOC +#define XSHAL_ISS_CACHEATTR_WRITETHRU XSHAL_TRAPNULL_CACHEATTR_WRITETHRU +#define XSHAL_ISS_CACHEATTR_BYPASS XSHAL_TRAPNULL_CACHEATTR_BYPASS +#define XSHAL_ISS_CACHEATTR_DEFAULT XSHAL_TRAPNULL_CACHEATTR_WRITEBACK + +#define XSHAL_ISS_PIPE_REGIONS 0 +#define XSHAL_ISS_SDRAM_REGIONS 0 + + +/*---------------------------------------------------------------------- + XT2000 BOARD SPECIFIC ... + ----------------------------------------------------------------------*/ + +/* For the following, a 512MB region is used if it contains any system RAM, + * system ROM, local memory, XLMI, or other XT2000 board device or memory. + * Regions containing devices are forced to cache-BYPASS mode regardless + * of whether the macro is _WRITEBACK vs. _BYPASS etc. */ + +/* These set any 512MB region unused on the XT2000 to ILLEGAL attribute: */ +#define XSHAL_XT2000_CACHEATTR_WRITEBACK 0x4FF2442F /* enable caches in write-back mode */ +#define XSHAL_XT2000_CACHEATTR_WRITEALLOC 0x1FF2112F /* enable caches in write-allocate mode */ +#define XSHAL_XT2000_CACHEATTR_WRITETHRU 0x1FF2112F /* enable caches in write-through mode */ +#define XSHAL_XT2000_CACHEATTR_BYPASS 0x2FF2222F /* disable caches in bypass mode */ +#define XSHAL_XT2000_CACHEATTR_DEFAULT XSHAL_XT2000_CACHEATTR_WRITEBACK /* default setting to enable caches */ + +#define XSHAL_XT2000_PIPE_REGIONS 0x00000000 /* BusInt pipeline regions */ +#define XSHAL_XT2000_SDRAM_REGIONS 0x00000044 /* BusInt SDRAM regions */ + + +/*---------------------------------------------------------------------- + VECTOR INFO AND SIZES + ----------------------------------------------------------------------*/ + +#define XSHAL_VECTORS_PACKED 0 /* UNUSED */ +#define XSHAL_STATIC_VECTOR_SELECT 0 +#define XSHAL_RESET_VECTOR_VADDR 0x7F000000 +#define XSHAL_RESET_VECTOR_PADDR 0x7F000000 + +/* + * Sizes allocated to vectors by the system (memory map) configuration. + * These sizes are constrained by core configuration (eg. one vector's + * code cannot overflow into another vector) but are dependent on the + * system or board (or LSP) memory map configuration. + * + * Whether or not each vector happens to be in a system ROM is also + * a system configuration matter, sometimes useful, included here also: + */ +#define XSHAL_RESET_VECTOR_SIZE 0x00000300 +#define XSHAL_RESET_VECTOR_ISROM 0 +#define XSHAL_USER_VECTOR_SIZE 0x00000038 +#define XSHAL_USER_VECTOR_ISROM 0 +#define XSHAL_PROGRAMEXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */ +#define XSHAL_USEREXC_VECTOR_SIZE XSHAL_USER_VECTOR_SIZE /* for backward compatibility */ +#define XSHAL_KERNEL_VECTOR_SIZE 0x00000038 +#define XSHAL_KERNEL_VECTOR_ISROM 0 +#define XSHAL_STACKEDEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */ +#define XSHAL_KERNELEXC_VECTOR_SIZE XSHAL_KERNEL_VECTOR_SIZE /* for backward compatibility */ +#define XSHAL_DOUBLEEXC_VECTOR_SIZE 0x00000040 +#define XSHAL_DOUBLEEXC_VECTOR_ISROM 0 +#define XSHAL_WINDOW_VECTORS_SIZE 0x00000178 +#define XSHAL_WINDOW_VECTORS_ISROM 0 +#define XSHAL_INTLEVEL2_VECTOR_SIZE 0x00000038 +#define XSHAL_INTLEVEL2_VECTOR_ISROM 0 +#define XSHAL_INTLEVEL3_VECTOR_SIZE 0x00000038 +#define XSHAL_INTLEVEL3_VECTOR_ISROM 0 +#define XSHAL_INTLEVEL4_VECTOR_SIZE 0x00000038 +#define XSHAL_INTLEVEL4_VECTOR_ISROM 0 +#define XSHAL_INTLEVEL5_VECTOR_SIZE 0x00000038 +#define XSHAL_INTLEVEL5_VECTOR_ISROM 0 +#define XSHAL_INTLEVEL6_VECTOR_SIZE 0x00000038 +#define XSHAL_INTLEVEL6_VECTOR_ISROM 0 +#define XSHAL_DEBUG_VECTOR_SIZE XSHAL_INTLEVEL6_VECTOR_SIZE +#define XSHAL_DEBUG_VECTOR_ISROM XSHAL_INTLEVEL6_VECTOR_ISROM +#define XSHAL_NMI_VECTOR_SIZE 0x00000038 +#define XSHAL_NMI_VECTOR_ISROM 0 +#define XSHAL_INTLEVEL7_VECTOR_SIZE XSHAL_NMI_VECTOR_SIZE + +#endif /*XTENSA_CONFIG_SYSTEM_H*/ + diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/tie-asm.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/tie-asm.h new file mode 100644 index 000000000000..ce8f0103809b --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/tie-asm.h @@ -0,0 +1,366 @@ +/* + * tie-asm.h -- compile-time HAL assembler definitions dependent on CORE & TIE + * + * NOTE: This header file is not meant to be included directly. + */ + +/* This header file contains assembly-language definitions (assembly + macros, etc.) for this specific Xtensa processor's TIE extensions + and options. It is customized to this Xtensa processor configuration. + + Customer ID=7490; Build=0xa28f5; Copyright (c) 1999-2022 Cadence Design Systems Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef _XTENSA_CORE_TIE_ASM_H +#define _XTENSA_CORE_TIE_ASM_H + +#include <xtensa/coreasm.h> + +/* Selection parameter values for save-area save/restore macros: */ +/* Option vs. TIE: */ +#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */ +#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */ +#define XTHAL_SAS_ANYOT 0x0003 /* both of the above */ +/* Whether used automatically by compiler: */ +#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */ +#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */ +#define XTHAL_SAS_ANYCC 0x000C /* both of the above */ +/* ABI handling across function calls: */ +#define XTHAL_SAS_CALR 0x0010 /* caller-saved */ +#define XTHAL_SAS_CALE 0x0020 /* callee-saved */ +#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */ +#define XTHAL_SAS_ANYABI 0x0070 /* all of the above three */ +/* Misc */ +#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */ +#define XTHAL_SAS3(optie,ccuse,abi) ( ((optie) & XTHAL_SAS_ANYOT) \ + | ((ccuse) & XTHAL_SAS_ANYCC) \ + | ((abi) & XTHAL_SAS_ANYABI) ) + + + /* + * Macro to store all non-coprocessor (extra) custom TIE and optional state + * (not including zero-overhead loop registers). + * Required parameters: + * ptr Save area pointer address register (clobbered) + * (register must contain a 4 byte aligned address). + * at1..at4 Four temporary address registers (first XCHAL_NCP_NUM_ATMPS + * registers are clobbered, the remaining are unused). + * Optional parameters: + * continue If macro invoked as part of a larger store sequence, set to 1 + * if this is not the first in the sequence. Defaults to 0. + * ofs Offset from start of larger sequence (from value of first ptr + * in sequence) at which to store. Defaults to next available space + * (or 0 if <continue> is 0). + * select Select what category(ies) of registers to store, as a bitmask + * (see XTHAL_SAS_xxx constants). Defaults to all registers. + * alloc Select what category(ies) of registers to allocate; if any + * category is selected here that is not in <select>, space for + * the corresponding registers is skipped without doing any store. + */ + .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 + xchal_sa_start \continue, \ofs + // Optional global registers used by default by the compiler: + .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select) + xchal_sa_align \ptr, 0, 1016, 4, 4 + rur.threadptr \at1 // threadptr option + s32i \at1, \ptr, .Lxchal_ofs_+0 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 + .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0 + xchal_sa_align \ptr, 0, 1016, 4, 4 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 + .endif + // Optional caller-saved registers not used by default by the compiler: + .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) + xchal_sa_align \ptr, 0, 1012, 4, 4 + rsr.br \at1 // boolean option + s32i \at1, \ptr, .Lxchal_ofs_+0 + rsr.scompare1 \at1 // conditional store option + s32i \at1, \ptr, .Lxchal_ofs_+4 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 8 + .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 + xchal_sa_align \ptr, 0, 1012, 4, 4 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 8 + .endif + .endm // xchal_ncp_store + + /* + * Macro to load all non-coprocessor (extra) custom TIE and optional state + * (not including zero-overhead loop registers). + * Required parameters: + * ptr Save area pointer address register (clobbered) + * (register must contain a 4 byte aligned address). + * at1..at4 Four temporary address registers (first XCHAL_NCP_NUM_ATMPS + * registers are clobbered, the remaining are unused). + * Optional parameters: + * continue If macro invoked as part of a larger load sequence, set to 1 + * if this is not the first in the sequence. Defaults to 0. + * ofs Offset from start of larger sequence (from value of first ptr + * in sequence) at which to load. Defaults to next available space + * (or 0 if <continue> is 0). + * select Select what category(ies) of registers to load, as a bitmask + * (see XTHAL_SAS_xxx constants). Defaults to all registers. + * alloc Select what category(ies) of registers to allocate; if any + * category is selected here that is not in <select>, space for + * the corresponding registers is skipped without doing any load. + */ + .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 + xchal_sa_start \continue, \ofs + // Optional global registers used by default by the compiler: + .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\select) + xchal_sa_align \ptr, 0, 1016, 4, 4 + l32i \at1, \ptr, .Lxchal_ofs_+0 + wur.threadptr \at1 // threadptr option + .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 + .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~(\alloc)) == 0 + xchal_sa_align \ptr, 0, 1016, 4, 4 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 4 + .endif + // Optional caller-saved registers not used by default by the compiler: + .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) + xchal_sa_align \ptr, 0, 1012, 4, 4 + l32i \at1, \ptr, .Lxchal_ofs_+0 + wsr.br \at1 // boolean option + l32i \at1, \ptr, .Lxchal_ofs_+4 + wsr.scompare1 \at1 // conditional store option + .set .Lxchal_ofs_, .Lxchal_ofs_ + 8 + .elseif ((XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 + xchal_sa_align \ptr, 0, 1012, 4, 4 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 8 + .endif + .endm // xchal_ncp_load + + +#define XCHAL_NCP_NUM_ATMPS 1 + + /* + * Macro to store the state of TIE coprocessor AudioEngineLX. + * Required parameters: + * ptr Save area pointer address register (clobbered) + * (register must contain a 16 byte aligned address). + * at1..at4 Four temporary address registers (first XCHAL_CP1_NUM_ATMPS + * registers are clobbered, the remaining are unused). + * Optional parameters are the same as for xchal_ncp_store. + */ +#define xchal_cp_AudioEngineLX_store xchal_cp1_store + .macro xchal_cp1_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 + xchal_sa_start \continue, \ofs + // Custom caller-saved registers not used by default by the compiler: + .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) + xchal_sa_align \ptr, 0, 0, 16, 16 + ae_s64.i aed0, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_s64.i aed1, \ptr, .Lxchal_ofs_+0 + ae_s64.i aed2, \ptr, .Lxchal_ofs_+8 + ae_s64.i aed3, \ptr, .Lxchal_ofs_+16 + ae_s64.i aed4, \ptr, .Lxchal_ofs_+24 + ae_s64.i aed5, \ptr, .Lxchal_ofs_+32 + ae_s64.i aed6, \ptr, .Lxchal_ofs_+40 + ae_s64.i aed7, \ptr, .Lxchal_ofs_+48 + ae_s64.i aed8, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_s64.i aed9, \ptr, .Lxchal_ofs_+0 + ae_s64.i aed10, \ptr, .Lxchal_ofs_+8 + ae_s64.i aed11, \ptr, .Lxchal_ofs_+16 + ae_s64.i aed12, \ptr, .Lxchal_ofs_+24 + ae_s64.i aed13, \ptr, .Lxchal_ofs_+32 + ae_s64.i aed14, \ptr, .Lxchal_ofs_+40 + ae_s64.i aed15, \ptr, .Lxchal_ofs_+48 + ae_s64.i aed16, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_s64.i aed17, \ptr, .Lxchal_ofs_+0 + ae_s64.i aed18, \ptr, .Lxchal_ofs_+8 + ae_s64.i aed19, \ptr, .Lxchal_ofs_+16 + ae_s64.i aed20, \ptr, .Lxchal_ofs_+24 + ae_s64.i aed21, \ptr, .Lxchal_ofs_+32 + ae_s64.i aed22, \ptr, .Lxchal_ofs_+40 + ae_s64.i aed23, \ptr, .Lxchal_ofs_+48 + ae_s64.i aed24, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_s64.i aed25, \ptr, .Lxchal_ofs_+0 + ae_s64.i aed26, \ptr, .Lxchal_ofs_+8 + ae_s64.i aed27, \ptr, .Lxchal_ofs_+16 + ae_s64.i aed28, \ptr, .Lxchal_ofs_+24 + ae_s64.i aed29, \ptr, .Lxchal_ofs_+32 + ae_s64.i aed30, \ptr, .Lxchal_ofs_+40 + ae_s64.i aed31, \ptr, .Lxchal_ofs_+48 + ae_movae \at1, aep0 + s8i \at1, \ptr, .Lxchal_ofs_+56 + ae_movae \at1, aep1 + s8i \at1, \ptr, .Lxchal_ofs_+57 + ae_movae \at1, aep2 + s8i \at1, \ptr, .Lxchal_ofs_+58 + ae_movae \at1, aep3 + s8i \at1, \ptr, .Lxchal_ofs_+59 + addi.a \ptr, \ptr, 64 + ae_salign128.i u0, \ptr, .Lxchal_ofs_+0 + ae_salign128.i u1, \ptr, .Lxchal_ofs_+16 + ae_salign128.i u2, \ptr, .Lxchal_ofs_+32 + ae_salign128.i u3, \ptr, .Lxchal_ofs_+48 + addi.a \ptr, \ptr, -320 + ae_movdrzbvc aed0 // ureg AE_ZBIASV8C + ae_s64.i aed0, \ptr, .Lxchal_ofs_+0 + 0 + ae_movvfcrfsr aed0 // ureg FCR_FSR + ae_s64.i aed0, \ptr, .Lxchal_ofs_+8 + 0 + rur.ae_ovf_sar \at1 // ureg 240 + s32i \at1, \ptr, .Lxchal_ofs_+16 + rur.ae_bithead \at1 // ureg 241 + s32i \at1, \ptr, .Lxchal_ofs_+20 + rur.ae_ts_fts_bu_bp \at1 // ureg 242 + s32i \at1, \ptr, .Lxchal_ofs_+24 + rur.ae_cw_sd_no \at1 // ureg 243 + s32i \at1, \ptr, .Lxchal_ofs_+28 + rur.ae_cbegin0 \at1 // ureg 246 + s32i \at1, \ptr, .Lxchal_ofs_+32 + rur.ae_cend0 \at1 // ureg 247 + s32i \at1, \ptr, .Lxchal_ofs_+36 + rur.ae_cbegin1 \at1 // ureg 248 + s32i \at1, \ptr, .Lxchal_ofs_+40 + rur.ae_cend1 \at1 // ureg 249 + s32i \at1, \ptr, .Lxchal_ofs_+44 + rur.ae_cbegin2 \at1 // ureg 250 + s32i \at1, \ptr, .Lxchal_ofs_+48 + rur.ae_cend2 \at1 // ureg 251 + s32i \at1, \ptr, .Lxchal_ofs_+52 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 384 + .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 + xchal_sa_align \ptr, 0, 0, 16, 16 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 384 + .endif + .endm // xchal_cp1_store + + /* + * Macro to load the state of TIE coprocessor AudioEngineLX. + * Required parameters: + * ptr Save area pointer address register (clobbered) + * (register must contain a 16 byte aligned address). + * at1..at4 Four temporary address registers (first XCHAL_CP1_NUM_ATMPS + * registers are clobbered, the remaining are unused). + * Optional parameters are the same as for xchal_ncp_load. + */ +#define xchal_cp_AudioEngineLX_load xchal_cp1_load + .macro xchal_cp1_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL alloc=0 + xchal_sa_start \continue, \ofs + // Custom caller-saved registers not used by default by the compiler: + .ifeq (XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\select) + xchal_sa_align \ptr, 0, 0, 16, 16 + ae_l64.i aed0, \ptr, .Lxchal_ofs_+0 + 0 // ureg AE_ZBIASV8C + ae_movzbvcdr aed0 + ae_l64.i aed0, \ptr, .Lxchal_ofs_+8 + 0 // ureg FCR_FSR + ae_movfcrfsrv aed0 + l32i \at1, \ptr, .Lxchal_ofs_+16 + wur.ae_ovf_sar \at1 // ureg 240 + l32i \at1, \ptr, .Lxchal_ofs_+20 + wur.ae_bithead \at1 // ureg 241 + l32i \at1, \ptr, .Lxchal_ofs_+24 + wur.ae_ts_fts_bu_bp \at1 // ureg 242 + l32i \at1, \ptr, .Lxchal_ofs_+28 + wur.ae_cw_sd_no \at1 // ureg 243 + l32i \at1, \ptr, .Lxchal_ofs_+32 + wur.ae_cbegin0 \at1 // ureg 246 + l32i \at1, \ptr, .Lxchal_ofs_+36 + wur.ae_cend0 \at1 // ureg 247 + l32i \at1, \ptr, .Lxchal_ofs_+40 + wur.ae_cbegin1 \at1 // ureg 248 + l32i \at1, \ptr, .Lxchal_ofs_+44 + wur.ae_cend1 \at1 // ureg 249 + l32i \at1, \ptr, .Lxchal_ofs_+48 + wur.ae_cbegin2 \at1 // ureg 250 + l32i \at1, \ptr, .Lxchal_ofs_+52 + wur.ae_cend2 \at1 // ureg 251 + ae_l64.i aed0, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_l64.i aed1, \ptr, .Lxchal_ofs_+0 + ae_l64.i aed2, \ptr, .Lxchal_ofs_+8 + ae_l64.i aed3, \ptr, .Lxchal_ofs_+16 + ae_l64.i aed4, \ptr, .Lxchal_ofs_+24 + ae_l64.i aed5, \ptr, .Lxchal_ofs_+32 + ae_l64.i aed6, \ptr, .Lxchal_ofs_+40 + ae_l64.i aed7, \ptr, .Lxchal_ofs_+48 + ae_l64.i aed8, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_l64.i aed9, \ptr, .Lxchal_ofs_+0 + ae_l64.i aed10, \ptr, .Lxchal_ofs_+8 + ae_l64.i aed11, \ptr, .Lxchal_ofs_+16 + ae_l64.i aed12, \ptr, .Lxchal_ofs_+24 + ae_l64.i aed13, \ptr, .Lxchal_ofs_+32 + ae_l64.i aed14, \ptr, .Lxchal_ofs_+40 + ae_l64.i aed15, \ptr, .Lxchal_ofs_+48 + ae_l64.i aed16, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_l64.i aed17, \ptr, .Lxchal_ofs_+0 + ae_l64.i aed18, \ptr, .Lxchal_ofs_+8 + ae_l64.i aed19, \ptr, .Lxchal_ofs_+16 + ae_l64.i aed20, \ptr, .Lxchal_ofs_+24 + ae_l64.i aed21, \ptr, .Lxchal_ofs_+32 + ae_l64.i aed22, \ptr, .Lxchal_ofs_+40 + ae_l64.i aed23, \ptr, .Lxchal_ofs_+48 + ae_l64.i aed24, \ptr, .Lxchal_ofs_+56 + addi.a \ptr, \ptr, 64 + ae_l64.i aed25, \ptr, .Lxchal_ofs_+0 + ae_l64.i aed26, \ptr, .Lxchal_ofs_+8 + ae_l64.i aed27, \ptr, .Lxchal_ofs_+16 + ae_l64.i aed28, \ptr, .Lxchal_ofs_+24 + ae_l64.i aed29, \ptr, .Lxchal_ofs_+32 + ae_l64.i aed30, \ptr, .Lxchal_ofs_+40 + ae_l64.i aed31, \ptr, .Lxchal_ofs_+48 + addi.a \ptr, \ptr, 56 + l8ui \at1, \ptr, .Lxchal_ofs_+0 + ae_movea aep0, \at1 + l8ui \at1, \ptr, .Lxchal_ofs_+1 + ae_movea aep1, \at1 + l8ui \at1, \ptr, .Lxchal_ofs_+2 + ae_movea aep2, \at1 + l8ui \at1, \ptr, .Lxchal_ofs_+3 + ae_movea aep3, \at1 + addi.a \ptr, \ptr, 8 + ae_lalign128.i u0, \ptr, .Lxchal_ofs_+0 + ae_lalign128.i u1, \ptr, .Lxchal_ofs_+16 + ae_lalign128.i u2, \ptr, .Lxchal_ofs_+32 + ae_lalign128.i u3, \ptr, .Lxchal_ofs_+48 + .set .Lxchal_pofs_, .Lxchal_pofs_ + 320 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 64 + .elseif ((XTHAL_SAS_TIE | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~(\alloc)) == 0 + xchal_sa_align \ptr, 0, 0, 16, 16 + .set .Lxchal_ofs_, .Lxchal_ofs_ + 384 + .endif + .endm // xchal_cp1_load + +#define XCHAL_CP1_NUM_ATMPS 1 +#define XCHAL_SA_NUM_ATMPS 1 + + /* Empty macros for unconfigured coprocessors: */ + .macro xchal_cp0_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp0_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp2_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp2_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp3_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp3_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp4_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp4_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp5_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp5_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp6_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp6_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp7_store p a b c d continue=0 ofs=-1 select=-1 ; .endm + .macro xchal_cp7_load p a b c d continue=0 ofs=-1 select=-1 ; .endm + +#endif /*_XTENSA_CORE_TIE_ASM_H*/ + diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/config/tie.h b/src/platform/amd/acp_6_3/include/arch/xtensa/config/tie.h new file mode 100644 index 000000000000..22fe621c7127 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/config/tie.h @@ -0,0 +1,211 @@ +/* + * tie.h -- compile-time HAL definitions dependent on CORE & TIE configuration + * + * NOTE: This header file is not meant to be included directly. + */ + +/* This header file describes this specific Xtensa processor's TIE extensions + that extend basic Xtensa core functionality. It is customized to this + Xtensa processor configuration. + + Customer ID=7490; Build=0xa28f5; Copyright (c) 1999-2022 Cadence Design Systems Inc. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef XTENSA_CORE_TIE_H +#define XTENSA_CORE_TIE_H + +/* parasoft-begin-suppress ALL "This file not MISRA checked." */ + +#define XCHAL_CP_NUM 1 /* number of coprocessors */ +#define XCHAL_CP_MAX 2 /* max CP ID + 1 (0 if none) */ +#define XCHAL_CP_MASK 0x02 /* bitmask of all CPs by ID */ +#define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */ + +/* Basic parameters of each coprocessor: */ +#define XCHAL_CP1_NAME "AudioEngineLX" +#define XCHAL_CP1_IDENT AudioEngineLX +#define XCHAL_CP1_SA_SIZE 384 /* size of state save area */ +#define XCHAL_CP1_SA_ALIGN 16 /* min alignment of save area */ +#define XCHAL_CP_ID_AUDIOENGINELX 1 /* coprocessor ID (0..7) */ + +/* Filler info for unassigned coprocessors, to simplify arrays etc: */ +#define XCHAL_CP0_SA_SIZE 0 +#define XCHAL_CP0_SA_ALIGN 1 +#define XCHAL_CP2_SA_SIZE 0 +#define XCHAL_CP2_SA_ALIGN 1 +#define XCHAL_CP3_SA_SIZE 0 +#define XCHAL_CP3_SA_ALIGN 1 +#define XCHAL_CP4_SA_SIZE 0 +#define XCHAL_CP4_SA_ALIGN 1 +#define XCHAL_CP5_SA_SIZE 0 +#define XCHAL_CP5_SA_ALIGN 1 +#define XCHAL_CP6_SA_SIZE 0 +#define XCHAL_CP6_SA_ALIGN 1 +#define XCHAL_CP7_SA_SIZE 0 +#define XCHAL_CP7_SA_ALIGN 1 + +/* Save area for non-coprocessor optional and custom (TIE) state: */ +#define XCHAL_NCP_SA_SIZE 12 +#define XCHAL_NCP_SA_ALIGN 4 + +/* Total save area for optional and custom state (NCP + CPn): */ +#define XCHAL_TOTAL_SA_SIZE 400 /* with 16-byte align padding */ +#define XCHAL_TOTAL_SA_ALIGN 16 /* actual minimum alignment */ + +/* + * Detailed contents of save areas. + * NOTE: caller must define the XCHAL_SA_REG macro (not defined here) + * before expanding the XCHAL_xxx_SA_LIST() macros. + * + * XCHAL_SA_REG(s,ccused,abikind,kind,opt,name,galign,align,asize, + * dbnum,base,regnum,bitsz,gapsz,reset,x...) + * + * s = passed from XCHAL_*_LIST(s), eg. to select how to expand + * ccused = set if used by compiler without special options or code + * abikind = 0 (caller-saved), 1 (callee-saved), or 2 (thread-global) + * kind = 0 (special reg), 1 (TIE user reg), or 2 (TIE regfile reg) + * opt = 0 (custom TIE extension or coprocessor), or 1 (optional reg) + * name = lowercase reg name (no quotes) + * galign = group byte alignment (power of 2) (galign >= align) + * align = register byte alignment (power of 2) + * asize = allocated size in bytes (asize*8 == bitsz + gapsz + padsz) + * (not including any pad bytes required to galign this or next reg) + * dbnum = unique target number f/debug (see <xtensa-libdb-macros.h>) + * base = reg shortname w/o index (or sr=special, ur=TIE user reg) + * regnum = reg index in regfile, or special/TIE-user reg number + * bitsz = number of significant bits (regfile width, or ur/sr mask bits) + * gapsz = intervening bits, if bitsz bits not stored contiguously + * (padsz = pad bits at end [TIE regfile] or at msbits [ur,sr] of asize) + * reset = register reset value (or 0 if undefined at reset) + * x = reserved for future use (0 until then) + * + * To filter out certain registers, e.g. to expand only the non-global + * registers used by the compiler, you can do something like this: + * + * #define XCHAL_SA_REG(s,ccused,p...) SELCC##ccused(p) + * #define SELCC0(p...) + * #define SELCC1(abikind,p...) SELAK##abikind(p) + * #define SELAK0(p...) REG(p) + * #define SELAK1(p...) REG(p) + * #define SELAK2(p...) + * #define REG(kind,tie,name,galn,aln,asz,csz,dbnum,base,rnum,bsz,rst,x...) \ + * ...what you want to expand... + */ + +#define XCHAL_NCP_SA_NUM 3 +#define XCHAL_NCP_SA_LIST(s) \ + XCHAL_SA_REG(s,1,2,1,1, threadptr, 4, 4, 4,0x03E7, ur,231, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,0,1, br, 4, 4, 4,0x0204, sr,4 , 16,0,0,0) \ + XCHAL_SA_REG(s,0,0,0,1, scompare1, 4, 4, 4,0x020C, sr,12 , 32,0,0,0) + +#define XCHAL_CP0_SA_NUM 0 +#define XCHAL_CP0_SA_LIST(s) /* empty */ + +#define XCHAL_CP1_SA_NUM 52 +#define XCHAL_CP1_SA_LIST(s) \ + XCHAL_SA_REG(s,0,0,1,0, ae_zbiasv8c,16, 8, 8,0x1029, ur,-1 , 16,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, fcr_fsr, 8, 8, 8,0x102A, ur,-1 , 7,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_ovf_sar, 4, 4, 4,0x03F0, ur,240, 15,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_bithead, 4, 4, 4,0x03F1, ur,241, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0,ae_ts_fts_bu_bp, 4, 4, 4,0x03F2, ur,242, 16,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cw_sd_no, 4, 4, 4,0x03F3, ur,243, 29,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cbegin0, 4, 4, 4,0x03F6, ur,246, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cend0, 4, 4, 4,0x03F7, ur,247, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cbegin1, 4, 4, 4,0x03F8, ur,248, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cend1, 4, 4, 4,0x03F9, ur,249, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cbegin2, 4, 4, 4,0x03FA, ur,250, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,1,0, ae_cend2, 4, 4, 4,0x03FB, ur,251, 32,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed0, 8, 8, 8,0x1000, aed,0 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed1, 8, 8, 8,0x1001, aed,1 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed2, 8, 8, 8,0x1002, aed,2 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed3, 8, 8, 8,0x1003, aed,3 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed4, 8, 8, 8,0x1004, aed,4 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed5, 8, 8, 8,0x1005, aed,5 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed6, 8, 8, 8,0x1006, aed,6 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed7, 8, 8, 8,0x1007, aed,7 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed8, 8, 8, 8,0x1008, aed,8 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed9, 8, 8, 8,0x1009, aed,9 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed10, 8, 8, 8,0x100A, aed,10 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed11, 8, 8, 8,0x100B, aed,11 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed12, 8, 8, 8,0x100C, aed,12 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed13, 8, 8, 8,0x100D, aed,13 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed14, 8, 8, 8,0x100E, aed,14 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed15, 8, 8, 8,0x100F, aed,15 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed16, 8, 8, 8,0x1010, aed,16 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed17, 8, 8, 8,0x1011, aed,17 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed18, 8, 8, 8,0x1012, aed,18 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed19, 8, 8, 8,0x1013, aed,19 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed20, 8, 8, 8,0x1014, aed,20 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed21, 8, 8, 8,0x1015, aed,21 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed22, 8, 8, 8,0x1016, aed,22 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed23, 8, 8, 8,0x1017, aed,23 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed24, 8, 8, 8,0x1018, aed,24 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed25, 8, 8, 8,0x1019, aed,25 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed26, 8, 8, 8,0x101A, aed,26 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed27, 8, 8, 8,0x101B, aed,27 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed28, 8, 8, 8,0x101C, aed,28 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed29, 8, 8, 8,0x101D, aed,29 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed30, 8, 8, 8,0x101E, aed,30 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aed31, 8, 8, 8,0x101F, aed,31 , 64,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aep0, 1, 1, 1,0x1024, aep,0 , 8,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aep1, 1, 1, 1,0x1025, aep,1 , 8,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aep2, 1, 1, 1,0x1026, aep,2 , 8,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, aep3, 1, 1, 1,0x1027, aep,3 , 8,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, u0,16,16,16,0x1020, u,0 ,128,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, u1,16,16,16,0x1021, u,1 ,128,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, u2,16,16,16,0x1022, u,2 ,128,0,0,0) \ + XCHAL_SA_REG(s,0,0,2,0, u3,16,16,16,0x1023, u,3 ,128,0,0,0) + +#define XCHAL_CP2_SA_NUM 0 +#define XCHAL_CP2_SA_LIST(s) /* empty */ + +#define XCHAL_CP3_SA_NUM 0 +#define XCHAL_CP3_SA_LIST(s) /* empty */ + +#define XCHAL_CP4_SA_NUM 0 +#define XCHAL_CP4_SA_LIST(s) /* empty */ + +#define XCHAL_CP5_SA_NUM 0 +#define XCHAL_CP5_SA_LIST(s) /* empty */ + +#define XCHAL_CP6_SA_NUM 0 +#define XCHAL_CP6_SA_LIST(s) /* empty */ + +#define XCHAL_CP7_SA_NUM 0 +#define XCHAL_CP7_SA_LIST(s) /* empty */ + +/* Byte length of instruction from its first nibble (op0 field), per FLIX. */ +#define XCHAL_OP0_FORMAT_LENGTHS 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16 +/* Byte length of instruction from its first byte, per FLIX. */ +#define XCHAL_BYTE0_FORMAT_LENGTHS \ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16,\ + 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16, 3,3,3,3,3,3,3,3,2,2,2,2,2,2,8,16 + +/* parasoft-end-suppress ALL "This file not MISRA checked." */ + +#endif /* XTENSA_CORE_TIE_H */ + diff --git a/src/platform/amd/acp_6_3/include/arch/xtensa/tie/xt_datacache.h b/src/platform/amd/acp_6_3/include/arch/xtensa/tie/xt_datacache.h new file mode 100644 index 000000000000..8e83064e2923 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/arch/xtensa/tie/xt_datacache.h @@ -0,0 +1,132 @@ +// Customer ID=12153; Build=0x878bf; Copyright (c) 2017 Cadence Design Systems, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +/* Definitions for the xt_datacache TIE package */ + +/* Do not modify. This is automatically generated.*/ + +#ifndef _XTENSA_xt_datacache_HEADER +#define _XTENSA_xt_datacache_HEADER + +/* parasoft-begin-suppress ALL "This file not MISRA checked." */ + +#ifdef __XTENSA__ +#ifdef __XCC__ + +#ifndef _ASMLANGUAGE +#ifndef _NOCLANGUAGE +#ifndef __ASSEMBLER__ + +#include <xtensa/tie/xt_core.h> + +/* + * The following prototypes describe intrinsic functions + * corresponding to TIE instructions. Some TIE instructions + * may produce multiple results (designated as "out" operands + * in the iclass section) or may have operands used as both + * inputs and outputs (designated as "inout"). However, the C + * and C++ languages do not provide syntax that can express + * the in/out/inout constraints of TIE intrinsics. + * Nevertheless, the compiler understands these constraints + * and will check that the intrinsic functions are used + * correctly. To improve the readability of these prototypes, + * the "out" and "inout" parameters are marked accordingly + * with comments. + */ + +extern void _TIE_xt_datacache_DHI(const int * s, immediate i); +extern void _TIE_xt_datacache_DHI_B(const int * s, int i); +extern void _TIE_xt_datacache_DHU(const int * s, immediate i); +extern void _TIE_xt_datacache_DHWB(const int * s, immediate i); +extern void _TIE_xt_datacache_DHWBI(const int * s, immediate i); +extern void _TIE_xt_datacache_DHWBI_B(const int * s, int i); +extern void _TIE_xt_datacache_DHWB_B(const int * s, int i); +extern void _TIE_xt_datacache_DII(const int * s, immediate i); +extern void _TIE_xt_datacache_DIU(const int * s, immediate i); +extern void _TIE_xt_datacache_DIWB(const int * s, immediate i); +extern void _TIE_xt_datacache_DIWBI(const int * s, immediate i); +extern void _TIE_xt_datacache_DIWBUI_P(const int * s /*inout*/); +extern void _TIE_xt_datacache_DPFL(const int * s, immediate i); +extern void _TIE_xt_datacache_DPFM_B(const int * s, int i); +extern void _TIE_xt_datacache_DPFM_BF(const int * s, int i); +extern void _TIE_xt_datacache_DPFR(const int * s, immediate i); +extern void _TIE_xt_datacache_DPFRO(const int * s, immediate i); +extern void _TIE_xt_datacache_DPFR_B(const int * s, int i); +extern void _TIE_xt_datacache_DPFR_BF(const int * s, int i); +extern void _TIE_xt_datacache_DPFW(const int * s, immediate i); +extern void _TIE_xt_datacache_DPFWO(const int * s, immediate i); +extern void _TIE_xt_datacache_DPFW_B(const int * s, int i); +extern void _TIE_xt_datacache_DPFW_BF(const int * s, int i); +extern int _TIE_xt_datacache_LDCT(const int * s); +extern int _TIE_xt_datacache_LDCW(const int * s); +extern void _TIE_xt_datacache_PFEND_A(void); +extern void _TIE_xt_datacache_PFEND_O(void); +extern void _TIE_xt_datacache_PFNXT_F(void); +extern void _TIE_xt_datacache_PFWAIT_A(void); +extern void _TIE_xt_datacache_PFWAIT_R(void); +extern void _TIE_xt_datacache_SDCT(int t, int * s); +extern void _TIE_xt_datacache_SDCW(int t, int * s); + +#endif /*__ASSEMBLER__*/ +#endif /*_NOCLANGUAGE*/ +#endif /*_ASMLANGUAGE*/ + +#define XT_DHI _TIE_xt_datacache_DHI +#define XT_DHI_B _TIE_xt_datacache_DHI_B +#define XT_DHU _TIE_xt_datacache_DHU +#define XT_DHWB _TIE_xt_datacache_DHWB +#define XT_DHWBI _TIE_xt_datacache_DHWBI +#define XT_DHWBI_B _TIE_xt_datacache_DHWBI_B +#define XT_DHWB_B _TIE_xt_datacache_DHWB_B +#define XT_DII _TIE_xt_datacache_DII +#define XT_DIU _TIE_xt_datacache_DIU +#define XT_DIWB _TIE_xt_datacache_DIWB +#define XT_DIWBI _TIE_xt_datacache_DIWBI +#define XT_DIWBUI_P _TIE_xt_datacache_DIWBUI_P +#define XT_DPFL _TIE_xt_datacache_DPFL +#define XT_DPFM_B _TIE_xt_datacache_DPFM_B +#define XT_DPFM_BF _TIE_xt_datacache_DPFM_BF +#define XT_DPFR _TIE_xt_datacache_DPFR +#define XT_DPFRO _TIE_xt_datacache_DPFRO +#define XT_DPFR_B _TIE_xt_datacache_DPFR_B +#define XT_DPFR_BF _TIE_xt_datacache_DPFR_BF +#define XT_DPFW _TIE_xt_datacache_DPFW +#define XT_DPFWO _TIE_xt_datacache_DPFWO +#define XT_DPFW_B _TIE_xt_datacache_DPFW_B +#define XT_DPFW_BF _TIE_xt_datacache_DPFW_BF +#define XT_LDCT _TIE_xt_datacache_LDCT +#define XT_LDCW _TIE_xt_datacache_LDCW +#define XT_PFEND_A _TIE_xt_datacache_PFEND_A +#define XT_PFEND_O _TIE_xt_datacache_PFEND_O +#define XT_PFNXT_F _TIE_xt_datacache_PFNXT_F +#define XT_PFWAIT_A _TIE_xt_datacache_PFWAIT_A +#define XT_PFWAIT_R _TIE_xt_datacache_PFWAIT_R +#define XT_SDCT _TIE_xt_datacache_SDCT +#define XT_SDCW _TIE_xt_datacache_SDCW + +#endif /* __XCC__ */ + +#endif /* __XTENSA__ */ + + +/* parasoft-end-suppress ALL "This file not MISRA checked." */ + +#endif /* !_XTENSA_xt_datacache_HEADER */ diff --git a/src/platform/amd/acp_6_3/include/platform/chip_offset_byte.h b/src/platform/amd/acp_6_3/include/platform/chip_offset_byte.h new file mode 100644 index 000000000000..e1877a8d22f4 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/platform/chip_offset_byte.h @@ -0,0 +1,195 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 AMD.All rights reserved. + * + * Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + * SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + */ + +#ifndef _ACP_6_3_OFFSET_HEADER +#define _ACP_6_3_OFFSET_HEADER + +#define PU_REGISTER_BASE (0x9FD00000 - 0x01240000) +#define PU_SCRATCH_REG_BASE (0x9FF00000 - 0x01250000) + +/* Registers from ACP_DMA block */ +#define ACP_DMA_CNTL_0 0x1240000 +#define ACP_DMA_DSCR_STRT_IDX_0 0x1240020 +#define ACP_DMA_DSCR_CNT_0 0x1240040 +#define ACP_DMA_PRIO_0 0x1240060 +#define ACP_DMA_DESC_BASE_ADDR 0x12400E0 +#define ACP_DMA_DESC_MAX_NUM_DSCR 0x12400E4 +#define ACP_DMA_CH_STS 0x12400E8 + +/* Registers from ACP_MISC block */ +#define ACP_CLKMUX_SEL 0x124102C +#define ACP_I2S_196MHZ_CLK_SEL 0x124105C +#define ACP_DSP0_INTR_CNTL 0x1241800 +#define ACP_DSP0_INTR_STAT 0x1241804 +#define ACP_DSP_SW_INTR_CNTL 0x1241808 +#define ACP_DSP_SW_INTR_STAT 0x124180C +#define ACP_SW_INTR_TRIG 0x1241810 +#define DSP_INTERRUPT_ROUTING_CTRL_0 0x1241814 +#define DSP_INTERRUPT_ROUTING_CTRL_1 0x1241818 +#define ACP_AXI2DAGB_SEM_0 0x1241874 +#define ACP_DSP0_INTR_CNTL1 0x1241920 +#define ACP_DSP0_INTR_STAT1 0x1241924 +#define ACP_SRBM_CLIENT_BASE_ADDR 0x12419EC +#define ACP_SRBM_CLIENT_RDDATA 0x12419F0 +#define ACP_SRBM_CYCLE_STS 0x12419F4 +#define ACP_SRBM_CLIENT_CONFIG 0x12419F8 + +/* Registers from ACP_P1_MISC block */ +#define ACP_EXTERNAL_INTR_ENB 0x1241A00 + +/* Registers from ACP_AUDIO_BUFFERS block */ +#define ACP_AUDIO_RX_RINGBUFADDR 0x1242000 +#define ACP_AUDIO_RX_FIFOADDR 0x124200C +#define ACP_AUDIO_TX_FIFOADDR 0x1242030 + +#define ACP_BT_RX_RINGBUFADDR 0x1242048 +#define ACP_BT_RX_RINGBUFSIZE 0x124204C +#define ACP_BT_RX_FIFOADDR 0x1242054 +#define ACP_BT_RX_FIFOSIZE 0x1242058 +#define ACP_BT_RX_DMA_SIZE 0x124205C +#define ACP_BT_RX_LINEARPOSITIONCNTR_HIGH 0x1242060 +#define ACP_BT_RX_LINEARPOSITIONCNTR_LOW 0x1242064 +#define ACP_BT_RX_INTR_WATERMARK_SIZE 0x1242068 +#define ACP_BT_TX_RINGBUFADDR 0x124206C +#define ACP_BT_TX_RINGBUFSIZE 0x1242070 +#define ACP_BT_TX_FIFOADDR 0x1242078 +#define ACP_BT_TX_FIFOSIZE 0x124207C +#define ACP_BT_TX_DMA_SIZE 0x1242080 +#define ACP_BT_TX_LINEARPOSITIONCNTR_HIGH 0x1242084 +#define ACP_BT_TX_LINEARPOSITIONCNTR_LOW 0x1242088 +#define ACP_BT_TX_INTR_WATERMARK_SIZE 0x124208C + +#define ACP_HS_RX_RINGBUFADDR 0x1242090 +#define ACP_HS_RX_RINGBUFSIZE 0x1242094 +#define ACP_HS_RX_FIFOADDR 0x124209C +#define ACP_HS_RX_FIFOSIZE 0x12420A0 +#define ACP_HS_RX_DMA_SIZE 0x12420A4 +#define ACP_HS_RX_LINEARPOSITIONCNTR_HIGH 0x12420A8 +#define ACP_HS_RX_LINEARPOSITIONCNTR_LOW 0x12420AC +#define ACP_HS_RX_INTR_WATERMARK_SIZE 0x12420B0 +#define ACP_HS_TX_RINGBUFADDR 0x12420B4 +#define ACP_HS_TX_RINGBUFSIZE 0x12420B8 +#define ACP_HS_TX_FIFOADDR 0x12420C0 +#define ACP_HS_TX_FIFOSIZE 0x12420C4 +#define ACP_HS_TX_DMA_SIZE 0x12420C8 +#define ACP_HS_TX_LINEARPOSITIONCNTR_HIGH 0x12420CC +#define ACP_HS_TX_LINEARPOSITIONCNTR_LOW 0x12420D0 +#define ACP_HS_TX_INTR_WATERMARK_SIZE 0x12420D4 + +/* Registers from ACP_I2S_TDM block */ +#define ACP_I2STDM_IER 0x1242400 +#define ACP_I2STDM_IRER 0x1242404 +#define ACP_I2STDM_RXFRMT 0x1242408 +#define ACP_I2STDM_ITER 0x124240C +#define ACP_I2STDM_TXFRMT 0x1242410 +#define ACP_I2STDM0_MSTRCLKGEN 0x1242414 +#define ACP_I2STDM2_MSTRCLKGEN 0x124241C + +/* Registers from ACP_BT_TDM block */ +#define ACP_BTTDM_IER 0x1242800 +#define ACP_BTTDM_IRER 0x1242804 +#define ACP_BTTDM_ITER 0x124280C +#define ACP_HSTDM_IER 0x1242814 +#define ACP_HSTDM_IRER 0x1242818 +#define ACP_HSTDM_RXFRMT 0x124281C +#define ACP_HSTDM_ITER 0x1242820 +#define ACP_HSTDM_TXFRMT 0x1242824 + +/* Registers from ACP_WOV block */ +#define ACP_WOV_PDM_ENABLE 0x1242C04 +#define ACP_WOV_PDM_DMA_ENABLE 0x1242C08 +#define ACP_WOV_RX_RINGBUFADDR 0x1242C0C +#define ACP_WOV_RX_RINGBUFSIZE 0x1242C10 +#define ACP_WOV_RX_INTR_WATERMARK_SIZE 0x1242C20 +#define ACP_WOV_PDM_FIFO_FLUSH 0x1242C24 +#define ACP_WOV_PDM_NO_OF_CHANNELS 0x1242C28 +#define ACP_WOV_PDM_DECIMATION_FACTOR 0x1242C2C +#define ACP_WOV_MISC_CTRL 0x1242C5C +#define ACP_WOV_CLK_CTRL 0x1242C60 + +/* Registers from ACP_P1_AUDIO_BUFFERS block */ +#define ACP_P1_I2S_RX_RINGBUFADDR 0x1243A00 +#define ACP_P1_I2S_RX_RINGBUFSIZE 0x1243A04 +#define ACP_P1_I2S_RX_FIFOADDR 0x1243A0C +#define ACP_P1_I2S_RX_FIFOSIZE 0x1243A10 +#define ACP_P1_I2S_RX_DMA_SIZE 0x1243A14 +#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_HIGH 0x1243A18 +#define ACP_P1_I2S_RX_LINEARPOSITIONCNTR_LOW 0x1243A1C +#define ACP_P1_I2S_RX_INTR_WATERMARK_SIZE 0x1243A20 +#define ACP_P1_I2S_TX_RINGBUFADDR 0x1243A24 +#define ACP_P1_I2S_TX_RINGBUFSIZE 0x1243A28 +#define ACP_P1_I2S_TX_FIFOADDR 0x1243A30 +#define ACP_P1_I2S_TX_FIFOSIZE 0x1243A34 +#define ACP_P1_I2S_TX_DMA_SIZE 0x1243A38 +#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_HIGH 0x1243A3C +#define ACP_P1_I2S_TX_LINEARPOSITIONCNTR_LOW 0x1243A40 +#define ACP_P1_I2S_TX_INTR_WATERMARK_SIZE 0x1243A44 +#define ACP_P1_BT_RX_RINGBUFADDR 0x1243A48 +#define ACP_P1_BT_RX_RINGBUFSIZE 0x1243A4C +#define ACP_P1_BT_RX_FIFOADDR 0x1243A54 +#define ACP_P1_BT_RX_FIFOSIZE 0x1243A58 +#define ACP_P1_BT_RX_DMA_SIZE 0x1243A5C +#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_HIGH 0x1243A60 +#define ACP_P1_BT_RX_LINEARPOSITIONCNTR_LOW 0x1243A64 +#define ACP_P1_BT_RX_INTR_WATERMARK_SIZE 0x1243A68 +#define ACP_P1_BT_TX_RINGBUFADDR 0x1243A6C +#define ACP_P1_BT_TX_RINGBUFSIZE 0x1243A70 +#define ACP_P1_BT_TX_FIFOADDR 0x1243A78 +#define ACP_P1_BT_TX_FIFOSIZE 0x1243A7C +#define ACP_P1_BT_TX_DMA_SIZE 0x1243A80 +#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_HIGH 0x1243A84 +#define ACP_P1_BT_TX_LINEARPOSITIONCNTR_LOW 0x1243A88 +#define ACP_P1_BT_TX_INTR_WATERMARK_SIZE 0x1243A8C +#define ACP_P1_HS_RX_RINGBUFADDR 0x1243A90 +#define ACP_P1_HS_RX_RINGBUFSIZE 0x1243A94 +#define ACP_P1_HS_RX_FIFOADDR 0x1243A9C +#define ACP_P1_HS_RX_FIFOSIZE 0x1243AA0 +#define ACP_P1_HS_RX_DMA_SIZE 0x1243AA4 +#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_HIGH 0x1243AA8 +#define ACP_P1_HS_RX_LINEARPOSITIONCNTR_LOW 0x1243AAC +#define ACP_P1_HS_RX_INTR_WATERMARK_SIZE 0x1243AB0 +#define ACP_P1_HS_TX_RINGBUFADDR 0x1243AB4 +#define ACP_P1_HS_TX_RINGBUFSIZE 0x1243AB8 +#define ACP_P1_HS_TX_FIFOADDR 0x1243AC0 +#define ACP_P1_HS_TX_FIFOSIZE 0x1243AC4 +#define ACP_P1_HS_TX_DMA_SIZE 0x1243AC8 +#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_HIGH 0x1243ACC +#define ACP_P1_HS_TX_LINEARPOSITIONCNTR_LOW 0x1243AD0 +#define ACP_P1_HS_TX_INTR_WATERMARK_SIZE 0x1243AD4 + +#define MP1_SMN_C2PMSG_69 0x58A14 +#define MP1_SMN_C2PMSG_85 0x58A54 +#define MP1_SMN_C2PMSG_93 0x58A74 + +#define CLK5_ROOTREFCLKMUX_1 0x6c0c8 +#define CLK5_CLK_PLL_REFCLK_RATE_STARTUP 0x6C0D0 +#define CLK5_CLK_PLL_REQ 0x6C0DC +#define CLK5_CLK1_DFS_CNTL 0x6C1B0 +#define CLK5_CLK1_CURRENT_CNT 0x6C348 +#define CLK5_CLK0_DFS_CNTL 0x6C1A4 +#define CLK5_CLK0_CURRENT_CNT 0x6C344 +#define CLK5_CLK0_BYPASS_CNTL 0x6C200 +#define CLK5_CLK1_BYPASS_CNTL 0x6C224 +#define CLK5_CLK0_DFS_STATUS 0x6C1AC +#define CLK5_CLK1_DFS_STATUS 0x6C1B8 +#define CLK5_SPLL_FIELD_2 0x6C114 +#define CLK5_CLK_PLL_PWR_REQ 0x6C2C0 +#define CLK5_CLK_DFSBYPASS_CONTROL 0x6C2C8 +#define CLK5_CLK_FSM_STATUS 0x6C2D4 +#define CLK5_SPLL_FUSE_1 0x6C0F8 +#define CLK5_SPLL_FUSE_2 0x6C0FC +#define CLK5_SPLL_FIELD_7 0x6C128 +#define CLK5_SPLL_FIELD_9 0x6C130 +#define CLK5_SPLL_FIELD_6nm 0x6C138 +#define CLK5_SPLL_FIELD_4 0x6C11C +#define CLK5_SPLL_FIELD_5nm_BUS_CTRL 0x6c140 +#define CLK5_SPLL_FIELD_5nm_BUS_WDATA 0x6c144 +#define CLK5_SPLL_FIELD_5nm_BUS_STATUS 0x6c148 +#define CLK5_CLK_PLL_RESET_STOP_TIMER 0x6C180 + +#endif diff --git a/src/platform/amd/acp_6_3/include/platform/chip_registers.h b/src/platform/amd/acp_6_3/include/platform/chip_registers.h new file mode 100644 index 000000000000..5ea907e2ff5b --- /dev/null +++ b/src/platform/amd/acp_6_3/include/platform/chip_registers.h @@ -0,0 +1,1062 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 AMD.All rights reserved. + * + * Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + * SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + */ +#if !defined(_ACP_6_3_REG_HEADER) +#define _ACP_6_3_REG_HEADER + +typedef union acp_dma_cntl_0 { + struct { + unsigned int dmachrst:1; + unsigned int dmachrun:1; + unsigned int dmachiocen:1; + unsigned int :29; + } bits; + unsigned int u32all; +} acp_dma_cntl_0_t; + +typedef union acp_dma_ch_sts { + struct { + unsigned int dmachrunsts:8; + unsigned int :24; + } bits; + unsigned int u32all; +} acp_dma_ch_sts_t; + +typedef union acp_external_intr_enb { + struct { + unsigned int acpextintrenb:1; + unsigned int :31; + } bits; + unsigned int u32all; +} acp_external_intr_enb_t; + +typedef union acp_dsp0_intr_cntl { + struct { + unsigned int dmaiocmask:8; + unsigned int :8; + unsigned int wov_dma_intr_mask:1; + unsigned int :6; + unsigned int audio_buffer_int_mask:6; + unsigned int :3; + } bits; + unsigned int u32all; +} acp_dsp0_intr_cntl_t; + +typedef union acp_dsp0_intr_stat { + struct { + unsigned int dmaiocstat:8; + unsigned int :8; + unsigned int wov_dma_stat:1; + unsigned int :6; + unsigned int audio_buffer_int_stat:6; + unsigned int :3; + } bits; + unsigned int u32all; +} acp_dsp0_intr_stat_t; + +typedef union acp_dsp0_intr_cntl1 { + struct { + unsigned int acp_fusion_dsp_ext_timer1_timeoutmask :1; + unsigned int fusion_dsp_watchdog_timeoutmask :1; + unsigned int soundwire_mask :1; + unsigned int audio_buffer_int_mask :6; + unsigned int :23; + } bits; + unsigned int u32all; +} acp_dsp0_intr_cntl1_t; + +typedef union acp_dsp0_intr_stat1 { + struct { + unsigned int acp_fusion_dsp_timer1_timeoutstat :1; + unsigned int fusion_dsp_watchdog_timeoutstat :1; + unsigned int soundwire_stat :1; + unsigned int audio_buffer_int_stat :6; + unsigned int :23; + } bits; + unsigned int u32all; +} acp_dsp0_intr_stat1_t; + +typedef union acp_dsp_sw_intr_cntl { + struct { + unsigned int :2; + unsigned int dsp0_to_host_intr_mask:1; + unsigned int :29; + } bits; + unsigned int u32all; +} acp_dsp_sw_intr_cntl_t; + +typedef union acp_dsp_sw_intr_stat { + struct { + unsigned int host_to_dsp0_intr1_stat:1; + unsigned int host_to_dsp0_intr2_stat:1; + unsigned int dsp0_to_host_intr_stat:1; + unsigned int host_to_dsp0_intr3_stat:1; + unsigned int :28; + } bits; + unsigned int u32all; +} acp_dsp_sw_intr_stat_t; + +typedef union acp_sw_intr_trig { + struct { + unsigned int trig_host_to_dsp0_intr1:1; + unsigned int :1; + unsigned int trig_dsp0_to_host_intr:1; + unsigned int :29; + } bits; + unsigned int u32all; +} acp_sw_intr_trig_t; + +typedef union dsp_interrupt_routing_ctrl_0 { + struct { + unsigned int dma_intr_level:3; + unsigned int :18; + unsigned int watchdog_intr_level:3; + unsigned int az_sw_i2s_intr_level:3; + unsigned int sha_intr_level:3; + unsigned int :2; + } bits; + unsigned int u32all; +} dsp_interrupt_routing_ctrl_0_t; + +typedef union dsp_interrupt_routing_ctrl_1 { + struct { + unsigned int host_to_dsp_intr1_level:3; + unsigned int host_to_dsp_intr2_level:3; + unsigned int src_intr_level:3; + unsigned int mailbox_intr_level:3; + unsigned int error_intr_level:3; + unsigned int wov_intr_level:3; + unsigned int fusion_timer1_intr_level:3; + unsigned int fusion_watchdog_intr_level:3; + unsigned int p1_sw_i2s_intr_level:3; + unsigned int :5; + } bits; + unsigned int u32all; +} dsp_interrupt_routing_ctrl_1_t; + +typedef union acp_i2s_rx_ringbufaddr { + struct { + unsigned int i2s_rx_ringbufaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_i2s_rx_ringbufaddr_t; + +typedef union acp_i2s_rx_ringbufsize { + struct { + unsigned int i2s_rx_ringbufsize:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_i2s_rx_ringbufsize_t; + +typedef union acp_i2s_rx_linkpositioncntr { + struct { + unsigned int i2s_rx_linkpositioncntr:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_i2s_rx_linkpositioncntr_t; + +typedef union acp_i2s_rx_fifoaddr { + struct { + unsigned int i2s_rx_fifoaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_i2s_rx_fifoaddr_t; + +typedef union acp_i2s_rx_fifosize { + struct { + unsigned int i2s_rx_fifosize:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_i2s_rx_fifosize_t; + +typedef union acp_i2s_rx_dma_size { + struct { + unsigned int i2s_rx_dma_size:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_i2s_rx_dma_size_t; + +typedef union acp_i2s_rx_linearpositioncntr_high { + struct { + unsigned int i2s_rx_linearpositioncntr_high:32; + } bits; + unsigned int u32all; +} acp_i2s_rx_linearpositioncntr_high_t; + +typedef union acp_i2s_rx_linearpositioncntr_low { + struct { + unsigned int i2s_rx_linearpositioncntr_low:32; + } bits; + unsigned int u32all; +} acp_i2s_rx_linearpositioncntr_low_t; + +typedef union acp_i2s_rx_watermark_size { + struct { + unsigned int i2s_rx_intr_watermark_size:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_i2s_rx_intr_watermark_size_t; + +typedef union acp_i2s_tx_ringbufaddr { + struct { + unsigned int i2s_tx_ringbufaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_i2s_tx_ringbufaddr_t; + +typedef union acp_i2s_tx_ringbufsize { + struct { + unsigned int i2s_tx_ringbufsize:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_i2s_tx_ringbufsize_t; + +typedef union acp_i2s_tx_linkpositioncntr { + struct { + unsigned int i2s_tx_linkpositioncntr:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_i2s_tx_linkpositioncntr_t; + +typedef union acp_i2s_tx_fifoaddr { + struct { + unsigned int i2s_tx_fifoaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_i2s_tx_fifoaddr_t; + +typedef union acp_i2s_tx_fifosize { + struct { + unsigned int i2s_tx_fifosize:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_i2s_tx_fifosize_t; + +typedef union acp_i2s_tx_dma_size { + struct { + unsigned int i2s_tx_dma_size:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_i2s_tx_dma_size_t; + +typedef union acp_i2s_tx_linearpositioncntr_high { + struct { + unsigned int i2s_tx_linearpositioncntr_high:32; + } bits; + unsigned int u32all; +} acp_i2s_tx_linearpositioncntr_hight_t; + +typedef union acp_i2s_tx_linearpositioncntr_low { + struct { + unsigned int i2s_tx_linearpositioncntr_low:32; + } bits; + unsigned int u32all; +} acp_i2s_tx_linearpositioncntr_low_t; + +typedef union acp_i2s_tx_intr_watermark_size { + struct { + unsigned int i2s_tx_intr_watermark_size:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_i2s_tx_intr_watermark_size_t; + +typedef union acp_bt_rx_ringbufaddr { + struct { + unsigned int bt_rx_ringbufaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_bt_rx_ringbufaddr_t; + +typedef union acp_bt_rx_ringbufsize { + struct { + unsigned int bt_rx_ringbufsize:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_bt_rx_ringbufsize_t; + +typedef union acp_bt_rx_linkpositioncntr { + struct { + unsigned int bt_rx_linkpositioncntr:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_bt_rx_linkpositioncntr_t; + +typedef union acp_bt_rx_fifoaddr { + struct { + unsigned int bt_rx_fifoaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_bt_rx_fifoaddr_t; + +typedef union acp_bt_rx_fifosize { + struct { + unsigned int bt_rx_fifosize:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_bt_rx_fifosize_t; + +typedef union acp_bt_rx_dma_size { + struct { + unsigned int bt_rx_dma_size:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_bt_rx_dma_size_t; + +typedef union acp_bt_rx_linearpositioncntr_high { + struct { + unsigned int bt_rx_linearpositioncntr_high:32; + } bits; + unsigned int u32all; +} acp_bt_rx_linearpositioncntr_high_t; + +typedef union acp_bt_rx_linearpositioncntr_low { + struct { + unsigned int bt_rx_linearpositioncntr_low:32; + } bits; + unsigned int u32all; +} acp_bt_rx_linearpositioncntr_low_t; + +typedef union acp_bt_rx_intr_watermark_size { + struct { + unsigned int bt_rx_intr_watermark_size:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_bt_rx_intr_watermark_size_t; + +typedef union acp_bt_tx_ringbufaddr { + struct { + unsigned int bt_tx_ringbufaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_bt_tx_ringbufaddr_t; + +typedef union acp_bt_tx_ringbufsize { + struct { + unsigned int bt_tx_ringbufsize:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_bt_tx_ringbufsize_t; + +typedef union acp_bt_tx_linkpositiontcntr { + struct { + unsigned int bt_tx_linkpositioncntr:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_bt_tx_linkpositiontcntr_t; + +typedef union acp_bt_tx_fifoaddr { + struct { + unsigned int bt_tx_fifoaddr:27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_bt_tx_fifoaddr_t; + +typedef union acp_bt_tx_fifosize { + struct { + unsigned int bt_tx_fifosize:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_bt_tx_fifosize_t; + +typedef union acp_bt_tx_dmasize { + struct { + unsigned int bt_tx_dma_size:13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_bt_tx_dmasize_t; + +typedef union acp_bt_tx_linearpositioncntr_high { + struct { + unsigned int bt_tx_linearpositioncntr_high:32; + } bits; + unsigned int u32all; +} acp_bt_tx_linearpositioncntr_high_t; + +typedef union acp_bt_tx_linearpositioncntr_low { + struct { + unsigned int bt_tx_linearpositioncntr_low:32; + } bits; + unsigned int u32all; +} acp_bt_tx_linearpositioncntr_low_t; + +typedef union acp_bt_tx_intr_watermark_size { + struct { + unsigned int bt_tx_intr_watermark_size:26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_bt_tx_intr_watermark_size_t; + +typedef union acp_i2stdm_ier { + struct { + unsigned int i2stdm_ien:1; + unsigned int :31; + } bits; + unsigned int u32all; +} acp_i2stdm_ier_t; + +typedef union acp_i2stdm_irer { + struct { + unsigned int i2stdm_rx_en:1; + unsigned int i2stdm_rx_protocol_mode:1; + unsigned int i2stdm_rx_data_path_mode:1; + unsigned int i2stdm_rx_samplen:3; + unsigned int i2stdm_rx_status:1; + unsigned int :25; + } bits; + unsigned int u32all; +} acp_i2stdm_irer_t; + +typedef union acp_i2stdm_iter { + struct { + unsigned int i2stdm_txen:1; + unsigned int i2stdm_tx_protocol_mode:1; + unsigned int i2stdm_tx_data_path_mode:1; + unsigned int i2stdm_tx_samp_len:3; + unsigned int i2stdm_tx_status:1; + unsigned int :25; + } bits; + unsigned int u32all; +} acp_i2stdm_iter_t; + +typedef union acp_bttdm_ier { + struct { + unsigned int bttdm_ien:1; + unsigned int :31; + } bits; + unsigned int u32all; +} acp_bttdm_ier_t; + +typedef union acp_bttdm_irer { + struct { + unsigned int bttdm_rx_en:1; + unsigned int bttdm_rx_protocol_mode:1; + unsigned int bttdm_rx_data_path_mode:1; + unsigned int bttdm_rx_samplen:3; + unsigned int bttdm_rx_status:1; + unsigned int :25; + } bits; + unsigned int u32all; +} acp_bttdm_irer_t; + +typedef union acp_bttdm_iter { + struct { + unsigned int bttdm_txen :1; + unsigned int bttdm_tx_protocol_mode :1; + unsigned int bttdm_tx_data_path_mode :1; + unsigned int bttdm_tx_samp_len :3; + unsigned int bttdm_tx_status :1; + unsigned int :25; + } bits; + unsigned int u32all; +} acp_bttdm_iter_t; + +typedef union acp_wov_pdm_dma_enable { + struct { + unsigned int pdm_dma_en :1; + unsigned int pdm_dma_en_status :1; + unsigned int :30; + } bits; +unsigned int u32all; +} acp_wov_pdm_dma_enable_t; + +typedef union acp_wov_rx_ringbufaddr { + struct { + unsigned int rx_ringbufaddr :27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_wov_rx_ringbufaddr_t; + +typedef union acp_wov_rx_ringbufsize { + struct { + unsigned int rx_ringbufsize :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_wov_rx_ringbufsize_t; + +typedef union acp_wov_rx_intr_watermark_size { + struct { + unsigned int rx_intr_watermark_size :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_wov_rx_intr_watermark_size_t; + +typedef union acp_wov_pdm_no_of_channels { + struct { + unsigned int pdm_no_of_channels :2; + unsigned int :30; + } bits; + unsigned int u32all; +} acp_wov_pdm_no_of_channels_t; + +typedef union acp_wov_pdm_decimation_factor { + struct { + unsigned int pdm_decimation_factor :2; + unsigned int :30; + } bits; + unsigned int u32all; +} acp_wov_pdm_decimation_factor_t; + +typedef union acp_wov_misc_ctrl { + struct { + unsigned int :3; + unsigned int pcm_data_shift_ctrl :2; + unsigned int :27; + } bits; + unsigned int u32all; +} acp_wov_misc_ctrl_t; + +typedef union acp_wov_clk_ctrl { + struct { + unsigned int brm_clk_ctrl :4; + unsigned int pdm_vad_clkdiv :2; + unsigned int :26; + } bits; + unsigned int u32all; +} acp_wov_clk_ctrl_t; + +typedef union acp_srbm_cycle_sts { + struct { + unsigned int srbm_clients_sts :1; + unsigned int :7; + } bits; + unsigned int u32all; +} acp_srbm_cycle_sts_t; + +typedef union acp_hs_rx_ringbufaddr { + struct { + unsigned int hs_rx_ringbufaddr :32; + } bits; + unsigned int u32all; +} acp_hs_rx_ringbufaddr_t; + +typedef union acp_hs_rx_ringbufsize { + struct { + unsigned int hs_rx_ringbufsize :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_hs_rx_ringbufsize_t; + +typedef union acp_hs_rx_linkpositioncntr { + struct { + unsigned int hs_rx_linkpositioncntr :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_hs_rx_linkpositioncntr_t; + +typedef union acp_hs_rx_fifoaddr { + struct { + unsigned int hs_rx_fifoaddr :27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_hs_rx_fifoaddr_t; + +typedef union acp_hs_rx_fifosize { + struct { + unsigned int hs_rx_fifosize :13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_hs_rx_fifosize_t; + +typedef union acp_hs_rx_dma_size { + struct { + unsigned int hs_rx_dma_size :13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_hs_rx_dma_size_t; + +typedef union acp_hs_rx_linearpositioncntr_high { + struct { + unsigned int hs_rx_linearpositioncntr_high :32; + } bits; + unsigned int u32all; +} acp_hs_rx_linearpositioncntr_high_t; + +typedef union acp_hs_rx_linearpositioncntr_low { + struct { + unsigned int hs_rx_linearpositioncntr_low :32; + } bits; + unsigned int u32all; +} acp_hs_rx_linearpositioncntr_low_t; + +typedef union acp_hs_rx_intr_watermark_size { + struct { + unsigned int hs_rx_intr_watermark_size :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_hs_rx_intr_watermark_size_t; + +typedef union acp_hs_tx_ringbufaddr { + struct { + unsigned int hs_tx_ringbufaddr :32; + } bits; + unsigned int u32all; +} acp_hs_tx_ringbufaddr_t; + +typedef union acp_hs_tx_ringbufsize { + struct { + unsigned int hs_tx_ringbufsize :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_hs_tx_ringbufsize_t; + +typedef union acp_hs_tx_linkpositioncntr { + struct { + unsigned int hs_tx_linkpositioncntr :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_hs_tx_linkpositioncntr_t; + +typedef union acp_hs_tx_fifoaddr { + struct { + unsigned int hs_tx_fifoaddr :27; + unsigned int :5; + } bits; + unsigned int u32all; +} acp_hs_tx_fifoaddr_t; + +typedef union acp_hs_tx_fifosize { + struct { + unsigned int hs_tx_fifosize :13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_hs_tx_fifosize_t; + +typedef union acp_hs_tx_dma_size { + struct { + unsigned int hs_tx_dma_size :13; + unsigned int :19; + } bits; + unsigned int u32all; +} acp_hs_tx_dma_size_t; + +typedef union acp_hs_tx_linearpositioncntr_high { + struct { + unsigned int hs_tx_linearpositioncntr_high :32; + } bits; + unsigned int u32all; +} acp_hs_tx_linearpositioncntr_high_t; + +typedef union acp_hs_tx_linearpositioncntr_low { + struct { + unsigned int hs_tx_linearpositioncntr_low :32; + } bits; + unsigned int u32all; +} acp_hs_tx_linearpositioncntr_low_t; + +typedef union acp_hs_tx_intr_watermark_size { + struct { + unsigned int hs_tx_intr_watermark_size :26; + unsigned int :6; + } bits; + unsigned int u32all; +} acp_hs_tx_intr_watermark_size_t; + +typedef union acp_i2stdm_rxfrmt { + struct { + unsigned int i2stdm_frame_len :9; + unsigned int :6; + unsigned int i2stdm_num_slots :3; + unsigned int i2stdm_slot_len :5; + unsigned int :9; + } bits; + unsigned int u32all; +} acp_i2stdm_rxfrmt_t; + +typedef union acp_i2stdm_txfrmt { + struct { + unsigned int i2stdm_frame_len :9; + unsigned int :6; + unsigned int i2stdm_num_slots :3; + unsigned int i2stdm_slot_len :5; + unsigned int :9; + } bits; + unsigned int u32all; +} acp_i2stdm_txfrmt_t; + +typedef union acp_hstdm_ier { + struct { + unsigned int hstdm_ien :1; + unsigned int :31; + } bits; + unsigned int u32all; +} acp_hstdm_ier_t; + +typedef union acp_hstdm_irer { + struct { + unsigned int hstdm_rx_en :1; + unsigned int hstdm_rx_protocol_mode :1; + unsigned int hstdm_rx_data_path_mode :1; + unsigned int hstdm_rx_samplen :3; + unsigned int hstdm_rx_status :1; + unsigned int :25; + } bits; + unsigned int u32all; +} acp_hstdm_irer_t; + +typedef union acp_hstdm_rxfrmt { + struct { + unsigned int hstdm_frame_len :9; + unsigned int :6; + unsigned int hstdm_num_slots :3; + unsigned int hstdm_slot_len :5; + unsigned int :9; + } bits; + unsigned int u32all; +} acp_hstdm_rxfrmt_t; + +typedef union acp_hstdm_iter { + struct { + unsigned int hstdm_txen :1; + unsigned int hstdm_tx_protocol_mode :1; + unsigned int hstdm_tx_data_path_mode :1; + unsigned int hstdm_tx_samp_len :3; + unsigned int hstdm_tx_status :1; + unsigned int :25; + } bits; + unsigned int u32all; +} acp_hstdm_iter_t; + +typedef union acp_hstdm_txfrmt { + struct { + unsigned int hstdm_frame_len :9; + unsigned int :6; + unsigned int hstdm_num_slots :3; + unsigned int hstdm_slot_len :5; + unsigned int :9; + } bits; + unsigned int u32all; +} acp_hstdm_txfrmt_t; + +typedef union acp_clkmux_sel { + struct { + unsigned int acp_clkmux_sel : 3; + unsigned int : 13; + unsigned int acp_clkmux_div_value : 16; + } bits; + unsigned int u32all; +} acp_clkmux_sel_t; + +typedef union acp_i2stdm_mstrclkgen { + struct { + unsigned int i2stdm_master_mode : 1; + unsigned int i2stdm_format_mode : 1; + unsigned int i2stdm_lrclk_div_val : 11; + unsigned int i2stdm_bclk_div_val : 11; + unsigned int : 8; + } bits; + unsigned int u32all; +} acp_i2stdm_mstrclkgen_t; + +typedef union clk5_clk1_dfs_cntl_u { + struct { + unsigned int CLK1_DIVIDER : 7; + unsigned int : 25; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk1_dfs_cntl_u_t; + +typedef union clk5_clk1_dfs_status_u { + struct { + unsigned int : 16; + unsigned int CLK1_DFS_DIV_REQ_IDLE : 1; + unsigned int : 2; + unsigned int RO_CLK1_DFS_STATE_IDLE : 1; + unsigned int CLK1_CURRENT_DFS_DID : 7; + unsigned int : 5; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk1_dfs_status_u_t; + +typedef union clk5_clk1_bypass_cntl_u { + struct { + unsigned int CLK1_BYPASS_SEL : 3; + unsigned int : 13; + unsigned int CLK1_BYPASS_DIV : 4; + unsigned int : 12; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk1_bypass_cntl_u_t; + +typedef union clk5_clk_fsm_status_u { + struct { + unsigned int AUTOLAUCH_FSM_FULL_SPEED_IDLE : 1; + unsigned int : 3; + unsigned int AUTOLAUCH_FSM_BYPASS_IDLE : 1; + unsigned int : 3; + unsigned int RO_FSM_PLL_STATUS_STARTED : 1; + unsigned int : 3; + unsigned int RO_FSM_PLL_STATUS_STOPPED : 1; + unsigned int : 3; + unsigned int RO_EARLY_FSM_DONE : 1; + unsigned int : 3; + unsigned int RO_DFS_GAP_ACTIVE : 1; + unsigned int : 3; + unsigned int RO_DID_FSM_IDLE : 1; + unsigned int : 7; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk_fsm_status_t; + +typedef union clk5_clk_pll_req_u { + struct { + unsigned int fbmult_int : 9; + unsigned int : 3; + unsigned int pllspinediv : 4; + unsigned int fbmult_frac : 16; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk_pll_req_u_t; + +typedef union clk5_clk_pll_refclk_startup { + struct { + unsigned int main_pll_ref_clk_rate_startup : 8; + unsigned int main_pll_cfg_4_startup : 8; + unsigned int main_pll_ref_clk_div_startup : 2; + unsigned int main_pll_cfg_3_startup : 10; + unsigned int : 1; + unsigned int main_pll_refclk_src_mux0_startup : 1; + unsigned int main_pll_refclk_src_mux1_startup : 1; + unsigned int : 1; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk_pll_refclk_startup_t; + +typedef union clk5_spll_field_2 { + struct{ + unsigned int : 3; + unsigned int spll_fbdiv_mask_en : 1; + unsigned int spll_fracn_en : 1; + unsigned int spll_freq_jump_en : 1; + unsigned int : 25; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_2_t; + +typedef union clk5_clk_dfsbypass_cntl { + struct { + unsigned int enter_dfs_bypass_0 : 1; + unsigned int enter_dfs_bypass_1 : 1; + unsigned int : 14; + unsigned int exit_dfs_bypass_0 : 1; + unsigned int exit_dfs_bypass_1 : 1; + unsigned int : 14; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk_dfsbypass_cntl_t; + +typedef union clk5_clk_pll_pwr_req { + struct { + unsigned int PLL_AUTO_START_REQ : 1; + unsigned int : 3; + unsigned int PLL_AUTO_STOP_REQ : 1; + unsigned int : 3; + unsigned int PLL_AUTO_STOP_NOCLK_REQ : 1; + unsigned int : 3; + unsigned int PLL_AUTO_STOP_REFBYPCLK_REQ : 1; + unsigned int : 3; + unsigned int PLL_FORCE_RESET_HIGH : 1; + unsigned int : 15; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_clk_pll_pwr_req_t; + +typedef union clk5_spll_fuse_1 { + struct { + unsigned int : 8; + unsigned int spll_gp_coarse_exp : 4; + unsigned int spll_gp_coarse_mant : 4; + unsigned int : 4; + unsigned int spll_gi_coarse_exp : 4; + unsigned int : 1; + unsigned int spll_gi_coarse_mant : 2; + unsigned int : 5; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_fuse_1_t; + +typedef union clk5_spll_fuse_2 { + struct { + unsigned int spll_tdc_resolution : 8; + unsigned int spll_freq_offset_exp : 4; + unsigned int spll_freq_offset_mant : 5; + unsigned int : 15; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_fuse_2_t; + +typedef union clk5_spll_field_9 { + struct { + unsigned int : 16; + unsigned int spll_dpll_cfg_3 : 10; + unsigned int spll_fll_mode : 1; + unsigned int : 5; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_9_t; + +typedef union clk5_spll_field_6nm { + struct { + unsigned int spll_dpll_cfg_4 : 8; + unsigned int spll_reg_tim_exp : 3; + unsigned int spll_reg_tim_mant : 1; + unsigned int spll_ref_tim_exp : 3; + unsigned int spll_ref_tim_mant : 1; + unsigned int spll_vco_pre_div : 2; + unsigned int : 14; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_6nm_t; + +typedef union clk5_spll_field_7 { + struct { + unsigned int : 7; + unsigned int spll_pllout_sel : 1; + unsigned int spll_pllout_req : 1; + unsigned int spll_pllout_state : 2; + unsigned int spll_postdiv_ovrd : 4; + unsigned int spll_postdiv_pllout_ovrd : 4; + unsigned int spll_postdiv_sync_enable : 1; + unsigned int : 1; + unsigned int spll_pwr_state : 2; + unsigned int : 1; + unsigned int spll_refclk_rate : 8; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_7_t; + +typedef union clk5_spll_field_4 { + struct { + unsigned int spll_fcw0_frac_ovrd : 16; + unsigned int pll_out_sel : 1; + unsigned int : 3; + unsigned int pll_pwr_dn_state : 2; + unsigned int : 2; + unsigned int spll_refclk_div : 2; + unsigned int : 6; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_4_t; + +typedef union clk5_spll_field_5nm_bus_ctrl { + struct { + unsigned int bus_spll_async_mode :1; + unsigned int bus_spll_apb_mode :1; + unsigned int bus_spll_addr :8; + unsigned int bus_spll_byte_en :4; + unsigned int bus_spll_rdtr :1; + unsigned int bus_spll_resetb :1; + unsigned int bus_spll_sel :1; + unsigned int bus_spll_wrtr :1; + unsigned int :14; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_5nm_bus_ctrl_t; + +typedef union clk5_spll_field_5nm_bus_wdata { + struct { + unsigned int bus_spll_wr_data; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_5nm_bus_wdata_t; + +typedef union clk5_rootrefclk_mux_1 { + struct { + unsigned int ROOTREFCLK_MUX_1 : 1; + unsigned int reserved : 31; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_rootrefclk_mux_1_t; + +typedef union clk5_spll_field_5nm_bus_status { + struct { + unsigned int spll_bus_error :1; + unsigned int spll_bus_rd_valid :1; + unsigned int spll_bus_wr_ack :1; + unsigned int :29; + } bitfields, bits; + uint32_t u32all; + int32_t i32all; + float f32all; +} clk5_spll_field_5nm_bus_status_t; + +#endif diff --git a/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h b/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h new file mode 100644 index 000000000000..59127dfe81b7 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h @@ -0,0 +1,109 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 AMD.All rights reserved. + * + * Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + * SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + */ +#ifdef __SOF_DRIVERS_INTERRUPT_H__ + +#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__ +#define __PLATFORM_DRIVERS_INTERRUPT_H__ + +#include <rtos/bit.h> +#include <sof/lib/cpu.h> +#include <sof/lib/memory.h> + +#define PLATFORM_IRQ_HW_NUM 9 + +#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM + +#define PLATFORM_IRQ_CHILDREN 0 + +/* IRQ numbers - wrt Tensilica DSP */ +#define IRQ_NUM_SOFTWARE0 1 /* level 1 */ + +#define IRQ_NUM_TIMER0 0 /* level 1 */ + +#define IRQ_NUM_EXT_LEVEL3 3 /* level 1 */ + +#define IRQ_NUM_TIMER1 6 /* level 2 */ + +#define IRQ_NUM_EXT_LEVEL4 4 /* level 2 */ + +#define IRQ_NUM_EXT_LEVEL5 5 /* level 3 */ + +/* IRQ Masks */ +#define IRQ_MASK_SOFTWARE0 BIT(IRQ_NUM_SOFTWARE0) + +#define IRQ_MASK_TIMER0 BIT(IRQ_NUM_TIMER0) + +#define IRQ_MASK_TIMER1 BIT(IRQ_NUM_TIMER1) + +#define IRQ_MASK_EXT_LEVEL3 BIT(IRQ_NUM_EXT_LEVEL3) + +#define IRQ_MASK_EXT_LEVEL4 BIT(IRQ_NUM_EXT_LEVEL4) + +#define IRQ_MASK_EXT_LEVEL5 BIT(IRQ_NUM_EXT_LEVEL5) + +#define HOST_TO_DSP_INTR 0x1 + +#define _XTSTR(x) # x + +#define XTSTR(x) _XTSTR(x) + +/* Enabling flag */ +#define INTERRUPT_ENABLE 1 + +/* Clearing flag */ +#define INTERRUPT_CLEAR 0 + +/* Disable flag */ +#define INTERRUPT_DISABLE 0 + +/* brief Tensilica Interrupt Levels. */ +typedef enum { + acp_interrupt_level_3 = 0, + + acp_interrupt_level_4, + + acp_interrupt_level_5, + + acp_interrupt_level_nmi, + + acp_interrupt_level_max +} artos_interrupt_levels_t; + +/* brief Tensilica timer control */ +typedef enum { + acp_timer_cntl_disable = 0, + + acp_timer_cntl_oneshot, + + acp_timer_cntl_periodic, + + acp_timer_cntl_max +} artos_timer_control_t; + +/* Disable Host to DSP interrupt */ +void acp_dsp_sw_intr_disable(void); + +void acp_intr_route(void); + +void acp_dsp_to_host_intr_trig(void); + +void acp_ack_intr_from_host(void); + +void acp_dsp_sw_intr_enable(void); + +void acp_intr_enable(void); + +void acp_intr_disable(void); + +#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */ + +#else + +#error "This file shouldn't be included from outside of sof/drivers/interrupt.h" + +#endif /* __SOF_DRIVERS_INTERRUPT_H__ */ diff --git a/src/platform/amd/acp_6_3/include/platform/fw_scratch_mem.h b/src/platform/amd/acp_6_3/include/platform/fw_scratch_mem.h new file mode 100644 index 000000000000..9f77a7d33383 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/platform/fw_scratch_mem.h @@ -0,0 +1,120 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 AMD. All rights reserved. + * + * Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + * SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + */ +#ifndef __EXT_SCRATCH_MEM_H__ +#define __EXT_SCRATCH_MEM_H__ + +#include <sof/lib/mailbox.h> + +/* MAX number of DMA descriptors */ +#define MAX_NUM_DMA_DESC_DSCR 64 +#define SCRATCH_REG_OFFSET 0x1250000 +#define ACP_SRAM 0x03800000 +typedef struct acp_atu_grp_pte { + uint32_t low_part; + uint32_t high_part; +} __attribute__((packed, aligned(4))) acp_atu_grp_pte_t; + +typedef union acp_cfg_dma_trns_cnt { + struct{ + uint32_t trns_cnt : 19; + uint32_t reserved : 12; + uint32_t ioc : 1; + } bits; + unsigned int u32all; +} __attribute__((packed, aligned(4))) acp_cfg_dma_trns_cnt_t; + +typedef struct acp_config_dma_descriptor { + uint32_t src_addr; + uint32_t dest_addr; + acp_cfg_dma_trns_cnt_t trns_cnt; + uint32_t reserved; +} __attribute__((packed, aligned(4))) acp_cfg_dma_descriptor_t; + +typedef struct acp_config_dma_misc { + uint32_t channelstatus; + uint32_t channel; + uint32_t flag; +} __attribute__((packed, aligned(4))) acp_cfg_dma_misc_t; + +typedef struct acp_scratch_memory_config { + /* ACP out box buffer */ + uint8_t acp_outbox_buffer[MAILBOX_DSPBOX_SIZE]; + + /* ACP in box buffer */ + uint8_t acp_inbox_buffer[MAILBOX_HOSTBOX_SIZE]; + + /* ACP debug box buffer */ + uint8_t acp_debug_buffer[MAILBOX_DEBUG_SIZE]; + + /* ACP exception box buffer */ + uint8_t acp_except_buffer[MAILBOX_EXCEPTION_SIZE]; + + /* ACP stream buffer */ + uint8_t acp_stream_buffer[MAILBOX_STREAM_SIZE]; + + /* ACP trace buffer */ + uint8_t acp_trace_buffer[MAILBOX_TRACE_SIZE]; + + /* Host msg write flag */ + uint32_t acp_host_msg_write; + + /* Host ack flag */ + uint32_t acp_host_ack_write; + + /* Dsp msg write flag */ + uint32_t acp_dsp_msg_write; + + /* Dsp ack flag */ + uint32_t acp_dsp_ack_write; + + /* ACP pte1 table */ + acp_atu_grp_pte_t acp_atugrp1_pte[16]; + + /* ACP pte2 table */ + acp_atu_grp_pte_t acp_atugrp2_pte[16]; + + /* ACP pte3 table */ + acp_atu_grp_pte_t acp_atugrp3_pte[16]; + + /* ACP pte4 table */ + acp_atu_grp_pte_t acp_atugrp4_pte[16]; + + /* ACP pte5 table */ + acp_atu_grp_pte_t acp_atugrp5_pte[16]; + + /* ACP pte6 table */ + acp_atu_grp_pte_t acp_atugrp6_pte[16]; + + /* ACP pte7 table */ + acp_atu_grp_pte_t acp_atugrp7_pte[16]; + + /* ACP pte8 table */ + acp_atu_grp_pte_t acp_atugrp8_pte[16]; + + /* ACP DMA Descriptor */ + acp_cfg_dma_descriptor_t acp_cfg_dma_descriptor[MAX_NUM_DMA_DESC_DSCR]; + + /* Stream physical offset */ + uint32_t phy_offset[8]; + + /* Stream system memory size */ + uint32_t syst_buff_size[8]; + + /* Fifo buffers are not part of scratch memory on ACP_6_3 */ + /* Added fifo members to align with Driver structure */ + /* ACP transmit fifo buffer */ + uint8_t acp_transmit_fifo_buffer[256] __attribute__((aligned(128))); + + /* ACP receive fifo buffer */ + uint8_t acp_receive_fifo_buffer[256] __attribute__((aligned(128))); + + uint32_t reserve[]; +} __attribute__((packed, aligned(4))) acp_scratch_mem_config_t; + +#endif /* __EXT_SCRATCH_MEM_H__ */ + diff --git a/src/platform/amd/acp_6_3/include/platform/lib/memory.h b/src/platform/amd/acp_6_3/include/platform/lib/memory.h new file mode 100644 index 000000000000..2597b0858715 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/platform/lib/memory.h @@ -0,0 +1,185 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 AMD.All rights reserved. + * + * Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + * SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + */ +#ifdef __SOF_LIB_MEMORY_H__ + +#ifndef __PLATFORM_LIB_MEMORY_H__ +#define __PLATFORM_LIB_MEMORY_H__ + +#include <rtos/cache.h> +#include <platform/chip_offset_byte.h> + +/* data cache line alignment */ +#define PLATFORM_DCACHE_ALIGN 128 + +/* physical DSP addresses */ +#define IRAM_BASE 0x7F000000 +#define IRAM_SIZE 0x60000 + +#define DRAM0_BASE 0xE0000000 +#define DRAM0_SIZE 0x10000 +#define SRAM0_BASE 0x9FF00000 + +#define DRAM1_BASE 0xE0010000 +#define DRAM1_SIZE 0x10000 +#define SRAM1_BASE 0x60006000 +#define SRAM1_SIZE 0x27A000 + +#define DMA0_BASE PU_REGISTER_BASE +#define DMA0_SIZE 0x4 + +/* DAI DMA register base address */ +#define DAI_BASE (PU_REGISTER_BASE + ACP_I2S_RX_RINGBUFADDR) +#define DAI_BASE_REM (PU_REGISTER_BASE + ACP_P1_I2S_RX_RINGBUFADDR) +#define DAI_SIZE 0x4 +#define BT_TX_FIFO_OFFST (ACP_P1_BT_TX_FIFOADDR - ACP_P1_I2S_RX_RINGBUFADDR) +#define BT_RX_FIFO_OFFST (ACP_P1_BT_RX_FIFOADDR - ACP_P1_I2S_RX_RINGBUFADDR) + +#define HS_TX_FIFO_OFFST (ACP_P1_HS_TX_FIFOADDR - ACP_P1_I2S_RX_RINGBUFADDR) +#define HS_RX_FIFO_OFFST (ACP_P1_HS_TX_FIFOADDR - ACP_P1_I2S_RX_RINGBUFADDR) +#define SW0_AUDIO_TX_FIFO_OFFST (ACP_AUDIO_TX_FIFOADDR - ACP_AUDIO_RX_RINGBUFADDR) +#define SW0_AUDIO_RX_FIFO_OFFST (ACP_AUDIO_RX_FIFOADDR - ACP_AUDIO_RX_RINGBUFADDR) + +#define BT0_TX_FIFO_OFFST (ACP_BT_TX_FIFOADDR - ACP_AUDIO_RX_RINGBUFADDR) +#define BT0_RX_FIFO_OFFST (ACP_BT_RX_FIFOADDR - ACP_AUDIO_RX_RINGBUFADDR) + +#define HS0_TX_FIFO_OFFST (ACP_HS_TX_FIFOADDR - ACP_AUDIO_RX_RINGBUFADDR) +#define HS0_RX_FIFO_OFFST (ACP_HS_TX_FIFOADDR - ACP_AUDIO_RX_RINGBUFADDR) + +#define UUID_ENTRY_ELF_BASE 0x1FFFA000 +#define UUID_ENTRY_ELF_SIZE 0x6000 + +/* Log buffer base need to be updated properly, these are used in linker scripts */ +#define LOG_ENTRY_ELF_BASE 0x20000000 +#define LOG_ENTRY_ELF_SIZE 0x2000000 + +#define EXT_MANIFEST_ELF_BASE (LOG_ENTRY_ELF_BASE + LOG_ENTRY_ELF_SIZE) +#define EXT_MANIFEST_ELF_SIZE 0x2000000 + +/* Stack configuration */ +#define SOF_STACK_SIZE 0x1000 +#define SOF_STACK_TOTAL_SIZE SOF_STACK_SIZE +#define SOF_STACK_END (DRAM1_BASE + DRAM1_SIZE - SOF_STACK_SIZE) +#define SOF_STACK_BASE (SOF_STACK_END + SOF_STACK_SIZE) + +/* Mailbox configuration */ +#define SRAM_OUTBOX_BASE SRAM0_BASE +#define SRAM_OUTBOX_SIZE 0x400 +#define SRAM_OUTBOX_OFFSET 0 + +#define SRAM_INBOX_BASE (SRAM_OUTBOX_BASE + SRAM_OUTBOX_SIZE) +#define SRAM_INBOX_SIZE 0x400 +#define SRAM_INBOX_OFFSET SRAM_OUTBOX_SIZE + +#define SRAM_DEBUG_BASE (SRAM_INBOX_BASE + SRAM_INBOX_SIZE) +#define SRAM_DEBUG_SIZE 0x400 +#define SRAM_DEBUG_OFFSET (SRAM_INBOX_OFFSET + SRAM_INBOX_SIZE) + +#define SRAM_EXCEPT_BASE (SRAM_DEBUG_BASE + SRAM_DEBUG_SIZE) +#define SRAM_EXCEPT_SIZE 0x400 +#define SRAM_EXCEPT_OFFSET (SRAM_DEBUG_OFFSET + SRAM_DEBUG_SIZE) + +#define SRAM_STREAM_BASE (SRAM_EXCEPT_BASE + SRAM_EXCEPT_SIZE) +#define SRAM_STREAM_SIZE 0x400 +#define SRAM_STREAM_OFFSET (SRAM_EXCEPT_OFFSET + SRAM_EXCEPT_SIZE) + +#define SRAM_TRACE_BASE (SRAM_STREAM_BASE + SRAM_STREAM_SIZE) +#define SRAM_TRACE_SIZE 0x400 +#define SRAM_TRACE_OFFSET (SRAM_STREAM_OFFSET + SRAM_STREAM_SIZE) +#define SOF_MAILBOX_SIZE (SRAM_INBOX_SIZE + SRAM_OUTBOX_SIZE \ + + SRAM_DEBUG_SIZE + SRAM_EXCEPT_SIZE \ + + SRAM_STREAM_SIZE + SRAM_TRACE_SIZE) + +/* Heap section sizes for module pool */ +#define HEAP_RT_COUNT8 0 +#define HEAP_RT_COUNT16 192 +#define HEAP_RT_COUNT32 192 +#define HEAP_RT_COUNT64 128 +#define HEAP_RT_COUNT128 240 +#define HEAP_RT_COUNT256 128 +#define HEAP_RT_COUNT512 16 +#define HEAP_RT_COUNT1024 73 +#define HEAP_RT_COUNT2048 48 + +/* Heap section sizes for system runtime heap */ +#define HEAP_SYS_RT_COUNT64 720 +#define HEAP_SYS_RT_COUNT512 240 +#define HEAP_SYS_RT_COUNT1024 91 + +#define SIZE_OF_MEMORY_FOR_DATA_SECTION 0x60000 + +/* Heap configuration */ +#define HEAP_SYSTEM_BASE (SRAM1_BASE + SIZE_OF_MEMORY_FOR_DATA_SECTION) +#define HEAP_SYSTEM_SIZE 0x40000 +#define HEAP_SYSTEM_0_BASE HEAP_SYSTEM_BASE +#define HEAP_SYS_RUNTIME_BASE (HEAP_SYSTEM_BASE + HEAP_SYSTEM_SIZE) +#define HEAP_SYS_RUNTIME_SIZE (HEAP_SYS_RT_COUNT64 * 64 + HEAP_SYS_RT_COUNT512 * 512 + \ + HEAP_SYS_RT_COUNT1024 * 1024) + +#define HEAP_RUNTIME_BASE (HEAP_SYS_RUNTIME_BASE + HEAP_SYS_RUNTIME_SIZE) +#define HEAP_RUNTIME_SIZE \ + (HEAP_RT_COUNT8 * 8 + HEAP_RT_COUNT16 * 16 + \ + HEAP_RT_COUNT32 * 32 + HEAP_RT_COUNT64 * 64 + \ + HEAP_RT_COUNT128 * 128 + HEAP_RT_COUNT256 * 256 + \ + HEAP_RT_COUNT512 * 512 + HEAP_RT_COUNT1024 * 1024 + \ + HEAP_RT_COUNT2048 * 2048) + +#define HEAP_BUFFER_BASE (HEAP_RUNTIME_BASE + HEAP_RUNTIME_SIZE) +#define HEAP_BUFFER_SIZE (0x60000) +#define HEAP_BUFFER_BLOCK_SIZE 0x180 +#define HEAP_BUFFER_COUNT (HEAP_BUFFER_SIZE / HEAP_BUFFER_BLOCK_SIZE) + +#define PLATFORM_HEAP_SYSTEM 1 +#define PLATFORM_HEAP_SYSTEM_RUNTIME 1 +#define PLATFORM_HEAP_RUNTIME 1 +#define PLATFORM_HEAP_BUFFER 1 + +/* Vector and literal sizes - not in core-isa.h */ +#define SOF_MEM_VECT_LIT_SIZE 0x7 +#define SOF_MEM_VECT_TEXT_SIZE 0x37 +#define SOF_MEM_VECT_SIZE (SOF_MEM_VECT_TEXT_SIZE + SOF_MEM_VECT_LIT_SIZE) + +#define SOF_MEM_RESET_TEXT_SIZE 0x400 +#define SOF_MEM_RESET_LIT_SIZE 0x8 +#define SOF_MEM_VECBASE_LIT_SIZE 0x178 +#define SOF_MEM_WIN_TEXT_SIZE 0x178 + +#define SOF_MEM_RO_SIZE 0x8 + +#define uncache_to_cache(address) address +#define cache_to_uncache(address) address +#define is_uncached(address) 0 + +#define HEAP_BUF_ALIGNMENT PLATFORM_DCACHE_ALIGN + +/* brief EDF task's default stack size in bytes */ +#define PLATFORM_TASK_DEFAULT_STACK_SIZE 3072 + +#if !defined(__ASSEMBLER__) && !defined(LINKER) +struct sof; + +#define SHARED_DATA +void platform_init_memmap(struct sof *sof); + +static inline void *platform_shared_get(void *ptr, int bytes) +{ + return ptr; +} + +static inline void *platform_rfree_prepare(void *ptr) +{ + return ptr; +} +#endif + +#endif /* __PLATFORM_LIB_MEMORY_H__ */ + +#else + +#error "This file shouldn't be included from outside of sof/lib/memory.h" + +#endif /* __SOF_LIB_MEMORY_H__ */ diff --git a/src/platform/amd/acp_6_3/include/platform/platform.h b/src/platform/amd/acp_6_3/include/platform/platform.h new file mode 100644 index 000000000000..21d77802fda7 --- /dev/null +++ b/src/platform/amd/acp_6_3/include/platform/platform.h @@ -0,0 +1,101 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 AMD.All rights reserved. + * + * Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + * SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + */ +#ifdef __SOF_PLATFORM_H__ + +#ifndef __PLATFORM_PLATFORM_H__ +#define __PLATFORM_PLATFORM_H__ + +#if !defined(__ASSEMBLER__) && !defined(LINKER) + +#include <rtos/interrupt.h> +#include <rtos/clk.h> +#include <sof/lib/mailbox.h> +#include <stddef.h> +#include <stdint.h> +#include <platform/fw_scratch_mem.h> +#include <platform/chip_registers.h> + +struct ll_schedule_domain; +struct timer; + +#define PLATFORM_DEFAULT_CLOCK CLK_CPU(0) + +/* IPC Interrupt */ +#define PLATFORM_IPC_INTERRUPT IRQ_EXT_IPC_LEVEL_3 +#define PLATFORM_IPC_INTERRUPT_NAME NULL + +/* Host page size */ +#define HOST_PAGE_SIZE 65536 + +/* pipeline IRQ */ +#define PLATFORM_SCHEDULE_IRQ IRQ_NUM_SOFTWARE0 +#define PLATFORM_SCHEDULE_IRQ_NAME NULL + +/* Platform stream capabilities */ +#define PLATFORM_MAX_CHANNELS 8 +#define PLATFORM_MAX_STREAMS 5 + +/* local buffer size of DMA tracing */ +#define DMA_TRACE_LOCAL_SIZE (16384 + 8192) //8192 + +/* trace bytes flushed during panic */ +#define DMA_FLUSH_TRACE_SIZE (MAILBOX_TRACE_SIZE >> 2) + +/* the interval of DMA trace copying */ +#define DMA_TRACE_PERIOD 500 //1000 //50000 + +/* + * the interval of reschedule DMA trace copying in special case like half + * fullness of local DMA trace buffer + */ +#define DMA_TRACE_RESCHEDULE_TIME 100 + +/* DSP default delay in cycles */ +#define PLATFORM_DEFAULT_DELAY 12 + +/* default dma trace channel */ +#define DMA_TRACE_CHANNEL 7 + +/* debug offset */ +#define ACP_SOF_FW_STATUS 0 + +/* Platform defined panic code */ +static inline void platform_panic(uint32_t p) +{ + acp_sw_intr_trig_t sw_intr_trig; + volatile acp_scratch_mem_config_t *pscratch_mem_cfg = + (volatile acp_scratch_mem_config_t *)(PU_SCRATCH_REG_BASE + SCRATCH_REG_OFFSET); + + pscratch_mem_cfg->acp_dsp_msg_write = p; + mailbox_sw_reg_write(ACP_SOF_FW_STATUS, p); + /* Read the Software Interrupt controller register and update */ + sw_intr_trig = (acp_sw_intr_trig_t)io_reg_read(PU_REGISTER_BASE + ACP_SW_INTR_TRIG); + /* Configures the trigger bit in ACP_DSP_SW_INTR_TRIG register */ + sw_intr_trig.bits.trig_dsp0_to_host_intr = INTERRUPT_ENABLE; + /* Write the Software Interrupt trigger register */ + io_reg_write((PU_REGISTER_BASE + ACP_SW_INTR_TRIG), sw_intr_trig.u32all); +} + +/* + * brief Platform specific CPU entering idle. + * May be power-optimized using platform specific capabilities. + * @param level Interrupt level. + */ +void platform_wait_for_interrupt(int level); + +extern intptr_t _module_init_start; +extern intptr_t _module_init_end; +#endif + +#endif /* __PLATFORM_PLATFORM_H__ */ + +#else + +#error "This file shouldn't be included from outside of sof/platform.h" + +#endif /* __SOF_PLATFORM_H__ */ diff --git a/src/platform/amd/acp_6_3/lib/CMakeLists.txt b/src/platform/amd/acp_6_3/lib/CMakeLists.txt new file mode 100644 index 000000000000..271a099cc6a9 --- /dev/null +++ b/src/platform/amd/acp_6_3/lib/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: BSD-3-Clause + +add_local_sources(sof + clk.c + dai.c + dma.c + memory.c +) diff --git a/src/platform/amd/acp_6_3/lib/clk.c b/src/platform/amd/acp_6_3/lib/clk.c new file mode 100644 index 000000000000..566a988df3ef --- /dev/null +++ b/src/platform/amd/acp_6_3/lib/clk.c @@ -0,0 +1,494 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 AMD.All rights reserved. +// +// Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> +// Maruthi Machani <maruthi.machani@amd.com> +// SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> +// + +#include <sof/common.h> +#include <rtos/clk.h> +#include <sof/lib/cpu.h> +#include <sof/lib/memory.h> +#include <sof/lib/notifier.h> +#include <rtos/sof.h> +#include <rtos/atomic.h> +#include <sof/audio/component.h> +#include <rtos/bit.h> +#include <sof/drivers/acp_dai_dma.h> +#include <rtos/interrupt.h> +#include <rtos/timer.h> +#include <rtos/alloc.h> +#include <rtos/clk.h> +#include <sof/lib/cpu.h> +#include <sof/lib/dma.h> +#include <sof/lib/io.h> +#include <sof/lib/pm_runtime.h> +#include <sof/lib/notifier.h> +#include <sof/platform.h> +#include <sof/schedule/schedule.h> +#include <rtos/spinlock.h> +#include <sof/math/numbers.h> +#include <sof/trace/trace.h> +#include <ipc/topology.h> +#include <user/trace.h> +#include <errno.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <platform/fw_scratch_mem.h> +#include <platform/chip_registers.h> + +/*b414df09-9e31-4c59-8657-7afc8deba70c*/ +DECLARE_SOF_UUID("acp-clk", acp_clk_uuid, 0xb414df09, 0x9e31, 0x4c59, + 0x86, 0x57, 0x7a, 0xfc, 0x8d, 0xeb, 0xa7, 0x0c); +DECLARE_TR_CTX(acp_clk_tr, SOF_UUID(acp_clk_uuid), LOG_LEVEL_INFO); + +const struct freq_table platform_cpu_freq[] = { + {600000000, 600000 }, +}; + +STATIC_ASSERT(ARRAY_SIZE(platform_cpu_freq) == NUM_CPU_FREQ, + invalid_number_of_cpu_frequencies); + +static SHARED_DATA struct clock_info platform_clocks_info[NUM_CLOCKS]; + +void audio_pll_power_off(void); +void audio_pll_power_on(void); +void clk_dfs_bypassexit(void); +void audio_pll_mode_switch(uint32_t mode, uint32_t fcw_int, uint32_t fcw_frac, uint32_t fcw_denom, + uint32_t pllspinediv); +void clk5_init_vco(void); +void acp_6_3_reg_wait(void); +void acp_6_3_get_boot_ref_clock(float *boot_ref_clk); + +typedef enum { + PLL_MODE_100MHZ_NORMAL, + PLL_MODE_48MHZ_NORMAL, + PLL_MODE_32KHZ_LPPM, + PLL_MODE_48MHZ_LPPM, + PLL_MODE_100MHZ_LPPM +} PLL_MODE; + +/* Enumeration for the Clock Types */ +typedef enum _acp_clock_type_ { + acp_aclk_clock, + acp_sclk_clock, + acp_clock_type_max, + acp_clock_type_force = 0xFF +} acp_clock_type_t; + +static int acp_reg_read_via_smn(uint32_t reg_offset, + uint32_t size) +{ + uint32_t reg_value; + uint32_t delay_cnt = 10000; + uint32_t smn_client_base_addr = (reg_offset >> 10); + uint32_t region_start_addr = (smn_client_base_addr << 10); + uint32_t apertureid = ((reg_offset >> 20) & 0xFFF); + acp_srbm_cycle_sts_t acp_srbm_cycle_sts; + + io_reg_write((PU_REGISTER_BASE + ACP_SRBM_CLIENT_CONFIG), apertureid); + io_reg_write((PU_REGISTER_BASE + ACP_SRBM_CLIENT_BASE_ADDR), smn_client_base_addr); + reg_value = (uint32_t)io_reg_read(PU_REGISTER_BASE + + (ACP_MASTER_REG_ACCESS_ADDRESS + reg_offset - region_start_addr + ACP_FIRST_REG_OFFSET)); + if (reg_value) + reg_value = 0; + acp_srbm_cycle_sts = (acp_srbm_cycle_sts_t)io_reg_read(PU_REGISTER_BASE + + ACP_SRBM_CYCLE_STS); + while (delay_cnt > 0) { + if (!acp_srbm_cycle_sts.bits.srbm_clients_sts) + return (uint32_t)io_reg_read(PU_REGISTER_BASE + ACP_SRBM_CLIENT_RDDATA); + acp_srbm_cycle_sts = (acp_srbm_cycle_sts_t)io_reg_read(PU_REGISTER_BASE + + ACP_SRBM_CYCLE_STS); + delay_cnt--; + } + return -1; +} + +static void acp_reg_write_via_smn(uint32_t reg_offset, + uint32_t value, uint32_t size) +{ + uint32_t delay_cnt = 10000; + uint32_t smn_client_base_addr = (reg_offset >> 10); + uint32_t region_start_addr = (smn_client_base_addr << 10); + uint32_t apertureid = ((reg_offset >> 20) & 0xFFF); + acp_srbm_cycle_sts_t acp_srbm_cycle_sts; + + io_reg_write((PU_REGISTER_BASE + ACP_SRBM_CLIENT_CONFIG), apertureid); + io_reg_write((PU_REGISTER_BASE + ACP_SRBM_CLIENT_BASE_ADDR), smn_client_base_addr); + io_reg_write((PU_REGISTER_BASE + + (ACP_MASTER_REG_ACCESS_ADDRESS + reg_offset - region_start_addr + + ACP_FIRST_REG_OFFSET)), + value); + acp_srbm_cycle_sts = + (acp_srbm_cycle_sts_t)io_reg_read(PU_REGISTER_BASE + ACP_SRBM_CYCLE_STS); + while (delay_cnt > 0) { + acp_srbm_cycle_sts = (acp_srbm_cycle_sts_t)io_reg_read(PU_REGISTER_BASE + + ACP_SRBM_CYCLE_STS); + if (!acp_srbm_cycle_sts.bits.srbm_clients_sts) + return; + delay_cnt--; + } +} + +void acp_6_3_reg_wait(void) +{ + int test_count = 0; + int val = 0; + + for (test_count = 0; test_count < 255; test_count++) { + val = acp_reg_read_via_smn(CLK5_CLK_FSM_STATUS, sizeof(int)); + val = val * 0; + } +} + +void acp_6_3_get_boot_ref_clock(float *boot_ref_clk) +{ + clk5_clk_pll_refclk_startup_t boot_ref_clk_startup; + clk5_clk_pll_req_u_t clk5_clk_pll_req; + clk5_spll_field_2_t clk5_spll_field; + uint32_t spinediv = 1; + float fract_part = 0.0f; + float final_refclk = 0.0f; + + boot_ref_clk_startup.u32all = + acp_reg_read_via_smn(CLK5_CLK_PLL_REFCLK_RATE_STARTUP, sizeof(int)); + + clk5_spll_field_9_t clk_spll_field_9; + + clk_spll_field_9.u32all = 0x0; + clk_spll_field_9.u32all = acp_reg_read_via_smn(CLK5_SPLL_FIELD_9, sizeof(int)); + + if (clk_spll_field_9.bitfields.spll_dpll_cfg_3 == 0x2) + final_refclk = ((32768.0f * 128.0f) / 1000000.0f); + else + final_refclk = (float)boot_ref_clk_startup.bitfields.main_pll_ref_clk_rate_startup; + + clk5_clk_pll_req.u32all = acp_reg_read_via_smn(CLK5_CLK_PLL_REQ, sizeof(int)); + clk5_spll_field.u32all = acp_reg_read_via_smn(CLK5_SPLL_FIELD_2, sizeof(int)); + + spinediv = (1 << clk5_clk_pll_req.bitfields.pllspinediv); + + if (clk5_spll_field.bitfields.spll_fracn_en == 1) + fract_part = (float)(clk5_clk_pll_req.bitfields.fbmult_frac / (float)65536.0f); + + *boot_ref_clk = (float)(((final_refclk) * (clk5_clk_pll_req.bitfields.fbmult_int + + fract_part)) / (float)spinediv); +} + +void acp_change_clock_notify(uint32_t clock_freq) +{ + volatile clk5_clk1_dfs_cntl_u_t dfs_cntl; + volatile clk5_clk1_bypass_cntl_u_t bypass_cntl; + volatile clk5_clk1_dfs_status_u_t dfs_status; + volatile uint32_t updated_clk; + float did = 0.0f; + float fraction_val = 0.0f; + uint32_t int_did_val = 0; + float boot_ref_clk; + acp_clock_type_t clock_type = acp_aclk_clock; + + acp_6_3_get_boot_ref_clock(&boot_ref_clk); + + tr_info(&acp_clk_tr, "acp_change_clock_notify clock_freq : %d clock_type : %d", + clock_freq, clock_type); + + fraction_val = (float)(clock_freq / (float)1000000.0f); + clock_freq = (clock_freq / 1000000); + if (acp_aclk_clock == clock_type) { + bypass_cntl.u32all = acp_reg_read_via_smn(CLK5_CLK1_BYPASS_CNTL, sizeof(int)); + dfs_cntl.u32all = acp_reg_read_via_smn(CLK5_CLK1_DFS_CNTL, sizeof(int)); + } else if (acp_sclk_clock == clock_type) { + bypass_cntl.u32all = acp_reg_read_via_smn(CLK5_CLK0_BYPASS_CNTL, sizeof(int)); + dfs_cntl.u32all = acp_reg_read_via_smn(CLK5_CLK0_DFS_CNTL, sizeof(int)); + } + + bypass_cntl.bitfields.CLK1_BYPASS_DIV = 0; + + if (clock_freq == 6 || clock_freq == 0) { + did = 128; + dfs_cntl.bitfields.CLK1_DIVIDER = 0x7F; + bypass_cntl.bitfields.CLK1_BYPASS_DIV = 0xF; + } else { + did = (float)(boot_ref_clk / (float)fraction_val); + tr_info(&acp_clk_tr, "acp_change_clock_notify CLK Divider : %d boot_ref_clk : %d\n", + (uint32_t)(did * 100), (uint32_t)boot_ref_clk); + + if (did > 62.0f) { + dfs_cntl.bitfields.CLK1_DIVIDER = 0x7F; + } else { + fraction_val = did - (uint8_t)(did); + did = did - fraction_val; + if (did <= 16.00f) + did = (did * 4.0f); + else if ((did > 16.0f) && (did <= 32.0f)) + did = ((did - 16.0f) * 2.0f + 64.0f); + else if ((did > 32.0f) && (did <= 62.0f)) + did = ((did - 32.0f) + 96.0f); + + int_did_val = (uint32_t)(fraction_val * 100.0f); + fraction_val = (float)(int_did_val / 100.0f); + + if (fraction_val == 0.0f) + dfs_cntl.bitfields.CLK1_DIVIDER = (uint8_t)(did); + else if (fraction_val <= 0.25f) + dfs_cntl.bitfields.CLK1_DIVIDER = (uint8_t)(did) + 1; + else if ((fraction_val > 0.25f) && (fraction_val <= 0.5f)) + dfs_cntl.bitfields.CLK1_DIVIDER = (uint8_t)(did) + 2; + else if ((fraction_val > 0.5f) && (fraction_val <= 0.75f)) + dfs_cntl.bitfields.CLK1_DIVIDER = (uint8_t)(did) + 3; + else if ((fraction_val > 0.75f)) + dfs_cntl.bitfields.CLK1_DIVIDER = (uint8_t)(did) + 4; + } + } + + if (acp_aclk_clock == clock_type) { + acp_reg_write_via_smn(CLK5_CLK1_BYPASS_CNTL, bypass_cntl.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_CLK1_DFS_CNTL, dfs_cntl.u32all, sizeof(int)); + dfs_status.u32all = acp_reg_read_via_smn(CLK5_CLK1_DFS_STATUS, sizeof(int)); + acp_6_3_reg_wait(); + + do { + dfs_status.u32all = acp_reg_read_via_smn(CLK5_CLK1_DFS_STATUS, sizeof(int)); + tr_info(&acp_clk_tr, "acp_change_clock_notify ACLK1 CLK1_DIVIDER : %d dfsstatus %d ", + dfs_cntl.u32all, dfs_status.u32all); + } while (dfs_status.bitfields.CLK1_DFS_DIV_REQ_IDLE == 0); + updated_clk = acp_reg_read_via_smn(CLK5_CLK1_CURRENT_CNT, sizeof(int)); + acp_6_3_reg_wait(); + + if (updated_clk < (clock_freq * 10)) { + dfs_cntl.bitfields.CLK1_DIVIDER -= 1; + dfs_status.u32all = 0; + acp_reg_write_via_smn(CLK5_CLK1_DFS_CNTL, dfs_cntl.u32all, sizeof(int)); + do { + dfs_status.u32all = + acp_reg_read_via_smn(CLK5_CLK1_DFS_STATUS, + sizeof(int)); + dfs_cntl.u32all = + acp_reg_read_via_smn(CLK5_CLK1_DFS_CNTL, + sizeof(int)); + tr_info(&acp_clk_tr, "acp_change_clock_notify ACLK2 CLK1_DIVIDER:%d dfsstatus %d ", + dfs_cntl.u32all, dfs_status.u32all); + } while (dfs_status.bitfields.CLK1_DFS_DIV_REQ_IDLE == 0); + } + updated_clk = acp_reg_read_via_smn(CLK5_CLK1_CURRENT_CNT, sizeof(int)); + } else if (acp_sclk_clock == clock_type) { + acp_reg_write_via_smn(CLK5_CLK0_BYPASS_CNTL, bypass_cntl.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_CLK0_DFS_CNTL, dfs_cntl.u32all, sizeof(int)); + dfs_status.u32all = acp_reg_read_via_smn(CLK5_CLK0_DFS_STATUS, sizeof(int)); + acp_6_3_reg_wait(); + + do { + dfs_status.u32all = acp_reg_read_via_smn(CLK5_CLK0_DFS_STATUS, sizeof(int)); + tr_info(&acp_clk_tr, "acp_change_clock_notify SCLK CLK1_DIVIDER: %d", + dfs_cntl.u32all); + } while (dfs_status.bitfields.CLK1_DFS_DIV_REQ_IDLE == 0); + + updated_clk = acp_reg_read_via_smn(CLK5_CLK0_CURRENT_CNT, sizeof(int)); + } + tr_info(&acp_clk_tr, + "clock_notify:CLK1_DIVIDER :%x boot_ref_clk : %d ClkReq : %d FinalClockValue: %d", + dfs_cntl.u32all, (uint32_t)boot_ref_clk, + clock_freq, updated_clk); +} + +void audio_pll_power_off(void) +{ + volatile clk5_clk_pll_pwr_req_t clk5_clk_pll_pwr_req; + volatile clk5_clk_fsm_status_t clk5_clk_fsm_status; + int count = 0; + + for (count = 0; count < 10; count++) { + clk5_clk_pll_pwr_req.u32all = + acp_reg_read_via_smn(CLK5_CLK_PLL_PWR_REQ, sizeof(int)); + clk5_clk_pll_pwr_req.bitfields.PLL_AUTO_STOP_REQ = 1; + + acp_reg_write_via_smn(CLK5_CLK_PLL_PWR_REQ, + clk5_clk_pll_pwr_req.u32all, sizeof(int)); + acp_6_3_reg_wait(); + + clk5_clk_fsm_status.u32all = acp_reg_read_via_smn(CLK5_CLK_FSM_STATUS, sizeof(int)); + + if (clk5_clk_fsm_status.bitfields.RO_FSM_PLL_STATUS_STOPPED == 1) + break; + } +} + +void audio_pll_power_on(void) +{ + volatile clk5_clk_pll_pwr_req_t clk5_clk_pll_pwr_req; + volatile clk5_clk_fsm_status_t clk5_clk_fsm_status; + int count = 0; + + for (count = 0; count < 10; count++) { + clk5_clk_pll_pwr_req.u32all = + acp_reg_read_via_smn(CLK5_CLK_PLL_PWR_REQ, sizeof(int)); + clk5_clk_pll_pwr_req.bitfields.PLL_AUTO_START_REQ = 1; + + acp_reg_write_via_smn(CLK5_CLK_PLL_PWR_REQ, + clk5_clk_pll_pwr_req.u32all, + sizeof(int)); + acp_6_3_reg_wait(); + + clk5_clk_fsm_status.u32all = acp_reg_read_via_smn(CLK5_CLK_FSM_STATUS, sizeof(int)); + if (clk5_clk_fsm_status.bitfields.RO_FSM_PLL_STATUS_STARTED == 1) + break; + acp_6_3_reg_wait(); + } +} + +void clk_dfs_bypassexit(void) +{ + volatile clk5_clk_dfsbypass_cntl_t clk5_clk_dfsbypass_cntl; + + clk5_clk_dfsbypass_cntl = (clk5_clk_dfsbypass_cntl_t)acp_reg_read_via_smn + (CLK5_CLK_DFSBYPASS_CONTROL, sizeof(int)); + + clk5_clk_dfsbypass_cntl.bitfields.exit_dfs_bypass_0 = 1; + clk5_clk_dfsbypass_cntl.bitfields.exit_dfs_bypass_1 = 1; + + acp_reg_write_via_smn(CLK5_CLK_DFSBYPASS_CONTROL, + clk5_clk_dfsbypass_cntl.u32all, + sizeof(int)); +} + +void audio_pll_mode_switch(uint32_t mode, uint32_t fcw_int, uint32_t fcw_frac, uint32_t fcw_denom, + uint32_t pllspinediv) +{ + volatile clk5_spll_fuse_1_t clk_spll_fuse1; + volatile clk5_spll_fuse_2_t clk_spll_fuse2; + volatile clk5_spll_field_9_t clk_spll_field_9; + volatile clk5_spll_field_6nm_t clk_spll_field_6nm; + volatile clk5_spll_field_7_t clk_spll_field_7; + volatile clk5_spll_field_4_t clk_spll_field_4; + volatile clk5_spll_field_5nm_bus_ctrl_t clk_spll_field_5nm_bus_ctrl; + volatile clk5_spll_field_5nm_bus_wdata_t clk_spll_field_5nm_bus_wdata; + volatile clk5_spll_field_5nm_bus_status_t clk_spll_field_5nm_bus_status; + volatile clk5_rootrefclk_mux_1_t clk_rootrefclkmux; + volatile clk5_spll_field_2_t clk5_spll_field_2; + + clk_spll_fuse1.u32all = 0x0; + clk_spll_fuse2.u32all = 0x0; + clk_spll_field_9.u32all = 0x0; + clk_spll_field_6nm.u32all = 0x0; + clk_spll_field_7.u32all = 0x0; + clk_spll_field_4.u32all = 0x0; + clk_spll_field_5nm_bus_ctrl.u32all = 0x0; + clk_spll_field_5nm_bus_wdata.u32all = 0x0; + clk_spll_field_5nm_bus_status.u32all = 0x0; + clk5_spll_field_2 = + (clk5_spll_field_2_t)acp_reg_read_via_smn(CLK5_SPLL_FIELD_2, sizeof(int)); + + if (clk5_spll_field_2.bitfields.spll_fracn_en == 0) + clk5_spll_field_2.bitfields.spll_fracn_en = 1; + acp_reg_write_via_smn(CLK5_SPLL_FIELD_2, clk5_spll_field_2.u32all, sizeof(int)); + + switch (mode) { + case PLL_MODE_32KHZ_LPPM: + clk_rootrefclkmux.bitfields.ROOTREFCLK_MUX_1 = 0x0; + clk_rootrefclkmux.u32all = acp_reg_read_via_smn(CLK5_ROOTREFCLKMUX_1, sizeof(int)); + + clk_rootrefclkmux.bitfields.ROOTREFCLK_MUX_1 = 1; + acp_reg_write_via_smn(CLK5_ROOTREFCLKMUX_1, clk_rootrefclkmux.u32all, sizeof(int)); + + clk_spll_fuse1.bitfields.spll_gp_coarse_exp = 0x5; + clk_spll_fuse1.bitfields.spll_gp_coarse_mant = 0x0; + clk_spll_fuse1.bitfields.spll_gi_coarse_exp = 0x7; + clk_spll_fuse1.bitfields.spll_gi_coarse_mant = 0x0; + + clk_spll_fuse2.bitfields.spll_tdc_resolution = 0xe8; + clk_spll_fuse2.bitfields.spll_freq_offset_exp = 0xa; + clk_spll_fuse2.bitfields.spll_freq_offset_mant = 0xe; + + clk_spll_field_9.bitfields.spll_dpll_cfg_3 = 2; + clk_spll_field_6nm.bitfields.spll_dpll_cfg_4 = 0x60; + clk_spll_field_6nm.bitfields.spll_vco_pre_div = 3; + clk_spll_field_7.bitfields.spll_refclk_rate = 4; + clk_spll_field_7.bitfields.spll_pwr_state = 1; + clk_spll_field_4.bitfields.spll_refclk_div = 0; + + acp_reg_write_via_smn(CLK5_SPLL_FUSE_1, clk_spll_fuse1.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_SPLL_FUSE_2, clk_spll_fuse2.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_SPLL_FIELD_9, clk_spll_field_9.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_SPLL_FIELD_6nm, clk_spll_field_6nm.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_SPLL_FIELD_7, clk_spll_field_7.u32all, sizeof(int)); + acp_reg_write_via_smn(CLK5_SPLL_FIELD_4, clk_spll_field_4.u32all, sizeof(int)); + + clk_spll_field_5nm_bus_wdata.bitfields.bus_spll_wr_data = 0x00400000; + acp_reg_write_via_smn(CLK5_SPLL_FIELD_5nm_BUS_WDATA, + clk_spll_field_5nm_bus_wdata.u32all, + sizeof(int)); + + clk_spll_field_5nm_bus_ctrl.u32all = + acp_reg_read_via_smn(CLK5_SPLL_FIELD_5nm_BUS_CTRL, + sizeof(int)); + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_async_mode = 1; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_apb_mode = 0; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_addr = 0xa; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_byte_en = 0xf; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_rdtr = + !clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_rdtr; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_resetb = 1; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_sel = 1; + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_wrtr = 1; + acp_reg_write_via_smn(CLK5_SPLL_FIELD_5nm_BUS_CTRL, + clk_spll_field_5nm_bus_ctrl.u32all, + sizeof(int)); + do { + clk_spll_field_5nm_bus_status.u32all = + acp_reg_read_via_smn(CLK5_SPLL_FIELD_5nm_BUS_STATUS, + sizeof(int)); + } while (clk_spll_field_5nm_bus_status.bitfields.spll_bus_rd_valid != + clk_spll_field_5nm_bus_ctrl.bitfields.bus_spll_rdtr); + + acp_reg_write_via_smn(CLK5_CLK_PLL_RESET_STOP_TIMER, 0xbbb11aa, sizeof(int)); + break; + default: + tr_err(&acp_clk_tr, "ERROR: Invalid PLL Mode"); + return; + } + + clk5_clk_pll_req_u_t clk5_clk_pll_req; + + clk5_clk_pll_req.u32all = 0; + clk5_clk_pll_req = + (clk5_clk_pll_req_u_t)acp_reg_read_via_smn(CLK5_CLK_PLL_REQ, sizeof(int)); + clk5_clk_pll_req.bitfields.fbmult_int = fcw_int; + + if (clk5_spll_field_2.bitfields.spll_fracn_en) + clk5_clk_pll_req.bitfields.fbmult_frac = fcw_frac; + clk5_clk_pll_req.bitfields.pllspinediv = pllspinediv; + acp_reg_write_via_smn(CLK5_CLK_PLL_REQ, clk5_clk_pll_req.u32all, sizeof(int)); +} + +void clk5_init_vco(void) +{ + audio_pll_power_off(); + audio_pll_mode_switch(PLL_MODE_32KHZ_LPPM, 0x125, 0, 0, 0); + + audio_pll_power_on(); + + clk_dfs_bypassexit(); + acp_reg_write_via_smn(CLK5_CLK1_BYPASS_CNTL, 0, sizeof(int)); +} + +void platform_clock_init(struct sof *sof) +{ + int i = 0; + + sof->clocks = platform_clocks_info; + for (i = 0; i < CONFIG_CORE_COUNT; i++) { + sof->clocks[i] = (struct clock_info) { + .freqs_num = NUM_CPU_FREQ, + .freqs = platform_cpu_freq, + .default_freq_idx = CPU_DEFAULT_IDX, + .current_freq_idx = CPU_DEFAULT_IDX, + .notification_id = NOTIFIER_ID_CPU_FREQ, + .notification_mask = NOTIFIER_TARGET_CORE_MASK(i), + .set_freq = NULL, + }; + } + clk5_init_vco(); +} diff --git a/src/platform/amd/acp_6_3/lib/dai.c b/src/platform/amd/acp_6_3/lib/dai.c new file mode 100644 index 000000000000..02ee5c5d4dc3 --- /dev/null +++ b/src/platform/amd/acp_6_3/lib/dai.c @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +//Copyright(c) 2023 AMD. All rights reserved. +// +//Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> +// SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + +#include <sof/common.h> +#include <sof/drivers/acp_dai_dma.h> +#include <sof/lib/dai.h> +#include <sof/lib/memory.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> +#include <ipc/dai.h> +#include <ipc/stream.h> + +static struct dai acp_dmic_dai[] = { + { + .index = 0, + .plat_data = { + .base = DMA0_BASE, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = DMA0_BASE, + .depth = 8, + .handshake = 0, + }, + .base = DMA0_BASE, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = DMA0_BASE, + .depth = 8, + .handshake = 1, + }, + }, + .drv = &acp_dmic_dai_driver, + }, +}; + +static struct dai hsdai[] = { + { + .index = 0, + .plat_data = { + .base = DAI_BASE_REM, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = DAI_BASE_REM + HS_TX_FIFO_OFFST, + .depth = 8, + .handshake = 1, + }, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = DAI_BASE_REM + HS_RX_FIFO_OFFST, + .depth = 8, + .handshake = 0, + }, + }, + .drv = &acp_hsdai_driver, + }, + { + .index = 1, + .plat_data = { + .base = DAI_BASE_REM, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = DAI_BASE_REM + HS_TX_FIFO_OFFST, + .depth = 8, + .handshake = 1, + }, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = DAI_BASE_REM + HS_RX_FIFO_OFFST, + .depth = 8, + .handshake = 0, + }, + }, + .drv = &acp_hsdai_driver, + } +}; + +#ifdef ACP_SP_ENABLE +static struct dai spdai[] = { + { + .index = 0, + .plat_data = { + .base = DAI_BASE, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = DAI_BASE + BT_TX_FIFO_OFFST, + .depth = 8, + .handshake = 5, + }, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = DAI_BASE + BT_RX_FIFO_OFFST, + .depth = 8, + .handshake = 4, + }, + }, + .drv = &acp_spdai_driver, + } +}; + +static struct dai sp_virtual_dai[] = { + { + .index = 1, + .plat_data = { + .base = DAI_BASE, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = DAI_BASE + BT_TX_FIFO_OFFST, + .depth = 8, + .handshake = 5, + }, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = DAI_BASE + BT_RX_FIFO_OFFST, + .depth = 8, + .handshake = 4, + }, + }, + .drv = &acp_sp_virtual_dai_driver, + } +}; +#endif +#ifdef ACP_BT_ENABLE +static struct dai btdai[] = { + { + .index = 0, + .plat_data = { + .base = DAI_BASE, + .fifo[SOF_IPC_STREAM_PLAYBACK] = { + .offset = DAI_BASE + BT_TX_FIFO_OFFST, + .depth = 8, + .handshake = 3, + }, + .fifo[SOF_IPC_STREAM_CAPTURE] = { + .offset = DAI_BASE + BT_RX_FIFO_OFFST, + .depth = 8, + .handshake = 2, + }, + }, + .drv = &acp_btdai_driver, + }, +}; +#endif + +const struct dai_type_info dti[] = { + { + .type = SOF_DAI_AMD_DMIC, + .dai_array = acp_dmic_dai, + .num_dais = ARRAY_SIZE(acp_dmic_dai) + }, + { + .type = SOF_DAI_AMD_HS, + .dai_array = hsdai, + .num_dais = ARRAY_SIZE(hsdai) + }, +#ifdef ACP_SP_ENABLE + { + .type = SOF_DAI_AMD_SP, + .dai_array = spdai, + .num_dais = ARRAY_SIZE(spdai) + }, + { + .type = SOF_DAI_AMD_SP_VIRTUAL, + .dai_array = sp_virtual_dai, + .num_dais = ARRAY_SIZE(sp_virtual_dai) + }, +#endif +#ifdef ACP_BT_ENABLE + { + .type = SOF_DAI_AMD_BT, + .dai_array = btdai, + .num_dais = ARRAY_SIZE(btdai) + }, +#endif +}; + +const struct dai_info lib_dai = { + .dai_type_array = dti, + .num_dai_types = ARRAY_SIZE(dti) +}; + +int dai_init(struct sof *sof) +{ + int i; + + /* initialize spin locks early to enable ref counting */ + for (i = 0; i < ARRAY_SIZE(acp_dmic_dai); i++) + k_spinlock_init(&acp_dmic_dai[i].lock); + for (i = 0; i < ARRAY_SIZE(hsdai); i++) + k_spinlock_init(&hsdai[i].lock); +#ifdef ACP_SP_ENABLE + for (i = 0; i < ARRAY_SIZE(spdai); i++) + k_spinlock_init(&spdai[i].lock); + /* initialize spin locks early to enable ref counting */ + for (i = 0; i < ARRAY_SIZE(sp_virtual_dai); i++) + k_spinlock_init(&sp_virtual_dai[i].lock); +#endif +#ifdef ACP_BT_ENABLE + /* initialize spin locks early to enable ref counting */ + for (i = 0; i < ARRAY_SIZE(btdai); i++) + k_spinlock_init(&btdai[i].lock); +#endif + sof->dai_info = &lib_dai; + return 0; +} diff --git a/src/platform/amd/acp_6_3/lib/dma.c b/src/platform/amd/acp_6_3/lib/dma.c new file mode 100644 index 000000000000..d6a2b5f1e59f --- /dev/null +++ b/src/platform/amd/acp_6_3/lib/dma.c @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +//Copyright(c) 2023 AMD. All rights reserved. +// +//Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> +// SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + +#include <sof/common.h> +#include <platform/fw_scratch_mem.h> +#include <sof/drivers/acp_dai_dma.h> +#include <rtos/interrupt.h> +#include <sof/lib/dma.h> +#include <sof/lib/memory.h> +#include <rtos/sof.h> +#include <rtos/spinlock.h> + +extern struct dma_ops acp_dma_ops; +extern struct dma_ops acp_dmic_dma_ops; +#ifdef ACP_BT_ENABLE +extern struct dma_ops acp_dai_bt_dma_ops; +#endif +#ifdef ACP_SP_ENABLE +extern struct dma_ops acp_dai_sp_dma_ops; +#endif +extern struct dma_ops acp_dai_hs_dma_ops; + +SHARED_DATA struct dma dma[PLATFORM_NUM_DMACS] = { +{ + .plat_data = { + .id = DMA_ID_DMA0, + .dir = DMA_DIR_LMEM_TO_HMEM | DMA_DIR_HMEM_TO_LMEM, + .devs = DMA_DEV_HOST, + .base = DMA0_BASE, + .chan_size = DMA0_SIZE, + .channels = 8, + .irq = IRQ_NUM_EXT_LEVEL5, + }, + .ops = &acp_dma_ops, +}, +{ + .plat_data = { + .id = DMA_ID_DAI_HS, + .dir = DMA_DIR_DEV_TO_MEM | DMA_DIR_MEM_TO_DEV, + .devs = DMA_DEV_SP, + .caps = DMA_CAP_SP, + .base = DMA0_BASE, + .chan_size = DMA0_SIZE, + .channels = 8, + .irq = IRQ_NUM_EXT_LEVEL5, + }, + .ops = &acp_dai_hs_dma_ops, +}, +{ + .plat_data = { + .id = DMA_ID_DAI_DMIC, + .dir = DMA_DIR_DEV_TO_MEM, + .devs = DMA_DEV_DMIC, + .caps = DMA_CAP_DMIC, + .base = DMA0_BASE, + .chan_size = DMA0_SIZE, + .channels = 8, + .irq = IRQ_NUM_EXT_LEVEL4, + }, + .ops = &acp_dmic_dma_ops, +}, +#ifdef ACP_SP_ENABLE +{ + .plat_data = { + .id = DMA_ID_DAI_SP, + .dir = DMA_DIR_DEV_TO_MEM | DMA_DIR_MEM_TO_DEV, + .devs = DMA_DEV_SP, + .caps = DMA_CAP_SP, + .base = DMA0_BASE, + .chan_size = DMA0_SIZE, + .channels = 8, + .irq = IRQ_NUM_EXT_LEVEL5, + }, + .ops = &acp_dai_sp_dma_ops, +}, +{ + .plat_data = { + .id = DMA_ID_DAI_SP_VIRTUAL, + .dir = DMA_DIR_DEV_TO_MEM | DMA_DIR_MEM_TO_DEV, + .devs = DMA_DEV_SP_VIRTUAL, + .caps = DMA_CAP_SP_VIRTUAL, + .base = DMA0_BASE, + .chan_size = DMA0_SIZE, + .channels = 8, + .irq = IRQ_NUM_EXT_LEVEL5, + }, + .ops = &acp_dai_sp_virtual_dma_ops, +}, +#endif + +#ifdef ACP_BT_ENABLE +{ + .plat_data = { + .id = DMA_ID_DAI, + .dir = DMA_DIR_DEV_TO_MEM | DMA_DIR_MEM_TO_DEV, + .devs = DMA_DEV_BT, + .caps = DMA_CAP_BT, + .base = DMA0_BASE, + .chan_size = DMA0_SIZE, + .channels = 8, + .irq = IRQ_NUM_EXT_LEVEL5, + }, + .ops = &acp_dai_bt_dma_ops, +}, +#endif +}; + +const struct dma_info lib_dma = { + .dma_array = dma, + .num_dmas = ARRAY_SIZE(dma) +}; + +int acp_dma_init(struct sof *sof) +{ + int i; + uint32_t descr_base; + volatile acp_scratch_mem_config_t *pscratch_mem_cfg = + (volatile acp_scratch_mem_config_t *)(PU_SCRATCH_REG_BASE + SCRATCH_REG_OFFSET); + descr_base = (uint32_t)(&pscratch_mem_cfg->acp_cfg_dma_descriptor); + descr_base = (descr_base - 0x9C700000); + io_reg_write((PU_REGISTER_BASE + ACP_DMA_DESC_BASE_ADDR), descr_base); + io_reg_write((PU_REGISTER_BASE + ACP_DMA_DESC_MAX_NUM_DSCR), 0x1); + /* early lock initialization for ref counting */ + for (i = 0; i < ARRAY_SIZE(dma); i++) + k_spinlock_init(&dma[i].lock); + sof->dma_info = &lib_dma; + return 0; +} diff --git a/src/platform/amd/acp_6_3/lib/memory.c b/src/platform/amd/acp_6_3/lib/memory.c new file mode 100644 index 000000000000..94047b7c488a --- /dev/null +++ b/src/platform/amd/acp_6_3/lib/memory.c @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright 2023 AMD +// +// Author:Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> + +#include <sof/common.h> +#include <sof/lib/mm_heap.h> +#include <sof/lib/memory.h> +#include <sof/platform.h> +#include <rtos/sof.h> +#include <ipc/topology.h> + +/* Heap blocks for system runtime */ +static SHARED_DATA struct block_hdr sys_rt_block64[HEAP_SYS_RT_COUNT64]; +static SHARED_DATA struct block_hdr sys_rt_block512[HEAP_SYS_RT_COUNT512]; +static SHARED_DATA struct block_hdr sys_rt_block1024[HEAP_SYS_RT_COUNT1024]; + +/* Heap memory for system runtime */ +static SHARED_DATA struct block_map sys_rt_heap_map[] = { + BLOCK_DEF(64, HEAP_SYS_RT_COUNT64, sys_rt_block64), + BLOCK_DEF(512, HEAP_SYS_RT_COUNT512, sys_rt_block512), + BLOCK_DEF(1024, HEAP_SYS_RT_COUNT1024, sys_rt_block1024), +}; + +/* Heap blocks for modules */ +static SHARED_DATA struct block_hdr mod_block16[HEAP_RT_COUNT16]; +static SHARED_DATA struct block_hdr mod_block32[HEAP_RT_COUNT32]; +static SHARED_DATA struct block_hdr mod_block64[HEAP_RT_COUNT64]; +static SHARED_DATA struct block_hdr mod_block128[HEAP_RT_COUNT128]; +static SHARED_DATA struct block_hdr mod_block256[HEAP_RT_COUNT256]; +static SHARED_DATA struct block_hdr mod_block512[HEAP_RT_COUNT512]; +static SHARED_DATA struct block_hdr mod_block1024[HEAP_RT_COUNT1024]; +static SHARED_DATA struct block_hdr mod_block2048[HEAP_RT_COUNT2048]; + +/* Heap memory map for modules */ +static SHARED_DATA struct block_map rt_heap_map[] = { + BLOCK_DEF(16, HEAP_RT_COUNT16, mod_block16), + BLOCK_DEF(32, HEAP_RT_COUNT32, mod_block32), + BLOCK_DEF(64, HEAP_RT_COUNT64, mod_block64), + BLOCK_DEF(128, HEAP_RT_COUNT128, mod_block128), + BLOCK_DEF(256, HEAP_RT_COUNT256, mod_block256), + BLOCK_DEF(512, HEAP_RT_COUNT512, mod_block512), + BLOCK_DEF(1024, HEAP_RT_COUNT1024, mod_block1024), + BLOCK_DEF(2048, HEAP_RT_COUNT2048, mod_block2048), +}; + +/* Heap blocks for buffers */ +static SHARED_DATA struct block_hdr buf_block[HEAP_BUFFER_COUNT]; + +/* Heap memory map for buffers */ +static SHARED_DATA struct block_map buf_heap_map[] = { + BLOCK_DEF(HEAP_BUFFER_BLOCK_SIZE, HEAP_BUFFER_COUNT, buf_block), +}; + +static SHARED_DATA struct mm memmap = { + .system[0] = { + .heap = HEAP_SYSTEM_BASE, + .size = HEAP_SYSTEM_SIZE, + .info = {.free = HEAP_SYSTEM_SIZE,}, + .caps = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, + }, + .system_runtime[0] = { + .blocks = ARRAY_SIZE(sys_rt_heap_map), + .map = sys_rt_heap_map, + .heap = HEAP_SYS_RUNTIME_BASE, + .size = HEAP_SYS_RUNTIME_SIZE, + .info = {.free = HEAP_SYS_RUNTIME_SIZE,}, + .caps = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, + }, + .runtime[0] = { + .blocks = ARRAY_SIZE(rt_heap_map), + .map = rt_heap_map, + .heap = HEAP_RUNTIME_BASE, + .size = HEAP_RUNTIME_SIZE, + .info = {.free = HEAP_RUNTIME_SIZE,}, + .caps = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, + }, + .buffer[0] = { + .blocks = ARRAY_SIZE(buf_heap_map), + .map = buf_heap_map, + .heap = HEAP_BUFFER_BASE, + .size = HEAP_BUFFER_SIZE, + .info = {.free = HEAP_BUFFER_SIZE,}, + .caps = SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA | SOF_MEM_CAPS_CACHE | SOF_MEM_CAPS_HP, + }, + .total = {.free = HEAP_SYSTEM_SIZE + HEAP_SYS_RUNTIME_SIZE + + HEAP_RUNTIME_SIZE + HEAP_BUFFER_SIZE,}, +}; + +void platform_init_memmap(struct sof *sof) +{ + /* memmap has been initialized statically as a part of .data */ + sof->memory_map = &memmap; +} diff --git a/src/platform/amd/acp_6_3/platform.c b/src/platform/amd/acp_6_3/platform.c new file mode 100644 index 000000000000..66aac4c054e1 --- /dev/null +++ b/src/platform/amd/acp_6_3/platform.c @@ -0,0 +1,210 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +//Copyright(c) 2023 AMD. All rights reserved. +// +//Author: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com> +// SaiSurya, Ch <saisurya.chakkaveeravenkatanaga@amd.com> + +#include <sof/compiler_info.h> +#include <sof/debug/debug.h> +#include <rtos/interrupt.h> +#include <sof/drivers/acp_dai_dma.h> +#include <sof/ipc/driver.h> +#include <rtos/timer.h> +#include <sof/fw-ready-metadata.h> +#include <sof/lib/agent.h> +#include <rtos/clk.h> +#include <sof/lib/cpu.h> +#include <sof/lib/dai.h> +#include <sof/lib/dma.h> +#include <sof/lib/mailbox.h> +#include <sof/lib/memory.h> +#include <sof/lib/mm_heap.h> +#include <sof/platform.h> +#include <sof/schedule/edf_schedule.h> +#include <sof/schedule/ll_schedule.h> +#include <sof/schedule/ll_schedule_domain.h> +#include <rtos/sof.h> +#include <sof/trace/dma-trace.h> +#include <ipc/dai.h> +#include <ipc/header.h> +#include <ipc/info.h> +#include <kernel/abi.h> +#include <kernel/ext_manifest.h> +#include <sof_versions.h> +#include <errno.h> +#include <stdint.h> +#include <platform/chip_offset_byte.h> + +struct sof; +static const struct sof_ipc_fw_ready ready + __attribute__((section(".fw_ready"))) = { + .hdr = { + .cmd = SOF_IPC_FW_READY, + .size = sizeof(struct sof_ipc_fw_ready), + }, + /* dspbox is for DSP initiated IPC, hostbox is for host initiated IPC */ + .version = { + .hdr.size = sizeof(struct sof_ipc_fw_version), + .micro = SOF_MICRO, + .minor = SOF_MINOR, + .major = SOF_MAJOR, +#ifdef DEBUG_BUILD + /* only added in debug for reproducibility in releases */ + .build = SOF_BUILD, + .date = __DATE__, + .time = __TIME__, +#endif + .tag = SOF_TAG, + .abi_version = SOF_ABI_VERSION, + }, + .flags = DEBUG_SET_FW_READY_FLAGS, +}; + +#define NUM_ACP_WINDOWS 6 + +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_COMPILE(sizeof(struct ext_man_windows), EXT_MAN_ALIGN), + }, + .window = { + .ext_hdr = { + .hdr.cmd = SOF_IPC_FW_READY, + .hdr.size = sizeof(struct sof_ipc_window), + .type = SOF_IPC_EXT_WINDOW, + }, + .num_windows = NUM_ACP_WINDOWS, + .window = { + { + .type = SOF_IPC_REGION_UPBOX, + .id = 0, + .flags = 0, + .size = MAILBOX_DSPBOX_SIZE, + .offset = MAILBOX_DSPBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DOWNBOX, + .id = 0, + .flags = 0, + .size = MAILBOX_HOSTBOX_SIZE, + .offset = MAILBOX_HOSTBOX_OFFSET, + }, + { + .type = SOF_IPC_REGION_DEBUG, + .id = 0, + .flags = 0, + .size = MAILBOX_DEBUG_SIZE, + .offset = MAILBOX_DEBUG_OFFSET, + }, + { + .type = SOF_IPC_REGION_TRACE, + .id = 0, + .flags = 0, + .size = MAILBOX_TRACE_SIZE, + .offset = MAILBOX_TRACE_OFFSET, + }, + { + .type = SOF_IPC_REGION_STREAM, + .id = 0, + .flags = 0, + .size = MAILBOX_STREAM_SIZE, + .offset = MAILBOX_STREAM_OFFSET, + }, + { + .type = SOF_IPC_REGION_EXCEPTION, + .id = 0, + .flags = 0, + .size = MAILBOX_EXCEPTION_SIZE, + .offset = MAILBOX_EXCEPTION_OFFSET, + }, + }, + }, +}; + +static SHARED_DATA struct timer timer = { + .id = TIMER0, + .irq = IRQ_NUM_TIMER0, +}; + +int platform_init(struct sof *sof) +{ + int ret; + + sof->platform_timer = &timer; + sof->cpu_timers = &timer; + /* to view system memory */ + interrupt_init(sof); + platform_interrupt_init(); + platform_clock_init(sof); + scheduler_init_edf(); + /* init low latency domains and schedulers */ + /* CONFIG_SYSTICK_PERIOD set as PLATFORM_DEFAULT_CLOCK */ + sof->platform_timer_domain = + timer_domain_init(sof->platform_timer, PLATFORM_DEFAULT_CLOCK); + scheduler_init_ll(sof->platform_timer_domain); + platform_timer_start(sof->platform_timer); + /*CONFIG_SYSTICK_PERIOD hardcoded as 200000*/ + sa_init(sof, 200000); + clock_set_freq(CLK_CPU(cpu_get_id()), CLK_MAX_CPU_HZ); + /* init DMA */ + ret = acp_dma_init(sof); + if (ret < 0) + return -ENODEV; + /* Init DMA platform domain */ + sof->platform_dma_domain = + dma_multi_chan_domain_init(&sof->dma_info->dma_array[0], + sizeof(sof->dma_info->dma_array), + PLATFORM_DEFAULT_CLOCK, true); + sof->platform_dma_domain->full_sync = true; + scheduler_init_ll(sof->platform_dma_domain); + /* initialize the host IPC mechanisms */ + ipc_init(sof); + /* initialize the DAI mechanisms */ + ret = dai_init(sof); + if (ret < 0) + return -ENODEV; +#if CONFIG_TRACE + /* Initialize DMA for Trace*/ + trace_point(TRACE_BOOT_PLATFORM_DMA_TRACE); + sof->dmat->config.elem_array.elems = + rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, + sizeof(struct dma_sg_elem) * 1); + sof->dmat->config.elem_array.count = 1; + sof->dmat->config.elem_array.elems->dest = 0x03800000; + sof->dmat->config.elem_array.elems->size = 65536; + sof->dmat->config.scatter = 0; + dma_trace_init_complete(sof->dmat); +#endif + /* show heap status */ + heap_trace_all(1); + return 0; +} + +int platform_boot_complete(uint32_t boot_message) +{ + acp_sw_intr_trig_t swintrtrig; + + volatile acp_scratch_mem_config_t *pscratch_mem_cfg = + (volatile acp_scratch_mem_config_t *)(PU_SCRATCH_REG_BASE + SCRATCH_REG_OFFSET); + mailbox_dspbox_write(0, &ready, sizeof(ready)); + pscratch_mem_cfg->acp_dsp_msg_write = 1; + acp_dsp_to_host_intr_trig(); + /* Configures the trigger bit in ACP_DSP_SW_INTR_TRIG register */ + swintrtrig = (acp_sw_intr_trig_t)io_reg_read(PU_REGISTER_BASE + ACP_SW_INTR_TRIG); + swintrtrig.bits.trig_dsp0_to_host_intr = INTERRUPT_DISABLE; + io_reg_write((PU_REGISTER_BASE + ACP_SW_INTR_TRIG), swintrtrig.u32all); + clock_set_freq(CLK_CPU(cpu_get_id()), CLK_DEFAULT_CPU_HZ); + return 0; +} + +int platform_context_save(struct sof *sof) +{ + return 0; +} + +void platform_wait_for_interrupt(int level) +{ + arch_wait_for_interrupt(level); +} From 354029acbdbfd684d33dc225ba7b412095c5d3db Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Tue, 3 Oct 2023 13:07:44 +0530 Subject: [PATCH 579/639] Update clock switching sequence and return EBUSY for IPC when Host busy - Update clock switching and clock frequency sequence. - Return EBUSY for IPC when Host busy with previous ipc. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- src/drivers/amd/rembrandt/acp_hs_dma.c | 4 ++-- src/drivers/amd/rembrandt/ipc.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/drivers/amd/rembrandt/acp_hs_dma.c b/src/drivers/amd/rembrandt/acp_hs_dma.c index dd3026236055..95d189e1ab2b 100644 --- a/src/drivers/amd/rembrandt/acp_hs_dma.c +++ b/src/drivers/amd/rembrandt/acp_hs_dma.c @@ -96,9 +96,9 @@ static int acp_dai_hs_dma_start(struct dma_chan_data *channel) acp_pdm_en = (uint32_t)io_reg_read(PU_REGISTER_BASE + ACP_WOV_PDM_ENABLE); if (!hs_iter.bits.hstdm_txen && !hs_irer.bits.hstdm_rx_en && !acp_pdm_en) { - io_reg_write((PU_REGISTER_BASE + ACP_CLKMUX_SEL), ACP_ACLK_CLK_SEL); /* Request SMU to set aclk to 600 Mhz */ acp_change_clock_notify(600000000); + io_reg_write((PU_REGISTER_BASE + ACP_CLKMUX_SEL), ACP_ACLK_CLK_SEL); } if (channel->direction == DMA_DIR_MEM_TO_DEV) { @@ -180,8 +180,8 @@ static int acp_dai_hs_dma_stop(struct dma_chan_data *channel) io_reg_write((PU_REGISTER_BASE + ACP_HSTDM_IER), HS_IER_DISABLE); /* Request SMU to scale down aclk to minimum clk */ if (!acp_pdm_en) { - acp_change_clock_notify(0); io_reg_write((PU_REGISTER_BASE + ACP_CLKMUX_SEL), ACP_INTERNAL_CLK_SEL); + acp_change_clock_notify(0); } } return 0; diff --git a/src/drivers/amd/rembrandt/ipc.c b/src/drivers/amd/rembrandt/ipc.c index 8628ffecfb4f..f8a17cdedab5 100644 --- a/src/drivers/amd/rembrandt/ipc.c +++ b/src/drivers/amd/rembrandt/ipc.c @@ -121,7 +121,7 @@ int ipc_platform_send_msg(const struct ipc_msg *msg) sw_intr_stat = (acp_dsp_sw_intr_stat_t) io_reg_read(PU_REGISTER_BASE + ACP_DSP_SW_INTR_STAT); status = sw_intr_stat.bits.dsp0_to_host_intr_stat; - return ret; + return -EBUSY; } lock = io_reg_read(PU_REGISTER_BASE + ACP_AXI2DAGB_SEM_0); while (lock) From 5e583c4c8a2a25a961cffb203d604836a737dd79 Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Fri, 6 Oct 2023 17:26:29 +0530 Subject: [PATCH 580/639] Add cascaded interrupt in the platform ACP_6_3 Add cascaded interrupt in the platform ACP_6_3. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- src/drivers/amd/rembrandt/acp_hs_dai.c | 3 + src/drivers/amd/rembrandt/interrupt.c | 59 ++++++++++++++++++- .../include/platform/drivers/interrupt.h | 4 +- src/platform/amd/acp_6_3/lib/dma.c | 2 + 4 files changed, 65 insertions(+), 3 deletions(-) diff --git a/src/drivers/amd/rembrandt/acp_hs_dai.c b/src/drivers/amd/rembrandt/acp_hs_dai.c index 69aba78da6bd..651dd3bfbf37 100644 --- a/src/drivers/amd/rembrandt/acp_hs_dai.c +++ b/src/drivers/amd/rembrandt/acp_hs_dai.c @@ -158,6 +158,9 @@ static int hsdai_get_fifo(struct dai *dai, int direction, int stream_id) static int hsdai_get_handshake(struct dai *dai, int direction, int stream_id) { + int handshake = dai->plat_data.fifo[direction].handshake; + + interrupt_get_irq(handshake, "irqsteer1"); return dai->plat_data.fifo[direction].handshake; } diff --git a/src/drivers/amd/rembrandt/interrupt.c b/src/drivers/amd/rembrandt/interrupt.c index 93b03d66978b..f183186c2f74 100644 --- a/src/drivers/amd/rembrandt/interrupt.c +++ b/src/drivers/amd/rembrandt/interrupt.c @@ -104,6 +104,45 @@ static int get_first_irq(uint64_t ints) return ffs(ints) - 1; } +static inline void acp_handle_irq_5(struct irq_cascade_desc *cascade, + uint32_t line_index, uint64_t status) +{ + int core = cpu_get_id(); + struct list_item *clist; + struct irq_desc *child = NULL; + int bit; + bool handled; + k_spinlock_key_t key; + + while (status) { + bit = get_first_irq(status); + handled = false; + status &= ~(1ull << bit); + bit = 5; + + key = k_spin_lock(&cascade->lock); + + list_for_item(clist, &cascade->child[bit].list) { + child = container_of(clist, struct irq_desc, irq_list); + + if (child->handler && (child->cpu_mask & 1 << core)) { + k_spin_unlock(&cascade->lock, key); + child->handler(child->handler_arg); + k_spin_lock(&cascade->lock); + handled = true; + } + } + + k_spin_unlock(&cascade->lock, key); + + if (!handled) { + tr_err(&acp_irq_tr, "irq_handler(): not handled, bit %d", + bit); + acp_irq_mask_int(line_index * IRQS_PER_LINE + bit); + } + } +} + static inline void acp_handle_irq(struct irq_cascade_desc *cascade, uint32_t line_index, uint64_t status) { @@ -140,6 +179,24 @@ static inline void acp_handle_irq(struct irq_cascade_desc *cascade, } } +static void irqhandler_5(void *data) +{ + uint32_t line_index = 5; + struct irq_desc *parent = data; + struct irq_cascade_desc *cascade = + container_of(parent, struct irq_cascade_desc, desc); + uint64_t status; + + line_index = 5; + status = acp_get_irq_interrupts(line_index); + + if (status) + /* Handle current interrupts */ + acp_handle_irq_5(cascade, line_index, status); + else + tr_err(&acp_irq_tr, "invalid interrupt status"); +} + static inline void irq_handler(void *data, uint32_t line_index) { struct irq_desc *parent = data; @@ -165,7 +222,6 @@ DEFINE_IRQ_HANDLER(0) DEFINE_IRQ_HANDLER(1) DEFINE_IRQ_HANDLER(3) DEFINE_IRQ_HANDLER(4) -DEFINE_IRQ_HANDLER(5) static void acp_irq_mask(struct irq_desc *desc, uint32_t irq, unsigned int core) { @@ -207,6 +263,7 @@ static const struct irq_cascade_tmpl dsp_irq[] = { .global_mask = false, }, { + .name = "irqsteer1", .irq = IRQ_NUM_EXT_LEVEL5, .handler = irqhandler_5, .ops = &irq_ops, diff --git a/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h b/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h index 59127dfe81b7..6197427cdf92 100644 --- a/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h +++ b/src/platform/amd/acp_6_3/include/platform/drivers/interrupt.h @@ -16,9 +16,9 @@ #define PLATFORM_IRQ_HW_NUM 9 -#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM +#define PLATFORM_IRQ_FIRST_CHILD 5 -#define PLATFORM_IRQ_CHILDREN 0 +#define PLATFORM_IRQ_CHILDREN 32 /* IRQ numbers - wrt Tensilica DSP */ #define IRQ_NUM_SOFTWARE0 1 /* level 1 */ diff --git a/src/platform/amd/acp_6_3/lib/dma.c b/src/platform/amd/acp_6_3/lib/dma.c index d6a2b5f1e59f..d9dd7f4c474d 100644 --- a/src/platform/amd/acp_6_3/lib/dma.c +++ b/src/platform/amd/acp_6_3/lib/dma.c @@ -34,6 +34,7 @@ SHARED_DATA struct dma dma[PLATFORM_NUM_DMACS] = { .chan_size = DMA0_SIZE, .channels = 8, .irq = IRQ_NUM_EXT_LEVEL5, + .irq_name = "irqsteer1", }, .ops = &acp_dma_ops, }, @@ -47,6 +48,7 @@ SHARED_DATA struct dma dma[PLATFORM_NUM_DMACS] = { .chan_size = DMA0_SIZE, .channels = 8, .irq = IRQ_NUM_EXT_LEVEL5, + .irq_name = "irqsteer1", }, .ops = &acp_dai_hs_dma_ops, }, From 51a44aadb60132f9b0de038293c959b8444dcc37 Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Mon, 9 Oct 2023 15:02:24 +0530 Subject: [PATCH 581/639] Enable PLL clock for the platform ACP_6_3 Enable PLL clock for the platform ACP_6_3. Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- src/drivers/amd/rembrandt/acp_hs_dma.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/drivers/amd/rembrandt/acp_hs_dma.c b/src/drivers/amd/rembrandt/acp_hs_dma.c index 95d189e1ab2b..e49fca13615e 100644 --- a/src/drivers/amd/rembrandt/acp_hs_dma.c +++ b/src/drivers/amd/rembrandt/acp_hs_dma.c @@ -99,6 +99,10 @@ static int acp_dai_hs_dma_start(struct dma_chan_data *channel) /* Request SMU to set aclk to 600 Mhz */ acp_change_clock_notify(600000000); io_reg_write((PU_REGISTER_BASE + ACP_CLKMUX_SEL), ACP_ACLK_CLK_SEL); +#ifdef CONFIG_ACP_6_3 + if (!io_reg_read(PU_REGISTER_BASE + ACP_I2S_196MHZ_CLK_SEL)) + io_reg_write((PU_REGISTER_BASE + ACP_I2S_196MHZ_CLK_SEL), 0x1); +#endif } if (channel->direction == DMA_DIR_MEM_TO_DEV) { @@ -182,6 +186,10 @@ static int acp_dai_hs_dma_stop(struct dma_chan_data *channel) if (!acp_pdm_en) { io_reg_write((PU_REGISTER_BASE + ACP_CLKMUX_SEL), ACP_INTERNAL_CLK_SEL); acp_change_clock_notify(0); +#ifdef CONFIG_ACP_6_3 + if (io_reg_read(PU_REGISTER_BASE + ACP_I2S_196MHZ_CLK_SEL)) + io_reg_write((PU_REGISTER_BASE + ACP_I2S_196MHZ_CLK_SEL), 0x0); +#endif } } return 0; From 4c5409235ec4d19b0d4cd3a0c54e6666f986bc15 Mon Sep 17 00:00:00 2001 From: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> Date: Tue, 17 Oct 2023 15:39:51 +0530 Subject: [PATCH 582/639] rimage: config: add acp_6_3 toml file to support acp_6_3 build Add acp_6_3 toml file to support sof-acp_6_3.ri binary build Signed-off-by: SaiSurya Ch <saisurya.chakkaveeravenkatanaga@amd.com> --- tools/rimage/config/acp_6_3.toml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/rimage/config/acp_6_3.toml diff --git a/tools/rimage/config/acp_6_3.toml b/tools/rimage/config/acp_6_3.toml new file mode 100644 index 000000000000..8a6286dde153 --- /dev/null +++ b/tools/rimage/config/acp_6_3.toml @@ -0,0 +1,20 @@ +version = [1, 0] # use simple file write + +[adsp] +name = "acp_6_3" + +[[adsp.mem_zone]] +type = "IRAM" +base = "0x7F000000" +size = "0x60000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "DRAM" +base = "0xE0000000" +size = "0x20000" +host_offset = "0x0" +[[adsp.mem_zone]] +type = "SRAM" +base = "0x60006000" +size = "0x27A000" +host_offset = "0x0" From 7c735fe7a7acb5d77d70d17b0b4929e8810624e4 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Tue, 17 Oct 2023 13:56:42 -0700 Subject: [PATCH 583/639] topology2: deepbuffer-playback: Remove stale comments These were left over when the audio formats were cleaned up. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../topology2/include/pipelines/cavs/deepbuffer-playback.conf | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf index f63f77ad13be..b89fcb717702 100644 --- a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf @@ -51,7 +51,6 @@ Class.Pipeline."deepbuffer-playback" { num_output_audio_formats 1 num_output_pins 1 deep_buffer_dma_ms $DEEPBUFFER_FW_DMA_MS - # 16-bit 48KHz 2ch Object.Base.input_audio_format [ { in_bit_depth 16 @@ -66,7 +65,6 @@ Class.Pipeline."deepbuffer-playback" { in_valid_bit_depth 32 } ] - # 24-bit 48KHz 2ch Object.Base.output_audio_format [ { out_bit_depth 32 From b6d34fb4a837cb39904b4811ae32fc8e33bfd849 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 13 Oct 2023 16:29:01 -0700 Subject: [PATCH 584/639] topology2: Replace audio_format objects Replace audio_format objects with input_audio_format/output_audio_format objects in preparation for deprecating the audio_format class. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> --- .../topology2/cavs-nocodec-multicore.conf | 264 +++++++++++------- .../development/cavs-nocodec-crossover.conf | 6 - .../bench/one_input_output_format_s16.conf | 8 +- .../bench/one_input_output_format_s24.conf | 8 +- .../bench/one_input_output_format_s32.conf | 6 +- .../include/pipelines/cavs/dai-copier-be.conf | 86 +++--- .../cavs/dai-copier-gain-mixin-capture.conf | 39 ++- ...dai-copier-gain-module-copier-capture.conf | 57 ++-- .../include/pipelines/cavs/dai-kpb-be.conf | 126 +++++---- .../pipelines/cavs/deepbuffer-playback.conf | 7 +- .../pipelines/cavs/gain-module-copier.conf | 58 ++-- .../include/pipelines/cavs/gain-playback.conf | 73 +++-- .../pipelines/cavs/highpass-capture-be.conf | 39 ++- .../cavs/host-copier-gain-mixin-playback.conf | 50 ++-- .../pipelines/cavs/io-gateway-capture.conf | 21 +- .../cavs/mixout-aria-gain-mixin-playback.conf | 9 +- .../cavs/mixout-dai-copier-playback.conf | 9 +- .../mixout-gain-efx-dai-copier-playback.conf | 33 ++- ...ut-gain-efx-mbdrc-dai-copier-playback.conf | 45 ++- .../cavs/mixout-gain-host-copier-capture.conf | 90 +++--- ...ut-gain-smart-amp-dai-copier-playback.conf | 29 +- .../cavs/src-gain-mixin-playback.conf | 45 +-- .../include/pipelines/cavs/wov-detect.conf | 69 +++-- .../topology2/platform/intel/bt-generic.conf | 244 ++++++++-------- .../topology2/platform/intel/dmic-wov.conf | 91 +++--- 25 files changed, 899 insertions(+), 613 deletions(-) diff --git a/tools/topology/topology2/cavs-nocodec-multicore.conf b/tools/topology/topology2/cavs-nocodec-multicore.conf index 9c7e9c833b59..36c20c6b682d 100644 --- a/tools/topology/topology2/cavs-nocodec-multicore.conf +++ b/tools/topology/topology2/cavs-nocodec-multicore.conf @@ -315,46 +315,62 @@ IncludeByKey.PASSTHROUGH { stream_name 'Gain Capture 19' num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] Object.Control.mixer.1 { name 'Pre Demux $DMIC0_PCM_0_NAME Capture Volume' } @@ -376,46 +392,62 @@ IncludeByKey.PASSTHROUGH { pcm_id $DMIC0_PCM_0_PCM_ID num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] Object.Control.mixer.1 { name 'Post Demux $DMIC0_PCM_0_NAME Capture Volume' } @@ -434,46 +466,62 @@ IncludeByKey.PASSTHROUGH { pcm_id $DMIC0_PCM_1_PCM_ID num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.gain.1 { num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] Object.Control.mixer.1 { name 'Post Demux $DMIC0_PCM_1_NAME Capture Volume' } diff --git a/tools/topology/topology2/development/cavs-nocodec-crossover.conf b/tools/topology/topology2/development/cavs-nocodec-crossover.conf index cc49e9c3ef84..710e9125d567 100644 --- a/tools/topology/topology2/development/cavs-nocodec-crossover.conf +++ b/tools/topology/topology2/development/cavs-nocodec-crossover.conf @@ -315,12 +315,6 @@ Object.Pipeline.io-gateway-capture [ copier_type "SSP" stream_name "NoCodec-2" node_type $I2S_LINK_INPUT_CLASS - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } } } ] diff --git a/tools/topology/topology2/include/bench/one_input_output_format_s16.conf b/tools/topology/topology2/include/bench/one_input_output_format_s16.conf index 2f23335b7c6d..a309ceed07b4 100644 --- a/tools/topology/topology2/include/bench/one_input_output_format_s16.conf +++ b/tools/topology/topology2/include/bench/one_input_output_format_s16.conf @@ -1,11 +1,15 @@ num_input_audio_formats 1 num_output_audio_formats 1 - # 32-bit 48KHz 2ch - Object.Base.audio_format [ + # 16-bit 48KHz 2ch + Object.Base.input_audio_format [ { in_bit_depth 16 in_valid_bit_depth 16 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 16 out_valid_bit_depth 16 } diff --git a/tools/topology/topology2/include/bench/one_input_output_format_s24.conf b/tools/topology/topology2/include/bench/one_input_output_format_s24.conf index 4d83f5426dc1..081373a4b405 100644 --- a/tools/topology/topology2/include/bench/one_input_output_format_s24.conf +++ b/tools/topology/topology2/include/bench/one_input_output_format_s24.conf @@ -1,11 +1,15 @@ num_input_audio_formats 1 num_output_audio_formats 1 - # 32-bit 48KHz 2ch - Object.Base.audio_format [ + # 24-bit 48KHz 2ch + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 24 } diff --git a/tools/topology/topology2/include/bench/one_input_output_format_s32.conf b/tools/topology/topology2/include/bench/one_input_output_format_s32.conf index 5ef867327013..adc4d2f47d40 100644 --- a/tools/topology/topology2/include/bench/one_input_output_format_s32.conf +++ b/tools/topology/topology2/include/bench/one_input_output_format_s32.conf @@ -2,10 +2,14 @@ num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf index c8e8699f1294..4a597637ce50 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-be.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/pipeline.conf> @@ -39,46 +40,59 @@ Class.Pipeline."dai-copier-be" { num_output_audio_formats 3 num_output_pins 1 - # 32-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32-bit 48KHz 4ch - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 24 - out_sample_type $SAMPLE_TYPE_MSB_INTEGER - out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_sample_type $SAMPLE_TYPE_MSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] } module-copier."2" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf index 7f7a85d4724e..9e8d4c8b0f8a 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-mixin-capture.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/mixin.conf> @@ -51,12 +52,18 @@ Class.Pipeline."dai-copier-gain-mixin-capture" { num_output_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } mixin."1" {} @@ -64,12 +71,18 @@ Class.Pipeline."dai-copier-gain-mixin-capture" { num_input_audio_formats 1 num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf index 2e38db9f0719..146ab0dcf044 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-copier-gain-module-copier-capture.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/pipeline.conf> @@ -50,35 +51,53 @@ Class.Pipeline."dai-copier-gain-module-copier-capture" { num_output_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } module-copier."2" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } gain."1" { num_input_audio_formats 1 num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf index 28d2f8c47d74..71ed5dff6039 100644 --- a/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/dai-kpb-be.conf @@ -46,70 +46,78 @@ Class.Pipeline."dai-kpb-be" { num_output_audio_formats 3 num_output_pins 1 - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 24 - out_sample_type $SAMPLE_TYPE_MSB_INTEGER - out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" - } - - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32-bit 48KHz 4ch - Object.Base.audio_format.2 { - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + out_sample_type $SAMPLE_TYPE_MSB_INTEGER + out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" + } + ] } kpb."1" { num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_rate 16000 - out_rate 16000 - obs 128 - in_ch_cfg $CHANNEL_CONFIG_STEREO - in_ch_map $CHANNEL_MAP_STEREO - out_ch_cfg $CHANNEL_CONFIG_STEREO - out_ch_map $CHANNEL_MAP_STEREO - in_channels 2 - out_channels 2 - out_bit_depth 32 - in_bit_depth 32 - in_valid_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_rate 16000 - out_rate 16000 - obs 128 - in_ch_cfg $CHANNEL_CONFIG_4_POINT_0 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_4_POINT_0 - out_ch_map $CHANNEL_MAP_3_POINT_1 - in_channels 4 - out_channels 4 - out_bit_depth 32 - in_bit_depth 32 - in_valid_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate 16000 + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + + Object.Base.output_audio_format [ + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate 16000 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf index b89fcb717702..b787551b58bf 100644 --- a/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/deepbuffer-playback.conf @@ -77,11 +77,14 @@ Class.Pipeline."deepbuffer-playback" { num_input_audio_formats 1 num_output_audio_formats 1 - # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf b/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf index ff9ef84b6d51..b452c42eb1f0 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-module-copier.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/pipeline.conf> @@ -47,26 +48,51 @@ Class.Pipeline."gain-module-copier" { num_input_audio_formats 2 num_output_audio_formats 2 - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } module-copier."1" { num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf index e5e5bc41d9a7..84f8927fafaa 100644 --- a/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/gain-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/host-copier.conf> <include/components/gain.conf> <include/components/pipeline.conf> @@ -45,42 +46,54 @@ Class.Pipeline."gain-playback" { host-copier."1" { type "aif_in" num_input_audio_formats 3 - num_output_audio_formats 3 + num_output_audio_formats 1 num_output_pins 1 - # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] node_type $HDA_HOST_OUTPUT_CLASS } gain."1" { num_input_audio_formats 2 num_output_audio_formats 2 - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - # 32-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf b/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf index 7d43f08f1a61..f80a43acb0a3 100644 --- a/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf +++ b/tools/topology/topology2/include/pipelines/cavs/highpass-capture-be.conf @@ -17,7 +17,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/pipeline.conf> <include/controls/bytes.conf> @@ -42,24 +43,36 @@ Class.Pipeline."highpass-capture-be" { num_output_audio_formats 1 num_output_pins 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } eqiir."1" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] Object.Control.bytes."1" { <include/components/eqiir/highpass_40hz_0db_48khz.conf> diff --git a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf index 02f47b204a3b..8a2665c20bce 100644 --- a/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/host-copier-gain-mixin-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/host-copier.conf> <include/components/mixin.conf> <include/components/pipeline.conf> @@ -47,27 +48,28 @@ Class.Pipeline."host-copier-gain-mixin-playback" { type "aif_in" node_type $HDA_HOST_OUTPUT_CLASS num_input_audio_formats 3 - num_output_audio_formats 3 + num_output_audio_formats 1 num_output_pins 1 - # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32-bit 48KHz 2ch - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } gain."1" { @@ -75,10 +77,14 @@ Class.Pipeline."host-copier-gain-mixin-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } diff --git a/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf b/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf index a50b8ed0dd3c..8216a07a0878 100644 --- a/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/io-gateway-capture.conf @@ -17,7 +17,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/pipeline.conf> @@ -40,12 +41,18 @@ Class.Pipeline."io-gateway-capture" { num_output_audio_formats 1 num_output_pins 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf index 682b3c47ebe3..5bb171977c56 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-aria-gain-mixin-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/mixin.conf> <include/components/gain.conf> <include/components/mixout.conf> @@ -51,10 +52,14 @@ Class.Pipeline."mixout-aria-gain-mixin-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf index ba7997a55006..a125bbf6fc8f 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-dai-copier-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/mixout.conf> <include/components/pipeline.conf> @@ -50,10 +51,14 @@ Class.Pipeline."mixout-dai-copier-playback" { num_input_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf index 66b7b9c8b1a5..c8f443c4c497 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-dai-copier-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/mixout.conf> @@ -56,10 +57,14 @@ Class.Pipeline."mixout-gain-efx-dai-copier-playback" { num_input_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -70,10 +75,14 @@ Class.Pipeline."mixout-gain-efx-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -84,10 +93,14 @@ Class.Pipeline."mixout-gain-efx-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -104,10 +117,14 @@ Class.Pipeline."mixout-gain-efx-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -124,10 +141,14 @@ Class.Pipeline."mixout-gain-efx-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf index 87f3e1e34809..70167085bad3 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-efx-mbdrc-dai-copier-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/mixout.conf> @@ -56,10 +57,14 @@ Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { num_input_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -70,10 +75,14 @@ Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -84,10 +93,14 @@ Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -104,10 +117,14 @@ Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -123,12 +140,18 @@ Class.Pipeline."mixout-gain-efx-mbdrc-dai-copier-playback" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] Object.Control.bytes."1" { IncludeByKey.EFX_MBDRC_PARAMS { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf index 1c9801d89520..3126311e93a7 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-host-copier-capture.conf @@ -48,56 +48,58 @@ Class.Pipeline."mixout-gain-host-copier-capture" { host-copier."1" { type "aif_out" node_type $HDA_HOST_INPUT_CLASS - num_input_audio_formats 4 - num_output_audio_formats 4 + num_input_audio_formats 2 + num_output_audio_formats 3 num_input_pins 1 - # 16-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24-bit 48KHz 2ch - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 24 - } - - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 24 - } - - # 32-bit 48KHz 2ch - Object.Base.audio_format.4 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + ] } gain."1"{ num_input_audio_formats 2 num_output_audio_formats 2 - - # 32-bit 48KHz 2ch - Object.Base.audio_format.1 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 24 - } - - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-smart-amp-dai-copier-playback.conf b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-smart-amp-dai-copier-playback.conf index 2272c815d1e2..f0ca0fbf6b14 100644 --- a/tools/topology/topology2/include/pipelines/cavs/mixout-gain-smart-amp-dai-copier-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/mixout-gain-smart-amp-dai-copier-playback.conf @@ -16,7 +16,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/gain.conf> <include/components/mixout.conf> @@ -52,10 +53,14 @@ Class.Pipeline."mixout-gain-smart-amp-dai-copier-playback" { num_input_pins 1 # copier only supports one format based on mixin/mixout requirements: 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -66,10 +71,14 @@ Class.Pipeline."mixout-gain-smart-amp-dai-copier-playback" { num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.audio_format [ + Object.Base.input_audio_format [ { in_bit_depth 32 in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { out_bit_depth 32 out_valid_bit_depth 32 } @@ -80,23 +89,25 @@ Class.Pipeline."mixout-gain-smart-amp-dai-copier-playback" { num_input_audio_formats 2 num_output_audio_formats 1 # 32-bit 48KHz 2ch - Object.Base.input_audio_format { - 1 { + Object.Base.input_audio_format [ + { input_pin_index 0 in_bit_depth 32 in_valid_bit_depth 32 } - 2 { + { input_pin_index 1 in_bit_depth 32 in_valid_bit_depth 32 } - } - Object.Base.output_audio_format.1 { + ] + Object.Base.output_audio_format [ + { output_pin_index 0 out_bit_depth 32 out_valid_bit_depth 32 - } + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf index 46d1a6dfc8b9..1394c45d411a 100644 --- a/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf +++ b/tools/topology/topology2/include/pipelines/cavs/src-gain-mixin-playback.conf @@ -59,22 +59,35 @@ Class.Pipeline."src-gain-mixin-playback" { gain."1" { num_input_audio_formats 3 num_output_audio_formats 3 - #16-bit 48KHz 2ch - Object.Base.audio_format.1 {} - - Object.Base.audio_format.2 { - in_bit_depth 32 - in_valid_bit_depth 24 - out_bit_depth 32 - out_valid_bit_depth 24 - } - - Object.Base.audio_format.3 { - in_bit_depth 32 - in_valid_bit_depth 32 - out_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_bit_depth 16 + in_valid_bit_depth 16 + } + { + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_bit_depth 32 + in_valid_bit_depth 24 + } + ] + Object.Base.output_audio_format [ + { + out_bit_depth 16 + out_valid_bit_depth 16 + } + { + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_bit_depth 32 + out_valid_bit_depth 24 + } + ] + } mixin."1" { } diff --git a/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf b/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf index dc7805bd0f3e..b4d0466ea7be 100644 --- a/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf +++ b/tools/topology/topology2/include/pipelines/cavs/wov-detect.conf @@ -17,7 +17,8 @@ # Where N is the unique pipeline ID within the same alsaconf node. # -<include/common/audio_format.conf> +<include/common/input_audio_format.conf> +<include/common/output_audio_format.conf> <include/components/dai-copier.conf> <include/components/micsel.conf> <include/components/wov.conf> @@ -59,39 +60,49 @@ Class.Pipeline."wov-detect" { } micsel."1" { - Object.Base.audio_format.1 { - in_rate 16000 - out_rate 16000 - in_channels 2 - out_channels 1 - in_ch_map $CHANNEL_MAP_STEREO - in_ch_cfg 1 - out_ch_map $CHANNEL_MAP_MONO - out_ch_cfg 0 - out_bit_depth 32 - in_bit_depth 32 - in_valid_bit_depth 32 - out_valid_bit_depth 32 - } + Object.Base.input_audio_format [ + { + in_rate 16000 + in_channels 2 + in_ch_map $CHANNEL_MAP_STEREO + in_ch_cfg 1 + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate 16000 + out_channels 1 + out_ch_map $CHANNEL_MAP_MONO + out_ch_cfg 0 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } wov."1" { num_input_audio_formats 1 num_output_audio_formats 1 - Object.Base.audio_format.1 { - in_rate 16000 - out_rate 16000 - in_channels 1 - out_channels 1 - in_ch_cfg 0 - in_ch_map $CHANNEL_MAP_MONO - out_bit_depth 32 - in_bit_depth 32 - in_valid_bit_depth 32 - out_valid_bit_depth 32 - ibs 0x80 - obs 0x80 - } + Object.Base.input_audio_format [ + { + in_rate 16000 + in_channels 1 + in_ch_cfg 0 + in_ch_map $CHANNEL_MAP_MONO + in_bit_depth 32 + in_valid_bit_depth 32 + } + ] + Object.Base.output_audio_format [ + { + out_rate 16000 + out_channels 1 + out_bit_depth 32 + out_valid_bit_depth 32 + } + ] } pipeline."1" { diff --git a/tools/topology/topology2/platform/intel/bt-generic.conf b/tools/topology/topology2/platform/intel/bt-generic.conf index 57965f36b562..85c121a01026 100644 --- a/tools/topology/topology2/platform/intel/bt-generic.conf +++ b/tools/topology/topology2/platform/intel/bt-generic.conf @@ -26,34 +26,38 @@ Object.Pipeline { num_output_audio_formats 3 num_input_pins 1 - Object.Base.audio_format.0 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 2 - out_channels 2 - } - Object.Base.audio_format.2 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 8000 - out_rate 8000 - } - Object.Base.audio_format.3 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 16000 - out_rate 16000 - } + CombineArrays.Object.Base.output_audio_format [ + # array of 2ch format with range of rates + { + out_rate [ + 8000 + 16000 + ] + out_channels [ 1 ] + } + # 2ch 16-bit 48k + { + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + out_channels [ 2 ] + } + ] + CombineArrays.Object.Base.input_audio_format [ + # array of 2ch format with range of rates + { + in_rate [ + 8000 + 16000 + ] + in_channels [ 1 ] + } + # 2ch 16-bit 48k + { + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + in_channels [ 2 ] + } + ] } } ] @@ -69,34 +73,38 @@ Object.Pipeline { pcm_id $BT_PCM_ID num_input_audio_formats 3 num_output_audio_formats 3 - Object.Base.audio_format.0 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 2 - out_channels 2 - } - Object.Base.audio_format.2 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 8000 - out_rate 8000 - } - Object.Base.audio_format.3 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 16000 - out_rate 16000 - } + CombineArrays.Object.Base.output_audio_format [ + # array of 2ch format with range of rates + { + out_rate [ + 8000 + 16000 + ] + out_channels [ 1 ] + } + # 2ch 16-bit 48k + { + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + out_channels [ 2 ] + } + ] + CombineArrays.Object.Base.input_audio_format [ + # array of 2ch format with range of rates + { + in_rate [ + 8000 + 16000 + ] + in_channels [ 1 ] + } + # 2ch 16-bit 48k + { + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + in_channels [ 2 ] + } + ] } } ] @@ -113,34 +121,38 @@ Object.Pipeline { pcm_id $BT_PCM_ID num_input_audio_formats 3 num_output_audio_formats 3 - Object.Base.audio_format.0 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 2 - out_channels 2 - } - Object.Base.audio_format.2 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 8000 - out_rate 8000 - } - Object.Base.audio_format.3 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 16000 - out_rate 16000 - } + CombineArrays.Object.Base.output_audio_format [ + # array of 2ch format with range of rates + { + out_rate [ + 8000 + 16000 + ] + out_channels [ 1 ] + } + # 2ch 16-bit 48k + { + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + out_channels [ 2 ] + } + ] + CombineArrays.Object.Base.input_audio_format [ + # array of 2ch format with range of rates + { + in_rate [ + 8000 + 16000 + ] + in_channels [ 1 ] + } + # 2ch 16-bit 48k + { + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + in_channels [ 2 ] + } + ] } } ] @@ -160,36 +172,40 @@ Object.Pipeline { copier_type "SSP" stream_name $BT_NAME node_type $I2S_LINK_INPUT_CLASS - num_input_audio_formats 4 - num_output_audio_formats 4 - Object.Base.audio_format.0 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 2 - out_channels 2 - } - Object.Base.audio_format.1 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 8000 - out_rate 8000 - } - Object.Base.audio_format.2 { - in_bit_depth 16 - in_valid_bit_depth 16 - out_bit_depth 16 - out_valid_bit_depth 16 - in_channels 1 - out_channels 1 - in_rate 16000 - out_rate 16000 - } + num_input_audio_formats 3 + num_output_audio_formats 3 + CombineArrays.Object.Base.output_audio_format [ + # array of 2ch format with range of rates + { + out_rate [ + 8000 + 16000 + ] + out_channels [ 1 ] + } + # 2ch 16-bit 48k + { + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + out_channels [ 2 ] + } + ] + CombineArrays.Object.Base.input_audio_format [ + # array of 2ch format with range of rates + { + in_rate [ + 8000 + 16000 + ] + in_channels [ 1 ] + } + # 2ch 16-bit 48k + { + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + in_channels [ 2 ] + } + ] } } ] diff --git a/tools/topology/topology2/platform/intel/dmic-wov.conf b/tools/topology/topology2/platform/intel/dmic-wov.conf index 6dc4a2619b8b..0094941e0c74 100644 --- a/tools/topology/topology2/platform/intel/dmic-wov.conf +++ b/tools/topology/topology2/platform/intel/dmic-wov.conf @@ -10,28 +10,22 @@ Object.Pipeline { Object.Widget.host-copier.1 { stream_name $DMIC1_PCM_CAPS pcm_id 11 - Object.Base.audio_format.1 { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 32 - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_rate 16000 - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_rate 16000 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + num_output_audio_formats 2 + Object.Base.output_audio_format [ + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate 16000 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } } ] @@ -55,28 +49,37 @@ Object.Pipeline { node_type $DMIC_LINK_INPUT_CLASS num_input_audio_formats 2 num_output_audio_formats 2 - Object.Base.audio_format.1 { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 32 - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - Object.Base.audio_format.2 { - in_rate 16000 - in_channels 4 - in_bit_depth 32 - in_valid_bit_depth 32 - out_rate 16000 - out_channels 4 - out_bit_depth 32 - out_valid_bit_depth 32 - in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - in_ch_map $CHANNEL_MAP_3_POINT_1 - out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 - out_ch_map $CHANNEL_MAP_3_POINT_1 - } + Object.Base.input_audio_format [ + { + in_rate 16000 + in_bit_depth 32 + in_valid_bit_depth 32 + } + { + in_rate 16000 + in_channels 4 + in_bit_depth 32 + in_valid_bit_depth 32 + in_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + in_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] + + Object.Base.output_audio_format [ + { + out_rate 16000 + out_bit_depth 32 + out_valid_bit_depth 32 + } + { + out_rate 16000 + out_channels 4 + out_bit_depth 32 + out_valid_bit_depth 32 + out_ch_cfg $CHANNEL_CONFIG_3_POINT_1 + out_ch_map $CHANNEL_MAP_3_POINT_1 + } + ] } Object.Widget.kpb.1 { From 2eeae16d2414dbb966cd617dbdb6640be04a43f2 Mon Sep 17 00:00:00 2001 From: Jyri Sarha <jyri.sarha@linux.intel.com> Date: Thu, 19 Oct 2023 21:33:32 +0300 Subject: [PATCH 585/639] topology2: doc: Fix main page The main page sources were dropped out from the document sources in the last review rounds of the original PR. Add *.doxy to FILE_PATTERNS to add it back. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com> --- tools/topology/topology2/doc/sof.doxygen.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology2/doc/sof.doxygen.in b/tools/topology/topology2/doc/sof.doxygen.in index d964c58258da..8e278f79bfa3 100644 --- a/tools/topology/topology2/doc/sof.doxygen.in +++ b/tools/topology/topology2/doc/sof.doxygen.in @@ -12,7 +12,7 @@ INPUT = @top_srcdir@ \ @top_bindir@/contents.doxy RECURSIVE = YES -FILE_PATTERNS = *.conf +FILE_PATTERNS = *.conf,*.doxy IMAGE_PATH = QUIET = YES WARN_LOGFILE = doxygen_warnings.txt From 3f2ebb81d0aa1f086d77a4ec5ee13eb90421b3ae Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 10:55:48 +0300 Subject: [PATCH 586/639] Tools: Tune: TDFB: Add support for IPC4 and tplg2 blobs This patch adds generation of.conf format blobs for tplg2 with IPC4 format blob. The blob ABI header retrieving is changed to common helper functions path those already have the support. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/tune/tdfb/bf_blob_pack.m | 4 +- tools/tune/tdfb/bf_defaults.m | 7 +- tools/tune/tdfb/bf_export.m | 58 +++++++--- tools/tune/tdfb/bf_filenames_helper.m | 20 +++- .../tdfb/example_line_0mm36mm146mm182mm.m | 7 +- tools/tune/tdfb/example_pass_config.m | 13 ++- tools/tune/tdfb/example_two_beams.m | 104 +++++++++++------- 7 files changed, 146 insertions(+), 67 deletions(-) diff --git a/tools/tune/tdfb/bf_blob_pack.m b/tools/tune/tdfb/bf_blob_pack.m index 097d04cee431..306c16a6ad99 100644 --- a/tools/tune/tdfb/bf_blob_pack.m +++ b/tools/tune/tdfb/bf_blob_pack.m @@ -1,4 +1,4 @@ -function blob8 = bf_blob_pack(bf) +function blob8 = bf_blob_pack(bf, ipc_version) %% Pack TDFB struct to bytes % @@ -143,7 +143,7 @@ nbytes_data = nb16 * 2; %% Get ABI information -[abi_bytes, nbytes_abi] = eq_get_abi(nbytes_data); +[abi_bytes, nbytes_abi] = get_abi(nbytes_data, ipc_version); %% Initialize uint8 array with correct size nbytes = nbytes_abi + nbytes_data; diff --git a/tools/tune/tdfb/bf_defaults.m b/tools/tune/tdfb/bf_defaults.m index 2d448d08fc3a..3bf4e834cf60 100644 --- a/tools/tune/tdfb/bf_defaults.m +++ b/tools/tune/tdfb/bf_defaults.m @@ -19,8 +19,10 @@ bf.array_angle = [0 0 0]; % Array rotation angles for xyz bf.tplg_fn = ''; bf.sofctl_fn = ''; -bf.tplg_path = '../../topology/topology1/m4/tdfb'; -bf.sofctl_path = '../../ctl/tdfb'; +bf.tplg1_path = '../../topology/topology1/m4/tdfb'; +bf.tplg2_path = '../../topology/topology2/include/components/tdfb'; +bf.sofctl3_path = '../../ctl/ipc3/tdfb'; +bf.sofctl4_path = '../../ctl/ipc4/tdfb'; bf.data_path = './data'; bf.endian = 'little'; bf.fn = 1; @@ -56,5 +58,6 @@ bf.diffuse_fn = {''}; bf.random_fn = {''}; bf.mat_fn = {''}; +bf.export_note = ''; end diff --git a/tools/tune/tdfb/bf_export.m b/tools/tune/tdfb/bf_export.m index 9f52bedf8a8a..7b39e71cfe02 100644 --- a/tools/tune/tdfb/bf_export.m +++ b/tools/tune/tdfb/bf_export.m @@ -1,8 +1,10 @@ % bf_export(bf) % % Inputs -% bf.sofctl_fn ..... filename of ascii text format blob -% bf.tplg_fn ....... filename of topology m4 format blob +% bf.sofctl3_fn .... filename of ascii text format blob +% bf.sofctl4_fn .... filename of ascii text format blob +% bf.tplg1_fn ...... filename of topology m4 format blob +% bf.tplg2_fn ...... filename of topology m4 format blob % bf ............... the design procedure output % SPDX-License-Identifier: BSD-3-Clause @@ -13,7 +15,8 @@ function bf = bf_export(bf) -% Use functionc from EQ tool, test utils +% Use functionc from common, test utils +addpath('../common'); addpath('../eq'); addpath('../../test/audio/test_utils'); @@ -73,23 +76,50 @@ %% Build blob bf.all_filters = filters; -bp = bf_blob_pack(bf); +bp3 = bf_blob_pack(bf, 3); +bp4 = bf_blob_pack(bf, 4); %% Export -if isempty(bf.sofctl_fn) - fprintf(1, 'No sof-ctl output file specified.\n'); +if isempty(bf.sofctl3_fn) + fprintf(1, 'No sof-ctl3 output file specified.\n'); else - fprintf(1, 'Exporting to %s\n', bf.sofctl_fn); - mkdir_check(bf.sofctl_path); - eq_alsactl_write(bf.sofctl_fn, bp); + fprintf(1, 'Exporting to %s\n', bf.sofctl3_fn); + mkdir_check(bf.sofctl3_path); + alsactl_write(bf.sofctl3_fn, bp3); end -if isempty(bf.tplg_fn) - fprintf(1, 'No topology output file specified.\n'); +if isempty(bf.sofctl4_fn) + fprintf(1, 'No sof-ctl4 output file specified.\n'); else - fprintf(1, 'Exporting to %s\n', bf.tplg_fn); - mkdir_check(bf.tplg_path); - eq_tplg_write(bf.tplg_fn, bp, 'DEF_TDFB_PRIV'); + fprintf(1, 'Exporting to %s\n', bf.sofctl4_fn); + mkdir_check(bf.sofctl4_path); + alsactl_write(bf.sofctl4_fn, bp4); end +if isempty(bf.export_note) + export_note = sprintf("Exported with script example_%s_array.m", bf.array); +else + export_note = bf.export_note; +end + +if isempty(bf.tplg1_fn) + fprintf(1, 'No topology1 output file specified.\n'); +else + fprintf(1, 'Exporting to %s\n', bf.tplg1_fn); + mkdir_check(bf.tplg1_path); + tplg_write(bf.tplg1_fn, bp3, 'DEF_TDFB_PRIV', export_note); +end + +if isempty(bf.tplg2_fn) + fprintf(1, 'No topology2 output file specified.\n'); +else + fprintf(1, 'Exporting to %s\n', bf.tplg2_fn); + mkdir_check(bf.tplg2_path); + tplg2_write(bf.tplg2_fn, bp4, "tdfb_config", export_note); +end + +rmpath('../../test/audio/test_utils'); +rmpath('../eq'); +rmpath('../common'); + end diff --git a/tools/tune/tdfb/bf_filenames_helper.m b/tools/tune/tdfb/bf_filenames_helper.m index dcd09531f479..7fd446df37b3 100644 --- a/tools/tune/tdfb/bf_filenames_helper.m +++ b/tools/tune/tdfb/bf_filenames_helper.m @@ -34,18 +34,26 @@ [az_str_pm] = angles_to_str(bf.steer_az); [el_str_pm] = angles_to_str(bf.steer_el); +if strcmp(bf.array, 'line') + el_str_show = ''; +else + el_str_show = sprintf('_el%s', el_str_pm); +end + if nargin > 1 - idstr = sprintf('%s_az%sel%sdeg_%dkhz', ... - id, az_str_pm, el_str_pm, round(bf.fs/1e3)); + idstr = sprintf('%s_az%s%s_%dkhz', ... + id, az_str_pm, el_str_show, round(bf.fs/1e3)); else - idstr = sprintf('%s%s_%smm_az%sel%sdeg_%dkhz', ... + idstr = sprintf('%s%s_%smm_az%s%s_%dkhz', ... bf.array, mic_n_str, mic_d_str, ... - az_str_pm, el_str_pm, round(bf.fs/1e3)); + az_str_pm, el_str_show, round(bf.fs/1e3)); end % Contain multiple (az, el) angles -bf.sofctl_fn = fullfile(bf.sofctl_path, sprintf('coef_%s.txt', idstr)); -bf.tplg_fn = fullfile(bf.tplg_path, sprintf('coef_%s.m4', idstr)); +bf.sofctl3_fn = fullfile(bf.sofctl3_path, sprintf('coef_%s.txt', idstr)); +bf.tplg1_fn = fullfile(bf.tplg1_path, sprintf('coef_%s.m4', idstr)); +bf.sofctl4_fn = fullfile(bf.sofctl4_path, sprintf('%s.txt', idstr)); +bf.tplg2_fn = fullfile(bf.tplg2_path, sprintf('%s.conf', idstr)); for n = 1:length(bf.steer_az) diff --git a/tools/tune/tdfb/example_line_0mm36mm146mm182mm.m b/tools/tune/tdfb/example_line_0mm36mm146mm182mm.m index c78ac881b240..d8532b240e4a 100644 --- a/tools/tune/tdfb/example_line_0mm36mm146mm182mm.m +++ b/tools/tune/tdfb/example_line_0mm36mm146mm182mm.m @@ -16,8 +16,10 @@ function example_line_0mm36mm146mm182mm() function line_xyz(fs, fir_length, az) -tplg_fn = sprintf('coef_line4_0mm36mm146mm182mm_%dkhz.m4', fs/1e3); -sofctl_fn = sprintf('coef_line4_0mm36mm146mm182mm_%dkhz.txt', fs/1e3); +tplg1_fn = sprintf('coef_line4_0mm36mm146mm182mm_%dkhz.m4', fs/1e3); +sofctl3_fn = sprintf('coef_line4_0mm36mm146mm182mm_%dkhz.txt', fs/1e3); +tplg2_fn = sprintf('line4_0mm36mm146mm182mm_%dkhz.conf', fs/1e3); +sofctl4_fn = sprintf('line4_0mm36mm146mm182mm_%dkhz.txt', fs/1e3); % Get defaults close all; @@ -52,6 +54,7 @@ function line_xyz(fs, fir_length, az) bf = bf_design(bf); % Export files for topology and sof-ctl +bf.export_note = 'Created with script example_line_0mm36mm146mm182mm.m'; bf_export(bf); end diff --git a/tools/tune/tdfb/example_pass_config.m b/tools/tune/tdfb/example_pass_config.m index 84b2251d242c..b65d48d218aa 100644 --- a/tools/tune/tdfb/example_pass_config.m +++ b/tools/tune/tdfb/example_pass_config.m @@ -27,8 +27,11 @@ function example_pass_config() bf.w = [1 0 0 0; 1 0 0 0]'; % Two FIR filters with first tap set to one % Files -bf.sofctl_fn = fullfile(bf.sofctl_path, 'coef_line2_pass.txt'); -bf.tplg_fn = fullfile(bf.tplg_path, 'coef_line2_pass.m4'); +bf.export_note = 'Exported with script example_pass_config.m'; +bf.sofctl3_fn = fullfile(bf.sofctl3_path, 'coef_line2_pass.txt'); +bf.tplg1_fn = fullfile(bf.tplg1_path, 'coef_line2_pass.m4'); +bf.sofctl4_fn = fullfile(bf.sofctl4_path, 'line2_pass.txt'); +bf.tplg2_fn = fullfile(bf.tplg2_path, 'line2_pass.conf'); bf_export(bf); % Setup for four channels @@ -43,8 +46,10 @@ function example_pass_config() bf.w = [1 0 0 0; 1 0 0 0; 1 0 0 0; 1 0 0 0]'; % Four FIR filters with first tap set to one % Files -bf.sofctl_fn = fullfile(bf.sofctl_path, 'coef_line4_pass.txt'); -bf.tplg_fn = fullfile(bf.tplg_path, 'coef_line4_pass.m4'); +bf.sofctl3_fn = fullfile(bf.sofctl3_path, 'coef_line4_pass.txt'); +bf.tplg1_fn = fullfile(bf.tplg1_path, 'coef_line4_pass.m4'); +bf.sofctl4_fn = fullfile(bf.sofctl4_path, 'line4_pass.txt'); +bf.tplg2_fn = fullfile(bf.tplg2_path, 'line4_pass.conf'); bf_export(bf); end diff --git a/tools/tune/tdfb/example_two_beams.m b/tools/tune/tdfb/example_two_beams.m index 65d998e61f78..5db6b9da094d 100644 --- a/tools/tune/tdfb/example_two_beams.m +++ b/tools/tune/tdfb/example_two_beams.m @@ -25,44 +25,54 @@ function example_two_beams() close all; %% 2 mic 50 mm array - tplg_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line2_50mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line2_50mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 50e-3; % 50 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line2_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 1); + line2_two_beams(fs, d, a1, a2, fn, 1); %% 2 mic 68 mm array - tplg_fn = sprintf('coef_line2_68mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line2_68mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line2_68mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line2_68mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line2_68mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line2_68mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 68e-3; % 68 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line2_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 1); + line2_two_beams(fs, d, a1, a2, fn, 1); %% 4 mic 28 mm spaced array - tplg_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line4_28mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line4_28mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 28e-3; % 28 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line4_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 1); + line4_two_beams(fs, d, a1, a2, fn, 1); %% 4 mic 68 mm spaced array - tplg_fn = sprintf('coef_line4_68mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line4_68mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line4_68mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line4_68mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line4_68mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line4_68mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 68e-3; % 68 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line4_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 1); + line4_two_beams(fs, d, a1, a2, fn, 1); %% 4 mic 78 mm spaced array - tplg_fn = sprintf('coef_line4_78mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line4_78mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line4_78mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line4_78mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line4_78mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line4_78mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 78e-3; % 78 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line4_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 1); + line4_two_beams(fs, d, a1, a2, fn, 1); end %% Export blob with just +/- 90 deg beams for testbench beampattern check @@ -71,29 +81,35 @@ function example_two_beams() azstr = az_to_string(az); for fs = [16e3 48e3] %% 2 mic 50 mm array, disable beam off description in blob to force processing on - tplg_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line2_50mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line2_50mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line2_50mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 50e-3; % 50 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line2_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 0); + line2_two_beams(fs, d, a1, a2, fn, 0); %% 4 mic 28 mm spaced array, no beam off configuration - tplg_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg1_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_line4_28mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('line4_28mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('line4_28mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); d = 28e-3; % 28 mm spacing a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg - line4_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, 0); + line4_two_beams(fs, d, a1, a2, fn, 0); end %% Circular array with two beams az = 30; azstr = az_to_string(az); for fs = [48e3 16e3] - tplg_fn = sprintf('coef_circular8_100mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); - sofctl_fn = sprintf('coef_circular8_100mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); - circular_two_beams(fs, 100e-3, 8, az, -az, tplg_fn, sofctl_fn, 0); + fn.tplg1_fn = sprintf('coef_circular8_100mm_pm%sdeg_%dkhz.m4', azstr, fs/1e3); + fn.sofctl3_fn = sprintf('coef_circular8_100mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + fn.tplg2_fn = sprintf('coef_circular8_100mm_pm%sdeg_%dkhz.conf', azstr, fs/1e3); + fn.sofctl4_fn = sprintf('coef_circular8_100mm_pm%sdeg_%dkhz.txt', azstr, fs/1e3); + circular_two_beams(fs, 100e-3, 8, az, -az, fn, 0); end %% Creates beamformer with two beams for device with device with microphones @@ -110,7 +126,7 @@ function example_two_beams() end end -function line2_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, add_beam_off); +function line2_two_beams(fs, d, a1, a2, fn, add_beam_off); % Get defaults bf1 = bf_defaults(); @@ -152,15 +168,18 @@ function example_two_beams() % Merge two beamformers into single description, set file names bfm = bf_merge(bf1, bf2); -bfm.sofctl_fn = fullfile(bfm.sofctl_path, sofctl_fn); -bfm.tplg_fn = fullfile(bfm.tplg_path, tplg_fn); +bfm.sofctl3_fn = fullfile(bfm.sofctl3_path, fn.sofctl3_fn); +bfm.tplg1_fn = fullfile(bfm.tplg1_path, fn.tplg1_fn); +bfm.sofctl4_fn = fullfile(bfm.sofctl4_path, fn.sofctl4_fn); +bfm.tplg2_fn = fullfile(bfm.tplg2_path, fn.tplg2_fn); % Export files for topology and sof-ctl +bfm.export_note = 'Created with script example_two_beams.m'; bf_export(bfm); end -function line4_two_beams(fs, d, a1, a2, tplg_fn, sofctl_fn, add_beam_off); +function line4_two_beams(fs, d, a1, a2, fn, add_beam_off); % Get defaults bf1 = bf_defaults(); @@ -201,15 +220,18 @@ function example_two_beams() % Merge two beamformers into single description, set file names bfm = bf_merge(bf1, bf2); -bfm.sofctl_fn = fullfile(bfm.sofctl_path, sofctl_fn); -bfm.tplg_fn = fullfile(bfm.tplg_path, tplg_fn); +bfm.sofctl3_fn = fullfile(bfm.sofctl3_path, fn.sofctl3_fn); +bfm.tplg1_fn = fullfile(bfm.tplg1_path, fn.tplg1_fn); +bfm.sofctl4_fn = fullfile(bfm.sofctl4_path, fn.sofctl4_fn); +bfm.tplg2_fn = fullfile(bfm.tplg2_path, fn.tplg2_fn); % Export files for topology and sof-ctl +bfm.export_note = 'Created with script example_two_beams.m'; bf_export(bfm); end -function circular_two_beams(fs, r, n, a1, a2, tplg_fn, sofctl_fn, add_beam_off) +function circular_two_beams(fs, r, n, a1, a2, fn, add_beam_off) % Get defaults and common settings bf1 = bf_defaults(); @@ -244,10 +266,13 @@ function circular_two_beams(fs, r, n, a1, a2, tplg_fn, sofctl_fn, add_beam_off) % Merge two beamformers into single description, set file names bfm = bf_merge(bf1, bf2); -bfm.sofctl_fn = fullfile(bfm.sofctl_path, sofctl_fn); -bfm.tplg_fn = fullfile(bfm.tplg_path, tplg_fn); +bfm.sofctl3_fn = fullfile(bfm.sofctl3_path, fn.sofctl3_fn); +bfm.tplg1_fn = fullfile(bfm.tplg1_path, fn.tplg1_fn); +bfm.sofctl4_fn = fullfile(bfm.sofctl4_path, fn.sofctl4_fn); +bfm.tplg2_fn = fullfile(bfm.tplg2_path, fn.tplg2_fn); % Export files for topology and sof-ctl +bfm.export_note = 'Created with script example_two_beams.m'; bf_export(bfm); end @@ -273,8 +298,10 @@ function line_xyz(fs) end % Setup array -tplg_fn = sprintf('coef_line4_0mm36mm146mm182mm_%s_%dkhz.m4', azstr, fs/1e3); -sofctl_fn = sprintf('coef_line4_0mm36mm146mm182mm_%s_%dkhz.txt', azstr, fs/1e3); +tplg1_fn = sprintf('coef_line4_0mm36mm146mm182mm_%s_%dkhz.m4', azstr, fs/1e3); +sofctl3_fn = sprintf('coef_line4_0mm36mm146mm182mm_%s_%dkhz.txt', azstr, fs/1e3); +tplg2_fn = sprintf('line4_0mm36mm146mm182mm_%s_%dkhz.conf', azstr, fs/1e3); +sofctl4_fn = sprintf('line4_0mm36mm146mm182mm_%s_%dkhz.txt', azstr, fs/1e3); a1 = az; % Azimuth +az deg a2 = -az; % Azimuth -az deg close all; @@ -317,10 +344,13 @@ function line_xyz(fs) % Merge two beamformers into single description, set file names bfm = bf_merge(bf1, bf2); -bfm.sofctl_fn = fullfile(bfm.sofctl_path, sofctl_fn); -bfm.tplg_fn = fullfile(bfm.tplg_path, tplg_fn); +bfm.sofctl3_fn = fullfile(bfm.sofctl3_path, sofctl3_fn); +bfm.tplg1_fn = fullfile(bfm.tplg1_path, tplg1_fn); +bfm.sofctl4_fn = fullfile(bfm.sofctl4_path, sofctl4_fn); +bfm.tplg2_fn = fullfile(bfm.tplg2_path, tplg2_fn); % Export files for topology and sof-ctl +bfm.export_note = 'Created with script example_two_beams.m'; bf_export(bfm); end From d03dcda88f056f2d16683a6d9aa453831691a4e5 Mon Sep 17 00:00:00 2001 From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Date: Fri, 2 Jun 2023 11:29:30 -0700 Subject: [PATCH 587/639] audio: aria: Add set_large_config op This patch is needed to make the module work with linux and avoid firmware crash. This patch sets the attenuation parameters with the bytes control since the setup parameters can't be passed in init() as in Windows OS. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/audio/aria/aria.c | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/src/audio/aria/aria.c b/src/audio/aria/aria.c index 9ca1626e644d..70c93cb4595b 100644 --- a/src/audio/aria/aria.c +++ b/src/audio/aria/aria.c @@ -28,6 +28,8 @@ #include <stddef.h> #include <stdint.h> +#define ARIA_SET_ATTENUATION 1 + LOG_MODULE_REGISTER(aria, CONFIG_SOF_LOG_LEVEL); /* these ids aligns windows driver requirement to support windows driver */ @@ -46,11 +48,17 @@ static size_t get_required_emory(size_t chan_cnt, size_t smpl_group_cnt) return ALIGN_UP(num_of_ms * chan_cnt * smpl_group_cnt, 2) * sizeof(int32_t); } +static void aria_set_gains(struct aria_data *cd) +{ + int i; + + for (i = 0; i < ARIA_MAX_GAIN_STATES; ++i) + cd->gains[i] = (1ULL << (32 - cd->att - 1)) - 1; +} + static int aria_algo_init(struct aria_data *cd, void *buffer_desc, size_t att, size_t chan_cnt, size_t smpl_group_cnt) { - size_t idx; - cd->chan_cnt = chan_cnt; cd->smpl_group_cnt = smpl_group_cnt; /* ensures buffer size is aligned to 8 bytes */ @@ -62,8 +70,7 @@ static int aria_algo_init(struct aria_data *cd, void *buffer_desc, cd->data_end = cd->data_addr + cd->buff_size; cd->buff_pos = 0; - for (idx = 0; idx < ARIA_MAX_GAIN_STATES; ++idx) - cd->gains[idx] = (1ULL << (32 - cd->att - 1)) - 1; + aria_set_gains(cd); memset((void *)cd->data_addr, 0, sizeof(int32_t) * cd->buff_size); cd->gain_state = 0; @@ -249,12 +256,35 @@ static int aria_process(struct processing_module *mod, return 0; } +static int aria_set_config(struct processing_module *mod, uint32_t param_id, + enum module_cfg_fragment_position pos, uint32_t data_offset_size, + const uint8_t *fragment, size_t fragment_size, uint8_t *response, + size_t response_size) +{ + struct aria_data *cd = module_get_private_data(mod); + + if (param_id == ARIA_SET_ATTENUATION) { + if (fragment_size != sizeof(uint32_t)) { + comp_err(mod->dev, "Illegal fragment_size = %d", fragment_size); + return -EINVAL; + } + memcpy_s(&cd->att, sizeof(uint32_t), fragment, sizeof(uint32_t)); + aria_set_gains(cd); + } else { + comp_err(mod->dev, "Illegal param_id = %d", param_id); + return -EINVAL; + } + + return 0; +} + static const struct module_interface aria_interface = { .init = aria_init, .prepare = aria_prepare, .process_audio_stream = aria_process, .reset = aria_reset, - .free = aria_free + .free = aria_free, + .set_configuration = aria_set_config, }; DECLARE_MODULE_ADAPTER(aria_interface, aria_comp_uuid, aria_comp_tr); From 76754b52d0fb2e20702e25bb36666743e28083eb Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 18 Oct 2023 16:41:24 +0300 Subject: [PATCH 588/639] App: Intel: Enable Aria build for TGL and TGL-H platforms Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- app/boards/intel_adsp_cavs25.conf | 1 + app/boards/intel_adsp_cavs25_tgph.conf | 1 + 2 files changed, 2 insertions(+) diff --git a/app/boards/intel_adsp_cavs25.conf b/app/boards/intel_adsp_cavs25.conf index 196726580e6a..c247fb8a339f 100644 --- a/app/boards/intel_adsp_cavs25.conf +++ b/app/boards/intel_adsp_cavs25.conf @@ -30,6 +30,7 @@ CONFIG_COMP_VOLUME_WINDOWS_FADE=y CONFIG_COMP_DRC=y CONFIG_COMP_CROSSOVER=y CONFIG_COMP_MULTIBAND_DRC=y +CONFIG_COMP_ARIA=y # route SOF logs to Zephyr logging subsystem CONFIG_SOF_LOG_LEVEL_INF=y diff --git a/app/boards/intel_adsp_cavs25_tgph.conf b/app/boards/intel_adsp_cavs25_tgph.conf index 47523b196375..2b110c073e43 100644 --- a/app/boards/intel_adsp_cavs25_tgph.conf +++ b/app/boards/intel_adsp_cavs25_tgph.conf @@ -29,6 +29,7 @@ CONFIG_COMP_VOLUME_WINDOWS_FADE=y CONFIG_COMP_DRC=y CONFIG_COMP_CROSSOVER=y CONFIG_COMP_MULTIBAND_DRC=y +CONFIG_COMP_ARIA=y # route SOF logs to Zephyr logging subsystem CONFIG_SOF_LOG_LEVEL_INF=y From e1141669830f448a63176945e0a8555c9bcfe6e3 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 19 Oct 2023 20:00:30 +0000 Subject: [PATCH 589/639] Delete inherited tools/rimage/.gitignore rimage is not so special that it needs its personalized .gitignore Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 tools/rimage/.gitignore diff --git a/tools/rimage/.gitignore b/tools/rimage/.gitignore deleted file mode 100644 index 7693903fddf6..000000000000 --- a/tools/rimage/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build/ -.checkpatch-camelcase.git.* From 9a9fa5d6fbdcd61582761acf2d17aedd332254f9 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Tue, 17 Oct 2023 14:24:24 +0800 Subject: [PATCH 590/639] audio: eq_iir: move iir header file to its own directory move header file from include path to its directory path. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/eq_iir/eq_iir.c | 2 +- src/{include/sof => }/audio/eq_iir/eq_iir.h | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/{include/sof => }/audio/eq_iir/eq_iir.h (100%) diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index 76f187ce04f0..a0b177d65a10 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -6,11 +6,11 @@ // Liam Girdwood <liam.r.girdwood@linux.intel.com> // Keyon Jie <yang.jie@linux.intel.com> +#include "eq_iir.h" #include <sof/audio/component.h> #include <sof/audio/module_adapter/module/generic.h> #include <sof/audio/data_blob.h> #include <sof/audio/buffer.h> -#include <sof/audio/eq_iir/eq_iir.h> #include <sof/audio/format.h> #include <sof/audio/pipeline.h> #include <sof/audio/ipc-config.h> diff --git a/src/include/sof/audio/eq_iir/eq_iir.h b/src/audio/eq_iir/eq_iir.h similarity index 100% rename from src/include/sof/audio/eq_iir/eq_iir.h rename to src/audio/eq_iir/eq_iir.h From c1ba0949f7a9bad529cce53096a1d87ec93baaf3 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 10:54:03 +0800 Subject: [PATCH 591/639] audio: eq_iir: move iir structure definition to header file this structure is common for both ipc3 and ipc4, move it to header file. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/eq_iir/eq_iir.c | 11 ----------- src/audio/eq_iir/eq_iir.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index a0b177d65a10..a7da4c5209b9 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -22,7 +22,6 @@ #include <sof/lib/memory.h> #include <sof/lib/uuid.h> #include <sof/list.h> -#include <sof/math/iir_df1.h> #include <sof/platform.h> #include <rtos/string.h> #include <sof/ut.h> @@ -44,16 +43,6 @@ DECLARE_SOF_RT_UUID("eq-iir", eq_iir_uuid, 0x5150c0e6, 0x27f9, 0x4ec8, DECLARE_TR_CTX(eq_iir_tr, SOF_UUID(eq_iir_uuid), LOG_LEVEL_INFO); -/* IIR component private data */ -struct comp_data { - struct iir_state_df1 iir[PLATFORM_MAX_CHANNELS]; /**< filters state */ - struct comp_data_blob_handler *model_handler; - struct sof_eq_iir_config *config; - int32_t *iir_delay; /**< pointer to allocated RAM */ - size_t iir_delay_size; /**< allocated size */ - eq_iir_func eq_iir_func; /**< processing function */ -}; - #if CONFIG_FORMAT_S16LE /* diff --git a/src/audio/eq_iir/eq_iir.h b/src/audio/eq_iir/eq_iir.h index bcd4f9d79280..68ff9bb51a6f 100644 --- a/src/audio/eq_iir/eq_iir.h +++ b/src/audio/eq_iir/eq_iir.h @@ -13,6 +13,7 @@ #include <stdint.h> #include <sof/audio/module_adapter/module/generic.h> #include <sof/math/iir_df2t.h> +#include <sof/math/iir_df1.h> /** \brief Macros to convert without division bytes count to samples count */ #define EQ_IIR_BYTES_TO_S16_SAMPLES(b) ((b) >> 1) @@ -32,6 +33,16 @@ struct eq_iir_func_map { eq_iir_func func; /**< processing function */ }; +/* IIR component private data */ +struct comp_data { + struct iir_state_df1 iir[PLATFORM_MAX_CHANNELS]; /**< filters state */ + struct comp_data_blob_handler *model_handler; + struct sof_eq_iir_config *config; + int32_t *iir_delay; /**< pointer to allocated RAM */ + size_t iir_delay_size; /**< allocated size */ + eq_iir_func eq_iir_func; /**< processing function */ +}; + #ifdef UNIT_TEST void sys_comp_module_eq_iir_interface_init(void); #endif From 0153f9f2faf4f127a7f2168b641cac3862603dd7 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 11:12:13 +0800 Subject: [PATCH 592/639] audio: eq_iir: public common functions for ipc3 and ipc4 this is preparation for later ipc3 and ipc4 code split out from eq_iir.c, these common functions will be used both by ipc3 and ipc4. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/eq_iir/eq_iir.c | 12 ++++++------ src/audio/eq_iir/eq_iir.h | 9 +++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index a7da4c5209b9..0bd8dc82bfe9 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -49,8 +49,8 @@ DECLARE_TR_CTX(eq_iir_tr, SOF_UUID(eq_iir_uuid), LOG_LEVEL_INFO); * EQ IIR algorithm code */ -static void eq_iir_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) +void eq_iir_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); struct audio_stream *source = bsource->data; @@ -97,8 +97,8 @@ static void eq_iir_s16_default(struct processing_module *mod, struct input_strea #if CONFIG_FORMAT_S24LE -static void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) +void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); struct audio_stream *source = bsource->data; @@ -145,8 +145,8 @@ static void eq_iir_s24_default(struct processing_module *mod, struct input_strea #if CONFIG_FORMAT_S32LE -static void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) +void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) { struct comp_data *cd = module_get_private_data(mod); struct audio_stream *source = bsource->data; diff --git a/src/audio/eq_iir/eq_iir.h b/src/audio/eq_iir/eq_iir.h index 68ff9bb51a6f..583a87c4a30a 100644 --- a/src/audio/eq_iir/eq_iir.h +++ b/src/audio/eq_iir/eq_iir.h @@ -47,4 +47,13 @@ struct comp_data { void sys_comp_module_eq_iir_interface_init(void); #endif +void eq_iir_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames); + +void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames); + +void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames); + #endif /* __SOF_AUDIO_EQ_IIR_EQ_IIR_H__ */ From 9e0f7eecec85519c978c562d2df9c688564205d4 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 11:59:24 +0800 Subject: [PATCH 593/639] audio: eq_iir: create generic/ipc3/ipc4 source files for eq_iir Create generic ipc3 ipc4 source files and move related code into these source files. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/CMakeLists.txt | 2 + src/audio/eq_iir/CMakeLists.txt | 7 +- src/audio/eq_iir/eq_iir.c | 692 +----------------- src/audio/eq_iir/eq_iir.h | 16 + src/audio/eq_iir/eq_iir_generic.c | 346 +++++++++ src/audio/eq_iir/eq_iir_ipc3.c | 336 +++++++++ src/audio/eq_iir/eq_iir_ipc4.c | 151 ++++ test/cmocka/src/audio/eq_iir/CMakeLists.txt | 2 + test/cmocka/src/audio/eq_iir/eq_iir_process.c | 2 +- zephyr/CMakeLists.txt | 16 +- 10 files changed, 874 insertions(+), 696 deletions(-) create mode 100644 src/audio/eq_iir/eq_iir_generic.c create mode 100644 src/audio/eq_iir/eq_iir_ipc3.c create mode 100644 src/audio/eq_iir/eq_iir_ipc4.c diff --git a/src/audio/CMakeLists.txt b/src/audio/CMakeLists.txt index 7e58fd55d929..425756f7e4d5 100644 --- a/src/audio/CMakeLists.txt +++ b/src/audio/CMakeLists.txt @@ -175,9 +175,11 @@ set(sof_audio_modules mixer volume src asrc eq-fir eq-iir dcblock crossover tdfb if(CONFIG_IPC_MAJOR_3) set(volume_sources volume/volume.c volume/volume_generic.c volume/volume_ipc3.c) set(src_sources src/src.c src/src_ipc3.c src/src_generic.c) + set(eq-iir_sources eq_iir/eq_iir_ipc3.c eq_iir/eq_iir_generic.c) elseif(CONFIG_IPC_MAJOR_4) set(volume_sources volume/volume.c volume/volume_generic.c volume/volume_ipc4.c) set(src_sources src/src.c src/src_ipc4.c src/src_generic.c) + set(eq-iir_sources eq_iir/eq_iir_ipc4.c eq_iir/eq_iir_generic.c) endif() set(mixer_sources ${mixer_src}) set(asrc_sources asrc/asrc.c asrc/asrc_farrow.c asrc/asrc_farrow_generic.c) diff --git a/src/audio/eq_iir/CMakeLists.txt b/src/audio/eq_iir/CMakeLists.txt index 498946370528..0c9853540ad5 100644 --- a/src/audio/eq_iir/CMakeLists.txt +++ b/src/audio/eq_iir/CMakeLists.txt @@ -1,3 +1,8 @@ # SPDX-License-Identifier: BSD-3-Clause -add_local_sources(sof eq_iir.c) +add_local_sources(sof eq_iir.c eq_iir_generic.c) +if(CONFIG_IPC_MAJOR_3) + add_local_sources(sof eq_iir_ipc3.c) +elseif(CONFIG_IPC_MAJOR_4) + add_local_sources(sof eq_iir_ipc4.c) +endif() diff --git a/src/audio/eq_iir/eq_iir.c b/src/audio/eq_iir/eq_iir.c index 0bd8dc82bfe9..2a91a08165a2 100644 --- a/src/audio/eq_iir/eq_iir.c +++ b/src/audio/eq_iir/eq_iir.c @@ -43,575 +43,6 @@ DECLARE_SOF_RT_UUID("eq-iir", eq_iir_uuid, 0x5150c0e6, 0x27f9, 0x4ec8, DECLARE_TR_CTX(eq_iir_tr, SOF_UUID(eq_iir_uuid), LOG_LEVEL_INFO); -#if CONFIG_FORMAT_S16LE - -/* - * EQ IIR algorithm code - */ - -void eq_iir_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct comp_data *cd = module_get_private_data(mod); - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - struct iir_state_df1 *filter; - int16_t *x0; - int16_t *y0; - int16_t *x; - int16_t *y; - int nmax; - int n1; - int n2; - int i; - int j; - int n; - const int nch = audio_stream_get_channels(source); - const int samples = frames * nch; - int processed = 0; - - x = audio_stream_get_rptr(source); - y = audio_stream_get_wptr(sink); - while (processed < samples) { - nmax = samples - processed; - n1 = audio_stream_bytes_without_wrap(source, x) >> 1; - n2 = audio_stream_bytes_without_wrap(sink, y) >> 1; - n = MIN(n1, n2); - n = MIN(n, nmax); - for (i = 0; i < nch; i++) { - x0 = x + i; - y0 = y + i; - filter = &cd->iir[i]; - for (j = 0; j < n; j += nch) { - *y0 = iir_df1_s16(filter, *x0); - x0 += nch; - y0 += nch; - } - } - processed += n; - x = audio_stream_wrap(source, x + n); - y = audio_stream_wrap(sink, y + n); - } -} -#endif /* CONFIG_FORMAT_S16LE */ - -#if CONFIG_FORMAT_S24LE - -void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct comp_data *cd = module_get_private_data(mod); - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - struct iir_state_df1 *filter; - int32_t *x0; - int32_t *y0; - int32_t *x; - int32_t *y; - int nmax; - int n1; - int n2; - int i; - int j; - int n; - const int nch = audio_stream_get_channels(source); - const int samples = frames * nch; - int processed = 0; - - x = audio_stream_get_rptr(source); - y = audio_stream_get_wptr(sink); - while (processed < samples) { - nmax = samples - processed; - n1 = audio_stream_bytes_without_wrap(source, x) >> 2; - n2 = audio_stream_bytes_without_wrap(sink, y) >> 2; - n = MIN(n1, n2); - n = MIN(n, nmax); - for (i = 0; i < nch; i++) { - x0 = x + i; - y0 = y + i; - filter = &cd->iir[i]; - for (j = 0; j < n; j += nch) { - *y0 = iir_df1_s24(filter, *x0); - x0 += nch; - y0 += nch; - } - } - processed += n; - x = audio_stream_wrap(source, x + n); - y = audio_stream_wrap(sink, y + n); - } -} -#endif /* CONFIG_FORMAT_S24LE */ - -#if CONFIG_FORMAT_S32LE - -void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct comp_data *cd = module_get_private_data(mod); - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - struct iir_state_df1 *filter; - int32_t *x0; - int32_t *y0; - int32_t *x; - int32_t *y; - int nmax; - int n1; - int n2; - int i; - int j; - int n; - const int nch = audio_stream_get_channels(source); - const int samples = frames * nch; - int processed = 0; - - x = audio_stream_get_rptr(source); - y = audio_stream_get_wptr(sink); - while (processed < samples) { - nmax = samples - processed; - n1 = audio_stream_bytes_without_wrap(source, x) >> 2; - n2 = audio_stream_bytes_without_wrap(sink, y) >> 2; - n = MIN(n1, n2); - n = MIN(n, nmax); - for (i = 0; i < nch; i++) { - x0 = x + i; - y0 = y + i; - filter = &cd->iir[i]; - for (j = 0; j < n; j += nch) { - *y0 = iir_df1(filter, *x0); - x0 += nch; - y0 += nch; - } - } - processed += n; - x = audio_stream_wrap(source, x + n); - y = audio_stream_wrap(sink, y + n); - } -} -#endif /* CONFIG_FORMAT_S32LE */ - -#if CONFIG_IPC_MAJOR_3 -#if CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S16LE -static void eq_iir_s32_16_default(struct processing_module *mod, - struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct comp_data *cd = module_get_private_data(mod); - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - struct iir_state_df1 *filter; - int32_t *x0; - int16_t *y0; - int32_t *x; - int16_t *y; - int nmax; - int n1; - int n2; - int i; - int j; - int n; - const int nch = audio_stream_get_channels(source); - const int samples = frames * nch; - int processed = 0; - - x = audio_stream_get_rptr(source); - y = audio_stream_get_wptr(sink); - while (processed < samples) { - nmax = samples - processed; - n1 = audio_stream_bytes_without_wrap(source, x) >> 2; /* divide 4 */ - n2 = audio_stream_bytes_without_wrap(sink, y) >> 1; /* divide 2 */ - n = MIN(n1, n2); - n = MIN(n, nmax); - for (i = 0; i < nch; i++) { - x0 = x + i; - y0 = y + i; - filter = &cd->iir[i]; - for (j = 0; j < n; j += nch) { - *y0 = iir_df1_s32_s16(filter, *x0); - x0 += nch; - y0 += nch; - } - } - processed += n; - x = audio_stream_wrap(source, x + n); - y = audio_stream_wrap(sink, y + n); - } -} -#endif /* CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S16LE */ - -#if CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S24LE -static void eq_iir_s32_24_default(struct processing_module *mod, - struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct comp_data *cd = module_get_private_data(mod); - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - struct iir_state_df1 *filter; - int32_t *x0; - int32_t *y0; - int32_t *x; - int32_t *y; - int nmax; - int n1; - int n2; - int i; - int j; - int n; - const int nch = audio_stream_get_channels(source); - const int samples = frames * nch; - int processed = 0; - - x = audio_stream_get_rptr(source); - y = audio_stream_get_wptr(sink); - while (processed < samples) { - nmax = samples - processed; - n1 = audio_stream_bytes_without_wrap(source, x) >> 2; - n2 = audio_stream_bytes_without_wrap(sink, y) >> 2; - n = MIN(n1, n2); - n = MIN(n, nmax); - for (i = 0; i < nch; i++) { - x0 = x + i; - y0 = y + i; - filter = &cd->iir[i]; - for (j = 0; j < n; j += nch) { - *y0 = iir_df1_s32_s24(filter, *x0); - x0 += nch; - y0 += nch; - } - } - processed += n; - x = audio_stream_wrap(source, x + n); - y = audio_stream_wrap(sink, y + n); - } -} -#endif /* CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S24LE */ -#endif /* CONFIG_IPC_MAJOR_3 */ - -static void eq_iir_pass(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - - audio_stream_copy(source, 0, sink, 0, frames * audio_stream_get_channels(source)); -} - -#if CONFIG_IPC_MAJOR_3 -#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE -static void eq_iir_s32_s16_pass(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - int32_t *x = audio_stream_get_rptr(source); - int16_t *y = audio_stream_get_wptr(sink); - int nmax; - int n; - int i; - int remaining_samples = frames * audio_stream_get_channels(source); - - while (remaining_samples) { - nmax = EQ_IIR_BYTES_TO_S32_SAMPLES(audio_stream_bytes_without_wrap(source, x)); - n = MIN(remaining_samples, nmax); - nmax = EQ_IIR_BYTES_TO_S16_SAMPLES(audio_stream_bytes_without_wrap(sink, y)); - n = MIN(n, nmax); - for (i = 0; i < n; i++) { - *y = sat_int16(Q_SHIFT_RND(*x, 31, 15)); - x++; - y++; - } - remaining_samples -= n; - x = audio_stream_wrap(source, x); - y = audio_stream_wrap(sink, y); - } -} -#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE */ - -#if CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE -static void eq_iir_s32_s24_pass(struct processing_module *mod, struct input_stream_buffer *bsource, - struct output_stream_buffer *bsink, uint32_t frames) -{ - struct audio_stream *source = bsource->data; - struct audio_stream *sink = bsink->data; - int32_t *x = audio_stream_get_rptr(source); - int32_t *y = audio_stream_get_wptr(sink); - int nmax; - int n; - int i; - int remaining_samples = frames * audio_stream_get_channels(source); - - while (remaining_samples) { - nmax = EQ_IIR_BYTES_TO_S32_SAMPLES(audio_stream_bytes_without_wrap(source, x)); - n = MIN(remaining_samples, nmax); - nmax = EQ_IIR_BYTES_TO_S32_SAMPLES(audio_stream_bytes_without_wrap(sink, y)); - n = MIN(n, nmax); - for (i = 0; i < n; i++) { - *y = sat_int24(Q_SHIFT_RND(*x, 31, 23)); - x++; - y++; - } - remaining_samples -= n; - x = audio_stream_wrap(source, x); - y = audio_stream_wrap(sink, y); - } -} -#endif /* CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE */ -#endif /* CONFIG_IPC_MAJOR_3 */ - -#if CONFIG_IPC_MAJOR_3 -const struct eq_iir_func_map fm_configured[] = { -#if CONFIG_FORMAT_S16LE - {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S16_LE, eq_iir_s16_default}, -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE - {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, NULL}, - {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S16_LE, NULL}, - -#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE - {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S32_LE, NULL}, - {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S16_LE, eq_iir_s32_16_default}, -#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE */ -#if CONFIG_FORMAT_S24LE - {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S24_4LE, eq_iir_s24_default}, -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE - {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE, NULL}, - {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S24_4LE, eq_iir_s32_24_default}, -#endif /* CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE */ -#if CONFIG_FORMAT_S32LE - {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S32_LE, eq_iir_s32_default}, -#endif /* CONFIG_FORMAT_S32LE */ -}; - -const struct eq_iir_func_map fm_passthrough[] = { -#if CONFIG_FORMAT_S16LE - {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S16_LE, eq_iir_pass}, -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE - {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, NULL}, - {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S16_LE, NULL}, - -#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE*/ -#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE - {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S32_LE, NULL}, - {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S16_LE, eq_iir_s32_s16_pass}, -#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE*/ -#if CONFIG_FORMAT_S24LE - {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S24_4LE, eq_iir_pass}, -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE - {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE, NULL}, - {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S24_4LE, eq_iir_s32_s24_pass}, -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S32LE - {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S32_LE, eq_iir_pass}, -#endif /* CONFIG_FORMAT_S32LE */ -}; - -static eq_iir_func eq_iir_find_func(enum sof_ipc_frame source_format, - enum sof_ipc_frame sink_format, - const struct eq_iir_func_map *map, - int n) -{ - int i; - - /* Find suitable processing function from map. */ - for (i = 0; i < n; i++) { - if ((uint8_t)source_format != map[i].source) - continue; - if ((uint8_t)sink_format != map[i].sink) - continue; - - return map[i].func; - } - - return NULL; -} - -#elif CONFIG_IPC_MAJOR_4 - -static eq_iir_func eq_iir_find_func(struct processing_module *mod) -{ - unsigned int valid_bit_depth = mod->priv.cfg.base_cfg.audio_fmt.valid_bit_depth; - - comp_dbg(mod->dev, "eq_iir_find_func(): valid_bit_depth %d", valid_bit_depth); - switch (valid_bit_depth) { -#if CONFIG_FORMAT_S16LE - case IPC4_DEPTH_16BIT: - return eq_iir_s16_default; -#endif /* CONFIG_FORMAT_S16LE */ -#if CONFIG_FORMAT_S24LE - case IPC4_DEPTH_24BIT: - return eq_iir_s24_default; -#endif /* CONFIG_FORMAT_S24LE */ -#if CONFIG_FORMAT_S32LE - case IPC4_DEPTH_32BIT: - return eq_iir_s32_default; -#endif /* CONFIG_FORMAT_S32LE */ - default: - comp_err(mod->dev, "set_fir_func(), invalid valid_bith_depth"); - } - return NULL; -} -#endif /* CONFIG_IPC_MAJOR_4 */ - -static void eq_iir_free_delaylines(struct comp_data *cd) -{ - struct iir_state_df1 *iir = cd->iir; - int i = 0; - - /* Free the common buffer for all EQs and point then - * each IIR channel delay line to NULL. - */ - rfree(cd->iir_delay); - cd->iir_delay = NULL; - cd->iir_delay_size = 0; - for (i = 0; i < PLATFORM_MAX_CHANNELS; i++) - iir[i].delay = NULL; -} - -static int eq_iir_init_coef(struct processing_module *mod, int nch) -{ - struct comp_data *cd = module_get_private_data(mod); - struct sof_eq_iir_config *config = cd->config; - struct iir_state_df1 *iir = cd->iir; - struct sof_eq_iir_header *lookup[SOF_EQ_IIR_MAX_RESPONSES]; - struct sof_eq_iir_header *eq; - int32_t *assign_response; - int32_t *coef_data; - int size_sum = 0; - int resp = 0; - int i; - int j; - int s; - - comp_info(mod->dev, "eq_iir_init_coef(): %u responses, %u channels, stream %d channels", - config->number_of_responses, config->channels_in_config, nch); - - /* Sanity checks */ - if (nch > PLATFORM_MAX_CHANNELS || - config->channels_in_config > PLATFORM_MAX_CHANNELS || - !config->channels_in_config) { - comp_err(mod->dev, "eq_iir_init_coef(), invalid channels count"); - return -EINVAL; - } - if (config->number_of_responses > SOF_EQ_IIR_MAX_RESPONSES) { - comp_err(mod->dev, "eq_iir_init_coef(), # of resp exceeds max"); - return -EINVAL; - } - - /* Collect index of response start positions in all_coefficients[] */ - j = 0; - assign_response = ASSUME_ALIGNED(&config->data[0], 4); - coef_data = ASSUME_ALIGNED(&config->data[config->channels_in_config], - 4); - for (i = 0; i < SOF_EQ_IIR_MAX_RESPONSES; i++) { - if (i < config->number_of_responses) { - eq = (struct sof_eq_iir_header *)&coef_data[j]; - lookup[i] = eq; - j += SOF_EQ_IIR_NHEADER - + SOF_EQ_IIR_NBIQUAD * eq->num_sections; - } else { - lookup[i] = NULL; - } - } - - /* Initialize 1st phase */ - for (i = 0; i < nch; i++) { - /* Check for not reading past blob response to channel assign - * map. The previous channel response is assigned for any - * additional channels in the stream. It allows to use single - * channel configuration to setup multi channel equalization - * with the same response. - */ - if (i < config->channels_in_config) - resp = assign_response[i]; - - if (resp < 0) { - /* Initialize EQ channel to bypass and continue with - * next channel response. - */ - comp_info(mod->dev, "eq_iir_init_coef(), ch %d is set to bypass", i); - iir_reset_df1(&iir[i]); - continue; - } - - if (resp >= config->number_of_responses) { - comp_err(mod->dev, "eq_iir_init_coef(), requested response %d exceeds defined", - resp); - return -EINVAL; - } - - /* Initialize EQ coefficients */ - eq = lookup[resp]; - s = iir_delay_size_df1(eq); - if (s > 0) { - size_sum += s; - } else { - comp_err(mod->dev, "eq_iir_init_coef(), sections count %d exceeds max", - eq->num_sections); - return -EINVAL; - } - - iir_init_coef_df1(&iir[i], eq); - comp_info(mod->dev, "eq_iir_init_coef(), ch %d is set to response %d", i, resp); - } - - return size_sum; -} - -static void eq_iir_init_delay(struct iir_state_df1 *iir, - int32_t *delay_start, int nch) -{ - int32_t *delay = delay_start; - int i; - - /* Initialize second phase to set EQ delay lines pointers. A - * bypass mode filter is indicated by biquads count of zero. - */ - for (i = 0; i < nch; i++) { - if (iir[i].biquads > 0) - iir_init_delay_df1(&iir[i], &delay); - } -} - -static int eq_iir_setup(struct processing_module *mod, int nch) -{ - struct comp_data *cd = module_get_private_data(mod); - int delay_size; - - /* Free existing IIR channels data if it was allocated */ - eq_iir_free_delaylines(cd); - - /* Set coefficients for each channel EQ from coefficient blob */ - delay_size = eq_iir_init_coef(mod, nch); - if (delay_size < 0) - return delay_size; /* Contains error code */ - - /* If all channels were set to bypass there's no need to - * allocate delay. Just return with success. - */ - if (!delay_size) - return 0; - - /* Allocate all IIR channels data in a big chunk and clear it */ - cd->iir_delay = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, - delay_size); - if (!cd->iir_delay) { - comp_err(mod->dev, "eq_iir_setup(), delay allocation fail"); - return -ENOMEM; - } - - cd->iir_delay_size = delay_size; - - /* Assign delay line to each channel EQ */ - eq_iir_init_delay(cd->iir, cd->iir_delay, nch); - return 0; -} - /* * End of EQ setup code. Next the standard component methods. */ @@ -678,42 +109,6 @@ static int eq_iir_free(struct processing_module *mod) return 0; } -#if CONFIG_IPC_MAJOR_3 -static int eq_iir_verify_params(struct comp_dev *dev, - struct sof_ipc_stream_params *params) -{ - struct comp_buffer *sourceb, *sinkb; - uint32_t buffer_flag; - int ret; - - comp_dbg(dev, "eq_iir_verify_params()"); - - /* EQ component will only ever have 1 source and 1 sink buffer */ - sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, - sink_list); - sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, - source_list); - - /* we check whether we can support frame_fmt conversion (whether we have - * such conversion function) due to source and sink buffer frame_fmt's. - * If not, we will overwrite sink (playback) and source (capture) with - * pcm frame_fmt and will not make any conversion (sink and source - * frame_fmt will be equal). - */ - buffer_flag = eq_iir_find_func(audio_stream_get_frm_fmt(&sourceb->stream), - audio_stream_get_frm_fmt(&sinkb->stream), fm_configured, - ARRAY_SIZE(fm_configured)) ? - BUFF_PARAMS_FRAME_FMT : 0; - - ret = comp_verify_params(dev, buffer_flag, params); - if (ret < 0) { - comp_err(dev, "eq_iir_verify_params(): comp_verify_params() failed."); - return ret; - } - - return 0; -} -#endif /* CONFIG_IPC_MAJOR_3 */ /* used to pass standard and bespoke commands (with data) to component */ static int eq_iir_set_config(struct processing_module *mod, uint32_t config_id, @@ -741,37 +136,6 @@ static int eq_iir_get_config(struct processing_module *mod, return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size); } -static int eq_iir_new_blob(struct processing_module *mod, struct comp_data *cd, - enum sof_ipc_frame source_format, enum sof_ipc_frame sink_format, - int channels) -{ - int ret; - - ret = eq_iir_setup(mod, channels); - if (ret < 0) { - comp_err(mod->dev, "eq_iir_new_blob(), failed IIR setup"); - return ret; - } else if (cd->iir_delay_size) { - comp_dbg(mod->dev, "eq_iir_new_blob(), active"); -#if CONFIG_IPC_MAJOR_3 - cd->eq_iir_func = eq_iir_find_func(source_format, sink_format, fm_configured, - ARRAY_SIZE(fm_configured)); -#elif CONFIG_IPC_MAJOR_4 - cd->eq_iir_func = eq_iir_find_func(mod); -#endif - } else { - comp_dbg(mod->dev, "eq_iir_new_blob(), pass-through"); -#if CONFIG_IPC_MAJOR_3 - cd->eq_iir_func = eq_iir_find_func(source_format, sink_format, fm_passthrough, - ARRAY_SIZE(fm_passthrough)); -#elif CONFIG_IPC_MAJOR_4 - cd->eq_iir_func = eq_iir_pass; -#endif - } - - return 0; -} - static int eq_iir_process(struct processing_module *mod, struct input_stream_buffer *input_buffers, int num_input_buffers, struct output_stream_buffer *output_buffers, int num_output_buffers) @@ -814,51 +178,6 @@ static void eq_iir_set_alignment(struct audio_stream *source, audio_stream_init_alignment_constants(byte_align, frame_align_req, sink); } -#if CONFIG_IPC_MAJOR_4 -static int eq_iir_params(struct processing_module *mod) -{ - struct sof_ipc_stream_params *params = mod->stream_params; - struct sof_ipc_stream_params comp_params; - struct comp_dev *dev = mod->dev; - struct comp_buffer *sinkb; - enum sof_ipc_frame valid_fmt, frame_fmt; - int i, ret; - - comp_dbg(dev, "eq_iir_params()"); - comp_params = *params; - comp_params.channels = mod->priv.cfg.base_cfg.audio_fmt.channels_count; - comp_params.rate = mod->priv.cfg.base_cfg.audio_fmt.sampling_frequency; - comp_params.buffer_fmt = mod->priv.cfg.base_cfg.audio_fmt.interleaving_style; - - audio_stream_fmt_conversion(mod->priv.cfg.base_cfg.audio_fmt.depth, - mod->priv.cfg.base_cfg.audio_fmt.valid_bit_depth, - &frame_fmt, &valid_fmt, - mod->priv.cfg.base_cfg.audio_fmt.s_type); - - comp_params.frame_fmt = valid_fmt; - - for (i = 0; i < SOF_IPC_MAX_CHANNELS; i++) - comp_params.chmap[i] = (mod->priv.cfg.base_cfg.audio_fmt.ch_map >> i * 4) & 0xf; - - component_set_nearest_period_frames(dev, comp_params.rate); - sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - ret = buffer_set_params(sinkb, &comp_params, true); - return ret; -} -#endif - -static void eq_iir_set_passthrough_func(struct comp_data *cd, - enum sof_ipc_frame source_format, - enum sof_ipc_frame sink_format) -{ -#if CONFIG_IPC_MAJOR_3 - cd->eq_iir_func = eq_iir_find_func(source_format, sink_format, fm_passthrough, - ARRAY_SIZE(fm_passthrough)); -#else - cd->eq_iir_func = eq_iir_pass; -#endif -} - static int eq_iir_prepare(struct processing_module *mod, struct sof_source **sources, int num_of_sources, struct sof_sink **sinks, int num_of_sinks) @@ -873,19 +192,10 @@ static int eq_iir_prepare(struct processing_module *mod, comp_dbg(dev, "eq_iir_prepare()"); -#if CONFIG_IPC_MAJOR_3 - ret = eq_iir_verify_params(dev, mod->stream_params); + ret = eq_iir_prepare_sub(mod); if (ret < 0) return ret; -#elif CONFIG_IPC_MAJOR_4 - ret = eq_iir_params(mod); - if (ret < 0) { - comp_set_state(dev, COMP_TRIGGER_RESET); - return ret; - } -#endif - /* EQ component will only ever have 1 source and 1 sink buffer */ sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, sink_list); sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); diff --git a/src/audio/eq_iir/eq_iir.h b/src/audio/eq_iir/eq_iir.h index 583a87c4a30a..7b6b6c247574 100644 --- a/src/audio/eq_iir/eq_iir.h +++ b/src/audio/eq_iir/eq_iir.h @@ -56,4 +56,20 @@ void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffe void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource, struct output_stream_buffer *bsink, uint32_t frames); +int eq_iir_new_blob(struct processing_module *mod, struct comp_data *cd, + enum sof_ipc_frame source_format, enum sof_ipc_frame sink_format, + int channels); + +void eq_iir_set_passthrough_func(struct comp_data *cd, + enum sof_ipc_frame source_format, + enum sof_ipc_frame sink_format); + +int eq_iir_prepare_sub(struct processing_module *mod); + +void eq_iir_pass(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames); + +int eq_iir_setup(struct processing_module *mod, int nch); + +void eq_iir_free_delaylines(struct comp_data *cd); #endif /* __SOF_AUDIO_EQ_IIR_EQ_IIR_H__ */ diff --git a/src/audio/eq_iir/eq_iir_generic.c b/src/audio/eq_iir/eq_iir_generic.c new file mode 100644 index 000000000000..2f891e240b10 --- /dev/null +++ b/src/audio/eq_iir/eq_iir_generic.c @@ -0,0 +1,346 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017-2022 Intel Corporation. All rights reserved. +// +// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> +// Liam Girdwood <liam.r.girdwood@linux.intel.com> +// Keyon Jie <yang.jie@linux.intel.com> + +#include "eq_iir.h" +#include <sof/audio/component.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/data_blob.h> +#include <sof/audio/buffer.h> +#include <sof/audio/format.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/ipc-config.h> +#include <sof/common.h> +#include <rtos/panic.h> +#include <sof/ipc/msg.h> +#include <rtos/alloc.h> +#include <rtos/init.h> +#include <sof/lib/memory.h> +#include <sof/lib/uuid.h> +#include <sof/list.h> +#include <sof/math/iir_df1.h> +#include <sof/platform.h> +#include <rtos/string.h> +#include <sof/ut.h> +#include <sof/trace/trace.h> +#include <ipc/control.h> +#include <ipc/stream.h> +#include <ipc/topology.h> +#include <user/eq.h> +#include <user/trace.h> +#include <errno.h> +#include <stddef.h> +#include <stdint.h> + +LOG_MODULE_DECLARE(eq_iir, CONFIG_SOF_LOG_LEVEL); + +#if CONFIG_FORMAT_S16LE +void eq_iir_s16_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct comp_data *cd = module_get_private_data(mod); + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + struct iir_state_df1 *filter; + int16_t *x0; + int16_t *y0; + int16_t *x; + int16_t *y; + int nmax; + int n1; + int n2; + int i; + int j; + int n; + const int nch = audio_stream_get_channels(source); + const int samples = frames * nch; + int processed = 0; + + x = audio_stream_get_rptr(source); + y = audio_stream_get_wptr(sink); + while (processed < samples) { + nmax = samples - processed; + n1 = audio_stream_bytes_without_wrap(source, x) >> 1; + n2 = audio_stream_bytes_without_wrap(sink, y) >> 1; + n = MIN(n1, n2); + n = MIN(n, nmax); + for (i = 0; i < nch; i++) { + x0 = x + i; + y0 = y + i; + filter = &cd->iir[i]; + for (j = 0; j < n; j += nch) { + *y0 = iir_df1_s16(filter, *x0); + x0 += nch; + y0 += nch; + } + } + processed += n; + x = audio_stream_wrap(source, x + n); + y = audio_stream_wrap(sink, y + n); + } +} +#endif /* CONFIG_FORMAT_S16LE */ + +#if CONFIG_FORMAT_S24LE + +void eq_iir_s24_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct comp_data *cd = module_get_private_data(mod); + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + struct iir_state_df1 *filter; + int32_t *x0; + int32_t *y0; + int32_t *x; + int32_t *y; + int nmax; + int n1; + int n2; + int i; + int j; + int n; + const int nch = audio_stream_get_channels(source); + const int samples = frames * nch; + int processed = 0; + + x = audio_stream_get_rptr(source); + y = audio_stream_get_wptr(sink); + while (processed < samples) { + nmax = samples - processed; + n1 = audio_stream_bytes_without_wrap(source, x) >> 2; + n2 = audio_stream_bytes_without_wrap(sink, y) >> 2; + n = MIN(n1, n2); + n = MIN(n, nmax); + for (i = 0; i < nch; i++) { + x0 = x + i; + y0 = y + i; + filter = &cd->iir[i]; + for (j = 0; j < n; j += nch) { + *y0 = iir_df1_s24(filter, *x0); + x0 += nch; + y0 += nch; + } + } + processed += n; + x = audio_stream_wrap(source, x + n); + y = audio_stream_wrap(sink, y + n); + } +} +#endif /* CONFIG_FORMAT_S24LE */ + +#if CONFIG_FORMAT_S32LE + +void eq_iir_s32_default(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct comp_data *cd = module_get_private_data(mod); + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + struct iir_state_df1 *filter; + int32_t *x0; + int32_t *y0; + int32_t *x; + int32_t *y; + int nmax; + int n1; + int n2; + int i; + int j; + int n; + const int nch = audio_stream_get_channels(source); + const int samples = frames * nch; + int processed = 0; + + x = audio_stream_get_rptr(source); + y = audio_stream_get_wptr(sink); + while (processed < samples) { + nmax = samples - processed; + n1 = audio_stream_bytes_without_wrap(source, x) >> 2; + n2 = audio_stream_bytes_without_wrap(sink, y) >> 2; + n = MIN(n1, n2); + n = MIN(n, nmax); + for (i = 0; i < nch; i++) { + x0 = x + i; + y0 = y + i; + filter = &cd->iir[i]; + for (j = 0; j < n; j += nch) { + *y0 = iir_df1(filter, *x0); + x0 += nch; + y0 += nch; + } + } + processed += n; + x = audio_stream_wrap(source, x + n); + y = audio_stream_wrap(sink, y + n); + } +} +#endif /* CONFIG_FORMAT_S32LE */ + +static int eq_iir_init_coef(struct processing_module *mod, int nch) +{ + struct comp_data *cd = module_get_private_data(mod); + struct sof_eq_iir_config *config = cd->config; + struct iir_state_df1 *iir = cd->iir; + struct sof_eq_iir_header *lookup[SOF_EQ_IIR_MAX_RESPONSES]; + struct sof_eq_iir_header *eq; + int32_t *assign_response; + int32_t *coef_data; + int size_sum = 0; + int resp = 0; + int i; + int j; + int s; + + comp_info(mod->dev, "eq_iir_init_coef(): %u responses, %u channels, stream %d channels", + config->number_of_responses, config->channels_in_config, nch); + + /* Sanity checks */ + if (nch > PLATFORM_MAX_CHANNELS || + config->channels_in_config > PLATFORM_MAX_CHANNELS || + !config->channels_in_config) { + comp_err(mod->dev, "eq_iir_init_coef(), invalid channels count"); + return -EINVAL; + } + if (config->number_of_responses > SOF_EQ_IIR_MAX_RESPONSES) { + comp_err(mod->dev, "eq_iir_init_coef(), # of resp exceeds max"); + return -EINVAL; + } + + /* Collect index of response start positions in all_coefficients[] */ + j = 0; + assign_response = ASSUME_ALIGNED(&config->data[0], 4); + coef_data = ASSUME_ALIGNED(&config->data[config->channels_in_config], + 4); + for (i = 0; i < SOF_EQ_IIR_MAX_RESPONSES; i++) { + if (i < config->number_of_responses) { + eq = (struct sof_eq_iir_header *)&coef_data[j]; + lookup[i] = eq; + j += SOF_EQ_IIR_NHEADER + + SOF_EQ_IIR_NBIQUAD * eq->num_sections; + } else { + lookup[i] = NULL; + } + } + + /* Initialize 1st phase */ + for (i = 0; i < nch; i++) { + /* Check for not reading past blob response to channel assign + * map. The previous channel response is assigned for any + * additional channels in the stream. It allows to use single + * channel configuration to setup multi channel equalization + * with the same response. + */ + if (i < config->channels_in_config) + resp = assign_response[i]; + + if (resp < 0) { + /* Initialize EQ channel to bypass and continue with + * next channel response. + */ + comp_info(mod->dev, "eq_iir_init_coef(), ch %d is set to bypass", i); + iir_reset_df1(&iir[i]); + continue; + } + + if (resp >= config->number_of_responses) { + comp_err(mod->dev, "eq_iir_init_coef(), requested response %d exceeds defined", + resp); + return -EINVAL; + } + + /* Initialize EQ coefficients */ + eq = lookup[resp]; + s = iir_delay_size_df1(eq); + if (s > 0) { + size_sum += s; + } else { + comp_err(mod->dev, "eq_iir_init_coef(), sections count %d exceeds max", + eq->num_sections); + return -EINVAL; + } + + iir_init_coef_df1(&iir[i], eq); + comp_info(mod->dev, "eq_iir_init_coef(), ch %d is set to response %d", i, resp); + } + + return size_sum; +} + +static void eq_iir_init_delay(struct iir_state_df1 *iir, + int32_t *delay_start, int nch) +{ + int32_t *delay = delay_start; + int i; + + /* Initialize second phase to set EQ delay lines pointers. A + * bypass mode filter is indicated by biquads count of zero. + */ + for (i = 0; i < nch; i++) { + if (iir[i].biquads > 0) + iir_init_delay_df1(&iir[i], &delay); + } +} + +void eq_iir_free_delaylines(struct comp_data *cd) +{ + struct iir_state_df1 *iir = cd->iir; + int i = 0; + + /* Free the common buffer for all EQs and point then + * each IIR channel delay line to NULL. + */ + rfree(cd->iir_delay); + cd->iir_delay = NULL; + cd->iir_delay_size = 0; + for (i = 0; i < PLATFORM_MAX_CHANNELS; i++) + iir[i].delay = NULL; +} + +void eq_iir_pass(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + + audio_stream_copy(source, 0, sink, 0, frames * audio_stream_get_channels(source)); +} + +int eq_iir_setup(struct processing_module *mod, int nch) +{ + struct comp_data *cd = module_get_private_data(mod); + int delay_size; + + /* Free existing IIR channels data if it was allocated */ + eq_iir_free_delaylines(cd); + + /* Set coefficients for each channel EQ from coefficient blob */ + delay_size = eq_iir_init_coef(mod, nch); + if (delay_size < 0) + return delay_size; /* Contains error code */ + + /* If all channels were set to bypass there's no need to + * allocate delay. Just return with success. + */ + if (!delay_size) + return 0; + + /* Allocate all IIR channels data in a big chunk and clear it */ + cd->iir_delay = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, + delay_size); + if (!cd->iir_delay) { + comp_err(mod->dev, "eq_iir_setup(), delay allocation fail"); + return -ENOMEM; + } + + cd->iir_delay_size = delay_size; + + /* Assign delay line to each channel EQ */ + eq_iir_init_delay(cd->iir, cd->iir_delay, nch); + return 0; +} + diff --git a/src/audio/eq_iir/eq_iir_ipc3.c b/src/audio/eq_iir/eq_iir_ipc3.c new file mode 100644 index 000000000000..6958dd6b536b --- /dev/null +++ b/src/audio/eq_iir/eq_iir_ipc3.c @@ -0,0 +1,336 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017-2022 Intel Corporation. All rights reserved. +// +// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> +// Liam Girdwood <liam.r.girdwood@linux.intel.com> +// Keyon Jie <yang.jie@linux.intel.com> + +#include "eq_iir.h" +#include <sof/audio/component.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/data_blob.h> +#include <sof/audio/buffer.h> +#include <sof/audio/format.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/ipc-config.h> +#include <sof/common.h> +#include <rtos/panic.h> +#include <sof/ipc/msg.h> +#include <rtos/alloc.h> +#include <rtos/init.h> +#include <sof/lib/memory.h> +#include <sof/lib/uuid.h> +#include <sof/list.h> +#include <sof/math/iir_df1.h> +#include <sof/platform.h> +#include <rtos/string.h> +#include <sof/ut.h> +#include <sof/trace/trace.h> +#include <ipc/control.h> +#include <ipc/stream.h> +#include <ipc/topology.h> +#include <user/eq.h> +#include <user/trace.h> +#include <errno.h> +#include <stddef.h> +#include <stdint.h> + +LOG_MODULE_DECLARE(eq_iir, CONFIG_SOF_LOG_LEVEL); + +#if CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S16LE +static void eq_iir_s32_16_default(struct processing_module *mod, + struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct comp_data *cd = module_get_private_data(mod); + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + struct iir_state_df1 *filter; + int32_t *x0; + int16_t *y0; + int32_t *x; + int16_t *y; + int nmax; + int n1; + int n2; + int i; + int j; + int n; + const int nch = audio_stream_get_channels(source); + const int samples = frames * nch; + int processed = 0; + + x = audio_stream_get_rptr(source); + y = audio_stream_get_wptr(sink); + while (processed < samples) { + nmax = samples - processed; + n1 = audio_stream_bytes_without_wrap(source, x) >> 2; /* divide 4 */ + n2 = audio_stream_bytes_without_wrap(sink, y) >> 1; /* divide 2 */ + n = MIN(n1, n2); + n = MIN(n, nmax); + for (i = 0; i < nch; i++) { + x0 = x + i; + y0 = y + i; + filter = &cd->iir[i]; + for (j = 0; j < n; j += nch) { + *y0 = iir_df1_s32_s16(filter, *x0); + x0 += nch; + y0 += nch; + } + } + processed += n; + x = audio_stream_wrap(source, x + n); + y = audio_stream_wrap(sink, y + n); + } +} +#endif /* CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S16LE */ + +#if CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S24LE +static void eq_iir_s32_24_default(struct processing_module *mod, + struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct comp_data *cd = module_get_private_data(mod); + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + struct iir_state_df1 *filter; + int32_t *x0; + int32_t *y0; + int32_t *x; + int32_t *y; + int nmax; + int n1; + int n2; + int i; + int j; + int n; + const int nch = audio_stream_get_channels(source); + const int samples = frames * nch; + int processed = 0; + + x = audio_stream_get_rptr(source); + y = audio_stream_get_wptr(sink); + while (processed < samples) { + nmax = samples - processed; + n1 = audio_stream_bytes_without_wrap(source, x) >> 2; + n2 = audio_stream_bytes_without_wrap(sink, y) >> 2; + n = MIN(n1, n2); + n = MIN(n, nmax); + for (i = 0; i < nch; i++) { + x0 = x + i; + y0 = y + i; + filter = &cd->iir[i]; + for (j = 0; j < n; j += nch) { + *y0 = iir_df1_s32_s24(filter, *x0); + x0 += nch; + y0 += nch; + } + } + processed += n; + x = audio_stream_wrap(source, x + n); + y = audio_stream_wrap(sink, y + n); + } +} +#endif /* CONFIG_FORMAT_S32LE && CONFIG_FORMAT_S24LE */ + +#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE +static void eq_iir_s32_s16_pass(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + int32_t *x = audio_stream_get_rptr(source); + int16_t *y = audio_stream_get_wptr(sink); + int nmax; + int n; + int i; + int remaining_samples = frames * audio_stream_get_channels(source); + + while (remaining_samples) { + nmax = EQ_IIR_BYTES_TO_S32_SAMPLES(audio_stream_bytes_without_wrap(source, x)); + n = MIN(remaining_samples, nmax); + nmax = EQ_IIR_BYTES_TO_S16_SAMPLES(audio_stream_bytes_without_wrap(sink, y)); + n = MIN(n, nmax); + for (i = 0; i < n; i++) { + *y = sat_int16(Q_SHIFT_RND(*x, 31, 15)); + x++; + y++; + } + remaining_samples -= n; + x = audio_stream_wrap(source, x); + y = audio_stream_wrap(sink, y); + } +} +#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE */ + +#if CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE +static void eq_iir_s32_s24_pass(struct processing_module *mod, struct input_stream_buffer *bsource, + struct output_stream_buffer *bsink, uint32_t frames) +{ + struct audio_stream *source = bsource->data; + struct audio_stream *sink = bsink->data; + int32_t *x = audio_stream_get_rptr(source); + int32_t *y = audio_stream_get_wptr(sink); + int nmax; + int n; + int i; + int remaining_samples = frames * audio_stream_get_channels(source); + + while (remaining_samples) { + nmax = EQ_IIR_BYTES_TO_S32_SAMPLES(audio_stream_bytes_without_wrap(source, x)); + n = MIN(remaining_samples, nmax); + nmax = EQ_IIR_BYTES_TO_S32_SAMPLES(audio_stream_bytes_without_wrap(sink, y)); + n = MIN(n, nmax); + for (i = 0; i < n; i++) { + *y = sat_int24(Q_SHIFT_RND(*x, 31, 23)); + x++; + y++; + } + remaining_samples -= n; + x = audio_stream_wrap(source, x); + y = audio_stream_wrap(sink, y); + } +} +#endif /* CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE */ + +const struct eq_iir_func_map fm_configured[] = { +#if CONFIG_FORMAT_S16LE + {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S16_LE, eq_iir_s16_default}, +#endif /* CONFIG_FORMAT_S16LE */ +#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE + {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, NULL}, + {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S16_LE, NULL}, + +#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE + {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S32_LE, NULL}, + {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S16_LE, eq_iir_s32_16_default}, +#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE */ +#if CONFIG_FORMAT_S24LE + {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S24_4LE, eq_iir_s24_default}, +#endif /* CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE + {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE, NULL}, + {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S24_4LE, eq_iir_s32_24_default}, +#endif /* CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE */ +#if CONFIG_FORMAT_S32LE + {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S32_LE, eq_iir_s32_default}, +#endif /* CONFIG_FORMAT_S32LE */ +}; + +const struct eq_iir_func_map fm_passthrough[] = { +#if CONFIG_FORMAT_S16LE + {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S16_LE, eq_iir_pass}, +#endif /* CONFIG_FORMAT_S16LE */ +#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE + {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S24_4LE, NULL}, + {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S16_LE, NULL}, + +#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S24LE*/ +#if CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE + {SOF_IPC_FRAME_S16_LE, SOF_IPC_FRAME_S32_LE, NULL}, + {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S16_LE, eq_iir_s32_s16_pass}, +#endif /* CONFIG_FORMAT_S16LE && CONFIG_FORMAT_S32LE*/ +#if CONFIG_FORMAT_S24LE + {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S24_4LE, eq_iir_pass}, +#endif /* CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S24LE && CONFIG_FORMAT_S32LE + {SOF_IPC_FRAME_S24_4LE, SOF_IPC_FRAME_S32_LE, NULL}, + {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S24_4LE, eq_iir_s32_s24_pass}, +#endif /* CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S32LE + {SOF_IPC_FRAME_S32_LE, SOF_IPC_FRAME_S32_LE, eq_iir_pass}, +#endif /* CONFIG_FORMAT_S32LE */ +}; + +static eq_iir_func eq_iir_find_func(enum sof_ipc_frame source_format, + enum sof_ipc_frame sink_format, + const struct eq_iir_func_map *map, + int n) +{ + int i; + + /* Find suitable processing function from map. */ + for (i = 0; i < n; i++) { + if ((uint8_t)source_format != map[i].source) + continue; + if ((uint8_t)sink_format != map[i].sink) + continue; + + return map[i].func; + } + + return NULL; +} + +static int eq_iir_verify_params(struct comp_dev *dev, + struct sof_ipc_stream_params *params) +{ + struct comp_buffer *sourceb, *sinkb; + uint32_t buffer_flag; + int ret; + + comp_dbg(dev, "eq_iir_verify_params()"); + + /* EQ component will only ever have 1 source and 1 sink buffer */ + sourceb = list_first_item(&dev->bsource_list, struct comp_buffer, + sink_list); + sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, + source_list); + + /* we check whether we can support frame_fmt conversion (whether we have + * such conversion function) due to source and sink buffer frame_fmt's. + * If not, we will overwrite sink (playback) and source (capture) with + * pcm frame_fmt and will not make any conversion (sink and source + * frame_fmt will be equal). + */ + buffer_flag = eq_iir_find_func(audio_stream_get_frm_fmt(&sourceb->stream), + audio_stream_get_frm_fmt(&sinkb->stream), fm_configured, + ARRAY_SIZE(fm_configured)) ? + BUFF_PARAMS_FRAME_FMT : 0; + + ret = comp_verify_params(dev, buffer_flag, params); + if (ret < 0) { + comp_err(dev, "eq_iir_verify_params(): comp_verify_params() failed."); + return ret; + } + + return 0; +} + +int eq_iir_new_blob(struct processing_module *mod, struct comp_data *cd, + enum sof_ipc_frame source_format, enum sof_ipc_frame sink_format, + int channels) +{ + int ret; + + ret = eq_iir_setup(mod, channels); + if (ret < 0) { + comp_err(mod->dev, "eq_iir_new_blob(), failed IIR setup"); + return ret; + } else if (cd->iir_delay_size) { + comp_dbg(mod->dev, "eq_iir_new_blob(), active"); + cd->eq_iir_func = eq_iir_find_func(source_format, sink_format, fm_configured, + ARRAY_SIZE(fm_configured)); + } else { + comp_dbg(mod->dev, "eq_iir_new_blob(), pass-through"); + cd->eq_iir_func = eq_iir_find_func(source_format, sink_format, fm_passthrough, + ARRAY_SIZE(fm_passthrough)); + } + + return 0; +} + +void eq_iir_set_passthrough_func(struct comp_data *cd, + enum sof_ipc_frame source_format, + enum sof_ipc_frame sink_format) +{ + cd->eq_iir_func = eq_iir_find_func(source_format, sink_format, fm_passthrough, + ARRAY_SIZE(fm_passthrough)); +} + +int eq_iir_prepare_sub(struct processing_module *mod) +{ + return eq_iir_verify_params(mod->dev, mod->stream_params); +} diff --git a/src/audio/eq_iir/eq_iir_ipc4.c b/src/audio/eq_iir/eq_iir_ipc4.c new file mode 100644 index 000000000000..474b820b14de --- /dev/null +++ b/src/audio/eq_iir/eq_iir_ipc4.c @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2017-2022 Intel Corporation. All rights reserved. +// +// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> +// Liam Girdwood <liam.r.girdwood@linux.intel.com> +// Keyon Jie <yang.jie@linux.intel.com> + +#include "eq_iir.h" +#include <sof/audio/component.h> +#include <sof/audio/module_adapter/module/generic.h> +#include <sof/audio/data_blob.h> +#include <sof/audio/buffer.h> +#include <sof/audio/format.h> +#include <sof/audio/pipeline.h> +#include <sof/audio/ipc-config.h> +#include <sof/common.h> +#include <rtos/panic.h> +#include <sof/ipc/msg.h> +#include <rtos/alloc.h> +#include <rtos/init.h> +#include <sof/lib/memory.h> +#include <sof/lib/uuid.h> +#include <sof/list.h> +#include <sof/math/iir_df1.h> +#include <sof/platform.h> +#include <rtos/string.h> +#include <sof/ut.h> +#include <sof/trace/trace.h> +#include <ipc/control.h> +#include <ipc/stream.h> +#include <ipc/topology.h> +#include <user/eq.h> +#include <user/trace.h> +#include <errno.h> +#include <stddef.h> +#include <stdint.h> + +LOG_MODULE_DECLARE(eq_iir, CONFIG_SOF_LOG_LEVEL); + +/* + * In early days of SOF the preference for pipelines was 16 bits to save RAM in platforms + * like Baytrail. However in microphone paths if there was need to digitally boost the gain + * the quality was bad in topologies where capture DAI was 16 bit and we applied with volume + * or IIR about 20 dB gain. In practice a 16 bit word got left shifted by some bit positions + * that effectively made signal like 12 bits. We could achieve a lot better quality by + * capturing codec and DAI with 24 or 32bits and applying the gain in IIR for the larger word + * length. Then all 16 bits in the pipelines after DAI and IIR had signal. The IIR was chosen for + * format conversion because it also canceled the sometimes large DC component + * (and some lowest non-audible frequencies) in signal. + * It gave the headroom for signal for amplification. + + * If IPC4 systems ever need the memory save small 16 bit capture paths + * the format conversion could be brought back. + */ + +static eq_iir_func eq_iir_find_func(struct processing_module *mod) +{ + unsigned int valid_bit_depth = mod->priv.cfg.base_cfg.audio_fmt.valid_bit_depth; + + comp_dbg(mod->dev, "eq_iir_find_func(): valid_bit_depth %d", valid_bit_depth); + switch (valid_bit_depth) { +#if CONFIG_FORMAT_S16LE + case IPC4_DEPTH_16BIT: + return eq_iir_s16_default; +#endif /* CONFIG_FORMAT_S16LE */ +#if CONFIG_FORMAT_S24LE + case IPC4_DEPTH_24BIT: + return eq_iir_s24_default; +#endif /* CONFIG_FORMAT_S24LE */ +#if CONFIG_FORMAT_S32LE + case IPC4_DEPTH_32BIT: + return eq_iir_s32_default; +#endif /* CONFIG_FORMAT_S32LE */ + default: + comp_err(mod->dev, "set_fir_func(), invalid valid_bith_depth"); + } + return NULL; +} + +int eq_iir_new_blob(struct processing_module *mod, struct comp_data *cd, + enum sof_ipc_frame source_format, enum sof_ipc_frame sink_format, + int channels) +{ + int ret; + + ret = eq_iir_setup(mod, channels); + if (ret < 0) { + comp_err(mod->dev, "eq_iir_new_blob(), failed IIR setup"); + return ret; + } else if (cd->iir_delay_size) { + comp_dbg(mod->dev, "eq_iir_new_blob(), active"); + cd->eq_iir_func = eq_iir_find_func(mod); + } else { + comp_dbg(mod->dev, "eq_iir_new_blob(), pass-through"); + cd->eq_iir_func = eq_iir_pass; + } + + return 0; +} + +static int eq_iir_params(struct processing_module *mod) +{ + struct sof_ipc_stream_params *params = mod->stream_params; + struct sof_ipc_stream_params comp_params; + struct comp_dev *dev = mod->dev; + struct comp_buffer *sinkb; + enum sof_ipc_frame valid_fmt, frame_fmt; + int i, ret; + + comp_dbg(dev, "eq_iir_params()"); + comp_params = *params; + comp_params.channels = mod->priv.cfg.base_cfg.audio_fmt.channels_count; + comp_params.rate = mod->priv.cfg.base_cfg.audio_fmt.sampling_frequency; + comp_params.buffer_fmt = mod->priv.cfg.base_cfg.audio_fmt.interleaving_style; + + audio_stream_fmt_conversion(mod->priv.cfg.base_cfg.audio_fmt.depth, + mod->priv.cfg.base_cfg.audio_fmt.valid_bit_depth, + &frame_fmt, &valid_fmt, + mod->priv.cfg.base_cfg.audio_fmt.s_type); + + comp_params.frame_fmt = valid_fmt; + + for (i = 0; i < SOF_IPC_MAX_CHANNELS; i++) + comp_params.chmap[i] = (mod->priv.cfg.base_cfg.audio_fmt.ch_map >> i * 4) & 0xf; + + component_set_nearest_period_frames(dev, comp_params.rate); + sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + ret = buffer_set_params(sinkb, &comp_params, true); + return ret; +} + +void eq_iir_set_passthrough_func(struct comp_data *cd, + enum sof_ipc_frame source_format, + enum sof_ipc_frame sink_format) +{ + cd->eq_iir_func = eq_iir_pass; +} + +int eq_iir_prepare_sub(struct processing_module *mod) +{ + struct comp_dev *dev = mod->dev; + int ret = 0; + + ret = eq_iir_params(mod); + if (ret < 0) + comp_set_state(dev, COMP_TRIGGER_RESET); + + return ret; +} + diff --git a/test/cmocka/src/audio/eq_iir/CMakeLists.txt b/test/cmocka/src/audio/eq_iir/CMakeLists.txt index a520a22fa441..8f00dbedc750 100644 --- a/test/cmocka/src/audio/eq_iir/CMakeLists.txt +++ b/test/cmocka/src/audio/eq_iir/CMakeLists.txt @@ -13,6 +13,8 @@ add_compile_options(-DUNIT_TEST) add_library(audio_for_eq_iir STATIC ${PROJECT_SOURCE_DIR}/src/audio/eq_iir/eq_iir.c + ${PROJECT_SOURCE_DIR}/src/audio/eq_iir/eq_iir_generic.c + ${PROJECT_SOURCE_DIR}/src/audio/eq_iir/eq_iir_ipc3.c ${PROJECT_SOURCE_DIR}/src/math/iir_df1.c ${PROJECT_SOURCE_DIR}/src/math/iir_df1_generic.c ${PROJECT_SOURCE_DIR}/src/math/iir_df1_hifi3.c diff --git a/test/cmocka/src/audio/eq_iir/eq_iir_process.c b/test/cmocka/src/audio/eq_iir/eq_iir_process.c index b960a6997b14..529d4328f580 100644 --- a/test/cmocka/src/audio/eq_iir/eq_iir_process.c +++ b/test/cmocka/src/audio/eq_iir/eq_iir_process.c @@ -11,7 +11,7 @@ #include <cmocka.h> #include <kernel/header.h> #include <sof/audio/component_ext.h> -#include <sof/audio/eq_iir/eq_iir.h> +#include <eq_iir/eq_iir.h> #include <sof/audio/module_adapter/module/generic.h> #include "../../util.h" diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 8deca5155919..68e110426ea5 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -426,9 +426,19 @@ zephyr_library_sources_ifdef(CONFIG_COMP_FIR ${SOF_MATH_PATH}/fir_hifi3.c ) -zephyr_library_sources_ifdef(CONFIG_COMP_IIR - ${SOF_AUDIO_PATH}/eq_iir/eq_iir.c -) +if(CONFIG_IPC_MAJOR_3) + zephyr_library_sources_ifdef(CONFIG_COMP_IIR + ${SOF_AUDIO_PATH}/eq_iir/eq_iir.c + ${SOF_AUDIO_PATH}/eq_iir/eq_iir_ipc3.c + ${SOF_AUDIO_PATH}/eq_iir/eq_iir_generic.c + ) +elseif(CONFIG_IPC_MAJOR_4) + zephyr_library_sources_ifdef(CONFIG_COMP_IIR + ${SOF_AUDIO_PATH}/eq_iir/eq_iir.c + ${SOF_AUDIO_PATH}/eq_iir/eq_iir_ipc4.c + ${SOF_AUDIO_PATH}/eq_iir/eq_iir_generic.c + ) +endif() zephyr_library_sources_ifdef(CONFIG_MATH_IIR_DF1 ${SOF_MATH_PATH}/iir_df1_generic.c From ec1cfd8f95ac1097fb5636662518ff07e453f39a Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 19 Oct 2023 22:45:28 +0000 Subject: [PATCH 594/639] topology2/cmake: stricter if execute_process(alsatplg --version ...) We want to fail if STATUS is not defined, the empty string, the FALSE string or anything unexpected that it is not strictly equal to success code "0". Fixes commit 308a24a92b44 ("topology2: Add build support") Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/topology/topology2/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology2/CMakeLists.txt b/tools/topology/topology2/CMakeLists.txt index 6abb55262170..2ffc1697194a 100644 --- a/tools/topology/topology2/CMakeLists.txt +++ b/tools/topology/topology2/CMakeLists.txt @@ -4,7 +4,7 @@ add_custom_target(topologies2) # Check alsatplg version and build topology2 if alsatplg version is # 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323 execute_process(COMMAND alsatplg --version RESULT_VARIABLE STATUS OUTPUT_VARIABLE ALSA_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) -if(STATUS AND NOT STATUS EQUAL 0) +if(NOT STATUS EQUAL 0) message(WARNING "alsatplg error: ${STATUS}, topology2 will be skipped") else() string(REPLACE "\n" ";" ALSA_VERSION_LIST ${ALSA_VERSION}) From 4495357f1e8533a4d90013e6866173edad689d23 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Thu, 19 Oct 2023 23:12:41 +0000 Subject: [PATCH 595/639] topology2/cmake: extract new function "alsatplg_version()" for re-use We'll use this new function to require ALSA 1.2.5 and finally rename to "codec_consumer" (see revert discussion #5192) Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/topology/topology2/CMakeLists.txt | 35 ++++++++++++++++++++----- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/tools/topology/topology2/CMakeLists.txt b/tools/topology/topology2/CMakeLists.txt index 2ffc1697194a..7e3ee5acad7a 100644 --- a/tools/topology/topology2/CMakeLists.txt +++ b/tools/topology/topology2/CMakeLists.txt @@ -3,15 +3,38 @@ add_custom_target(topologies2) # Check alsatplg version and build topology2 if alsatplg version is # 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323 -execute_process(COMMAND alsatplg --version RESULT_VARIABLE STATUS OUTPUT_VARIABLE ALSA_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) -if(NOT STATUS EQUAL 0) - message(WARNING "alsatplg error: ${STATUS}, topology2 will be skipped") -else() - string(REPLACE "\n" ";" ALSA_VERSION_LIST ${ALSA_VERSION}) + +function(alsatplg_version OUT_STATUS OUT_VERSION) + execute_process(COMMAND alsatplg --version + RESULT_VARIABLE status + OUTPUT_VARIABLE stdout + OUTPUT_STRIP_TRAILING_WHITESPACE) + message(DEBUG "alsatplg --version: status=${status}, output=${stdout}") + + set(${OUT_STATUS} "${status}" PARENT_SCOPE) + + # Some error messages have already been printed on stderr + if(NOT status EQUAL 0) + message(WARNING "alsatplg --version returned status: ${status}, +${stdout}") + return() + endif() + + string(REPLACE "\n" ";" ALSA_VERSION_LIST ${stdout}) list(GET ALSA_VERSION_LIST 0 ALSATPLG_VERSION) string(REGEX MATCH "[0-9]\.[0-9]\.*[0-9]*" ALSATPLG_VERSION_NUMBER ${ALSATPLG_VERSION}) + + set(${OUT_VERSION} "${ALSATPLG_VERSION_NUMBER}" PARENT_SCOPE) +endfunction() + +alsatplg_version(STATUS ALSATPLG_VERSION_NUMBER) + +if(NOT STATUS EQUAL 0) + message(WARNING "alsatplg error: ${STATUS}; topology2 will be skipped") +else() if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.7") - message(WARNING "topology2 will be skipped. Minimum required version for alsatplg: 1.2.7") + message(WARNING "topology2 skipped. Minimum alsatplg version 1.2.7,\ + found ${ALSATPLG_VERSION_NUMBER}.") else() add_dependencies(topologies topologies2) endif() From 4bc6488b24e445ca7e6713b8c97f870b73788db5 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 20 Oct 2023 15:50:21 -0700 Subject: [PATCH 596/639] .github/zephyr: de-hardcode the name of the zephyr remote Fixes issue reported in stable-v2.7 #8353 which wants to use our own, downstream Zephyr branch. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/zephyr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 25af4e96cd8a..eb8a5805410e 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -167,7 +167,7 @@ jobs: # both issues in no time. cd zephyr - git fetch --filter=tree:0 zephyrproject "$rem_rev":_branch_placeholder + git fetch --filter=tree:0 "$(git remote |head -n1)" "$rem_rev":_branch_placeholder git branch -D _branch_placeholder set -x From 92fa7952d057dc41ac3c4ec952503a335468bae5 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 20 Oct 2023 15:53:35 -0700 Subject: [PATCH 597/639] .github/zephyr: time some fetch commands GitHub conveniently times each step but to reduce step proliferation we sometimes have multiple commands in a single step and lose the ability to time download commands. Prefix them with `time` to restore the data. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/zephyr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index eb8a5805410e..402f53102015 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -133,7 +133,7 @@ jobs: - name: west clones run: pip3 install west && cd workspace/sof/ && west init -l && - west update --narrow --fetch-opt=--filter=tree:0 + time west update --narrow --fetch-opt=--filter=tree:0 - name: select zephyr revision run: | @@ -149,7 +149,7 @@ jobs: sed -e "s#=sof_zephyr_revision_override=#${rem_rev}#" \ sof-ci-jenkins/zephyr-override-template.yml > test-zephyr-main.yml ) - west update --narrow --fetch-opt=--filter=tree:0 + time west update --narrow --fetch-opt=--filter=tree:0 fi # Because we used git tricks to speed things up, we now have two git @@ -167,7 +167,7 @@ jobs: # both issues in no time. cd zephyr - git fetch --filter=tree:0 "$(git remote |head -n1)" "$rem_rev":_branch_placeholder + time git fetch --filter=tree:0 "$(git remote |head -n1)" "$rem_rev":_branch_placeholder git branch -D _branch_placeholder set -x From 763ed6d02b3b129433bb4890daf72e9d463f16af Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 7 Sep 2023 17:40:45 +0300 Subject: [PATCH 598/639] Audio: Convert Google RTC audio processing to module API This patch converts the component to module API. The changes are: - google_rtc_audio_processing_params() is changed to update sources and sink params from IPC4 init IPC. It's not used for IPC3 where module adapter handles params(). - The commands handling is fixed to handle via module adapter the IPC3 and IPC4 commands. - The google_rtc_audio_processing_init() is updated to simpler module adapter client way. - The google_rtc_audio_processing_prepare() is updated to set buffers parameters for IPC4 and find sources buffers for microphone and reference by index instead of buffer pointer. That simplifies the processing function with module adapter. - The google_rtc_audio_processing_process() is updated from copy() to module adapter client way. - google_rtc_audio_processing_get_attribute() is removed - As overall change dev handle is changed to mod handle in nearly all functions. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../google/google_rtc_audio_processing.c | 432 +++++++++--------- src/include/sof/audio/component.h | 1 + 2 files changed, 224 insertions(+), 209 deletions(-) diff --git a/src/audio/google/google_rtc_audio_processing.c b/src/audio/google/google_rtc_audio_processing.c index 87d270e71e11..544e94dd7476 100644 --- a/src/audio/google/google_rtc_audio_processing.c +++ b/src/audio/google/google_rtc_audio_processing.c @@ -8,6 +8,7 @@ #include <ipc/stream.h> #include <ipc/topology.h> #include <ipc4/aec.h> +#include <sof/audio/module_adapter/module/generic.h> #include <sof/audio/buffer.h> #include <sof/audio/component.h> #include <sof/audio/data_blob.h> @@ -54,9 +55,6 @@ struct google_rtc_audio_processing_comp_data { #if CONFIG_IPC_MAJOR_4 struct sof_ipc4_aec_config config; #endif - struct comp_buffer *raw_microphone; - struct comp_buffer *aec_reference; - struct comp_buffer *output; uint32_t num_frames; int num_aec_reference_channels; int num_capture_channels; @@ -70,6 +68,8 @@ struct google_rtc_audio_processing_comp_data { uint8_t *memory_buffer; struct comp_data_blob_handler *tuning_handler; bool reconfigure; + int aec_reference_source; + int raw_microphone_source; }; void *GoogleRtcMalloc(size_t size) @@ -82,48 +82,31 @@ void GoogleRtcFree(void *ptr) return rfree(ptr); } -static int google_rtc_audio_processing_params( - struct comp_dev *dev, - struct sof_ipc_stream_params *params) -{ - int ret; #if CONFIG_IPC_MAJOR_4 - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - struct comp_buffer *sink; - - /* update sink buffer format */ - memset(params, 0, sizeof(*params)); - params->channels = cd->config.base_cfg.audio_fmt.channels_count; - params->rate = cd->config.base_cfg.audio_fmt.sampling_frequency; - params->sample_container_bytes = cd->config.base_cfg.audio_fmt.depth / 8; - params->sample_valid_bytes = - cd->config.base_cfg.audio_fmt.valid_bit_depth / 8; - params->buffer_fmt = cd->config.base_cfg.audio_fmt.interleaving_style; - params->buffer.size = cd->config.base_cfg.ibs; - - /* update sink format */ - if (!list_is_empty(&dev->bsink_list)) { - struct ipc4_audio_format *out_fmt = &cd->config.output_fmt; - enum sof_ipc_frame valid_fmt, frame_fmt; - - sink = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); - ipc4_update_buffer_format(sink, out_fmt); - } -#endif +static void google_rtc_audio_processing_params(struct processing_module *mod) +{ + struct sof_ipc_stream_params *params = mod->stream_params; + struct comp_buffer *sinkb, *sourceb; + struct list_item *source_list; + struct comp_dev *dev = mod->dev; - ret = comp_verify_params(dev, 0, params); - if (ret < 0) { - comp_err(dev, - "google_rtc_audio_processing_params(): comp_verify_params failed."); - return -EINVAL; + ipc4_base_module_cfg_to_stream_params(&mod->priv.cfg.base_cfg, params); + component_set_nearest_period_frames(dev, params->rate); + + list_for_item(source_list, &dev->bsource_list) { + sourceb = container_of(source_list, struct comp_buffer, sink_list); + ipc4_update_buffer_format(sourceb, &mod->priv.cfg.base_cfg.audio_fmt); } - return 0; + sinkb = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + ipc4_update_buffer_format(sinkb, &mod->priv.cfg.base_cfg.audio_fmt); } +#endif -static int google_rtc_audio_processing_reconfigure(struct comp_dev *dev) +static int google_rtc_audio_processing_reconfigure(struct processing_module *mod) { - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); + struct comp_dev *dev = mod->dev; uint8_t *config; size_t size; int ret; @@ -267,11 +250,11 @@ static int google_rtc_audio_processing_reconfigure(struct comp_dev *dev) return 0; } -static int google_rtc_audio_processing_cmd_set_data( - struct comp_dev *dev, - struct sof_ipc_ctrl_data *cdata) +#if CONFIG_IPC_MAJOR_3 +static int google_rtc_audio_processing_cmd_set_data(struct processing_module *mod, + struct sof_ipc_ctrl_data *cdata) { - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); int ret; switch (cdata->cmd) { @@ -294,85 +277,124 @@ static int google_rtc_audio_processing_cmd_set_data( } return 0; default: - comp_err(dev, - "google_rtc_audio_processing_ctrl_set_data(): Only binary controls supported %d", - cdata->cmd); + comp_err(mod->dev, + "google_rtc_audio_processing_ctrl_set_data(): Only binary controls supported %d", + cdata->cmd); return -EINVAL; } } -static int google_rtc_audio_processing_cmd_get_data( - struct comp_dev *dev, - struct sof_ipc_ctrl_data *cdata, - int max_data_size) +static int google_rtc_audio_processing_cmd_get_data(struct processing_module *mod, + struct sof_ipc_ctrl_data *cdata, + size_t max_data_size) { - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); - comp_info(dev, "google_rtc_audio_processing_ctrl_get_data(): %u", cdata->cmd); + comp_info(mod->dev, "google_rtc_audio_processing_ctrl_get_data(): %u", cdata->cmd); switch (cdata->cmd) { case SOF_CTRL_CMD_BINARY: return comp_data_blob_get_cmd(cd->tuning_handler, cdata, max_data_size); default: - comp_err(dev, - "google_rtc_audio_processing_ctrl_get_data(): Only binary controls supported %d", - cdata->cmd); + comp_err(mod->dev, + "google_rtc_audio_processing_ctrl_get_data(): Only binary controls supported %d", + cdata->cmd); return -EINVAL; } } +#endif -static int google_rtc_audio_processing_cmd(struct comp_dev *dev, int cmd, void *data, - int max_data_size) +static int google_rtc_audio_processing_set_config(struct processing_module *mod, uint32_t param_id, + enum module_cfg_fragment_position pos, + uint32_t data_offset_size, + const uint8_t *fragment, + size_t fragment_size, uint8_t *response, + size_t response_size) { - struct sof_ipc_ctrl_data *cdata = data; - - comp_dbg(dev, "google_rtc_audio_processing_cmd(): %d - data_cmd: %d", cmd, cdata->cmd); +#if CONFIG_IPC_MAJOR_4 + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); + int ret; - switch (cmd) { - case COMP_CMD_SET_VALUE: - case COMP_CMD_GET_VALUE: - return 0; - case COMP_CMD_SET_DATA: - return google_rtc_audio_processing_cmd_set_data(dev, cdata); - case COMP_CMD_GET_DATA: - return google_rtc_audio_processing_cmd_get_data(dev, cdata, max_data_size); - default: - comp_err(dev, "google_rtc_audio_processing_cmd(): Unknown cmd %d", cmd); + switch (param_id) { + case SOF_IPC4_SWITCH_CONTROL_PARAM_ID: + case SOF_IPC4_ENUM_CONTROL_PARAM_ID: + comp_err(mod->dev, "google_rtc_audio_processing_ctrl_set_data(): Only binary controls supported"); return -EINVAL; } + + ret = comp_data_blob_set(cd->tuning_handler, pos, data_offset_size, + fragment, fragment_size); + if (ret) + return ret; + + /* Accept the new blob immediately so that userspace can write + * the control in quick succession without error. + * This ensures the last successful control write from userspace + * before prepare/copy is applied. + * The config blob is not referenced after reconfigure() returns + * so it is safe to call comp_get_data_blob here which frees the + * old blob. This assumes cmd() and prepare()/copy() cannot run + * concurrently which is the case when there is no preemption. + * + * Note from review: A race condition is possible and should be + * further investigated and fixed. + */ + if (comp_is_new_data_blob_available(cd->tuning_handler)) { + comp_get_data_blob(cd->tuning_handler, NULL, NULL); + cd->reconfigure = true; + } + + return 0; +#elif CONFIG_IPC_MAJOR_3 + struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; + + return google_rtc_audio_processing_cmd_set_data(mod, cdata); +#endif } -static struct comp_dev *google_rtc_audio_processing_create( - const struct comp_driver *drv, - const struct comp_ipc_config *config, - const void *spec) +static int google_rtc_audio_processing_get_config(struct processing_module *mod, + uint32_t param_id, uint32_t *data_offset_size, + uint8_t *fragment, size_t fragment_size) { - struct comp_dev *dev; - struct google_rtc_audio_processing_comp_data *cd; - int ret; - - comp_cl_info(drv, "google_rtc_audio_processing_create()"); +#if CONFIG_IPC_MAJOR_4 + comp_err(mod->dev, "google_rtc_audio_processing_ctrl_get_config(): Not supported"); + return -EINVAL; +#elif CONFIG_IPC_MAJOR_3 + struct sof_ipc_ctrl_data *cdata = (struct sof_ipc_ctrl_data *)fragment; - /* Create component device with an effect processing component */ - dev = comp_alloc(drv, sizeof(*dev)); + return google_rtc_audio_processing_cmd_get_data(mod, cdata, fragment_size); +#endif +} - if (!dev) - return NULL; +static int google_rtc_audio_processing_init(struct processing_module *mod) +{ + struct module_data *md = &mod->priv; + struct comp_dev *dev = mod->dev; + struct google_rtc_audio_processing_comp_data *cd; + int ret; - dev->ipc_config = *config; + comp_info(dev, "google_rtc_audio_processing_init()"); /* Create private component data */ cd = rzalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM, sizeof(*cd)); - if (!cd) + if (!cd) { + ret = -ENOMEM; goto fail; + } + + md->private = cd; #if CONFIG_IPC_MAJOR_4 - cd->config = *(const struct sof_ipc4_aec_config *)spec; + struct module_config *cfg = &md->cfg; + + cd->config = *(const struct sof_ipc4_aec_config *)cfg->init_data; #endif cd->tuning_handler = comp_data_blob_handler_new(dev); - if (!cd->tuning_handler) + if (!cd->tuning_handler) { + ret = -ENOMEM; goto fail; + } cd->num_aec_reference_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_AEC_REFERENCE_CHANNELS; cd->num_capture_channels = CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_NUM_CHANNELS; @@ -384,8 +406,8 @@ static struct comp_dev *google_rtc_audio_processing_create( CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING_MEMORY_BUFFER_SIZE_BYTES * sizeof(cd->memory_buffer[0])); if (!cd->memory_buffer) { - comp_err(dev, "google_rtc_audio_processing_create: failed to allocate memory buffer"); - + comp_err(dev, "google_rtc_audio_processing_init: failed to allocate memory buffer"); + ret = -ENOMEM; goto fail; } @@ -401,6 +423,7 @@ static struct comp_dev *google_rtc_audio_processing_create( if (!cd->state) { comp_err(dev, "Failed to initialized GoogleRtcAudioProcessing"); + ret = -EINVAL; goto fail; } @@ -418,8 +441,10 @@ static struct comp_dev *google_rtc_audio_processing_create( cd->raw_mic_buffer = rballoc( 0, SOF_MEM_CAPS_RAM, cd->num_frames * cd->num_capture_channels * sizeof(cd->raw_mic_buffer[0])); - if (!cd->raw_mic_buffer) + if (!cd->raw_mic_buffer) { + ret = -EINVAL; goto fail; + } bzero(cd->raw_mic_buffer, cd->num_frames * cd->num_capture_channels * sizeof(cd->raw_mic_buffer[0])); cd->raw_mic_buffer_frame_index = 0; @@ -427,16 +452,20 @@ static struct comp_dev *google_rtc_audio_processing_create( 0, SOF_MEM_CAPS_RAM, cd->num_frames * sizeof(cd->aec_reference_buffer[0]) * cd->num_aec_reference_channels); - if (!cd->aec_reference_buffer) + if (!cd->aec_reference_buffer) { + ret = -ENOMEM; goto fail; + } bzero(cd->aec_reference_buffer, cd->num_frames * cd->num_aec_reference_channels * sizeof(cd->aec_reference_buffer[0])); cd->aec_reference_frame_index = 0; cd->output_buffer = rballoc( 0, SOF_MEM_CAPS_RAM, cd->num_frames * cd->num_capture_channels * sizeof(cd->output_buffer[0])); - if (!cd->output_buffer) + if (!cd->output_buffer) { + ret = -ENOMEM; goto fail; + } bzero(cd->output_buffer, cd->num_frames * sizeof(cd->output_buffer[0])); cd->output_buffer_frame_index = 0; @@ -447,12 +476,14 @@ static struct comp_dev *google_rtc_audio_processing_create( */ cd->reconfigure = true; - comp_set_drvdata(dev, cd); - dev->state = COMP_STATE_READY; - comp_dbg(dev, "google_rtc_audio_processing_create(): Ready"); - return dev; + /* Mic and reference, needed for audio stream type copy module client */ + mod->max_sources = 2; + + comp_dbg(dev, "google_rtc_audio_processing_init(): Ready"); + return 0; + fail: - comp_err(dev, "google_rtc_audio_processing_create(): Failed"); + comp_err(dev, "google_rtc_audio_processing_init(): Failed"); if (cd) { rfree(cd->output_buffer); rfree(cd->aec_reference_buffer); @@ -465,15 +496,15 @@ static struct comp_dev *google_rtc_audio_processing_create( comp_data_blob_handler_free(cd->tuning_handler); rfree(cd); } - rfree(dev); - return NULL; + + return ret; } -static void google_rtc_audio_processing_free(struct comp_dev *dev) +static int google_rtc_audio_processing_free(struct processing_module *mod) { - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); - comp_dbg(dev, "google_rtc_audio_processing_free()"); + comp_dbg(mod->dev, "google_rtc_audio_processing_free()"); GoogleRtcAudioProcessingFree(cd->state); cd->state = NULL; @@ -484,44 +515,55 @@ static void google_rtc_audio_processing_free(struct comp_dev *dev) rfree(cd->raw_mic_buffer); comp_data_blob_handler_free(cd->tuning_handler); rfree(cd); - rfree(dev); -} - - -static int google_rtc_audio_processing_trigger(struct comp_dev *dev, int cmd) -{ - comp_dbg(dev, "google_rtc_audio_processing_trigger(): %d", cmd); - - return comp_set_state(dev, cmd); + return 0; } -static int google_rtc_audio_processing_prepare(struct comp_dev *dev) +static int google_rtc_audio_processing_prepare(struct processing_module *mod, + struct sof_source **sources, + int num_of_sources, + struct sof_sink **sinks, + int num_of_sinks) { - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); + struct comp_dev *dev = mod->dev; + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); struct list_item *source_buffer_list_item; + struct comp_buffer *output; unsigned int aec_channels = 0, frame_fmt, rate; + int microphone_stream_channels = 0; + int output_stream_channels; int ret; + int i = 0; + + comp_info(dev, "google_rtc_audio_processing_prepare()"); - comp_dbg(dev, "google_rtc_audio_processing_prepare()"); +#if CONFIG_IPC_MAJOR_4 + google_rtc_audio_processing_params(mod); +#endif /* searching for stream and feedback source buffers */ list_for_item(source_buffer_list_item, &dev->bsource_list) { struct comp_buffer *source = container_of(source_buffer_list_item, struct comp_buffer, sink_list); - #if CONFIG_IPC_MAJOR_4 if (IPC4_SINK_QUEUE_ID(source->id) == SOF_AEC_FEEDBACK_QUEUE_ID) { #else if (source->source->pipeline->pipeline_id != dev->pipeline->pipeline_id) { #endif - cd->aec_reference = source; + cd->aec_reference_source = i; aec_channels = audio_stream_get_channels(&source->stream); + comp_dbg(dev, "reference index = %d, channels = %d", i, aec_channels); } else { - cd->raw_microphone = source; + cd->raw_microphone_source = i; + microphone_stream_channels = audio_stream_get_channels(&source->stream); + comp_dbg(dev, "microphone index = %d, channels = %d", i, + microphone_stream_channels); } + + audio_stream_init_alignment_constants(1, 1, &source->stream); + i++; } - cd->output = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); + output = list_first_item(&dev->bsink_list, struct comp_buffer, source_list); /* On some platform the playback output is left right left right due to a crossover * later on the signal processing chain. That makes the aec_reference be 4 channels @@ -533,18 +575,20 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) return -EINVAL; } - frame_fmt = audio_stream_get_frm_fmt(&cd->output->stream); - rate = audio_stream_get_rate(&cd->output->stream); + audio_stream_init_alignment_constants(1, 1, &output->stream); + frame_fmt = audio_stream_get_frm_fmt(&output->stream); + rate = audio_stream_get_rate(&output->stream); + output_stream_channels = audio_stream_get_channels(&output->stream); - if (cd->num_capture_channels > audio_stream_get_channels(&cd->raw_microphone->stream)) { + if (cd->num_capture_channels > microphone_stream_channels) { comp_err(dev, "unsupported number of microphone channels: %d", - audio_stream_get_channels(&cd->raw_microphone->stream)); + microphone_stream_channels); return -EINVAL; } - if (cd->num_capture_channels > audio_stream_get_channels(&cd->output->stream)) { + if (cd->num_capture_channels > output_stream_channels) { comp_err(dev, "unsupported number of output channels: %d", - audio_stream_get_channels(&cd->output->stream)); + output_stream_channels); return -EINVAL; } @@ -566,60 +610,65 @@ static int google_rtc_audio_processing_prepare(struct comp_dev *dev) /* Blobs sent during COMP_STATE_READY is assigned to blob_handler->data * directly, so comp_is_new_data_blob_available always returns false. */ - ret = google_rtc_audio_processing_reconfigure(dev); + ret = google_rtc_audio_processing_reconfigure(mod); if (ret) return ret; - return comp_set_state(dev, COMP_TRIGGER_PREPARE); + return 0; } -static int google_rtc_audio_processing_reset(struct comp_dev *dev) +static int google_rtc_audio_processing_reset(struct processing_module *mod) { - comp_dbg(dev, "google_rtc_audio_processing_reset()"); + comp_dbg(mod->dev, "google_rtc_audio_processing_reset()"); - return comp_set_state(dev, COMP_TRIGGER_RESET); + return 0; } -static int google_rtc_audio_processing_copy(struct comp_dev *dev) +static int google_rtc_audio_processing_process(struct processing_module *mod, + struct input_stream_buffer *input_buffers, + int num_input_buffers, + struct output_stream_buffer *output_buffers, + int num_output_buffers) { - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - struct comp_copy_limits cl; - struct comp_buffer *buffer; + struct google_rtc_audio_processing_comp_data *cd = module_get_private_data(mod); int16_t *src, *dst, *ref; uint32_t num_aec_reference_frames; uint32_t num_aec_reference_bytes; int num_samples_remaining; int num_frames_remaining; int channel; + int frames; int nmax; int ret; int i, j, n; + struct input_stream_buffer *ref_streamb, *mic_streamb; + struct output_stream_buffer *out_streamb; + struct audio_stream *ref_stream, *mic_stream, *out_stream; + if (cd->reconfigure) { - ret = google_rtc_audio_processing_reconfigure(dev); + ret = google_rtc_audio_processing_reconfigure(mod); if (ret) return ret; } - buffer = cd->aec_reference; - ref = audio_stream_get_rptr(&buffer->stream); + ref_streamb = &input_buffers[cd->aec_reference_source]; + ref_stream = ref_streamb->data; + ref = audio_stream_get_rptr(ref_stream); - num_aec_reference_frames = audio_stream_get_avail_frames(&buffer->stream); - num_aec_reference_bytes = audio_stream_get_avail_bytes(&buffer->stream); + num_aec_reference_frames = input_buffers[cd->aec_reference_source].size; + num_aec_reference_bytes = audio_stream_frame_bytes(ref_stream) * num_aec_reference_frames; - buffer_stream_invalidate(buffer, num_aec_reference_bytes); - - num_samples_remaining = num_aec_reference_frames * - audio_stream_get_channels(&buffer->stream); + num_samples_remaining = num_aec_reference_frames * audio_stream_get_channels(ref_stream); while (num_samples_remaining) { - nmax = audio_stream_samples_without_wrap_s16(&buffer->stream, ref); + nmax = audio_stream_samples_without_wrap_s16(ref_stream, ref); n = MIN(num_samples_remaining, nmax); for (i = 0; i < n; i += cd->num_aec_reference_channels) { j = cd->num_aec_reference_channels * cd->aec_reference_frame_index; for (channel = 0; channel < cd->num_aec_reference_channels; ++channel) cd->aec_reference_buffer[j++] = ref[channel]; - ref += audio_stream_get_channels(&buffer->stream); + ref += audio_stream_get_channels(ref_stream); ++cd->aec_reference_frame_index; if (cd->aec_reference_frame_index == cd->num_frames) { @@ -629,21 +678,25 @@ static int google_rtc_audio_processing_copy(struct comp_dev *dev) } } num_samples_remaining -= n; - ref = audio_stream_wrap(&buffer->stream, ref); + ref = audio_stream_wrap(ref_stream, ref); } - comp_update_buffer_consume(buffer, num_aec_reference_bytes); + input_buffers[cd->aec_reference_source].consumed = num_aec_reference_bytes; + + mic_streamb = &input_buffers[cd->raw_microphone_source]; + mic_stream = mic_streamb->data; + out_streamb = &output_buffers[0]; + out_stream = out_streamb->data; - src = audio_stream_get_rptr(&cd->raw_microphone->stream); - dst = audio_stream_get_wptr(&cd->output->stream); + src = audio_stream_get_rptr(mic_stream); + dst = audio_stream_get_wptr(out_stream); - comp_get_copy_limits(cd->raw_microphone, cd->output, &cl); - buffer_stream_invalidate(cd->raw_microphone, cl.source_bytes); + frames = input_buffers[cd->raw_microphone_source].size; + num_frames_remaining = frames; - num_frames_remaining = cl.frames; while (num_frames_remaining) { - nmax = audio_stream_frames_without_wrap(&cd->raw_microphone->stream, src); + nmax = audio_stream_frames_without_wrap(mic_stream, src); n = MIN(num_frames_remaining, nmax); - nmax = audio_stream_frames_without_wrap(&cd->output->stream, dst); + nmax = audio_stream_frames_without_wrap(out_stream, dst); n = MIN(n, nmax); for (i = 0; i < n; i++) { memcpy_s(&(cd->raw_mic_buffer[cd->raw_mic_buffer_frame_index * @@ -653,7 +706,6 @@ static int google_rtc_audio_processing_copy(struct comp_dev *dev) sizeof(int16_t) * cd->num_capture_channels); ++cd->raw_mic_buffer_frame_index; - memcpy_s(dst, cd->num_frames * cd->num_capture_channels * sizeof(cd->output_buffer[0]), &(cd->output_buffer[cd->output_buffer_frame_index * @@ -669,69 +721,31 @@ static int google_rtc_audio_processing_copy(struct comp_dev *dev) cd->raw_mic_buffer_frame_index = 0; } - src += audio_stream_get_channels(&cd->raw_microphone->stream); - dst += audio_stream_get_channels(&cd->output->stream); + src += audio_stream_get_channels(mic_stream); + dst += audio_stream_get_channels(out_stream); } num_frames_remaining -= n; - src = audio_stream_wrap(&cd->raw_microphone->stream, src); - dst = audio_stream_wrap(&cd->output->stream, dst); + src = audio_stream_wrap(mic_stream, src); + dst = audio_stream_wrap(out_stream, dst); } - buffer_stream_writeback(cd->output, cl.sink_bytes); - - comp_update_buffer_produce(cd->output, cl.sink_bytes); - comp_update_buffer_consume(cd->raw_microphone, cl.source_bytes); + module_update_buffer_position(&input_buffers[cd->raw_microphone_source], + &output_buffers[0], frames); return 0; } -#if CONFIG_IPC_MAJOR_4 -static int google_rtc_audio_processing_get_attribute(struct comp_dev *dev, - uint32_t type, void *value) -{ - struct google_rtc_audio_processing_comp_data *cd = comp_get_drvdata(dev); - - switch (type) { - case COMP_ATTR_BASE_CONFIG: - *(struct ipc4_base_module_cfg *)value = cd->config.base_cfg; - break; - default: - return -EINVAL; - } - - return 0; -} -#endif - -static const struct comp_driver google_rtc_audio_processing = { - .uid = SOF_RT_UUID(google_rtc_audio_processing_uuid), - .tctx = &google_rtc_audio_processing_tr, - .ops = { - .create = google_rtc_audio_processing_create, - .free = google_rtc_audio_processing_free, - .params = google_rtc_audio_processing_params, - .cmd = google_rtc_audio_processing_cmd, - .trigger = google_rtc_audio_processing_trigger, - .copy = google_rtc_audio_processing_copy, - .prepare = google_rtc_audio_processing_prepare, - .reset = google_rtc_audio_processing_reset, -#if CONFIG_IPC_MAJOR_4 - .get_attribute = google_rtc_audio_processing_get_attribute, -#endif - }, +static struct module_interface google_rtc_audio_processing_interface = { + .init = google_rtc_audio_processing_init, + .free = google_rtc_audio_processing_free, + .process_audio_stream = google_rtc_audio_processing_process, + .prepare = google_rtc_audio_processing_prepare, + .set_configuration = google_rtc_audio_processing_set_config, + .get_configuration = google_rtc_audio_processing_get_config, + .reset = google_rtc_audio_processing_reset, }; -static SHARED_DATA struct comp_driver_info google_rtc_audio_processing_info = { - .drv = &google_rtc_audio_processing, -}; - -UT_STATIC void sys_comp_google_rtc_audio_processing_init(void) -{ - comp_register( - platform_shared_get( - &google_rtc_audio_processing_info, - sizeof(google_rtc_audio_processing_info))); -} - -DECLARE_MODULE(sys_comp_google_rtc_audio_processing_init); -SOF_MODULE_INIT(google_rtc_audio_processing, sys_comp_google_rtc_audio_processing_init); +DECLARE_MODULE_ADAPTER(google_rtc_audio_processing_interface, + google_rtc_audio_processing_uuid, google_rtc_audio_processing_tr); +SOF_MODULE_INIT(google_rtc_audio_processing, + sys_comp_module_google_rtc_audio_processing_interface_init); diff --git a/src/include/sof/audio/component.h b/src/include/sof/audio/component.h index 4a24d08ffb28..148a45995abc 100644 --- a/src/include/sof/audio/component.h +++ b/src/include/sof/audio/component.h @@ -720,6 +720,7 @@ void sys_comp_module_demux_interface_init(void); void sys_comp_module_drc_interface_init(void); void sys_comp_module_eq_fir_interface_init(void); void sys_comp_module_eq_iir_interface_init(void); +void sys_comp_module_google_rtc_audio_processing_interface_init(void); void sys_comp_module_mfcc_interface_init(void); void sys_comp_module_mixer_interface_init(void); void sys_comp_module_multiband_drc_interface_init(void); From fc95621cd8939360ffd8f3424b1ae2d88a8b0401 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Tue, 26 Sep 2023 17:53:17 +0300 Subject: [PATCH 599/639] Audio: Google RTC audio processing: Mix all channels in mockup With this change e.g. in all 2ch case all output channels are mixed with matching microphone and reference channels. It helps with testing to hear and see that the mockup works. The mix is done for matching microphone, reference and output channels indices. With e.g. less reference channels, the remaining output channels are passed directly from microphone. The mixed samples are saturated to avoid nasty sounding overflows. Signed-off-by: Lionel Koenig <lionelk@google.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../google/google_rtc_audio_processing_mock.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/audio/google/google_rtc_audio_processing_mock.c b/src/audio/google/google_rtc_audio_processing_mock.c index 6073e125a539..a6c55c641270 100644 --- a/src/audio/google/google_rtc_audio_processing_mock.c +++ b/src/audio/google/google_rtc_audio_processing_mock.c @@ -10,6 +10,8 @@ #include <string.h> #include <stdint.h> +#include <sof/audio/format.h> +#include <sof/math/numbers.h> #include <rtos/alloc.h> #include "ipc/topology.h" @@ -145,11 +147,23 @@ int GoogleRtcAudioProcessingProcessCapture_int16(GoogleRtcAudioProcessingState * int16_t *ref = state->aec_reference; int16_t *mic = (int16_t *) src; int16_t *out = dest; - int n; + int n, io, im, ir; + /* Mix input and reference channels to output. The matching channels numbers + * are mixed. If e.g. microphone and output channels count is 4, and reference + * has 2 channels, output channels 3 and 4 are copy of microphone channels 3 and 4, + * and output channels 1 and 2 are sum of microphone and reference. + */ memset(dest, 0, sizeof(int16_t) * state->num_output_channels * state->num_frames); for (n = 0; n < state->num_frames; ++n) { - *out = *mic + *ref; + im = 0; + ir = 0; + for (io = 0; io < state->num_output_channels; io++) { + out[io] = sat_int16( + (im < state->num_capture_channels ? (int32_t)mic[im++] : 0) + + (ir < state->num_aec_reference_channels ? (int32_t)ref[ir++] : 0)); + } + ref += state->num_aec_reference_channels; out += state->num_output_channels; mic += state->num_capture_channels; From 3d040c72430c30333dc4823547906dd33671bdae Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 25 Sep 2023 18:42:51 +0300 Subject: [PATCH 600/639] Tools: Testbench: Add Google RTC with mockup to testbench This patch allows to load and run it in testbench. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/arch/host/configs/library_defconfig | 2 ++ src/audio/google/CMakeLists.txt | 3 +-- tools/testbench/common_test.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/arch/host/configs/library_defconfig b/src/arch/host/configs/library_defconfig index 6de2eef3333f..071e30808f3c 100644 --- a/src/arch/host/configs/library_defconfig +++ b/src/arch/host/configs/library_defconfig @@ -3,6 +3,7 @@ CONFIG_COMP_CROSSOVER=y CONFIG_COMP_DCBLOCK=y CONFIG_COMP_DRC=y CONFIG_COMP_FIR=y +CONFIG_COMP_GOOGLE_RTC_AUDIO_PROCESSING=y CONFIG_COMP_IIR=y CONFIG_COMP_MFCC=y CONFIG_COMP_MODULE_ADAPTER=y @@ -11,6 +12,7 @@ CONFIG_COMP_MUX=y CONFIG_COMP_SEL=y CONFIG_COMP_SRC=y CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y +CONFIG_COMP_STUBS=y CONFIG_COMP_TDFB=y CONFIG_COMP_VOLUME=y CONFIG_COMP_VOLUME_LINEAR_RAMP=y diff --git a/src/audio/google/CMakeLists.txt b/src/audio/google/CMakeLists.txt index 480766c2f4d5..3936c8041b67 100644 --- a/src/audio/google/CMakeLists.txt +++ b/src/audio/google/CMakeLists.txt @@ -1,7 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause - -if(NOT CONFIG_LIBRARY) +if((NOT CONFIG_LIBRARY) OR CONFIG_LIBRARY_STATIC) if(CONFIG_COMP_GOOGLE_HOTWORD_DETECT) add_local_sources(sof google_hotword_detect.c diff --git a/tools/testbench/common_test.c b/tools/testbench/common_test.c index 221d6ba93d5c..87d815a5bbae 100644 --- a/tools/testbench/common_test.c +++ b/tools/testbench/common_test.c @@ -54,6 +54,7 @@ int tb_setup(struct sof *sof, struct testbench_prm *tp) sys_comp_module_drc_interface_init(); sys_comp_module_eq_fir_interface_init(); sys_comp_module_eq_iir_interface_init(); + sys_comp_module_google_rtc_audio_processing_interface_init(); sys_comp_module_multiband_drc_interface_init(); sys_comp_module_mux_interface_init(); sys_comp_module_src_interface_init(); From f8a202aa92e17ba20fc7dbf637c8836a7a154b0f Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Fri, 20 Oct 2023 13:39:34 +0300 Subject: [PATCH 601/639] app: boards: intel_adsp_ace20_lnl: drop DMA_DW_SUSPEND_DRAIN The LNL board does not use DMA_DW driver, so the board file should not set any build options specific to that driver. This fixes build warning: --cut-- warning: DMA_DW_SUSPEND_DRAIN (defined at drivers/dma/Kconfig.dw_common:27, drivers/dma/Kconfig.dw_common:27, drivers/dma/Kconfig.dw_common:27) was assigned the value 'y' but got the value 'n'. ---cut-- Link: https://github.com/thesofproject/sof/issues/8356 Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- app/boards/intel_adsp_ace20_lnl.conf | 1 - 1 file changed, 1 deletion(-) diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index b8affcf55f61..500c2d5e6efb 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -30,7 +30,6 @@ CONFIG_DAI_INTEL_SSP=y CONFIG_ZEPHYR_DP_SCHEDULER=y CONFIG_DMA=y CONFIG_DMA_INTEL_ADSP_GPDMA=n -CONFIG_DMA_DW_SUSPEND_DRAIN=y CONFIG_INTEL_MODULES=y CONFIG_LIBRARY_MANAGER=y CONFIG_INTEL_ADSP_TIMER=y From d9fb722b648f76cf86b7b4d88be26c513174e661 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 23 Oct 2023 15:01:05 -0700 Subject: [PATCH 602/639] topology/cmake: move alsatplg_version() one level up We want to use it in topology1 too. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/topology/CMakeLists.txt | 25 +++++++++++++++++++++++++ tools/topology/topology2/CMakeLists.txt | 24 ------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/tools/topology/CMakeLists.txt b/tools/topology/CMakeLists.txt index 2ef3feb784be..23b5f9ae7ee5 100644 --- a/tools/topology/CMakeLists.txt +++ b/tools/topology/CMakeLists.txt @@ -1,5 +1,30 @@ set(SOF_TOPOLOGY_BINARY_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") + +function(alsatplg_version OUT_STATUS OUT_VERSION) + execute_process(COMMAND alsatplg --version + RESULT_VARIABLE status + OUTPUT_VARIABLE stdout + OUTPUT_STRIP_TRAILING_WHITESPACE) + message(DEBUG "alsatplg --version: status=${status}, output=${stdout}") + + set(${OUT_STATUS} "${status}" PARENT_SCOPE) + + # Some error messages have already been printed on stderr + if(NOT status EQUAL 0) + message(WARNING "alsatplg --version returned status: ${status}, +${stdout}") + return() + endif() + + string(REPLACE "\n" ";" ALSA_VERSION_LIST ${stdout}) + list(GET ALSA_VERSION_LIST 0 ALSATPLG_VERSION) + string(REGEX MATCH "[0-9]\.[0-9]\.*[0-9]*" ALSATPLG_VERSION_NUMBER ${ALSATPLG_VERSION}) + + set(${OUT_VERSION} "${ALSATPLG_VERSION_NUMBER}" PARENT_SCOPE) +endfunction() + + # This use of VERBOSE relies on original CMake behavior. # From the add_custom_command() manual: # diff --git a/tools/topology/topology2/CMakeLists.txt b/tools/topology/topology2/CMakeLists.txt index 7e3ee5acad7a..d3cd9ecca5f9 100644 --- a/tools/topology/topology2/CMakeLists.txt +++ b/tools/topology/topology2/CMakeLists.txt @@ -3,30 +3,6 @@ add_custom_target(topologies2) # Check alsatplg version and build topology2 if alsatplg version is # 1.2.7 or greater, see https://github.com/thesofproject/sof/issues/5323 - -function(alsatplg_version OUT_STATUS OUT_VERSION) - execute_process(COMMAND alsatplg --version - RESULT_VARIABLE status - OUTPUT_VARIABLE stdout - OUTPUT_STRIP_TRAILING_WHITESPACE) - message(DEBUG "alsatplg --version: status=${status}, output=${stdout}") - - set(${OUT_STATUS} "${status}" PARENT_SCOPE) - - # Some error messages have already been printed on stderr - if(NOT status EQUAL 0) - message(WARNING "alsatplg --version returned status: ${status}, -${stdout}") - return() - endif() - - string(REPLACE "\n" ";" ALSA_VERSION_LIST ${stdout}) - list(GET ALSA_VERSION_LIST 0 ALSATPLG_VERSION) - string(REGEX MATCH "[0-9]\.[0-9]\.*[0-9]*" ALSATPLG_VERSION_NUMBER ${ALSATPLG_VERSION}) - - set(${OUT_VERSION} "${ALSATPLG_VERSION_NUMBER}" PARENT_SCOPE) -endfunction() - alsatplg_version(STATUS ALSATPLG_VERSION_NUMBER) if(NOT STATUS EQUAL 0) From 1b1ec6c4920f9e607259a5ad5e1a5580a9cd6fbd Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 23 Oct 2023 15:08:51 -0700 Subject: [PATCH 603/639] topology/cmake: skip all topologies when alsatplg < 1.2.5 Stop producing corrupted .tplg files when using `codec_consumer` (e.g.: sof-imx8mp-btsco-dual-8ch.tplg, sof-imx8ulp-9x9-btsco-16k.tplg, ...) Then we'll be able to finally search/replace "codec_master", see revert Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/topology/CMakeLists.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/topology/CMakeLists.txt b/tools/topology/CMakeLists.txt index 23b5f9ae7ee5..33722120e41b 100644 --- a/tools/topology/CMakeLists.txt +++ b/tools/topology/CMakeLists.txt @@ -25,6 +25,25 @@ ${stdout}") endfunction() +# Being written in C, `alsatplg` silently ignores some invalid inputs +# and produces an corrupt .tplg file instead of returning an error code +# that fails the build. For instance, alsatplg versions < 1.2.5 silently +# corrupt `codec_consumer` and turn it into `codec_master` instead. +# Longer story in #5192. +alsatplg_version(STATUS ALSATPLG_VERSION_NUMBER) +if(NOT STATUS EQUAL 0) + message(WARNING "alsatplg failed: ${STATUS}; all topologies skipped") + return() +else() + if(${ALSATPLG_VERSION_NUMBER} VERSION_LESS "1.2.5") + message(WARNING "All topologies skipped: minimum alsatplg version 1.2.5,\ + found ${ALSATPLG_VERSION_NUMBER}.") + return() + endif() + # success +endif() + + # This use of VERBOSE relies on original CMake behavior. # From the add_custom_command() manual: # From f6c8706cfe1123ef97ceffae6f26c8c62da6baae Mon Sep 17 00:00:00 2001 From: Daniel Baluta <daniel.baluta@nxp.com> Date: Tue, 24 Oct 2023 13:53:38 +0300 Subject: [PATCH 604/639] drivers: imx: micfil: Change loglevel to info There is no need to print an error at the beginning of a function. The usual behavior should be to print an info. Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com> --- src/drivers/imx/micfil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/imx/micfil.c b/src/drivers/imx/micfil.c index 20c96b9eb4a8..3995dbc48589 100644 --- a/src/drivers/imx/micfil.c +++ b/src/drivers/imx/micfil.c @@ -52,7 +52,7 @@ static int micfil_get_hw_params(struct dai *dai, { struct micfil_pdata *micfil = dai_get_drvdata(dai); - dai_err(dai, "micfil_get_hw_params()"); + dai_info(dai, "micfil_get_hw_params()"); params->rate = micfil->params.pdm_rate; params->channels = micfil->params.pdm_ch; From 88b609ed07305538bec876500cfa49f203eb3099 Mon Sep 17 00:00:00 2001 From: Serhiy Katsyuba <serhiy.katsyuba@intel.com> Date: Thu, 12 Oct 2023 17:20:35 +0200 Subject: [PATCH 605/639] ipc4: Add cross-core binding support Implements binding of two pipelines from different cores so stream could travel cross-core. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com> --- src/include/sof/schedule/ll_schedule_domain.h | 25 +++ src/ipc/ipc4/helper.c | 155 +++++++++++++++--- src/schedule/zephyr_domain.c | 60 +++++++ zephyr/Kconfig | 11 ++ 4 files changed, 228 insertions(+), 23 deletions(-) diff --git a/src/include/sof/schedule/ll_schedule_domain.h b/src/include/sof/schedule/ll_schedule_domain.h index f555c256398b..9765df5ef0bc 100644 --- a/src/include/sof/schedule/ll_schedule_domain.h +++ b/src/include/sof/schedule/ll_schedule_domain.h @@ -44,6 +44,17 @@ struct ll_schedule_domain_ops { struct task *task, uint32_t num_tasks); void (*domain_enable)(struct ll_schedule_domain *domain, int core); void (*domain_disable)(struct ll_schedule_domain *domain, int core); +#if CONFIG_CROSS_CORE_STREAM + /* + * Unlike domain_disable(), these are intended to temporary block LL from + * starting its next cycle. Triggering (e.g., by means of timer interrupt) + * is still enabled and registered but execution of next cycle is blocked. + * Once unblocked, if triggering were previously registered in a blocked + * state -- next cycle execution could start immediately. + */ + void (*domain_block)(struct ll_schedule_domain *domain); + void (*domain_unblock)(struct ll_schedule_domain *domain); +#endif void (*domain_set)(struct ll_schedule_domain *domain, uint64_t start); void (*domain_clear)(struct ll_schedule_domain *domain); bool (*domain_is_pending)(struct ll_schedule_domain *domain, @@ -192,6 +203,20 @@ static inline void domain_disable(struct ll_schedule_domain *domain, int core) } } +#if CONFIG_CROSS_CORE_STREAM +static inline void domain_block(struct ll_schedule_domain *domain) +{ + if (domain->ops->domain_block) + domain->ops->domain_block(domain); +} + +static inline void domain_unblock(struct ll_schedule_domain *domain) +{ + if (domain->ops->domain_unblock) + domain->ops->domain_unblock(domain); +} +#endif + static inline bool domain_is_pending(struct ll_schedule_domain *domain, struct task *task, struct comp_dev **comp) { diff --git a/src/ipc/ipc4/helper.c b/src/ipc/ipc4/helper.c index 91babe75b97d..29ef61dfb5c9 100644 --- a/src/ipc/ipc4/helper.c +++ b/src/ipc/ipc4/helper.c @@ -337,10 +337,78 @@ static struct comp_buffer *ipc4_create_buffer(struct comp_dev *src, bool is_shar ipc_buf.size = buf_size; ipc_buf.comp.id = IPC4_COMP_ID(src_queue, dst_queue); ipc_buf.comp.pipeline_id = src->ipc_config.pipeline_id; - ipc_buf.comp.core = src->ipc_config.core; + ipc_buf.comp.core = cpu_get_id(); return buffer_new(&ipc_buf, is_shared); } +#if CONFIG_CROSS_CORE_STREAM +/* + * Disabling interrupts to block next LL cycle works much faster comparing using + * of condition variable and mutex. Since same core binding is the most typical + * case, let's use slower cond_var blocking mechanism only for not so typical + * cross-core binding. + * + * Note, disabling interrupts to block LL for cross-core binding case will not work + * as .bind() handlers are called on corresponding cores using IDC tasks. IDC requires + * interrupts to be enabled. Only disabling timer interrupt instead of all interrupts + * might work. However, as CPU could go to some power down mode while waiting for + * blocking IDC call response, it's not clear how safe is to assume CPU can wakeup + * without timer interrupt. It depends on blocking IDC waiting implementation. That + * is why additional cond_var mechanism to block LL was introduced which does not + * disable any interrupts. + */ + +#define ll_block(cross_core_bind) \ + do { \ + if (cross_core_bind) \ + domain_block(sof_get()->platform_timer_domain); \ + else \ + irq_local_disable(flags); \ + } while (0) + +#define ll_unblock(cross_core_bind) \ + do { \ + if (cross_core_bind) \ + domain_unblock(sof_get()->platform_timer_domain); \ + else \ + irq_local_enable(flags); \ + } while (0) + +/* Calling both ll_block() and ll_wait_finished_on_core() makes sure LL will not start its + * next cycle and its current cycle on specified core has finished. + */ +static int ll_wait_finished_on_core(struct comp_dev *dev) +{ + /* To make sure (blocked) LL has finished its current cycle, it is + * enough to send any blocking IDC to the core. Since IDC task has lower + * priority then LL thread and cannot preempt it, execution of IDC task + * happens when LL thread is not active waiting for its next cycle. + */ + + int ret; + struct ipc4_base_module_cfg dummy; + + if (cpu_is_me(dev->ipc_config.core)) + return 0; + + /* Any blocking IDC that does not change component state could be utilized */ + ret = comp_ipc4_get_attribute_remote(dev, COMP_ATTR_BASE_CONFIG, &dummy); + if (ret < 0) { + tr_err(&ipc_tr, "comp_ipc4_get_attribute_remote() failed for module %#x", + dev_comp_id(dev)); + return ret; + } + + return 0; +} + +#else + +#define ll_block(cross_core_bind) irq_local_disable(flags) +#define ll_unblock(cross_core_bind) irq_local_enable(flags) + +#endif + int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) { struct ipc4_module_bind_unbind *bu; @@ -364,14 +432,15 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) return IPC4_INVALID_RESOURCE_ID; } - bool is_shared = source->ipc_config.core != sink->ipc_config.core; + bool cross_core_bind = source->ipc_config.core != sink->ipc_config.core; - /* Pass IPC to target core if the buffer won't be shared and will be used - * on different core + /* If both components are on same core -- process IPC on that core, + * otherwise stay on core 0 */ - if (!cpu_is_me(source->ipc_config.core) && !is_shared) + if (!cpu_is_me(source->ipc_config.core) && !cross_core_bind) return ipc4_process_on_core(source->ipc_config.core, false); + /* these might call comp_ipc4_get_attribute_remote() if necessary */ ret = comp_get_attribute(source, COMP_ATTR_BASE_CONFIG, &source_src_cfg); if (ret < 0) { tr_err(&ipc_tr, "failed to get base config for module %#x", dev_comp_id(source)); @@ -397,7 +466,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) else buf_size = sink_src_cfg.ibs * 2; - buffer = ipc4_create_buffer(source, is_shared, buf_size, bu->extension.r.src_queue, + buffer = ipc4_create_buffer(source, cross_core_bind, buf_size, bu->extension.r.src_queue, bu->extension.r.dst_queue); if (!buffer) { tr_err(&ipc_tr, "failed to allocate buffer to bind %d to %d", src_id, sink_id); @@ -418,12 +487,26 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) source_set_min_available(audio_stream_get_source(&buffer->stream), sink_src_cfg.ibs); /* - * Connect and bind the buffer to both source and sink components with the interrupts - * disabled to prevent the IPC task getting preempted which could result in buffers being - * only half connected when a pipeline task gets executed. A spinlock isn't required - * because all connected pipelines need to be on the same core. + * Connect and bind the buffer to both source and sink components with LL processing been + * blocked on corresponding core(s) to prevent IPC or IDC task getting preempted which + * could result in buffers being only half connected when a pipeline task gets executed. */ - irq_local_disable(flags); + ll_block(cross_core_bind); + + if (cross_core_bind) { +#if CONFIG_CROSS_CORE_STREAM + /* Make sure LL has finished on both cores */ + if (!cpu_is_me(source->ipc_config.core)) + if (ll_wait_finished_on_core(source) < 0) + goto free; + if (!cpu_is_me(sink->ipc_config.core)) + if (ll_wait_finished_on_core(sink) < 0) + goto free; +#else + tr_err(&ipc_tr, "Cross-core binding is disabled"); + goto free; +#endif + } ret = comp_buffer_connect(source, source->ipc_config.core, buffer, PPL_CONN_DIR_COMP_TO_BUFFER); @@ -432,7 +515,6 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) goto free; } - ret = comp_buffer_connect(sink, sink->ipc_config.core, buffer, PPL_CONN_DIR_BUFFER_TO_COMP); if (ret < 0) { @@ -440,7 +522,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) goto e_sink_connect; } - + /* these might call comp_ipc4_bind_remote() if necessary */ ret = comp_bind(source, bu); if (ret < 0) goto e_src_bind; @@ -461,7 +543,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) source->direction_set = true; } - irq_local_enable(flags); + ll_unblock(cross_core_bind); return IPC4_SUCCESS; @@ -472,7 +554,7 @@ int ipc_comp_connect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) e_sink_connect: pipeline_disconnect(source, buffer, PPL_CONN_DIR_COMP_TO_BUFFER); free: - irq_local_enable(flags); + ll_unblock(cross_core_bind); buffer_free(buffer); return IPC4_INVALID_RESOURCE_STATE; } @@ -491,6 +573,7 @@ int ipc_comp_disconnect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) uint32_t src_id, sink_id, buffer_id; uint32_t flags; int ret, ret1; + bool cross_core_unbind; bu = (struct ipc4_module_bind_unbind *)_connect; src_id = IPC4_COMP_ID(bu->primary.r.module_id, bu->primary.r.instance_id); @@ -507,8 +590,12 @@ int ipc_comp_disconnect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) return 0; } - /* Pass IPC to target core if both modules has the same target core */ - if (!cpu_is_me(src->ipc_config.core) && src->ipc_config.core == sink->ipc_config.core) + cross_core_unbind = src->ipc_config.core != sink->ipc_config.core; + + /* Pass IPC to target core if both modules has the same target core, + * otherwise stay on core 0 + */ + if (!cpu_is_me(src->ipc_config.core) && !cross_core_unbind) return ipc4_process_on_core(src->ipc_config.core, false); buffer_id = IPC4_COMP_ID(bu->extension.r.src_queue, bu->extension.r.dst_queue); @@ -527,17 +614,39 @@ int ipc_comp_disconnect(struct ipc *ipc, ipc_pipe_comp_connect *_connect) /* * Disconnect and unbind buffer from source/sink components and continue to free the buffer - * even in case of errors. Disable interrupts during disconnect and unbinding to prevent - * the IPC task getting preempted which could result in buffers being only half connected - * when a pipeline task gets executed. A spinlock isn't required because all connected - * pipelines need to be on the same core. + * even in case of errors. Block LL processing during disconnect and unbinding to prevent + * IPC or IDC task getting preempted which could result in buffers being only half connected + * when a pipeline task gets executed. */ - irq_local_disable(flags); + ll_block(cross_core_unbind); + + if (cross_core_unbind) { +#if CONFIG_CROSS_CORE_STREAM + /* Make sure LL has finished on both cores */ + if (!cpu_is_me(src->ipc_config.core)) + if (ll_wait_finished_on_core(src) < 0) { + ll_unblock(cross_core_unbind); + return IPC4_FAILURE; + } + if (!cpu_is_me(sink->ipc_config.core)) + if (ll_wait_finished_on_core(sink) < 0) { + ll_unblock(cross_core_unbind); + return IPC4_FAILURE; + } +#else + tr_err(&ipc_tr, "Cross-core binding is disabled"); + ll_unblock(cross_core_unbind); + return IPC4_FAILURE; +#endif + } + pipeline_disconnect(src, buffer, PPL_CONN_DIR_COMP_TO_BUFFER); pipeline_disconnect(sink, buffer, PPL_CONN_DIR_BUFFER_TO_COMP); + /* these might call comp_ipc4_bind_remote() if necessary */ ret = comp_unbind(src, bu); ret1 = comp_unbind(sink, bu); - irq_local_enable(flags); + + ll_unblock(cross_core_unbind); buffer_free(buffer); diff --git a/src/schedule/zephyr_domain.c b/src/schedule/zephyr_domain.c index 1605dd6ded63..7fb9b4ae0465 100644 --- a/src/schedule/zephyr_domain.c +++ b/src/schedule/zephyr_domain.c @@ -50,6 +50,11 @@ struct zephyr_domain { struct k_timer timer; struct zephyr_domain_thread domain_thread[CONFIG_CORE_COUNT]; struct ll_schedule_domain *ll_domain; +#if CONFIG_CROSS_CORE_STREAM + atomic_t block; + struct k_mutex block_mutex; + struct k_condvar block_condvar; +#endif }; /* perf measurement windows size 2^x */ @@ -67,6 +72,26 @@ static void zephyr_domain_thread_fn(void *p1, void *p2, void *p3) /* immediately go to sleep, waiting to be woken up by the timer */ k_sem_take(&dt->sem, K_FOREVER); +#if CONFIG_CROSS_CORE_STREAM + /* + * If zephyr_domain->block is set -- block LL scheduler from starting its + * next cycle. + * Mutex locking might be somewhat expensive, hence first check for + * zephyr_domain->block value is made without locking the mutex. If + * zephyr_domain->block is not set -- no need to do anything. Otherwise, + * usual condvar procedure is performed: mutex is locked to properly check + * zephyr_domain->block value again to avoid race with unblocking procedure + * (clearing zephyr_domain->block and broadcasting the condvar). + */ + if (atomic_get(&zephyr_domain->block)) { + k_mutex_lock(&zephyr_domain->block_mutex, K_FOREVER); + if (atomic_get(&zephyr_domain->block)) + k_condvar_wait(&zephyr_domain->block_condvar, + &zephyr_domain->block_mutex, K_FOREVER); + k_mutex_unlock(&zephyr_domain->block_mutex); + } +#endif + cycles0 = k_cycle_get_32(); dt->handler(dt->arg); cycles1 = k_cycle_get_32(); @@ -221,9 +246,38 @@ static int zephyr_domain_unregister(struct ll_schedule_domain *domain, return 0; } +#if CONFIG_CROSS_CORE_STREAM +static void zephyr_domain_block(struct ll_schedule_domain *domain) +{ + struct zephyr_domain *zephyr_domain = ll_sch_domain_get_pdata(domain); + + tr_dbg(&ll_tr, "Blocking LL scheduler"); + + k_mutex_lock(&zephyr_domain->block_mutex, K_FOREVER); + atomic_set(&zephyr_domain->block, 1); + k_mutex_unlock(&zephyr_domain->block_mutex); +} + +static void zephyr_domain_unblock(struct ll_schedule_domain *domain) +{ + struct zephyr_domain *zephyr_domain = ll_sch_domain_get_pdata(domain); + + tr_dbg(&ll_tr, "Unblocking LL scheduler"); + + k_mutex_lock(&zephyr_domain->block_mutex, K_FOREVER); + atomic_set(&zephyr_domain->block, 0); + k_condvar_broadcast(&zephyr_domain->block_condvar); + k_mutex_unlock(&zephyr_domain->block_mutex); +} +#endif + static const struct ll_schedule_domain_ops zephyr_domain_ops = { .domain_register = zephyr_domain_register, .domain_unregister = zephyr_domain_unregister, +#if CONFIG_CROSS_CORE_STREAM + .domain_block = zephyr_domain_block, + .domain_unblock = zephyr_domain_unblock, +#endif }; struct ll_schedule_domain *zephyr_domain_init(int clk) @@ -239,6 +293,12 @@ struct ll_schedule_domain *zephyr_domain_init(int clk) zephyr_domain->ll_domain = domain; +#if CONFIG_CROSS_CORE_STREAM + atomic_set(&zephyr_domain->block, 0); + k_mutex_init(&zephyr_domain->block_mutex); + k_condvar_init(&zephyr_domain->block_condvar); +#endif + ll_sch_domain_set_pdata(domain, zephyr_domain); return domain; diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 86c94a1de9a4..ea8c1d6e809f 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -56,4 +56,15 @@ config ZEPHYR_DP_SCHEDULER DP modules can be located in dieffrent cores than LL pipeline modules, may have different tick (i.e. 300ms for speech reccognition, etc.) +config CROSS_CORE_STREAM + bool "Enable cross-core connected pipelines" + default y if IPC_MAJOR_4 + help + Enables support for pipelines from different cores to be + connected together cross-core. So stream can travel from one + core to another. Note, this is different from "multicore" + support. In SOF "multicore" support means different streams + can be processed on different cores, however, each stream + is processed entirely on single core. + endif From d449ff74d6e71763b520ebd1f653bffae6f75efa Mon Sep 17 00:00:00 2001 From: Tomasz Leman <tomasz.m.leman@intel.com> Date: Mon, 23 Oct 2023 10:36:05 +0200 Subject: [PATCH 606/639] west.yml: update zephyr to v3.5.0 Updating zephyr version to v3.5.0 release. Total of 352 commits. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com> --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 14bfd48aa368..8fdbababd700 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: 3563347b108a8fe323595060576572fccdb81be6 + revision: a6eef0ba3755f2530c5ce93524e5ac4f5be30194 remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision From d661616892e591948d4533ffd9221784c8e424f8 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Mon, 23 Oct 2023 09:59:55 -0700 Subject: [PATCH 607/639] .github/zephyr: de-hardcode the remote name in the Windows build too Fixes commit 4bc6488b24e44 (".github/zephyr: de-hardcode the name of the zephyr remote") (Yay for duplication) Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/zephyr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 402f53102015..5b2dd5798e14 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -308,7 +308,7 @@ jobs: # Get some tags to fix `git describe`, see build-linux comments above. cd zephyr $_rev = "$(git rev-parse HEAD)" - git fetch --filter=tree:0 zephyrproject "${_rev}:_branch_placeholder" + git fetch --filter=tree:0 "$(west list -f '{url}' zephyr)" "${_rev}:_branch_placeholder" git branch -D _branch_placeholder From bcdf037d2cdb6ff0ff4a071be193a34142354fce Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 25 Oct 2023 00:29:44 +0000 Subject: [PATCH 608/639] rebuild-testbench.sh: drop no-op LDFLAGS=-Wl,-LE It's not clear why `LDFLAGS=-Wl,-LE` was added in commit 10d0b3b5e1075 ("Scripts: Add xt-run build target for rebuild-testbench.sh"). Maybe it was supposed to be `-Wl,-EL`? Either way this flag has always been interpreted as adding the directory `./E/` to the search library path, which obviously never had any effect; proof below. So it can safely be removed. Here's the proof: ``` mv ~/XCC/install/builds/RG-2017.8-linux/cavs2x_LX6HiFi3_2017_8/xtensa-elf/lib/libm.a . ./scripts/rebuild-testbench.sh -p tgl # Fails as expected # => XCC/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: cannot find -lm cmake --build tools/testbench/build_xt_testbench/ -- testbench # Same again # => XCC/install/tools/RG-2017.8-linux/XtensaTools/bin/xt-ld: cannot find -lm mkdir tools/testbench/build_xt_testbench/E/ cp libm.a tools/testbench/build_xt_testbench/E/ cmake --build tools/testbench/build_xt_testbench/ -- testbench # => now compiles! ``` Remember: the best way to test software is always to break it. Don't forget to fix XCC: ``` mv libm.a ~/XCC/install/builds/RG-2017.8-linux/cavs2x_LX6HiFi3_2017_8/xtensa-elf/lib/ ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- scripts/rebuild-testbench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rebuild-testbench.sh b/scripts/rebuild-testbench.sh index 620b15dbeb26..7ac06e30fd00 100755 --- a/scripts/rebuild-testbench.sh +++ b/scripts/rebuild-testbench.sh @@ -78,7 +78,7 @@ setup_xtensa_tools_build() export CC=$tools_bin/$compiler export LD=$tools_bin/xt-ld export OBJDUMP=$tools_bin/xt-objdump - export LDFLAGS="-mlsp=sim -Wl,-LE $testbench_sections" + export LDFLAGS="-mlsp=sim $testbench_sections" export XTENSA_CORE } From 59a5bc74486c14f7eb2f474b2c46779f89ccef21 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Wed, 25 Oct 2023 00:24:39 +0000 Subject: [PATCH 609/639] rebuild-testbench.sh: explain BUILD_TYPE=native in usage() Explain what happens when running the script without any argument. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- scripts/rebuild-testbench.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/rebuild-testbench.sh b/scripts/rebuild-testbench.sh index 7ac06e30fd00..bc70456f90ad 100755 --- a/scripts/rebuild-testbench.sh +++ b/scripts/rebuild-testbench.sh @@ -2,7 +2,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2020, Mohana Datta Yelugoti -# fail on any errors +# stop on most errors set -e # Defaults @@ -15,6 +15,7 @@ print_usage() cat <<EOFUSAGE usage: $0 [-f] [-p <platform>] -p Build testbench binary for xt-run for selected platform, e.g. -p tgl + When omitted, perform a BUILD_TYPE=native, compile-only check. -f Build testbench with compiler provided by fuzzer (default path: $HOME/sof/work/AFL/afl-gcc) -j number of parallel make/ninja jobs. Defaults to /usr/bin/nproc. @@ -139,7 +140,7 @@ main() done rebuild_testbench - + printf '\n' testbench_usage } From 0ef4dfe15a383de5bf106bce27a16d4b0711dfdc Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Mon, 23 Oct 2023 15:48:26 +0800 Subject: [PATCH 610/639] Audio: aria: move aria header to aria module folder There are two headers for aria, below action is taken: 1. move header file from include path to module path. 2. combine two headers to one header file. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- src/audio/aria/aria.c | 3 +-- src/{include/sof => }/audio/aria/aria.h | 8 +++++- src/audio/aria/aria_generic.c | 3 +-- src/audio/aria/aria_hifi3.c | 2 +- src/include/ipc4/aria.h | 34 ------------------------- 5 files changed, 10 insertions(+), 40 deletions(-) rename src/{include/sof => }/audio/aria/aria.h (92%) delete mode 100644 src/include/ipc4/aria.h diff --git a/src/audio/aria/aria.c b/src/audio/aria/aria.c index 70c93cb4595b..d338ae22743e 100644 --- a/src/audio/aria/aria.c +++ b/src/audio/aria/aria.c @@ -4,7 +4,6 @@ // // Author: Adrian Bonislawski <adrian.bonislawski@intel.com> -#include <sof/audio/aria/aria.h> #include <sof/audio/buffer.h> #include <sof/audio/format.h> #include <sof/audio/pipeline.h> @@ -20,13 +19,13 @@ #include <rtos/string.h> #include <sof/ut.h> #include <sof/trace/trace.h> -#include <ipc4/aria.h> #include <ipc4/fw_reg.h> #include <ipc/dai.h> #include <user/trace.h> #include <errno.h> #include <stddef.h> #include <stdint.h> +#include "aria.h" #define ARIA_SET_ATTENUATION 1 diff --git a/src/include/sof/audio/aria/aria.h b/src/audio/aria/aria.h similarity index 92% rename from src/include/sof/audio/aria/aria.h rename to src/audio/aria/aria.h index 6718f84a72da..98cba48f93c0 100644 --- a/src/include/sof/audio/aria/aria.h +++ b/src/audio/aria/aria.h @@ -6,7 +6,7 @@ */ /** - * \file audio/aria/aria.h + * \file aria.h * \brief Aria component header file * \authors Adrian Bonislawski <adrian.bonislawski@intel.com> */ @@ -16,6 +16,7 @@ #include <sof/audio/component_ext.h> #include <sof/audio/ipc-config.h> +#include <sof/compiler_attributes.h> #include <rtos/bit.h> #include <sof/common.h> #include <sof/trace/trace.h> @@ -92,4 +93,9 @@ struct aria_data { extern const uint8_t INDEX_TAB[]; +struct ipc4_aria_module_cfg { + struct ipc4_base_module_cfg base_cfg; + uint32_t attenuation; +} __packed __aligned(8); + #endif /* __SOF_AUDIO_ARIA_H__ */ diff --git a/src/audio/aria/aria_generic.c b/src/audio/aria/aria_generic.c index 09daee86c5d9..0fca86f44548 100644 --- a/src/audio/aria/aria_generic.c +++ b/src/audio/aria/aria_generic.c @@ -2,8 +2,7 @@ // // Copyright(c) 2023 Intel Corporation. All rights reserved. -#include <sof/audio/aria/aria.h> -#include <ipc4/aria.h> +#include "aria.h" #ifdef ARIA_GENERIC diff --git a/src/audio/aria/aria_hifi3.c b/src/audio/aria/aria_hifi3.c index 363ba583b0d3..e296db7ff863 100644 --- a/src/audio/aria/aria_hifi3.c +++ b/src/audio/aria/aria_hifi3.c @@ -2,7 +2,7 @@ // // Copyright(c) 2021 Intel Corporation. All rights reserved. -#include <sof/audio/aria/aria.h> +#include "aria.h" #ifdef ARIA_HIFI3 #include <xtensa/config/defs.h> diff --git a/src/include/ipc4/aria.h b/src/include/ipc4/aria.h deleted file mode 100644 index 6f7adcd2d2f7..000000000000 --- a/src/include/ipc4/aria.h +++ /dev/null @@ -1,34 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * - * Copyright(c) 2022 Intel Corporation. All rights reserved. - */ - -/* - * This file contains structures that are exact copies of an existing ABI used - * by IOT middleware. They are Intel specific and will be used by one middleware. - * - * Some of the structures may contain programming implementations that makes them - * unsuitable for generic use and general usage. - * - * This code is mostly copied "as-is" from existing C++ interface files hence the use of - * different style in places. The intention is to keep the interface as close as possible to - * original so it's easier to track changes with IPC host code. - */ - -/* - * \file include/ipc4/aria.h - * \brief aria definitions. - * NOTE: This ABI uses bit fields and is non portable. - */ - -#ifndef __SOF_IPC4_ARIA_H__ -#define __SOF_IPC4_ARIA_H__ - -#include <sof/compiler_attributes.h> -#include "base-config.h" - -struct ipc4_aria_module_cfg { - struct ipc4_base_module_cfg base_cfg; - uint32_t attenuation; -} __packed __aligned(8); -#endif From 8be15f5469c09d334b2b7c4ca00bd612a53cdd72 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Tue, 24 Oct 2023 13:27:11 +0200 Subject: [PATCH 611/639] lnl: Fix KD topology tests failure KD topology tests fail on LNL due to insufficient size of heap memory. During creation of KD topologies with 4ch audio format, FW fails on memory allocation. The patch increases HEAPMEM size. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- app/boards/intel_adsp_ace20_lnl.conf | 1 + src/platform/lunarlake/include/platform/lib/memory.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/boards/intel_adsp_ace20_lnl.conf b/app/boards/intel_adsp_ace20_lnl.conf index 500c2d5e6efb..99016e3a539c 100644 --- a/app/boards/intel_adsp_ace20_lnl.conf +++ b/app/boards/intel_adsp_ace20_lnl.conf @@ -57,6 +57,7 @@ CONFIG_LOG_FUNC_NAME_PREFIX_DBG=y CONFIG_COMP_VOLUME_WINDOWS_FADE=y CONFIG_COMP_UP_DOWN_MIXER=y CONFIG_COMP_CHAIN_DMA=y +CONFIG_SAMPLE_KEYPHRASE=y CONFIG_SYS_CLOCK_TICKS_PER_SEC=12000 CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=38400000 diff --git a/src/platform/lunarlake/include/platform/lib/memory.h b/src/platform/lunarlake/include/platform/lib/memory.h index f968da8c50f0..e23fd7556482 100644 --- a/src/platform/lunarlake/include/platform/lib/memory.h +++ b/src/platform/lunarlake/include/platform/lib/memory.h @@ -56,7 +56,7 @@ /** * size of HPSRAM system heap */ -#define HEAPMEM_SIZE 0xD0000 +#define HEAPMEM_SIZE 0xF0000 #endif /* __PLATFORM_LIB_MEMORY_H__ */ From 338e87f7e1fad0d85bacc9a19e382be85da752a8 Mon Sep 17 00:00:00 2001 From: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> Date: Tue, 24 Oct 2023 13:29:18 +0200 Subject: [PATCH 612/639] mtl: Fix KD topology tests failure KD topology tests fail on MTL due to insufficient size of heap memory. During creation of KD topologies with 4ch audio format, FW fails on memory allocation. The patch increases HEAPMEM size. Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com> --- src/platform/meteorlake/include/platform/lib/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/meteorlake/include/platform/lib/memory.h b/src/platform/meteorlake/include/platform/lib/memory.h index a741d0fb1025..77e8b7c1b25b 100644 --- a/src/platform/meteorlake/include/platform/lib/memory.h +++ b/src/platform/meteorlake/include/platform/lib/memory.h @@ -56,7 +56,7 @@ /** * size of HPSRAM system heap */ -#define HEAPMEM_SIZE 0xD0000 +#define HEAPMEM_SIZE 0xF0000 #endif /* __PLATFORM_LIB_MEMORY_H__ */ From a951579bb27e7f8556824ffe4e88705ccee0d024 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Date: Wed, 25 Oct 2023 14:52:08 +0300 Subject: [PATCH 613/639] sof_ri_info: Decode the Signed package info extension Print out some information from the Signed package info extension, the most important information being is the partition_usage which is used to select key slot to be used for verification. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> --- tools/sof_ri_info/sof_ri_info.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/sof_ri_info/sof_ri_info.py b/tools/sof_ri_info/sof_ri_info.py index 8aa5dbbcf56e..126a35e234a3 100755 --- a/tools/sof_ri_info/sof_ri_info.py +++ b/tools/sof_ri_info/sof_ri_info.py @@ -800,6 +800,15 @@ def parse_mft_extension(reader, ext_id): ext.add_a(Auint('base_offset', reader.read_dw())) ext.add_a(Auint('limit_offset', reader.read_dw())) ext.add_a(Abytes('attributes', reader.read_bytes(16))) + elif ext_type == 35: + reader.info("Signed package info extension") + ext = SignedPkgInfoExtension(ext_id, reader.get_offset()-8) + ext.add_a(Astring('name', reader.read_string(4))) + ext.add_a(Auint('vcn', reader.read_dw())) + ext.add_a(Auint('svn', reader.read_dw())) + ext.add_a(Auint('partition_usage', reader.read_b(), 'red')) + read_len = reader.get_offset() - begin_off + reader.ff_data(ext_len - read_len) else: reader.info("Other extension") ext = MftExtension(ext_id, 'Other Extension', reader.get_offset()-8) @@ -1310,6 +1319,22 @@ def dump_info(self, pref, comp_filter): out += ' svn {}'.format(self.adir['svn']) print(out) +class SignedPkgInfoExtension(MftExtension): + """ Signed package info Extension + """ + def __init__(self, ext_id, offset): + super(SignedPkgInfoExtension, + self).__init__(ext_id, 'Signed package info Extension', offset) + + def dump_info(self, pref, comp_filter): + super().dump_info(pref, comp_filter) + out = '{}'.format(pref) + out += ' name {}'.format(self.adir['name']) + out += ' vcn {}'.format(self.adir['vcn']) + out += ' svn {}'.format(self.adir['svn']) + out += ' partition_usage {}'.format(self.adir['partition_usage']) + print(out) + class AdspMetadataFileExt(MftExtension): """ ADSP Metadata File Extension """ From 5cc8a6dc14e29951cb8bc7c558f4981792427a7d Mon Sep 17 00:00:00 2001 From: Andrula Song <andrula.song@intel.com> Date: Thu, 19 Oct 2023 14:39:32 +0800 Subject: [PATCH 614/639] Audio: Fix the default alignment setting Set the default alignment value after buffer format is set in audio_stream_set_params instead of in audio_stream_init where the buffer format hasn't been set yet. Signed-off-by: Andrula Song <andrula.song@intel.com> --- src/audio/audio_stream.c | 6 ---- src/include/sof/audio/audio_stream.h | 44 ++++++++++++++++------------ 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/audio/audio_stream.c b/src/audio/audio_stream.c index 0308e036755c..2a1a7a05e64a 100644 --- a/src/audio/audio_stream.c +++ b/src/audio/audio_stream.c @@ -141,12 +141,6 @@ void audio_stream_init(struct audio_stream *audio_stream, void *buff_addr, uint3 audio_stream->addr = buff_addr; audio_stream->end_addr = (char *)audio_stream->addr + size; - /* set the default alignment info. - * set byte_align as 1 means no alignment limit on byte. - * set frame_align as 1 means no alignment limit on frame. - */ - audio_stream_init_alignment_constants(1, 1, audio_stream); - source_init(audio_stream_get_source(audio_stream), &audio_stream_source_ops, &audio_stream->runtime_stream_params); sink_init(audio_stream_get_sink(audio_stream), &audio_stream_sink_ops, diff --git a/src/include/sof/audio/audio_stream.h b/src/include/sof/audio/audio_stream.h index 49f3dab09245..75060b0e1ef3 100644 --- a/src/include/sof/audio/audio_stream.h +++ b/src/include/sof/audio/audio_stream.h @@ -348,25 +348,6 @@ static inline void audio_stream_set_buffer_fmt(struct audio_stream *buf, #define audio_stream_get_frag(buffer, ptr, idx, sample_size) \ audio_stream_wrap(buffer, (char *)(ptr) + ((idx) * (sample_size))) -/** - * Applies parameters to the buffer. - * @param buffer Buffer. - * @param params Parameters (frame format, rate, number of channels). - * @return 0 if succeeded, error code otherwise. - */ -static inline int audio_stream_set_params(struct audio_stream *buffer, - struct sof_ipc_stream_params *params) -{ - if (!params) - return -EINVAL; - - buffer->runtime_stream_params.frame_fmt = params->frame_fmt; - buffer->runtime_stream_params.rate = params->rate; - buffer->runtime_stream_params.channels = params->channels; - - return 0; -} - /** * Calculates period size in bytes based on component stream's parameters. * @param buf Component buffer. @@ -433,6 +414,31 @@ static inline void audio_stream_init_alignment_constants(const uint32_t byte_ali (is_power_of_2(process_size) ? 31 : 32) - clz(process_size); } +/** + * Applies parameters to the buffer. + * @param buffer Audio stream buffer. + * @param params Parameters (frame format, rate, number of channels). + * @return 0 if succeeded, error code otherwise. + */ +static inline int audio_stream_set_params(struct audio_stream *buffer, + struct sof_ipc_stream_params *params) +{ + if (!params) + return -EINVAL; + + buffer->runtime_stream_params.frame_fmt = params->frame_fmt; + buffer->runtime_stream_params.rate = params->rate; + buffer->runtime_stream_params.channels = params->channels; + + /* set the default alignment info. + * set byte_align as 1 means no alignment limit on byte. + * set frame_align as 1 means no alignment limit on frame. + */ + audio_stream_init_alignment_constants(1, 1, buffer); + + return 0; +} + /** * Calculates period size in bytes based on component stream's parameters. * @param buf Component buffer. From 90fef5afd2adf2cba7f6a5f26f0b25f1c4833f60 Mon Sep 17 00:00:00 2001 From: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com> Date: Tue, 17 Oct 2023 12:47:03 +0200 Subject: [PATCH 615/639] src_lite: add module Addition of SRC Lite module, which only supports a subset of conversions supported by the SRC module. Purpose of SRC Lite module is memory optimization. Code of SRC Lite is drastically reduced and requires significantly less memory. When needed one of defined conversions, driver can choose SRC Lite module instead of SRC module to optimize memory utilization. 48 -> 16kHz 44.1 -> 16 kHz 32 -> 16 kHz 44.1 -> 48 Signed-off-by: Fabiola Kwasowiec <fabiola.kwasowiec@intel.com> --- app/boards/intel_adsp_ace15_mtpm.conf | 1 + src/audio/Kconfig | 12 ++ .../src/coef/src_ipc4_int32_10_21_2500_5000.h | 2 +- .../src/coef/src_ipc4_int32_10_21_3455_5000.h | 2 +- .../src/coef/src_ipc4_int32_10_21_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_10_9_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_16_21_4319_5000.h | 2 +- .../src/coef/src_ipc4_int32_16_21_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_16_7_4082_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_2_2268_5000.h | 1 - .../src/coef/src_ipc4_int32_1_2_2500_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_2_2721_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_2_3401_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_2_3887_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_2_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_3_2268_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_3_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_4_1512_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_4_2268_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_4_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_1_6_1134_5000.h | 2 +- .../src/coef/src_ipc4_int32_20_21_1250_5000.h | 2 +- .../src/coef/src_ipc4_int32_20_21_2500_5000.h | 2 +- .../src/coef/src_ipc4_int32_20_21_3125_5000.h | 2 +- .../src/coef/src_ipc4_int32_20_21_4167_5000.h | 2 +- .../src/coef/src_ipc4_int32_20_21_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_20_7_2976_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_10_2500_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_10_3455_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_10_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_16_4319_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_16_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_20_1250_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_20_2500_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_20_3125_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_20_4167_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_20_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_2_3239_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_32_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_40_2381_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_40_3968_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_4_1080_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_4_3239_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_5_1728_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_5_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_80_3968_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_8_2160_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_8_3239_5000.h | 2 +- .../src/coef/src_ipc4_int32_21_8_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_2_1_2268_5000.h | 2 +- .../src/coef/src_ipc4_int32_2_1_2500_5000.h | 2 +- .../src/coef/src_ipc4_int32_2_1_2721_5000.h | 2 +- .../src/coef/src_ipc4_int32_2_1_3401_5000.h | 2 +- .../src/coef/src_ipc4_int32_2_1_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_2_3_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_32_21_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_3_1_2268_5000.h | 2 +- .../src/coef/src_ipc4_int32_3_1_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_3_2_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_3_4_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_40_21_2381_5000.h | 2 +- .../src/coef/src_ipc4_int32_40_21_2976_5000.h | 2 +- .../src/coef/src_ipc4_int32_40_21_3968_5000.h | 1 - .../src/coef/src_ipc4_int32_40_7_2976_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_1_1134_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_1_1512_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_1_2268_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_1_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_21_1080_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_21_3239_5000.h | 2 +- .../src/coef/src_ipc4_int32_4_3_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_5_21_1728_5000.h | 2 +- .../src/coef/src_ipc4_int32_5_21_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_5_7_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_6_1_1134_5000.h | 2 +- .../src/coef/src_ipc4_int32_7_3_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_7_5_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_7_8_1361_5000.h | 2 +- .../src/coef/src_ipc4_int32_7_8_2468_5000.h | 2 +- .../src/coef/src_ipc4_int32_7_8_2721_5000.h | 2 +- .../src/coef/src_ipc4_int32_7_8_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_21_2160_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_21_3239_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_21_4535_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_7_1361_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_7_2468_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_7_2721_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_7_4082_5000.h | 2 +- .../src/coef/src_ipc4_int32_8_7_4535_5000.h | 2 +- src/audio/src/coef/src_ipc4_int32_table.h | 1 - .../src/coef/src_lite_ipc4_int32_define.h | 23 ++++ .../src/coef/src_lite_ipc4_int32_table.h | 43 ++++++ .../src/coef/src_small_int32_1_2_2268_5000.h | 1 - .../src/coef/src_small_int32_1_2_4535_5000.h | 1 - .../src/coef/src_small_int32_1_3_2268_5000.h | 1 - .../src/coef/src_small_int32_1_3_4535_5000.h | 1 - .../coef/src_small_int32_20_21_4167_5000.h | 1 - .../coef/src_small_int32_21_20_4167_5000.h | 1 - .../src/coef/src_small_int32_2_1_2268_5000.h | 1 - .../src/coef/src_small_int32_2_1_4535_5000.h | 1 - .../src/coef/src_small_int32_2_3_4535_5000.h | 1 - .../src/coef/src_small_int32_3_1_2268_5000.h | 1 - .../src/coef/src_small_int32_3_1_4535_5000.h | 1 - .../src/coef/src_small_int32_3_2_4535_5000.h | 1 - .../src/coef/src_small_int32_3_4_4535_5000.h | 1 - .../src/coef/src_small_int32_4_3_4535_5000.h | 1 - .../src/coef/src_small_int32_4_5_4535_5000.h | 1 - .../src/coef/src_small_int32_5_4_4535_5000.h | 1 - .../src/coef/src_small_int32_5_6_4354_5000.h | 1 - .../src/coef/src_small_int32_6_5_4354_5000.h | 1 - .../src/coef/src_small_int32_7_8_4535_5000.h | 1 - .../src/coef/src_small_int32_8_7_4535_5000.h | 1 - src/audio/src/coef/src_small_int32_table.h | 2 +- src/audio/src/coef/src_std_int32_table.h | 2 +- src/audio/src/coef/src_tiny_int16_table.h | 1 - src/audio/src/src.c | 122 ++++++------------ src/audio/src/src.h | 86 +++++++++++- src/audio/src/src_lite.c | 32 +++++ tools/rimage/config/mtl.toml | 43 +++++- zephyr/CMakeLists.txt | 3 + 120 files changed, 366 insertions(+), 197 deletions(-) create mode 100644 src/audio/src/coef/src_lite_ipc4_int32_define.h create mode 100644 src/audio/src/coef/src_lite_ipc4_int32_table.h create mode 100644 src/audio/src/src_lite.c diff --git a/app/boards/intel_adsp_ace15_mtpm.conf b/app/boards/intel_adsp_ace15_mtpm.conf index ac1a3c846441..7f0938bbdd5b 100644 --- a/app/boards/intel_adsp_ace15_mtpm.conf +++ b/app/boards/intel_adsp_ace15_mtpm.conf @@ -3,6 +3,7 @@ CONFIG_IPC_MAJOR_4=y CONFIG_COMP_SRC=y CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y +CONFIG_COMP_SRC_LITE=y CONFIG_COMP_DRC=y CONFIG_COMP_CROSSOVER=y CONFIG_COMP_MULTIBAND_DRC=y diff --git a/src/audio/Kconfig b/src/audio/Kconfig index 8c533713419a..b05957a835d3 100644 --- a/src/audio/Kconfig +++ b/src/audio/Kconfig @@ -126,6 +126,18 @@ config COMP_SRC help Select for SRC component +config COMP_SRC_LITE + bool "SRC_LITE component" + default y + help + Select for SRC_LITE component + which only supports a subset of conversions + supported by the SRC module: + 48 -> 16kHz + 44.1 -> 16 kHz + 32 -> 16 kHz + 44.1 -> 48 + config COMP_STUBS bool "Build all selected third-party (3P) components with stubs" default n diff --git a/src/audio/src/coef/src_ipc4_int32_10_21_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_10_21_2500_5000.h index d1d115ee44a0..48030954faa5 100644 --- a/src/audio/src/coef/src_ipc4_int32_10_21_2500_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_10_21_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_10_21_2500_5000_fir[480] = { diff --git a/src/audio/src/coef/src_ipc4_int32_10_21_3455_5000.h b/src/audio/src/coef/src_ipc4_int32_10_21_3455_5000.h index 18c85e663503..c0e8973896ad 100644 --- a/src/audio/src/coef/src_ipc4_int32_10_21_3455_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_10_21_3455_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_10_21_3455_5000_fir[640] = { diff --git a/src/audio/src/coef/src_ipc4_int32_10_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_10_21_4535_5000.h index 44548957393b..86d846a7c806 100644 --- a/src/audio/src/coef/src_ipc4_int32_10_21_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_10_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_10_21_4535_5000_fir[2320] = { diff --git a/src/audio/src/coef/src_ipc4_int32_10_9_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_10_9_4535_5000.h index 25cc0225e3be..b8ce8872260a 100644 --- a/src/audio/src/coef/src_ipc4_int32_10_9_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_10_9_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_10_9_4535_5000_fir[1080] = { diff --git a/src/audio/src/coef/src_ipc4_int32_16_21_4319_5000.h b/src/audio/src/coef/src_ipc4_int32_16_21_4319_5000.h index 337160da937f..7afecdab5e9a 100644 --- a/src/audio/src/coef/src_ipc4_int32_16_21_4319_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_16_21_4319_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_16_21_4319_5000_fir[1472] = { diff --git a/src/audio/src/coef/src_ipc4_int32_16_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_16_21_4535_5000.h index e3c61b76f695..f23f95bf5f36 100644 --- a/src/audio/src/coef/src_ipc4_int32_16_21_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_16_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_16_21_4535_5000_fir[2048] = { diff --git a/src/audio/src/coef/src_ipc4_int32_16_7_4082_5000.h b/src/audio/src/coef/src_ipc4_int32_16_7_4082_5000.h index 43805148096f..a28a8804180f 100644 --- a/src/audio/src/coef/src_ipc4_int32_16_7_4082_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_16_7_4082_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_16_7_4082_5000_fir[896] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_2_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_2268_5000.h index be58891825a2..6439054b1a53 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_2_2268_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_2_2268_5000.h @@ -5,7 +5,6 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_2268_5000_fir[36] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_2_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_2500_5000.h index 969ee2727761..5e619afffb81 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_2_2500_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_2_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_2_2500_5000_fir[40] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_2_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_2721_5000.h index 92d3ee21d921..c93526f5354a 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_2_2721_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_2_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_2_2721_5000_fir[44] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_2_3401_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_3401_5000.h index e3556ed816c1..67b9e495a922 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_2_3401_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_2_3401_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_2_3401_5000_fir[60] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_2_3887_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_3887_5000.h index 369c861cd598..154fa629e140 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_2_3887_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_2_3887_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_2_3887_5000_fir[84] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_2_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_1_2_4535_5000.h index c5221b373733..eed23b13668e 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_2_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_2_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_2_4535_5000_fir[192] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_3_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_1_3_2268_5000.h index 51c259bc7617..5a455da33297 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_3_2268_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_3_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_3_2268_5000_fir[52] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_1_3_4535_5000.h index 1f717019d9ea..a22d7c3da8e1 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_3_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_3_4535_5000_fir[260] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_4_1512_5000.h b/src/audio/src/coef/src_ipc4_int32_1_4_1512_5000.h index fcf3ba774765..5426a9ff0404 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_4_1512_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_4_1512_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_4_1512_5000_fir[52] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_4_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_1_4_2268_5000.h index b2f84d157233..d375e6625f1f 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_4_2268_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_4_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_4_2268_5000_fir[60] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_4_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_1_4_4535_5000.h index b33697aedb89..9522110b2d66 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_4_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_4_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_4_4535_5000_fir[332] = { diff --git a/src/audio/src/coef/src_ipc4_int32_1_6_1134_5000.h b/src/audio/src/coef/src_ipc4_int32_1_6_1134_5000.h index 6cc06424de00..02afd78663a4 100644 --- a/src/audio/src/coef/src_ipc4_int32_1_6_1134_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_1_6_1134_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_1_6_1134_5000_fir[68] = { diff --git a/src/audio/src/coef/src_ipc4_int32_20_21_1250_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_1250_5000.h index b50d11408430..dfd8d462b9ec 100644 --- a/src/audio/src/coef/src_ipc4_int32_20_21_1250_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_20_21_1250_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_20_21_1250_5000_fir[320] = { diff --git a/src/audio/src/coef/src_ipc4_int32_20_21_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_2500_5000.h index 5828ac080c60..021c9572342d 100644 --- a/src/audio/src/coef/src_ipc4_int32_20_21_2500_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_20_21_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_20_21_2500_5000_fir[560] = { diff --git a/src/audio/src/coef/src_ipc4_int32_20_21_3125_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_3125_5000.h index c34349e9e25e..09a71eb3dadd 100644 --- a/src/audio/src/coef/src_ipc4_int32_20_21_3125_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_20_21_3125_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_20_21_3125_5000_fir[640] = { diff --git a/src/audio/src/coef/src_ipc4_int32_20_21_4167_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_4167_5000.h index 521d2f244aa2..5eb7c718b39c 100644 --- a/src/audio/src/coef/src_ipc4_int32_20_21_4167_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_20_21_4167_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_20_21_4167_5000_fir[1200] = { diff --git a/src/audio/src/coef/src_ipc4_int32_20_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_20_21_4535_5000.h index 0a1677d6f277..75e59fa53554 100644 --- a/src/audio/src/coef/src_ipc4_int32_20_21_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_20_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_20_21_4535_5000_fir[2080] = { diff --git a/src/audio/src/coef/src_ipc4_int32_20_7_2976_5000.h b/src/audio/src/coef/src_ipc4_int32_20_7_2976_5000.h index a16d7b713113..0e076dfa6b22 100644 --- a/src/audio/src/coef/src_ipc4_int32_20_7_2976_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_20_7_2976_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_20_7_2976_5000_fir[560] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_10_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_21_10_2500_5000.h index e58dddfb028a..8e59eac928a1 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_10_2500_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_10_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_10_2500_5000_fir[504] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_10_3455_5000.h b/src/audio/src/coef/src_ipc4_int32_21_10_3455_5000.h index ec2fef3d8cd7..2d3f3b0c4a22 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_10_3455_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_10_3455_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_10_3455_5000_fir[756] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_10_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_10_4535_5000.h index f24f635f1ac5..ef37e5b74280 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_10_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_10_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_10_4535_5000_fir[2520] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_16_4319_5000.h b/src/audio/src/coef/src_ipc4_int32_21_16_4319_5000.h index aab03d7e8db5..be79e187c8a2 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_16_4319_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_16_4319_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_16_4319_5000_fir[1596] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_16_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_16_4535_5000.h index 924268316718..9afb6408f986 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_16_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_16_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_16_4535_5000_fir[2436] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_20_1250_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_1250_5000.h index a4c08f30e549..a420745baa54 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_20_1250_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_20_1250_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_20_1250_5000_fir[420] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_20_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_2500_5000.h index 356e9539e193..87c0f8a79e01 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_20_2500_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_20_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_20_2500_5000_fir[504] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_20_3125_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_3125_5000.h index fa68cd2fe43a..692597e7093e 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_20_3125_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_20_3125_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_20_3125_5000_fir[672] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_20_4167_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_4167_5000.h index e1476e94177a..a5125e18b35f 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_20_4167_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_20_4167_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_20_4167_5000_fir[1260] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_20_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_20_4535_5000.h index 603779985693..85f20e60c536 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_20_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_20_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_20_4535_5000_fir[2268] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_2_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_21_2_3239_5000.h index 0dec16ed1041..d4a99940d49c 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_2_3239_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_2_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_2_3239_5000_fir[672] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_32_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_32_4535_5000.h index 445cba531dbd..838aeab0b802 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_32_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_32_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_32_4535_5000_fir[3612] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_40_2381_5000.h b/src/audio/src/coef/src_ipc4_int32_21_40_2381_5000.h index 654a37afa02a..bcefb4d03299 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_40_2381_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_40_2381_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_40_2381_5000_fir[924] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h b/src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h index 63b0727e24c5..ce9e0cb6ddb1 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_40_3968_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_40_3968_5000_fir[1680] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_4_1080_5000.h b/src/audio/src/coef/src_ipc4_int32_21_4_1080_5000.h index f22d15eca1bf..de8beea74d01 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_4_1080_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_4_1080_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_4_1080_5000_fir[336] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_4_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_21_4_3239_5000.h index 6c4d3524e4dc..5b8aaf04755c 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_4_3239_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_4_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_4_3239_5000_fir[672] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_5_1728_5000.h b/src/audio/src/coef/src_ipc4_int32_21_5_1728_5000.h index 8d5e1920f9c1..0f6a4110f090 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_5_1728_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_5_1728_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_5_1728_5000_fir[420] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_5_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_5_4535_5000.h index 4f4d101eb8e4..e7e0f09a3d8f 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_5_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_5_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_5_4535_5000_fir[2184] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h b/src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h index e2a51e917c54..71ed1ba54db3 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_80_3968_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_80_3968_5000_fir[3360] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_8_2160_5000.h b/src/audio/src/coef/src_ipc4_int32_21_8_2160_5000.h index 860c7d00c3b5..54ccaae7be81 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_8_2160_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_8_2160_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_8_2160_5000_fir[420] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_8_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_21_8_3239_5000.h index b6568d54b125..3c60f57466f6 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_8_3239_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_8_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_8_3239_5000_fir[672] = { diff --git a/src/audio/src/coef/src_ipc4_int32_21_8_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_21_8_4535_5000.h index d2d853e7af50..77061aec771d 100644 --- a/src/audio/src/coef/src_ipc4_int32_21_8_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_21_8_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_21_8_4535_5000_fir[2436] = { diff --git a/src/audio/src/coef/src_ipc4_int32_2_1_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_2268_5000.h index 09c3bff531dd..5278f76504fd 100644 --- a/src/audio/src/coef/src_ipc4_int32_2_1_2268_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_2_1_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_2_1_2268_5000_fir[48] = { diff --git a/src/audio/src/coef/src_ipc4_int32_2_1_2500_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_2500_5000.h index 83488544fdf0..ccd0fce5856c 100644 --- a/src/audio/src/coef/src_ipc4_int32_2_1_2500_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_2_1_2500_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_2_1_2500_5000_fir[40] = { diff --git a/src/audio/src/coef/src_ipc4_int32_2_1_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_2721_5000.h index 20de3bfeb5a3..eaa8f4c38814 100644 --- a/src/audio/src/coef/src_ipc4_int32_2_1_2721_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_2_1_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_2_1_2721_5000_fir[48] = { diff --git a/src/audio/src/coef/src_ipc4_int32_2_1_3401_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_3401_5000.h index 9dd605d6e52a..93afa72dc538 100644 --- a/src/audio/src/coef/src_ipc4_int32_2_1_3401_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_2_1_3401_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_2_1_3401_5000_fir[72] = { diff --git a/src/audio/src/coef/src_ipc4_int32_2_1_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_2_1_4535_5000.h index 732ef897a283..baf8f5fb4cfd 100644 --- a/src/audio/src/coef/src_ipc4_int32_2_1_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_2_1_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_2_1_4535_5000_fir[240] = { diff --git a/src/audio/src/coef/src_ipc4_int32_2_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_2_3_4535_5000.h index 79eb8611a146..9adf487a73be 100644 --- a/src/audio/src/coef/src_ipc4_int32_2_3_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_2_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_2_3_4535_5000_fir[264] = { diff --git a/src/audio/src/coef/src_ipc4_int32_32_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_32_21_4535_5000.h index df6eef20aeae..89c7e885a064 100644 --- a/src/audio/src/coef/src_ipc4_int32_32_21_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_32_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_32_21_4535_5000_fir[3840] = { diff --git a/src/audio/src/coef/src_ipc4_int32_3_1_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_3_1_2268_5000.h index 5edce0ac9d2d..02ac3227cec4 100644 --- a/src/audio/src/coef/src_ipc4_int32_3_1_2268_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_3_1_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_3_1_2268_5000_fir[72] = { diff --git a/src/audio/src/coef/src_ipc4_int32_3_1_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_3_1_4535_5000.h index eee1b3a17b92..6f3af03b34fb 100644 --- a/src/audio/src/coef/src_ipc4_int32_3_1_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_3_1_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_3_1_4535_5000_fir[336] = { diff --git a/src/audio/src/coef/src_ipc4_int32_3_2_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_3_2_4535_5000.h index 815f41b7bc60..7b528ca29668 100644 --- a/src/audio/src/coef/src_ipc4_int32_3_2_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_3_2_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_3_2_4535_5000_fir[324] = { diff --git a/src/audio/src/coef/src_ipc4_int32_3_4_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_3_4_4535_5000.h index 1c4a33a25539..87183cbf7fab 100644 --- a/src/audio/src/coef/src_ipc4_int32_3_4_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_3_4_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_3_4_4535_5000_fir[360] = { diff --git a/src/audio/src/coef/src_ipc4_int32_40_21_2381_5000.h b/src/audio/src/coef/src_ipc4_int32_40_21_2381_5000.h index cec8b5f212fe..5a0751a569e6 100644 --- a/src/audio/src/coef/src_ipc4_int32_40_21_2381_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_40_21_2381_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_40_21_2381_5000_fir[960] = { diff --git a/src/audio/src/coef/src_ipc4_int32_40_21_2976_5000.h b/src/audio/src/coef/src_ipc4_int32_40_21_2976_5000.h index df32a455a27c..6df84d8ec71b 100644 --- a/src/audio/src/coef/src_ipc4_int32_40_21_2976_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_40_21_2976_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_40_21_2976_5000_fir[1120] = { diff --git a/src/audio/src/coef/src_ipc4_int32_40_21_3968_5000.h b/src/audio/src/coef/src_ipc4_int32_40_21_3968_5000.h index 31d57d112ddc..eb417efac43f 100644 --- a/src/audio/src/coef/src_ipc4_int32_40_21_3968_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_40_21_3968_5000.h @@ -5,7 +5,6 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_40_21_3968_5000_fir[2080] = { diff --git a/src/audio/src/coef/src_ipc4_int32_40_7_2976_5000.h b/src/audio/src/coef/src_ipc4_int32_40_7_2976_5000.h index da0467c3c147..ec29d256dc23 100644 --- a/src/audio/src/coef/src_ipc4_int32_40_7_2976_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_40_7_2976_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_40_7_2976_5000_fir[1120] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_1_1134_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_1134_5000.h index a6698dac6739..94dc4fe2d061 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_1_1134_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_1_1134_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_1_1134_5000_fir[64] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_1_1512_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_1512_5000.h index 0f5b9d267505..d24439378e7d 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_1_1512_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_1_1512_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_1_1512_5000_fir[64] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_1_2268_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_2268_5000.h index 2caa64654899..6debcd407b01 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_1_2268_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_1_2268_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_1_2268_5000_fir[80] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_1_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_4_1_4535_5000.h index efb70988f749..c54bcbaec041 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_1_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_1_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_1_4535_5000_fir[416] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_21_1080_5000.h b/src/audio/src/coef/src_ipc4_int32_4_21_1080_5000.h index 7b5a30d154b2..9087729b2c20 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_21_1080_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_21_1080_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_21_1080_5000_fir[224] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_21_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_4_21_3239_5000.h index 1b876606df53..8bccc923b22b 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_21_3239_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_21_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_21_3239_5000_fir[512] = { diff --git a/src/audio/src/coef/src_ipc4_int32_4_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_4_3_4535_5000.h index 84ab1b359e7b..0ec9006187bc 100644 --- a/src/audio/src/coef/src_ipc4_int32_4_3_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_4_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_4_3_4535_5000_fir[432] = { diff --git a/src/audio/src/coef/src_ipc4_int32_5_21_1728_5000.h b/src/audio/src/coef/src_ipc4_int32_5_21_1728_5000.h index 226e1a6216af..6996b1b22e27 100644 --- a/src/audio/src/coef/src_ipc4_int32_5_21_1728_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_5_21_1728_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_5_21_1728_5000_fir[320] = { diff --git a/src/audio/src/coef/src_ipc4_int32_5_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_5_21_4535_5000.h index 290d409fd00d..e6a61dde3ab1 100644 --- a/src/audio/src/coef/src_ipc4_int32_5_21_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_5_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_5_21_4535_5000_fir[1740] = { diff --git a/src/audio/src/coef/src_ipc4_int32_5_7_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_5_7_4535_5000.h index f8314556a665..a53184414f6a 100644 --- a/src/audio/src/coef/src_ipc4_int32_5_7_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_5_7_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_5_7_4535_5000_fir[680] = { diff --git a/src/audio/src/coef/src_ipc4_int32_6_1_1134_5000.h b/src/audio/src/coef/src_ipc4_int32_6_1_1134_5000.h index ddf6e0c51bde..0a0fdc47204b 100644 --- a/src/audio/src/coef/src_ipc4_int32_6_1_1134_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_6_1_1134_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_6_1_1134_5000_fir[96] = { diff --git a/src/audio/src/coef/src_ipc4_int32_7_3_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_7_3_4535_5000.h index 1b40753e77d7..182a13ff7da8 100644 --- a/src/audio/src/coef/src_ipc4_int32_7_3_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_7_3_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_7_3_4535_5000_fir[728] = { diff --git a/src/audio/src/coef/src_ipc4_int32_7_5_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_7_5_4535_5000.h index 0e7ecf543842..9892f3419692 100644 --- a/src/audio/src/coef/src_ipc4_int32_7_5_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_7_5_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_7_5_4535_5000_fir[812] = { diff --git a/src/audio/src/coef/src_ipc4_int32_7_8_1361_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_1361_5000.h index d5a31e8fa3d4..caa97de96c8a 100644 --- a/src/audio/src/coef/src_ipc4_int32_7_8_1361_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_7_8_1361_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_7_8_1361_5000_fir[140] = { diff --git a/src/audio/src/coef/src_ipc4_int32_7_8_2468_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_2468_5000.h index c68546b258d9..f47683dadc66 100644 --- a/src/audio/src/coef/src_ipc4_int32_7_8_2468_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_7_8_2468_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_7_8_2468_5000_fir[196] = { diff --git a/src/audio/src/coef/src_ipc4_int32_7_8_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_2721_5000.h index 3c7c02ecbc3d..1d53d3f887c1 100644 --- a/src/audio/src/coef/src_ipc4_int32_7_8_2721_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_7_8_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_7_8_2721_5000_fir[224] = { diff --git a/src/audio/src/coef/src_ipc4_int32_7_8_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_7_8_4535_5000.h index 3037d3dd258e..afbc84f69fb1 100644 --- a/src/audio/src/coef/src_ipc4_int32_7_8_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_7_8_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_7_8_4535_5000_fir[840] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_21_2160_5000.h b/src/audio/src/coef/src_ipc4_int32_8_21_2160_5000.h index c687495d433d..a8db0edae0f1 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_21_2160_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_21_2160_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_21_2160_5000_fir[384] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_21_3239_5000.h b/src/audio/src/coef/src_ipc4_int32_8_21_3239_5000.h index 4bc6f351e350..6c94c2eb5b1f 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_21_3239_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_21_3239_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_21_3239_5000_fir[544] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_21_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_8_21_4535_5000.h index d61a7d09d215..6ed9f654954f 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_21_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_21_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_21_4535_5000_fir[1984] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_7_1361_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_1361_5000.h index a0746b412434..78b22782c66a 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_7_1361_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_7_1361_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_7_1361_5000_fir[160] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_7_2468_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_2468_5000.h index 01b479c08705..f8c8b11efddc 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_7_2468_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_7_2468_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_7_2468_5000_fir[192] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_7_2721_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_2721_5000.h index 921abdb6b94d..b71b96071313 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_7_2721_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_7_2721_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_7_2721_5000_fir[192] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_7_4082_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_4082_5000.h index 7a5b0ec6b469..2e02d9c80455 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_7_4082_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_7_4082_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_7_4082_5000_fir[480] = { diff --git a/src/audio/src/coef/src_ipc4_int32_8_7_4535_5000.h b/src/audio/src/coef/src_ipc4_int32_8_7_4535_5000.h index 51b0c1dc13df..8754d53b2cad 100644 --- a/src/audio/src/coef/src_ipc4_int32_8_7_4535_5000.h +++ b/src/audio/src/coef/src_ipc4_int32_8_7_4535_5000.h @@ -5,7 +5,7 @@ */ /** \cond GENERATED_BY_TOOLS_TUNE_SRC */ -#include "../src.h" + #include <stdint.h> const int32_t src_int32_8_7_4535_5000_fir[896] = { diff --git a/src/audio/src/coef/src_ipc4_int32_table.h b/src/audio/src/coef/src_ipc4_int32_table.h index 23a470ad7025..98f7cc0e9f09 100644 --- a/src/audio/src/coef/src_ipc4_int32_table.h +++ b/src/audio/src/coef/src_ipc4_int32_table.h @@ -97,7 +97,6 @@ #include "src_ipc4_int32_40_21_2381_5000.h" #include "src_ipc4_int32_40_21_2976_5000.h" #include "src_ipc4_int32_40_21_3968_5000.h" -#include "../src.h" #include <stdint.h> /* SRC table */ diff --git a/src/audio/src/coef/src_lite_ipc4_int32_define.h b/src/audio/src/coef/src_lite_ipc4_int32_define.h new file mode 100644 index 000000000000..c690f3c7338f --- /dev/null +++ b/src/audio/src/coef/src_lite_ipc4_int32_define.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + * Author: Fabiola Jasinska <fabiola.jasinska@intel.com> + */ + +#ifndef __SOF_AUDIO_COEFFICIENTS_SRC_SRC_IPC4_INT32_DEFINE_H__ +#define __SOF_AUDIO_COEFFICIENTS_SRC_SRC_IPC4_INT32_DEFINE_H__ + +/* SRC constants */ +#define MAX_FIR_DELAY_SIZE 730 +#define MAX_OUT_DELAY_SIZE 900 +#define MAX_BLK_IN 80 +#define MAX_BLK_OUT 40 +#define NUM_IN_FS 16 +#define NUM_OUT_FS 10 +#define STAGE1_TIMES_MAX 32 +#define STAGE2_TIMES_MAX 32 +#define STAGE_BUF_SIZE 672 +#define NUM_ALL_COEFFICIENTS 69224 + +#endif /* __SOF_AUDIO_COEFFICIENTS_SRC_SRC_IPC4_INT32_DEFINE_H__ */ diff --git a/src/audio/src/coef/src_lite_ipc4_int32_table.h b/src/audio/src/coef/src_lite_ipc4_int32_table.h new file mode 100644 index 000000000000..90f6b6d15c8a --- /dev/null +++ b/src/audio/src/coef/src_lite_ipc4_int32_table.h @@ -0,0 +1,43 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * + * Copyright(c) 2023 Intel Corporation. All rights reserved. + * + */ + +/** \cond GENERATED_BY_TOOLS_TUNE_SRC */ + +#ifndef __SOF_AUDIO_COEFFICIENTS_SRC_src_IPC4_INT32_TABLE_H__ +#define __SOF_AUDIO_COEFFICIENTS_SRC_src_IPC4_INT32_TABLE_H__ + +/* SRC conversions */ +#include "src_ipc4_int32_1_2_4535_5000.h" +#include "src_ipc4_int32_10_21_3455_5000.h" +#include "src_ipc4_int32_1_3_4535_5000.h" +#include "src_ipc4_int32_3_2_4535_5000.h" +#include "src_ipc4_int32_8_7_4535_5000.h" +#include "src_ipc4_int32_16_21_4535_5000.h" +#include "src_ipc4_int32_20_21_4167_5000.h" + +#include <stdint.h> + +/* SRC table */ +int32_t src_fir_one = Q_CONVERT_FLOAT(1, 30); +struct src_stage src_int32_1_1_0_0 = { 0, 0, 1, 1, 1, 1, 1, 0, -1, &src_fir_one }; +struct src_stage src_int32_0_0_0_0 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, &src_fir_one }; +int src_in_fs[3] = { 32000, 44100, 48000}; +int src_out_fs[2] = {16000, 48000}; + +struct src_stage *src_table1[2][3] = { + { &src_int32_1_2_4535_5000, &src_int32_10_21_3455_5000, + &src_int32_1_3_4535_5000 }, + { &src_int32_3_2_4535_5000, &src_int32_8_7_4535_5000, &src_int32_1_1_0_0 } +}; + +struct src_stage *src_table2[2][3] = { + { &src_int32_1_1_0_0, &src_int32_16_21_4535_5000, &src_int32_1_1_0_0 }, + { &src_int32_1_1_0_0, &src_int32_20_21_4167_5000, &src_int32_1_1_0_0 } +}; + +#endif /* __SOF_AUDIO_COEFFICIENTS_SRC_src_IPC4_INT32_TABLE_H__ */ + +/** \endcond */ diff --git a/src/audio/src/coef/src_small_int32_1_2_2268_5000.h b/src/audio/src/coef/src_small_int32_1_2_2268_5000.h index e71ef83a079e..e47e44345aa9 100644 --- a/src/audio/src/coef/src_small_int32_1_2_2268_5000.h +++ b/src/audio/src/coef/src_small_int32_1_2_2268_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_2268_5000_fir[40] = { diff --git a/src/audio/src/coef/src_small_int32_1_2_4535_5000.h b/src/audio/src/coef/src_small_int32_1_2_4535_5000.h index 9a207cfc4a78..bc677003b18b 100644 --- a/src/audio/src/coef/src_small_int32_1_2_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_1_2_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_1_2_4535_5000_fir[200] = { diff --git a/src/audio/src/coef/src_small_int32_1_3_2268_5000.h b/src/audio/src/coef/src_small_int32_1_3_2268_5000.h index 22114da5f961..b56245e5b61c 100644 --- a/src/audio/src/coef/src_small_int32_1_3_2268_5000.h +++ b/src/audio/src/coef/src_small_int32_1_3_2268_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_1_3_2268_5000_fir[56] = { diff --git a/src/audio/src/coef/src_small_int32_1_3_4535_5000.h b/src/audio/src/coef/src_small_int32_1_3_4535_5000.h index 40d2c1d57b00..9086231b48b1 100644 --- a/src/audio/src/coef/src_small_int32_1_3_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_1_3_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_1_3_4535_5000_fir[268] = { diff --git a/src/audio/src/coef/src_small_int32_20_21_4167_5000.h b/src/audio/src/coef/src_small_int32_20_21_4167_5000.h index 5ba424809efe..d8c4224bc811 100644 --- a/src/audio/src/coef/src_small_int32_20_21_4167_5000.h +++ b/src/audio/src/coef/src_small_int32_20_21_4167_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_20_21_4167_5000_fir[1120] = { diff --git a/src/audio/src/coef/src_small_int32_21_20_4167_5000.h b/src/audio/src/coef/src_small_int32_21_20_4167_5000.h index 5280f529fb30..19872b67f0fd 100644 --- a/src/audio/src/coef/src_small_int32_21_20_4167_5000.h +++ b/src/audio/src/coef/src_small_int32_21_20_4167_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_21_20_4167_5000_fir[1092] = { diff --git a/src/audio/src/coef/src_small_int32_2_1_2268_5000.h b/src/audio/src/coef/src_small_int32_2_1_2268_5000.h index 3b727a0d782b..cfc1c9c42728 100644 --- a/src/audio/src/coef/src_small_int32_2_1_2268_5000.h +++ b/src/audio/src/coef/src_small_int32_2_1_2268_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_2268_5000_fir[40] = { diff --git a/src/audio/src/coef/src_small_int32_2_1_4535_5000.h b/src/audio/src/coef/src_small_int32_2_1_4535_5000.h index 4d2d75ec328b..31e1d3e361f7 100644 --- a/src/audio/src/coef/src_small_int32_2_1_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_2_1_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_2_1_4535_5000_fir[200] = { diff --git a/src/audio/src/coef/src_small_int32_2_3_4535_5000.h b/src/audio/src/coef/src_small_int32_2_3_4535_5000.h index b6b464f6b4bf..4c64cb49c4d1 100644 --- a/src/audio/src/coef/src_small_int32_2_3_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_2_3_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_2_3_4535_5000_fir[272] = { diff --git a/src/audio/src/coef/src_small_int32_3_1_2268_5000.h b/src/audio/src/coef/src_small_int32_3_1_2268_5000.h index 8b79acf94a6e..f8a379ed0b3f 100644 --- a/src/audio/src/coef/src_small_int32_3_1_2268_5000.h +++ b/src/audio/src/coef/src_small_int32_3_1_2268_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_3_1_2268_5000_fir[60] = { diff --git a/src/audio/src/coef/src_small_int32_3_1_4535_5000.h b/src/audio/src/coef/src_small_int32_3_1_4535_5000.h index 33ebefc04653..e7d2c66009f6 100644 --- a/src/audio/src/coef/src_small_int32_3_1_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_3_1_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_3_1_4535_5000_fir[276] = { diff --git a/src/audio/src/coef/src_small_int32_3_2_4535_5000.h b/src/audio/src/coef/src_small_int32_3_2_4535_5000.h index 668947ceb7e6..c221fb86dbdb 100644 --- a/src/audio/src/coef/src_small_int32_3_2_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_3_2_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_3_2_4535_5000_fir[276] = { diff --git a/src/audio/src/coef/src_small_int32_3_4_4535_5000.h b/src/audio/src/coef/src_small_int32_3_4_4535_5000.h index b6527580c8f2..f0d1527b74aa 100644 --- a/src/audio/src/coef/src_small_int32_3_4_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_3_4_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_3_4_4535_5000_fir[348] = { diff --git a/src/audio/src/coef/src_small_int32_4_3_4535_5000.h b/src/audio/src/coef/src_small_int32_4_3_4535_5000.h index 5266ca1448c9..8cf22c9a9eb7 100644 --- a/src/audio/src/coef/src_small_int32_4_3_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_4_3_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_4_3_4535_5000_fir[352] = { diff --git a/src/audio/src/coef/src_small_int32_4_5_4535_5000.h b/src/audio/src/coef/src_small_int32_4_5_4535_5000.h index 4eca45e3d5f8..10c49bd6f82f 100644 --- a/src/audio/src/coef/src_small_int32_4_5_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_4_5_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_4_5_4535_5000_fir[448] = { diff --git a/src/audio/src/coef/src_small_int32_5_4_4535_5000.h b/src/audio/src/coef/src_small_int32_5_4_4535_5000.h index 79240798db05..3e8c24769c44 100644 --- a/src/audio/src/coef/src_small_int32_5_4_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_5_4_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_5_4_4535_5000_fir[440] = { diff --git a/src/audio/src/coef/src_small_int32_5_6_4354_5000.h b/src/audio/src/coef/src_small_int32_5_6_4354_5000.h index a34c3d2d7c1f..1323d07df6d0 100644 --- a/src/audio/src/coef/src_small_int32_5_6_4354_5000.h +++ b/src/audio/src/coef/src_small_int32_5_6_4354_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_5_6_4354_5000_fir[380] = { diff --git a/src/audio/src/coef/src_small_int32_6_5_4354_5000.h b/src/audio/src/coef/src_small_int32_6_5_4354_5000.h index 1cb91867ff13..959a4cf8e041 100644 --- a/src/audio/src/coef/src_small_int32_6_5_4354_5000.h +++ b/src/audio/src/coef/src_small_int32_6_5_4354_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_6_5_4354_5000_fir[384] = { diff --git a/src/audio/src/coef/src_small_int32_7_8_4535_5000.h b/src/audio/src/coef/src_small_int32_7_8_4535_5000.h index 537a4e1d63ca..0dd63132b167 100644 --- a/src/audio/src/coef/src_small_int32_7_8_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_7_8_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_7_8_4535_5000_fir[644] = { diff --git a/src/audio/src/coef/src_small_int32_8_7_4535_5000.h b/src/audio/src/coef/src_small_int32_8_7_4535_5000.h index fda7bb6c4e41..4f0aeecdde94 100644 --- a/src/audio/src/coef/src_small_int32_8_7_4535_5000.h +++ b/src/audio/src/coef/src_small_int32_8_7_4535_5000.h @@ -4,7 +4,6 @@ * */ -#include "../src.h" #include <stdint.h> const int32_t src_int32_8_7_4535_5000_fir[640] = { diff --git a/src/audio/src/coef/src_small_int32_table.h b/src/audio/src/coef/src_small_int32_table.h index 2fd22a6372f3..3a01957e9560 100644 --- a/src/audio/src/coef/src_small_int32_table.h +++ b/src/audio/src/coef/src_small_int32_table.h @@ -28,7 +28,7 @@ #include "src_small_int32_8_7_4535_5000.h" #include "src_small_int32_20_21_4167_5000.h" #include "src_small_int32_21_20_4167_5000.h" -#include "../src.h" + #include <stdint.h> /* SRC table */ diff --git a/src/audio/src/coef/src_std_int32_table.h b/src/audio/src/coef/src_std_int32_table.h index 7905e3a88745..9d96da8c6658 100644 --- a/src/audio/src/coef/src_std_int32_table.h +++ b/src/audio/src/coef/src_std_int32_table.h @@ -38,7 +38,7 @@ #include "src_std_int32_21_80_3968_5000.h" #include "src_std_int32_32_21_4535_5000.h" #include "src_std_int32_40_21_3968_5000.h" -#include "../src.h" + #include <stdint.h> /* SRC table */ diff --git a/src/audio/src/coef/src_tiny_int16_table.h b/src/audio/src/coef/src_tiny_int16_table.h index f4b7b790ca24..3a6003db75d8 100644 --- a/src/audio/src/coef/src_tiny_int16_table.h +++ b/src/audio/src/coef/src_tiny_int16_table.h @@ -23,7 +23,6 @@ #include "src_tiny_int16_21_20_1667_5000.h" #include "src_tiny_int16_24_25_1814_5000.h" #include "src_tiny_int16_25_24_1814_5000.h" -#include "../src.h" #include <stdint.h> /* SRC table */ diff --git a/src/audio/src/src.c b/src/audio/src/src.c index d1966efe5e4e..0be34245189a 100644 --- a/src/audio/src/src.c +++ b/src/audio/src/src.c @@ -41,7 +41,10 @@ #include "src.h" #include "src_config.h" -#if SRC_SHORT || CONFIG_COMP_SRC_TINY +#ifdef SRC_LITE +#include "coef/src_lite_ipc4_int32_define.h" +#include "coef/src_lite_ipc4_int32_table.h" +#elif SRC_SHORT || CONFIG_COMP_SRC_TINY #include "coef/src_tiny_int16_define.h" #include "coef/src_tiny_int16_table.h" #elif CONFIG_COMP_SRC_SMALL @@ -63,34 +66,9 @@ LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL); -/* Calculates the needed FIR delay line length */ -static int src_fir_delay_length(struct src_stage *s) -{ - return s->subfilter_length + (s->num_of_subfilters - 1) * s->idm - + s->blk_in; -} - -/* Calculates the FIR output delay line length */ -static int src_out_delay_length(struct src_stage *s) -{ - return 1 + (s->num_of_subfilters - 1) * s->odm; -} - -/* Returns index of a matching sample rate */ -static int src_find_fs(int fs_list[], int list_length, int fs) -{ - int i; - - for (i = 0; i < list_length; i++) { - if (fs_list[i] == fs) - return i; - } - return -EINVAL; -} - /* Calculates buffers to allocate for a SRC mode */ -static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, - int nch) +int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, + int nch) { struct src_stage *stage1; struct src_stage *stage2; @@ -172,15 +150,9 @@ static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, return 0; } -static void src_state_reset(struct src_state *state) -{ - state->fir_delay_size = 0; - state->out_delay_size = 0; -} - -static int init_stages(struct src_stage *stage1, struct src_stage *stage2, - struct polyphase_src *src, struct src_param *p, - int n, int32_t *delay_lines_start) +int init_stages(struct src_stage *stage1, struct src_stage *stage2, + struct polyphase_src *src, struct src_param *p, + int n, int32_t *delay_lines_start) { /* Clear FIR state */ src_state_reset(&src->state1); @@ -244,15 +216,6 @@ static int init_stages(struct src_stage *stage1, struct src_stage *stage2, return 0; } -void src_polyphase_reset(struct polyphase_src *src) -{ - src->number_of_stages = 0; - src->stage1 = NULL; - src->stage2 = NULL; - src_state_reset(&src->state1); - src_state_reset(&src->state2); -} - int src_polyphase_init(struct polyphase_src *src, struct src_param *p, int32_t *delay_lines_start) { @@ -291,16 +254,9 @@ int src_polyphase_init(struct polyphase_src *src, struct src_param *p, return n_stages; } -/* Fallback function */ -int src_fallback(struct comp_data *cd, struct sof_source *source, - struct sof_sink *sink) -{ - return 0; -} - /* Normal 2 stage SRC */ -static int src_2s(struct comp_data *cd, - struct sof_source *source, struct sof_sink *sink) +int src_2s(struct comp_data *cd, + struct sof_source *source, struct sof_sink *sink) { struct src_stage_prm s1; struct src_stage_prm s2; @@ -401,8 +357,8 @@ static int src_2s(struct comp_data *cd, } /* 1 stage SRC for simple conversions */ -static int src_1s(struct comp_data *cd, struct sof_source *source, - struct sof_sink *sink) +int src_1s(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink) { struct src_stage_prm s1; int ret; @@ -441,8 +397,8 @@ static int src_1s(struct comp_data *cd, struct sof_source *source, } /* A fast copy function for same in and out rate */ -static int src_copy_sxx(struct comp_data *cd, struct sof_source *source, - struct sof_sink *sink) +int src_copy_sxx(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink) { int frames = cd->param.blk_in; @@ -468,7 +424,7 @@ void src_set_alignment(struct sof_source *source, struct sof_sink *sink) sink_set_alignment_constants(sink, byte_align, frame_align_req); } -static int src_verify_params(struct processing_module *mod) +int src_verify_params(struct processing_module *mod) { struct sof_ipc_stream_params *params = mod->stream_params; struct comp_data *cd = module_get_private_data(mod); @@ -505,9 +461,9 @@ static int src_verify_params(struct processing_module *mod) return ret; } -static bool src_get_copy_limits(struct comp_data *cd, - struct sof_source *source, - struct sof_sink *sink) +bool src_get_copy_limits(struct comp_data *cd, + struct sof_source *source, + struct sof_sink *sink) { struct src_param *sp; struct src_stage *s1; @@ -549,9 +505,9 @@ static bool src_get_copy_limits(struct comp_data *cd, return true; } -static int src_params_general(struct processing_module *mod, - struct sof_source *source, - struct sof_sink *sink) +int src_params_general(struct processing_module *mod, + struct sof_source *source, + struct sof_sink *sink) { struct comp_data *cd = module_get_private_data(mod); struct comp_dev *dev = mod->dev; @@ -652,9 +608,9 @@ static int src_params_general(struct processing_module *mod, return 0; } -static int src_prepare(struct processing_module *mod, - struct sof_source **sources, int num_of_sources, - struct sof_sink **sinks, int num_of_sinks) +int src_prepare(struct processing_module *mod, + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { int ret; @@ -671,18 +627,18 @@ static int src_prepare(struct processing_module *mod, } -static bool src_is_ready_to_process(struct processing_module *mod, - struct sof_source **sources, int num_of_sources, - struct sof_sink **sinks, int num_of_sinks) +bool src_is_ready_to_process(struct processing_module *mod, + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); return src_get_copy_limits(cd, sources[0], sinks[0]); } -static int src_process(struct processing_module *mod, - struct sof_source **sources, int num_of_sources, - struct sof_sink **sinks, int num_of_sinks) +int src_process(struct processing_module *mod, + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks) { struct comp_data *cd = module_get_private_data(mod); @@ -697,21 +653,21 @@ static int src_process(struct processing_module *mod, return cd->src_func(cd, sources[0], sinks[0]); } -static int src_set_config(struct processing_module *mod, uint32_t config_id, - enum module_cfg_fragment_position pos, uint32_t data_offset_size, - const uint8_t *fragment, size_t fragment_size, uint8_t *response, - size_t response_size) +int src_set_config(struct processing_module *mod, uint32_t config_id, + enum module_cfg_fragment_position pos, uint32_t data_offset_size, + const uint8_t *fragment, size_t fragment_size, uint8_t *response, + size_t response_size) { return -EINVAL; } -static int src_get_config(struct processing_module *mod, uint32_t config_id, - uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size) +int src_get_config(struct processing_module *mod, uint32_t config_id, + uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size) { return -EINVAL; } -static int src_reset(struct processing_module *mod) +int src_reset(struct processing_module *mod) { struct comp_data *cd = module_get_private_data(mod); @@ -723,7 +679,7 @@ static int src_reset(struct processing_module *mod) return 0; } -static int src_free(struct processing_module *mod) +int src_free(struct processing_module *mod) { struct comp_data *cd = module_get_private_data(mod); diff --git a/src/audio/src/src.h b/src/audio/src/src.h index fe2170ab1714..2ead7fa95062 100644 --- a/src/audio/src/src.h +++ b/src/audio/src/src.h @@ -104,7 +104,20 @@ static inline void src_dec_wrap_s16(int16_t **ptr, int16_t *addr, size_t size) } #endif /* CONFIG_FORMAT_S16LE */ -void src_polyphase_reset(struct polyphase_src *src); +static inline void src_state_reset(struct src_state *state) +{ + state->fir_delay_size = 0; + state->out_delay_size = 0; +} + +static inline void src_polyphase_reset(struct polyphase_src *src) +{ + src->number_of_stages = 0; + src->stage1 = NULL; + src->stage2 = NULL; + src_state_reset(&src->state1); + src_state_reset(&src->state2); +} int src_polyphase_init(struct polyphase_src *src, struct src_param *p, int32_t *delay_lines_start); @@ -173,6 +186,39 @@ int src_stream_pcm_source_rate_check(struct ipc_config_src cfg, struct sof_ipc_stream_params *params); #endif /* CONFIG_IPC_MAJOR_4 */ +/* Calculates the needed FIR delay line length */ +static inline int src_fir_delay_length(struct src_stage *s) +{ + return s->subfilter_length + (s->num_of_subfilters - 1) * s->idm + + s->blk_in; +} + +/* Calculates the FIR output delay line length */ +static inline int src_out_delay_length(struct src_stage *s) +{ + return 1 + (s->num_of_subfilters - 1) * s->odm; +} + +/* Returns index of a matching sample rate */ +static inline int src_find_fs(int fs_list[], int list_length, int fs) +{ + int i; + + for (i = 0; i < list_length; i++) { + if (fs_list[i] == fs) + return i; + } + return -EINVAL; +} + +/* Fallback function */ +static inline int src_fallback(struct comp_data *cd, + struct sof_source *source, + struct sof_sink *sink) +{ + return 0; +} + int src_rate_check(const void *spec); int src_set_params(struct processing_module *mod, struct sof_sink *sink); @@ -182,9 +228,45 @@ int src_prepare_general(struct processing_module *mod, struct sof_source *source, struct sof_sink *sink); int src_init(struct processing_module *mod); -int src_fallback(struct comp_data *cd, struct sof_source *source, + +int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, + int nch); +int init_stages(struct src_stage *stage1, struct src_stage *stage2, + struct polyphase_src *src, struct src_param *p, + int n, int32_t *delay_lines_start); +int src_1s(struct comp_data *cd, struct sof_source *source, + struct sof_sink *sink); +int src_copy_sxx(struct comp_data *cd, struct sof_source *source, struct sof_sink *sink); +int src_verify_params(struct processing_module *mod); + +bool src_get_copy_limits(struct comp_data *cd, + struct sof_source *source, + struct sof_sink *sink); +int src_params_general(struct processing_module *mod, + struct sof_source *source, + struct sof_sink *sink); +int src_prepare(struct processing_module *mod, + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); +int src_2s(struct comp_data *cd, + struct sof_source *source, struct sof_sink *sink); + +bool src_is_ready_to_process(struct processing_module *mod, + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); +int src_process(struct processing_module *mod, + struct sof_source **sources, int num_of_sources, + struct sof_sink **sinks, int num_of_sinks); +int src_set_config(struct processing_module *mod, uint32_t config_id, + enum module_cfg_fragment_position pos, uint32_t data_offset_size, + const uint8_t *fragment, size_t fragment_size, uint8_t *response, + size_t response_size); +int src_get_config(struct processing_module *mod, uint32_t config_id, + uint32_t *data_offset_size, uint8_t *fragment, size_t fragment_size); +int src_free(struct processing_module *mod); +int src_reset(struct processing_module *mod); extern const struct sof_uuid src_uuid; extern struct tr_ctx src_tr; diff --git a/src/audio/src/src_lite.c b/src/audio/src/src_lite.c new file mode 100644 index 000000000000..5b6bf40f832a --- /dev/null +++ b/src/audio/src/src_lite.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: BSD-3-Clause +// +// Copyright(c) 2023 Intel Corporation. All rights reserved. +// +// Author: Fabiola Jasinska <fabiola.jasinska@intel.com> + +#include <rtos/init.h> +#include "src.h" +#include "src_config.h" + +#define SRC_LITE 1 + +LOG_MODULE_REGISTER(src_lite, CONFIG_SOF_LOG_LEVEL); + +static const struct module_interface src_lite_interface = { + .init = src_init, + .prepare = src_prepare, + .process = src_process, + .is_ready_to_process = src_is_ready_to_process, + .set_configuration = src_set_config, + .get_configuration = src_get_config, + .reset = src_reset, + .free = src_free, +}; + +DECLARE_SOF_RT_UUID("src_lite", src_lite_uuid, 0x33441051, 0x44CD, 0x466A, + 0x83, 0xA3, 0x17, 0x84, 0x78, 0x70, 0x8A, 0xEA); + +DECLARE_TR_CTX(src_lite_tr, SOF_UUID(src_lite_uuid), LOG_LEVEL_INFO); + +DECLARE_MODULE_ADAPTER(src_lite_interface, src_lite_uuid, src_lite_tr); +SOF_MODULE_INIT(src_lite, sys_comp_module_src_lite_interface_init); diff --git a/tools/rimage/config/mtl.toml b/tools/rimage/config/mtl.toml index 453b0df89dbd..d85f797f627e 100644 --- a/tools/rimage/config/mtl.toml +++ b/tools/rimage/config/mtl.toml @@ -57,7 +57,7 @@ name = "ADSPFW" load_offset = "0x40000" [module] -count = 26 +count = 27 [[module.entry]] name = "BRNGUP" uuid = "2B79E4F3-4675-F649-89DF-3BC194A91AEB" @@ -649,3 +649,44 @@ count = 26 # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] mod_cfg = [0, 0, 0, 0, 296, 5000000, 384, 384, 0, 5000, 0] + + # SRC lite module config + [[module.entry]] + name = "SRC_LITE" + uuid = "33441051-44CD-466A-83A3-178478708AEA" + affinity_mask = "0x1" + #instance_count = "10" + domain_types = "0" + load_type = "0" + module_type = "0x1F" + auto_start = "0" + sched_caps = [1, 0x00008000] + + # pin = [dir, type, sample rate, size, container, channel-cfg] + pin = [0, 0, 0xffff, 0xc, 0x8, 0x05ff, + 1, 0, 0xf6c9, 0xc, 0x8, 0x05ff] + + # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] + mod_cfg = [0, 0, 0, 0, 12832, 1365500, 0, 0, 0, 1365, 0, + 1, 0, 0, 0, 12832, 2302300, 0, 0, 0, 2302, 0, + 2, 0, 0, 0, 12832, 3218200, 0, 0, 0, 3218, 0, + 3, 0, 0, 0, 12832, 4169700, 0, 0, 0, 4169, 0, + 4, 0, 0, 0, 12832, 5095100, 0, 0, 0, 5095, 0, + 5, 0, 0, 0, 12832, 6014800, 0, 0, 0, 6014, 0, + 6, 0, 0, 0, 12832, 6963500, 0, 0, 0, 6963, 0, + 7, 0, 0, 0, 12832, 7791000, 0, 0, 0, 7791, 0, + 8, 0, 0, 0, 12832, 8843000, 0, 0, 0, 8843, 0, + 9, 0, 0, 0, 12832, 9755100, 0, 0, 0, 9755, 0, + 10, 0, 0, 0, 12832, 10726500, 0, 0, 0, 10726, 0, + 11, 0, 0, 0, 12832, 11624100, 0, 0, 0, 11624, 0, + 12, 0, 0, 0, 12832, 12518700, 0, 0, 0, 12518, 0, + 13, 0, 0, 0, 12832, 13555000, 0, 0, 0, 13555, 0, + 14, 0, 0, 0, 12832, 14144500, 0, 0, 0, 14144, 0, + 15, 0, 0, 0, 12832, 15809800, 0, 0, 0, 15809, 0, + 16, 0, 0, 0, 12832, 16749000, 0, 0, 0, 16749, 0, + 17, 0, 0, 0, 12832, 18433500, 0, 0, 0, 18433, 0, + 18, 0, 0, 0, 12832, 19425900, 0, 0, 0, 19425, 0, + 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, + 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, + 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] \ No newline at end of file diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 68e110426ea5..37a51de920d9 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -610,6 +610,9 @@ elseif(CONFIG_IPC_MAJOR_4) ) endif() +zephyr_library_sources_ifdef(CONFIG_COMP_SRC_LITE + ${SOF_AUDIO_PATH}/src/src_lite.c +) zephyr_library_sources_ifdef(CONFIG_COMP_BASEFW_IPC4 ${SOF_AUDIO_PATH}/base_fw.c ) From d27d0682451bb13c6c6d7c112958e58602c2c1a5 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 11:34:49 +0300 Subject: [PATCH 616/639] Tools: Topology2: Add support for ALSA enum control This patch adds to definitions in common.conf a new class "text" to support the enum control values. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/include/controls/common.conf | 19 ++++ .../topology2/include/controls/enum.conf | 97 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 tools/topology/topology2/include/controls/enum.conf diff --git a/tools/topology/topology2/include/controls/common.conf b/tools/topology/topology2/include/controls/common.conf index 0cf249914070..caf32838b61e 100644 --- a/tools/topology/topology2/include/controls/common.conf +++ b/tools/topology/topology2/include/controls/common.conf @@ -182,3 +182,22 @@ Class.Base."tlv" { unique "instance" } } + +Class.Base."text" { + DefineAttribute."instance" {} + + DefineAttribute."name" { + type "string" + } + + attributes { + !constructor [ + "name" + ] + # + # text objects instantiated within the same alsaconf node must have unique + # instance attribute + # + unique "instance" + } +} diff --git a/tools/topology/topology2/include/controls/enum.conf b/tools/topology/topology2/include/controls/enum.conf new file mode 100644 index 000000000000..349f062475c1 --- /dev/null +++ b/tools/topology/topology2/include/controls/enum.conf @@ -0,0 +1,97 @@ +# +# Enum kcontrol class. All attributes defined herein are namespaced +# by alsatplg to "Object.Control.enum.N.attribute_name" +# +# Usage: this component can be used by instantiating it in the parent object. i.e. +# +# Object.Control.enum."N" { +# index 1 +# name "Master Playback Enum Control" +# Object.Base.text.1 { +# name "mytext" +# !values [ +# "One" +# "Two" +# "Three" +# ] +# } +# Object.Base.channel.1 { +# name "fc" +# shift 0 +# reg 0 +# } +# Object.Base.ops."ctl" { +# info "enum" +# get "257" +# put "257" +# } +# } +# +# Where N is the unique instance number for the buffer object within the same alsaconf node. +# The enum control object should also include the ops, channels and tlv objects in the object +# instance + +<include/controls/common.conf> + +Class.Control."enum" { + # + # Pipeline ID for the enum object + # + DefineAttribute."index" {} + + # + # Instance of enum object in the same alsaconf node + # + DefineAttribute."instance" {} + + # + # Enum name. A enum object is included in the built topology only if it is given a + # name + # + DefineAttribute."name" { + type "string" + } + + # + # access control for enum + # + DefineAttribute."access" { + type "compound" + constraints { + !valid_values [ + "read_write" + "tlv_read_write" + "read" + "write" + "volatile" + "tlv_read" + "tlv_write" + "tlv_command" + "inactive" + "lock" + "owner" + "tlv_callback" + ] + } + } + + attributes { + # + # The Enum object name would be constructed using the index and instance arguments. + # For ex: "enum.1.1" or "enum.10.2" etc. + # + !constructor [ + "index" + "instance" + ] + !mandatory [ + name + ] + # + # enum control objects instantiated within the same alsaconf node must have unique + # index attribute + # + unique "instance" + } + +} From 613021b37f62ea5d059745ece2167bddd37c6dcb Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Mon, 2 Oct 2023 11:51:31 +0300 Subject: [PATCH 617/639] Tools: Topology2: Add widget class TDFB This patch adds the class for the Time domain fixed beamformer (TDFB) and example blobs for line arrays. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- .../topology2/include/components/tdfb.conf | 175 +++ .../tdfb/line2_50mm_azm90_90_13_16khz.conf | 362 +++++ .../tdfb/line2_50mm_azm90_90_13_48khz.conf | 518 +++++++ .../tdfb/line2_50mm_pm0_30_90deg_16khz.conf | 258 ++++ .../tdfb/line2_50mm_pm0_30_90deg_48khz.conf | 258 ++++ .../tdfb/line2_50mm_pm90deg_16khz.conf | 93 ++ .../tdfb/line2_50mm_pm90deg_48khz.conf | 93 ++ .../include/components/tdfb/line2_pass.conf | 14 + .../tdfb/line4_28mm_azm90_90_13_16khz.conf | 698 ++++++++++ .../tdfb/line4_28mm_azm90_90_13_48khz.conf | 1218 +++++++++++++++++ .../tdfb/line4_28mm_pm90deg_16khz.conf | 172 +++ .../tdfb/line4_28mm_pm90deg_48khz.conf | 172 +++ .../include/components/tdfb/line4_pass.conf | 16 + 13 files changed, 4047 insertions(+) create mode 100644 tools/topology/topology2/include/components/tdfb.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_16khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_48khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_16khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_48khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_16khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_48khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line2_pass.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_16khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_48khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_16khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_48khz.conf create mode 100644 tools/topology/topology2/include/components/tdfb/line4_pass.conf diff --git a/tools/topology/topology2/include/components/tdfb.conf b/tools/topology/topology2/include/components/tdfb.conf new file mode 100644 index 000000000000..aa8a39a82b3c --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb.conf @@ -0,0 +1,175 @@ +# +# +# A generic Time Domain Fixed Beamformer (TDFB) component. All attributes +# defined herein are namespaced by alsatplg to +# "Object.Widget.tdfb.attribute_name" +# +# Usage: this component can be used by declaring in the parent object. i.e. +# +# Object.Widget.tdfb."N" { +# index 1 +# } +# } + +# +# Where M is pipeline ID and N is a unique integer in the parent object. + +<include/controls/mixer.conf> +<include/controls/enum.conf> + +Class.Widget."tdfb" { + # + # Pipeline ID + # + DefineAttribute."index" { + type "integer" + } + + # + # Unique instance for TDFB widget + # + DefineAttribute."instance" { + type "integer" + } + + # Include common widget attributes definition + <include/components/widget-common.conf> + + attributes { + !constructor [ + "index" + "instance" + ] + !mandatory [ + "num_input_pins" + "num_output_pins" + "num_input_audio_formats" + "num_output_audio_formats" + ] + + !immutable [ + "uuid" + "type" + ] + !deprecated [ + "preload_count" + ] + unique "instance" + } + + # + # tdfb widget switch control + # + Object.Control { + # Switch controls + mixer."1" { + Object.Base.channel.1 { + name "fc" + shift 0 + } + Object.Base.ops.1 { + name "ctl" + info "volsw" + #259 binds the mixer control to switch get/put handlers + get 259 + put 259 + } + max 1 + } + mixer."2" { + Object.Base.channel.1 { + name "fc" + shift 0 + } + Object.Base.ops.1 { + name "ctl" + info "volsw" + #259 binds the mixer control to switch get/put handlers + get 259 + put 259 + } + max 1 + } + + # Enum controls + enum."1" { + Object.Base { + channel.1 { + name "fc" + reg 3 + shift 0 + } + text.0 { + name "tdfb_enum_plus_minus_90_text" + !values [ + "-90" + "-75" + "-60" + "-45" + "-30" + "-15" + "0" + "15" + "30" + "45" + "60" + "75" + "90" + ] + } + ops.1 { + name "ctl" + info "enum" + #257 binds the mixer control to enum get/put handlers + get 257 + put 257 + } + } + } + enum."2" { + Object.Base { + channel.1 { + name "fc" + reg 3 + shift 0 + } + text.0 { + name "mytext" + !values [ + "-90" + "-75" + "-60" + "-45" + "-30" + "-15" + "0" + "15" + "30" + "45" + "60" + "75" + "90" + ] + } + ops.1 { + name "ctl" + info "enum" + #257 binds the mixer control to enum get/put handlers + get 257 + put 257 + } + } + } + } + + # + # Default attributes for tdfb + # + + # dd511749-d9fa-455c-b3a7-13585693f1af + uuid "49:17:51:dd:fa:d9:5c:45:b3:a7:13:58:56:93:f1:af" + type "effect" + no_pm "true" + num_input_pins 1 + num_output_pins 1 +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_16khz.conf b/tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_16khz.conf new file mode 100644 index 000000000000..45b7f92588a8 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_16khz.conf @@ -0,0 +1,362 @@ +# Created with script example_line_array.m 23-Oct-2023 +# cd tools/tune/tdfb; octave --no-window-system example_line_array.m +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x04,0x0b,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x0b,0x00,0x00,0x02,0x00,0x02,0x00, + 0x01,0x00,0x02,0x00,0x0d,0x00,0x01,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0a,0x00,0x42,0x00,0x59,0x00, + 0x12,0x01,0xef,0x00,0x6b,0x02,0xa9,0x01, + 0x1c,0x04,0x02,0x03,0xa7,0x08,0x38,0x04, + 0x30,0x0b,0x40,0x03,0x58,0x0b,0x31,0xfb, + 0x52,0x0f,0x92,0xed,0xe6,0x34,0x51,0x69, + 0x07,0xe4,0x0b,0x0c,0x08,0xf2,0xc7,0x02, + 0x01,0xf2,0x51,0xfb,0xe9,0xf3,0x75,0xfa, + 0xc7,0xf6,0x63,0xfd,0xdb,0xfa,0xee,0xfd, + 0xce,0xfc,0xb5,0xfe,0x61,0xfe,0x68,0xff, + 0x70,0xff,0xdb,0xff,0xf1,0xff,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf4,0xff,0xcd,0xff,0x8e,0xff,0x2d,0xff, + 0xbd,0xfe,0x24,0xfe,0x99,0xfd,0xd3,0xfc, + 0x61,0xfc,0x29,0xfb,0x9b,0xf8,0xda,0xf7, + 0x9b,0xf7,0xe7,0xf6,0x19,0xf9,0xf1,0xfb, + 0x5e,0xfc,0xad,0xfd,0xbb,0xfe,0xcb,0x7f, + 0x41,0x01,0x43,0x02,0x7e,0x03,0xd9,0x03, + 0x71,0x06,0x5c,0x08,0x95,0x07,0x38,0x07, + 0x69,0x06,0x17,0x04,0xf9,0x02,0x83,0x02, + 0xd1,0x01,0x53,0x01,0xd3,0x00,0x79,0x00, + 0x33,0x00,0x0d,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0a,0x00,0x3e,0x00,0x5c,0x00, + 0x02,0x01,0xfa,0x00,0x47,0x02,0xc4,0x01, + 0xdc,0x03,0xf2,0x02,0x2a,0x08,0xb0,0x04, + 0x73,0x0a,0x16,0x04,0x24,0x0a,0xde,0xfc, + 0xec,0x0c,0xf9,0xf1,0x4e,0x27,0x6c,0x72, + 0x53,0xe7,0x10,0x0a,0xa3,0xf3,0xec,0x01, + 0xa0,0xf3,0x9e,0xfa,0xb2,0xf4,0x13,0xfa, + 0x4b,0xf7,0x29,0xfd,0x2b,0xfb,0xce,0xfd, + 0xfc,0xfc,0xa6,0xfe,0x78,0xfe,0x63,0xff, + 0x78,0xff,0xda,0xff,0xf2,0xff,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf4,0xff,0xcf,0xff,0x90,0xff,0x32,0xff, + 0xc3,0xfe,0x2f,0xfe,0xa2,0xfd,0xe7,0xfc, + 0x68,0xfc,0x63,0xfb,0xcb,0xf8,0xea,0xf7, + 0xb9,0xf7,0xff,0xf6,0x81,0xf9,0xf9,0xfb, + 0x6b,0xfc,0xb2,0xfd,0xbf,0xfe,0xcb,0x7f, + 0x3d,0x01,0x3e,0x02,0x71,0x03,0xd1,0x03, + 0x11,0x06,0x46,0x08,0x79,0x07,0x2a,0x07, + 0x40,0x06,0xe7,0x03,0xf3,0x02,0x74,0x02, + 0xca,0x01,0x4b,0x01,0xcf,0x00,0x76,0x00, + 0x32,0x00,0x0c,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0b,0x00,0x30,0x00,0x6a,0x00, + 0xc7,0x00,0x29,0x01,0xbe,0x01,0x32,0x02, + 0xf1,0x02,0x48,0x03,0xd9,0x05,0xbd,0x06, + 0x6e,0x07,0x7c,0x07,0x52,0x05,0x34,0x03, + 0x00,0x04,0xf1,0x00,0xb2,0x03,0xb1,0x7f, + 0x4e,0xfc,0xfa,0xfe,0xcb,0xfb,0x9b,0xfc, + 0x2a,0xfa,0xc5,0xf7,0xcb,0xf7,0x58,0xf8, + 0x57,0xf9,0x26,0xfc,0x68,0xfc,0x3b,0xfd, + 0xb2,0xfd,0x5f,0xfe,0xcf,0xfe,0x47,0xff, + 0x95,0xff,0xd4,0xff,0xf5,0xff,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf5,0xff,0xd3,0xff,0x97,0xff,0x43,0xff, + 0xd6,0xfe,0x54,0xfe,0xc0,0xfd,0x27,0xfd, + 0x84,0xfc,0x01,0xfc,0x77,0xf9,0x28,0xf8, + 0x0e,0xf8,0x77,0xf7,0xae,0xfa,0x06,0xfc, + 0xa1,0xfc,0xc1,0xfd,0xd2,0xfe,0xcb,0x7f, + 0x2a,0x01,0x31,0x02,0x3e,0x03,0xc4,0x03, + 0xf8,0x04,0xd8,0x07,0x2d,0x07,0xf3,0x06, + 0xaa,0x05,0x61,0x03,0xdc,0x02,0x41,0x02, + 0xb3,0x01,0x30,0x01,0xc3,0x00,0x6c,0x00, + 0x2f,0x00,0x0b,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0d,0x00,0x1a,0x00,0x7b,0x00, + 0x6a,0x00,0x67,0x01,0xe3,0x00,0xca,0x02, + 0x5f,0x01,0x71,0x04,0xb4,0x01,0xf4,0x08, + 0x70,0x03,0x9b,0x0b,0x08,0xff,0xb7,0x0a, + 0x50,0xf9,0x18,0x11,0x01,0xe7,0xb4,0x67, + 0x58,0x37,0x6b,0xe8,0xaf,0x0a,0x2c,0xf3, + 0x73,0x03,0xfd,0xf4,0x8f,0xfc,0xd5,0xf5, + 0x90,0xfc,0xba,0xfa,0x6e,0xfe,0x6d,0xfc, + 0xd5,0xfe,0xfd,0xfd,0x5b,0xff,0x22,0xff, + 0xc5,0xff,0xcc,0xff,0xfa,0xff,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf6,0xff,0xda,0xff,0xa6,0xff,0x61,0xff, + 0xfb,0xfe,0x96,0xfe,0x01,0xfe,0x95,0xfd, + 0xd9,0xfc,0xc7,0xfc,0xd9,0xfa,0xcf,0xf8, + 0x7e,0xf8,0xe5,0xf8,0x30,0xfc,0x45,0xfc, + 0x12,0xfd,0xe1,0xfd,0xf7,0xfe,0xcb,0x7f, + 0x05,0x01,0x11,0x02,0xd0,0x02,0x89,0x03, + 0x90,0x03,0x87,0x06,0xc8,0x06,0x5f,0x06, + 0x77,0x04,0xb9,0x02,0x96,0x02,0xea,0x01, + 0x83,0x01,0x02,0x01,0xab,0x00,0x5b,0x00, + 0x29,0x00,0x09,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x05,0x00,0x26,0x00,0x31,0x00, + 0xa3,0x00,0x8a,0x00,0x7d,0x01,0xf8,0x00, + 0x97,0x02,0x2c,0x01,0x24,0x04,0xc0,0x03, + 0xd3,0x07,0xe4,0x00,0xf9,0x05,0xf7,0xfd, + 0xad,0x08,0xf6,0xf6,0xb1,0x18,0xf1,0x79, + 0x96,0xed,0x60,0x07,0x7e,0xf7,0x9d,0x01, + 0xbc,0xf9,0xcf,0xfd,0xea,0xf6,0x58,0xfc, + 0xb7,0xfb,0x70,0xfe,0xe8,0xfc,0xba,0xfe, + 0x12,0xfe,0x3c,0xff,0x0c,0xff,0xaa,0xff, + 0xad,0xff,0xeb,0xff,0xf7,0xff,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf9,0xff, + 0xe4,0xff,0xbe,0xff,0x8a,0xff,0x3e,0xff, + 0xed,0xfe,0x7f,0xfe,0x25,0xfe,0xaf,0xfd, + 0x79,0xfd,0xdb,0xfc,0x4f,0xfa,0x40,0xf9, + 0xae,0xfb,0x41,0xfd,0x2c,0xfd,0xc3,0xfd, + 0x3d,0xfe,0x26,0xff,0xcb,0x7f,0xd7,0x00, + 0xb8,0x01,0x27,0x02,0xae,0x02,0x91,0x02, + 0xf8,0x03,0x19,0x06,0x0b,0x05,0xba,0x02, + 0x23,0x02,0xe7,0x01,0x78,0x01,0x23,0x01, + 0xc3,0x00,0x7f,0x00,0x43,0x00,0x1e,0x00, + 0x07,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x07,0x00,0x01,0x00,0x46,0x00, + 0x00,0x00,0xd5,0x00,0xfd,0xff,0xb5,0x01, + 0xc9,0xff,0xda,0x02,0x39,0xff,0x7d,0x04, + 0xf2,0x00,0xda,0x06,0x8c,0xfb,0x4e,0x09, + 0xb1,0xf6,0xa6,0x10,0x6b,0xe5,0x9e,0x61, + 0x55,0x3f,0x91,0xe7,0xf2,0x0c,0xf4,0xf4, + 0x8b,0x05,0x22,0xf9,0x4a,0x01,0x4f,0xf8, + 0x52,0x01,0x67,0xfc,0x74,0x00,0xbd,0xfd, + 0x17,0x00,0xc2,0xfe,0x01,0x00,0x7f,0xff, + 0xff,0xff,0xe2,0xff,0x00,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff, + 0xf0,0xff,0xde,0xff,0xbe,0xff,0x9f,0xff, + 0x5e,0xff,0x3b,0xff,0xe8,0xfe,0xe2,0xfe, + 0x68,0xfe,0xc2,0xfe,0xd6,0xfc,0x87,0xfb, + 0x8f,0xfe,0x32,0xfe,0xa8,0xfe,0xae,0xfe, + 0x11,0xff,0x5f,0xff,0xcb,0x7f,0x9f,0x00, + 0xe9,0x00,0x45,0x01,0x46,0x01,0xaf,0x01, + 0x53,0x01,0x0a,0x04,0xcd,0x02,0x13,0x01, + 0x59,0x01,0xeb,0x00,0xde,0x00,0x95,0x00, + 0x73,0x00,0x3f,0x00,0x26,0x00,0x0f,0x00, + 0x04,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xcb,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xcb,0x7f,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfc,0xff,0xf0,0xff,0xde,0xff, + 0xbe,0xff,0x9f,0xff,0x5e,0xff,0x3b,0xff, + 0xe8,0xfe,0xe2,0xfe,0x68,0xfe,0xc2,0xfe, + 0xd6,0xfc,0x87,0xfb,0x8f,0xfe,0x32,0xfe, + 0xa8,0xfe,0xae,0xfe,0x11,0xff,0x5f,0xff, + 0xcb,0x7f,0x9f,0x00,0xe9,0x00,0x45,0x01, + 0x46,0x01,0xaf,0x01,0x53,0x01,0x0a,0x04, + 0xcd,0x02,0x13,0x01,0x59,0x01,0xeb,0x00, + 0xde,0x00,0x95,0x00,0x73,0x00,0x3f,0x00, + 0x26,0x00,0x0f,0x00,0x04,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x00, + 0x01,0x00,0x46,0x00,0x00,0x00,0xd5,0x00, + 0xfd,0xff,0xb5,0x01,0xc9,0xff,0xda,0x02, + 0x39,0xff,0x7d,0x04,0xf2,0x00,0xda,0x06, + 0x8c,0xfb,0x4e,0x09,0xb1,0xf6,0xa6,0x10, + 0x6b,0xe5,0x9e,0x61,0x55,0x3f,0x91,0xe7, + 0xf2,0x0c,0xf4,0xf4,0x8b,0x05,0x22,0xf9, + 0x4a,0x01,0x4f,0xf8,0x52,0x01,0x67,0xfc, + 0x74,0x00,0xbd,0xfd,0x17,0x00,0xc2,0xfe, + 0x01,0x00,0x7f,0xff,0xff,0xff,0xe2,0xff, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf9,0xff,0xe4,0xff,0xbe,0xff, + 0x8a,0xff,0x3e,0xff,0xed,0xfe,0x7f,0xfe, + 0x25,0xfe,0xaf,0xfd,0x79,0xfd,0xdb,0xfc, + 0x4f,0xfa,0x40,0xf9,0xae,0xfb,0x41,0xfd, + 0x2c,0xfd,0xc3,0xfd,0x3d,0xfe,0x26,0xff, + 0xcb,0x7f,0xd7,0x00,0xb8,0x01,0x27,0x02, + 0xae,0x02,0x91,0x02,0xf8,0x03,0x19,0x06, + 0x0b,0x05,0xba,0x02,0x23,0x02,0xe7,0x01, + 0x78,0x01,0x23,0x01,0xc3,0x00,0x7f,0x00, + 0x43,0x00,0x1e,0x00,0x07,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00, + 0x26,0x00,0x31,0x00,0xa3,0x00,0x8a,0x00, + 0x7d,0x01,0xf8,0x00,0x97,0x02,0x2c,0x01, + 0x24,0x04,0xc0,0x03,0xd3,0x07,0xe4,0x00, + 0xf9,0x05,0xf7,0xfd,0xad,0x08,0xf6,0xf6, + 0xb1,0x18,0xf1,0x79,0x96,0xed,0x60,0x07, + 0x7e,0xf7,0x9d,0x01,0xbc,0xf9,0xcf,0xfd, + 0xea,0xf6,0x58,0xfc,0xb7,0xfb,0x70,0xfe, + 0xe8,0xfc,0xba,0xfe,0x12,0xfe,0x3c,0xff, + 0x0c,0xff,0xaa,0xff,0xad,0xff,0xeb,0xff, + 0xf7,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf6,0xff,0xda,0xff, + 0xa6,0xff,0x61,0xff,0xfb,0xfe,0x96,0xfe, + 0x01,0xfe,0x95,0xfd,0xd9,0xfc,0xc7,0xfc, + 0xd9,0xfa,0xcf,0xf8,0x7e,0xf8,0xe5,0xf8, + 0x30,0xfc,0x45,0xfc,0x12,0xfd,0xe1,0xfd, + 0xf7,0xfe,0xcb,0x7f,0x05,0x01,0x11,0x02, + 0xd0,0x02,0x89,0x03,0x90,0x03,0x87,0x06, + 0xc8,0x06,0x5f,0x06,0x77,0x04,0xb9,0x02, + 0x96,0x02,0xea,0x01,0x83,0x01,0x02,0x01, + 0xab,0x00,0x5b,0x00,0x29,0x00,0x09,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00, + 0x1a,0x00,0x7b,0x00,0x6a,0x00,0x67,0x01, + 0xe3,0x00,0xca,0x02,0x5f,0x01,0x71,0x04, + 0xb4,0x01,0xf4,0x08,0x70,0x03,0x9b,0x0b, + 0x08,0xff,0xb7,0x0a,0x50,0xf9,0x18,0x11, + 0x01,0xe7,0xb4,0x67,0x58,0x37,0x6b,0xe8, + 0xaf,0x0a,0x2c,0xf3,0x73,0x03,0xfd,0xf4, + 0x8f,0xfc,0xd5,0xf5,0x90,0xfc,0xba,0xfa, + 0x6e,0xfe,0x6d,0xfc,0xd5,0xfe,0xfd,0xfd, + 0x5b,0xff,0x22,0xff,0xc5,0xff,0xcc,0xff, + 0xfa,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf5,0xff,0xd3,0xff, + 0x97,0xff,0x43,0xff,0xd6,0xfe,0x54,0xfe, + 0xc0,0xfd,0x27,0xfd,0x84,0xfc,0x01,0xfc, + 0x77,0xf9,0x28,0xf8,0x0e,0xf8,0x77,0xf7, + 0xae,0xfa,0x06,0xfc,0xa1,0xfc,0xc1,0xfd, + 0xd2,0xfe,0xcb,0x7f,0x2a,0x01,0x31,0x02, + 0x3e,0x03,0xc4,0x03,0xf8,0x04,0xd8,0x07, + 0x2d,0x07,0xf3,0x06,0xaa,0x05,0x61,0x03, + 0xdc,0x02,0x41,0x02,0xb3,0x01,0x30,0x01, + 0xc3,0x00,0x6c,0x00,0x2f,0x00,0x0b,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00, + 0x30,0x00,0x6a,0x00,0xc7,0x00,0x29,0x01, + 0xbe,0x01,0x32,0x02,0xf1,0x02,0x48,0x03, + 0xd9,0x05,0xbd,0x06,0x6e,0x07,0x7c,0x07, + 0x52,0x05,0x34,0x03,0x00,0x04,0xf1,0x00, + 0xb2,0x03,0xb1,0x7f,0x4e,0xfc,0xfa,0xfe, + 0xcb,0xfb,0x9b,0xfc,0x2a,0xfa,0xc5,0xf7, + 0xcb,0xf7,0x58,0xf8,0x57,0xf9,0x26,0xfc, + 0x68,0xfc,0x3b,0xfd,0xb2,0xfd,0x5f,0xfe, + 0xcf,0xfe,0x47,0xff,0x95,0xff,0xd4,0xff, + 0xf5,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf4,0xff,0xcf,0xff, + 0x90,0xff,0x32,0xff,0xc3,0xfe,0x2f,0xfe, + 0xa2,0xfd,0xe7,0xfc,0x68,0xfc,0x63,0xfb, + 0xcb,0xf8,0xea,0xf7,0xb9,0xf7,0xff,0xf6, + 0x81,0xf9,0xf9,0xfb,0x6b,0xfc,0xb2,0xfd, + 0xbf,0xfe,0xcb,0x7f,0x3d,0x01,0x3e,0x02, + 0x71,0x03,0xd1,0x03,0x11,0x06,0x46,0x08, + 0x79,0x07,0x2a,0x07,0x40,0x06,0xe7,0x03, + 0xf3,0x02,0x74,0x02,0xca,0x01,0x4b,0x01, + 0xcf,0x00,0x76,0x00,0x32,0x00,0x0c,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00, + 0x3e,0x00,0x5c,0x00,0x02,0x01,0xfa,0x00, + 0x47,0x02,0xc4,0x01,0xdc,0x03,0xf2,0x02, + 0x2a,0x08,0xb0,0x04,0x73,0x0a,0x16,0x04, + 0x24,0x0a,0xde,0xfc,0xec,0x0c,0xf9,0xf1, + 0x4e,0x27,0x6c,0x72,0x53,0xe7,0x10,0x0a, + 0xa3,0xf3,0xec,0x01,0xa0,0xf3,0x9e,0xfa, + 0xb2,0xf4,0x13,0xfa,0x4b,0xf7,0x29,0xfd, + 0x2b,0xfb,0xce,0xfd,0xfc,0xfc,0xa6,0xfe, + 0x78,0xfe,0x63,0xff,0x78,0xff,0xda,0xff, + 0xf2,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf4,0xff,0xcd,0xff, + 0x8e,0xff,0x2d,0xff,0xbd,0xfe,0x24,0xfe, + 0x99,0xfd,0xd3,0xfc,0x61,0xfc,0x29,0xfb, + 0x9b,0xf8,0xda,0xf7,0x9b,0xf7,0xe7,0xf6, + 0x19,0xf9,0xf1,0xfb,0x5e,0xfc,0xad,0xfd, + 0xbb,0xfe,0xcb,0x7f,0x41,0x01,0x43,0x02, + 0x7e,0x03,0xd9,0x03,0x71,0x06,0x5c,0x08, + 0x95,0x07,0x38,0x07,0x69,0x06,0x17,0x04, + 0xf9,0x02,0x83,0x02,0xd1,0x01,0x53,0x01, + 0xd3,0x00,0x79,0x00,0x33,0x00,0x0d,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00, + 0x42,0x00,0x59,0x00,0x12,0x01,0xef,0x00, + 0x6b,0x02,0xa9,0x01,0x1c,0x04,0x02,0x03, + 0xa7,0x08,0x38,0x04,0x30,0x0b,0x40,0x03, + 0x58,0x0b,0x31,0xfb,0x52,0x0f,0x92,0xed, + 0xe6,0x34,0x51,0x69,0x07,0xe4,0x0b,0x0c, + 0x08,0xf2,0xc7,0x02,0x01,0xf2,0x51,0xfb, + 0xe9,0xf3,0x75,0xfa,0xc7,0xf6,0x63,0xfd, + 0xdb,0xfa,0xee,0xfd,0xce,0xfc,0xb5,0xfe, + 0x61,0xfe,0x68,0xff,0x70,0xff,0xdb,0xff, + 0xf1,0xff,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00, + 0x01,0x00,0x02,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0xb5,0xff,0x00,0x00, + 0x02,0x00,0x00,0x00,0xc4,0xff,0x00,0x00, + 0x04,0x00,0x00,0x00,0xd3,0xff,0x00,0x00, + 0x06,0x00,0x00,0x00,0xe2,0xff,0x00,0x00, + 0x08,0x00,0x00,0x00,0xf1,0xff,0x00,0x00, + 0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x0c,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, + 0x0e,0x00,0x00,0x00,0x1e,0x00,0x00,0x00, + 0x10,0x00,0x00,0x00,0x2d,0x00,0x00,0x00, + 0x12,0x00,0x00,0x00,0x3c,0x00,0x00,0x00, + 0x14,0x00,0x00,0x00,0x4b,0x00,0x00,0x00, + 0x16,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x00,0x00,0x66,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_48khz.conf b/tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_48khz.conf new file mode 100644 index 000000000000..1d0afd1c83d7 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_50mm_azm90_90_13_48khz.conf @@ -0,0 +1,518 @@ +# Created with script example_line_array.m 23-Oct-2023 +# cd tools/tune/tdfb; octave --no-window-system example_line_array.m +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0xe4,0x0f,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xe4,0x0f,0x00,0x00,0x02,0x00,0x02,0x00, + 0x01,0x00,0x02,0x00,0x0d,0x00,0x01,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x19,0x00,0x29,0x00,0x41,0x00,0x58,0x00, + 0x79,0x00,0x95,0x00,0xbd,0x00,0xdb,0x00, + 0x08,0x01,0x24,0x01,0x56,0x01,0x68,0x01, + 0xaa,0x01,0x58,0x01,0xf9,0x00,0x10,0x01, + 0x0a,0x01,0x06,0x01,0x04,0x01,0xef,0x00, + 0xed,0x00,0xc8,0x00,0xc8,0x00,0x91,0x00, + 0x9b,0x00,0x48,0x00,0x74,0x00,0xc5,0xff, + 0xeb,0x7f,0x3c,0x00,0x8b,0xff,0xb7,0xff, + 0x62,0xff,0x6b,0xff,0x32,0xff,0x30,0xff, + 0x09,0xff,0x05,0xff,0xee,0xfe,0xe9,0xfe, + 0xe3,0xfe,0xdb,0xfe,0xf1,0xfe,0x88,0xfe, + 0x28,0xfe,0x6d,0xfe,0x7c,0xfe,0xb1,0xfe, + 0xcc,0xfe,0xfc,0xfe,0x1b,0xff,0x46,0xff, + 0x64,0xff,0x89,0xff,0xa4,0xff,0xc1,0xff, + 0xd5,0xff,0xec,0xff,0xf9,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xf9,0xff, + 0xec,0xff,0xd5,0xff,0xc1,0xff,0xa4,0xff, + 0x89,0xff,0x65,0xff,0x45,0xff,0x1c,0xff, + 0xfb,0xfe,0xcd,0xfe,0xaf,0xfe,0x7e,0xfe, + 0x6a,0xfe,0x2b,0xfe,0x84,0xfe,0xf6,0xfe, + 0xd6,0xfe,0xe9,0xfe,0xe3,0xfe,0xf6,0xfe, + 0xfc,0xfe,0x14,0xff,0x24,0xff,0x40,0xff, + 0x59,0xff,0x79,0xff,0x98,0xff,0xba,0xff, + 0xdd,0xff,0xec,0x7f,0x23,0x00,0x45,0x00, + 0x67,0x00,0x84,0x00,0xa3,0x00,0xba,0x00, + 0xd4,0x00,0xe3,0x00,0xf8,0x00,0xfc,0x00, + 0x0c,0x01,0x05,0x01,0x14,0x01,0xf5,0x00, + 0x5a,0x01,0xa7,0x01,0x6a,0x01,0x55,0x01, + 0x25,0x01,0x07,0x01,0xdc,0x00,0xbc,0x00, + 0x96,0x00,0x78,0x00,0x58,0x00,0x41,0x00, + 0x29,0x00,0x19,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x1d,0x00,0x1f,0x00,0x50,0x00,0x40,0x00, + 0x99,0x00,0x67,0x00,0xf6,0x00,0x8e,0x00, + 0x64,0x01,0xae,0x00,0xe0,0x01,0xbe,0x00, + 0x6f,0x02,0x69,0x00,0x0c,0x02,0xcd,0xff, + 0x86,0x02,0x4f,0xff,0x0a,0x03,0x97,0xfe, + 0xb7,0x03,0x81,0xfd,0xc5,0x04,0xb8,0xfb, + 0xce,0x06,0x0f,0xf8,0x97,0x0c,0xbd,0xe9, + 0x08,0x74,0xd1,0x24,0xe9,0xef,0xa4,0x09, + 0x44,0xf8,0xff,0x04,0xc4,0xfa,0xec,0x02, + 0xf7,0xfb,0xb3,0x01,0xb3,0xfc,0xe6,0x00, + 0x3b,0xfd,0x5b,0x00,0xaf,0xfd,0xf7,0xff, + 0x62,0xfd,0x2e,0xff,0xe2,0xfd,0x3d,0xff, + 0x61,0xfe,0x5b,0xff,0xd5,0xfe,0x83,0xff, + 0x3a,0xff,0xac,0xff,0x8d,0xff,0xd2,0xff, + 0xcb,0xff,0xf2,0xff,0xf7,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xf9,0xff, + 0xef,0xff,0xd6,0xff,0xc1,0xff,0xa5,0xff, + 0x8a,0xff,0x67,0xff,0x47,0xff,0x1f,0xff, + 0xfd,0xfe,0xd2,0xfe,0xb2,0xfe,0x84,0xfe, + 0x6c,0xfe,0x36,0xfe,0xb9,0xfe,0xf6,0xfe, + 0xdc,0xfe,0xeb,0xfe,0xe7,0xfe,0xf8,0xfe, + 0x00,0xff,0x16,0xff,0x27,0xff,0x42,0xff, + 0x5b,0xff,0x7b,0xff,0x99,0xff,0xbb,0xff, + 0xdd,0xff,0xec,0x7f,0x23,0x00,0x44,0x00, + 0x66,0x00,0x83,0x00,0xa1,0x00,0xb8,0x00, + 0xd1,0x00,0xe1,0x00,0xf4,0x00,0xfa,0x00, + 0x08,0x01,0x03,0x01,0x0f,0x01,0xf4,0x00, + 0x2a,0x01,0x9d,0x01,0x69,0x01,0x4f,0x01, + 0x23,0x01,0x03,0x01,0xda,0x00,0xb9,0x00, + 0x94,0x00,0x77,0x00,0x58,0x00,0x3f,0x00, + 0x28,0x00,0x18,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x07,0x00,0x12,0x00,0x2b,0x00,0x36,0x00, + 0x5d,0x00,0x66,0x00,0x9e,0x00,0x9d,0x00, + 0xeb,0x00,0xd8,0x00,0x40,0x01,0x0f,0x01, + 0x9f,0x01,0xf6,0x00,0x18,0x01,0xaa,0x00, + 0x4e,0x01,0x95,0x00,0x73,0x01,0x62,0x00, + 0x90,0x01,0x0f,0x00,0xb6,0x01,0x8c,0xff, + 0x02,0x02,0xa9,0xfe,0xdf,0x02,0x66,0xfc, + 0x25,0x08,0x2b,0x7f,0xb5,0xf8,0x66,0x03, + 0x2b,0xfd,0x4d,0x01,0xf5,0xfd,0x6f,0x00, + 0x3a,0xfe,0xeb,0xff,0x5b,0xfe,0x94,0xff, + 0x74,0xfe,0x5d,0xff,0x96,0xfe,0x46,0xff, + 0xca,0xfe,0xd8,0xfe,0x30,0xfe,0xcc,0xfe, + 0x90,0xfe,0x03,0xff,0xe9,0xfe,0x40,0xff, + 0x3b,0xff,0x7d,0xff,0x83,0xff,0xb2,0xff, + 0xbd,0xff,0xe3,0xff,0xf1,0xff,0xfa,0xff, + 0xfe,0xff,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xf9,0xff, + 0xf2,0xff,0xdf,0xff,0xc1,0xff,0xac,0xff, + 0x8c,0xff,0x71,0xff,0x4a,0xff,0x2c,0xff, + 0x02,0xff,0xe5,0xfe,0xb5,0xfe,0xa0,0xfe, + 0x64,0xfe,0xa5,0xfe,0x14,0xff,0xf2,0xfe, + 0xfa,0xfe,0xec,0xfe,0xf9,0xfe,0xfd,0xfe, + 0x0f,0xff,0x1b,0xff,0x33,0xff,0x47,0xff, + 0x64,0xff,0x7f,0xff,0x9f,0xff,0xbe,0xff, + 0xdf,0xff,0xec,0x7f,0x21,0x00,0x42,0x00, + 0x60,0x00,0x7f,0x00,0x98,0x00,0xb3,0x00, + 0xc6,0x00,0xdb,0x00,0xe6,0x00,0xf6,0x00, + 0xf7,0x00,0x01,0x01,0xf3,0x00,0xf8,0x00, + 0xd7,0x00,0x39,0x01,0x70,0x01,0x36,0x01, + 0x20,0x01,0xf3,0x00,0xd6,0x00,0xae,0x00, + 0x91,0x00,0x6f,0x00,0x56,0x00,0x3b,0x00, + 0x29,0x00,0x13,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x05,0x00,0x0d,0x00,0x18,0x00,0x3d,0x00, + 0x46,0x00,0x72,0x00,0x77,0x00,0xb4,0x00, + 0xad,0x00,0xff,0x00,0xe2,0x00,0x56,0x01, + 0xd3,0x00,0xdf,0x00,0x95,0x00,0x10,0x01, + 0x8c,0x00,0x37,0x01,0x74,0x00,0x5b,0x01, + 0x41,0x00,0x76,0x01,0xe6,0xff,0x9f,0x01, + 0x54,0xff,0x03,0x02,0x3b,0xfe,0x6f,0x03, + 0xd2,0xf9,0x5a,0x7f,0xec,0x06,0x5e,0xfc, + 0xe3,0x01,0xea,0xfd,0xba,0x00,0x52,0xfe, + 0x21,0x00,0x7a,0xfe,0xc0,0xff,0x92,0xfe, + 0x88,0xff,0xb4,0xfe,0x6b,0xff,0xd9,0xfe, + 0x5f,0xff,0x08,0xff,0x27,0xff,0x7d,0xfe, + 0xfe,0xfe,0xd6,0xfe,0x33,0xff,0x26,0xff, + 0x6c,0xff,0x6d,0xff,0xa2,0xff,0xa8,0xff, + 0xd8,0xff,0xe9,0xff,0xf4,0xff,0xfa,0xff, + 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xfa,0xff,0xf3,0xff, + 0xeb,0xff,0xd5,0xff,0xae,0xff,0x9a,0xff, + 0x78,0xff,0x5e,0xff,0x37,0xff,0x1d,0xff, + 0xf1,0xfe,0xdd,0xfe,0xa3,0xfe,0xef,0xfe, + 0x3f,0xff,0x1e,0xff,0x23,0xff,0x14,0xff, + 0x18,0xff,0x12,0xff,0x19,0xff,0x20,0xff, + 0x33,0xff,0x43,0xff,0x5b,0xff,0x71,0xff, + 0x8c,0xff,0xa7,0xff,0xc4,0xff,0xe2,0xff, + 0xec,0x7f,0x1e,0x00,0x3b,0x00,0x58,0x00, + 0x72,0x00,0x8c,0x00,0xa0,0x00,0xb6,0x00, + 0xc4,0x00,0xd5,0x00,0xdb,0x00,0xe0,0x00, + 0xd9,0x00,0xdb,0x00,0xcb,0x00,0xce,0x00, + 0xae,0x00,0xf4,0x00,0x34,0x01,0xfe,0x00, + 0xe8,0x00,0xbf,0x00,0xa5,0x00,0x82,0x00, + 0x6a,0x00,0x4c,0x00,0x39,0x00,0x1c,0x00, + 0x0c,0x00,0x06,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x08,0x00,0x01,0x00,0x1e,0x00, + 0x0b,0x00,0x6a,0x00,0x23,0x00,0xb7,0x00, + 0x30,0x00,0x19,0x01,0x39,0x00,0x5c,0x01, + 0x8f,0xff,0x90,0x01,0x4b,0xff,0x0a,0x02, + 0xe0,0xfe,0xa2,0x02,0x44,0xfe,0x64,0x03, + 0x62,0xfd,0x6e,0x04,0x0d,0xfc,0x00,0x06, + 0xcc,0xf9,0xd2,0x08,0x3d,0xf5,0x0f,0x10, + 0x67,0xe5,0xde,0x50,0x9a,0x51,0xb6,0xe4, + 0xf2,0x0f,0x3a,0xf4,0x55,0x08,0x7b,0xf8, + 0x33,0x05,0x83,0xfa,0x76,0x03,0xc7,0xfb, + 0x57,0x02,0xa9,0xfc,0x8f,0x01,0x58,0xfd, + 0x00,0x01,0xe8,0xfd,0x97,0x00,0x69,0xfe, + 0x0c,0x00,0x2f,0xfe,0xbd,0xff,0xb3,0xfe, + 0xbe,0xff,0x21,0xff,0xc9,0xff,0x8c,0xff, + 0x02,0x00,0xce,0xff,0xfe,0xff,0xee,0xff, + 0xff,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfc,0xff,0xf7,0xff,0xf0,0xff, + 0xe7,0xff,0xdb,0xff,0xa9,0xff,0x8c,0xff, + 0x73,0xff,0x56,0xff,0x39,0xff,0x1a,0xff, + 0x04,0xff,0x6c,0xff,0x6f,0xff,0x62,0xff, + 0x5c,0xff,0x55,0xff,0x52,0xff,0x4f,0xff, + 0x50,0xff,0x51,0xff,0x56,0xff,0x5c,0xff, + 0x65,0xff,0x76,0xff,0x8a,0xff,0x9f,0xff, + 0xb7,0xff,0xce,0xff,0xe7,0xff,0xec,0x7f, + 0x19,0x00,0x31,0x00,0x48,0x00,0x5f,0x00, + 0x73,0x00,0x86,0x00,0x95,0x00,0x9d,0x00, + 0xa2,0x00,0xa5,0x00,0xa6,0x00,0xa5,0x00, + 0xa1,0x00,0x9d,0x00,0x95,0x00,0x8f,0x00, + 0x81,0x00,0x83,0x00,0xdb,0x00,0xc5,0x00, + 0xa7,0x00,0x8c,0x00,0x71,0x00,0x5a,0x00, + 0x40,0x00,0x1a,0x00,0x10,0x00,0x09,0x00, + 0x04,0x00,0x01,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x00,0x00,0x0a,0x00, + 0x00,0x00,0x1b,0x00,0xfe,0xff,0x3a,0x00, + 0x33,0x00,0x9a,0x00,0x4b,0x00,0xb7,0x00, + 0xd1,0xff,0xbd,0x00,0xb7,0xff,0xf8,0x00, + 0x8a,0xff,0x40,0x01,0x47,0xff,0x98,0x01, + 0xe8,0xfe,0x0a,0x02,0x5f,0xfe,0xa9,0x02, + 0x90,0xfd,0x9f,0x03,0x33,0xfc,0x70,0x05, + 0x45,0xf9,0x69,0x0a,0x01,0xed,0x8e,0x78, + 0x09,0x1c,0x5e,0xf3,0xca,0x07,0xf6,0xf9, + 0x39,0x04,0x12,0xfc,0xae,0x02,0x23,0xfd, + 0xca,0x01,0xce,0xfd,0x35,0x01,0x46,0xfe, + 0xce,0x00,0xa3,0xfe,0x84,0x00,0xef,0xfe, + 0x51,0x00,0x2e,0xff,0x30,0x00,0x56,0xff, + 0xad,0xff,0x46,0xff,0xbc,0xff,0xa1,0xff, + 0x06,0x00,0xd8,0xff,0x00,0x00,0xef,0xff, + 0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfe,0xff,0xfb,0xff,0xf7,0xff, + 0xf3,0xff,0xec,0xff,0xe9,0xff,0xd0,0xff, + 0x8d,0xff,0x84,0xff,0x5c,0xff,0x9e,0xff, + 0xc4,0xff,0xb1,0xff,0xb3,0xff,0xa9,0xff, + 0xa8,0xff,0xa2,0xff,0xa3,0xff,0xa0,0xff, + 0xa2,0xff,0xa1,0xff,0xa5,0xff,0xa7,0xff, + 0xad,0xff,0xb1,0xff,0xb9,0xff,0xbf,0xff, + 0xcc,0xff,0xdd,0xff,0xef,0xff,0xec,0x7f, + 0x11,0x00,0x22,0x00,0x33,0x00,0x40,0x00, + 0x46,0x00,0x4c,0x00,0x50,0x00,0x55,0x00, + 0x57,0x00,0x5a,0x00,0x59,0x00,0x5a,0x00, + 0x56,0x00,0x56,0x00,0x50,0x00,0x4f,0x00, + 0x45,0x00,0x46,0x00,0x34,0x00,0x54,0x00, + 0x8a,0x00,0x66,0x00,0x5c,0x00,0x25,0x00, + 0x11,0x00,0x0e,0x00,0x09,0x00,0x05,0x00, + 0x02,0x00,0x01,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xec,0x7f,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfe,0xff, + 0xfb,0xff,0xf7,0xff,0xf3,0xff,0xec,0xff, + 0xe9,0xff,0xd0,0xff,0x8d,0xff,0x84,0xff, + 0x5c,0xff,0x9e,0xff,0xc4,0xff,0xb1,0xff, + 0xb3,0xff,0xa9,0xff,0xa8,0xff,0xa2,0xff, + 0xa3,0xff,0xa0,0xff,0xa2,0xff,0xa1,0xff, + 0xa5,0xff,0xa7,0xff,0xad,0xff,0xb1,0xff, + 0xb9,0xff,0xbf,0xff,0xcc,0xff,0xdd,0xff, + 0xef,0xff,0xec,0x7f,0x11,0x00,0x22,0x00, + 0x33,0x00,0x40,0x00,0x46,0x00,0x4c,0x00, + 0x50,0x00,0x55,0x00,0x57,0x00,0x5a,0x00, + 0x59,0x00,0x5a,0x00,0x56,0x00,0x56,0x00, + 0x50,0x00,0x4f,0x00,0x45,0x00,0x46,0x00, + 0x34,0x00,0x54,0x00,0x8a,0x00,0x66,0x00, + 0x5c,0x00,0x25,0x00,0x11,0x00,0x0e,0x00, + 0x09,0x00,0x05,0x00,0x02,0x00,0x01,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x00,0x00,0x0a,0x00,0x00,0x00,0x1b,0x00, + 0xfe,0xff,0x3a,0x00,0x33,0x00,0x9a,0x00, + 0x4b,0x00,0xb7,0x00,0xd1,0xff,0xbd,0x00, + 0xb7,0xff,0xf8,0x00,0x8a,0xff,0x40,0x01, + 0x47,0xff,0x98,0x01,0xe8,0xfe,0x0a,0x02, + 0x5f,0xfe,0xa9,0x02,0x90,0xfd,0x9f,0x03, + 0x33,0xfc,0x70,0x05,0x45,0xf9,0x69,0x0a, + 0x01,0xed,0x8e,0x78,0x09,0x1c,0x5e,0xf3, + 0xca,0x07,0xf6,0xf9,0x39,0x04,0x12,0xfc, + 0xae,0x02,0x23,0xfd,0xca,0x01,0xce,0xfd, + 0x35,0x01,0x46,0xfe,0xce,0x00,0xa3,0xfe, + 0x84,0x00,0xef,0xfe,0x51,0x00,0x2e,0xff, + 0x30,0x00,0x56,0xff,0xad,0xff,0x46,0xff, + 0xbc,0xff,0xa1,0xff,0x06,0x00,0xd8,0xff, + 0x00,0x00,0xef,0xff,0x00,0x00,0xfc,0xff, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfc,0xff, + 0xf7,0xff,0xf0,0xff,0xe7,0xff,0xdb,0xff, + 0xa9,0xff,0x8c,0xff,0x73,0xff,0x56,0xff, + 0x39,0xff,0x1a,0xff,0x04,0xff,0x6c,0xff, + 0x6f,0xff,0x62,0xff,0x5c,0xff,0x55,0xff, + 0x52,0xff,0x4f,0xff,0x50,0xff,0x51,0xff, + 0x56,0xff,0x5c,0xff,0x65,0xff,0x76,0xff, + 0x8a,0xff,0x9f,0xff,0xb7,0xff,0xce,0xff, + 0xe7,0xff,0xec,0x7f,0x19,0x00,0x31,0x00, + 0x48,0x00,0x5f,0x00,0x73,0x00,0x86,0x00, + 0x95,0x00,0x9d,0x00,0xa2,0x00,0xa5,0x00, + 0xa6,0x00,0xa5,0x00,0xa1,0x00,0x9d,0x00, + 0x95,0x00,0x8f,0x00,0x81,0x00,0x83,0x00, + 0xdb,0x00,0xc5,0x00,0xa7,0x00,0x8c,0x00, + 0x71,0x00,0x5a,0x00,0x40,0x00,0x1a,0x00, + 0x10,0x00,0x09,0x00,0x04,0x00,0x01,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, + 0x01,0x00,0x1e,0x00,0x0b,0x00,0x6a,0x00, + 0x23,0x00,0xb7,0x00,0x30,0x00,0x19,0x01, + 0x39,0x00,0x5c,0x01,0x8f,0xff,0x90,0x01, + 0x4b,0xff,0x0a,0x02,0xe0,0xfe,0xa2,0x02, + 0x44,0xfe,0x64,0x03,0x62,0xfd,0x6e,0x04, + 0x0d,0xfc,0x00,0x06,0xcc,0xf9,0xd2,0x08, + 0x3d,0xf5,0x0f,0x10,0x67,0xe5,0xde,0x50, + 0x9a,0x51,0xb6,0xe4,0xf2,0x0f,0x3a,0xf4, + 0x55,0x08,0x7b,0xf8,0x33,0x05,0x83,0xfa, + 0x76,0x03,0xc7,0xfb,0x57,0x02,0xa9,0xfc, + 0x8f,0x01,0x58,0xfd,0x00,0x01,0xe8,0xfd, + 0x97,0x00,0x69,0xfe,0x0c,0x00,0x2f,0xfe, + 0xbd,0xff,0xb3,0xfe,0xbe,0xff,0x21,0xff, + 0xc9,0xff,0x8c,0xff,0x02,0x00,0xce,0xff, + 0xfe,0xff,0xee,0xff,0xff,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, + 0xfa,0xff,0xf3,0xff,0xeb,0xff,0xd5,0xff, + 0xae,0xff,0x9a,0xff,0x78,0xff,0x5e,0xff, + 0x37,0xff,0x1d,0xff,0xf1,0xfe,0xdd,0xfe, + 0xa3,0xfe,0xef,0xfe,0x3f,0xff,0x1e,0xff, + 0x23,0xff,0x14,0xff,0x18,0xff,0x12,0xff, + 0x19,0xff,0x20,0xff,0x33,0xff,0x43,0xff, + 0x5b,0xff,0x71,0xff,0x8c,0xff,0xa7,0xff, + 0xc4,0xff,0xe2,0xff,0xec,0x7f,0x1e,0x00, + 0x3b,0x00,0x58,0x00,0x72,0x00,0x8c,0x00, + 0xa0,0x00,0xb6,0x00,0xc4,0x00,0xd5,0x00, + 0xdb,0x00,0xe0,0x00,0xd9,0x00,0xdb,0x00, + 0xcb,0x00,0xce,0x00,0xae,0x00,0xf4,0x00, + 0x34,0x01,0xfe,0x00,0xe8,0x00,0xbf,0x00, + 0xa5,0x00,0x82,0x00,0x6a,0x00,0x4c,0x00, + 0x39,0x00,0x1c,0x00,0x0c,0x00,0x06,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x05,0x00,0x0d,0x00, + 0x18,0x00,0x3d,0x00,0x46,0x00,0x72,0x00, + 0x77,0x00,0xb4,0x00,0xad,0x00,0xff,0x00, + 0xe2,0x00,0x56,0x01,0xd3,0x00,0xdf,0x00, + 0x95,0x00,0x10,0x01,0x8c,0x00,0x37,0x01, + 0x74,0x00,0x5b,0x01,0x41,0x00,0x76,0x01, + 0xe6,0xff,0x9f,0x01,0x54,0xff,0x03,0x02, + 0x3b,0xfe,0x6f,0x03,0xd2,0xf9,0x5a,0x7f, + 0xec,0x06,0x5e,0xfc,0xe3,0x01,0xea,0xfd, + 0xba,0x00,0x52,0xfe,0x21,0x00,0x7a,0xfe, + 0xc0,0xff,0x92,0xfe,0x88,0xff,0xb4,0xfe, + 0x6b,0xff,0xd9,0xfe,0x5f,0xff,0x08,0xff, + 0x27,0xff,0x7d,0xfe,0xfe,0xfe,0xd6,0xfe, + 0x33,0xff,0x26,0xff,0x6c,0xff,0x6d,0xff, + 0xa2,0xff,0xa8,0xff,0xd8,0xff,0xe9,0xff, + 0xf4,0xff,0xfa,0xff,0xff,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xf9,0xff,0xf2,0xff,0xdf,0xff, + 0xc1,0xff,0xac,0xff,0x8c,0xff,0x71,0xff, + 0x4a,0xff,0x2c,0xff,0x02,0xff,0xe5,0xfe, + 0xb5,0xfe,0xa0,0xfe,0x64,0xfe,0xa5,0xfe, + 0x14,0xff,0xf2,0xfe,0xfa,0xfe,0xec,0xfe, + 0xf9,0xfe,0xfd,0xfe,0x0f,0xff,0x1b,0xff, + 0x33,0xff,0x47,0xff,0x64,0xff,0x7f,0xff, + 0x9f,0xff,0xbe,0xff,0xdf,0xff,0xec,0x7f, + 0x21,0x00,0x42,0x00,0x60,0x00,0x7f,0x00, + 0x98,0x00,0xb3,0x00,0xc6,0x00,0xdb,0x00, + 0xe6,0x00,0xf6,0x00,0xf7,0x00,0x01,0x01, + 0xf3,0x00,0xf8,0x00,0xd7,0x00,0x39,0x01, + 0x70,0x01,0x36,0x01,0x20,0x01,0xf3,0x00, + 0xd6,0x00,0xae,0x00,0x91,0x00,0x6f,0x00, + 0x56,0x00,0x3b,0x00,0x29,0x00,0x13,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x07,0x00,0x12,0x00, + 0x2b,0x00,0x36,0x00,0x5d,0x00,0x66,0x00, + 0x9e,0x00,0x9d,0x00,0xeb,0x00,0xd8,0x00, + 0x40,0x01,0x0f,0x01,0x9f,0x01,0xf6,0x00, + 0x18,0x01,0xaa,0x00,0x4e,0x01,0x95,0x00, + 0x73,0x01,0x62,0x00,0x90,0x01,0x0f,0x00, + 0xb6,0x01,0x8c,0xff,0x02,0x02,0xa9,0xfe, + 0xdf,0x02,0x66,0xfc,0x25,0x08,0x2b,0x7f, + 0xb5,0xf8,0x66,0x03,0x2b,0xfd,0x4d,0x01, + 0xf5,0xfd,0x6f,0x00,0x3a,0xfe,0xeb,0xff, + 0x5b,0xfe,0x94,0xff,0x74,0xfe,0x5d,0xff, + 0x96,0xfe,0x46,0xff,0xca,0xfe,0xd8,0xfe, + 0x30,0xfe,0xcc,0xfe,0x90,0xfe,0x03,0xff, + 0xe9,0xfe,0x40,0xff,0x3b,0xff,0x7d,0xff, + 0x83,0xff,0xb2,0xff,0xbd,0xff,0xe3,0xff, + 0xf1,0xff,0xfa,0xff,0xfe,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xf9,0xff,0xef,0xff,0xd6,0xff, + 0xc1,0xff,0xa5,0xff,0x8a,0xff,0x67,0xff, + 0x47,0xff,0x1f,0xff,0xfd,0xfe,0xd2,0xfe, + 0xb2,0xfe,0x84,0xfe,0x6c,0xfe,0x36,0xfe, + 0xb9,0xfe,0xf6,0xfe,0xdc,0xfe,0xeb,0xfe, + 0xe7,0xfe,0xf8,0xfe,0x00,0xff,0x16,0xff, + 0x27,0xff,0x42,0xff,0x5b,0xff,0x7b,0xff, + 0x99,0xff,0xbb,0xff,0xdd,0xff,0xec,0x7f, + 0x23,0x00,0x44,0x00,0x66,0x00,0x83,0x00, + 0xa1,0x00,0xb8,0x00,0xd1,0x00,0xe1,0x00, + 0xf4,0x00,0xfa,0x00,0x08,0x01,0x03,0x01, + 0x0f,0x01,0xf4,0x00,0x2a,0x01,0x9d,0x01, + 0x69,0x01,0x4f,0x01,0x23,0x01,0x03,0x01, + 0xda,0x00,0xb9,0x00,0x94,0x00,0x77,0x00, + 0x58,0x00,0x3f,0x00,0x28,0x00,0x18,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x1d,0x00,0x1f,0x00, + 0x50,0x00,0x40,0x00,0x99,0x00,0x67,0x00, + 0xf6,0x00,0x8e,0x00,0x64,0x01,0xae,0x00, + 0xe0,0x01,0xbe,0x00,0x6f,0x02,0x69,0x00, + 0x0c,0x02,0xcd,0xff,0x86,0x02,0x4f,0xff, + 0x0a,0x03,0x97,0xfe,0xb7,0x03,0x81,0xfd, + 0xc5,0x04,0xb8,0xfb,0xce,0x06,0x0f,0xf8, + 0x97,0x0c,0xbd,0xe9,0x08,0x74,0xd1,0x24, + 0xe9,0xef,0xa4,0x09,0x44,0xf8,0xff,0x04, + 0xc4,0xfa,0xec,0x02,0xf7,0xfb,0xb3,0x01, + 0xb3,0xfc,0xe6,0x00,0x3b,0xfd,0x5b,0x00, + 0xaf,0xfd,0xf7,0xff,0x62,0xfd,0x2e,0xff, + 0xe2,0xfd,0x3d,0xff,0x61,0xfe,0x5b,0xff, + 0xd5,0xfe,0x83,0xff,0x3a,0xff,0xac,0xff, + 0x8d,0xff,0xd2,0xff,0xcb,0xff,0xf2,0xff, + 0xf7,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xf9,0xff,0xec,0xff,0xd5,0xff, + 0xc1,0xff,0xa4,0xff,0x89,0xff,0x65,0xff, + 0x45,0xff,0x1c,0xff,0xfb,0xfe,0xcd,0xfe, + 0xaf,0xfe,0x7e,0xfe,0x6a,0xfe,0x2b,0xfe, + 0x84,0xfe,0xf6,0xfe,0xd6,0xfe,0xe9,0xfe, + 0xe3,0xfe,0xf6,0xfe,0xfc,0xfe,0x14,0xff, + 0x24,0xff,0x40,0xff,0x59,0xff,0x79,0xff, + 0x98,0xff,0xba,0xff,0xdd,0xff,0xec,0x7f, + 0x23,0x00,0x45,0x00,0x67,0x00,0x84,0x00, + 0xa3,0x00,0xba,0x00,0xd4,0x00,0xe3,0x00, + 0xf8,0x00,0xfc,0x00,0x0c,0x01,0x05,0x01, + 0x14,0x01,0xf5,0x00,0x5a,0x01,0xa7,0x01, + 0x6a,0x01,0x55,0x01,0x25,0x01,0x07,0x01, + 0xdc,0x00,0xbc,0x00,0x96,0x00,0x78,0x00, + 0x58,0x00,0x41,0x00,0x29,0x00,0x19,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x19,0x00,0x29,0x00, + 0x41,0x00,0x58,0x00,0x79,0x00,0x95,0x00, + 0xbd,0x00,0xdb,0x00,0x08,0x01,0x24,0x01, + 0x56,0x01,0x68,0x01,0xaa,0x01,0x58,0x01, + 0xf9,0x00,0x10,0x01,0x0a,0x01,0x06,0x01, + 0x04,0x01,0xef,0x00,0xed,0x00,0xc8,0x00, + 0xc8,0x00,0x91,0x00,0x9b,0x00,0x48,0x00, + 0x74,0x00,0xc5,0xff,0xeb,0x7f,0x3c,0x00, + 0x8b,0xff,0xb7,0xff,0x62,0xff,0x6b,0xff, + 0x32,0xff,0x30,0xff,0x09,0xff,0x05,0xff, + 0xee,0xfe,0xe9,0xfe,0xe3,0xfe,0xdb,0xfe, + 0xf1,0xfe,0x88,0xfe,0x28,0xfe,0x6d,0xfe, + 0x7c,0xfe,0xb1,0xfe,0xcc,0xfe,0xfc,0xfe, + 0x1b,0xff,0x46,0xff,0x64,0xff,0x89,0xff, + 0xa4,0xff,0xc1,0xff,0xd5,0xff,0xec,0xff, + 0xf9,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00, + 0x01,0x00,0x02,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0xb5,0xff,0x00,0x00, + 0x02,0x00,0x00,0x00,0xc4,0xff,0x00,0x00, + 0x04,0x00,0x00,0x00,0xd3,0xff,0x00,0x00, + 0x06,0x00,0x00,0x00,0xe2,0xff,0x00,0x00, + 0x08,0x00,0x00,0x00,0xf1,0xff,0x00,0x00, + 0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x0c,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, + 0x0e,0x00,0x00,0x00,0x1e,0x00,0x00,0x00, + 0x10,0x00,0x00,0x00,0x2d,0x00,0x00,0x00, + 0x12,0x00,0x00,0x00,0x3c,0x00,0x00,0x00, + 0x14,0x00,0x00,0x00,0x4b,0x00,0x00,0x00, + 0x16,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x00,0x00,0x66,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_16khz.conf b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_16khz.conf new file mode 100644 index 000000000000..c2e9b2003684 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_16khz.conf @@ -0,0 +1,258 @@ +# Created with script example_two_beams.m 23-Oct-2023 +# cd tools/tune/tdfb; matlab -nodisplay -nosplash -nodesktop -r example_two_beams +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0xc4,0x07,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc4,0x07,0x00,0x00,0x04,0x00,0x02,0x00, + 0x01,0x00,0x02,0x00,0x03,0x00,0x01,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xec,0x7f,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xec,0x7f,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfe,0xff,0xf9,0xff,0xee,0xff, + 0xe1,0xff,0xcd,0xff,0xb6,0xff,0x97,0xff, + 0x77,0xff,0x4b,0xff,0x22,0xff,0xe9,0xfe, + 0xb7,0xfe,0x72,0xfe,0x3b,0xfe,0xea,0xfd, + 0xa4,0xfd,0x3a,0xfd,0xf7,0xfc,0x87,0xfc, + 0x5f,0xfc,0x0c,0xfc,0x27,0xfc,0xa5,0xfb, + 0xb7,0xf8,0xe9,0xf7,0x18,0xfb,0x03,0xfd, + 0x07,0xfd,0xb4,0xfd,0x39,0xfe,0x26,0xff, + 0xec,0x7f,0xd9,0x00,0xc3,0x01,0x43,0x02, + 0xea,0x02,0xe9,0x02,0xc2,0x04,0xcd,0x07, + 0xfc,0x06,0x26,0x04,0xa5,0x03,0xb8,0x03, + 0x64,0x03,0x38,0x03,0xcb,0x02,0x87,0x02, + 0x21,0x02,0xdd,0x01,0x90,0x01,0x5a,0x01, + 0x1a,0x01,0xea,0x00,0xb7,0x00,0x91,0x00, + 0x6a,0x00,0x4e,0x00,0x34,0x00,0x21,0x00, + 0x12,0x00,0x08,0x00,0x02,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x0a,0x00,0x0e,0x00,0x29,0x00,0x28,0x00, + 0x61,0x00,0x52,0x00,0xb4,0x00,0x8b,0x00, + 0x25,0x01,0xd4,0x00,0xb4,0x01,0x27,0x01, + 0x60,0x02,0x8d,0x01,0x40,0x03,0xfa,0x01, + 0x36,0x04,0x3d,0x02,0x10,0x05,0xff,0x01, + 0x4e,0x06,0x31,0x05,0x03,0x0a,0x11,0x01, + 0xc8,0x06,0xc9,0xfd,0x1f,0x09,0xbb,0xf6, + 0xeb,0x18,0x10,0x7a,0x91,0xed,0x71,0x07, + 0x47,0xf7,0xb2,0x01,0x30,0xf9,0x83,0xfd, + 0x1e,0xf5,0x52,0xfb,0x11,0xfa,0x9e,0xfd, + 0xb9,0xfa,0x83,0xfd,0x8d,0xfb,0xd6,0xfd, + 0x82,0xfc,0x4b,0xfe,0x64,0xfd,0xb1,0xfe, + 0x13,0xfe,0x09,0xff,0xa9,0xfe,0x58,0xff, + 0x23,0xff,0x97,0xff,0x80,0xff,0xc7,0xff, + 0xc1,0xff,0xe8,0xff,0xeb,0xff,0xfa,0xff, + 0xfe,0xff,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x0a,0x00,0x0e,0x00, + 0x29,0x00,0x28,0x00,0x61,0x00,0x52,0x00, + 0xb4,0x00,0x8b,0x00,0x25,0x01,0xd4,0x00, + 0xb4,0x01,0x27,0x01,0x60,0x02,0x8d,0x01, + 0x40,0x03,0xfa,0x01,0x36,0x04,0x3d,0x02, + 0x10,0x05,0xff,0x01,0x4e,0x06,0x31,0x05, + 0x03,0x0a,0x11,0x01,0xc8,0x06,0xc9,0xfd, + 0x1f,0x09,0xbb,0xf6,0xeb,0x18,0x10,0x7a, + 0x91,0xed,0x71,0x07,0x47,0xf7,0xb2,0x01, + 0x30,0xf9,0x83,0xfd,0x1e,0xf5,0x52,0xfb, + 0x11,0xfa,0x9e,0xfd,0xb9,0xfa,0x83,0xfd, + 0x8d,0xfb,0xd6,0xfd,0x82,0xfc,0x4b,0xfe, + 0x64,0xfd,0xb1,0xfe,0x13,0xfe,0x09,0xff, + 0xa9,0xfe,0x58,0xff,0x23,0xff,0x97,0xff, + 0x80,0xff,0xc7,0xff,0xc1,0xff,0xe8,0xff, + 0xeb,0xff,0xfa,0xff,0xfe,0xff,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff, + 0xf9,0xff,0xee,0xff,0xe1,0xff,0xcd,0xff, + 0xb6,0xff,0x97,0xff,0x77,0xff,0x4b,0xff, + 0x22,0xff,0xe9,0xfe,0xb7,0xfe,0x72,0xfe, + 0x3b,0xfe,0xea,0xfd,0xa4,0xfd,0x3a,0xfd, + 0xf7,0xfc,0x87,0xfc,0x5f,0xfc,0x0c,0xfc, + 0x27,0xfc,0xa5,0xfb,0xb7,0xf8,0xe9,0xf7, + 0x18,0xfb,0x03,0xfd,0x07,0xfd,0xb4,0xfd, + 0x39,0xfe,0x26,0xff,0xec,0x7f,0xd9,0x00, + 0xc3,0x01,0x43,0x02,0xea,0x02,0xe9,0x02, + 0xc2,0x04,0xcd,0x07,0xfc,0x06,0x26,0x04, + 0xa5,0x03,0xb8,0x03,0x64,0x03,0x38,0x03, + 0xcb,0x02,0x87,0x02,0x21,0x02,0xdd,0x01, + 0x90,0x01,0x5a,0x01,0x1a,0x01,0xea,0x00, + 0xb7,0x00,0x91,0x00,0x6a,0x00,0x4e,0x00, + 0x34,0x00,0x21,0x00,0x12,0x00,0x08,0x00, + 0x02,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfd,0xff,0xf2,0xff, + 0xe1,0xff,0xc7,0xff,0xa6,0xff,0x7a,0xff, + 0x49,0xff,0x08,0xff,0xc8,0xfe,0x72,0xfe, + 0x23,0xfe,0xba,0xfd,0x5d,0xfd,0xd1,0xfc, + 0x66,0xfc,0xc9,0xfb,0x63,0xfb,0xbc,0xfa, + 0x74,0xfa,0xca,0xf9,0xd3,0xf9,0xa2,0xf8, + 0xc2,0xf5,0x93,0xf5,0xf1,0xf5,0xac,0xf5, + 0x7f,0xf8,0xbc,0xfb,0x46,0xfc,0xa8,0xfd, + 0xba,0xfe,0xec,0x7f,0x44,0x01,0x52,0x02, + 0xab,0x03,0x2f,0x04,0x51,0x07,0x04,0x0a, + 0xb3,0x09,0xff,0x09,0xc3,0x09,0xfb,0x06, + 0xd0,0x05,0xcd,0x05,0x25,0x05,0xd8,0x04, + 0x35,0x04,0xce,0x03,0x38,0x03,0xcf,0x02, + 0x4c,0x02,0xf3,0x01,0x91,0x01,0x48,0x01, + 0xfa,0x00,0xc0,0x00,0x88,0x00,0x5e,0x00, + 0x3a,0x00,0x20,0x00,0x0e,0x00,0x03,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00, + 0x11,0x00,0x19,0x00,0x48,0x00,0x4a,0x00, + 0xa9,0x00,0x95,0x00,0x39,0x01,0xfc,0x00, + 0xf9,0x01,0x7a,0x01,0xee,0x02,0x1c,0x02, + 0x21,0x04,0xcc,0x02,0x78,0x05,0x6b,0x03, + 0xd8,0x06,0xd5,0x03,0x09,0x08,0x21,0x05, + 0x2c,0x0d,0xd7,0x05,0x50,0x0e,0xe5,0x03, + 0xe1,0x0c,0xc6,0xfa,0x1b,0x10,0x19,0xed, + 0x61,0x35,0x6c,0x69,0x00,0xe4,0x27,0x0c, + 0xad,0xf1,0xeb,0x02,0xc9,0xf0,0xaf,0xfa, + 0x84,0xf1,0xe8,0xf8,0x3b,0xf3,0x06,0xfc, + 0x3a,0xf7,0xf3,0xfb,0xa0,0xf8,0x57,0xfc, + 0x13,0xfa,0xf9,0xfc,0x76,0xfb,0xae,0xfd, + 0xb5,0xfc,0x4f,0xfe,0xb1,0xfd,0xd5,0xfe, + 0x80,0xfe,0x44,0xff,0x20,0xff,0x99,0xff, + 0x92,0xff,0xd4,0xff,0xda,0xff,0xf6,0xff, + 0xfc,0xff,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x03,0x00,0x11,0x00,0x19,0x00, + 0x48,0x00,0x4a,0x00,0xa9,0x00,0x95,0x00, + 0x39,0x01,0xfc,0x00,0xf9,0x01,0x7a,0x01, + 0xee,0x02,0x1c,0x02,0x21,0x04,0xcc,0x02, + 0x78,0x05,0x6b,0x03,0xd8,0x06,0xd5,0x03, + 0x09,0x08,0x21,0x05,0x2c,0x0d,0xd7,0x05, + 0x50,0x0e,0xe5,0x03,0xe1,0x0c,0xc6,0xfa, + 0x1b,0x10,0x19,0xed,0x61,0x35,0x6c,0x69, + 0x00,0xe4,0x27,0x0c,0xad,0xf1,0xeb,0x02, + 0xc9,0xf0,0xaf,0xfa,0x84,0xf1,0xe8,0xf8, + 0x3b,0xf3,0x06,0xfc,0x3a,0xf7,0xf3,0xfb, + 0xa0,0xf8,0x57,0xfc,0x13,0xfa,0xf9,0xfc, + 0x76,0xfb,0xae,0xfd,0xb5,0xfc,0x4f,0xfe, + 0xb1,0xfd,0xd5,0xfe,0x80,0xfe,0x44,0xff, + 0x20,0xff,0x99,0xff,0x92,0xff,0xd4,0xff, + 0xda,0xff,0xf6,0xff,0xfc,0xff,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfd,0xff,0xf2,0xff,0xe1,0xff,0xc7,0xff, + 0xa6,0xff,0x7a,0xff,0x49,0xff,0x08,0xff, + 0xc8,0xfe,0x72,0xfe,0x23,0xfe,0xba,0xfd, + 0x5d,0xfd,0xd1,0xfc,0x66,0xfc,0xc9,0xfb, + 0x63,0xfb,0xbc,0xfa,0x74,0xfa,0xca,0xf9, + 0xd3,0xf9,0xa2,0xf8,0xc2,0xf5,0x93,0xf5, + 0xf1,0xf5,0xac,0xf5,0x7f,0xf8,0xbc,0xfb, + 0x46,0xfc,0xa8,0xfd,0xba,0xfe,0xec,0x7f, + 0x44,0x01,0x52,0x02,0xab,0x03,0x2f,0x04, + 0x51,0x07,0x04,0x0a,0xb3,0x09,0xff,0x09, + 0xc3,0x09,0xfb,0x06,0xd0,0x05,0xcd,0x05, + 0x25,0x05,0xd8,0x04,0x35,0x04,0xce,0x03, + 0x38,0x03,0xcf,0x02,0x4c,0x02,0xf3,0x01, + 0x91,0x01,0x48,0x01,0xfa,0x00,0xc0,0x00, + 0x88,0x00,0x5e,0x00,0x3a,0x00,0x20,0x00, + 0x0e,0x00,0x03,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00, + 0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00, + 0x04,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x08,0x00,0x00,0x00,0x00,0x00,0x66,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_48khz.conf b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_48khz.conf new file mode 100644 index 000000000000..339d281c2f27 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm0_30_90deg_48khz.conf @@ -0,0 +1,258 @@ +# Created with script example_two_beams.m 23-Oct-2023 +# cd tools/tune/tdfb; matlab -nodisplay -nosplash -nodesktop -r example_two_beams +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0xc4,0x07,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc4,0x07,0x00,0x00,0x04,0x00,0x02,0x00, + 0x01,0x00,0x02,0x00,0x03,0x00,0x01,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xec,0x7f,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xec,0x7f,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xec,0x7f,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfc,0xff, + 0xf7,0xff,0xf0,0xff,0xe7,0xff,0xdb,0xff, + 0xa9,0xff,0x8c,0xff,0x73,0xff,0x56,0xff, + 0x39,0xff,0x1a,0xff,0x04,0xff,0x6c,0xff, + 0x6f,0xff,0x62,0xff,0x5c,0xff,0x55,0xff, + 0x52,0xff,0x4f,0xff,0x50,0xff,0x51,0xff, + 0x56,0xff,0x5c,0xff,0x65,0xff,0x76,0xff, + 0x8a,0xff,0x9f,0xff,0xb7,0xff,0xce,0xff, + 0xe7,0xff,0xec,0x7f,0x19,0x00,0x31,0x00, + 0x48,0x00,0x5f,0x00,0x73,0x00,0x86,0x00, + 0x95,0x00,0x9d,0x00,0xa2,0x00,0xa5,0x00, + 0xa6,0x00,0xa5,0x00,0xa1,0x00,0x9d,0x00, + 0x95,0x00,0x8f,0x00,0x81,0x00,0x83,0x00, + 0xdb,0x00,0xc5,0x00,0xa7,0x00,0x8c,0x00, + 0x71,0x00,0x5a,0x00,0x40,0x00,0x1a,0x00, + 0x10,0x00,0x09,0x00,0x04,0x00,0x01,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00, + 0x01,0x00,0x1e,0x00,0x0b,0x00,0x6a,0x00, + 0x23,0x00,0xb7,0x00,0x30,0x00,0x19,0x01, + 0x39,0x00,0x5c,0x01,0x8f,0xff,0x90,0x01, + 0x4b,0xff,0x0a,0x02,0xe0,0xfe,0xa2,0x02, + 0x44,0xfe,0x64,0x03,0x62,0xfd,0x6e,0x04, + 0x0d,0xfc,0x00,0x06,0xcc,0xf9,0xd2,0x08, + 0x3d,0xf5,0x0f,0x10,0x67,0xe5,0xde,0x50, + 0x9a,0x51,0xb6,0xe4,0xf2,0x0f,0x3a,0xf4, + 0x55,0x08,0x7b,0xf8,0x33,0x05,0x83,0xfa, + 0x76,0x03,0xc7,0xfb,0x57,0x02,0xa9,0xfc, + 0x8f,0x01,0x58,0xfd,0x00,0x01,0xe8,0xfd, + 0x97,0x00,0x69,0xfe,0x0c,0x00,0x2f,0xfe, + 0xbd,0xff,0xb3,0xfe,0xbe,0xff,0x21,0xff, + 0xc9,0xff,0x8c,0xff,0x02,0x00,0xce,0xff, + 0xfe,0xff,0xee,0xff,0xff,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x08,0x00,0x01,0x00,0x1e,0x00, + 0x0b,0x00,0x6a,0x00,0x23,0x00,0xb7,0x00, + 0x30,0x00,0x19,0x01,0x39,0x00,0x5c,0x01, + 0x8f,0xff,0x90,0x01,0x4b,0xff,0x0a,0x02, + 0xe0,0xfe,0xa2,0x02,0x44,0xfe,0x64,0x03, + 0x62,0xfd,0x6e,0x04,0x0d,0xfc,0x00,0x06, + 0xcc,0xf9,0xd2,0x08,0x3d,0xf5,0x0f,0x10, + 0x67,0xe5,0xde,0x50,0x9a,0x51,0xb6,0xe4, + 0xf2,0x0f,0x3a,0xf4,0x55,0x08,0x7b,0xf8, + 0x33,0x05,0x83,0xfa,0x76,0x03,0xc7,0xfb, + 0x57,0x02,0xa9,0xfc,0x8f,0x01,0x58,0xfd, + 0x00,0x01,0xe8,0xfd,0x97,0x00,0x69,0xfe, + 0x0c,0x00,0x2f,0xfe,0xbd,0xff,0xb3,0xfe, + 0xbe,0xff,0x21,0xff,0xc9,0xff,0x8c,0xff, + 0x02,0x00,0xce,0xff,0xfe,0xff,0xee,0xff, + 0xff,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfc,0xff,0xf7,0xff,0xf0,0xff, + 0xe7,0xff,0xdb,0xff,0xa9,0xff,0x8c,0xff, + 0x73,0xff,0x56,0xff,0x39,0xff,0x1a,0xff, + 0x04,0xff,0x6c,0xff,0x6f,0xff,0x62,0xff, + 0x5c,0xff,0x55,0xff,0x52,0xff,0x4f,0xff, + 0x50,0xff,0x51,0xff,0x56,0xff,0x5c,0xff, + 0x65,0xff,0x76,0xff,0x8a,0xff,0x9f,0xff, + 0xb7,0xff,0xce,0xff,0xe7,0xff,0xec,0x7f, + 0x19,0x00,0x31,0x00,0x48,0x00,0x5f,0x00, + 0x73,0x00,0x86,0x00,0x95,0x00,0x9d,0x00, + 0xa2,0x00,0xa5,0x00,0xa6,0x00,0xa5,0x00, + 0xa1,0x00,0x9d,0x00,0x95,0x00,0x8f,0x00, + 0x81,0x00,0x83,0x00,0xdb,0x00,0xc5,0x00, + 0xa7,0x00,0x8c,0x00,0x71,0x00,0x5a,0x00, + 0x40,0x00,0x1a,0x00,0x10,0x00,0x09,0x00, + 0x04,0x00,0x01,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xf9,0xff,0xec,0xff,0xd5,0xff, + 0xc1,0xff,0xa4,0xff,0x89,0xff,0x65,0xff, + 0x45,0xff,0x1c,0xff,0xfb,0xfe,0xcd,0xfe, + 0xaf,0xfe,0x7e,0xfe,0x6a,0xfe,0x2b,0xfe, + 0x84,0xfe,0xf6,0xfe,0xd6,0xfe,0xe9,0xfe, + 0xe3,0xfe,0xf6,0xfe,0xfc,0xfe,0x14,0xff, + 0x24,0xff,0x40,0xff,0x59,0xff,0x79,0xff, + 0x98,0xff,0xba,0xff,0xdd,0xff,0xec,0x7f, + 0x23,0x00,0x45,0x00,0x67,0x00,0x84,0x00, + 0xa3,0x00,0xba,0x00,0xd4,0x00,0xe3,0x00, + 0xf8,0x00,0xfc,0x00,0x0c,0x01,0x05,0x01, + 0x14,0x01,0xf5,0x00,0x5a,0x01,0xa7,0x01, + 0x6a,0x01,0x55,0x01,0x25,0x01,0x07,0x01, + 0xdc,0x00,0xbc,0x00,0x96,0x00,0x78,0x00, + 0x58,0x00,0x41,0x00,0x29,0x00,0x19,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x19,0x00,0x29,0x00, + 0x41,0x00,0x58,0x00,0x79,0x00,0x95,0x00, + 0xbd,0x00,0xdb,0x00,0x08,0x01,0x24,0x01, + 0x56,0x01,0x68,0x01,0xaa,0x01,0x58,0x01, + 0xf9,0x00,0x10,0x01,0x0a,0x01,0x06,0x01, + 0x04,0x01,0xef,0x00,0xed,0x00,0xc8,0x00, + 0xc8,0x00,0x91,0x00,0x9b,0x00,0x48,0x00, + 0x74,0x00,0xc5,0xff,0xeb,0x7f,0x3c,0x00, + 0x8b,0xff,0xb7,0xff,0x62,0xff,0x6b,0xff, + 0x32,0xff,0x30,0xff,0x09,0xff,0x05,0xff, + 0xee,0xfe,0xe9,0xfe,0xe3,0xfe,0xdb,0xfe, + 0xf1,0xfe,0x88,0xfe,0x28,0xfe,0x6d,0xfe, + 0x7c,0xfe,0xb1,0xfe,0xcc,0xfe,0xfc,0xfe, + 0x1b,0xff,0x46,0xff,0x64,0xff,0x89,0xff, + 0xa4,0xff,0xc1,0xff,0xd5,0xff,0xec,0xff, + 0xf9,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x19,0x00,0x29,0x00,0x41,0x00,0x58,0x00, + 0x79,0x00,0x95,0x00,0xbd,0x00,0xdb,0x00, + 0x08,0x01,0x24,0x01,0x56,0x01,0x68,0x01, + 0xaa,0x01,0x58,0x01,0xf9,0x00,0x10,0x01, + 0x0a,0x01,0x06,0x01,0x04,0x01,0xef,0x00, + 0xed,0x00,0xc8,0x00,0xc8,0x00,0x91,0x00, + 0x9b,0x00,0x48,0x00,0x74,0x00,0xc5,0xff, + 0xeb,0x7f,0x3c,0x00,0x8b,0xff,0xb7,0xff, + 0x62,0xff,0x6b,0xff,0x32,0xff,0x30,0xff, + 0x09,0xff,0x05,0xff,0xee,0xfe,0xe9,0xfe, + 0xe3,0xfe,0xdb,0xfe,0xf1,0xfe,0x88,0xfe, + 0x28,0xfe,0x6d,0xfe,0x7c,0xfe,0xb1,0xfe, + 0xcc,0xfe,0xfc,0xfe,0x1b,0xff,0x46,0xff, + 0x64,0xff,0x89,0xff,0xa4,0xff,0xc1,0xff, + 0xd5,0xff,0xec,0xff,0xf9,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xf9,0xff, + 0xec,0xff,0xd5,0xff,0xc1,0xff,0xa4,0xff, + 0x89,0xff,0x65,0xff,0x45,0xff,0x1c,0xff, + 0xfb,0xfe,0xcd,0xfe,0xaf,0xfe,0x7e,0xfe, + 0x6a,0xfe,0x2b,0xfe,0x84,0xfe,0xf6,0xfe, + 0xd6,0xfe,0xe9,0xfe,0xe3,0xfe,0xf6,0xfe, + 0xfc,0xfe,0x14,0xff,0x24,0xff,0x40,0xff, + 0x59,0xff,0x79,0xff,0x98,0xff,0xba,0xff, + 0xdd,0xff,0xec,0x7f,0x23,0x00,0x45,0x00, + 0x67,0x00,0x84,0x00,0xa3,0x00,0xba,0x00, + 0xd4,0x00,0xe3,0x00,0xf8,0x00,0xfc,0x00, + 0x0c,0x01,0x05,0x01,0x14,0x01,0xf5,0x00, + 0x5a,0x01,0xa7,0x01,0x6a,0x01,0x55,0x01, + 0x25,0x01,0x07,0x01,0xdc,0x00,0xbc,0x00, + 0x96,0x00,0x78,0x00,0x58,0x00,0x41,0x00, + 0x29,0x00,0x19,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00, + 0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x01,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00, + 0x04,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x08,0x00,0x00,0x00,0x00,0x00,0x66,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_16khz.conf b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_16khz.conf new file mode 100644 index 000000000000..9547488b9d83 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_16khz.conf @@ -0,0 +1,93 @@ +# Created with script example_two_beams.m 23-Oct-2023 +# cd tools/tune/tdfb; matlab -nodisplay -nosplash -nodesktop -r example_two_beams +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x9c,0x02,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x9c,0x02,0x00,0x00,0x04,0x00,0x02,0x00, + 0x01,0x00,0x02,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfd,0xff,0xf2,0xff, + 0xe1,0xff,0xc7,0xff,0xa6,0xff,0x7a,0xff, + 0x49,0xff,0x08,0xff,0xc8,0xfe,0x72,0xfe, + 0x23,0xfe,0xba,0xfd,0x5d,0xfd,0xd1,0xfc, + 0x66,0xfc,0xc9,0xfb,0x63,0xfb,0xbc,0xfa, + 0x74,0xfa,0xca,0xf9,0xd3,0xf9,0xa2,0xf8, + 0xc2,0xf5,0x93,0xf5,0xf1,0xf5,0xac,0xf5, + 0x7f,0xf8,0xbc,0xfb,0x46,0xfc,0xa8,0xfd, + 0xba,0xfe,0xec,0x7f,0x44,0x01,0x52,0x02, + 0xab,0x03,0x2f,0x04,0x51,0x07,0x04,0x0a, + 0xb3,0x09,0xff,0x09,0xc3,0x09,0xfb,0x06, + 0xd0,0x05,0xcd,0x05,0x25,0x05,0xd8,0x04, + 0x35,0x04,0xce,0x03,0x38,0x03,0xcf,0x02, + 0x4c,0x02,0xf3,0x01,0x91,0x01,0x48,0x01, + 0xfa,0x00,0xc0,0x00,0x88,0x00,0x5e,0x00, + 0x3a,0x00,0x20,0x00,0x0e,0x00,0x03,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00, + 0x11,0x00,0x19,0x00,0x48,0x00,0x4a,0x00, + 0xa9,0x00,0x95,0x00,0x39,0x01,0xfc,0x00, + 0xf9,0x01,0x7a,0x01,0xee,0x02,0x1c,0x02, + 0x21,0x04,0xcc,0x02,0x78,0x05,0x6b,0x03, + 0xd8,0x06,0xd5,0x03,0x09,0x08,0x21,0x05, + 0x2c,0x0d,0xd7,0x05,0x50,0x0e,0xe5,0x03, + 0xe1,0x0c,0xc6,0xfa,0x1b,0x10,0x19,0xed, + 0x61,0x35,0x6c,0x69,0x00,0xe4,0x27,0x0c, + 0xad,0xf1,0xeb,0x02,0xc9,0xf0,0xaf,0xfa, + 0x84,0xf1,0xe8,0xf8,0x3b,0xf3,0x06,0xfc, + 0x3a,0xf7,0xf3,0xfb,0xa0,0xf8,0x57,0xfc, + 0x13,0xfa,0xf9,0xfc,0x76,0xfb,0xae,0xfd, + 0xb5,0xfc,0x4f,0xfe,0xb1,0xfd,0xd5,0xfe, + 0x80,0xfe,0x44,0xff,0x20,0xff,0x99,0xff, + 0x92,0xff,0xd4,0xff,0xda,0xff,0xf6,0xff, + 0xfc,0xff,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x03,0x00,0x11,0x00,0x19,0x00, + 0x48,0x00,0x4a,0x00,0xa9,0x00,0x95,0x00, + 0x39,0x01,0xfc,0x00,0xf9,0x01,0x7a,0x01, + 0xee,0x02,0x1c,0x02,0x21,0x04,0xcc,0x02, + 0x78,0x05,0x6b,0x03,0xd8,0x06,0xd5,0x03, + 0x09,0x08,0x21,0x05,0x2c,0x0d,0xd7,0x05, + 0x50,0x0e,0xe5,0x03,0xe1,0x0c,0xc6,0xfa, + 0x1b,0x10,0x19,0xed,0x61,0x35,0x6c,0x69, + 0x00,0xe4,0x27,0x0c,0xad,0xf1,0xeb,0x02, + 0xc9,0xf0,0xaf,0xfa,0x84,0xf1,0xe8,0xf8, + 0x3b,0xf3,0x06,0xfc,0x3a,0xf7,0xf3,0xfb, + 0xa0,0xf8,0x57,0xfc,0x13,0xfa,0xf9,0xfc, + 0x76,0xfb,0xae,0xfd,0xb5,0xfc,0x4f,0xfe, + 0xb1,0xfd,0xd5,0xfe,0x80,0xfe,0x44,0xff, + 0x20,0xff,0x99,0xff,0x92,0xff,0xd4,0xff, + 0xda,0xff,0xf6,0xff,0xfc,0xff,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfd,0xff,0xf2,0xff,0xe1,0xff,0xc7,0xff, + 0xa6,0xff,0x7a,0xff,0x49,0xff,0x08,0xff, + 0xc8,0xfe,0x72,0xfe,0x23,0xfe,0xba,0xfd, + 0x5d,0xfd,0xd1,0xfc,0x66,0xfc,0xc9,0xfb, + 0x63,0xfb,0xbc,0xfa,0x74,0xfa,0xca,0xf9, + 0xd3,0xf9,0xa2,0xf8,0xc2,0xf5,0x93,0xf5, + 0xf1,0xf5,0xac,0xf5,0x7f,0xf8,0xbc,0xfb, + 0x46,0xfc,0xa8,0xfd,0xba,0xfe,0xec,0x7f, + 0x44,0x01,0x52,0x02,0xab,0x03,0x2f,0x04, + 0x51,0x07,0x04,0x0a,0xb3,0x09,0xff,0x09, + 0xc3,0x09,0xfb,0x06,0xd0,0x05,0xcd,0x05, + 0x25,0x05,0xd8,0x04,0x35,0x04,0xce,0x03, + 0x38,0x03,0xcf,0x02,0x4c,0x02,0xf3,0x01, + 0x91,0x01,0x48,0x01,0xfa,0x00,0xc0,0x00, + 0x88,0x00,0x5e,0x00,0x3a,0x00,0x20,0x00, + 0x0e,0x00,0x03,0x00,0x00,0x00,0x01,0x00, + 0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00, + 0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_48khz.conf b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_48khz.conf new file mode 100644 index 000000000000..0fc17a7bb3a6 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_50mm_pm90deg_48khz.conf @@ -0,0 +1,93 @@ +# Created with script example_two_beams.m 23-Oct-2023 +# cd tools/tune/tdfb; matlab -nodisplay -nosplash -nodesktop -r example_two_beams +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x9c,0x02,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x9c,0x02,0x00,0x00,0x04,0x00,0x02,0x00, + 0x01,0x00,0x02,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xf9,0xff,0xec,0xff,0xd5,0xff, + 0xc1,0xff,0xa4,0xff,0x89,0xff,0x65,0xff, + 0x45,0xff,0x1c,0xff,0xfb,0xfe,0xcd,0xfe, + 0xaf,0xfe,0x7e,0xfe,0x6a,0xfe,0x2b,0xfe, + 0x84,0xfe,0xf6,0xfe,0xd6,0xfe,0xe9,0xfe, + 0xe3,0xfe,0xf6,0xfe,0xfc,0xfe,0x14,0xff, + 0x24,0xff,0x40,0xff,0x59,0xff,0x79,0xff, + 0x98,0xff,0xba,0xff,0xdd,0xff,0xec,0x7f, + 0x23,0x00,0x45,0x00,0x67,0x00,0x84,0x00, + 0xa3,0x00,0xba,0x00,0xd4,0x00,0xe3,0x00, + 0xf8,0x00,0xfc,0x00,0x0c,0x01,0x05,0x01, + 0x14,0x01,0xf5,0x00,0x5a,0x01,0xa7,0x01, + 0x6a,0x01,0x55,0x01,0x25,0x01,0x07,0x01, + 0xdc,0x00,0xbc,0x00,0x96,0x00,0x78,0x00, + 0x58,0x00,0x41,0x00,0x29,0x00,0x19,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x19,0x00,0x29,0x00, + 0x41,0x00,0x58,0x00,0x79,0x00,0x95,0x00, + 0xbd,0x00,0xdb,0x00,0x08,0x01,0x24,0x01, + 0x56,0x01,0x68,0x01,0xaa,0x01,0x58,0x01, + 0xf9,0x00,0x10,0x01,0x0a,0x01,0x06,0x01, + 0x04,0x01,0xef,0x00,0xed,0x00,0xc8,0x00, + 0xc8,0x00,0x91,0x00,0x9b,0x00,0x48,0x00, + 0x74,0x00,0xc5,0xff,0xeb,0x7f,0x3c,0x00, + 0x8b,0xff,0xb7,0xff,0x62,0xff,0x6b,0xff, + 0x32,0xff,0x30,0xff,0x09,0xff,0x05,0xff, + 0xee,0xfe,0xe9,0xfe,0xe3,0xfe,0xdb,0xfe, + 0xf1,0xfe,0x88,0xfe,0x28,0xfe,0x6d,0xfe, + 0x7c,0xfe,0xb1,0xfe,0xcc,0xfe,0xfc,0xfe, + 0x1b,0xff,0x46,0xff,0x64,0xff,0x89,0xff, + 0xa4,0xff,0xc1,0xff,0xd5,0xff,0xec,0xff, + 0xf9,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x19,0x00,0x29,0x00,0x41,0x00,0x58,0x00, + 0x79,0x00,0x95,0x00,0xbd,0x00,0xdb,0x00, + 0x08,0x01,0x24,0x01,0x56,0x01,0x68,0x01, + 0xaa,0x01,0x58,0x01,0xf9,0x00,0x10,0x01, + 0x0a,0x01,0x06,0x01,0x04,0x01,0xef,0x00, + 0xed,0x00,0xc8,0x00,0xc8,0x00,0x91,0x00, + 0x9b,0x00,0x48,0x00,0x74,0x00,0xc5,0xff, + 0xeb,0x7f,0x3c,0x00,0x8b,0xff,0xb7,0xff, + 0x62,0xff,0x6b,0xff,0x32,0xff,0x30,0xff, + 0x09,0xff,0x05,0xff,0xee,0xfe,0xe9,0xfe, + 0xe3,0xfe,0xdb,0xfe,0xf1,0xfe,0x88,0xfe, + 0x28,0xfe,0x6d,0xfe,0x7c,0xfe,0xb1,0xfe, + 0xcc,0xfe,0xfc,0xfe,0x1b,0xff,0x46,0xff, + 0x64,0xff,0x89,0xff,0xa4,0xff,0xc1,0xff, + 0xd5,0xff,0xec,0xff,0xf9,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xf9,0xff, + 0xec,0xff,0xd5,0xff,0xc1,0xff,0xa4,0xff, + 0x89,0xff,0x65,0xff,0x45,0xff,0x1c,0xff, + 0xfb,0xfe,0xcd,0xfe,0xaf,0xfe,0x7e,0xfe, + 0x6a,0xfe,0x2b,0xfe,0x84,0xfe,0xf6,0xfe, + 0xd6,0xfe,0xe9,0xfe,0xe3,0xfe,0xf6,0xfe, + 0xfc,0xfe,0x14,0xff,0x24,0xff,0x40,0xff, + 0x59,0xff,0x79,0xff,0x98,0xff,0xba,0xff, + 0xdd,0xff,0xec,0x7f,0x23,0x00,0x45,0x00, + 0x67,0x00,0x84,0x00,0xa3,0x00,0xba,0x00, + 0xd4,0x00,0xe3,0x00,0xf8,0x00,0xfc,0x00, + 0x0c,0x01,0x05,0x01,0x14,0x01,0xf5,0x00, + 0x5a,0x01,0xa7,0x01,0x6a,0x01,0x55,0x01, + 0x25,0x01,0x07,0x01,0xdc,0x00,0xbc,0x00, + 0x96,0x00,0x78,0x00,0x58,0x00,0x41,0x00, + 0x29,0x00,0x19,0x00,0x00,0x00,0x01,0x00, + 0x00,0x00,0x01,0x00,0x01,0x00,0x01,0x00, + 0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x66,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x9a,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line2_pass.conf b/tools/topology/topology2/include/components/tdfb/line2_pass.conf new file mode 100644 index 000000000000..4e83bb50c401 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line2_pass.conf @@ -0,0 +1,14 @@ +# Exported with script example_pass_config.m 23-Oct-2023 +# cd tools/tune/tdfb; octave --no-window-system example_pass_config.m +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x28,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x28,0x00,0x00,0x00,0x02,0x00,0x02,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x01,0x00,0x02,0x00,0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_16khz.conf b/tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_16khz.conf new file mode 100644 index 000000000000..0912b10d7410 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_16khz.conf @@ -0,0 +1,698 @@ +# Created with script example_line_array.m 23-Oct-2023 +# cd tools/tune/tdfb; octave --no-window-system example_line_array.m +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x84,0x15,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x84,0x15,0x00,0x00,0x04,0x00,0x02,0x00, + 0x01,0x00,0x04,0x00,0x0d,0x00,0x01,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xf6,0xff,0xee,0xff,0xc8,0xff, + 0xae,0xff,0x51,0xff,0x2a,0xff,0xf8,0xfe, + 0x36,0x00,0xa3,0x00,0x23,0x02,0x96,0x03, + 0xf7,0x07,0xde,0x0c,0xaa,0x14,0xbf,0x14, + 0x1f,0x1a,0x77,0x13,0x9a,0x56,0x9e,0x19, + 0x26,0x0e,0x39,0x0a,0xbf,0x00,0xc2,0x00, + 0x04,0xfd,0xa4,0xfd,0x96,0xfc,0x7b,0xfd, + 0x20,0xfd,0xa5,0xfe,0xda,0xfe,0x14,0xff, + 0xf5,0xfe,0x21,0xff,0x42,0xff,0xa1,0xff, + 0xca,0xff,0xf2,0xff,0x00,0x00,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00, + 0x7b,0x00,0x7e,0x01,0x62,0x02,0x8b,0x04, + 0x14,0x05,0xda,0x07,0x03,0x06,0xd5,0x08, + 0x11,0x01,0x3d,0xff,0xfd,0xee,0x34,0xeb, + 0x39,0xd0,0xd4,0xce,0x02,0xb6,0x00,0xca, + 0x60,0xa5,0x39,0x2e,0xe2,0x1a,0x1f,0xd6, + 0x64,0x0d,0x5f,0x03,0x8a,0x1a,0x90,0x0f, + 0x6b,0x15,0xed,0x07,0x7c,0x07,0x85,0xfd, + 0xaa,0xfe,0x90,0xfb,0x53,0xfd,0x99,0xfc, + 0x99,0xfe,0xe4,0xfe,0xc4,0xff,0xdb,0xff, + 0x03,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x02,0x00,0xdf,0xff, + 0xc2,0xff,0xf2,0xfe,0x93,0xfe,0xb1,0xfc, + 0x28,0xfd,0xa1,0xfb,0x59,0xfe,0x74,0xfd, + 0xad,0x06,0xf6,0x07,0x85,0x14,0x4e,0x10, + 0xfa,0x19,0x89,0x05,0xb5,0x0c,0x60,0xdb, + 0x14,0x0e,0xea,0x39,0x3c,0xa8,0xb9,0xc8, + 0xb7,0xb6,0x99,0xcd,0x98,0xcf,0xcd,0xe9, + 0x96,0xee,0x4e,0xfe,0xcb,0x00,0x66,0x08, + 0x10,0x06,0xa6,0x07,0x25,0x05,0x7d,0x04, + 0x6d,0x02,0x7d,0x01,0x7e,0x00,0x23,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf1,0xff,0xcb,0xff,0x9c,0xff, + 0x4b,0xff,0x0d,0xff,0x04,0xff,0xf1,0xfe, + 0xff,0xfe,0x7f,0xfe,0x6c,0xfd,0x1b,0xfd, + 0x02,0xfd,0x0b,0xfd,0x9a,0xfd,0xa8,0xff, + 0xba,0x01,0xc7,0x07,0x60,0x10,0xc7,0x13, + 0x0d,0x57,0x2d,0x18,0xb7,0x17,0x63,0x16, + 0xc2,0x13,0x37,0x0e,0xa6,0x07,0x45,0x04, + 0xdc,0x01,0xf9,0x00,0x13,0x00,0x32,0xff, + 0x0a,0xff,0x64,0xff,0x9e,0xff,0xd0,0xff, + 0xe9,0xff,0xf7,0xff,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf2,0xff,0xf0,0xff,0xb8,0xff, + 0xbd,0xff,0x2c,0xff,0x55,0xff,0x90,0xfe, + 0x55,0x00,0x27,0x00,0x76,0x02,0xd5,0x02, + 0x7e,0x08,0xd7,0x0a,0x35,0x16,0xbe,0x12, + 0x9d,0x1d,0x2b,0x0e,0x25,0x53,0xda,0x24, + 0x9f,0x0a,0xb3,0x0e,0x9d,0xff,0xdb,0x02, + 0xc0,0xfc,0xe5,0xfe,0x55,0xfc,0x51,0xfe, + 0xdc,0xfc,0x07,0xff,0xae,0xfe,0x48,0xff, + 0xda,0xfe,0x37,0xff,0x36,0xff,0xa7,0xff, + 0xc7,0xff,0xf2,0xff,0x00,0x00,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x23,0x00, + 0x79,0x00,0x7a,0x01,0x58,0x02,0x92,0x04, + 0x07,0x05,0xfa,0x07,0xed,0x05,0xf0,0x08, + 0x7e,0x01,0xf9,0xff,0x8d,0xef,0x1c,0xec, + 0x1d,0xd1,0xb1,0xcf,0xe9,0xb5,0xf8,0xc9, + 0x0f,0xa4,0x25,0x1f,0xf8,0x27,0x01,0xd1, + 0x00,0x0c,0x56,0x00,0x66,0x19,0x50,0x0e, + 0x1b,0x15,0x3e,0x07,0xc4,0x07,0x65,0xfd, + 0xf3,0xfe,0x9d,0xfb,0x87,0xfd,0xa8,0xfc, + 0xb6,0xfe,0xec,0xfe,0xcd,0xff,0xdd,0xff, + 0x04,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x03,0x00,0xe6,0xff, + 0xc9,0xff,0x0d,0xff,0xac,0xfe,0xdf,0xfc, + 0x24,0xfd,0xb8,0xfb,0x36,0xfe,0x2e,0xfd, + 0xc1,0x05,0x49,0x07,0xd6,0x12,0x09,0x10, + 0x49,0x18,0x8d,0x05,0xb7,0x0a,0xbd,0xdd, + 0x65,0x06,0x02,0x3f,0x41,0xaa,0x41,0xc7, + 0x3a,0xb7,0xca,0xcc,0x43,0xcf,0xa9,0xe8, + 0x5a,0xee,0xab,0xfd,0xbb,0x00,0xf5,0x07, + 0xfe,0x05,0x7f,0x07,0x2f,0x05,0x73,0x04, + 0x75,0x02,0x7b,0x01,0x81,0x00,0x23,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf1,0xff,0xca,0xff,0x9a,0xff, + 0x4d,0xff,0x06,0xff,0x01,0xff,0xf1,0xfe, + 0x08,0xff,0xac,0xfe,0x9e,0xfd,0x59,0xfd, + 0x6a,0xfd,0x64,0xfd,0x2b,0xfe,0x2d,0x00, + 0xff,0x01,0x54,0x08,0xb7,0x10,0x03,0x14, + 0x51,0x57,0x79,0x18,0x10,0x18,0x9d,0x16, + 0x22,0x14,0x47,0x0e,0xa3,0x07,0x89,0x04, + 0xd2,0x01,0xf0,0x00,0x0c,0x00,0x18,0xff, + 0x05,0xff,0x5b,0xff,0x96,0xff,0xca,0xff, + 0xe4,0xff,0xf5,0xff,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfb,0xff,0xf7,0xff,0xc6,0xff,0xd8,0xff, + 0x48,0xff,0x99,0xff,0x87,0xfe,0xe5,0xff, + 0x96,0xff,0x16,0x02,0x93,0x01,0xee,0x07, + 0xc2,0x06,0xad,0x14,0x06,0x11,0x69,0x1e, + 0x68,0x0d,0x21,0x38,0x8b,0x47,0xd3,0x05, + 0x43,0x17,0xf0,0x00,0x0e,0x06,0xf8,0xfd, + 0x70,0x01,0x54,0xfc,0xd7,0xff,0x8e,0xfc, + 0x6f,0xff,0x69,0xfe,0x6d,0xff,0x6d,0xfe, + 0x0a,0xff,0xbf,0xfe,0x70,0xff,0x7a,0xff, + 0xcc,0xff,0xee,0xff,0x00,0x00,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00, + 0x9f,0x00,0x4f,0x01,0xe0,0x02,0xaa,0x03, + 0xde,0x05,0x1c,0x05,0xb4,0x06,0xe1,0x02, + 0xde,0x00,0x5e,0xf4,0xcd,0xee,0xb7,0xd9, + 0x10,0xd3,0x28,0xbe,0x26,0xc7,0x1c,0xad, + 0x74,0xee,0x4d,0x46,0x5b,0xcd,0x47,0x01, + 0x78,0xfb,0x21,0x13,0x25,0x0d,0x12,0x14, + 0xea,0x06,0xf1,0x07,0xbc,0xfd,0xb2,0xfe, + 0x89,0xfb,0x18,0xfd,0x33,0xfc,0x64,0xfe, + 0xac,0xfe,0xba,0xff,0xcf,0xff,0x14,0x00, + 0x04,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x06,0x00,0xfc,0xff,0xe1,0xff, + 0x59,0xff,0xf3,0xfe,0x7e,0xfd,0x26,0xfd, + 0x13,0xfc,0xbf,0xfd,0xe5,0xfc,0xce,0x02, + 0xaa,0x05,0x61,0x0d,0x47,0x0f,0xac,0x12, + 0xf4,0x05,0xb0,0x03,0x76,0xe5,0xe9,0xf0, + 0x36,0x4a,0x18,0xb4,0xf4,0xc1,0x18,0xba, + 0x1b,0xca,0xa2,0xcf,0xda,0xe4,0x2b,0xee, + 0x68,0xfb,0xd6,0x00,0x6b,0x06,0xd9,0x05, + 0xe4,0x06,0x48,0x05,0x43,0x04,0x89,0x02, + 0x6c,0x01,0x89,0x00,0x22,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf1,0xff,0xc7,0xff,0x94,0xff,0x54,0xff, + 0xfa,0xfe,0xf1,0xfe,0xf4,0xfe,0x17,0xff, + 0x25,0xff,0x32,0xfe,0x13,0xfe,0x7b,0xfe, + 0x6f,0xfe,0xdc,0xff,0xa2,0x01,0xdb,0x02, + 0xe6,0x09,0x98,0x11,0xab,0x14,0xeb,0x57, + 0x34,0x19,0xeb,0x18,0x2c,0x17,0x15,0x15, + 0x6a,0x0e,0x9f,0x07,0x3a,0x05,0xe6,0x01, + 0xc9,0x00,0xf2,0xff,0xde,0xfe,0xfc,0xfe, + 0x42,0xff,0x82,0xff,0xb8,0xff,0xd7,0xff, + 0xf1,0xff,0xfd,0xff,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfd,0xff,0xe7,0xff,0xd7,0xff,0x86,0xff, + 0x95,0xff,0xfb,0xfe,0x4c,0xff,0x5e,0xfe, + 0xf6,0xff,0xc3,0xff,0x09,0x03,0x33,0x04, + 0x33,0x09,0x8c,0x0a,0x29,0x18,0x07,0x14, + 0x65,0x1f,0x72,0x0f,0x89,0x53,0xbe,0x27, + 0xc4,0x0b,0xc3,0x12,0x47,0x02,0xe8,0x05, + 0xfe,0x00,0xf7,0x01,0x8d,0xfe,0x34,0x00, + 0x50,0xfe,0x1c,0x00,0xd2,0xfe,0x4c,0xff, + 0xa7,0xfe,0x23,0xff,0x43,0xff,0x99,0xff, + 0xc1,0xff,0xf1,0xff,0x00,0x00,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x22,0x00, + 0x83,0x00,0x5d,0x01,0x4c,0x02,0x1b,0x04, + 0xd2,0x04,0x81,0x06,0xf0,0x04,0x53,0x05, + 0x96,0x00,0x40,0xfb,0xf1,0xed,0xa2,0xe4, + 0x0d,0xd1,0x7d,0xcc,0x87,0xba,0x42,0xc4, + 0x79,0xb1,0xa6,0x47,0x4c,0xf2,0x40,0xdf, + 0xb9,0xfd,0x32,0xfe,0xaf,0x0c,0xda,0x09, + 0x03,0x09,0xbb,0x01,0x1e,0x01,0x98,0xfc, + 0x31,0xfe,0x6e,0xfc,0xf6,0xfd,0x31,0xfe, + 0x8d,0xff,0xa5,0xff,0x1c,0x00,0x10,0x00, + 0x0c,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0a,0x00,0x1d,0x00,0x09,0x00, + 0xde,0xff,0x47,0xff,0xc0,0xfe,0x4b,0xfd, + 0x27,0xfd,0xaa,0xfc,0xe9,0xfd,0x22,0xfe, + 0x97,0x03,0x8c,0x04,0x1d,0x0d,0xd0,0x08, + 0x77,0x06,0xe0,0xf6,0xd2,0xf0,0x46,0xd5, + 0x21,0x4e,0x2b,0xcf,0x72,0xb7,0x62,0xc2, + 0xef,0xc4,0xd4,0xd3,0x9a,0xde,0xb7,0xee, + 0x75,0xf7,0x12,0x01,0xd7,0x03,0x88,0x05, + 0xa9,0x05,0x48,0x05,0xd3,0x03,0x92,0x02, + 0x4b,0x01,0x93,0x00,0x20,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf0,0xff,0xc5,0xff,0x8b,0xff,0x58,0xff, + 0x07,0xff,0xca,0xfe,0xf6,0xfe,0x23,0xff, + 0x9d,0xff,0x35,0xff,0x30,0xff,0xc2,0xff, + 0x3d,0x00,0x7f,0x02,0xc3,0x03,0x8e,0x04, + 0x48,0x0c,0xb8,0x12,0x9e,0x15,0x83,0x58, + 0xdb,0x19,0xcb,0x19,0xb3,0x17,0x15,0x16, + 0x64,0x0e,0xc9,0x07,0xd7,0x05,0x82,0x02, + 0x9f,0x00,0x91,0xff,0xd1,0xfe,0xee,0xfe, + 0x2b,0xff,0x6a,0xff,0x9b,0xff,0xc7,0xff, + 0xeb,0xff,0xfb,0xff,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf9,0xff,0xe2,0xff,0xbe,0xff, + 0x7f,0xff,0x5d,0xff,0x24,0xff,0x0e,0xff, + 0x0a,0xff,0x25,0xff,0xd5,0x00,0xb1,0x03, + 0xd1,0x05,0xc1,0x08,0x72,0x0d,0xb1,0x16, + 0x27,0x17,0x2a,0x1b,0x9d,0x17,0xbc,0x58, + 0x7f,0x19,0x70,0x12,0x59,0x10,0xf3,0x06, + 0x8b,0x06,0xff,0x04,0xdb,0x02,0xb1,0x00, + 0x60,0x00,0x32,0x00,0xb5,0xff,0x12,0xff, + 0xcf,0xfe,0xb0,0xfe,0x23,0xff,0x42,0xff, + 0x89,0xff,0xc3,0xff,0xf0,0xff,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00, + 0x71,0x00,0x43,0x01,0xe3,0x01,0x9e,0x03, + 0x37,0x04,0x4d,0x06,0xb3,0x04,0xc2,0x05, + 0xad,0x00,0x1c,0x00,0x6b,0xf2,0x9e,0xec, + 0x28,0xd8,0xbf,0xd7,0x38,0xbe,0xda,0xcb, + 0xf3,0xac,0x44,0xf6,0x3f,0x3f,0xe1,0xc4, + 0xe5,0xf5,0xf2,0xe9,0x1f,0x03,0x20,0xfd, + 0xdb,0x06,0xe6,0xfc,0x2e,0x00,0x00,0xfc, + 0xcb,0xff,0xe9,0xfc,0x53,0xff,0xbd,0xfe, + 0x32,0x00,0xe2,0xff,0x58,0x00,0x1c,0x00, + 0x11,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x0e,0x00,0x44,0x00,0x38,0x00, + 0x98,0x00,0xbd,0xff,0x41,0x00,0x2d,0xfe, + 0x20,0xff,0xf0,0xfb,0xb2,0xff,0xfd,0xfa, + 0x2d,0x00,0xd2,0xfb,0x73,0x07,0x44,0xfc, + 0xe2,0x03,0x20,0xe8,0xc2,0xf6,0x94,0xc2, + 0xfd,0x38,0x7f,0xff,0x9c,0xac,0x3e,0xcf, + 0x93,0xc0,0x15,0xdb,0xe7,0xda,0xd7,0xee, + 0xb7,0xf3,0x6c,0x00,0x9e,0x00,0x02,0x05, + 0xc3,0x03,0xed,0x04,0x0a,0x03,0x72,0x02, + 0x18,0x01,0x96,0x00,0x1d,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf0,0xff,0xc5,0xff,0x89,0xff,0x4b,0xff, + 0x24,0xff,0xc9,0xfe,0xca,0xfe,0x38,0xff, + 0xac,0xff,0x75,0x00,0x5b,0x00,0x02,0x01, + 0xab,0x02,0x69,0x05,0x5e,0x06,0x8a,0x07, + 0x58,0x0f,0xcc,0x13,0xb6,0x16,0xe9,0x58, + 0xf6,0x19,0xed,0x19,0xbe,0x17,0x0f,0x16, + 0x01,0x0e,0x49,0x08,0xed,0x05,0x61,0x03, + 0xed,0x00,0xed,0xfe,0x05,0xff,0xed,0xfe, + 0x20,0xff,0x4d,0xff,0x7d,0xff,0xb9,0xff, + 0xe2,0xff,0xf9,0xff,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf6,0xff,0xdb,0xff,0xad,0xff, + 0x7b,0xff,0x36,0xff,0x34,0xff,0x30,0xff, + 0x0d,0xff,0x6c,0xff,0x79,0x01,0x0a,0x04, + 0xeb,0x05,0x0a,0x09,0x41,0x0d,0x4b,0x14, + 0x41,0x17,0x51,0x18,0x8b,0x1a,0xea,0x58, + 0xd6,0x16,0x65,0x15,0x52,0x12,0xce,0x0b, + 0x02,0x09,0x71,0x07,0xdb,0x04,0x10,0x02, + 0x1e,0x01,0xae,0x00,0x80,0xff,0xdc,0xfe, + 0x93,0xfe,0xf8,0xfe,0x02,0xff,0x49,0xff, + 0x88,0xff,0xc8,0xff,0xf1,0xff,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00, + 0x64,0x00,0x1b,0x01,0x81,0x01,0xe5,0x02, + 0xcf,0x02,0x99,0x04,0x77,0x02,0xa0,0x03, + 0xd6,0xfc,0x19,0xfe,0x57,0xef,0x46,0xed, + 0xb4,0xdb,0xc7,0xdd,0x0e,0xc2,0xd6,0xd6, + 0x23,0xae,0x9f,0x35,0xfb,0x06,0xeb,0xc4, + 0x8d,0xed,0x32,0xe0,0x19,0xfa,0x68,0xf2, + 0xe1,0xfe,0x5f,0xf7,0xf6,0xfd,0xad,0xfc, + 0xab,0x00,0xb4,0xfe,0x29,0x01,0x2b,0x00, + 0x27,0x01,0x90,0x00,0xab,0x00,0x3e,0x00, + 0x18,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x17,0x00,0x3a,0x00,0xa2,0x00, + 0x81,0x00,0x0f,0x01,0x0a,0x00,0xfd,0x00, + 0x7d,0xfe,0x6e,0x00,0x61,0xfc,0x98,0xfd, + 0x0a,0xf7,0x7a,0xfe,0xff,0xf1,0xa2,0xf9, + 0x8a,0xdf,0x1d,0xed,0x7a,0xc4,0xb1,0x06, + 0x4f,0x35,0x0d,0xae,0xeb,0xd6,0x44,0xc2, + 0x54,0xde,0x30,0xdc,0xc4,0xed,0xf2,0xef, + 0x9e,0xfe,0x44,0xfd,0xff,0x03,0xc1,0x02, + 0xd1,0x04,0xf6,0x02,0xff,0x02,0x91,0x01, + 0x24,0x01,0x67,0x00,0x1f,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf1,0xff, + 0xca,0xff,0x8d,0xff,0x4f,0xff,0x12,0xff, + 0x06,0xff,0xb0,0xfe,0xf7,0xfe,0xb1,0xff, + 0xd0,0x00,0x64,0x01,0x39,0x02,0x34,0x05, + 0x8d,0x07,0x6d,0x09,0xf0,0x0b,0xd0,0x12, + 0x1c,0x15,0xd6,0x17,0xf9,0x58,0x9a,0x19, + 0xa6,0x18,0xcc,0x16,0x26,0x14,0xd2,0x0c, + 0xe3,0x08,0x8c,0x05,0xd9,0x03,0x32,0x01, + 0x48,0xff,0xe3,0xfe,0x1c,0xff,0x1c,0xff, + 0x2c,0xff,0x71,0xff,0xa9,0xff,0xd9,0xff, + 0xf6,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf4,0xff,0xd1,0xff,0x9c,0xff, + 0x5b,0xff,0x1d,0xff,0xee,0xfe,0xf0,0xfe, + 0xcf,0xfe,0x45,0xff,0x4e,0x00,0xbf,0x01, + 0xc5,0x03,0x4c,0x06,0x45,0x09,0x13,0x0c, + 0x42,0x11,0xe6,0x15,0x03,0x17,0x76,0x19, + 0xf4,0x58,0x21,0x18,0xba,0x16,0x96,0x14, + 0x31,0x10,0xd9,0x0a,0x61,0x08,0x57,0x05, + 0x25,0x03,0x3d,0x01,0x20,0x00,0x38,0xff, + 0xf9,0xfe,0x1a,0xff,0x32,0xff,0x61,0xff, + 0x9e,0xff,0xd1,0xff,0xf4,0xff,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00, + 0x5f,0x00,0xc9,0x00,0x49,0x01,0xc9,0x01, + 0x21,0x02,0x25,0x02,0x5c,0x02,0x84,0x01, + 0x5b,0xff,0x99,0xfc,0x69,0xf8,0x8a,0xf3, + 0x5d,0xed,0x0f,0xe8,0x58,0xdd,0x87,0xd4, + 0x89,0xd1,0x09,0xce,0xaa,0x4d,0xcf,0xce, + 0xfa,0xd2,0x85,0xd6,0xbf,0xdf,0x1d,0xea, + 0x54,0xef,0x33,0xf5,0xc3,0xf9,0x73,0xfd, + 0xc7,0xff,0x86,0x01,0x14,0x02,0xc7,0x01, + 0x9f,0x01,0x3b,0x01,0xc5,0x00,0x5e,0x00, + 0x19,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x18,0x00,0x5f,0x00,0xc9,0x00, + 0x49,0x01,0xc9,0x01,0x21,0x02,0x25,0x02, + 0x5c,0x02,0x84,0x01,0x5b,0xff,0x99,0xfc, + 0x69,0xf8,0x8a,0xf3,0x5d,0xed,0x0f,0xe8, + 0x58,0xdd,0x87,0xd4,0x89,0xd1,0x09,0xce, + 0xaa,0x4d,0xcf,0xce,0xfa,0xd2,0x85,0xd6, + 0xbf,0xdf,0x1d,0xea,0x54,0xef,0x33,0xf5, + 0xc3,0xf9,0x73,0xfd,0xc7,0xff,0x86,0x01, + 0x14,0x02,0xc7,0x01,0x9f,0x01,0x3b,0x01, + 0xc5,0x00,0x5e,0x00,0x19,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf4,0xff, + 0xd1,0xff,0x9c,0xff,0x5b,0xff,0x1d,0xff, + 0xee,0xfe,0xf0,0xfe,0xcf,0xfe,0x45,0xff, + 0x4e,0x00,0xbf,0x01,0xc5,0x03,0x4c,0x06, + 0x45,0x09,0x13,0x0c,0x42,0x11,0xe6,0x15, + 0x03,0x17,0x76,0x19,0xf4,0x58,0x21,0x18, + 0xba,0x16,0x96,0x14,0x31,0x10,0xd9,0x0a, + 0x61,0x08,0x57,0x05,0x25,0x03,0x3d,0x01, + 0x20,0x00,0x38,0xff,0xf9,0xfe,0x1a,0xff, + 0x32,0xff,0x61,0xff,0x9e,0xff,0xd1,0xff, + 0xf4,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xf1,0xff,0xca,0xff,0x8d,0xff, + 0x4f,0xff,0x12,0xff,0x06,0xff,0xb0,0xfe, + 0xf7,0xfe,0xb1,0xff,0xd0,0x00,0x64,0x01, + 0x39,0x02,0x34,0x05,0x8d,0x07,0x6d,0x09, + 0xf0,0x0b,0xd0,0x12,0x1c,0x15,0xd6,0x17, + 0xf9,0x58,0x9a,0x19,0xa6,0x18,0xcc,0x16, + 0x26,0x14,0xd2,0x0c,0xe3,0x08,0x8c,0x05, + 0xd9,0x03,0x32,0x01,0x48,0xff,0xe3,0xfe, + 0x1c,0xff,0x1c,0xff,0x2c,0xff,0x71,0xff, + 0xa9,0xff,0xd9,0xff,0xf6,0xff,0x00,0x00, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x17,0x00, + 0x3a,0x00,0xa2,0x00,0x81,0x00,0x0f,0x01, + 0x0a,0x00,0xfd,0x00,0x7d,0xfe,0x6e,0x00, + 0x61,0xfc,0x98,0xfd,0x0a,0xf7,0x7a,0xfe, + 0xff,0xf1,0xa2,0xf9,0x8a,0xdf,0x1d,0xed, + 0x7a,0xc4,0xb1,0x06,0x4f,0x35,0x0d,0xae, + 0xeb,0xd6,0x44,0xc2,0x54,0xde,0x30,0xdc, + 0xc4,0xed,0xf2,0xef,0x9e,0xfe,0x44,0xfd, + 0xff,0x03,0xc1,0x02,0xd1,0x04,0xf6,0x02, + 0xff,0x02,0x91,0x01,0x24,0x01,0x67,0x00, + 0x1f,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1e,0x00,0x64,0x00,0x1b,0x01, + 0x81,0x01,0xe5,0x02,0xcf,0x02,0x99,0x04, + 0x77,0x02,0xa0,0x03,0xd6,0xfc,0x19,0xfe, + 0x57,0xef,0x46,0xed,0xb4,0xdb,0xc7,0xdd, + 0x0e,0xc2,0xd6,0xd6,0x23,0xae,0x9f,0x35, + 0xfb,0x06,0xeb,0xc4,0x8d,0xed,0x32,0xe0, + 0x19,0xfa,0x68,0xf2,0xe1,0xfe,0x5f,0xf7, + 0xf6,0xfd,0xad,0xfc,0xab,0x00,0xb4,0xfe, + 0x29,0x01,0x2b,0x00,0x27,0x01,0x90,0x00, + 0xab,0x00,0x3e,0x00,0x18,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf6,0xff, + 0xdb,0xff,0xad,0xff,0x7b,0xff,0x36,0xff, + 0x34,0xff,0x30,0xff,0x0d,0xff,0x6c,0xff, + 0x79,0x01,0x0a,0x04,0xeb,0x05,0x0a,0x09, + 0x41,0x0d,0x4b,0x14,0x41,0x17,0x51,0x18, + 0x8b,0x1a,0xea,0x58,0xd6,0x16,0x65,0x15, + 0x52,0x12,0xce,0x0b,0x02,0x09,0x71,0x07, + 0xdb,0x04,0x10,0x02,0x1e,0x01,0xae,0x00, + 0x80,0xff,0xdc,0xfe,0x93,0xfe,0xf8,0xfe, + 0x02,0xff,0x49,0xff,0x88,0xff,0xc8,0xff, + 0xf1,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf0,0xff,0xc5,0xff, + 0x89,0xff,0x4b,0xff,0x24,0xff,0xc9,0xfe, + 0xca,0xfe,0x38,0xff,0xac,0xff,0x75,0x00, + 0x5b,0x00,0x02,0x01,0xab,0x02,0x69,0x05, + 0x5e,0x06,0x8a,0x07,0x58,0x0f,0xcc,0x13, + 0xb6,0x16,0xe9,0x58,0xf6,0x19,0xed,0x19, + 0xbe,0x17,0x0f,0x16,0x01,0x0e,0x49,0x08, + 0xed,0x05,0x61,0x03,0xed,0x00,0xed,0xfe, + 0x05,0xff,0xed,0xfe,0x20,0xff,0x4d,0xff, + 0x7d,0xff,0xb9,0xff,0xe2,0xff,0xf9,0xff, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x00, + 0x44,0x00,0x38,0x00,0x98,0x00,0xbd,0xff, + 0x41,0x00,0x2d,0xfe,0x20,0xff,0xf0,0xfb, + 0xb2,0xff,0xfd,0xfa,0x2d,0x00,0xd2,0xfb, + 0x73,0x07,0x44,0xfc,0xe2,0x03,0x20,0xe8, + 0xc2,0xf6,0x94,0xc2,0xfd,0x38,0x7f,0xff, + 0x9c,0xac,0x3e,0xcf,0x93,0xc0,0x15,0xdb, + 0xe7,0xda,0xd7,0xee,0xb7,0xf3,0x6c,0x00, + 0x9e,0x00,0x02,0x05,0xc3,0x03,0xed,0x04, + 0x0a,0x03,0x72,0x02,0x18,0x01,0x96,0x00, + 0x1d,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x20,0x00,0x71,0x00,0x43,0x01, + 0xe3,0x01,0x9e,0x03,0x37,0x04,0x4d,0x06, + 0xb3,0x04,0xc2,0x05,0xad,0x00,0x1c,0x00, + 0x6b,0xf2,0x9e,0xec,0x28,0xd8,0xbf,0xd7, + 0x38,0xbe,0xda,0xcb,0xf3,0xac,0x44,0xf6, + 0x3f,0x3f,0xe1,0xc4,0xe5,0xf5,0xf2,0xe9, + 0x1f,0x03,0x20,0xfd,0xdb,0x06,0xe6,0xfc, + 0x2e,0x00,0x00,0xfc,0xcb,0xff,0xe9,0xfc, + 0x53,0xff,0xbd,0xfe,0x32,0x00,0xe2,0xff, + 0x58,0x00,0x1c,0x00,0x11,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf9,0xff, + 0xe2,0xff,0xbe,0xff,0x7f,0xff,0x5d,0xff, + 0x24,0xff,0x0e,0xff,0x0a,0xff,0x25,0xff, + 0xd5,0x00,0xb1,0x03,0xd1,0x05,0xc1,0x08, + 0x72,0x0d,0xb1,0x16,0x27,0x17,0x2a,0x1b, + 0x9d,0x17,0xbc,0x58,0x7f,0x19,0x70,0x12, + 0x59,0x10,0xf3,0x06,0x8b,0x06,0xff,0x04, + 0xdb,0x02,0xb1,0x00,0x60,0x00,0x32,0x00, + 0xb5,0xff,0x12,0xff,0xcf,0xfe,0xb0,0xfe, + 0x23,0xff,0x42,0xff,0x89,0xff,0xc3,0xff, + 0xf0,0xff,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf0,0xff,0xc5,0xff, + 0x8b,0xff,0x58,0xff,0x07,0xff,0xca,0xfe, + 0xf6,0xfe,0x23,0xff,0x9d,0xff,0x35,0xff, + 0x30,0xff,0xc2,0xff,0x3d,0x00,0x7f,0x02, + 0xc3,0x03,0x8e,0x04,0x48,0x0c,0xb8,0x12, + 0x9e,0x15,0x83,0x58,0xdb,0x19,0xcb,0x19, + 0xb3,0x17,0x15,0x16,0x64,0x0e,0xc9,0x07, + 0xd7,0x05,0x82,0x02,0x9f,0x00,0x91,0xff, + 0xd1,0xfe,0xee,0xfe,0x2b,0xff,0x6a,0xff, + 0x9b,0xff,0xc7,0xff,0xeb,0xff,0xfb,0xff, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00, + 0x1d,0x00,0x09,0x00,0xde,0xff,0x47,0xff, + 0xc0,0xfe,0x4b,0xfd,0x27,0xfd,0xaa,0xfc, + 0xe9,0xfd,0x22,0xfe,0x97,0x03,0x8c,0x04, + 0x1d,0x0d,0xd0,0x08,0x77,0x06,0xe0,0xf6, + 0xd2,0xf0,0x46,0xd5,0x21,0x4e,0x2b,0xcf, + 0x72,0xb7,0x62,0xc2,0xef,0xc4,0xd4,0xd3, + 0x9a,0xde,0xb7,0xee,0x75,0xf7,0x12,0x01, + 0xd7,0x03,0x88,0x05,0xa9,0x05,0x48,0x05, + 0xd3,0x03,0x92,0x02,0x4b,0x01,0x93,0x00, + 0x20,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x22,0x00,0x83,0x00,0x5d,0x01, + 0x4c,0x02,0x1b,0x04,0xd2,0x04,0x81,0x06, + 0xf0,0x04,0x53,0x05,0x96,0x00,0x40,0xfb, + 0xf1,0xed,0xa2,0xe4,0x0d,0xd1,0x7d,0xcc, + 0x87,0xba,0x42,0xc4,0x79,0xb1,0xa6,0x47, + 0x4c,0xf2,0x40,0xdf,0xb9,0xfd,0x32,0xfe, + 0xaf,0x0c,0xda,0x09,0x03,0x09,0xbb,0x01, + 0x1e,0x01,0x98,0xfc,0x31,0xfe,0x6e,0xfc, + 0xf6,0xfd,0x31,0xfe,0x8d,0xff,0xa5,0xff, + 0x1c,0x00,0x10,0x00,0x0c,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfd,0xff,0xe7,0xff, + 0xd7,0xff,0x86,0xff,0x95,0xff,0xfb,0xfe, + 0x4c,0xff,0x5e,0xfe,0xf6,0xff,0xc3,0xff, + 0x09,0x03,0x33,0x04,0x33,0x09,0x8c,0x0a, + 0x29,0x18,0x07,0x14,0x65,0x1f,0x72,0x0f, + 0x89,0x53,0xbe,0x27,0xc4,0x0b,0xc3,0x12, + 0x47,0x02,0xe8,0x05,0xfe,0x00,0xf7,0x01, + 0x8d,0xfe,0x34,0x00,0x50,0xfe,0x1c,0x00, + 0xd2,0xfe,0x4c,0xff,0xa7,0xfe,0x23,0xff, + 0x43,0xff,0x99,0xff,0xc1,0xff,0xf1,0xff, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf1,0xff,0xc7,0xff, + 0x94,0xff,0x54,0xff,0xfa,0xfe,0xf1,0xfe, + 0xf4,0xfe,0x17,0xff,0x25,0xff,0x32,0xfe, + 0x13,0xfe,0x7b,0xfe,0x6f,0xfe,0xdc,0xff, + 0xa2,0x01,0xdb,0x02,0xe6,0x09,0x98,0x11, + 0xab,0x14,0xeb,0x57,0x34,0x19,0xeb,0x18, + 0x2c,0x17,0x15,0x15,0x6a,0x0e,0x9f,0x07, + 0x3a,0x05,0xe6,0x01,0xc9,0x00,0xf2,0xff, + 0xde,0xfe,0xfc,0xfe,0x42,0xff,0x82,0xff, + 0xb8,0xff,0xd7,0xff,0xf1,0xff,0xfd,0xff, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00, + 0xfc,0xff,0xe1,0xff,0x59,0xff,0xf3,0xfe, + 0x7e,0xfd,0x26,0xfd,0x13,0xfc,0xbf,0xfd, + 0xe5,0xfc,0xce,0x02,0xaa,0x05,0x61,0x0d, + 0x47,0x0f,0xac,0x12,0xf4,0x05,0xb0,0x03, + 0x76,0xe5,0xe9,0xf0,0x36,0x4a,0x18,0xb4, + 0xf4,0xc1,0x18,0xba,0x1b,0xca,0xa2,0xcf, + 0xda,0xe4,0x2b,0xee,0x68,0xfb,0xd6,0x00, + 0x6b,0x06,0xd9,0x05,0xe4,0x06,0x48,0x05, + 0x43,0x04,0x89,0x02,0x6c,0x01,0x89,0x00, + 0x22,0x00,0x00,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1f,0x00,0x9f,0x00,0x4f,0x01, + 0xe0,0x02,0xaa,0x03,0xde,0x05,0x1c,0x05, + 0xb4,0x06,0xe1,0x02,0xde,0x00,0x5e,0xf4, + 0xcd,0xee,0xb7,0xd9,0x10,0xd3,0x28,0xbe, + 0x26,0xc7,0x1c,0xad,0x74,0xee,0x4d,0x46, + 0x5b,0xcd,0x47,0x01,0x78,0xfb,0x21,0x13, + 0x25,0x0d,0x12,0x14,0xea,0x06,0xf1,0x07, + 0xbc,0xfd,0xb2,0xfe,0x89,0xfb,0x18,0xfd, + 0x33,0xfc,0x64,0xfe,0xac,0xfe,0xba,0xff, + 0xcf,0xff,0x14,0x00,0x04,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfb,0xff,0xf7,0xff, + 0xc6,0xff,0xd8,0xff,0x48,0xff,0x99,0xff, + 0x87,0xfe,0xe5,0xff,0x96,0xff,0x16,0x02, + 0x93,0x01,0xee,0x07,0xc2,0x06,0xad,0x14, + 0x06,0x11,0x69,0x1e,0x68,0x0d,0x21,0x38, + 0x8b,0x47,0xd3,0x05,0x43,0x17,0xf0,0x00, + 0x0e,0x06,0xf8,0xfd,0x70,0x01,0x54,0xfc, + 0xd7,0xff,0x8e,0xfc,0x6f,0xff,0x69,0xfe, + 0x6d,0xff,0x6d,0xfe,0x0a,0xff,0xbf,0xfe, + 0x70,0xff,0x7a,0xff,0xcc,0xff,0xee,0xff, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf1,0xff, + 0xca,0xff,0x9a,0xff,0x4d,0xff,0x06,0xff, + 0x01,0xff,0xf1,0xfe,0x08,0xff,0xac,0xfe, + 0x9e,0xfd,0x59,0xfd,0x6a,0xfd,0x64,0xfd, + 0x2b,0xfe,0x2d,0x00,0xff,0x01,0x54,0x08, + 0xb7,0x10,0x03,0x14,0x51,0x57,0x79,0x18, + 0x10,0x18,0x9d,0x16,0x22,0x14,0x47,0x0e, + 0xa3,0x07,0x89,0x04,0xd2,0x01,0xf0,0x00, + 0x0c,0x00,0x18,0xff,0x05,0xff,0x5b,0xff, + 0x96,0xff,0xca,0xff,0xe4,0xff,0xf5,0xff, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x03,0x00,0xe6,0xff,0xc9,0xff,0x0d,0xff, + 0xac,0xfe,0xdf,0xfc,0x24,0xfd,0xb8,0xfb, + 0x36,0xfe,0x2e,0xfd,0xc1,0x05,0x49,0x07, + 0xd6,0x12,0x09,0x10,0x49,0x18,0x8d,0x05, + 0xb7,0x0a,0xbd,0xdd,0x65,0x06,0x02,0x3f, + 0x41,0xaa,0x41,0xc7,0x3a,0xb7,0xca,0xcc, + 0x43,0xcf,0xa9,0xe8,0x5a,0xee,0xab,0xfd, + 0xbb,0x00,0xf5,0x07,0xfe,0x05,0x7f,0x07, + 0x2f,0x05,0x73,0x04,0x75,0x02,0x7b,0x01, + 0x81,0x00,0x23,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x23,0x00,0x79,0x00,0x7a,0x01, + 0x58,0x02,0x92,0x04,0x07,0x05,0xfa,0x07, + 0xed,0x05,0xf0,0x08,0x7e,0x01,0xf9,0xff, + 0x8d,0xef,0x1c,0xec,0x1d,0xd1,0xb1,0xcf, + 0xe9,0xb5,0xf8,0xc9,0x0f,0xa4,0x25,0x1f, + 0xf8,0x27,0x01,0xd1,0x00,0x0c,0x56,0x00, + 0x66,0x19,0x50,0x0e,0x1b,0x15,0x3e,0x07, + 0xc4,0x07,0x65,0xfd,0xf3,0xfe,0x9d,0xfb, + 0x87,0xfd,0xa8,0xfc,0xb6,0xfe,0xec,0xfe, + 0xcd,0xff,0xdd,0xff,0x04,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf2,0xff, + 0xf0,0xff,0xb8,0xff,0xbd,0xff,0x2c,0xff, + 0x55,0xff,0x90,0xfe,0x55,0x00,0x27,0x00, + 0x76,0x02,0xd5,0x02,0x7e,0x08,0xd7,0x0a, + 0x35,0x16,0xbe,0x12,0x9d,0x1d,0x2b,0x0e, + 0x25,0x53,0xda,0x24,0x9f,0x0a,0xb3,0x0e, + 0x9d,0xff,0xdb,0x02,0xc0,0xfc,0xe5,0xfe, + 0x55,0xfc,0x51,0xfe,0xdc,0xfc,0x07,0xff, + 0xae,0xfe,0x48,0xff,0xda,0xfe,0x37,0xff, + 0x36,0xff,0xa7,0xff,0xc7,0xff,0xf2,0xff, + 0x00,0x00,0x00,0x00,0x28,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xf1,0xff, + 0xcb,0xff,0x9c,0xff,0x4b,0xff,0x0d,0xff, + 0x04,0xff,0xf1,0xfe,0xff,0xfe,0x7f,0xfe, + 0x6c,0xfd,0x1b,0xfd,0x02,0xfd,0x0b,0xfd, + 0x9a,0xfd,0xa8,0xff,0xba,0x01,0xc7,0x07, + 0x60,0x10,0xc7,0x13,0x0d,0x57,0x2d,0x18, + 0xb7,0x17,0x63,0x16,0xc2,0x13,0x37,0x0e, + 0xa6,0x07,0x45,0x04,0xdc,0x01,0xf9,0x00, + 0x13,0x00,0x32,0xff,0x0a,0xff,0x64,0xff, + 0x9e,0xff,0xd0,0xff,0xe9,0xff,0xf7,0xff, + 0x28,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x02,0x00,0xdf,0xff,0xc2,0xff,0xf2,0xfe, + 0x93,0xfe,0xb1,0xfc,0x28,0xfd,0xa1,0xfb, + 0x59,0xfe,0x74,0xfd,0xad,0x06,0xf6,0x07, + 0x85,0x14,0x4e,0x10,0xfa,0x19,0x89,0x05, + 0xb5,0x0c,0x60,0xdb,0x14,0x0e,0xea,0x39, + 0x3c,0xa8,0xb9,0xc8,0xb7,0xb6,0x99,0xcd, + 0x98,0xcf,0xcd,0xe9,0x96,0xee,0x4e,0xfe, + 0xcb,0x00,0x66,0x08,0x10,0x06,0xa6,0x07, + 0x25,0x05,0x7d,0x04,0x6d,0x02,0x7d,0x01, + 0x7e,0x00,0x23,0x00,0x28,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x23,0x00,0x7b,0x00,0x7e,0x01, + 0x62,0x02,0x8b,0x04,0x14,0x05,0xda,0x07, + 0x03,0x06,0xd5,0x08,0x11,0x01,0x3d,0xff, + 0xfd,0xee,0x34,0xeb,0x39,0xd0,0xd4,0xce, + 0x02,0xb6,0x00,0xca,0x60,0xa5,0x39,0x2e, + 0xe2,0x1a,0x1f,0xd6,0x64,0x0d,0x5f,0x03, + 0x8a,0x1a,0x90,0x0f,0x6b,0x15,0xed,0x07, + 0x7c,0x07,0x85,0xfd,0xaa,0xfe,0x90,0xfb, + 0x53,0xfd,0x99,0xfc,0x99,0xfe,0xe4,0xfe, + 0xc4,0xff,0xdb,0xff,0x03,0x00,0x00,0x00, + 0x28,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xf6,0xff, + 0xee,0xff,0xc8,0xff,0xae,0xff,0x51,0xff, + 0x2a,0xff,0xf8,0xfe,0x36,0x00,0xa3,0x00, + 0x23,0x02,0x96,0x03,0xf7,0x07,0xde,0x0c, + 0xaa,0x14,0xbf,0x14,0x1f,0x1a,0x77,0x13, + 0x9a,0x56,0x9e,0x19,0x26,0x0e,0x39,0x0a, + 0xbf,0x00,0xc2,0x00,0x04,0xfd,0xa4,0xfd, + 0x96,0xfc,0x7b,0xfd,0x20,0xfd,0xa5,0xfe, + 0xda,0xfe,0x14,0xff,0xf5,0xfe,0x21,0xff, + 0x42,0xff,0xa1,0xff,0xca,0xff,0xf2,0xff, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x03,0x00,0x03,0x00, + 0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x02,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0xb5,0xff,0x00,0x00, + 0x04,0x00,0x00,0x00,0xc4,0xff,0x00,0x00, + 0x08,0x00,0x00,0x00,0xd3,0xff,0x00,0x00, + 0x0c,0x00,0x00,0x00,0xe2,0xff,0x00,0x00, + 0x10,0x00,0x00,0x00,0xf1,0xff,0x00,0x00, + 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, + 0x1c,0x00,0x00,0x00,0x1e,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x2d,0x00,0x00,0x00, + 0x24,0x00,0x00,0x00,0x3c,0x00,0x00,0x00, + 0x28,0x00,0x00,0x00,0x4b,0x00,0x00,0x00, + 0x2c,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x30,0x00,0x00,0x00,0x00,0x00,0xac,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xc7,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_48khz.conf b/tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_48khz.conf new file mode 100644 index 000000000000..fb13f144c246 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line4_28mm_azm90_90_13_48khz.conf @@ -0,0 +1,1218 @@ +# Created with script example_line_array.m 23-Oct-2023 +# cd tools/tune/tdfb; octave --no-window-system example_line_array.m +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0xc4,0x25,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xc4,0x25,0x00,0x00,0x04,0x00,0x02,0x00, + 0x01,0x00,0x04,0x00,0x0d,0x00,0x01,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfa,0xff,0xeb,0xff,0x00,0x00,0xf1,0xff, + 0x0e,0x00,0xf3,0xff,0x28,0x00,0x01,0x00, + 0x5b,0x00,0x15,0x00,0x71,0x00,0x38,0x00, + 0xe2,0x00,0x92,0x00,0x7d,0x01,0x0f,0x01, + 0x4c,0x02,0x99,0x01,0x60,0x03,0x7d,0x03, + 0x28,0x05,0x5b,0x04,0x7b,0x06,0x35,0x05, + 0xc9,0x07,0xe6,0x05,0xba,0x08,0x90,0x05, + 0xca,0x09,0x4c,0x05,0x3e,0x0b,0xc9,0x03, + 0x4b,0x0e,0x9a,0xfc,0x99,0x41,0x38,0x1a, + 0x11,0xff,0xca,0x0b,0x8f,0x02,0xa4,0x08, + 0xef,0x02,0xaf,0x06,0x93,0x02,0xb1,0x03, + 0x32,0x00,0x3b,0x02,0xba,0xff,0x40,0x01, + 0x55,0xff,0x84,0x00,0x20,0xff,0x44,0x00, + 0xed,0xfe,0xd5,0xff,0xfc,0xfe,0xb7,0xff, + 0x1d,0xff,0xb4,0xff,0x49,0xff,0xbc,0xff, + 0x61,0xff,0xbc,0xff,0x8b,0xff,0xce,0xff, + 0xaf,0xff,0xde,0xff,0xcc,0xff,0xf4,0xff, + 0xed,0xff,0xfb,0xff,0xf7,0xff,0xfe,0xff, + 0xfe,0xff,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0x0c,0x00, + 0x1e,0x00,0x2b,0x00,0x49,0x00,0x4d,0x00, + 0x84,0x00,0x7d,0x00,0xa0,0x00,0x68,0x00, + 0x7e,0x00,0x02,0x00,0x01,0x00,0x3d,0xff, + 0x35,0xff,0xf0,0xfd,0xc3,0xfd,0x0e,0xfc, + 0xd6,0xfb,0xac,0xf9,0x84,0xf9,0xda,0xf6, + 0xb5,0xf5,0x26,0xf2,0x9e,0xf2,0x0f,0xef, + 0x27,0xf0,0x47,0xec,0x54,0xee,0x14,0xea, + 0xae,0xec,0x49,0xe7,0x28,0xed,0xba,0xe6, + 0xd6,0xef,0xdc,0xe5,0x78,0xf6,0x8b,0xdd, + 0xc8,0x6a,0x09,0x0a,0x49,0xe9,0x0e,0xfd, + 0x03,0xf3,0x0d,0xfe,0xbb,0xf8,0x78,0x00, + 0x22,0xfd,0xc9,0x03,0x52,0x01,0x6c,0x05, + 0x50,0x03,0x47,0x06,0x6a,0x04,0x67,0x06, + 0xdb,0x04,0x62,0x06,0x2a,0x04,0x08,0x05, + 0x58,0x03,0xc7,0x03,0x56,0x02,0x88,0x02, + 0x5d,0x01,0x72,0x01,0x7c,0x00,0x96,0x00, + 0x00,0x00,0x19,0x00,0xbe,0xff,0xdb,0xff, + 0xaf,0xff,0xe1,0xff,0xd3,0xff,0xe7,0xff, + 0xe6,0xff,0xf4,0xff,0xf9,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff, + 0xfa,0xff,0xf1,0xff,0xeb,0xff,0xde,0xff, + 0xdd,0xff,0xd1,0xff,0xc7,0xff,0xb5,0xff, + 0xde,0xff,0xdf,0xff,0x2e,0x00,0x42,0x00, + 0xbe,0x00,0xf7,0x00,0xbd,0x01,0xee,0x01, + 0xdb,0x02,0x06,0x03,0x0e,0x04,0x1b,0x04, + 0x20,0x05,0x24,0x05,0x4e,0x06,0x09,0x05, + 0x22,0x06,0x9f,0x04,0x87,0x05,0x5b,0x03, + 0x2d,0x04,0x37,0x01,0x33,0x01,0xb9,0xfc, + 0x14,0xfe,0x83,0xf8,0x17,0xfb,0x38,0xf3, + 0x8f,0xf9,0x0e,0xe9,0x5c,0x6f,0x48,0xfa, + 0x57,0xe8,0xdd,0xef,0xe5,0xe8,0xad,0xec, + 0xa4,0xe8,0x65,0xeb,0x28,0xe9,0xd5,0xec, + 0xce,0xeb,0x60,0xee,0x1a,0xee,0xa0,0xf0, + 0xec,0xf0,0x57,0xf3,0x19,0xf4,0x7b,0xf7, + 0x75,0xf8,0x41,0xfa,0xf9,0xfa,0x7c,0xfc, + 0x16,0xfd,0x40,0xfe,0xb1,0xfe,0x7c,0xff, + 0xa6,0xff,0x2a,0x00,0x40,0x00,0x82,0x00, + 0x7a,0x00,0x8d,0x00,0x73,0x00,0x59,0x00, + 0x3e,0x00,0x30,0x00,0x1b,0x00,0x0d,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xfc,0xff, + 0xfa,0xff,0xf7,0xff,0xf3,0xff,0xee,0xff, + 0xda,0xff,0xce,0xff,0xc2,0xff,0xb6,0xff, + 0xa7,0xff,0x9b,0xff,0x88,0xff,0x89,0xff, + 0x81,0xff,0x74,0xff,0x65,0xff,0x61,0xff, + 0x58,0xff,0x64,0xff,0x60,0xff,0xa2,0xff, + 0xc5,0xff,0xc0,0xff,0x10,0x00,0x48,0x00, + 0xa9,0x00,0xfc,0x00,0x72,0x01,0xde,0x01, + 0xe0,0x03,0xb5,0x04,0x20,0x05,0xb1,0x05, + 0x22,0x06,0xa0,0x06,0x02,0x07,0x66,0x07, + 0xa5,0x47,0xea,0x07,0x00,0x08,0x10,0x08, + 0xfe,0x07,0xe5,0x07,0xac,0x07,0x69,0x07, + 0x1f,0x07,0x3c,0x07,0xb5,0x06,0x47,0x06, + 0xab,0x05,0x37,0x05,0x8b,0x04,0x2c,0x04, + 0x28,0x03,0x19,0x02,0xef,0x01,0x7d,0x01, + 0x37,0x01,0xe6,0x00,0xac,0x00,0x76,0x00, + 0x4a,0x00,0x37,0x00,0x3d,0x00,0x21,0x00, + 0x14,0x00,0x07,0x00,0x01,0x00,0xfd,0xff, + 0xfb,0xff,0xf2,0xff,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf9,0xff,0xe0,0xff,0xf6,0xff,0xe0,0xff, + 0x1a,0x00,0xdd,0xff,0x47,0x00,0xef,0xff, + 0xa1,0x00,0x09,0x00,0xce,0x00,0x42,0x00, + 0xa1,0x01,0xe1,0x00,0xc6,0x02,0xc7,0x01, + 0x46,0x04,0xea,0x02,0x8f,0x05,0xb3,0x05, + 0x39,0x0a,0xb7,0x07,0xdd,0x0c,0x67,0x09, + 0x9a,0x0f,0xc5,0x0a,0x0b,0x12,0x1e,0x0a, + 0x38,0x14,0x88,0x09,0x88,0x17,0x72,0x06, + 0xd3,0x1d,0x16,0xfa,0x4b,0x48,0x5c,0x76, + 0xc2,0xf3,0x5f,0x1d,0x60,0x02,0x5a,0x14, + 0xb2,0x04,0x8c,0x0f,0xcd,0x04,0xf0,0x0a, + 0xde,0xff,0xf7,0x05,0x24,0xff,0xb8,0x03, + 0x68,0xfe,0x0f,0x02,0xe0,0xfd,0x86,0x01, + 0xf7,0xfd,0x16,0x00,0xda,0xfd,0xc5,0xff, + 0x13,0xfe,0xa7,0xff,0x69,0xfe,0xa9,0xff, + 0xb1,0xfe,0x8b,0xff,0xef,0xfe,0xa4,0xff, + 0x3b,0xff,0xbd,0xff,0x7a,0xff,0xe7,0xff, + 0xcc,0xff,0xf5,0xff,0xe4,0xff,0xfa,0xff, + 0xf5,0xff,0xfe,0xff,0xff,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0x0b,0x00, + 0x20,0x00,0x28,0x00,0x4f,0x00,0x45,0x00, + 0x86,0x00,0x73,0x00,0xbc,0x00,0x59,0x00, + 0xab,0x00,0xed,0xff,0x44,0x00,0x23,0xff, + 0x90,0xff,0xc4,0xfd,0x3c,0xfe,0xd0,0xfb, + 0x72,0xfc,0x54,0xf9,0x47,0xfa,0x59,0xf6, + 0xec,0xf6,0x90,0xf1,0xb4,0xf3,0x2e,0xee, + 0x75,0xf1,0x0b,0xeb,0xe5,0xef,0x60,0xe8, + 0xc9,0xee,0xbc,0xe4,0x9b,0xef,0x1b,0xe3, + 0x74,0xf3,0x3c,0xe0,0xfa,0xfc,0x68,0xd2, + 0xe5,0x4b,0x90,0x37,0x1a,0xda,0xbd,0x04, + 0x64,0xec,0xc7,0x01,0x5c,0xf4,0xba,0x02, + 0xc1,0xf9,0xd2,0x04,0xdc,0xfe,0x65,0x06, + 0x50,0x01,0x02,0x07,0xcc,0x02,0x00,0x07, + 0x7a,0x03,0x28,0x07,0x61,0x03,0x60,0x05, + 0xaf,0x02,0x16,0x04,0xd8,0x01,0xcc,0x02, + 0x01,0x01,0xb2,0x01,0x52,0x00,0xc0,0x00, + 0xdc,0xff,0x3a,0x00,0xa8,0xff,0xf2,0xff, + 0xa3,0xff,0xef,0xff,0xcd,0xff,0xee,0xff, + 0xe4,0xff,0xf6,0xff,0xf8,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff, + 0xfa,0xff,0xf0,0xff,0xed,0xff,0xd9,0xff, + 0xe2,0xff,0xc8,0xff,0xdb,0xff,0x9d,0xff, + 0xe9,0xff,0xb9,0xff,0x3a,0x00,0x07,0x00, + 0xcd,0x00,0xac,0x00,0xc9,0x01,0x78,0x01, + 0xea,0x02,0x71,0x02,0x29,0x04,0x66,0x03, + 0x4d,0x05,0x62,0x04,0xdf,0x06,0x02,0x04, + 0x9d,0x06,0x6d,0x03,0x3e,0x06,0xf4,0x01, + 0x36,0x05,0x86,0xff,0xae,0x02,0xa6,0xfa, + 0x4d,0x00,0xad,0xf5,0x8a,0xfe,0xa9,0xee, + 0x28,0x00,0x9a,0xdd,0x2d,0x67,0xc0,0x0f, + 0x74,0xdf,0x79,0xf5,0xe3,0xe4,0xd1,0xef, + 0x16,0xe6,0x84,0xed,0x35,0xe7,0x1c,0xee, + 0x83,0xea,0x71,0xef,0x0b,0xed,0x6a,0xf1, + 0x0e,0xf0,0xe9,0xf3,0x62,0xf3,0x98,0xf7, + 0xd2,0xf7,0x8d,0xfa,0x78,0xfa,0xb0,0xfc, + 0xb0,0xfc,0x65,0xfe,0x62,0xfe,0x9e,0xff, + 0x7b,0xff,0x3b,0x00,0x1e,0x00,0x8f,0x00, + 0x64,0x00,0x96,0x00,0x64,0x00,0x5c,0x00, + 0x38,0x00,0x31,0x00,0x19,0x00,0x0e,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xfc,0xff, + 0xfa,0xff,0xf7,0xff,0xf3,0xff,0xf1,0xff, + 0xdf,0xff,0xd0,0xff,0xc7,0xff,0xbb,0xff, + 0xaf,0xff,0xa2,0xff,0x96,0xff,0x9a,0xff, + 0x8f,0xff,0x87,0xff,0x78,0xff,0x78,0xff, + 0x6d,0xff,0x7f,0xff,0x75,0xff,0xdc,0xff, + 0xf0,0xff,0xd9,0xff,0x2a,0x00,0x64,0x00, + 0xbf,0x00,0x1a,0x01,0x80,0x01,0x16,0x02, + 0x22,0x04,0xc1,0x04,0x40,0x05,0xc2,0x05, + 0x3d,0x06,0xb2,0x06,0x1a,0x07,0x78,0x07, + 0xba,0x47,0x00,0x08,0x1b,0x08,0x2a,0x08, + 0x19,0x08,0x01,0x08,0xc7,0x07,0x89,0x07, + 0x2d,0x07,0x4b,0x07,0xd2,0x06,0x5d,0x06, + 0xc3,0x05,0x4d,0x05,0x9e,0x04,0x43,0x04, + 0x11,0x03,0x06,0x02,0x03,0x02,0x84,0x01, + 0x45,0x01,0xec,0x00,0xb7,0x00,0x79,0x00, + 0x53,0x00,0x2b,0x00,0x37,0x00,0x23,0x00, + 0x13,0x00,0x07,0x00,0x00,0x00,0xfd,0xff, + 0xf7,0xff,0xf1,0xff,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfb,0xff,0xf2,0xff,0xf6,0xff,0xea,0xff, + 0x05,0x00,0xf7,0xff,0x17,0x00,0x09,0x00, + 0x31,0x00,0x02,0x00,0x60,0x00,0x42,0x00, + 0xc4,0x00,0xa3,0x00,0x52,0x01,0x28,0x01, + 0x0d,0x02,0xad,0x01,0x71,0x02,0xb0,0x02, + 0xfb,0x04,0x62,0x04,0x34,0x06,0x62,0x05, + 0x76,0x07,0x45,0x06,0x69,0x08,0x2e,0x06, + 0x54,0x09,0x4d,0x06,0x73,0x0a,0x95,0x05, + 0x35,0x0c,0x5d,0x02,0x6c,0x15,0x80,0x44, + 0x5a,0xfe,0x3e,0x0c,0x70,0x03,0xf8,0x08, + 0xde,0x03,0x26,0x07,0x76,0x03,0xa8,0x05, + 0x7f,0x01,0x81,0x02,0x8e,0x00,0xa0,0x01, + 0x0a,0x00,0xea,0x00,0xb6,0xff,0xcf,0x00, + 0xe8,0xff,0x2c,0x00,0x68,0xff,0xf5,0xff, + 0x72,0xff,0xe5,0xff,0x86,0xff,0xdd,0xff, + 0x99,0xff,0xda,0xff,0xa1,0xff,0xd3,0xff, + 0xb9,0xff,0xdc,0xff,0xd4,0xff,0xf9,0xff, + 0xed,0xff,0xfb,0xff,0xf5,0xff,0xfc,0xff, + 0xfb,0xff,0xff,0xff,0xff,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0x0c,0x00, + 0x1d,0x00,0x28,0x00,0x46,0x00,0x46,0x00, + 0x6d,0x00,0x67,0x00,0xa5,0x00,0x56,0x00, + 0x84,0x00,0xee,0xff,0x24,0x00,0x28,0xff, + 0x36,0xff,0xc5,0xfd,0xca,0xfd,0xdb,0xfb, + 0xe7,0xfb,0x77,0xf9,0x8b,0xf9,0xe6,0xf5, + 0x5c,0xf6,0x05,0xf2,0xf8,0xf2,0xd4,0xee, + 0xa8,0xf0,0xef,0xeb,0xff,0xee,0x54,0xe9, + 0xfc,0xec,0x88,0xe6,0x9d,0xed,0x6b,0xe5, + 0xaa,0xf0,0xc3,0xe3,0x46,0xf8,0x0d,0xd9, + 0xe1,0x65,0x92,0x12,0xd1,0xe4,0x61,0xfe, + 0x55,0xf0,0x2e,0xfe,0x6f,0xf6,0x07,0x00, + 0xc5,0xfa,0x44,0x02,0x44,0xff,0x4b,0x04, + 0x58,0x01,0x1b,0x05,0x98,0x02,0x49,0x05, + 0x8a,0x03,0xef,0x05,0x52,0x03,0x19,0x04, + 0x4f,0x02,0x0a,0x03,0x80,0x01,0xfa,0x01, + 0xc9,0x00,0x1f,0x01,0x3f,0x00,0x71,0x00, + 0xc7,0xff,0x02,0x00,0xa3,0xff,0xd4,0xff, + 0xc0,0xff,0xe8,0xff,0xd0,0xff,0xea,0xff, + 0xe6,0xff,0xf6,0xff,0xf9,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, + 0xf8,0xff,0xf7,0xff,0xe4,0xff,0xee,0xff, + 0xcb,0xff,0xf2,0xff,0xb3,0xff,0xe2,0xff, + 0x98,0xff,0x1b,0x00,0xb6,0xff,0x99,0x00, + 0x24,0x00,0x51,0x01,0xa1,0x00,0x3b,0x02, + 0x48,0x01,0x5d,0x03,0xfe,0x01,0x80,0x04, + 0x01,0x03,0x5b,0x06,0xcb,0x02,0xcc,0x05, + 0xc7,0x01,0xbe,0x05,0x44,0x00,0x1b,0x05, + 0xcf,0xfd,0x17,0x03,0xf4,0xf8,0x82,0x01, + 0xd9,0xf3,0x94,0x00,0x46,0xec,0x46,0x03, + 0x43,0xdb,0x93,0x2f,0xf8,0x51,0x61,0xd2, + 0x4e,0xfc,0x4e,0xe0,0xf4,0xf2,0x2e,0xe3, + 0x33,0xef,0xfd,0xe4,0x4f,0xee,0x69,0xe8, + 0xf4,0xef,0x36,0xeb,0x79,0xf1,0x58,0xee, + 0xa5,0xf3,0xd2,0xf1,0x0b,0xf7,0xb8,0xf5, + 0x30,0xfa,0x48,0xf9,0x5e,0xfc,0xc0,0xfb, + 0x27,0xfe,0xb6,0xfd,0x7d,0xff,0x20,0xff, + 0x55,0x00,0xe5,0xff,0xa8,0x00,0x51,0x00, + 0xbc,0x00,0x5e,0x00,0x78,0x00,0x44,0x00, + 0x4c,0x00,0x27,0x00,0x1f,0x00,0x0b,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfe,0xff,0xfd,0xff,0xfa,0xff, + 0xf9,0xff,0xf6,0xff,0xf4,0xff,0xf1,0xff, + 0xdd,0xff,0xd0,0xff,0xcb,0xff,0xc0,0xff, + 0xbe,0xff,0xc0,0xff,0xbd,0xff,0xb7,0xff, + 0xb8,0xff,0xb3,0xff,0xb3,0xff,0xb4,0xff, + 0xbc,0xff,0xe7,0xff,0x60,0x00,0x58,0x00, + 0x3e,0x00,0x67,0x00,0xbf,0x00,0xf7,0x00, + 0x77,0x01,0x9f,0x01,0xee,0x02,0x9b,0x04, + 0xf1,0x04,0x94,0x05,0xfa,0x05,0x81,0x06, + 0xe7,0x06,0x56,0x07,0xa6,0x07,0xee,0x47, + 0x2e,0x08,0x5b,0x08,0x69,0x08,0x5e,0x08, + 0x45,0x08,0x0c,0x08,0xd1,0x07,0x64,0x07, + 0x59,0x07,0x27,0x07,0x90,0x06,0x0b,0x06, + 0x7a,0x05,0xe4,0x04,0x5a,0x04,0xd9,0x02, + 0x06,0x02,0xfd,0x01,0xb3,0x01,0x5c,0x01, + 0x0c,0x01,0xca,0x00,0x8f,0x00,0x5f,0x00, + 0x38,0x00,0x18,0x00,0x1c,0x00,0x17,0x00, + 0x06,0x00,0x01,0x00,0xf9,0xff,0xee,0xff, + 0xf1,0xff,0xf5,0xff,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xf4,0xff,0xf7,0xff,0xe1,0xff,0xf3,0xff, + 0xcc,0xff,0xfa,0xff,0xe8,0xff,0x3a,0x00, + 0xcd,0xff,0x7b,0x00,0x16,0x00,0x19,0x01, + 0x99,0x00,0x06,0x02,0x60,0x01,0x4b,0x03, + 0x6a,0x02,0x5e,0x04,0xfd,0x02,0x2f,0x06, + 0x78,0x04,0x93,0x0a,0xe2,0x08,0xaf,0x0d, + 0xaa,0x0a,0x9b,0x10,0xcb,0x0b,0x16,0x12, + 0xbd,0x0b,0xcd,0x14,0x38,0x0b,0xea,0x17, + 0x62,0x08,0x77,0x1d,0x25,0xfd,0x91,0x41, + 0x9a,0x7c,0xbf,0xf5,0x8f,0x1d,0x07,0x04, + 0x26,0x15,0x43,0x06,0xb4,0x10,0xfa,0x05, + 0x58,0x0d,0x2a,0x04,0xba,0x06,0xff,0x00, + 0xde,0x04,0x4f,0x00,0x5c,0x03,0x5f,0x00, + 0x3d,0x03,0x32,0x00,0x54,0x02,0x7f,0xff, + 0xf8,0x00,0x55,0xff,0x99,0x00,0x56,0xff, + 0x55,0x00,0x64,0xff,0x24,0x00,0x7a,0xff, + 0x04,0x00,0x7c,0xff,0x06,0x00,0xd0,0xff, + 0x07,0x00,0xdd,0xff,0xfe,0xff,0xe9,0xff, + 0xfb,0xff,0xf5,0xff,0xfd,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0x0a,0x00, + 0x1d,0x00,0x22,0x00,0x47,0x00,0x39,0x00, + 0x71,0x00,0x3b,0x00,0x8e,0x00,0x43,0x00, + 0xa7,0x00,0xea,0xff,0x47,0x00,0x09,0xff, + 0x74,0xff,0xa5,0xfd,0x2e,0xfe,0xb7,0xfb, + 0x79,0xfc,0x35,0xf9,0xb0,0xf9,0xc9,0xf5, + 0x67,0xf7,0x93,0xf2,0x30,0xf4,0xa8,0xee, + 0x23,0xf2,0x97,0xeb,0xc5,0xf0,0x47,0xe8, + 0xea,0xee,0x5e,0xe5,0xce,0xef,0xfc,0xe2, + 0x41,0xf3,0xdb,0xdf,0x9d,0xfc,0x24,0xd2, + 0x5c,0x45,0x06,0x3d,0xc5,0xd7,0xb9,0x03, + 0x48,0xea,0xe9,0xff,0xee,0xf1,0x29,0x00, + 0xe0,0xf6,0x24,0x01,0x06,0xfb,0x73,0x03, + 0xfa,0xfd,0x02,0x04,0xa9,0xff,0x37,0x04, + 0x59,0x01,0xb8,0x04,0x99,0x01,0xf0,0x03, + 0xbf,0x00,0x59,0x02,0x4e,0x00,0x8c,0x01, + 0xf6,0xff,0xde,0x00,0xb4,0xff,0x5f,0x00, + 0x93,0xff,0x09,0x00,0x7c,0xff,0xff,0xff, + 0xb7,0xff,0xf1,0xff,0xce,0xff,0xf2,0xff, + 0xe7,0xff,0xfa,0xff,0xfa,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfc,0xff, + 0xf3,0xff,0xf2,0xff,0xdd,0xff,0xe7,0xff, + 0xc4,0xff,0xe3,0xff,0xb6,0xff,0xe2,0xff, + 0x76,0xff,0x01,0x00,0xa3,0xff,0x55,0x00, + 0xd9,0xff,0xd4,0x00,0x34,0x00,0x7f,0x01, + 0xa4,0x00,0x3e,0x02,0x53,0x01,0xe6,0x03, + 0x06,0x02,0x7b,0x04,0x9a,0x01,0x88,0x03, + 0x25,0x00,0x17,0x03,0x7d,0xfe,0x24,0x02, + 0x28,0xfb,0x80,0xff,0x94,0xf7,0xfd,0xfd, + 0x0f,0xf3,0xf8,0xfc,0x50,0xec,0x93,0xff, + 0x0a,0xdb,0x20,0x64,0x2d,0x13,0x84,0xdd, + 0x02,0xf6,0xf6,0xe3,0x17,0xf0,0xb3,0xe5, + 0x23,0xee,0x98,0xe7,0x1b,0xee,0x95,0xea, + 0x6e,0xf0,0x6d,0xed,0x36,0xf2,0x54,0xf0, + 0xb0,0xf4,0x4b,0xf4,0xb6,0xf7,0x23,0xf7, + 0x30,0xfa,0x74,0xfa,0xb6,0xfc,0x9c,0xfc, + 0x5c,0xfe,0x48,0xfe,0x8a,0xff,0x70,0xff, + 0x43,0x00,0x1e,0x00,0x8c,0x00,0x4f,0x00, + 0x6b,0x00,0x40,0x00,0x53,0x00,0x30,0x00, + 0x2d,0x00,0x16,0x00,0x0d,0x00,0x03,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, + 0xfe,0xff,0xfd,0xff,0xfb,0xff,0xfa,0xff, + 0xf9,0xff,0xfa,0xff,0xf8,0xff,0xfb,0xff, + 0xe9,0xff,0xdd,0xff,0xe9,0xff,0xe6,0xff, + 0xeb,0xff,0xed,0xff,0xf3,0xff,0xf9,0xff, + 0x03,0x00,0x12,0x00,0x1a,0x00,0x5e,0x00, + 0xb4,0x00,0xbf,0x00,0x08,0x01,0xea,0x00, + 0xec,0x00,0x33,0x01,0x7e,0x01,0xc7,0x01, + 0x55,0x02,0x42,0x04,0xdd,0x04,0x60,0x05, + 0xe9,0x05,0x64,0x06,0xd4,0x06,0x38,0x07, + 0x95,0x07,0xe2,0x07,0x23,0x48,0x5f,0x08, + 0x8b,0x08,0x9d,0x08,0xa4,0x08,0x83,0x08, + 0x59,0x08,0x0b,0x08,0xbe,0x07,0x50,0x07, + 0x5e,0x07,0xe0,0x06,0x5a,0x06,0xae,0x05, + 0x3d,0x05,0x07,0x04,0xab,0x02,0x6c,0x02, + 0xdd,0x01,0xb6,0x01,0x86,0x01,0x34,0x01, + 0xe8,0x00,0xad,0x00,0x75,0x00,0x4e,0x00, + 0x28,0x00,0x11,0x00,0xfb,0xff,0x09,0x00, + 0xfb,0xff,0xeb,0xff,0xee,0xff,0xf0,0xff, + 0xf5,0xff,0xf8,0xff,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xfd,0xff,0xf8,0xff,0xf9,0xff, + 0xf0,0xff,0xf9,0xff,0xe6,0xff,0xeb,0xff, + 0xe0,0xff,0x19,0x00,0x19,0x00,0x56,0x00, + 0x55,0x00,0xb3,0x00,0xb2,0x00,0x37,0x01, + 0x2e,0x01,0x98,0x01,0x89,0x01,0x63,0x02, + 0x44,0x02,0x57,0x03,0x0c,0x03,0x33,0x05, + 0x99,0x05,0xdd,0x06,0x8c,0x06,0xc2,0x07, + 0xb2,0x06,0xa9,0x08,0x31,0x07,0x92,0x09, + 0x28,0x07,0x71,0x0a,0x46,0x06,0x2c,0x0c, + 0xb8,0x01,0xb9,0x46,0xd8,0x10,0xc8,0x03, + 0x32,0x0a,0x42,0x05,0x4f,0x08,0x13,0x05, + 0xea,0x06,0x7a,0x04,0xb8,0x05,0xa8,0x03, + 0x19,0x03,0x99,0x01,0x4b,0x02,0x39,0x01, + 0x2a,0x02,0x48,0x01,0xaf,0x01,0xf9,0x00, + 0x41,0x01,0xb1,0x00,0xb2,0x00,0x25,0x00, + 0x62,0x00,0x0c,0x00,0x38,0x00,0xf9,0xff, + 0x19,0x00,0xec,0xff,0x1b,0x00,0x04,0x00, + 0x0b,0x00,0xf5,0xff,0xff,0xff,0xf6,0xff, + 0xfc,0xff,0xf9,0xff,0xfd,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00, + 0x09,0x00,0x16,0x00,0x1f,0x00,0x32,0x00, + 0x35,0x00,0x48,0x00,0x3c,0x00,0x51,0x00, + 0x1b,0x00,0x4a,0x00,0xeb,0xff,0xd0,0xff, + 0x24,0xff,0xec,0xfe,0xf0,0xfd,0xa0,0xfd, + 0x34,0xfc,0x44,0xfb,0x9b,0xf9,0x20,0xf9, + 0x32,0xf7,0xd4,0xf6,0xb1,0xf4,0xeb,0xf3, + 0x1d,0xf1,0x83,0xf1,0xcf,0xee,0x03,0xef, + 0x97,0xeb,0xa0,0xed,0x16,0xea,0x69,0xed, + 0x23,0xe9,0xa7,0xee,0x5c,0xe8,0x09,0xf3, + 0xed,0xe2,0x4b,0x6d,0x41,0xfe,0x71,0xeb, + 0x74,0xf7,0x8f,0xf1,0x52,0xf8,0x30,0xf5, + 0xfe,0xf9,0x22,0xf8,0xc4,0xfb,0xb3,0xfa, + 0x72,0xfe,0x67,0xfd,0x7a,0xff,0xbf,0xfe, + 0x0f,0x01,0x23,0x00,0x30,0x01,0x58,0x00, + 0x0e,0x01,0x67,0x00,0x72,0x00,0x9b,0xff, + 0x09,0x00,0x87,0xff,0xd4,0xff,0x7d,0xff, + 0xba,0xff,0x85,0xff,0xe8,0xff,0xcf,0xff, + 0xe5,0xff,0xcc,0xff,0xe6,0xff,0xe1,0xff, + 0xf1,0xff,0xf2,0xff,0xfb,0xff,0xfd,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfe,0xff, + 0xf9,0xff,0xf5,0xff,0xeb,0xff,0xe7,0xff, + 0xd8,0xff,0xd8,0xff,0xcc,0xff,0xe2,0xff, + 0xc6,0xff,0xa7,0xff,0x82,0xff,0xaa,0xff, + 0x88,0xff,0xc5,0xff,0xa2,0xff,0xf1,0xff, + 0xdc,0xff,0xce,0x00,0x71,0x00,0xe6,0x00, + 0x68,0x00,0xdc,0x00,0x21,0x00,0xda,0xff, + 0x3c,0xfe,0xb2,0xfe,0xea,0xfc,0x68,0xfc, + 0xc9,0xf9,0x62,0xfa,0x57,0xf7,0x57,0xf8, + 0x7d,0xf4,0x74,0xf6,0xe5,0xf0,0x7d,0xf5, + 0xae,0xe9,0xab,0x6e,0xed,0xf5,0x87,0xe9, + 0xc6,0xee,0xf7,0xe9,0xe2,0xec,0x5f,0xea, + 0xa7,0xec,0x6e,0xeb,0x80,0xed,0x3c,0xed, + 0x2e,0xf0,0x47,0xf0,0x37,0xf2,0xed,0xf2, + 0x8c,0xf5,0x12,0xf6,0xdf,0xf7,0x88,0xf8, + 0x23,0xfa,0xcc,0xfa,0x91,0xfc,0x4e,0xfd, + 0x3d,0xfe,0xb0,0xfe,0x5d,0xff,0xa6,0xff, + 0x13,0x00,0x34,0x00,0x3e,0x00,0x3e,0x00, + 0x51,0x00,0x3f,0x00,0x40,0x00,0x2e,0x00, + 0x24,0x00,0x15,0x00,0x0b,0x00,0x03,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfe,0xff, + 0xfd,0xff,0xfb,0xff,0xfb,0xff,0xfa,0xff, + 0xfc,0xff,0xfc,0xff,0x05,0x00,0x0f,0x00, + 0x15,0x00,0x02,0x00,0x09,0x00,0x13,0x00, + 0x22,0x00,0x30,0x00,0x45,0x00,0x54,0x00, + 0x83,0x00,0xe8,0x00,0x10,0x01,0x40,0x01, + 0x6e,0x01,0x9f,0x01,0xdd,0x01,0xc5,0x01, + 0xcf,0x01,0x30,0x02,0x6a,0x02,0x31,0x04, + 0xfe,0x04,0x58,0x05,0xe2,0x05,0x4d,0x06, + 0xca,0x06,0x2e,0x07,0x90,0x07,0xd5,0x07, + 0x1f,0x08,0x46,0x48,0x7f,0x08,0x94,0x08, + 0xa8,0x08,0x9d,0x08,0x8f,0x08,0x5f,0x08, + 0x29,0x08,0xca,0x07,0x6d,0x07,0xff,0x06, + 0x08,0x07,0x64,0x06,0xfa,0x05,0xf6,0x04, + 0x66,0x03,0x02,0x03,0x85,0x02,0x20,0x02, + 0xbc,0x01,0x5f,0x01,0x46,0x01,0x12,0x01, + 0xca,0x00,0x96,0x00,0x66,0x00,0x41,0x00, + 0x23,0x00,0x0c,0x00,0xe9,0xff,0xe0,0xff, + 0xe9,0xff,0xf3,0xff,0xf2,0xff,0xf6,0xff, + 0xf8,0xff,0xfc,0xff,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xfc,0xff,0xfc,0xff, + 0xf6,0xff,0xf1,0xff,0xef,0xff,0xf3,0xff, + 0xf4,0xff,0x03,0x00,0x08,0x00,0x2c,0x00, + 0x5f,0x00,0x91,0x00,0xb5,0x00,0xf4,0x00, + 0xe9,0x00,0x46,0x01,0x78,0x01,0xf3,0x01, + 0x2b,0x02,0xbe,0x02,0xf4,0x02,0x9e,0x03, + 0xc9,0x03,0xb1,0x05,0x3c,0x06,0x96,0x06, + 0x86,0x06,0x6a,0x07,0x34,0x07,0x24,0x08, + 0xa3,0x07,0xc3,0x08,0xc1,0x07,0x5e,0x09, + 0x28,0x07,0x44,0x0b,0x2d,0x48,0xa4,0x05, + 0x68,0x09,0xe8,0x06,0x2b,0x08,0x9f,0x06, + 0x43,0x07,0x0e,0x06,0x68,0x06,0x59,0x05, + 0x99,0x05,0x3f,0x04,0x01,0x03,0x9a,0x02, + 0xf5,0x02,0x72,0x02,0x5f,0x02,0xe5,0x01, + 0xce,0x01,0x6a,0x01,0x54,0x01,0x02,0x01, + 0xe9,0x00,0x70,0x00,0x5e,0x00,0x35,0x00, + 0x2a,0x00,0x2e,0x00,0x2e,0x00,0x13,0x00, + 0x10,0x00,0x01,0x00,0x00,0x00,0xf9,0xff, + 0xf9,0xff,0xf6,0xff,0xfa,0xff,0xfb,0xff, + 0xfe,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00, + 0x07,0x00,0x0f,0x00,0x17,0x00,0x21,0x00, + 0x2c,0x00,0x2b,0x00,0x29,0x00,0x18,0x00, + 0x03,0x00,0xd4,0xff,0xb0,0xff,0xa6,0xff, + 0x4c,0xff,0xe1,0xfe,0x4c,0xfe,0x3e,0xfd, + 0x91,0xfc,0xb7,0xfb,0xe7,0xfa,0xec,0xf9, + 0x04,0xf9,0xf4,0xf7,0x04,0xf7,0xf1,0xf5, + 0x39,0xf4,0x00,0xf3,0x6c,0xf1,0x05,0xf0, + 0x8f,0xef,0xaa,0xee,0x83,0xee,0xd2,0xed, + 0x07,0xee,0x78,0xed,0x24,0xee,0x7c,0xed, + 0x9b,0xef,0x31,0x6f,0x1d,0xef,0x5e,0xf1, + 0x69,0xf1,0xc1,0xf2,0x49,0xf3,0x79,0xf4, + 0x2f,0xf5,0x3a,0xf6,0x03,0xf7,0xdf,0xf7, + 0xff,0xf8,0x91,0xfa,0x3a,0xfb,0xba,0xfc, + 0xf9,0xfc,0x89,0xfd,0xd0,0xfd,0x41,0xfe, + 0x78,0xfe,0xcc,0xfe,0xf5,0xfe,0x2e,0xff, + 0xd9,0xfe,0xf1,0xfe,0x15,0xff,0x3b,0xff, + 0x9f,0xff,0xc3,0xff,0xce,0xff,0xdf,0xff, + 0xe9,0xff,0xf3,0xff,0xfa,0xff,0xfb,0xff, + 0xfc,0xff,0x00,0x00,0x01,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xfa,0xff,0xf8,0xff,0xf6,0xff, + 0xef,0xff,0xe3,0xff,0xd8,0xff,0xc5,0xff, + 0xba,0xff,0x8f,0xff,0x2b,0xff,0x0a,0xff, + 0xe0,0xfe,0xca,0xfe,0x19,0xff,0xe2,0xfe, + 0xb3,0xfe,0x63,0xfe,0x23,0xfe,0xb8,0xfd, + 0x67,0xfd,0xe0,0xfc,0x93,0xfc,0x23,0xfb, + 0x5c,0xfa,0xb7,0xf8,0xbe,0xf7,0xde,0xf6, + 0x12,0xf6,0x0e,0xf5,0x4f,0xf4,0x2d,0xf3, + 0x95,0xf2,0x58,0xf1,0x28,0xf1,0x2a,0xef, + 0x19,0x6f,0x57,0xef,0x83,0xed,0x0b,0xee, + 0x7c,0xed,0xfc,0xed,0xda,0xed,0x84,0xee, + 0xb7,0xee,0x9b,0xef,0x18,0xf0,0x82,0xf1, + 0x15,0xf3,0x71,0xf4,0x20,0xf6,0x18,0xf7, + 0x18,0xf8,0x1e,0xf9,0x0f,0xfa,0x01,0xfb, + 0xd8,0xfb,0xa8,0xfc,0x5f,0xfd,0x6a,0xfe, + 0xf7,0xfe,0x60,0xff,0xb7,0xff,0xbf,0xff, + 0xe2,0xff,0x0d,0x00,0x21,0x00,0x30,0x00, + 0x31,0x00,0x2f,0x00,0x23,0x00,0x19,0x00, + 0x0f,0x00,0x08,0x00,0x02,0x00,0x00,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfe,0xff,0xfc,0xff,0xfa,0xff, + 0xf8,0xff,0xf9,0xff,0xfd,0xff,0x01,0x00, + 0x08,0x00,0x11,0x00,0x1d,0x00,0x2e,0x00, + 0x3c,0x00,0x2c,0x00,0x46,0x00,0x5e,0x00, + 0x88,0x00,0xea,0x00,0x1c,0x01,0x51,0x01, + 0x8a,0x01,0xc8,0x01,0x0c,0x02,0x55,0x02, + 0x9f,0x02,0xe8,0x02,0xde,0x02,0xe6,0x02, + 0x95,0x04,0x69,0x05,0xaf,0x05,0x27,0x06, + 0x79,0x06,0xe2,0x06,0x31,0x07,0x8d,0x07, + 0xd2,0x07,0x1e,0x08,0x42,0x08,0x61,0x48, + 0x75,0x08,0x85,0x08,0x75,0x08,0x65,0x08, + 0x36,0x08,0x08,0x08,0xbd,0x07,0x77,0x07, + 0x17,0x07,0xb5,0x06,0x43,0x06,0x54,0x06, + 0x6e,0x05,0xd2,0x03,0x71,0x03,0xfb,0x02, + 0x97,0x02,0x2d,0x02,0xd1,0x01,0x77,0x01, + 0x2b,0x01,0xe6,0x00,0xdc,0x00,0xb3,0x00, + 0x80,0x00,0x5c,0x00,0x1f,0x00,0x06,0x00, + 0xfa,0xff,0xf2,0xff,0xee,0xff,0xee,0xff, + 0xee,0xff,0xf6,0xff,0xfb,0xff,0xfc,0xff, + 0xfe,0xff,0xff,0xff,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xfe,0xff,0xfc,0xff, + 0xf8,0xff,0xf7,0xff,0xf4,0xff,0xf7,0xff, + 0xf7,0xff,0x00,0x00,0x05,0x00,0x17,0x00, + 0x23,0x00,0x41,0x00,0x55,0x00,0x82,0x00, + 0xa2,0x00,0xdf,0x00,0x0b,0x01,0x5a,0x01, + 0x90,0x01,0xf0,0x01,0x2c,0x02,0x9b,0x02, + 0xdb,0x02,0x57,0x03,0x97,0x03,0x1f,0x04, + 0x32,0x05,0x02,0x06,0x18,0x06,0xc6,0x06, + 0xc8,0x06,0x7b,0x07,0x53,0x07,0x1a,0x08, + 0xab,0x07,0xae,0x08,0x9b,0x07,0xdb,0x09, + 0x58,0x48,0x04,0x07,0xed,0x08,0xa8,0x07, + 0x37,0x08,0x68,0x07,0x93,0x07,0xe8,0x06, + 0xdb,0x06,0x42,0x06,0x0d,0x06,0x8c,0x05, + 0xfe,0x04,0xa9,0x03,0x82,0x03,0xf6,0x02, + 0xbe,0x02,0x47,0x02,0x0d,0x02,0xa8,0x01, + 0x73,0x01,0x20,0x01,0xf3,0x00,0xb2,0x00, + 0x8d,0x00,0x5e,0x00,0x4a,0x00,0x2a,0x00, + 0x1d,0x00,0x0a,0x00,0x03,0x00,0xfa,0xff, + 0xf8,0xff,0xf6,0xff,0xf7,0xff,0xf9,0xff, + 0xfb,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x03,0x00,0x08,0x00,0x10,0x00,0x13,0x00, + 0x16,0x00,0x15,0x00,0x10,0x00,0x04,0x00, + 0xf3,0xff,0xd7,0xff,0xb5,0xff,0x86,0xff, + 0x4f,0xff,0x06,0xff,0xb3,0xfe,0x51,0xfe, + 0xdd,0xfd,0x5e,0xfd,0xd0,0xfc,0x38,0xfc, + 0x92,0xfb,0xe8,0xfa,0x2d,0xfa,0x77,0xf9, + 0xac,0xf8,0xf4,0xf7,0x76,0xf5,0x32,0xf4, + 0x95,0xf3,0xbc,0xf2,0x21,0xf2,0x6b,0xf1, + 0xe9,0xf0,0x58,0xf0,0xfb,0xef,0x94,0xef, + 0x62,0xef,0x28,0xef,0x1c,0x6f,0x3b,0xef, + 0x85,0xef,0xc6,0xef,0x3e,0xf0,0xa7,0xf0, + 0x48,0xf1,0xd2,0xf1,0x97,0xf2,0x35,0xf3, + 0x1e,0xf4,0xb3,0xf4,0x26,0xf6,0x7f,0xf8, + 0x20,0xf9,0xf2,0xf9,0x9e,0xfa,0x58,0xfb, + 0xfa,0xfb,0x9a,0xfc,0x29,0xfd,0xaf,0xfd, + 0x26,0xfe,0x8f,0xfe,0xee,0xfe,0x3b,0xff, + 0x73,0xff,0xa5,0xff,0xcb,0xff,0xe8,0xff, + 0xfd,0xff,0x0a,0x00,0x11,0x00,0x13,0x00, + 0x12,0x00,0x0e,0x00,0x0a,0x00,0x04,0x00, + 0x01,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x01,0x00,0x03,0x00,0x08,0x00, + 0x10,0x00,0x13,0x00,0x16,0x00,0x15,0x00, + 0x10,0x00,0x04,0x00,0xf3,0xff,0xd7,0xff, + 0xb5,0xff,0x86,0xff,0x4f,0xff,0x06,0xff, + 0xb3,0xfe,0x51,0xfe,0xdd,0xfd,0x5e,0xfd, + 0xd0,0xfc,0x38,0xfc,0x92,0xfb,0xe8,0xfa, + 0x2d,0xfa,0x77,0xf9,0xac,0xf8,0xf4,0xf7, + 0x76,0xf5,0x32,0xf4,0x95,0xf3,0xbc,0xf2, + 0x21,0xf2,0x6b,0xf1,0xe9,0xf0,0x58,0xf0, + 0xfb,0xef,0x94,0xef,0x62,0xef,0x28,0xef, + 0x1c,0x6f,0x3b,0xef,0x85,0xef,0xc6,0xef, + 0x3e,0xf0,0xa7,0xf0,0x48,0xf1,0xd2,0xf1, + 0x97,0xf2,0x35,0xf3,0x1e,0xf4,0xb3,0xf4, + 0x26,0xf6,0x7f,0xf8,0x20,0xf9,0xf2,0xf9, + 0x9e,0xfa,0x58,0xfb,0xfa,0xfb,0x9a,0xfc, + 0x29,0xfd,0xaf,0xfd,0x26,0xfe,0x8f,0xfe, + 0xee,0xfe,0x3b,0xff,0x73,0xff,0xa5,0xff, + 0xcb,0xff,0xe8,0xff,0xfd,0xff,0x0a,0x00, + 0x11,0x00,0x13,0x00,0x12,0x00,0x0e,0x00, + 0x0a,0x00,0x04,0x00,0x01,0x00,0x00,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, + 0xfe,0xff,0xfc,0xff,0xf8,0xff,0xf7,0xff, + 0xf4,0xff,0xf7,0xff,0xf7,0xff,0x00,0x00, + 0x05,0x00,0x17,0x00,0x23,0x00,0x41,0x00, + 0x55,0x00,0x82,0x00,0xa2,0x00,0xdf,0x00, + 0x0b,0x01,0x5a,0x01,0x90,0x01,0xf0,0x01, + 0x2c,0x02,0x9b,0x02,0xdb,0x02,0x57,0x03, + 0x97,0x03,0x1f,0x04,0x32,0x05,0x02,0x06, + 0x18,0x06,0xc6,0x06,0xc8,0x06,0x7b,0x07, + 0x53,0x07,0x1a,0x08,0xab,0x07,0xae,0x08, + 0x9b,0x07,0xdb,0x09,0x58,0x48,0x04,0x07, + 0xed,0x08,0xa8,0x07,0x37,0x08,0x68,0x07, + 0x93,0x07,0xe8,0x06,0xdb,0x06,0x42,0x06, + 0x0d,0x06,0x8c,0x05,0xfe,0x04,0xa9,0x03, + 0x82,0x03,0xf6,0x02,0xbe,0x02,0x47,0x02, + 0x0d,0x02,0xa8,0x01,0x73,0x01,0x20,0x01, + 0xf3,0x00,0xb2,0x00,0x8d,0x00,0x5e,0x00, + 0x4a,0x00,0x2a,0x00,0x1d,0x00,0x0a,0x00, + 0x03,0x00,0xfa,0xff,0xf8,0xff,0xf6,0xff, + 0xf7,0xff,0xf9,0xff,0xfb,0xff,0xfe,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xff,0xff,0xfe,0xff, + 0xfc,0xff,0xfa,0xff,0xf8,0xff,0xf9,0xff, + 0xfd,0xff,0x01,0x00,0x08,0x00,0x11,0x00, + 0x1d,0x00,0x2e,0x00,0x3c,0x00,0x2c,0x00, + 0x46,0x00,0x5e,0x00,0x88,0x00,0xea,0x00, + 0x1c,0x01,0x51,0x01,0x8a,0x01,0xc8,0x01, + 0x0c,0x02,0x55,0x02,0x9f,0x02,0xe8,0x02, + 0xde,0x02,0xe6,0x02,0x95,0x04,0x69,0x05, + 0xaf,0x05,0x27,0x06,0x79,0x06,0xe2,0x06, + 0x31,0x07,0x8d,0x07,0xd2,0x07,0x1e,0x08, + 0x42,0x08,0x61,0x48,0x75,0x08,0x85,0x08, + 0x75,0x08,0x65,0x08,0x36,0x08,0x08,0x08, + 0xbd,0x07,0x77,0x07,0x17,0x07,0xb5,0x06, + 0x43,0x06,0x54,0x06,0x6e,0x05,0xd2,0x03, + 0x71,0x03,0xfb,0x02,0x97,0x02,0x2d,0x02, + 0xd1,0x01,0x77,0x01,0x2b,0x01,0xe6,0x00, + 0xdc,0x00,0xb3,0x00,0x80,0x00,0x5c,0x00, + 0x1f,0x00,0x06,0x00,0xfa,0xff,0xf2,0xff, + 0xee,0xff,0xee,0xff,0xee,0xff,0xf6,0xff, + 0xfb,0xff,0xfc,0xff,0xfe,0xff,0xff,0xff, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xfa,0xff, + 0xf8,0xff,0xf6,0xff,0xef,0xff,0xe3,0xff, + 0xd8,0xff,0xc5,0xff,0xba,0xff,0x8f,0xff, + 0x2b,0xff,0x0a,0xff,0xe0,0xfe,0xca,0xfe, + 0x19,0xff,0xe2,0xfe,0xb3,0xfe,0x63,0xfe, + 0x23,0xfe,0xb8,0xfd,0x67,0xfd,0xe0,0xfc, + 0x93,0xfc,0x23,0xfb,0x5c,0xfa,0xb7,0xf8, + 0xbe,0xf7,0xde,0xf6,0x12,0xf6,0x0e,0xf5, + 0x4f,0xf4,0x2d,0xf3,0x95,0xf2,0x58,0xf1, + 0x28,0xf1,0x2a,0xef,0x19,0x6f,0x57,0xef, + 0x83,0xed,0x0b,0xee,0x7c,0xed,0xfc,0xed, + 0xda,0xed,0x84,0xee,0xb7,0xee,0x9b,0xef, + 0x18,0xf0,0x82,0xf1,0x15,0xf3,0x71,0xf4, + 0x20,0xf6,0x18,0xf7,0x18,0xf8,0x1e,0xf9, + 0x0f,0xfa,0x01,0xfb,0xd8,0xfb,0xa8,0xfc, + 0x5f,0xfd,0x6a,0xfe,0xf7,0xfe,0x60,0xff, + 0xb7,0xff,0xbf,0xff,0xe2,0xff,0x0d,0x00, + 0x21,0x00,0x30,0x00,0x31,0x00,0x2f,0x00, + 0x23,0x00,0x19,0x00,0x0f,0x00,0x08,0x00, + 0x02,0x00,0x00,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x02,0x00,0x07,0x00,0x0f,0x00, + 0x17,0x00,0x21,0x00,0x2c,0x00,0x2b,0x00, + 0x29,0x00,0x18,0x00,0x03,0x00,0xd4,0xff, + 0xb0,0xff,0xa6,0xff,0x4c,0xff,0xe1,0xfe, + 0x4c,0xfe,0x3e,0xfd,0x91,0xfc,0xb7,0xfb, + 0xe7,0xfa,0xec,0xf9,0x04,0xf9,0xf4,0xf7, + 0x04,0xf7,0xf1,0xf5,0x39,0xf4,0x00,0xf3, + 0x6c,0xf1,0x05,0xf0,0x8f,0xef,0xaa,0xee, + 0x83,0xee,0xd2,0xed,0x07,0xee,0x78,0xed, + 0x24,0xee,0x7c,0xed,0x9b,0xef,0x31,0x6f, + 0x1d,0xef,0x5e,0xf1,0x69,0xf1,0xc1,0xf2, + 0x49,0xf3,0x79,0xf4,0x2f,0xf5,0x3a,0xf6, + 0x03,0xf7,0xdf,0xf7,0xff,0xf8,0x91,0xfa, + 0x3a,0xfb,0xba,0xfc,0xf9,0xfc,0x89,0xfd, + 0xd0,0xfd,0x41,0xfe,0x78,0xfe,0xcc,0xfe, + 0xf5,0xfe,0x2e,0xff,0xd9,0xfe,0xf1,0xfe, + 0x15,0xff,0x3b,0xff,0x9f,0xff,0xc3,0xff, + 0xce,0xff,0xdf,0xff,0xe9,0xff,0xf3,0xff, + 0xfa,0xff,0xfb,0xff,0xfc,0xff,0x00,0x00, + 0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, + 0xfc,0xff,0xfc,0xff,0xf6,0xff,0xf1,0xff, + 0xef,0xff,0xf3,0xff,0xf4,0xff,0x03,0x00, + 0x08,0x00,0x2c,0x00,0x5f,0x00,0x91,0x00, + 0xb5,0x00,0xf4,0x00,0xe9,0x00,0x46,0x01, + 0x78,0x01,0xf3,0x01,0x2b,0x02,0xbe,0x02, + 0xf4,0x02,0x9e,0x03,0xc9,0x03,0xb1,0x05, + 0x3c,0x06,0x96,0x06,0x86,0x06,0x6a,0x07, + 0x34,0x07,0x24,0x08,0xa3,0x07,0xc3,0x08, + 0xc1,0x07,0x5e,0x09,0x28,0x07,0x44,0x0b, + 0x2d,0x48,0xa4,0x05,0x68,0x09,0xe8,0x06, + 0x2b,0x08,0x9f,0x06,0x43,0x07,0x0e,0x06, + 0x68,0x06,0x59,0x05,0x99,0x05,0x3f,0x04, + 0x01,0x03,0x9a,0x02,0xf5,0x02,0x72,0x02, + 0x5f,0x02,0xe5,0x01,0xce,0x01,0x6a,0x01, + 0x54,0x01,0x02,0x01,0xe9,0x00,0x70,0x00, + 0x5e,0x00,0x35,0x00,0x2a,0x00,0x2e,0x00, + 0x2e,0x00,0x13,0x00,0x10,0x00,0x01,0x00, + 0x00,0x00,0xf9,0xff,0xf9,0xff,0xf6,0xff, + 0xfa,0xff,0xfb,0xff,0xfe,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfe,0xff,0xfd,0xff,0xfb,0xff, + 0xfb,0xff,0xfa,0xff,0xfc,0xff,0xfc,0xff, + 0x05,0x00,0x0f,0x00,0x15,0x00,0x02,0x00, + 0x09,0x00,0x13,0x00,0x22,0x00,0x30,0x00, + 0x45,0x00,0x54,0x00,0x83,0x00,0xe8,0x00, + 0x10,0x01,0x40,0x01,0x6e,0x01,0x9f,0x01, + 0xdd,0x01,0xc5,0x01,0xcf,0x01,0x30,0x02, + 0x6a,0x02,0x31,0x04,0xfe,0x04,0x58,0x05, + 0xe2,0x05,0x4d,0x06,0xca,0x06,0x2e,0x07, + 0x90,0x07,0xd5,0x07,0x1f,0x08,0x46,0x48, + 0x7f,0x08,0x94,0x08,0xa8,0x08,0x9d,0x08, + 0x8f,0x08,0x5f,0x08,0x29,0x08,0xca,0x07, + 0x6d,0x07,0xff,0x06,0x08,0x07,0x64,0x06, + 0xfa,0x05,0xf6,0x04,0x66,0x03,0x02,0x03, + 0x85,0x02,0x20,0x02,0xbc,0x01,0x5f,0x01, + 0x46,0x01,0x12,0x01,0xca,0x00,0x96,0x00, + 0x66,0x00,0x41,0x00,0x23,0x00,0x0c,0x00, + 0xe9,0xff,0xe0,0xff,0xe9,0xff,0xf3,0xff, + 0xf2,0xff,0xf6,0xff,0xf8,0xff,0xfc,0xff, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfe,0xff,0xf9,0xff,0xf5,0xff, + 0xeb,0xff,0xe7,0xff,0xd8,0xff,0xd8,0xff, + 0xcc,0xff,0xe2,0xff,0xc6,0xff,0xa7,0xff, + 0x82,0xff,0xaa,0xff,0x88,0xff,0xc5,0xff, + 0xa2,0xff,0xf1,0xff,0xdc,0xff,0xce,0x00, + 0x71,0x00,0xe6,0x00,0x68,0x00,0xdc,0x00, + 0x21,0x00,0xda,0xff,0x3c,0xfe,0xb2,0xfe, + 0xea,0xfc,0x68,0xfc,0xc9,0xf9,0x62,0xfa, + 0x57,0xf7,0x57,0xf8,0x7d,0xf4,0x74,0xf6, + 0xe5,0xf0,0x7d,0xf5,0xae,0xe9,0xab,0x6e, + 0xed,0xf5,0x87,0xe9,0xc6,0xee,0xf7,0xe9, + 0xe2,0xec,0x5f,0xea,0xa7,0xec,0x6e,0xeb, + 0x80,0xed,0x3c,0xed,0x2e,0xf0,0x47,0xf0, + 0x37,0xf2,0xed,0xf2,0x8c,0xf5,0x12,0xf6, + 0xdf,0xf7,0x88,0xf8,0x23,0xfa,0xcc,0xfa, + 0x91,0xfc,0x4e,0xfd,0x3d,0xfe,0xb0,0xfe, + 0x5d,0xff,0xa6,0xff,0x13,0x00,0x34,0x00, + 0x3e,0x00,0x3e,0x00,0x51,0x00,0x3f,0x00, + 0x40,0x00,0x2e,0x00,0x24,0x00,0x15,0x00, + 0x0b,0x00,0x03,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x03,0x00,0x09,0x00,0x16,0x00, + 0x1f,0x00,0x32,0x00,0x35,0x00,0x48,0x00, + 0x3c,0x00,0x51,0x00,0x1b,0x00,0x4a,0x00, + 0xeb,0xff,0xd0,0xff,0x24,0xff,0xec,0xfe, + 0xf0,0xfd,0xa0,0xfd,0x34,0xfc,0x44,0xfb, + 0x9b,0xf9,0x20,0xf9,0x32,0xf7,0xd4,0xf6, + 0xb1,0xf4,0xeb,0xf3,0x1d,0xf1,0x83,0xf1, + 0xcf,0xee,0x03,0xef,0x97,0xeb,0xa0,0xed, + 0x16,0xea,0x69,0xed,0x23,0xe9,0xa7,0xee, + 0x5c,0xe8,0x09,0xf3,0xed,0xe2,0x4b,0x6d, + 0x41,0xfe,0x71,0xeb,0x74,0xf7,0x8f,0xf1, + 0x52,0xf8,0x30,0xf5,0xfe,0xf9,0x22,0xf8, + 0xc4,0xfb,0xb3,0xfa,0x72,0xfe,0x67,0xfd, + 0x7a,0xff,0xbf,0xfe,0x0f,0x01,0x23,0x00, + 0x30,0x01,0x58,0x00,0x0e,0x01,0x67,0x00, + 0x72,0x00,0x9b,0xff,0x09,0x00,0x87,0xff, + 0xd4,0xff,0x7d,0xff,0xba,0xff,0x85,0xff, + 0xe8,0xff,0xcf,0xff,0xe5,0xff,0xcc,0xff, + 0xe6,0xff,0xe1,0xff,0xf1,0xff,0xf2,0xff, + 0xfb,0xff,0xfd,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfe,0xff,0xfd,0xff, + 0xf8,0xff,0xf9,0xff,0xf0,0xff,0xf9,0xff, + 0xe6,0xff,0xeb,0xff,0xe0,0xff,0x19,0x00, + 0x19,0x00,0x56,0x00,0x55,0x00,0xb3,0x00, + 0xb2,0x00,0x37,0x01,0x2e,0x01,0x98,0x01, + 0x89,0x01,0x63,0x02,0x44,0x02,0x57,0x03, + 0x0c,0x03,0x33,0x05,0x99,0x05,0xdd,0x06, + 0x8c,0x06,0xc2,0x07,0xb2,0x06,0xa9,0x08, + 0x31,0x07,0x92,0x09,0x28,0x07,0x71,0x0a, + 0x46,0x06,0x2c,0x0c,0xb8,0x01,0xb9,0x46, + 0xd8,0x10,0xc8,0x03,0x32,0x0a,0x42,0x05, + 0x4f,0x08,0x13,0x05,0xea,0x06,0x7a,0x04, + 0xb8,0x05,0xa8,0x03,0x19,0x03,0x99,0x01, + 0x4b,0x02,0x39,0x01,0x2a,0x02,0x48,0x01, + 0xaf,0x01,0xf9,0x00,0x41,0x01,0xb1,0x00, + 0xb2,0x00,0x25,0x00,0x62,0x00,0x0c,0x00, + 0x38,0x00,0xf9,0xff,0x19,0x00,0xec,0xff, + 0x1b,0x00,0x04,0x00,0x0b,0x00,0xf5,0xff, + 0xff,0xff,0xf6,0xff,0xfc,0xff,0xf9,0xff, + 0xfd,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xfe,0xff,0xfd,0xff, + 0xfb,0xff,0xfa,0xff,0xf9,0xff,0xfa,0xff, + 0xf8,0xff,0xfb,0xff,0xe9,0xff,0xdd,0xff, + 0xe9,0xff,0xe6,0xff,0xeb,0xff,0xed,0xff, + 0xf3,0xff,0xf9,0xff,0x03,0x00,0x12,0x00, + 0x1a,0x00,0x5e,0x00,0xb4,0x00,0xbf,0x00, + 0x08,0x01,0xea,0x00,0xec,0x00,0x33,0x01, + 0x7e,0x01,0xc7,0x01,0x55,0x02,0x42,0x04, + 0xdd,0x04,0x60,0x05,0xe9,0x05,0x64,0x06, + 0xd4,0x06,0x38,0x07,0x95,0x07,0xe2,0x07, + 0x23,0x48,0x5f,0x08,0x8b,0x08,0x9d,0x08, + 0xa4,0x08,0x83,0x08,0x59,0x08,0x0b,0x08, + 0xbe,0x07,0x50,0x07,0x5e,0x07,0xe0,0x06, + 0x5a,0x06,0xae,0x05,0x3d,0x05,0x07,0x04, + 0xab,0x02,0x6c,0x02,0xdd,0x01,0xb6,0x01, + 0x86,0x01,0x34,0x01,0xe8,0x00,0xad,0x00, + 0x75,0x00,0x4e,0x00,0x28,0x00,0x11,0x00, + 0xfb,0xff,0x09,0x00,0xfb,0xff,0xeb,0xff, + 0xee,0xff,0xf0,0xff,0xf5,0xff,0xf8,0xff, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xff,0xff,0xfc,0xff,0xf3,0xff,0xf2,0xff, + 0xdd,0xff,0xe7,0xff,0xc4,0xff,0xe3,0xff, + 0xb6,0xff,0xe2,0xff,0x76,0xff,0x01,0x00, + 0xa3,0xff,0x55,0x00,0xd9,0xff,0xd4,0x00, + 0x34,0x00,0x7f,0x01,0xa4,0x00,0x3e,0x02, + 0x53,0x01,0xe6,0x03,0x06,0x02,0x7b,0x04, + 0x9a,0x01,0x88,0x03,0x25,0x00,0x17,0x03, + 0x7d,0xfe,0x24,0x02,0x28,0xfb,0x80,0xff, + 0x94,0xf7,0xfd,0xfd,0x0f,0xf3,0xf8,0xfc, + 0x50,0xec,0x93,0xff,0x0a,0xdb,0x20,0x64, + 0x2d,0x13,0x84,0xdd,0x02,0xf6,0xf6,0xe3, + 0x17,0xf0,0xb3,0xe5,0x23,0xee,0x98,0xe7, + 0x1b,0xee,0x95,0xea,0x6e,0xf0,0x6d,0xed, + 0x36,0xf2,0x54,0xf0,0xb0,0xf4,0x4b,0xf4, + 0xb6,0xf7,0x23,0xf7,0x30,0xfa,0x74,0xfa, + 0xb6,0xfc,0x9c,0xfc,0x5c,0xfe,0x48,0xfe, + 0x8a,0xff,0x70,0xff,0x43,0x00,0x1e,0x00, + 0x8c,0x00,0x4f,0x00,0x6b,0x00,0x40,0x00, + 0x53,0x00,0x30,0x00,0x2d,0x00,0x16,0x00, + 0x0d,0x00,0x03,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0x0a,0x00,0x1d,0x00,0x22,0x00, + 0x47,0x00,0x39,0x00,0x71,0x00,0x3b,0x00, + 0x8e,0x00,0x43,0x00,0xa7,0x00,0xea,0xff, + 0x47,0x00,0x09,0xff,0x74,0xff,0xa5,0xfd, + 0x2e,0xfe,0xb7,0xfb,0x79,0xfc,0x35,0xf9, + 0xb0,0xf9,0xc9,0xf5,0x67,0xf7,0x93,0xf2, + 0x30,0xf4,0xa8,0xee,0x23,0xf2,0x97,0xeb, + 0xc5,0xf0,0x47,0xe8,0xea,0xee,0x5e,0xe5, + 0xce,0xef,0xfc,0xe2,0x41,0xf3,0xdb,0xdf, + 0x9d,0xfc,0x24,0xd2,0x5c,0x45,0x06,0x3d, + 0xc5,0xd7,0xb9,0x03,0x48,0xea,0xe9,0xff, + 0xee,0xf1,0x29,0x00,0xe0,0xf6,0x24,0x01, + 0x06,0xfb,0x73,0x03,0xfa,0xfd,0x02,0x04, + 0xa9,0xff,0x37,0x04,0x59,0x01,0xb8,0x04, + 0x99,0x01,0xf0,0x03,0xbf,0x00,0x59,0x02, + 0x4e,0x00,0x8c,0x01,0xf6,0xff,0xde,0x00, + 0xb4,0xff,0x5f,0x00,0x93,0xff,0x09,0x00, + 0x7c,0xff,0xff,0xff,0xb7,0xff,0xf1,0xff, + 0xce,0xff,0xf2,0xff,0xe7,0xff,0xfa,0xff, + 0xfa,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf4,0xff,0xf7,0xff, + 0xe1,0xff,0xf3,0xff,0xcc,0xff,0xfa,0xff, + 0xe8,0xff,0x3a,0x00,0xcd,0xff,0x7b,0x00, + 0x16,0x00,0x19,0x01,0x99,0x00,0x06,0x02, + 0x60,0x01,0x4b,0x03,0x6a,0x02,0x5e,0x04, + 0xfd,0x02,0x2f,0x06,0x78,0x04,0x93,0x0a, + 0xe2,0x08,0xaf,0x0d,0xaa,0x0a,0x9b,0x10, + 0xcb,0x0b,0x16,0x12,0xbd,0x0b,0xcd,0x14, + 0x38,0x0b,0xea,0x17,0x62,0x08,0x77,0x1d, + 0x25,0xfd,0x91,0x41,0x9a,0x7c,0xbf,0xf5, + 0x8f,0x1d,0x07,0x04,0x26,0x15,0x43,0x06, + 0xb4,0x10,0xfa,0x05,0x58,0x0d,0x2a,0x04, + 0xba,0x06,0xff,0x00,0xde,0x04,0x4f,0x00, + 0x5c,0x03,0x5f,0x00,0x3d,0x03,0x32,0x00, + 0x54,0x02,0x7f,0xff,0xf8,0x00,0x55,0xff, + 0x99,0x00,0x56,0xff,0x55,0x00,0x64,0xff, + 0x24,0x00,0x7a,0xff,0x04,0x00,0x7c,0xff, + 0x06,0x00,0xd0,0xff,0x07,0x00,0xdd,0xff, + 0xfe,0xff,0xe9,0xff,0xfb,0xff,0xf5,0xff, + 0xfd,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff, + 0xfd,0xff,0xfa,0xff,0xf9,0xff,0xf6,0xff, + 0xf4,0xff,0xf1,0xff,0xdd,0xff,0xd0,0xff, + 0xcb,0xff,0xc0,0xff,0xbe,0xff,0xc0,0xff, + 0xbd,0xff,0xb7,0xff,0xb8,0xff,0xb3,0xff, + 0xb3,0xff,0xb4,0xff,0xbc,0xff,0xe7,0xff, + 0x60,0x00,0x58,0x00,0x3e,0x00,0x67,0x00, + 0xbf,0x00,0xf7,0x00,0x77,0x01,0x9f,0x01, + 0xee,0x02,0x9b,0x04,0xf1,0x04,0x94,0x05, + 0xfa,0x05,0x81,0x06,0xe7,0x06,0x56,0x07, + 0xa6,0x07,0xee,0x47,0x2e,0x08,0x5b,0x08, + 0x69,0x08,0x5e,0x08,0x45,0x08,0x0c,0x08, + 0xd1,0x07,0x64,0x07,0x59,0x07,0x27,0x07, + 0x90,0x06,0x0b,0x06,0x7a,0x05,0xe4,0x04, + 0x5a,0x04,0xd9,0x02,0x06,0x02,0xfd,0x01, + 0xb3,0x01,0x5c,0x01,0x0c,0x01,0xca,0x00, + 0x8f,0x00,0x5f,0x00,0x38,0x00,0x18,0x00, + 0x1c,0x00,0x17,0x00,0x06,0x00,0x01,0x00, + 0xf9,0xff,0xee,0xff,0xf1,0xff,0xf5,0xff, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xf8,0xff,0xf7,0xff, + 0xe4,0xff,0xee,0xff,0xcb,0xff,0xf2,0xff, + 0xb3,0xff,0xe2,0xff,0x98,0xff,0x1b,0x00, + 0xb6,0xff,0x99,0x00,0x24,0x00,0x51,0x01, + 0xa1,0x00,0x3b,0x02,0x48,0x01,0x5d,0x03, + 0xfe,0x01,0x80,0x04,0x01,0x03,0x5b,0x06, + 0xcb,0x02,0xcc,0x05,0xc7,0x01,0xbe,0x05, + 0x44,0x00,0x1b,0x05,0xcf,0xfd,0x17,0x03, + 0xf4,0xf8,0x82,0x01,0xd9,0xf3,0x94,0x00, + 0x46,0xec,0x46,0x03,0x43,0xdb,0x93,0x2f, + 0xf8,0x51,0x61,0xd2,0x4e,0xfc,0x4e,0xe0, + 0xf4,0xf2,0x2e,0xe3,0x33,0xef,0xfd,0xe4, + 0x4f,0xee,0x69,0xe8,0xf4,0xef,0x36,0xeb, + 0x79,0xf1,0x58,0xee,0xa5,0xf3,0xd2,0xf1, + 0x0b,0xf7,0xb8,0xf5,0x30,0xfa,0x48,0xf9, + 0x5e,0xfc,0xc0,0xfb,0x27,0xfe,0xb6,0xfd, + 0x7d,0xff,0x20,0xff,0x55,0x00,0xe5,0xff, + 0xa8,0x00,0x51,0x00,0xbc,0x00,0x5e,0x00, + 0x78,0x00,0x44,0x00,0x4c,0x00,0x27,0x00, + 0x1f,0x00,0x0b,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0x0c,0x00,0x1d,0x00,0x28,0x00, + 0x46,0x00,0x46,0x00,0x6d,0x00,0x67,0x00, + 0xa5,0x00,0x56,0x00,0x84,0x00,0xee,0xff, + 0x24,0x00,0x28,0xff,0x36,0xff,0xc5,0xfd, + 0xca,0xfd,0xdb,0xfb,0xe7,0xfb,0x77,0xf9, + 0x8b,0xf9,0xe6,0xf5,0x5c,0xf6,0x05,0xf2, + 0xf8,0xf2,0xd4,0xee,0xa8,0xf0,0xef,0xeb, + 0xff,0xee,0x54,0xe9,0xfc,0xec,0x88,0xe6, + 0x9d,0xed,0x6b,0xe5,0xaa,0xf0,0xc3,0xe3, + 0x46,0xf8,0x0d,0xd9,0xe1,0x65,0x92,0x12, + 0xd1,0xe4,0x61,0xfe,0x55,0xf0,0x2e,0xfe, + 0x6f,0xf6,0x07,0x00,0xc5,0xfa,0x44,0x02, + 0x44,0xff,0x4b,0x04,0x58,0x01,0x1b,0x05, + 0x98,0x02,0x49,0x05,0x8a,0x03,0xef,0x05, + 0x52,0x03,0x19,0x04,0x4f,0x02,0x0a,0x03, + 0x80,0x01,0xfa,0x01,0xc9,0x00,0x1f,0x01, + 0x3f,0x00,0x71,0x00,0xc7,0xff,0x02,0x00, + 0xa3,0xff,0xd4,0xff,0xc0,0xff,0xe8,0xff, + 0xd0,0xff,0xea,0xff,0xe6,0xff,0xf6,0xff, + 0xf9,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfb,0xff,0xf2,0xff, + 0xf6,0xff,0xea,0xff,0x05,0x00,0xf7,0xff, + 0x17,0x00,0x09,0x00,0x31,0x00,0x02,0x00, + 0x60,0x00,0x42,0x00,0xc4,0x00,0xa3,0x00, + 0x52,0x01,0x28,0x01,0x0d,0x02,0xad,0x01, + 0x71,0x02,0xb0,0x02,0xfb,0x04,0x62,0x04, + 0x34,0x06,0x62,0x05,0x76,0x07,0x45,0x06, + 0x69,0x08,0x2e,0x06,0x54,0x09,0x4d,0x06, + 0x73,0x0a,0x95,0x05,0x35,0x0c,0x5d,0x02, + 0x6c,0x15,0x80,0x44,0x5a,0xfe,0x3e,0x0c, + 0x70,0x03,0xf8,0x08,0xde,0x03,0x26,0x07, + 0x76,0x03,0xa8,0x05,0x7f,0x01,0x81,0x02, + 0x8e,0x00,0xa0,0x01,0x0a,0x00,0xea,0x00, + 0xb6,0xff,0xcf,0x00,0xe8,0xff,0x2c,0x00, + 0x68,0xff,0xf5,0xff,0x72,0xff,0xe5,0xff, + 0x86,0xff,0xdd,0xff,0x99,0xff,0xda,0xff, + 0xa1,0xff,0xd3,0xff,0xb9,0xff,0xdc,0xff, + 0xd4,0xff,0xf9,0xff,0xed,0xff,0xfb,0xff, + 0xf5,0xff,0xfc,0xff,0xfb,0xff,0xff,0xff, + 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xfc,0xff,0xfa,0xff,0xf7,0xff, + 0xf3,0xff,0xf1,0xff,0xdf,0xff,0xd0,0xff, + 0xc7,0xff,0xbb,0xff,0xaf,0xff,0xa2,0xff, + 0x96,0xff,0x9a,0xff,0x8f,0xff,0x87,0xff, + 0x78,0xff,0x78,0xff,0x6d,0xff,0x7f,0xff, + 0x75,0xff,0xdc,0xff,0xf0,0xff,0xd9,0xff, + 0x2a,0x00,0x64,0x00,0xbf,0x00,0x1a,0x01, + 0x80,0x01,0x16,0x02,0x22,0x04,0xc1,0x04, + 0x40,0x05,0xc2,0x05,0x3d,0x06,0xb2,0x06, + 0x1a,0x07,0x78,0x07,0xba,0x47,0x00,0x08, + 0x1b,0x08,0x2a,0x08,0x19,0x08,0x01,0x08, + 0xc7,0x07,0x89,0x07,0x2d,0x07,0x4b,0x07, + 0xd2,0x06,0x5d,0x06,0xc3,0x05,0x4d,0x05, + 0x9e,0x04,0x43,0x04,0x11,0x03,0x06,0x02, + 0x03,0x02,0x84,0x01,0x45,0x01,0xec,0x00, + 0xb7,0x00,0x79,0x00,0x53,0x00,0x2b,0x00, + 0x37,0x00,0x23,0x00,0x13,0x00,0x07,0x00, + 0x00,0x00,0xfd,0xff,0xf7,0xff,0xf1,0xff, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfe,0xff,0xfa,0xff,0xf0,0xff, + 0xed,0xff,0xd9,0xff,0xe2,0xff,0xc8,0xff, + 0xdb,0xff,0x9d,0xff,0xe9,0xff,0xb9,0xff, + 0x3a,0x00,0x07,0x00,0xcd,0x00,0xac,0x00, + 0xc9,0x01,0x78,0x01,0xea,0x02,0x71,0x02, + 0x29,0x04,0x66,0x03,0x4d,0x05,0x62,0x04, + 0xdf,0x06,0x02,0x04,0x9d,0x06,0x6d,0x03, + 0x3e,0x06,0xf4,0x01,0x36,0x05,0x86,0xff, + 0xae,0x02,0xa6,0xfa,0x4d,0x00,0xad,0xf5, + 0x8a,0xfe,0xa9,0xee,0x28,0x00,0x9a,0xdd, + 0x2d,0x67,0xc0,0x0f,0x74,0xdf,0x79,0xf5, + 0xe3,0xe4,0xd1,0xef,0x16,0xe6,0x84,0xed, + 0x35,0xe7,0x1c,0xee,0x83,0xea,0x71,0xef, + 0x0b,0xed,0x6a,0xf1,0x0e,0xf0,0xe9,0xf3, + 0x62,0xf3,0x98,0xf7,0xd2,0xf7,0x8d,0xfa, + 0x78,0xfa,0xb0,0xfc,0xb0,0xfc,0x65,0xfe, + 0x62,0xfe,0x9e,0xff,0x7b,0xff,0x3b,0x00, + 0x1e,0x00,0x8f,0x00,0x64,0x00,0x96,0x00, + 0x64,0x00,0x5c,0x00,0x38,0x00,0x31,0x00, + 0x19,0x00,0x0e,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0x0b,0x00,0x20,0x00,0x28,0x00, + 0x4f,0x00,0x45,0x00,0x86,0x00,0x73,0x00, + 0xbc,0x00,0x59,0x00,0xab,0x00,0xed,0xff, + 0x44,0x00,0x23,0xff,0x90,0xff,0xc4,0xfd, + 0x3c,0xfe,0xd0,0xfb,0x72,0xfc,0x54,0xf9, + 0x47,0xfa,0x59,0xf6,0xec,0xf6,0x90,0xf1, + 0xb4,0xf3,0x2e,0xee,0x75,0xf1,0x0b,0xeb, + 0xe5,0xef,0x60,0xe8,0xc9,0xee,0xbc,0xe4, + 0x9b,0xef,0x1b,0xe3,0x74,0xf3,0x3c,0xe0, + 0xfa,0xfc,0x68,0xd2,0xe5,0x4b,0x90,0x37, + 0x1a,0xda,0xbd,0x04,0x64,0xec,0xc7,0x01, + 0x5c,0xf4,0xba,0x02,0xc1,0xf9,0xd2,0x04, + 0xdc,0xfe,0x65,0x06,0x50,0x01,0x02,0x07, + 0xcc,0x02,0x00,0x07,0x7a,0x03,0x28,0x07, + 0x61,0x03,0x60,0x05,0xaf,0x02,0x16,0x04, + 0xd8,0x01,0xcc,0x02,0x01,0x01,0xb2,0x01, + 0x52,0x00,0xc0,0x00,0xdc,0xff,0x3a,0x00, + 0xa8,0xff,0xf2,0xff,0xa3,0xff,0xef,0xff, + 0xcd,0xff,0xee,0xff,0xe4,0xff,0xf6,0xff, + 0xf8,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xf9,0xff,0xe0,0xff, + 0xf6,0xff,0xe0,0xff,0x1a,0x00,0xdd,0xff, + 0x47,0x00,0xef,0xff,0xa1,0x00,0x09,0x00, + 0xce,0x00,0x42,0x00,0xa1,0x01,0xe1,0x00, + 0xc6,0x02,0xc7,0x01,0x46,0x04,0xea,0x02, + 0x8f,0x05,0xb3,0x05,0x39,0x0a,0xb7,0x07, + 0xdd,0x0c,0x67,0x09,0x9a,0x0f,0xc5,0x0a, + 0x0b,0x12,0x1e,0x0a,0x38,0x14,0x88,0x09, + 0x88,0x17,0x72,0x06,0xd3,0x1d,0x16,0xfa, + 0x4b,0x48,0x5c,0x76,0xc2,0xf3,0x5f,0x1d, + 0x60,0x02,0x5a,0x14,0xb2,0x04,0x8c,0x0f, + 0xcd,0x04,0xf0,0x0a,0xde,0xff,0xf7,0x05, + 0x24,0xff,0xb8,0x03,0x68,0xfe,0x0f,0x02, + 0xe0,0xfd,0x86,0x01,0xf7,0xfd,0x16,0x00, + 0xda,0xfd,0xc5,0xff,0x13,0xfe,0xa7,0xff, + 0x69,0xfe,0xa9,0xff,0xb1,0xfe,0x8b,0xff, + 0xef,0xfe,0xa4,0xff,0x3b,0xff,0xbd,0xff, + 0x7a,0xff,0xe7,0xff,0xcc,0xff,0xf5,0xff, + 0xe4,0xff,0xfa,0xff,0xf5,0xff,0xfe,0xff, + 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x50,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0xfe,0xff,0xfc,0xff,0xfa,0xff,0xf7,0xff, + 0xf3,0xff,0xee,0xff,0xda,0xff,0xce,0xff, + 0xc2,0xff,0xb6,0xff,0xa7,0xff,0x9b,0xff, + 0x88,0xff,0x89,0xff,0x81,0xff,0x74,0xff, + 0x65,0xff,0x61,0xff,0x58,0xff,0x64,0xff, + 0x60,0xff,0xa2,0xff,0xc5,0xff,0xc0,0xff, + 0x10,0x00,0x48,0x00,0xa9,0x00,0xfc,0x00, + 0x72,0x01,0xde,0x01,0xe0,0x03,0xb5,0x04, + 0x20,0x05,0xb1,0x05,0x22,0x06,0xa0,0x06, + 0x02,0x07,0x66,0x07,0xa5,0x47,0xea,0x07, + 0x00,0x08,0x10,0x08,0xfe,0x07,0xe5,0x07, + 0xac,0x07,0x69,0x07,0x1f,0x07,0x3c,0x07, + 0xb5,0x06,0x47,0x06,0xab,0x05,0x37,0x05, + 0x8b,0x04,0x2c,0x04,0x28,0x03,0x19,0x02, + 0xef,0x01,0x7d,0x01,0x37,0x01,0xe6,0x00, + 0xac,0x00,0x76,0x00,0x4a,0x00,0x37,0x00, + 0x3d,0x00,0x21,0x00,0x14,0x00,0x07,0x00, + 0x01,0x00,0xfd,0xff,0xfb,0xff,0xf2,0xff, + 0x50,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfe,0xff,0xfa,0xff,0xf1,0xff, + 0xeb,0xff,0xde,0xff,0xdd,0xff,0xd1,0xff, + 0xc7,0xff,0xb5,0xff,0xde,0xff,0xdf,0xff, + 0x2e,0x00,0x42,0x00,0xbe,0x00,0xf7,0x00, + 0xbd,0x01,0xee,0x01,0xdb,0x02,0x06,0x03, + 0x0e,0x04,0x1b,0x04,0x20,0x05,0x24,0x05, + 0x4e,0x06,0x09,0x05,0x22,0x06,0x9f,0x04, + 0x87,0x05,0x5b,0x03,0x2d,0x04,0x37,0x01, + 0x33,0x01,0xb9,0xfc,0x14,0xfe,0x83,0xf8, + 0x17,0xfb,0x38,0xf3,0x8f,0xf9,0x0e,0xe9, + 0x5c,0x6f,0x48,0xfa,0x57,0xe8,0xdd,0xef, + 0xe5,0xe8,0xad,0xec,0xa4,0xe8,0x65,0xeb, + 0x28,0xe9,0xd5,0xec,0xce,0xeb,0x60,0xee, + 0x1a,0xee,0xa0,0xf0,0xec,0xf0,0x57,0xf3, + 0x19,0xf4,0x7b,0xf7,0x75,0xf8,0x41,0xfa, + 0xf9,0xfa,0x7c,0xfc,0x16,0xfd,0x40,0xfe, + 0xb1,0xfe,0x7c,0xff,0xa6,0xff,0x2a,0x00, + 0x40,0x00,0x82,0x00,0x7a,0x00,0x8d,0x00, + 0x73,0x00,0x59,0x00,0x3e,0x00,0x30,0x00, + 0x1b,0x00,0x0d,0x00,0x50,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0x0c,0x00,0x1e,0x00,0x2b,0x00, + 0x49,0x00,0x4d,0x00,0x84,0x00,0x7d,0x00, + 0xa0,0x00,0x68,0x00,0x7e,0x00,0x02,0x00, + 0x01,0x00,0x3d,0xff,0x35,0xff,0xf0,0xfd, + 0xc3,0xfd,0x0e,0xfc,0xd6,0xfb,0xac,0xf9, + 0x84,0xf9,0xda,0xf6,0xb5,0xf5,0x26,0xf2, + 0x9e,0xf2,0x0f,0xef,0x27,0xf0,0x47,0xec, + 0x54,0xee,0x14,0xea,0xae,0xec,0x49,0xe7, + 0x28,0xed,0xba,0xe6,0xd6,0xef,0xdc,0xe5, + 0x78,0xf6,0x8b,0xdd,0xc8,0x6a,0x09,0x0a, + 0x49,0xe9,0x0e,0xfd,0x03,0xf3,0x0d,0xfe, + 0xbb,0xf8,0x78,0x00,0x22,0xfd,0xc9,0x03, + 0x52,0x01,0x6c,0x05,0x50,0x03,0x47,0x06, + 0x6a,0x04,0x67,0x06,0xdb,0x04,0x62,0x06, + 0x2a,0x04,0x08,0x05,0x58,0x03,0xc7,0x03, + 0x56,0x02,0x88,0x02,0x5d,0x01,0x72,0x01, + 0x7c,0x00,0x96,0x00,0x00,0x00,0x19,0x00, + 0xbe,0xff,0xdb,0xff,0xaf,0xff,0xe1,0xff, + 0xd3,0xff,0xe7,0xff,0xe6,0xff,0xf4,0xff, + 0xf9,0xff,0xfe,0xff,0x00,0x00,0x00,0x00, + 0x50,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0xfa,0xff,0xeb,0xff, + 0x00,0x00,0xf1,0xff,0x0e,0x00,0xf3,0xff, + 0x28,0x00,0x01,0x00,0x5b,0x00,0x15,0x00, + 0x71,0x00,0x38,0x00,0xe2,0x00,0x92,0x00, + 0x7d,0x01,0x0f,0x01,0x4c,0x02,0x99,0x01, + 0x60,0x03,0x7d,0x03,0x28,0x05,0x5b,0x04, + 0x7b,0x06,0x35,0x05,0xc9,0x07,0xe6,0x05, + 0xba,0x08,0x90,0x05,0xca,0x09,0x4c,0x05, + 0x3e,0x0b,0xc9,0x03,0x4b,0x0e,0x9a,0xfc, + 0x99,0x41,0x38,0x1a,0x11,0xff,0xca,0x0b, + 0x8f,0x02,0xa4,0x08,0xef,0x02,0xaf,0x06, + 0x93,0x02,0xb1,0x03,0x32,0x00,0x3b,0x02, + 0xba,0xff,0x40,0x01,0x55,0xff,0x84,0x00, + 0x20,0xff,0x44,0x00,0xed,0xfe,0xd5,0xff, + 0xfc,0xfe,0xb7,0xff,0x1d,0xff,0xb4,0xff, + 0x49,0xff,0xbc,0xff,0x61,0xff,0xbc,0xff, + 0x8b,0xff,0xce,0xff,0xaf,0xff,0xde,0xff, + 0xcc,0xff,0xf4,0xff,0xed,0xff,0xfb,0xff, + 0xf7,0xff,0xfe,0xff,0xfe,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x04,0x00,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00, + 0x04,0x00,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x03,0x00,0x03,0x00, + 0x03,0x00,0x03,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x02,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0xb5,0xff,0x00,0x00, + 0x04,0x00,0x00,0x00,0xc4,0xff,0x00,0x00, + 0x08,0x00,0x00,0x00,0xd3,0xff,0x00,0x00, + 0x0c,0x00,0x00,0x00,0xe2,0xff,0x00,0x00, + 0x10,0x00,0x00,0x00,0xf1,0xff,0x00,0x00, + 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x18,0x00,0x00,0x00,0x0f,0x00,0x00,0x00, + 0x1c,0x00,0x00,0x00,0x1e,0x00,0x00,0x00, + 0x20,0x00,0x00,0x00,0x2d,0x00,0x00,0x00, + 0x24,0x00,0x00,0x00,0x3c,0x00,0x00,0x00, + 0x28,0x00,0x00,0x00,0x4b,0x00,0x00,0x00, + 0x2c,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x30,0x00,0x00,0x00,0x00,0x00,0xac,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xc7,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_16khz.conf b/tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_16khz.conf new file mode 100644 index 000000000000..9e757b4f6e89 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_16khz.conf @@ -0,0 +1,172 @@ +# Created with script example_two_beams.m 23-Oct-2023 +# cd tools/tune/tdfb; matlab -nodisplay -nosplash -nodesktop -r example_two_beams +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x14,0x05,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x14,0x05,0x00,0x00,0x08,0x00,0x02,0x00, + 0x01,0x00,0x04,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfb,0xff, + 0xec,0xff,0xd1,0xff,0xa9,0xff,0x72,0xff, + 0x2b,0xff,0xd8,0xfe,0x79,0xfe,0x16,0xfe, + 0xb0,0xfd,0x4f,0xfd,0xf5,0xfc,0xc5,0xfc, + 0xac,0xfc,0xd6,0xfc,0x64,0xfc,0x87,0xfc, + 0x38,0xfd,0x90,0xfd,0x09,0xfe,0x70,0xfd, + 0x14,0xfc,0xfe,0xfb,0x2c,0xfc,0x75,0xfc, + 0x47,0xfd,0xa0,0xff,0xd1,0x01,0xfa,0x07, + 0x86,0x10,0xcc,0x13,0x24,0x57,0x65,0x18, + 0x52,0x18,0x89,0x17,0x7b,0x15,0x23,0x10, + 0x2a,0x09,0x76,0x05,0x94,0x02,0x7b,0x01, + 0x21,0x00,0x6c,0xfe,0xc9,0xfd,0x48,0xfe, + 0x9b,0xfe,0x09,0xff,0x45,0xff,0x72,0xff, + 0xc4,0xff,0xf9,0xff,0x17,0x00,0x27,0x00, + 0x2f,0x00,0x31,0x00,0x2c,0x00,0x24,0x00, + 0x1b,0x00,0x13,0x00,0x0b,0x00,0x05,0x00, + 0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x03,0x00,0x08,0x00,0x24,0x00,0x32,0x00, + 0x81,0x00,0x8e,0x00,0x19,0x01,0xfe,0x00, + 0xb0,0x01,0x24,0x01,0xbf,0x01,0x3e,0x00, + 0x89,0x00,0xe7,0xfd,0x09,0xfe,0x9e,0xfa, + 0xc9,0xfa,0xa2,0xf6,0x6f,0xf9,0x75,0xf7, + 0x2e,0xfd,0x20,0xfc,0x3f,0x09,0x2f,0x0a, + 0x96,0x18,0x83,0x12,0x3e,0x1c,0xd1,0x05, + 0x08,0x0d,0x0b,0xdb,0x17,0x0e,0xf9,0x39, + 0x70,0xa7,0x4f,0xc7,0xf7,0xb2,0x34,0xc9, + 0x0b,0xc9,0x67,0xe5,0xb8,0xe9,0xa7,0xfd, + 0x35,0x01,0x53,0x0e,0xda,0x0b,0xa7,0x11, + 0x8f,0x0e,0x6c,0x10,0x67,0x0c,0x08,0x0c, + 0xe5,0x07,0x97,0x07,0xbf,0x04,0x69,0x04, + 0x7e,0x02,0x58,0x02,0x43,0x01,0x38,0x01, + 0x9e,0x00,0x90,0x00,0x40,0x00,0x31,0x00, + 0x10,0x00,0x05,0x00,0x40,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x05,0x00,0x0f,0x00,0x32,0x00, + 0x3e,0x00,0x93,0x00,0x99,0x00,0x3d,0x01, + 0x38,0x01,0x5d,0x02,0x67,0x02,0x6e,0x04, + 0x9b,0x04,0xa0,0x07,0xb3,0x07,0x0d,0x0c, + 0x2d,0x0c,0xa0,0x10,0x60,0x0e,0x20,0x12, + 0xc0,0x0b,0x10,0x0f,0x9f,0x01,0xf2,0xfe, + 0x3d,0xea,0x16,0xe7,0xc2,0xc9,0x8b,0xca, + 0x38,0xb2,0x9e,0xc8,0x8e,0xa4,0x45,0x2e, + 0xe9,0x1a,0xbe,0xd5,0xbb,0x0d,0x8c,0x03, + 0xdb,0x1c,0xab,0x11,0xa9,0x19,0x24,0x0a, + 0x5d,0x0a,0x39,0xfc,0xb9,0xfd,0x54,0xf7, + 0xd2,0xf9,0x5f,0xf6,0xe0,0xfa,0x53,0xfa, + 0x19,0xfe,0xaa,0xfd,0x90,0x00,0x16,0x00, + 0xc6,0x01,0x0f,0x01,0xb9,0x01,0xf4,0x00, + 0x20,0x01,0x8b,0x00,0x85,0x00,0x30,0x00, + 0x25,0x00,0x07,0x00,0x03,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x02,0x00,0x05,0x00, + 0x0c,0x00,0x11,0x00,0x1e,0x00,0x20,0x00, + 0x33,0x00,0x2a,0x00,0x3b,0x00,0x1a,0x00, + 0x2b,0x00,0xe7,0xff,0xe3,0xff,0x58,0xff, + 0x6b,0xff,0xe4,0xfe,0xd3,0xfe,0x12,0xfe, + 0x11,0xfe,0xfb,0xfd,0x5c,0x00,0xf8,0x00, + 0xf5,0x02,0x96,0x04,0x8b,0x09,0x9c,0x0e, + 0x78,0x16,0xcf,0x15,0xca,0x1a,0xa4,0x13, + 0xb0,0x56,0xa4,0x19,0x47,0x0e,0x7c,0x0a, + 0xc9,0x00,0xd3,0x00,0x9d,0xfc,0x2d,0xfd, + 0xa1,0xfb,0x83,0xfc,0x9f,0xfb,0xb0,0xfd, + 0xc1,0xfd,0xe0,0xfd,0x0b,0xfd,0xcf,0xfc, + 0x38,0xfc,0xff,0xfc,0x98,0xfc,0xe3,0xfc, + 0xe5,0xfc,0x61,0xfd,0xa4,0xfd,0x20,0xfe, + 0x70,0xfe,0xdd,0xfe,0x26,0xff,0x74,0xff, + 0xa7,0xff,0xd2,0xff,0xec,0xff,0xfb,0xff, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x02,0x00,0x05,0x00,0x0c,0x00,0x11,0x00, + 0x1e,0x00,0x20,0x00,0x33,0x00,0x2a,0x00, + 0x3b,0x00,0x1a,0x00,0x2b,0x00,0xe7,0xff, + 0xe3,0xff,0x58,0xff,0x6b,0xff,0xe4,0xfe, + 0xd3,0xfe,0x12,0xfe,0x11,0xfe,0xfb,0xfd, + 0x5c,0x00,0xf8,0x00,0xf5,0x02,0x96,0x04, + 0x8b,0x09,0x9c,0x0e,0x78,0x16,0xcf,0x15, + 0xca,0x1a,0xa4,0x13,0xb0,0x56,0xa4,0x19, + 0x47,0x0e,0x7c,0x0a,0xc9,0x00,0xd3,0x00, + 0x9d,0xfc,0x2d,0xfd,0xa1,0xfb,0x83,0xfc, + 0x9f,0xfb,0xb0,0xfd,0xc1,0xfd,0xe0,0xfd, + 0x0b,0xfd,0xcf,0xfc,0x38,0xfc,0xff,0xfc, + 0x98,0xfc,0xe3,0xfc,0xe5,0xfc,0x61,0xfd, + 0xa4,0xfd,0x20,0xfe,0x70,0xfe,0xdd,0xfe, + 0x26,0xff,0x74,0xff,0xa7,0xff,0xd2,0xff, + 0xec,0xff,0xfb,0xff,0x00,0x00,0x00,0x00, + 0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00, + 0x0f,0x00,0x32,0x00,0x3e,0x00,0x93,0x00, + 0x99,0x00,0x3d,0x01,0x38,0x01,0x5d,0x02, + 0x67,0x02,0x6e,0x04,0x9b,0x04,0xa0,0x07, + 0xb3,0x07,0x0d,0x0c,0x2d,0x0c,0xa0,0x10, + 0x60,0x0e,0x20,0x12,0xc0,0x0b,0x10,0x0f, + 0x9f,0x01,0xf2,0xfe,0x3d,0xea,0x16,0xe7, + 0xc2,0xc9,0x8b,0xca,0x38,0xb2,0x9e,0xc8, + 0x8e,0xa4,0x45,0x2e,0xe9,0x1a,0xbe,0xd5, + 0xbb,0x0d,0x8c,0x03,0xdb,0x1c,0xab,0x11, + 0xa9,0x19,0x24,0x0a,0x5d,0x0a,0x39,0xfc, + 0xb9,0xfd,0x54,0xf7,0xd2,0xf9,0x5f,0xf6, + 0xe0,0xfa,0x53,0xfa,0x19,0xfe,0xaa,0xfd, + 0x90,0x00,0x16,0x00,0xc6,0x01,0x0f,0x01, + 0xb9,0x01,0xf4,0x00,0x20,0x01,0x8b,0x00, + 0x85,0x00,0x30,0x00,0x25,0x00,0x07,0x00, + 0x03,0x00,0x00,0x00,0x40,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x03,0x00,0x08,0x00, + 0x24,0x00,0x32,0x00,0x81,0x00,0x8e,0x00, + 0x19,0x01,0xfe,0x00,0xb0,0x01,0x24,0x01, + 0xbf,0x01,0x3e,0x00,0x89,0x00,0xe7,0xfd, + 0x09,0xfe,0x9e,0xfa,0xc9,0xfa,0xa2,0xf6, + 0x6f,0xf9,0x75,0xf7,0x2e,0xfd,0x20,0xfc, + 0x3f,0x09,0x2f,0x0a,0x96,0x18,0x83,0x12, + 0x3e,0x1c,0xd1,0x05,0x08,0x0d,0x0b,0xdb, + 0x17,0x0e,0xf9,0x39,0x70,0xa7,0x4f,0xc7, + 0xf7,0xb2,0x34,0xc9,0x0b,0xc9,0x67,0xe5, + 0xb8,0xe9,0xa7,0xfd,0x35,0x01,0x53,0x0e, + 0xda,0x0b,0xa7,0x11,0x8f,0x0e,0x6c,0x10, + 0x67,0x0c,0x08,0x0c,0xe5,0x07,0x97,0x07, + 0xbf,0x04,0x69,0x04,0x7e,0x02,0x58,0x02, + 0x43,0x01,0x38,0x01,0x9e,0x00,0x90,0x00, + 0x40,0x00,0x31,0x00,0x10,0x00,0x05,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfb,0xff,0xec,0xff,0xd1,0xff, + 0xa9,0xff,0x72,0xff,0x2b,0xff,0xd8,0xfe, + 0x79,0xfe,0x16,0xfe,0xb0,0xfd,0x4f,0xfd, + 0xf5,0xfc,0xc5,0xfc,0xac,0xfc,0xd6,0xfc, + 0x64,0xfc,0x87,0xfc,0x38,0xfd,0x90,0xfd, + 0x09,0xfe,0x70,0xfd,0x14,0xfc,0xfe,0xfb, + 0x2c,0xfc,0x75,0xfc,0x47,0xfd,0xa0,0xff, + 0xd1,0x01,0xfa,0x07,0x86,0x10,0xcc,0x13, + 0x24,0x57,0x65,0x18,0x52,0x18,0x89,0x17, + 0x7b,0x15,0x23,0x10,0x2a,0x09,0x76,0x05, + 0x94,0x02,0x7b,0x01,0x21,0x00,0x6c,0xfe, + 0xc9,0xfd,0x48,0xfe,0x9b,0xfe,0x09,0xff, + 0x45,0xff,0x72,0xff,0xc4,0xff,0xf9,0xff, + 0x17,0x00,0x27,0x00,0x2f,0x00,0x31,0x00, + 0x2c,0x00,0x24,0x00,0x1b,0x00,0x13,0x00, + 0x0b,0x00,0x05,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x01,0x00,0x01,0x00, + 0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00, + 0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xc7,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_48khz.conf b/tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_48khz.conf new file mode 100644 index 000000000000..150519bdac18 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line4_28mm_pm90deg_48khz.conf @@ -0,0 +1,172 @@ +# Created with script example_two_beams.m 23-Oct-2023 +# cd tools/tune/tdfb; matlab -nodisplay -nosplash -nodesktop -r example_two_beams +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x14,0x05,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x14,0x05,0x00,0x00,0x08,0x00,0x02,0x00, + 0x01,0x00,0x04,0x00,0x01,0x00,0x00,0x00, + 0x00,0x00,0x0f,0x00,0xa6,0xff,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff, + 0xfc,0xff,0xf7,0xff,0xef,0xff,0xe7,0xff, + 0xdb,0xff,0xd4,0xff,0xca,0xff,0xbc,0xff, + 0xae,0xff,0xa4,0xff,0x98,0xff,0x99,0xff, + 0x90,0xff,0xbb,0xff,0xd3,0xff,0xcd,0xff, + 0x0e,0x00,0x3e,0x00,0x94,0x00,0xe2,0x00, + 0x53,0x01,0xbf,0x01,0xad,0x03,0x87,0x04, + 0xfc,0x04,0x96,0x05,0x11,0x06,0x96,0x06, + 0xfe,0x06,0x65,0x07,0xa1,0x47,0xe6,0x07, + 0xf4,0x07,0xf9,0x07,0xd8,0x07,0xad,0x07, + 0x60,0x07,0x07,0x07,0xa5,0x06,0xa1,0x06, + 0x05,0x06,0x81,0x05,0xd6,0x04,0x51,0x04, + 0xa2,0x03,0x36,0x03,0x53,0x02,0x79,0x01, + 0x49,0x01,0xed,0x00,0xb4,0x00,0x7a,0x00, + 0x53,0x00,0x33,0x00,0x1b,0x00,0x11,0x00, + 0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xfe,0xff,0xfe,0xff,0xfc,0xff, + 0x09,0x00,0x11,0x00,0x3b,0x00,0x5c,0x00, + 0xbe,0x00,0xee,0x00,0x84,0x01,0xc0,0x01, + 0x86,0x02,0xb9,0x02,0x98,0x03,0xca,0x03, + 0xda,0x04,0x07,0x04,0x13,0x05,0xf1,0x03, + 0xd9,0x04,0x03,0x03,0xd4,0x03,0x22,0x01, + 0x23,0x01,0xd9,0xfc,0x22,0xfe,0xa6,0xf8, + 0x25,0xfb,0x4a,0xf3,0x92,0xf9,0x0f,0xe9, + 0x56,0x6f,0x4b,0xfa,0x79,0xe8,0x0b,0xf0, + 0x52,0xe9,0x35,0xed,0x8b,0xe9,0x75,0xec, + 0xad,0xea,0x6f,0xee,0xe0,0xed,0x8d,0xf0, + 0xba,0xf0,0x46,0xf3,0xf0,0xf3,0x41,0xf6, + 0x3b,0xf7,0x06,0xfa,0xff,0xfa,0x6d,0xfc, + 0x18,0xfd,0x22,0xfe,0x99,0xfe,0x40,0xff, + 0x84,0xff,0xd7,0xff,0xea,0xff,0x08,0x00, + 0x08,0x00,0x09,0x00,0x40,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x03,0x00,0x07,0x00,0x10,0x00,0x00,0x00, + 0x00,0x00,0xc3,0xff,0xb5,0xff,0x1e,0xff, + 0xed,0xfe,0xe8,0xfd,0x98,0xfd,0x10,0xfc, + 0xb3,0xfb,0x95,0xf9,0x6a,0xf8,0x57,0xf5, + 0x4c,0xf5,0xfa,0xf1,0x7a,0xf2,0xb6,0xee, + 0x23,0xf0,0xe8,0xeb,0xf7,0xed,0x8f,0xe8, + 0xe2,0xed,0x6d,0xe7,0x22,0xf0,0x26,0xe6, + 0x86,0xf6,0x9d,0xdd,0xc1,0x6a,0x08,0x0a, + 0x55,0xe9,0x13,0xfd,0x28,0xf3,0x16,0xfe, + 0xee,0xf8,0x73,0x00,0x48,0xfd,0x88,0x03, + 0x36,0x01,0xde,0x04,0xe7,0x02,0x5b,0x05, + 0xa8,0x03,0x1f,0x05,0xbd,0x03,0xb4,0x04, + 0xec,0x02,0x57,0x03,0x15,0x02,0x2f,0x02, + 0x3e,0x01,0x38,0x01,0x95,0x00,0x89,0x00, + 0x27,0x00,0x25,0x00,0x00,0x00,0x03,0x00, + 0xfc,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x17,0x00,0x06,0x00, + 0x2a,0x00,0x18,0x00,0x6c,0x00,0x4e,0x00, + 0xdd,0x00,0xa9,0x00,0x86,0x01,0x1f,0x01, + 0x7d,0x02,0xaf,0x02,0x20,0x04,0x9b,0x03, + 0x87,0x05,0x90,0x04,0xfd,0x06,0x68,0x05, + 0x25,0x08,0x47,0x05,0x69,0x09,0x27,0x05, + 0x09,0x0b,0xbf,0x03,0x37,0x0e,0x9c,0xfc, + 0x95,0x41,0x37,0x1a,0x11,0xff,0xb9,0x0b, + 0x88,0x02,0x7c,0x08,0xdb,0x02,0x6d,0x06, + 0x71,0x02,0x72,0x03,0x2d,0x00,0x00,0x02, + 0xc3,0xff,0x11,0x01,0x73,0xff,0x6a,0x00, + 0x54,0xff,0x32,0x00,0x3f,0xff,0xe3,0xff, + 0x5e,0xff,0xd6,0xff,0x87,0xff,0xdb,0xff, + 0xb2,0xff,0xe7,0xff,0xcf,0xff,0xef,0xff, + 0xea,0xff,0xfa,0xff,0xfb,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x40,0x00,0x01,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x17,0x00,0x06,0x00,0x2a,0x00,0x18,0x00, + 0x6c,0x00,0x4e,0x00,0xdd,0x00,0xa9,0x00, + 0x86,0x01,0x1f,0x01,0x7d,0x02,0xaf,0x02, + 0x20,0x04,0x9b,0x03,0x87,0x05,0x90,0x04, + 0xfd,0x06,0x68,0x05,0x25,0x08,0x47,0x05, + 0x69,0x09,0x27,0x05,0x09,0x0b,0xbf,0x03, + 0x37,0x0e,0x9c,0xfc,0x95,0x41,0x37,0x1a, + 0x11,0xff,0xb9,0x0b,0x88,0x02,0x7c,0x08, + 0xdb,0x02,0x6d,0x06,0x71,0x02,0x72,0x03, + 0x2d,0x00,0x00,0x02,0xc3,0xff,0x11,0x01, + 0x73,0xff,0x6a,0x00,0x54,0xff,0x32,0x00, + 0x3f,0xff,0xe3,0xff,0x5e,0xff,0xd6,0xff, + 0x87,0xff,0xdb,0xff,0xb2,0xff,0xe7,0xff, + 0xcf,0xff,0xef,0xff,0xea,0xff,0xfa,0xff, + 0xfb,0xff,0xff,0xff,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x40,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x03,0x00,0x07,0x00, + 0x10,0x00,0x00,0x00,0x00,0x00,0xc3,0xff, + 0xb5,0xff,0x1e,0xff,0xed,0xfe,0xe8,0xfd, + 0x98,0xfd,0x10,0xfc,0xb3,0xfb,0x95,0xf9, + 0x6a,0xf8,0x57,0xf5,0x4c,0xf5,0xfa,0xf1, + 0x7a,0xf2,0xb6,0xee,0x23,0xf0,0xe8,0xeb, + 0xf7,0xed,0x8f,0xe8,0xe2,0xed,0x6d,0xe7, + 0x22,0xf0,0x26,0xe6,0x86,0xf6,0x9d,0xdd, + 0xc1,0x6a,0x08,0x0a,0x55,0xe9,0x13,0xfd, + 0x28,0xf3,0x16,0xfe,0xee,0xf8,0x73,0x00, + 0x48,0xfd,0x88,0x03,0x36,0x01,0xde,0x04, + 0xe7,0x02,0x5b,0x05,0xa8,0x03,0x1f,0x05, + 0xbd,0x03,0xb4,0x04,0xec,0x02,0x57,0x03, + 0x15,0x02,0x2f,0x02,0x3e,0x01,0x38,0x01, + 0x95,0x00,0x89,0x00,0x27,0x00,0x25,0x00, + 0x00,0x00,0x03,0x00,0xfc,0xff,0xff,0xff, + 0x00,0x00,0x00,0x00,0x40,0x00,0x02,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xff, + 0xfe,0xff,0xfc,0xff,0x09,0x00,0x11,0x00, + 0x3b,0x00,0x5c,0x00,0xbe,0x00,0xee,0x00, + 0x84,0x01,0xc0,0x01,0x86,0x02,0xb9,0x02, + 0x98,0x03,0xca,0x03,0xda,0x04,0x07,0x04, + 0x13,0x05,0xf1,0x03,0xd9,0x04,0x03,0x03, + 0xd4,0x03,0x22,0x01,0x23,0x01,0xd9,0xfc, + 0x22,0xfe,0xa6,0xf8,0x25,0xfb,0x4a,0xf3, + 0x92,0xf9,0x0f,0xe9,0x56,0x6f,0x4b,0xfa, + 0x79,0xe8,0x0b,0xf0,0x52,0xe9,0x35,0xed, + 0x8b,0xe9,0x75,0xec,0xad,0xea,0x6f,0xee, + 0xe0,0xed,0x8d,0xf0,0xba,0xf0,0x46,0xf3, + 0xf0,0xf3,0x41,0xf6,0x3b,0xf7,0x06,0xfa, + 0xff,0xfa,0x6d,0xfc,0x18,0xfd,0x22,0xfe, + 0x99,0xfe,0x40,0xff,0x84,0xff,0xd7,0xff, + 0xea,0xff,0x08,0x00,0x08,0x00,0x09,0x00, + 0x40,0x00,0x01,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0xff,0xff,0xfc,0xff,0xf7,0xff, + 0xef,0xff,0xe7,0xff,0xdb,0xff,0xd4,0xff, + 0xca,0xff,0xbc,0xff,0xae,0xff,0xa4,0xff, + 0x98,0xff,0x99,0xff,0x90,0xff,0xbb,0xff, + 0xd3,0xff,0xcd,0xff,0x0e,0x00,0x3e,0x00, + 0x94,0x00,0xe2,0x00,0x53,0x01,0xbf,0x01, + 0xad,0x03,0x87,0x04,0xfc,0x04,0x96,0x05, + 0x11,0x06,0x96,0x06,0xfe,0x06,0x65,0x07, + 0xa1,0x47,0xe6,0x07,0xf4,0x07,0xf9,0x07, + 0xd8,0x07,0xad,0x07,0x60,0x07,0x07,0x07, + 0xa5,0x06,0xa1,0x06,0x05,0x06,0x81,0x05, + 0xd6,0x04,0x51,0x04,0xa2,0x03,0x36,0x03, + 0x53,0x02,0x79,0x01,0x49,0x01,0xed,0x00, + 0xb4,0x00,0x7a,0x00,0x53,0x00,0x33,0x00, + 0x1b,0x00,0x11,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x01,0x00,0x01,0x00, + 0x01,0x00,0x01,0x00,0x02,0x00,0x02,0x00, + 0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x5a,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xac,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x39,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0xc7,0xff, + 0x00,0x00,0x00,0x00,0x00,0x00,0x54,0xff, + 0x00,0x00,0x00,0x00" +} diff --git a/tools/topology/topology2/include/components/tdfb/line4_pass.conf b/tools/topology/topology2/include/components/tdfb/line4_pass.conf new file mode 100644 index 000000000000..d32da6170539 --- /dev/null +++ b/tools/topology/topology2/include/components/tdfb/line4_pass.conf @@ -0,0 +1,16 @@ +# Exported with script example_pass_config.m 23-Oct-2023 +# cd tools/tune/tdfb; octave --no-window-system example_pass_config.m +Object.Base.data."tdfb_config" { + bytes " + 0x53,0x4f,0x46,0x34,0x00,0x00,0x00,0x00, + 0x34,0x00,0x00,0x00,0x00,0xa0,0x01,0x03, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x34,0x00,0x00,0x00,0x04,0x00,0x04,0x00, + 0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x1e,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, + 0x02,0x00,0x03,0x00,0x01,0x00,0x02,0x00, + 0x04,0x00,0x08,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00" +} From a01fcc2f52c172c83356728da540bbb06ccd4026 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 20 Oct 2023 19:14:16 +0000 Subject: [PATCH 618/639] rimage/toml_utils.c: stop ignoring errors in parse_uuid() assert() that sscanf returns the expected value. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/src/toml_utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/rimage/src/toml_utils.c b/tools/rimage/src/toml_utils.c index 128286d7194b..674806e4817f 100644 --- a/tools/rimage/src/toml_utils.c +++ b/tools/rimage/src/toml_utils.c @@ -10,6 +10,7 @@ #include <rimage/toml_utils.h> #include <rimage/cavs/cavs_ext_manifest.h> +#include <assert.h> #include <errno.h> #include <string.h> #include <stdlib.h> @@ -294,8 +295,12 @@ void parse_uuid(char *buf, uint8_t *uuid) struct uuid_t id; uint32_t d[10]; + const int parsed_uuid_fields = sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); + + assert(parsed_uuid_fields == 11); + id.d1 = (uint16_t)d[0]; id.d2 = (uint16_t)d[1]; id.d3 = (uint8_t)d[2]; From c180e8cb958c1a59950b6390f6350bbdbae2c30b Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 20 Oct 2023 18:48:46 +0000 Subject: [PATCH 619/639] rimage/toml_utils.c: remove uint32_t d0 shortcut in parse_uuid() Fixes compilation failure with clang 15: rimage/src/toml_utils.c:297:67: error: taking address of packed member 'd0' of class or structure 'uuid_t' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, ^~~~ This also aligns indexes. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/src/toml_utils.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/rimage/src/toml_utils.c b/tools/rimage/src/toml_utils.c index 674806e4817f..5168591755f8 100644 --- a/tools/rimage/src/toml_utils.c +++ b/tools/rimage/src/toml_utils.c @@ -293,24 +293,25 @@ void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char void parse_uuid(char *buf, uint8_t *uuid) { struct uuid_t id; - uint32_t d[10]; + uint32_t d[11]; const int parsed_uuid_fields = - sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &id.d0, &d[0], - &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9]); + sscanf(buf, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", &d[0], + &d[1], &d[2], &d[3], &d[4], &d[5], &d[6], &d[7], &d[8], &d[9], &d[10]); assert(parsed_uuid_fields == 11); - id.d1 = (uint16_t)d[0]; - id.d2 = (uint16_t)d[1]; - id.d3 = (uint8_t)d[2]; - id.d4 = (uint8_t)d[3]; - id.d5 = (uint8_t)d[4]; - id.d6 = (uint8_t)d[5]; - id.d7 = (uint8_t)d[6]; - id.d8 = (uint8_t)d[7]; - id.d9 = (uint8_t)d[8]; - id.d10 = (uint8_t)d[9]; + id.d0 = d[0]; + id.d1 = (uint16_t)d[1]; + id.d2 = (uint16_t)d[2]; + id.d3 = (uint8_t)d[3]; + id.d4 = (uint8_t)d[4]; + id.d5 = (uint8_t)d[5]; + id.d6 = (uint8_t)d[6]; + id.d7 = (uint8_t)d[7]; + id.d8 = (uint8_t)d[8]; + id.d9 = (uint8_t)d[9]; + id.d10 = (uint8_t)d[10]; memcpy(uuid, &id, sizeof(id)); } From 20705ad4c1dde8c73d15da3c85a132d7a10abd24 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Fri, 20 Oct 2023 19:18:34 +0000 Subject: [PATCH 620/639] rimage/toml_utils: fix signature and doxygen of parse_uuid() Add missing `const` and warn that the endianness can't be relied on. Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- tools/rimage/src/include/rimage/toml_utils.h | 6 +++++- tools/rimage/src/toml_utils.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/rimage/src/include/rimage/toml_utils.h b/tools/rimage/src/include/rimage/toml_utils.h index cd17bb4af28d..22f257c2c65d 100644 --- a/tools/rimage/src/include/rimage/toml_utils.h +++ b/tools/rimage/src/include/rimage/toml_utils.h @@ -111,7 +111,11 @@ void parse_printable_key(const toml_table_t *table, struct parse_ctx *ctx, const void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char *key, char *dst, int capacity, int *error); -void parse_uuid(char *buf, uint8_t *uuid); +/** + * Parse UUID hex string into a byte array. The endianness of the output + * is architecture-dependent: do not use in any portable code. + */ +void parse_uuid(const char *buf, uint8_t *uuid); /** version is stored as toml array with integer number, something like: * "version = [1, 8]" diff --git a/tools/rimage/src/toml_utils.c b/tools/rimage/src/toml_utils.c index 5168591755f8..7570c5b1f7bb 100644 --- a/tools/rimage/src/toml_utils.c +++ b/tools/rimage/src/toml_utils.c @@ -290,7 +290,7 @@ void parse_str_key(const toml_table_t *table, struct parse_ctx *ctx, const char dst[capacity - 1] = 0; } -void parse_uuid(char *buf, uint8_t *uuid) +void parse_uuid(const char *buf, uint8_t *uuid) { struct uuid_t id; uint32_t d[11]; From 8ca07591c9786eb4c261d0e802f0ff286d4c8d84 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Thu, 26 Oct 2023 12:15:10 +0300 Subject: [PATCH 621/639] Tools: Test: Topology: Avoid dependence to platform/intel/bxt.m4 A simplified copy of previous bxt.m4 is made as local platform/generic.m4 with SSP and other platform definitions for test topologies build. It is included to test-all, test-capture, and test-playback macros definitions. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- tools/test/topology/platform/generic.m4 | 60 +++++++++++++++++++++++++ tools/test/topology/test-all.m4 | 4 +- tools/test/topology/test-capture.m4 | 5 +-- tools/test/topology/test-playback.m4 | 4 +- 4 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 tools/test/topology/platform/generic.m4 diff --git a/tools/test/topology/platform/generic.m4 b/tools/test/topology/platform/generic.m4 new file mode 100644 index 000000000000..49469d6b4b9d --- /dev/null +++ b/tools/test/topology/platform/generic.m4 @@ -0,0 +1,60 @@ +# +# Generic test platform values for pipelines and components +# + +undefine(`SSP_MCLK_RATE') +define(`SSP_MCLK_RATE', `19200000') + +undefine(`SSP1_BCLK') +define(`SSP1_BCLK', `1536000') + +undefine(`SSP_BCLK') +define(`SSP_BCLK', `1920000') + +undefine(`SSP_FSYNC') +define(`SSP_FSYNC', `48000') + +define(`SSP1_VALID_BITS_STR', `s16le') + +undefine(`SSP_BITS_WIDTH') +define(`SSP_BITS_WIDTH', `20') + +undefine(`SSP1_VALID_BITS') +define(`SSP1_VALID_BITS', `16') + +undefine(`SSP_VALID_BITS') +define(`SSP_VALID_BITS', `16') + +undefine(`MCLK_ID') +define(`MCLK_ID', `1') + +include(`memory.m4') + +dnl Memory capabilities for different buffer types +define(`PLATFORM_DAI_MEM_CAP', + MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) +define(`PLATFORM_HOST_MEM_CAP', + MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) +define(`PLATFORM_PASS_MEM_CAP', + MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) +define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) + +# Low Latency PCM Configuration +W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "50000"')) + +W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens) + +# Media PCM Configuration +W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "100000"')) + +W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens) + +# Tone Signal Generator Configuration +W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "200000"')) + +W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens) + +# DAI schedule Configuration - scheduled by IRQ +W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "5000"')) + +W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens) diff --git a/tools/test/topology/test-all.m4 b/tools/test/topology/test-all.m4 index 0187ba96d069..e30df5d5fe40 100644 --- a/tools/test/topology/test-all.m4 +++ b/tools/test/topology/test-all.m4 @@ -14,8 +14,8 @@ include(`common/tlv.m4') # Include Token library include(`sof/tokens.m4') -# Include Apollolake DSP configuration -include(`platform/intel/bxt.m4') +# Include generic DSP configuration +include(`platform/generic.m4') DEBUG_START diff --git a/tools/test/topology/test-capture.m4 b/tools/test/topology/test-capture.m4 index b7354544cb6b..b5a8deb7681c 100644 --- a/tools/test/topology/test-capture.m4 +++ b/tools/test/topology/test-capture.m4 @@ -6,7 +6,6 @@ include(`utils.m4') include(`dai.m4') include(`ssp.m4') -include(`dmic.m4') include(`pipeline.m4') # Include TLV library @@ -15,8 +14,8 @@ include(`common/tlv.m4') # Include Token library include(`sof/tokens.m4') -# Include Apollolake DSP configuration -include(`platform/intel/bxt.m4') +# Include generic DSP configuration +include(`platform/generic.m4') DEBUG_START diff --git a/tools/test/topology/test-playback.m4 b/tools/test/topology/test-playback.m4 index 0400583335df..48ed1f26af37 100644 --- a/tools/test/topology/test-playback.m4 +++ b/tools/test/topology/test-playback.m4 @@ -14,8 +14,8 @@ include(`common/tlv.m4') # Include Token library include(`sof/tokens.m4') -# Include Apollolake DSP configuration -include(`platform/intel/bxt.m4') +# Include generic DSP configuration +include(`platform/generic.m4') DEBUG_START From c6ba44228aca4455a72d73ba1d35eec632db4d18 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Wed, 25 Oct 2023 15:37:42 +0300 Subject: [PATCH 622/639] topology1: remove Intel GLK/TGL/ADL/RPL topology definitions These topologies are no longer supported by mainline firmware code for these platforms. The stable-v2.2 branch continues to support these targets with topology1. Also SOF main branch provides topology2 targets for a subset of these configurations. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- installer/GNUmakefile | 2 - tools/topology/topology1/CMakeLists.txt | 141 ----- .../topology1/development/CMakeLists.txt | 66 --- .../topology1/development/sof-hda-asrc.m4 | 202 ------- .../development/sof-hda-generic-kwd.m4 | 203 ------- .../development/sof-tgl-nocodec-ci.m4 | 280 --------- .../sof-tgl-nocodec-crossover-2way.m4 | 158 ------ .../sof-tgl-nocodec-crossover-4way.m4 | 264 --------- .../development/sof-tgl-nocodec-mux.m4 | 143 ----- .../topology1/dsp_enhancement/CMakeLists.txt | 46 -- .../topology1/kernel_dependent/CMakeLists.txt | 3 - .../kernel_dependent/v5.19/CMakeLists.txt | 90 --- .../topology/topology1/platform/intel/adl.m4 | 38 -- .../topology/topology1/platform/intel/bxt.m4 | 80 --- .../topology/topology1/platform/intel/dmic.m4 | 71 --- .../topology/topology1/platform/intel/ehl.m4 | 38 -- .../topology1/platform/intel/intel-boards.m4 | 32 -- .../platform/intel/intel-generic-bt.m4 | 80 --- .../platform/intel/intel-generic-dmic-kwd.m4 | 167 ------ .../platform/intel/intel-generic-dmic.m4 | 178 ------ .../platform/intel/intel-hdmi-ssp.m4 | 53 -- .../topology/topology1/platform/intel/rpl.m4 | 6 - .../topology/topology1/platform/intel/tgl.m4 | 38 -- tools/topology/topology1/sof-adl-nau8825.m4 | 400 ------------- tools/topology/topology1/sof-glk-es8336.m4 | 205 ------- .../topology1/sof-hda-generic-idisp.m4 | 129 ----- tools/topology/topology1/sof-hda-generic.m4 | 222 -------- .../sof-icl-rt711-rt1308-rt715-hdmi.m4 | 398 ------------- .../topology1/sof-smart-amplifier-nocodec.m4 | 56 -- .../topology1/sof-tgl-max98357a-rt5682.m4 | 531 ------------------ .../topology1/sof-tgl-max98373-rt5682.m4 | 257 --------- .../topology1/sof-tgl-rt1308-hdmi-ssp.m4 | 219 -------- .../topology1/sof-tgl-rt711-rt1308.m4 | 303 ---------- .../topology1/sof-tgl-sdw-max98373-rt5682.m4 | 246 -------- 34 files changed, 5345 deletions(-) delete mode 100644 tools/topology/topology1/development/sof-hda-asrc.m4 delete mode 100644 tools/topology/topology1/development/sof-hda-generic-kwd.m4 delete mode 100644 tools/topology/topology1/development/sof-tgl-nocodec-ci.m4 delete mode 100644 tools/topology/topology1/development/sof-tgl-nocodec-crossover-2way.m4 delete mode 100644 tools/topology/topology1/development/sof-tgl-nocodec-crossover-4way.m4 delete mode 100644 tools/topology/topology1/development/sof-tgl-nocodec-mux.m4 delete mode 100644 tools/topology/topology1/dsp_enhancement/CMakeLists.txt delete mode 100644 tools/topology/topology1/kernel_dependent/CMakeLists.txt delete mode 100644 tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt delete mode 100644 tools/topology/topology1/platform/intel/adl.m4 delete mode 100644 tools/topology/topology1/platform/intel/bxt.m4 delete mode 100644 tools/topology/topology1/platform/intel/dmic.m4 delete mode 100644 tools/topology/topology1/platform/intel/ehl.m4 delete mode 100644 tools/topology/topology1/platform/intel/intel-boards.m4 delete mode 100644 tools/topology/topology1/platform/intel/intel-generic-bt.m4 delete mode 100644 tools/topology/topology1/platform/intel/intel-generic-dmic-kwd.m4 delete mode 100644 tools/topology/topology1/platform/intel/intel-generic-dmic.m4 delete mode 100644 tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 delete mode 100644 tools/topology/topology1/platform/intel/rpl.m4 delete mode 100644 tools/topology/topology1/platform/intel/tgl.m4 delete mode 100644 tools/topology/topology1/sof-adl-nau8825.m4 delete mode 100644 tools/topology/topology1/sof-glk-es8336.m4 delete mode 100644 tools/topology/topology1/sof-hda-generic-idisp.m4 delete mode 100644 tools/topology/topology1/sof-hda-generic.m4 delete mode 100644 tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 delete mode 100644 tools/topology/topology1/sof-smart-amplifier-nocodec.m4 delete mode 100644 tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 delete mode 100644 tools/topology/topology1/sof-tgl-max98373-rt5682.m4 delete mode 100644 tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 delete mode 100644 tools/topology/topology1/sof-tgl-rt711-rt1308.m4 delete mode 100644 tools/topology/topology1/sof-tgl-sdw-max98373-rt5682.m4 diff --git a/installer/GNUmakefile b/installer/GNUmakefile index 3caaab5eb3b5..d041c5bd3c8f 100644 --- a/installer/GNUmakefile +++ b/installer/GNUmakefile @@ -301,10 +301,8 @@ COMPARE_REFS ?= /lib/firmware/intel checktree: cd ${STAGING_SOF_VERSION} && \ tree -a -v --dirsfirst . > ${BUILDS_ROOT}/staging_sof_tree.txt - # Update sof-cavs-nocodec.tplg when adding or removing a default platform diff -u tests/staging_sof${IPC_VERSION}_ref.txt ${BUILDS_ROOT}/staging_sof_tree.txt # Check two random topologies are there - test -f ${STAGING_SOF_TPLG}/sof-tgl-nocodec.tplg test -f ${STAGING_SOF_TPLG}/sof-imx8-wm8960.tplg for t in sof-ctl sof-logger sof-probes; do \ test -f ${STAGING_TOOLS}${VERSION_SUFFIX}/$${t}; done diff --git a/tools/topology/topology1/CMakeLists.txt b/tools/topology/topology1/CMakeLists.txt index 344285efe539..70b0bdd260de 100644 --- a/tools/topology/topology1/CMakeLists.txt +++ b/tools/topology/topology1/CMakeLists.txt @@ -1,7 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause file(GLOB TPLG_DEPS - platform/intel/*.m4 platform/common/*.m4 common/*.m4 m4/*.m4 @@ -21,144 +20,6 @@ add_custom_command(OUTPUT abi.h ) set(TPLGS - ## HDaudio codec topologies - "sof-hda-generic\;sof-hda-generic\;-DCHANNELS=0\;-DHSPROC=volume\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-1ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-1ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-3ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-4ch\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - ## end HDaudio codec topologies - - "sof-hda-generic-idisp\;sof-hda-generic-idisp\;-DCHANNELS=0\;-DDYNAMIC=1" - "sof-hda-generic-idisp\;sof-hda-generic-idisp-2ch\;-DCHANNELS=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic-idisp\;sof-hda-generic-idisp-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-cavs-nocodec\;sof-tgl-nocodec\;-DPLATFORM=tgl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" - "sof-cavs-nocodec\;sof-tgl-h-nocodec\;-DPLATFORM=tgl\;-DNCORES=2\;-DDYNAMIC=1" - "sof-cavs-nocodec\;sof-ehl-nocodec\;-DPLATFORM=ehl\;-DDYNAMIC=1" - "sof-cavs-nocodec\;sof-adl-nocodec\;-DPLATFORM=adl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" - "sof-cavs-nocodec\;sof-rpl-nocodec\;-DPLATFORM=rpl\;-DDMIC_48k_CORE_ID=1\;-DSSP0_CORE_ID=2\;-DSSP1_CORE_ID=3\;-DDYNAMIC=1" - - ## SoundWire topologies - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-rt1308-mono-rt715\;-DPLATFORM=tgl\;-DMONO\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-l0-rt1316-l1-mono-rt714-l3\;-DPLATFORM=tgl\;-DMONO\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt715-rt711-rt1308-mono\;-DPLATFORM=tgl\;-DMONO\;-DUAJ_LINK=1\;-DAMP_1_LINK=2\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-rt1308-rt715\;-DPLATFORM=tgl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-rt1316-rt714\;-DPLATFORM=tgl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1308-l12-rt715-l3\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DNOAMP\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DNOAMP\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" - ## end SoundWire topologies - - ## SoundWire NOJACK topologies - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l1-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" - ## end SoundWire NOJACK topologies - - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-waves-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D2CH_2WAY\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98357a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-D4CH_PASSTHROUGH\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-waves-spk-only\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DWAVES_SPK_ONLY" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-2way-pdm1\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D2CH_2WAY\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-4ch\;-DCODEC=MAX98360A_TDM\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-D4CH_PASSTHROUGH\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-rt5682-rtnr-google-aec\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-google-aec\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING" - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-pdm1-drceq\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DDMIC_DAI_LINK_16k_PDM=STEREO_PDM1\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DDRC_EQ" - "sof-tgl-max98357a-rt5682\;sof-tgl-rt1011-rt5682\;-DCODEC=RT1011\;-DFMT=s24le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1" - "sof-tgl-max98357a-rt5682\;sof-tgl-max98357a-rt5682-rtnr\;-DCODEC=MAX98357A\;-DFMT=s16le\;-DPLATFORM=tgl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DCHANNELS=2\;-DRTNR" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DRTNR\;-DNOHOTWORD\;-DDMICPROC=rtnr\;-DNO16KDMIC\;-DDMIC_48k_CORE_ID=1\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-rt5682-rtnr-google-aec\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DCHANNELS=2\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DRTNR\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-max98390-ssp2-rt5682-ssp0\;-DCODEC=MAX98390\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=2\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-rt5682\;-DNO_AMP\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-rt1019-rt5682-waves\;-DCODEC=RT1019\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DWAVES\;-DBT_OFFLOAD" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DDYNAMIC=1" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98357a-rt5682\;sof-adl-cs35l41-google-aec-waves\;-DCODEC=CS35L41\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_ssp_amp\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DNO_HEADPHONE\;-DGOOGLE_RTC_AUDIO_PROCESSING\;-DWAVES\;-DNOHOTWORD\;-DNO16KDMIC\;-DSPK_MIC_PERIOD_US=10000" - "sof-tgl-max98357a-rt5682\;sof-adl-max98360a-da7219\;-DUSE_DA7219\;-DCODEC=MAX98360A\;-DFMT=s32le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98357a-rt5682\;sof-adl-rt5650\;-DUSE_RT5650\;-DFMT=s24le\;-DPLATFORM=adl\;-DLINUX_MACHINE_DRIVER=sof_rt5682\;-DAMP_SSP=1\;-DSPK_MIC_PERIOD_US=10000\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC" - "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682\;-DAMP_SSP=1" - "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-igonr\;-DAMP_SSP=1\;-DIGO" - "sof-tgl-max98373-rt5682\;sof-tgl-max98373-rt5682-xperi\;-DAMP_SSP=1\;-DINCLUDE_IIR_EQ=1" - "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2\;-DAMP_SSP=2" - "sof-tgl-max98373-rt5682\;sof-tgl-rt5682-ssp0-max98373-ssp2-xperi\;-DAMP_SSP=2\;-DINCLUDE_IIR_EQ=1" - "sof-adl-nau8825\;sof-adl-nau8825\;-DNO_AMP\;-DBT_OFFLOAD\;-DDYNAMIC=1" - "sof-adl-nau8825\;sof-adl-max98373-nau8825\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDYNAMIC=1" - "sof-adl-nau8825\;sof-adl-max98373-nau8825-dts\;-DAMP_SSP=1\;-DSMART_AMP\;-DBT_OFFLOAD\;-DNOHOTWORD\;-DNO16KDMIC\;-DDTS=`DTS'" - "sof-adl-nau8825\;sof-adl-max98360a-nau8825\;-DCODEC=MAX98360A\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" - "sof-adl-nau8825\;sof-adl-rt1019-nau8825\;-DCODEC=RT1019P\;-DFMT=s16le\;-DAMP_SSP=2\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" - "sof-adl-nau8825\;sof-adl-rt1015-nau8825\;-DCODEC=RT1015P\;-DFMT=s32le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" - "sof-adl-nau8825\;sof-adl-nau8318-nau8825\;-DCODEC=NAU8318\;-DFMT=s16le\;-DAMP_SSP=1\;-DBT_OFFLOAD\;-DSPK_MIC_PERIOD_US=10000\;-DDYNAMIC=1" - "sof-tgl-sdw-max98373-rt5682\;sof-tgl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=tgl" - "sof-tgl-sdw-max98373-rt5682\;sof-adl-sdw-max98373-rt5682\;-DCHANNELS=4\;-DPLATFORM=adl\;-DDYNAMIC=1" - "sof-smart-amplifier-nocodec\;sof-smart-amplifier-nocodec" - - "sof-glk-es8336\;sof-tgl-es8336\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-tgl-es8336-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=0" - "sof-glk-es8336\;sof-tgl-es8336-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=0" - "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-dmic2ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=2" - "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp0\;-DPLATFORM=tgl\;-DSSP_NUM=0\;-DCHANNELS=4" - "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp1\;-DPLATFORM=tgl\;-DSSP_NUM=1\;-DCHANNELS=4" - "sof-glk-es8336\;sof-tgl-es8336-dmic4ch-ssp2\;-DPLATFORM=tgl\;-DSSP_NUM=2\;-DCHANNELS=4" - - "sof-glk-es8336\;sof-adl-es8336\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-adl-es8336-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=0" - "sof-glk-es8336\;sof-adl-es8336-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0" - "sof-glk-es8336\;sof-adl-es8336-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=0" - "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=2" - "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=2" - "sof-glk-es8336\;sof-adl-es8336-dmic2ch-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=2" - "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp0\;-DPLATFORM=adl\;-DSSP_NUM=0\;-DCHANNELS=4" - "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp1\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=4" - "sof-glk-es8336\;sof-adl-es8336-dmic4ch-ssp2\;-DPLATFORM=adl\;-DSSP_NUM=2\;-DCHANNELS=4" - - #sof-adl-es8336-ssp1-hdmi-ssp02 supports es8336 codec along with 2xHDMI_over_SSP Capture's. - "sof-glk-es8336\;sof-adl-es8336-ssp1-hdmi-ssp02\;-DPLATFORM=adl\;-DSSP_NUM=1\;-DCHANNELS=0\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2" - - #To support HDMI-in capture with RT1308 ssp-amplifier products. - "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-rt1308-ssp2-hdmi-ssp15\;-DAMP_SSP_NUM=2\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" - #Topologies for No SSP-amp or codec+HDMI-IN capture support. - "sof-tgl-rt1308-hdmi-ssp\;sof-tgl-nocodec-hdmi-ssp15\;-DNO_AMP\;-DHDMI_1_SSP_NUM=1\;-DHDMI_2_SSP_NUM=5\;-DPLATFORM=tgl" - "sof-tgl-rt1308-hdmi-ssp\;sof-adl-nocodec-hdmi-ssp02\;-DNO_AMP\;-DHDMI_1_SSP_NUM=0\;-DHDMI_2_SSP_NUM=2\;-DPLATFORM=adl" - ## i.MX8 (i.MX8QM and i.MX8QXP) topologies "sof-imx8-nocodec\;sof-imx8-nocodec" "sof-imx8-wm8960-cs42888\;sof-imx8-wm8960-cs42888" @@ -289,5 +150,3 @@ foreach(tplg ${TPLGS}) endforeach() add_subdirectory(development) -add_subdirectory(dsp_enhancement) -add_subdirectory(kernel_dependent) diff --git a/tools/topology/topology1/development/CMakeLists.txt b/tools/topology/topology1/development/CMakeLists.txt index 37b4b956afbc..288820b73d94 100644 --- a/tools/topology/topology1/development/CMakeLists.txt +++ b/tools/topology/topology1/development/CMakeLists.txt @@ -19,40 +19,9 @@ set(TPLGS "sof-imx8mp-compr-wm8960\;sof-imx8mp-compr-wm8960\;-DCODEC=wm8960\;-DRATE=48000" "sof-imx8mp-compr-wm8960\;sof-imx8mp-compr-wm8962\;-DCODEC=wm8962\;-DRATE=48000" ## end i.MX8MP topologies - - "sof-hda-asrc\;sof-hda-asrc-2ch\;-DCHANNELS=2" - "sof-tgl-nocodec-ci\;sof-tgl-nocodec-ci" - "sof-tgl-nocodec-ci\;sof-adl-nocodec-ci" - "sof-tgl-nocodec-mux\;sof-tgl-nocodec-mux" - "sof-tgl-nocodec-crossover-4way\;sof-tgl-nocodec-crossover-4way" - "sof-tgl-nocodec-crossover-2way\;sof-tgl-nocodec-crossover-2way" - "sof-hda-generic-kwd\;sof-hda-generic-2ch-kwd\;-DCHANNELS=2\;-DDYNAMIC=1" - "sof-hda-generic-kwd\;sof-hda-generic-4ch-kwd\;-DCHANNELS=4\;-DDYNAMIC=1" ) -# The topologies those are built from topology in the parent directory -set(TPLGS_UP - "sof-hda-generic\;sof-hda-generic-tdfb_50mm-2ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMIC16KPROC=tdfb-eq-iir-volume\;-DDMIC16KPROC_FILTER1=tdfb/coef_line2_50mm_azm90_90_13el0_0_13deg_16khz.m4\;-DDMICPROC=tdfb-eq-iir-volume\;-DDMICPROC_FILTER1=tdfb/coef_line2_50mm_azm90_90_13el0_0_13deg_48khz.m4\;-DDMICPROC_FILTER2=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER2=eq_iir_coef_highpass_40hz_20db_16khz.m4" - "sof-hda-generic\;sof-hda-generic-tdfb_68mm-2ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMIC16KPROC=tdfb-eq-iir-volume\;-DDMIC16KPROC_FILTER1=tdfb/coef_line2_68mm_azm90_90_13el0_0_13deg_16khz.m4\;-DDMICPROC=tdfb-eq-iir-volume\;-DDMICPROC_FILTER1=tdfb/coef_line2_68mm_azm90_90_13el0_0_13deg_48khz.m4\;-DDMICPROC_FILTER2=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER2=eq_iir_coef_highpass_40hz_20db_16khz.m4" - "sof-hda-generic\;sof-hda-generic-tdfb_0mm36mm146mm182mm-4ch\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMIC16KPROC=tdfb-eq-iir-volume\;-DDMIC16KPROC_FILTER1=tdfb/coef_line4_0mm36mm146mm182mm_azm90_90_13el0_0_13deg_16khz.m4\;-DDMICPROC=tdfb-eq-iir-volume\;-DDMICPROC_FILTER1=tdfb/coef_line4_0mm36mm146mm182mm_azm90_90_13el0_0_13deg_48khz.m4\;-DDMICPROC_FILTER2=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER2=eq_iir_coef_highpass_40hz_20db_16khz.m4" - "sof-hda-generic\;sof-hda-generic-iir\;-DCHANNELS=0\;-DHSPROC=eq-iir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-iir-2ch\;-DCHANNELS=2\;-DHSPROC=eq-iir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-iir-4ch\;-DCHANNELS=4\;-DHSPROC=eq-iir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-iir-fir\;-DCHANNELS=0\;-DHSPROC=eq-iir-eq-fir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DHSPROC_FILTER2=eq_fir_coef_pass.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-iir-fir-2ch\;-DCHANNELS=2\;-DHSPROC=eq-iir-eq-fir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DHSPROC_FILTER2=eq_fir_coef_pass.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-iir-fir-4ch\;-DCHANNELS=4\;-DHSPROC=eq-iir-eq-fir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DHSPROC_FILTER2=eq_fir_coef_pass.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-multiband-drc\;-DCHANNELS=0\;-DHSPROC=multiband-drc\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch-multiband-drc\;-DCHANNELS=2\;-DHSPROC=multiband-drc\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-drc\;-DCHANNELS=0\;-DHSPROC=drc\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch-drc\;-DCHANNELS=2\;-DHSPROC=drc\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch-mfcc\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1\;-DDMIC16KPROC=eq-iir-mfcc" - "sof-tgl-rt711-rt1308\;sof-tgl-sdw-max98373-rt5682-dmic4ch-ampref\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-hda-generic\;sof-hda-generic-src\;-DCHANNELS=0\;-DHSSFX=src-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4" - "sof-hda-generic\;sof-hda-generic-2ch-src\;-DCHANNELS=2\;-DHSSFX=src-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4" - "sof-hda-generic\;sof-hda-generic-4ch-src\;-DCHANNELS=4\;-DHSSFX=src-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4" -) - add_custom_target(dev_topologies1 ALL) foreach(tplg ${TPLGS}) @@ -90,38 +59,3 @@ foreach(tplg ${TPLGS}) add_custom_target(dev_topology_${output} DEPENDS ${output}.tplg) add_dependencies(dev_topologies1 dev_topology_${output}) endforeach() - -# Duplicate of above to handle topologies in parent directory -foreach(tplg ${TPLGS_UP}) - list(GET tplg 0 input) - list(GET tplg 1 output) - list(LENGTH tplg tplg_len) - math(EXPR num_args "${tplg_len} - 1") - set(DEFINES "") - if (${num_args} GREATER 1) - foreach(index RANGE 2 ${num_args}) - list(GET tplg ${index} custom_define) - list(APPEND DEFINES ${custom_define}) - endforeach() - endif() - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf - COMMAND m4 --fatal-warnings - ${DEFINES} - -I ${CMAKE_CURRENT_SOURCE_DIR}/../m4 - -I ${CMAKE_CURRENT_SOURCE_DIR}/../common - -I ${CMAKE_CURRENT_SOURCE_DIR}/../platform/common - -I ${CMAKE_CURRENT_SOURCE_DIR}/../ - -I ${CMAKE_CURRENT_BINARY_DIR}/../ - ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 - ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.m4 - > ${output}.conf - DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h - VERBATIM - USES_TERMINAL - ) - add_alsatplg_command(${output}.conf ${output}.tplg) - - add_custom_target(topology_${output} DEPENDS ${output}.tplg) - add_dependencies(dev_topologies1 topology_${output}) -endforeach() diff --git a/tools/topology/topology1/development/sof-hda-asrc.m4 b/tools/topology/topology1/development/sof-hda-asrc.m4 deleted file mode 100644 index d91fb862c3ad..000000000000 --- a/tools/topology/topology1/development/sof-hda-asrc.m4 +++ /dev/null @@ -1,202 +0,0 @@ -# -# Topology for SKL+ HDA for testing ASRC -# - -# if XPROC is not defined, define with default pipe -ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include bxt DSP configuration -include(`platform/intel/bxt.m4') - -DEBUG_START - -# Define pipeline id for intel-generic-dmic.m4 -# to generate dmic setting - -ifelse(CHANNELS, `0', , -` -define(DMIC_PCM_48k_ID, `6') -define(DMIC_PCM_16k_ID, `7') -define(DMIC_DAI_LINK_48k_ID, `6') -define(DMIC_DAI_LINK_16k_ID, `7') -define(DMIC_PIPELINE_48k_ID, `10') -define(DMIC_PIPELINE_16k_ID, `11') - -include(`platform/intel/intel-generic-dmic.m4') -' -) - -# -# Define the pipelines -# -# PCM0 <---> volume (pipe 1,2) <----> HDA Analog (HDA Analog playback/capture) -# PCM1 <---> volume (pipe 3,4) <----> HDA Digital (HDA Digital playback/capture) -# PCM3 ----> volume (pipe 7) -----> iDisp1 (HDMI/DP playback, BE link 3) -# PCM4 ----> Volume (pipe 8) -----> iDisp2 (HDMI/DP playback, BE link 4) -# PCM5 ----> volume (pipe 9) -----> iDisp3 (HDMI/DP playback, BE link 5) -# - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-asrc-volume-playback.m4, - 1, 0, 2, s24le, - 1000, 0, 0, - 8000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-asrc-volume-capture.m4, - 2, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 3 on PCM 1 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 1, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 4 on PCM 1 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 4, 1, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 3 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 3, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 4 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 4, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 9 on PCM 5 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 9, 5, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -# playback DAI is HDA Analog using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, HDA, 0, Analog Playback and Capture, - PIPELINE_SOURCE_1, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is HDA Analog using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, HDA, 1, Analog Playback and Capture, - PIPELINE_SINK_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is HDA Digital using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, HDA, 2, Digital Playback and Capture, - PIPELINE_SOURCE_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is HDA Digital using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 4, HDA, 3, Digital Playback and Capture, - PIPELINE_SINK_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 4, iDisp1, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 5, iDisp2, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 9, HDA, 6, iDisp3, - PIPELINE_SOURCE_9, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -PCM_DUPLEX_ADD(HDA Analog, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_DUPLEX_ADD(HDA Digital, 1, PIPELINE_PCM_3, PIPELINE_PCM_4) -PCM_PLAYBACK_ADD(HDMI1, 3, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI2, 4, PIPELINE_PCM_8) -PCM_PLAYBACK_ADD(HDMI3, 5, PIPELINE_PCM_9) - -# -# BE configurations - overrides config in ACPI if present -# - -# HDA outputs -DAI_CONFIG(HDA, 0, 4, Analog Playback and Capture, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 5, Digital Playback and Capture, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 4, 1, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2))) -DAI_CONFIG(HDA, 5, 2, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) -DAI_CONFIG(HDA, 6, 3, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2))) - - -VIRTUAL_DAPM_ROUTE_IN(codec0_in, HDA, 1, IN, 1) -VIRTUAL_DAPM_ROUTE_IN(codec1_in, HDA, 3, IN, 2) -VIRTUAL_DAPM_ROUTE_OUT(codec0_out, HDA, 0, OUT, 3) -VIRTUAL_DAPM_ROUTE_OUT(codec1_out, HDA, 2, OUT, 4) - -# codec2 is not supported in dai links but it exists -# in dapm routes, so hack this one to HDA1 -VIRTUAL_DAPM_ROUTE_IN(codec2_in, HDA, 3, IN, 5) -VIRTUAL_DAPM_ROUTE_OUT(codec2_out, HDA, 2, OUT, 6) - -VIRTUAL_DAPM_ROUTE_OUT(iDisp1_out, HDA, 4, OUT, 7) -VIRTUAL_DAPM_ROUTE_OUT(iDisp2_out, HDA, 5, OUT, 8) -VIRTUAL_DAPM_ROUTE_OUT(iDisp3_out, HDA, 6, OUT, 9) - -VIRTUAL_WIDGET(iDisp3 Tx, out_drv, 0) -VIRTUAL_WIDGET(iDisp2 Tx, out_drv, 1) -VIRTUAL_WIDGET(iDisp1 Tx, out_drv, 2) -VIRTUAL_WIDGET(Analog CPU Playback, out_drv, 3) -VIRTUAL_WIDGET(Digital CPU Playback, out_drv, 4) -VIRTUAL_WIDGET(Alt Analog CPU Playback, out_drv, 5) -VIRTUAL_WIDGET(Analog CPU Capture, input, 6) -VIRTUAL_WIDGET(Digital CPU Capture, input, 7) -VIRTUAL_WIDGET(Alt Analog CPU Capture, input, 8) - -DEBUG_END diff --git a/tools/topology/topology1/development/sof-hda-generic-kwd.m4 b/tools/topology/topology1/development/sof-hda-generic-kwd.m4 deleted file mode 100644 index 284aa7a6f37d..000000000000 --- a/tools/topology/topology1/development/sof-hda-generic-kwd.m4 +++ /dev/null @@ -1,203 +0,0 @@ -# Topology for SKL+ HDA Generic machine -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include bxt DSP configuration -include(`platform/intel/bxt.m4') - - - - - -# -# Define the pipelines -# -# PCM0 <---> volume (pipe 1,2) <----> HDA Analog (HDA Analog playback/capture) -# PCM1 <---> volume (pipe 3,4) <----> HDA Digital (HDA Digital playback/capture) -# PCM3 ----> volume (pipe 7) -----> iDisp1 (HDMI/DP playback, BE link 3) -# PCM4 ----> Volume (pipe 8) -----> iDisp2 (HDMI/DP playback, BE link 4) -# PCM5 ----> volume (pipe 9) -----> iDisp3 (HDMI/DP playback, BE link 5) -# PCM6 <---- Volume (pipe 10) <----- DMIC01 -# PCM7 <---- KWD (pipe 11/12) <----- DMIC16K (KWD) -# - -# Define pipeline id for intel-generic-dmic-kwd.m4 -# to generate dmic setting with kwd when we have dmic -# define kfbm without volume -# define pcm to 6,7, pipeline to 10,11,12 and dai id to 6,7 -ifelse(CHANNELS, `0', , -` -define(KFBM_TYPE, `vol-kfbm') -define(DMIC_PCM_48k_ID, `6') -define(DMIC_PCM_16k_ID, `7') -define(DMIC_PIPELINE_48k_ID, `10') -define(DMIC_PIPELINE_16k_ID, `11') -define(DMIC_PIPELINE_KWD_ID, `12') -define(DMIC_DAI_LINK_48k_ID, `6') -define(DMIC_DAI_LINK_16k_ID, `7') -define(KWD_PIPE_SCH_DEADLINE_US, 20000) - -include(`platform/intel/intel-generic-dmic-kwd.m4') -' -) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 3 on PCM 1 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 1, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 4 on PCM 1 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 4, 1, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 3 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 3, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 4 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 4, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 9 on PCM 5 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 9, 5, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -# playback DAI is HDA Analog using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, HDA, 0, Analog Playback and Capture, - PIPELINE_SOURCE_1, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is HDA Analog using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, HDA, 1, Analog Playback and Capture, - PIPELINE_SINK_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is HDA Digital using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, HDA, 2, Digital Playback and Capture, - PIPELINE_SOURCE_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is HDA Digital using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 4, HDA, 3, Digital Playback and Capture, - PIPELINE_SINK_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 4, iDisp1, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 5, iDisp2, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 9, HDA, 6, iDisp3, - PIPELINE_SOURCE_9, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -PCM_DUPLEX_ADD(HDA Analog, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_DUPLEX_ADD(HDA Digital, 1, PIPELINE_PCM_3, PIPELINE_PCM_4) -PCM_PLAYBACK_ADD(HDMI1, 3, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI2, 4, PIPELINE_PCM_8) -PCM_PLAYBACK_ADD(HDMI3, 5, PIPELINE_PCM_9) - -# -# BE configurations - overrides config in ACPI if present -# - -# HDA outputs -DAI_CONFIG(HDA, 0, 4, Analog Playback and Capture, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 5, Digital Playback and Capture, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 4, 1, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2))) -DAI_CONFIG(HDA, 5, 2, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) -DAI_CONFIG(HDA, 6, 3, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2))) - - -VIRTUAL_DAPM_ROUTE_IN(codec0_in, HDA, 1, IN, 1) -VIRTUAL_DAPM_ROUTE_IN(codec1_in, HDA, 3, IN, 2) -VIRTUAL_DAPM_ROUTE_OUT(codec0_out, HDA, 0, OUT, 3) -VIRTUAL_DAPM_ROUTE_OUT(codec1_out, HDA, 2, OUT, 4) - -# codec2 is not supported in dai links but it exists -# in dapm routes, so hack this one to HDA1 -VIRTUAL_DAPM_ROUTE_IN(codec2_in, HDA, 3, IN, 5) -VIRTUAL_DAPM_ROUTE_OUT(codec2_out, HDA, 2, OUT, 6) - -VIRTUAL_DAPM_ROUTE_OUT(iDisp1_out, HDA, 4, OUT, 7) -VIRTUAL_DAPM_ROUTE_OUT(iDisp2_out, HDA, 5, OUT, 8) -VIRTUAL_DAPM_ROUTE_OUT(iDisp3_out, HDA, 6, OUT, 9) - -VIRTUAL_WIDGET(iDisp3 Tx, out_drv, 0) -VIRTUAL_WIDGET(iDisp2 Tx, out_drv, 1) -VIRTUAL_WIDGET(iDisp1 Tx, out_drv, 2) -VIRTUAL_WIDGET(Analog CPU Playback, out_drv, 3) -VIRTUAL_WIDGET(Digital CPU Playback, out_drv, 4) -VIRTUAL_WIDGET(Alt Analog CPU Playback, out_drv, 5) -VIRTUAL_WIDGET(Analog CPU Capture, input, 6) -VIRTUAL_WIDGET(Digital CPU Capture, input, 7) -VIRTUAL_WIDGET(Alt Analog CPU Capture, input, 8) diff --git a/tools/topology/topology1/development/sof-tgl-nocodec-ci.m4 b/tools/topology/topology1/development/sof-tgl-nocodec-ci.m4 deleted file mode 100644 index c53242f9a73d..000000000000 --- a/tools/topology/topology1/development/sof-tgl-nocodec-ci.m4 +++ /dev/null @@ -1,280 +0,0 @@ -# -# Topology for Tigerlake RVP board CI testing, with covering as more -# features as possible running with no codec machine. -# -# TGL Host GW DMAC support max 6 playback and max 6 capture channels so some -# pipelines/PCMs/DAIs are commented out to keep within HW bounds. If these -# are needed then they can be used provided other PCMs/pipelines/SSPs are -# commented out in their place. - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`ssp.m4') -include(`muxdemux.m4') -include(`pipeline.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/tgl.m4') -include(`platform/intel/dmic.m4') - - -# -# Define the demux configure -# -dnl Configure demux -dnl name, pipeline_id, routing_matrix_rows -dnl Diagonal 1's in routing matrix mean that every input channel is -dnl copied to corresponding output channels in all output streams. -dnl I.e. row index is the input channel, 1 means it is copied to -dnl corresponding output channel (column index), 0 means it is discarded. -dnl There's a separate matrix for all outputs. -define(matrix1, `ROUTE_MATRIX(1, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -define(matrix2, `ROUTE_MATRIX(7, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -dnl name, num_streams, route_matrix list -MUXDEMUX_CONFIG(demux_priv_1, 2, LIST_NONEWLINE(`', `matrix1,', `matrix2')) - -# -# Define the pipelines -# -# PCM0 --> volume --> demux --> SSP0 -# | | -# PCM3 <----------------+ | -# PCM0 <-------------------------+ -# PCM1 <---> Volume <----> SSP1 -# PCM2 ----> smart_amp ----> SSP(SSP_INDEX) -# ^ -# | -# | -# PCM2 <---- demux <----- SSP(SSP_INDEX) -# PCM4 <---- volume <---- DMIC01 (dmic 48k capture) -# PCM5 <---- volume <---- DMIC16k (dmic 16k capture) -# - -# Smart amplifier related -# SSP related -#define smart amplifier SSP index -define(`SMART_SSP_INDEX', 2) -#define SSP BE dai_link name -define(`SMART_SSP_NAME', `NoCodec-2') -#define BE dai_link ID -define(`SMART_BE_ID', 2) -#define SSP QUIRK -define(`SMART_SSP_QUIRK', `SSP_QUIRK_LBM') -#define SSP_MCLK -define(`SSP_MCLK', 38400000) - -# Playback related -define(`SMART_PB_PPL_ID', 5) -define(`SMART_PB_CH_NUM', 2) -define(`SMART_TX_CHANNELS', 4) -define(`SMART_RX_CHANNELS', 8) -define(`SMART_FB_CHANNELS', 8) -# Ref capture related -define(`SMART_REF_PPL_ID', 6) -define(`SMART_REF_CH_NUM', 4) -# PCM related -define(`SMART_PCM_ID', 2) -define(`SMART_PCM_NAME', `smart-nocodec') - -# run smart amp pipelines on DSP core 1 -define(`SMART_AMP_CORE', 1) - -# Include Smart Amplifier support -include(`sof-smart-amplifier.m4') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, - 1, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Volume-switch capture pipeline 2 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, - 2, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 3 on PCM 1 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 1, 2, s16le, - 1000, 0, 3, - 48000, 48000, 48000) - -# Low Latency capture pipeline 4 on PCM 1 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline on core 3 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 4, 1, 2, s16le, - 1000, 0, 3, - 48000, 48000, 48000) - -# Capture pipeline 7 from demux on PCM 6 using max 2 channels of s32le. -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture-sched.m4, - 7, 3, 2, s32le, - 1000, 1, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Passthrough capture pipeline 8 on PCM 4 using max 2 channels. -# 1000us deadline on core 2 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 8, 4, 2, s32le, - 1000, 0, 2, - 48000, 48000, 48000) - -# Passthrough capture pipeline 9 on PCM 5 using max 2 channels. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 9, 5, 2, s32le, - 1000, 0, 0, - 16000, 16000, 16000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, 0, NoCodec-0, - PIPELINE_SOURCE_1, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, 0, NoCodec-0, - PIPELINE_SINK_2, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# Connect demux to capture -SectionGraph."PIPE_CAP" { - index "0" - - lines [ - # mux to capture - dapm(PIPELINE_SINK_7, PIPELINE_DEMUX_1) - ] -} - -# Connect virtual capture to dai -SectionGraph."PIPE_CAP_VIRT" { - index "7" - - lines [ - # mux to capture - dapm(ECHO REF 7, SSP0.IN) - ] -} - -# playback DAI is SSP1 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 3 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, SSP, 1, NoCodec-1, - PIPELINE_SOURCE_3, 2, s16le, - 1000, 0, 3, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP1 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 3 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 4, SSP, 1, NoCodec-1, - PIPELINE_SINK_4, 2, s16le, - 1000, 0, 3, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC 0 using 2 periods -# Buffers use s32le format, 1000us deadline on core 2 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 8, DMIC, 0, NoCodec-6, - PIPELINE_SINK_8, 2, s32le, - 1000, 0, 2, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC 1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 9, DMIC, 1, NoCodec-7, - PIPELINE_SINK_9, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) -PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) -PCM_DUPLEX_ADD(Port1, 1, PIPELINE_PCM_3, PIPELINE_PCM_4) -PCM_CAPTURE_ADD(FWEchoRef, 3, PIPELINE_PCM_7) -PCM_CAPTURE_ADD(DMIC, 4, PIPELINE_PCM_8) -PCM_CAPTURE_ADD(DMIC16kHz, 5, PIPELINE_PCM_9) - -# -# BE configurations - overrides config in ACPI if present -# - -DAI_CONFIG(SSP, 0, 0, NoCodec-0, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, SSP_QUIRK_LBM))) - -DAI_CONFIG(SSP, 1, 1, NoCodec-1, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 1, 24, 0, SSP_QUIRK_LBM))) - -DAI_CONFIG(DMIC, 0, 6, NoCodec-6, - dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max, - dnl sample_rate, fifo word length, unmute time, type, - dnl dai_index, pdm controller config) - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, - dnl PDM_CONFIG(type, dai_index, num pdm active, pdm tuples list) - dnl STEREO_PDM0 is a pre-defined pdm config for stereo capture - PDM_CONFIG(DMIC, 0, STEREO_PDM0))) - -DAI_CONFIG(DMIC, 1, 7, NoCodec-7, - dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max, - dnl sample_rate, fifo word length, unmute time, type, - dnl dai_index, pdm controller config) - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - dnl PDM_CONFIG(type, dai_index, num pdm active, pdm tuples list) - dnl STEREO_PDM0 is a pre-defined pdm config for stereo capture - PDM_CONFIG(DMIC, 1, STEREO_PDM0))) diff --git a/tools/topology/topology1/development/sof-tgl-nocodec-crossover-2way.m4 b/tools/topology/topology1/development/sof-tgl-nocodec-crossover-2way.m4 deleted file mode 100644 index 77e9cd99e832..000000000000 --- a/tools/topology/topology1/development/sof-tgl-nocodec-crossover-2way.m4 +++ /dev/null @@ -1,158 +0,0 @@ -# -# Topology for Tigerlake RVP board CI testing, with covering as more -# features as possible running with no codec machine. -# -# TGL Host GW DMAC support max 6 playback and max 6 capture channels so some -# pipelines/PCMs/DAIs are commented out to keep within HW bounds. If these -# are needed then they can be used provided other PCMs/pipelines/SSPs are -# commented out in their place. - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`ssp.m4') -include(`crossover.m4') -include(`bytecontrol.m4') -include(`pipeline.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/tgl.m4') - -#define SSP_MCLK -define(`SSP_MCLK', 38400000) - -# -# Topology -# -# pcm0p --> buf1.0 --> crossover1.0 --> buf1.1 --> ssp0.out -# | -# +----------> buf2.0 --> ssp2.out -# -# -# pcm0c <-- buf5.0 <-- ssp0.in -# pcm1c <-- buf6.0 <-- ssp2.in -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp, dynamic) - -define(PIPELINE_FILTER1, crossover/coef_2way_48000_200_1_2.m4) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-crossover-playback.m4, - 1, 0, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -undefine(`PIPELINE_FILTER1') - -# Playback pipeline 2 on PCM 1 using max 2 channels of s16le. -# Set 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, - 2, 1, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER) - -# connect pipelines together -SectionGraph."pipe-sof-2-pipe" { - index "2" - - lines [ - # connect the second sink buffer - dapm(PIPELINE_SOURCE_2, PIPELINE_CROSSOVER_1) - ] -} - -# Pass-through capture pipeline 5 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 5, 0, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Pass-throug capture pipeline 6 on PCM 1 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 6, 1, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl period , priority, core, time_domain, -dnl channels, rate, dynamic_pipe) - -# playback DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, 0, NoCodec-0, - PIPELINE_SOURCE_1, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - 2, 48000) - -dnl DAI_ADD_SCHED(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl period , priority, core, time_domain, sched_comp) - -# playback DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 2, SSP, 2, NoCodec-2, - PIPELINE_SOURCE_2, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# capture DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 5, SSP, 0, NoCodec-0, - PIPELINE_SINK_5, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 6, SSP, 2, NoCodec-2, - PIPELINE_SINK_6, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) -PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_5) - -dnl PCM_CAPTURE_ADD(name, pcm_id, capture) -PCM_CAPTURE_ADD(Port1, 1, PIPELINE_PCM_6) - -# -# BE configurations - overrides config in ACPI if present -# - -dnl DAI_CONFIG(type, idx, link_id, name, ssp_config/dmic_config) -DAI_CONFIG(SSP, 0, 0, NoCodec-0, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, SSP_QUIRK_LBM))) - -DAI_CONFIG(SSP, 2, 2, NoCodec-2, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 2, 24, 0, SSP_QUIRK_LBM))) diff --git a/tools/topology/topology1/development/sof-tgl-nocodec-crossover-4way.m4 b/tools/topology/topology1/development/sof-tgl-nocodec-crossover-4way.m4 deleted file mode 100644 index e3d73ec59c90..000000000000 --- a/tools/topology/topology1/development/sof-tgl-nocodec-crossover-4way.m4 +++ /dev/null @@ -1,264 +0,0 @@ -# -# Topology for Tigerlake RVP board CI testing, with covering as more -# features as possible running with no codec machine. -# -# TGL Host GW DMAC support max 6 playback and max 6 capture channels so some -# pipelines/PCMs/DAIs are commented out to keep within HW bounds. If these -# are needed then they can be used provided other PCMs/pipelines/SSPs are -# commented out in their place. - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`ssp.m4') -include(`crossover.m4') -include(`bytecontrol.m4') -include(`pipeline.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/tgl.m4') - -#define SSP_MCLK -define(`SSP_MCLK', 38400000) - -# -# Topology -# -# pcm0p --> buf1.0 --> crossover1.0 --> buf1.1 --> ssp0.out -# | -# +----------> buf2.0 --> ssp1.out -# | -# +----------> buf3.0 --> ssp2.out -# | -# +----------> buf4.0 --> ssp3.out -# -# pcm0c <-- buf5.0 <-- ssp0.in -# pcm1c <-- buf6.0 <-- ssp1.in -# pcm2c <-- buf7.0 <-- ssp2.in -# pcm3c <-- buf8.0 <-- ssp3.in -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp, dynamic) - -define(PIPELINE_FILTER1, crossover/coef_4way_48000_200_1000_3000_1_2_3_4.m4) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-crossover-playback.m4, - 1, 0, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -undefine(`PIPELINE_FILTER1') - -# Playback pipeline 2 on PCM 1 using max 2 channels of s16le. -# Set 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, - 2, 1, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER) - -# Playback pipeline 3 on PCM 2 using max 2 channels of s16le. -# Set 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, - 3, 2, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER) - -# Playback pipeline 4 on PCM 3 using max 2 channels of s16le. -# Set 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, - 4, 3, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER) - -# connect pipelines together -SectionGraph."pipe-sof-2-pipe" { - index "2" - - lines [ - # connect the second sink buffer - dapm(PIPELINE_SOURCE_2, PIPELINE_CROSSOVER_1) - ] -} - -# connect pipelines together -SectionGraph."pipe-sof-3-pipe" { - index "3" - - lines [ - # connect the second sink buffer - dapm(PIPELINE_SOURCE_3, PIPELINE_CROSSOVER_1) - ] -} - -# connect pipelines together -SectionGraph."pipe-sof-4-pipe" { - index "4" - - lines [ - # connect the second sink buffer - dapm(PIPELINE_SOURCE_4, PIPELINE_CROSSOVER_1) - ] -} - -# Pass-through capture pipeline 5 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 5, 0, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Pass-throug capture pipeline 6 on PCM 1 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 6, 1, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Pass-throug capture pipeline 7 on PCM 2 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 7, 2, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Pass-throug capture pipeline 6 on PCM 3 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 8, 3, 2, s16le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl period , priority, core, time_domain, -dnl channels, rate, dynamic_pipe) - -# playback DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, 0, NoCodec-0, - PIPELINE_SOURCE_1, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - 2, 48000) - - - -dnl DAI_ADD_SCHED(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl period , priority, core, time_domain, sched_comp) - -# playback DAI is SSP1 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 2, SSP, 1, NoCodec-1, - PIPELINE_SOURCE_2, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# playback DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 3, SSP, 2, NoCodec-2, - PIPELINE_SOURCE_3, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# playback DAI is SSP3 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 4, SSP, 3, NoCodec-3, - PIPELINE_SOURCE_4, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - - - -# capture DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 5, SSP, 0, NoCodec-0, - PIPELINE_SINK_5, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP1 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 6, SSP, 1, NoCodec-1, - PIPELINE_SINK_6, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 7, SSP, 2, NoCodec-2, - PIPELINE_SINK_7, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP3 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 8, SSP, 3, NoCodec-3, - PIPELINE_SINK_8, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - - -dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) -PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_1, PIPELINE_PCM_5) - -dnl PCM_CAPTURE_ADD(name, pcm_id, capture) -PCM_CAPTURE_ADD(Port1, 1, PIPELINE_PCM_6) -PCM_CAPTURE_ADD(Port2, 2, PIPELINE_PCM_7) -PCM_CAPTURE_ADD(Port3, 3, PIPELINE_PCM_8) - -# -# BE configurations - overrides config in ACPI if present -# - -dnl DAI_CONFIG(type, idx, link_id, name, ssp_config/dmic_config) -DAI_CONFIG(SSP, 0, 0, NoCodec-0, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, SSP_QUIRK_LBM))) - -DAI_CONFIG(SSP, 1, 1, NoCodec-1, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 1, 24, 0, SSP_QUIRK_LBM))) - -DAI_CONFIG(SSP, 2, 2, NoCodec-2, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 2, 24, 0, SSP_QUIRK_LBM))) - -DAI_CONFIG(SSP, 3, 3, NoCodec-3, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 3, 24, 0, SSP_QUIRK_LBM))) diff --git a/tools/topology/topology1/development/sof-tgl-nocodec-mux.m4 b/tools/topology/topology1/development/sof-tgl-nocodec-mux.m4 deleted file mode 100644 index 8121c6a78db4..000000000000 --- a/tools/topology/topology1/development/sof-tgl-nocodec-mux.m4 +++ /dev/null @@ -1,143 +0,0 @@ -# -# Topology for Tigerlake RVP board CI testing, with covering as more -# features as possible running with no codec machine. -# -# TGL Host GW DMAC support max 6 playback and max 6 capture channels so some -# pipelines/PCMs/DAIs are commented out to keep within HW bounds. If these -# are needed then they can be used provided other PCMs/pipelines/SSPs are -# commented out in their place. - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`ssp.m4') -include(`muxdemux.m4') -include(`bytecontrol.m4') -include(`pipeline.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/tgl.m4') - -define(PIPE_NAME, pipe-tgl-mux) - -# -# Define the demux configure -# -dnl Configure demux -dnl name, pipeline_id, routing_matrix_rows -dnl Diagonal 1's in routing matrix mean that every input channel is -dnl copied to corresponding output channels in all output streams. -dnl I.e. row index is the input channel, 1 means it is copied to -dnl corresponding output channel (column index), 0 means it is discarded. -dnl There's a separate matrix for all outputs. -define(matrix1, `ROUTE_MATRIX(2, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)')') - -define(matrix2, `ROUTE_MATRIX(3, - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)')') - -dnl name, num_streams, route_matrix list -MUXDEMUX_CONFIG(demux_priv_1, 2, LIST_NONEWLINE(`', `matrix1,', `matrix2')) - -#define SSP_MCLK -define(`SSP_MCLK', 38400000) - -# playback DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-mux-dai-playback.m4, - 1, SSP, 0, NoCodec-0, - NOT_USED_IGNORED, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - 4, 48000) - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-host-playback.m4, - 2, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Low Latency playback pipeline 3 on PCM 1 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-host-playback.m4, - 3, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Volume-switch capture pipeline 2 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 4, 0, 4, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# capture DAI is SSP0 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 4, SSP, 0, NoCodec-0, - PIPELINE_SINK_4, 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# Connect pipelines together -SectionGraph."PIPE_NAME" { - index "0" - lines [ - # PCM pipeline 3 to DAI pipeline 1 - dapm(PIPELINE_MUX_1, PIPELINE_SOURCE_2) - # PCM pipeline 4 to DAI pipeline 1 - dapm(PIPELINE_MUX_1, PIPELINE_SOURCE_3) - ] -} - -dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) -PCM_DUPLEX_ADD(Port0, 0, PIPELINE_PCM_2, PIPELINE_PCM_4) -PCM_PLAYBACK_ADD(Media Playback MUX 1, 1, PIPELINE_PCM_3) - -# -# BE configurations - overrides config in ACPI if present -# - -DAI_CONFIG(SSP, 0, 0, NoCodec-0, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 4800000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(4, 25, 15, 15), - SSP_CONFIG_DATA(SSP, 0, 24, 0, SSP_QUIRK_LBM))) diff --git a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt b/tools/topology/topology1/dsp_enhancement/CMakeLists.txt deleted file mode 100644 index bdb655dd7800..000000000000 --- a/tools/topology/topology1/dsp_enhancement/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -# The topologies are defined in parent directory and enhanced with end-point specific processing -set(TPLGS_UP - "sof-hda-generic\;sof-hda-generic-eq\;-DCHANNELS=0\;-DHSPROC=eq-iir-eq-fir-volume\;-DHSPROC_FILTER1=eq_iir_coef_pass.m4\;-DHSPROC_FILTER2=eq_fir_coef_pass.m4" - "sof-hda-generic\;sof-hda-generic-eq-2ch\;-DCHANNELS=2\;-DHSPROC=eq-iir-eq-fir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4" - "sof-hda-generic\;sof-hda-generic-eq-4ch\;-DCHANNELS=4\;-DHSPROC=eq-iir-eq-fir-volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4" -) - -add_custom_target(dsp_topologies1 ALL) - -foreach(tplg ${TPLGS_UP}) - list(GET tplg 0 input) - list(GET tplg 1 output) - list(LENGTH tplg tplg_len) - math(EXPR num_args "${tplg_len} - 1") - set(DEFINES "") - if (${num_args} GREATER 1) - foreach(index RANGE 2 ${num_args}) - list(GET tplg ${index} custom_define) - list(APPEND DEFINES ${custom_define}) - endforeach() - endif() - - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf - COMMAND m4 --fatal-warnings - ${DEFINES} - -I ${CMAKE_CURRENT_SOURCE_DIR}/../m4 - -I ${CMAKE_CURRENT_SOURCE_DIR}/../common - -I ${CMAKE_CURRENT_SOURCE_DIR}/../platform/common - -I ${CMAKE_CURRENT_SOURCE_DIR}/../ - -I ${CMAKE_CURRENT_BINARY_DIR}/../ - ${CMAKE_CURRENT_SOURCE_DIR}/../common/abi.m4 - ${CMAKE_CURRENT_SOURCE_DIR}/../${input}.m4 - > ${output}.conf - DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h - VERBATIM - USES_TERMINAL - ) - - add_alsatplg_command(${output}.conf ${output}.tplg) - - add_custom_target(dsp_topology_${output} DEPENDS ${output}.tplg) - add_dependencies(dsp_topologies1 dsp_topology_${output}) -endforeach() diff --git a/tools/topology/topology1/kernel_dependent/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/CMakeLists.txt deleted file mode 100644 index 5b81d374b6a7..000000000000 --- a/tools/topology/topology1/kernel_dependent/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -add_subdirectory(v5.19) diff --git a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt b/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt deleted file mode 100644 index 46fcfb0b4f85..000000000000 --- a/tools/topology/topology1/kernel_dependent/v5.19/CMakeLists.txt +++ /dev/null @@ -1,90 +0,0 @@ -# SPDX-License-Identifier: BSD-3-Clause - -# Those topologies are built from topology in the parent directory -set(TPLGS_UP - ## HDaudio codec topologies - "sof-hda-generic\;sof-hda-generic\;-DDEEP_BUFFER\;-DCHANNELS=0\;-DHSPROC=volume\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-1ch\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-1ch-pdm1\;-DPDM1\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-2ch-pdm1\;-DPDM1\;-DDEEP_BUFFER\;-DCHANNELS=2\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-3ch\;-DDEEP_BUFFER\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - "sof-hda-generic\;sof-hda-generic-4ch\;-DDEEP_BUFFER\;-DCHANNELS=4\;-DHSPROC=volume\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DDYNAMIC=1" - ## end HDaudio codec topologies - - ## SoundWire topologies - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-rt1308-mono-rt715\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=tgl\;-DMONO\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-l0-rt1316-l1-mono-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=tgl\;-DMONO\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt715-rt711-rt1308-mono\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=tgl\;-DMONO\;-DUAJ_LINK=1\;-DAMP_1_LINK=2\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-rt1308-rt715\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=tgl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-tgl-rt711-rt1316-rt714\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=tgl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1308-l12-rt715-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l0-rt1316-l13-rt714-l2\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=3\;-DEXT_AMP_REF\;-DMIC_LINK=2" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l2-rt1316-l01\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=2\;-DAMP_1_LINK=0\;-DAMP_2_LINK=1\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1316-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12-rt714-l3\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt711-l0-rt1318-l12\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DUAJ_LINK=0\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DNO_LOCAL_MIC" - "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-tgl-rt711-rt1308-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-tgl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=tgl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l3-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=3\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-2ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=2\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - "sof-tgl-rt711-rt1308\;sof-adl-rt711-l0-rt1316-l2-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DEXT_AMP\;-DEXT_AMP_REF\;-DAMP_1_LINK=2\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=adl" - - "sof-tgl-rt711-rt1308\;sof-rpl-rt711-4ch\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=4\;-DBT_OFFLOAD\;-DDMICPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_48khz.m4\;-DDMIC16KPROC_FILTER1=eq_iir_coef_highpass_40hz_20db_16khz.m4\;-DPLATFORM=rpl" - "sof-tgl-rt711-rt1308\;sof-rpl-rt711\;-DHEADSET_DEEP_BUFFER\;-DDYNAMIC=1\;-DCHANNELS=0\;-DBT_OFFLOAD\;-DPLATFORM=rpl" - ## end SoundWire topologies - - ## SoundWire NOJACK topologies - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l1-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=1\;-DEXT_AMP_REF\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-adl-rt1316-l2-mono-rt714-l3\;-DDYNAMIC=1\;-DPLATFORM=adl\;-DMONO\;-DNOJACK\;-DAMP_1_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=3" - "sof-icl-rt711-rt1308-rt715-hdmi\;sof-rpl-rt1316-l12-rt714-l0\;-DDYNAMIC=1\;-DPLATFORM=rpl\;-DNOJACK\;-DAMP_1_LINK=1\;-DAMP_2_LINK=2\;-DEXT_AMP_REF\;-DMIC_LINK=0" - ## end SoundWire NOJACK topologies -) - -add_custom_target(kernel_dependent_v5_19_topologies1) -add_dependencies(topologies1 kernel_dependent_v5_19_topologies1) - -# handle topologies in parent directory -foreach(tplg ${TPLGS_UP}) - list(GET tplg 0 input) - list(GET tplg 1 output) - list(LENGTH tplg tplg_len) - math(EXPR num_args "${tplg_len} - 1") - set(DEFINES "") - if (${num_args} GREATER 1) - foreach(index RANGE 2 ${num_args}) - list(GET tplg ${index} custom_define) - list(APPEND DEFINES ${custom_define}) - endforeach() - endif() - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${output}.conf - COMMAND m4 --fatal-warnings - ${DEFINES} - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../m4 - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../common - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../platform/common - -I ${CMAKE_CURRENT_SOURCE_DIR}/../../ - -I ${CMAKE_CURRENT_BINARY_DIR}/../../ - ${CMAKE_CURRENT_SOURCE_DIR}/../../common/abi.m4 - ${CMAKE_CURRENT_SOURCE_DIR}/../../${input}.m4 - > ${output}.conf - DEPENDS abi_v1 ${CMAKE_BINARY_DIR}/topology/topology1/abi.h - VERBATIM - USES_TERMINAL - ) - add_alsatplg_command(${output}.conf ${output}.tplg) - - add_custom_target(k519_topology_${output} DEPENDS ${output}.tplg) - add_dependencies(kernel_dependent_v5_19_topologies1 k519_topology_${output}) -endforeach() diff --git a/tools/topology/topology1/platform/intel/adl.m4 b/tools/topology/topology1/platform/intel/adl.m4 deleted file mode 100644 index f058b2025bbb..000000000000 --- a/tools/topology/topology1/platform/intel/adl.m4 +++ /dev/null @@ -1,38 +0,0 @@ -# -# Tigerlake differentiation for pipelines and components -# - -include(`memory.m4') - -dnl Memory capabilities for different buffer types on Tigerlake -define(`PLATFORM_DAI_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_HOST_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_PASS_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) - -# Low Latency PCM Configuration -W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "50000"')) - -W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens) - -# Media PCM Configuration -W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "100000"')) - -W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens) - -# Tone Signal Generator Configuration -W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "200000"')) - -W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens) - -# DAI schedule Configuration - scheduled by IRQ -W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "5000"')) - -W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens) diff --git a/tools/topology/topology1/platform/intel/bxt.m4 b/tools/topology/topology1/platform/intel/bxt.m4 deleted file mode 100644 index 20205b5fc0ed..000000000000 --- a/tools/topology/topology1/platform/intel/bxt.m4 +++ /dev/null @@ -1,80 +0,0 @@ -# -# Broxton differentiation for pipelines and components -# -include(`platform/intel/dmic.m4') - -undefine(`SSP_MCLK_RATE') -define(`SSP_MCLK_RATE', `19200000') - -undefine(`SSP1_BCLK') -define(`SSP1_BCLK', `1536000') - -undefine(`SSP_BCLK') -define(`SSP_BCLK', `1920000') - -undefine(`SSP_FSYNC') -define(`SSP_FSYNC', `48000') - -define(`DMIC_PIPE_CAPTURE', `sof/pipe-volume-capture.m4') - -define(`PIPE_VOLUME_PLAYBACK', `sof/pipe-volume-playback.m4') - -undefine(`DMIC01_FMT') -define(`DMIC01_FMT', `s16le') - -undefine(`DMIC1_FMT') -define(`DMIC1_FMT', `s16le') - -define(`SSP1_VALID_BITS_STR', `s16le') - -undefine(`HDMI0_INDEX') -define(`HDMI0_INDEX', `3') - -undefine(`HDMI1_INDEX') -define(`HDMI1_INDEX', `4') - -undefine(`HDMI2_INDEX') -define(`HDMI2_INDEX', `5') - -undefine(`SSP_BITS_WIDTH') -define(`SSP_BITS_WIDTH', `20') - -undefine(`SSP1_VALID_BITS') -define(`SSP1_VALID_BITS', `16') - -undefine(`SSP_VALID_BITS') -define(`SSP_VALID_BITS', `16') - -undefine(`MCLK_ID') -define(`MCLK_ID', `1') - -include(`memory.m4') - -dnl Memory capabilities for diferent buffer types on Baytrail -define(`PLATFORM_DAI_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_HOST_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_PASS_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) - -# Low Latency PCM Configuration -W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "50000"')) - -W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens) - -# Media PCM Configuration -W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "100000"')) - -W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens) - -# Tone Signal Generator Configuration -W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "200000"')) - -W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens) - -# DAI schedule Configuration - scheduled by IRQ -W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, LIST(` ', `SOF_TKN_SCHED_MIPS "5000"')) - -W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens) diff --git a/tools/topology/topology1/platform/intel/dmic.m4 b/tools/topology/topology1/platform/intel/dmic.m4 deleted file mode 100644 index 4291543159bc..000000000000 --- a/tools/topology/topology1/platform/intel/dmic.m4 +++ /dev/null @@ -1,71 +0,0 @@ -divert(-1) - -dnl DMIC related macros - -dnl PDM_TUPLES(pdm ctrl id, mic_a_enable, mic_b_enable, polarity_a, polarity_b, -dnl clk_egde, skew) -define(`PDM_TUPLES', -` tuples."short.pdm$1" {' -` SOF_TKN_INTEL_DMIC_PDM_CTRL_ID' STR($1) -` SOF_TKN_INTEL_DMIC_PDM_MIC_A_Enable' STR($2) -` SOF_TKN_INTEL_DMIC_PDM_MIC_B_Enable' STR($3) -` SOF_TKN_INTEL_DMIC_PDM_POLARITY_A' STR($4) -` SOF_TKN_INTEL_DMIC_PDM_POLARITY_B' STR($5) -` SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE' STR($6) -` SOF_TKN_INTEL_DMIC_PDM_SKEW' STR($7) -` }' -) - -dnl PDM_CONFIG(type, idx, num pdm active, pdm tuples list) -define(`PDM_CONFIG', -` SOF_TKN_INTEL_DMIC_NUM_PDM_ACTIVE' STR($3) -` }' -`}' -`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_pdm_tuples" {' -` tokens "sof_dmic_pdm_tokens"' -$4 -`}' -) - -dnl DMIC currently only supports 16 bit or 32-bit word length -dnl DMIC_WORD_LENGTH(frame format) -define(`DMIC_WORD_LENGTH', -`ifelse($1, `s16le', 16, $1, `s32le', 32, `')') - -dnl DMIC_CONFIG(driver_version, clk_min, clk_mac, duty_min, duty_max, -dnl sample_rate, fifo word length, ramp_time, -dnl type, idx, pdm controller config) -define(`DMIC_CONFIG', -`SectionVendorTuples."'N_DAI_CONFIG($9$10)`_dmic_tuples" {' -` tokens "sof_dmic_tokens"' -` tuples."word" {' -` SOF_TKN_INTEL_DMIC_DRIVER_VERSION' STR($1) -` SOF_TKN_INTEL_DMIC_CLK_MIN' STR($2) -` SOF_TKN_INTEL_DMIC_CLK_MAX' STR($3) -` SOF_TKN_INTEL_DMIC_DUTY_MIN' STR($4) -` SOF_TKN_INTEL_DMIC_DUTY_MAX' STR($5) -` SOF_TKN_INTEL_DMIC_SAMPLE_RATE' STR($6) -` SOF_TKN_INTEL_DMIC_FIFO_WORD_LENGTH' STR($7) -` SOF_TKN_INTEL_DMIC_UNMUTE_RAMP_TIME_MS' STR($8) - -dnl PDM config for the number of active PDM controllers -$11 -`SectionData."'N_DAI_CONFIG($9$10)`_pdm_data" {' -` tuples "'N_DAI_CONFIG($9$10)`_pdm_tuples"' -`}' -`SectionData."'N_DAI_CONFIG($9$10)`_data" {' -` tuples "'N_DAI_CONFIG($9$10)`_dmic_tuples"' - -`}' -) - -dnl DMIC PDM configurations -dnl macros to get the number of active pdm's and their config -define(`MONO_PDM0_MICA', `1, LIST(`', PDM_TUPLES(0, 1, 0, 0, 0, 0, 0))') -define(`MONO_PDM0_MICB', `1, LIST(`', PDM_TUPLES(0, 0, 1, 0, 0, 0, 0))') -define(`STEREO_PDM0', `1, LIST(`', PDM_TUPLES(0, 1, 1, 0, 0, 0, 0))') -define(`STEREO_PDM1', `1, LIST(`', PDM_TUPLES(1, 1, 1, 0, 0, 0, 0))') -define(`FOUR_CH_PDM0_PDM1', - `2, LIST(`', PDM_TUPLES(0, 1, 1, 0, 0, 0, 0), PDM_TUPLES(1, 1, 1, 0, 0, 0, 0))') - -divert(0)dnl diff --git a/tools/topology/topology1/platform/intel/ehl.m4 b/tools/topology/topology1/platform/intel/ehl.m4 deleted file mode 100644 index e914bbbaa323..000000000000 --- a/tools/topology/topology1/platform/intel/ehl.m4 +++ /dev/null @@ -1,38 +0,0 @@ -# -# ElkhartLake differentiation for pipelines and components -# - -include(`memory.m4') - -dnl Memory capabilities for different buffer types on ElkhartLake -define(`PLATFORM_DAI_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_HOST_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_PASS_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) - -# Low Latency PCM Configuration -W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "50000"')) - -W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens) - -# Media PCM Configuration -W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "100000"')) - -W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens) - -# Tone Signal Generator Configuration -W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "200000"')) - -W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens) - -# DAI schedule Configuration - scheduled by IRQ -W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "5000"')) - -W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens) diff --git a/tools/topology/topology1/platform/intel/intel-boards.m4 b/tools/topology/topology1/platform/intel/intel-boards.m4 deleted file mode 100644 index 8b415a777df8..000000000000 --- a/tools/topology/topology1/platform/intel/intel-boards.m4 +++ /dev/null @@ -1,32 +0,0 @@ -# -# Machine driver differentiation for dai link ID -# - -# variable that need to be defined in upper m4 -ifdef(`PLATFORM',`',`fatal_error(note: Need to define platform identifier for intel-boards)') -ifdef(`LINUX_MACHINE_DRIVER',`',`fatal_error(note: Need to define linux machine driver identifier for intel-boards)') - -define(`NUM_DMIC_BE_LINK', `2') - -ifelse( - PLATFORM, `tgl', `define(`NUM_HDMI_BE_LINK', 4)', - PLATFORM, `adl', `define(`NUM_HDMI_BE_LINK', 4)', - `fatal_error(note: Unknown platform to intel-boards)') - -# define the ID base for backend DAI Links -ifelse( - LINUX_MACHINE_DRIVER, `sof_rt5682', ` - define(`BOARD_HP_BE_ID', `0') - define(`BOARD_DMIC_BE_ID_BASE', eval(BOARD_HP_BE_ID + 1)) - define(`BOARD_HDMI_BE_ID_BASE', eval(BOARD_DMIC_BE_ID_BASE + NUM_DMIC_BE_LINK)) - ifdef(`NO_AMP', `', `define(`BOARD_SPK_BE_ID', eval(BOARD_HDMI_BE_ID_BASE + NUM_HDMI_BE_LINK))') - ifdef(`NO_AMP', `define(`BOARD_BT_BE_ID', eval(BOARD_HDMI_BE_ID_BASE + NUM_HDMI_BE_LINK))', `define(`BOARD_BT_BE_ID', eval(BOARD_SPK_BE_ID + 1))')', - LINUX_MACHINE_DRIVER, `sof_ssp_amp', ` - define(`BOARD_SPK_BE_ID', `0') - ifdef(`NO_DMICS', `', `define(`BOARD_DMIC_BE_ID_BASE', eval(BOARD_SPK_BE_ID + 1))') - ifdef(`NO_DMICS', `define(`BOARD_HDMI_BE_ID_BASE', eval(BOARD_SPK_BE_ID + 1))', `define(`BOARD_HDMI_BE_ID_BASE', eval(BOARD_DMIC_BE_ID_BASE + NUM_DMIC_BE_LINK))') - define(`BOARD_BT_BE_ID', eval(BOARD_HDMI_BE_ID_BASE + NUM_HDMI_BE_LINK))', - `fatal_error(note: Unknown linux machine driver to intel-boards)') - -undefine(`NUM_DMIC_BE_LINK') -undefine(`NUM_HDMI_BE_LINK') diff --git a/tools/topology/topology1/platform/intel/intel-generic-bt.m4 b/tools/topology/topology1/platform/intel/intel-generic-bt.m4 deleted file mode 100644 index 48c9456da71b..000000000000 --- a/tools/topology/topology1/platform/intel/intel-generic-bt.m4 +++ /dev/null @@ -1,80 +0,0 @@ -# -# Bluetooth Audio Offload support -# - -include(`ssp.m4') - -# define default SSP port -ifdef(`SSP_INDEX',`', -`define(SSP_INDEX, `2')') - -define(`BT_MCLK', 38400000) -define(`SSP_NAME', concat(concat(`SSP', SSP_INDEX),`-BT')) - -# variable that need to be defined in upper m4 -ifdef(`BT_PIPELINE_PB_ID',`',`fatal_error(note: Need to define playback pcm id for intel-generic-bt -)') -ifdef(`BT_PIPELINE_CP_ID',`',`fatal_error(note: Need to define capture pcm id for intel-generic-bt -)') -ifdef(`BT_DAI_LINK_ID',`',`fatal_error(note: Need to define DAI link id for intel-generic-bt -)') -ifdef(`BT_PCM_ID',`',`fatal_error(note: Need to define pipeline PCM dev id for intel-generic-bt -)') -ifdef(`HW_CONFIG_ID',`',`fatal_error(note: Need to define hw_conf_id for intel-generic-bt -)') - -define(`CHANNELS_MIN', 1) - -# Support 8K/16K mono and 48K stereo playback -PIPELINE_PCM_ADD(sof/pipe-passthrough-playback.m4, - BT_PIPELINE_PB_ID, BT_PCM_ID, 2, s16le, - 1000, 0, 0, - 8000, 48000, 48000) - -# We are done -undefine(`CHANNELS_MIN') - -# Support 8K/16K mono capture only -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - BT_PIPELINE_CP_ID, BT_PCM_ID, 1, s16le, - 1000, 0, 0, - 8000, 16000, 48000) - -# playback DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - BT_PIPELINE_PB_ID, SSP, SSP_INDEX, SSP_NAME, - concat(`PIPELINE_SOURCE_', BT_PIPELINE_PB_ID), 2, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP2 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - BT_PIPELINE_CP_ID, SSP, SSP_INDEX, SSP_NAME, - concat(`PIPELINE_SINK_', BT_PIPELINE_CP_ID), 1, s16le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -PCM_DUPLEX_ADD(Bluetooth, BT_PCM_ID, concat(`PIPELINE_PCM_', BT_PIPELINE_PB_ID), concat(`PIPELINE_PCM_', BT_PIPELINE_CP_ID)) - -define(`hwconfig_names', HW_CONFIG_NAMES(LIST(` ', "hw_config1", "hw_config2", "hw_config3"))) -define(`data_names', DAI_DATA_NAMES(LIST(` ', "ssp_data1", "ssp_data2", "ssp_data3"))) - -# Note WB is put as default in the list -define(`ssp_config_list_1', LIST(`', - `MULTI_SSP_CONFIG(hw_config1, HW_CONFIG_ID, DSP_A, SSP_CLOCK(mclk, BT_MCLK, codec_mclk_in),' - `SSP_CLOCK(bclk, 256000, codec_master, inverted),' - `SSP_CLOCK(fsync, 16000, codec_master),' - `SSP_TDM(1, 16, 1, 1),' - `SSP_MULTI_CONFIG_DATA(ssp_data1, 16))', - `MULTI_SSP_CONFIG(hw_config2, eval(HW_CONFIG_ID + 1), DSP_A, SSP_CLOCK(mclk, BT_MCLK, codec_mclk_in),' - `SSP_CLOCK(bclk, 128000, codec_master, inverted),' - `SSP_CLOCK(fsync, 8000, codec_master),' - `SSP_TDM(1, 16, 1, 1),' - `SSP_MULTI_CONFIG_DATA(ssp_data2, 16))', - `MULTI_SSP_CONFIG(hw_config3, eval(HW_CONFIG_ID + 2), DSP_A, SSP_CLOCK(mclk, BT_MCLK, codec_mclk_in),' - `SSP_CLOCK(bclk, 1536000, codec_slave),' - `SSP_CLOCK(fsync, 48000, codec_slave),' - `SSP_TDM(2, 16, 3, 0),' - `SSP_MULTI_CONFIG_DATA(ssp_data3, 16))')) - -MULTI_DAI_CONFIG(SSP, SSP_INDEX, BT_DAI_LINK_ID, SSP_NAME, ssp_config_list_1, hwconfig_names, data_names) diff --git a/tools/topology/topology1/platform/intel/intel-generic-dmic-kwd.m4 b/tools/topology/topology1/platform/intel/intel-generic-dmic-kwd.m4 deleted file mode 100644 index cbcb11e6a7e3..000000000000 --- a/tools/topology/topology1/platform/intel/intel-generic-dmic-kwd.m4 +++ /dev/null @@ -1,167 +0,0 @@ -# -# Topology for digital microphones array -# - -include(`platform/intel/dmic.m4') - -# define default PCM names -ifdef(`DMIC_48k_PCM_NAME',`', -`define(DMIC_48k_PCM_NAME, `DMIC')') -ifdef(`DMIC_16k_PCM_NAME',`', -`define(DMIC_16k_PCM_NAME, `DMIC16kHz')') - -# variable that need to be defined in upper m4 -ifdef(`CHANNELS',`',`fatal_error(note: Need to define channel number for intel-generic-dmic-kwd -)') -ifdef(`KFBM_TYPE',`',`fatal_error(note: Need to define kfbm type for intel-generic-dmic-kwd, available type: vol-kfbm/kfbm -)') -ifdef(`DMIC_PCM_48k_ID',`',`fatal_error(note: Need to define dmic48k pcm id for intel-generic-dmic-kwd -)') -ifdef(`DMIC_PIPELINE_48k_ID',`',`fatal_error(note: Need to define dmic48k pipeline id for intel-generic-dmic-kwd -)') -ifdef(`DMIC_DAI_LINK_48k_ID',`',`fatal_error(note: Need to define dmic48k dai id for intel-generic-dmic-kwd -)') - -ifdef(`DMIC_PCM_16k_ID',`',`fatal_error(note: Need to define dmic16k pcm id for intel-generic-dmic-kwd -)') -ifdef(`DMIC_PIPELINE_16k_ID',`',`fatal_error(note: Need to define dmic16k pipeline id for intel-generic-dmic-kwd -)') -ifdef(`DMIC_PIPELINE_KWD_ID',`',`fatal_error(note: Need to define kwd pipeline id for intel-generic-dmic-kwd -)') -ifdef(`DMIC_DAI_LINK_16k_ID',`',`fatal_error(note: Need to define dmic16k dai id for intel-generic-dmic-kwd -)') - -# define(KWD_PIPE_SCH_DEADLINE_US, 20000) -ifdef(`KWD_PIPE_SCH_DEADLINE_US',`',`fatal_error(note: Need to define schedule for intel-generic-dmic-kwd -)') - -# define(DMIC_DAI_LINK_48k_NAME, `dmic01') -ifdef(`DMIC_DAI_LINK_48k_NAME',`',define(DMIC_DAI_LINK_48k_NAME, `dmic01')) - -# define(DMIC_PIPELINE_48k_CORE_ID, 0) -ifdef(`DMIC_PIPELINE_48k_CORE_ID',`',define(DMIC_PIPELINE_48k_CORE_ID, 0)) - -# define(DMIC_DAI_LINK_16k_NAME, `dmic16k') -ifdef(`DMIC_DAI_LINK_16k_NAME',`',define(DMIC_DAI_LINK_16k_NAME, `dmic16k')) - -# DMICPROC is set by makefile, available type: passthrough/eq-iir-volume -ifdef(`DMICPROC', `', `define(DMICPROC, passthrough)') - -dnl Unless explicitly specified, dmic period at 48k is 1ms -ifdef(`DMIC_48k_PERIOD_US', `', `define(`DMIC_48k_PERIOD_US', 1000)') - -# define(DMIC_DAI_LINK_16k_PDM, `STEREO_PDM0') define the PDM port, default is STEREO_PDM0 -ifdef(`DMIC_DAI_LINK_16k_PDM',`',`define(DMIC_DAI_LINK_16k_PDM, `STEREO_PDM0')') - -# define(DETECTOR_TYPE, `google-hotword-detect') define the detector type, default is the test detector -ifdef(`DETECTOR_TYPE',`',define(DETECTOR_TYPE, `detect')) - -# -# Define the pipelines -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Passthrough capture pipeline using max channels defined by CHANNELS. - -# Set 1000us deadline with priority 0 on core 0 -ifdef(`DMICPROC_FILTER1', `define(PIPELINE_FILTER1, DMICPROC_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`DMICPROC_FILTER2', `define(PIPELINE_FILTER2, DMICPROC_FILTER2)', `undefine(`PIPELINE_FILTER2')') -define(`PGA_NAME', Dmic0) - -PIPELINE_PCM_ADD(sof/pipe-`DMICPROC'-capture.m4, - DMIC_PIPELINE_48k_ID, DMIC_PCM_48k_ID, CHANNELS, s32le, - DMIC_48k_PERIOD_US, 0, DMIC_PIPELINE_48k_CORE_ID, 48000, 48000, 48000) -undefine(`PGA_NAME') -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') -undefine(`DMICPROC') - -# -# KWD configuration -# - -# Passthrough capture pipeline 7 on PCM 7 using max 2 channels. -# Schedule 20000us deadline with priority 0 on core 0 -PIPELINE_PCM_DAI_ADD(sof/pipe-KFBM_TYPE-capture.m4, - DMIC_PIPELINE_16k_ID, DMIC_PCM_16k_ID, 2, s32le, - KWD_PIPE_SCH_DEADLINE_US, 0, 0, DMIC, 1, s32le, 3, - 16000, 16000, 16000) - - - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# capture DAI is DMIC 0 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - DMIC_PIPELINE_48k_ID, DMIC, 0, DMIC_DAI_LINK_48k_NAME, - concat(`PIPELINE_SINK_', DMIC_PIPELINE_48k_ID), 2, s32le, - DMIC_48k_PERIOD_US, 0, DMIC_PIPELINE_48k_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC 1 using 3 periods -# Buffers use s32le format, with 320 frame per 20000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - DMIC_PIPELINE_16k_ID, DMIC, 1, DMIC_DAI_LINK_16k_NAME, - `PIPELINE_SINK_'DMIC_PIPELINE_16k_ID, 3, s32le, - KWD_PIPE_SCH_DEADLINE_US, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) -dnl PCM_CAPTURE_ADD(name, pipeline, capture) -PCM_CAPTURE_ADD(DMIC_48k_PCM_NAME, DMIC_PCM_48k_ID, concat(`PIPELINE_PCM_', DMIC_PIPELINE_48k_ID)) - -# keyword detector pipe -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp, dynamic) -PIPELINE_PCM_ADD(sof/pipe-DETECTOR_TYPE.m4, - DMIC_PIPELINE_KWD_ID, DMIC_PCM_16k_ID, 2, s24le, - KWD_PIPE_SCH_DEADLINE_US, 1, 0, - 16000, 16000, 16000, - SCHEDULE_TIME_DOMAIN_TIMER, - `PIPELINE_SCHED_COMP_'DMIC_PIPELINE_16k_ID) - -# Connect pipelines together -SectionGraph."pipe-sof-generic-keyword-detect" { - index "0" - - lines [ - # keyword detect - dapm(`PIPELINE_SINK_'DMIC_PIPELINE_KWD_ID, `PIPELINE_SOURCE_'DMIC_PIPELINE_16k_ID) - dapm(`PIPELINE_PCM_'DMIC_PIPELINE_16k_ID, `PIPELINE_DETECT_'DMIC_PIPELINE_KWD_ID) - ] -} - -# -# BE configurations - overrides config in ACPI if present -# - -dnl DAI_CONFIG(type, dai_index, link_id, name, ssp_config/dmic_config) -ifelse(CHANNELS, 4, -`DAI_CONFIG(DMIC, 0, DMIC_DAI_LINK_48k_ID, DMIC_DAI_LINK_48k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 200, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))', -`DAI_CONFIG(DMIC, 0, DMIC_DAI_LINK_48k_ID, DMIC_DAI_LINK_48k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 200, DMIC, 0, - PDM_CONFIG(DMIC, 0, STEREO_PDM0)))') - -# dmic16k (ID: 2) -DAI_CONFIG(DMIC, 1, DMIC_DAI_LINK_16k_ID, DMIC_DAI_LINK_16k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, DMIC_DAI_LINK_16k_PDM))) diff --git a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 b/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 deleted file mode 100644 index 63be50e05b93..000000000000 --- a/tools/topology/topology1/platform/intel/intel-generic-dmic.m4 +++ /dev/null @@ -1,178 +0,0 @@ -# -# Topology for digital microphones array -# - -include(`platform/intel/dmic.m4') - -# define default PCM names -ifdef(`DMIC_48k_PCM_NAME',`', -`define(DMIC_48k_PCM_NAME, `DMIC')') -ifdef(`DMIC_16k_PCM_NAME',`', -`define(DMIC_16k_PCM_NAME, `DMIC16kHz')') - -ifdef(`DMIC_48k_PRIORITY', `', -`define(DMIC_48k_PRIORITY, 0)') - -# variable that need to be defined in upper m4 -ifdef(`DMICPROC',`',`fatal_error(note: Need to define dmic processing for intel-generic-dmic -)') -ifdef(`CHANNELS',`',`fatal_error(note: Need to define channel number for intel-generic-dmic -)') -ifdef(`DMIC_PCM_48k_ID',`',`fatal_error(note: Need to define dmic48k pcm id for intel-generic-dmic -)') -ifdef(`DMIC_PIPELINE_48k_ID',`',`fatal_error(note: Need to define dmic48k pipeline id for intel-generic-dmic -)') -ifdef(`DMIC_DAI_LINK_48k_ID',`',`fatal_error(note: Need to define dmic48k dai id for intel-generic-dmic -)') - -ifdef(`DMIC_PCM_16k_ID',`',`fatal_error(note: Need to define dmic16k pcm id for intel-generic-dmic -)') -ifdef(`DMIC_PIPELINE_16k_ID',`',`fatal_error(note: Need to define dmic16k pipeline id for intel-generic-dmic -)') -ifdef(`DMIC_DAI_LINK_16k_ID',`',`fatal_error(note: Need to define dmic16k dai id for intel-generic-dmic -)') - -# define(DMIC_DAI_LINK_48k_NAME, `dmic01') -ifdef(`DMIC_DAI_LINK_48k_NAME',`',define(DMIC_DAI_LINK_48k_NAME, `dmic01')) - -# define(DMIC_DAI_LINK_16k_NAME, `dmic16k') -ifdef(`DMIC_DAI_LINK_16k_NAME',`',define(DMIC_DAI_LINK_16k_NAME, `dmic16k')) - -ifdef(`DMIC_48k_CORE_ID',`', define(DMIC_48k_CORE_ID, `0')) -ifdef(`DMIC_16k_CORE_ID',`', define(DMIC_16k_CORE_ID, `0')) - -# Handle possible different channels count for PCM and DAI -ifdef(`DMIC_DAI_CHANNELS', `', `define(DMIC_DAI_CHANNELS, CHANNELS)') -ifdef(`DMIC_PCM_CHANNELS', `', `define(DMIC_PCM_CHANNELS, CHANNELS)') -ifdef(`DMIC16K_DAI_CHANNELS', `', `define(DMIC16K_DAI_CHANNELS, CHANNELS)') -ifdef(`DMIC16K_PCM_CHANNELS', `', `define(DMIC16K_PCM_CHANNELS, CHANNELS)') - -dnl Unless explicitly specified, dmic period at 48k is 1ms -ifdef(`DMIC_48k_PERIOD_US', `', `define(DMIC_48k_PERIOD_US, 1000)') - -define(`INTEL_GENERIC_DMIC_PERIOD', 1000) - -ifelse(CHANNELS, 1, `define(`VOLUME_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 1, 0)))') -ifelse(CHANNELS, 2, `define(`VOLUME_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), - KCONTROL_CHANNEL(FR, 1, 1)))') -ifelse(CHANNELS, 3, `define(`VOLUME_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), - KCONTROL_CHANNEL(FC, 1, 1), - KCONTROL_CHANNEL(FR, 1, 2)))') -ifelse(CHANNELS, 4, `define(`VOLUME_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FLW, 1, 0), - KCONTROL_CHANNEL(FL, 1, 1), - KCONTROL_CHANNEL(FR, 1, 2), - KCONTROL_CHANNEL(FRW, 1, 3)))') - -ifelse(CHANNELS, 1, `define(`SWITCH_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 2, 0)))') -ifelse(CHANNELS, 2, `define(`SWITCH_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), - KCONTROL_CHANNEL(FR, 2, 1)))') -ifelse(CHANNELS, 3, `define(`SWITCH_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), - KCONTROL_CHANNEL(FC, 2, 1), - KCONTROL_CHANNEL(FR, 2, 2)))') -ifelse(CHANNELS, 4, `define(`SWITCH_CHANNEL_MAP', LIST(` ', KCONTROL_CHANNEL(FLW, 2, 0), - KCONTROL_CHANNEL(FL, 2, 1), - KCONTROL_CHANNEL(FR, 2, 2), - KCONTROL_CHANNEL(FRW, 2, 3)))') -# -# Define the pipelines -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Passthrough capture pipeline using max channels defined by DMIC_PCM_CHANNELS. - -# Set 1000us deadline with priority 0 on core 0 -ifdef(`DMICPROC_FILTER1', `define(PIPELINE_FILTER1, DMICPROC_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`DMICPROC_FILTER2', `define(PIPELINE_FILTER2, DMICPROC_FILTER2)', `undefine(`PIPELINE_FILTER2')') -define(`PGA_NAME', Dmic0) - -PIPELINE_PCM_ADD(sof/pipe-DMICPROC-capture.m4, - DMIC_PIPELINE_48k_ID, DMIC_PCM_48k_ID, DMIC_PCM_CHANNELS, s32le, - DMIC_48k_PERIOD_US, 0, DMIC_48k_CORE_ID, 48000, 48000, 48000) - -undefine(`PGA_NAME') -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') - -# Passthrough capture pipeline using max channels defined by CHANNELS. - -# Schedule with 1000us deadline with priority 0 on core 0 -ifdef(`DMIC16KPROC_FILTER1', `define(PIPELINE_FILTER1, DMIC16KPROC_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`DMIC16KPROC_FILTER2', `define(PIPELINE_FILTER2, DMIC16KPROC_FILTER2)', `undefine(`PIPELINE_FILTER2')') -define(`PGA_NAME', Dmic1) - -ifdef(NO16KDMIC, `', -`PIPELINE_PCM_ADD(sof/pipe-DMIC16KPROC-capture-16khz.m4, - DMIC_PIPELINE_16k_ID, DMIC_PCM_16k_ID, DMIC16K_PCM_CHANNELS, s32le, - INTEL_GENERIC_DMIC_PERIOD, 0, DMIC_16k_CORE_ID, 16000, 16000, 16000)') - -undefine(`PGA_NAME') -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') -undefine(`VOLUME_CHANNEL_MAP') -undefine(`SWITCH_CHANNEL_MAP') - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# capture DAI is DMIC 0 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - DMIC_PIPELINE_48k_ID, DMIC, 0, DMIC_DAI_LINK_48k_NAME, - concat(`PIPELINE_SINK_', DMIC_PIPELINE_48k_ID), 2, s32le, - DMIC_48k_PERIOD_US, DMIC_48k_PRIORITY, DMIC_48k_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is DMIC 1 using 2 periods -# Buffers use s32le format, with 16 frame per 1000us on core 0 with priority 0 -ifdef(NO16KDMIC, `', -`DAI_ADD(sof/pipe-dai-capture.m4, - DMIC_PIPELINE_16k_ID, DMIC, 1, DMIC_DAI_LINK_16k_NAME, - concat(`PIPELINE_SINK_', DMIC_PIPELINE_16k_ID), 2, s32le, - INTEL_GENERIC_DMIC_PERIOD, 0, DMIC_16k_CORE_ID, SCHEDULE_TIME_DOMAIN_TIMER)') - -dnl PCM_DUPLEX_ADD(name, pcm_id, playback, capture) -dnl PCM_CAPTURE_ADD(name, pipeline, capture) -PCM_CAPTURE_ADD(DMIC_48k_PCM_NAME, DMIC_PCM_48k_ID, concat(`PIPELINE_PCM_', DMIC_PIPELINE_48k_ID)) - -ifdef(NO16KDMIC, `', -`PCM_CAPTURE_ADD(DMIC_16k_PCM_NAME, DMIC_PCM_16k_ID, concat(`PIPELINE_PCM_', DMIC_PIPELINE_16k_ID))') - -ifdef(`PDM1',`define(DEF_STEREO_PDM, `STEREO_PDM1')',`define(DEF_STEREO_PDM, `STEREO_PDM0')') - -# -# BE configurations - overrides config in ACPI if present -# - -dnl DAI_CONFIG(type, dai_index, link_id, name, ssp_config/dmic_config) -ifelse(DMIC_DAI_CHANNELS, 4, -`DAI_CONFIG(DMIC, 0, DMIC_DAI_LINK_48k_ID, DMIC_DAI_LINK_48k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 200, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))', -`DAI_CONFIG(DMIC, 0, DMIC_DAI_LINK_48k_ID, DMIC_DAI_LINK_48k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 200, DMIC, 0, - PDM_CONFIG(DMIC, 0, DEF_STEREO_PDM)))') - -ifdef(NO16KDMIC, `', -`ifelse(DMIC16K_DAI_CHANNELS, 4, -`DAI_CONFIG(DMIC, 1, DMIC_DAI_LINK_16k_ID, DMIC_DAI_LINK_16k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, FOUR_CH_PDM0_PDM1)))', -`DAI_CONFIG(DMIC, 1, DMIC_DAI_LINK_16k_ID, DMIC_DAI_LINK_16k_NAME, - DMIC_CONFIG(1, 2400000, 4800000, 40, 60, 16000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 1, - PDM_CONFIG(DMIC, 1, DEF_STEREO_PDM)))')') - -undefine(DEF_STEREO_PDM) diff --git a/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 b/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 deleted file mode 100644 index afe48b4adad3..000000000000 --- a/tools/topology/topology1/platform/intel/intel-hdmi-ssp.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# -# HDMI-SSP Audio Offload support -# - -include(`ssp.m4') - -define(`HDMI_SSP_NAME', concat(concat(`SSP', HDMI_SSP_NUM),`-HDMI')) -define(`HDMI_SSP_PCM_NAME', concat(concat(`HDMI-', HDMI_SSP_NUM),`-In')) - -# variable that need to be defined in upper m4 -ifdef(`HDMI_SSP_PIPELINE_CP_ID',`',`fatal_error(note: Need to define capture pcm id for ssp intel-hdmi-in -)') -ifdef(`HDMI_SSP_DAI_LINK_ID',`',`fatal_error(note: Need to define DAI link id for ssp intel-hdmi-in -)') -ifdef(`HDMI_SSP_PCM_ID',`',`fatal_error(note: Need to define pipeline PCM dev id for ssp intel-hdmi-in -)') - - -# Low Latency capture pipeline 4 on PCM HDMI_SSP_PCM_ID using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, - HDMI_SSP_PIPELINE_CP_ID, HDMI_SSP_PCM_ID, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - - -# capture DAI is SSP using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - HDMI_SSP_PIPELINE_CP_ID, SSP, HDMI_SSP_NUM, HDMI_SSP_NAME, - concat(`PIPELINE_SINK_', HDMI_SSP_PIPELINE_CP_ID), 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) - - -PCM_CAPTURE_ADD(HDMI_SSP_PCM_NAME, HDMI_SSP_PCM_ID, concat(`PIPELINE_PCM_', HDMI_SSP_PIPELINE_CP_ID)) - - -#BE configuration in slave mode -DAI_CONFIG(SSP, HDMI_SSP_NUM, HDMI_SSP_DAI_LINK_ID, HDMI_SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 24576000, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_provider), - SSP_CLOCK(fsync, 48000, codec_provider), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, HDMI_SSP_NUM, 32, 0))) - - -undefine(`HDMI_SSP_PIPELINE_CP_ID') -undefine(`HDMI_SSP_DAI_LINK_ID') -undefine(`HDMI_SSP_PCM_ID') dnl use fixed PCM_ID -undefine(`HDMI_SSP_NUM') -undefine(`HDMI_SSP_NAME') -undefine(`HDMI_SSP_PCM_NAME') - diff --git a/tools/topology/topology1/platform/intel/rpl.m4 b/tools/topology/topology1/platform/intel/rpl.m4 deleted file mode 100644 index a36e847e9bad..000000000000 --- a/tools/topology/topology1/platform/intel/rpl.m4 +++ /dev/null @@ -1,6 +0,0 @@ -# -# Raptor Lake differentiation for pipelines and components -# - -# no difference yet, use Alder Lake definitions -include(`platform/intel/adl.m4') diff --git a/tools/topology/topology1/platform/intel/tgl.m4 b/tools/topology/topology1/platform/intel/tgl.m4 deleted file mode 100644 index f058b2025bbb..000000000000 --- a/tools/topology/topology1/platform/intel/tgl.m4 +++ /dev/null @@ -1,38 +0,0 @@ -# -# Tigerlake differentiation for pipelines and components -# - -include(`memory.m4') - -dnl Memory capabilities for different buffer types on Tigerlake -define(`PLATFORM_DAI_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_HOST_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_PASS_MEM_CAP', - MEMCAPS(MEM_CAP_RAM, MEM_CAP_DMA, MEM_CAP_CACHE, MEM_CAP_HP)) -define(`PLATFORM_COMP_MEM_CAP', MEMCAPS(MEM_CAP_RAM, MEM_CAP_CACHE)) - -# Low Latency PCM Configuration -W_VENDORTUPLES(pipe_ll_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "50000"')) - -W_DATA(pipe_ll_schedule_plat, pipe_ll_schedule_plat_tokens) - -# Media PCM Configuration -W_VENDORTUPLES(pipe_media_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "100000"')) - -W_DATA(pipe_media_schedule_plat, pipe_media_schedule_plat_tokens) - -# Tone Signal Generator Configuration -W_VENDORTUPLES(pipe_tone_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "200000"')) - -W_DATA(pipe_tone_schedule_plat, pipe_tone_schedule_plat_tokens) - -# DAI schedule Configuration - scheduled by IRQ -W_VENDORTUPLES(pipe_dai_schedule_plat_tokens, sof_sched_tokens, - LIST(` ', `SOF_TKN_SCHED_MIPS "5000"')) - -W_DATA(pipe_dai_schedule_plat, pipe_dai_schedule_plat_tokens) diff --git a/tools/topology/topology1/sof-adl-nau8825.m4 b/tools/topology/topology1/sof-adl-nau8825.m4 deleted file mode 100644 index d2feb681197d..000000000000 --- a/tools/topology/topology1/sof-adl-nau8825.m4 +++ /dev/null @@ -1,400 +0,0 @@ -# -# Topology for Alderlake with headphone, DMIC, HDMI with/without speaker. -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Alderlake DSP configuration -include(`platform/intel/adl.m4') -include(`platform/intel/dmic.m4') - -DEBUG_START - -ifdef(`NO_AMP',,` -ifdef(`AMP_SSP',`',`fatal_error(note: Define AMP_SSP for speaker amp SSP Index)')') - -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',,` -include(`muxdemux.m4') - -# -# Define the demux configure -# -# PCM0 --> volume --> demux --> SSP1/SSP2 (speaker - max98360a/rt1019) -# | -# PCM6 <----------------+ - -#define speaker SSP index -define(`SPK_SSP_INDEX', AMP_SSP) -# define SSP BE dai_link name -define(`SPK_SSP_NAME', concat(concat(`SSP', SPK_SSP_INDEX),`-Codec')) -# define BE dai_link ID -define(`SPK_BE_ID', 7) -# Ref capture related -# Ref capture BE dai_name -define(`SPK_REF_DAI_NAME', concat(concat(`SSP', SPK_SSP_INDEX),`.IN')) -define(`DEMUX_ROUTE')')') -ifdef(`DEMUX_ROUTE', -dnl Configure demux -dnl name, pipeline_id, routing_matrix_rows -dnl Diagonal 1's in routing matrix mean that every input channel is -dnl copied to corresponding output channels in all output streams. -dnl I.e. row index is the input channel, 1 means it is copied to -dnl corresponding output channel (column index), 0 means it is discarded. -dnl There's a separate matrix for all outputs. -`define(matrix1, `ROUTE_MATRIX(1, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')')' - -`define(matrix2, `ROUTE_MATRIX(9, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')')' - -dnl name, num_streams, route_matrix list -`MUXDEMUX_CONFIG(demux_priv_1, 2, LIST_NONEWLINE(`', `matrix1,', `matrix2'))') - -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',` -# PCM0 ----> smart_amp ----> SSP1 (Speaker - max98373) -# ^ -# | -# | -# PCM0 <---- demux <----- SSP1 (Speaker - max98373)')') -# PCM1 <---> volume <----> SSP0 (Headset - NAU8825) -# PCM2 ----> volume -----> iDisp1 -# PCM3 ----> volume -----> iDisp2 -# PCM4 ----> volume -----> iDisp3 -# PCM5 ----> volume -----> iDisp4 -ifdef(`BT_OFFLOAD', ` -# PCM7 ----> passthrough ----> SSP2 (Bluetooth)') -# PCM99 <---- volume <---- DMIC01 (dmic 48k capture) -# PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) - -ifdef(`SPK_MIC_PERIOD_US',`', `define(`SPK_MIC_PERIOD_US', 1000)') - -# Run Speakers pipeline on core#1 by default for low power considering -ifdef(`SPK_PLAYBACK_CORE', `', `define(`SPK_PLAYBACK_CORE', `1')') - -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',` -# Smart amplifier related -# SSP related -#define smart amplifier SSP index -define(`SMART_SSP_INDEX', AMP_SSP) -#define SSP BE dai_link name -define(`SMART_SSP_NAME', concat(concat(`SSP', AMP_SSP),`-Codec')) -#define BE dai_link ID -define(`SMART_BE_ID', 7) -#define SSP mclk -define(`SSP_MCLK', 24576000) -#define Core ID -define(`SMART_AMP_CORE', SPK_PLAYBACK_CORE) -# Playback related -define(`SMART_PB_PPL_ID', 1) -define(`SMART_PB_CH_NUM', 2) -define(`SMART_TX_CHANNELS', 4) -define(`SMART_RX_CHANNELS', 4) -define(`SMART_FB_CHANNELS', 4) -# Ref capture related -define(`SMART_REF_PPL_ID', 11) -define(`SMART_REF_CH_NUM', 2) -# PCM related -define(`SMART_PCM_ID', 0) -define(`SMART_PCM_NAME', `smart373-spk') - -# Include Smart Amplifier support -ifdef(`DTS',` -include(`sof-eq-iir-dts-codec-smart-amplifier.m4')',` -include(`sof-smart-amplifier.m4')')')') - -# Define pipeline id for intel-generic-dmic-kwd.m4 -# to generate dmic setting with kwd when we have dmic -# define channel -define(CHANNELS, `4') -# define kfbm with volume -define(KFBM_TYPE, `vol-kfbm') -# define pcm, pipeline and dai id -define(DMIC_PCM_48k_ID, `99') -define(DMIC_PIPELINE_48k_ID, `4') -define(DMIC_DAI_LINK_48k_ID, `1') -define(DMIC_PCM_16k_ID, `100') -define(DMIC_PIPELINE_16k_ID, `12') -define(DMIC_PIPELINE_KWD_ID, `13') -define(DMIC_DAI_LINK_16k_ID, `2') -# Offload DMIC_PIPELINE_48K to secondary core for IGO. -ifdef(`IGO', `define(`DMIC_PIPELINE_48k_CORE_ID', 1)') -# define pcm, pipeline and dai id -define(KWD_PIPE_SCH_DEADLINE_US, 20000) -# include the generic dmic with kwd -ifdef(`NOHOTWORD', -` -define(NO16KDMIC) -define(DMIC_48k_CORE_ID, 1) -define(DMICPROC, passthrough) -include(`platform/intel/intel-generic-dmic.m4')', -`include(`platform/intel/intel-generic-dmic-kwd.m4')') - -# define(`SSP_MCLK', ) -ifdef(`SSP_MCLK',`',`define(`SSP_MCLK', 19200000)') - -ifdef(`BT_OFFLOAD', ` -define(`BT_PIPELINE_PB_ID', eval(DMIC_PIPELINE_KWD_ID + 1)) -define(`BT_PIPELINE_CP_ID', eval(DMIC_PIPELINE_KWD_ID + 2)) -define(`BT_DAI_LINK_ID', 7) - -ifdef(`AMP_SSP',` -define(`BT_DAI_LINK_ID', 8)') - -define(`BT_PCM_ID', `7') -define(`HW_CONFIG_ID', eval(BT_DAI_LINK_ID)) -include(`platform/intel/intel-generic-bt.m4')') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate) - -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',,` -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, - 1, 0, 2, s32le, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, - 48000, 48000, 48000)')') - -# Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD( -ifdef(`DTS', sof/pipe-eq-iir-dts-codec-playback.m4, sof/pipe-volume-playback.m4), - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 3 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 3, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 3 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 4 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is SSP0 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 2, SSP, 0, SSP0-Codec, - PIPELINE_SOURCE_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP0 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, SSP, 0, SSP0-Codec, - PIPELINE_SINK_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 0, iDisp1, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 1, iDisp2, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 2, iDisp3, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp4 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 3, iDisp4, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',,` -# playback DAI is SSP1 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SOURCE_1, 2, FMT, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, SCHEDULE_TIME_DOMAIN_TIMER) - -# The echo refenrence pipeline has no connections in it, -# it is used for the capture DAI widget to dock. -DAI_ADD(sof/pipe-echo-ref-dai-capture.m4, - 29, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SINK_29, 3, FMT, - 1000, 0, SPK_PLAYBACK_CORE, SCHEDULE_TIME_DOMAIN_TIMER) - -# Capture pipeline 9 from demux on PCM 6 using max 2 channels of s32le. -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture-sched.m4, - 9, 6, 2, s32le, - 1000, 1, SPK_PLAYBACK_CORE, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Connect demux to capture -SectionGraph."PIPE_CAP" { - index "0" - - lines [ - # mux to capture - dapm(PIPELINE_SINK_9, PIPELINE_DEMUX_1) - ] -} - -# Connect virtual capture to dai -SectionGraph."PIPE_CAP_VIRT" { - index "9" - - lines [ - # mux to capture - dapm(ECHO REF 9, SPK_REF_DAI_NAME) - ] -}')') - -# -# Bind PCM with the pipeline -# -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback, capture) -PCM_DUPLEX_ADD(Headset, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) -PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI4, 5, PIPELINE_PCM_8) -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',,` -PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1) -PCM_CAPTURE_ADD(EchoRef, 6, PIPELINE_PCM_9)')') - -# -# BE configurations - overrides config in ACPI if present -# -dnl DAI_CONFIG(type, dai_index, link_id, name, ssp_config/dmic_config) -dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data) -dnl SSP_CLOCK(clock, freq, codec_master, polarity) -dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id) -dnl mclk_id is optional -dnl ssp1-maxmspk - -#SSP 0 (ID: 0) -DAI_CONFIG(SSP, 0, 0, SSP0-Codec, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 32, 0, 0, 0, SSP_CC_BCLK_ES))) - -# 4 HDMI/DP outputs (ID: 3,4,5,6) -DAI_CONFIG(HDA, 0, 3, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 4, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 5, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -DAI_CONFIG(HDA, 3, 6, iDisp4, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) - -ifdef(`NO_AMP',,` -ifdef(`SMART_AMP',,` -`# SSP' SPK_SSP_INDEX `(ID: 7)' -DAI_CONFIG(SSP, SPK_SSP_INDEX, SPK_BE_ID, SPK_SSP_NAME, -ifelse( - CODEC, `MAX98360A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 1536000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 16, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', - CODEC, `RT1019P', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 1536000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 16, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', - CODEC, `RT1015P', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', - CODEC, `NAU8318', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 1536000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 16, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', -)')') - -DEBUG_END diff --git a/tools/topology/topology1/sof-glk-es8336.m4 b/tools/topology/topology1/sof-glk-es8336.m4 deleted file mode 100644 index 1e63c87d0065..000000000000 --- a/tools/topology/topology1/sof-glk-es8336.m4 +++ /dev/null @@ -1,205 +0,0 @@ -# -# Topology for generic Apollolake UP^2 with es8316 codec. -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include DSP configuration -include(`platform/intel/'PLATFORM`.m4') - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# define(`SSP_MCLK', ) -define(`SSP_MCLK', 19200000) - -# Define pipeline id for intel-generic-dmic.m4 -# to generate dmic setting - -ifelse(CHANNELS, `0', , -` - -# if XPROC is not defined, define with default pipe -ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') - -define(DMIC_PCM_48k_ID, `1') -define(DMIC_PCM_16k_ID, `2') -define(DMIC_DAI_LINK_48k_ID, `1') -define(DMIC_DAI_LINK_16k_ID, `2') -define(DMIC_PIPELINE_48k_ID, `3') -define(DMIC_PIPELINE_16k_ID, `4') - -include(`platform/intel/intel-generic-dmic.m4') -' -) - -# Add HDMI-SSP Audio Offload pass-through -ifdef(`HDMI_1_SSP_NUM', -` define(`HDMI_SSP_NUM', HDMI_1_SSP_NUM) - define(`HDMI_SSP_PIPELINE_CP_ID', `8') - define(`HDMI_SSP_DAI_LINK_ID', 6) - define(`HDMI_SSP_PCM_ID', `3') dnl use fixed PCM_ID - include(`platform/intel/intel-hdmi-ssp.m4') -' -) - -ifdef(`HDMI_2_SSP_NUM', -` define(`HDMI_SSP_NUM', HDMI_2_SSP_NUM) - define(`HDMI_SSP_PIPELINE_CP_ID', `9') - define(`HDMI_SSP_DAI_LINK_ID', 7) - define(`HDMI_SSP_PCM_ID', `4') dnl use fixed PCM_ID - include(`platform/intel/intel-hdmi-ssp.m4') -' -) - -DEBUG_START -# -# Define the pipelines -# -# PCM0 <----> volume <-----> SSP2 (es8316) -# -ifelse(CHANNELS, `0', -` -# PCM2 <-------------------- DMIC01 (dmic0 capture, BE dailink 2) -# PCM3 <-------------------- DMIC16k (dmic16k, BE dailink 3) -') -# PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5) -# PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6) -# PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7) -ifdef(`HDMI_1_SSP_NUM', -` -# PCM3 <---- volume <----- HDMI_1_SSP_NUM (lt6911) -' -) -ifdef(`HDMI_2_SSP_NUM', -` -# PCM4 <---- volume <----- HDMI_2_SSP_NUM (lt6911) -' -) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-low-latency-capture.m4, - 2, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 6 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 6, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 7 using max 2 channels of s32le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 7, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is SSP2 using 2 periods -# Buffers use s24le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, SSP_NUM, `SSP'SSP_NUM`-Codec', - PIPELINE_SOURCE_1, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) - -# capture DAI is SSP2 using 2 periods -# Buffers use s24le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, SSP_NUM, `SSP'SSP_NUM`-Codec', - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_DMA) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 3, iDisp1, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 4, iDisp2, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 5, iDisp3, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -PCM_DUPLEX_ADD(ES8336, 0, PIPELINE_PCM_1, PIPELINE_PCM_2) - -PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_7) - -# BE configurations - overrides config in ACPI if present - -DAI_CONFIG(SSP, SSP_NUM, 0, `SSP'SSP_NUM`-Codec', - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, SSP_NUM, 24, 0))) - - -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 3, 3, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) -DAI_CONFIG(HDA, 4, 4, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2))) -DAI_CONFIG(HDA, 5, 5, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) - -DEBUG_END - - diff --git a/tools/topology/topology1/sof-hda-generic-idisp.m4 b/tools/topology/topology1/sof-hda-generic-idisp.m4 deleted file mode 100644 index 65cd7f6a3804..000000000000 --- a/tools/topology/topology1/sof-hda-generic-idisp.m4 +++ /dev/null @@ -1,129 +0,0 @@ -# -# Topology for SKL+ HDA Generic machine w/ iDISP codec only -# - -# if XPROC is not defined, define with default pipe -ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include bxt DSP configuration -include(`platform/intel/bxt.m4') - -# Define pipeline id for intel-generic-dmic.m4 -# to generate dmic setting - -ifelse(CHANNELS, `0', , -` -define(DMIC_PCM_48k_ID, `6') -define(DMIC_PCM_16k_ID, `7') -define(DMIC_DAI_LINK_48k_ID, `6') -define(DMIC_DAI_LINK_16k_ID, `7') -define(DMIC_PIPELINE_48k_ID, `5') -define(DMIC_PIPELINE_16k_ID, `6') - -include(`platform/intel/intel-generic-dmic.m4') -' -) - -# -# Define the pipelines -# -# PCM1 ----> volume -----> iDisp1 -# PCM2 ----> volume -----> iDisp2 -# PCM3 ----> volume -----> iDisp3 -# - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 4 on PCM 3 using max 2 channels of s32le. -# Set 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 4, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 2, HDA, 0, iDisp1, - PIPELINE_SOURCE_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, HDA, 1, iDisp2, - PIPELINE_SOURCE_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 4, HDA, 2, iDisp3, - PIPELINE_SOURCE_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_PLAYBACK_ADD(HDMI1, 1, PIPELINE_PCM_2) -PCM_PLAYBACK_ADD(HDMI2, 2, PIPELINE_PCM_3) -PCM_PLAYBACK_ADD(HDMI3, 3, PIPELINE_PCM_4) - -# -# BE configurations - overrides config in ACPI if present -# - -# 3 HDMI/DP outputs (ID: 1,2,3) -DAI_CONFIG(HDA, 0, 1, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 2, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 3, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) - -VIRTUAL_DAPM_ROUTE_OUT(iDisp1_out, HDA, 0, OUT, 2) -VIRTUAL_DAPM_ROUTE_OUT(iDisp2_out, HDA, 1, OUT, 3) -VIRTUAL_DAPM_ROUTE_OUT(iDisp3_out, HDA, 2, OUT, 4) - -VIRTUAL_WIDGET(iDisp3 Tx, out_drv, 0) -VIRTUAL_WIDGET(iDisp2 Tx, out_drv, 1) -VIRTUAL_WIDGET(iDisp1 Tx, out_drv, 2) diff --git a/tools/topology/topology1/sof-hda-generic.m4 b/tools/topology/topology1/sof-hda-generic.m4 deleted file mode 100644 index b920bf7c411e..000000000000 --- a/tools/topology/topology1/sof-hda-generic.m4 +++ /dev/null @@ -1,222 +0,0 @@ -# Topology for SKL+ HDA Generic machine -# - -# if XPROC is not defined, define with default pipe -ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') -ifdef(`HSPROC', , `define(HSPROC, volume)') -ifdef(`HSSFX', , `define(HSSFX, volume)') - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include bxt DSP configuration -include(`platform/intel/bxt.m4') - -# Define pipeline id for intel-generic-dmic.m4 -# to generate dmic setting - -ifelse(CHANNELS, `0', , -` -define(DMIC_PCM_48k_ID, `6') -define(DMIC_PCM_16k_ID, `7') -define(DMIC_DAI_LINK_48k_ID, `6') -define(DMIC_DAI_LINK_16k_ID, `7') -define(DMIC_PIPELINE_48k_ID, `10') -define(DMIC_PIPELINE_16k_ID, `11') - -include(`platform/intel/intel-generic-dmic.m4') -' -) - -# The pipeline naming notation is pipe-mixer-PROCESSING-dai-DIRECTION.m4 -# HSPROC is set by makefile, if not the default above is applied -define(PIPE_HEADSET_PLAYBACK, `sof/pipe-mixer-`HSPROC'-dai-playback.m4') - -# -# Define the pipelines -# -# PCM0P --> volume (pipe 1) --> HDA Analog (HDA Analog playback) -# PCM0C <-- volume, EQ (pipe 2) <-- HDA Analog (HDA Analog capture) -# PCM3 ----> volume (pipe 7) ----> iDisp1 (HDMI/DP playback, BE link 3) -# PCM4 ----> Volume (pipe 8) ----> iDisp2 (HDMI/DP playback, BE link 4) -# PCM5 ----> volume (pipe 9) ----> iDisp3 (HDMI/DP playback, BE link 5) -# - -# If HSPROC_FILTERx is defined set PIPELINE_FILTERx -ifdef(`HSPROC_FILTER1', `define(PIPELINE_FILTER1, HSPROC_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`HSPROC_FILTER2', `define(PIPELINE_FILTER2, HSPROC_FILTER2)', `undefine(`PIPELINE_FILTER2')') - -# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-highpass-capture.m4, - 2, 0, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 3 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 3, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 4 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 4, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 9 on PCM 5 using max 2 channels of s24le. -# 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 9, 5, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -# playback DAI is HDA Analog using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -# The 'NOT_USED_IGNORED' is due to dependencies and is adjusted later with an explicit dapm line. -DAI_ADD(PIPE_HEADSET_PLAYBACK, - 1, HDA, 0, Analog Playback and Capture, - NOT_USED_IGNORED, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) - -# If HSSFX_FILTERx is defined set PIPELINE_FILTERx -ifdef(`HSSFX_FILTER1', `define(PIPELINE_FILTER1, HSSFX_FILTER1)', `undefine(`PIPELINE_FILTER1')') -ifdef(`HSSFX_FILTER2', `define(PIPELINE_FILTER2, HSSFX_FILTER2)', `undefine(`PIPELINE_FILTER2')') - -# Low Latency playback pipeline 1 on PCM 30 using max 2 channels of s32le. -# 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-HSSFX-playback.m4, - 30, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Deep buffer playback pipeline 31 on PCM 31 using max 2 channels of s32le -# Set 1000us deadline on core 0 with priority 0. -# TODO: Modify pipeline deadline to account for deep buffering -ifdef(`DEEP_BUFFER', -` -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, - 31, 31, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) -' -) - -# Undefine PIPELINE_FILTERx to avoid to propagate elsewhere, other endpoints -# with filters blobs will need similar handling as HSPROC_FILTERx. -undefine(`PIPELINE_FILTER1') -undefine(`PIPELINE_FILTER2') - -# capture DAI is HDA Analog using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, HDA, 1, Analog Playback and Capture, - PIPELINE_SINK_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 4, iDisp1, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 5, iDisp2, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Dai buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 9, HDA, 6, iDisp3, - PIPELINE_SOURCE_9, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -SectionGraph."mixer-host" { - index "0" - - lines [ - # connect mixer dai pipelines to PCM pipelines - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_30) -ifdef(`DEEP_BUFFER', -` - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_31) -' -) - ] -} - -PCM_DUPLEX_ADD(HDA Analog, 0, PIPELINE_PCM_30, PIPELINE_PCM_2) -ifdef(`DEEP_BUFFER', -` -PCM_PLAYBACK_ADD(HDA Analog Deep Buffer, 31, PIPELINE_PCM_31) -' -) -PCM_PLAYBACK_ADD(HDMI1, 3, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI2, 4, PIPELINE_PCM_8) -PCM_PLAYBACK_ADD(HDMI3, 5, PIPELINE_PCM_9) - -# -# BE configurations - overrides config in ACPI if present -# - -# HDA outputs -DAI_CONFIG(HDA, 0, 4, Analog Playback and Capture, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) - -# 3 HDMI/DP outputs (ID: 3,4,5) -DAI_CONFIG(HDA, 4, 1, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2))) -DAI_CONFIG(HDA, 5, 2, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) -DAI_CONFIG(HDA, 6, 3, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2))) - - -VIRTUAL_DAPM_ROUTE_IN(codec0_in, HDA, 1, IN, 1) -VIRTUAL_DAPM_ROUTE_IN(codec1_in, HDA, 3, IN, 2) -VIRTUAL_DAPM_ROUTE_OUT(codec0_out, HDA, 0, OUT, 3) -VIRTUAL_DAPM_ROUTE_OUT(codec1_out, HDA, 2, OUT, 4) - -# codec2 is not supported in dai links but it exists -# in dapm routes, so hack this one to HDA1 -VIRTUAL_DAPM_ROUTE_IN(codec2_in, HDA, 3, IN, 5) -VIRTUAL_DAPM_ROUTE_OUT(codec2_out, HDA, 2, OUT, 6) - -VIRTUAL_DAPM_ROUTE_OUT(iDisp1_out, HDA, 4, OUT, 7) -VIRTUAL_DAPM_ROUTE_OUT(iDisp2_out, HDA, 5, OUT, 8) -VIRTUAL_DAPM_ROUTE_OUT(iDisp3_out, HDA, 6, OUT, 9) - -VIRTUAL_WIDGET(iDisp3 Tx, out_drv, 0) -VIRTUAL_WIDGET(iDisp2 Tx, out_drv, 1) -VIRTUAL_WIDGET(iDisp1 Tx, out_drv, 2) -VIRTUAL_WIDGET(Analog CPU Playback, out_drv, 3) -VIRTUAL_WIDGET(Digital CPU Playback, out_drv, 4) -VIRTUAL_WIDGET(Alt Analog CPU Playback, out_drv, 5) -VIRTUAL_WIDGET(Analog CPU Capture, input, 6) -VIRTUAL_WIDGET(Digital CPU Capture, input, 7) -VIRTUAL_WIDGET(Alt Analog CPU Capture, input, 8) diff --git a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 b/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 deleted file mode 100644 index c397d2bc8a93..000000000000 --- a/tools/topology/topology1/sof-icl-rt711-rt1308-rt715-hdmi.m4 +++ /dev/null @@ -1,398 +0,0 @@ -# -# Topology for Icelake with rt711 + rt1308 (x2) + rt715. -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`alh.m4') -include(`muxdemux.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Platform specific DSP configuration -include(`platform/intel/'PLATFORM`.m4') - -ifdef(`UAJ_LINK',`', -`define(UAJ_LINK, `0')') - -ifdef(`AMP_1_LINK',`', -`define(AMP_1_LINK, `1')') - -ifdef(`AMP_2_LINK',`', -`define(AMP_2_LINK, `2')') - -ifdef(`MIC_LINK',`', -`define(MIC_LINK, `3')') - -# uncomment to remove HDMI support -#define(NOHDMI, `1') - -# UAJ ID: 0, 1 -# AMP ID: 2, 3 (if EXT_AMP_REF defined) -# DMIC ID: 4 -# HDMI ID calculated based on the configuration -define(HDMI_BE_ID_BASE, `0') - -ifdef(`NO_JACK', `', - `undefine(`HDMI_BE_ID_BASE') - define(HDMI_BE_ID_BASE, `2')' -) - -ifdef(`NOAMP', `', - `undefine(`HDMI_BE_ID_BASE') - define(HDMI_BE_ID_BASE, `3')' -) - -ifdef(`EXT_AMP_REF', - `undefine(`HDMI_BE_ID_BASE') - define(HDMI_BE_ID_BASE, `4')', - `' -) - -ifdef(`NO_LOCAL_MIC', `', - `undefine(`HDMI_BE_ID_BASE') - define(HDMI_BE_ID_BASE, `5')' -) - -DEBUG_START - -dnl Configure demux -dnl name, pipeline_id, routing_matrix_rows -dnl Diagonal 1's in routing matrix mean that every input channel is -dnl copied to corresponding output channels in all output streams. -dnl I.e. row index is the input channel, 1 means it is copied to -dnl corresponding output channel (column index), 0 means it is discarded. -dnl There's a separate matrix for all outputs. -ifdef(`NOAMP', `', -` -ifdef(`MONO', `', -` -define(matrix1, `ROUTE_MATRIX(3, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -define(matrix2, `ROUTE_MATRIX(4, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -dnl name, num_streams, route_matrix list -MUXDEMUX_CONFIG(demux_priv_3, 2, LIST_NONEWLINE(`', `matrix1,', `matrix2')) -') -') - -# -# Define the pipelines -# -ifdef(`NOJACK', `', -` -# PCM0 ---> volume ----> mixer --->ALH 2 BE UAJ_LINK -# PCM31 ---> volume ------^ -# PCM1 <--- volume <---- ALH 3 BE UAJ_LINK -') -ifdef(`NOAMP', `', -` -# PCM2 ---> volume ----> ALH 2 BE AMP_1_LINK -ifdef(`MONO', `', -`# PCM40 ---> volume ----> ALH 2 BE AMP_2_LINK') -') -ifdef(`NO_LOCAL_MIC', `', -`# PCM4 <--- volume <---- ALH 2 BE MIC_LINK') - -ifdef(`NOHDMI', `', -` -# PCM5 ---> volume ----> iDisp1 -# PCM6 ---> volume ----> iDisp2 -# PCM7 ---> volume ----> iDisp3 -') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -ifdef(`NOJACK', `', -` -# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -') - -ifdef(`NOAMP', `', -` -ifdef(`MONO', -` -# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -', -` -# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-demux-playback.m4, - 3, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 4 on PCM 40 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-dai-endpoint.m4, - 4, 40, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -') -') - -ifdef(`NO_LOCAL_MIC', `', -` -# Low Latency capture pipeline 5 on PCM 4 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-highpass-switch-capture.m4, - 5, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -') - -# Low Latency playback pipeline 6 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 6 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 6, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 7 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 7, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -ifdef(`NOJACK', `', -` -# playback DAI is ALH(UAJ_LINK PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -# The NOT_USED_IGNORED is due to dependencies and is adjusted later with an explicit dapm line. - -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, - 1, ALH, eval(UAJ_LINK * 256 + 2), `SDW'eval(UAJ_LINK)`-Playback', - NOT_USE_IGNORED, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) - -# capture DAI is ALH(UAJ_LINK PIN3) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, ALH, eval(UAJ_LINK * 256 + 3), `SDW'eval(UAJ_LINK)`-Capture', - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# Low Latency playback pipeline 30 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, - 30, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Deep buffer playback pipeline 31 on PCM 31 using max 2 channels of s32le -# Set 1000us deadline on core 0 with priority 0. -# TODO: Modify pipeline deadline to account for deep buffering -ifdef(`HEADSET_DEEP_BUFFER', -` -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, - 31, 31, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) -' -) - -SectionGraph."mixer-host" { - index "0" - - lines [ - # connect mixer dai pipelines to PCM pipelines - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_30) -ifdef(`HEADSET_DEEP_BUFFER', -` - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_31) -' -) - ] -} - -' -) - -ifdef(`NOAMP', `', -` -# playback DAI is ALH(AMP_1_LINK PIN2/AMP_2_LINK PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', - PIPELINE_SOURCE_3, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -ifdef(`MONO', `', -`DAI_ADD_SCHED(sof/pipe-dai-sched-playback.m4, - 4, ALH, eval(AMP_2_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', - PIPELINE_SOURCE_4, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_3) - -# Connect demux to 2nd pipeline -SectionGraph."PIPE_DEMUX" { - index "4" - - lines [ - # mux to 2nd pipeline - dapm(PIPELINE_SOURCE_4, PIPELINE_DEMUX_3) - ] -} -') -') - -ifdef(`NO_LOCAL_MIC', `', -` -# capture DAI is ALH(MIC_LINK PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 5, ALH, eval(MIC_LINK * 256 + 2), `SDW'eval(MIC_LINK)`-Capture', - PIPELINE_SINK_5, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) -') - -ifdef(`NOHDMI', `', -` -# playback DAI is iDisp1 using 2 periods -# # Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 0, iDisp1, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# # Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 1, iDisp2, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# # Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 2, iDisp3, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) -') - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) - -ifdef(`NOJACK', `', -` -PCM_PLAYBACK_ADD(Jack Out, 0, PIPELINE_PCM_30) -ifdef(`HEADSET_DEEP_BUFFER', -` -PCM_PLAYBACK_ADD(Jack Out DeepBuffer, 31, PIPELINE_PCM_31) -' -) -PCM_CAPTURE_ADD(Jack In, 1, PIPELINE_PCM_2) -') -ifdef(`NOAMP', `', -` -PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3) -') -ifdef(`NO_LOCAL_MIC', `', `PCM_CAPTURE_ADD(Microphone, 4, PIPELINE_PCM_5)') - -ifdef(`NOHDMI', `', -` -PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_8) -') - -# -# BE configurations - overrides config in ACPI if present -# - -ifdef(`NOJACK', `', -` -#ALH dai index = ((link_id << 8) | PDI id) -#ALH UAJ_LINK Pin2 (ID: 0) -DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 2), 0, `SDW'eval(UAJ_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 2), 48000, 2))) - -#ALH UAJ_LINK Pin3 (ID: 1) -DAI_CONFIG(ALH, eval(UAJ_LINK * 256 + 3), 1, `SDW'eval(UAJ_LINK)`-Capture', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(UAJ_LINK * 256 + 3), 48000, 2))) -') - -ifdef(`NOAMP', `', -` -#ALH AMP_1_LINK Pin2 (ID: 2) -DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) -') - -ifdef(`NO_LOCAL_MIC', `', -` -#ALH MIC_LINK Pin2 (ID: 4) -DAI_CONFIG(ALH, eval(MIC_LINK * 256 + 2), 4, `SDW'eval(MIC_LINK)`-Capture', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(MIC_LINK * 256 + 2), 48000, 2))) -') - -ifdef(`NOHDMI', `', -` -# 3 HDMI/DP outputs (ID: from HDMI_BE_ID_BASE) -DAI_CONFIG(HDA, 0, HDMI_BE_ID_BASE, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, eval(HDMI_BE_ID_BASE + 1), iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, eval(HDMI_BE_ID_BASE + 2), iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -') - -DEBUG_END diff --git a/tools/topology/topology1/sof-smart-amplifier-nocodec.m4 b/tools/topology/topology1/sof-smart-amplifier-nocodec.m4 deleted file mode 100644 index 5b5facd6c7c4..000000000000 --- a/tools/topology/topology1/sof-smart-amplifier-nocodec.m4 +++ /dev/null @@ -1,56 +0,0 @@ -# -# Topology for Tigerlake smart amplifier nocodec mode verification -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include platform specific DSP configuration -include(`platform/intel/tgl.m4') - -DEBUG_START - -# -# Define the pipelines -# -# PCM0 ----> smart_amp ----> SSP(SSP_INDEX) -# ^ -# | -# | -# PCM0 <---- demux <----- SSP(SSP_INDEX) -# - -# Smart amplifier related -# SSP related -#define smart amplifier SSP index -define(`SMART_SSP_INDEX', 0) -#define SSP BE dai_link name -define(`SMART_SSP_NAME', `NoCodec-0') -#define BE dai_link ID -define(`SMART_BE_ID', 0) -#define SSP QUIRK -define(`SMART_SSP_QUIRK', `SSP_QUIRK_LBM') - -# Playback related -define(`SMART_PB_PPL_ID', 1) -define(`SMART_PB_CH_NUM', 2) -define(`SMART_TX_CHANNELS', 4) -define(`SMART_RX_CHANNELS', 8) -define(`SMART_FB_CHANNELS', 8) -# Ref capture related -define(`SMART_REF_PPL_ID', 2) -define(`SMART_REF_CH_NUM', 4) -# PCM related -define(`SMART_PCM_ID', 0) -define(`SMART_PCM_NAME', `smart373-spk') - -# Include Smart Amplifier support -include(`sof-smart-amplifier.m4') - -DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 deleted file mode 100644 index 04bfc96471ff..000000000000 --- a/tools/topology/topology1/sof-tgl-max98357a-rt5682.m4 +++ /dev/null @@ -1,531 +0,0 @@ -# -# Topology for Tigerlake with CODEC amp + rt5682 codec + DMIC + 4 HDMI -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`muxdemux.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/'PLATFORM`.m4') -include(`platform/intel/dmic.m4') - -# Include machine driver definitions -include(`platform/intel/intel-boards.m4') - -DEBUG_START - -# -# Check option conflicts -# -ifdef(`2CH_2WAY', `ifdef(`4CH_PASSTHROUGH', `fatal_error(note: 2CH_2WAY and 4CH_PASSTHROUGH are mutually exclusive)')') - -# -# Set headphone type, default is RT5682 -# -ifdef(`USE_DA7219',`define(HEADPHONE, `DA7219')',` - ifdef(`USE_RT5650',`define(HEADPHONE, `RT5650')',`define(HEADPHONE, `RT5682')')') - -# -# Set the MCLK rate for headphone and amplifier SSP ports -# -ifelse( - HEADPHONE, `DA7219', ` - define(MCLK_RATE, `24576000')', - HEADPHONE, `RT5650', ` - define(MCLK_RATE, `24576000') - define(CODEC, `RT5650')', - HEADPHONE, `RT5682', ` - define(MCLK_RATE, `19200000')', - `fatal_error(note: unknown HEADPHONE type)') - -# -# Define the demux configure -# -dnl Configure demux -dnl name, pipeline_id, routing_matrix_rows -dnl Diagonal 1's in routing matrix mean that every input channel is -dnl copied to corresponding output channels in all output streams. -dnl I.e. row index is the input channel, 1 means it is copied to -dnl corresponding output channel (column index), 0 means it is discarded. -dnl There's a separate matrix for all outputs. -define(matrix1, `ROUTE_MATRIX(1, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -define(matrix2, `ROUTE_MATRIX(9, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -define(matrix3, `ROUTE_MATRIX(1, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,0)')') - -define(matrix4, `ROUTE_MATRIX(10, - `BITS_TO_BYTE(1, 0, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 1, 0 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 1 ,0 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,1 ,0 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,1 ,0 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,1 ,0 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,1 ,0)', - `BITS_TO_BYTE(0, 0, 0 ,0 ,0 ,0 ,0 ,1)')') - -dnl name, num_streams, route_matrix list -ifdef(`NO_AMP',`',` -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', - `ifdef(`2CH_2WAY', - `MUXDEMUX_CONFIG(demux_priv_1, 2, LIST_NONEWLINE(`', `matrix3,', `matrix4'))', - `MUXDEMUX_CONFIG(demux_priv_1, 3, LIST_NONEWLINE(`', `matrix1,', `matrix2,', `matrix4'))')', - `ifdef(`2CH_2WAY', - `MUXDEMUX_CONFIG(demux_priv_1, 1, LIST_NONEWLINE(`', `matrix3'))', - `MUXDEMUX_CONFIG(demux_priv_1, 2, LIST_NONEWLINE(`', `matrix1,', `matrix2'))')' -)') - -# -# Define the pipelines -# -ifdef(`2CH_2WAY',` -ifdef(`WAVES',` -# PCM0 --> waves --> demux(2to4-ch) --> eq_iir --> SSP$AMP_SSP (Speaker - CODEC)',` -# PCM0 --> demux(2to4-ch) --> eq_iir --> SSP$AMP_SSP (Speaker - CODEC)')',` -ifdef(`WAVES',` -# PCM0 --> waves --> volume --> demux --> SSP$AMP_SSP (Speaker - CODEC) -# | -# PCM6 <--------------------------+',` -# PCM0 --> volume --> demux --> SSP$AMP_SSP (Speaker - CODEC) -# | -# PCM6 <----------------+')') -# PCM1 <---> volume <----> SSP0 (Headset - ALC5682) -# PCM99 <---- volume <----- DMIC01 (dmic0 capture) -# PCM2 ----> volume -----> iDisp1 -# PCM3 ----> volume -----> iDisp2 -# PCM4 ----> volume -----> iDisp3 -# PCM5 ----> volume -----> iDisp4 -# PCM99 <---- volume <---- DMIC01 (dmic 48k capture) -# PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) - -ifdef(`SPK_MIC_PERIOD_US',`', `define(`SPK_MIC_PERIOD_US', 1000)') - -ifdef(`NO_AMP',`',` -# Define pipeline id for sof-tgl-CODEC-rt5682.m4 -ifdef(`AMP_SSP',`',`fatal_error(note: Define AMP_SSP for speaker amp SSP Index)') -# Speaker related -# SSP related -# define speaker SSP index -define(`SPK_SSP_INDEX', AMP_SSP) -# define SSP BE dai_link name -define(`SPK_SSP_NAME', concat(concat(`SSP', SPK_SSP_INDEX),`-Codec')) -# define BE dai_link ID -define(`SPK_BE_ID', BOARD_SPK_BE_ID) -# Ref capture related -# Ref capture BE dai_name -define(`SPK_REF_DAI_NAME', concat(concat(`SSP', SPK_SSP_INDEX),`.IN'))') - -# to generate dmic setting with kwd when we have dmic -# define channel -ifdef(`CHANNELS', `', `define(`CHANNELS', 4)') -# define kfbm with volume -define(KFBM_TYPE, `vol-kfbm') -# define pcm, pipeline and dai id -define(DMIC_PCM_48k_ID, `99') -define(DMIC_PIPELINE_48k_ID, `10') -define(DMIC_DAI_LINK_48k_ID, BOARD_DMIC_BE_ID_BASE) -define(DMIC_PCM_16k_ID, `100') -define(DMIC_PIPELINE_16k_ID, `11') -define(DMIC_PIPELINE_KWD_ID, `12') -define(DMIC_DAI_LINK_16k_ID, eval(BOARD_DMIC_BE_ID_BASE + 1)) -define(DMIC_PIPELINE_48k_CORE_ID, `1') - -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', - `ifdef(`RTNR', - `define(`DMICPROC', rtnr-google-rtc-audio-processing)', - `define(`DMICPROC', google-rtc-audio-processing)')' - `define(`DMIC_48k_PERIOD_US', 10000)' - , - `ifdef(`RTNR', - `define(`DMICPROC', rtnr)' -# 5ms period is required for RTNR build 20220728 and later versions - `define(`DMIC_48k_PERIOD_US', 5000)')' -) - -# Run Speakers pipeline on core#1 by default for low power considering -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', `define(`SPK_PLAYBACK_CORE', DMIC_PIPELINE_48k_CORE_ID)', - `ifdef(`SPK_PLAYBACK_CORE', `', `define(`SPK_PLAYBACK_CORE', `1')')') - -# Google RTC Audio processing processes 10ms at a time. It needs to have time to process it. -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', `define(`DMIC_48k_PERIOD', 10000)', `') - -# When Google RTC Audio (AEC) is applied, put DMIC pipe task after Speaker in schedule order. -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', `define(`DMIC_48k_PRIORITY', 1)', `') - -# define pcm, pipeline and dai id -define(KWD_PIPE_SCH_DEADLINE_US, 5000) - -# include the generic dmic with kwd -ifdef(`NOHOTWORD', -` -define(NO16KDMIC) -define(DMIC_48k_CORE_ID, 1) -ifdef(`DMICPROC',`',`define(`DMICPROC', passthrough)') -include(`platform/intel/intel-generic-dmic.m4')', -`include(`platform/intel/intel-generic-dmic-kwd.m4')') - -ifdef(`BT_OFFLOAD', ` -# BT offload support -define(`BT_PIPELINE_PB_ID', `13') -define(`BT_PIPELINE_CP_ID', `14') -define(`BT_DAI_LINK_ID', BOARD_BT_BE_ID) -define(`BT_PCM_ID', `7') -define(`HW_CONFIG_ID', BOARD_BT_BE_ID) -include(`platform/intel/intel-generic-bt.m4')') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl frames, deadline, priority, core) - -ifdef(`NO_AMP',`',` -`# Low Latency playback pipeline 1 on PCM 0 using max 'ifdef(`4CH_PASSTHROUGH', `4', `2')` channels of s24le.' -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -define(`ENDPOINT_NAME', `Speakers') -PIPELINE_PCM_ADD( - ifdef(`2CH_2WAY', - ifdef(`WAVES', sof/pipe-waves-demux-eq-iir-playback.m4, - sof/pipe-demux-eq-iir-playback.m4), - ifdef(`WAVES', sof/pipe-waves-codec-demux-playback.m4, - ifdef(`DRC_EQ', sof/pipe-drc-eq-volume-demux-playback.m4, - sof/pipe-volume-demux-playback.m4))), - 1, 0, ifdef(`4CH_PASSTHROUGH', `4', `2'), s32le, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, - 48000, 48000, 48000) -undefine(`ENDPOINT_NAME')') - -ifdef(`NO_HEADPHONE',`',` -# define Waves integration on Headphones = WAVES && !WAVES_SPK_ONLY -ifdef(`WAVES', `ifdef(`WAVES_SPK_ONLY', `', `define(`WAVES_HEADPHONE')')', `') - -# Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -define(`ENDPOINT_NAME', `Headphones') -PIPELINE_PCM_ADD( - ifdef(`WAVES_HEADPHONE', sof/pipe-waves-codec-playback.m4, sof/pipe-volume-playback.m4), - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -undefine(`ENDPOINT_NAME') - -# Low Latency capture pipeline 3 on PCM 1 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 3, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000)') - -# Low Latency playback pipeline 2 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 3 on PCM 3 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 4 on PCM 4 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl frames, deadline, priority, core) - -ifdef(`NO_AMP',`',` -# playback DAI is SSP1 using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SOURCE_1, 2, FMT, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, SCHEDULE_TIME_DOMAIN_TIMER) - -ifelse(CODEC, `MAX98390', ` -# Low Latency capture pipeline 9 on PCM 6 using max 4 channels of s32le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 9, 6, 4, s32le, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, - 48000, 48000, 48000) - -# capture DAI is SSP1 using 2 periods -# Buffers use FMT format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 9, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SINK_9, 2, FMT, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, SCHEDULE_TIME_DOMAIN_TIMER) -', CODEC, `CS35L41', ` -# Low Latency capture pipeline 9 on PCM 6 using max 4 channels of s32le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 9, 6, 4, s32le, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, - 48000, 48000, 48000) - -# capture DAI is SSP1 using 2 periods -# Buffers use FMT format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 9, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SINK_9, 2, FMT, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, SCHEDULE_TIME_DOMAIN_TIMER)', -` -ifdef(`2CH_2WAY',`# No echo reference for 2-way speakers', -` -# The echo refenrence pipeline has no connections in it, -# it is used for the capture DAI widget to dock. -DAI_ADD(sof/pipe-echo-ref-dai-capture.m4, - 29, SSP, SPK_SSP_INDEX, SPK_SSP_NAME, - PIPELINE_SINK_29, 3, FMT, - SPK_MIC_PERIOD_US, 0, SPK_PLAYBACK_CORE, SCHEDULE_TIME_DOMAIN_TIMER) - -`# Capture pipeline 9 from demux on PCM 6 using max 'ifdef(`4CH_PASSTHROUGH', `4', `2')` channels of s32le.' -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture-sched.m4, - 9, 6, ifdef(`4CH_PASSTHROUGH', `4', `2'), s32le, - SPK_MIC_PERIOD_US, 1, SPK_PLAYBACK_CORE, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Connect demux to capture -SectionGraph."PIPE_CAP" { - index "0" - - lines [ - # mux to capture - dapm(PIPELINE_SINK_9, PIPELINE_DEMUX_1) - ] -} - -# Connect virtual capture to dai -SectionGraph."PIPE_CAP_VIRT" { - index "9" - - lines [ - # mux to capture - dapm(ECHO REF 9, SPK_REF_DAI_NAME) - ] -} -')')') - -dnl if using Google AEC -ifdef(`GOOGLE_RTC_AUDIO_PROCESSING', -`# Connect demux to capture' -`SectionGraph."PIPE_GOOGLE_RTC_AUDIO_PROCESSING_REF_AEC" {' -` index "0"' -` lines [' -` # mux to capture' -` dapm(N_AEC_REF_BUF, PIPELINE_DEMUX_1)' -` ]' -`}' -dnl else -, `') - -ifdef(`NO_HEADPHONE',`',` -# playback DAI is SSP0 using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 2, SSP, 0, SSP0-Codec, - PIPELINE_SOURCE_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP0 using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, SSP, 0, SSP0-Codec, - PIPELINE_SINK_3, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)') - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 0, iDisp1, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 1, iDisp2, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 2, iDisp3, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp4 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 3, iDisp4, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -ifdef(`NO_AMP',`',` -PCM_PLAYBACK_ADD(Speakers, 0, PIPELINE_PCM_1)') -ifdef(`NO_HEADPHONE',`',` -PCM_DUPLEX_ADD(Headset, 1, PIPELINE_PCM_2, PIPELINE_PCM_3)') -PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI4, 5, PIPELINE_PCM_8) -ifdef(`NO_AMP',`',` -ifdef(`2CH_2WAY',`# No echo reference for 2-way speakers', -`PCM_CAPTURE_ADD(EchoRef, 6, PIPELINE_PCM_9)')') - -# -# BE conf2igurations - overrides config in ACPI if present -# -dnl DAI_CONFIG(type, dai_index, link_id, name, ssp_config/dmic_config) -dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data) -dnl SSP_CLOCK(clock, freq, codec_master, polarity) -dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id) -dnl mclk_id is optional -dnl ssp1-maxmspk - -ifdef(`NO_AMP',`',` -# SSP SPK_SSP_INDEX (ID: SPK_BE_ID) -DAI_CONFIG(SSP, SPK_SSP_INDEX, SPK_BE_ID, SPK_SSP_NAME, -ifelse( - CODEC, `MAX98357A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 1536000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 16, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 16)))', - CODEC, `MAX98360A', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', - CODEC, `MAX98360A_TDM', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 12288000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(8, 32, 15, 15), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', - CODEC, `RT1011', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 4800000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(4, 25, 3, 15), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', - CODEC, `MAX98390', ` - SSP_CONFIG(DSP_B, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 6144000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(4, 32, 3, 15), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 32)))', - CODEC, `RT1019', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', - CODEC, `CS35L41', ` - SSP_CONFIG(DSP_A, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 6144000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(4, 32, 3, 15), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24)))', - CODEC, `RT5650', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, SPK_SSP_INDEX, 24, 0, 0, 0, SSP_CC_MCLK_AON)))', - )') - -ifdef(`NO_HEADPHONE',`',` -# SSP 0 (ID: BOARD_HP_BE_ID) -DAI_CONFIG(SSP, 0, BOARD_HP_BE_ID, SSP0-Codec, -ifelse( - HEADPHONE, `DA7219', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24)))', - HEADPHONE, `RT5682', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_BCLK_ES)))', - HEADPHONE, `RT5650', ` - SSP_CONFIG(I2S, SSP_CLOCK(mclk, MCLK_RATE, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 24, 0, 0, 0, SSP_CC_MCLK_AON)))', - )') - -# 4 HDMI/DP outputs (ID: 3,4,5,6) -DAI_CONFIG(HDA, 0, BOARD_HDMI_BE_ID_BASE, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, eval(BOARD_HDMI_BE_ID_BASE + 1), iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, eval(BOARD_HDMI_BE_ID_BASE + 2), iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -DAI_CONFIG(HDA, 3, eval(BOARD_HDMI_BE_ID_BASE + 3), iDisp4, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) - -DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 b/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 deleted file mode 100644 index 5d92bb3c7f92..000000000000 --- a/tools/topology/topology1/sof-tgl-max98373-rt5682.m4 +++ /dev/null @@ -1,257 +0,0 @@ -# -# Topology for Tigerlake with Max98373 amp (SSP: $AMP_SSP) + rt5682 codec + DMIC + 4 HDMI -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/tgl.m4') -include(`platform/intel/dmic.m4') - -DEBUG_START - -# -# Define the pipelines -# -# PCM0 ----> smart_amp ----> SSP$AMP_SSP (Speaker -max98373) -# ^ -# | -# | -# PCM0 <---- demux <----- SSP$AMP_SSP (Speaker -max98373) -# PCM1 <---> volume <----> SSP0 (Headset - ALC5682) -# PCM2 ----> volume -----> iDisp1 -# PCM3 ----> volume -----> iDisp2 -# PCM4 ----> volume -----> iDisp3 -# PCM5 ----> volume -----> iDisp4 -# PCM6 ----> passthrough ----> SSP2 (Bluetooth) -# PCM99 <---- volume <---- DMIC01 (dmic 48k capture) -# PCM100 <---- kpb <---- DMIC16K (dmic 16k capture) - -# Run Speakers pipeline on core#1 by default for low power considering -ifdef(`SPK_PLAYBACK_CORE', `', `define(`SPK_PLAYBACK_CORE', `1')') - -ifdef(`AMP_SSP',`',`fatal_error(note: Define AMP_SSP for speaker amp SSP Index)') -# Smart amplifier related -# SSP related -#define smart amplifier SSP index -define(`SMART_SSP_INDEX', AMP_SSP) -#define SSP BE dai_link name -define(`SMART_SSP_NAME', concat(concat(`SSP', AMP_SSP),`-Codec')) -#define BE dai_link ID -define(`SMART_BE_ID', 7) -#define SSP mclk -define(`SSP_MCLK', 24576000) -# Run Smart Amp pipeline on core#1 by default for low power considering -define(`SMART_AMP_CORE', SPK_PLAYBACK_CORE) -# Playback related -define(`SMART_PB_PPL_ID', 1) -define(`SMART_PB_CH_NUM', 2) -define(`SMART_TX_CHANNELS', 4) -define(`SMART_RX_CHANNELS', 4) -define(`SMART_FB_CHANNELS', 4) -# Ref capture related -define(`SMART_REF_PPL_ID', 11) -define(`SMART_REF_CH_NUM', 2) -# PCM related -define(`SMART_PCM_ID', 0) -define(`SMART_PCM_NAME', `smart373-spk') - -# Include Smart Amplifier support -include(`sof-smart-amplifier.m4') - -# Define pipeline id for intel-generic-dmic-kwd.m4 -# to generate dmic setting with kwd when we have dmic -# define channel -define(CHANNELS, `4') -# define kfbm with volume -define(KFBM_TYPE, `vol-kfbm') -# define pcm, pipeline and dai id -define(DMIC_PCM_48k_ID, `99') -define(DMIC_PIPELINE_48k_ID, `4') -define(DMIC_DAI_LINK_48k_ID, `1') -define(DMIC_PCM_16k_ID, `100') -define(DMIC_PIPELINE_16k_ID, `9') -define(DMIC_PIPELINE_KWD_ID, `10') -define(DMIC_DAI_LINK_16k_ID, `2') -# Offload DMIC_PIPELINE_48K to secondary core of TGL. -define(DMIC_PIPELINE_48k_CORE_ID, 1) -# define pcm, pipeline and dai id -define(KWD_PIPE_SCH_DEADLINE_US, 20000) - -ifdef(`IGO', - `define(`DMICPROC', igonr)' - `define(`DMIC_48k_PERIOD_US', 16000)', - `') - -# include the generic dmic with kwd -include(`platform/intel/intel-generic-dmic-kwd.m4') - -# BT offload support -ifdef(`BT_OFFLOAD', ` -define(`BT_PIPELINE_PB_ID', eval(SMART_REF_PPL_ID + 1)) -define(`BT_PIPELINE_CP_ID', eval(SMART_REF_PPL_ID + 2)) -define(`BT_DAI_LINK_ID', eval(SMART_BE_ID + 1)) -define(`BT_PCM_ID', `6') -define(`HW_CONFIG_ID', `8') -include(`platform/intel/intel-generic-bt.m4')') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl frames, deadline, priority, core) - -ifdef(`INCLUDE_IIR_EQ', -` -# Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-eq-iir-volume-playback.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -' -, -` -# Low Latency playback pipeline 2 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -') - - -# Low Latency capture pipeline 3 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 3, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 3 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 3, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 4 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 4, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl frames, deadline, priority, core) - -# playback DAI is SSP0 using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 2, SSP, 0, SSP0-Codec, - PIPELINE_SOURCE_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is SSP0 using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 3, SSP, 0, SSP0-Codec, - PIPELINE_SINK_3, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 0, iDisp1, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 1, iDisp2, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 2, iDisp3, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp4 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 3, iDisp4, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# -# Bind PCM with the pipeline -# -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_DUPLEX_ADD(Headset, 1, PIPELINE_PCM_2, PIPELINE_PCM_3) -PCM_PLAYBACK_ADD(HDMI1, 2, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI2, 3, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI3, 4, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI4, 5, PIPELINE_PCM_8) - -# -# BE configurations - overrides config in ACPI if present -# -dnl DAI_CONFIG(type, dai_index, link_id, name, ssp_config/dmic_config) -dnl SSP_CONFIG(format, mclk, bclk, fsync, tdm, ssp_config_data) -dnl SSP_CLOCK(clock, freq, codec_master, polarity) -dnl SSP_CONFIG_DATA(type, idx, valid bits, mclk_id) -dnl mclk_id is optional -dnl ssp1-maxmspk, ssp0-RTHeadset - -#SSP 0 (ID: 0) -DAI_CONFIG(SSP, 0, 0, SSP0-Codec, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, SSP_MCLK, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, 0, 32))) - -# 4 HDMI/DP outputs (ID: 3,4,5,6) -DAI_CONFIG(HDA, 0, 3, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 4, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 5, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -DAI_CONFIG(HDA, 3, 6, iDisp4, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) - -DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 b/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 deleted file mode 100644 index a10cd51c05f8..000000000000 --- a/tools/topology/topology1/sof-tgl-rt1308-hdmi-ssp.m4 +++ /dev/null @@ -1,219 +0,0 @@ -# -# Topology for Tigerlake with rt1308 codec + DMIC + 3 HDMI out + 2 HDMI-in capture -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`ssp.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/'PLATFORM`.m4') -include(`platform/intel/dmic.m4') - -define(`HDMI1_SSP_NAME', concat(concat(`SSP', HDMI_1_SSP_NUM),`-HDMI')) -define(`HDMI2_SSP_NAME', concat(concat(`SSP', HDMI_2_SSP_NUM),`-HDMI')) -define(`AMP_SSP_NAME', concat(concat(`SSP', AMP_SSP_NUM),`-Codec')) - -ifdef(`NO_AMP',`',` -ifdef(`AMP_SSP_NUM',`',`fatal_error(note: Define AMP_SSP_NUM for speaker amp SSP)')') - -DEBUG_START -# -# Define the pipelines -# -# PCM0 <---- volume <----- HDMI-1 SSP -# PCM1 <---- volume <----- HDMI-2 SSP -# PCM2 ----> volume -----> Codec SSP -# PCM3 <---- volume <----- DMIC01 (dmic0 capture) -# - -# PCM5 ----> volume (pipe 5) -----> iDisp1 (HDMI/DP playback, BE link 5) -# PCM6 ----> Volume (pipe 6) -----> iDisp2 (HDMI/DP playback, BE link 6) -# PCM7 ----> volume (pipe 7) -----> iDisp3 (HDMI/DP playback, BE link 7) - - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl frames, deadline, priority, core) - -# Low Latency capture pipeline 1 on PCM 0 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 1, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - - -# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s16le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -ifdef(`NO_AMP',`',` -# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 2, 2, s24le, - 1000, 0, 0, - 48000, 48000, 48000)') - -# Passthrough capture pipeline 4 on PCM 3 using max 4 channels. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-passthrough-capture.m4, - 4, 3, 4, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 5 on PCM 5 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 5, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 6 on PCM 6 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 6, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 7 using max 2 channels of s24le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 7, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl frames, deadline, priority, core) - -# capture DAI using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 1, SSP, HDMI_1_SSP_NUM, HDMI1_SSP_NAME, - PIPELINE_SINK_1, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI using 2 periods -# Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, SSP, HDMI_2_SSP_NUM, HDMI2_SSP_NAME, - PIPELINE_SINK_2, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -ifdef(`NO_AMP',`',` -# playback DAI using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, SSP, AMP_SSP_NUM, AMP_SSP_NAME, - PIPELINE_SOURCE_3, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)') - -# capture DAI is DMIC01 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 4, DMIC, 0, dmic01, - PIPELINE_SINK_4, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 5, HDA, 5, iDisp1, - PIPELINE_SOURCE_5, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 6, iDisp2, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 7, iDisp3, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# PCM Low Latency, id 0 -dnl PCM_CAPTURE_ADD(name, pcm_id, capture) -PCM_CAPTURE_ADD(HDMI-IN-1, 0, PIPELINE_PCM_1) - -dnl PCM_CAPTURE_ADD(name, pcm_id, capture) -PCM_CAPTURE_ADD(HDMI-IN-2, 1, PIPELINE_PCM_2) - -ifdef(`NO_AMP',`',` -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3)') -PCM_CAPTURE_ADD(DMIC01, 3, PIPELINE_PCM_4) - -PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_5) -PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_7) - -# -# BE configurations - overrides config in ACPI if present -# - -#HDMI-1 SSP (ID: 0) -#MCLK is not required and won't impact for HDMI-in capture use case. -DAI_CONFIG(SSP, HDMI_1_SSP_NUM, 0, HDMI1_SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_master), - SSP_CLOCK(fsync, 48000, codec_master), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, HDMI_1_SSP_NUM, 32, 0))) - -#HDMI-2 SSP (ID: 1) -#MCLK is not required and won't impact for HDMI-in capture use case. -DAI_CONFIG(SSP, HDMI_2_SSP_NUM, 1, HDMI2_SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 3072000, codec_master), - SSP_CLOCK(fsync, 48000, codec_master), - SSP_TDM(2, 32, 3, 3), - SSP_CONFIG_DATA(SSP, HDMI_2_SSP_NUM, 32, 0))) - -ifdef(`NO_AMP',`',` -#Amplifier Codec SSP (ID: 2) -DAI_CONFIG(SSP, AMP_SSP_NUM, 2, AMP_SSP_NAME, - SSP_CONFIG(I2S, SSP_CLOCK(mclk, 38400000, codec_mclk_in), - SSP_CLOCK(bclk, 2400000, codec_slave), - SSP_CLOCK(fsync, 48000, codec_slave), - SSP_TDM(2, 25, 3, 3), - SSP_CONFIG_DATA(SSP, AMP_SSP_NUM, 24)))') - -# dmic01 (ID: 3) -DAI_CONFIG(DMIC, 0, 3, dmic01, - DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000, - DMIC_WORD_LENGTH(s32le), 400, DMIC, 0, - PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1))) - - -# 3 HDMI/DP outputs (ID: 5,6,7) -DAI_CONFIG(HDA, 5, 5, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2))) -DAI_CONFIG(HDA, 6, 6, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2))) -DAI_CONFIG(HDA, 7, 7, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 7, 48000, 2))) -DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 b/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 deleted file mode 100644 index 73f3bc7b67ae..000000000000 --- a/tools/topology/topology1/sof-tgl-rt711-rt1308.m4 +++ /dev/null @@ -1,303 +0,0 @@ -# -# Topology for Tigerlake with rt711 + rt1308 (x2). -# - -# if XPROC is not defined, define with default pipe -ifdef(`DMICPROC', , `define(DMICPROC, eq-iir-volume)') -ifdef(`DMIC16KPROC', , `define(DMIC16KPROC, eq-iir-volume)') - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`alh.m4') -include(`hda.m4') -include(`platform/intel/dmic.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -include(`platform/intel/'PLATFORM`.m4') - -ifdef(`NO_JACK', -` -define(JACK_OFFSET, `0') -', -` -define(JACK_OFFSET, `2') -') - -ifdef(`AMP_1_LINK',`', -`define(AMP_1_LINK, `1')') - -# if there is an external RT1308 amplifier connected over SoundWire, -# enable "EXT_AMP" option in the CMakefile. -ifdef(`EXT_AMP', -` -define(AMP_OFFSET, `1') -', -` -define(AMP_OFFSET, `0') -' -) - -ifdef(`EXT_AMP_REF', -` -define(AMP_REF_OFFSET, `1') -', -` -define(AMP_REF_OFFSET, `0') -' -) - -# Define pipeline id for intel-generic-dmic.m4 -# to generate dmic setting -ifelse(CHANNELS, `0', -` -define(DMIC_OFFSET, `0') -' -, -` -define(DMIC_PCM_48k_ID, `10') -define(DMIC_PCM_16k_ID, `11') -define(DMIC_PIPELINE_48k_ID, `4') -define(DMIC_PIPELINE_16k_ID, `5') - -define(DMIC_DAI_LINK_48k_ID, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET)) -define(DMIC_DAI_LINK_16k_ID, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+1)) -include(`platform/intel/intel-generic-dmic.m4') - -define(DMIC_OFFSET, `2') -' -) - -define(HDMI_BE_ID_BASE, eval(JACK_OFFSET+AMP_OFFSET+AMP_REF_OFFSET+DMIC_OFFSET)) - -# Add Bluetooth Audio Offload pass-through - -ifdef(`BT_OFFLOAD', -` define(`BT_PIPELINE_PB_ID', `13') - define(`BT_PIPELINE_CP_ID', `14') - define(`BT_DAI_LINK_ID', eval(HDMI_BE_ID_BASE + 4)) - define(`BT_PCM_ID', `14') dnl use fixed PCM_ID - define(HW_CONFIG_ID, eval(6 + DMIC_OFFSET)) - include(`platform/intel/intel-generic-bt.m4') -' -) - -DEBUG_START - -# -# Define the pipelines -# -# PCM0 ---> volume ----> mixer --->ALH 2 BE dailink 0 -# PCM31 ---> volume ------^ -# PCM1 <--- volume <---- ALH 3 BE dailink 1 -ifdef(`EXT_AMP', ` -# PCM2 ---> volume ----> ALH 2 BE dailink AMP_1_LINK -') -# PCM5 ---> volume <---- iDisp1 -# PCM6 ---> volume <---- iDisp2 -# PCM7 ---> volume <---- iDisp3 -# PCM8 ---> volume <---- iDisp4 -# PCM10 <----volume <---- DMIC01 -# PCM11 <----volume <---- DMIC16k -ifdef(`BT_OFFLOAD', -` -# PCM14 <---> passthrough <---> SSP2 BT playback/capture -') - -# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-switch-capture.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -ifdef(`EXT_AMP', -` -# Low Latency playback pipeline 3 on PCM 2 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 3, 2, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) -') -# Low Latency playback pipeline 6 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 6 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 6, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 7 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 7, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 9 on PCM 8 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 9, 8, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is ALH(SDW0 PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-mixer-volume-dai-playback.m4, - 1, ALH, 2, SDW0-Playback, - NOT_USED_IGNORED, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER, 2, 48000) - -# capture DAI is ALH(SDW0 PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, ALH, 3, SDW0-Capture, - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# Low Latency playback pipeline 30 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline on core 0 with priority 0 -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, - 30, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) - -# Deep buffer playback pipeline 31 on PCM 31 using max 2 channels of s32le -# Set 1000us deadline on core 0 with priority 0. -# TODO: Modify pipeline deadline to account for deep buffering -ifdef(`HEADSET_DEEP_BUFFER', -` -PIPELINE_PCM_ADD(sof/pipe-host-volume-playback.m4, - 31, 31, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000, - SCHEDULE_TIME_DOMAIN_TIMER, - PIPELINE_PLAYBACK_SCHED_COMP_1) -' -) - -SectionGraph."mixer-host" { - index "0" - - lines [ - # connect mixer dai pipelines to PCM pipelines - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_30) -ifdef(`HEADSET_DEEP_BUFFER', -` - - dapm(PIPELINE_MIXER_1, PIPELINE_SOURCE_31) -' -) - ] -} - -ifdef(`EXT_AMP', -` -# playback DAI is ALH(AMP_1_LINK PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 3, ALH, eval(AMP_1_LINK * 256 + 2), `SDW'eval(AMP_1_LINK)`-Playback', - PIPELINE_SOURCE_3, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) -') - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 0, iDisp1, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 1, iDisp2, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, 1000us deadline with priority 0 on core 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 2, iDisp3, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp4 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 9, HDA, 3, iDisp4, - PIPELINE_SOURCE_9, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# PCM Low Latency, id 0 -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_PLAYBACK_ADD(Jack Out, 0, PIPELINE_PCM_30) -ifdef(`HEADSET_DEEP_BUFFER', -` -PCM_PLAYBACK_ADD(Jack Out DeepBuffer, 31, PIPELINE_PCM_31) -' -) -PCM_CAPTURE_ADD(Jack In, 1, PIPELINE_PCM_2) -ifdef(`EXT_AMP', -` -PCM_PLAYBACK_ADD(Speaker, 2, PIPELINE_PCM_3) -') -PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_8) -PCM_PLAYBACK_ADD(HDMI 4, 8, PIPELINE_PCM_9) -# -# BE configurations - overrides config in ACPI if present -# - -#ALH dai index = ((link_id << 8) | PDI id) -#ALH SDW0 Pin2 (ID: 0) -DAI_CONFIG(ALH, 2, 0, SDW0-Playback, - ALH_CONFIG(ALH_CONFIG_DATA(ALH, 2, 48000, 2))) - -#ALH SDW0 Pin3 (ID: 1) -DAI_CONFIG(ALH, 3, 1, SDW0-Capture, - ALH_CONFIG(ALH_CONFIG_DATA(ALH, 3, 48000, 2))) - -ifdef(`EXT_AMP', -` -#ALH SDW AMP_1_LINK Pin2 (ID: 2) -DAI_CONFIG(ALH, eval(AMP_1_LINK * 256 + 2), 2, `SDW'eval(AMP_1_LINK)`-Playback', - ALH_CONFIG(ALH_CONFIG_DATA(ALH, eval(AMP_1_LINK * 256 + 2), 48000, 2))) -') - -# 3 HDMI/DP outputs -DAI_CONFIG(HDA, 0, HDMI_BE_ID_BASE, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, eval(HDMI_BE_ID_BASE + 1), iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, eval(HDMI_BE_ID_BASE + 2), iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -DAI_CONFIG(HDA, 3, eval(HDMI_BE_ID_BASE + 3), iDisp4, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) - -DEBUG_END diff --git a/tools/topology/topology1/sof-tgl-sdw-max98373-rt5682.m4 b/tools/topology/topology1/sof-tgl-sdw-max98373-rt5682.m4 deleted file mode 100644 index 0dc461d934c9..000000000000 --- a/tools/topology/topology1/sof-tgl-sdw-max98373-rt5682.m4 +++ /dev/null @@ -1,246 +0,0 @@ -# -# Topology for Tigerlake with sdw rt5682 + Max98373 amp + DMIC + 4 HDMI -# - -# Include topology builder -include(`utils.m4') -include(`dai.m4') -include(`pipeline.m4') -include(`alh.m4') -include(`hda.m4') - -# Include TLV library -include(`common/tlv.m4') - -# Include Token library -include(`sof/tokens.m4') - -# Include Tigerlake DSP configuration -include(`platform/intel/'PLATFORM`.m4') -include(`platform/intel/dmic.m4') - -define(DMIC_PDM_CONFIG, ifelse(CHANNELS, `4', ``FOUR_CH_PDM0_PDM1'', - `ifelse(CHANNELS, `2', ``STEREO_PDM0'', `')')) - -DEBUG_START - -# -# Define the pipelines -# -# PCM0 <---> volume <----> playback (Headset - ALC5682) -# PCM1 <---> volume <----> capture (Headset - ALC5682) -# PCM2 ----> smart_amp ----> ALH0xy02 (Speaker -max98373) -# ^ -# | -# | -# PCM3 <---- demux <----- ALH0xy03 (Speaker -max98373) -# PCM5 ----> volume -----> iDisp1 -# PCM6 ----> volume -----> iDisp2 -# PCM7 ----> volume -----> iDisp3 -# PCM8 ----> volume -----> iDisp4 -# PCM10 <---- volume <---- DMIC01 (dmic 48k capture) -# PCM12 <---- kpb <---- DMIC16k (dmic 16k capture) -# PCM14 <---> passthrough <---> SSP2 (Bluetooth playback/capture) - - -define(`SDW', 1) - -# Smart amplifier related -# ALH related -ifelse(PLATFORM, `tgl', -` #define smart amplifier ALH index - define(`SMART_ALH_INDEX', 0x102) - #define ALH BE dai_link name - define(`SMART_ALH_PLAYBACK_NAME', `SDW1-Playback') - define(`SMART_ALH_CAPTURE_NAME', `SDW1-Capture') -', `') -ifelse(PLATFORM, `adl', -` define(`SMART_ALH_INDEX', 0x202) - define(`SMART_ALH_PLAYBACK_NAME', `SDW2-Playback') - define(`SMART_ALH_CAPTURE_NAME', `SDW2-Capture') - # Add BT audio offload support - define(`BT_PIPELINE_PB_ID', `14') dnl DMIC_PIPELINE_KWD_ID + 1 - define(`BT_PIPELINE_CP_ID', `15') dnl DMIC_PIPELINE_KWD_ID + 2 - define(`BT_DAI_LINK_ID', `10') - define(`BT_PCM_ID', `14') - define(`HW_CONFIG_ID', `10') - include(`platform/intel/intel-generic-bt.m4') -', `') -#define BE dai_link ID -define(`SMART_BE_ID', 2) - -# Playback related -define(`SMART_PB_PPL_ID', 3) -define(`SMART_PB_CH_NUM', 2) -# channel number for playback on sdw link -define(`SMART_TX_CHANNELS', 2) -# channel number for I/V feedback on sdw link -define(`SMART_RX_CHANNELS', 4) -# Smart_amp algorithm specific. channel number -# for feedback provided to smart_amp algorithm -define(`SMART_FB_CHANNELS', 4) -# Ref capture related -define(`SMART_REF_PPL_ID', 4) -define(`SMART_REF_CH_NUM', 2) -# PCM related -define(`SMART_PCM_ID', 2) -define(`SMART_PCM_NAME', `Speaker') - -# Include Smart Amplifier support -include(`sof-smart-amplifier.m4') - -dnl PIPELINE_PCM_ADD(pipeline, -dnl pipe id, pcm, max channels, format, -dnl period, priority, core, -dnl pcm_min_rate, pcm_max_rate, pipeline_rate, -dnl time_domain, sched_comp) - -# Low Latency playback pipeline 1 on PCM 0 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 1, 0, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency capture pipeline 2 on PCM 1 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4, - 2, 1, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Define pipeline id for intel-generic-dmic-kwd.m4 -# to generate dmic setting with kwd when we have dmic -# define channel -define(CHANNELS, `4') -# define kfbm with volume -define(KFBM_TYPE, `vol-kfbm') -# define pcm, pipeline and dai id -define(DMIC_PCM_48k_ID, `10') -define(DMIC_PIPELINE_48k_ID, `11') -define(DMIC_DAI_LINK_48k_ID, `4') -define(DMIC_PCM_16k_ID, `12') -define(DMIC_PIPELINE_16k_ID, `12') -define(DMIC_PIPELINE_KWD_ID, `13') -define(DMIC_DAI_LINK_16k_ID, `5') -define(DMIC_16k_PCM_NAME, `BufferedMic') -# define pcm, pipeline and dai id -define(KWD_PIPE_SCH_DEADLINE_US, 5000) -# include the generic dmic with kwd -include(`platform/intel/intel-generic-dmic-kwd.m4') - - -# Low Latency playback pipeline 6 on PCM 5 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 6, 5, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 7 on PCM 6 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 7, 6, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 8 on PCM 7 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 8, 7, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# Low Latency playback pipeline 9 on PCM 8 using max 2 channels of s32le. -# Schedule 48 frames per 1000us deadline with priority 0 on core 0 -PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4, - 9, 8, 2, s32le, - 1000, 0, 0, - 48000, 48000, 48000) - -# -# DAIs configuration -# - -dnl DAI_ADD(pipeline, -dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl deadline, priority, core, time_domain) - -# playback DAI is ALH(ALH0 PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 1, ALH, 2, SDW0-Playback, - PIPELINE_SOURCE_1, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# capture DAI is ALH(ALH0 PIN2) using 2 periods -# Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-capture.m4, - 2, ALH, 3, SDW0-Capture, - PIPELINE_SINK_2, 2, s24le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp1 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 6, HDA, 0, iDisp1, - PIPELINE_SOURCE_6, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp2 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 7, HDA, 1, iDisp2, - PIPELINE_SOURCE_7, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp3 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 8, HDA, 2, iDisp3, - PIPELINE_SOURCE_8, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# playback DAI is iDisp4 using 2 periods -# Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 -DAI_ADD(sof/pipe-dai-playback.m4, - 9, HDA, 3, iDisp4, - PIPELINE_SOURCE_9, 2, s32le, - 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER) - -# -# Bind PCM with the pipeline -# -dnl PCM_PLAYBACK_ADD(name, pcm_id, playback) -PCM_PLAYBACK_ADD(Jack Out, 0, PIPELINE_PCM_1) -PCM_CAPTURE_ADD(Jack In, 1, PIPELINE_PCM_2) -PCM_PLAYBACK_ADD(HDMI 1, 5, PIPELINE_PCM_6) -PCM_PLAYBACK_ADD(HDMI 2, 6, PIPELINE_PCM_7) -PCM_PLAYBACK_ADD(HDMI 3, 7, PIPELINE_PCM_8) -PCM_PLAYBACK_ADD(HDMI 4, 8, PIPELINE_PCM_9) - -# -# BE configurations - overrides config in ACPI if present -# -dnl DAI_CONFIG(type, dai_index, link_id, name, ssp_config/dmic_config) - -#ALH SDW0 Pin2 (ID: 0) -DAI_CONFIG(ALH, 2, 0, SDW0-Playback, - ALH_CONFIG(ALH_CONFIG_DATA(ALH, 2, 48000, 2))) - -#ALH SDW0 Pin3 (ID: 1) -DAI_CONFIG(ALH, 3, 1, SDW0-Capture, - ALH_CONFIG(ALH_CONFIG_DATA(ALH, 3, 48000, 2))) - -# 4 HDMI/DP outputs (ID: 6,7,8,9) -DAI_CONFIG(HDA, 0, 6, iDisp1, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2))) -DAI_CONFIG(HDA, 1, 7, iDisp2, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2))) -DAI_CONFIG(HDA, 2, 8, iDisp3, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2))) -DAI_CONFIG(HDA, 3, 9, iDisp4, - HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2))) - -DEBUG_END From 4624b3d7bd35c1cfd9dab03298d2d45947c96d0f Mon Sep 17 00:00:00 2001 From: Trevor Wu <trevor.wu@mediatek.com> Date: Wed, 25 Oct 2023 16:24:13 +0800 Subject: [PATCH 623/639] audio: module adapter: fix redefinition problem When I was using xtensa to build mt8188 platform, I encountered an error: 'redefinition of i'. To fix the problem, I removed the declaration in the for loop. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> --- src/audio/module_adapter/module_adapter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/audio/module_adapter/module_adapter.c b/src/audio/module_adapter/module_adapter.c index e7e4619ad840..a1f18cd034b4 100644 --- a/src/audio/module_adapter/module_adapter.c +++ b/src/audio/module_adapter/module_adapter.c @@ -1450,9 +1450,9 @@ int module_adapter_reset(struct comp_dev *dev) #endif /* CONFIG_ZEPHYR_DP_SCHEDULER */ if (IS_PROCESSING_MODE_SINK_SOURCE(mod)) { /* for both LL and DP processing */ - for (int i = 0; i < mod->num_of_sources; i++) + for (i = 0; i < mod->num_of_sources; i++) mod->sources[i] = NULL; - for (int i = 0; i < mod->num_of_sinks; i++) + for (i = 0; i < mod->num_of_sinks; i++) mod->sinks[i] = NULL; mod->num_of_sinks = 0; mod->num_of_sources = 0; From 4b0cb077f73dd4a48afbbd37824080bae050fb83 Mon Sep 17 00:00:00 2001 From: Trevor Wu <trevor.wu@mediatek.com> Date: Wed, 25 Oct 2023 16:57:06 +0800 Subject: [PATCH 624/639] platform: mtk: fix memory allocation problem Because the size of struct comp_buffer has increased, the current heap layout for the basic use case is not enough. Some use cases are experiencing out of memory issues, c0 memory src/lib/alloc.c:765 ERROR failed to alloc 0x180 bytes zone 0x4 caps 0x1 flags 0x0 To fix this issue, we increase the number of 512-byte heap blocks to 32. Signed-off-by: Trevor Wu <trevor.wu@mediatek.com> --- src/platform/mt8186/include/platform/lib/memory.h | 2 +- src/platform/mt8188/include/platform/lib/memory.h | 2 +- src/platform/mt8195/include/platform/lib/memory.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/mt8186/include/platform/lib/memory.h b/src/platform/mt8186/include/platform/lib/memory.h index c3532b103cda..65148c9c348d 100644 --- a/src/platform/mt8186/include/platform/lib/memory.h +++ b/src/platform/mt8186/include/platform/lib/memory.h @@ -115,7 +115,7 @@ #define HEAP_RT_COUNT64 32 #define HEAP_RT_COUNT128 32 #define HEAP_RT_COUNT256 32 -#define HEAP_RT_COUNT512 4 +#define HEAP_RT_COUNT512 32 #define HEAP_RT_COUNT1024 4 #define HEAP_RT_COUNT2048 2 #define HEAP_RT_COUNT4096 2 diff --git a/src/platform/mt8188/include/platform/lib/memory.h b/src/platform/mt8188/include/platform/lib/memory.h index c3532b103cda..65148c9c348d 100644 --- a/src/platform/mt8188/include/platform/lib/memory.h +++ b/src/platform/mt8188/include/platform/lib/memory.h @@ -115,7 +115,7 @@ #define HEAP_RT_COUNT64 32 #define HEAP_RT_COUNT128 32 #define HEAP_RT_COUNT256 32 -#define HEAP_RT_COUNT512 4 +#define HEAP_RT_COUNT512 32 #define HEAP_RT_COUNT1024 4 #define HEAP_RT_COUNT2048 2 #define HEAP_RT_COUNT4096 2 diff --git a/src/platform/mt8195/include/platform/lib/memory.h b/src/platform/mt8195/include/platform/lib/memory.h index 33e0e1e74f1a..47bb91202bfb 100644 --- a/src/platform/mt8195/include/platform/lib/memory.h +++ b/src/platform/mt8195/include/platform/lib/memory.h @@ -103,7 +103,7 @@ #define HEAP_RT_COUNT64 32 #define HEAP_RT_COUNT128 32 #define HEAP_RT_COUNT256 32 -#define HEAP_RT_COUNT512 4 +#define HEAP_RT_COUNT512 32 #define HEAP_RT_COUNT1024 4 #define HEAP_RT_COUNT2048 2 #define HEAP_RT_COUNT4096 2 From b8c52ecaf7f58956d7c3f0727e072401d05ef2c5 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 16:30:13 +0800 Subject: [PATCH 625/639] Topology2: condense output format in tplg file Condense src 48k to other audio format with combined array format. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- .../src_format_s32_convert_from_48k.conf | 113 ++++-------------- 1 file changed, 26 insertions(+), 87 deletions(-) diff --git a/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf b/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf index 2185581258dc..c1e450c776d1 100644 --- a/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf +++ b/tools/topology/topology2/include/components/src_format_s32_convert_from_48k.conf @@ -1,95 +1,34 @@ #src format array num_output_audio_formats 14 - Object.Base.output_audio_format [ - # 8khz output - { - out_rate 8000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 11.025 khz output - { - out_rate 11025 - out_bit_depth 32 - out_valid_bit_depth 32 - obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" - } - # 12khz output - { - out_rate 12000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 16khz output - { - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 22.05khz output - { - out_rate 22050 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24khz output - { - out_rate 24000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32khz output - { - out_rate 32000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 44.1khz output - { - out_rate 44100 - out_bit_depth 32 - out_valid_bit_depth 32 - obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" - } - # 48khz output - { - out_rate 48000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 64khz output - { - out_rate 64000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 88.2khz output - { - out_rate 88200 - out_bit_depth 32 - out_valid_bit_depth 32 + CombineArrays.Object.Base.output_audio_format [ + { + out_rate [ + 8000 + 12000 + 16000 + 22050 + 24000 + 32000 + 48000 + 64000 + 96000 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 32 ] + } + { + out_rate [ + 11025 + 44100 + 88200 + 176400 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 32 ] obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" } - # 96khz output - { - out_rate 96000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 176.4khz output - { - out_rate 176400 - out_bit_depth 32 - out_valid_bit_depth 32 - obs "$[($out_channels * (($[($out_rate + 999)] / 1000) + 4)) * ($out_bit_depth / 8)]" - } - # 192khz output - { - out_rate 192000 - out_bit_depth 32 - out_valid_bit_depth 32 - } ] num_input_audio_formats 1 From b814f307fbcd21e9cc8af3a4e904ab1e686e3292 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 16:34:55 +0800 Subject: [PATCH 626/639] Topology2: condense src input format in tplg file Condense src input audio format convert to 48k in tplg file. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- .../src_format_s32_convert_to_48k.conf | 104 ++++-------------- 1 file changed, 20 insertions(+), 84 deletions(-) diff --git a/tools/topology/topology2/include/components/src_format_s32_convert_to_48k.conf b/tools/topology/topology2/include/components/src_format_s32_convert_to_48k.conf index f20af68b3c3a..9b47223ec555 100644 --- a/tools/topology/topology2/include/components/src_format_s32_convert_to_48k.conf +++ b/tools/topology/topology2/include/components/src_format_s32_convert_to_48k.conf @@ -1,90 +1,26 @@ #src format array num_input_audio_formats 14 - Object.Base.input_audio_format [ - # 8khz input - { - in_rate 8000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 11.025 khz input - { - in_rate 11025 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 12khz input - { - in_rate 12000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 16khz input - { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 22.05khz input - { - in_rate 22050 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24khz input - { - in_rate 24000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 32khz input - { - in_rate 32000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 44.1khz input - { - in_rate 44100 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 48khz input - { - in_rate 48000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 64khz input - { - in_rate 64000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 88.2khz input - { - in_rate 88200 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 96khz input - { - in_rate 96000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 176.4khz input - { - in_rate 176400 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 192khz input - { - in_rate 192000 - in_bit_depth 32 - in_valid_bit_depth 32 + CombineArrays.Object.Base.input_audio_format [ + { + in_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 32 ] } ] From b0abfe5e2078f6e8d8fc347452bc15b3c56dc256 Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 16:49:14 +0800 Subject: [PATCH 627/639] Topology2: condense tplg audio format for s32 format Condense src format from s32 to multiple audio format. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- .../src_format_s32_to_sxx_convert.conf | 399 +++--------------- 1 file changed, 63 insertions(+), 336 deletions(-) diff --git a/tools/topology/topology2/include/components/src_format_s32_to_sxx_convert.conf b/tools/topology/topology2/include/components/src_format_s32_to_sxx_convert.conf index a76ba74ab2de..3f57456d836f 100644 --- a/tools/topology/topology2/include/components/src_format_s32_to_sxx_convert.conf +++ b/tools/topology/topology2/include/components/src_format_s32_to_sxx_convert.conf @@ -1,346 +1,73 @@ #src format array num_input_audio_formats 14 - Object.Base.input_audio_format [ - # 8khz input - { - in_rate 8000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 11.025 khz input - { - in_rate 11025 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 12khz input - { - in_rate 12000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 16khz input - { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 22.05khz input - { - in_rate 22050 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24khz input - { - in_rate 24000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 32khz input - { - in_rate 32000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 44.1khz input - { - in_rate 44100 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 48khz input - { - in_rate 48000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 64khz input - { - in_rate 64000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 88.2khz input - { - in_rate 88200 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 96khz input - { - in_rate 96000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 176.4khz input - { - in_rate 176400 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 192khz input - { - in_rate 192000 - in_bit_depth 32 - in_valid_bit_depth 32 + CombineArrays.Object.Base.input_audio_format [ + { + in_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 32 ] } ] num_output_audio_formats 42 - Object.Base.output_audio_format [ - # 8khz output - { - out_rate 8000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 11.025 khz output - { - out_rate 11025 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 12khz output - { - out_rate 12000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 16khz output - { - out_rate 16000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 22.05khz output - { - out_rate 22050 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 24khz output - { - out_rate 24000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 32khz output - { - out_rate 32000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 44.1khz output - { - out_rate 44100 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 48khz output - { - out_rate 48000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 64khz output - { - out_rate 64000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 88.2khz output - { - out_rate 88200 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 96khz output - { - out_rate 96000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 176.4khz output - { - out_rate 176400 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 192khz output - { - out_rate 192000 - out_bit_depth 16 - out_valid_bit_depth 16 - } - # 8khz output - { - out_rate 8000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 11.025 khz output - { - out_rate 11025 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 12khz output - { - out_rate 12000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 16khz output - { - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 22.05khz output - { - out_rate 22050 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 24khz output - { - out_rate 24000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 32khz output - { - out_rate 32000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 44.1khz output - { - out_rate 44100 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 48khz output - { - out_rate 48000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 64khz output - { - out_rate 64000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 88.2khz output - { - out_rate 88200 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 96khz output - { - out_rate 96000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 176.4khz output - { - out_rate 176400 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 192khz output - { - out_rate 192000 - out_bit_depth 32 - out_valid_bit_depth 24 - } - # 8khz output - { - out_rate 8000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 11.025 khz output - { - out_rate 11025 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 12khz output - { - out_rate 12000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 16khz output - { - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 22.05khz output - { - out_rate 22050 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24khz output - { - out_rate 24000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32khz output - { - out_rate 32000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 44.1khz output - { - out_rate 44100 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 48khz output - { - out_rate 48000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 64khz output - { - out_rate 64000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 88.2khz output - { - out_rate 88200 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 96khz output - { - out_rate 96000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 176.4khz output - { - out_rate 176400 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 192khz output - { - out_rate 192000 - out_bit_depth 32 - out_valid_bit_depth 32 + CombineArrays.Object.Base.output_audio_format [ + { + out_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + out_bit_depth [ 16 ] + out_valid_bit_depth [ 16 ] + } + { + out_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ + 24 + 32 + ] } ] From ae653d06a473c20e978416c14b6dcc56195ab5da Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Thu, 19 Oct 2023 16:59:55 +0800 Subject: [PATCH 628/639] Topology2: condense src input format with combined array Condense input format to combined array for src. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- .../src_format_sxx_to_s32_convert.conf | 399 +++--------------- 1 file changed, 63 insertions(+), 336 deletions(-) diff --git a/tools/topology/topology2/include/components/src_format_sxx_to_s32_convert.conf b/tools/topology/topology2/include/components/src_format_sxx_to_s32_convert.conf index 0518fb2d2a6f..941bf69f30bf 100644 --- a/tools/topology/topology2/include/components/src_format_sxx_to_s32_convert.conf +++ b/tools/topology/topology2/include/components/src_format_sxx_to_s32_convert.conf @@ -1,346 +1,73 @@ #src format array num_input_audio_formats 42 - Object.Base.input_audio_format [ - # 8khz input - { - in_rate 8000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 11.025 khz input - { - in_rate 11025 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 12khz input - { - in_rate 12000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 16khz input - { - in_rate 16000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 22.05khz input - { - in_rate 22050 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 24khz input - { - in_rate 24000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 32khz input - { - in_rate 32000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 44.1khz input - { - in_rate 44100 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 48khz input - { - in_rate 48000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 64khz input - { - in_rate 64000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 88.2khz input - { - in_rate 88200 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 96khz input - { - in_rate 96000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 176.4khz input - { - in_rate 176400 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 192khz input - { - in_rate 192000 - in_bit_depth 16 - in_valid_bit_depth 16 - } - # 8khz input - { - in_rate 8000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 11.025 khz input - { - in_rate 11025 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 12khz input - { - in_rate 12000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 16khz input - { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 22.05khz input - { - in_rate 22050 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 24khz input - { - in_rate 24000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 32khz input - { - in_rate 32000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 44.1khz input - { - in_rate 44100 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 48khz input - { - in_rate 48000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 64khz input - { - in_rate 64000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 88.2khz input - { - in_rate 88200 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 96khz input - { - in_rate 96000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 176.4khz input - { - in_rate 176400 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 192khz input - { - in_rate 192000 - in_bit_depth 32 - in_valid_bit_depth 24 - } - # 8khz input - { - in_rate 8000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 11.025 khz input - { - in_rate 11025 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 12khz input - { - in_rate 12000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 16khz input - { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 22.05khz input - { - in_rate 22050 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24khz input - { - in_rate 24000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 32khz input - { - in_rate 32000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 44.1khz input - { - in_rate 44100 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 48khz input - { - in_rate 48000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 64khz input - { - in_rate 64000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 88.2khz input - { - in_rate 88200 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 96khz input - { - in_rate 96000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 176.4khz input - { - in_rate 176400 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 192khz input - { - in_rate 192000 - in_bit_depth 32 - in_valid_bit_depth 32 + CombineArrays.Object.Base.input_audio_format [ + { + in_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + in_bit_depth [ 16 ] + in_valid_bit_depth [ 16 ] + } + { + in_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ + 24 + 32 + ] } ] num_output_audio_formats 14 - Object.Base.output_audio_format [ - # 8khz output - { - out_rate 8000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 11.025 khz output - { - out_rate 11025 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 12khz output - { - out_rate 12000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 16khz output - { - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 22.05khz output - { - out_rate 22050 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24khz output - { - out_rate 24000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32khz output - { - out_rate 32000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 44.1khz output - { - out_rate 44100 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 48khz output - { - out_rate 48000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 64khz output - { - out_rate 64000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 88.2khz output - { - out_rate 88200 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 96khz output - { - out_rate 96000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 176.4khz output - { - out_rate 176400 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 192khz output - { - out_rate 192000 - out_bit_depth 32 - out_valid_bit_depth 32 + CombineArrays.Object.Base.output_audio_format [ + { + out_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 32 ] } ] From e20009bc4153cfa57177460e2097b8e239e7782e Mon Sep 17 00:00:00 2001 From: Baofeng Tian <baofeng.tian@intel.com> Date: Fri, 20 Oct 2023 16:14:34 +0800 Subject: [PATCH 629/639] Topology2: condense passthrough tplg file audio format Condense passthrough audio format with combined arrays. Signed-off-by: Baofeng Tian <baofeng.tian@intel.com> --- .../src_format_s32_passthrough.conf | 208 ++++-------------- 1 file changed, 40 insertions(+), 168 deletions(-) diff --git a/tools/topology/topology2/include/components/src_format_s32_passthrough.conf b/tools/topology/topology2/include/components/src_format_s32_passthrough.conf index adc8a391ef6b..97d87c9b24c4 100644 --- a/tools/topology/topology2/include/components/src_format_s32_passthrough.conf +++ b/tools/topology/topology2/include/components/src_format_s32_passthrough.conf @@ -1,178 +1,50 @@ #src format array num_input_audio_formats 14 - Object.Base.input_audio_format [ - # 8khz input - { - in_rate 8000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 11.025 khz input - { - in_rate 11025 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 12khz input - { - in_rate 12000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 16khz input - { - in_rate 16000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 22.05khz input - { - in_rate 22050 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 24khz input - { - in_rate 24000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 32khz input - { - in_rate 32000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 44.1khz input - { - in_rate 44100 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 48khz input - { - in_rate 48000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 64khz input - { - in_rate 64000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 88.2khz input - { - in_rate 88200 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 96khz input - { - in_rate 96000 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 176.4khz input - { - in_rate 176400 - in_bit_depth 32 - in_valid_bit_depth 32 - } - # 192khz input - { - in_rate 192000 - in_bit_depth 32 - in_valid_bit_depth 32 + CombineArrays.Object.Base.input_audio_format [ + { + in_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + in_bit_depth [ 32 ] + in_valid_bit_depth [ 32 ] } ] num_output_audio_formats 14 - Object.Base.output_audio_format [ - # 8khz output - { - out_rate 8000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 11.025 khz output - { - out_rate 11025 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 12khz output - { - out_rate 12000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 16khz output - { - out_rate 16000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 22.05khz output - { - out_rate 22050 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 24khz output - { - out_rate 24000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 32khz output - { - out_rate 32000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 44.1khz output - { - out_rate 44100 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 48khz output - { - out_rate 48000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 64khz output - { - out_rate 64000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 88.2khz output - { - out_rate 88200 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 96khz output - { - out_rate 96000 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 176.4khz output - { - out_rate 176400 - out_bit_depth 32 - out_valid_bit_depth 32 - } - # 192khz output - { - out_rate 192000 - out_bit_depth 32 - out_valid_bit_depth 32 + CombineArrays.Object.Base.output_audio_format [ + { + out_rate [ + 8000 + 11025 + 12000 + 16000 + 22050 + 24000 + 32000 + 44100 + 48000 + 64000 + 88200 + 96000 + 176400 + 192000 + ] + out_bit_depth [ 32 ] + out_valid_bit_depth [ 32 ] } ] From 31140b132c1cbffde524b767954670fe49a5fdad Mon Sep 17 00:00:00 2001 From: Yong Zhi <yong.zhi@intel.com> Date: Wed, 18 Oct 2023 14:40:21 -0500 Subject: [PATCH 630/639] topology2: cavs-rt5682 enable google rtc aec support Enable Google ACE for for all sof-mtl-max98357a-rt5682 variants. Signed-off-by: Yong Zhi <yong.zhi@intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index ffc97bffc8e4..817960fa9708 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -53,14 +53,14 @@ PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\ NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\ SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\ BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\ -DEEPBUFFER_D0I3_COMPATIBLE=true" +DEEPBUFFER_D0I3_COMPATIBLE=true,GOOGLE_RTC_AEC_SUPPORT=1" "cavs-rt5682\;sof-mtl-max98357a-rt5682-ssp2-ssp0-2ch-pdm1\;PLATFORM=mtl,NUM_DMICS=2,\ PDM0_MIC_A_ENABLE=0,PDM0_MIC_B_ENABLE=0,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682-2ch.bin,\ HEADSET_SSP_DAI_INDEX=2,SPEAKER_SSP_DAI_INDEX=0,SPK_ID=6,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\ BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\ -DEEPBUFFER_FW_DMA_MS=10,DEEPBUFFER_D0I3_COMPATIBLE=true" +DEEPBUFFER_FW_DMA_MS=10,DEEPBUFFER_D0I3_COMPATIBLE=true,GOOGLE_RTC_AEC_SUPPORT=1" "cavs-rt5682\;sof-mtl-rt1019-rt5682\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,SPK_ID=6,PREPROCESS_PLUGINS=nhlt,\ From 1c729f43c86296cef3355ba21f90d9fc7cbfe5ba Mon Sep 17 00:00:00 2001 From: Kai Vehmanen <kai.vehmanen@linux.intel.com> Date: Wed, 25 Oct 2023 13:40:11 +0300 Subject: [PATCH 631/639] west.yml: update Zephyr to 460c2167e4f3 Contains 600+ commits merged after 3.5.0 release, including following directly affecting SOF targets: 76cb2a54f51f intel_adsp: Do not include device_runtime header 1fac5ed2a60b soc: xtensa/nxp_adsp: put guard in Kconfig.defconfig f4cb487b79f9 modules: sof: Options only when module is available 02deea0e806a ace: alh: Only ACE1.5 has OSEL feature f0326f72498c tests: dma_loopback: Intel ADSP ACE15 disable PM adf6d0e3d80e soc: intel_adsp: lpsram enable retention mode eeb4f2f76d6d soc: intel_adsp: hpsram enable retention mode 16f729214b50 soc: intel_adsp: lpsram init refactor 112611378f85 soc: intel_adsp: hpsram init refactor cdd4d8470323 xtensa: add custom mem range check functions Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> --- west.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/west.yml b/west.yml index 8fdbababd700..4602b625f255 100644 --- a/west.yml +++ b/west.yml @@ -43,7 +43,7 @@ manifest: - name: zephyr repo-path: zephyr - revision: a6eef0ba3755f2530c5ce93524e5ac4f5be30194 + revision: 460c2167e4f3f6489ff0d3f519466a5682d8146b remote: zephyrproject # Import some projects listed in zephyr/west.yml@revision From 369dac1a226d002839d1e5bd1c5a0e855a612079 Mon Sep 17 00:00:00 2001 From: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> Date: Wed, 25 Oct 2023 16:49:41 +0300 Subject: [PATCH 632/639] Trace: Rename UNUSED() macro to SOF_TRACE_UNUSED() The xt-clang RI-2022.10 compiler headers define UNUSED. The rename of the macro for trace fixes in testbench build this error: In file included sof/tools/tplg_parser/pga.c:17: In file included sof/tools/tplg_parser/ ../../src/include/sof/lib/uuid.h:11: In file included sof/tools/tplg_parser/ ../../src/include/sof/common.h:105: /home/singalsu/work/current/sof/sof/tools/tplg_parser/ ../../src/include/sof/trace/preproc.h:162:9: error: 'UNUSED' macro redefined [-Werror,-Wmacro-redefined] #define UNUSED(arg1, ...) do { META_RECURSE( xtensa/XtDevTools/install/tools/RI-2022.10-linux/XtensaTools/ xtensa-elf/include/xtensa/xtensa-types.h:60:9: note: previous definition is here #define UNUSED(x) ((void)(x)) Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com> --- src/include/sof/trace/preproc.h | 2 +- src/include/sof/trace/trace.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/include/sof/trace/preproc.h b/src/include/sof/trace/preproc.h index 17a7994fcb43..acc20086258e 100644 --- a/src/include/sof/trace/preproc.h +++ b/src/include/sof/trace/preproc.h @@ -158,7 +158,7 @@ return_t META_CONCAT(prefix, postfix) (args) /* counteract compiler warning about unused variables */ -#define UNUSED(arg1, ...) do { META_RECURSE( \ +#define SOF_TRACE_UNUSED(arg1, ...) do { META_RECURSE( \ META_MAP_AGGREGATE(1, _META_VOID2, _META_VOID(arg1), __VA_ARGS__)); \ } while (0) diff --git a/src/include/sof/trace/trace.h b/src/include/sof/trace/trace.h index 737f9913cf6f..d1beb48d81e2 100644 --- a/src/include/sof/trace/trace.h +++ b/src/include/sof/trace/trace.h @@ -93,7 +93,7 @@ static inline struct trace *trace_get(void) /* Silences compiler warnings about unused variables */ #define trace_unused(class, ctx, id_1, id_2, format, ...) \ - UNUSED(ctx, id_1, id_2, ##__VA_ARGS__) + SOF_TRACE_UNUSED(ctx, id_1, id_2, ##__VA_ARGS__) struct trace_filter { uint32_t uuid_id; /**< type id, or 0 when not important */ From 165e68fdaff8bf46aa4e65286259e576a51a6ce2 Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Thu, 26 Oct 2023 15:48:56 +0800 Subject: [PATCH 633/639] topology2: Add sof-lnl-rt711-l0-rt1316-l23-rt714-l1 support This patch adds sof-lnl-rt711-l0-rt1316-l23-rt714-l1.tplg, which is used to support LNL RVP + AIOC4.1 codec board combination. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 817960fa9708..56cad54312bb 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -80,4 +80,7 @@ SDW_JACK_CAPTURE_CH=1,DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" "cavs-sdw\;sof-lnl-rt711-4ch\;PLATFORM=lnl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\ DMIC0_ID=2,DMIC1_ID=3,NUM_HDMIS=0,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-lnl-rt711-4ch.bin,\ DEEPBUFFER_FW_DMA_MS=100,DEEPBUFFER_D0I3_COMPATIBLE=true" + +"cavs-sdw\;sof-lnl-rt711-l0-rt1316-l23-rt714-l1\;PLATFORM=lnl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1,\ +NUM_HDMIS=0,SDW_SPK_STREAM=SDW2-Playback,SDW_SPK_IN_STREAM=SDW2-Capture,SDW_DMIC_STREAM=SDW1-Capture" ) From 3cb13e7c74ba7b531f67ad2e45e043740177949f Mon Sep 17 00:00:00 2001 From: Adrian Warecki <adrian.warecki@intel.com> Date: Thu, 26 Oct 2023 17:38:00 +0200 Subject: [PATCH 634/639] rimage: module: Fix section order in output image Fixed the order in which sections are placed in the output firmware image for platforms using a simple manifest. Fixes: #8336 Signed-off-by: Adrian Warecki <adrian.warecki@intel.com> --- tools/rimage/src/include/rimage/module.h | 3 ++- tools/rimage/src/module.c | 32 ++++++++++++++---------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tools/rimage/src/include/rimage/module.h b/tools/rimage/src/include/rimage/module.h index 3c265b20823b..872b559ddbd2 100644 --- a/tools/rimage/src/include/rimage/module.h +++ b/tools/rimage/src/include/rimage/module.h @@ -63,8 +63,9 @@ struct module_sections_info { /* sections count */ unsigned int count; - /* First section */ + /* sections list */ struct module_section *first_section; + struct module_section *last_section; }; /* diff --git a/tools/rimage/src/module.c b/tools/rimage/src/module.c index 0fb4de075de7..b150e246ca8c 100644 --- a/tools/rimage/src/module.c +++ b/tools/rimage/src/module.c @@ -218,22 +218,31 @@ static void sections_info_init(struct module_sections_info *info) * Adds section to module_sections_info structure * * @param info Pointer to a module_sections_info structure - * @param address section address - * @param size section size + * @param section module_section structure */ -static void sections_info_add(struct module_sections_info *info, const uint32_t address, - const size_t size) +static void sections_info_add(struct module_sections_info *info, struct module_section *section) { - const uint32_t end = address + size; + const uint32_t end = section->load_address + section->size; - if (address < info->start) - info->start = address; + if (section->load_address < info->start) + info->start = section->load_address; if (end > info->end) info->end = end; - info->size += size; + info->size += section->size; info->count++; + + /* Add section to list */ + section->next_section = NULL; + + if (info->last_section) + info->last_section->next_section = section; + + info->last_section = section; + + if (!info->first_section) + info->first_section = section; } /** @@ -356,11 +365,8 @@ void module_parse_sections(struct module *module, const struct memory_config *me fprintf(stdout, " ROM"); } else { /* Add section to list */ - if (info) { - sections_info_add(info, out_section->load_address, out_section->size); - out_section->next_section = info->first_section; - info->first_section = out_section; - } + if (info) + sections_info_add(info, out_section); } module->num_sections++; From 6458f48471eb957836760ec29a89ede31e5828d8 Mon Sep 17 00:00:00 2001 From: Marc Herbert <marc.herbert@intel.com> Date: Sat, 28 Oct 2023 00:08:01 +0000 Subject: [PATCH 635/639] scripts/fuzz.sh: fix multiple issues with "stub" overlays Fixes commit deed9a8808eb ("scripts: fuzz: add support for build and overlays") The main issue was the way fuzz.sh was trying to parse the overlay file. Drop that and just pass it as is to `west` and `cmake` instead, they know what to do with it. Also: - Fix invalid syntax in stub_build_all_ipc4.conf - Make fuzz.sh shellcheck-clean again. Always use shellcheck. - Temporarily disable `CONFIG_COMP_SMART_AMP` in stub_build_all_ipc3.conf because `smart_amp.c` does not compile (in any configuration) ``` sof/src/audio/smart_amp/smart_amp.c:748:9: error: no member named 'in_channels' in 'struct smart_amp_data' sad->in_channels = audio_stream_get_channels(&source_buffer->stream); ``` Signed-off-by: Marc Herbert <marc.herbert@intel.com> --- .github/workflows/build_all.yml | 2 +- app/stub_build_all_ipc3.conf | 7 +++++-- app/stub_build_all_ipc4.conf | 10 +++++----- scripts/fuzz.sh | 16 ++++++---------- 4 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index 886b53cf2d7a..16aae15274e9 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -61,4 +61,4 @@ jobs: cd workspace clang --verbose set -x - sof/scripts/fuzz.sh -b -c stub_build_all_${{ matrix.IPC }}.conf -- "$cmake_arg" + sof/scripts/fuzz.sh -b -- -DOVERLAY_CONFIG=stub_build_all_${{ matrix.IPC }}.conf diff --git a/app/stub_build_all_ipc3.conf b/app/stub_build_all_ipc3.conf index 9dcfbb50f1fb..b96ffe48adac 100644 --- a/app/stub_build_all_ipc3.conf +++ b/app/stub_build_all_ipc3.conf @@ -4,11 +4,14 @@ CONFIG_COMP_TONE=n CONFIG_COMP_CROSSOVER=y CONFIG_COMP_DRC=y CONFIG_COMP_MULTIBAND_DRC=y -CONFIG_COMP_SMART_AMP=y CONFIG_PASSTHROUGH_CODEC=y CONFIG_WAVES_CODEC=y CONFIG_DTS_CODEC=y CONFIG_COMP_IGO_NR=y CONFIG_COMP_RTNR=y -CONFIG_COMP_SMART_AMP=y +# temporarily disabled until it compiles: +# sof/src/audio/smart_amp/smart_amp.c:748:9: error: +# no member named 'in_channels' in 'struct smart_amp_data' +# sad->in_channels = audio_stream_get_channels(&source_buffer->stream); +CONFIG_COMP_SMART_AMP=n CONFIG_MAXIM_DSM=y diff --git a/app/stub_build_all_ipc4.conf b/app/stub_build_all_ipc4.conf index f111940b17b6..178b70388c01 100644 --- a/app/stub_build_all_ipc4.conf +++ b/app/stub_build_all_ipc4.conf @@ -1,5 +1,5 @@ --DCONFIG_COMP_STUBS=y --DCONFIG_COMP_ARIA=y --DCONFIG_COMP_CHAIN_DMA=y --DCONFIG_COMP_UP_DOWN_MIXER=y --DCONFIG_IPC_MAJOR_4=y +CONFIG_COMP_STUBS=y +CONFIG_COMP_ARIA=y +CONFIG_COMP_CHAIN_DMA=y +CONFIG_COMP_UP_DOWN_MIXER=y +CONFIG_IPC_MAJOR_4=y diff --git a/scripts/fuzz.sh b/scripts/fuzz.sh index d999beeb476a..47bd565d40ab 100755 --- a/scripts/fuzz.sh +++ b/scripts/fuzz.sh @@ -49,14 +49,14 @@ main() { setup + BUILD_ONLY=false # Parse "$@". getopts stops after '--' - while getopts "ho:t:c:b" opt; do + while getopts "ho:t:b" opt; do case "$opt" in h) print_help; exit 0;; o) FUZZER_STDOUT="$OPTARG";; t) TEST_DURATION="$OPTARG";; - b) BUILD_ONLY=1;; - c) OVERLAY="$OPTARG";; + b) BUILD_ONLY=true;; *) print_help; exit 1;; esac done @@ -80,15 +80,11 @@ main() -DCONFIG_ASAN=y ) - if [ ! -z $OVERLAY ]; then - overlay_config=$(xargs -a "$SOF_TOP/app/$OVERLAY" printf -- "-D%s ") - fi - west build -d build-fuzz -b native_posix "$SOF_TOP"/app/ -- \ - "${fuzz_configs[@]}" "$overlay_config" "$@" + "${fuzz_configs[@]}" "$@" - if [ $BUILD_ONLY -eq 1 ]; then - exit + if $BUILD_ONLY; then + exit 0 fi mkdir -p ./fuzz_corpus From 86497b46bf8fb4f48a63f2b7c3b20172ff262279 Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski <adrian.bonislawski@intel.com> Date: Wed, 25 Oct 2023 14:28:24 +0200 Subject: [PATCH 636/639] rimage: mtl/lnl: fix key slot setup based on imr type Clean cherry-picks of two commits from separate rimage repo https://github.com/thesofproject/rimage/commits/stable-v2.7 This will properly setup partition_usage field and remove fixed 0x23 value from MTL toml Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com> (cherry picked from commit fbea59358d06ffa86645cdf4ce0996e352742eb5) Second, squashed LNL commit: config/lnl.toml: drop now invalid signed_pkg.partition_usage Fixes commit fbea59358d06 ("rimage: mtl: fix key slot setup based on imr type") which broke LNL compilation like this: ``` error: 1 unparsed keys left in 'signed_pkg' error: key 'signed_pkg' parsing error ``` This commit does not change the final image (compared to before rimage commit fbea59358d06) because the default value is now 0x20 + IMR type. Fixes are normally submitted to the main branch first and then cherry picked to stable branches. However MTL fbea59358d06 has been made in stable-v2.7 first so the LNL change was also in stable-v2.7 first for consistency. Signed-off-by: Marc Herbert <marc.herbert@intel.com> (cherry picked from commit 469102a8f6052ce6a374b870ea945a84d04c3b1a) --- tools/rimage/config/lnl.toml | 1 - tools/rimage/config/mtl.toml | 1 - tools/rimage/src/adsp_config.c | 4 +--- tools/rimage/src/rimage.c | 2 -- 4 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/rimage/config/lnl.toml b/tools/rimage/config/lnl.toml index 04f9cb18b75e..879ec9097231 100644 --- a/tools/rimage/config/lnl.toml +++ b/tools/rimage/config/lnl.toml @@ -44,7 +44,6 @@ length = "0x0" # calculated by rimage [signed_pkg] name = "ADSP" -partition_usage = "0x23" [[signed_pkg.module]] name = "ADSP.met" diff --git a/tools/rimage/config/mtl.toml b/tools/rimage/config/mtl.toml index d85f797f627e..0a953e100cb8 100644 --- a/tools/rimage/config/mtl.toml +++ b/tools/rimage/config/mtl.toml @@ -44,7 +44,6 @@ length = "0x0" # calculated by rimage [signed_pkg] name = "ADSP" -partition_usage = "0x23" [[signed_pkg.module]] name = "ADSP.met" diff --git a/tools/rimage/src/adsp_config.c b/tools/rimage/src/adsp_config.c index ac196075a2b0..9a9423cbada7 100644 --- a/tools/rimage/src/adsp_config.c +++ b/tools/rimage/src/adsp_config.c @@ -1087,9 +1087,7 @@ static int parse_signed_pkg_ace_v1_5(const toml_table_t *toml, struct parse_ctx if (ret < 0) return ret; - out->partition_usage = parse_uint32_hex_key(signed_pkg, &ctx, "partition_usage", 0, &ret); - if (ret < 0) - return ret; + out->partition_usage = 0x20 + image->imr_type; /* check everything parsed, expect 1 more array */ ctx.array_cnt += 1; diff --git a/tools/rimage/src/rimage.c b/tools/rimage/src/rimage.c index 735075c130cc..887dd85ed755 100644 --- a/tools/rimage/src/rimage.c +++ b/tools/rimage/src/rimage.c @@ -191,8 +191,6 @@ int main(int argc, char *argv[]) } if (image.adsp->man_ace_v1_5) { - if (imr_type_override) - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; } From e73cdf68057a0d7a8f8618d2dba53dda28e54b9a Mon Sep 17 00:00:00 2001 From: Chao Song <chao.song@linux.intel.com> Date: Mon, 30 Oct 2023 15:43:21 +0800 Subject: [PATCH 637/639] topology2: Add sof-mtl-rt722-l0 support This patch adds sof-mtl-rt722-l0.tplg, which is used to support MTL RVP + RT722 EVB combination. Headphone, speaker and DMIC functions are verified with this topology. Signed-off-by: Chao Song <chao.song@linux.intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 56cad54312bb..80c7acdcdbd1 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -40,6 +40,10 @@ SDW_DMIC_STREAM=SDW0-Capture" # Jack codec + SmartAmp topology. No SDW_DMIC connection "cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2" +"cavs-sdw\;sof-mtl-rt722-l0\;PLATFORM=mtl,SDW_DMIC=1,NUM_HDMIS=0,NUM_SDW_AMP_LINKS=1,\ +SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\ +SDW_JACK_OUT_STREAM=Playback-SimpleJack,SDW_JACK_IN_STREAM=Capture-SimpleJack" + # Below topologies are used on Chromebooks "cavs-rt5682\;sof-mtl-max98357a-rt5682\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\ From e62e333e50f3704e8b5ab8254a00ee5a66e1c1e0 Mon Sep 17 00:00:00 2001 From: Yong Zhi <yong.zhi@intel.com> Date: Mon, 30 Oct 2023 11:07:16 -0500 Subject: [PATCH 638/639] rimage: mtl: Use DP scheduler for AEC module Change domain_types to DP, and allow it to run all 3 cores. Signed-off-by: Yong Zhi <yong.zhi@intel.com> --- tools/rimage/config/mtl.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/rimage/config/mtl.toml b/tools/rimage/config/mtl.toml index 0a953e100cb8..d401ac81eaba 100644 --- a/tools/rimage/config/mtl.toml +++ b/tools/rimage/config/mtl.toml @@ -600,9 +600,10 @@ count = 27 [[module.entry]] name = "RTC_AEC" uuid = "B780A0A6-269F-466F-B477-23DFA05AF758" - affinity_mask = "0x3" + # bit #i = 1 means core #i is allowed. + affinity_mask = "0x7" instance_count = "1" - domain_types = "0" + domain_types = "1" load_type = "1" module_type = "10" init_config = "1" @@ -688,4 +689,4 @@ count = 27 19, 0, 0, 0, 12832, 20396900, 0, 0, 0, 20396, 0, 20, 0, 0, 0, 12832, 20881000, 0, 0, 0, 20881, 0, 21, 0, 0, 0, 12832, 23431000, 0, 0, 0, 23431, 0, - 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] \ No newline at end of file + 22, 0, 0, 0, 12832, 30471000, 0, 0, 0, 30471, 0] From fd06766c919a20f8b17dcee250c9bd53ddf51efd Mon Sep 17 00:00:00 2001 From: Mac Chiang <mac.chiang@intel.com> Date: Tue, 31 Oct 2023 22:19:27 -0400 Subject: [PATCH 639/639] topology2: sof-mtl-rt713-rt1316: fix HDMI_IDs due to dai id mismatch In non sdw-dmic case, dai incremental id without it, so correct HDMI1/2/3_ID sequence from default 5,6,7 to 4,5,6. Signed-off-by: Mac Chiang <mac.chiang@intel.com> --- tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake index 80c7acdcdbd1..dd6402dc2c4f 100644 --- a/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake +++ b/tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake @@ -38,7 +38,7 @@ SDW_DMIC_STREAM=SDW0-Capture" "cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12-rt1713-l3\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,SDW_DMIC=1" # Jack codec + SmartAmp topology. No SDW_DMIC connection -"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2" +"cavs-sdw\;sof-mtl-rt713-l0-rt1316-l12\;PLATFORM=mtl,NUM_SDW_AMP_LINKS=2,HDMI1_ID=4,HDMI2_ID=5,HDMI3_ID=6" "cavs-sdw\;sof-mtl-rt722-l0\;PLATFORM=mtl,SDW_DMIC=1,NUM_HDMIS=0,NUM_SDW_AMP_LINKS=1,\ SDW_AMP_FEEDBACK=false,SDW_SPK_STREAM=Playback-SmartAmp,SDW_DMIC_STREAM=Capture-SmartMic,\