Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/audio/multiband_drc/multiband_drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,9 @@ static int multiband_drc_process(struct processing_module *mod,
return 0;
}

__cold static int multiband_drc_prepare(struct processing_module *mod,
struct sof_source **sources, int num_of_sources,
struct sof_sink **sinks, int num_of_sinks)
static int multiband_drc_prepare(struct processing_module *mod,
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;
Expand All @@ -370,8 +370,6 @@ __cold static int multiband_drc_prepare(struct processing_module *mod,
int rate;
int ret = 0;

assert_can_be_cold();

comp_info(dev, "multiband_drc_prepare()");

ret = multiband_drc_params(mod);
Expand Down Expand Up @@ -407,12 +405,10 @@ __cold static int multiband_drc_prepare(struct processing_module *mod,
return ret;
}

__cold static int multiband_drc_reset(struct processing_module *mod)
static int multiband_drc_reset(struct processing_module *mod)
{
struct multiband_drc_comp_data *cd = module_get_private_data(mod);

assert_can_be_cold();

comp_info(mod->dev, "multiband_drc_reset()");

multiband_drc_reset_state(&cd->state);
Expand Down
2 changes: 1 addition & 1 deletion src/audio/multiband_drc/multiband_drc_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ __cold int multiband_drc_get_ipc_config(struct processing_module *mod,
return comp_data_blob_get_cmd(cd->model_handler, cdata, fragment_size);
}

__cold int multiband_drc_params(struct processing_module *mod)
int multiband_drc_params(struct processing_module *mod)
{
struct sof_ipc_stream_params *params = mod->stream_params;
struct sof_ipc_stream_params comp_params;
Expand Down
8 changes: 3 additions & 5 deletions src/audio/src/src.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,14 @@

LOG_MODULE_DECLARE(src, CONFIG_SOF_LOG_LEVEL);

__cold static int src_prepare(struct processing_module *mod,
struct sof_source **sources, int num_of_sources,
struct sof_sink **sinks, int num_of_sinks)
static int src_prepare(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);
struct src_param *a = &cd->param;
int ret;

assert_can_be_cold();

comp_info(mod->dev, "src_prepare()");

if (num_of_sources != 1 || num_of_sinks != 1)
Expand Down
38 changes: 12 additions & 26 deletions src/audio/src/src_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
LOG_MODULE_REGISTER(src, CONFIG_SOF_LOG_LEVEL);

/* Calculates buffers to allocate for a SRC mode */
__cold static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, int nch)
static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd, int nch)
{
const struct src_stage *stage1;
const struct src_stage *stage2;
Expand All @@ -54,8 +54,6 @@ __cold static int src_buffer_lengths(struct comp_dev *dev, struct comp_data *cd,
int source_frames;
int r1, n;

assert_can_be_cold();

a = &cd->param;
fs_in = cd->source_rate;
fs_out = cd->sink_rate;
Expand Down Expand Up @@ -186,16 +184,14 @@ static int init_stages(const struct src_stage *stage1, const struct src_stage *s
return 0;
}

__cold static int src_polyphase_init(struct polyphase_src *src, struct src_param *p,
int32_t *delay_lines_start)
static int src_polyphase_init(struct polyphase_src *src, struct src_param *p,
int32_t *delay_lines_start)
{
const struct src_stage *stage1;
const struct src_stage *stage2;
int n_stages;
int ret;

assert_can_be_cold();

if (p->idx_in < 0 || p->idx_out < 0)
return -EINVAL;

Expand Down Expand Up @@ -397,15 +393,13 @@ void src_set_alignment(struct sof_source *source, struct sof_sink *sink)
sink_set_alignment_constants(sink, byte_align, frame_align_req);
}

__cold static int src_verify_params(struct processing_module *mod)
static 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);
struct comp_dev *dev = mod->dev;
int ret;

assert_can_be_cold();

comp_dbg(dev, "src_verify_params()");

/* check whether params->rate (received from driver) are equal
Expand Down Expand Up @@ -480,9 +474,9 @@ static bool src_get_copy_limits(struct comp_data *cd,
return true;
}

__cold 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;
Expand All @@ -491,8 +485,6 @@ __cold int src_params_general(struct processing_module *mod,
int n;
int err;

assert_can_be_cold();

comp_info(dev, "src_params()");

err = src_set_params(mod, sink);
Expand Down Expand Up @@ -583,14 +575,12 @@ __cold int src_params_general(struct processing_module *mod,
return 0;
}

__cold int src_param_set(struct comp_dev *dev, struct comp_data *cd)
int src_param_set(struct comp_dev *dev, struct comp_data *cd)
{
struct src_param *a = &cd->param;
int fs_in = cd->source_rate;
int fs_out = cd->sink_rate;

assert_can_be_cold();

a->idx_in = src_find_fs(a->in_fs, a->num_in_fs, fs_in);
a->idx_out = src_find_fs(a->out_fs, a->num_out_fs, fs_out);

Expand All @@ -604,9 +594,9 @@ __cold int src_param_set(struct comp_dev *dev, struct comp_data *cd)
return 0;
}

__cold int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
const struct src_stage *stage_src1,
const struct src_stage *stage_src2)
int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
const struct src_stage *stage_src1,
const struct src_stage *stage_src2)
{
#if CONFIG_FAST_GET
struct src_stage *stage_dst;
Expand All @@ -617,8 +607,6 @@ __cold int src_allocate_copy_stages(struct comp_dev *dev, struct src_param *prm,
size_t tap_size = sizeof(int32_t);
#endif

assert_can_be_cold();

stage_dst = rmalloc(SOF_MEM_ZONE_RUNTIME, 0, SOF_MEM_CAPS_RAM,
2 * sizeof(*stage_dst));
if (!stage_dst) {
Expand Down Expand Up @@ -697,12 +685,10 @@ __cold int src_get_config(struct processing_module *mod, uint32_t config_id,
return -EINVAL;
}

__cold int src_reset(struct processing_module *mod)
int src_reset(struct processing_module *mod)
{
struct comp_data *cd = module_get_private_data(mod);

assert_can_be_cold();

comp_info(mod->dev, "src_reset()");

cd->src_func = src_fallback;
Expand Down
18 changes: 6 additions & 12 deletions src/audio/src/src_ipc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ 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.
*/
__cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
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;
Expand All @@ -86,8 +86,6 @@ __cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
struct comp_dev *dev = mod->dev;
int ret;

assert_can_be_cold();

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;
Expand Down Expand Up @@ -119,15 +117,13 @@ __cold int src_set_params(struct processing_module *mod, struct sof_sink *sink)
return ret;
}

__cold void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
struct sof_sink *sink)
void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *source,
struct sof_sink *sink)
{
struct processing_module *mod = comp_mod(dev);
struct comp_data *cd = module_get_private_data(mod);
enum sof_ipc_frame frame_fmt, valid_fmt;

assert_can_be_cold();

/* 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,
Expand All @@ -140,16 +136,14 @@ __cold void src_get_source_sink_params(struct comp_dev *dev, struct sof_source *
sink_set_rate(sink, cd->ipc_config.sink_rate);
}

__cold int src_prepare_general(struct processing_module *mod,
struct sof_source *source,
struct sof_sink *sink)
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;

assert_can_be_cold();

/* set align requirements */
src_set_alignment(source, sink);

Expand Down
7 changes: 5 additions & 2 deletions src/include/module/module/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ struct module_interface {
/**
* (optional) Module specific reset procedure, called as part of module_adapter component
* reset in .reset(). This should reset all parameters to their initial stage
* and free all memory allocated during prepare(). Usually can be __cold
* and free all memory allocated during prepare(). Usually shouldn't be __cold since it's
* called from pipeline_reset() from ipc4_pipeline_trigger()
*/
int (*reset)(struct processing_module *mod);

Expand All @@ -239,7 +240,9 @@ struct module_interface {

/**
* (optional) Module specific trigger procedure, called when modules are triggered. Usually
* can be __cold
* shouldn't be __cold. If a module implements this method, even if it only handles
* commands, running in non-LL context, it will still be called from the high priority
* LL context, which will cause a short jump to DRAM to check for supported commands.
*/
int (*trigger)(struct processing_module *mod, int cmd);

Expand Down
2 changes: 0 additions & 2 deletions src/include/sof/ipc/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ typedef uint32_t ipc_comp;
struct ipc_comp_dev;
const struct comp_driver *ipc4_get_comp_drv(uint32_t module_id);
struct comp_dev *ipc4_get_comp_dev(uint32_t comp_id);
int ipc4_add_comp_dev(struct comp_dev *dev);
const struct comp_driver *ipc4_get_drv(const void *uuid);
int ipc4_chain_manager_create(struct ipc4_chain_dma *cdma);
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);
Expand Down
6 changes: 3 additions & 3 deletions src/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static int secondary_core_restore(void)

#endif

int secondary_core_init(struct sof *sof)
__cold int secondary_core_init(struct sof *sof)
{
int err;
struct ll_schedule_domain *dma_domain;
Expand Down Expand Up @@ -237,7 +237,7 @@ int secondary_core_init(struct sof *sof)

#endif

static void print_version_banner(void)
__cold static void print_version_banner(void)
{
/*
* Non-Zephyr builds emit the version banner in DMA-trace
Expand Down Expand Up @@ -267,7 +267,7 @@ static log_timestamp_t default_get_timestamp(void)
}
#endif

static int primary_core_init(int argc, char *argv[], struct sof *sof)
__cold static int primary_core_init(int argc, char *argv[], struct sof *sof)
{
/* setup context */
sof->argc = argc;
Expand Down
9 changes: 7 additions & 2 deletions src/ipc/ipc-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <rtos/cache.h>
#include <sof/lib/cpu.h>
#include <sof/lib/mailbox.h>
#include <sof/lib/memory.h>
#include <sof/list.h>
#include <sof/platform.h>
#include <rtos/sof.h>
Expand Down Expand Up @@ -188,12 +189,14 @@ static void schedule_ipc_worker(void)
#endif
}

void ipc_msg_send_direct(struct ipc_msg *msg, void *data)
__cold void ipc_msg_send_direct(struct ipc_msg *msg, void *data)
{
struct ipc *ipc = ipc_get();
k_spinlock_key_t key;
int ret;

assert_can_be_cold();

key = k_spin_lock(&ipc->lock);

/* copy mailbox data to message if not already copied */
Expand Down Expand Up @@ -280,8 +283,10 @@ void ipc_schedule_process(struct ipc *ipc)
#endif
}

int ipc_init(struct sof *sof)
__cold int ipc_init(struct sof *sof)
{
assert_can_be_cold();

tr_dbg(&ipc_tr, "ipc_init()");

/* init ipc data */
Expand Down
Loading
Loading