Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1524697ybl; Thu, 30 Jan 2020 01:14:40 -0800 (PST) X-Google-Smtp-Source: APXvYqw+eArBNgojjDHn8T08hVIO3R06cLoBKbjUfO9iKfEeWNf4Tmxh4/UAhP7/8mVDNo/KR596 X-Received: by 2002:a05:6808:24e:: with SMTP id m14mr2261729oie.168.1580375679811; Thu, 30 Jan 2020 01:14:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580375679; cv=none; d=google.com; s=arc-20160816; b=KpXYpd8PsGzJNFNLj5eHxsEQ1I/dzuD9SBZHd/OM/ruHg7zl/2S/ryNso6yeCicNgj D1uerBg41TG1DEjs8eZB0nCz8ylg4906OU1nY6HVHO+ZbToEa1a5jvEGd3nvPVeEMPpt bJ276SKAKGx8auJd8dGiER57veMa2nFPEx4LoJr/VXXMJz3+eQ8blz2q5gbdolnYRT3i Pic74vhYtfdxwLbmOK30T7Mo8YYeIXhKm7rnuEBc5gTqedIgyH20jO3NYYwAjzSmh8Ko uf9+3tYKbybCCmgl+TEZiFwildxAjXWYMewXNUUto77+OqtUpYDWLCrZoIcia/Bt9nj5 lNiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dmarc-filter :dkim-signature; bh=OV+rJWAmEQGco859SXAi+h7Dm++pVop0UNENTmmd7ks=; b=or52bFjjdaEOj0LS9QagCfnLH5SLqKOEwA+mosc7V2NR95FTXM2D1dh5a5yHm21NY+ A19Deupd07dEFTQwSCVo7Wt21++nDRCdrhePzE58io1Mhhxrp/namqTScoH1KN4iG18P ldPZ8JJE2K6NNrohtbs7LG3x7H9VZ1D60dA9xEpSY9w+8AqCLHiFF61PjGSWikkLV5ho 2Mg6HxSnhNr6p9ckTf31SlORwZIcSqfV1tUZUQ9UOLfT37IxEoDus1XHm4kMB1e2vSVN 9LObsetth6j0cb+USoGvFUcmYCqyjzkWYHtNjr/DVziwQWo75o5dNwevouXi//H876IG NA0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=R9f5NRns; 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 i6si2728239otp.5.2020.01.30.01.14.27; Thu, 30 Jan 2020 01:14:39 -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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=R9f5NRns; 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 S1726913AbgA3JNR (ORCPT + 99 others); Thu, 30 Jan 2020 04:13:17 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:17143 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726882AbgA3JNR (ORCPT ); Thu, 30 Jan 2020 04:13:17 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1580375595; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: References: Cc: To: From: Subject: Sender; bh=OV+rJWAmEQGco859SXAi+h7Dm++pVop0UNENTmmd7ks=; b=R9f5NRnsydrg8UZA6Kc5xGBSWwAKcNYV6FaAC8yNMnv2+jNuZjUTBD4Z06yLL/w35G57nHgE w1Jumv3m7JSt2yp+dnVegv/EWqDn0S1KFczflOnLProRdWlQ7zSmrgIcqwKCt9PVzVt6dlQp bHZrSLSAV26QL7IqKVvvnbPuvaA= X-Mailgun-Sending-Ip: 104.130.122.25 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5e329e26.7f0132f49a40-smtp-out-n03; Thu, 30 Jan 2020 09:13:10 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 1BB3FC447A6; Thu, 30 Jan 2020 09:13:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [10.252.222.65] (blr-c-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: akashast) by smtp.codeaurora.org (Postfix) with ESMTPSA id B1890C43383; Thu, 30 Jan 2020 09:13:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B1890C43383 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=akashast@codeaurora.org Subject: Re: [PATCH V2] dt-bindings: geni-se: Convert QUP geni-se bindings to YAML From: Akash Asthana To: Rob Herring Cc: agross@kernel.org, bjorn.andersson@linaro.org, mark.rutland@arm.com, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, mgautam@codeaurora.org, swboyd@chromium.org References: <1576576279-29927-1-git-send-email-akashast@codeaurora.org> <20191220232046.GA408@bogus> <7b14fd2b-3aee-7255-ddbf-e1166340eb09@codeaurora.org> Message-ID: <5dc66df5-293a-0429-b972-0e80fc078814@codeaurora.org> Date: Thu, 30 Jan 2020 14:43:02 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <7b14fd2b-3aee-7255-ddbf-e1166340eb09@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/28/2020 5:17 PM, Akash Asthana wrote: > > Thanks Rob for reviewing. > > On 12/21/2019 4:50 AM, Rob Herring wrote: >> On Tue, Dec 17, 2019 at 03:21:19PM +0530, Akash Asthana wrote: >>> Convert QUP geni-se bindings to DT schema format using json-schema. >>> >>> Signed-off-by: Akash Asthana >>> --- >>> Changes in V2: >>> - As per Stephen's comment corrected defintion of interrupts for UART node. >>> Any valid UART node must contain atleast 1 interrupts. >>> >>> .../devicetree/bindings/soc/qcom/qcom,geni-se.txt | 94 ---------- >>> .../devicetree/bindings/soc/qcom/qcom,geni-se.yaml | 197 +++++++++++++++++++++ >>> 2 files changed, 197 insertions(+), 94 deletions(-) >>> delete mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt >>> create mode 100644 Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>> >>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt >>> deleted file mode 100644 >>> index dab7ca9..0000000 >>> --- a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt >>> +++ /dev/null >>> @@ -1,94 +0,0 @@ >>> -Qualcomm Technologies, Inc. GENI Serial Engine QUP Wrapper Controller >>> - >>> -Generic Interface (GENI) based Qualcomm Universal Peripheral (QUP) wrapper >>> -is a programmable module for supporting a wide range of serial interfaces >>> -like UART, SPI, I2C, I3C, etc. A single QUP module can provide upto 8 Serial >>> -Interfaces, using its internal Serial Engines. The GENI Serial Engine QUP >>> -Wrapper controller is modeled as a node with zero or more child nodes each >>> -representing a serial engine. >>> - >>> -Required properties: >>> -- compatible: Must be "qcom,geni-se-qup". >>> -- reg: Must contain QUP register address and length. >>> -- clock-names: Must contain "m-ahb" and "s-ahb". >>> -- clocks: AHB clocks needed by the device. >>> - >>> -Required properties if child node exists: >>> -- #address-cells: Must be <1> for Serial Engine Address >>> -- #size-cells: Must be <1> for Serial Engine Address Size >>> -- ranges: Must be present >>> - >>> -Properties for children: >>> - >>> -A GENI based QUP wrapper controller node can contain 0 or more child nodes >>> -representing serial devices. These serial devices can be a QCOM UART, I2C >>> -controller, SPI controller, or some combination of aforementioned devices. >>> -Please refer below the child node definitions for the supported serial >>> -interface protocols. >>> - >>> -Qualcomm Technologies Inc. GENI Serial Engine based I2C Controller >>> - >>> -Required properties: >>> -- compatible: Must be "qcom,geni-i2c". >>> -- reg: Must contain QUP register address and length. >>> -- interrupts: Must contain I2C interrupt. >>> -- clock-names: Must contain "se". >>> -- clocks: Serial engine core clock needed by the device. >>> -- #address-cells: Must be <1> for I2C device address. >>> -- #size-cells: Must be <0> as I2C addresses have no size component. >>> - >>> -Optional property: >>> -- clock-frequency: Desired I2C bus clock frequency in Hz. >>> - When missing default to 100000Hz. >>> - >>> -Child nodes should conform to I2C bus binding as described in i2c.txt. >>> - >>> -Qualcomm Technologies Inc. GENI Serial Engine based UART Controller >>> - >>> -Required properties: >>> -- compatible: Must be "qcom,geni-debug-uart" or "qcom,geni-uart". >>> -- reg: Must contain UART register location and length. >>> -- interrupts: Must contain UART core interrupts. >>> -- clock-names: Must contain "se". >>> -- clocks: Serial engine core clock needed by the device. >>> - >>> -Qualcomm Technologies Inc. GENI Serial Engine based SPI Controller >>> -node binding is described in >>> -Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.txt. >>> - >>> -Example: >>> - geniqup@8c0000 { >>> - compatible = "qcom,geni-se-qup"; >>> - reg = <0x8c0000 0x6000>; >>> - clock-names = "m-ahb", "s-ahb"; >>> - clocks = <&clock_gcc GCC_QUPV3_WRAP_0_M_AHB_CLK>, >>> - <&clock_gcc GCC_QUPV3_WRAP_0_S_AHB_CLK>; >>> - #address-cells = <1>; >>> - #size-cells = <1>; >>> - ranges; >>> - >>> - i2c0: i2c@a94000 { >>> - compatible = "qcom,geni-i2c"; >>> - reg = <0xa94000 0x4000>; >>> - interrupts = ; >>> - clock-names = "se"; >>> - clocks = <&clock_gcc GCC_QUPV3_WRAP0_S5_CLK>; >>> - pinctrl-names = "default", "sleep"; >>> - pinctrl-0 = <&qup_1_i2c_5_active>; >>> - pinctrl-1 = <&qup_1_i2c_5_sleep>; >>> - #address-cells = <1>; >>> - #size-cells = <0>; >>> - }; >>> - >>> - uart0: serial@a88000 { >>> - compatible = "qcom,geni-debug-uart"; >>> - reg = <0xa88000 0x7000>; >>> - interrupts = ; >>> - clock-names = "se"; >>> - clocks = <&clock_gcc GCC_QUPV3_WRAP0_S0_CLK>; >>> - pinctrl-names = "default", "sleep"; >>> - pinctrl-0 = <&qup_1_uart_3_active>; >>> - pinctrl-1 = <&qup_1_uart_3_sleep>; >>> - }; >>> - >>> - } >>> diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>> new file mode 100644 >>> index 0000000..5ba0e0e >>> --- /dev/null >>> +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml >>> @@ -0,0 +1,197 @@ >>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >>> + >>> +%YAML 1.2 >>> +--- >>> +$id:"http://devicetree.org/schemas/soc/qcom/qcom,geni-se.yaml#" >>> +$schema:"http://devicetree.org/meta-schemas/core.yaml#" >>> + >>> +title: GENI Serial Engine QUP Wrapper Controller >>> + >>> +maintainers: >>> + - Mukesh Savaliya >>> + - Akash Asthana >>> + >>> +description: | >>> + Generic Interface (GENI) based Qualcomm Universal Peripheral (QUP) wrapper >>> + is a programmable module for supporting a wide range of serial interfaces >>> + like UART, SPI, I2C, I3C, etc. A single QUP module can provide upto 8 Serial >>> + Interfaces, using its internal Serial Engines. The GENI Serial Engine QUP >>> + Wrapper controller is modeled as a node with zero or more child nodes each >>> + representing a serial engine. >>> + >>> +properties: >>> + compatible: >>> + enum: >>> + - qcom,geni-se-qup >>> + >>> + reg: >>> + description: QUP wrapper common register address and length. >>> + >>> + clock-names: >>> + items: >>> + - const: m-ahb >>> + - const: s-ahb >>> + >>> + clocks: >>> + minItems: 2 >>> + maxItems: 2 >>> + items: >>> + - description: Master AHB Clock >>> + - description: Slave AHB Clock >>> + >>> + "#address-cells": >>> + const: 2 >>> + >>> + "#size-cells": >>> + const: 2 >>> + >>> + ranges: true >>> + >>> +required: >>> + - compatible >>> + - reg >>> + - clocks >>> + - clock-names >>> + - "#address-cells" >>> + - "#size-cells" >>> + - ranges >>> + >>> +patternProperties: >>> + "[i2c|spi]@[0-9]+$": >> You'll need to split this so you can a add $ref to SPI and I2C >> controller schemas. >> >> For example: >> >> allOf: >> - $ref: /spi/spi-controller.yaml# >> >> >> Though you could have 1 pattern that matches everything common and then >> ones for I2C, SPI, etc. >> > Okay. >>> + type: object >>> + description: GENI Serial Engine based I2C and SPI Controller. >>> + SPI in master mode supports up to 50MHz, up to four chip >>> + selects, programmable data path from 4 bits to 32 bits and >>> + numerous protocol variants. >>> + >>> + properties: >>> + compatible: >>> + enum: >>> + - qcom,geni-i2c >>> + - qcom,geni-spi >>> + >>> + reg: >>> + description: GENI Serial Engine register address and length. >> Number of reg entries? Needs a 'maxItems: 1' or a list of the entries. I will update in next patch >> >>> + >>> + interrupts: >>> + maxItems: 1 >>> + >>> + clock-names: >>> + const: se >>> + >>> + clocks: >>> + description: Serial engine core clock needed by the device. >>> + maxItems: 1 >>> + >>> + "#address-cells": >>> + const: 1 >>> + >>> + "#size-cells": >>> + const: 0 >>> + >>> + clock-frequency: >>> + description: Desired I2C bus clock frequency in Hz. >>> + default: 100000 >>> + >>> + required: >>> + - compatible >>> + - reg >>> + - interrupts >>> + - clock-names >>> + - clocks >>> + - "#address-cells" >>> + - "#size-cells" >>> + >>> + "serial@[0-9]+$": >> unit-address is hex. I will correct in next patch. >> >>> + type: object >>> + description: GENI Serial Engine based UART Controller. >>> + >>> + properties: >>> + compatible: >>> + enum: >>> + - qcom,geni-uart >>> + - qcom,geni-debug-uart >>> + >>> + reg: >>> + description: GENI Serial Engine register address and length. >> Number of reg entries? I will correct in next patch. >> >>> + >>> + interrupts: >>> + minItems: 1 >>> + maxItems: 2 >>> + items: >>> + - description: UART core irq >>> + - description: Wakeup irq (RX GPIO) >>> + >>> + clock-names: >>> + const: se >>> + >>> + clocks: >>> + description: Serial engine core clock needed by the device. >>> + maxItems: 1 >>> + >>> + required: >>> + - compatible >>> + - reg >>> + - interrupts >>> + - clock-names >>> + - clocks >>> + >>> +examples: >>> + - | >>> + #include >>> + #include >>> + >>> + soc: soc@0 { >>> + #address-cells = <2>; >>> + #size-cells = <2>; >>> + >>> + qupv3_id_0: geniqup@8c0000 { >>> + compatible = "qcom,geni-se-qup"; >>> + reg = <0 0x008c0000 0 0x6000>; >>> + clocks = <&gcc GCC_QUPV3_WRAP_0_M_AHB_CLK>, >>> + <&gcc GCC_QUPV3_WRAP_0_S_AHB_CLK>; >>> + #address-cells = <2>; >>> + #size-cells = <2>; >>> + ranges; >>> + status = "disabled"; >> Don't show status in examples. >> >> Why is the example changed? I don't really want to review it again. Ok, I will use original example. >> >>> + >>> + i2c0: i2c@880000 { >>> + compatible = "qcom,geni-i2c"; >>> + reg = <0 0x00880000 0 0x4000>; >>> + clock-names = "se"; >>> + clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>; >>> + pinctrl-names = "default"; >>> + pinctrl-0 = <&qup_i2c0_default>; >>> + interrupts = ; >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + status = "disabled"; >>> + }; >>> + >>> + spi0: spi@880000 { >> Overlapping addresses are a problem unless these are all enable only 1 >> at a time. The original example didn't have this issue. Yes, these all will be enabled only 1 at a time.  I will fall back to original example. If example needs to be change, I will post seperate patch for it. >>> + compatible = "qcom,geni-spi"; >>> + reg = <0 0x00880000 0 0x4000>; >>> + clock-names = "se"; >>> + clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>; >>> + pinctrl-names = "default"; >>> + pinctrl-0 = <&qup_spi0_default>; >>> + interrupts = ; >>> + #address-cells = <1>; >>> + #size-cells = <0>; >>> + status = "disabled"; >>> + }; >>> + >>> + uart0: serial@880000 { >>> + compatible = "qcom,geni-uart"; >>> + reg = <0 0x00880000 0 0x4000>; >>> + clock-names = "se"; >>> + clocks = <&gcc GCC_QUPV3_WRAP0_S0_CLK>; >>> + pinctrl-names = "default"; >>> + pinctrl-0 = <&qup_uart0_default>; >>> + interrupts = ; >>> + status = "disabled"; >>> + }; >>> + }; >>> + }; >>> + >>> +... >>> -- >>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project >>> > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project