Skip to contentSkip to conversation

clk: qcom: gcc-ipq6018: add QUP6 I2C clock

PATCH Superseded Robert Marko 3 participants 8 messages Oct 15, 2023 – Oct 25, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: qcom: gcc-ipq6018: add QUP6 I2C clock

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled as its somehow affecting DVFS and if disabled it sometimes crashes the board.

---
 drivers/clk/qcom/gcc-ipq6018.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/clk/qcom/gcc-ipq6018.c +17 -0
index 31eef38c5864c..126d87df80c5b 100644
@@ -2125,6 +2125,22 @@ static struct clk_branch gcc_blsp1_qup5_spi_apps_clk = {
 	},
 };
 
+static struct clk_branch gcc_blsp1_qup6_i2c_apps_clk = {
+	.halt_reg = 0x07010,
+	.clkr = {
+		.enable_reg = 0x07010,
+		.enable_mask = BIT(0),
+		.hw.init = &(struct clk_init_data){
+			.name = "gcc_blsp1_qup6_i2c_apps_clk",
+			.parent_hws = (const struct clk_hw *[]){
+					&blsp1_qup6_i2c_apps_clk_src.clkr.hw },
+			.num_parents = 1,
+			.flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED,
+			.ops = &clk_branch2_ops,
+		},
+	},
+};
+
 static struct clk_branch gcc_blsp1_qup6_spi_apps_clk = {
 	.halt_reg = 0x0700c,
 	.clkr = {
@@ -4281,6 +4297,7 @@ static struct clk_regmap *gcc_ipq6018_clks[] = {
 	[GCC_BLSP1_QUP4_SPI_APPS_CLK] = &gcc_blsp1_qup4_spi_apps_clk.clkr,
 	[GCC_BLSP1_QUP5_I2C_APPS_CLK] = &gcc_blsp1_qup5_i2c_apps_clk.clkr,
 	[GCC_BLSP1_QUP5_SPI_APPS_CLK] = &gcc_blsp1_qup5_spi_apps_clk.clkr,
+	[GCC_BLSP1_QUP6_I2C_APPS_CLK] = &gcc_blsp1_qup6_i2c_apps_clk.clkr,
 	[GCC_BLSP1_QUP6_SPI_APPS_CLK] = &gcc_blsp1_qup6_spi_apps_clk.clkr,
 	[GCC_BLSP1_UART1_APPS_CLK] = &gcc_blsp1_uart1_apps_clk.clkr,
 	[GCC_BLSP1_UART2_APPS_CLK] = &gcc_blsp1_uart2_apps_clk.clkr,
Signature · 1 line
2.41.0
#1 lore raw
Quoted 8 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled as its somehow affecting DVFS and if disabled it sometimes crashes the board.

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Konrad

#2 lore raw
Quoted 9 lines · Konrad Dybcio
Quoted 6 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled as its somehow affecting DVFS and if disabled it sometimes crashes the board.

Quoted 7 lines
Quoted 2 lines

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Konrad / Robert,

Similar to IPQ9574, RPM needs this clock to communicate with PMIC over I2C interface. Discussion happened here[1] is pretty much applicable to IPQ6018 as well. Based on previous experience, we may need to document the reason for CLK_IGNORE_UNUSED in driver as well. Nevertheless,

[1] https://lore.kernel.org/linux-arm-msm/[email protected]/

Quoted 1 line

Konrad

#3 lore raw
Quoted 21 lines · Kathiravan Thirumoorthy
Quoted 10 lines · Konrad Dybcio
Quoted 7 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled
as its somehow affecting DVFS and if disabled it sometimes crashes the board.

Quoted 7 lines
Quoted 2 lines

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Quoted 8 lines

Konrad / Robert,

Similar to IPQ9574, RPM needs this clock to communicate with PMIC over I2C interface. Discussion happened here[1] is pretty much applicable to IPQ6018 as well. Based on previous experience, we may need to document the reason for CLK_IGNORE_UNUSED in driver as well. Nevertheless,

Thanks for the explanation, it makes sense as I used to control the MP5496 directly
via I2C.

Is it possible to disable RPM so it doesn't conflict and just use the full MP5496 driver instead?
I find the RPM quite limiting as there is no way to actually retrieve the current-voltage.

Regards,
Robert

Quoted 6 lines

[1]
https://lore.kernel.org/linux-arm-msm/[email protected]/

Quoted 1 line

Konrad

#4 lore raw
Quoted 28 lines · Robert Marko
Quoted 18 lines · Kathiravan Thirumoorthy
Quoted 9 lines · Konrad Dybcio
Quoted 7 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled
as its somehow affecting DVFS and if disabled it sometimes crashes the board.

Quoted 7 lines
Quoted 2 lines

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Quoted 8 lines

Konrad / Robert,

Similar to IPQ9574, RPM needs this clock to communicate with PMIC over I2C interface. Discussion happened here[1] is pretty much applicable to IPQ6018 as well. Based on previous experience, we may need to document the reason for CLK_IGNORE_UNUSED in driver as well. Nevertheless,

Quoted 8 lines

Thanks for the explanation, it makes sense as I used to control the MP5496 directly
via I2C.

Is it possible to disable RPM so it doesn't conflict and just use the full MP5496 driver instead?
I find the RPM quite limiting as there is no way to actually retrieve the current-voltage.

Robert, checked with the team and currently we don't have any option to disable the RPM as such.

Quoted 8 lines

Regards,
Robert

Quoted 5 lines

[1]
https://lore.kernel.org/linux-arm-msm/[email protected]/

Quoted 1 line

Konrad

#5 lore raw
Quoted 35 lines · Kathiravan Thirumoorthy
Quoted 32 lines · Robert Marko
Quoted 18 lines · Kathiravan Thirumoorthy
Quoted 9 lines · Konrad Dybcio
Quoted 7 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled
as its somehow affecting DVFS and if disabled it sometimes crashes the board.

Quoted 7 lines
Quoted 2 lines

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Quoted 8 lines

Konrad / Robert,

Similar to IPQ9574, RPM needs this clock to communicate with PMIC over I2C interface. Discussion happened here[1] is pretty much applicable to IPQ6018 as well. Based on previous experience, we may need to document the reason for CLK_IGNORE_UNUSED in driver as well. Nevertheless,

Thanks for the explanation, it makes sense as I used to control the MP5496 directly
via I2C.

Quoted 8 lines
Quoted 4 lines

Is it possible to disable RPM so it doesn't conflict and just use the full MP5496 driver instead?
I find the RPM quite limiting as there is no way to actually retrieve the current-voltage.

Robert, checked with the team and currently we don't have any option to disable the RPM as such.

Thanks for checking.

BTW, is there any information you could share on the USB GDSC-s? I tried converting them to GDSC-s like IPQ8074 has, but it seems that they have different features.
It would be great to use proper GSDC support instead of manually setting bits during GCC probe.

Regards,
Robert

Quoted 10 lines
Quoted 10 lines

Regards,
Robert

Quoted 5 lines

[1]
https://lore.kernel.org/linux-arm-msm/[email protected]/

Quoted 1 line

Konrad

#6 lore raw
Quoted 46 lines · Robert Marko
Quoted 35 lines · Kathiravan Thirumoorthy
Quoted 32 lines · Robert Marko
Quoted 18 lines · Kathiravan Thirumoorthy
Quoted 9 lines · Konrad Dybcio
Quoted 7 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled
as its somehow affecting DVFS and if disabled it sometimes crashes the board.

Quoted 7 lines
Quoted 2 lines

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Quoted 8 lines

Konrad / Robert,

Similar to IPQ9574, RPM needs this clock to communicate with PMIC over I2C interface. Discussion happened here[1] is pretty much applicable to IPQ6018 as well. Based on previous experience, we may need to document the reason for CLK_IGNORE_UNUSED in driver as well. Nevertheless,

Thanks for the explanation, it makes sense as I used to control the MP5496 directly
via I2C.

Quoted 8 lines
Quoted 4 lines

Is it possible to disable RPM so it doesn't conflict and just use the full MP5496 driver instead?
I find the RPM quite limiting as there is no way to actually retrieve the current-voltage.

Robert, checked with the team and currently we don't have any option to disable the RPM as such.

Quoted 7 lines

Thanks for checking.

BTW, is there any information you could share on the USB GDSC-s? I tried converting them to GDSC-s like IPQ8074 has, but it seems that they have different features.
It would be great to use proper GSDC support instead of manually setting bits during GCC probe.

Could you please explain the issue which you are facing? Based on quick look at the HW documentation, seems there is no difference between IPQ8074 and IPQ6018 GDSC-s.

Thanks,

#7 lore raw
Quoted 59 lines · Kathiravan Thirumoorthy
Quoted 46 lines · Robert Marko
Quoted 35 lines · Kathiravan Thirumoorthy
Quoted 32 lines · Robert Marko
Quoted 18 lines · Kathiravan Thirumoorthy
Quoted 9 lines · Konrad Dybcio
Quoted 7 lines · Robert Marko

QUP6 I2C clock is listed in the dt bindings but it was never included in the GCC driver.
So lets add support for it, its intentionally marked to never be disabled
as its somehow affecting DVFS and if disabled it sometimes crashes the board.

Quoted 7 lines
Quoted 2 lines

---

Bjorn, would you be able to get an idea of what could be sitting on that bus?

Or maybe the IPQ folks could know?

Quoted 8 lines

Konrad / Robert,

Similar to IPQ9574, RPM needs this clock to communicate with PMIC over I2C interface. Discussion happened here[1] is pretty much applicable to IPQ6018 as well. Based on previous experience, we may need to document the reason for CLK_IGNORE_UNUSED in driver as well. Nevertheless,

Thanks for the explanation, it makes sense as I used to control the MP5496 directly
via I2C.

Quoted 8 lines
Quoted 4 lines

Is it possible to disable RPM so it doesn't conflict and just use the full MP5496 driver instead?
I find the RPM quite limiting as there is no way to actually retrieve the current-voltage.

Robert, checked with the team and currently we don't have any option to disable the RPM as such.

Quoted 7 lines

Thanks for checking.

BTW, is there any information you could share on the USB GDSC-s? I tried converting them to GDSC-s like IPQ8074 has, but it seems that they have different features.
It would be great to use proper GSDC support instead of manually setting bits during GCC probe.

Quoted 3 lines

Could you please explain the issue which you are facing? Based on quick look at the HW documentation, seems there is no difference between IPQ8074 and IPQ6018 GDSC-s.

Thanks for checking, it seems I hit a buggy kernel version last time I tried to convert the driver to use proper GDSC-s and now it seems to work fine, I will send patches to add GDSC-s.

Regards,
Robert

Quoted 2 lines

Thanks,