2019-11-28 14:18:16 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Interconnect framework internal structs
|
|
|
|
*
|
|
|
|
* Copyright (c) 2019, Linaro Ltd.
|
|
|
|
* Author: Georgi Djakov <georgi.djakov@linaro.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __DRIVERS_INTERCONNECT_INTERNAL_H
|
|
|
|
#define __DRIVERS_INTERCONNECT_INTERNAL_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct icc_req - constraints that are attached to each node
|
|
|
|
* @req_node: entry in list of requests for the particular @node
|
|
|
|
* @node: the interconnect node to which this constraint applies
|
|
|
|
* @dev: reference to the device that sets the constraints
|
2020-05-10 15:30:37 +00:00
|
|
|
* @enabled: indicates whether the path with this request is enabled
|
2019-11-28 14:18:16 +00:00
|
|
|
* @tag: path tag (optional)
|
|
|
|
* @avg_bw: an integer describing the average bandwidth in kBps
|
|
|
|
* @peak_bw: an integer describing the peak bandwidth in kBps
|
|
|
|
*/
|
|
|
|
struct icc_req {
|
|
|
|
struct hlist_node req_node;
|
|
|
|
struct icc_node *node;
|
|
|
|
struct device *dev;
|
2020-05-10 15:30:37 +00:00
|
|
|
bool enabled;
|
2019-11-28 14:18:16 +00:00
|
|
|
u32 tag;
|
|
|
|
u32 avg_bw;
|
|
|
|
u32 peak_bw;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* struct icc_path - interconnect path structure
|
2019-11-28 14:18:17 +00:00
|
|
|
* @name: a string name of the path (useful for ftrace)
|
2019-11-28 14:18:16 +00:00
|
|
|
* @num_nodes: number of hops (nodes)
|
|
|
|
* @reqs: array of the requests applicable to this path of nodes
|
|
|
|
*/
|
|
|
|
struct icc_path {
|
2019-11-28 14:18:17 +00:00
|
|
|
const char *name;
|
2019-11-28 14:18:16 +00:00
|
|
|
size_t num_nodes;
|
2023-08-17 20:41:47 +00:00
|
|
|
struct icc_req reqs[] __counted_by(num_nodes);
|
2019-11-28 14:18:16 +00:00
|
|
|
};
|
|
|
|
|
2023-08-07 14:29:13 +00:00
|
|
|
struct icc_path *icc_get(struct device *dev, const char *src, const char *dst);
|
2023-08-07 14:29:14 +00:00
|
|
|
int icc_debugfs_client_init(struct dentry *icc_dir);
|
2023-08-07 14:29:13 +00:00
|
|
|
|
2019-11-28 14:18:16 +00:00
|
|
|
#endif
|