0001
0002
0003
0004
0005
0006 #ifndef __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H
0007 #define __DRIVERS_INTERCONNECT_QCOM_ICC_RPM_H
0008
0009 #include <dt-bindings/interconnect/qcom,icc.h>
0010
0011 #define RPM_BUS_MASTER_REQ 0x73616d62
0012 #define RPM_BUS_SLAVE_REQ 0x766c7362
0013
0014 #define to_qcom_provider(_provider) \
0015 container_of(_provider, struct qcom_icc_provider, provider)
0016
0017 enum qcom_icc_type {
0018 QCOM_ICC_NOC,
0019 QCOM_ICC_BIMC,
0020 QCOM_ICC_QNOC,
0021 };
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 struct qcom_icc_provider {
0034 struct icc_provider provider;
0035 int num_clks;
0036 enum qcom_icc_type type;
0037 struct regmap *regmap;
0038 unsigned int qos_offset;
0039 u64 *bus_clk_rate;
0040 struct clk_bulk_data bus_clks[];
0041 };
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 struct qcom_icc_qos {
0054 u32 areq_prio;
0055 u32 prio_level;
0056 bool limit_commands;
0057 bool ap_owned;
0058 int qos_mode;
0059 int qos_port;
0060 bool urg_fwd_en;
0061 };
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 struct qcom_icc_node {
0077 unsigned char *name;
0078 u16 id;
0079 const u16 *links;
0080 u16 num_links;
0081 u16 buswidth;
0082 u64 sum_avg[QCOM_ICC_NUM_BUCKETS];
0083 u64 max_peak[QCOM_ICC_NUM_BUCKETS];
0084 int mas_rpm_id;
0085 int slv_rpm_id;
0086 struct qcom_icc_qos qos;
0087 };
0088
0089 struct qcom_icc_desc {
0090 struct qcom_icc_node * const *nodes;
0091 size_t num_nodes;
0092 const char * const *clocks;
0093 size_t num_clocks;
0094 bool has_bus_pd;
0095 enum qcom_icc_type type;
0096 const struct regmap_config *regmap_cfg;
0097 unsigned int qos_offset;
0098 };
0099
0100
0101 #define NOC_QOS_MODE_INVALID -1
0102 #define NOC_QOS_MODE_FIXED 0x0
0103 #define NOC_QOS_MODE_BYPASS 0x2
0104
0105 int qnoc_probe(struct platform_device *pdev);
0106 int qnoc_remove(struct platform_device *pdev);
0107
0108 #endif