15
15
#include <dt-bindings/interconnect/qcom,osm-l3.h>
16
16
17
17
#include "sc7180.h"
18
+ #include "sc8180x.h"
18
19
#include "sdm845.h"
19
20
#include "sm8150.h"
20
21
#include "sm8250.h"
37
38
38
39
#define OSM_L3_MAX_LINKS 1
39
40
40
- #define to_qcom_provider (_provider ) \
41
+ #define to_osm_l3_provider (_provider ) \
41
42
container_of(_provider, struct qcom_osm_l3_icc_provider, provider)
42
43
43
44
struct qcom_osm_l3_icc_provider {
@@ -49,31 +50,31 @@ struct qcom_osm_l3_icc_provider {
49
50
};
50
51
51
52
/**
52
- * struct qcom_icc_node - Qualcomm specific interconnect nodes
53
+ * struct qcom_osm_l3_node - Qualcomm specific interconnect nodes
53
54
* @name: the node name used in debugfs
54
55
* @links: an array of nodes where we can go next while traversing
55
56
* @id: a unique node identifier
56
57
* @num_links: the total number of @links
57
58
* @buswidth: width of the interconnect between a node and the bus
58
59
*/
59
- struct qcom_icc_node {
60
+ struct qcom_osm_l3_node {
60
61
const char * name ;
61
62
u16 links [OSM_L3_MAX_LINKS ];
62
63
u16 id ;
63
64
u16 num_links ;
64
65
u16 buswidth ;
65
66
};
66
67
67
- struct qcom_icc_desc {
68
- const struct qcom_icc_node * * nodes ;
68
+ struct qcom_osm_l3_desc {
69
+ const struct qcom_osm_l3_node * * nodes ;
69
70
size_t num_nodes ;
70
71
unsigned int lut_row_size ;
71
72
unsigned int reg_freq_lut ;
72
73
unsigned int reg_perf_state ;
73
74
};
74
75
75
76
#define DEFINE_QNODE (_name , _id , _buswidth , ...) \
76
- static const struct qcom_icc_node _name = { \
77
+ static const struct qcom_osm_l3_node _name = { \
77
78
.name = #_name, \
78
79
.id = _id, \
79
80
.buswidth = _buswidth, \
@@ -84,12 +85,12 @@ struct qcom_icc_desc {
84
85
DEFINE_QNODE (sdm845_osm_apps_l3 , SDM845_MASTER_OSM_L3_APPS , 16 , SDM845_SLAVE_OSM_L3 );
85
86
DEFINE_QNODE (sdm845_osm_l3 , SDM845_SLAVE_OSM_L3 , 16 );
86
87
87
- static const struct qcom_icc_node * sdm845_osm_l3_nodes [] = {
88
+ static const struct qcom_osm_l3_node * sdm845_osm_l3_nodes [] = {
88
89
[MASTER_OSM_L3_APPS ] = & sdm845_osm_apps_l3 ,
89
90
[SLAVE_OSM_L3 ] = & sdm845_osm_l3 ,
90
91
};
91
92
92
- static const struct qcom_icc_desc sdm845_icc_osm_l3 = {
93
+ static const struct qcom_osm_l3_desc sdm845_icc_osm_l3 = {
93
94
.nodes = sdm845_osm_l3_nodes ,
94
95
.num_nodes = ARRAY_SIZE (sdm845_osm_l3_nodes ),
95
96
.lut_row_size = OSM_LUT_ROW_SIZE ,
@@ -100,28 +101,44 @@ static const struct qcom_icc_desc sdm845_icc_osm_l3 = {
100
101
DEFINE_QNODE (sc7180_osm_apps_l3 , SC7180_MASTER_OSM_L3_APPS , 16 , SC7180_SLAVE_OSM_L3 );
101
102
DEFINE_QNODE (sc7180_osm_l3 , SC7180_SLAVE_OSM_L3 , 16 );
102
103
103
- static const struct qcom_icc_node * sc7180_osm_l3_nodes [] = {
104
+ static const struct qcom_osm_l3_node * sc7180_osm_l3_nodes [] = {
104
105
[MASTER_OSM_L3_APPS ] = & sc7180_osm_apps_l3 ,
105
106
[SLAVE_OSM_L3 ] = & sc7180_osm_l3 ,
106
107
};
107
108
108
- static const struct qcom_icc_desc sc7180_icc_osm_l3 = {
109
+ static const struct qcom_osm_l3_desc sc7180_icc_osm_l3 = {
109
110
.nodes = sc7180_osm_l3_nodes ,
110
111
.num_nodes = ARRAY_SIZE (sc7180_osm_l3_nodes ),
111
112
.lut_row_size = OSM_LUT_ROW_SIZE ,
112
113
.reg_freq_lut = OSM_REG_FREQ_LUT ,
113
114
.reg_perf_state = OSM_REG_PERF_STATE ,
114
115
};
115
116
117
+ DEFINE_QNODE (sc8180x_osm_apps_l3 , SC8180X_MASTER_OSM_L3_APPS , 32 , SC8180X_SLAVE_OSM_L3 );
118
+ DEFINE_QNODE (sc8180x_osm_l3 , SC8180X_SLAVE_OSM_L3 , 32 );
119
+
120
+ static const struct qcom_osm_l3_node * sc8180x_osm_l3_nodes [] = {
121
+ [MASTER_OSM_L3_APPS ] = & sc8180x_osm_apps_l3 ,
122
+ [SLAVE_OSM_L3 ] = & sc8180x_osm_l3 ,
123
+ };
124
+
125
+ static const struct qcom_osm_l3_desc sc8180x_icc_osm_l3 = {
126
+ .nodes = sc8180x_osm_l3_nodes ,
127
+ .num_nodes = ARRAY_SIZE (sc8180x_osm_l3_nodes ),
128
+ .lut_row_size = OSM_LUT_ROW_SIZE ,
129
+ .reg_freq_lut = OSM_REG_FREQ_LUT ,
130
+ .reg_perf_state = OSM_REG_PERF_STATE ,
131
+ };
132
+
116
133
DEFINE_QNODE (sm8150_osm_apps_l3 , SM8150_MASTER_OSM_L3_APPS , 32 , SM8150_SLAVE_OSM_L3 );
117
134
DEFINE_QNODE (sm8150_osm_l3 , SM8150_SLAVE_OSM_L3 , 32 );
118
135
119
- static const struct qcom_icc_node * sm8150_osm_l3_nodes [] = {
136
+ static const struct qcom_osm_l3_node * sm8150_osm_l3_nodes [] = {
120
137
[MASTER_OSM_L3_APPS ] = & sm8150_osm_apps_l3 ,
121
138
[SLAVE_OSM_L3 ] = & sm8150_osm_l3 ,
122
139
};
123
140
124
- static const struct qcom_icc_desc sm8150_icc_osm_l3 = {
141
+ static const struct qcom_osm_l3_desc sm8150_icc_osm_l3 = {
125
142
.nodes = sm8150_osm_l3_nodes ,
126
143
.num_nodes = ARRAY_SIZE (sm8150_osm_l3_nodes ),
127
144
.lut_row_size = OSM_LUT_ROW_SIZE ,
@@ -132,24 +149,24 @@ static const struct qcom_icc_desc sm8150_icc_osm_l3 = {
132
149
DEFINE_QNODE (sm8250_epss_apps_l3 , SM8250_MASTER_EPSS_L3_APPS , 32 , SM8250_SLAVE_EPSS_L3 );
133
150
DEFINE_QNODE (sm8250_epss_l3 , SM8250_SLAVE_EPSS_L3 , 32 );
134
151
135
- static const struct qcom_icc_node * sm8250_epss_l3_nodes [] = {
152
+ static const struct qcom_osm_l3_node * sm8250_epss_l3_nodes [] = {
136
153
[MASTER_EPSS_L3_APPS ] = & sm8250_epss_apps_l3 ,
137
154
[SLAVE_EPSS_L3_SHARED ] = & sm8250_epss_l3 ,
138
155
};
139
156
140
- static const struct qcom_icc_desc sm8250_icc_epss_l3 = {
157
+ static const struct qcom_osm_l3_desc sm8250_icc_epss_l3 = {
141
158
.nodes = sm8250_epss_l3_nodes ,
142
159
.num_nodes = ARRAY_SIZE (sm8250_epss_l3_nodes ),
143
160
.lut_row_size = EPSS_LUT_ROW_SIZE ,
144
161
.reg_freq_lut = EPSS_REG_FREQ_LUT ,
145
162
.reg_perf_state = EPSS_REG_PERF_STATE ,
146
163
};
147
164
148
- static int qcom_icc_set (struct icc_node * src , struct icc_node * dst )
165
+ static int qcom_osm_l3_set (struct icc_node * src , struct icc_node * dst )
149
166
{
150
167
struct qcom_osm_l3_icc_provider * qp ;
151
168
struct icc_provider * provider ;
152
- const struct qcom_icc_node * qn ;
169
+ const struct qcom_osm_l3_node * qn ;
153
170
struct icc_node * n ;
154
171
unsigned int index ;
155
172
u32 agg_peak = 0 ;
@@ -158,7 +175,7 @@ static int qcom_icc_set(struct icc_node *src, struct icc_node *dst)
158
175
159
176
qn = src -> data ;
160
177
provider = src -> provider ;
161
- qp = to_qcom_provider (provider );
178
+ qp = to_osm_l3_provider (provider );
162
179
163
180
list_for_each_entry (n , & provider -> nodes , node_list )
164
181
provider -> aggregate (n , 0 , n -> avg_bw , n -> peak_bw ,
@@ -191,10 +208,10 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
191
208
u32 info , src , lval , i , prev_freq = 0 , freq ;
192
209
static unsigned long hw_rate , xo_rate ;
193
210
struct qcom_osm_l3_icc_provider * qp ;
194
- const struct qcom_icc_desc * desc ;
211
+ const struct qcom_osm_l3_desc * desc ;
195
212
struct icc_onecell_data * data ;
196
213
struct icc_provider * provider ;
197
- const struct qcom_icc_node * * qnodes ;
214
+ const struct qcom_osm_l3_node * * qnodes ;
198
215
struct icc_node * node ;
199
216
size_t num_nodes ;
200
217
struct clk * clk ;
@@ -264,7 +281,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
264
281
265
282
provider = & qp -> provider ;
266
283
provider -> dev = & pdev -> dev ;
267
- provider -> set = qcom_icc_set ;
284
+ provider -> set = qcom_osm_l3_set ;
268
285
provider -> aggregate = icc_std_aggregate ;
269
286
provider -> xlate = of_icc_xlate_onecell ;
270
287
INIT_LIST_HEAD (& provider -> nodes );
@@ -286,7 +303,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
286
303
}
287
304
288
305
node -> name = qnodes [i ]-> name ;
289
- /* Cast away const and add it back in qcom_icc_set () */
306
+ /* Cast away const and add it back in qcom_osm_l3_set () */
290
307
node -> data = (void * )qnodes [i ];
291
308
icc_node_add (node , provider );
292
309
@@ -311,6 +328,7 @@ static const struct of_device_id osm_l3_of_match[] = {
311
328
{ .compatible = "qcom,sc7180-osm-l3" , .data = & sc7180_icc_osm_l3 },
312
329
{ .compatible = "qcom,sdm845-osm-l3" , .data = & sdm845_icc_osm_l3 },
313
330
{ .compatible = "qcom,sm8150-osm-l3" , .data = & sm8150_icc_osm_l3 },
331
+ { .compatible = "qcom,sc8180x-osm-l3" , .data = & sc8180x_icc_osm_l3 },
314
332
{ .compatible = "qcom,sm8250-epss-l3" , .data = & sm8250_icc_epss_l3 },
315
333
{ }
316
334
};
0 commit comments