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 4CA9644077; Mon, 20 May 2024 12:43:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7385B40A8B; Mon, 20 May 2024 12:42:59 +0200 (CEST) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2054.outbound.protection.outlook.com [40.107.220.54]) by mails.dpdk.org (Postfix) with ESMTP id E78D840A6E for ; Mon, 20 May 2024 12:42:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qt461i7LMmIRwjTnBaApFE/d3RRqllPMj9zdHTSOb39nwDaoJLhPgt/25L5mIq9B3r4gBwSaIBB6H4MgT8wkdxqrg0WgifP99/myEfdXLSuhskJSwfdCtbBWP3KaiUUQhI0WCMI95F2YSzpb9qZ2KU0rbh2JIug55HSkux4B/mHjLvfjh4wiS5n/VQkUOiK+OJxEJpMVTEKkmgVpRAdETleAJrhqBtIFsBr2E/xWAF3OPbO+XSpMeZi8XbblmPJtl0jJn0a4md9ctoNDUdAQ0YzMlKsvyqIld35INBvKvTUEOMps3xHGSa20wiy4ONJTc5uSv20NeLAcUCBYaeOD8A== 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=gV4pSXM+4rQg+41KoWHUHaR6OdZ7m3E6fi0iINTlHNw=; b=O7CHJ41TVURDZmX0A2sIa2gIol0U4p1UWLC3oYZHO0rdB7h6LnyXlt8iFin6D7wGe/V9qI2v2s7H+AtY8Y3QrY96PD+fQoa6PC/is6ykyvFQr7zq9qtLg4+Ew8im/yQdJSozmQkTY8h59NAAQp9RFwRCn6yMe6fAMtGMamgZwBH+L0JPraQUQmSL4YLB7mmTmmmnNjFAlCT4TtWVmVwqOXWy4idqC9Rkm+tvzpGHeNMr4fAw+rljCxYuJwnmXZewHsdq+35WgjqNrFH+XNgNgSZe3xiOvJqp8hfNnKgPVFUQSpHqURztH8QRMQBkq52GkfF/DyMhp+yaD5WzrrZBng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none 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=gV4pSXM+4rQg+41KoWHUHaR6OdZ7m3E6fi0iINTlHNw=; b=Pm8CsZB5UVjXV7DNz5fqwjj3HSsv8fQ8awpVN7Eixzf4zznNBMX9raD8dCN9EsQhqsQUQu84LTdrsp1et5Jvt1dl8daFKwJf4Zy23aqqUM6AuKB8K713AITzMKp8vNzzxxRCfQbgP82BfD52HNZTrpxHBs/xbdT2ni7OE0DVKQw= Received: from DM4PR12MB5055.namprd12.prod.outlook.com (2603:10b6:5:39a::20) by CY8PR12MB7123.namprd12.prod.outlook.com (2603:10b6:930:60::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Mon, 20 May 2024 10:42:55 +0000 Received: from DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::acbd:ea93:4496:51a5]) by DM4PR12MB5055.namprd12.prod.outlook.com ([fe80::acbd:ea93:4496:51a5%7]) with mapi id 15.20.7587.035; Mon, 20 May 2024 10:42:54 +0000 From: "Sebastian, Selwin" To: "Ande, Venkat Kumar" , "dev@dpdk.org" Subject: RE: [PATCH v2 18/25] net/axgbe: add support for 10 Mbps speed Thread-Topic: [PATCH v2 18/25] net/axgbe: add support for 10 Mbps speed Thread-Index: AQHaoHxIFTWlwdO6BkKqrR/lR6eaHrGgA/Pg Date: Mon, 20 May 2024 10:42:54 +0000 Message-ID: References: <20240412125013.10498-1-VenkatKumar.Ande@amd.com> <20240507124305.2318-1-venkatkumar.ande@amd.com> <20240507124305.2318-18-venkatkumar.ande@amd.com> In-Reply-To: <20240507124305.2318-18-venkatkumar.ande@amd.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ActionId=0bd9eb58-55c9-45a4-909b-5657e764d3d9; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_ContentBits=0; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Enabled=true; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Method=Standard; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_Name=AMD Internal Distribution Only; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SetDate=2024-05-20T10:42:50Z; MSIP_Label_dce362fe-1558-4fb5-9f64-8a6240d76441_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR12MB5055:EE_|CY8PR12MB7123:EE_ x-ms-office365-filtering-correlation-id: 1b32e44b-cd01-43fe-404a-08dc78b99acc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|1800799015|366007|376005|38070700009; x-microsoft-antispam-message-info: =?us-ascii?Q?8xxGM7N0Njh19WRbEIflvbzUc7D8SzoTrJqkCb2WovYTHF8ryKxSY2/H/AfO?= =?us-ascii?Q?qV5tVRHBQEzcCwu3NfaY084Shh1AvYw1YFQvWxU5WtUzh2o0zYS6tn4Iz/3a?= =?us-ascii?Q?qiXcJPyLg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YCYhvv5J46FSnTZK?= =?us-ascii?Q?mH0FPzK2DG9EtiikRQ3B4b6cxEPsZyjZoTPMhfabJRootEZ1aa5A0Xtal6gM?= =?us-ascii?Q?+dKJVvDPF8MXjg7hig2h8Ikc0mdx+ofh2cwVnN63u9tY7PgloWGpGMGOj8dG?= =?us-ascii?Q?jeV1D8ZLcD9WA+aDBkVreaF1yzgqBVgJrB3+oNra/kGgzc1Crm5OxQ565LiQ?= =?us-ascii?Q?FAW2+MOOh7gQlHW6hFkxQ1NyJ2nRTqX+pcv2QEqdaq5pC3GnpbRAyqe4L2CC?= =?us-ascii?Q?cN1/KaNmLW1N+MLDB2ouVBLGf5mtV8qlf8ZEH3UUsEvrRRCYNOwAZ3KFoKJz?= =?us-ascii?Q?fIUBWWWt2SuiYrcLZuCuDbvohCyU3osLD0VumoXuVyKHzw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR12MB5055.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(1800799015)(366007)(376005)(38070700009); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?YBaghV1ybdzx+gE5PMLotTl65WttvrLuXkzL2asgTJkV5Vv2r6XsdyQHNYfv?= =?us-ascii?Q?Qe+foz86c5BV5MndWrHbO5IU+Fj206+2MOngBj6p//56x+o4BiARhqqpHg6f?= =?us-ascii?Q?CeYuXG/IZGuMLNT9pPhXcOi+0PCb/CBomaL7NZwltaHQlcEYO/rMC6BmMJ6t?= =?us-ascii?Q?GoZ5GZrsLdl2ewKBnehRGyRoMt8d3/v+PfudUgFrQhNbug5+DgJvUHBG/Tau?= =?us-ascii?Q?Os8vNMDY30ONXfW6ptMd5EfxfauQbpoXIzNE1IITxHljGuPMa8CzV+KdJK4S?= =?us-ascii?Q?/zZUPHW32tzbgRo61J1pK+kSmbflc+8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yWPUfgS0y+OC/fi07Sj3tDDwAEAylw7Jj1hUO9RTbOxM8yyxB9x/z/Kg?= =?us-ascii?Q?fanhl+AcunVOAHLlV7V9OxbYpzWK95bFiXhL/EyY+95onZ+djFf+72rMQbSS?= =?us-ascii?Q?fAZ4b+ycrYprnpouDUvkfRwA9pBCoOXs11R5wkmB6WU3QCtNf7T+RIFSsJw8?= =?us-ascii?Q?2B2mT+7z0dOurHIh6SFBKR9CsaULewZkqVZZwVTOjBGfOVxt5OUGmn14yQVx?= =?us-ascii?Q?QovTKFA7wPfZ5tYRDhpbocutposkdrA24VDVQz3wm5AaMhCVXiC8ZBE1Vp6A?= =?us-ascii?Q?ijR6thMlru/t/xcXa4lIIKy3qgckqHpQdItLV2qs6mVHOJOEhZk+LtU+UXj3?= =?us-ascii?Q?B5R95ITZYKj3S75J6/VXlGGEbui0X8/ItTVIZSC/?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB5055.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b32e44b-cd01-43fe-404a-08dc78b99acc X-MS-Exchange-CrossTenant-originalarrivaltime: 20 May 2024 10:42:54.0497 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 7lOLsXeMAovPfOUQ6ZJdXhXr4f3nNkOGI+KiE1WfPs3fb+X8Yzf1q7HuM6ZbUsZGTCDb7T4uYY/1A6F6Rjjvsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7123 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 [AMD Official Use Only - AMD Internal Distribution Only] Acked-by: Selwin Sebastian -----Original Message----- From: Ande, Venkat Kumar Sent: Tuesday, May 7, 2024 6:13 PM To: dev@dpdk.org Cc: Sebastian, Selwin ; Ande, Venkat Kumar Subject: [PATCH v2 18/25] net/axgbe: add support for 10 Mbps speed Add the necessary changes to support 10 Mbps speed for BaseT and SFP port m= odes. This is supported in MAC ver >=3D 30H. Signed-off-by: Venkat Kumar Ande --- 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, in= t speed) unsigned int ss; switch (speed) { + case SPEED_10: + ss =3D 0x07; + break; case SPEED_1000: ss =3D 0x03; break; diff --git a/drivers/net/axgbe/axgbe_ethdev.h b/drivers/net/axgbe/axgbe_eth= dev.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 faa7cdbf0a..9fe30e83bc 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 *p= data) 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 *pd= ata) 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 *p= data, 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 =3D -EINVAL; @@ -1025,6 +1040,9 @@ static void axgbe_phy_status_result(struct axgbe_port= *pdata) mode =3D axgbe_phy_status_aneg(pdata); switch (mode) { + case AXGBE_MODE_SGMII_10: + pdata->phy.speed =3D SPEED_10; + break; case AXGBE_MODE_SGMII_100: pdata->phy.speed =3D SPEED_100; break; @@ -1173,6 +1191,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 =3D -EINVAL; goto err_stop; @@ -1220,6 +1240,8 @@ static int axgbe_phy_best_advertised_speed(struct axg= be_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_p= hy_impl.c index 67a18e7c55..9c2c411b4f 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_por= t *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 |=3D ADVERTISED_10baseT_Full= ; if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) pdata->phy.advertising |=3D ADVERTISED_100baseT_Ful= l; if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_1000) @@ -= 511,6 +514,8 @@ static void axgbe_phy_sfp_phy_settings(struct axgbe_port *p= data) pdata->phy.advertising |=3D ADVERTISED_1000baseT_Fu= ll; else if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) pdata->phy.advertising |=3D ADVERTISED_100baseT_Ful= l; + else if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) + pdata->phy.advertising |=3D ADVERTISED_10baseT_Full= ; } } @@ -980,6 +985,14 @@ static enum axgbe_mode axgbe_phy_an37_sgmii_outcome(st= ruct 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 |=3D ADVERTISED_10baseT_F= ull; + mode =3D AXGBE_MODE_SGMII_10; + } else { + mode =3D AXGBE_MODE_UNKNOWN; + } + break; case AXGBE_SGMII_AN_LINK_SPEED_100: if (pdata->an_status & AXGBE_SGMII_AN_LINK_DUPLEX) { pdata->phy.lp_advertising |=3D ADVERTISED_100baseT_= Full; @@ -1347,6 +1360,18 @@ static void axgbe_phy_sgmii_1000_mode(struct a= xgbe_port *pdata) phy_data->cur_mode =3D AXGBE_MODE_SGMII_1000; } +static void axgbe_phy_sgmii_10_mode(struct axgbe_port *pdata) { + struct axgbe_phy_data *phy_data =3D 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 =3D AXGBE_MODE_SGMII_10; } + static enum axgbe_mode axgbe_phy_cur_mode(struct axgbe_port *pdata) { struct axgbe_phy_data *phy_data =3D pdata->phy_data; @@ -1363,6 +13= 88,7 @@ static enum axgbe_mode axgbe_phy_switch_baset_mode(struct axgbe_por= t *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(struc= t 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 *pda= ta, 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_por= t *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 !=3D 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 !=3D AXGBE_SFP_BASE_1000_T) return false; @@ -1803,6 +1844,12 @@ static int axgbe_phy_mdio_reset_setup(struct axgbe_p= ort *pdata) static bool axgbe_phy_port_mode_mismatch(struct axgbe_port *pd= ata) { struct axgbe_phy_data *phy_data =3D pdata->phy_data; + unsigned int ver; + + /* 10 Mbps speed is not supported in ver < 30H */ + ver =3D 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 axg= be_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 |=3D SUPPORTED_Autoneg; pdata->phy.supported |=3D SUPPORTED_Pause | SUPPORTED_Asym_= Pause; pdata->phy.supported |=3D SUPPORTED_TP; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |=3D SUPPORTED_10baseT_Full; + phy_data->start_mode =3D AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |=3D SUPPORTED_100baseT_Full; phy_data->start_mode =3D AXGBE_MODE_SGMII_100; @@ -= 2178,6 +2233,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |=3D SUPPORTED_Autoneg; pdata->phy.supported |=3D SUPPORTED_Pause | SUPPORTED_Asym_= Pause; pdata->phy.supported |=3D SUPPORTED_TP; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |=3D SUPPORTED_10baseT_Full; + phy_data->start_mode =3D AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |=3D SUPPORTED_100baseT_Full; phy_data->start_mode =3D AXGBE_MODE_SGMII_100; @@ -= 2199,6 +2258,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |=3D SUPPORTED_Autoneg; pdata->phy.supported |=3D SUPPORTED_Pause | SUPPORTED_Asym_= Pause; pdata->phy.supported |=3D SUPPORTED_TP; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |=3D SUPPORTED_10baseT_Full; + phy_data->start_mode =3D AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |=3D SUPPORTED_100baseT_Full; phy_data->start_mode =3D AXGBE_MODE_SGMII_100; @@ -= 2234,6 +2297,10 @@ static int axgbe_phy_init(struct axgbe_port *pdata) pdata->phy.supported |=3D SUPPORTED_Pause | SUPPORTED_Asym_= Pause; pdata->phy.supported |=3D SUPPORTED_TP; pdata->phy.supported |=3D SUPPORTED_FIBRE; + if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_10) { + pdata->phy.supported |=3D SUPPORTED_10baseT_Full; + phy_data->start_mode =3D AXGBE_MODE_SGMII_10; + } if (phy_data->port_speeds & AXGBE_PHY_PORT_SPEED_100) { pdata->phy.supported |=3D SUPPORTED_100baseT_Full; phy_data->start_mode =3D AXGBE_MODE_SGMII_100; -- 2.34.1