Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5431519ybp; Mon, 14 Oct 2019 22:37:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwp97bQQVa8uOzjeKjszT61ub+AdyhOzANQ5ps4kIqt6iDX5QNRba36+yPEhJ8l15X5RloI X-Received: by 2002:a17:906:1cd8:: with SMTP id i24mr31590154ejh.149.1571117869477; Mon, 14 Oct 2019 22:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571117869; cv=none; d=google.com; s=arc-20160816; b=KCH7Cz2eWPRKDQjrTwzcbY9grKb1q9+HfkTVmrWZpwMc8mlKdqV2kFrs6FtkRhqKnv CN+t3IGpYQ0FFfNPr3MMKExRYsqcK50iAez1IPoAPr0V7nwsfSmvXXVWJC26dVli13hL 2I4EdazfIEhrcd5qa9nY2URMP0PpyqEDPwzfZjayCFsB0XDRPQVb3afK88BezgftTmbv 4VDGlQ1AGvTDACFO2ZVUEPOtDBBEUnrgTc5+tiqpQzhqEkSvJFVj4hId5VM3MD5alvTj 34ldGyFcUjcPYnXKkV6lmlbLKUwkMv2p3kNItNjaVpa+U7ibQmoS0wFHH+7Czr3W/F7a eJyA== 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=6zpjnd/oSYf7dWxIXsHsLG6VqXEmTIzLuPNZft47eNI=; b=c9ebOrdIxYObzOSfbjYKxlj2QTVJDiTpil276eh5jYoVmzchYbHlyr4BC6fkEi2EwA f/VOFC0a/vPXnMRUZF9fpnjaSTAH4adTwcnowZnlL8fXwEyKfbI3O4GD1w5vMXdgY8Zt 7e7djYOnGcTKQ3WAGCpH8o5lM022EldnIDON0MArf5ziqdBObPUyCnG+v1gBm0a3r9/Z wdnjDkDRmcadgJnZVq6YtvDNMCbXqfiOdRoBptbbFkUuoi6DL5BlLJsuXjvi62mNefy/ Il7R+oaIop+GCVu3vV9+mvg6vtFsxRoaQeXAxiLymvCnZ10jyvr2prnbPAlJh9f82rK9 4Sng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uyr8Mi4O; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3si2058758ejs.427.2019.10.14.22.37.18; Mon, 14 Oct 2019 22:37:49 -0700 (PDT) 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=@linaro.org header.s=google header.b=uyr8Mi4O; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727761AbfJOD5i (ORCPT + 99 others); Mon, 14 Oct 2019 23:57:38 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40598 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbfJOD5i (ORCPT ); Mon, 14 Oct 2019 23:57:38 -0400 Received: by mail-wm1-f65.google.com with SMTP id b24so18617062wmj.5 for ; Mon, 14 Oct 2019 20:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=6zpjnd/oSYf7dWxIXsHsLG6VqXEmTIzLuPNZft47eNI=; b=uyr8Mi4OzKIo/JSKBj9IwTqrgR+SAtZcNjnmIWpJhDdPpzZ+CBdwSRG5hF/iBoP+vC 3V1p42ka/zlVvcHK7gAfTWVdZ10ABNL7rt9tT/QXnS0dBp/Xv9udy/XRKb2wYutlR1Qm chtkT3g3yB7yKRsM9AB2IeUJXSk9/31UakOteKzMYEXdV6sG0vtKlmYBzR+esBiRvhCm CzrwYws317sfMtQDeUEFrJLZZy5ysi6Ika2dr8ladP30ZqOPi9kLkN/GvZuN2lA4hjPF DjxcdsEx5BeQW+KPvzvlGOtlQhbj4L80XhqqyiBEqnTtlqLxuMsAHO1mrdKD4F7OMXd4 n8eg== 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=6zpjnd/oSYf7dWxIXsHsLG6VqXEmTIzLuPNZft47eNI=; b=d0whjs/+DNwmsYAYqwKHwBuzkDhpOvgMxNUbpuk9MMOjaMZQufcekB1+/gHgQymGwC pOPBkqSBhq5ZKeVQcGtODfUGj1KSyEmuvUlqDmuzP3+wvggvHs+A+QKYGohUOPz5zrn+ ykI1sYYvqgbQNmHVCTw4ozkwTHS6V20MQ4jmyswrFQedwO3LlcruhlBjFqhkxZWPnTje wQSPF2GKaoZVfjJ9teDm7gPS0uGeyaSTy9H9U6vNRNsd2Tas7X/vN0RX4xkhA9FtorLM SAQP025Txoeb/r4HlU7rCf5jEBZKDrekxxHZ/HaJmV1OO6TGBstHcH8sX9H84CaveHzU JsQA== X-Gm-Message-State: APjAAAUq1qGbbe7FdNCCbV+rG3+U5A4ZDVBLmTh5OZhvBcbRS27YcN7D TWQWzytCIgMqWuwB5vtisPXlVa8xQ6+VTzYtwEJLRA== X-Received: by 2002:a1c:a8c9:: with SMTP id r192mr17425885wme.152.1571111855030; Mon, 14 Oct 2019 20:57:35 -0700 (PDT) MIME-Version: 1.0 References: <20191007175553.66940-1-john.stultz@linaro.org> <20191007175553.66940-5-john.stultz@linaro.org> <20191011155123.GA14272@bogus> In-Reply-To: <20191011155123.GA14272@bogus> From: John Stultz Date: Mon, 14 Oct 2019 20:57:22 -0700 Message-ID: Subject: Re: [RFC][PATCH v2 4/5] dt-bindings: usb: dwc3: of-simple: add compatible for HiSi To: Rob Herring Cc: lkml , Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Mark Rutland , Yu Chen , Matthias Brugger , Chunfeng Yun , Linux USB List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Masahiro Yamada 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 On Fri, Oct 11, 2019 at 8:51 AM Rob Herring wrote: > > On Mon, Oct 07, 2019 at 04:00:24PM -0700, John Stultz wrote: > > On Mon, Oct 7, 2019 at 2:11 PM Rob Herring wrote: > > > > > > On Mon, Oct 7, 2019 at 2:07 PM John Stultz wrote: > > > > > > > > On Mon, Oct 7, 2019 at 11:38 AM Rob Herring wrote: > > > > > > > > > > On Mon, Oct 7, 2019 at 12:56 PM John Stultz wrote: > > > > > > > > > > > > Add necessary compatible flag for HiSi's DWC3 so > > > > > > dwc3-of-simple will probe. > > > > > > > > > > > > Cc: Greg Kroah-Hartman > > > > > > Cc: Felipe Balbi > > > > > > Cc: Andy Shevchenko > > > > > > Cc: Rob Herring > > > > > > Cc: Mark Rutland > > > > > > Cc: Yu Chen > > > > > > Cc: Matthias Brugger > > > > > > Cc: Chunfeng Yun > > > > > > Cc: linux-usb@vger.kernel.org > > > > > > Cc: devicetree@vger.kernel.org > > > > > > Signed-off-by: John Stultz > > > > > > --- > > > > > > v2: Tweaked clock names as clk_usb3phy_ref didn't seem right. > > > > > > --- > > > > > > .../devicetree/bindings/usb/hisi,dwc3.txt | 52 +++++++++++++++++++ > > > > > > 1 file changed, 52 insertions(+) > > > > > > create mode 100644 Documentation/devicetree/bindings/usb/hisi,dwc3.txt > > > > > > > > > > Can you make this a schema. > > > > > > > > Sorry, I'm not sure exactly what you're asking. I'm guessing from > > > > grepping around you want the bindings in yaml instead (I see a few > > > > examples)? > > > > > > Yes. > > > > > > > Is there some pointer to documentation? The > > > > Documentation/devicetree/bindings/writing-bindings.txt file doesn't > > > > seem to say much on it. > > > > > > You mean Documentation/devicetree/writing-schemas.rst? There's that > > > and Documentation/devicetree/bindings/example-schema.yaml which has a > > > bunch of annotations on what each part means. > > > > Ah! Sorry for missing that. Thanks for the pointer, though I may get > > away with dropping this one. > > > > > > > If it's only clocks and resets for the wrapper node, just make this > > > > > all one node. > > > > > > > > Just to make sure I'm following, you're suggesting I put all the > > > > clocks/resets in the dwc3 node (renamed to usb for the node name) and > > > > not add the wrapper? > > > > > > Yes. > > > > > > > I'll have to see if that's possible. The generic dwc3 binding wants 3 > > > > clocks, but I only have two in the code I've worked with (similarly it > > > > seems to only want two resets, not 4) so I'll have to see if I can > > > > figure out how to adapt that. > > > > > > Possible since commit fe8abf332b8f ("usb: dwc3: support clocks and > > > resets for DWC3 core"). > > > > Ok. It *seems* like I can get it working with the existing binding > > then. There's a little funkiness with the core expecting three clocks > > while I only have two (currently I'm duplicating the "bus_early" clk > > for "suspend". Is there a preferred way to do this sort of hack?), and > > I'm a little worried that only the first reset is being used (instead > > of the 4 specified), but it seems to work so far. > > I would assume that you simply don't know how the 'suspend' clock is > connected rather than you don't have one. But that's maybe not a > problem you can fix. > > I would make dwc3 use devm_clk_bulk_get_all and allow for less than 3 > clocks. And do a similar change for resets. So got a chance to start implementing this and it seems like it will work. That said, it feels like I'm duplicating logic already in the dwc-of-simple.c implementation (which already handles arbitrary clks and resets), particularly if I try to implement the device specific need_reset quirk used by HiKey960 (and rk3399). Do you feel having that logic copied is worth avoiding the extra bindings? Or is it too duplicative? thanks -john