diff options
Diffstat (limited to 'include/linux/qcom-geni-se.h')
| -rw-r--r-- | include/linux/qcom-geni-se.h | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index dd464943f717..8f385fbe5a0e 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -6,6 +6,8 @@  #ifndef _LINUX_QCOM_GENI_SE  #define _LINUX_QCOM_GENI_SE +#include <linux/interconnect.h> +  /* Transfer mode supported by GENI Serial Engines */  enum geni_se_xfer_mode {  	GENI_SE_INVALID, @@ -25,6 +27,17 @@ enum geni_se_protocol_type {  struct geni_wrapper;  struct clk; +enum geni_icc_path_index { +	GENI_TO_CORE, +	CPU_TO_GENI, +	GENI_TO_DDR +}; + +struct geni_icc_path { +	struct icc_path *path; +	unsigned int avg_bw; +}; +  /**   * struct geni_se - GENI Serial Engine   * @base:		Base Address of the Serial Engine's register block @@ -33,6 +46,9 @@ struct clk;   * @clk:		Handle to the core serial engine clock   * @num_clk_levels:	Number of valid clock levels in clk_perf_tbl   * @clk_perf_tbl:	Table of clock frequency input to serial engine clock + * @icc_paths:		Array of ICC paths for SE + * @opp_table:		Pointer to the OPP table + * @has_opp_table:	Specifies if the SE has an OPP table   */  struct geni_se {  	void __iomem *base; @@ -41,6 +57,9 @@ struct geni_se {  	struct clk *clk;  	unsigned int num_clk_levels;  	unsigned long *clk_perf_tbl; +	struct geni_icc_path icc_paths[3]; +	struct opp_table *opp_table; +	bool has_opp_table;  };  /* Common SE registers */ @@ -229,6 +248,21 @@ struct geni_se {  #define GENI_SE_VERSION_MINOR(ver) ((ver & HW_VER_MINOR_MASK) >> HW_VER_MINOR_SHFT)  #define GENI_SE_VERSION_STEP(ver) (ver & HW_VER_STEP_MASK) +/* + * Define bandwidth thresholds that cause the underlying Core 2X interconnect + * clock to run at the named frequency. These baseline values are recommended + * by the hardware team, and are not dynamically scaled with GENI bandwidth + * beyond basic on/off. + */ +#define CORE_2X_19_2_MHZ		960 +#define CORE_2X_50_MHZ			2500 +#define CORE_2X_100_MHZ			5000 +#define CORE_2X_150_MHZ			7500 +#define CORE_2X_200_MHZ			10000 +#define CORE_2X_236_MHZ			16383 + +#define GENI_DEFAULT_BW			Bps_to_icc(1000) +  #if IS_ENABLED(CONFIG_QCOM_GENI_SE)  u32 geni_se_get_qup_hw_version(struct geni_se *se); @@ -416,5 +450,16 @@ int geni_se_rx_dma_prep(struct geni_se *se, void *buf, size_t len,  void geni_se_tx_dma_unprep(struct geni_se *se, dma_addr_t iova, size_t len);  void geni_se_rx_dma_unprep(struct geni_se *se, dma_addr_t iova, size_t len); + +int geni_icc_get(struct geni_se *se, const char *icc_ddr); + +int geni_icc_set_bw(struct geni_se *se); +void geni_icc_set_tag(struct geni_se *se, u32 tag); + +int geni_icc_enable(struct geni_se *se); + +int geni_icc_disable(struct geni_se *se); + +void geni_remove_earlycon_icc_vote(void);  #endif  #endif  |