xref: /linux/sound/soc/sof/amd/acp.h (revision d880c62788399ba31da6f41a21194b10e32aee0b)
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
2 /*
3  * This file is provided under a dual BSD/GPLv2 license. When using or
4  * redistributing this file, you may do so under either license.
5  *
6  * Copyright(c) 2021, 2023 Advanced Micro Devices, Inc. All rights reserved.
7  *
8  * Author: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
9  */
10 
11 #ifndef __SOF_AMD_ACP_H
12 #define __SOF_AMD_ACP_H
13 
14 #include <linux/dmi.h>
15 #include <linux/soundwire/sdw_amd.h>
16 #include "../sof-priv.h"
17 #include "../sof-audio.h"
18 
19 #define ACP_MAX_STREAM	8
20 
21 #define ACP_DSP_BAR	0
22 
23 #define ACP_HW_SEM_RETRY_COUNT			10000
24 #define ACP_REG_POLL_INTERVAL                   500
25 #define ACP_REG_POLL_TIMEOUT_US                 2000
26 #define ACP_DMA_COMPLETE_TIMEOUT_US		5000
27 
28 #define ACP3X_PGFSM_CNTL_POWER_ON_MASK		0x01
29 #define ACP3X_PGFSM_STATUS_MASK			0x03
30 #define ACP6X_PGFSM_CNTL_POWER_ON_MASK		0x07
31 #define ACP6X_PGFSM_STATUS_MASK			0x0F
32 #define ACP70_PGFSM_CNTL_POWER_ON_MASK		0x1F
33 #define ACP70_PGFSM_STATUS_MASK			0xFF
34 
35 #define ACP_POWERED_ON				0x00
36 #define ACP_ASSERT_RESET			0x01
37 #define ACP_RELEASE_RESET			0x00
38 #define ACP_SOFT_RESET_DONE_MASK		0x00010001
39 #define ACP_DSP_ASSERT_RESET			0x04
40 #define ACP_DSP_RELEASE_RESET			0x00
41 #define ACP_DSP_SOFT_RESET_DONE_MASK		0x00050004
42 
43 #define ACP_DSP_INTR_EN_MASK			0x00000001
44 #define ACP3X_SRAM_PTE_OFFSET			0x02050000
45 #define ACP5X_SRAM_PTE_OFFSET			0x02050000
46 #define ACP6X_SRAM_PTE_OFFSET			0x03800000
47 #define ACP70_SRAM_PTE_OFFSET			ACP6X_SRAM_PTE_OFFSET
48 #define PAGE_SIZE_4K_ENABLE			0x2
49 #define ACP_PAGE_SIZE				0x1000
50 #define ACP_DMA_CH_RUN				0x02
51 #define ACP_MAX_DESC_CNT			0x02
52 #define ACP_DSP_RUN				0x00
53 #define DSP_FW_RUN_ENABLE			0x01
54 #define ACP_SHA_RUN				0x01
55 #define ACP_SHA_RESET				0x02
56 #define ACP_SHA_HEADER				0x01
57 /* SHA_IOC_En (bit 2): interrupt-on-completion to ASP; must be set alongside sha_run */
58 #define ACP_SHA_IOC_EN				0x04
59 #define ACP_SHA_RUN_WITH_IOC			(ACP_SHA_RUN | ACP_SHA_IOC_EN)
60 #define ACP_DMA_CH_RST				0x01
61 #define ACP_DMA_CH_GRACEFUL_RST_EN		0x10
62 #define ACP_ATU_CACHE_INVALID			0x01
63 #define ACP_MAX_DESC				128
64 #define ACPBUS_REG_BASE_OFFSET			ACP_DMA_CNTL_0
65 
66 #define ACP_DEFAULT_DRAM_LENGTH			0x00080000
67 #define ACP3X_SCRATCH_MEMORY_ADDRESS		0x02050000
68 #define ACP_SYSTEM_MEMORY_WINDOW		0x4000000
69 #define ACP_IRAM_BASE_ADDRESS			0x000000
70 #define ACP_DRAM_BASE_ADDRESS			0x01000000
71 #define ACP_DRAM_PAGE_COUNT			128
72 #define ACP_SRAM_BASE_ADDRESS			0x3806000
73 #define ACP7X_SRAM_BASE_ADDRESS			0x380C000
74 #define ACP_DSP_TO_HOST_IRQ			0x04
75 
76 #define ACP_RN_PCI_ID				0x01
77 #define ACP_VANGOGH_PCI_ID			0x50
78 #define ACP_RMB_PCI_ID				0x6F
79 #define ACP63_PCI_ID				0x63
80 #define ACP70_PCI_ID				0x70
81 #define ACP71_PCI_ID				0x71
82 #define ACP72_PCI_ID				0x72
83 #define ACP7B_PCI_ID				0x7B
84 #define ACP7F_PCI_ID				0x7F
85 
86 #define ACP7X_PGFSM_CNTL_POWER_ON_MASK		0x7F
87 #define ACP7X_PGFSM_STATUS_MASK			0xFFF
88 #define ACP7X_SRAM_PTE_OFFSET			ACP6X_SRAM_PTE_OFFSET
89 
90 #define HOST_BRIDGE_CZN				0x1630
91 #define HOST_BRIDGE_VGH				0x1645
92 #define HOST_BRIDGE_RMB				0x14B5
93 #define HOST_BRIDGE_ACP63			0x14E8
94 #define HOST_BRIDGE_ACP70			0x1507
95 #define ACP_SHA_STAT				0x8000
96 #define ACP_PSP_TIMEOUT_US			1000000
97 #define ACP_EXT_INTR_ERROR_STAT			0x20000000
98 #define MP0_C2PMSG_114_REG			0x3810AC8
99 #define MP0_C2PMSG_73_REG			0x3810A24
100 #define MP0_C2PMSG_63_REG			0x38109FC
101 #define MP0_C2PMSG_63_FW_SIGN_ALT		BIT(6)
102 #define MBOX_ACP_SHA_DMA_COMMAND		0x70000
103 #define MBOX_ACP_IRAM_DRAM_FENCE_COMMAND	0x80000
104 #define MBOX_DELAY_US				1000
105 #define MBOX_READY_MASK				0x80000000
106 #define MBOX_STATUS_MASK			0xFFFF
107 #define MBOX_ISREADY_FLAG			0x40000000
108 #define IRAM_DRAM_FENCE_0			0X0
109 #define IRAM_DRAM_FENCE_1			0X01
110 #define IRAM_DRAM_FENCE_2			0X02
111 
112 #define BOX_SIZE_512				0x200
113 #define BOX_SIZE_1024				0x400
114 
115 #define EXCEPT_MAX_HDR_SIZE			0x400
116 #define AMD_STACK_DUMP_SIZE			32
117 
118 #define SRAM1_SIZE				0x280000
119 #define PROBE_STATUS_BIT			BIT(31)
120 
121 #define ACP_FIRMWARE_SIGNATURE			0x100
122 #define ACP_IMAGE_HEADER_SIZE			ACP_FIRMWARE_SIGNATURE
123 #define ACP_IMAGE_HDR_SIZE_FW_SIGNED_OFF	0x14
124 #define ACP_ASP_SIGNATURE_LENGTH		512
125 
126 /*
127  * ACP7.B/7.F carveout: 32 MB region mapped at 2 MB page granularity.
128  * Use AXI2AXIATU_PAGE_SIZE_Mask2MB (value 0x0) for carveout ATU
129  * groups giving 32MB / 2MB = 16 PTEs. 4KB pages would require 8192 PTEs and
130  * is not how the hardware carveout path is configured.
131  */
132 #define ACP7X_CARVEOUT_MAX_SIZE			(32 * SZ_1M)
133 #define ACP7X_CARVEOUT_PAGE_SIZE		(2 * SZ_1M)
134 #define ACP7X_CARVEOUT_PAGE_COUNT		(ACP7X_CARVEOUT_MAX_SIZE / ACP7X_CARVEOUT_PAGE_SIZE)
135 /*
136  * PTE high-word flags for ATU entries:
137  *   bit[31]: PAGE_Enable  - entry is valid
138  *   bit[30]: MALL_Enable  - route accesses through carveout (MALL) memory,
139  *            not standard DRAM. Required for ASP to recognise the SHA DMA
140  *            source as within the carveout and grant ACP_SHA_DSP_FW_QUALIFIER.
141  *            (PAGE_Enable | MALL_Enable ATU entry flags)
142  */
143 #define ACP_ATU_PTE_PAGE_ENABLE			BIT(31)
144 #define ACP_ATU_PTE_MALL_ENABLE			BIT(30)
145 #define ACP_ATU_PTE_CARVEOUT_FLAGS		(ACP_ATU_PTE_PAGE_ENABLE | ACP_ATU_PTE_MALL_ENABLE)
146 
147 #define ACP_ERROR_IRQ_MASK			BIT(29)
148 #define ACP_SDW0_IRQ_MASK			BIT(21)
149 #define ACP_SDW1_IRQ_MASK			BIT(2)
150 #define SDW_ACPI_ADDR_ACP63			5
151 #define SDW_ACPI_ADDR_ACP70			SDW_ACPI_ADDR_ACP63
152 #define ACP_DEFAULT_SRAM_LENGTH			0x00080000
153 #define ACP_SRAM_PAGE_COUNT			128
154 #define ACP6X_SDW_MAX_MANAGER_COUNT		2
155 #define ACP70_SDW_MAX_MANAGER_COUNT		ACP6X_SDW_MAX_MANAGER_COUNT
156 /* ACPI _DSD acp-audio-ep-port values for PDM controller selection */
157 #define ACP_DEV_PORT_PDM			4
158 #define ACP_DEV_PORT_PDM2			5
159 #define SDW_ACPI_ADDR_ACP7X			SDW_ACPI_ADDR_ACP63
160 #define ACP7X_SDW_MAX_MANAGER_COUNT		4
161 
162 /* ACPI child device address for the ACP7x PDM/DMIC device */
163 #define ACP7X_DMIC_ADDR				2
164 #define ACP_DSP_MSG_SET				1
165 #define ACP_DSP_ACK_SET				1
166 
167 /*
168  * ATU PTE group ACP logical address offsets.
169  * Each group covers 8 MB (0x00800000).  Groups 1-8 are used for PCM
170  * streams; groups 9-16 are extended groups.
171  *
172  *   GRP_N_OFFSET = (N - 1) * 8 MB
173  */
174 #define PTE_GRP1_OFFSET		0x00000000
175 #define PTE_GRP2_OFFSET		0x00800000
176 #define PTE_GRP3_OFFSET		0x01000000
177 #define PTE_GRP4_OFFSET		0x01800000
178 #define PTE_GRP5_OFFSET		0x02000000
179 #define PTE_GRP6_OFFSET		0x02800000
180 #define PTE_GRP7_OFFSET		0x03000000
181 #define PTE_GRP8_OFFSET		0x03800000
182 #define PTE_GRP9_OFFSET		0x04000000
183 #define PTE_GRP10_OFFSET	0x04800000
184 #define PTE_GRP11_OFFSET	0x05000000
185 #define PTE_GRP12_OFFSET	0x05800000
186 #define PTE_GRP13_OFFSET	0x06000000
187 #define PTE_GRP14_OFFSET	0x06800000
188 #define PTE_GRP15_OFFSET	0x07000000
189 #define PTE_GRP16_OFFSET	0x07800000
190 
191 enum clock_source {
192 	ACP_CLOCK_96M = 0,
193 	ACP_CLOCK_48M,
194 	ACP_CLOCK_24M,
195 	ACP_CLOCK_ACLK,
196 	ACP_CLOCK_MCLK,
197 };
198 
199 struct  acp_atu_grp_pte {
200 	u32 low;
201 	u32 high;
202 };
203 
204 /* ASP mailbox payload for GET_CARVEOUT_ADDR command (0x04) */
205 struct asp_get_carveout_payload {
206 	u32 cookie;		/* [0x00] Driver: ASP_MBOX_COOKIE */
207 	u32 status;		/* [0x04] ASP:    0 = success */
208 	u64 carveout_addr;	/* [0x08] ASP:    carveout physical base address */
209 	u32 carveout_size;	/* [0x10] ASP:    ACP_MALL_SIZE register value */
210 	u32 mall_addr_valid;	/* [0x14] ASP:    ACP_MALL_ADDR_VALID register value */
211 	u32 mall_valid;		/* [0x18] ASP:    ACP_MALL_VALID register value */
212 };
213 
214 /*
215  * ASP mailbox payload for VALIDATE_IMAGE command (0x01).
216  * Driver fills src/dest fields; ASP fills carveout_dest_addr and status.
217  */
218 struct asp_validate_image_payload {
219 	u32 cookie;		/* [0x00] Driver: ASP_MBOX_COOKIE */
220 	u32 status;		/* [0x04] ASP:    0 = success */
221 	u64 carveout_dest_addr;	/* [0x08] ASP:    physical addr of raw binary in carveout */
222 	u64 dest_offset;	/* [0x10] Driver: destination offset within carveout */
223 	u64 src_phys_addr;	/* [0x18] Driver: signed FW source physical addr in DDR */
224 	u32 fw_image_size;	/* [0x20] Driver: total signed image size in bytes */
225 };
226 
227 union dma_tx_cnt {
228 	struct {
229 		unsigned int count : 19;
230 		unsigned int reserved : 12;
231 		unsigned ioc : 1;
232 	} bitfields, bits;
233 	unsigned int u32_all;
234 	signed int i32_all;
235 };
236 
237 struct dma_descriptor {
238 	unsigned int src_addr;
239 	unsigned int dest_addr;
240 	union dma_tx_cnt tx_cnt;
241 	unsigned int reserved;
242 };
243 
244 /* Scratch memory structure for communication b/w host and dsp */
245 struct  scratch_ipc_conf {
246 	/* Debug memory */
247 	u8 sof_debug_box[1024];
248 	/* Exception memory*/
249 	u8 sof_except_box[1024];
250 	/* Stream buffer */
251 	u8 sof_stream_box[1024];
252 	/* Trace buffer */
253 	u8 sof_trace_box[1024];
254 	/* Host msg flag */
255 	u32 sof_host_msg_write;
256 	/* Host ack flag*/
257 	u32 sof_host_ack_write;
258 	/* DSP msg flag */
259 	u32 sof_dsp_msg_write;
260 	/* Dsp ack flag */
261 	u32 sof_dsp_ack_write;
262 };
263 
264 struct  scratch_reg_conf {
265 	struct scratch_ipc_conf info;
266 	struct acp_atu_grp_pte grp1_pte[16];
267 	struct acp_atu_grp_pte grp2_pte[16];
268 	struct acp_atu_grp_pte grp3_pte[16];
269 	struct acp_atu_grp_pte grp4_pte[16];
270 	struct acp_atu_grp_pte grp5_pte[16];
271 	struct acp_atu_grp_pte grp6_pte[16];
272 	struct acp_atu_grp_pte grp7_pte[16];
273 	struct acp_atu_grp_pte grp8_pte[16];
274 	struct dma_descriptor dma_desc[64];
275 	unsigned int reg_offset[8];
276 	unsigned int buf_size[8];
277 	u8 acp_tx_fifo_buf[256];
278 	u8 acp_rx_fifo_buf[256];
279 	unsigned int    reserve[];
280 };
281 
282 struct acp_dsp_stream {
283 	struct list_head list;
284 	struct snd_sof_dev *sdev;
285 	struct snd_pcm_substream *substream;
286 	struct snd_dma_buffer *dmab;
287 	int num_pages;
288 	int stream_tag;
289 	int active;
290 	unsigned int reg_offset;
291 	size_t posn_offset;
292 	struct snd_compr_stream *cstream;
293 	u64 cstream_posn;
294 };
295 
296 struct sof_amd_acp_desc {
297 	const char *name;
298 	u32 pgfsm_base;
299 	u32 ext_intr_enb;
300 	u32 ext_intr_cntl;
301 	u32 ext_intr_stat;
302 	u32 ext_intr_stat1;
303 	u32 dsp_intr_base;
304 	u32 sram_pte_offset;
305 	u32 hw_semaphore_offset;
306 	u32 acp_clkmux_sel;
307 	u32 fusion_dsp_offset;
308 	u32 probe_reg_offset;
309 	u32 reg_start_addr;
310 	u32 reg_end_addr;
311 	u32 acp_error_stat;
312 	u32 acp_sw0_i2s_err_reason;
313 	u32 sdw_max_link_count;
314 	u64 sdw_acpi_dev_addr;
315 };
316 
317 struct acp_quirk_entry {
318 	bool signed_fw_image;
319 	bool skip_iram_dram_size_mod;
320 	bool post_fw_run_delay;
321 };
322 
323 /* Common device data struct for ACP devices */
324 struct acp_dev_data {
325 	struct snd_sof_dev  *dev;
326 	const struct firmware *fw_dbin;
327 	/* DMIC device */
328 	struct platform_device *dmic_dev;
329 	/* mutex lock to protect ACP common registers access */
330 	struct mutex acp_lock;
331 	/* ACPI information stored between scan and probe steps */
332 	struct sdw_amd_acpi_info info;
333 	/* sdw context allocated by SoundWire driver */
334 	struct sdw_amd_ctx *sdw;
335 	unsigned int fw_bin_size;
336 	unsigned int fw_data_bin_size;
337 	unsigned int fw_sram_data_bin_size;
338 	const char *fw_code_bin;
339 	const char *fw_data_bin;
340 	const char *fw_sram_data_bin;
341 	u32 fw_bin_page_count;
342 	u32 fw_data_bin_page_count;
343 	u32 addr;
344 	u32 reg_range;
345 	u32 blk_type;
346 	dma_addr_t sha_dma_addr;
347 	u8 *bin_buf;
348 	dma_addr_t dma_addr;
349 	u8 *data_buf;
350 	dma_addr_t sram_dma_addr;
351 	u8 *sram_data_buf;
352 	struct acp_quirk_entry *quirks;
353 	struct dma_descriptor dscr_info[ACP_MAX_DESC];
354 	struct acp_dsp_stream stream_buf[ACP_MAX_STREAM];
355 	struct acp_dsp_stream *dtrace_stream;
356 	struct acp_dsp_stream *probe_stream;
357 	bool enable_fw_debug;
358 	bool is_dram_in_use;
359 	bool is_sram_in_use;
360 	bool sdw_en_stat;
361 	/* acp70_sdw0_wake_event flag set to true when wake irq asserted for SW0 instance */
362 	bool acp70_sdw0_wake_event;
363 	/* acp70_sdw1_wake_event flag set to true when wake irq asserted for SW1 instance */
364 	bool acp70_sdw1_wake_event;
365 	/* per-manager wake event flags; indexed by SoundWire manager instance (0-3) */
366 	bool acp7x_sdw_wake_event[ACP7X_SDW_MAX_MANAGER_COUNT];
367 	/* PDM controller index selected from ACPI acp-audio-ep-port; passed to machine driver */
368 	unsigned int pdm_sel;
369 	bool is_sdw_dev;
370 	unsigned int pci_rev;
371 	u32 subsystem_vendor;
372 	u32 subsystem_device;
373 	int acp_sof_signed_firmware_image;
374 	/* ACP7.F ASP carveout firmware load state */
375 	u64  asp_carveout_base;
376 	u32  asp_carveout_size;
377 	u32  asp_carveout_group_start;  /* first ATU group index for carveout (from ASP) */
378 	u32  asp_carveout_group_count;  /* number of consecutive ATU groups for carveout */
379 	/*
380 	 * Physical address and raw size of each validated DSP code binary
381 	 * within the carveout region (returned by ASP VALIDATE_IMAGE).
382 	 * Preserved across suspend/resume so that SHA DMA can reload DSP IRAM
383 	 * from the carveout without re-authenticating from disk.
384 	 */
385 	u64  fw_code_carveout_addr;
386 	u32  fw_code_raw_size;
387 	/* Real CPU physical address of the ASP MPASP mailbox payload page */
388 	phys_addr_t asp_mbox_buf_phys;
389 	void       *asp_mbox_buf;
390 	/*
391 	 * SHA DMA completion for the carveout path.
392 	 * ACP_SHA_STAT (bit 15 of ACP_EXTERNAL_INTR_STAT) has no dedicated
393 	 * mask bit in ACP_EXTERNAL_INTR_CNTL - it is always enabled by default.
394 	 * SHA DMA is triggered exclusively during firmware loading, so no
395 	 * spurious ACP_SHA_STAT interrupts are expected outside that window.
396 	 * acp7x_irq_handler signals sha_dma_complete when ACP_SHA_STAT fires;
397 	 * configure_and_run_sha_dma() waits on it before polling
398 	 * ACP_SHA_DSP_FW_QUALIFIER to ensure ASP has validated the source.
399 	 */
400 	struct completion sha_dma_complete;
401 };
402 
403 void memcpy_to_scratch(struct snd_sof_dev *sdev, u32 offset, unsigned int *src, size_t bytes);
404 void memcpy_from_scratch(struct snd_sof_dev *sdev, u32 offset, unsigned int *dst, size_t bytes);
405 
406 int acp_dma_status(struct acp_dev_data *adata, unsigned char ch);
407 int configure_and_run_dma(struct acp_dev_data *adata, unsigned int src_addr,
408 			  unsigned int dest_addr, int dsp_data_size);
409 int configure_and_run_sha_dma(struct acp_dev_data *adata, void *image_addr,
410 			      unsigned int start_addr, unsigned int dest_addr,
411 			      unsigned int image_length);
412 
413 /* ACP device probe/remove */
414 int amd_sof_acp_probe(struct snd_sof_dev *sdev);
415 void amd_sof_acp_remove(struct snd_sof_dev *sdev);
416 
417 /* DSP Loader callbacks */
418 int acp_sof_dsp_run(struct snd_sof_dev *sdev);
419 int acp_dsp_pre_fw_run(struct snd_sof_dev *sdev);
420 int acp_sof_load_signed_firmware(struct snd_sof_dev *sdev);
421 int acp_get_bar_index(struct snd_sof_dev *sdev, u32 type);
422 
423 /* ACP7.B/7.F ASP carveout firmware load helper functions */
424 int acp7x_query_asp_carveout(struct snd_sof_dev *sdev);
425 int acp7x_load_firmware_carveout(struct snd_sof_dev *sdev);
426 int acp7x_configure_carveout_pte(struct snd_sof_dev *sdev);
427 
428 /* Block IO callbacks */
429 int acp_dsp_block_write(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type,
430 			u32 offset, void *src, size_t size);
431 int acp_dsp_block_read(struct snd_sof_dev *sdev, enum snd_sof_fw_blk_type blk_type,
432 		       u32 offset, void *dest, size_t size);
433 
434 /* IPC callbacks */
435 irqreturn_t acp_sof_ipc_irq_thread(int irq, void *context);
436 int acp_sof_ipc_msg_data(struct snd_sof_dev *sdev, struct snd_sof_pcm_stream *sps,
437 			 void *p, size_t sz);
438 int acp_set_stream_data_offset(struct snd_sof_dev *sdev,
439 			       struct snd_sof_pcm_stream *sps,
440 			       size_t posn_offset);
441 int acp_sof_ipc_send_msg(struct snd_sof_dev *sdev,
442 			 struct snd_sof_ipc_msg *msg);
443 int acp_sof_ipc_get_mailbox_offset(struct snd_sof_dev *sdev);
444 int acp_sof_ipc_get_window_offset(struct snd_sof_dev *sdev, u32 id);
445 void acp_mailbox_write(struct snd_sof_dev *sdev, u32 offset, void *message, size_t bytes);
446 void acp_mailbox_read(struct snd_sof_dev *sdev, u32 offset, void *message, size_t bytes);
447 
448 /* ACP - DSP  stream callbacks */
449 int acp_dsp_stream_config(struct snd_sof_dev *sdev, struct acp_dsp_stream *stream);
450 int acp_dsp_stream_init(struct snd_sof_dev *sdev);
451 struct acp_dsp_stream *acp_dsp_stream_get(struct snd_sof_dev *sdev, int tag);
452 int acp_dsp_stream_put(struct snd_sof_dev *sdev, struct acp_dsp_stream *acp_stream);
453 
454 /*
455  * DSP PCM Operations.
456  */
457 int acp_pcm_open(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream);
458 int acp_pcm_close(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream);
459 int acp_pcm_hw_params(struct snd_sof_dev *sdev, struct snd_pcm_substream *substream,
460 		      struct snd_pcm_hw_params *params,
461 		      struct snd_sof_platform_stream_params *platform_params);
462 snd_pcm_uframes_t acp_pcm_pointer(struct snd_sof_dev *sdev,
463 				  struct snd_pcm_substream *substream);
464 
465 extern const struct snd_sof_dsp_ops sof_acp_common_ops;
466 
467 extern struct snd_sof_dsp_ops sof_renoir_ops;
468 int sof_renoir_ops_init(struct snd_sof_dev *sdev);
469 extern struct snd_sof_dsp_ops sof_vangogh_ops;
470 int sof_vangogh_ops_init(struct snd_sof_dev *sdev);
471 extern struct snd_sof_dsp_ops sof_rembrandt_ops;
472 int sof_rembrandt_ops_init(struct snd_sof_dev *sdev);
473 extern struct snd_sof_dsp_ops sof_acp63_ops;
474 int sof_acp63_ops_init(struct snd_sof_dev *sdev);
475 
476 extern struct snd_sof_dsp_ops sof_acp70_ops;
477 int sof_acp70_ops_init(struct snd_sof_dev *sdev);
478 
479 extern struct snd_sof_dsp_ops sof_acp7x_ops;
480 int sof_acp7x_ops_init(struct snd_sof_dev *sdev);
481 
482 int amd_sof_acp7x_probe(struct snd_sof_dev *sdev);
483 void amd_sof_acp7x_remove(struct snd_sof_dev *sdev);
484 int amd_sof_acp7x_suspend(struct snd_sof_dev *sdev, u32 target_state);
485 int amd_sof_acp7x_resume(struct snd_sof_dev *sdev);
486 int amd_sof_acp7x_suspend_runtime(struct snd_sof_dev *sdev);
487 int amd_sof_acp7x_resume_runtime(struct snd_sof_dev *sdev);
488 
489 struct snd_soc_acpi_mach *amd_sof_machine_select(struct snd_sof_dev *sdev);
490 /* Machine configuration */
491 int snd_amd_acp_find_config(struct pci_dev *pci);
492 
493 /* Trace */
494 int acp_sof_trace_init(struct snd_sof_dev *sdev, struct snd_dma_buffer *dmab,
495 		       struct sof_ipc_dma_trace_params_ext *dtrace_params);
496 int acp_sof_trace_release(struct snd_sof_dev *sdev);
497 
498 /* PM Callbacks */
499 int amd_sof_acp_suspend(struct snd_sof_dev *sdev, u32 target_state);
500 int amd_sof_acp_resume(struct snd_sof_dev *sdev);
501 
502 void amd_sof_ipc_dump(struct snd_sof_dev *sdev);
503 void amd_sof_dump(struct snd_sof_dev *sdev, u32 flags);
504 
505 static inline const struct sof_amd_acp_desc *get_chip_info(struct snd_sof_pdata *pdata)
506 {
507 	const struct sof_dev_desc *desc = pdata->desc;
508 
509 	return desc->chip_info;
510 }
511 
512 int acp_probes_register(struct snd_sof_dev *sdev);
513 void acp_probes_unregister(struct snd_sof_dev *sdev);
514 
515 extern struct snd_soc_acpi_mach snd_soc_acpi_amd_vangogh_sof_machines[];
516 extern const struct dmi_system_id acp_sof_quirk_table[];
517 #endif
518