From patchwork Wed Sep 15 06:47:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12495551 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73C81C433F5 for ; Wed, 15 Sep 2021 06:47:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 541016103C for ; Wed, 15 Sep 2021 06:47:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236463AbhIOGsr (ORCPT ); Wed, 15 Sep 2021 02:48:47 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:49620 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236452AbhIOGsp (ORCPT ); Wed, 15 Sep 2021 02:48:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1631688447; x=1663224447; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UmuYHmTNzTwV9vDkC+JmtSlR6vT++q3IeQidaO5JmMI=; b=KdTX6XIelU9BB2xyd3zAHgDw5D0x6lk2sIpTTbv+kQjh301MoaubGope ymBEk7l3+9OLZy0qbhMT5/fKLfriMHzobWolV0wvMVbpWkLdj34lFaXKh Q8IVpicXp60Ovtb0RK/HAfdGSYkS1gowuSFsTlA6Lsc9a1+eSXLWt2Wgo UfcDAx1BB4cy9Bq/fjO5QU4ZSDbEeQaM28SfKaJXnfX95CG1bddlzznXj myOMlXireJcC3QvCEUvCPjqIbu+vCZGzk/AQNPpD2hg6ikq8HWe5UjgKB cyUZI3Z5gYLz+oIHuNZeK7Jp24mUhlb2d/jkpRwWbMJc0rW6r+eq+Zu61 g==; IronPort-SDR: cm6QVWT4dt9j3CP/W7akqYSj5u0VYlBLTP+xLyIbBchSP1q1WS1b3iuulNnHFtoKjag9jkr0Xh DWuJu6nQzRTS5xgSgq8qZhShRcd12s7+0ANmFmMrFJiF5TpnBEusBf+cvxg1XiH2guWHnB6gON JPWZbkSDnyAj7UGLEEVU0zRHk8nIO44tw++CinEZH3r28QTJol51AWNaq1huE7XFpCKpObJXuY LYPxnJi9GTIbh3ejo3I/tMMqHmG7MpXUSV13S/Z/bNrdAlGo1Vj5YRbN6+C2kvC8tiO1vZq5dj 0lGPjRYcQTNhKbUvU9JahAvf X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="136018094" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2021 23:47:27 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 14 Sep 2021 23:47:26 -0700 Received: from rob-dk-mpu01.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 14 Sep 2021 23:47:25 -0700 From: Claudiu Beznea To: , , CC: , , Claudiu Beznea Subject: [PATCH 1/3] net: macb: add description for SRTSM Date: Wed, 15 Sep 2021 09:47:19 +0300 Message-ID: <20210915064721.5530-2-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210915064721.5530-1-claudiu.beznea@microchip.com> References: <20210915064721.5530-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Add description for SRTSM bit. Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index d8d87213697c..d1e0e116b976 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -243,7 +243,7 @@ #define MACB_NCR_TPF_SIZE 1 #define MACB_TZQ_OFFSET 12 /* Transmit zero quantum pause frame */ #define MACB_TZQ_SIZE 1 -#define MACB_SRTSM_OFFSET 15 +#define MACB_SRTSM_OFFSET 15 /* Store Receive Timestamp to Memory */ #define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */ #define MACB_OSSMODE_SIZE 1 From patchwork Wed Sep 15 06:47:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12495553 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB150C433EF for ; Wed, 15 Sep 2021 06:47:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AD1F46121F for ; Wed, 15 Sep 2021 06:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236502AbhIOGtB (ORCPT ); Wed, 15 Sep 2021 02:49:01 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:36058 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236495AbhIOGst (ORCPT ); Wed, 15 Sep 2021 02:48:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1631688451; x=1663224451; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=28X2xpvIOdgLnziUslbEgcO+e/pbWRNhpGCAyEVvh0Q=; b=kC1YnQqW1CwQmpjjiXCIeRZsCLZFpgTnbChG6bsUDkREqgMEfazl7Y1+ ymIXe3t7kyhhGaghfpbr6eh1UajX9ZKjhN/Uiu2jrLLU5aUO5nFawHfV1 SHcubkNyP6IFD/kg6W5glLTDJdTA1gTdDxngGRhOjldCtw8GHteh4Q7rP 6z4IZHWkCtPhJpRQlowC7GT69f6m2pM7zN0CyHR9P6mKpeqSd51AjgzA6 c4uSp5VM+/UBdKj+voT6M7JTPp4ARvMvA6U0WOo+dWibOQqyKxL2bX+l3 hXm0aIlbrlrJEGqiqm50heuXW5GPlhooqztZRxlU5VZVnDEOBlYVez2k9 w==; IronPort-SDR: hfWe0cDWsZRkvWBfrU2xgtmXQYpQB+nuC+Y9k580tiRy17HK4gGbk+vowKd/ORJP/p+zbp1Vjo m60YRM0E3aNz+WVV6UFhPmkLnHHptyB5trSWFRZJC1LKcpaiLC2vDjMD4xZTvyDpznUHnO6wX3 MPDgb4RmyaxWK6/vEz0nA5hkFJGCqv53CQtZTHFWQcDph2uxQKg4lBvcz0kuFDggP7cyMlD/Ry z/D65NrzIaLO8OcfgEq7R8YFoFg6EN6RvkSKGDI0I6RIjFuTrCeWUa2ID425enLxwC/77gCZUM UmSnLaCK46EJgde/0+OOdkHa X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="136592254" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2021 23:47:31 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 14 Sep 2021 23:47:28 -0700 Received: from rob-dk-mpu01.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 14 Sep 2021 23:47:27 -0700 From: Claudiu Beznea To: , , CC: , , Claudiu Beznea Subject: [PATCH 2/3] net: macb: align for OSSMODE offset Date: Wed, 15 Sep 2021 09:47:20 +0300 Message-ID: <20210915064721.5530-3-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210915064721.5530-1-claudiu.beznea@microchip.com> References: <20210915064721.5530-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Align for OSSMODE offset. Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index d1e0e116b976..c33e98bfa5e8 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -244,7 +244,7 @@ #define MACB_TZQ_OFFSET 12 /* Transmit zero quantum pause frame */ #define MACB_TZQ_SIZE 1 #define MACB_SRTSM_OFFSET 15 /* Store Receive Timestamp to Memory */ -#define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */ +#define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */ #define MACB_OSSMODE_SIZE 1 /* Bitfields in NCFGR */ From patchwork Wed Sep 15 06:47:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 12495555 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2154C433EF for ; Wed, 15 Sep 2021 06:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A134610A2 for ; Wed, 15 Sep 2021 06:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236487AbhIOGtH (ORCPT ); Wed, 15 Sep 2021 02:49:07 -0400 Received: from esa.microchip.iphmx.com ([68.232.153.233]:36058 "EHLO esa.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236489AbhIOGtA (ORCPT ); Wed, 15 Sep 2021 02:49:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1631688462; x=1663224462; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=e6GO9tw2z7CzWA7UGiw1OwSYdNRLkOqWBkkYRcdq7/U=; b=aOY6FsOltTlHEnaol8bcSDFjEcv3zqfUfCbVp2iY19urKpOeGb5bsKkg vaXaTZ9SItBESMtPdW63Bg+c/GOBJnhuXMMg1jQ43dKywi5hTr+By7qfV jC5PgUHiLMU3Q+syK8IXbXnzg4UnSYbMVT3Nq2gVgU7sSO1C/LCtBxz/C Mcf1vOHGpTf/yMa3MyncI3n3ol0tJ9W7jsWdRXhF9P6/ZgUgNgsxI+ifr nW1IDz02s4yqQERH1tyT8oSQw1VItk10dq3YoWSlt8pR+fAUpfgbxRs0J Cr0l1dgi+kHhi54lzs4cgcQ2qsCP6u6Q26J1IvwwMw/GV6mEqDWxXdpfz g==; IronPort-SDR: AbYa88Q7a65AAIOAJMJjbXX1O8YBJkSftj7Ppgs28Fn7WD7zqIamBNEdYQUiMEjqYEMeyv7Rv/ pYQoL2BuNO7C2VBEF09Y7C33VYcCc9R1tx33u/b2NSKriG3Q8rJcB6l2UEYl5dmDC301JkSgSy 1YbvZclDtzM/NFAQ8+7jW1XRiHdcqj0iY02Mv3HF3MZ4zCv/sD6v8/kr02yp4XazAknBgsBuhj c/lCipv0lGlOqmU5z5tpmcUptlDnQ4GzhD1Mft1NaPCR2H/szPRtnE+lXXoUfUGADC1s1Y3Ck+ IkQyXeUidlQnf1AogiZO2KAE X-IronPort-AV: E=Sophos;i="5.85,294,1624345200"; d="scan'208";a="136592256" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2021 23:47:31 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 14 Sep 2021 23:47:30 -0700 Received: from rob-dk-mpu01.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 14 Sep 2021 23:47:29 -0700 From: Claudiu Beznea To: , , CC: , , Claudiu Beznea Subject: [PATCH 3/3] net: macb: add support for mii on rgmii Date: Wed, 15 Sep 2021 09:47:21 +0300 Message-ID: <20210915064721.5530-4-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20210915064721.5530-1-claudiu.beznea@microchip.com> References: <20210915064721.5530-1-claudiu.beznea@microchip.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Cadence IP has option to enable MII support on RGMII interface. This could be selected though bit 28 of network control register. This option is not enabled on all the IP versions thus add a software capability to be selected by the proper implementation of this IP. Signed-off-by: Claudiu Beznea Acked-by: Nicolas Ferre --- drivers/net/ethernet/cadence/macb.h | 3 +++ drivers/net/ethernet/cadence/macb_main.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index c33e98bfa5e8..5620b97b3482 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -246,6 +246,8 @@ #define MACB_SRTSM_OFFSET 15 /* Store Receive Timestamp to Memory */ #define MACB_OSSMODE_OFFSET 24 /* Enable One Step Synchro Mode */ #define MACB_OSSMODE_SIZE 1 +#define MACB_MIIONRGMII_OFFSET 28 /* MII Usage on RGMII Interface */ +#define MACB_MIIONRGMII_SIZE 1 /* Bitfields in NCFGR */ #define MACB_SPD_OFFSET 0 /* Speed */ @@ -713,6 +715,7 @@ #define MACB_CAPS_GEM_HAS_PTP 0x00000040 #define MACB_CAPS_BD_RD_PREFETCH 0x00000080 #define MACB_CAPS_NEEDS_RSTONUBR 0x00000100 +#define MACB_CAPS_MIIONRGMII 0x00000200 #define MACB_CAPS_CLK_HW_CHG 0x04000000 #define MACB_CAPS_MACB_IS_EMAC 0x08000000 #define MACB_CAPS_FIFO_MODE 0x10000000 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index d13fb1d31821..cdf3e35b5b33 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -684,6 +684,9 @@ static void macb_mac_config(struct phylink_config *config, unsigned int mode, } else if (state->interface == PHY_INTERFACE_MODE_10GBASER) { ctrl |= GEM_BIT(PCSSEL); ncr |= GEM_BIT(ENABLE_HS_MAC); + } else if (bp->caps & MACB_CAPS_MIIONRGMII && + bp->phy_interface == PHY_INTERFACE_MODE_MII) { + ncr |= MACB_BIT(MIIONRGMII); } }