From patchwork Fri Jun 29 15:35:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 140613 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp993562ljj; Fri, 29 Jun 2018 08:36:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfqJNbKul2mxDmsOU/mUjKA0UzVHXvTT7xPK8QWpUwKRWm55HmR1a8B7tbWgtACWxC/hxnq X-Received: by 2002:a17:902:8f86:: with SMTP id z6-v6mr10896584plo.38.1530286587088; Fri, 29 Jun 2018 08:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530286587; cv=none; d=google.com; s=arc-20160816; b=RDgI3m7g4ZqwMZvYXBHyq//SW/+QmjraqwUp4oX+JkRV/zpJx/CJBzWl3kzD8XsM6G EocZo26G8pF1oNGfLbcp+QF2VTgll/qkfBrxzXD+n9Dg5GyobPPfSJNNqtDj5XZSPYJ4 zIspdAi0MsOztsPaS1rzxEb8qT0OItZ+F9bqK5NYBwHIK2AFvoVpODnWX3u6mUEXUViX YsCW1NqNZbfCSuWFITtBrKSo7P3nHhkBeBFCJxFlKqXS9HFmPu7rNaCweuMkbHJWP2Yw OVCODHbaD0ri6Ax9J3ntD3SgOkziu8ox31ODYLZQuvbr436Q9HVh8Iya3DEYJUmh93kf Uf4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=RPhTbVnvi256NBldU8FbitfughbHmZpBL5A4omRqQ8M=; b=Wsly079FUTM61dFfIrr1u/CtqnezYrO2ODraCbpbiKMJHBp6jgc8ZmVu3sFXQARStf Fy78qwVNXkZzGqmOAatm8fN/j4YL7B7so4MlIZUlxUGYrWmpf4dU8zNXPKuisobIVyZN HUpQ8bCAgv/elvBzHRN1xMchNwP7IA+tZTdMkYduSAjsnV2HPaSPAgmwXe/gHzzrHQ/x p33w36uobBN3z2er0A930+z9bTchHgC7OsXQzLLGuM+HPKAZ3A4EGhFMMrI2V/pN1T0C Y7xhjC3o3yi99IUMvc+QLNXJLw1/IknRdUq4jN8tUTNAYG+UzUKSTVCU3/ISHBOU/EeI dLjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JgNq3J9o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u12-v6si9232285pls.311.2018.06.29.08.36.26; Fri, 29 Jun 2018 08:36:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=JgNq3J9o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966028AbeF2PgI (ORCPT + 31 others); Fri, 29 Jun 2018 11:36:08 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:43136 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752225AbeF2PgG (ORCPT ); Fri, 29 Jun 2018 11:36:06 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id w5TFZwHa114884; Fri, 29 Jun 2018 10:35:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1530286558; bh=RPhTbVnvi256NBldU8FbitfughbHmZpBL5A4omRqQ8M=; h=From:To:CC:Subject:Date; b=JgNq3J9o4vyv7y8nUgwBSrT/2y4quRJ0n06/rGWcm/JYBlA6x25SdInn/YcUoMMlR S+LTRL8PJ/TpUp1HaY2p6NjuqYK1KtjJqDBeHfn0S73aQBualPfOfv7p4dxh2oMu1O PBdW7PeV5J7v6MsaZ87Md8+fdXD+IFyZ3VjBpsTA= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5TFZwA9011194; Fri, 29 Jun 2018 10:35:58 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 29 Jun 2018 10:35:57 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 29 Jun 2018 10:35:57 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5TFZv7K019307; Fri, 29 Jun 2018 10:35:57 -0500 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.149.121]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w5TFZvx17690; Fri, 29 Jun 2018 10:35:57 -0500 (CDT) From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH net-next v2 1/2] net: phy: DP83TC811: Add INT_STAT3 Date: Fri, 29 Jun 2018 10:35:45 -0500 Message-ID: <20180629153546.24107-1-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add INT_STAT3 interrupt setting and clearing support. Signed-off-by: Dan Murphy --- v2 - Removed bug fix removal of writing INT_STAT1 twice when disabling interrupts drivers/net/phy/dp83tc811.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) -- 2.17.0.582.gccdcbd54c diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c index 49ac678eb2dc..f8653f5d8789 100644 --- a/drivers/net/phy/dp83tc811.c +++ b/drivers/net/phy/dp83tc811.c @@ -21,6 +21,7 @@ #define MII_DP83811_SGMII_CTRL 0x09 #define MII_DP83811_INT_STAT1 0x12 #define MII_DP83811_INT_STAT2 0x13 +#define MII_DP83811_INT_STAT3 0x18 #define MII_DP83811_RESET_CTRL 0x1f #define DP83811_HW_RESET BIT(15) @@ -44,6 +45,11 @@ #define DP83811_OVERVOLTAGE_INT_EN BIT(6) #define DP83811_UNDERVOLTAGE_INT_EN BIT(7) +/* INT_STAT3 bits */ +#define DP83811_LPS_INT_EN BIT(0) +#define DP83811_NO_FRAME_INT_EN BIT(3) +#define DP83811_POR_DONE_INT_EN BIT(4) + #define MII_DP83811_RXSOP1 0x04a5 #define MII_DP83811_RXSOP2 0x04a6 #define MII_DP83811_RXSOP3 0x04a7 @@ -81,6 +87,10 @@ static int dp83811_ack_interrupt(struct phy_device *phydev) if (err < 0) return err; + err = phy_read(phydev, MII_DP83811_INT_STAT3); + if (err < 0) + return err; + return 0; } @@ -216,6 +226,18 @@ static int dp83811_config_intr(struct phy_device *phydev) DP83811_UNDERVOLTAGE_INT_EN); err = phy_write(phydev, MII_DP83811_INT_STAT2, misr_status); + if (err < 0) + return err; + + misr_status = phy_read(phydev, MII_DP83811_INT_STAT3); + if (misr_status < 0) + return misr_status; + + misr_status |= (DP83811_LPS_INT_EN | + DP83811_NO_FRAME_INT_EN | + DP83811_POR_DONE_INT_EN); + + err = phy_write(phydev, MII_DP83811_INT_STAT3, misr_status); } else { err = phy_write(phydev, MII_DP83811_INT_STAT1, 0); @@ -223,6 +245,10 @@ static int dp83811_config_intr(struct phy_device *phydev) return err; err = phy_write(phydev, MII_DP83811_INT_STAT2, 0); + if (err < 0) + return err; + + err = phy_write(phydev, MII_DP83811_INT_STAT3, 0); } return err; From patchwork Fri Jun 29 15:35:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 140612 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp993301ljj; Fri, 29 Jun 2018 08:36:12 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJqW3YNjmn3F/AJdIroosIOqKKlAxIbCWyflQgR2pl5aVGMElsIk351B3ArSVN//oCIdTMq X-Received: by 2002:a63:8a41:: with SMTP id y62-v6mr12700366pgd.291.1530286572183; Fri, 29 Jun 2018 08:36:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530286572; cv=none; d=google.com; s=arc-20160816; b=yXXzTvCIN/jJkX6+xWxxxFCU4tddV8EYG3b8DhS+pb1Z4BPb2w00CsxBCsOaUQpael fEYlhayynOgJrEIuefGavDkAsUY6M0h0AFV01YkSxCnTHRVqMbhmd0mRYQZuWZF0xbtd DbIwmGv6pE5+FNrLUbKN73i5H9WyPNbEBfOCBzP/yIPMTqi21N84HLizGZpO7Tl+A8uz UiUk6zQtHfgXMFgCHCbpbFqbgOCjxs40NJUkca47mZxEwcfTrCbhcvEezIA9074PuDOR ZtmxujOGQJNSBnMAXRrJdFoC3ed8fY8soR470jvuoC999kEQ48BT8E9Gp8NU3m3RX3tU rOsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=obJSGThw7Yq/ZleoBGB6MTxPf0hoqhCyDaXF+ZzNZmY=; b=SRsJt6xo/a+fv2dnO+xlLBRO/MzWDRkczCIYTNoe0dw1Ytnm4wGY6vR2+Voh8k3sCy atR+v6CIQWVOQwRhWMEya+iYFQH4IopTLgEpm0JfifFb6tcd2zoM+zIEcPriroI0S3w2 HiJTEb18yYx4nvVbkkIT6SJcb8af4SntJg+HV1TRMas9Q9+eTjO8rIMDGBg1VtkFGMaQ FNUiuMz19bGfOqprmjss25bjdgHmT80Y9A/mkE7OE+PKd2ySC8STVKO1Mt3D8Uteym/t bhypYippg27dujm7vtzvyfUjTOE4IXfNKZRffvjGAJXXglMuqytr5GBFcRYUJ7cLVDYa isJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="EgGP/KiZ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si760374pgp.18.2018.06.29.08.36.11; Fri, 29 Jun 2018 08:36:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="EgGP/KiZ"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966076AbeF2PgJ (ORCPT + 31 others); Fri, 29 Jun 2018 11:36:09 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:43658 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753318AbeF2PgG (ORCPT ); Fri, 29 Jun 2018 11:36:06 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w5TFZweY026546; Fri, 29 Jun 2018 10:35:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1530286558; bh=obJSGThw7Yq/ZleoBGB6MTxPf0hoqhCyDaXF+ZzNZmY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EgGP/KiZdTwQVTAN/tHcKa97OukwX+IrwjTitiZgDsVFZZe4PsBIymoR7YcHx6x/a q2dYrbfQ8WJ6M+KlZBehlIsgIaoTYkxtj0pUMJj0SMXqV1S2MedVg6/53uB0KgpTMn 9ej2uxrcFfmmf3zROdoQHKo/imcwi0rXzBHFFWRk= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5TFZwE9021037; Fri, 29 Jun 2018 10:35:58 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 29 Jun 2018 10:35:58 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 29 Jun 2018 10:35:58 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w5TFZwhj031772; Fri, 29 Jun 2018 10:35:58 -0500 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.149.121]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id w5TFZvx17694; Fri, 29 Jun 2018 10:35:58 -0500 (CDT) From: Dan Murphy To: , CC: , , Dan Murphy Subject: [PATCH net-next v2 2/2] net: phy: DP83TC811: Fix SGMII enable/disable Date: Fri, 29 Jun 2018 10:35:46 -0500 Message-ID: <20180629153546.24107-2-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20180629153546.24107-1-dmurphy@ti.com> References: <20180629153546.24107-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If SGMII was selected in the DT then the device should write the SGMII enable bit. If SGMII is not selected in the DT then the SGMII bit should be disabled. Signed-off-by: Dan Murphy --- v2 - Removed erroneous defconfig addtion in the patch. drivers/net/phy/dp83tc811.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) -- 2.17.0.582.gccdcbd54c diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c index f8653f5d8789..78cad134a79e 100644 --- a/drivers/net/phy/dp83tc811.c +++ b/drivers/net/phy/dp83tc811.c @@ -284,21 +284,19 @@ static int dp83811_config_init(struct phy_device *phydev) if (err < 0) return err; + value = phy_read(phydev, MII_DP83811_SGMII_CTRL); if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { - value = phy_read(phydev, MII_DP83811_SGMII_CTRL); - if (!(value & DP83811_SGMII_EN)) { - err = phy_write(phydev, MII_DP83811_SGMII_CTRL, + err = phy_write(phydev, MII_DP83811_SGMII_CTRL, (DP83811_SGMII_EN | value)); - if (err < 0) - return err; - } else { - err = phy_write(phydev, MII_DP83811_SGMII_CTRL, - (~DP83811_SGMII_EN & value)); - if (err < 0) - return err; - } + } else { + err = phy_write(phydev, MII_DP83811_SGMII_CTRL, + (~DP83811_SGMII_EN & value)); } + if (err < 0) + + return err; + value = DP83811_WOL_MAGIC_EN | DP83811_WOL_SECURE_ON | DP83811_WOL_EN; return phy_write_mmd(phydev, DP83811_DEVADDR, MII_DP83811_WOL_CFG,