Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2019 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: AMD
0023  *
0024  */
0025 #ifndef _DMUB_TRACE_BUFFER_H_
0026 #define _DMUB_TRACE_BUFFER_H_
0027 
0028 #include "dmub_cmd.h"
0029 
0030 #define LOAD_DMCU_FW    1
0031 #define LOAD_PHY_FW 2
0032 
0033 
0034 enum dmucb_trace_code {
0035     DMCUB__UNKNOWN,
0036     DMCUB__MAIN_BEGIN,
0037     DMCUB__PHY_INIT_BEGIN,
0038     DMCUB__PHY_FW_SRAM_LOAD_BEGIN,
0039     DMCUB__PHY_FW_SRAM_LOAD_END,
0040     DMCUB__PHY_INIT_POLL_DONE,
0041     DMCUB__PHY_INIT_END,
0042     DMCUB__DMCU_ERAM_LOAD_BEGIN,
0043     DMCUB__DMCU_ERAM_LOAD_END,
0044     DMCUB__DMCU_ISR_LOAD_BEGIN,
0045     DMCUB__DMCU_ISR_LOAD_END,
0046     DMCUB__MAIN_IDLE,
0047     DMCUB__PERF_TRACE,
0048     DMCUB__PG_DONE,
0049 };
0050 
0051 struct dmcub_trace_buf_entry {
0052     enum dmucb_trace_code trace_code;
0053     uint32_t tick_count;
0054     uint32_t param0;
0055     uint32_t param1;
0056 };
0057 
0058 #define TRACE_BUF_SIZE (1024) //1 kB
0059 #define PERF_TRACE_MAX_ENTRY ((TRACE_BUF_SIZE - 8)/sizeof(struct dmcub_trace_buf_entry))
0060 
0061 
0062 struct dmcub_trace_buf {
0063     uint32_t entry_count;
0064     uint32_t clk_freq;
0065     struct dmcub_trace_buf_entry entries[PERF_TRACE_MAX_ENTRY];
0066 };
0067 
0068 #endif /* _DMUB_TRACE_BUFFER_H_ */