1 /* SPDX-License-Identifier: BSD-3-Clause
2  *
3  * Copyright(c) 2016 Intel Corporation. All rights reserved.
4  *
5  * Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
6  */
7 
8 #ifndef __SOF_SOF_H__
9 #define __SOF_SOF_H__
10 
11 #include <arch/sof.h>
12 #include <sof/common.h>
13 #include <sof/lib/memory.h>
14 
15 struct cascade_root;
16 struct clock_info;
17 struct comp_driver_list;
18 struct dai_info;
19 struct dma_info;
20 struct dma_trace_data;
21 struct ipc;
22 struct ll_schedule_domain;
23 struct mm;
24 struct mn;
25 struct notify_data;
26 struct pm_runtime_data;
27 struct sa;
28 struct timer;
29 struct trace;
30 struct pipeline_posn;
31 struct probe_pdata;
32 
33 /**
34  * \brief General firmware context.
35  * This structure holds all the global pointers, which can potentially
36  * be accessed by SMP code, hence it should be aligned to platform's
37  * data cache line size. Alignments in the both beginning and end are needed
38  * to avoid potential before and after data evictions.
39  */
40 struct sof {
41 	/* init data */
42 	int argc;
43 	char **argv;
44 
45 	/* ipc */
46 	struct ipc *ipc;
47 
48 	/* system agent */
49 	struct sa *sa;
50 
51 	/* DMA for Trace*/
52 	struct dma_trace_data *dmat;
53 
54 	/* generic trace structure */
55 	struct trace *trace;
56 
57 	/* platform clock information */
58 	struct clock_info *clocks;
59 
60 	/* default platform timer */
61 	struct timer *platform_timer;
62 
63 	/* cpu (arch) timers - 1 per core */
64 	struct timer *cpu_timers;
65 
66 	/* timer domain for driving timer LL scheduler */
67 	struct ll_schedule_domain *platform_timer_domain;
68 
69 	/* DMA domain for driving DMA LL scheduler */
70 	struct ll_schedule_domain *platform_dma_domain;
71 
72 	/* memory map */
73 	struct mm *memory_map;
74 
75 	/* runtime power management data */
76 	struct pm_runtime_data *prd;
77 
78 	/* shared notifier data */
79 	struct notify_data *notify_data;
80 
81 	/* platform dai information */
82 	const struct dai_info *dai_info;
83 
84 	/* platform DMA information */
85 	const struct dma_info *dma_info;
86 
87 	/* cascading interrupt controller root */
88 	struct cascade_root *cascade_root;
89 
90 	/* list of registered component drivers */
91 	struct comp_driver_list *comp_drivers;
92 
93 	/* M/N dividers */
94 	struct mn *mn;
95 
96 	/* probes */
97 	struct probe_pdata *probe;
98 
99 	/* pipelines stream position */
100 	struct pipeline_posn *pipeline_posn;
101 
102 	__aligned(PLATFORM_DCACHE_ALIGN) int alignment[0];
103 } __aligned(PLATFORM_DCACHE_ALIGN);
104 
105 struct sof *sof_get(void);
106 
107 #endif /* __SOF_SOF_H__ */
108