Skip to content

Commit f21b6bd

Browse files
committed
logging: Move trace class definitions to uapi/logging.h
Move definitions into header that would be shared between SOF and SOFT. Paste SOF_ABI_VERSION into FW ready message. Also remove unused code from uapi/logging.h. Signed-off-by: ArturX Kloniecki <arturx.kloniecki@linux.intel.com>
1 parent 6ec8bce commit f21b6bd

6 files changed

Lines changed: 33 additions & 70 deletions

File tree

src/include/sof/trace.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -80,33 +80,6 @@
8080
#define TRACE_BOOT_PLATFORM_DMIC (TRACE_BOOT_PLATFORM + 0x1a0)
8181
#define TRACE_BOOT_PLATFORM_IDC (TRACE_BOOT_PLATFORM + 0x1b0)
8282

83-
/* trace event classes - high 8 bits*/
84-
#define TRACE_CLASS_IRQ (1 << 24)
85-
#define TRACE_CLASS_IPC (2 << 24)
86-
#define TRACE_CLASS_PIPE (3 << 24)
87-
#define TRACE_CLASS_HOST (4 << 24)
88-
#define TRACE_CLASS_DAI (5 << 24)
89-
#define TRACE_CLASS_DMA (6 << 24)
90-
#define TRACE_CLASS_SSP (7 << 24)
91-
#define TRACE_CLASS_COMP (8 << 24)
92-
#define TRACE_CLASS_WAIT (9 << 24)
93-
#define TRACE_CLASS_LOCK (10 << 24)
94-
#define TRACE_CLASS_MEM (11 << 24)
95-
#define TRACE_CLASS_MIXER (12 << 24)
96-
#define TRACE_CLASS_BUFFER (13 << 24)
97-
#define TRACE_CLASS_VOLUME (14 << 24)
98-
#define TRACE_CLASS_SWITCH (15 << 24)
99-
#define TRACE_CLASS_MUX (16 << 24)
100-
#define TRACE_CLASS_SRC (17 << 24)
101-
#define TRACE_CLASS_TONE (18 << 24)
102-
#define TRACE_CLASS_EQ_FIR (19 << 24)
103-
#define TRACE_CLASS_EQ_IIR (20 << 24)
104-
#define TRACE_CLASS_SA (21 << 24)
105-
#define TRACE_CLASS_DMIC (22 << 24)
106-
#define TRACE_CLASS_POWER (23 << 24)
107-
#define TRACE_CLASS_IDC (24 << 24)
108-
#define TRACE_CLASS_CPU (25 << 24)
109-
11083
/* move to config.h */
11184
#define TRACE 1
11285
#define TRACEV 0

src/include/uapi/ipc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,8 @@ struct sof_ipc_fw_version {
892892
uint8_t date[12];
893893
uint8_t time[10];
894894
uint8_t tag[6];
895-
uint8_t pad[2]; /* Make sure the total size is 4 bytes aligned */
895+
uint16_t abi_version;
896+
/* Make sure the total size is 4 bytes aligned */
896897
} __attribute__((packed));
897898

898899
/* FW ready Message - sent by firmware when boot has completed */

src/include/uapi/logging.h

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -49,52 +49,38 @@ struct system_time {
4949
uint32_t val_u; /* Upper dword of current host time value */
5050
};
5151

52+
/* trace event classes - high 8 bits*/
53+
#define TRACE_CLASS_IRQ (1 << 24)
54+
#define TRACE_CLASS_IPC (2 << 24)
55+
#define TRACE_CLASS_PIPE (3 << 24)
56+
#define TRACE_CLASS_HOST (4 << 24)
57+
#define TRACE_CLASS_DAI (5 << 24)
58+
#define TRACE_CLASS_DMA (6 << 24)
59+
#define TRACE_CLASS_SSP (7 << 24)
60+
#define TRACE_CLASS_COMP (8 << 24)
61+
#define TRACE_CLASS_WAIT (9 << 24)
62+
#define TRACE_CLASS_LOCK (10 << 24)
63+
#define TRACE_CLASS_MEM (11 << 24)
64+
#define TRACE_CLASS_MIXER (12 << 24)
65+
#define TRACE_CLASS_BUFFER (13 << 24)
66+
#define TRACE_CLASS_VOLUME (14 << 24)
67+
#define TRACE_CLASS_SWITCH (15 << 24)
68+
#define TRACE_CLASS_MUX (16 << 24)
69+
#define TRACE_CLASS_SRC (17 << 24)
70+
#define TRACE_CLASS_TONE (18 << 24)
71+
#define TRACE_CLASS_EQ_FIR (19 << 24)
72+
#define TRACE_CLASS_EQ_IIR (20 << 24)
73+
#define TRACE_CLASS_SA (21 << 24)
74+
#define TRACE_CLASS_DMIC (22 << 24)
75+
#define TRACE_CLASS_POWER (23 << 24)
76+
#define TRACE_CLASS_IDC (24 << 24)
77+
#define TRACE_CLASS_CPU (25 << 24)
78+
5279
#define LOG_ENABLE 1 /* Enable logging */
5380
#define LOG_DISABLE 0 /* Disable logging */
5481

5582
#define LOG_LEVEL_CRITICAL 1 /* (FDK fatal) */
56-
#define LOG_LEVEL_HIGH 2 /* (FDK error) */
57-
#define LOG_LEVEL_MEDIUM 3 /* (FDK warning) */
58-
#define LOG_LEVEL_LOW 4
59-
#define LOG_LEVEL_VERBOSE 5
60-
61-
/*
62-
* Logging configuration per single core.
63-
*
64-
* (cavs: LogState).
65-
*/
66-
struct log_state_core {
67-
uint32_t enabled; /* LOG_ENABLE / LOG_DISABLE */
68-
uint32_t level; /* Logging level, one of LOG_LEVEL_. */
69-
};
70-
71-
/*
72-
* Logging settings.
73-
*
74-
* Aging timer period pecifies how frequently FW sends Log Buffer Status
75-
* notification for new entries in case the usual notification sending
76-
* criteria are not met (half of the buffer is full).
77-
*
78-
* FIFO full timer period specifies the latency of logging 'dropped log
79-
* entries' information after the content is consumed by the driver but no
80-
* new log entry appears (which would trigger logging 'dropped entries' as
81-
* well).
82-
*
83-
* Core mask indicates which cores are targeted by the message.
84-
* Bit[i] set to 1 means that configuration for i-th core, specified in
85-
* logs_core[i] is valid.
86-
*
87-
* Logs core array specifies logging settings for each core. i-th entry is
88-
* processed by FW only if bit[i] of core_mask is set.
89-
*
90-
* (cavs: LogStateInfo).
91-
*/
92-
struct log_state {
93-
uint32_t aging_timer_period; /* Aging timer period */
94-
uint32_t fifo_full_timer_period; /* FIFO full timer period */
95-
uint32_t core_mask; /* Mask of cores */
96-
struct log_state_core logs_core[0]; /* Logging state per core */
97-
};
83+
#define LOG_LEVEL_VERBOSE 2
9884

9985
/*
10086
* Layout of a log fifo.

src/platform/baytrail/platform.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ static const struct sof_ipc_fw_ready ready = {
6969
.date = __DATE__,
7070
.time = __TIME__,
7171
.tag = SOF_TAG,
72+
.abi_version = SOF_ABI_VERSION,
7273
},
7374
/* TODO: add capabilities */
7475
};

src/platform/haswell/platform.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static const struct sof_ipc_fw_ready ready = {
6868
.date = __DATE__,
6969
.time = __TIME__,
7070
.tag = SOF_TAG,
71+
.abi_version = SOF_ABI_VERSION,
7172
},
7273
/* TODO: add capabilities */
7374
};

src/platform/intel/cavs/platform.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ static const struct sof_ipc_fw_ready ready = {
7777
.date = __DATE__,
7878
.time = __TIME__,
7979
.tag = SOF_TAG,
80+
.abi_version = SOF_ABI_VERSION,
8081
},
8182
};
8283

0 commit comments

Comments
 (0)