From patchwork Tue Sep 26 14:02:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Schulz X-Patchwork-Id: 114265 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp3872001qgf; Tue, 26 Sep 2017 07:03:12 -0700 (PDT) X-Google-Smtp-Source: AOwi7QBEEf6YeU4hSPhP+C+EMz1vF8Xp10rE93IedUQkbGrsJDTDt4AnTWE6EuWoTzQmnGPpbuha X-Received: by 10.80.173.80 with SMTP id z16mr17714929edc.133.1506434592511; Tue, 26 Sep 2017 07:03:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506434592; cv=none; d=google.com; s=arc-20160816; b=LPbxx38oLizE9sK5lZ9V4WrHFYkHuTcs5IDWf3UwZSKDI9/xF5+04wViyZtSuwt9Us mkUhk4qXxtvMdVYzGGNbljx5THAZieSWO9q9wcsL6ejClzgGmnipX/5X/xZWQ1glog5l 6LkjQAOCAyIUlRSkz/bXi4Nul2rCSXaj8627oxi1IpmACqWP8zAypnJ+ncK1BVkVAl2G T9oYwL6t4ORL+obk26P2A6CKKQLay6U8PGlt7AcRKjfgbBc/i6CSDcCO7bsO+MOUNTF7 yWp338ib3Wp1K+Lz7KDRo4tixeouheILkH8pVb4e6ADH6dCubnKsBHP7j0T/VEPKGjl5 5amg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=NYfHsVVToxysFbWrW43LBMvsgRL1HxSI+9By8zslI64=; b=oBB6L+kdrrpvoo7dlc6yvOlwW0gvwBSa2DgLBPYWj+tht+WVPd8bAl+o+iCz46TUk7 X3WU09F+Gpw6mCoMRPnhDOX3SB/6bTvMVM2I7tXkZVxTWah1TCfGZM8WEAQU7DQoJs50 IZTCH21AU7FsgAzvwI499s3Tj9bKnzRyx5kpuNdEDM1sVmZ6eRFI9RRRC08XGubKC+IZ GfPZfKC1zY6J6WJWrDlhS4WwwMDLeLAjFMMLE7VR3J1dmLTe6ZhMDiIORz6TnDnnXvhn Z2G1nysYpINZsEG38EP/m5XGlW5/mcSU15BDuxeF1d8vEUP1DC1k3izLFcVEqJjFnFUk KQdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id v21si5927115edb.130.2017.09.26.07.03.11; Tue, 26 Sep 2017 07:03:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 58E32C21E2C; Tue, 26 Sep 2017 14:03:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id D7D87C21D64; Tue, 26 Sep 2017 14:03:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5B1F9C21D64; Tue, 26 Sep 2017 14:03:07 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 047E8C21C93 for ; Tue, 26 Sep 2017 14:03:07 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id BB5EA208A5; Tue, 26 Sep 2017 16:03:05 +0200 (CEST) Received: from localhost.localdomain (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 814A52089B; Tue, 26 Sep 2017 16:03:05 +0200 (CEST) From: Quentin Schulz To: jagan@openedev.com, maxime.ripard@free-electrons.com, albert.u.boot@aribaud.net Date: Tue, 26 Sep 2017 16:02:47 +0200 Message-Id: <20170926140247.26236-1-quentin.schulz@free-electrons.com> X-Mailer: git-send-email 2.11.0 Cc: u-boot@lists.denx.de, hdegoede@redhat.com Subject: [U-Boot] [PATCH] sunxi: clk: fix N formula for CPUX clocks X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" As explained in arch/arm/mach-sunxi/clock_sun8i_a83t.c, clk for CPU clusters is computed as clk = 24*n. However, the current formula is clk = 24*(n-1). This results in a clock set to a frequency that isn't specified as possible for CPUs. Let's use the correct formula. Fixes: f542948b1e8c ("sunxi: clk: add basic clocks for A83T") Signed-off-by: Quentin Schulz Acked-by: Maxime Ripard --- arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h b/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h index 5e1346e524..c4f5f5f958 100644 --- a/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h +++ b/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h @@ -158,7 +158,7 @@ struct sunxi_ccm_reg { #define CPU_CLK_SRC_OSC24M 0 #define CPU_CLK_SRC_PLL1 1 -#define CCM_PLL1_CTRL_N(n) ((((n) - 1) & 0xff) << 8) +#define CCM_PLL1_CTRL_N(n) (((n) & 0xff) << 8) #define CCM_PLL1_CTRL_P(n) (((n) & 0x1) << 16) #define CCM_PLL1_CTRL_EN (0x1 << 31) #define CMM_PLL1_CLOCK_TIME_2 (0x2 << 24)