From patchwork Mon Oct 19 14:23:29 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: 1384350 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.20150623.gappssmtp.com header.i=@foundries-io.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=oht0f4Et; 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)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CFJsX1BPTz9sSC for ; Tue, 20 Oct 2020 01:23:59 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E26E281F7C; Mon, 19 Oct 2020 16:23:47 +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.20150623.gappssmtp.com header.i=@foundries-io.20150623.gappssmtp.com header.b="oht0f4Et"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12292822CD; Mon, 19 Oct 2020 16:23:47 +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=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 419DB81B79 for ; Mon, 19 Oct 2020 16:23:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=jorge@foundries.io Received: by mail-wr1-x442.google.com with SMTP id s9so11659878wro.8 for ; Mon, 19 Oct 2020 07:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries-io.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=odH212YJIlKLYJ5ZYUoXbPgYBZ4oV7fGAfwNyF43Jm8=; b=oht0f4EtzlUuP4i55Y+vAy2uPBxZASXgGJhJOBNhhb3EtFIPtPSDyHmGvkoS6Eev3o 6Dn92jXMWT+Wa6MfTZXnCSM9JX7EmX9aOsvcuyqpnc0e81jv2+b6+ojpiMkIOh7q31a8 Z7DXYWF5A5bXmHItlUknFKpy3ecFWgE3eAlPzhG49W+xSkhUIO23doitnK7BRjPbunfP ma4uDi2LsvcHzIoLe0O7QT9Uv8yF6xBwsTPY9wi7g5HgIjJu8seO925v1F+coF0zAU+z vhHwzrH3SfmIzWPvMNzuoNb6cB1UzRQaJDOeECTWDXGqppwGIOcUEF5G/R0x8KTkEeU1 cGuw== 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=odH212YJIlKLYJ5ZYUoXbPgYBZ4oV7fGAfwNyF43Jm8=; b=aT9lB59f23CuWZp9FaUMAsHAwtU02ix2ThmmFzep9Uv/p7tzBS4FjSSYHrimhU8AfH 0+hpFK7oVNoRkOXDx7ON4+s/kyz9a6Gf8iFCarNZi2diaYtQ4Un1Z92Q+m+aS8nOkMjl PlTyoQw8LjUgS8eQtNnbZwPBtCR4u08MTCZ231y33NXPk76OtM7WKnM97dRqdwOm+V0a 4iTKxwn5UTrRcOIn7hDIcAXxyErI0niSjk1XhbQaq6bX3sSWVyuzSLgn8DCZjhfSWMQw n1JgZVjFzU8oOc2xOJKq4+fEo7E7XTBU9ci1YyBQBCb7ktBHG2vvqGGRz6AGOPxsuYEc 4x1w== X-Gm-Message-State: AOAM531S4sS1QZW/28Rf+HmbX9SEFEcQT9njZFGwv4DEn+JpMhIrogu7 v2jXuTCZEnEmViPkCBC0MOiceA== X-Google-Smtp-Source: ABdhPJy42bYqopzIuM76gWUVA5PfHB2OhAejWPm+DL8cVCmpnt+nbqC9fExbYPE7FA95LxyRsPl8xg== X-Received: by 2002:a5d:4843:: with SMTP id n3mr20683213wrs.416.1603117413586; Mon, 19 Oct 2020 07:23:33 -0700 (PDT) Received: from localhost.localdomain (155.red-176-86-137.dynamicip.rima-tde.net. [176.86.137.155]) by smtp.gmail.com with ESMTPSA id 30sm18720425wrs.84.2020.10.19.07.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 07:23:32 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, festevam@gmail.com, sbabic@denx.de, peng.fan@nxp.com Cc: uboot-imx@nxp.com, u-boot@lists.denx.de, mike@foundries.io Subject: [PATCH] mx6: peripheral clock from oscillator Date: Mon, 19 Oct 2020 16:23:29 +0200 Message-Id: <20201019142329.2103-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. [1] Rev 2, 10/2019, ERR007805 Signed-off-by: Jorge Ramirez-Ortiz --- arch/arm/mach-imx/mx6/soc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c index e129286065..f498c93b00 100644 --- a/arch/arm/mach-imx/mx6/soc.c +++ b/arch/arm/mach-imx/mx6/soc.c @@ -26,6 +26,8 @@ #include #include +#define ERRATA_ERR007805 (is_mx6dl() || is_mx6solo() || is_mx6ull()) + struct scu_regs { u32 ctrl; u32 config; @@ -469,7 +471,7 @@ int arch_cpu_init(void) } /* Set perclk to source from OSC 24MHz */ - if (is_mx6sl()) + if (is_mx6sl() || ERRATA_ERR007805) setbits_le32(&ccm->cscmr1, MXC_CCM_CSCMR1_PER_CLK_SEL_MASK); imx_wdog_disable_powerdown(); /* Disable PDE bit of WMCR register */