linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Rob Herring <robh@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.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
Subject: Re: [PATCH] dt-bindings: usb: samsung,exynos-dwc3: allow unit address in DTS
Date: Thu, 26 Jan 2023 11:48:26 +0100	[thread overview]
Message-ID: <afce38b0-be90-a3b5-f181-a88ad3025bd9@linaro.org> (raw)
In-Reply-To: <20230125211329.GA2899932-robh@kernel.org>

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


  reply	other threads:[~2023-01-26 10:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 17:59 [PATCH] dt-bindings: usb: samsung,exynos-dwc3: allow unit address in DTS Krzysztof Kozlowski
2023-01-25 21:13 ` Rob Herring
2023-01-26 10:48   ` Krzysztof Kozlowski [this message]
2023-01-26 13:41     ` Rob Herring
2023-01-26 13:54       ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afce38b0-be90-a3b5-f181-a88ad3025bd9@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=alim.akhtar@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).