Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5764563ioo; Wed, 1 Jun 2022 12:05:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT995koedhZk9QpNv5ncFukGAZ9bgQzqma0OGX+7B1ZUYudSmtl5ds9GRn2ys/lG/Rv0KE X-Received: by 2002:a05:6a00:22d2:b0:518:97ee:8609 with SMTP id f18-20020a056a0022d200b0051897ee8609mr51724543pfj.80.1654110315112; Wed, 01 Jun 2022 12:05:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654110315; cv=none; d=google.com; s=arc-20160816; b=SvZqKhi53sLQYh2sVU+jBVtaysK01mg7WMChaAoyYGBvRMyVklcDnKy1l5+23GGS3I Do4SifLYOMjYXRetYI5aWRtGJtrDf6tUdUDh/0IppwLA+oj2Cz7mZo3Cdxemak1qyG0O 1vQmT7u86hGIFlhMihXg39Pqzz/UagQXKjyh9+ygk8I/WjcbPGcXbHahLe5EBiKXKrdl yMS6R+oKwK5JrafbS0325KsSDRuW6J6HRMUtoY4NEYpbLZCMFdeLldw+V9w7vW1JTv6r 2z0LzyPOikKXfY9caA9azK5f3K4DFxwNLs7+gFMKYBMzi8zmQdVP1HKtFaqOL7v7ENKB tnwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ZWm3WuKv62qT7e5z6OWP+gT1B/tneUL+ffK/iAp+h6E=; b=FCMSz8DZ4FZfTr5syPwQozwnoY/b5z9Vv+iBJCycX2Ua530GytryckO+7n9KbVRPHx DTUfgIzcX4YgnMfEtBYskw9nAhgVBFo+M2onHbK+GQqU/+c2OyFiVuUMtLKvC2qDNIq7 xorTADbHQ/4APhK517uvoW4c1yJxcVg9VB5z5p5urG18nu2kixHB2rGPV+l4rPK9vl8+ uVBjBLuSVo07NpXEZUkmPHCEHEhcfiUeelWB9xdDer38aZXmYrNApzh+0RvHJpqtZRfC ntf5pMRTnZeYBzMVV2pL9MBXyFFKRjs6UeNTpO4lFN9j0QOTr/BYcx5jqscky1tSH8A/ Suzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/jM5cQw"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id k13-20020a636f0d000000b003c20bb0af3asi3267774pgc.623.2022.06.01.12.05.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 12:05:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="T/jM5cQw"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AB12EFF58E; Wed, 1 Jun 2022 11:47:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343896AbiEaLpY (ORCPT + 99 others); Tue, 31 May 2022 07:45:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343891AbiEaLpW (ORCPT ); Tue, 31 May 2022 07:45:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 857A68DDFF; Tue, 31 May 2022 04:45:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 33D15B80FB3; Tue, 31 May 2022 11:45:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADE74C385A9; Tue, 31 May 2022 11:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653997518; bh=jODhV9sVWgDMOncckTb9rlVg7HE1GMWluvYU3vHcQQw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=T/jM5cQwlJy5RlsQ3RmAF2rR6nSCTb4ZafGhYV1lwqUVtBw/IIcpex8bHtTjeaI3/ 52K2AUShelO3J/lvZ4XtohN6LhEXMjdDRLkd8g5lG6MjMfFhUShnkM9PON6Wj0ONRq ctpaD2Kwind/XUNcsB/4fajLbaFJumhG5/C4LOY1OS+O7OsAvH1DSSjTUBlLUkTXIa cOYZn2esO2vxTbayF24reFPQfPXtum95iCaZ7yrL9E164SXhingiBnsicdTRqfkE5P 3/zjGsRQqvlYG+ISpTGljlJmqKG2AX7Yxo1vxgbZApXwDYjlnj1V3JTXr/tpfM50zV J/4Hlfk8UeyZw== Message-ID: <26603540-8887-ef8d-8f4d-26f2f33d2a6f@kernel.org> Date: Tue, 31 May 2022 14:45:12 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 1/2] dt-bindings: phy: ti: phy-gmii-sel: Add bindings for J7200 Content-Language: en-US To: Siddharth Vadapalli , robh+dt@kernel.org, lee.jones@linaro.org, krzysztof.kozlowski+dt@linaro.org, kishon@ti.com, vkoul@kernel.org, dan.carpenter@oracle.com, grygorii.strashko@ti.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org References: <20220531111221.22963-1-s-vadapalli@ti.com> <20220531111221.22963-2-s-vadapalli@ti.com> From: Roger Quadros In-Reply-To: <20220531111221.22963-2-s-vadapalli@ti.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Siddharth, On 31/05/2022 14:12, Siddharth Vadapalli wrote: > TI's J7200 SoC supports additional PHY modes like QSGMII and SGMII > that are not supported on earlier SoCs. Add a compatible for it. > > Signed-off-by: Siddharth Vadapalli > --- > .../mfd/ti,j721e-system-controller.yaml | 5 ++++ > .../bindings/phy/ti,phy-gmii-sel.yaml | 24 ++++++++++++++++++- > 2 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml > index fa86691ebf16..e381ba62a513 100644 > --- a/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml > +++ b/Documentation/devicetree/bindings/mfd/ti,j721e-system-controller.yaml > @@ -48,6 +48,11 @@ patternProperties: > description: > This is the SERDES lane control mux. > > + "phy@[0-9a-f]+$": > + type: object > + description: > + This is the register to set phy mode through phy-gmii-sel driver. > + Is this really required? The system controller has 100s of different such registers and it is not practical to mention about all. > required: > - compatible > - reg > diff --git a/Documentation/devicetree/bindings/phy/ti,phy-gmii-sel.yaml b/Documentation/devicetree/bindings/phy/ti,phy-gmii-sel.yaml > index ff8a6d9eb153..7427758451e7 100644 > --- a/Documentation/devicetree/bindings/phy/ti,phy-gmii-sel.yaml > +++ b/Documentation/devicetree/bindings/phy/ti,phy-gmii-sel.yaml > @@ -53,12 +53,21 @@ properties: > - ti,am43xx-phy-gmii-sel > - ti,dm814-phy-gmii-sel > - ti,am654-phy-gmii-sel > + - ti,j7200-cpsw5g-phy-gmii-sel Why not just "ti,j7200-phy-gmii-sel" so it is consistent naming. > > reg: > maxItems: 1 > > '#phy-cells': true > > + ti,enet-ctrl-qsgmii: > + $ref: /schemas/types.yaml#/definitions/uint32 > + description: | > + Required only for QSGMII mode. Bitmask to select the port for > + QSGMII main mode. Rest of the ports are selected as QSGMII_SUB > + ports automatically. Any of the 4 CPSW5G ports can act as the > + main port with the rest of them being the QSGMII_SUB ports. > + This is weird way of doing things. The Ethernet controller driver already knows which mode the port is supposed to operate. e.g. +&cpsw0_port1 { + phy-handle = <&cpsw5g_phy0>; + phy-mode = "qsgmii"; + mac-address = [00 00 00 00 00 00]; + phys = <&cpsw0_phy_gmii_sel 1>; +}; + +&cpsw0_port2 { + phy-handle = <&cpsw5g_phy1>; + phy-mode = "qsgmii-sub"; + mac-address = [00 00 00 00 00 00]; + phys = <&cpsw0_phy_gmii_sel 2>; And it can convey the mode to the PHY driver via phy_ops->set_mode. So you should be depending on that instead of adding this new property. > allOf: > - if: > properties: > @@ -73,6 +82,19 @@ allOf: > '#phy-cells': > const: 1 > description: CPSW port number (starting from 1) > + - if: > + properties: > + compatible: > + contains: > + enum: > + - ti,j7200-cpsw5g-phy-gmii-sel > + then: > + properties: > + '#phy-cells': > + const: 1 > + description: CPSW port number (starting from 1) > + ti,enet-ctrl-qsgmii: > + enum: [1, 2, 4, 8] > - if: > properties: > compatible: > @@ -97,7 +119,7 @@ additionalProperties: false > > examples: > - | > - phy_gmii_sel: phy-gmii-sel@650 { > + phy_gmii_sel: phy@650 { > compatible = "ti,am3352-phy-gmii-sel"; > reg = <0x650 0x4>; > #phy-cells = <2>; cheers, -roger