From patchwork Wed Dec 13 18:53:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 10110673 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 0660660327 for ; Wed, 13 Dec 2017 18:54:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA7728D13 for ; Wed, 13 Dec 2017 18:54:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFC5F28DC8; Wed, 13 Dec 2017 18:54:25 +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.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 60CB528D3E for ; Wed, 13 Dec 2017 18:54:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=zHNAfdOEEYK9x/WTIgiCEoTLFClU3gAjWni8lYH+J00=; b=dJQGFCVcHaMxnrTAlEtTmYsrVq OP1AmZtjB/GJLtDfRVFoSWWlEldX6pZWgVlfyMEA0tau2YD9tdpKGWncJ/j68x/CfajWut+h+Ii8l AkJvCxaNbT+SgJBZ4l4/kEhZe5roPPxXFlqpBZUTKBfnIybQxDUObRIRqNCg1iZeiZzfEJvSMnZmg AKeWAj3/hOYs67F2i+D2EGHRjkCKkDt0ne76g1IHu1fexfxbTLwzEtHK611Ku5mqwrSqEBj61tPmi iQ2nK2IEgVSaArNwu9lrjAWNizexZ9oCnDRUYa6Ljyfw17c0epobF97Qi3nzOTIzPj51Ts9SHpXYX s662UfFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePCAi-0005o9-DZ; Wed, 13 Dec 2017 18:54:24 +0000 Received: from mail.free-electrons.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePCAN-0005TG-Qz for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2017 18:54:06 +0000 Received: by mail.free-electrons.com (Postfix, from userid 110) id F14D820397; Wed, 13 Dec 2017 19:53:40 +0100 (CET) Received: from localhost (unknown [195.53.49.241]) by mail.free-electrons.com (Postfix) with ESMTPSA id B510C207B1; Wed, 13 Dec 2017 19:53:30 +0100 (CET) From: Alexandre Belloni To: Rob Herring , Daniel Lezcano Subject: [PATCH 1/3] dt-bindings: chosen: Add clocksource and clockevent selection Date: Wed, 13 Dec 2017 19:53:11 +0100 Message-Id: <20171213185313.20017-2-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171213185313.20017-1-alexandre.belloni@free-electrons.com> References: <20171213185313.20017-1-alexandre.belloni@free-electrons.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_105404_024128_40BCFC3E X-CRM114-Status: GOOD ( 12.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Belloni , Thomas Gleixner , linux-arm-kernel@lists.infradead.org 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 clocksource and clockevent timer are probed early in the boot process. At that time it is difficult for linux to know whether a particular timer can be used as the clocksource or the clockevent or by another driver, especially when they are all identical or have similar features. Until now, multiple strategies have been used to solve that: - use Kconfig option as MXC_USE_EPIT or ATMEL_TCB_CLKSRC_BLOCK - use a kernel parameter as the "clocksource" early_param in mach-omap2 - registering the first seen timer as a clockevent and the second one as a clocksource as in rk_timer_init or dw_apb_timer_init Add a linux,clocksource and a linux,clockevent node in chosen with a timer property pointing to the timer to use. Other properties, like the targeted precision may be added later. Signed-off-by: Alexandre Belloni --- Documentation/devicetree/bindings/chosen.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/devicetree/bindings/chosen.txt b/Documentation/devicetree/bindings/chosen.txt index e3b13ea7d2ae..c7ee3ecb5276 100644 --- a/Documentation/devicetree/bindings/chosen.txt +++ b/Documentation/devicetree/bindings/chosen.txt @@ -120,3 +120,23 @@ e.g. While this property does not represent a real hardware, the address and the size are expressed in #address-cells and #size-cells, respectively, of the root node. + +linux,clocksource and linux,clockevent +-------------------------------------- + +Those nodes have a timer property. This property is a phandle to the timer to be +chosen as the clocksource or clockevent. This is only useful when the platform +has multiple identical timers and it is not possible to let linux make the +correct choice. + +/ { + chosen { + linux,clocksource { + timer = <&timer0>; + }; + + linux,clockevent { + timer = <&timer1>; + }; + }; +};