From patchwork Mon Dec 1 23:20:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hogan X-Patchwork-Id: 416611 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 7DAA71400B7 for ; Tue, 2 Dec 2014 10:22:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932701AbaLAXWb (ORCPT ); Mon, 1 Dec 2014 18:22:31 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:56616 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932885AbaLAXVE (ORCPT ); Mon, 1 Dec 2014 18:21:04 -0500 Received: by mail-wg0-f50.google.com with SMTP id k14so15425606wgh.23 for ; Mon, 01 Dec 2014 15:21:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=kUWZPhlulBpwXxlwNldZus48ps9qc4JuObMqI4WMKNw=; b=PWMO75PNujVSLEgcBjiTvCloOZYdIVGUjuBnnNtNi9IPhan+IjLtdFXCrFnYW0SV/8 a9n7gOO+pBdqO4kJZvARd9BKoDqRWT1icUPItM9LzmvUGyQ5jQII/g6haR4lmkh6Y2V7 xX9e29wXbD8ZQUz3ki8Q+7Ejgz0IhEceyZ1q/H421Z+lWwv4zPXWL/SX0MMVFTuN6F6R mSFTXsht39nK/8G2Y42KxyaBmkbNsk/3J642hTeTM/9m9yEjGY+4rxZXQ/vIDmAMeRgd 7QohWbI35mmGdYQzXFiviqEchCPheORn9ho609pROpUNIyAuHMVeUX9baXMo4xCSn6H9 v/IA== X-Gm-Message-State: ALoCoQlHv0yuHzYKx/MIRTrgtoOkOOgyzFcZXYfGtTI30M0ayAWth1g5spIxpLhlsfYRWtu195sy X-Received: by 10.180.75.42 with SMTP id z10mr389979wiv.70.1417476063040; Mon, 01 Dec 2014 15:21:03 -0800 (PST) Received: from radagast.lan (jahogan.plus.com. [212.159.75.221]) by mx.google.com with ESMTPSA id bx19sm31195121wib.6.2014.12.01.15.21.01 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Mon, 01 Dec 2014 15:21:02 -0800 (PST) From: James Hogan To: Mike Turquette , linux-metag@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Heiko Stuebner , James Hogan , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala Subject: [PATCH v2 13/16] dt: binding: add binding for TZ1090 PERIP clocks Date: Mon, 1 Dec 2014 23:20:03 +0000 Message-Id: <1417476006-10407-14-git-send-email-james.hogan@imgtec.com> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1417476006-10407-1-git-send-email-james.hogan@imgtec.com> References: <1417476006-10407-1-git-send-email-james.hogan@imgtec.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The TZ1090 peripheral (PERIP) register region controls a bank of system clock gates for individual peripherals. Create a clock binding for the provider of these clocks, and a header file in for enumerating the provided clocks. There is a single input clock, the main system clock, and multiple peripheral specific system clocks provided which should be referenced by the relevant peripheral device nodes. Signed-off-by: James Hogan Cc: Mike Turquette Cc: Rob Herring Cc: Pawel Moll Cc: Mark Rutland Cc: Ian Campbell Cc: Kumar Gala Cc: linux-metag@vger.kernel.org Cc: devicetree@vger.kernel.org --- Changes since v1 (patch 15): - New patch. - Convert explicit DT representation of clock infrastructure using generic bindings to several TZ1090 specific bindings representing groups of TZ1090 clocks. --- .../bindings/clock/img,tz1090-perip-cru.txt | 49 ++++++++++++++++++++++ include/dt-bindings/clock/tz1090-perip.h | 30 +++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 Documentation/devicetree/bindings/clock/img,tz1090-perip-cru.txt create mode 100644 include/dt-bindings/clock/tz1090-perip.h diff --git a/Documentation/devicetree/bindings/clock/img,tz1090-perip-cru.txt b/Documentation/devicetree/bindings/clock/img,tz1090-perip-cru.txt new file mode 100644 index 0000000..3517737 --- /dev/null +++ b/Documentation/devicetree/bindings/clock/img,tz1090-perip-cru.txt @@ -0,0 +1,49 @@ +Binding for TZ1090 Peripheral register clocks. + +This binding uses the common clock binding[1]. It represents the clocks +controlled from the peripheral registers of the TZ1090: + +[1] Documentation/devicetree/bindings/clock/clock-bindings.txt + +Required properties: +- compatible : Shall be "img,tz1090-perip-cru". +- #clock-cells : From common clock binding; shall be set to 1. +- reg : Base address for clock registers in peripheral register + region. +- clocks : Clock specifiers for each input clock. +- clock-names : Labels for each input clock specified in clocks. + Can contain the following entries: + "sys" : Main system clock. + +Optional properties: +- clock-indices : From common clock binding. Allows clock-output-names to + be sparse. +- clock-output-names : From common clock binding. May be used to name specific + output clocks so that other clock providers can find + the clocks by name before the provider has been + instantiated. Can contain: + "sys_scb0", "sys_scb1", "sys_scb2", "sys_sdio", + "sys_uart0", "sys_uart1", "sys_spim", "sys_spis", + "sys_spim1", "sys_i2sout", "sys_i2sin", "sys_lcd", + "sys_sdhost", "sys_usb" + +Clock Specifier Definition: +- <1st-cell>: Output clock number. Use constants from + . + +Examples: + perip_cru: perip_cru { + compatible = "img,tz1090-perip-cru"; + #clock-cells = <1>; + reg = <0x02004000 0x18>; + clocks = <&top_clks CLK_TOP_SYS>; + clock-names = "sys"; + }; + + i2c { + ... + clocks = <&top_clks CLK_TOP_SCB>, + <&perip_cru CLK_PERIP_SCB0>; + clock-names = "scb", "sys"; + ... + }; diff --git a/include/dt-bindings/clock/tz1090-perip.h b/include/dt-bindings/clock/tz1090-perip.h new file mode 100644 index 0000000..b2990ea --- /dev/null +++ b/include/dt-bindings/clock/tz1090-perip.h @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2013-2014 Imagination Technologies Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _DT_BINDINGS_CLK_TZ1090_PERIP_H +#define _DT_BINDINGS_CLK_TZ1090_PERIP_H + +/* CR_PERIP_CLKEN - Peripheral system clocks */ +#define CLK_PERIP_SCB0 0 +#define CLK_PERIP_SCB1 1 +#define CLK_PERIP_SCB2 2 +#define CLK_PERIP_SDIO 3 +#define CLK_PERIP_UART0 4 +#define CLK_PERIP_UART1 5 +#define CLK_PERIP_SPIM 6 +#define CLK_PERIP_SPIS 7 +#define CLK_PERIP_SPIM1 8 +#define CLK_PERIP_I2SOUT 9 +#define CLK_PERIP_I2SIN 10 +#define CLK_PERIP_LCD 11 +#define CLK_PERIP_SDHOST 12 +#define CLK_PERIP_USB 13 + +#define CLK_PERIP_MAX 14 + +#endif