Skip to content
Open
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
10 changes: 0 additions & 10 deletions posix/include/rtos/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,6 @@ 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);
Expand Down
10 changes: 5 additions & 5 deletions src/kernel/platform/amd/acp_7_x/lib/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <sof/kernel/drivers/acp_dai_dma.h>
#include <rtos/interrupt.h>
#include <rtos/timer.h>
#include <rtos/wait.h>
#include <zephyr/kernel.h>
#include <rtos/alloc.h>
#include <rtos/clk.h>
#include <sof/lib/cpu.h>
Expand Down Expand Up @@ -303,7 +303,7 @@ static uint32_t acp_pmfw_poll_response(uint32_t msg, uint32_t arg)
if (resp || sof_cycle_get_64() >= deadline) {
break;
}
wait_delay_us(1000);/*1ms delay to avoid busy loop*/
k_busy_wait(1000);/*1ms delay to avoid busy loop*/
} while (sof_cycle_get_64() < deadline);

elapsed_us = (uint32_t)k_cyc_to_us_floor64(sof_cycle_get_64() - start);
Expand Down Expand Up @@ -340,7 +340,7 @@ static void acp_clk_dfsbypass_request(uint32_t req_bit, uint32_t timeout_cnt)
if (!(value & req_bit)) {
return;
}
wait_delay_us(CLK_POLL_DELAY_US);
k_busy_wait(CLK_POLL_DELAY_US);
}

tr_warn(&acp_clk_tr, "DFS bypass request 0x%x still pending: cntl 0x%x",
Expand Down Expand Up @@ -538,7 +538,7 @@ uint32_t acp_clk_update_dfs_did(uint32_t did, uint32_t clk_type)
} else if (clk_type == acp_sclk_clock) {
acp_cpl_audioclk_dfs_did_update(true, 10, did);
}
wait_delay_us(ACP_CLK_MEASURE_SETTLE_US);
k_busy_wait(ACP_CLK_MEASURE_SETTLE_US);
acp_log_current_aclk("D0");
acp_get_current_clk(acp_aclk_clock, (float *)&updated_clk);
return updated_clk;
Expand Down Expand Up @@ -675,7 +675,7 @@ static void acp_log_agt_clk(const char *state, const char *name, acp_clock_type_
static void acp_log_current_aclk(const char *state)
{
acp_clk_tick_cnt_enable();
wait_delay_us(ACP_CLK_MEASURE_SETTLE_US);
k_busy_wait(ACP_CLK_MEASURE_SETTLE_US);
acp_log_agt_clk(state, "ACLK", acp_aclk_clock);
acp_log_agt_clk(state, "AUDIOCLK", acp_sclk_clock);
}
4 changes: 2 additions & 2 deletions src/samples/audio/detect_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <sof/ipc/msg.h>
#include <rtos/alloc.h>
#include <rtos/init.h>
#include <rtos/wait.h>
#include <zephyr/kernel.h>
#include <sof/lib/cold.h>
#include <sof/lib/uuid.h>
#include <sof/list.h>
Expand Down Expand Up @@ -225,7 +225,7 @@ static void default_detect_test(struct comp_dev *dev,
/* assuming count is a processing frame size in samples */
cycles_per_frame = (cd->config.load_mips * 1000000 * count)
/ audio_stream_get_rate(source);
wait_delay(cycles_per_frame);
k_busy_wait(k_cyc_to_us_floor64(cycles_per_frame));
}

/* perform detection within current period */
Expand Down
2 changes: 1 addition & 1 deletion src/schedule/dma_multi_chan_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static bool dma_multi_chan_domain_is_pending(struct ll_schedule_domain *domain,
/* it's too soon for this task */
if (!pipe_task->registrable &&
pipe_task->task.start >
sof_cycle_get_64_atomic())
sof_cycle_get_64())
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions src/schedule/dma_single_chan_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static void dma_single_chan_domain_set(struct ll_schedule_domain *domain,
return;

if (dma_domain->channel_changed) {
domain->next_tick = sof_cycle_get_64_atomic();
domain->next_tick = sof_cycle_get_64();

dma_domain->channel_changed = false;
} else {
Expand Down Expand Up @@ -488,7 +488,7 @@ static void dma_single_chan_domain_clear(struct ll_schedule_domain *domain)
static bool dma_single_chan_domain_is_pending(struct ll_schedule_domain *domain,
struct task *task, struct comp_dev **comp)
{
return task->start <= sof_cycle_get_64_atomic();
return task->start <= sof_cycle_get_64();
}

/**
Expand Down
7 changes: 0 additions & 7 deletions zephyr/include/rtos/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ static inline uint64_t sof_cycle_get_64(void)
return k_ticks_to_cyc_floor64(k_uptime_ticks());
}

static inline uint64_t sys_cycle_get_64_rate(void)
{
return CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
}

#define sof_cycle_get_64_safe() sof_cycle_get_64()
#define sof_cycle_get_64_atomic() sof_cycle_get_64()
#define platform_timer_stop(x)

/* get timestamp for host stream DMA position */
Expand Down
16 changes: 0 additions & 16 deletions zephyr/include/rtos/wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@
#include <stdint.h>
#include <stdbool.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/time_units.h>

static inline void wait_delay_us(uint64_t us)
{
k_busy_wait(us);
}

static inline void wait_delay(uint64_t number_of_clks)
{
k_busy_wait(k_cyc_to_us_floor64(number_of_clks));
}

static inline void wait_delay_ms(uint64_t ms)
{
k_busy_wait(ms * 1000);
}

int poll_for_register_delay(uint32_t reg, uint32_t mask,
uint32_t val, uint64_t us);
Expand Down
4 changes: 2 additions & 2 deletions zephyr/wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void platform_dai_timestamp(struct comp_dev *dai,
/* get SSP wallclock - DAI sets this to stream start value */
#ifndef CONFIG_SOF_USERSPACE_LL
posn->wallclock = sof_cycle_get_64() - posn->wallclock;
posn->wallclock_hz = sys_cycle_get_64_rate();
posn->wallclock_hz = sys_clock_hw_cycles_per_sec();
#else
posn->wallclock = k_uptime_ticks() - posn->wallclock;
posn->wallclock_hz = CONFIG_SYS_CLOCK_TICKS_PER_SEC;
Expand Down Expand Up @@ -322,7 +322,7 @@ int poll_for_register_delay(uint32_t reg, uint32_t mask,
reg, mask, val, (uint32_t)us);
return -EIO;
}
wait_delay(delta);
k_busy_wait(k_cyc_to_us_floor64(delta));
}
return 0;
}
Expand Down
Loading