Loading...
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Intel Smart Sound Technology
4 *
5 * Copyright (C) 2013, Intel Corporation. All rights reserved.
6 */
7
8#ifndef __SOUND_SOC_SST_DSP_PRIV_H
9#define __SOUND_SOC_SST_DSP_PRIV_H
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/firmware.h>
15
16#include "../skylake/skl-sst-dsp.h"
17
18struct sst_mem_block;
19struct sst_module;
20struct sst_fw;
21
22/* do we need to remove or keep */
23#define DSP_DRAM_ADDR_OFFSET 0x400000
24
25/*
26 * DSP Operations exported by platform Audio DSP driver.
27 */
28struct sst_ops {
29 /* DSP core boot / reset */
30 void (*boot)(struct sst_dsp *);
31 void (*reset)(struct sst_dsp *);
32 int (*wake)(struct sst_dsp *);
33 void (*sleep)(struct sst_dsp *);
34 void (*stall)(struct sst_dsp *);
35
36 /* Shim IO */
37 void (*write)(void __iomem *addr, u32 offset, u32 value);
38 u32 (*read)(void __iomem *addr, u32 offset);
39 void (*write64)(void __iomem *addr, u32 offset, u64 value);
40 u64 (*read64)(void __iomem *addr, u32 offset);
41
42 /* DSP I/DRAM IO */
43 void (*ram_read)(struct sst_dsp *sst, void *dest, void __iomem *src,
44 size_t bytes);
45 void (*ram_write)(struct sst_dsp *sst, void __iomem *dest, void *src,
46 size_t bytes);
47
48 void (*dump)(struct sst_dsp *);
49
50 /* IRQ handlers */
51 irqreturn_t (*irq_handler)(int irq, void *context);
52
53 /* SST init and free */
54 int (*init)(struct sst_dsp *sst, struct sst_pdata *pdata);
55 void (*free)(struct sst_dsp *sst);
56
57 /* FW module parser/loader */
58 int (*parse_fw)(struct sst_fw *sst_fw);
59};
60
61/*
62 * Audio DSP memory offsets and addresses.
63 */
64struct sst_addr {
65 u32 lpe_base;
66 u32 shim_offset;
67 u32 iram_offset;
68 u32 dram_offset;
69 u32 dsp_iram_offset;
70 u32 dsp_dram_offset;
71 u32 sram0_base;
72 u32 sram1_base;
73 u32 w0_stat_sz;
74 u32 w0_up_sz;
75 void __iomem *lpe;
76 void __iomem *shim;
77 void __iomem *pci_cfg;
78 void __iomem *fw_ext;
79};
80
81/*
82 * Audio DSP Mailbox configuration.
83 */
84struct sst_mailbox {
85 void __iomem *in_base;
86 void __iomem *out_base;
87 size_t in_size;
88 size_t out_size;
89};
90
91/*
92 * Audio DSP memory block types.
93 */
94enum sst_mem_type {
95 SST_MEM_IRAM = 0,
96 SST_MEM_DRAM = 1,
97 SST_MEM_ANY = 2,
98 SST_MEM_CACHE= 3,
99};
100
101/*
102 * Audio DSP Generic Firmware File.
103 *
104 * SST Firmware files can consist of 1..N modules. This generic structure is
105 * used to manage each firmware file and it's modules regardless of SST firmware
106 * type. A SST driver may load multiple FW files.
107 */
108struct sst_fw {
109 struct sst_dsp *dsp;
110
111 /* base addresses of FW file data */
112 dma_addr_t dmable_fw_paddr; /* physical address of fw data */
113 void *dma_buf; /* virtual address of fw data */
114 u32 size; /* size of fw data */
115
116 /* lists */
117 struct list_head list; /* DSP list of FW */
118 struct list_head module_list; /* FW list of modules */
119
120 void *private; /* core doesn't touch this */
121};
122
123/*
124 * Audio DSP Generic Module Template.
125 *
126 * Used to define and register a new FW module. This data is extracted from
127 * FW module header information.
128 */
129struct sst_module_template {
130 u32 id;
131 u32 entry; /* entry point */
132 u32 scratch_size;
133 u32 persistent_size;
134};
135
136/*
137 * Block Allocator - Used to allocate blocks of DSP memory.
138 */
139struct sst_block_allocator {
140 u32 id;
141 u32 offset;
142 int size;
143 enum sst_mem_type type;
144};
145
146/*
147 * Runtime Module Instance - A module object can be instantiated multiple
148 * times within the DSP FW.
149 */
150struct sst_module_runtime {
151 struct sst_dsp *dsp;
152 int id;
153 struct sst_module *module; /* parent module we belong too */
154
155 u32 persistent_offset; /* private memory offset */
156 void *private;
157
158 struct list_head list;
159 struct list_head block_list; /* list of blocks used */
160};
161
162/*
163 * Runtime Module Context - The runtime context must be manually stored by the
164 * driver prior to enter S3 and restored after leaving S3. This should really be
165 * part of the memory context saved by the enter D3 message IPC ???
166 */
167struct sst_module_runtime_context {
168 dma_addr_t dma_buffer;
169 u32 *buffer;
170};
171
172/*
173 * Audio DSP Module State
174 */
175enum sst_module_state {
176 SST_MODULE_STATE_UNLOADED = 0, /* default state */
177 SST_MODULE_STATE_LOADED,
178 SST_MODULE_STATE_INITIALIZED, /* and inactive */
179 SST_MODULE_STATE_ACTIVE,
180};
181
182/*
183 * Audio DSP Generic Module.
184 *
185 * Each Firmware file can consist of 1..N modules. A module can span multiple
186 * ADSP memory blocks. The simplest FW will be a file with 1 module. A module
187 * can be instantiated multiple times in the DSP.
188 */
189struct sst_module {
190 struct sst_dsp *dsp;
191 struct sst_fw *sst_fw; /* parent FW we belong too */
192
193 /* module configuration */
194 u32 id;
195 u32 entry; /* module entry point */
196 s32 offset; /* module offset in firmware file */
197 u32 size; /* module size */
198 u32 scratch_size; /* global scratch memory required */
199 u32 persistent_size; /* private memory required */
200 enum sst_mem_type type; /* destination memory type */
201 u32 data_offset; /* offset in ADSP memory space */
202 void *data; /* module data */
203
204 /* runtime */
205 u32 usage_count; /* can be unloaded if count == 0 */
206 void *private; /* core doesn't touch this */
207
208 /* lists */
209 struct list_head block_list; /* Module list of blocks in use */
210 struct list_head list; /* DSP list of modules */
211 struct list_head list_fw; /* FW list of modules */
212 struct list_head runtime_list; /* list of runtime module objects*/
213
214 /* state */
215 enum sst_module_state state;
216};
217
218/*
219 * SST Memory Block operations.
220 */
221struct sst_block_ops {
222 int (*enable)(struct sst_mem_block *block);
223 int (*disable)(struct sst_mem_block *block);
224};
225
226/*
227 * SST Generic Memory Block.
228 *
229 * SST ADP memory has multiple IRAM and DRAM blocks. Some ADSP blocks can be
230 * power gated.
231 */
232struct sst_mem_block {
233 struct sst_dsp *dsp;
234 struct sst_module *module; /* module that uses this block */
235
236 /* block config */
237 u32 offset; /* offset from base */
238 u32 size; /* block size */
239 u32 index; /* block index 0..N */
240 enum sst_mem_type type; /* block memory type IRAM/DRAM */
241 const struct sst_block_ops *ops;/* block operations, if any */
242
243 /* block status */
244 u32 bytes_used; /* bytes in use by modules */
245 void *private; /* generic core does not touch this */
246 int users; /* number of modules using this block */
247
248 /* block lists */
249 struct list_head module_list; /* Module list of blocks */
250 struct list_head list; /* Map list of free/used blocks */
251};
252
253/*
254 * Generic SST Shim Interface.
255 */
256struct sst_dsp {
257
258 /* Shared for all platforms */
259
260 /* runtime */
261 struct sst_dsp_device *sst_dev;
262 spinlock_t spinlock; /* IPC locking */
263 struct mutex mutex; /* DSP FW lock */
264 struct device *dev;
265 struct device *dma_dev;
266 void *thread_context;
267 int irq;
268 u32 id;
269
270 /* operations */
271 struct sst_ops *ops;
272
273 /* debug FS */
274 struct dentry *debugfs_root;
275
276 /* base addresses */
277 struct sst_addr addr;
278
279 /* mailbox */
280 struct sst_mailbox mailbox;
281
282 /* HSW/Byt data */
283
284 /* list of free and used ADSP memory blocks */
285 struct list_head used_block_list;
286 struct list_head free_block_list;
287
288 /* SST FW files loaded and their modules */
289 struct list_head module_list;
290 struct list_head fw_list;
291
292 /* scratch buffer */
293 struct list_head scratch_block_list;
294 u32 scratch_offset;
295 u32 scratch_size;
296
297 /* platform data */
298 struct sst_pdata *pdata;
299
300 /* DMA FW loading */
301 struct sst_dma *dma;
302 bool fw_use_dma;
303
304 /* SKL data */
305
306 const char *fw_name;
307
308 /* To allocate CL dma buffers */
309 struct skl_dsp_loader_ops dsp_ops;
310 struct skl_dsp_fw_ops fw_ops;
311 int sst_state;
312 struct skl_cl_dev cl_dev;
313 u32 intr_status;
314 const struct firmware *fw;
315 struct snd_dma_buffer dmab;
316};
317
318/* Size optimised DRAM/IRAM memcpy */
319static inline void sst_dsp_write(struct sst_dsp *sst, void *src,
320 u32 dest_offset, size_t bytes)
321{
322 sst->ops->ram_write(sst, sst->addr.lpe + dest_offset, src, bytes);
323}
324
325static inline void sst_dsp_read(struct sst_dsp *sst, void *dest,
326 u32 src_offset, size_t bytes)
327{
328 sst->ops->ram_read(sst, dest, sst->addr.lpe + src_offset, bytes);
329}
330
331static inline void *sst_dsp_get_thread_context(struct sst_dsp *sst)
332{
333 return sst->thread_context;
334}
335
336/* Create/Free FW files - can contain multiple modules */
337struct sst_fw *sst_fw_new(struct sst_dsp *dsp,
338 const struct firmware *fw, void *private);
339void sst_fw_free(struct sst_fw *sst_fw);
340void sst_fw_free_all(struct sst_dsp *dsp);
341int sst_fw_reload(struct sst_fw *sst_fw);
342void sst_fw_unload(struct sst_fw *sst_fw);
343
344/* Create/Free firmware modules */
345struct sst_module *sst_module_new(struct sst_fw *sst_fw,
346 struct sst_module_template *template, void *private);
347void sst_module_free(struct sst_module *module);
348struct sst_module *sst_module_get_from_id(struct sst_dsp *dsp, u32 id);
349int sst_module_alloc_blocks(struct sst_module *module);
350int sst_module_free_blocks(struct sst_module *module);
351
352/* Create/Free firmware module runtime instances */
353struct sst_module_runtime *sst_module_runtime_new(struct sst_module *module,
354 int id, void *private);
355void sst_module_runtime_free(struct sst_module_runtime *runtime);
356struct sst_module_runtime *sst_module_runtime_get_from_id(
357 struct sst_module *module, u32 id);
358int sst_module_runtime_alloc_blocks(struct sst_module_runtime *runtime,
359 int offset);
360int sst_module_runtime_free_blocks(struct sst_module_runtime *runtime);
361int sst_module_runtime_save(struct sst_module_runtime *runtime,
362 struct sst_module_runtime_context *context);
363int sst_module_runtime_restore(struct sst_module_runtime *runtime,
364 struct sst_module_runtime_context *context);
365
366/* generic block allocation */
367int sst_alloc_blocks(struct sst_dsp *dsp, struct sst_block_allocator *ba,
368 struct list_head *block_list);
369int sst_free_blocks(struct sst_dsp *dsp, struct list_head *block_list);
370
371/* scratch allocation */
372int sst_block_alloc_scratch(struct sst_dsp *dsp);
373void sst_block_free_scratch(struct sst_dsp *dsp);
374
375/* Register the DSPs memory blocks - would be nice to read from ACPI */
376struct sst_mem_block *sst_mem_block_register(struct sst_dsp *dsp, u32 offset,
377 u32 size, enum sst_mem_type type, const struct sst_block_ops *ops,
378 u32 index, void *private);
379void sst_mem_block_unregister_all(struct sst_dsp *dsp);
380
381u32 sst_dsp_get_offset(struct sst_dsp *dsp, u32 offset,
382 enum sst_mem_type type);
383#endif
1/*
2 * Intel Smart Sound Technology
3 *
4 * Copyright (C) 2013, Intel Corporation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 */
16
17#ifndef __SOUND_SOC_SST_DSP_PRIV_H
18#define __SOUND_SOC_SST_DSP_PRIV_H
19
20#include <linux/kernel.h>
21#include <linux/types.h>
22#include <linux/interrupt.h>
23#include <linux/firmware.h>
24
25#include "../skylake/skl-sst-dsp.h"
26
27struct sst_mem_block;
28struct sst_module;
29struct sst_fw;
30
31/* do we need to remove or keep */
32#define DSP_DRAM_ADDR_OFFSET 0x400000
33
34/*
35 * DSP Operations exported by platform Audio DSP driver.
36 */
37struct sst_ops {
38 /* DSP core boot / reset */
39 void (*boot)(struct sst_dsp *);
40 void (*reset)(struct sst_dsp *);
41 int (*wake)(struct sst_dsp *);
42 void (*sleep)(struct sst_dsp *);
43 void (*stall)(struct sst_dsp *);
44
45 /* Shim IO */
46 void (*write)(void __iomem *addr, u32 offset, u32 value);
47 u32 (*read)(void __iomem *addr, u32 offset);
48 void (*write64)(void __iomem *addr, u32 offset, u64 value);
49 u64 (*read64)(void __iomem *addr, u32 offset);
50
51 /* DSP I/DRAM IO */
52 void (*ram_read)(struct sst_dsp *sst, void *dest, void __iomem *src,
53 size_t bytes);
54 void (*ram_write)(struct sst_dsp *sst, void __iomem *dest, void *src,
55 size_t bytes);
56
57 void (*dump)(struct sst_dsp *);
58
59 /* IRQ handlers */
60 irqreturn_t (*irq_handler)(int irq, void *context);
61
62 /* SST init and free */
63 int (*init)(struct sst_dsp *sst, struct sst_pdata *pdata);
64 void (*free)(struct sst_dsp *sst);
65
66 /* FW module parser/loader */
67 int (*parse_fw)(struct sst_fw *sst_fw);
68};
69
70/*
71 * Audio DSP memory offsets and addresses.
72 */
73struct sst_addr {
74 u32 lpe_base;
75 u32 shim_offset;
76 u32 iram_offset;
77 u32 dram_offset;
78 u32 dsp_iram_offset;
79 u32 dsp_dram_offset;
80 u32 sram0_base;
81 u32 sram1_base;
82 u32 w0_stat_sz;
83 u32 w0_up_sz;
84 void __iomem *lpe;
85 void __iomem *shim;
86 void __iomem *pci_cfg;
87 void __iomem *fw_ext;
88};
89
90/*
91 * Audio DSP Mailbox configuration.
92 */
93struct sst_mailbox {
94 void __iomem *in_base;
95 void __iomem *out_base;
96 size_t in_size;
97 size_t out_size;
98};
99
100/*
101 * Audio DSP memory block types.
102 */
103enum sst_mem_type {
104 SST_MEM_IRAM = 0,
105 SST_MEM_DRAM = 1,
106 SST_MEM_ANY = 2,
107 SST_MEM_CACHE= 3,
108};
109
110/*
111 * Audio DSP Generic Firmware File.
112 *
113 * SST Firmware files can consist of 1..N modules. This generic structure is
114 * used to manage each firmware file and it's modules regardless of SST firmware
115 * type. A SST driver may load multiple FW files.
116 */
117struct sst_fw {
118 struct sst_dsp *dsp;
119
120 /* base addresses of FW file data */
121 dma_addr_t dmable_fw_paddr; /* physical address of fw data */
122 void *dma_buf; /* virtual address of fw data */
123 u32 size; /* size of fw data */
124
125 /* lists */
126 struct list_head list; /* DSP list of FW */
127 struct list_head module_list; /* FW list of modules */
128
129 void *private; /* core doesn't touch this */
130};
131
132/*
133 * Audio DSP Generic Module Template.
134 *
135 * Used to define and register a new FW module. This data is extracted from
136 * FW module header information.
137 */
138struct sst_module_template {
139 u32 id;
140 u32 entry; /* entry point */
141 u32 scratch_size;
142 u32 persistent_size;
143};
144
145/*
146 * Block Allocator - Used to allocate blocks of DSP memory.
147 */
148struct sst_block_allocator {
149 u32 id;
150 u32 offset;
151 int size;
152 enum sst_mem_type type;
153};
154
155/*
156 * Runtime Module Instance - A module object can be instanciated multiple
157 * times within the DSP FW.
158 */
159struct sst_module_runtime {
160 struct sst_dsp *dsp;
161 int id;
162 struct sst_module *module; /* parent module we belong too */
163
164 u32 persistent_offset; /* private memory offset */
165 void *private;
166
167 struct list_head list;
168 struct list_head block_list; /* list of blocks used */
169};
170
171/*
172 * Runtime Module Context - The runtime context must be manually stored by the
173 * driver prior to enter S3 and restored after leaving S3. This should really be
174 * part of the memory context saved by the enter D3 message IPC ???
175 */
176struct sst_module_runtime_context {
177 dma_addr_t dma_buffer;
178 u32 *buffer;
179};
180
181/*
182 * Audio DSP Module State
183 */
184enum sst_module_state {
185 SST_MODULE_STATE_UNLOADED = 0, /* default state */
186 SST_MODULE_STATE_LOADED,
187 SST_MODULE_STATE_INITIALIZED, /* and inactive */
188 SST_MODULE_STATE_ACTIVE,
189};
190
191/*
192 * Audio DSP Generic Module.
193 *
194 * Each Firmware file can consist of 1..N modules. A module can span multiple
195 * ADSP memory blocks. The simplest FW will be a file with 1 module. A module
196 * can be instanciated multiple times in the DSP.
197 */
198struct sst_module {
199 struct sst_dsp *dsp;
200 struct sst_fw *sst_fw; /* parent FW we belong too */
201
202 /* module configuration */
203 u32 id;
204 u32 entry; /* module entry point */
205 s32 offset; /* module offset in firmware file */
206 u32 size; /* module size */
207 u32 scratch_size; /* global scratch memory required */
208 u32 persistent_size; /* private memory required */
209 enum sst_mem_type type; /* destination memory type */
210 u32 data_offset; /* offset in ADSP memory space */
211 void *data; /* module data */
212
213 /* runtime */
214 u32 usage_count; /* can be unloaded if count == 0 */
215 void *private; /* core doesn't touch this */
216
217 /* lists */
218 struct list_head block_list; /* Module list of blocks in use */
219 struct list_head list; /* DSP list of modules */
220 struct list_head list_fw; /* FW list of modules */
221 struct list_head runtime_list; /* list of runtime module objects*/
222
223 /* state */
224 enum sst_module_state state;
225};
226
227/*
228 * SST Memory Block operations.
229 */
230struct sst_block_ops {
231 int (*enable)(struct sst_mem_block *block);
232 int (*disable)(struct sst_mem_block *block);
233};
234
235/*
236 * SST Generic Memory Block.
237 *
238 * SST ADP memory has multiple IRAM and DRAM blocks. Some ADSP blocks can be
239 * power gated.
240 */
241struct sst_mem_block {
242 struct sst_dsp *dsp;
243 struct sst_module *module; /* module that uses this block */
244
245 /* block config */
246 u32 offset; /* offset from base */
247 u32 size; /* block size */
248 u32 index; /* block index 0..N */
249 enum sst_mem_type type; /* block memory type IRAM/DRAM */
250 const struct sst_block_ops *ops;/* block operations, if any */
251
252 /* block status */
253 u32 bytes_used; /* bytes in use by modules */
254 void *private; /* generic core does not touch this */
255 int users; /* number of modules using this block */
256
257 /* block lists */
258 struct list_head module_list; /* Module list of blocks */
259 struct list_head list; /* Map list of free/used blocks */
260};
261
262/*
263 * Generic SST Shim Interface.
264 */
265struct sst_dsp {
266
267 /* Shared for all platforms */
268
269 /* runtime */
270 struct sst_dsp_device *sst_dev;
271 spinlock_t spinlock; /* IPC locking */
272 struct mutex mutex; /* DSP FW lock */
273 struct device *dev;
274 struct device *dma_dev;
275 void *thread_context;
276 int irq;
277 u32 id;
278
279 /* operations */
280 struct sst_ops *ops;
281
282 /* debug FS */
283 struct dentry *debugfs_root;
284
285 /* base addresses */
286 struct sst_addr addr;
287
288 /* mailbox */
289 struct sst_mailbox mailbox;
290
291 /* HSW/Byt data */
292
293 /* list of free and used ADSP memory blocks */
294 struct list_head used_block_list;
295 struct list_head free_block_list;
296
297 /* SST FW files loaded and their modules */
298 struct list_head module_list;
299 struct list_head fw_list;
300
301 /* scratch buffer */
302 struct list_head scratch_block_list;
303 u32 scratch_offset;
304 u32 scratch_size;
305
306 /* platform data */
307 struct sst_pdata *pdata;
308
309 /* DMA FW loading */
310 struct sst_dma *dma;
311 bool fw_use_dma;
312
313 /* SKL data */
314
315 const char *fw_name;
316
317 /* To allocate CL dma buffers */
318 struct skl_dsp_loader_ops dsp_ops;
319 struct skl_dsp_fw_ops fw_ops;
320 int sst_state;
321 struct skl_cl_dev cl_dev;
322 u32 intr_status;
323 const struct firmware *fw;
324 struct snd_dma_buffer dmab;
325};
326
327/* Size optimised DRAM/IRAM memcpy */
328static inline void sst_dsp_write(struct sst_dsp *sst, void *src,
329 u32 dest_offset, size_t bytes)
330{
331 sst->ops->ram_write(sst, sst->addr.lpe + dest_offset, src, bytes);
332}
333
334static inline void sst_dsp_read(struct sst_dsp *sst, void *dest,
335 u32 src_offset, size_t bytes)
336{
337 sst->ops->ram_read(sst, dest, sst->addr.lpe + src_offset, bytes);
338}
339
340static inline void *sst_dsp_get_thread_context(struct sst_dsp *sst)
341{
342 return sst->thread_context;
343}
344
345/* Create/Free FW files - can contain multiple modules */
346struct sst_fw *sst_fw_new(struct sst_dsp *dsp,
347 const struct firmware *fw, void *private);
348void sst_fw_free(struct sst_fw *sst_fw);
349void sst_fw_free_all(struct sst_dsp *dsp);
350int sst_fw_reload(struct sst_fw *sst_fw);
351void sst_fw_unload(struct sst_fw *sst_fw);
352
353/* Create/Free firmware modules */
354struct sst_module *sst_module_new(struct sst_fw *sst_fw,
355 struct sst_module_template *template, void *private);
356void sst_module_free(struct sst_module *module);
357struct sst_module *sst_module_get_from_id(struct sst_dsp *dsp, u32 id);
358int sst_module_alloc_blocks(struct sst_module *module);
359int sst_module_free_blocks(struct sst_module *module);
360
361/* Create/Free firmware module runtime instances */
362struct sst_module_runtime *sst_module_runtime_new(struct sst_module *module,
363 int id, void *private);
364void sst_module_runtime_free(struct sst_module_runtime *runtime);
365struct sst_module_runtime *sst_module_runtime_get_from_id(
366 struct sst_module *module, u32 id);
367int sst_module_runtime_alloc_blocks(struct sst_module_runtime *runtime,
368 int offset);
369int sst_module_runtime_free_blocks(struct sst_module_runtime *runtime);
370int sst_module_runtime_save(struct sst_module_runtime *runtime,
371 struct sst_module_runtime_context *context);
372int sst_module_runtime_restore(struct sst_module_runtime *runtime,
373 struct sst_module_runtime_context *context);
374
375/* generic block allocation */
376int sst_alloc_blocks(struct sst_dsp *dsp, struct sst_block_allocator *ba,
377 struct list_head *block_list);
378int sst_free_blocks(struct sst_dsp *dsp, struct list_head *block_list);
379
380/* scratch allocation */
381int sst_block_alloc_scratch(struct sst_dsp *dsp);
382void sst_block_free_scratch(struct sst_dsp *dsp);
383
384/* Register the DSPs memory blocks - would be nice to read from ACPI */
385struct sst_mem_block *sst_mem_block_register(struct sst_dsp *dsp, u32 offset,
386 u32 size, enum sst_mem_type type, const struct sst_block_ops *ops,
387 u32 index, void *private);
388void sst_mem_block_unregister_all(struct sst_dsp *dsp);
389
390u32 sst_dsp_get_offset(struct sst_dsp *dsp, u32 offset,
391 enum sst_mem_type type);
392#endif