From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDAB83E49F3 for ; Tue, 6 Oct 2026 20:24:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791318247; cv=none; b=Nc03QZcFBM7+ANtm+dI21+Go7oBJD7qUFmFvQFYuy0Qs/aJR/p/tk9ZQXXOPHQTiZlAikbGf/UrETAtG0qwq60mqvoG7WyiQQVfQBotKSCkcAOUkwkQE92Xh3VgPtxZ17NIBJ10c2BjVckOVnNUVQjcQmBcQeuOK5Xo6FU2brvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791318247; c=relaxed/simple; bh=J/Lu3OQHoMqX8RH8EGFYizmZvLr2h7FE3KKLVrxf3hc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fZOlL4GViGBG6TZ6doyZLsEyNnIpKKjMeL6oS3GDfDUTvS02Rm9Ny9Z802WbwEa6ulc5jMH/Z5sERD7mZWQi/i8U8BDCw68itSsSCdKQ5cjg5S7gqmkNGgyrSwsnEyy1sBzWtS09tVneQsu0Fzt8jVMw5IWizzaaDe+X4jpZC70= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kCu7T9N1; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kCu7T9N1" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-381b831d535so3268156a91.0 for ; Tue, 06 Oct 2026 13:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791318245; x=1791923045; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GLwYfTdXyDPQuumFFWIFzFC4aHDNR/bZf79M03BhnEQ=; b=kCu7T9N1bughVeXg5leC6PEpd5NAjtFCuC4CTwp8Dqvr7Desnq4e7cCGw1oSBD0ypf sVjeRmSIWzZVGclHGHex7y3oF7t8swiamyTJgGpERk2c2A31uez54OoWjU3Cyt2R00tQ SDcxOTF2I9ONMEM3o8Z7yRkYiaeBJhe3iK2qiI9/iNg4GfOZILCv2wnCKERNpZ6U3OfR J3N0uRq8/bzgDi168C5jQ+hoSG8iRU/KrFPb42MUWZ+mjeNVydwGFuosgAIV65XqJddh ZBcDayOma2HQVRmDWwS3ZS1TyCN/I0A8xikxUxEHJPNpBgquLAW/HaffTvYxA2Q4VIjH O9Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791318245; x=1791923045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=GLwYfTdXyDPQuumFFWIFzFC4aHDNR/bZf79M03BhnEQ=; b=N7K9pt2fsCOJXEY5fUKaWpzfr+zQwQC2zurWjDwtTSTqJ3hca7rUwQPW1S46gzCqfD bsM80LXwu7cGk8XsSVdbi+bKpqc92lj7SLwLu2NyL/2cSgMmvOFksjZx8Epd3UEV9T1S pUjG9mc44XumiLAw9i/PCRNTUj4ZwaZjtY8zIwLnTpCx2k+nxOVPErtLpVF8lmT1LOiX gXFZtsEme4Bj8UlyZml6vB1kOLzRLf+Ulh9maTaAd5OvjIk5LuJz4ECE+X1peWJOaBNU YfbVqZrTEFioCzPw4N38T2r7bNZCH3YXRgp56VB0wZIKzXHlpyJYOPLPn/dfIEJxTxSy jgxQ== X-Forwarded-Encrypted: i=1; AKwUvBxLPQKVG+sFU2n6B1eAp1zc9zRSSiy2TX1wa3iYO7S7HsVQG+vFGy3anWa+w0bJXOgzADVZkFH4/pK02DQ=@vger.kernel.org X-Gm-Message-State: AFq9FYIkidfFCIq0IKDg5PHPetEMvqzdYuFpucMixo0QvLLB8sQ+CZI8 9+GeWJ4Rhw5M2JVYybnnqBymkL1MPWUM9WgidJWZLkY3by/d8iRd4JLy X-Gm-Gg: AYBFou0VKlWZh2lA1naTqqHz34PTPgGbDRrAuQx/fJFZOAqpMpWAk4hZqPZl3QObmSu GvcCZcuEH3QCizAaZ4rC0IpOnhNcUaObNjUvZhOMqZEzTBcx/StqGCCNJNX4sMsiYS4Q5oN7Z5E hqQ6vXRb1nV9qfipnsEefRx1Vegwh0FT7/c4MbFefBBf+MBQIfXeUpEvmRNHYevQne1uu+Gl2NE y8mO9aH2KTBnesc1bIry7/YwT5Su3Moz5jQ+juwOlrsYWvb1WRC6vYr75ZzMWyjzmfuJhDL49SZ s/bLWiZRQSSSh60BddxSyQVjkSVK9WddnOm4e0WzZrH/yQACq+5fesd2Ns3yS/dSTMaKS93AieD VLkNKJ3ag5tUgsM2ubes0u3dE9ulBxGs9zVydZ4HJ0fRS/RvoyN0or8rxCf0uiwwaqHqqJ+LLCb 3Dizsj5Cz+HQq9qdg7+wH58QTr01NoxGMbtWg3acs6QCcdrB/zUewpf0utchruY4rWO9Jy7EYjT v2DrLkHYgRyw8zQAMkU9l4ZXg== X-Received: by 2002:a17:90b:3943:b0:3a8:2c7e:8986 with SMTP id 98e67ed59e1d1-3a8a17f9e4cmr270135a91.17.1791318245012; Tue, 06 Oct 2026 13:24:05 -0700 (PDT) Received: from d.home.yangfl.dn42 ([2a09:bac5:661c:1246::1d2:d1]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cd0a92da735sm383218a12.17.2026.10.06.13.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2026 13:24:03 -0700 (PDT) From: David Yang To: netdev@vger.kernel.org Cc: David Yang , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Frank , linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 1/2] net: phy: motorcomm: Add driver entry for internal YT861x PHYs Date: Wed, 7 Oct 2026 04:23:47 +0800 Message-ID: <20261006202352.1616626-2-mmyangfl@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261006202352.1616626-1-mmyangfl@gmail.com> References: <20261006202352.1616626-1-mmyangfl@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The YT921x switches integrate GbE PHYs of the YT861x family on the switch-internal MDIO bus exposed by the yt921x DSA driver. Without a specific driver they bind to the generic PHY driver. Add a driver entry for them. The PHY ID 0x01e04281 is live captured from the switch-internal MDIO bus. The switch SerDes PCS does follow the pattern, 0x4f51e899, though. Auto sleep can be disabled with the "motorcomm,auto-sleep-disabled" device property, as with the other Motorcomm PHYs. Signed-off-by: David Yang --- drivers/net/phy/Kconfig | 3 ++- drivers/net/phy/motorcomm.c | 38 +++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index d3835597e379..30e9d22c8d1a 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig @@ -363,7 +363,8 @@ config MOTORCOMM_PHY tristate "Motorcomm PHYs" help Enables support for Motorcomm network PHYs. - Currently supports YT85xx Gigabit Ethernet PHYs. + Currently supports YT85xx Gigabit Ethernet PHYs, YT861x PHYs + integrated in YT921x switches, and YT8821 2.5Gbps PHYs. config NATIONAL_PHY tristate "National Semiconductor PHYs" diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c index 90a4f86f2758..3ebd911f4400 100644 --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0+ /* - * Motorcomm 8511/8521/8522/8531/8531S/8821 PHY driver. + * Motorcomm 8511/8521/8522/8531/8531S/861x/8821 PHY driver. * * Author: Peter Geis * Author: Frank @@ -18,6 +18,8 @@ #define PHY_ID_YT8522 0x4f51e928 #define PHY_ID_YT8531 0x4f51e91b #define PHY_ID_YT8531S 0x4f51e91a +/* Live captured from YT921x switch internal MDIO bus */ +#define PHY_ID_INT861X 0x01e04281 #define PHY_ID_YT8821 0x4f51ea19 /* YT8521/YT8531S/YT8821 Register Overview * UTP Register space | FIBER Register space @@ -2538,6 +2540,29 @@ static int yt8521_get_features(struct phy_device *phydev) return ret; } +/** + * yt861x_config_init() - apply the auto sleep setting to the PHY + * @phydev: a pointer to a &struct phy_device + * + * Auto sleep is enabled by default and a BMCR soft reset does not restore it, + * so apply the setting from config_init. It can be disabled with the + * "motorcomm,auto-sleep-disabled" device property. + * + * Returns: 0 or negative errno code + */ +static int yt861x_config_init(struct phy_device *phydev) +{ + bool sleep; + + sleep = !device_property_read_bool(&phydev->mdio.dev, + "motorcomm,auto-sleep-disabled"); + + return ytphy_modify_ext_with_lock(phydev, + YT8521_EXTREG_SLEEP_CONTROL1_REG, + YT8521_ESC1R_SLEEP_SW, + sleep ? YT8521_ESC1R_SLEEP_SW : 0); +} + /** * yt8821_get_features - read mmd register to get 2.5G capability * @phydev: target phy_device struct @@ -3173,6 +3198,14 @@ static struct phy_driver motorcomm_phy_drvs[] = { .suspend = yt8521_suspend, .resume = yt8521_resume, }, + { + PHY_ID_MATCH_EXACT(PHY_ID_INT861X), + .name = "Internal YT861x Gigabit Ethernet", + .config_init = yt861x_config_init, + .soft_reset = genphy_soft_reset, + .suspend = genphy_suspend, + .resume = genphy_resume, + }, { PHY_ID_MATCH_EXACT(PHY_ID_YT8821), .name = "YT8821 2.5Gbps PHY", @@ -3194,7 +3227,7 @@ static struct phy_driver motorcomm_phy_drvs[] = { module_phy_driver(motorcomm_phy_drvs); -MODULE_DESCRIPTION("Motorcomm 8511/8521/8531/8531S/8821 PHY driver"); +MODULE_DESCRIPTION("Motorcomm 8511/8521/8531/8531S/861x/8821 PHY driver"); MODULE_AUTHOR("Peter Geis"); MODULE_AUTHOR("Frank"); MODULE_LICENSE("GPL"); @@ -3205,6 +3238,7 @@ static const struct mdio_device_id __maybe_unused motorcomm_tbl[] = { { PHY_ID_MATCH_EXACT(PHY_ID_YT8522) }, { PHY_ID_MATCH_EXACT(PHY_ID_YT8531) }, { PHY_ID_MATCH_EXACT(PHY_ID_YT8531S) }, + { PHY_ID_MATCH_EXACT(PHY_ID_INT861X) }, { PHY_ID_MATCH_EXACT(PHY_ID_YT8821) }, { /* sentinel */ } }; -- 2.53.0