summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-06-03 13:38:15 -0400
committerMark Brown <broonie@kernel.org>2019-06-03 13:38:15 -0400
commita529819d8876fd469f58e630ed015c4a4620ee75 (patch)
tree99666fbde477efd814c9328bd685a9d6ea208393
parent663580695611b9c3837cdf596de2194234f0fbd5 (diff)
parent14104eb6a351a5bad21fdd2cf05ca46ad5e5beab (diff)
Merge branch 'asoc-5.2' into asoc-5.3
-rw-r--r--include/sound/sof/header.h23
-rw-r--r--include/sound/sof/info.h20
-rw-r--r--include/sound/sof/xtensa.h9
-rw-r--r--include/uapi/sound/sof/abi.h2
-rw-r--r--sound/pci/hda/hda_codec.c9
-rw-r--r--sound/soc/codecs/rt5670.c12
-rw-r--r--sound/soc/intel/common/soc-acpi-intel-byt-match.c17
-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/ipc.c11
-rw-r--r--sound/soc/sof/xtensa/core.c2
12 files changed, 115 insertions, 38 deletions
diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h
index ccb6a004b37b..1efcf7b18ec2 100644
--- a/include/sound/sof/header.h
+++ b/include/sound/sof/header.h
@@ -48,6 +48,7 @@
48#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U) 48#define SOF_IPC_FW_READY SOF_GLB_TYPE(0x7U)
49#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U) 49#define SOF_IPC_GLB_DAI_MSG SOF_GLB_TYPE(0x8U)
50#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U) 50#define SOF_IPC_GLB_TRACE_MSG SOF_GLB_TYPE(0x9U)
51#define SOF_IPC_GLB_GDB_DEBUG SOF_GLB_TYPE(0xAU)
51 52
52/* 53/*
53 * DSP Command Message Types 54 * DSP Command Message Types
@@ -78,6 +79,7 @@
78#define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002) 79#define SOF_IPC_COMP_GET_VALUE SOF_CMD_TYPE(0x002)
79#define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003) 80#define SOF_IPC_COMP_SET_DATA SOF_CMD_TYPE(0x003)
80#define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004) 81#define SOF_IPC_COMP_GET_DATA SOF_CMD_TYPE(0x004)
82#define SOF_IPC_COMP_NOTIFICATION SOF_CMD_TYPE(0x005)
81 83
82/* DAI messages */ 84/* DAI messages */
83#define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001) 85#define SOF_IPC_DAI_CONFIG SOF_CMD_TYPE(0x001)
@@ -153,6 +155,27 @@ struct sof_ipc_compound_hdr {
153 uint32_t count; /**< count of 0 means end of compound sequence */ 155 uint32_t count; /**< count of 0 means end of compound sequence */
154} __packed; 156} __packed;
155 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
156/** @}*/ 179/** @}*/
157 180
158#endif 181#endif
diff --git a/include/sound/sof/info.h b/include/sound/sof/info.h
index 21dae04d8183..16528d2b4a50 100644
--- a/include/sound/sof/info.h
+++ b/include/sound/sof/info.h
@@ -18,6 +18,14 @@
18 18
19#define SOF_IPC_MAX_ELEMS 16 19#define SOF_IPC_MAX_ELEMS 16
20 20
21/*
22 * Firmware boot info flag bits (64-bit)
23 */
24#define SOF_IPC_INFO_BUILD BIT(0)
25#define SOF_IPC_INFO_LOCKS BIT(1)
26#define SOF_IPC_INFO_LOCKSV BIT(2)
27#define SOF_IPC_INFO_GDB BIT(3)
28
21/* extended data types that can be appended onto end of sof_ipc_fw_ready */ 29/* extended data types that can be appended onto end of sof_ipc_fw_ready */
22enum sof_ipc_ext_data { 30enum sof_ipc_ext_data {
23 SOF_IPC_EXT_DMA_BUFFER = 0, 31 SOF_IPC_EXT_DMA_BUFFER = 0,
@@ -49,16 +57,8 @@ struct sof_ipc_fw_ready {
49 uint32_t hostbox_size; 57 uint32_t hostbox_size;
50 struct sof_ipc_fw_version version; 58 struct sof_ipc_fw_version version;
51 59
52 /* Miscellaneous debug flags showing build/debug features enabled */ 60 /* Miscellaneous flags */
53 union { 61 uint64_t flags;
54 uint64_t reserved;
55 struct {
56 uint64_t build:1;
57 uint64_t locks:1;
58 uint64_t locks_verbose:1;
59 uint64_t gdb:1;
60 } bits;
61 } debug;
62 62
63 /* reserved for future use */ 63 /* reserved for future use */
64 uint32_t reserved[4]; 64 uint32_t reserved[4];
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/include/uapi/sound/sof/abi.h b/include/uapi/sound/sof/abi.h
index 13a4eca04577..0868eb47acf7 100644
--- a/include/uapi/sound/sof/abi.h
+++ b/include/uapi/sound/sof/abi.h
@@ -26,7 +26,7 @@
26 26
27/* SOF ABI version major, minor and patch numbers */ 27/* SOF ABI version major, minor and patch numbers */
28#define SOF_ABI_MAJOR 3 28#define SOF_ABI_MAJOR 3
29#define SOF_ABI_MINOR 5 29#define SOF_ABI_MINOR 6
30#define SOF_ABI_PATCH 0 30#define SOF_ABI_PATCH 0
31 31
32/* SOF ABI version number. Format within 32bit word is MMmmmppp */ 32/* SOF ABI version number. Format within 32bit word is MMmmmppp */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b20eb7fc83eb..fcdf2cd3783b 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -840,7 +840,14 @@ static int snd_hda_codec_dev_free(struct snd_device *device)
840 if (codec->core.type == HDA_DEV_LEGACY) 840 if (codec->core.type == HDA_DEV_LEGACY)
841 snd_hdac_device_unregister(&codec->core); 841 snd_hdac_device_unregister(&codec->core);
842 codec_display_power(codec, false); 842 codec_display_power(codec, false);
843 put_device(hda_codec_dev(codec)); 843
844 /*
845 * In the case of ASoC HD-audio bus, the device refcount is released in
846 * snd_hdac_ext_bus_device_remove() explicitly.
847 */
848 if (codec->core.type == HDA_DEV_LEGACY)
849 put_device(hda_codec_dev(codec));
850
844 return 0; 851 return 0;
845} 852}
846 853
diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c
index 9a037108b1ae..a746e11ccfe3 100644
--- a/sound/soc/codecs/rt5670.c
+++ b/sound/soc/codecs/rt5670.c
@@ -2882,6 +2882,18 @@ static const struct dmi_system_id dmi_platform_intel_quirks[] = {
2882 RT5670_DEV_GPIO | 2882 RT5670_DEV_GPIO |
2883 RT5670_JD_MODE3), 2883 RT5670_JD_MODE3),
2884 }, 2884 },
2885 {
2886 .callback = rt5670_quirk_cb,
2887 .ident = "Aegex 10 tablet (RU2)",
2888 .matches = {
2889 DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
2890 DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
2891 },
2892 .driver_data = (unsigned long *)(RT5670_DMIC_EN |
2893 RT5670_DMIC2_INR |
2894 RT5670_DEV_GPIO |
2895 RT5670_JD_MODE3),
2896 },
2885 {} 2897 {}
2886}; 2898};
2887 2899
diff --git a/sound/soc/intel/common/soc-acpi-intel-byt-match.c b/sound/soc/intel/common/soc-acpi-intel-byt-match.c
index 9cc7b17e0b10..81fd72ad6925 100644
--- a/sound/soc/intel/common/soc-acpi-intel-byt-match.c
+++ b/sound/soc/intel/common/soc-acpi-intel-byt-match.c
@@ -22,6 +22,7 @@ static unsigned long byt_machine_id;
22 22
23#define BYT_THINKPAD_10 1 23#define BYT_THINKPAD_10 1
24#define BYT_POV_P1006W 2 24#define BYT_POV_P1006W 2
25#define BYT_AEGEX_10 3
25 26
26static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id) 27static int byt_thinkpad10_quirk_cb(const struct dmi_system_id *id)
27{ 28{
@@ -35,6 +36,12 @@ static int byt_pov_p1006w_quirk_cb(const struct dmi_system_id *id)
35 return 1; 36 return 1;
36} 37}
37 38
39static int byt_aegex10_quirk_cb(const struct dmi_system_id *id)
40{
41 byt_machine_id = BYT_AEGEX_10;
42 return 1;
43}
44
38static const struct dmi_system_id byt_table[] = { 45static const struct dmi_system_id byt_table[] = {
39 { 46 {
40 .callback = byt_thinkpad10_quirk_cb, 47 .callback = byt_thinkpad10_quirk_cb,
@@ -75,9 +82,18 @@ static const struct dmi_system_id byt_table[] = {
75 DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"), 82 DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"),
76 }, 83 },
77 }, 84 },
85 {
86 /* Aegex 10 tablet (RU2) */
87 .callback = byt_aegex10_quirk_cb,
88 .matches = {
89 DMI_MATCH(DMI_SYS_VENDOR, "AEGEX"),
90 DMI_MATCH(DMI_PRODUCT_VERSION, "RU2"),
91 },
92 },
78 { } 93 { }
79}; 94};
80 95
96/* The Thinkapd 10 and Aegex 10 tablets have the same ID problem */
81static struct snd_soc_acpi_mach byt_thinkpad_10 = { 97static struct snd_soc_acpi_mach byt_thinkpad_10 = {
82 .id = "10EC5640", 98 .id = "10EC5640",
83 .drv_name = "cht-bsw-rt5672", 99 .drv_name = "cht-bsw-rt5672",
@@ -104,6 +120,7 @@ static struct snd_soc_acpi_mach *byt_quirk(void *arg)
104 120
105 switch (byt_machine_id) { 121 switch (byt_machine_id) {
106 case BYT_THINKPAD_10: 122 case BYT_THINKPAD_10:
123 case BYT_AEGEX_10:
107 return &byt_thinkpad_10; 124 return &byt_thinkpad_10;
108 case BYT_POV_P1006W: 125 case BYT_POV_P1006W:
109 return &byt_pov_p1006w; 126 return &byt_pov_p1006w;
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 8765eedfcf54..107d711efc3f 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 92c546e93400..bb5f02f4e49a 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/ipc.c b/sound/soc/sof/ipc.c
index 10304a90cf25..2414640a32d1 100644
--- a/sound/soc/sof/ipc.c
+++ b/sound/soc/sof/ipc.c
@@ -763,16 +763,19 @@ int snd_sof_ipc_valid(struct snd_sof_dev *sdev)
763 } 763 }
764 } 764 }
765 765
766 if (ready->debug.bits.build) { 766 if (ready->flags & SOF_IPC_INFO_BUILD) {
767 dev_info(sdev->dev, 767 dev_info(sdev->dev,
768 "Firmware debug build %d on %s-%s - options:\n" 768 "Firmware debug build %d on %s-%s - options:\n"
769 " GDB: %s\n" 769 " GDB: %s\n"
770 " lock debug: %s\n" 770 " lock debug: %s\n"
771 " lock vdebug: %s\n", 771 " lock vdebug: %s\n",
772 v->build, v->date, v->time, 772 v->build, v->date, v->time,
773 ready->debug.bits.gdb ? "enabled" : "disabled", 773 ready->flags & SOF_IPC_INFO_GDB ?
774 ready->debug.bits.locks ? "enabled" : "disabled", 774 "enabled" : "disabled",
775 ready->debug.bits.locks_verbose ? "enabled" : "disabled"); 775 ready->flags & SOF_IPC_INFO_LOCKS ?
776 "enabled" : "disabled",
777 ready->flags & SOF_IPC_INFO_LOCKSV ?
778 "enabled" : "disabled");
776 } 779 }
777 780
778 /* copy the fw_version into debugfs at first boot */ 781 /* copy the fw_version into debugfs at first boot */
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;