From patchwork Thu Nov 24 22:12:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Kochetkov X-Patchwork-Id: 9446321 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 6F438606DB for ; Thu, 24 Nov 2016 22:14:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5BE1B27F88 for ; Thu, 24 Nov 2016 22:14:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DADB27FA3; Thu, 24 Nov 2016 22:14:05 +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=unavailable 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 D746827F88 for ; Thu, 24 Nov 2016 22:14:04 +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 1cA2G7-0004o8-HW; Thu, 24 Nov 2016 22:12:47 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cA2G2-0004em-PC; Thu, 24 Nov 2016 22:12:44 +0000 Received: by mail-lf0-x241.google.com with SMTP id 98so2503634lfs.0; Thu, 24 Nov 2016 14:12:22 -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; bh=9aGDTqJ7wOx4EJyVGKvaYLFyEvyvZgxovzLRWRO/gCQ=; b=fzK8JG41y8vHs/b5ebgGXMYSiPoCqCyBKj+4feiGtATOF8LNckK0avXZYpMz83seqn RFFzEhLsRnzt5TGFld1blZxw1W/BJh7qhDRPtcmqcN+iYQHjd2hvh0JJkYe7+p9f4URY oaJHZUBe2po7myRP6sKE43mOFuSVpfDVJN4hZ8K8wnGHsH+S/Lc5Oeesk8qncBIFP1K6 CxApi6FetSkW7PKH9Q6OtVbsymwnlOegO4zVKc2TRvGkg8w4EtOFGgHAT16MA31QXr/i zvNb5AueRvxZu0oDZ8t9atGtd1mq4hyTaQbg6D5rZ0U2Ke1ROqb6XOmYSe5P2S6i3TIR wwoA== 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; bh=9aGDTqJ7wOx4EJyVGKvaYLFyEvyvZgxovzLRWRO/gCQ=; b=BwiBhI0oyCsuajhr/3wnHfvnJFr0nulabpml91Yul0MKhVA43wIZcqhPbkVgLRGhgm blpfXLbNlG3/5/eIns5Vdu+Fmhx+Q5Z/Dq202KO3OWtFWwgnbKsLcTpk77hN7SvfPWil FORoN9UFwlvRr9dy8MeLvuQy6McyFT++NaukNZi99+ymzta+Pr/5+0xgY8b++UykfgdD vub7tBVo0eiQRY983P+TC0b9fhbXzngwqxbhCMRHqlhHkDDVV1UiIPk1ZNKln6hrBX6E ETCYnUWn2+c2OAI2WZlaEd4phD7Lxfq0BIhDRZ4A8UhG+mVUKA2C72gk7DXkWAi0Nbwo AJoQ== X-Gm-Message-State: AKaTC01NVOCHl8EyZE5bXKdAqaBoCTohFEAE+QQ/hThMkq+2I2MrhtFsdkX4g7bWGwa/1A== X-Received: by 10.25.139.195 with SMTP id n186mr1895986lfd.27.1480025540432; Thu, 24 Nov 2016 14:12:20 -0800 (PST) Received: from localhost.localdomain ([79.164.63.174]) by smtp.gmail.com with ESMTPSA id q19sm8691205lfi.1.2016.11.24.14.12.19 (version=TLS1_1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Nov 2016 14:12:19 -0800 (PST) From: Alexander Kochetkov To: robh+dt@kernel.org, mark.rutland@arm.com, wxt@rock-chips.com, daniel.lezcano@linaro.org, huangtao@rock-chips.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: document how to setup rockchip timers as clocksource Date: Fri, 25 Nov 2016 01:12:16 +0300 Message-Id: <1480025536-6837-1-git-send-email-al.kochet@gmail.com> X-Mailer: git-send-email 1.7.9.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161124_141243_137506_AFC2299D X-CRM114-Status: UNSURE ( 9.61 ) 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 The patch describes how to setup rockchip timers in device tree so they can be used as clocksource. I'm going to implement this feature. Signed-off-by: Alexander Kochetkov --- .../bindings/timer/rockchip,rk-timer.txt | 35 +++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt b/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt index 7bc9691..15f8fed 100644 --- a/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt +++ b/Documentation/devicetree/bindings/timer/rockchip,rk-timer.txt @@ -16,7 +16,18 @@ Required properties: - clock-names : must include the following entries: "timer", "pclk" -Example: +Note: +If device tree contain only one timer, than the timer will be intialized +as clockevent provider. If device tree contain two timers, than first timer +will be initialized as clockevent provider and second one as clocksource. + +If you want to bind specific timer as clockevent (i.e. one from alive subsystem) +and specific timer as clocksource, you can number the timers in "aliases" node. + +If device tree contain only one timer and the timer is named as timer1 in +"aliases" node, then the timer will be initialized as clocksource. + +Example (clockevent only): timer: timer@ff810000 { compatible = "rockchip,rk3288-timer"; reg = <0xff810000 0x20>; @@ -24,3 +35,25 @@ Example: clocks = <&xin24m>, <&cru PCLK_TIMER>; clock-names = "timer", "pclk"; }; + +Example (clockevent and clocksource with explicit numbering): + aliases { + timer0 = &timer6; + timer1 = &timer5; + }; + + timer5: timer@20038080 { + compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer"; + reg = <0x20038080 0x20>; + interrupts = ; + clocks = <&cru SCLK_TIMER5>, <&cru PCLK_TIMER0>; + clock-names = "timer", "pclk"; + }; + + timer6: timer@200380A0 { + compatible = ""rockchip,rk3188-timer", rockchip,rk3288-timer"; + reg = <0x200380A0 0x20>; + interrupts = ; + clocks = <&cru SCLK_TIMER6>, <&cru PCLK_TIMER0>; + clock-names = "timer", "pclk"; + };