From patchwork Thu Oct 24 13:24:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Schumacher X-Patchwork-Id: 13849027 X-Patchwork-Delegate: kuba@kernel.org Received: from BEUP281CU002.outbound.protection.outlook.com (mail-germanynorthazon11020123.outbound.protection.outlook.com [52.101.169.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D93871D9A71; Thu, 24 Oct 2024 13:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.169.123 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729776269; cv=fail; b=fvgQhaGG0r2evWwe5t0Hu2LfeeADlKJjzORWg/sWqmdfDxepeCylth5npzPWgxo1L5bW+lBh9Npg41BF6j5QnK3mDeLvqeB1OO2c55lulx+Zkuj4l9M2xHSm5o3lF9nkeICY46+Tn5YI9GPjW1nncdPh2CyCdiq3bp6GMl5KMzA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729776269; c=relaxed/simple; bh=S5VTMBtqNy8wFhijNvuBMmv2oV9cj940jaAXCEWZmhM=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=Dq6D6DpZ3n2ceymeGKSBnicnQ0awoDFpXgzOKbPJCkfnPo21zBgLJqHLMhyuaUkjJXgviSiTNBqDIh+0pMfN/2lP5VL+SZGlKZAV8kTiT1lenwjuPykYl4GPiUpPQFm+8ps9TOT1hAfih9tEBiVqK/ZkatOCZEb2ERIecYEg7e4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iris-sensing.com; spf=pass smtp.mailfrom=iris-sensing.com; dkim=pass (2048-bit key) header.d=iris-sensing.com header.i=@iris-sensing.com header.b=3E1dgXSd; arc=fail smtp.client-ip=52.101.169.123 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=iris-sensing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=iris-sensing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=iris-sensing.com header.i=@iris-sensing.com header.b="3E1dgXSd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EW1QpHxGyCHSKH3dZOoH9ASjSmLxJ4MH/x21lT7wsv7z8TYViCZr0zZULcKJoOefwdZZFvvbsImT/H15FXTSai6M27J+KOAiG4QdMoCH3+bTFiCGzWJqzlbAi4MI4z9MxzL1l9DxNttJk+Hth1i7MVpBG6HpFTNrIIySyJON7AwK+oaWoVap62r3CicAnQAz6I2n4o080gQ7rA5izz1dOQZ/gCXuAFYEpNE0H4kZO5SzWXLNHaTZ4PAdUYCtq0Q3PDMz5UXrE2TErxrf0qgQKyjumbBYmVBGUHGhnOjy/ykZFrsf00nMRvRj2993zt+DMKbip2AW19BhXVoRWKAJAg== 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=S5VTMBtqNy8wFhijNvuBMmv2oV9cj940jaAXCEWZmhM=; b=sWyugkTGwdXyclEBVg/YPJcKI5g1rKQ065+V7M9QUcXxwRcTPvEAq+1oDRH1B3ONdXtQfIVSflDwmc8fhwR+nNsFHsKQzNyuKg6YGa9cNPlqXX9oxsOt+4So7iieT74CRD1P3VkNNk6TmwSyqvmHVCXJ3K3EE+2SfE714jUDWqPEfdEi+0AsGgKlHDP5SMA10WzeiCYJSfVg/I8AFpBBF2j6a63KB26GTeSWibpDZdd3pwrIjc7qUXrUwI0AoCNMXVOuqzL84jWsh/EdPoldpbkj3dr2enYwnD8Y1E7Abn7NDNb4mDDh80Fs4gPdXmCPVErTrNaPJRqMgsq6nYZ3hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=iris-sensing.com; dmarc=pass action=none header.from=iris-sensing.com; dkim=pass header.d=iris-sensing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iris-sensing.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=S5VTMBtqNy8wFhijNvuBMmv2oV9cj940jaAXCEWZmhM=; b=3E1dgXSdQ/dZwhQomWZJXGVveY5nWnTsCuUjEaRoXvDe3xMIUs1hQy0fsy9qNwSAPPBpbwhCFo9Wug0Wbo+JPmJQotXZ2Sk5itIeE9TYeiTK4o8rn7deyKyzG6udUozKIwCgWC2RPT2CApZk24f1ZP3UIu5LTs17s92bDnnBQDHvc2nAKI+PIEuPCseHR74FX95iO8x+9EWbG5WSHKlAUx9FMlwpvAF1Cdf9ltgycyqBOWwVS6FzZepDe2qX+xR5mC5nznzflhldhnPhslURBcEzHwz4u02Ow4FUPz/jUVa0550fE1rn42/XDCREgWl51kgm5tTOTw01cLoHOvF+zg== Received: from FR0P281MB2809.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:23::8) by FR4P281MB3493.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:d2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.17; Thu, 24 Oct 2024 13:24:23 +0000 Received: from FR0P281MB2809.DEUP281.PROD.OUTLOOK.COM ([fe80::d685:f312:e114:519e]) by FR0P281MB2809.DEUP281.PROD.OUTLOOK.COM ([fe80::d685:f312:e114:519e%4]) with mapi id 15.20.8093.018; Thu, 24 Oct 2024 13:24:23 +0000 From: Erik Schumacher To: "hkallweit1@gmail.com" , "andrew@lunn.ch" CC: "linux@armlinux.org.uk" , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "kuba@kernel.org" , "edumazet@google.com" , "jeremie.dautheribes@bootlin.com" , "pabeni@redhat.com" Subject: [PATCH net-next] net: phy: dp83822: Configure RMII mode on DP83825 devices Thread-Topic: [PATCH net-next] net: phy: dp83822: Configure RMII mode on DP83825 devices Thread-Index: AQHbJhgKGFGOOWZToUS3NBClQzY34Q== Date: Thu, 24 Oct 2024 13:24:23 +0000 Message-ID: Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=iris-sensing.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: FR0P281MB2809:EE_|FR4P281MB3493:EE_ x-ms-office365-filtering-correlation-id: c57beb85-e4f7-417a-fb6f-08dcf42f2d2f x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|7416014|376014|366016|10070799003|1800799024|38070700018; x-microsoft-antispam-message-info: =?utf-8?q?C9NyrOzzwDRQSV2Xnt66c0j4iYKR0i2?= =?utf-8?q?nZ6il3KvVFUorj7Gux9YLYQjVBnblqsfdV4qZ5/MpSnpR7snyEdb3CBn2HCajd8rZ?= =?utf-8?q?aK18OsF9X5T4eiZg+eTLZvSWRuuSHNmX9afBnpmxlbpuWRLSYCV3iW3iitw3+RXwk?= =?utf-8?q?7p38iP+qITa5iHeaw0qrNqnhaFCvjKduhm3JlkdDvdXT9+JG+XeIFEW6rji/pDpnI?= =?utf-8?q?YdFCZDvlxxo3pkEwfpiMJ2ysp8vVt/9ROCylvs0j1zNZhYzQiVFZxzcx9bDOzGJUM?= =?utf-8?q?8lTNV+g7v8Y8WV7F0xh141bAtKvby8CUsd3ykdoN/YDJxNYEqp3bR9UkWJVNbaiLA?= =?utf-8?q?BhncJqyG1wABRD1/fudXk34JgCOzpiRFrVXwOsCQX6desZX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Mk+ByZ9VvRGM4TSmgwvldR4i0MtR6vDcE?= =?utf-8?q?e/4NWNb1WmPdPojOyvoy+L4jmDkgQjmj9RaFnGRnefZlpKu+Sqp3gk7g=3D?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:FR0P281MB2809.DEUP281.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(7416014)(376014)(366016)(10070799003)(1800799024)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?q?joYpcCdISec/GfFsp+MJ7UgIy/d/?= =?utf-8?q?wetRxLaPG0UisDLpFXYGuY0Sv5u9kvkEGOHjGtEIEU+nF6aLIZMtRujjchdDDk10j?= =?utf-8?q?zV0eey0+Q1oEEWbAbYld6eDFr72QevwVJu71xTP9rGvDV3yFLmWqwbNIGbceE9iTX?= =?utf-8?q?LgZlxMTKeALEk0SzbXNOt8Gky68H52XFhqVpeMTw/f9oiQ7jClm148/+W0wvv8vSP?= =?utf-8?q?oZJNIkLJjlAgMQ7q3UnEiugHTxOmbaSHIBPN3nVxcNkDW1oDlOsSYy1h25ZR/MR6U?= =?utf-8?q?JSDZ3i83yi/P87Ia/BBemePcbOn/XOBLoYAgLJtjK6Z4zU+MdAHITPI1nbfyPQmyw?= =?utf-8?q?6l6cA2r+sjH/WB5lcD32ROk1YjHqOeojcAr8yrzkoD3l/OBWy4SXt/JBZWjXR2u6b?= =?utf-8?q?Zh21xhwbx8PSd/uIufUL5XoxgAhtCgusoM0UKA0jKwoEws3jql2H+mF/OWHmXWzc6?= =?utf-8?q?9raBOpNAd5Gz5Ni88NBxekRJ/+8gc3Wqz9P69UXXAOxv6cVgmSPae6+zz5kO9HCUd?= =?utf-8?q?9bjKeZGQsA6fziG4BhIAaSsxJQGvbwQsJaNkaIoHW7x1C+DwQlrUu0ud4jVsIlxuq?= =?utf-8?q?Cz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?q?XO/yuagsnEr7YY/3B1XCHDE3AQHE0SueQjmsC1PAH+uMP27lcQkSV0YJPF9SwkjbF?= =?utf-8?q?x5UqDOovvA/HS/iJ3OPs8YJTDiiSftaszIsj1/ThGXg4wnELT7VBMJtkEt9g2S1P4?= =?utf-8?q?pmwHvwxQ9Ty4ECBAtRS30EbLo4pFd6AzU9UBvm+BW4HUf/saiEyT9E=3D?= Content-ID: <442FA0F2D6093244B25BE6581A00D7DB@DEUP281.PROD.OUTLOOK.COM> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-OriginatorOrg: iris-sensing.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: FR0P281MB2809.DEUP281.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: c57beb85-e4f7-417a-fb6f-08dcf42f2d2f X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2024 13:24:23.7987 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 963f3913-ffae-43fd-856b-2dfd3f6604e3 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CgSYf+cv30iEJX8OHJAVmlksql14P0f9N40iqWZWNBAczRSIgMoKH3hfrrK5vUWktqZJPT75AEJ8YiA291QUvNBzUK63EnBS5WWI9TX29KReifnZqYelucxwIr5YiLCR X-MS-Exchange-Transport-CrossTenantHeadersStamped: FR4P281MB3493 X-Patchwork-Delegate: kuba@kernel.org Like the DP83826, the DP83825 can also be configured as an RMII master or slave via a control register. The existing function responsible for this configuration is renamed to a general dp8382x function. The DP83825 only supports RMII so nothing more needs to be configured. With this change, the dp83822_driver list is reorganized according to the device name. Signed-off-by: Erik Schumacher Reviewed-by: Andrew Lunn --- Note: This could probably extended to cover the DP83822 aswell as the configuration register bit is identical. But I have no DP83822 to test and because the DP83822 does support MII and RGMII, I can't rule out any side effects. drivers/net/phy/dp83822.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index fc247f479257..915a34da04da 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -506,7 +506,7 @@ static int dp83822_config_init(struct phy_device *phydev) return dp83822_config_wol(phydev, &dp83822->wol); } -static int dp83826_config_rmii_mode(struct phy_device *phydev) +static int dp8382x_config_rmii_mode(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; const char *of_val; @@ -544,7 +544,7 @@ static int dp83826_config_init(struct phy_device *phydev) if (ret) return ret; - ret = dp83826_config_rmii_mode(phydev); + ret = dp8382x_config_rmii_mode(phydev); if (ret) return ret; } else { @@ -585,9 +585,14 @@ static int dp83826_config_init(struct phy_device *phydev) return dp83822_config_wol(phydev, &dp83822->wol); } -static int dp8382x_config_init(struct phy_device *phydev) +static int dp83825_config_init(struct phy_device *phydev) { struct dp83822_private *dp83822 = phydev->priv; + int ret; + + ret = dp8382x_config_rmii_mode(phydev); + if (ret) + return ret; return dp83822_config_wol(phydev, &dp83822->wol); } @@ -782,14 +787,14 @@ static int dp83822_resume(struct phy_device *phydev) .resume = dp83822_resume, \ } -#define DP83826_PHY_DRIVER(_id, _name) \ +#define DP83825_PHY_DRIVER(_id, _name) \ { \ PHY_ID_MATCH_MODEL(_id), \ .name = (_name), \ /* PHY_BASIC_FEATURES */ \ - .probe = dp83826_probe, \ + .probe = dp8382x_probe, \ .soft_reset = dp83822_phy_reset, \ - .config_init = dp83826_config_init, \ + .config_init = dp83825_config_init, \ .get_wol = dp83822_get_wol, \ .set_wol = dp83822_set_wol, \ .config_intr = dp83822_config_intr, \ @@ -798,14 +803,14 @@ static int dp83822_resume(struct phy_device *phydev) .resume = dp83822_resume, \ } -#define DP8382X_PHY_DRIVER(_id, _name) \ +#define DP83826_PHY_DRIVER(_id, _name) \ { \ PHY_ID_MATCH_MODEL(_id), \ .name = (_name), \ /* PHY_BASIC_FEATURES */ \ - .probe = dp8382x_probe, \ + .probe = dp83826_probe, \ .soft_reset = dp83822_phy_reset, \ - .config_init = dp8382x_config_init, \ + .config_init = dp83826_config_init, \ .get_wol = dp83822_get_wol, \ .set_wol = dp83822_set_wol, \ .config_intr = dp83822_config_intr, \ @@ -816,12 +821,12 @@ static int dp83822_resume(struct phy_device *phydev) static struct phy_driver dp83822_driver[] = { DP83822_PHY_DRIVER(DP83822_PHY_ID, "TI DP83822"), - DP8382X_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"), + DP83825_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"), + DP83825_PHY_DRIVER(DP83825S_PHY_ID, "TI DP83825S"), + DP83825_PHY_DRIVER(DP83825CM_PHY_ID, "TI DP83825M"), + DP83825_PHY_DRIVER(DP83825CS_PHY_ID, "TI DP83825CS"), DP83826_PHY_DRIVER(DP83826C_PHY_ID, "TI DP83826C"), DP83826_PHY_DRIVER(DP83826NC_PHY_ID, "TI DP83826NC"), - DP8382X_PHY_DRIVER(DP83825S_PHY_ID, "TI DP83825S"), - DP8382X_PHY_DRIVER(DP83825CM_PHY_ID, "TI DP83825M"), - DP8382X_PHY_DRIVER(DP83825CS_PHY_ID, "TI DP83825CS"), }; module_phy_driver(dp83822_driver);