Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] qcom: Add BCM vote macro to TCS header
@ 2019-07-17 15:53 Jordan Crouse
  2019-07-24 15:30 ` Georgi Djakov
  0 siblings, 1 reply; 2+ messages in thread
From: Jordan Crouse @ 2019-07-17 15:53 UTC (permalink / raw)
  To: freedreno
  Cc: ilina, bjorn.andersson, linux-pm, Raju P.L.S.S.S.N,
	linux-arm-msm, linux-kernel, Andy Gross, David Brown,
	Georgi Djakov

The A6XX family of Adreno GPUs use a microcontroller to control the
GPU clock independently. The microcontroller also has the capability
to vote for the bus but doesn't currently do so except for one initial
vote that is hard coded [1].

Currently there is no good way to construct a valid TCS command outside
of the inner workings of the QCOM interconnect driver which is something
that will need to be addressed for the next generation of GPU drivers.

To start the process, this change moves the TCS command macros from the
sdm845 interconnect driver into a soc specific header to make it available
for future efforts into this area.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/msm/adreno/a6xx_hfi.c#n219

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---

 drivers/interconnect/qcom/sdm845.c | 17 -----------------
 include/soc/qcom/tcs.h             | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c
index 4915b78..79b6f01 100644
--- a/drivers/interconnect/qcom/sdm845.c
+++ b/drivers/interconnect/qcom/sdm845.c
@@ -20,23 +20,6 @@
 #include <soc/qcom/rpmh.h>
 #include <soc/qcom/tcs.h>
 
-#define BCM_TCS_CMD_COMMIT_SHFT		30
-#define BCM_TCS_CMD_COMMIT_MASK		0x40000000
-#define BCM_TCS_CMD_VALID_SHFT		29
-#define BCM_TCS_CMD_VALID_MASK		0x20000000
-#define BCM_TCS_CMD_VOTE_X_SHFT		14
-#define BCM_TCS_CMD_VOTE_MASK		0x3fff
-#define BCM_TCS_CMD_VOTE_Y_SHFT		0
-#define BCM_TCS_CMD_VOTE_Y_MASK		0xfffc000
-
-#define BCM_TCS_CMD(commit, valid, vote_x, vote_y)		\
-	(((commit) << BCM_TCS_CMD_COMMIT_SHFT) |		\
-	((valid) << BCM_TCS_CMD_VALID_SHFT) |			\
-	((cpu_to_le32(vote_x) &					\
-	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) |	\
-	((cpu_to_le32(vote_y) &					\
-	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))
-
 #define to_qcom_provider(_provider) \
 	container_of(_provider, struct qcom_icc_provider, provider)
 
diff --git a/include/soc/qcom/tcs.h b/include/soc/qcom/tcs.h
index 262876a..6012a9e 100644
--- a/include/soc/qcom/tcs.h
+++ b/include/soc/qcom/tcs.h
@@ -53,4 +53,21 @@ struct tcs_request {
 	struct tcs_cmd *cmds;
 };
 
+#define BCM_TCS_CMD_COMMIT_SHFT		30
+#define BCM_TCS_CMD_COMMIT_MASK		0x40000000
+#define BCM_TCS_CMD_VALID_SHFT		29
+#define BCM_TCS_CMD_VALID_MASK		0x20000000
+#define BCM_TCS_CMD_VOTE_X_SHFT		14
+#define BCM_TCS_CMD_VOTE_MASK		0x3fff
+#define BCM_TCS_CMD_VOTE_Y_SHFT		0
+#define BCM_TCS_CMD_VOTE_Y_MASK		0xfffc000
+
+#define BCM_TCS_CMD(commit, valid, vote_x, vote_y)		\
+	(((commit) << BCM_TCS_CMD_COMMIT_SHFT) |		\
+	((valid) << BCM_TCS_CMD_VALID_SHFT) |			\
+	((cpu_to_le32(vote_x) &					\
+	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) |	\
+	((cpu_to_le32(vote_y) &					\
+	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))
+
 #endif /* __SOC_QCOM_TCS_H__ */
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] qcom: Add BCM vote macro to TCS header
  2019-07-17 15:53 [PATCH] qcom: Add BCM vote macro to TCS header Jordan Crouse
@ 2019-07-24 15:30 ` Georgi Djakov
  0 siblings, 0 replies; 2+ messages in thread
From: Georgi Djakov @ 2019-07-24 15:30 UTC (permalink / raw)
  To: Jordan Crouse, freedreno
  Cc: ilina, bjorn.andersson, linux-pm, Raju P.L.S.S.S.N,
	linux-arm-msm, linux-kernel, Andy Gross, David Brown

Hi Jordan,

On 7/17/19 18:53, Jordan Crouse wrote:
> The A6XX family of Adreno GPUs use a microcontroller to control the
> GPU clock independently. The microcontroller also has the capability
> to vote for the bus but doesn't currently do so except for one initial
> vote that is hard coded [1].
> 
> Currently there is no good way to construct a valid TCS command outside
> of the inner workings of the QCOM interconnect driver which is something
> that will need to be addressed for the next generation of GPU drivers.
> 
> To start the process, this change moves the TCS command macros from the
> sdm845 interconnect driver into a soc specific header to make it available
> for future efforts into this area.

I agree that we should move the TCS macros into tsc.h. There is also a similar
macro in drivers/clk/qcom/clk-rpmh.c. Maybe we can replace both with a common one?

Thanks,
Georgi

> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/msm/adreno/a6xx_hfi.c#n219
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
> ---
> 
>  drivers/interconnect/qcom/sdm845.c | 17 -----------------
>  include/soc/qcom/tcs.h             | 17 +++++++++++++++++
>  2 files changed, 17 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c
> index 4915b78..79b6f01 100644
> --- a/drivers/interconnect/qcom/sdm845.c
> +++ b/drivers/interconnect/qcom/sdm845.c
> @@ -20,23 +20,6 @@
>  #include <soc/qcom/rpmh.h>
>  #include <soc/qcom/tcs.h>
>  
> -#define BCM_TCS_CMD_COMMIT_SHFT		30
> -#define BCM_TCS_CMD_COMMIT_MASK		0x40000000
> -#define BCM_TCS_CMD_VALID_SHFT		29
> -#define BCM_TCS_CMD_VALID_MASK		0x20000000
> -#define BCM_TCS_CMD_VOTE_X_SHFT		14
> -#define BCM_TCS_CMD_VOTE_MASK		0x3fff
> -#define BCM_TCS_CMD_VOTE_Y_SHFT		0
> -#define BCM_TCS_CMD_VOTE_Y_MASK		0xfffc000
> -
> -#define BCM_TCS_CMD(commit, valid, vote_x, vote_y)		\
> -	(((commit) << BCM_TCS_CMD_COMMIT_SHFT) |		\
> -	((valid) << BCM_TCS_CMD_VALID_SHFT) |			\
> -	((cpu_to_le32(vote_x) &					\
> -	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) |	\
> -	((cpu_to_le32(vote_y) &					\
> -	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))
> -
>  #define to_qcom_provider(_provider) \
>  	container_of(_provider, struct qcom_icc_provider, provider)
>  
> diff --git a/include/soc/qcom/tcs.h b/include/soc/qcom/tcs.h
> index 262876a..6012a9e 100644
> --- a/include/soc/qcom/tcs.h
> +++ b/include/soc/qcom/tcs.h
> @@ -53,4 +53,21 @@ struct tcs_request {
>  	struct tcs_cmd *cmds;
>  };
>  
> +#define BCM_TCS_CMD_COMMIT_SHFT		30
> +#define BCM_TCS_CMD_COMMIT_MASK		0x40000000
> +#define BCM_TCS_CMD_VALID_SHFT		29
> +#define BCM_TCS_CMD_VALID_MASK		0x20000000
> +#define BCM_TCS_CMD_VOTE_X_SHFT		14
> +#define BCM_TCS_CMD_VOTE_MASK		0x3fff
> +#define BCM_TCS_CMD_VOTE_Y_SHFT		0
> +#define BCM_TCS_CMD_VOTE_Y_MASK		0xfffc000
> +
> +#define BCM_TCS_CMD(commit, valid, vote_x, vote_y)		\
> +	(((commit) << BCM_TCS_CMD_COMMIT_SHFT) |		\
> +	((valid) << BCM_TCS_CMD_VALID_SHFT) |			\
> +	((cpu_to_le32(vote_x) &					\
> +	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_X_SHFT) |	\
> +	((cpu_to_le32(vote_y) &					\
> +	BCM_TCS_CMD_VOTE_MASK) << BCM_TCS_CMD_VOTE_Y_SHFT))
> +
>  #endif /* __SOC_QCOM_TCS_H__ */
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-17 15:53 [PATCH] qcom: Add BCM vote macro to TCS header Jordan Crouse
2019-07-24 15:30 ` Georgi Djakov

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org linux-arm-msm@archiver.kernel.org
	public-inbox-index linux-arm-msm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox