Skip to content

Commit 74bcdca

Browse files
committed
build: remove scheduling-related XTOS remainders
Remove XTOS scheduling and related inintialisation code. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent e68dfe9 commit 74bcdca

File tree

4 files changed

+0
-730
lines changed

4 files changed

+0
-730
lines changed

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

0 commit comments

Comments
 (0)