Message ID | 20230125175943.675823-1-krzysztof.kozlowski@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp415118wrn; Wed, 25 Jan 2023 10:12:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXvXv6nPEVk3lyOVlEetdcuBMOqizz51gSgTBTTMwmKbJ59Cue6g9VB+p3/MlWvH+MlnhE62 X-Received: by 2002:a05:6402:43ce:b0:461:2288:6808 with SMTP id p14-20020a05640243ce00b0046122886808mr36039711edc.21.1674670341892; Wed, 25 Jan 2023 10:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674670341; cv=none; d=google.com; s=arc-20160816; b=u+cAKm19zNgMOfHqmN/SEtWOYAaawggVK0kYYMaLiUlrGiLL7uKcJnTKYD9tCmAaf0 GY+mKyKIPuhW1WJY3ONUKAwh7g4GqdmGGHQkwGYHEf0j1JOMssz9dCYxuvPR+XfmV3l3 9qhO9ZVtJyfOtjiIxkm85CYqY0E9DZPh1CngyaCdDFn/EQbNtEIokWbg7Zw7jAki6dNh YEEPADKUJEHXUbm77u3oRXX4Yawall18hnPXunUls+Xs4iBwB2F1BUZi1r51OdB4E/Fy c8y3zCml13iQnljHXrlJDHKrIiKA8n4wsYIOIycC0bIPEcM64pYANzwpHBJP01L/n2V7 ds5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sTOOyplbHxnZ+EFGvkRK9RseAv80+oP0c90JV+EsvHc=; b=UkJWIRxZtq4ckZToSrVRqOXxy1R+UJI5c8cJBSM+N+Lphp2C2QeuUTnF47OCPLhDnc uO77+o/HKsLh1MB3PA7UcRbLHs2lJmXOrS85x2rkMO1flykbq9oXQIi9ISbrWcD+Rznb Ea0feE9tIrMtboAn4VO03el+PTVaFZ12wuVRzhKsJR5RIyf5Ya82CpXdCkAawFlA4vEv GwcFOR8W/AqPQwHCfH2/q4YxkuTzUAQIy3rjm2Cpg1PlzhN5GBc+nsw/4irYTb4EMbJ/ D2v2XajJJPXLEr43c6fEePm3mAgqzJgziZ4bLdFrvpLeZog/3bO6srLcx35ZGPMJk98R h2Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b3xrzTS5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l20-20020a056402345400b0049dd955ded4si7034829edc.524.2023.01.25.10.11.57; Wed, 25 Jan 2023 10:12:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b3xrzTS5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S235950AbjAYR7x (ORCPT <rfc822;rust.linux@gmail.com> + 99 others); Wed, 25 Jan 2023 12:59:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjAYR7v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 25 Jan 2023 12:59:51 -0500 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F6822DE62 for <linux-kernel@vger.kernel.org>; Wed, 25 Jan 2023 09:59:50 -0800 (PST) Received: by mail-wr1-x432.google.com with SMTP id t18so5070873wro.1 for <linux-kernel@vger.kernel.org>; Wed, 25 Jan 2023 09:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sTOOyplbHxnZ+EFGvkRK9RseAv80+oP0c90JV+EsvHc=; b=b3xrzTS5gcAyZdQpRwmO6xq87K/+gmwj3GtougbVYdVQRQCOEZHNlrsx6LRYrb2KnG AVIP1dZjGgS8PfB9/OiiHLgXsTAYL+xYW4OSiWSmwiYjizCelQw9X/ga3CFj5xse05gS lmmZ/fj88VeBXnC0Yr9ZZbmCzwNMdFn6+yAc669OjP/0o3F8l8/1W4vqUv6jPElbvzAt KbOEoXZbQRCAqWvdM/FsVZZhUZ7t+7Xm6g0JlpWUCAjOsq9TEF/C3X/NT5cl2n55zn6z ga8meNb/niwL0bojsOlp8FgZjgdx8/11jRwcP0pFjW2I4yR/OSwrAW4RClEXCQXYMGTo eMnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sTOOyplbHxnZ+EFGvkRK9RseAv80+oP0c90JV+EsvHc=; b=xJaodhr88FK9Wk6OGofWRtkV3+72sXU6GBSumh+rgck8R/GLk6iXbx72lJhGhaseZB Fc1ezxs3Fi0EAsz7hBxWd/tJbbn+W1lNjO1bd3ybr1McUgd0/vdK9u47W8gJY5l1m+8z EDliHykNouKU3qHEw5RA8wUj6cKPDLhMZYUhpLTyN6SDtH5UuG3ChxS2HubrnF5DUUyE AIpPODbRWHGhx4Pnxb9ffRtfQr/yGwQRviSDf9jTO79hDO7KKJuTgWQFQQN/zSQSDfl/ REbYE+71AlFHPD9G4Y5XQws4c+QnkqW8H+xHB3poMYrVQllvXPEh0LsBJLkYxPcvGP/Y Zw6g== X-Gm-Message-State: AO0yUKUbZrdD9DsDy2OLGlwie2wd0MYGWTgjcdqBFgown08JO56czbon SAhmkEY52po68guKHXXG/Dsm0Q== X-Received: by 2002:adf:fa09:0:b0:2bf:ac2c:4489 with SMTP id m9-20020adffa09000000b002bfac2c4489mr6572646wrr.54.1674669588976; Wed, 25 Jan 2023 09:59:48 -0800 (PST) Received: from krzk-bin.. ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id w14-20020a5d608e000000b002bc84c55758sm6048927wrt.63.2023.01.25.09.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 09:59:48 -0800 (PST) From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Subject: [PATCH] dt-bindings: usb: samsung,exynos-dwc3: allow unit address in DTS Date: Wed, 25 Jan 2023 18:59:43 +0100 Message-Id: <20230125175943.675823-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756019128357029751?= X-GMAIL-MSGID: =?utf-8?q?1756019128357029751?= |
Series |
dt-bindings: usb: samsung,exynos-dwc3: allow unit address in DTS
|
|
Commit Message
Krzysztof Kozlowski
Jan. 25, 2023, 5:59 p.m. UTC
The Samsung Exynos SoC USB 3.0 DWC3 Controller is a simple wrapper of
actual DWC3 Controller device node. It handles necessary Samsung
Exynos-specific resources (regulators, clocks), but does not have its
own MMIO address space.
However neither simple-bus bindings nor dtc W=1 accept device nodes in
soc@ node which do not have unit address. Therefore allow using
the address space of child device (actual DWC3 Controller) as the
wrapper's address.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
DTS fixes are here:
https://lore.kernel.org/linux-samsung-soc/20230125175751.675090-1-krzysztof.kozlowski@linaro.org/T/#t
---
.../devicetree/bindings/usb/samsung,exynos-dwc3.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
Comments
On Wed, Jan 25, 2023 at 06:59:43PM +0100, Krzysztof Kozlowski wrote: > The Samsung Exynos SoC USB 3.0 DWC3 Controller is a simple wrapper of > actual DWC3 Controller device node. It handles necessary Samsung > Exynos-specific resources (regulators, clocks), but does not have its > own MMIO address space. > > However neither simple-bus bindings nor dtc W=1 accept device nodes in > soc@ node which do not have unit address. Therefore allow using > the address space of child device (actual DWC3 Controller) as the > wrapper's address. The correct fix is 'ranges' should have a value. Though the whole wrapper thing when there are no registers I dislike... > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > > --- > > DTS fixes are here: > https://lore.kernel.org/linux-samsung-soc/20230125175751.675090-1-krzysztof.kozlowski@linaro.org/T/#t > --- > .../devicetree/bindings/usb/samsung,exynos-dwc3.yaml | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml > index 6b9a3bcb3926..a94b1926dda0 100644 > --- a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml > +++ b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml > @@ -29,6 +29,9 @@ properties: > > ranges: true > > + reg: > + maxItems: 1 > + > '#size-cells': > const: 1 > > @@ -108,8 +111,9 @@ examples: > #include <dt-bindings/clock/exynos5420.h> > #include <dt-bindings/interrupt-controller/arm-gic.h> > > - usb { > + usb-wrapper@12000000 { > compatible = "samsung,exynos5250-dwusb3"; > + reg = <0x12000000 0x10000>; > #address-cells = <1>; > #size-cells = <1>; > ranges; > -- > 2.34.1 >
On 25/01/2023 22:13, Rob Herring wrote: > On Wed, Jan 25, 2023 at 06:59:43PM +0100, Krzysztof Kozlowski wrote: >> The Samsung Exynos SoC USB 3.0 DWC3 Controller is a simple wrapper of >> actual DWC3 Controller device node. It handles necessary Samsung >> Exynos-specific resources (regulators, clocks), but does not have its >> own MMIO address space. >> >> However neither simple-bus bindings nor dtc W=1 accept device nodes in >> soc@ node which do not have unit address. Therefore allow using >> the address space of child device (actual DWC3 Controller) as the >> wrapper's address. > > The correct fix is 'ranges' should have a value. Though the whole > wrapper thing when there are no registers I dislike... You mean something like this (diff against this patchset): ---------- diff --git a/arch/arm/boot/dts/exynos54xx.dtsi b/arch/arm/boot/dts/exynos54xx.dtsi index 08786fd9c6ea..75b6f9678672 100644 --- a/arch/arm/boot/dts/exynos54xx.dtsi +++ b/arch/arm/boot/dts/exynos54xx.dtsi @@ -142,16 +142,15 @@ hsi2c_7: i2c@12cd0000 { status = "disabled"; }; - usbdrd3_0: usb-wrapper@12000000 { + usbdrd3_0: usb-wrapper { compatible = "samsung,exynos5250-dwusb3"; - reg = <0x12000000 0x10000>; #address-cells = <1>; #size-cells = <1>; - ranges; + ranges = <0x0 0x12000000 0x10000>; - usbdrd_dwc3_0: usb@12000000 { + usbdrd_dwc3_0: usb@0 { compatible = "snps,dwc3"; - reg = <0x12000000 0x10000>; + reg = <0x0 0x10000>; --------- Unfortunately dtc W=1 is still not happy: exynos54xx.dtsi:145.26-159.5: Warning (unit_address_vs_reg): /soc/usb-wrapper: node has a reg or ranges property, but no unit name neither dtbs_check is: exynos5410-smdk5410.dtb: soc: usb-wrapper: {'compatible': ['samsung,exynos5250-dwusb3'], '#address-cells': [[1]], '#size-cells': [[1]], 'ranges': [[0, 301989888, 65536]], 'clocks': [[5, 366]], 'clock-names': ['usbdrd30'], 'pinctrl-names': ['default'], 'pinctrl-0': [[21, 22]], 'vdd10-supply': [[23]], 'vdd33-supply': [[23]], 'usb@0': {'compatible': ['snps,dwc3'], 'reg': [[0, 65536]], 'interrupts': [[0, 72, 4]], 'phys': [[24, 0], [24, 1]], 'phy-names': ['usb2-phy', 'usb3-phy'], 'snps,dis_u3_susphy_quirk': True}} should not be valid under {'type': 'object'} From schema: /home/krzk/.local/lib/python3.10/site-packages/dtschema/schemas/simple-bus.yaml Best regards, Krzysztof
On Thu, Jan 26, 2023 at 4:48 AM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > On 25/01/2023 22:13, Rob Herring wrote: > > On Wed, Jan 25, 2023 at 06:59:43PM +0100, Krzysztof Kozlowski wrote: > >> The Samsung Exynos SoC USB 3.0 DWC3 Controller is a simple wrapper of > >> actual DWC3 Controller device node. It handles necessary Samsung > >> Exynos-specific resources (regulators, clocks), but does not have its > >> own MMIO address space. > >> > >> However neither simple-bus bindings nor dtc W=1 accept device nodes in > >> soc@ node which do not have unit address. Therefore allow using > >> the address space of child device (actual DWC3 Controller) as the > >> wrapper's address. > > > > The correct fix is 'ranges' should have a value. Though the whole > > wrapper thing when there are no registers I dislike... > > You mean something like this (diff against this patchset): > ---------- > diff --git a/arch/arm/boot/dts/exynos54xx.dtsi > b/arch/arm/boot/dts/exynos54xx.dtsi > index 08786fd9c6ea..75b6f9678672 100644 > --- a/arch/arm/boot/dts/exynos54xx.dtsi > +++ b/arch/arm/boot/dts/exynos54xx.dtsi > @@ -142,16 +142,15 @@ hsi2c_7: i2c@12cd0000 { > status = "disabled"; > }; > > - usbdrd3_0: usb-wrapper@12000000 { > + usbdrd3_0: usb-wrapper { Why did you drop the unit-address? Unit-address is valid with 'reg' or 'ranges'. > compatible = "samsung,exynos5250-dwusb3"; > - reg = <0x12000000 0x10000>; > #address-cells = <1>; > #size-cells = <1>; > - ranges; > + ranges = <0x0 0x12000000 0x10000>; > > - usbdrd_dwc3_0: usb@12000000 { > + usbdrd_dwc3_0: usb@0 { > compatible = "snps,dwc3"; > - reg = <0x12000000 0x10000>; > + reg = <0x0 0x10000>; > > --------- > > Unfortunately dtc W=1 is still not happy: > > exynos54xx.dtsi:145.26-159.5: Warning (unit_address_vs_reg): > /soc/usb-wrapper: node has a reg or ranges property, but no unit name > > neither dtbs_check is: > > exynos5410-smdk5410.dtb: soc: usb-wrapper: {'compatible': > ['samsung,exynos5250-dwusb3'], '#address-cells': [[1]], '#size-cells': > [[1]], 'ranges': [[0, 301989888, 65536]], 'clocks': [[5, 366]], > 'clock-names': ['usbdrd30'], 'pinctrl-names': ['default'], 'pinctrl-0': > [[21, 22]], 'vdd10-supply': [[23]], 'vdd33-supply': [[23]], 'usb@0': > {'compatible': ['snps,dwc3'], 'reg': [[0, 65536]], 'interrupts': [[0, > 72, 4]], 'phys': [[24, 0], [24, 1]], 'phy-names': ['usb2-phy', > 'usb3-phy'], 'snps,dis_u3_susphy_quirk': True}} should not be valid > under {'type': 'object'} > From schema: > /home/krzk/.local/lib/python3.10/site-packages/dtschema/schemas/simple-bus.yaml > > > Best regards, > Krzysztof >
On 26/01/2023 14:41, Rob Herring wrote: > On Thu, Jan 26, 2023 at 4:48 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> >> On 25/01/2023 22:13, Rob Herring wrote: >>> On Wed, Jan 25, 2023 at 06:59:43PM +0100, Krzysztof Kozlowski wrote: >>>> The Samsung Exynos SoC USB 3.0 DWC3 Controller is a simple wrapper of >>>> actual DWC3 Controller device node. It handles necessary Samsung >>>> Exynos-specific resources (regulators, clocks), but does not have its >>>> own MMIO address space. >>>> >>>> However neither simple-bus bindings nor dtc W=1 accept device nodes in >>>> soc@ node which do not have unit address. Therefore allow using >>>> the address space of child device (actual DWC3 Controller) as the >>>> wrapper's address. >>> >>> The correct fix is 'ranges' should have a value. Though the whole >>> wrapper thing when there are no registers I dislike... >> >> You mean something like this (diff against this patchset): >> ---------- >> diff --git a/arch/arm/boot/dts/exynos54xx.dtsi >> b/arch/arm/boot/dts/exynos54xx.dtsi >> index 08786fd9c6ea..75b6f9678672 100644 >> --- a/arch/arm/boot/dts/exynos54xx.dtsi >> +++ b/arch/arm/boot/dts/exynos54xx.dtsi >> @@ -142,16 +142,15 @@ hsi2c_7: i2c@12cd0000 { >> status = "disabled"; >> }; >> >> - usbdrd3_0: usb-wrapper@12000000 { >> + usbdrd3_0: usb-wrapper { > > Why did you drop the unit-address? Unit-address is valid with 'reg' or 'ranges'. I misunderstood your comment then. To which problem did you refer with "The correct fix is ranges ...."? To my understanding this only changes the unit address, so I won't have to change the node name usb->usb-wrapper. Except this, my patches having empty ranges are equivalent. > >> compatible = "samsung,exynos5250-dwusb3"; >> - reg = <0x12000000 0x10000>; >> #address-cells = <1>; >> #size-cells = <1>; >> - ranges; >> + ranges = <0x0 0x12000000 0x10000>; >> Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml index 6b9a3bcb3926..a94b1926dda0 100644 --- a/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/samsung,exynos-dwc3.yaml @@ -29,6 +29,9 @@ properties: ranges: true + reg: + maxItems: 1 + '#size-cells': const: 1 @@ -108,8 +111,9 @@ examples: #include <dt-bindings/clock/exynos5420.h> #include <dt-bindings/interrupt-controller/arm-gic.h> - usb { + usb-wrapper@12000000 { compatible = "samsung,exynos5250-dwusb3"; + reg = <0x12000000 0x10000>; #address-cells = <1>; #size-cells = <1>; ranges;