1/*
2 * platform_sst_audio.h:  sst audio platform data header file
3 *
4 * Copyright (C) 2012-14 Intel Corporation
5 * Author: Jeeja KP <jeeja.kp@intel.com>
6 * 	Omair Mohammed Abdullah <omair.m.abdullah@intel.com>
7 *	Vinod Koul ,vinod.koul@intel.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; version 2
12 * of the License.
13 */
14#ifndef _PLATFORM_SST_AUDIO_H_
15#define _PLATFORM_SST_AUDIO_H_
16
17#include <linux/sfi.h>
18
19#define MAX_NUM_STREAMS_MRFLD	25
20#define MAX_NUM_STREAMS	MAX_NUM_STREAMS_MRFLD
21
22enum sst_audio_task_id_mrfld {
23	SST_TASK_ID_NONE = 0,
24	SST_TASK_ID_SBA = 1,
25	SST_TASK_ID_MEDIA = 3,
26	SST_TASK_ID_MAX = SST_TASK_ID_MEDIA,
27};
28
29/* Device IDs for Merrifield are Pipe IDs,
30 * ref: DSP spec v0.75 */
31enum sst_audio_device_id_mrfld {
32	/* Output pipeline IDs */
33	PIPE_ID_OUT_START = 0x0,
34	PIPE_CODEC_OUT0 = 0x2,
35	PIPE_CODEC_OUT1 = 0x3,
36	PIPE_SPROT_LOOP_OUT = 0x4,
37	PIPE_MEDIA_LOOP1_OUT = 0x5,
38	PIPE_MEDIA_LOOP2_OUT = 0x6,
39	PIPE_VOIP_OUT = 0xC,
40	PIPE_PCM0_OUT = 0xD,
41	PIPE_PCM1_OUT = 0xE,
42	PIPE_PCM2_OUT = 0xF,
43	PIPE_MEDIA0_OUT = 0x12,
44	PIPE_MEDIA1_OUT = 0x13,
45/* Input Pipeline IDs */
46	PIPE_ID_IN_START = 0x80,
47	PIPE_CODEC_IN0 = 0x82,
48	PIPE_CODEC_IN1 = 0x83,
49	PIPE_SPROT_LOOP_IN = 0x84,
50	PIPE_MEDIA_LOOP1_IN = 0x85,
51	PIPE_MEDIA_LOOP2_IN = 0x86,
52	PIPE_VOIP_IN = 0x8C,
53	PIPE_PCM0_IN = 0x8D,
54	PIPE_PCM1_IN = 0x8E,
55	PIPE_MEDIA0_IN = 0x8F,
56	PIPE_MEDIA1_IN = 0x90,
57	PIPE_MEDIA2_IN = 0x91,
58	PIPE_RSVD = 0xFF,
59};
60
61/* The stream map for each platform consists of an array of the below
62 * stream map structure.
63 */
64struct sst_dev_stream_map {
65	u8 dev_num;		/* device id */
66	u8 subdev_num;		/* substream */
67	u8 direction;
68	u8 device_id;		/* fw id */
69	u8 task_id;		/* fw task */
70	u8 status;
71};
72
73struct sst_platform_data {
74	/* Intel software platform id*/
75	struct sst_dev_stream_map *pdev_strm_map;
76	unsigned int strm_map_size;
77};
78
79struct sst_info {
80	u32 iram_start;
81	u32 iram_end;
82	bool iram_use;
83	u32 dram_start;
84	u32 dram_end;
85	bool dram_use;
86	u32 imr_start;
87	u32 imr_end;
88	bool imr_use;
89	u32 mailbox_start;
90	bool use_elf;
91	bool lpe_viewpt_rqd;
92	unsigned int max_streams;
93	u32 dma_max_len;
94	u8 num_probes;
95};
96
97struct sst_lib_dnld_info {
98	unsigned int mod_base;
99	unsigned int mod_end;
100	unsigned int mod_table_offset;
101	unsigned int mod_table_size;
102	bool mod_ddr_dnld;
103};
104
105struct sst_res_info {
106	unsigned int shim_offset;
107	unsigned int shim_size;
108	unsigned int shim_phy_addr;
109	unsigned int ssp0_offset;
110	unsigned int ssp0_size;
111	unsigned int dma0_offset;
112	unsigned int dma0_size;
113	unsigned int dma1_offset;
114	unsigned int dma1_size;
115	unsigned int iram_offset;
116	unsigned int iram_size;
117	unsigned int dram_offset;
118	unsigned int dram_size;
119	unsigned int mbox_offset;
120	unsigned int mbox_size;
121	unsigned int acpi_lpe_res_index;
122	unsigned int acpi_ddr_index;
123	unsigned int acpi_ipc_irq_index;
124};
125
126struct sst_ipc_info {
127	int ipc_offset;
128	unsigned int mbox_recv_off;
129};
130
131struct sst_platform_info {
132	const struct sst_info *probe_data;
133	const struct sst_ipc_info *ipc_info;
134	const struct sst_res_info *res_info;
135	const struct sst_lib_dnld_info *lib_info;
136	const char *platform;
137};
138int add_sst_platform_device(void);
139#endif
140
141