From patchwork Fri Jul 15 21:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Anderson X-Patchwork-Id: 12919833 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 B7111C433EF for ; Fri, 15 Jul 2022 22:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id: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=/gmUyrVHuR0D5OJIg3aek1utwjZpATRnACyBORTHF9g=; b=Kwfhm9W5fdZ8Lr 33jYwtuBFRMUeDAoJ55v9eHfFHmx3wDm6ZhqNRVTvytKF9eZbb8YywcyYtDv7+04Io2dBlAV2YxHm 8OLigELMA4choiK02AVdtgTV+GhH2NnGFBquvFaNQC0rewK51vq15D/Tk04SrLbj7MSIwyJ0ZT+Os vNZ3EXouTZLtPFIuSGdPv5s0EMsL9d3YGrhyIfmOckyYbYDq+UFVdcL+7kxk9nij8msdHJypjVA12 HYoT+9gwSNSwMPdMBmTpjbM6BuN+jzY3CV32I+v9JEWc3D+QVb9+YE2BhARu55sXPEXJ903OLBs7i qOj3yPW5c1Ddop2iHlhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTTn-00AeMQ-0t; Fri, 15 Jul 2022 22:08:11 +0000 Received: from mail-eopbgr50063.outbound.protection.outlook.com ([40.107.5.63] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCTMb-00Ab8A-Lj for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2022 22:00:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h+whvttEnfaYbZaOyzuobw6cS0ScGbZkqRK+Qa4v0V2klq1pyxDmurpy0Bhh3CpegZS2rPSFD5tA6t5ZgfCF4l0iSnWAd6hVw7x0QEuRPboCrnso31fNyq6K+GJfMYfm+/oNDc5jmNCW4gQHoFb0MKFnpWrUKy27DnZo4jEf1mxFCgLN0jKVb2KJzHBEW0/hGH4iYGCTFxefbUiUayi1/A6So2h6trwWI9Ev9Kulky0yZtCpLlvrSsmHWSwfag9h0WNxcvDsjzYjNsXarVrEFSfai68o6pVUe6jxLM9WMBFFdA9gfvHR6ENLXp6vY2JqZoWq2vUBtFot+zOJo8lQ+Q== 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=ALy1Mp8Kayet9h3WO5ALQ+i8lgiqf6yX3kfdI7pNkVM=; b=mU1yJaFM0SI8Nrw/w2AJij79OYjrK4D2a2Z0+vj9sozwGr1cfENOvwcwR4btFKn6S91GVmbfWC7AjUdc5LJGDfAkoMUZZR3qRvscexvfUSVNcSxq3tLDS0aFgiDe44q7AucxvVV6uxCDUGQeRvILyVYzIR9V28okocKb47YshXoZGhkWD2bK2xecuVOwzVNU7hfmFI74D3pw70wN0tvmSvQRzMYr585VX0V04iXskuLE7PmuC257gMZYiLz3fWRMk0aGcv2fziyEqDOIzfaHyzC2iKYaw7T6nPDoKtjR4FpkxumcV+Cr9HWQGXzydID4CpJpQoRzjtMs1ZS41WJFvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=seco.com; dmarc=pass action=none header.from=seco.com; dkim=pass header.d=seco.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seco.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ALy1Mp8Kayet9h3WO5ALQ+i8lgiqf6yX3kfdI7pNkVM=; b=zTVZAGxfgekrftN8Y4QkJXXOn4aid/Zfr9a1+D2rz99aRY84M3mVnqV0UDXkGPtbr33HSJnqclwzSUmdZhGJXVw1Gn6/yJkd/rFYCetTQYv7aAIlYV+FvxLCf6M+3VQ+z1OlIWbbezwK6PQfljfaoGBc7vEgR+Gdgwhn3tyXm1u2yz0KYyOd3dzYk8MmBrhywlIGyBm22RM6XcBESPbWn6e+XVofmzlN/+VM/ecZ5UmGsW0BsDJRToRnNPWVIJNWmd4fpEYQuTXjtI69B9EyKAUD0682L9UR+GDgBa4T6EPpoee+ZTjc5TtOnhqbsMwM8ycPVuEuAidUFzEDiFthUQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=seco.com; Received: from VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) by DU0PR03MB8598.eurprd03.prod.outlook.com (2603:10a6:10:3e5::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15; Fri, 15 Jul 2022 22:00:41 +0000 Received: from VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558]) by VI1PR03MB4973.eurprd03.prod.outlook.com ([fe80::5c3e:4e46:703b:8558%7]) with mapi id 15.20.5438.015; Fri, 15 Jul 2022 22:00:41 +0000 From: Sean Anderson To: "David S . Miller" , Jakub Kicinski , Madalin Bucur , netdev@vger.kernel.org Cc: Paolo Abeni , Eric Dumazet , linux-arm-kernel@lists.infradead.org, Russell King , linux-kernel@vger.kernel.org, Sean Anderson , Alexandru Marginean , Andrew Lunn , Heiner Kallweit , Vladimir Oltean Subject: [PATCH net-next v3 12/47] net: phy: aquantia: Add support for AQR115 Date: Fri, 15 Jul 2022 17:59:19 -0400 Message-Id: <20220715215954.1449214-13-sean.anderson@seco.com> X-Mailer: git-send-email 2.35.1.1320.gc452695387.dirty In-Reply-To: <20220715215954.1449214-1-sean.anderson@seco.com> References: <20220715215954.1449214-1-sean.anderson@seco.com> X-ClientProxiedBy: CH2PR10CA0009.namprd10.prod.outlook.com (2603:10b6:610:4c::19) To VI1PR03MB4973.eurprd03.prod.outlook.com (2603:10a6:803:c5::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 790f4b5e-80f6-4374-9feb-08da66ad7573 X-MS-TrafficTypeDiagnostic: DU0PR03MB8598:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2pLrehLdgPvopI7ozN3gHWmfycUZyjEExrlrNmP6FQtxZ3c36hrmy/Fh/Qg+t4w4DvolcpVRozENzaw54F6v2dRdZcyZEd2cq0q9G4U9F5gUaQ0QTpjcdbFhRBTp2FuS4hOcAJcKMtB0yIn2cMVXUd2KPVlySDUZXb9cQ2BnBAsBwlZ2QAcerb52ANSNbH8DqARHNA1M4aqfL8t1blatuNMgM8m9yN2t89uBIEfJapvhxzfggmITsLt2bx4OLQd70e2xh+yTKtdqkHitkrsbG0DwG8/r2nCNubdMllYow2JyAQ/xhN0rspLQNQBao+eJAbv0UExYk+tceagvMPb79b6wWLjiU6UJomdT+XaMZ7rK+o9hICVUQsNSuXC9/6hX/fyi4z5uCq8T+YlesFwOaIapHO6Rxt477EuL3l2wqx1hNBXOjuTRTggOchqo8Wb+oywmPKkZT9habXWTmK+8fM8EmDmqmGTPDr9H0tWjT3rG7iNHXIk+sNtBVgt+/d/DiPz4P3kmyao5hzrgVdKAHtVrrNR8haERgPKU9LfU+XWQQ4ExDnSw10IGvRzLV7HKc5Z3iDzc7MGGgczujqcwtgFWafdCveZ5rga/vZYFquI9tEZqAQM+ojB14n+f67QLDeW8+uLNskFTAzJLb7kSyIuu30DQa8qlO5x8IIMaPSjsbtkGLEUwI4xKgRQE3iPt8cMbXFcOSYPxDCG6oZi05E1y8x9vRk9K/Bgtc9v+2XO0/mxbl2z/4GziztzpCwnKsoJMQZgH02+u6MsH5l9mT9WL5S+NcNDjdAzehTgLxkPl7Ioo8V8rpVYgYDE/1EHF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR03MB4973.eurprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(136003)(366004)(39850400004)(376002)(346002)(396003)(5660300002)(8936002)(44832011)(7416002)(2906002)(54906003)(66556008)(4326008)(8676002)(66476007)(66946007)(110136005)(86362001)(316002)(186003)(2616005)(26005)(38350700002)(52116002)(36756003)(6666004)(41300700001)(478600001)(6486002)(1076003)(6506007)(83380400001)(6512007)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ElS4Ew3G/40Tl9xpIwmUIZV5BEGAbk4jXzOD+ETn7ACm9XoaZRrDsrDyfpzGJa+htZWHyCbUEWoFfIsta62iINM7wS0djJlFusuQqxcgiWtvEKIMn08GXTX4OLzlB+i/yQdQYnDvwZkd5WI+8keMKfUErMg8xM74wMRjBkiUqzfgWf/FsCp0FMFC8IGAzIMcUQorwi2rSWtlBqSdDWHzu576/CYd104cZHG7XcM64Try63Gfm4Ays71FohrCO1zHnwvqKkM4jAflCmMjnFVNmA/0BeJmjK/S13cKV8otc5WfMiktYZ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3bW0yG9T6rbv/2+eMBXhXWheoV2KBsP4ucoSiSBjcOv8+uPfAg528IoGpkgIweUh5DRM+ikCcSkD3xlY1Tvb7EROYt4eSw2cL2pUYOLUrPLWEK4P31FDzZy/mLzr2WzP4TEc3Qqco+S8Tl/S1jkG44JcIkJUSih+K9e5hvF2stEZgNYWuT+UjoUlbpPiyNF3l+JkAR7EYVQALo1mQ5SwIPmktZg== X-OriginatorOrg: seco.com X-MS-Exchange-CrossTenant-Network-Message-Id: 790f4b5e-80f6-4374-9feb-08da66ad7573 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4973.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jul 2022 22:00:41.3171 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bebe97c3-6438-442e-ade3-ff17aa50e733 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W9eGMRjd6PbrEeicipkCs5W16HANeRvKPNoAdgXJQjwyKMeis0bwOC+DYdpogCiVBKF7wluldZf/srCp2urvFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR03MB8598 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_150045_787542_571A0279 X-CRM114-Status: GOOD ( 18.65 ) 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 This adds support for the AQR115 (which I have on my LS1046A RDB). I had a quick look over the registers, and it seems to be compatible with the AQR107. I couldn't find this oui anywhere, but that's what I have on my board. It's possible that NXP used a substitute here; I can't confirm the part number since there is a heatsink on top of the phy. To avoid breaking <10G ethernet on the LS1046ARDB, we must add this vendor id as an exception to dpaa_phy_init. This will be removed once the DPAA driver is converted to phylink. Signed-off-by: Sean Anderson Reviewed-by: Andrew Lunn --- Changes in v3: - New .../net/ethernet/freescale/dpaa/dpaa_eth.c | 6 +++++- drivers/net/phy/aquantia_main.c | 20 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 45634579adb6..a770bab4d1ed 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2886,6 +2886,7 @@ static void dpaa_adjust_link(struct net_device *net_dev) /* The Aquantia PHYs are capable of performing rate adaptation */ #define PHY_VEND_AQUANTIA 0x03a1b400 +#define PHY_VEND_AQUANTIA2 0x31c31c00 static int dpaa_phy_init(struct net_device *net_dev) { @@ -2893,6 +2894,7 @@ static int dpaa_phy_init(struct net_device *net_dev) struct mac_device *mac_dev; struct phy_device *phy_dev; struct dpaa_priv *priv; + u32 phy_vendor; priv = netdev_priv(net_dev); mac_dev = priv->mac_dev; @@ -2905,9 +2907,11 @@ static int dpaa_phy_init(struct net_device *net_dev) return -ENODEV; } + phy_vendor = phy_dev->drv->phy_id & GENMASK(31, 10); /* Unless the PHY is capable of rate adaptation */ if (mac_dev->phy_if != PHY_INTERFACE_MODE_XGMII || - ((phy_dev->drv->phy_id & GENMASK(31, 10)) != PHY_VEND_AQUANTIA)) { + (phy_vendor != PHY_VEND_AQUANTIA && + phy_vendor != PHY_VEND_AQUANTIA2)) { /* remove any features not supported by the controller */ ethtool_convert_legacy_u32_to_link_mode(mask, mac_dev->if_support); diff --git a/drivers/net/phy/aquantia_main.c b/drivers/net/phy/aquantia_main.c index 8b7a46db30e0..f9e2d20d0ec5 100644 --- a/drivers/net/phy/aquantia_main.c +++ b/drivers/net/phy/aquantia_main.c @@ -21,6 +21,7 @@ #define PHY_ID_AQR106 0x03a1b4d0 #define PHY_ID_AQR107 0x03a1b4e0 #define PHY_ID_AQCS109 0x03a1b5c2 +#define PHY_ID_AQR115 0x31c31c12 #define PHY_ID_AQR405 0x03a1b4b0 #define PHY_ID_AQR113C 0x31c31c12 @@ -672,6 +673,24 @@ static struct phy_driver aqr_driver[] = { .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, }, +{ + PHY_ID_MATCH_MODEL(PHY_ID_AQR115), + .name = "Aquantia AQR115", + .probe = aqr107_probe, + .config_init = aqr107_config_init, + .config_aneg = aqr_config_aneg, + .config_intr = aqr_config_intr, + .handle_interrupt = aqr_handle_interrupt, + .read_status = aqr107_read_status, + .get_tunable = aqr107_get_tunable, + .set_tunable = aqr107_set_tunable, + .suspend = aqr107_suspend, + .resume = aqr107_resume, + .get_sset_count = aqr107_get_sset_count, + .get_strings = aqr107_get_strings, + .get_stats = aqr107_get_stats, + .link_change_notify = aqr107_link_change_notify, +}, { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109), .name = "Aquantia AQCS109", @@ -726,6 +745,7 @@ static struct mdio_device_id __maybe_unused aqr_tbl[] = { { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) }, + { PHY_ID_MATCH_MODEL(PHY_ID_AQR115) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },