From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E312D44153; Tue, 4 Jun 2024 14:14:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 431FC4357B; Tue, 4 Jun 2024 14:13:36 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2049.outbound.protection.outlook.com [40.107.100.49]) by mails.dpdk.org (Postfix) with ESMTP id 2758C43702 for ; Tue, 4 Jun 2024 14:13:34 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e9mEan3sq+omrgFSe1vyDxLo96/m0EKTUhgM51TTYKfIrreuGM8htAAhYHpeF7Vkq9pXaaLTphbrZsUyGNFio7Si5Yy9KafzJ5e/ZHRF1DPPGePUehJSXfqfgj1S5Nmjemfa3sCBeFOK+EWm1sP7VFaxbwly5/WH3KUrzUw3qsbAOwM/YK4VYmL2rU2jqgRWr/qqdftPQ4euVDTIqdRHcSD/f2Z3u374kWhqhZycXRxAp2eWKs+LAgroqGxWhmmj9b5EZiaRyKy7vOXKO8hzipnuVgHfU6oFq0pYFMQ8BnAfd3q64kzAVEzhh5y0SmWuuONEVfZtwgg/mvUC3GbFWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=o8Zds0ayvXwgSg6wVZqtTIMsXsqS80rWcqqfCohF6ws=; b=YPLyM3/ZozTJJsM3cbXKCii10eN31cFlEuuxEG1SINpwpPDPYTeP15wXh4skVsume8ujs3hWwv7pFdxl1kw3sKnaozV3PUAUFXrRb0p8c00XQft4RtbsFyS/m2O4Ogz4UjbL2WiQ9WLNXbh+ae4EU/iI8+xgZqjZJxwBv4kq4I5PNWQRk3OeXwZRTaxxV62+c3zrWzd+Uv0QaCdHvl4uHol8KST1f2BCgwhOJUf+g7U5TJgLCKsWOfk4R9mP6kHwao8nb3S9iMiDE3K8tuLK9HFyrmHxlsQrtdYG4+X4lqpmwjgHN/fMwbJv/V36w0WFi5j49TKR0RscrPwcytISUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none 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=o8Zds0ayvXwgSg6wVZqtTIMsXsqS80rWcqqfCohF6ws=; b=kuELi/f7hblf5CCTfZo0XDx8v3TxRe9VC2qHy0xEgxrvzav52WLuBrQLJquaC9QaEM5iS+0X5m7wkehkUHSqjCettCj0eO6hLCSSHqnGbNjkhhzgJy9CTGxuApHHrpY2nnJyF/J9x52YRiwUwI06DfCCZ6evQgeyrzqU7Y+5mH4= Received: from MN2PR18CA0017.namprd18.prod.outlook.com (2603:10b6:208:23c::22) by DS7PR12MB5982.namprd12.prod.outlook.com (2603:10b6:8:7d::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.30; Tue, 4 Jun 2024 12:13:22 +0000 Received: from BN3PEPF0000B372.namprd21.prod.outlook.com (2603:10b6:208:23c:cafe::a5) by MN2PR18CA0017.outlook.office365.com (2603:10b6:208:23c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31 via Frontend Transport; Tue, 4 Jun 2024 12:13:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B372.mail.protection.outlook.com (10.167.243.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.0 via Frontend Transport; Tue, 4 Jun 2024 12:13:22 +0000 Received: from cae-Lilac-RMB.amd.com (10.180.168.240) 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.35; Tue, 4 Jun 2024 07:13:20 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , Selwin Sebastian Subject: [PATCH v3 19/25] net/axgbe: add support for 10 Mbps speed Date: Tue, 4 Jun 2024 17:41:51 +0530 Message-ID: <20240604121157.3052-19-venkatkumar.ande@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604121157.3052-1-venkatkumar.ande@amd.com> References: <20240507124305.2318-1-VenkatKumar.Ande@amd.com> <20240604121157.3052-1-venkatkumar.ande@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B372:EE_|DS7PR12MB5982:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b333e60-b7a8-43f5-309f-08dc848fbaae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|1800799015|82310400017|376005|36860700004; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ukHckdKgQ2odbxArMDrK7HYxgASsnuwh/oa70iMZQvdEanBlEHZyHLr5QWpa?= =?us-ascii?Q?4hasFOJln+8Hm3O0H0hNL3GSgSnKBXoJ/e3wpNpWz/s0lBFMorRN8+NH/xpd?= =?us-ascii?Q?rH7zWXJD9j/3JGYwRveetBxD1a5wiIupOhKkx02icXgLbW1znfWkjvEV8rPp?= =?us-ascii?Q?tSLxLZqhVlcp3GRFkDeNeScyV0M7sDPK4P825Wy9IPP61EGoPPyR4i/C4eL7?= =?us-ascii?Q?lmI/R0x+pQkZKqtvKG0+384NgcU0+IHy5gmLVIoSpdzcc6eU3zbUzsfRi6z1?= =?us-ascii?Q?XDVM+gnJIjBurAVjPy9nsRC6JHKM9UhxMDktdQV8UhTBkAiVJmwWUIa0JFRc?= =?us-ascii?Q?DMeyHroYMXvyZ9rotopjcxTB0qrKRkNo7LSMHRrX3SMy7KnRUNsrrJ/cC0N/?= =?us-ascii?Q?Bjkq33R2gTYYygyklPlgj0JkRCVHVSdzBCojk7Lr98gDd58+Vb41uIF4F4n9?= =?us-ascii?Q?qD4vOkvOwSvUvKHQzRG+AlLXZWmklwwgmtislX2yr6E8auOtvbYDu9wEj9HS?= =?us-ascii?Q?bxV1HbkDjvcJhguwzsHoS/cwnPSM5gCDJL3Cuq1wviveR/XRzYUhqUe/3c2b?= =?us-ascii?Q?kfar7xjVFYHQb4a7eSYf0ZPjyrLpzW3wEo+EX96h1BgGh/nr9IuI2DEJsw4u?= =?us-ascii?Q?IEQZuqbVuxTT3Lpvm7eKNigcuWP/jLltBN+OD+b1tpEA3g3tw3WhyiK4j1c5?= =?us-ascii?Q?0P5EC3FdktE93JZqM5nQfp4C2okeEWNkMztO14acFJOBPU5HqP/t9IXC/fJN?= =?us-ascii?Q?84Ox4PzNLtRBPr/q/yTZzH2LooI0nn4UR2bNFaREFbuXHYJY008XC0jBtdJh?= =?us-ascii?Q?jmTyFdhPvHWQkDLxTaEc47NsSp0rXMytMPPxl7V9OolKsHfPbzWMPZvrilz+?= =?us-ascii?Q?JdfRJTW6f9+dH1g/rRHR/DIcObfjTjsF6TmyGjaTZABAXI+trlRZasuqzWNQ?= =?us-ascii?Q?/P2wWpkmjo2y1nAFYGZ3uvGfeqV8iIgg6tAuDO8r0IBPFiF0mI3rvoHTYzvn?= =?us-ascii?Q?QZRKN2SMH+AFE24Y4QNb2PigoriF7meyz0BDhAZUMTDJ7GmNnB/C2+yhwrLj?= =?us-ascii?Q?y2uDYAAzsMJH5XTGCSTy7vfMSfcfCpmhgHIUhX5XI5cCygb5HjMaIjiGXpsH?= =?us-ascii?Q?Bdj8OpYSxAE4QyrPN+/Cd12mGwRXfqSKjVvnjDOoGZv3B1sDgQ9lRVgIukkH?= =?us-ascii?Q?gW4dzJEXxpNdyGjpC1xW0WB4NAyvlL3//5s9Cf8QZMRxD7Gz1yQND3dmaJt5?= =?us-ascii?Q?XSccebKr29p3Eh3MkezvUh8YlkB4immuaYyBJnKnDPf4DVkG1nzuBoc3073q?= =?us-ascii?Q?cnmRxyZ7IoT2XCYHSx8zHxx8C7dkdNDyYtUzeZNNvXXVcKd7E2cO1spDJAPv?= =?us-ascii?Q?ccKOSts=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(1800799015)(82310400017)(376005)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:13:22.6622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b333e60-b7a8-43f5-309f-08dc848fbaae 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.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B372.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB5982 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Venkat Kumar Ande Add the necessary changes to support 10 Mbps speed for BaseT and SFP port modes. This is supported in MAC ver >= 30H. Signed-off-by: Venkat Kumar Ande Acked-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_dev.c | 3 ++ drivers/net/axgbe/axgbe_ethdev.h | 2 + drivers/net/axgbe/axgbe_mdio.c | 22 +++++++++ drivers/net/axgbe/axgbe_phy.h | 2 + drivers/net/axgbe/axgbe_phy_impl.c | 75 ++++++++++++++++++++++++++++-- 5 files changed, 100 insertions(+), 4 deletions(-) diff --git a/drivers/net/axgbe/axgbe_dev.c b/drivers/net/axgbe/axgbe_dev.c index 5233633a53..6b413160c2 100644 --- a/drivers/net/axgbe/axgbe_dev.c +++ b/drivers/net/axgbe/axgbe_dev.c @@ -250,6 +250,9 @@ static int axgbe_set_speed(struct axgbe_port *pdata, int speed) unsigned int ss; switch (speed) { + case SPEED_10: + ss = 0x07; + break; case SPEED_1000: ss = 0x03; break; diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_ethdev.h index 6dc1c1274b..4dcbf6d9a2 100644 --- a/drivers/net/axgbe/axgbe_ethdev.h +++ b/drivers/net/axgbe/axgbe_ethdev.h @@ -115,6 +115,7 @@ #define AXGBE_SGMII_AN_LINK_STATUS BIT(1) #define AXGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3)) +#define AXGBE_SGMII_AN_LINK_SPEED_10 0x00 #define AXGBE_SGMII_AN_LINK_SPEED_100 0x04 #define AXGBE_SGMII_AN_LINK_SPEED_1000 0x08 #define AXGBE_SGMII_AN_LINK_DUPLEX BIT(4) @@ -214,6 +215,7 @@ enum axgbe_mode { AXGBE_MODE_KX_2500, AXGBE_MODE_KR, AXGBE_MODE_X, + AXGBE_MODE_SGMII_10, AXGBE_MODE_SGMII_100, AXGBE_MODE_SGMII_1000, AXGBE_MODE_SFI, diff --git a/drivers/net/axgbe/axgbe_mdio.c b/drivers/net/axgbe/axgbe_mdio.c index 3ec899a61d..130a67479e 100644 --- a/drivers/net/axgbe/axgbe_mdio.c +++ b/drivers/net/axgbe/axgbe_mdio.c @@ -143,6 +143,15 @@ static void axgbe_sgmii_1000_mode(struct axgbe_port *pdata) pdata->phy_if.phy_impl.set_mode(pdata, AXGBE_MODE_SGMII_1000); } +static void axgbe_sgmii_10_mode(struct axgbe_port *pdata) +{ + /* Set MAC to 10M speed */ + pdata->hw_if.set_speed(pdata, SPEED_10); + + /* Call PHY implementation support to complete rate change */ + pdata->phy_if.phy_impl.set_mode(pdata, AXGBE_MODE_SGMII_10); +} + static void axgbe_sgmii_100_mode(struct axgbe_port *pdata) { @@ -176,6 +185,9 @@ static void axgbe_change_mode(struct axgbe_port *pdata, case AXGBE_MODE_KR: axgbe_kr_mode(pdata); break; + case AXGBE_MODE_SGMII_10: + axgbe_sgmii_10_mode(pdata); + break; case AXGBE_MODE_SGMII_100: axgbe_sgmii_100_mode(pdata); break; @@ -864,6 +876,7 @@ static int axgbe_phy_config_fixed(struct axgbe_port *pdata) case AXGBE_MODE_KX_1000: case AXGBE_MODE_KX_2500: case AXGBE_MODE_KR: + case AXGBE_MODE_SGMII_10: case AXGBE_MODE_SGMII_100: case AXGBE_MODE_SGMII_1000: case AXGBE_MODE_X: @@ -923,6 +936,8 @@ static int __axgbe_phy_config_aneg(struct axgbe_port *pdata, bool set_mode) axgbe_set_mode(pdata, AXGBE_MODE_SGMII_1000); } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_100)) { axgbe_set_mode(pdata, AXGBE_MODE_SGMII_100); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_10)) { + axgbe_set_mode(pdata, AXGBE_MODE_SGMII_10); } else { rte_intr_enable(pdata->pci_dev->intr_handle); ret = -EINVAL; @@ -1025,6 +1040,9 @@ static bool axgbe_phy_status_result(struct axgbe_port *pdata) mode = axgbe_phy_status_aneg(pdata); switch (mode) { + case AXGBE_MODE_SGMII_10: + pdata->phy.speed = SPEED_10; + break; case AXGBE_MODE_SGMII_100: pdata->phy.speed = SPEED_100; break; @@ -1181,6 +1199,8 @@ static int axgbe_phy_start(struct axgbe_port *pdata) axgbe_sgmii_1000_mode(pdata); } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_100)) { axgbe_sgmii_100_mode(pdata); + } else if (axgbe_use_mode(pdata, AXGBE_MODE_SGMII_10)) { + axgbe_sgmii_10_mode(pdata); } else { ret = -EINVAL; goto err_stop; @@ -1228,6 +1248,8 @@ static int axgbe_phy_best_advertised_speed(struct axgbe_port *pdata) return SPEED_1000; else if (pdata->phy.advertising & ADVERTISED_100baseT_Full) return SPEED_100; + else if (pdata->phy.advertising & ADVERTISED_10baseT_Full) + return SPEED_10; return SPEED_UNKNOWN; } diff --git a/drivers/net/axgbe/axgbe_phy.h b/drivers/net/axgbe/axgbe_phy.h index 77ee20a31a..5b844e81cd 100644 --- a/drivers/net/axgbe/axgbe_phy.h +++ b/drivers/net/axgbe/axgbe_phy.h @@ -168,6 +168,7 @@ #define ADVERTISED_1000baseKX_Full (1 << 17) #define ADVERTISED_1000baseT_Full (1 << 5) #define ADVERTISED_100baseT_Full (1 << 3) +#define ADVERTISED_10baseT_Full (1 << 2) #define ADVERTISED_TP (1 << 7) #define ADVERTISED_FIBRE (1 << 10) #define ADVERTISED_Backplane (1 << 16) @@ -175,6 +176,7 @@ #define SUPPORTED_1000baseKX_Full (1 << 17) #define SUPPORTED_10000baseKR_Full (1 << 19) #define SUPPORTED_2500baseX_Full (1 << 15) +#define SUPPORTED_10baseT_Full (1 << 3) #define SUPPORTED_100baseT_Full (1 << 2) #define SUPPORTED_1000baseT_Full (1 << 5) #define SUPPORTED_10000baseT_Full (1 << 12) diff --git a/drivers/net/axgbe/axgbe_phy_impl.c b/drivers/net/axgbe/axgbe_phy_impl.c index 62503f038f..5ba7217320 100644 --- a/drivers/net/axgbe/axgbe_phy_impl.c +++ b/drivers/net/axgbe/axgbe_phy_impl.c @@ -7,6 +7,7 @@ #include "axgbe_common.h" #include "axgbe_phy.h" +#define AXGBE_PHY_PORT_SPEED_10 BIT(0) #define AXGBE_PHY_PORT_SPEED_100 BIT(1) #define AXGBE_PHY_PORT_SPEED_1000 BIT(2) #define AXGBE_PHY_PORT_SPEED_2500 BIT(3) @@ -490,6 +491,8 @@ static void axgbe_phy_sfp_phy_settings(struct axgbe_port *pdata) switch (phy_data->sfp_speed) { case AXGBE_SFP_SPEED_100_1000: + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) + pdata->phy.advertising |= ADVERTISED_10baseT_Full; if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) pdata->phy.advertising |= ADVERTISED_100baseT_Full; if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_1000) @@ -511,6 +514,8 @@ static void axgbe_phy_sfp_phy_settings(struct axgbe_port *pdata) pdata->phy.advertising |= ADVERTISED_1000baseT_Full; else if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) pdata->phy.advertising |= ADVERTISED_100baseT_Full; + else if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) + pdata->phy.advertising |= ADVERTISED_10baseT_Full; } } @@ -980,6 +985,14 @@ static enum axgbe_mode axgbe_phy_an37_sgmii_outcome(struct axgbe_port *pdata) axgbe_phy_phydev_flowctrl(pdata); switch (pdata->an_status & AXGBE_SGMII_AN_LINK_SPEED) { + case AXGBE_SGMII_AN_LINK_SPEED_10: + if (pdata->an_status & AXGBE_SGMII_AN_LINK_DUPLEX) { + pdata->phy.lp_advertising |= ADVERTISED_10baseT_Full; + mode = AXGBE_MODE_SGMII_10; + } else { + mode = AXGBE_MODE_UNKNOWN; + } + break; case AXGBE_SGMII_AN_LINK_SPEED_100: if (pdata->an_status & AXGBE_SGMII_AN_LINK_DUPLEX) { pdata->phy.lp_advertising |= ADVERTISED_100baseT_Full; @@ -1347,6 +1360,18 @@ static void axgbe_phy_sgmii_1000_mode(struct axgbe_port *pdata) phy_data->cur_mode = AXGBE_MODE_SGMII_1000; } +static void axgbe_phy_sgmii_10_mode(struct axgbe_port *pdata) +{ + struct axgbe_phy_data *phy_data = pdata->phy_data; + + axgbe_phy_set_redrv_mode(pdata); + + /* 10M/SGMII */ + axgbe_phy_perform_ratechange(pdata, AXGBE_MB_CMD_SET_1G, AXGBE_MB_SUBCMD_10MBITS); + + phy_data->cur_mode = AXGBE_MODE_SGMII_10; +} + static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata) { struct axgbe_phy_data *phy_data = pdata->phy_data; @@ -1363,6 +1388,7 @@ static enum axgbe_mode axgbe_phy_switch_baset_mode(struct axgbe_port *pdata) return axgbe_phy_cur_mode(pdata); switch (axgbe_phy_cur_mode(pdata)) { + case AXGBE_MODE_SGMII_10: case AXGBE_MODE_SGMII_100: case AXGBE_MODE_SGMII_1000: return AXGBE_MODE_KR; @@ -1433,6 +1459,8 @@ static enum axgbe_mode axgbe_phy_get_baset_mode(struct axgbe_phy_data *phy_data int speed) { switch (speed) { + case SPEED_10: + return AXGBE_MODE_SGMII_10; case SPEED_100: return AXGBE_MODE_SGMII_100; case SPEED_1000: @@ -1448,6 +1476,8 @@ static enum axgbe_mode axgbe_phy_get_sfp_mode(struct axgbe_phy_data *phy_data, int speed) { switch (speed) { + case SPEED_10: + return AXGBE_MODE_SGMII_10; case SPEED_100: return AXGBE_MODE_SGMII_100; case SPEED_1000: @@ -1525,6 +1555,9 @@ static void axgbe_phy_set_mode(struct axgbe_port *pdata, enum axgbe_mode mode) case AXGBE_MODE_SGMII_1000: axgbe_phy_sgmii_1000_mode(pdata); break; + case AXGBE_MODE_SGMII_10: + axgbe_phy_sgmii_10_mode(pdata); + break; default: break; } @@ -1566,6 +1599,9 @@ static bool axgbe_phy_use_baset_mode(struct axgbe_port *pdata, enum axgbe_mode mode) { switch (mode) { + case AXGBE_MODE_SGMII_10: + return axgbe_phy_check_mode(pdata, mode, + ADVERTISED_10baseT_Full); case AXGBE_MODE_SGMII_100: return axgbe_phy_check_mode(pdata, mode, ADVERTISED_100baseT_Full); @@ -1591,6 +1627,11 @@ static bool axgbe_phy_use_sfp_mode(struct axgbe_port *pdata, return false; return axgbe_phy_check_mode(pdata, mode, ADVERTISED_1000baseT_Full); + case AXGBE_MODE_SGMII_10: + if (phy_data->sfp_base != AXGBE_SFP_BASE_1000_T) + return false; + return axgbe_phy_check_mode(pdata, mode, + ADVERTISED_10baseT_Full); case AXGBE_MODE_SGMII_100: if (phy_data->sfp_base != AXGBE_SFP_BASE_1000_T) return false; @@ -1803,6 +1844,12 @@ static int axgbe_phy_mdio_reset_setup(struct axgbe_port *pdata) static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pdata) { struct axgbe_phy_data *phy_data = pdata->phy_data; + unsigned int ver; + + /* 10 Mbps speed is not supported in ver < 30H */ + ver = AXGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER); + if (ver < 0x30 && phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) + return true; switch (phy_data->port_mode) { case AXGBE_PORT_MODE_BACKPLANE: @@ -1816,7 +1863,8 @@ static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pdata) return false; break; case AXGBE_PORT_MODE_1000BASE_T: - if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || + if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) || + (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_1000)) return false; break; @@ -1825,13 +1873,15 @@ static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pdata) return false; break; case AXGBE_PORT_MODE_NBASE_T: - if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || + if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) || + (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_1000) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_2500)) return false; break; case AXGBE_PORT_MODE_10GBASE_T: - if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || + if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) || + (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_1000) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10000)) return false; @@ -1841,7 +1891,8 @@ static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pdata) return false; break; case AXGBE_PORT_MODE_SFP: - if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || + if ((phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) || + (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_1000) || (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10000)) return false; @@ -2150,6 +2201,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |= SUPPORTED_Autoneg; pdata->phy.supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; pdata->phy.supported |= SUPPORTED_TP; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |= SUPPORTED_10baseT_Full; + phy_data->start_mode = AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |= SUPPORTED_100baseT_Full; phy_data->start_mode = AXGBE_MODE_SGMII_100; @@ -2178,6 +2233,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |= SUPPORTED_Autoneg; pdata->phy.supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; pdata->phy.supported |= SUPPORTED_TP; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |= SUPPORTED_10baseT_Full; + phy_data->start_mode = AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |= SUPPORTED_100baseT_Full; phy_data->start_mode = AXGBE_MODE_SGMII_100; @@ -2199,6 +2258,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |= SUPPORTED_Autoneg; pdata->phy.supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; pdata->phy.supported |= SUPPORTED_TP; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |= SUPPORTED_10baseT_Full; + phy_data->start_mode = AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |= SUPPORTED_100baseT_Full; phy_data->start_mode = AXGBE_MODE_SGMII_100; @@ -2234,6 +2297,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; pdata->phy.supported |= SUPPORTED_TP; pdata->phy.supported |= SUPPORTED_FIBRE; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |= SUPPORTED_10baseT_Full; + phy_data->start_mode = AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |= SUPPORTED_100baseT_Full; phy_data->start_mode = AXGBE_MODE_SGMII_100; -- 2.34.1