Skip to contentSkip to conversation

I2C on imx8qm - Failed to enable ipg clk

DISCUSSION Oliver Graute 2 participants 4 messages Aug 5, 2020 – Nov 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hello,

I try to get my I2C working on imx8qm. But I run into this issue:

=> i2c bus
Bus 3: i2c at 5a830000
=> i2c dev 3
Setting bus to 3
Failed to enable ipg clk
Failure changing bus number (-524)

Some idea how to fix that?

I'am using U-Boot 2020.04

Best regards,

Oliver

#1 lore raw

Hi Oliver,

Quoted 11 lines · On Wed, 5 Aug 2020 15:47:07 +0200 Oliver Graute oliver.graute at gmail.com…

Hello,

I try to get my I2C working on imx8qm. But I run into this issue:

=> i2c bus
Bus 3: i2c at 5a830000
=> i2c dev 3
Setting bus to 3
Failed to enable ipg clk
Failure changing bus number (-524)

Quoted 3 lines

Some idea how to fix that?

I'am using U-Boot 2020.04

I think the clock driver (in drivers/clk/imx/clk-imx8qm.c) does not have support for IMX8QM_I2C*_IPG_CLK clocks yet.

--
Anatolij

#2 lore raw
Quoted 16 lines · Anatolij Gustschin

Hi Oliver,

Quoted 11 lines · On Wed, 5 Aug 2020 15:47:07 +0200 Oliver Graute oliver.graute at gmail.com…

Hello,

I try to get my I2C working on imx8qm. But I run into this issue:

=> i2c bus
Bus 3: i2c at 5a830000
=> i2c dev 3
Setting bus to 3
Failed to enable ipg clk
Failure changing bus number (-524)

Quoted 6 lines
Quoted 3 lines

Some idea how to fix that?

I'am using U-Boot 2020.04

I think the clock driver (in drivers/clk/imx/clk-imx8qm.c) does not have support for IMX8QM_I2C*_IPG_CLK clocks yet.

ok, what I have to do to add support for it? just adding IMX8QM_I2C*_IPG_CLK to the imx8_clk_names[]?

Best Regards,

Oliver

#3 lore raw
Quoted 19 lines · Oliver Graute
Quoted 18 lines · Anatolij Gustschin

Hi Oliver,

Quoted 13 lines · On Wed, 5 Aug 2020 15:47:07 +0200 Oliver Graute oliver.graute at gmail.com…

Hello,

I try to get my I2C working on imx8qm. But I run into this issue:

=> i2c bus
Bus 3: i2c at 5a830000
=> i2c dev 3
Setting bus to 3
Failed to enable ipg clk
Failure changing bus number (-524)

Some idea how to fix that?

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

I'am using U-Boot 2020.04

I think the clock driver (in drivers/clk/imx/clk-imx8qm.c) does not have support for IMX8QM_I2C*_IPG_CLK clocks yet.

ok, what I have to do to add support for it? just adding IMX8QM_I2C*_IPG_CLK to the imx8_clk_names[]?

ok I solved this issue this way:

drivers/clk/imx/clk-imx8qm.c +24 -0
index 54fb09fda4..7e466d630a 100644
@@ -53,19 +53,27 @@ ulong imx8_clk_get_rate(struct clk *clk)
 		resource = SC_R_A53;
 		pm_clk = SC_PM_CLK_CPU;
 		break;
+	case IMX8QM_I2C0_IPG_CLK:
 	case IMX8QM_I2C0_CLK:
+	case IMX8QM_I2C0_DIV:
 		resource = SC_R_I2C_0;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C1_IPG_CLK:
 	case IMX8QM_I2C1_CLK:
+	case IMX8QM_I2C1_DIV:
 		resource = SC_R_I2C_1;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C2_IPG_CLK:
 	case IMX8QM_I2C2_CLK:
+	case IMX8QM_I2C2_DIV:
 		resource = SC_R_I2C_2;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C3_IPG_CLK:
 	case IMX8QM_I2C3_CLK:
+	case IMX8QM_I2C3_DIV:
 		resource = SC_R_I2C_3;
 		pm_clk = SC_PM_CLK_PER;
 		break;
@@ -148,19 +156,27 @@ ulong imx8_clk_set_rate(struct clk *clk, unsigned long rate)
 	debug("%s(#%lu), rate: %lu\n", __func__, clk->id, rate);
 
 	switch (clk->id) {
+	case IMX8QM_I2C0_IPG_CLK:
 	case IMX8QM_I2C0_CLK:
+	case IMX8QM_I2C0_DIV:
 		resource = SC_R_I2C_0;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C1_IPG_CLK:
 	case IMX8QM_I2C1_CLK:
+	case IMX8QM_I2C1_DIV:
 		resource = SC_R_I2C_1;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C2_IPG_CLK:
 	case IMX8QM_I2C2_CLK:
+	case IMX8QM_I2C2_DIV:
 		resource = SC_R_I2C_2;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C3_IPG_CLK:
 	case IMX8QM_I2C3_CLK:
+	case IMX8QM_I2C3_DIV:
 		resource = SC_R_I2C_3;
 		pm_clk = SC_PM_CLK_PER;
 		break;
@@ -242,19 +258,27 @@ int __imx8_clk_enable(struct clk *clk, bool enable)
 	debug("%s(#%lu)\n", __func__, clk->id);
 
 	switch (clk->id) {
+	case IMX8QM_I2C0_IPG_CLK:
 	case IMX8QM_I2C0_CLK:
+	case IMX8QM_I2C0_DIV:
 		resource = SC_R_I2C_0;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C1_IPG_CLK:
 	case IMX8QM_I2C1_CLK:
+	case IMX8QM_I2C1_DIV:
 		resource = SC_R_I2C_1;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C2_IPG_CLK:
 	case IMX8QM_I2C2_CLK:
+	case IMX8QM_I2C2_DIV:
 		resource = SC_R_I2C_2;
 		pm_clk = SC_PM_CLK_PER;
 		break;
+	case IMX8QM_I2C3_IPG_CLK:
 	case IMX8QM_I2C3_CLK:
+	case IMX8QM_I2C3_DIV:
 		resource = SC_R_I2C_3;
 		pm_clk = SC_PM_CLK_PER;
 		break;

Best regards,

Oliver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 3829 bytes
Desc: PGP-Schl?ssel 0x00C0A76606F3A5480813234EEF50CD4BA60B1294.
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20201112/cf07360b/attachment.key>