Skip to content

Commit 4f2e381

Browse files
lyakhlgirdwood
authored andcommitted
build: remove more XTOS left-overs
Remove conditional __ZEPHYR__ core parts. Most files are now only Zephyr or only host. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent e68dfe9 commit 4f2e381

17 files changed

Lines changed: 6 additions & 358 deletions

File tree

src/init/init.c

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ static inline void lp_sram_unpack(void)
9090

9191
#if CONFIG_MULTICORE
9292

93-
#ifdef __ZEPHYR__
94-
9593
static bool check_restore(void)
9694
{
9795
struct idc *idc = *idc_get();
@@ -107,75 +105,11 @@ static bool check_restore(void)
107105

108106
static inline int secondary_core_restore(void) { return 0; };
109107

110-
#else
111-
112-
static bool check_restore(void)
113-
{
114-
struct idc *idc = *idc_get();
115-
struct task *task = *task_main_get();
116-
struct notify *notifier = *arch_notify_get();
117-
struct schedulers *schedulers = *arch_schedulers_get();
118-
119-
/* check whether basic core structures has been already allocated. If they
120-
* are available in memory, it means that this is not cold boot and memory
121-
* has not been powered off.
122-
*/
123-
return !!idc && !!task && !!notifier && !!schedulers;
124-
}
125-
126-
static int secondary_core_restore(void)
127-
{
128-
int err;
129-
130-
trace_point(TRACE_BOOT_PLATFORM_IRQ);
131-
132-
/* initialize interrupts */
133-
platform_interrupt_init();
134-
135-
/* As the memory was not turned of in D0->D0ix and basic structures are
136-
* already allocated, in restore process (D0ix->D0) we have only to
137-
* register and enable required interrupts (it is done in
138-
* schedulers_restore() and idc_restore()).
139-
*/
140-
141-
/* restore schedulers i.e. register and enable scheduler interrupts */
142-
trace_point(TRACE_BOOT_PLATFORM_SCHED);
143-
err = schedulers_restore();
144-
if (err < 0)
145-
return err;
146-
147-
/* restore idc i.e. register and enable idc interrupts */
148-
trace_point(TRACE_BOOT_PLATFORM_IDC);
149-
err = idc_restore();
150-
if (err < 0)
151-
return err;
152-
153-
trace_point(TRACE_BOOT_PLATFORM);
154-
155-
/* In restore case (D0ix->D0 flow) we do not have to invoke here
156-
* schedule_task(*task_main_get(), 0, UINT64_MAX) as it is done in
157-
* cold boot process (see end of secondary_core_init() function),
158-
* because in restore case memory has not been powered off and task_main
159-
* is already added into scheduler list.
160-
*/
161-
while (1)
162-
wait_for_interrupt(0);
163-
}
164-
165-
#endif
166-
167108
__cold int secondary_core_init(struct sof *sof)
168109
{
169110
int err;
170111
struct ll_schedule_domain *dma_domain;
171112

172-
#ifndef __ZEPHYR__
173-
/* init architecture */
174-
trace_point(TRACE_BOOT_ARCH);
175-
err = arch_init();
176-
if (err < 0)
177-
sof_panic(SOF_IPC_PANIC_ARCH);
178-
#endif
179113
/* check whether we are in a cold boot process or not (e.g. D0->D0ix
180114
* flow when primary core disables all secondary cores). If not, we do
181115
* not have allocate basic structures like e.g. schedulers, notifier,
@@ -188,13 +122,6 @@ __cold int secondary_core_init(struct sof *sof)
188122
trace_point(TRACE_BOOT_SYS_NOTIFIER);
189123
init_system_notify(sof);
190124

191-
#ifndef __ZEPHYR__
192-
/* interrupts need to be initialized before any usage */
193-
trace_point(TRACE_BOOT_PLATFORM_IRQ);
194-
platform_interrupt_init();
195-
196-
scheduler_init_edf();
197-
#endif
198125
trace_point(TRACE_BOOT_PLATFORM_SCHED);
199126
scheduler_init_ll(timer_domain_get());
200127

@@ -227,11 +154,6 @@ __cold int secondary_core_init(struct sof *sof)
227154

228155
trace_point(TRACE_BOOT_PLATFORM);
229156

230-
#ifndef __ZEPHYR__
231-
/* task initialized in edf_scheduler_init */
232-
schedule_task(*task_main_get(), 0, UINT64_MAX);
233-
#endif
234-
235157
return err;
236158
}
237159

@@ -273,20 +195,6 @@ __cold static int primary_core_init(int argc, char *argv[], struct sof *sof)
273195
sof->argc = argc;
274196
sof->argv = argv;
275197

276-
#ifndef __ZEPHYR__
277-
/* init architecture */
278-
trace_point(TRACE_BOOT_ARCH);
279-
if (arch_init() < 0)
280-
sof_panic(SOF_IPC_PANIC_ARCH);
281-
282-
/* initialise system services */
283-
trace_point(TRACE_BOOT_SYS_HEAP);
284-
platform_init_memmap(sof);
285-
init_heap(sof);
286-
287-
interrupt_init(sof);
288-
#endif /* __ZEPHYR__ */
289-
290198
#if defined(CONFIG_ZEPHYR_LOG) && !defined(CONFIG_LOG_MODE_MINIMAL)
291199
log_set_timestamp_func(default_get_timestamp,
292200
sys_clock_hw_cycles_per_sec());
@@ -338,27 +246,6 @@ __cold static int primary_core_init(int argc, char *argv[], struct sof *sof)
338246
return task_main_start(sof);
339247
}
340248

341-
#ifndef __ZEPHYR__
342-
int main(int argc, char *argv[])
343-
{
344-
int err = 0;
345-
346-
trace_point(TRACE_BOOT_START);
347-
348-
if (cpu_get_id() == PLATFORM_PRIMARY_CORE_ID)
349-
err = primary_core_init(argc, argv, &sof);
350-
#if CONFIG_MULTICORE
351-
else
352-
err = secondary_core_init(&sof);
353-
#endif
354-
355-
/* should never get here */
356-
sof_panic(SOF_IPC_PANIC_TASK);
357-
return err;
358-
}
359-
360-
#else
361-
362249
int sof_main(int argc, char *argv[])
363250
{
364251
trace_point(TRACE_BOOT_START);
@@ -372,4 +259,3 @@ static int sof_init(void)
372259
}
373260

374261
SYS_INIT(sof_init, POST_KERNEL, 99);
375-
#endif

src/lib/clk.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -83,35 +83,6 @@ void clock_low_power_mode(int clock, bool enable)
8383
clk_info->low_power_mode(clock, enable);
8484
}
8585

86-
#ifndef __ZEPHYR__
87-
uint64_t clock_ms_to_ticks(int clock, uint64_t ms)
88-
{
89-
struct clock_info *clk_info = clocks_get() + clock;
90-
uint64_t ticks;
91-
92-
ticks = clk_info->freqs[clk_info->current_freq_idx].ticks_per_msec * ms;
93-
94-
return ticks;
95-
}
96-
97-
uint64_t clock_us_to_ticks(int clock, uint64_t us)
98-
{
99-
struct clock_info *clk_info = clocks_get() + clock;
100-
uint64_t ticks;
101-
102-
ticks = clk_info->freqs[clk_info->current_freq_idx].ticks_per_msec * us / 1000ULL;
103-
104-
return ticks;
105-
}
106-
107-
uint64_t clock_ns_to_ticks(int clock, uint64_t ns)
108-
{
109-
struct clock_info *clk_info = clocks_get() + clock;
110-
111-
return clk_info->freqs[clk_info->current_freq_idx].ticks_per_msec * ns / 1000000ULL;
112-
}
113-
#endif /* __ZEPHYR__ */
114-
11586
uint64_t clock_ticks_per_sample(int clock, uint32_t sample_rate)
11687
{
11788
struct clock_info *clk_info = clocks_get() + clock;

src/lib/cpu-clk-manager.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
#include <rtos/clk.h>
1212
#include <sof/math/numbers.h>
1313
#include <errno.h>
14-
#ifdef __ZEPHYR__
1514
#include <zephyr/sys/util.h>
16-
#endif /* __ZEPHYR__ */
1715

1816
static struct kcps_budget_data kcps_data;
1917

src/lib/pm_runtime.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020
#include <ipc/topology.h>
2121
#include <stdint.h>
2222

23-
#if defined(__ZEPHYR__)
2423
#include <zephyr/pm/policy.h>
25-
#endif
2624

2725
LOG_MODULE_REGISTER(pm_runtime, CONFIG_SOF_LOG_LEVEL);
2826

@@ -132,7 +130,7 @@ bool pm_runtime_is_active(enum pm_runtime_context context, uint32_t index)
132130
{
133131
tr_dbg(&pm_tr, "pm_runtime_is_active() context %d index %d", context,
134132
index);
135-
#if defined(__ZEPHYR__) && defined(CONFIG_PM)
133+
#if defined(CONFIG_PM)
136134
return pm_policy_state_lock_is_active(PM_STATE_RUNTIME_IDLE, PM_ALL_SUBSTATES);
137135
#else
138136
switch (context) {

src/platform/ace30/include/platform/lib/memory.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
#define __PLATFORM_LIB_MEMORY_H__
1212

1313
/* prioritize definitions in Zephyr SoC layer */
14-
#ifdef __ZEPHYR__
1514
#include <adsp_memory.h>
16-
#endif
1715

1816
#include <ace/lib/memory.h>
1917
#include <mem_window.h>

src/platform/amd/rembrandt/lib/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@ add_local_sources(sof
44
clk.c
55
dai.c
66
dma.c
7-
memory.c
87
)

src/platform/amd/rembrandt/lib/memory.c

Lines changed: 0 additions & 96 deletions
This file was deleted.

src/platform/amd/rembrandt/platform.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,23 +123,13 @@ const struct ext_man_windows xsram_window
123123
},
124124
};
125125

126-
#ifndef __ZEPHYR__
127-
static SHARED_DATA struct timer timer = {
128-
.id = TIMER0,
129-
.irq = IRQ_NUM_TIMER0,
130-
};
131-
#endif
132-
133126
int platform_init(struct sof *sof)
134127
{
135128
int ret;
136-
#ifndef __ZEPHYR__
137-
sof->platform_timer = &timer;
138-
sof->cpu_timers = &timer;
139-
#else
129+
140130
/* initialize cascade interrupts before any usage */
141131
interrupt_init(sof);
142-
#endif
132+
143133
/* to view system memory */
144134
platform_interrupt_init();
145135
platform_clock_init(sof);
@@ -149,9 +139,7 @@ int platform_init(struct sof *sof)
149139
sof->platform_timer_domain = timer_domain_init(sof->platform_timer,
150140
PLATFORM_DEFAULT_CLOCK);
151141
scheduler_init_ll(sof->platform_timer_domain);
152-
#ifndef __ZEPHYR__
153-
platform_timer_start(sof->platform_timer);
154-
#endif
142+
155143
/*CONFIG_SYSTICK_PERIOD hardcoded as 200000*/
156144
sa_init(sof, 200000);
157145
clock_set_freq(CLK_CPU(cpu_get_id()), CLK_MAX_CPU_HZ);
@@ -202,14 +190,8 @@ int platform_boot_complete(uint32_t boot_message)
202190
clock_set_freq(CLK_CPU(cpu_get_id()), CLK_DEFAULT_CPU_HZ);
203191
return 0;
204192
}
193+
205194
int platform_context_save(struct sof *sof)
206195
{
207196
return 0;
208197
}
209-
210-
#ifndef __ZEPHYR__
211-
void platform_wait_for_interrupt(int level)
212-
{
213-
arch_wait_for_interrupt(level);
214-
}
215-
#endif

0 commit comments

Comments
 (0)