summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Vehmanen <kai.vehmanen@linux.intel.com>2019-06-03 12:18:15 -0400
committerMark Brown <broonie@kernel.org>2019-06-03 12:56:38 -0400
commit14104eb6a351a5bad21fdd2cf05ca46ad5e5beab (patch)
tree8318963b9a795666a7801e09f9827a1da3c0ff53
parentd6947bb234dcc86e878d502516d0fb9d635aa2ae (diff)
ASoC: SOF: fix DSP oops definitions in FW ABI
The definitions for DSP oops structures were not aligned correctly to current FW ABI version 3.6.0, leading to invalid data being printed out to debug logs. Fix the structs and update related platform code accordingly. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--include/sound/sof/header.h21
-rw-r--r--include/sound/sof/xtensa.h9
-rw-r--r--sound/soc/sof/intel/bdw.c17
-rw-r--r--sound/soc/sof/intel/byt.c15
-rw-r--r--sound/soc/sof/intel/hda.c16
-rw-r--r--sound/soc/sof/xtensa/core.c2
6 files changed, 58 insertions, 22 deletions
diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h
index 0aeb2c8ad6fd..1efcf7b18ec2 100644
--- a/include/sound/sof/header.h
+++ b/include/sound/sof/header.h
@@ -155,6 +155,27 @@ struct sof_ipc_compound_hdr {
155 uint32_t count; /**< count of 0 means end of compound sequence */ 155 uint32_t count; /**< count of 0 means end of compound sequence */
156} __packed; 156} __packed;
157 157
158/**
159 * OOPS header architecture specific data.
160 */
161struct sof_ipc_dsp_oops_arch_hdr {
162 uint32_t arch; /* Identifier of architecture */
163 uint32_t totalsize; /* Total size of oops message */
164} __packed;
165
166/**
167 * OOPS header platform specific data.
168 */
169struct sof_ipc_dsp_oops_plat_hdr {
170 uint32_t configidhi; /* ConfigID hi 32bits */
171 uint32_t configidlo; /* ConfigID lo 32bits */
172 uint32_t numaregs; /* Special regs num */
173 uint32_t stackoffset; /* Offset to stack pointer from beginning of
174 * oops message
175 */
176 uint32_t stackptr; /* Stack ptr */
177} __packed;
178
158/** @}*/ 179/** @}*/
159 180
160#endif 181#endif
diff --git a/include/sound/sof/xtensa.h b/include/sound/sof/xtensa.h
index a7189984000d..d25c764b10e8 100644
--- a/include/sound/sof/xtensa.h
+++ b/include/sound/sof/xtensa.h
@@ -17,7 +17,8 @@
17 17
18/* Xtensa Firmware Oops data */ 18/* Xtensa Firmware Oops data */
19struct sof_ipc_dsp_oops_xtensa { 19struct sof_ipc_dsp_oops_xtensa {
20 struct sof_ipc_hdr hdr; 20 struct sof_ipc_dsp_oops_arch_hdr arch_hdr;
21 struct sof_ipc_dsp_oops_plat_hdr plat_hdr;
21 uint32_t exccause; 22 uint32_t exccause;
22 uint32_t excvaddr; 23 uint32_t excvaddr;
23 uint32_t ps; 24 uint32_t ps;
@@ -38,7 +39,11 @@ struct sof_ipc_dsp_oops_xtensa {
38 uint32_t intenable; 39 uint32_t intenable;
39 uint32_t interrupt; 40 uint32_t interrupt;
40 uint32_t sar; 41 uint32_t sar;
41 uint32_t stack; 42 uint32_t debugcause;
43 uint32_t windowbase;
44 uint32_t windowstart;
45 uint32_t excsave1;
46 uint32_t ar[];
42} __packed; 47} __packed;
43 48
44#endif 49#endif
diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c
index 8ff3ee520aea..70d524ef9bc0 100644
--- a/sound/soc/sof/intel/bdw.c
+++ b/sound/soc/sof/intel/bdw.c
@@ -220,17 +220,20 @@ static void bdw_get_registers(struct snd_sof_dev *sdev,
220 struct sof_ipc_panic_info *panic_info, 220 struct sof_ipc_panic_info *panic_info,
221 u32 *stack, size_t stack_words) 221 u32 *stack, size_t stack_words)
222{ 222{
223 /* first read regsisters */ 223 u32 offset = sdev->dsp_oops_offset;
224 sof_mailbox_read(sdev, sdev->dsp_oops_offset, xoops, sizeof(*xoops)); 224
225 /* first read registers */
226 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops));
227
228 /* note: variable AR register array is not read */
225 229
226 /* then get panic info */ 230 /* then get panic info */
227 sof_mailbox_read(sdev, sdev->dsp_oops_offset + sizeof(*xoops), 231 offset += xoops->arch_hdr.totalsize;
228 panic_info, sizeof(*panic_info)); 232 sof_mailbox_read(sdev, offset, panic_info, sizeof(*panic_info));
229 233
230 /* then get the stack */ 234 /* then get the stack */
231 sof_mailbox_read(sdev, sdev->dsp_oops_offset + sizeof(*xoops) + 235 offset += sizeof(*panic_info);
232 sizeof(*panic_info), stack, 236 sof_mailbox_read(sdev, offset, stack, stack_words * sizeof(u32));
233 stack_words * sizeof(u32));
234} 237}
235 238
236static void bdw_dump(struct snd_sof_dev *sdev, u32 flags) 239static void bdw_dump(struct snd_sof_dev *sdev, u32 flags)
diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c
index 9e4c07eb889b..39d1ae01c45d 100644
--- a/sound/soc/sof/intel/byt.c
+++ b/sound/soc/sof/intel/byt.c
@@ -265,17 +265,20 @@ static void byt_get_registers(struct snd_sof_dev *sdev,
265 struct sof_ipc_panic_info *panic_info, 265 struct sof_ipc_panic_info *panic_info,
266 u32 *stack, size_t stack_words) 266 u32 *stack, size_t stack_words)
267{ 267{
268 u32 offset = sdev->dsp_oops_offset;
269
268 /* first read regsisters */ 270 /* first read regsisters */
269 sof_mailbox_read(sdev, sdev->dsp_oops_offset, xoops, sizeof(*xoops)); 271 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops));
272
273 /* note: variable AR register array is not read */
270 274
271 /* then get panic info */ 275 /* then get panic info */
272 sof_mailbox_read(sdev, sdev->dsp_oops_offset + sizeof(*xoops), 276 offset += xoops->arch_hdr.totalsize;
273 panic_info, sizeof(*panic_info)); 277 sof_mailbox_read(sdev, offset, panic_info, sizeof(*panic_info));
274 278
275 /* then get the stack */ 279 /* then get the stack */
276 sof_mailbox_read(sdev, sdev->dsp_oops_offset + sizeof(*xoops) + 280 offset += sizeof(*panic_info);
277 sizeof(*panic_info), stack, 281 sof_mailbox_read(sdev, offset, stack, stack_words * sizeof(u32));
278 stack_words * sizeof(u32));
279} 282}
280 283
281static void byt_dump(struct snd_sof_dev *sdev, u32 flags) 284static void byt_dump(struct snd_sof_dev *sdev, u32 flags)
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index e47f03dc62f0..8f5c68861bbc 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -108,17 +108,21 @@ static void hda_dsp_get_registers(struct snd_sof_dev *sdev,
108 struct sof_ipc_panic_info *panic_info, 108 struct sof_ipc_panic_info *panic_info,
109 u32 *stack, size_t stack_words) 109 u32 *stack, size_t stack_words)
110{ 110{
111 u32 offset = sdev->dsp_oops_offset;
112
111 /* first read registers */ 113 /* first read registers */
112 sof_block_read(sdev, sdev->mmio_bar, sdev->dsp_oops_offset, xoops, 114 sof_mailbox_read(sdev, offset, xoops, sizeof(*xoops));
113 sizeof(*xoops)); 115
116 /* note: variable AR register array is not read */
114 117
115 /* then get panic info */ 118 /* then get panic info */
116 sof_block_read(sdev, sdev->mmio_bar, sdev->dsp_oops_offset + 119 offset += xoops->arch_hdr.totalsize;
117 sizeof(*xoops), panic_info, sizeof(*panic_info)); 120 sof_block_read(sdev, sdev->mmio_bar, offset,
121 panic_info, sizeof(*panic_info));
118 122
119 /* then get the stack */ 123 /* then get the stack */
120 sof_block_read(sdev, sdev->mmio_bar, sdev->dsp_oops_offset + 124 offset += sizeof(*panic_info);
121 sizeof(*xoops) + sizeof(*panic_info), stack, 125 sof_block_read(sdev, sdev->mmio_bar, offset, stack,
122 stack_words * sizeof(u32)); 126 stack_words * sizeof(u32));
123} 127}
124 128
diff --git a/sound/soc/sof/xtensa/core.c b/sound/soc/sof/xtensa/core.c
index c3ad23a85b99..46a4905a9dce 100644
--- a/sound/soc/sof/xtensa/core.c
+++ b/sound/soc/sof/xtensa/core.c
@@ -110,7 +110,7 @@ static void xtensa_stack(struct snd_sof_dev *sdev, void *oops, u32 *stack,
110 u32 stack_words) 110 u32 stack_words)
111{ 111{
112 struct sof_ipc_dsp_oops_xtensa *xoops = oops; 112 struct sof_ipc_dsp_oops_xtensa *xoops = oops;
113 u32 stack_ptr = xoops->stack; 113 u32 stack_ptr = xoops->plat_hdr.stackptr;
114 /* 4 * 8chars + 3 ws + 1 terminating NUL */ 114 /* 4 * 8chars + 3 ws + 1 terminating NUL */
115 unsigned char buf[4 * 8 + 3 + 1]; 115 unsigned char buf[4 * 8 + 3 + 1];
116 int i; 116 int i;