Skip to contentSkip to conversation

mx6: peripheral clock from oscillator

PATCH New Jorge Ramirez-Ortiz 4 participants 6 messages Oct 14, 2020 – Oct 19, 2020

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

PATCH 1/1 mx6: peripheral clock from oscillator

In order to be able to run the I2C bus at 400Khz, the chip errata[1] recommends that the peripheral clock runs out of the 24MHz oscillator.

[1] Rev 2, 10/2019, ERR007805

---
 arch/arm/mach-imx/mx6/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +1 -1
index e129286065..1da250bbcd 100644
@@ -469,7 +469,7 @@ int arch_cpu_init(void)
 	}
 
 	/* Set perclk to source from OSC 24MHz */
-	if (is_mx6sl())
+	if (is_mx6sl() || is_mx6ull())
 		setbits_le32(&ccm->cscmr1, MXC_CCM_CSCMR1_PER_CLK_SEL_MASK);
 
 	imx_wdog_disable_powerdown(); /* Disable PDE bit of WMCR register */
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 mx6: peripheral clock from oscillator

any thoughts?

Quoted 26 lines · Jorge Ramirez-Ortiz

In order to be able to run the I2C bus at 400Khz, the chip errata[1] recommends that the peripheral clock runs out of the 24MHz oscillator.

[1] Rev 2, 10/2019, ERR007805

---
 arch/arm/mach-imx/mx6/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +1 -1
index e129286065..1da250bbcd 100644
@@ -469,7 +469,7 @@ int arch_cpu_init(void)
 	}
 
 	/* Set perclk to source from OSC 24MHz */
-	if (is_mx6sl())
+	if (is_mx6sl() || is_mx6ull())
 		setbits_le32(&ccm->cscmr1, MXC_CCM_CSCMR1_PER_CLK_SEL_MASK);
 
 	imx_wdog_disable_powerdown(); /* Disable PDE bit of WMCR register */
Signature · 1 line
2.17.1
#2 lore raw

PATCH 1/1 mx6: peripheral clock from oscillator

In reply to Jorge Ramirez-Ortiz
Quoted 25 lines

Subject: [PATCH] mx6: peripheral clock from oscillator

In order to be able to run the I2C bus at 400Khz, the chip errata[1] recommends that the peripheral clock runs out of the 24MHz oscillator.

[1] Rev 2, 10/2019, ERR007805

---
 arch/arm/mach-imx/mx6/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +1 -1
index e129286065..1da250bbcd 100644
@@ -469,7 +469,7 @@ int arch_cpu_init(void)
 	}
 
 	/* Set perclk to source from OSC 24MHz */
-	if (is_mx6sl())
+	if (is_mx6sl() || is_mx6ull())
 		setbits_le32(&ccm->cscmr1,
 MXC_CCM_CSCMR1_PER_CLK_SEL_MASK);
 
Quoted 3 lines

imx_wdog_disable_powerdown(); /* Disable PDE bit of WMCR register
*/
--

reviewer
#3 lore raw

PATCH 1/1 mx6: peripheral clock from oscillator

In reply to Jorge Ramirez-Ortiz

Hi Jorge,

Quoted 16 lines · Jorge Ramirez-Ortiz

In order to be able to run the I2C bus at 400Khz, the chip errata[1] recommends that the peripheral clock runs out of the 24MHz oscillator.

[1] Rev 2, 10/2019, ERR007805

---
 arch/arm/mach-imx/mx6/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +0 -0
index e129286065..1da250bbcd 100644

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 472

Quoted 5 lines
arch/arm/mach-imx/mx6/soc.c +1 -1
@@ -469,7 +469,7 @@ int arch_cpu_init(void)
        }
 
        /* Set perclk to source from OSC 24MHz */
-       if (is_mx6sl())
+       if (is_mx6sl() || is_mx6ull())

According to https://www.nxp.com/docs/en/errata/IMX6SDLCE.pdf the mx6solo and mx6dl are also affected by ERR007805.

These variants should be handled too.

#4 lore raw

PATCH 1/1 mx6: peripheral clock from oscillator

Quoted 21 lines · Fabio Estevam

Hi Jorge,

Quoted 18 lines · Jorge Ramirez-Ortiz

In order to be able to run the I2C bus at 400Khz, the chip errata[1] recommends that the peripheral clock runs out of the 24MHz oscillator.

[1] Rev 2, 10/2019, ERR007805

---
 arch/arm/mach-imx/mx6/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +0 -0
index e129286065..1da250bbcd 100644
@@ -469,7 +469,7 @@ int arch_cpu_init(void)
        }
 
Quoted 6 lines

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 472

Quoted 3 lines
arch/arm/mach-imx/mx6/soc.c +1 -1
        /* Set perclk to source from OSC 24MHz */
-       if (is_mx6sl())
+       if (is_mx6sl() || is_mx6ull())

According to https://www.nxp.com/docs/en/errata/IMX6SDLCE.pdf the mx6solo and mx6dl are also affected by ERR007805.

ah ok, I'll repost.

just as background info, this is needed in order for OP-TEE to access the EdgeLock SE050 secure element at a decent speed. I couldnt merge the support for the imx6ul i2c driver during the last OP-TEE release but will try again when I find some time (surely before their next release)

Quoted 2 lines

These variants should be handled too.

#5 lore raw

PATCH 1/1 mx6: peripheral clock from oscillator

Quoted 29 lines · Foundries
Quoted 21 lines · Fabio Estevam

Hi Jorge,

Quoted 18 lines · Jorge Ramirez-Ortiz

In order to be able to run the I2C bus at 400Khz, the chip errata[1] recommends that the peripheral clock runs out of the 24MHz oscillator.

[1] Rev 2, 10/2019, ERR007805

---
 arch/arm/mach-imx/mx6/soc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-imx/mx6/soc.c +0 -0
index e129286065..1da250bbcd 100644
@@ -469,7 +469,7 @@ int arch_cpu_init(void)
        }
 
Quoted 6 lines

arch/arm/mach-imx/mx6/soc.c int arch_cpu_init(void) · line 472

Quoted 3 lines
arch/arm/mach-imx/mx6/soc.c +1 -1
        /* Set perclk to source from OSC 24MHz */
-       if (is_mx6sl())
+       if (is_mx6sl() || is_mx6ull())

According to https://www.nxp.com/docs/en/errata/IMX6SDLCE.pdf the mx6solo and mx6dl are also affected by ERR007805.

Quoted 11 lines

ah ok, I'll repost.

just as background info, this is needed in order for OP-TEE to access the EdgeLock SE050 secure element at a decent speed. I couldnt merge the support for the imx6ul i2c driver during the last OP-TEE release but will try again when I find some time (surely before their next release)

Quoted 2 lines

These variants should be handled too.

I just reposted but realized I forgot to ammend the patch version. let me know if you would like me to repost with that corrected or if that is ok.