Received: by 10.223.176.5 with SMTP id f5csp2155675wra; Sun, 4 Feb 2018 22:12:22 -0800 (PST) X-Google-Smtp-Source: AH8x226pDCkEbOTX2bhDdpuYjhtlWMi4lVh6se+kjjaEfTPDoRIFCtUPnOkp09SNiDggHPcWsmYy X-Received: by 10.98.156.143 with SMTP id u15mr47244161pfk.170.1517811142056; Sun, 04 Feb 2018 22:12:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517811142; cv=none; d=google.com; s=arc-20160816; b=h7e4wxoLXMfOkXLq1PJ0ueEQ5j13WxRgNCnWxZbwXLQ0CjViHgjYSbSVh0iuAwgJSV 5558ndcbCNTdx9qi4UZ8N4w3nzNyig3s8mUhziRvs4RbND2+BNTqCfH0LxdVwyjLO+ZU i8W5k1k9L4FhSXdOc4LpiS6IQfnPoI48KUxyFf0TaGthE0P0OYvTgbNHcx9uozy3YNSP mtat0AnYlFjgMtPCA4JNExv52rxPRS3hQ5SDGdRmpmpbr/xvO1KYk3gSJFTCeHzvjCzm +rMteZjuUMMLSLqW3WoHCxVituF/mnls/Dtv9IodIckMWFbmif7GJPG5YMW7AW4v9fEq 5xhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=SgbSeOW75LPt1Pbfqu03ZYyjYewqqqYNLfn7YiUtxEw=; b=ePvXlhGaQ7FbN18rDaDkN1K+FI1iP2PPIgEO/ns8Us5hv86oN7nrEcSwP0FNWrCmR2 yJvCbpZe4Nrc2aUgP6yxObM8VadjMpmhkyQeGcmhbKG9uaN37FrnSLoBK0UD5+b8ubj/ GEZIBW+uqyy8e7hL0rgMlv1esM5T0toYHFm5KstSVgIwPNbmrTthCZQq/pYTTmg6+rsS 8Gyg7qdgW2VU6M6bDKAl0Mu7pS5LDYUgg2yUYZebRoR7dGvvuoTnpTgDejcKkLcRYTo0 ljNg/bfea248K1Mz0QmXySuRyHnGaSBuUT2+cGmLl3hiyAXVg9tQScvbvyJiWmTywxRZ pxdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si4057748pfg.232.2018.02.04.22.12.07; Sun, 04 Feb 2018 22:12:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753103AbeBEGLK (ORCPT + 99 others); Mon, 5 Feb 2018 01:11:10 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35439 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753007AbeBEGJe (ORCPT ); Mon, 5 Feb 2018 01:09:34 -0500 Received: by mail-pl0-f66.google.com with SMTP id j19so11139267pll.2; Sun, 04 Feb 2018 22:09:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=SgbSeOW75LPt1Pbfqu03ZYyjYewqqqYNLfn7YiUtxEw=; b=NLGrUb+tWE5cEhCQL3MQn9zGq96NC/o4e3KSpJFf8NqNGjDORkqQgg/rHaHO34xI1H 9+k9iYg3uWI51GoMSGdVK/vrD/lmf5FVcSJvwn+k/9EISakZxSaUybisF5rO9mqDbBkw Wrs52umubFCQNFt47r9jSCtvan59TqfdUu753njKtGjyztYgdxDis1rF/DHTZhBkKYlO 8lplo+KGGe7fmMxykx+HoskEdAkPTmpP+aprN93FCtGKUoQimOUiIZqgiglww/1BRncy WltJhPNn7sy2z50xQt/B6icJIcoAEeuS7dr5p8hUptZOU30+Y/+aVAAfSt4VY4MbmPsJ MXDQ== X-Gm-Message-State: AKwxytddV1c15ezpBiD8QyvWDEJmTGeGKVaHhUIsvHqF+ka4W537o02V tc6uC3N4WNe95rLwqmSCcw== X-Received: by 2002:a17:902:581a:: with SMTP id m26-v6mr42473978pli.158.1517810973384; Sun, 04 Feb 2018 22:09:33 -0800 (PST) Received: from localhost ([50.225.178.238]) by smtp.gmail.com with ESMTPSA id g27sm4923792pfa.25.2018.02.04.22.09.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 04 Feb 2018 22:09:32 -0800 (PST) Date: Mon, 5 Feb 2018 00:09:32 -0600 From: Rob Herring To: gabriel.fernandez@st.com Cc: Mark Rutland , Lee Jones , Maxime Coquelin , Alexandre Torgue , Michael Turquette , Stephen Boyd , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, gabriel.fernandez.st@gmail.com, olivier.bideau@st.com Subject: Re: [PATCH 01/14] dt-bindings: Document STM32MP1 Reset Clock Controller (RCC) bindings Message-ID: <20180205042238.64xjrrguls2drtrg@rob-hp-laptop> References: <1517580222-23301-1-git-send-email-gabriel.fernandez@st.com> <1517580222-23301-2-git-send-email-gabriel.fernandez@st.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517580222-23301-2-git-send-email-gabriel.fernandez@st.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 02, 2018 at 03:03:29PM +0100, gabriel.fernandez@st.com wrote: > From: Gabriel Fernandez > > The RCC block is responsible of the management of the clock and reset > generation for the complete circuit. > > Signed-off-by: Gabriel Fernandez > --- > .../devicetree/bindings/mfd/st,stm32-rcc.txt | 85 ++++++++++++++++++++++ > 1 file changed, 85 insertions(+) > create mode 100644 Documentation/devicetree/bindings/mfd/st,stm32-rcc.txt > > diff --git a/Documentation/devicetree/bindings/mfd/st,stm32-rcc.txt b/Documentation/devicetree/bindings/mfd/st,stm32-rcc.txt > new file mode 100644 > index 0000000..28017a1 > --- /dev/null > +++ b/Documentation/devicetree/bindings/mfd/st,stm32-rcc.txt > @@ -0,0 +1,85 @@ > +STMicroelectronics STM32 Peripheral Reset Clock Controller > +========================================================== > + > +The RCC IP is both a reset and a clock controller. > + > +Please also refer to reset.txt for common reset controller binding usage. > + > +Please also refer to clock-bindings.txt for common clock controller > +binding usage. > + > + > +Required properties: > +- compatible: "simple-mfd", "syscon" > +- reg: should be register base and length as documented in the datasheet > + > +- Sub-nodes: > + - compatible: "st,stm32mp1-rcc-clk" > + - #clock-cells: 1, device nodes should specify the clock in their > + "clocks" property, containing a phandle to the clock device node, > + an index specifying the clock to use. > + > + - compatible: "st,stm32mp1-rcc-rst" > + - #reset-cells: Shall be 1 > + > +Example: > + rcc: rcc@50000000 { > + compatible = "syscon", "simple-mfd"; > + reg = <0x50000000 0x1000>; > + > + rcc_clk: rcc-clk@50000000 { > + #clock-cells = <1>; > + compatible = "st,stm32mp1-rcc-clk"; > + }; > + > + rcc_rst: rcc-reset@50000000 { You should not have the same unit-address twice. IMO, this should just be: rcc: rcc@50000000 { compatible = "st-stm32mp1-rcc"; reg = <0x50000000 0x1000>; #clock-cells = <1>; #reset-cells = <1>; }; There's no reason a node can't provide more than 1 function. > + #reset-cells = <1>; > + compatible = "st,stm32mp1-rcc-rst"; > + }; > + }; > + > +Specifying clocks > +================= > + > +All available clocks are defined as preprocessor macros in > +dt-bindings/clock/stm32mp1-clks.h header and can be used in device > +tree sources. > + > +Example: > + > + /* Accessing DMA1 clock */ > + ... { > + clocks = <&rcc_clk DMA1> > + }; > + > + /* Accessing SPI6 kernel clock */ > + ... { > + clocks = <&rcc_clk SPI6_K> > + }; Other than the path to header, the clock binding explains all this. No need to duplicate here. > + > +Specifying softreset control of devices > +======================================= > + > +Device nodes should specify the reset channel required in their "resets" > +property, containing a phandle to the reset device node and an index specifying > +which channel to use. > +The index is the bit number within the RCC registers bank, starting from RCC > +base address. > +It is calculated as: index = register_offset / 4 * 32 + bit_offset. > +Where bit_offset is the bit offset within the register. > + > +For example on STM32MP1, for LTDC reset: > + ltdc = APB4_RSTSETR_offset / 4 * 32 + LTDC_bit_offset > + = 0x180 / 4 * 32 + 0 = 3072 > + > +The list of valid indices for STM32MP1 is available in: > +include/dt-bindings/reset-controller/stm32mp1-resets.h > + > +This file implements defines like: > +#define LTDC_R 3072 > + > +example: > + > + ltdc { > + resets = <&rcc_rst LTDC_R>; > + }; > -- > 1.9.1 >