1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Intel SOC Telemetry Driver Header File
4 * Copyright (C) 2015, Intel Corporation.
7 #ifndef INTEL_TELEMETRY_H
8 #define INTEL_TELEMETRY_H
10 #define TELEM_MAX_EVENTS_SRAM 28
11 #define TELEM_MAX_OS_ALLOCATED_EVENTS 20
19 struct telemetry_evtlog
{
24 struct telemetry_evtconfig
{
25 /* Array of Event-IDs to Enable */
28 /* Number of Events (<29) in evtmap */
35 struct telemetry_evtmap
{
40 struct telemetry_unit_config
{
41 struct telemetry_evtmap
*telem_evts
;
49 struct telemetry_plt_config
{
50 struct telemetry_unit_config pss_config
;
51 struct telemetry_unit_config ioss_config
;
52 struct mutex telem_trace_lock
;
53 struct mutex telem_lock
;
57 struct telemetry_core_ops
{
58 int (*get_sampling_period
)(u8
*pss_min_period
, u8
*pss_max_period
,
59 u8
*ioss_min_period
, u8
*ioss_max_period
);
61 int (*get_eventconfig
)(struct telemetry_evtconfig
*pss_evtconfig
,
62 struct telemetry_evtconfig
*ioss_evtconfig
,
63 int pss_len
, int ioss_len
);
65 int (*update_events
)(struct telemetry_evtconfig pss_evtconfig
,
66 struct telemetry_evtconfig ioss_evtconfig
);
68 int (*set_sampling_period
)(u8 pss_period
, u8 ioss_period
);
70 int (*get_trace_verbosity
)(enum telemetry_unit telem_unit
,
73 int (*set_trace_verbosity
)(enum telemetry_unit telem_unit
,
76 int (*raw_read_eventlog
)(enum telemetry_unit telem_unit
,
77 struct telemetry_evtlog
*evtlog
,
78 int len
, int log_all_evts
);
80 int (*read_eventlog
)(enum telemetry_unit telem_unit
,
81 struct telemetry_evtlog
*evtlog
,
82 int len
, int log_all_evts
);
84 int (*add_events
)(u8 num_pss_evts
, u8 num_ioss_evts
,
85 u32
*pss_evtmap
, u32
*ioss_evtmap
);
87 int (*reset_events
)(void);
90 int telemetry_set_pltdata(const struct telemetry_core_ops
*ops
,
91 struct telemetry_plt_config
*pltconfig
);
93 int telemetry_clear_pltdata(void);
95 int telemetry_pltconfig_valid(void);
97 int telemetry_get_evtname(enum telemetry_unit telem_unit
,
98 const char **name
, int len
);
100 int telemetry_update_events(struct telemetry_evtconfig pss_evtconfig
,
101 struct telemetry_evtconfig ioss_evtconfig
);
103 int telemetry_add_events(u8 num_pss_evts
, u8 num_ioss_evts
,
104 u32
*pss_evtmap
, u32
*ioss_evtmap
);
106 int telemetry_reset_events(void);
108 int telemetry_get_eventconfig(struct telemetry_evtconfig
*pss_config
,
109 struct telemetry_evtconfig
*ioss_config
,
110 int pss_len
, int ioss_len
);
112 int telemetry_read_events(enum telemetry_unit telem_unit
,
113 struct telemetry_evtlog
*evtlog
, int len
);
115 int telemetry_raw_read_events(enum telemetry_unit telem_unit
,
116 struct telemetry_evtlog
*evtlog
, int len
);
118 int telemetry_read_eventlog(enum telemetry_unit telem_unit
,
119 struct telemetry_evtlog
*evtlog
, int len
);
121 int telemetry_raw_read_eventlog(enum telemetry_unit telem_unit
,
122 struct telemetry_evtlog
*evtlog
, int len
);
124 int telemetry_get_sampling_period(u8
*pss_min_period
, u8
*pss_max_period
,
125 u8
*ioss_min_period
, u8
*ioss_max_period
);
127 int telemetry_set_sampling_period(u8 pss_period
, u8 ioss_period
);
129 int telemetry_set_trace_verbosity(enum telemetry_unit telem_unit
,
132 int telemetry_get_trace_verbosity(enum telemetry_unit telem_unit
,
135 #endif /* INTEL_TELEMETRY_H */