From patchwork Fri Oct 23 19:18:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Jorge Ramirez-Ortiz, Foundries" X-Patchwork-Id: 1386957 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.a=rsa-sha256 header.s=google header.b=dTHblmQl; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CHvDF5bNxz9sSn for ; Sat, 24 Oct 2020 06:18:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA49982424; Fri, 23 Oct 2020 21:18:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.b="dTHblmQl"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BF4EC82440; Fri, 23 Oct 2020 21:18:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D1C5882369 for ; Fri, 23 Oct 2020 21:18:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jorge@foundries.io Received: by mail-wm1-x344.google.com with SMTP id l15so3111638wmi.3 for ; Fri, 23 Oct 2020 12:18:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id; bh=VnPROdBLjQdPDMxUjDMMdIaC52VavzacC3YJ4m2iQpU=; b=dTHblmQl1T4zIUe1MzHZs5J1IN2G7smWH0Q4m+K5SXSF4hOfoIJW8Wyf+kMJaD1yhC /rTij+QYAPLTyrp/4dDyk3HiMVfDDVjQiijyNZjKIYheIFy6ZvJQvDp8LRNk5fSWoFFS rD46uX9z8jHgst10NrGqjobivyuGTR3L5+ER9ToevAr+HncTcmZgFZRLu/2X0R7DE7AE //VVq/wSmQordy0VEU/66MN/P+0nF6dztkqh16WFT5QMO23s7oefuWTMtR1ezvKW1uCT ArvtOuWnL6YlUEqmb2W+QnGsxKNQvl67pnt+rJvhs+VNHG5BuEFzRhhUv7ibxrVrYL3p 4FHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VnPROdBLjQdPDMxUjDMMdIaC52VavzacC3YJ4m2iQpU=; b=ZPpQVQU6H3NlSlkVue0hUqUkB/hTFvw6ErbAwn/p6oP1JomQbVAdl8+NviKSWt11zM bqXtZOPTtgleAXyMNODPUe23RwrhnVgidBoFKykUPeWW2qQyfStv0XbnpTDr8xul2BfD UfmAsRCiUYuRJK+MqqVs4u+CJ5WiSDeLVwf6H0OuatJJlF32HmbtUaP6q248rAwcQl7B /b9LJAiuLZT+fJ2ve+v1dFb5zNPFMvUhQ8b+fLSmwu/qBr2tQ3Yveq5k1/OWnpPUyMZU iiPROHzeN5pmzlUk8QI3p5xNHSTVo5ZwN6kkahPwJxqjxUcK4EKm9uDwaBsbZLllwr0S ToOw== X-Gm-Message-State: AOAM5310F+1UawoTNNVMprDAYAKz5tSVTKKpViPufLGMt1jUCwUesTL8 t5UZMPKkrSQfTJkMMc0/bfDejA== X-Google-Smtp-Source: ABdhPJy60nRRI0D8ffhiySUE9ktkH9Z4lEkw7ZAcR+ganWC0fyW9u/S0nfYojx24DHlfd3JdNM9NXA== X-Received: by 2002:a7b:cf04:: with SMTP id l4mr3782707wmg.33.1603480726137; Fri, 23 Oct 2020 12:18:46 -0700 (PDT) Received: from localhost.localdomain (102.red-95-121-89.dynamicip.rima-tde.net. [95.121.89.102]) by smtp.gmail.com with ESMTPSA id 40sm5134349wrc.46.2020.10.23.12.18.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 12:18:45 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, festevam@gmail.com, sbabic@denx.de Cc: peng.fan@nxp.com, uboot-imx@nxp.com, u-boot@lists.denx.de, mike@foundries.io Subject: [PATCHv2] mx6: peripheral clock from oscillator Date: Fri, 23 Oct 2020 21:18:41 +0200 Message-Id: <20201023191841.15849-1-jorge@foundries.io> X-Mailer: git-send-email 2.17.1 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Fabio Estevam --- 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 #include +#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 */