2019-06-02 03:14:06 +08:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause
|
2016-09-21 22:57:22 +08:00
|
|
|
*
|
2019-06-02 03:14:06 +08:00
|
|
|
* Copyright(c) 2016 Intel Corporation. All rights reserved.
|
2016-09-21 22:57:22 +08:00
|
|
|
*
|
|
|
|
* Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
|
|
|
|
*/
|
|
|
|
|
2023-02-22 01:05:47 +08:00
|
|
|
#ifndef __XTOS_RTOS_SOF_H__
|
|
|
|
#define __XTOS_RTOS_SOF_H__
|
2016-09-21 22:57:22 +08:00
|
|
|
|
2018-04-05 07:46:50 +08:00
|
|
|
#include <arch/sof.h>
|
2019-12-19 21:13:06 +08:00
|
|
|
#include <sof/common.h>
|
|
|
|
#include <sof/lib/memory.h>
|
2022-11-23 11:16:18 +08:00
|
|
|
#include <rtos/spinlock.h>
|
2016-09-21 22:57:22 +08:00
|
|
|
|
2020-01-15 23:47:32 +08:00
|
|
|
struct cascade_root;
|
2019-12-19 22:12:52 +08:00
|
|
|
struct clock_info;
|
2020-01-17 18:26:40 +08:00
|
|
|
struct comp_driver_list;
|
2020-01-08 22:06:31 +08:00
|
|
|
struct dai_info;
|
2020-01-08 23:09:03 +08:00
|
|
|
struct dma_info;
|
2019-07-15 17:27:29 +08:00
|
|
|
struct dma_trace_data;
|
2017-06-06 23:41:07 +08:00
|
|
|
struct ipc;
|
2019-12-19 23:17:38 +08:00
|
|
|
struct ll_schedule_domain;
|
2020-01-08 16:58:30 +08:00
|
|
|
struct mm;
|
2020-01-21 19:48:09 +08:00
|
|
|
struct mn;
|
2022-09-27 15:30:53 +08:00
|
|
|
struct ams_shared_context;
|
2020-01-08 19:54:17 +08:00
|
|
|
struct notify_data;
|
2020-01-08 17:29:23 +08:00
|
|
|
struct pm_runtime_data;
|
2017-12-22 01:12:50 +08:00
|
|
|
struct sa;
|
2019-12-19 22:20:32 +08:00
|
|
|
struct timer;
|
2019-12-19 21:41:05 +08:00
|
|
|
struct trace;
|
2020-03-16 23:56:22 +08:00
|
|
|
struct pipeline_posn;
|
2020-02-06 17:22:52 +08:00
|
|
|
struct probe_pdata;
|
2017-06-06 23:41:07 +08:00
|
|
|
|
2019-12-19 21:13:06 +08:00
|
|
|
/**
|
|
|
|
* \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.
|
|
|
|
*/
|
2018-04-05 07:46:50 +08:00
|
|
|
struct sof {
|
2017-06-06 23:41:07 +08:00
|
|
|
/* init data */
|
|
|
|
int argc;
|
|
|
|
char **argv;
|
|
|
|
|
|
|
|
/* ipc */
|
|
|
|
struct ipc *ipc;
|
|
|
|
|
2017-12-22 01:12:50 +08:00
|
|
|
/* system agent */
|
|
|
|
struct sa *sa;
|
|
|
|
|
2018-02-26 04:33:22 +08:00
|
|
|
/* DMA for Trace*/
|
|
|
|
struct dma_trace_data *dmat;
|
2019-12-19 21:13:06 +08:00
|
|
|
|
2019-12-19 21:41:05 +08:00
|
|
|
/* generic trace structure */
|
|
|
|
struct trace *trace;
|
|
|
|
|
2019-12-19 22:12:52 +08:00
|
|
|
/* platform clock information */
|
|
|
|
struct clock_info *clocks;
|
|
|
|
|
2019-12-19 22:20:32 +08:00
|
|
|
/* default platform timer */
|
|
|
|
struct timer *platform_timer;
|
|
|
|
|
2020-07-10 19:53:18 +08:00
|
|
|
/* cpu (arch) timers - 1 per core */
|
|
|
|
struct timer *cpu_timers;
|
2020-01-14 01:18:31 +08:00
|
|
|
|
2019-12-19 23:17:38 +08:00
|
|
|
/* 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;
|
|
|
|
|
2020-01-08 16:58:30 +08:00
|
|
|
/* memory map */
|
|
|
|
struct mm *memory_map;
|
|
|
|
|
2020-01-08 17:29:23 +08:00
|
|
|
/* runtime power management data */
|
|
|
|
struct pm_runtime_data *prd;
|
|
|
|
|
2022-09-27 15:30:53 +08:00
|
|
|
#ifdef CONFIG_AMS
|
|
|
|
/* asynchronous messaging service */
|
|
|
|
struct ams_shared_context *ams_shared_ctx;
|
|
|
|
#endif
|
|
|
|
|
2020-01-08 19:54:17 +08:00
|
|
|
/* shared notifier data */
|
|
|
|
struct notify_data *notify_data;
|
|
|
|
|
2020-01-08 22:06:31 +08:00
|
|
|
/* platform dai information */
|
2020-01-14 20:38:18 +08:00
|
|
|
const struct dai_info *dai_info;
|
2020-01-08 22:06:31 +08:00
|
|
|
|
2020-01-08 23:09:03 +08:00
|
|
|
/* platform DMA information */
|
2020-01-14 20:44:29 +08:00
|
|
|
const struct dma_info *dma_info;
|
2020-01-08 23:09:03 +08:00
|
|
|
|
2020-01-15 23:47:32 +08:00
|
|
|
/* cascading interrupt controller root */
|
|
|
|
struct cascade_root *cascade_root;
|
|
|
|
|
2020-01-17 18:26:40 +08:00
|
|
|
/* list of registered component drivers */
|
|
|
|
struct comp_driver_list *comp_drivers;
|
|
|
|
|
2020-01-21 19:48:09 +08:00
|
|
|
/* M/N dividers */
|
|
|
|
struct mn *mn;
|
|
|
|
|
2020-02-06 17:22:52 +08:00
|
|
|
/* probes */
|
|
|
|
struct probe_pdata *probe;
|
|
|
|
|
2020-03-16 23:56:22 +08:00
|
|
|
/* pipelines stream position */
|
|
|
|
struct pipeline_posn *pipeline_posn;
|
|
|
|
|
2022-04-27 18:14:24 +08:00
|
|
|
#ifdef CONFIG_LIBRARY_MANAGER
|
|
|
|
/* dynamically loaded libraries */
|
|
|
|
struct ext_library *ext_library;
|
|
|
|
#endif
|
|
|
|
|
2022-11-23 11:16:18 +08:00
|
|
|
#if CONFIG_IPC_MAJOR_4
|
|
|
|
/* lock for fw_reg access */
|
|
|
|
struct k_spinlock fw_reg_lock;
|
|
|
|
#endif
|
|
|
|
|
2019-12-19 21:13:06 +08:00
|
|
|
__aligned(PLATFORM_DCACHE_ALIGN) int alignment[0];
|
|
|
|
} __aligned(PLATFORM_DCACHE_ALIGN);
|
2017-06-06 23:41:07 +08:00
|
|
|
|
2019-12-19 21:25:39 +08:00
|
|
|
struct sof *sof_get(void);
|
|
|
|
|
2023-02-22 01:05:47 +08:00
|
|
|
#endif /* __XTOS_RTOS_SOF_H__ */
|