summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlawomir Blauciak <slawomir.blauciak@linux.intel.com>2019-06-03 12:20:32 -0400
committerMark Brown <broonie@kernel.org>2019-06-03 12:42:50 -0400
commit347d1c4b0779cbeabaebb9b8e9967afe28db22f1 (patch)
tree5ade08993252379907be43b8a92646ee2cb744ab
parentf86588302360e01fd0e0a4fc1a8d1b05e85e5173 (diff)
ASoC: SOF: ipc: replace fw ready bitfield with explicit bit ordering
Previously the structure used bitfields, which do not guarantee bit ordering. This change makes sure the order is clearly defined. It also renames and repurposes the field for general use. Signed-off-by: Slawomir Blauciak <slawomir.blauciak@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/info.h20
-rw-r--r--sound/soc/sof/ipc.c11
2 files changed, 17 insertions, 14 deletions
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/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 */