From patchwork Mon Nov 28 14:31:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 9449649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0EE40600CB for ; Mon, 28 Nov 2016 14:36:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 056B627C0C for ; Mon, 28 Nov 2016 14:36:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAF5327CEA; Mon, 28 Nov 2016 14:36:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 82FFE27BFC for ; Mon, 28 Nov 2016 14:36:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cBN1G-0000sv-Sf; Mon, 28 Nov 2016 14:34:58 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cBMyM-0007aY-EA; Mon, 28 Nov 2016 14:32:01 +0000 Received: by mail-lf0-x242.google.com with SMTP id o141so9692394lff.1; Mon, 28 Nov 2016 06:31:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1l25gacJ7T5fvL6QOYGmS75Zv9MeqfWWeVe1vOOz530=; b=oN0h9cpQCtY8tQLj0kl/wXT3An9eJFKBYhZ8rO1bMMl5Nx7lmTFCRRGIin5uQKK2bo nAOhpBgJwm7wXGB1Ov34HA7edK5BaXCn/Exzb+AxyaWFl5aTrKM5QoUboyuwUdieM5h9 Y0m9n7MZv5QjzbVEPXkKJ+h7ZYlz8p8Yt6Hbj5n0ph53BVfgf3JC4hUTU3oAU2B/0RHj sKDEyWBoNWBg+aXwVVztda2cXzQNT0T6TkSuF+0RgSpLf8YlMA2muckGXIQT0A8gzkLm 1OgbAJS1JW/uy9IFA4aUnzBHgb3qdAcRtJuTVz/e9V2C8KiF2K1Ztf4CAQ4Yo7GiKLCZ zmIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1l25gacJ7T5fvL6QOYGmS75Zv9MeqfWWeVe1vOOz530=; b=TqgCOH3RgSEyOSBchd7/hdwPHmB2lFv05SfzllsgtR6sjqi4ZQwvouaAW/QPFzjtkq ayel9I6mSezFlkz9prijb8GFr8Ael4F1X0xl+Pw87iQqIy4LQK4r0hyoBK3OiXMEJcBo 2skf75Du/SMf/m/TAW04rXWIBu9CeKvagL/i1Abg5/WdVfYXzphVYtC98RnefNDlCuB9 2okBWn4+AH/a9hXQ4s8LNBF7XIOT/9+wO0kdqkWAsSFACueRsN39bJaL2SichyKyyN6s uaEtHrBBGv5QUP7wjZms19na5LdWZBbJgLyKpcdYWqUY7TnYCyuVnTEuWIQn5aIlK2+G gOiA== X-Gm-Message-State: AKaTC03PPO47tizu0A6IIb8DZTDfGbmtTjgeEclOHBqUTsjHqIB0nSHlOTvqnf0l27utkQ== X-Received: by 10.25.228.88 with SMTP id b85mr8450843lfh.100.1480343501494; Mon, 28 Nov 2016 06:31:41 -0800 (PST) Received: from ubuntu.lintech.local ([185.35.119.87]) by smtp.gmail.com with ESMTPSA id h30sm12816162lji.28.2016.11.28.06.31.40 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Nov 2016 06:31:40 -0800 (PST) From: Alexander Kochetkov To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCHv2 09/11] clocksource/drivers/rockchip_timer: implement loading 64bit value into timer Date: Mon, 28 Nov 2016 17:31:24 +0300 Message-Id: <1480343486-25539-10-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1480343486-25539-1-git-send-email-al.kochet@gmail.com> References: <1480343486-25539-1-git-send-email-al.kochet@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161128_063158_933231_EB050100 X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Huang Tao , Heiko Stuebner , Alexander Kochetkov , Daniel Lezcano , Russell King , Rob Herring , Thomas Gleixner , Caesar Wang MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Alexander Kochetkov --- drivers/clocksource/rockchip_timer.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/clocksource/rockchip_timer.c b/drivers/clocksource/rockchip_timer.c index 61c3bb1..c2b0454 100644 --- a/drivers/clocksource/rockchip_timer.c +++ b/drivers/clocksource/rockchip_timer.c @@ -63,11 +63,13 @@ static inline void rk_timer_enable(struct rk_timer *timer, u32 flags) writel_relaxed(TIMER_ENABLE | flags, timer->ctrl); } -static void rk_timer_update_counter(unsigned long cycles, - struct rk_timer *timer) +static void rk_timer_update_counter(u64 cycles, struct rk_timer *timer) { - writel_relaxed(cycles, timer->base + TIMER_LOAD_COUNT0); - writel_relaxed(0, timer->base + TIMER_LOAD_COUNT1); + u32 lower = cycles & 0xFFFFFFFF; + u32 upper = (cycles >> 32) & 0xFFFFFFFF; + + writel_relaxed(lower, timer->base + TIMER_LOAD_COUNT0); + writel_relaxed(upper, timer->base + TIMER_LOAD_COUNT1); } static void rk_timer_interrupt_clear(struct rk_timer *timer)