Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22159809ybl; Mon, 6 Jan 2020 19:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyxvRD+490ZsA0FRqfrsmKakWIWVHt5WpyR1w306OiwjSFAOGZtOPexx9+UVibg8KpP6gUe X-Received: by 2002:a9d:6d8f:: with SMTP id x15mr111494092otp.322.1578368924500; Mon, 06 Jan 2020 19:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578368924; cv=none; d=google.com; s=arc-20160816; b=H6o2f6Pp/gvSF60KBEfMipc7MdekjrIvTbqTgkV+IRUDlNHs+UMJidpoXSyAJwlj24 bfGcWwqX68nIMvKQhSoZu4yjO5PYgZ/ZjZB2kKXThetpTtUcsKY3z+0WjbIc+WqHP512 XSfO9gTDGu56jXIiAE6Az+vreCckUi+xFwJYSltZafuaaLauuDCc7Ewhth6VdKLGZqOq TV33gtDEwMTIPhi0cjY6azWh4AzYBJM6fDBUgC5oDK8ReFqN79wR/mt86bEMmXlK+F+w U7HdlZctcadwnoIwGAr2cUo2JQNsrtCBgQEOAiCgE0Yp84Z68O9507bfhxl9nE9AFzL5 +t0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=tEfpX1c6FtmtlWWKsCu0uHMdacg/1q1tY7Sxd9ZVGjo=; b=GJNEOm0EKJCov+DQEf9lFpbQpNla3xLQcCVxc4/ru8C/Tfmmq7zIhj/sK6wfOJ1i2Q 9HzwB0ma3IobFxsQPW2xtVhq3KU/SZGv2HIK8+b9Z4lKfDEXLQymfgG4AbUoRTuelfXJ O7YY3ZScgU4cfT5hwhwy+jE6TiOAvXfR7Jy9PG+/8qaKZj5KOGafd9RaZTHtdx1FFdsH RFrnM2tgHc7FlPOk5huHHMZp3SuUjhykKif6ESNzg9xwDMhYdqUHEAjHq3VwnujS1DcO P9RYq8OT+zVsjBaotMfn08VNO/Mi6l/kvvfrAy6MnXUNxz+uXUQZ7v8siUgZvJ2Y3pPw ImbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b8qmAwzi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g126si28933243oif.106.2020.01.06.19.48.31; Mon, 06 Jan 2020 19:48:44 -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=pass header.i=@chromium.org header.s=google header.b=b8qmAwzi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727464AbgAGDrx (ORCPT + 99 others); Mon, 6 Jan 2020 22:47:53 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:45277 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727384AbgAGDrw (ORCPT ); Mon, 6 Jan 2020 22:47:52 -0500 Received: by mail-ua1-f67.google.com with SMTP id 59so17953538uap.12 for ; Mon, 06 Jan 2020 19:47:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tEfpX1c6FtmtlWWKsCu0uHMdacg/1q1tY7Sxd9ZVGjo=; b=b8qmAwziovz/RzwGYg119gCIpnGG5KZQxI/Bv5pJWT4zB8lVogebUiGmhxu6v0lJh6 hozVUivFT2U6NmUX+nwu2+Atf8kFuum+PpV7WqokgXgXo7wjQmHK4ylp9cJhmTgIu1NU 0K5GGxewnL0uyPz23qrcJYdLuDTT/Fv91eqyE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tEfpX1c6FtmtlWWKsCu0uHMdacg/1q1tY7Sxd9ZVGjo=; b=GHJmObMxeQ5Pd+zKKknDIQZtZs79fCnv7D7QQUPlVHR4Uc5vTkDB4d1t4mcibZQ+g2 5hmqr2UlAy5taOo97/dxdieT0t0ljtr5p0t66gRBf9K8SatOMV0c/SL2qqjtwpQTMo++ XIDw4EV4j4fcHfgIYX49RPMyFYOFLxysVNVElEwDggI4GN54HTXijStaEFewxa78SyZO MziI35f8HKRWkkKt57aZPvTVr+qfrYbRf1bp/FTnyMQqCDLrFC8/DdrzpnEz15w9nmU2 CfX83fjbCDHitkMg2muGE/2xCWtElcJZGRQx5kDqqU6L99Sg/+wILdSR4woHptdg5DQf dScg== X-Gm-Message-State: APjAAAVmZ/q1yEnPXrGmJBF9/g1g6FRyZgMdFV9WOOG2HIIq6PuaxwkJ MCSSzaNjFjPn3yeGteMOgQJH4xKrTt0= X-Received: by 2002:a9f:3ecc:: with SMTP id n12mr22582118uaj.45.1578368871223; Mon, 06 Jan 2020 19:47:51 -0800 (PST) Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com. [209.85.217.50]) by smtp.gmail.com with ESMTPSA id b4sm13550797vsr.5.2020.01.06.19.47.49 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jan 2020 19:47:49 -0800 (PST) Received: by mail-vs1-f50.google.com with SMTP id p6so33063592vsj.11 for ; Mon, 06 Jan 2020 19:47:49 -0800 (PST) X-Received: by 2002:a67:ec4a:: with SMTP id z10mr2569640vso.73.1578368868971; Mon, 06 Jan 2020 19:47:48 -0800 (PST) MIME-Version: 1.0 References: <1576474742-23409-1-git-send-email-sanm@codeaurora.org> <1576474742-23409-2-git-send-email-sanm@codeaurora.org> In-Reply-To: From: Doug Anderson Date: Mon, 6 Jan 2020 19:47:34 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/2] dt-bindings: usb: qcom,dwc3: Convert USB DWC3 bindings To: "Sandeep Maheswaram (Temp)" Cc: Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Felipe Balbi , Stephen Boyd , linux-arm-msm , linux-usb@vger.kernel.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , Manu Gautam Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Dec 25, 2019 at 9:56 PM Sandeep Maheswaram (Temp) wrote: > > Hi > > On 12/18/2019 12:44 AM, Doug Anderson wrote: > > Hi, > > > > On Sun, Dec 15, 2019 at 9:40 PM Sandeep Maheswaram wrote: > >> > >> > >> + items: > >> + - description: System Config NOC clock. Not present on "qcom,msm8996-dwc3" compatible. > >> + - description: Master/Core clock, have to be >= 125 MHz for SS operation and >= 60MHz for HS operation > > To make the grammer gooder, s/have/has/ > > > > > >> + - description: System bus AXI clock. Not present on "qcom,msm8996-dwc3" compatible. > >> + - description: Mock utmi clock needed for ITP/SOF generation in host mode.Its frequency should be 19.2MHz. > >> + - description: Sleep clock, used for wakeup when USB3 core goes into low power mode (U3). > > * Please word wrap to ~80 chracters. > > * As Stephen says, order matters. Please match order of old bindings > > (and in clock-names) > > * Please end each with a period. > > Regarding the order of clocks, If I change the order I am facing error > in make dtbs_check > > linux-next/arch/arm64/boot/dts/qcom/sc7180-idp.dt.yaml: usb@a6f8800: > clock-names:0: 'core' was expected > linux-next/arch/arm64/boot/dts/qcom/sc7180-idp.dt.yaml: usb@a6f8800: > clock-names:1: 'mock_utmi' was expected > linux-next/arch/arm64/boot/dts/qcom/sc7180-idp.dt.yaml: usb@a6f8800: > clock-names:2: 'sleep' was expected > linux-next/arch/arm64/boot/dts/qcom/sc7180-idp.dt.yaml: usb@a6f8800: > clock-names:3: 'cfg_noc' was expected > linux-next/arch/arm64/boot/dts/qcom/sc7180-idp.dt.yaml: usb@a6f8800: > clock-names:4: 'iface' was expected > > Need to modify in the sc7180.dtsi and sdm845.dtsi to avoid the error . > Please let me know how to proceed. Ick. OK, so I guess technically the old bindings didn't specify order. It seems like it was implied that the required clocks should come before the optional, but I guess it wasn't explicit... Ugh, it gets even worse, at least for msm8996. It looks like things are nicely consistent for all the new ones. They _all_ do: "cfg_noc", "core", "iface", "mock_utmi", "sleep"; ...but msm8996 is a mess. It looks to have two USB ports (usb2 and usb3). Both ports have exactly the same compatible string listed, AKA "qcom,msm8996-dwc3", "qcom,dwc3". ...but we don't seem to use "clock-names" for either port and things seem jumbled. Specifically: * USB3 port: actually has 6 clocks listed instead of 5 (but, on the plus side, the first 5 match everyone else in ordering). The 6th clock seems to be an extra PHY clock listed which seems wrong. * USB2 port: has 5 clocks. Missing "iface" but has the extra "PHY" clock. AKA listed order is: "cfg_noc", "core", "mock_utmi", "sleep", extra PHY clock. If I had to make a decision, I'd do this: * For 8996, document exactly what's in the device tree. * For everything except 8996, use the order that your current patch has (AKA also document what's in device trees). * Consider seeing if we can remove the "PHY" clock from the 8996 device tree. If you can, make it optional (but deprecated) to supply it. Probably something like this (UNTESTED) would work. Optionally you could figure out how to be smarter and list 6 clocks for the PHY with the node name "usb@6af8800" and 5 clocks for the PHY with the node name "usb@76f8800", but I'm not sure it's worth it. allOf: - if: properties: compatible: contains: const: "qcom,msm8996-dwc3" then: anyOf: - properties: # For USB 3 port with node name usb@6af8800 clocks: items: - description: System Config NOC clock. - description: Master/Core clock, has to be >= 125 MHz for SS operation and >= 60MHz for HS operation. - description: System bus AXI clock. - description: Mock utmi clock needed for ITP/SOF generation in host mode. Its frequency should be 19.2MHz. - description: Sleep clock, used for wakeup when USB3 core goes into low power mode (U3). - description: PHY clock. ((Maybe optional? If so, set minItems to 5)) - properties: # For USB 2 port with node name usb@76f8800 clocks: items: - description: System Config NOC clock. - description: Master/Core clock, has to be >= 60MHz. - description: Mock utmi clock needed for ITP/SOF generation in host mode. Its frequency should be 19.2MHz. - description: Sleep clock, used for wakeup when USB3 core goes into low power mode (U3). - description: PHY clock. ((Maybe optional? If so, set minItems to 4)) else: properties: clocks: items: - description: System Config NOC clock. - description: Master/Core clock, has to be >= 125 MHz for SS operation and >= 60MHz for HS operation. - description: System bus AXI clock. - description: Mock utmi clock needed for ITP/SOF generation in host mode. Its frequency should be 19.2MHz. - description: Sleep clock, used for wakeup when USB3 core goes into low power mode (U3). clock-names: items: - const: cfg_noc - const: core - const: iface - const: mock_utmi - const: sleep NOTE: looking at the current Linux driver, it is very simplistic and just enables all listed clocks in bulk. It never refers to clocks by name. -Doug