Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CB5EC433F5 for ; Tue, 12 Apr 2022 09:47:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BQxZXiXPeo6NkV3FPcGRqgYbBK3P4ZUux9TNGax6WvA=; b=oAcfyYyPybXWe1 /cHmQ0/5IQnYTGg2vcdb+x1Gn++IMKJmOtWdLHSiW2qn1FMpz3I1SYNrrx9ZI1OAQ3rF9Qsi8reJx Ye/ZYvo+8NvXpkucxB81gT7JuaqOPaNJQEr6ZXwC/sdcIvVj0Ghv3U+tOrebVtlrGAww30oBR7in9 WCItisabgvAG7D+uwqGof1Nj/vvLy6IBJZJvZrzGLpqJgqMpBHFsuloSUGbTmDYQvWrjJPeUHk3mP 4iEaruuXc0pXB/+czwSEvWOxhBWwAm35UOUVdATwKeE10wUsSG/Q+7vCPseXbNXTOzn4u1JnPXwrw HHQIC/qjqqJIapL7fnug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neD5o-00D0vF-1V; Tue, 12 Apr 2022 09:45:48 +0000 Received: from fllv0015.ext.ti.com ([198.47.19.141]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neD5k-00D0tF-2q for linux-arm-kernel@lists.infradead.org; Tue, 12 Apr 2022 09:45:45 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 23C9jUKe067665; Tue, 12 Apr 2022 04:45:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1649756730; bh=VDZc9Kk2A5AD9uS5jLQGDKo7YqCKDe0p6HsXL4ysfhI=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=iv8hwZ5BypRzsvkov7dNiU9fES4zKD4AeB2e2tT3+IZ2IG/soRzihAEobXxhPnn1w oKcYmdxfOt35wXl3f2vA2v8XTwsSrdbvJSowEbnP0I2nK4fFWEuy/DXYMghvNxi/Q4 t9indP3WDNhlqvzmwclK8zlA/i2MSfpAqVA0PYuQ= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 23C9jUhf021475 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 12 Apr 2022 04:45:30 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 12 Apr 2022 04:45:29 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 12 Apr 2022 04:45:29 -0500 Received: from [10.24.69.24] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 23C9jOXs106716; Tue, 12 Apr 2022 04:45:24 -0500 Message-ID: <468d4d9b-44b4-2894-2a75-4caab1e72147@ti.com> Date: Tue, 12 Apr 2022 15:15:23 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC 13/13] net: ti: icssg-prueth: Add ICSSG ethernet driver Content-Language: en-US To: Andrew Lunn References: <20220406094358.7895-1-p-mohan@ti.com> <20220406094358.7895-14-p-mohan@ti.com> From: Puranjay Mohan In-Reply-To: X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220412_024544_252635_0471024D X-CRM114-Status: GOOD ( 20.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nm@ti.com, devicetree@vger.kernel.org, Grygorii Strashko , vigneshr@ti.com, mathieu.poirier@linaro.org, kishon@ti.com, netdev@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, Roger Quadros , krzysztof.kozlowski+dt@linaro.org, ssantosh@kernel.org, kuba@kernel.org, davem@davemloft.net, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org + Roger, Grygorii On 07/04/22 00:07, Andrew Lunn wrote: >> +static int emac_phy_connect(struct prueth_emac *emac) >> +{ >> + struct prueth *prueth = emac->prueth; >> + >> + /* connect PHY */ >> + emac->phydev = of_phy_connect(emac->ndev, emac->phy_node, >> + &emac_adjust_link, 0, emac->phy_if); > >> +static int prueth_config_rgmiidelay(struct prueth *prueth, >> + struct device_node *eth_np, >> + phy_interface_t phy_if) >> +{ >> + struct device *dev = prueth->dev; >> + struct regmap *ctrl_mmr; >> + u32 rgmii_tx_id = 0; >> + u32 icssgctrl_reg; >> + >> + if (!phy_interface_mode_is_rgmii(phy_if)) >> + return 0; >> + >> + ctrl_mmr = syscon_regmap_lookup_by_phandle(eth_np, "ti,syscon-rgmii-delay"); >> + if (IS_ERR(ctrl_mmr)) { >> + dev_err(dev, "couldn't get ti,syscon-rgmii-delay\n"); >> + return -ENODEV; >> + } >> + >> + if (of_property_read_u32_index(eth_np, "ti,syscon-rgmii-delay", 1, >> + &icssgctrl_reg)) { >> + dev_err(dev, "couldn't get ti,rgmii-delay reg. offset\n"); >> + return -ENODEV; >> + } >> + >> + if (phy_if == PHY_INTERFACE_MODE_RGMII_ID || >> + phy_if == PHY_INTERFACE_MODE_RGMII_TXID) >> + rgmii_tx_id |= ICSSG_CTRL_RGMII_ID_MODE; >> + >> + regmap_update_bits(ctrl_mmr, icssgctrl_reg, ICSSG_CTRL_RGMII_ID_MODE, rgmii_tx_id); >> + >> + return 0; >> +} >> > > O.K, so this does not do what i initially thought it was doing. I was > thinking it was to fine tune the delay, ti,syscon-rgmii-delay would be > a small pico second value to allow the 2ns delay to be tuned to the > board. > > But now i think this is actually inserting the full 2ns delay? > > The problem is, you also pass phy_if to of_phy_connect() so the PHY > will also insert the delay if requested. So you end up with double > delays for rgmii_id and rgmii_txid. > > The general recommendation is that the PHY inserts the delay, based on > phy-mode. The MAC does not add a delay, so i suggest you always write > 0 here, just to ensure the system is in a deterministic state, and the > bootloader and not being messing around with things. > > Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel