All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes
@ 2022-05-04 16:38 Bryan O'Donoghue
  2022-05-04 16:38 ` [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC Bryan O'Donoghue
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2022-05-04 16:38 UTC (permalink / raw)
  To: agross, bjorn.andersson, mturquette, sboyd, linux-arm-msm, linux-clk
  Cc: bryan.odonoghue

There a few omissions/bugs I found recently which are worth fixing up.
The BIMC_DDR_CLK_SRC command RCGR points to a value off in the wilderness
and should be fixed.

More interestingly a number of Multi-media peripherals are defined as
pointing at the system NOC for their clocks, instead of at the System NOC
MM.

This turns out to be not much of a problem so far because we currently
aren't trying to set any of these clocks and the MM_SNOC clocks are derived
from the same source as regular SNOC clocks, except they can vote for
higher rates.

Bryan O'Donoghue (4):
  clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC
  clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address
  clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src
  clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc
    clock

 drivers/clk/qcom/gcc-msm8939.c               | 31 ++++++++++++++------
 include/dt-bindings/clock/qcom,gcc-msm8939.h |  1 +
 2 files changed, 23 insertions(+), 9 deletions(-)

-- 
2.35.1


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

* [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC
  2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
@ 2022-05-04 16:38 ` Bryan O'Donoghue
  2022-05-05  6:43   ` Krzysztof Kozlowski
  2022-05-04 16:38 ` [PATCH 2/4] clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address Bryan O'Donoghue
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 8+ messages in thread
From: Bryan O'Donoghue @ 2022-05-04 16:38 UTC (permalink / raw)
  To: agross, bjorn.andersson, mturquette, sboyd, linux-arm-msm, linux-clk
  Cc: bryan.odonoghue, Rob Herring, Krzysztof Kozlowski, devicetree

When adding in the indexes for this clock-controller we missed
SYSTEM_MM_NOC_BFDCD_CLK_SRC.

Add it in now.

Fixes: 4c71d6abc4fc ("clk: qcom: Add DT bindings for MSM8939 GCC")
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 include/dt-bindings/clock/qcom,gcc-msm8939.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/dt-bindings/clock/qcom,gcc-msm8939.h b/include/dt-bindings/clock/qcom,gcc-msm8939.h
index 0634467c4ce5..2d545ed0d35a 100644
--- a/include/dt-bindings/clock/qcom,gcc-msm8939.h
+++ b/include/dt-bindings/clock/qcom,gcc-msm8939.h
@@ -192,6 +192,7 @@
 #define GCC_VENUS0_CORE0_VCODEC0_CLK		183
 #define GCC_VENUS0_CORE1_VCODEC0_CLK		184
 #define GCC_OXILI_TIMER_CLK			185
+#define SYSTEM_MM_NOC_BFDCD_CLK_SRC		186
 
 /* Indexes for GDSCs */
 #define BIMC_GDSC				0
-- 
2.35.1


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

* [PATCH 2/4] clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address
  2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
  2022-05-04 16:38 ` [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC Bryan O'Donoghue
@ 2022-05-04 16:38 ` Bryan O'Donoghue
  2022-05-04 16:38 ` [PATCH 3/4] clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src Bryan O'Donoghue
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2022-05-04 16:38 UTC (permalink / raw)
  To: agross, bjorn.andersson, mturquette, sboyd, linux-arm-msm, linux-clk
  Cc: bryan.odonoghue

Reviewing qcom docs for the 8939 we can see the command rcgr is pointing to
the wrong address. bimc_ddr_clk_src_rcgr is @ 0x01832024 not 0x01832004.

Fixes: 1664014e4679 ("clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller")
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/clk/qcom/gcc-msm8939.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/gcc-msm8939.c b/drivers/clk/qcom/gcc-msm8939.c
index 40c20745a024..49e4bb87c46a 100644
--- a/drivers/clk/qcom/gcc-msm8939.c
+++ b/drivers/clk/qcom/gcc-msm8939.c
@@ -634,7 +634,7 @@ static struct clk_rcg2 system_noc_bfdcd_clk_src = {
 };
 
 static struct clk_rcg2 bimc_ddr_clk_src = {
-	.cmd_rcgr = 0x32004,
+	.cmd_rcgr = 0x32024,
 	.hid_width = 5,
 	.parent_map = gcc_xo_gpll0_bimc_map,
 	.clkr.hw.init = &(struct clk_init_data){
-- 
2.35.1


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

* [PATCH 3/4] clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src
  2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
  2022-05-04 16:38 ` [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC Bryan O'Donoghue
  2022-05-04 16:38 ` [PATCH 2/4] clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address Bryan O'Donoghue
@ 2022-05-04 16:38 ` Bryan O'Donoghue
  2022-05-04 16:38 ` [PATCH 4/4] clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc clock Bryan O'Donoghue
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2022-05-04 16:38 UTC (permalink / raw)
  To: agross, bjorn.andersson, mturquette, sboyd, linux-arm-msm, linux-clk
  Cc: bryan.odonoghue

The msm8939 has an additional higher operating point for the multi-media
peripherals. The higher throughput MM componets operate off of the
system-mm noc not the system noc.

system_mm_noc_bfdcd_clk_src is the source clock for the higher frequency
capable system noc mm.

Maximum frequency for the MM SNOC is 400 MHz.

Fixes: 1664014e4679 ("clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller")
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/clk/qcom/gcc-msm8939.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/clk/qcom/gcc-msm8939.c b/drivers/clk/qcom/gcc-msm8939.c
index 49e4bb87c46a..f27e19035c4f 100644
--- a/drivers/clk/qcom/gcc-msm8939.c
+++ b/drivers/clk/qcom/gcc-msm8939.c
@@ -646,6 +646,18 @@ static struct clk_rcg2 bimc_ddr_clk_src = {
 	},
 };
 
+static struct clk_rcg2 system_mm_noc_bfdcd_clk_src = {
+	.cmd_rcgr = 0x2600c,
+	.hid_width = 5,
+	.parent_map = gcc_xo_gpll0_gpll6a_map,
+	.clkr.hw.init = &(struct clk_init_data){
+		.name = "system_mm_noc_bfdcd_clk_src",
+		.parent_data = gcc_xo_gpll0_gpll6a_parent_data,
+		.num_parents = 3,
+		.ops = &clk_rcg2_ops,
+	},
+};
+
 static const struct freq_tbl ftbl_gcc_camss_ahb_clk[] = {
 	F(40000000, P_GPLL0, 10, 1, 2),
 	F(80000000, P_GPLL0, 10, 0, 0),
@@ -3625,6 +3637,7 @@ static struct clk_regmap *gcc_msm8939_clocks[] = {
 	[GPLL2_VOTE] = &gpll2_vote,
 	[PCNOC_BFDCD_CLK_SRC] = &pcnoc_bfdcd_clk_src.clkr,
 	[SYSTEM_NOC_BFDCD_CLK_SRC] = &system_noc_bfdcd_clk_src.clkr,
+	[SYSTEM_MM_NOC_BFDCD_CLK_SRC] = &system_mm_noc_bfdcd_clk_src.clkr,
 	[CAMSS_AHB_CLK_SRC] = &camss_ahb_clk_src.clkr,
 	[APSS_AHB_CLK_SRC] = &apss_ahb_clk_src.clkr,
 	[CSI0_CLK_SRC] = &csi0_clk_src.clkr,
-- 
2.35.1


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

* [PATCH 4/4] clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc clock
  2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
                   ` (2 preceding siblings ...)
  2022-05-04 16:38 ` [PATCH 3/4] clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src Bryan O'Donoghue
@ 2022-05-04 16:38 ` Bryan O'Donoghue
  2022-05-25 13:03 ` [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
  2022-07-03  3:56 ` Bjorn Andersson
  5 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2022-05-04 16:38 UTC (permalink / raw)
  To: agross, bjorn.andersson, mturquette, sboyd, linux-arm-msm, linux-clk
  Cc: bryan.odonoghue

Qcom docs indciate the following peripherals operating from System NOC
MM not from System NOC clocks.

- MDP
- VFE
- JPEGe
- Venus

Switch over the relevant parent pointers.

Fixes: 1664014e4679 ("clk: qcom: gcc-msm8939: Add MSM8939 Generic Clock Controller")
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
 drivers/clk/qcom/gcc-msm8939.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/qcom/gcc-msm8939.c b/drivers/clk/qcom/gcc-msm8939.c
index f27e19035c4f..c9845cbdde2a 100644
--- a/drivers/clk/qcom/gcc-msm8939.c
+++ b/drivers/clk/qcom/gcc-msm8939.c
@@ -2455,7 +2455,7 @@ static struct clk_branch gcc_camss_jpeg_axi_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_camss_jpeg_axi_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -2659,7 +2659,7 @@ static struct clk_branch gcc_camss_vfe_axi_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_camss_vfe_axi_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -2815,7 +2815,7 @@ static struct clk_branch gcc_mdss_axi_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_mdss_axi_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -3207,7 +3207,7 @@ static struct clk_branch gcc_mdp_tbu_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_mdp_tbu_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -3225,7 +3225,7 @@ static struct clk_branch gcc_venus_tbu_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_venus_tbu_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -3243,7 +3243,7 @@ static struct clk_branch gcc_vfe_tbu_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_vfe_tbu_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -3261,7 +3261,7 @@ static struct clk_branch gcc_jpeg_tbu_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_jpeg_tbu_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
@@ -3498,7 +3498,7 @@ static struct clk_branch gcc_venus0_axi_clk = {
 		.hw.init = &(struct clk_init_data){
 			.name = "gcc_venus0_axi_clk",
 			.parent_data = &(const struct clk_parent_data){
-				.hw = &system_noc_bfdcd_clk_src.clkr.hw,
+				.hw = &system_mm_noc_bfdcd_clk_src.clkr.hw,
 			},
 			.num_parents = 1,
 			.flags = CLK_SET_RATE_PARENT,
-- 
2.35.1


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

* Re: [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC
  2022-05-04 16:38 ` [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC Bryan O'Donoghue
@ 2022-05-05  6:43   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-05  6:43 UTC (permalink / raw)
  To: Bryan O'Donoghue, agross, bjorn.andersson, mturquette, sboyd,
	linux-arm-msm, linux-clk
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree

On 04/05/2022 18:38, Bryan O'Donoghue wrote:
> When adding in the indexes for this clock-controller we missed
> SYSTEM_MM_NOC_BFDCD_CLK_SRC.
> 
> Add it in now.
> 
> Fixes: 4c71d6abc4fc ("clk: qcom: Add DT bindings for MSM8939 GCC")
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof

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

* Re: [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes
  2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
                   ` (3 preceding siblings ...)
  2022-05-04 16:38 ` [PATCH 4/4] clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc clock Bryan O'Donoghue
@ 2022-05-25 13:03 ` Bryan O'Donoghue
  2022-07-03  3:56 ` Bjorn Andersson
  5 siblings, 0 replies; 8+ messages in thread
From: Bryan O'Donoghue @ 2022-05-25 13:03 UTC (permalink / raw)
  To: agross, bjorn.andersson, mturquette, sboyd, linux-arm-msm, linux-clk

On 04/05/2022 17:38, Bryan O'Donoghue wrote:
> There a few omissions/bugs I found recently which are worth fixing up.
> The BIMC_DDR_CLK_SRC command RCGR points to a value off in the wilderness
> and should be fixed.
> 
> More interestingly a number of Multi-media peripherals are defined as
> pointing at the system NOC for their clocks, instead of at the System NOC
> MM.
> 
> This turns out to be not much of a problem so far because we currently
> aren't trying to set any of these clocks and the MM_SNOC clocks are derived
> from the same source as regular SNOC clocks, except they can vote for
> higher rates.
> 
> Bryan O'Donoghue (4):
>    clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC
>    clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address
>    clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src
>    clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc
>      clock
> 
>   drivers/clk/qcom/gcc-msm8939.c               | 31 ++++++++++++++------
>   include/dt-bindings/clock/qcom,gcc-msm8939.h |  1 +
>   2 files changed, 23 insertions(+), 9 deletions(-)
> 
ping !

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

* Re: [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes
  2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
                   ` (4 preceding siblings ...)
  2022-05-25 13:03 ` [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
@ 2022-07-03  3:56 ` Bjorn Andersson
  5 siblings, 0 replies; 8+ messages in thread
From: Bjorn Andersson @ 2022-07-03  3:56 UTC (permalink / raw)
  To: sboyd, linux-clk, linux-arm-msm, Bryan O'Donoghue, agross,
	mturquette

On Wed, 4 May 2022 17:38:31 +0100, Bryan O'Donoghue wrote:
> There a few omissions/bugs I found recently which are worth fixing up.
> The BIMC_DDR_CLK_SRC command RCGR points to a value off in the wilderness
> and should be fixed.
> 
> More interestingly a number of Multi-media peripherals are defined as
> pointing at the system NOC for their clocks, instead of at the System NOC
> MM.
> 
> [...]

Applied, thanks!

[1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC
      commit: 07e7fcf1714c5f9930ad27613fea940aedba68da
[2/4] clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address
      commit: 63d42708320d6d2ca9ed505123d50ff4a542c36f
[3/4] clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src
      commit: dd363e2f7196278e7a30f509a0e8a841cb763b14
[4/4] clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc clock
      commit: 05eed0990927aa9634682fec58660e30f7b7ae30

Best regards,
-- 
Bjorn Andersson <bjorn.andersson@linaro.org>

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

end of thread, other threads:[~2022-07-03  3:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04 16:38 [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
2022-05-04 16:38 ` [PATCH 1/4] clk: qcom: Add missing SYSTEM_MM_NOC_BFDCD_CLK_SRC Bryan O'Donoghue
2022-05-05  6:43   ` Krzysztof Kozlowski
2022-05-04 16:38 ` [PATCH 2/4] clk: qcom: add gcc-msm8939: Fix bimc_ddr_clk_src rcgr base address Bryan O'Donoghue
2022-05-04 16:38 ` [PATCH 3/4] clk: qcom: add gcc-msm8939: Add missing system_mm_noc_bfdcd_clk_src Bryan O'Donoghue
2022-05-04 16:38 ` [PATCH 4/4] clk: qcom: add gcc-msm8939: Point MM peripherals to system_mm_noc clock Bryan O'Donoghue
2022-05-25 13:03 ` [PATCH 0/4] clk: qcom: msm8939: DDR and system_mm clock fixes Bryan O'Donoghue
2022-07-03  3:56 ` Bjorn Andersson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.