All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] mx6: peripheral clock from oscillator
@ 2020-10-23 19:18 Jorge Ramirez-Ortiz
  2020-10-25 13:12 ` Fabio Estevam
  2020-11-02  8:08 ` sbabic at denx.de
  0 siblings, 2 replies; 3+ messages in thread
From: Jorge Ramirez-Ortiz @ 2020-10-23 19:18 UTC (permalink / raw)
  To: u-boot

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.

Systems running I2C from OP-TEE before Linux executes - for example to
access a Secure Element [2] providing the cryptographic support - expect
this clock to be configured by the bootloader [3].

[1] IMX6SLCE Rev. 5, 02/2019, ERR007805.
[2] OP-TEE: support for NXP SE05X Plug and Trust (patch on the list).
[3] OP-TEE: check the imx_i2c.c driver (imx6 patch on the list).

Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
---
 arch/arm/mach-imx/mx6/soc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index e129286065..4c0a352574 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -26,6 +26,9 @@
 #include <imx_thermal.h>
 #include <mmc.h>
 
+#define has_err007805() \
+	(is_mx6sl() || is_mx6dl() || is_mx6solo() || is_mx6ull())
+
 struct scu_regs {
 	u32	ctrl;
 	u32	config;
@@ -469,7 +472,7 @@ int arch_cpu_init(void)
 	}
 
 	/* Set perclk to source from OSC 24MHz */
-	if (is_mx6sl())
+	if (has_err007805())
 		setbits_le32(&ccm->cscmr1, MXC_CCM_CSCMR1_PER_CLK_SEL_MASK);
 
 	imx_wdog_disable_powerdown(); /* Disable PDE bit of WMCR register */
-- 
2.17.1

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

* [PATCHv2] mx6: peripheral clock from oscillator
  2020-10-23 19:18 [PATCHv2] mx6: peripheral clock from oscillator Jorge Ramirez-Ortiz
@ 2020-10-25 13:12 ` Fabio Estevam
  2020-11-02  8:08 ` sbabic at denx.de
  1 sibling, 0 replies; 3+ messages in thread
From: Fabio Estevam @ 2020-10-25 13:12 UTC (permalink / raw)
  To: u-boot

On Fri, Oct 23, 2020 at 4:18 PM Jorge Ramirez-Ortiz <jorge@foundries.io> wrote:
>
> 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.
>
> Systems running I2C from OP-TEE before Linux executes - for example to
> access a Secure Element [2] providing the cryptographic support - expect
> this clock to be configured by the bootloader [3].
>
> [1] IMX6SLCE Rev. 5, 02/2019, ERR007805.
> [2] OP-TEE: support for NXP SE05X Plug and Trust (patch on the list).
> [3] OP-TEE: check the imx_i2c.c driver (imx6 patch on the list).
>
> Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>

Reviewed-by: Fabio Estevam <festevam@gmail.com>

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

* [PATCHv2] mx6: peripheral clock from oscillator
  2020-10-23 19:18 [PATCHv2] mx6: peripheral clock from oscillator Jorge Ramirez-Ortiz
  2020-10-25 13:12 ` Fabio Estevam
@ 2020-11-02  8:08 ` sbabic at denx.de
  1 sibling, 0 replies; 3+ messages in thread
From: sbabic at denx.de @ 2020-11-02  8:08 UTC (permalink / raw)
  To: u-boot

> 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.
> Systems running I2C from OP-TEE before Linux executes - for example to
> access a Secure Element [2] providing the cryptographic support - expect
> this clock to be configured by the bootloader [3].
> [1] IMX6SLCE Rev. 5, 02/2019, ERR007805.
> [2] OP-TEE: support for NXP SE05X Plug and Trust (patch on the list).
> [3] OP-TEE: check the imx_i2c.c driver (imx6 patch on the list).
> Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
> Reviewed-by: Fabio Estevam <festevam@gmail.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2020-11-02  8:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-23 19:18 [PATCHv2] mx6: peripheral clock from oscillator Jorge Ramirez-Ortiz
2020-10-25 13:12 ` Fabio Estevam
2020-11-02  8:08 ` sbabic at denx.de

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.