xref: /openbmc/linux/include/trace/events/fsi_master_gpio.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
21247cf7aSJeremy Kerr 
31247cf7aSJeremy Kerr #undef TRACE_SYSTEM
41247cf7aSJeremy Kerr #define TRACE_SYSTEM fsi_master_gpio
51247cf7aSJeremy Kerr 
61247cf7aSJeremy Kerr #if !defined(_TRACE_FSI_MASTER_GPIO_H) || defined(TRACE_HEADER_MULTI_READ)
71247cf7aSJeremy Kerr #define _TRACE_FSI_MASTER_GPIO_H
81247cf7aSJeremy Kerr 
91247cf7aSJeremy Kerr #include <linux/tracepoint.h>
101247cf7aSJeremy Kerr 
111247cf7aSJeremy Kerr TRACE_EVENT(fsi_master_gpio_in,
121247cf7aSJeremy Kerr 	TP_PROTO(const struct fsi_master_gpio *master, int bits, uint64_t msg),
131247cf7aSJeremy Kerr 	TP_ARGS(master, bits, msg),
141247cf7aSJeremy Kerr 	TP_STRUCT__entry(
151247cf7aSJeremy Kerr 		__field(int,	master_idx)
161247cf7aSJeremy Kerr 		__field(int,	bits)
171247cf7aSJeremy Kerr 		__field(uint64_t, msg)
181247cf7aSJeremy Kerr 	),
191247cf7aSJeremy Kerr 	TP_fast_assign(
201247cf7aSJeremy Kerr 		__entry->master_idx = master->master.idx;
211247cf7aSJeremy Kerr 		__entry->bits = bits;
221247cf7aSJeremy Kerr 		__entry->msg  = msg & ((1ull<<bits) - 1);
231247cf7aSJeremy Kerr 	),
241247cf7aSJeremy Kerr 	TP_printk("fsi-gpio%d => %0*llx[%d]",
251247cf7aSJeremy Kerr 		__entry->master_idx,
261247cf7aSJeremy Kerr 		(__entry->bits + 3) / 4,
271247cf7aSJeremy Kerr 		__entry->msg,
281247cf7aSJeremy Kerr 		__entry->bits
291247cf7aSJeremy Kerr 	)
301247cf7aSJeremy Kerr );
311247cf7aSJeremy Kerr 
321247cf7aSJeremy Kerr TRACE_EVENT(fsi_master_gpio_out,
331247cf7aSJeremy Kerr 	TP_PROTO(const struct fsi_master_gpio *master, int bits, uint64_t msg),
341247cf7aSJeremy Kerr 	TP_ARGS(master, bits, msg),
351247cf7aSJeremy Kerr 	TP_STRUCT__entry(
361247cf7aSJeremy Kerr 		__field(int,	master_idx)
371247cf7aSJeremy Kerr 		__field(int,	bits)
381247cf7aSJeremy Kerr 		__field(uint64_t, msg)
391247cf7aSJeremy Kerr 	),
401247cf7aSJeremy Kerr 	TP_fast_assign(
411247cf7aSJeremy Kerr 		__entry->master_idx = master->master.idx;
421247cf7aSJeremy Kerr 		__entry->bits = bits;
431247cf7aSJeremy Kerr 		__entry->msg  = msg & ((1ull<<bits) - 1);
441247cf7aSJeremy Kerr 	),
451247cf7aSJeremy Kerr 	TP_printk("fsi-gpio%d <= %0*llx[%d]",
461247cf7aSJeremy Kerr 		__entry->master_idx,
471247cf7aSJeremy Kerr 		(__entry->bits + 3) / 4,
481247cf7aSJeremy Kerr 		__entry->msg,
491247cf7aSJeremy Kerr 		__entry->bits
501247cf7aSJeremy Kerr 	)
511247cf7aSJeremy Kerr );
521247cf7aSJeremy Kerr 
53*777fd524SBenjamin Herrenschmidt TRACE_EVENT(fsi_master_gpio_clock_zeros,
54*777fd524SBenjamin Herrenschmidt 	TP_PROTO(const struct fsi_master_gpio *master, int clocks),
55*777fd524SBenjamin Herrenschmidt 	TP_ARGS(master, clocks),
56*777fd524SBenjamin Herrenschmidt 	TP_STRUCT__entry(
57*777fd524SBenjamin Herrenschmidt 		__field(int,	master_idx)
58*777fd524SBenjamin Herrenschmidt 		__field(int,	clocks)
59*777fd524SBenjamin Herrenschmidt 	),
60*777fd524SBenjamin Herrenschmidt 	TP_fast_assign(
61*777fd524SBenjamin Herrenschmidt 		__entry->master_idx = master->master.idx;
62*777fd524SBenjamin Herrenschmidt 		__entry->clocks = clocks;
63*777fd524SBenjamin Herrenschmidt 	),
64*777fd524SBenjamin Herrenschmidt 	TP_printk("fsi-gpio%d clock %d zeros",
65*777fd524SBenjamin Herrenschmidt 		  __entry->master_idx, __entry->clocks
66*777fd524SBenjamin Herrenschmidt 	)
67*777fd524SBenjamin Herrenschmidt );
68*777fd524SBenjamin Herrenschmidt 
691247cf7aSJeremy Kerr TRACE_EVENT(fsi_master_gpio_break,
701247cf7aSJeremy Kerr 	TP_PROTO(const struct fsi_master_gpio *master),
711247cf7aSJeremy Kerr 	TP_ARGS(master),
721247cf7aSJeremy Kerr 	TP_STRUCT__entry(
731247cf7aSJeremy Kerr 		__field(int,	master_idx)
741247cf7aSJeremy Kerr 	),
751247cf7aSJeremy Kerr 	TP_fast_assign(
761247cf7aSJeremy Kerr 		__entry->master_idx = master->master.idx;
771247cf7aSJeremy Kerr 	),
781247cf7aSJeremy Kerr 	TP_printk("fsi-gpio%d ----break---",
791247cf7aSJeremy Kerr 		__entry->master_idx
801247cf7aSJeremy Kerr 	)
811247cf7aSJeremy Kerr );
821247cf7aSJeremy Kerr 
834e56828aSBenjamin Herrenschmidt TRACE_EVENT(fsi_master_gpio_crc_cmd_error,
844e56828aSBenjamin Herrenschmidt 	TP_PROTO(const struct fsi_master_gpio *master),
854e56828aSBenjamin Herrenschmidt 	TP_ARGS(master),
864e56828aSBenjamin Herrenschmidt 	TP_STRUCT__entry(
874e56828aSBenjamin Herrenschmidt 		__field(int,	master_idx)
884e56828aSBenjamin Herrenschmidt 	),
894e56828aSBenjamin Herrenschmidt 	TP_fast_assign(
904e56828aSBenjamin Herrenschmidt 		__entry->master_idx = master->master.idx;
914e56828aSBenjamin Herrenschmidt 	),
924e56828aSBenjamin Herrenschmidt 	TP_printk("fsi-gpio%d ----CRC command retry---",
934e56828aSBenjamin Herrenschmidt 		__entry->master_idx
944e56828aSBenjamin Herrenschmidt 	)
954e56828aSBenjamin Herrenschmidt );
964e56828aSBenjamin Herrenschmidt 
974e56828aSBenjamin Herrenschmidt TRACE_EVENT(fsi_master_gpio_crc_rsp_error,
984e56828aSBenjamin Herrenschmidt 	TP_PROTO(const struct fsi_master_gpio *master),
994e56828aSBenjamin Herrenschmidt 	TP_ARGS(master),
1004e56828aSBenjamin Herrenschmidt 	TP_STRUCT__entry(
1014e56828aSBenjamin Herrenschmidt 		__field(int,	master_idx)
1024e56828aSBenjamin Herrenschmidt 	),
1034e56828aSBenjamin Herrenschmidt 	TP_fast_assign(
1044e56828aSBenjamin Herrenschmidt 		__entry->master_idx = master->master.idx;
1054e56828aSBenjamin Herrenschmidt 	),
1064e56828aSBenjamin Herrenschmidt 	TP_printk("fsi-gpio%d ----CRC response---",
1074e56828aSBenjamin Herrenschmidt 		__entry->master_idx
1084e56828aSBenjamin Herrenschmidt 	)
1094e56828aSBenjamin Herrenschmidt );
110918da951SAndrew Jeffery 
111918da951SAndrew Jeffery TRACE_EVENT(fsi_master_gpio_poll_response_busy,
112918da951SAndrew Jeffery 	TP_PROTO(const struct fsi_master_gpio *master, int busy),
113918da951SAndrew Jeffery 	TP_ARGS(master, busy),
114918da951SAndrew Jeffery 	TP_STRUCT__entry(
115918da951SAndrew Jeffery 		__field(int,	master_idx)
116918da951SAndrew Jeffery 		__field(int,	busy)
117918da951SAndrew Jeffery 	),
118918da951SAndrew Jeffery 	TP_fast_assign(
119918da951SAndrew Jeffery 		__entry->master_idx = master->master.idx;
120918da951SAndrew Jeffery 		__entry->busy = busy;
121918da951SAndrew Jeffery 	),
122918da951SAndrew Jeffery 	TP_printk("fsi-gpio%d: device reported busy %d times",
123918da951SAndrew Jeffery 		__entry->master_idx, __entry->busy)
124918da951SAndrew Jeffery );
125918da951SAndrew Jeffery 
126*777fd524SBenjamin Herrenschmidt TRACE_EVENT(fsi_master_gpio_cmd_abs_addr,
127*777fd524SBenjamin Herrenschmidt 	TP_PROTO(const struct fsi_master_gpio *master, u32 addr),
128*777fd524SBenjamin Herrenschmidt 	TP_ARGS(master, addr),
129*777fd524SBenjamin Herrenschmidt 	TP_STRUCT__entry(
130*777fd524SBenjamin Herrenschmidt 		__field(int,	master_idx)
131*777fd524SBenjamin Herrenschmidt 		__field(u32,	addr)
132*777fd524SBenjamin Herrenschmidt 	),
133*777fd524SBenjamin Herrenschmidt 	TP_fast_assign(
134*777fd524SBenjamin Herrenschmidt 		__entry->master_idx = master->master.idx;
135*777fd524SBenjamin Herrenschmidt 		__entry->addr = addr;
136*777fd524SBenjamin Herrenschmidt 	),
137*777fd524SBenjamin Herrenschmidt 	TP_printk("fsi-gpio%d: Sending ABS_ADR %06x",
138*777fd524SBenjamin Herrenschmidt 		__entry->master_idx, __entry->addr)
139*777fd524SBenjamin Herrenschmidt );
140*777fd524SBenjamin Herrenschmidt 
141*777fd524SBenjamin Herrenschmidt TRACE_EVENT(fsi_master_gpio_cmd_rel_addr,
142*777fd524SBenjamin Herrenschmidt 	TP_PROTO(const struct fsi_master_gpio *master, u32 rel_addr),
143*777fd524SBenjamin Herrenschmidt 	TP_ARGS(master, rel_addr),
144*777fd524SBenjamin Herrenschmidt 	TP_STRUCT__entry(
145*777fd524SBenjamin Herrenschmidt 		__field(int,	master_idx)
146*777fd524SBenjamin Herrenschmidt 		__field(u32,	rel_addr)
147*777fd524SBenjamin Herrenschmidt 	),
148*777fd524SBenjamin Herrenschmidt 	TP_fast_assign(
149*777fd524SBenjamin Herrenschmidt 		__entry->master_idx = master->master.idx;
150*777fd524SBenjamin Herrenschmidt 		__entry->rel_addr = rel_addr;
151*777fd524SBenjamin Herrenschmidt 	),
152*777fd524SBenjamin Herrenschmidt 	TP_printk("fsi-gpio%d: Sending REL_ADR %03x",
153*777fd524SBenjamin Herrenschmidt 		__entry->master_idx, __entry->rel_addr)
154*777fd524SBenjamin Herrenschmidt );
155*777fd524SBenjamin Herrenschmidt 
156*777fd524SBenjamin Herrenschmidt TRACE_EVENT(fsi_master_gpio_cmd_same_addr,
157*777fd524SBenjamin Herrenschmidt 	TP_PROTO(const struct fsi_master_gpio *master),
158*777fd524SBenjamin Herrenschmidt 	TP_ARGS(master),
159*777fd524SBenjamin Herrenschmidt 	TP_STRUCT__entry(
160*777fd524SBenjamin Herrenschmidt 		__field(int,	master_idx)
161*777fd524SBenjamin Herrenschmidt 	),
162*777fd524SBenjamin Herrenschmidt 	TP_fast_assign(
163*777fd524SBenjamin Herrenschmidt 		__entry->master_idx = master->master.idx;
164*777fd524SBenjamin Herrenschmidt 	),
165*777fd524SBenjamin Herrenschmidt 	TP_printk("fsi-gpio%d: Sending SAME_ADR",
166*777fd524SBenjamin Herrenschmidt 		__entry->master_idx)
167*777fd524SBenjamin Herrenschmidt );
168*777fd524SBenjamin Herrenschmidt 
1691247cf7aSJeremy Kerr #endif /* _TRACE_FSI_MASTER_GPIO_H */
1701247cf7aSJeremy Kerr 
1711247cf7aSJeremy Kerr #include <trace/define_trace.h>
172