From patchwork Mon Apr 14 14:13:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 14050503 X-Patchwork-Delegate: kuba@kernel.org Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B60B17BBF; Mon, 14 Apr 2025 14:14:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744640074; cv=none; b=KgylaBcxt1o/oGVjWSfnRhDIa3i1ItASh4aIjm34QdDvlb/AhKfs4PhPwIxZ5CuL7e7IBE6BXMKhIl5zTY8Bt3KyEs4iYiwcA8B8s8FYRMVd99U7fBDnpS7rWGxeez90uuFVNz5dJPbRIbmShGQ6hl4C1D721ROE+RfuKj3KAzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744640074; c=relaxed/simple; bh=HxLpkrEFrUtXNpv/Fmgq3bqgPSA51hoGXlg9yry0b40=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=X2KaQPQz79gSO1qOz/ihPZBknMPRZpJTS8xrGR27JQ91BDWvWwaMagE7GSC7BLyiOEIzdLuHyqh/ivaIYCRPgxS/W9n5ih4pPxMORCm6MGfya+NbbJ5TKSeZwHr3PRRhPUyV7616cQeJ9lXNo5b7xCp3crOsFeK5DI3KPPthEx0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=iZi+G63+; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=GQLpSNbK reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="iZi+G63+"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="GQLpSNbK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744640069; x=1776176069; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ghpOs9VSowOL1pV8FfmtuNICOLqxa7Du4VsQSt7f24A=; b=iZi+G63+3asSourtk+riWv04QxO0Eu6FjzeigNwMXeZvlnbA5nHgwK9L fhFr20+Oh8BPuQVhqQrhJa+FqiIRbKsTJfj3ZiVtcv3t5VDiPB5IiKjvI /6nhbqvu9BBxOPu0BWQDkTSfJY0uG0uM5ug6dJzqfbWP3R5+yGb2CUixg re0PeafaDBh8FtWngX8EnHk2kbVIUnnk8MvgF0oden52p/OfMJhZ9qBXb IHF5y8xT4y8I8OBUBfrgw8kZJqiNG0OfVqrfq+KzwxSc7IJrAA1YyqPmn LY/buG+lA5XXsYxk5PRHW5SQKqrLb+7pAAAyDnPdVHJD5efU2xM33OKFO Q==; X-CSE-ConnectionGUID: 2l3YtWDOTV2GZSR/efLqJw== X-CSE-MsgGUID: rZrdxSdsSfSlWdrMDazbYA== X-IronPort-AV: E=Sophos;i="6.15,212,1739833200"; d="scan'208";a="43517427" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 14 Apr 2025 16:14:26 +0200 X-CheckPoint: {67FD1842-10-DC4DC9A0-F4F29281} X-MAIL-CPID: DA2A3DC1ECC01433EB7A1E8886AE0492_0 X-Control-Analysis: str=0001.0A006378.67FD1841.003D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1CDDE163E9E; Mon, 14 Apr 2025 16:14:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1744640062; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ghpOs9VSowOL1pV8FfmtuNICOLqxa7Du4VsQSt7f24A=; b=GQLpSNbKY4M2rG94kS0hsxdgLcbqS9CfiBYrQ9AVKxlE7iFhB8ljqWYrSiqY6tRmGv5XV/ HOqyM9Il1xEOZUziDQyrFdjmJ0JAa4Y3I9YzuDqV3fubkNcaX34E4lwdK89gcueDK0p6FV W/NOTkwyVmxnE1JTdch6YTgZfzty4l1v6ErcBn5YzwDEHxryT4G8Qx2mFJzkDXqw65L940 9uorpvB6/DVp68wG2k+hgLSj6E/37szYB/AiSBVb0vW5K+2hW7pC61xEuDxx+Ww+wbh1Vs tlyklcHNClsf6Fuoe4SstHzn5v9KJ4d6XfZuE2br9NPWC43zdZliOgTqfbplew== From: Matthias Schiffer To: Andrew Lunn , Heiner Kallweit , Russell King Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH net-next 1/2] net: phy: dp83867: remove check of delay strap configuration Date: Mon, 14 Apr 2025 16:13:57 +0200 Message-ID: <8013ae5966dd22bcb698c0c09d2fc0912ae7ac25.1744639988.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Patchwork-Delegate: kuba@kernel.org The check that intended to handle "rgmii" PHY mode differently from the other RGMII modes never worked as intended: - added in commit 2a10154abcb7 ("net: phy: dp83867: Add TI dp83867 phy"): logic error caused the condition to always evaluate to true - changed in commit a46fa260f6f5 ("net: phy: dp83867: Fix warning check for setting the internal delay"): now the condition always evaluates to false - removed in commit 2b892649254f ("net: phy: dp83867: Set up RGMII TX delay") Around the time of the removal, commit c11669a2757e ("net: phy: dp83867: Rework delay rgmii delay handling") started clearing the delay enable flags in RGMIICTL (or it would have, if the condition ever evaluated to true at that time). The change attempted to preserve the historical behavior of not disabling internal delays with "rgmii" PHY mode and also documented this in a comment, but due to a conflict between "Set up RGMII TX delay" and "Rework delay rgmii delay handling", the behavior dp83867_verify_rgmii_cfg() warned about (and that was also described in a commit in dp83867_config_init()) disappeared in the following merge of net into net-next in commit b4b12b0d2f02 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net"). While is doesn't appear that this breaking change was intentional, it has been like this since 2019, and the new behavior to disable the delays with "rgmii" PHY mode is generally desirable - in particular with MAC drivers that have to fix up the delay mode, resulting in the PHY driver not even seeing the same mode that was specified in the Device Tree. Remove the obsolete check and comment. Signed-off-by: Matthias Schiffer --- drivers/net/phy/dp83867.c | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index 063266cafe9c7..e5b0c1b7be13f 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -92,11 +92,6 @@ #define DP83867_STRAP_STS1_RESERVED BIT(11) /* STRAP_STS2 bits */ -#define DP83867_STRAP_STS2_CLK_SKEW_TX_MASK GENMASK(6, 4) -#define DP83867_STRAP_STS2_CLK_SKEW_TX_SHIFT 4 -#define DP83867_STRAP_STS2_CLK_SKEW_RX_MASK GENMASK(2, 0) -#define DP83867_STRAP_STS2_CLK_SKEW_RX_SHIFT 0 -#define DP83867_STRAP_STS2_CLK_SKEW_NONE BIT(2) #define DP83867_STRAP_STS2_STRAP_FLD BIT(10) /* PHY CTRL bits */ @@ -510,25 +505,6 @@ static int dp83867_verify_rgmii_cfg(struct phy_device *phydev) { struct dp83867_private *dp83867 = phydev->priv; - /* Existing behavior was to use default pin strapping delay in rgmii - * mode, but rgmii should have meant no delay. Warn existing users. - */ - if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { - const u16 val = phy_read_mmd(phydev, DP83867_DEVADDR, - DP83867_STRAP_STS2); - const u16 txskew = (val & DP83867_STRAP_STS2_CLK_SKEW_TX_MASK) >> - DP83867_STRAP_STS2_CLK_SKEW_TX_SHIFT; - const u16 rxskew = (val & DP83867_STRAP_STS2_CLK_SKEW_RX_MASK) >> - DP83867_STRAP_STS2_CLK_SKEW_RX_SHIFT; - - if (txskew != DP83867_STRAP_STS2_CLK_SKEW_NONE || - rxskew != DP83867_STRAP_STS2_CLK_SKEW_NONE) - phydev_warn(phydev, - "PHY has delays via pin strapping, but phy-mode = 'rgmii'\n" - "Should be 'rgmii-id' to use internal delays txskew:%x rxskew:%x\n", - txskew, rxskew); - } - /* RX delay *must* be specified if internal delay of RX is used. */ if ((phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) && @@ -836,13 +812,7 @@ static int dp83867_config_init(struct phy_device *phydev) if (ret) return ret; - /* If rgmii mode with no internal delay is selected, we do NOT use - * aligned mode as one might expect. Instead we use the PHY's default - * based on pin strapping. And the "mode 0" default is to *use* - * internal delay with a value of 7 (2.00 ns). - * - * Set up RGMII delays - */ + /* Set up RGMII delays */ val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL); val &= ~(DP83867_RGMII_TX_CLK_DELAY_EN | DP83867_RGMII_RX_CLK_DELAY_EN); From patchwork Mon Apr 14 14:13:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 14050504 X-Patchwork-Delegate: kuba@kernel.org Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6DD417A2EA; Mon, 14 Apr 2025 14:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744640077; cv=none; b=JVJUYHpdxHOLrD0uKNBYKNtbkosnnH8FVdekY+tMZJaOZRU4i8zVJGPvvV4dBkXk18sVTPw/ElmVMtdZxMVAgFWidCa3BW2CbC4yW5RXXHvaRhPgNjDizQemSqeOU8RSL36y+sUJStIjPDsBVp81MG5ovQweysq8c4IghfS0IZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744640077; c=relaxed/simple; bh=Jqmd77umJyoaCy5gG2yrDU0YivAchN4acEmBBoR89zE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a5wHnS8q/BOU8t2PKE+DfmfeykfKPC/fTy9lPPz7RVMvKjQc9/cqu1HDaqZP31Bi5njJoAeLAcdZnGQMrs22rmr4NRBg66dCxy7wbybHkIrXN+oAzTyH3WdKFLBVaqo2K0FhYmcDZesYPEWvEMLkXNmRn0AQytvHhduBHxd8i8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=RCXRe0OT; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=AJHsRmlB reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="RCXRe0OT"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="AJHsRmlB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1744640074; x=1776176074; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vvYyMubPA5Sl5iG0mDNEkD9ed98foiGmowuWEtiDHtg=; b=RCXRe0OTjxta7XbTw3RzA8NdKUKpDxost5A7+Tf9eR4L5YOobOFb70n7 C3sXJBGqI6Dl4Z44bgyWSgh/6G5VlozRudLSG48MkNlw00d3+bBsJbzSC QdbdDwHlWhjKupn0TQgKKcPnnBS0XzCFnuygOHsqiq/sHlsHBFCEzoD6v 0hj4zqIdK1PXQ6W8v+UxAjTLK4WD8UMR/tzaAtkDU9MCVVLZx7d+laxZ1 ejcW5fUMA7NDY/SeI9Zhgk4EE0os6zYzGLvDuFIEOfuxs3xmdEg/9y81W yztdDJoVnH4tJX2NfBrmC/x0yC+Es1xav0Z5eXw8Q/tkKOPjPCm7omun/ A==; X-CSE-ConnectionGUID: S0FojUj4S/yTYFW32Yd5vw== X-CSE-MsgGUID: Iz1Acn4QSV6UDnOY4S3vCw== X-IronPort-AV: E=Sophos;i="6.15,212,1739833200"; d="scan'208";a="43517431" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 14 Apr 2025 16:14:31 +0200 X-CheckPoint: {67FD1847-B-B1D34AC3-DEA5B19F} X-MAIL-CPID: ADF53A2CE5B1B79FF9725C745A73F8FE_4 X-Control-Analysis: str=0001.0A006372.67FD184D.005C,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 34B7B16B0FF; Mon, 14 Apr 2025 16:14:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1744640066; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vvYyMubPA5Sl5iG0mDNEkD9ed98foiGmowuWEtiDHtg=; b=AJHsRmlBqEOt4/kWnciuiGIdU60CkRcN8UBKfiyY4o9Dagt6UisdejQjUX3XTQQ72CleXm aeMr8K463CciDYRfe2zHoWqRLC9wD7hYl2EYf6myiZ/ysJIlB2XxquD3NjIbIFqjHDkkZ0 fguoIFaAq6Da7B7y6Y3Ql3o9JUAsBIT7/JrtB+tP4IiJm25WpLKrj9Wnt/dIuZocrVCz95 d7dnT+I1UHMr/oL5Dv6wkK4+FM5aX9XIi5Tb3RYWU3hemzt4qeuzKLSULfpL53rSUpDqMB Q09C8nyUfoKbF/1u6oCGhXTAsd8wHmWsS4sRHIVJFKNszSJlDwpvjdUS6px92w== From: Matthias Schiffer To: Andrew Lunn , Heiner Kallweit , Russell King Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH net-next 2/2] net: phy: dp83867: use 2ns delay if not specified in DTB Date: Mon, 14 Apr 2025 16:13:58 +0200 Message-ID: <2709a88893b7d802f4caf3bc11b5d3ebafbca606.1744639988.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <8013ae5966dd22bcb698c0c09d2fc0912ae7ac25.1744639988.git.matthias.schiffer@ew.tq-group.com> References: <8013ae5966dd22bcb698c0c09d2fc0912ae7ac25.1744639988.git.matthias.schiffer@ew.tq-group.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-Patchwork-Delegate: kuba@kernel.org Most PHY drivers default to a 2ns delay if internal delay is requested and no value is specified. Having a default value makes sense, as it allows a Device Tree to only care about board design (whether there are delays on the PCB or not), and not whether the delay is added on the MAC or the PHY side when needed. Whether the delays are actually applied is controlled by the DP83867_RGMII_*_CLK_DELAY_EN flags, so the behavior is only changed in configurations that would previously be rejected with -EINVAL. Suggested-by: Andrew Lunn Signed-off-by: Matthias Schiffer --- drivers/net/phy/dp83867.c | 44 ++++----------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index e5b0c1b7be13f..deeefb9625664 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -106,10 +106,8 @@ /* RGMIIDCTL bits */ #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf #define DP83867_RGMII_TX_CLK_DELAY_SHIFT 4 -#define DP83867_RGMII_TX_CLK_DELAY_INV (DP83867_RGMII_TX_CLK_DELAY_MAX + 1) #define DP83867_RGMII_RX_CLK_DELAY_MAX 0xf #define DP83867_RGMII_RX_CLK_DELAY_SHIFT 0 -#define DP83867_RGMII_RX_CLK_DELAY_INV (DP83867_RGMII_RX_CLK_DELAY_MAX + 1) /* IO_MUX_CFG bits */ #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MASK 0x1f @@ -501,29 +499,6 @@ static int dp83867_config_port_mirroring(struct phy_device *phydev) return 0; } -static int dp83867_verify_rgmii_cfg(struct phy_device *phydev) -{ - struct dp83867_private *dp83867 = phydev->priv; - - /* RX delay *must* be specified if internal delay of RX is used. */ - if ((phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || - phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) && - dp83867->rx_id_delay == DP83867_RGMII_RX_CLK_DELAY_INV) { - phydev_err(phydev, "ti,rx-internal-delay must be specified\n"); - return -EINVAL; - } - - /* TX delay *must* be specified if internal delay of TX is used. */ - if ((phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || - phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) && - dp83867->tx_id_delay == DP83867_RGMII_TX_CLK_DELAY_INV) { - phydev_err(phydev, "ti,tx-internal-delay must be specified\n"); - return -EINVAL; - } - - return 0; -} - #if IS_ENABLED(CONFIG_OF_MDIO) static int dp83867_of_init_io_impedance(struct phy_device *phydev) { @@ -607,7 +582,7 @@ static int dp83867_of_init(struct phy_device *phydev) dp83867->sgmii_ref_clk_en = of_property_read_bool(of_node, "ti,sgmii-ref-clock-output-enable"); - dp83867->rx_id_delay = DP83867_RGMII_RX_CLK_DELAY_INV; + dp83867->rx_id_delay = DP83867_RGMIIDCTL_2_00_NS; ret = of_property_read_u32(of_node, "ti,rx-internal-delay", &dp83867->rx_id_delay); if (!ret && dp83867->rx_id_delay > DP83867_RGMII_RX_CLK_DELAY_MAX) { @@ -617,7 +592,7 @@ static int dp83867_of_init(struct phy_device *phydev) return -EINVAL; } - dp83867->tx_id_delay = DP83867_RGMII_TX_CLK_DELAY_INV; + dp83867->tx_id_delay = DP83867_RGMIIDCTL_2_00_NS; ret = of_property_read_u32(of_node, "ti,tx-internal-delay", &dp83867->tx_id_delay); if (!ret && dp83867->tx_id_delay > DP83867_RGMII_TX_CLK_DELAY_MAX) { @@ -737,7 +712,6 @@ static int dp83867_config_init(struct phy_device *phydev) { struct dp83867_private *dp83867 = phydev->priv; int ret, val, bs; - u16 delay; /* Force speed optimization for the PHY even if it strapped */ ret = phy_modify(phydev, DP83867_CFG2, DP83867_DOWNSHIFT_EN, @@ -745,10 +719,6 @@ static int dp83867_config_init(struct phy_device *phydev) if (ret) return ret; - ret = dp83867_verify_rgmii_cfg(phydev); - if (ret) - return ret; - /* RX_DV/RX_CTRL strapped in mode 1 or mode 2 workaround */ if (dp83867->rxctrl_strap_quirk) phy_clear_bits_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4, @@ -827,15 +797,9 @@ static int dp83867_config_init(struct phy_device *phydev) phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL, val); - delay = 0; - if (dp83867->rx_id_delay != DP83867_RGMII_RX_CLK_DELAY_INV) - delay |= dp83867->rx_id_delay; - if (dp83867->tx_id_delay != DP83867_RGMII_TX_CLK_DELAY_INV) - delay |= dp83867->tx_id_delay << - DP83867_RGMII_TX_CLK_DELAY_SHIFT; - phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIIDCTL, - delay); + dp83867->rx_id_delay | + (dp83867->tx_id_delay << DP83867_RGMII_TX_CLK_DELAY_SHIFT)); } /* If specified, set io impedance */