From patchwork Mon Nov 18 08:18:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Gupta X-Patchwork-Id: 13878260 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 A9784D43FEC for ; Mon, 18 Nov 2024 08:20:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=kMdGsiYuOlEb0IJtXA3t9I03AQf7+ILNVHVjfPUi51w=; b=iBZNAPVveiM/kO0VY2YoR74xlf SnJC5rF9gBBmtFeDE74CfLRCssuVJ/+TeNzst5MRsdJLEo+CYyggGQG8jPXKzW4IzlQJWFyBqy6JV bE6Kxc2qL88KyNVI/NCBjVppTZTi+bNL2J8EoThxiXjMoGA/0RGEvDLJEmV0KKYfOZr8pFBI8V4OE Yo3rFKnxDn4LRAAUYa0tqitPzu4ACShIvWBRp17/AevftEKHO1tPM9XvM8P7OSSDPZqpc3vjU1VE1 q/39JETKwLl9S2nJEQ1skUgRdPTM0l9iYXLWkAwKDvZiEuKY8EDk0vOq61kvsE3SdnK+u0rQWEYmm qc/cdvOg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tCwz9-00000008kUP-2rcs; Mon, 18 Nov 2024 08:19:51 +0000 Received: from mail-mw2nam04on20628.outbound.protection.outlook.com ([2a01:111:f403:240a::628] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tCwy8-00000008k0z-39Hw for linux-arm-kernel@lists.infradead.org; Mon, 18 Nov 2024 08:18:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BEYTi9ZbhzsDs+hZBClyF7Ephg7xYNiMf/h1dytqL1PEmhZZM2InCFZFQAn3BnZpKSe4a7r5r6TlvpwOEbo0q2HdEMY7uDSVpl4lrLLrAaAstqQXqw72RodHKSTUBhyHluO9iUywXItg5OSLBs38wuDhiO4Jfk0vjczzhh0ceHMIGhcEzLOV/YV9cdLgSkTu2ocH22Nm0brzV1720LiWhch/boCQrxN3uIgIvLvpEwmoM5aYHufSwUkETmfgmaij4ktzL38V6SA6FSqoDs4M89YABq3b0xJE6680oGFdTAkmllgIIJiSW+8VuZhtKjOs8gBjjRTAawSloc7ug3FgYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kMdGsiYuOlEb0IJtXA3t9I03AQf7+ILNVHVjfPUi51w=; b=fd3QxVfzjYCmA/ykR8pgKWn8MQk/Foiv3p9q3MCMGBEMG93w49k8H4nbnXJv1LqmcmkoOt23+q1V6SDDkZec6f+OwYqblahhDYG9XSsatiZ+m6yLnA5IERmuvb3PzS7zywHjSbJYoLG5+FmI7H4MGyPrSMRxYayRuBTrZztMDJC/fOINuylr0TwIy39IFUEo9eDJG+92IBaffw1gknMXcswOYQARGJGjjliSfpI6B4twrDQUOcKofkxiILGQOSkq3tFiS+cHfIk679fPEiGFbIl/PN/sEeHv9wKSy1YVtxXG/v9AuFm42oHW1RHkfPqy8ZgCioFiepckzd6zoGwqUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 165.204.84.12) smtp.rcpttodomain=lunn.ch smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kMdGsiYuOlEb0IJtXA3t9I03AQf7+ILNVHVjfPUi51w=; b=tcZLGEj8mgHyfrQPA/a/LJLd5Q/WutZjNptN5E8a1mXS8CucZr7ZA69Vi8n2XB9Q7c86XTdJHdwHGTyW/2IMMQqTafjdGPmlN8UJdgd02W+h1x6WwCwth1prv7L2LbB+z+mpRLgG7NKrDlWe20gsgHWqwfjbFPMHrTVVqYJwslk= Received: from CH5P222CA0020.NAMP222.PROD.OUTLOOK.COM (2603:10b6:610:1ee::12) by CH3PR12MB8187.namprd12.prod.outlook.com (2603:10b6:610:125::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22; Mon, 18 Nov 2024 08:18:36 +0000 Received: from CH1PEPF0000AD77.namprd04.prod.outlook.com (2603:10b6:610:1ee:cafe::67) by CH5P222CA0020.outlook.office365.com (2603:10b6:610:1ee::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23 via Frontend Transport; Mon, 18 Nov 2024 08:18:36 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 165.204.84.12 as permitted sender) Received: from SATLEXMB04.amd.com (165.204.84.12) by CH1PEPF0000AD77.mail.protection.outlook.com (10.167.244.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 08:18:35 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 02:18:31 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 02:18:30 -0600 Received: from xhdsuragupt40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 18 Nov 2024 02:18:27 -0600 From: Suraj Gupta To: , , , , , , , , CC: , , , , Subject: [PATCH net-next 1/2] dt-bindings: net: xlnx,axi-ethernet: Add bindings for AXI 2.5G MAC Date: Mon, 18 Nov 2024 13:48:21 +0530 Message-ID: <20241118081822.19383-2-suraj.gupta2@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241118081822.19383-1-suraj.gupta2@amd.com> References: <20241118081822.19383-1-suraj.gupta2@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD77:EE_|CH3PR12MB8187:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b9e3946-b2c2-4ddb-c370-08dd07a99952 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310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pn2oCS/tLxfPQijp/Ca8xpGdtC2Zk5iTwzkg9z0DUC/whj3IxdMsRGmUGLEbJrLh2Va4qTYIoYhigeDzvMkwFGNJfPdBsPo7LixQnTjUA/bC5PwUv94yi5HvwzXaLtZDU1n7ow1yo+q7en9fFrRCXXF7QicugDK3baiZ1b75SUJB9bRQFExeDC2ZHo/qvyCJqquDph+ks4dyhjpIx9ucyTVCOSfcmNFZht34E4xvkod7o77WB9ODhDX8mtcNvRQztBZaPd5IZGVtIIDnT0+teswg9SUaxoLvhR7uVm9DHCFQN1+/hx11YJUpI8pnEU+CrV6iU8s9rpL/qOUWhk33qWjJAjX83PQHhK5BX6GYQYEqz3xrk2K4UVTZYqMyAQjag== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 08:18:35.8902 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b9e3946-b2c2-4ddb-c370-08dd07a99952 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD77.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8187 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241118_001848_958213_9EE7E5C5 X-CRM114-Status: GOOD ( 14.47 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org AXI 1G/2.5G Ethernet subsystem supports 1G and 2.5G speeds. "max-speed" property is used to distinguish 1G and 2.5G MACs of AXI 1G/2.5G IP. max-speed is made a required property, and it breaks DT ABI but driver implementation ensures backward compatibility and assumes 1G when this property is absent. Modify existing bindings description for 2.5G MAC. Signed-off-by: Suraj Gupta --- .../bindings/net/xlnx,axi-ethernet.yaml | 44 +++++++++++++++++-- 1 file changed, 40 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml b/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml index fb02e579463c..69e84e2e2b63 100644 --- a/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml +++ b/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml @@ -9,10 +9,12 @@ title: AXI 1G/2.5G Ethernet Subsystem description: | Also called AXI 1G/2.5G Ethernet Subsystem, the xilinx axi ethernet IP core provides connectivity to an external ethernet PHY supporting different - interfaces: MII, GMII, RGMII, SGMII, 1000BaseX. It also includes two + interfaces: MII, GMII, RGMII, SGMII, 1000BaseX and 2500BaseX. It also includes two segments of memory for buffering TX and RX, as well as the capability of offloading TX/RX checksum calculation off the processor. + AXI 2.5G MAC is incremental speed upgrade of AXI 1G and supports 2.5G speed. + Management configuration is done through the AXI interface, while payload is sent and received through means of an AXI DMA controller. This driver includes the DMA driver code, so this driver is incompatible with AXI DMA @@ -62,6 +64,7 @@ properties: - rgmii - sgmii - 1000base-x + - 2500base-x xlnx,phy-type: description: @@ -118,9 +121,9 @@ properties: type: object pcs-handle: - description: Phandle to the internal PCS/PMA PHY in SGMII or 1000Base-X - modes, where "pcs-handle" should be used to point to the PCS/PMA PHY, - and "phy-handle" should point to an external PHY if exists. + description: Phandle to the internal PCS/PMA PHY in SGMII or 1000base-x/ + 2500base-x modes, where "pcs-handle" should be used to point to the + PCS/PMA PHY, and "phy-handle" should point to an external PHY if exists. maxItems: 1 dmas: @@ -137,12 +140,17 @@ properties: minItems: 2 maxItems: 32 + max-speed: + description: + Indicates max MAC rate. 1G and 2.5G MACs of AXI 1G/2.5G IP are distinguished using it. + required: - compatible - interrupts - reg - xlnx,rxmem - phy-handle + - max-speed allOf: - $ref: /schemas/net/ethernet-controller.yaml# @@ -164,6 +172,7 @@ examples: xlnx,rxmem = <0x800>; xlnx,txcsum = <0x2>; phy-handle = <&phy0>; + max-speed = <1000>; mdio { #address-cells = <1>; @@ -188,6 +197,7 @@ examples: xlnx,txcsum = <0x2>; phy-handle = <&phy1>; axistream-connected = <&dma>; + max-speed = <1000>; mdio { #address-cells = <1>; @@ -198,3 +208,29 @@ examples: }; }; }; + +# AXI 2.5G MAC + - | + axi_ethernet_eth2: ethernet@a4000000 { + compatible = "xlnx,axi-ethernet-1.00.a"; + interrupts = <0>; + clock-names = "s_axi_lite_clk", "axis_clk", "ref_clk", "mgt_clk"; + clocks = <&axi_clk>, <&axi_clk>, <&pl_enet_ref_clk>, <&mgt_clk>; + phy-mode = "2500base-x"; + reg = <0x40000000 0x40000>; + xlnx,rxcsum = <0x2>; + xlnx,rxmem = <0x800>; + xlnx,txcsum = <0x2>; + phy-handle = <&phy1>; + axistream-connected = <&dma>; + max-speed = <2500>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + phy2: ethernet-phy@1 { + device_type = "ethernet-phy"; + reg = <1>; + }; + }; + }; From patchwork Mon Nov 18 08:18:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Gupta X-Patchwork-Id: 13878283 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 C4073D43FEC for ; Mon, 18 Nov 2024 08:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HH1QrqeWsaU5gIUBWnFp32Lv/aEywXxRpHsZq4L3Zww=; b=B6g0pWJCKvj8H+pOD0N5Ta4lR1 gF0MJv24pWaDbUFtYVcZUSq2bGaLPRBAQLd2sGu+h2C+l7Zsa6BxXEcgic2GqV2I/bFMFE+VriIr3 0NNgpfouC1ivLIEocsbBk2JA6xhC5FAtXINyvsT8Pxuk88xd2jM471JPHz+36KoNATZwGEha5qmuu yzDWxwFLKXyfiRjrYOnxyEQFughKbmcWyArLu6ca9WfbgYl3WdMyq4xawuvO9iGAdrKD2Y+7+uReL rlPpttF7oGSz9F3+x71iRa0/dlj52yeZcqysSHk25y5tY9Dc4GJPaM/USaQZ6fg4FEuBXGlMbBlLD sUksHjuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tCx7t-00000008mDJ-1AN7; Mon, 18 Nov 2024 08:28:53 +0000 Received: from mail-bn8nam12on2060b.outbound.protection.outlook.com ([2a01:111:f403:2418::60b] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tCx67-00000008lg9-095s for linux-arm-kernel@lists.infradead.org; Mon, 18 Nov 2024 08:27:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wL4Zm8RcBeHOOl3jLXMcc+csuXbfenKhVwa7bV81kEASnpE7Nqnh1U+zYWZHkj8v3aO0IjdjeCTGmBZ6O7qUJ3xKQxik9uXuoKVGNbE2TUWzZ6aOynJcLsIAwbWA+VOUoXdTiptWDwBVKRxSZmh+NB1I/P18uOr0Rb2HduHilWv2KHw43fXNjwg7AY8J9TI9ujAKfGA4SHD04U0aVauMSl3CApfa2tilcW3SWJSA7G2ljQTHRsTshCbLwZfslpV3RVKu8a5qVZQjKCnR1kLwz19K/+VRPmRPPVyivOqeJkEcC/wPcmU1HSEMaoGQ/J7O7JGTLkDwaS8m963vR/YNow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HH1QrqeWsaU5gIUBWnFp32Lv/aEywXxRpHsZq4L3Zww=; b=wmitad7ipBx283kxfTdMQxIVd9KDzZYLhkwsh58XWyPes/rzovzXGtJetLjx4FR9eTF6ldInN+hqr7T20gQR/YC/jQcX0QG1thqkDOx3bdn+bZJ0pxi3y6qVdupl0++BU4BeiOZ9hbxiFDUuAIOqspZvTACADf2XDojwzxjZARS/L0u6U/Kcw93E+lnhMRZKUuyXfs+4VL2r65H5ekg7iFSd8EauwxdQlgYX6sjinQwganFo8zOW1WIR2jQKB+vw3WWE2cZkvblZWMhWhDreqc1vOjaeBkGG15je8EjwDkt4Po0UP04xJHMoEA6nbJkd1V1l5xqWuy8CdIEmEKdNXQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 165.204.84.12) smtp.rcpttodomain=lunn.ch smtp.mailfrom=amd.com; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HH1QrqeWsaU5gIUBWnFp32Lv/aEywXxRpHsZq4L3Zww=; b=g7zId37e+05pwEUteZN2qGKx3xrutEiPojkNREGm4fYDCsJmdcj5NFeQqiqWQFp/bChUD/xotl7g6Qy/YFN1oTu4V5GbF8O9VUSMtyh3nax+Pdree7Z2Rc1daQVGB2BxvvTtXcw9eBJYt52WydEm/vKTkm4+u7itZpQ58W2bars= Received: from DM6PR10CA0023.namprd10.prod.outlook.com (2603:10b6:5:60::36) by SJ2PR12MB9085.namprd12.prod.outlook.com (2603:10b6:a03:564::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.23; Mon, 18 Nov 2024 08:26:52 +0000 Received: from DS1PEPF00017099.namprd05.prod.outlook.com (2603:10b6:5:60:cafe::7f) by DM6PR10CA0023.outlook.office365.com (2603:10b6:5:60::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.22 via Frontend Transport; Mon, 18 Nov 2024 08:26:52 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 165.204.84.12) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=amd.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning amd.com discourages use of 165.204.84.12 as permitted sender) Received: from SATLEXMB03.amd.com (165.204.84.12) by DS1PEPF00017099.mail.protection.outlook.com (10.167.18.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8158.14 via Frontend Transport; Mon, 18 Nov 2024 08:26:52 +0000 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Mon, 18 Nov 2024 02:18:34 -0600 Received: from xhdsuragupt40.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Mon, 18 Nov 2024 02:18:31 -0600 From: Suraj Gupta To: , , , , , , , , CC: , , , , Subject: [PATCH net-next 2/2] net: axienet: Add support for AXI 2.5G MAC Date: Mon, 18 Nov 2024 13:48:22 +0530 Message-ID: <20241118081822.19383-3-suraj.gupta2@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241118081822.19383-1-suraj.gupta2@amd.com> References: <20241118081822.19383-1-suraj.gupta2@amd.com> MIME-Version: 1.0 Received-SPF: None (SATLEXMB03.amd.com: suraj.gupta2@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017099:EE_|SJ2PR12MB9085:EE_ X-MS-Office365-Filtering-Correlation-Id: 32d0a2d1-2591-4f5e-44ab-08dd07aac112 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014; X-Microsoft-Antispam-Message-Info: ZzpNpj7QVl7Jod7hHWis0gcQblOxNixPwnHpaUI3c4BPo+Irpucy4rufCcbcPKdAUoRiyQRgrsNJJ0ko4wLOJ8pPhbGA8UvMNOIxxy9m11O32LKIrkZLqN80+n+GKvrn7wat/axJwulL/J6fXjG7hyQlemsFknetGybAZruuZwqwKx5UstIS9FgpNHnDqbCFzi8j8FTpzCZ7kbTjaJt/1JHGuenRzov0fEN/XPZC0AgP98L8iHf4EKT7TrIT6QqG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VlL2CH4XVx9A6lqOjc1ijstlLBR1pkIa3FKQPxpdsotdTbM5+Xhak9IvO/89ODs1fQCG5nB3p4pZMCaIo1qWj9m6UKGSX3cSSYwq9Bw== X-Forefront-Antispam-Report: CIP:165.204.84.12;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:atlvpn-bp.amd.com;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Nov 2024 08:26:52.0575 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32d0a2d1-2591-4f5e-44ab-08dd07aac112 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.12];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017099.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB9085 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241118_002703_074473_4274F1D5 X-CRM114-Status: GOOD ( 18.37 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add AXI 2.5G MAC support, which is an incremental speed upgrade of AXI 1G MAC and supports 2.5G speed only. "max-speed" DT property is used in driver to distinguish 1G and 2.5G MACs of AXI 1G/2.5G IP. If max-speed property is missing, 1G is assumed to support backward compatibility. Co-developed-by: Harini Katakam Signed-off-by: Harini Katakam Signed-off-by: Suraj Gupta Reviewed-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_axienet.h | 4 +++- .../net/ethernet/xilinx/xilinx_axienet_main.c | 24 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet.h b/drivers/net/ethernet/xilinx/xilinx_axienet.h index d64b8abcf018..ebad1c147aa2 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet.h +++ b/drivers/net/ethernet/xilinx/xilinx_axienet.h @@ -274,7 +274,7 @@ #define XAE_EMMC_RX16BIT 0x01000000 /* 16 bit Rx client enable */ #define XAE_EMMC_LINKSPD_10 0x00000000 /* Link Speed mask for 10 Mbit */ #define XAE_EMMC_LINKSPD_100 0x40000000 /* Link Speed mask for 100 Mbit */ -#define XAE_EMMC_LINKSPD_1000 0x80000000 /* Link Speed mask for 1000 Mbit */ +#define XAE_EMMC_LINKSPD_1000_2500 0x80000000 /* Link Speed mask for 1000 or 2500 Mbit */ /* Bit masks for Axi Ethernet PHYC register */ #define XAE_PHYC_SGMIILINKSPEED_MASK 0xC0000000 /* SGMII link speed mask*/ @@ -542,6 +542,7 @@ struct skbuf_dma_descriptor { * @tx_ring_tail: TX skb ring buffer tail index. * @rx_ring_head: RX skb ring buffer head index. * @rx_ring_tail: RX skb ring buffer tail index. + * @max_speed: Maximum possible MAC speed. */ struct axienet_local { struct net_device *ndev; @@ -620,6 +621,7 @@ struct axienet_local { int tx_ring_tail; int rx_ring_head; int rx_ring_tail; + u32 max_speed; }; /** diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index 273ec5f70005..52a3703bd604 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2388,6 +2388,7 @@ static struct phylink_pcs *axienet_mac_select_pcs(struct phylink_config *config, struct axienet_local *lp = netdev_priv(ndev); if (interface == PHY_INTERFACE_MODE_1000BASEX || + interface == PHY_INTERFACE_MODE_2500BASEX || interface == PHY_INTERFACE_MODE_SGMII) return &lp->pcs; @@ -2421,8 +2422,9 @@ static void axienet_mac_link_up(struct phylink_config *config, emmc_reg &= ~XAE_EMMC_LINKSPEED_MASK; switch (speed) { + case SPEED_2500: case SPEED_1000: - emmc_reg |= XAE_EMMC_LINKSPD_1000; + emmc_reg |= XAE_EMMC_LINKSPD_1000_2500; break; case SPEED_100: emmc_reg |= XAE_EMMC_LINKSPD_100; @@ -2432,7 +2434,7 @@ static void axienet_mac_link_up(struct phylink_config *config, break; default: dev_err(&ndev->dev, - "Speed other than 10, 100 or 1Gbps is not supported\n"); + "Speed other than 10, 100, 1Gbps or 2.5Gbps is not supported\n"); break; } @@ -2681,6 +2683,12 @@ static int axienet_probe(struct platform_device *pdev) lp->switch_x_sgmii = of_property_read_bool(pdev->dev.of_node, "xlnx,switch-x-sgmii"); + ret = of_property_read_u32(pdev->dev.of_node, "max-speed", &lp->max_speed); + if (ret) { + lp->max_speed = SPEED_1000; + netdev_warn(ndev, "Please upgrade your device tree to use max-speed\n"); + } + /* Start with the proprietary, and broken phy_type */ ret = of_property_read_u32(pdev->dev.of_node, "xlnx,phy-type", &value); if (!ret) { @@ -2854,7 +2862,8 @@ static int axienet_probe(struct platform_device *pdev) "error registering MDIO bus: %d\n", ret); if (lp->phy_mode == PHY_INTERFACE_MODE_SGMII || - lp->phy_mode == PHY_INTERFACE_MODE_1000BASEX) { + lp->phy_mode == PHY_INTERFACE_MODE_1000BASEX || + lp->phy_mode == PHY_INTERFACE_MODE_2500BASEX) { np = of_parse_phandle(pdev->dev.of_node, "pcs-handle", 0); if (!np) { /* Deprecated: Always use "pcs-handle" for pcs_phy. @@ -2882,8 +2891,13 @@ static int axienet_probe(struct platform_device *pdev) lp->phylink_config.dev = &ndev->dev; lp->phylink_config.type = PHYLINK_NETDEV; - lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE | - MAC_10FD | MAC_100FD | MAC_1000FD; + lp->phylink_config.mac_capabilities = MAC_SYM_PAUSE | MAC_ASYM_PAUSE; + + /* Set MAC capabilities based on MAC type */ + if (lp->max_speed == SPEED_1000) + lp->phylink_config.mac_capabilities |= MAC_10FD | MAC_100FD | MAC_1000FD; + else + lp->phylink_config.mac_capabilities |= MAC_2500FD; __set_bit(lp->phy_mode, lp->phylink_config.supported_interfaces); if (lp->switch_x_sgmii) {