1
1
// SPDX-License-Identifier: GPL-2.0
2
2
/*
3
3
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
4
+ * Copyright (c) 2025 Qualcomm Innovation Center, Inc. All rights reserved.
4
5
*/
5
6
6
7
#include <linux/args.h>
32
33
#define EPSS_REG_FREQ_LUT 0x100
33
34
#define EPSS_REG_PERF_STATE 0x320
34
35
35
- #define OSM_L3_MAX_LINKS 1
36
-
37
36
#define to_osm_l3_provider (_provider ) \
38
37
container_of(_provider, struct qcom_osm_l3_icc_provider, provider)
39
38
@@ -48,16 +47,10 @@ struct qcom_osm_l3_icc_provider {
48
47
/**
49
48
* struct qcom_osm_l3_node - Qualcomm specific interconnect nodes
50
49
* @name: the node name used in debugfs
51
- * @links: an array of nodes where we can go next while traversing
52
- * @id: a unique node identifier
53
- * @num_links: the total number of @links
54
50
* @buswidth: width of the interconnect between a node and the bus
55
51
*/
56
52
struct qcom_osm_l3_node {
57
53
const char * name ;
58
- u16 links [OSM_L3_MAX_LINKS ];
59
- u16 id ;
60
- u16 num_links ;
61
54
u16 buswidth ;
62
55
};
63
56
@@ -69,30 +62,22 @@ struct qcom_osm_l3_desc {
69
62
unsigned int reg_perf_state ;
70
63
};
71
64
72
- enum {
73
- OSM_L3_MASTER_NODE = 10000 ,
74
- OSM_L3_SLAVE_NODE ,
75
- };
76
-
77
- #define DEFINE_QNODE (_name , _id , _buswidth , ...) \
65
+ #define DEFINE_QNODE (_name , _buswidth ) \
78
66
static const struct qcom_osm_l3_node _name = { \
79
67
.name = #_name, \
80
- .id = _id, \
81
68
.buswidth = _buswidth, \
82
- .num_links = COUNT_ARGS(__VA_ARGS__), \
83
- .links = { __VA_ARGS__ }, \
84
69
}
85
70
86
- DEFINE_QNODE (osm_l3_master , OSM_L3_MASTER_NODE , 16 , OSM_L3_SLAVE_NODE );
87
- DEFINE_QNODE (osm_l3_slave , OSM_L3_SLAVE_NODE , 16 );
71
+ DEFINE_QNODE (osm_l3_slave , 16 );
72
+ DEFINE_QNODE (osm_l3_master , 16 );
88
73
89
74
static const struct qcom_osm_l3_node * const osm_l3_nodes [] = {
90
75
[MASTER_OSM_L3_APPS ] = & osm_l3_master ,
91
76
[SLAVE_OSM_L3 ] = & osm_l3_slave ,
92
77
};
93
78
94
- DEFINE_QNODE (epss_l3_master , OSM_L3_MASTER_NODE , 32 , OSM_L3_SLAVE_NODE );
95
- DEFINE_QNODE (epss_l3_slave , OSM_L3_SLAVE_NODE , 32 );
79
+ DEFINE_QNODE (epss_l3_slave , 32 );
80
+ DEFINE_QNODE (epss_l3_master , 32 );
96
81
97
82
static const struct qcom_osm_l3_node * const epss_l3_nodes [] = {
98
83
[MASTER_EPSS_L3_APPS ] = & epss_l3_master ,
@@ -242,10 +227,10 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
242
227
243
228
icc_provider_init (provider );
244
229
230
+ /* Create nodes */
245
231
for (i = 0 ; i < num_nodes ; i ++ ) {
246
- size_t j ;
232
+ node = icc_node_create_dyn () ;
247
233
248
- node = icc_node_create (qnodes [i ]-> id );
249
234
if (IS_ERR (node )) {
250
235
ret = PTR_ERR (node );
251
236
goto err ;
@@ -256,12 +241,12 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
256
241
node -> data = (void * )qnodes [i ];
257
242
icc_node_add (node , provider );
258
243
259
- for (j = 0 ; j < qnodes [i ]-> num_links ; j ++ )
260
- icc_link_create (node , qnodes [i ]-> links [j ]);
261
-
262
244
data -> nodes [i ] = node ;
263
245
}
264
246
247
+ /* Create link */
248
+ icc_link_nodes (data -> nodes [MASTER_OSM_L3_APPS ], & data -> nodes [SLAVE_OSM_L3 ]);
249
+
265
250
ret = icc_provider_register (provider );
266
251
if (ret )
267
252
goto err ;
@@ -278,6 +263,7 @@ static int qcom_osm_l3_probe(struct platform_device *pdev)
278
263
static const struct of_device_id osm_l3_of_match [] = {
279
264
{ .compatible = "qcom,epss-l3" , .data = & epss_l3_l3_vote },
280
265
{ .compatible = "qcom,osm-l3" , .data = & osm_l3 },
266
+ { .compatible = "qcom,sa8775p-epss-l3" , .data = & epss_l3_perf_state },
281
267
{ .compatible = "qcom,sc7180-osm-l3" , .data = & osm_l3 },
282
268
{ .compatible = "qcom,sc7280-epss-l3" , .data = & epss_l3_perf_state },
283
269
{ .compatible = "qcom,sdm845-osm-l3" , .data = & osm_l3 },
0 commit comments