forked from linux-msm/debugcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsm8998.c
253 lines (235 loc) · 9.94 KB
/
msm8998.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
// SPDX-License-Identifier: BSD-3-Clause
/* Copyright (c) 2022, Linaro Limited */
#include <sys/mman.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "debugcc.h"
static struct debug_mux gcc = {
.phys = 0x100000,
.size = 0xb0000,
.enable_reg = 0x62000,
.enable_mask = BIT(16),
.mux_reg = 0x62000,
.mux_mask = 0x3ff,
.div_reg = 0x62000,
.div_mask = 0xf,
.div_val = 4,
.xo_div4_reg = 0x43008,
.debug_ctl_reg = 0x62004,
.debug_status_reg = 0x62008,
};
static struct debug_mux mm_cc = {
.phys = 0xc8c0000,
.size = 0x40000,
.block_name = "mm",
.enable_reg = 0x900,
.enable_mask = BIT(16),
.mux_reg = 0x900,
.mux_mask = 0x3ff,
};
static struct debug_mux gpu_cc = {
.phys = 0x5065000,
.size = 0x9000,
.block_name = "gpu",
.enable_reg = 0x120,
.enable_mask = BIT(16),
.mux_reg = 0x120,
.mux_mask = 0x3ff,
};
static struct measure_clk msm8998_clocks[] = {
// { "gpu_gcc_debug_clk", &gcc, 0x13d },
// { "gfx_gcc_debug_clk", &gcc, 0x13d },
// { "debug_mmss_clk", &gcc, 0x22 },
// { "debug_cpu_clk", &gcc, 0xc0 },
{ "snoc_clk", &gcc, 0x0 },
{ "cnoc_clk", &gcc, 0xe },
{ "bimc_clk", &gcc, 0x14e },
{ "gcc_mmss_sys_noc_axi_clk", &gcc, 0x1f },
{ "gcc_mmss_noc_cfg_ahb_clk", &gcc, 0x20 },
{ "gcc_usb30_master_clk", &gcc, 0x3e },
{ "gcc_usb30_sleep_clk", &gcc, 0x3f },
{ "gcc_usb30_mock_utmi_clk", &gcc, 0x40 },
{ "gcc_usb3_phy_aux_clk", &gcc, 0x41 },
{ "gcc_usb3_phy_pipe_clk", &gcc, 0x42 },
{ "gcc_sdcc2_apps_clk", &gcc, 0x46 },
{ "gcc_sdcc2_ahb_clk", &gcc, 0x47 },
{ "gcc_sdcc4_apps_clk", &gcc, 0x48 },
{ "gcc_sdcc4_ahb_clk", &gcc, 0x49 },
{ "gcc_blsp1_ahb_clk", &gcc, 0x4a },
{ "gcc_blsp1_qup1_spi_apps_clk", &gcc, 0x4c },
{ "gcc_blsp1_qup1_i2c_apps_clk", &gcc, 0x4d },
{ "gcc_blsp1_uart1_apps_clk", &gcc, 0x4e },
{ "gcc_blsp1_qup2_spi_apps_clk", &gcc, 0x50 },
{ "gcc_blsp1_qup2_i2c_apps_clk", &gcc, 0x51 },
{ "gcc_blsp1_uart2_apps_clk", &gcc, 0x52 },
{ "gcc_blsp1_qup3_spi_apps_clk", &gcc, 0x54 },
{ "gcc_blsp1_qup3_i2c_apps_clk", &gcc, 0x55 },
{ "gcc_blsp1_uart3_apps_clk", &gcc, 0x56 },
{ "gcc_blsp1_qup4_spi_apps_clk", &gcc, 0x58 },
{ "gcc_blsp1_qup4_i2c_apps_clk", &gcc, 0x59 },
{ "gcc_blsp1_qup5_spi_apps_clk", &gcc, 0x5a },
{ "gcc_blsp1_qup5_i2c_apps_clk", &gcc, 0x5b },
{ "gcc_blsp1_qup6_spi_apps_clk", &gcc, 0x5c },
{ "gcc_blsp1_qup6_i2c_apps_clk", &gcc, 0x5d },
{ "gcc_blsp2_ahb_clk", &gcc, 0x5e },
{ "gcc_blsp2_qup1_spi_apps_clk", &gcc, 0x60 },
{ "gcc_blsp2_qup1_i2c_apps_clk", &gcc, 0x61 },
{ "gcc_blsp2_uart1_apps_clk", &gcc, 0x62 },
{ "gcc_blsp2_qup2_spi_apps_clk", &gcc, 0x64 },
{ "gcc_blsp2_qup2_i2c_apps_clk", &gcc, 0x65 },
{ "gcc_blsp2_uart2_apps_clk", &gcc, 0x66 },
{ "gcc_blsp2_qup3_spi_apps_clk", &gcc, 0x68 },
{ "gcc_blsp2_qup3_i2c_apps_clk", &gcc, 0x69 },
{ "gcc_blsp2_uart3_apps_clk", &gcc, 0x6a },
{ "gcc_blsp2_qup4_spi_apps_clk", &gcc, 0x6c },
{ "gcc_blsp2_qup4_i2c_apps_clk", &gcc, 0x6d },
{ "gcc_blsp2_qup5_spi_apps_clk", &gcc, 0x6e },
{ "gcc_blsp2_qup5_i2c_apps_clk", &gcc, 0x6f },
{ "gcc_blsp2_qup6_spi_apps_clk", &gcc, 0x70 },
{ "gcc_blsp2_qup6_i2c_apps_clk", &gcc, 0x71 },
{ "gcc_pdm_ahb_clk", &gcc, 0x72 },
{ "gcc_pdm2_clk", &gcc, 0x74},
{ "gcc_prng_ahb_clk", &gcc, 0x75 },
{ "gcc_tsif_ahb_clk", &gcc, 0x76 },
{ "gcc_tsif_ref_clk", &gcc, 0x77 },
{ "gcc_boot_rom_ahb_clk", &gcc, 0x7a },
{ "ce1_clk", &gcc, 0x97 },
{ "gcc_ce1_axi_m_clk", &gcc, 0x98 },
{ "gcc_ce1_ahb_m_clk", &gcc, 0x99 },
{ "measure_only_bimc_hmss_axi_clk", &gcc, 0xbb },
{ "gcc_bimc_gfx_clk", &gcc, 0xac },
{ "gcc_hmss_rbcpr_clk", &gcc, 0xbc },
{ "gcc_gp1_clk", &gcc, 0xdf },
{ "gcc_gp2_clk", &gcc, 0xe0 },
{ "gcc_gp3_clk", &gcc, 0xe1 },
{ "gcc_pcie_0_slv_axi_clk", &gcc, 0xe2 },
{ "gcc_pcie_0_mstr_axi_clk", &gcc, 0xe3 },
{ "gcc_pcie_0_cfg_ahb_clk", &gcc, 0xe4 },
{ "gcc_pcie_0_aux_clk", &gcc, 0xe5 },
{ "gcc_pcie_0_pipe_clk", &gcc, 0xe6 },
{ "gcc_pcie_phy_aux_clk", &gcc, 0xe8 },
{ "gcc_ufs_axi_clk", &gcc, 0xea },
{ "gcc_ufs_ahb_clk", &gcc, 0xeb },
{ "gcc_ufs_tx_symbol_0_clk", &gcc, 0xec },
{ "gcc_ufs_rx_symbol_0_clk", &gcc, 0xed },
{ "gcc_ufs_rx_symbol_1_clk", &gcc, 0x162 },
{ "gcc_ufs_unipro_core_clk", &gcc, 0xf0 },
{ "gcc_ufs_ice_core_clk", &gcc, 0xf1 },
{ "gcc_dcc_ahb_clk", &gcc, 0x119 },
{ "ipa_clk", &gcc, 0x11b },
{ "gcc_mss_cfg_ahb_clk", &gcc, 0x11f },
{ "gcc_mss_q6_bimc_axi_clk", &gcc, 0x124 },
{ "gcc_mss_mnoc_bimc_axi_clk", &gcc, 0x120 },
{ "gcc_mss_snoc_axi_clk", &gcc, 0x123 },
{ "gcc_gpu_cfg_ahb_clk", &gcc, 0x13b },
{ "gcc_gpu_bimc_gfx_clk", &gcc, 0x13f },
{ "gcc_qspi_ahb_clk", &gcc, 0x156 },
{ "gcc_qspi_ref_clk", &gcc, 0x157 },
{ "mmss_mnoc_ahb_clk", &gcc, 0x22, &mm_cc, 0x1 },
{ "mmss_misc_ahb_clk", &gcc, 0x22, &mm_cc, 0x3 },
{ "mmss_vmem_maxi_clk", &gcc, 0x22, &mm_cc, 0x9 },
{ "mmss_vmem_ahb_clk", &gcc, 0x22, &mm_cc, 0xa },
{ "mmss_bimc_smmu_ahb_clk", &gcc, 0x22, &mm_cc, 0xc },
{ "mmss_bimc_smmu_axi_clk", &gcc, 0x22, &mm_cc, 0xd },
{ "mmss_video_core_clk", &gcc, 0x22, &mm_cc, 0xe },
{ "mmss_video_axi_clk", &gcc, 0x22, &mm_cc, 0xf },
{ "mmss_video_maxi_clk", &gcc, 0x22, &mm_cc, 0x10 },
{ "mmss_video_ahb_clk", &gcc, 0x22, &mm_cc, 0x11 },
{ "mmss_mdss_rot_clk", &gcc, 0x22, &mm_cc, 0x12 },
{ "mmss_snoc_dvm_axi_clk", &gcc, 0x22, &mm_cc, 0x13 },
{ "mmss_mdss_mdp_clk", &gcc, 0x22, &mm_cc, 0x14 },
{ "mmss_mdss_mdp_lut_clk", &gcc, 0x22, &mm_cc, 0x15 },
{ "mmss_mdss_pclk0_clk", &gcc, 0x22, &mm_cc, 0x16 },
{ "mmss_mdss_pclk1_clk", &gcc, 0x22, &mm_cc, 0x17 },
{ "mmss_mdss_extpclk_clk", &gcc, 0x22, &mm_cc, 0x18 },
{ "mmss_video_subcore0_clk", &gcc, 0x22, &mm_cc, 0x1a },
{ "mmss_video_subcore1_clk", &gcc, 0x22, &mm_cc, 0x1b },
{ "mmss_mdss_vsync_clk", &gcc, 0x22, &mm_cc, 0x1c },
{ "mmss_mdss_hdmi_clk", &gcc, 0x22, &mm_cc, 0x1d },
{ "mmss_mdss_byte0_clk", &gcc, 0x22, &mm_cc, 0x1e },
{ "mmss_mdss_byte1_clk", &gcc, 0x22, &mm_cc, 0x1f },
{ "mmss_mdss_esc0_clk", &gcc, 0x22, &mm_cc, 0x20 },
{ "mmss_mdss_esc1_clk", &gcc, 0x22, &mm_cc, 0x21 },
{ "mmss_mdss_ahb_clk", &gcc, 0x22, &mm_cc, 0x22 },
{ "mmss_mdss_hdmi_dp_ahb_clk", &gcc, 0x22, &mm_cc, 0x23 },
{ "mmss_mdss_axi_clk", &gcc, 0x22, &mm_cc, 0x24 },
{ "mmss_camss_top_ahb_clk", &gcc, 0x22, &mm_cc, 0x25 },
{ "mmss_camss_micro_ahb_clk", &gcc, 0x22, &mm_cc, 0x26 },
{ "mmss_camss_gp0_clk", &gcc, 0x22, &mm_cc, 0x27 },
{ "mmss_camss_gp1_clk", &gcc, 0x22, &mm_cc, 0x28 },
{ "mmss_camss_mclk0_clk", &gcc, 0x22, &mm_cc, 0x29 },
{ "mmss_camss_mclk1_clk", &gcc, 0x22, &mm_cc, 0x2a },
{ "mmss_camss_mclk2_clk", &gcc, 0x22, &mm_cc, 0x2b },
{ "mmss_camss_mclk3_clk", &gcc, 0x22, &mm_cc, 0x2c },
{ "mmss_camss_cci_clk", &gcc, 0x22, &mm_cc, 0x2d },
{ "mmss_camss_cci_ahb_clk", &gcc, 0x22, &mm_cc, 0x2e },
{ "mmss_camss_csi0phytimer_clk", &gcc, 0x22, &mm_cc, 0x2f },
{ "mmss_camss_csi1phytimer_clk", &gcc, 0x22, &mm_cc, 0x30 },
{ "mmss_camss_csi2phytimer_clk", &gcc, 0x22, &mm_cc, 0x31 },
{ "mmss_camss_jpeg0_clk", &gcc, 0x22, &mm_cc, 0x32 },
{ "mmss_camss_ispif_ahb_clk", &gcc, 0x22, &mm_cc, 0x33 },
{ "mmss_camss_jpeg_ahb_clk", &gcc, 0x22, &mm_cc, 0x35 },
{ "mmss_camss_jpeg_axi_clk", &gcc, 0x22, &mm_cc, 0x36 },
{ "mmss_camss_ahb_clk", &gcc, 0x22, &mm_cc, 0x37 },
{ "mmss_camss_vfe0_clk", &gcc, 0x22, &mm_cc, 0x38 },
{ "mmss_camss_vfe1_clk", &gcc, 0x22, &mm_cc, 0x39 },
{ "mmss_camss_cpp_clk", &gcc, 0x22, &mm_cc, 0x3a },
{ "mmss_camss_cpp_ahb_clk", &gcc, 0x22, &mm_cc, 0x3b },
{ "mmss_camss_csi_vfe0_clk", &gcc, 0x22, &mm_cc, 0x3f },
{ "mmss_camss_csi_vfe1_clk", &gcc, 0x22, &mm_cc, 0x40 },
{ "mmss_camss_csi0_clk", &gcc, 0x22, &mm_cc, 0x41 },
{ "mmss_camss_csi0_ahb_clk", &gcc, 0x22, &mm_cc, 0x42 },
{ "mmss_camss_csiphy0_clk", &gcc, 0x22, &mm_cc, 0x43 },
{ "mmss_camss_csi0rdi_clk", &gcc, 0x22, &mm_cc, 0x44 },
{ "mmss_camss_csi0pix_clk", &gcc, 0x22, &mm_cc, 0x45 },
{ "mmss_camss_csi1_clk", &gcc, 0x22, &mm_cc, 0x46 },
{ "mmss_camss_csi1_ahb_clk", &gcc, 0x22, &mm_cc, 0x47 },
{ "mmss_camss_csi1rdi_clk", &gcc, 0x22, &mm_cc, 0x49 },
{ "mmss_camss_csi1pix_clk", &gcc, 0x22, &mm_cc, 0x4a },
{ "mmss_camss_csi2_clk", &gcc, 0x22, &mm_cc, 0x4b },
{ "mmss_camss_csi2_ahb_clk", &gcc, 0x22, &mm_cc, 0x4c },
{ "mmss_camss_csi2rdi_clk", &gcc, 0x22, &mm_cc, 0x4e },
{ "mmss_camss_csi2pix_clk", &gcc, 0x22, &mm_cc, 0x4f },
{ "mmss_camss_csi3_clk", &gcc, 0x22, &mm_cc, 0x50 },
{ "mmss_camss_csi3_ahb_clk", &gcc, 0x22, &mm_cc, 0x51 },
{ "mmss_camss_csi3rdi_clk", &gcc, 0x22, &mm_cc, 0x53 },
{ "mmss_camss_csi3pix_clk", &gcc, 0x22, &mm_cc, 0x54 },
{ "mmss_mnoc_maxi_clk", &gcc, 0x22, &mm_cc, 0x70 },
{ "mmss_camss_vfe0_stream_clk", &gcc, 0x22, &mm_cc, 0x71 },
{ "mmss_camss_vfe1_stream_clk", &gcc, 0x22, &mm_cc, 0x72 },
{ "mmss_camss_cpp_vbif_ahb_clk", &gcc, 0x22, &mm_cc, 0x73 },
{ "mmss_misc_cxo_clk", &gcc, 0x22, &mm_cc, 0x77 },
{ "mmss_camss_cpp_axi_clk", &gcc, 0x22, &mm_cc, 0x7a },
{ "mmss_camss_csiphy1_clk", &gcc, 0x22, &mm_cc, 0x85 },
{ "mmss_camss_vfe0_ahb_clk", &gcc, 0x22, &mm_cc, 0x86 },
{ "mmss_camss_vfe1_ahb_clk", &gcc, 0x22, &mm_cc, 0x87 },
{ "mmss_camss_csiphy2_clk", &gcc, 0x22, &mm_cc, 0x88 },
{ "mmss_fd_core_clk", &gcc, 0x22, &mm_cc, 0x89 },
{ "mmss_fd_core_uar_clk", &gcc, 0x22, &mm_cc, 0x8a },
{ "mmss_fd_ahb_clk", &gcc, 0x22, &mm_cc, 0x8c },
{ "mmss_camss_cphy_csid0_clk", &gcc, 0x22, &mm_cc, 0x8d },
{ "mmss_camss_cphy_csid1_clk", &gcc, 0x22, &mm_cc, 0x8e },
{ "mmss_camss_cphy_csid2_clk", &gcc, 0x22, &mm_cc, 0x8f },
{ "mmss_camss_cphy_csid3_clk", &gcc, 0x22, &mm_cc, 0x90 },
{ "mmss_mdss_dp_link_clk", &gcc, 0x22, &mm_cc, 0x98 },
{ "mmss_mdss_dp_link_intf_clk", &gcc, 0x22, &mm_cc, 0x99 },
{ "mmss_mdss_dp_crypto_clk", &gcc, 0x22, &mm_cc, 0x9a },
{ "mmss_mdss_dp_pixel_clk", &gcc, 0x22, &mm_cc, 0x9b },
{ "mmss_mdss_dp_aux_clk", &gcc, 0x22, &mm_cc, 0x9c },
{ "mmss_mdss_dp_gtc_clk", &gcc, 0x22, &mm_cc, 0x9d },
{ "mmss_mdss_byte0_intf_clk", &gcc, 0x22, &mm_cc, 0xad },
{ "mmss_mdss_byte1_intf_clk", &gcc, 0x22, &mm_cc, 0xae },
{ "gpucc_rbcpr_clk", &gcc, 0x13d, &gpu_cc, 0x3 },
{ "gpucc_rbbmtimer_clk", &gcc, 0x13d, &gpu_cc, 0x5 },
{ "gpucc_gfx3d_isense_clk", &gcc, 0x13d, &gpu_cc, 0xa },
{}
};
struct debugcc_platform msm8998_debugcc = {
"msm8998",
msm8998_clocks,
};