From patchwork Wed Nov 23 17:29:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 9443979 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 604B26075F for ; Wed, 23 Nov 2016 17:33:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B0402679B for ; Wed, 23 Nov 2016 17:33:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5D00A27165; Wed, 23 Nov 2016 17:33:13 +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 0452B2679B for ; Wed, 23 Nov 2016 17:33:13 +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 1c9bOa-0007Cg-EJ; Wed, 23 Nov 2016 17:31:44 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9bN3-0005Ow-K1; Wed, 23 Nov 2016 17:30:11 +0000 Received: by mail-lf0-x243.google.com with SMTP id p100so628172lfg.2; Wed, 23 Nov 2016 09:29:49 -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=QVZ+UbnNNE2WtE6wFoX7EaTtSI6Kd6zTKUOGNx0w/0g=; b=qlwwWrNyXYMmYevBVCX/nkq/eBpHSPgFfKtQtalMJoNtv6hk5sz6i+FH0biH+FhFR1 7F/xPkDBWGDZq4Lxv6CLm1ZsGRXMPLIA5SH8snEC+5cwjO7BzxLsD06a86ElmktnZ3g2 oCLjEIhYbEJcmXuXROc/6FskPO71a6b/H/IVJ53Ys2TCYVWkh/gf/nlmt51EG56AWlIM 6N4EJJhNfL3vYdVayK5U8g2MJc6TFaZfRD7mf8y33esqiire1/ifTeseXYyWGQt/cSGZ tncBmj1yeb6nwCFAJGTi7ZXlFie85anWkXiIs9iAu+hHxqKHqRq6DrgdZ2OgRa0JYwp6 t3zQ== 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=QVZ+UbnNNE2WtE6wFoX7EaTtSI6Kd6zTKUOGNx0w/0g=; b=WoUISmIH40x6SALNlzBxMGTOXdC+fa+bJw+cHxrlaSPCJoJLpXAa9OJzDx5EKu5Zc6 JtJYG9CFLn6I4znSoSEDhUHhpLBj/yPgyDxzF+dmEig2YY72v1H7lioufhy95XZwsgcu tgLOlE/gYDdOasle4A1bW9JVAWk4b6qtuCM+R1624asfq8aazARgoWlYgLM0LdAMWChQ i5Ls/A0JtXb3ChPF19/FpEaguIu0bI1yBiWkLNKB4UnbQC47STW8XBUV7MUtIEtpdwpM kcqKx4FhcYUVOfEXaNTZUMz1WKpdHfWDV0G0/JFoHCuhyljQ4XAr+VKNxu2LEAAJUupB UEkA== X-Gm-Message-State: AKaTC03AwzZtVstlc8jfTdrXNQpo5iMT5XxTWLcAoQFZU7c0MW4mE0IlC8FYKPc+i7cYEw== X-Received: by 10.25.213.68 with SMTP id m65mr1236270lfg.43.1479922187365; Wed, 23 Nov 2016 09:29:47 -0800 (PST) Received: from ubuntu.lintech.local ([185.35.119.87]) by smtp.gmail.com with ESMTPSA id h71sm7455138ljh.21.2016.11.23.09.29.46 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Nov 2016 09:29:46 -0800 (PST) From: Alexander Kochetkov To: daniel.lezcano@linaro.org, tglx@linutronix.de, heiko@sntech.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Subject: [PATCH 5/9] clocksource/drivers/rockchip_timer: implement loading 64bit value into timer Date: Wed, 23 Nov 2016 20:29:33 +0300 Message-Id: <1479922177-20136-5-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1479922177-20136-1-git-send-email-al.kochet@gmail.com> References: <1479922177-20136-1-git-send-email-al.kochet@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161123_093010_022334_9FB809D6 X-CRM114-Status: UNSURE ( 8.17 ) 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: Alexander Kochetkov 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 3b530f9..f4c26be 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)