Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1080067imm; Wed, 8 Aug 2018 10:22:18 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwqRhKoAFRe0d24D5QGKQP1iYa4bIbAv/TN982aRv1+0Fo0gKDgrPEjtGWEWfhBZHUcOz2e X-Received: by 2002:a63:8341:: with SMTP id h62-v6mr3298110pge.298.1533748938374; Wed, 08 Aug 2018 10:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533748938; cv=none; d=google.com; s=arc-20160816; b=W5pStooHPJL4KBNbVmcQdqGsKghpKkT5pS84F4WxVkWblzsdPVBpzE3DI3keFrAB2J WvjonxHgctoFLqEFbb3vMLkhZLW0uxuqviHEQAUGY5ccIzge3ixCAHFlPRtWiytwwjUV 856WjzHd9QchAg6dmewQS0s8Bg5C9g+CTjLot4kSQIkTK/WDXSated5y2Hzh2X2v/uPM B69swr/9FPy49SAALXawPTnc3S49K7pjbqAqwcN+oXlJ63YbhEkguhNzlANO8zIe8zoS iOMGzKYZyYIPr49mheSx4d+CWvzhIiqNxo/SCesA00oE4nrUUU9mv1IPkUAeBB/AUUR8 NK8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ogDsiPMtuBQ4Z5GoBw0whuxNbGwhA8uQEBejwN1rH7U=; b=RxoH/LVDYhHwE0gdVRqEJClF0C7QnTdCZ1uoCWitrwib+r/3w9gbKMuPtm6L6ss3So yNjIb60+jr5e7judtqpJy6Lelt1lxURhQmDJ0zaW0/Uc25XQNmZshgvKYnBdkfCZdUeG d3BoLSE851qQzFK4EYKu9CdpHuEPNK2GMecMnzWR6+/I2TrvLvhj49crBdwUXkoG8UlO 5Ws2LfZbwGryD3xdN6PCIUBTsez9FIiqodIhjiDRMwl03CRVokITGSlVx0OY+0Pv3fiA pOGpYoMLzUHOCjrDS7VmVQxBnAhGEkbLVKSLyLpO1z6yag8sJgxxZTA3tvNcqPqS3xsF LMgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h187-v6si5302458pfb.62.2018.08.08.10.22.03; Wed, 08 Aug 2018 10:22:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729638AbeHHTlo (ORCPT + 99 others); Wed, 8 Aug 2018 15:41:44 -0400 Received: from hermes.aosc.io ([199.195.250.187]:53972 "EHLO hermes.aosc.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727472AbeHHTln (ORCPT ); Wed, 8 Aug 2018 15:41:43 -0400 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 56431BDE6A; Wed, 8 Aug 2018 17:20:56 +0000 (UTC) From: Icenowy Zheng To: Maxime Ripard , Chen-Yu Tsai Cc: linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Icenowy Zheng , stable@vger.kernel.org Subject: [PATCH] clk: sunxi-ng: fix H6 bus clocks divider position Date: Thu, 9 Aug 2018 01:19:52 +0800 Message-Id: <20180808171952.17263-1-icenowy@aosc.io> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The bus clocks (AHB/APB) on Allwinner H6 have their second divider start at bit 8, according to the user manual and the BSP code. However, currently the divider is wrongly set to 16, thus the divider is not correctly read and the clock frequency is not correctly calculated. Fix this bit offset on all affected bus clocks in ccu-sun50i-h6. Cc: stable@vger.kernel.org # v4.17.y Signed-off-by: Icenowy Zheng --- drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c index bdbfe78fe133..0f7a0ffd3f70 100644 --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c @@ -224,7 +224,7 @@ static SUNXI_CCU_MP_WITH_MUX(psi_ahb1_ahb2_clk, "psi-ahb1-ahb2", psi_ahb1_ahb2_parents, 0x510, 0, 5, /* M */ - 16, 2, /* P */ + 8, 2, /* P */ 24, 2, /* mux */ 0); @@ -233,19 +233,19 @@ static const char * const ahb3_apb1_apb2_parents[] = { "osc24M", "osc32k", "pll-periph0" }; static SUNXI_CCU_MP_WITH_MUX(ahb3_clk, "ahb3", ahb3_apb1_apb2_parents, 0x51c, 0, 5, /* M */ - 16, 2, /* P */ + 8, 2, /* P */ 24, 2, /* mux */ 0); static SUNXI_CCU_MP_WITH_MUX(apb1_clk, "apb1", ahb3_apb1_apb2_parents, 0x520, 0, 5, /* M */ - 16, 2, /* P */ + 8, 2, /* P */ 24, 2, /* mux */ 0); static SUNXI_CCU_MP_WITH_MUX(apb2_clk, "apb2", ahb3_apb1_apb2_parents, 0x524, 0, 5, /* M */ - 16, 2, /* P */ + 8, 2, /* P */ 24, 2, /* mux */ 0); -- 2.18.0