hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/hwtracing/intel_th/msu.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Intel(R) Trace Hub Memory Storage Unit (MSU) data structures
44 *
....@@ -11,6 +11,7 @@
1111 enum {
1212 REG_MSU_MSUPARAMS = 0x0000,
1313 REG_MSU_MSUSTS = 0x0008,
14
+ REG_MSU_MINTCTL = 0x0004, /* MSU-global interrupt control */
1415 REG_MSU_MSC0CTL = 0x0100, /* MSC0 control */
1516 REG_MSU_MSC0STS = 0x0104, /* MSC0 status */
1617 REG_MSU_MSC0BAR = 0x0108, /* MSC0 output base address */
....@@ -28,6 +29,8 @@
2829
2930 /* MSUSTS bits */
3031 #define MSUSTS_MSU_INT BIT(0)
32
+#define MSUSTS_MSC0BLAST BIT(16)
33
+#define MSUSTS_MSC1BLAST BIT(24)
3134
3235 /* MSCnCTL bits */
3336 #define MSC_EN BIT(0)
....@@ -36,13 +39,10 @@
3639 #define MSC_MODE (BIT(4) | BIT(5))
3740 #define MSC_LEN (BIT(8) | BIT(9) | BIT(10))
3841
39
-/* MSC operating modes (MSC_MODE) */
40
-enum {
41
- MSC_MODE_SINGLE = 0,
42
- MSC_MODE_MULTI,
43
- MSC_MODE_EXI,
44
- MSC_MODE_DEBUG,
45
-};
42
+/* MINTCTL bits */
43
+#define MICDE BIT(0)
44
+#define M0BLIE BIT(16)
45
+#define M1BLIE BIT(24)
4646
4747 /* MSCnSTS bits */
4848 #define MSCSTS_WRAPSTAT BIT(1) /* Wrap occurred */
....@@ -85,9 +85,19 @@
8585 return bdesc->valid_dw * 4 - MSC_BDESC;
8686 }
8787
88
+static inline unsigned long msc_total_sz(struct msc_block_desc *bdesc)
89
+{
90
+ return bdesc->valid_dw * 4;
91
+}
92
+
93
+static inline unsigned long msc_block_sz(struct msc_block_desc *bdesc)
94
+{
95
+ return bdesc->block_sz * 64 - MSC_BDESC;
96
+}
97
+
8898 static inline bool msc_block_wrapped(struct msc_block_desc *bdesc)
8999 {
90
- if (bdesc->hw_tag & MSC_HW_TAG_BLOCKWRAP)
100
+ if (bdesc->hw_tag & (MSC_HW_TAG_BLOCKWRAP | MSC_HW_TAG_WINWRAP))
91101 return true;
92102
93103 return false;
....@@ -96,7 +106,7 @@
96106 static inline bool msc_block_last_written(struct msc_block_desc *bdesc)
97107 {
98108 if ((bdesc->hw_tag & MSC_HW_TAG_ENDBIT) ||
99
- (msc_data_sz(bdesc) != DATA_IN_PAGE))
109
+ (msc_data_sz(bdesc) != msc_block_sz(bdesc)))
100110 return true;
101111
102112 return false;