Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1325631imu; Fri, 11 Jan 2019 20:47:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN7x0ENol6njytizozosBTzYi22tChXsCQ7vZDS4RfW+P0oTW0abhBD9JIOU8qKA6M+h2pfW X-Received: by 2002:a17:902:292b:: with SMTP id g40mr17535641plb.82.1547268435277; Fri, 11 Jan 2019 20:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547268435; cv=none; d=google.com; s=arc-20160816; b=CWQ73pEfzdDgd5J4WVIvc6AdlIbSZMY98/xSWFQCpn+o78UCJhpp3yOSezCk/fWn/2 gYOxhLLcKHvc+mN+3a01MNhtDwrlN4MGXQhX3hugHP/beP3gf5aAcdmMiF20MEcca4zM QuPWSopflvzDj0Q0cYxOh8Z7lgl0E+vI6yvcYnos63HvKfLjf8L/QUNgj9l+tkDwpZKH n+4kyx4QNu5N/k/ZNJvBsjDaATHcO4JR+BHSushtlVz28verQTyWXnrGHITge6Hu5JEM 90nHDSUFyFewRIcY0cMVokHIsTfNd2mPudAXnLkjucXTD+RNAzxCGIC8JHhjA6FogpWZ RH3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=rRnp0OTwDRdzL3ROofLLZKUQgFhKoiwj5vGrR9DCQB0=; b=r8HEB9gLs/0B/FjHm/HSU6SZINMH7PXW2plljDzMrqFG4gEtV5xJQxCWSdP2ZI5uTp vzskOEmyAgf+XxU4YDG2mVJrtvVQAvRQFEausEbtzTYYMy+bUGqX/K3iQSPtV5AWN7/z CXfnHa58TP0VFx9vsqkzVEIJERmUX6ofAG0Ov7KJC9zWm/Nh8pj+DCF97GEGaPwxpTrc W/HWA4CCePcKS7fmO/y7I64H/bc7AIOxmJsjejPhygL1A/TKSmsgseDVF7DumDz7rY+Z EOS+1eKpwZuFO3LiHDIM8pQhjEYsBrmjxxeAy4Abic1g+0s/ZhXAUgSG93J2KEyl69vG Qqyg== 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 38si19230009pln.313.2019.01.11.20.46.45; Fri, 11 Jan 2019 20:47:15 -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 S1726480AbfALEox (ORCPT + 99 others); Fri, 11 Jan 2019 23:44:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:51948 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726376AbfALEow (ORCPT ); Fri, 11 Jan 2019 23:44:52 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D72ACAC8D; Sat, 12 Jan 2019 04:44:48 +0000 (UTC) Subject: Re: [PATCH lora-next 4/4] dt-bindings: lora: sx130x: add clock bindings To: Ben Whitten Cc: linux-lpwan@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Rob Herring , Mark Rutland , "David S. Miller" References: <20190108084132.10214-1-ben.whitten@gmail.com> <20190108084132.10214-4-ben.whitten@gmail.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Openpgp: preference=signencrypt Autocrypt: addr=afaerber@suse.de; pref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czYCPYfqOcJ556QUGA9y DeDcxSitpYrNIvpk4C5CHbvskVLKPIUVXxTNl8hAGo1Ahm1VbNkYlocAEQEAAcLBXwQYAQIA CQUCTpbplAIbDAAKCRD6LtEtPn4BPzA6D/9TbSBOPM99SHPX9JiEQAw4ITCBF2oTWeZQ6RJg RKpB15lzyPfyFbNSceJp9dCiwDWe+pzKaX6KYOFZ5+YTS0Ph2eCR+uT2l6Mt6esAun8dvER/ xlPDW7p88dwGUcV8mHEukWdurSEDTj8V3K29vpgvIgRq2lHCn2wqRQBGpiJAt72Vg0HxUlwN GAJNvhpeW8Yb43Ek7lWExkUgOfNsDCTvDInF8JTFtEXMnUcPxC0d/GdAuvBilL9SlmzvoDIZ 5k2k456bkY3+3/ydDvKU5WIgThydyCEQUHlmE6RdA3C1ccIrIvKjVEwSH27Pzy5jKQ78qnhv dtLLAavOXyBJnOGlNDOpOyBXfv02x91RoRiyrSIM7dKmMEINKQlAMgB/UU/6B+mvzosbs5d3 4FPzBLuuRz9WYzXmnC460m2gaEVk1GjpidBWw0yY6kgnAM3KhwCFSecqUQCvwKFDGSXDDbCr w08b3GDk40UoCoUq9xrGfhlf05TUSFTg2NlSrK7+wAEsTUgs2ZYLpHyEeftoDDnKpM4ghs/O ceCeyZUP1zSgRSjgITQp691Uli5Nd1mIzaaM8RjOE/Rw67FwgblKR6HAhSy/LYw1HVOu+Ees RAEdbtRt37A8brlb/ENxbLd9SGC8/j20FQjit7oPNMkTJDs7Uo2eb7WxOt5pSTVVqZkv7Q== Organization: SUSE Linux GmbH Message-ID: <56999005-89ca-c98c-0f5b-48eda15ea9fa@suse.de> Date: Sat, 12 Jan 2019 05:44:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20190108084132.10214-4-ben.whitten@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 08.01.19 um 09:41 schrieb Ben Whitten: > The sx130x family consumes two clocks, a 32MHz clock provided by a > connected IQ transceiver, and a 133MHz high speed clock. > > In the example we connect the concentrator to output 0 of a fixed clock > providing the 133MHz high speed clock, and we connect to output 0 of a > connected transceiver 32MHz clock. > > The connected radios are both fed from output 0 of a fixed 32MHz clock, > with only one being the clock source back with one output to the > sx130x concentrator. No, no, no... See below. > > Signed-off-by: Ben Whitten > --- > .../{ => net}/lora/semtech,sx130x.yaml | 39 ++++++++++++++++++- > 1 file changed, 38 insertions(+), 1 deletion(-) > rename Documentation/devicetree/bindings/{ => net}/lora/semtech,sx130x.yaml (62%) > > diff --git a/Documentation/devicetree/bindings/lora/semtech,sx130x.yaml b/Documentation/devicetree/bindings/net/lora/semtech,sx130x.yaml > similarity index 62% > rename from Documentation/devicetree/bindings/lora/semtech,sx130x.yaml > rename to Documentation/devicetree/bindings/net/lora/semtech,sx130x.yaml > index ad263bc4e60d..23a096ca2912 100644 > --- a/Documentation/devicetree/bindings/lora/semtech,sx130x.yaml > +++ b/Documentation/devicetree/bindings/net/lora/semtech,sx130x.yaml > @@ -15,7 +15,8 @@ description: | > demodulating LoRa signals on 8 channels simultaneously. > > It is typically paired with two sx125x IQ radios controlled over an > - SPI directly from the concentrator. > + SPI directly from the concentrator. One of the radios will provide > + a 32MHz clock back into the concentrator. The SX125x does not seem to document the frequency of the output clock, so I assume it's pass-through of whatever went in, and 32 MHz seems correct for the SX130x input side. > > The concentrator itself it controlled over SPI. > > @@ -41,6 +42,20 @@ properties: > in Hz. Maximum SPI frequency is 10MHz although 8MHz is typically used > on a number of cards. > > + clocks: > + maxItems: 2 > + items: > + - description: 32MHz clock provider > + - description: 133MHz high speed clock provider > + description: The chip requires two clock inputs; A 32MHz clock at CMOS > + level which is provided from a connected radio. > + And a 133MHz high speed clock at CMOS level provided by an oscillator. > + > + clock-names: > + items: > + - const: clk32m The pin is called CLK32M; in the specs there's XTAL32F/XTAL32T. > + - const: clkhs The pin is called CLKHS; in the specs it's HSC_F. So I assume both names are good, but wanted to double-check. > + > radio-spi: > description: The concentrator has two radios connected which are contained > within the following node. > @@ -64,11 +79,27 @@ required: > > examples: > - | > + tcxo: dummy32m { > + compatible = "fixed-clock"; > + clock-frequency = <32000000>; > + clock-output-names = "tcxo"; > + #clock-cells = <0>; > + }; > + > + clkhs: dummy133m { > + compatible = "fixed-clock"; > + clock-frequency = <133000000>; > + clock-output-names = "clkhs"; > + #clock-cells = <0>; > + }; > + > concentrator0: lora@0 { > compatible = "semtech,sx1301"; > reg = <0>; > reset-gpios = <&pioB 27 GPIO_ACTIVE_HIGH>; > spi-max-frequency = <8000000>; > + clocks = <&radio1 0>, <&clkhs 0>; Once again, this is wrong use of #clock-cells: <&radio1>, <&clkhs> Otherwise you have four clocks, and your "clkhs" will be <0>. > + clock-names = "clk32m", "clkhs"; > > radio-spi { > #address-cells = <1>; > @@ -77,11 +108,17 @@ examples: > radio0: lora@0 { > compatible = "semtech,sx1257"; > reg = <0>; > + clocks = <&tcxo 0>; Ditto, <&tcxo>. > + clock-names = "tcxo"; > }; > > radio1: lora@1 { > compatible = "semtech,sx1257"; > reg = <1>; > + clocks = <&tcxo 0>; <&tcxo> > + clock-names = "tcxo"; > + clock-output-names = "clk32m"; > + #clock-cells = <0>; > }; > }; > }; This example may need to be updated to use a fixed-clock instead of the radio'S output, due to unsolved clk provider implementation problems that will render the example unusable. Same as for the radio, we should also prepare optional regulator inputs. There's at least 1.8 V and 3.3 V supplies here. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)