From patchwork Wed Jul 22 13:04:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 498528 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 102DF1402C3 for ; Wed, 22 Jul 2015 23:16:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757327AbbGVNPw (ORCPT ); Wed, 22 Jul 2015 09:15:52 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:34063 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756794AbbGVNE2 (ORCPT ); Wed, 22 Jul 2015 09:04:28 -0400 Received: by wibud3 with SMTP id ud3so153266182wib.1 for ; Wed, 22 Jul 2015 06:04:27 -0700 (PDT) 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=ViV1ghl1gcgJis9wMOaqfib0XJqN1Xi05LdJ2XdHczw=; b=eZdJ6sikjQEaYYxP7ehAN5jO1WOEYw3JjtzNMnO9aP6wwqhu2ELqNqT19kIxDfjy12 EpllOQCMSSzsILF0h6VDTBHQghozpMRfjdPw4Dyor4siS1lzqf338cjlEA8JuJDHvTVr hb/GsN2H4aml4LINFZaOkqtxYLBJP8NTVgXk83zrxN2iA9uQAv+g5DpkwIih9EaqlaT/ D2xQj69+RF42I1eul4C6cVKByybzRLoAlvWZnc1PWbrw5bFlLXY7NnrSaIcyXiLaW0Z+ Q1Ir/ororc6mFSUYjNWftUXJDZ4SwrKLjdXUaIYIJgYSRtBSjchp5nlmZamDyZePYkVz CX6g== X-Gm-Message-State: ALoCoQmJ6dQaeIaTJUoIPQQZ9cyFkQH3DwitBe6oQfMsjffz6C1Z4kUbgzG+YNuKHvkP99ucKH+l X-Received: by 10.180.10.200 with SMTP id k8mr6471650wib.5.1437570267226; Wed, 22 Jul 2015 06:04:27 -0700 (PDT) Received: from localhost.localdomain (host81-129-173-55.range81-129.btcentralplus.com. [81.129.173.55]) by smtp.gmail.com with ESMTPSA id qq1sm2359327wjc.0.2015.07.22.06.04.25 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Jul 2015 06:04:26 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: kernel@stlinux.com, mturquette@linaro.org, sboyd@codeaurora.org, devicetree@vger.kernel.org, geert@linux-m68k.org, maxime.ripard@free-electrons.com, s.hauer@pengutronix.de, Lee Jones Subject: [PATCH v7 5/5] clk: dt: Introduce binding for critical clock support Date: Wed, 22 Jul 2015 14:04:15 +0100 Message-Id: <1437570255-21049-6-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1437570255-21049-1-git-send-email-lee.jones@linaro.org> References: <1437570255-21049-1-git-send-email-lee.jones@linaro.org> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Signed-off-by: Lee Jones --- .../devicetree/bindings/clock/clock-bindings.txt | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Documentation/devicetree/bindings/clock/clock-bindings.txt b/Documentation/devicetree/bindings/clock/clock-bindings.txt index 06fc6d5..4137034 100644 --- a/Documentation/devicetree/bindings/clock/clock-bindings.txt +++ b/Documentation/devicetree/bindings/clock/clock-bindings.txt @@ -44,6 +44,45 @@ For example: clocks by index. The names should reflect the clock output signal names for the device. +critical-clock: Some hardware contains bunches of clocks which, in normal + circumstances, must never be turned off. If drivers a) fail to + obtain a reference to any of these or b) give up a previously + obtained reference during suspend, it is possible that some + Operating Systems might attempt to disable them to save power. + If this happens a platform can fail irrecoverably as a result. + Usually the only way to recover from these failures is to + reboot. + + To avoid either of these two scenarios from catastrophically + disabling an otherwise perfectly healthy running system, + clocks can be identified as 'critical' using this property from + inside a clocksource's node. + + This property is not to be abused. It is only to be used to + protect platforms from being crippled by gated clocks, NOT as a + convenience function to avoid using the framework correctly + inside device drivers. + + Expected values are hardware clock indices. If the + clock-indices property (see below) is used, then supplied + values must correspond to one of the listed identifiers. + Using the clock-indices example below, hardware clock <2> + is missing, therefore it is considered invalid to then + list clock <2> as a critical clock. + +For example: + + oscillator { + #clock-cells = <1>; + clock-output-names = "ckil", "ckih"; + critical-clock = <0>, <1>; + }; + +- this node defines a device with two clock outputs, just as in the + example above. The only difference being that 'ckil' and 'ckih' + are now identified as an critical clocks, so an OS will know to + never attempt to gate them. + clock-indices: If the identifying number for the clocks in the node is not linear from zero, then this allows the mapping of identifiers into the clock-output-names array.