From patchwork Tue Feb 13 18:24:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 200549 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp727817dyb; Tue, 13 Feb 2024 10:26:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1Ko9aswYAd+5iulsOgLwdEZwsSjlImJd4pkeYowtiY1g4QdGdOBWxacZVsKP5JsYxmKo61pEZr6NX1XHHk+Rlj00ziw== X-Google-Smtp-Source: AGHT+IHM3D+RmH6xp9fzqpyNJyln+p8jeRjseRWllXfWx5LRZM/EuEv61NBNu2hUQKotTTBTJYTd X-Received: by 2002:a17:907:1189:b0:a3d:f94:ebe2 with SMTP id uz9-20020a170907118900b00a3d0f94ebe2mr106762ejb.76.1707848764693; Tue, 13 Feb 2024 10:26:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707848764; cv=pass; d=google.com; s=arc-20160816; b=UsSjDH10BBgohisNJbH7tIo53DPhvfmEwtEiTnXGFKFmRGj12LTtlGfSMRqEtsmHma eExVBKifi0+tR/551KAeMjU1WZs1gM5InYtCUdTVrgsrtSk7PqM1V74cQZXT9RcEoMAX 768TyIIIdBlyT9TQWjGx6eMV8RWacAbEKdkZk3Myo12LzUqt1Crupq0+yau+qKsEYFtt Cljyig/s5CVF+Vv2Lf9pYnyhb6h2ihNDqlbjW0soN+Tsv1NFZPjGOP9eB29sQW4U4GJh ODSHoOZ60bbQIK8irncdBdq7iTfLgcIGIlsy6GQLiclOoAqega6qlvKC2tC07uPEiXjQ xVWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=jGnOlkHlcmiaaGm8mpXRkLoxVLEhp4gbuwkrUsWlruk=; fh=yRoOfmEjSzk73tn1UlIp9NsvblYbm6Z3e0nmqU4f8uQ=; b=Q0VpQ4wbaQMKK/3IiklCXTcH/cwZCrzAxB1q+clI0ZrJrSsYoLGyAzsiNxfA2yhNEW rp652T+kIBGo7p3JSY9j83M1o7mqqjpkEVrd7v8iPKB/X6nkdR7X4sfxcGIiPCbOIweL /3qriTFpGuXkUtI48uwa0PUx1iCni4izaW2sG5/CEBG0pb9nDDTNaP/8MwF3RMOZq7d0 wqkzP1U6rEYjKfqD1RDm/XA9dYUgbEO0FJDXMb4OJqCZJEZB40IpqkZj6RM5NLeOGin9 YRk55GJ9K0r4SAdQ3FSvxEZSrtatmBzVif3x1c/QZm7ZOxPEME5EWJEIBnEyT6G8cA4T vWAA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iVCpOeOJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-64074-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64074-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXCTVtmbiq6PVzVAKT7lvdn86je5ZU86O7+NSdzz4sjyXLTt+jPYFoQbjJhHPvIo9cl8rnA+TgoadNgWuByhCnllHBeBA== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id s5-20020a170906c30500b00a381d7baa84si1478566ejz.434.2024.02.13.10.26.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:26:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64074-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iVCpOeOJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-64074-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64074-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 233E11F23810 for ; Tue, 13 Feb 2024 18:26:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5CD8860BBB; Tue, 13 Feb 2024 18:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iVCpOeOJ" Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 B668F605BF; Tue, 13 Feb 2024 18:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707848683; cv=none; b=FK3WZ2idIAVDQjtU/UYdN9i+S/DzFMDQ1zOcUmCgLPC4IWsr78wID1MggacrBR50lcrFzgmxc3Cmj6GEEaz8ly8M17erUVOJHg2mklfYJ8Y30hqwStz6ox7PqKTNdY9R+UEC/rwDYMB2t4NocQJfshIB7QSzTeWdua5mGTNMm6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707848683; c=relaxed/simple; bh=z7yc8ubB/vZV64kloK8lXbtup7nKhGNU94YCpHImetg=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ieRb6eNbmsrdwwJLV69mPDrjJssw4VFuLNSmfvCNGH925Wa4R7fm1TzHX6AfeBI+5vD8rWyg0BlzePwJxU80E0mAMShdczQ+gZp7LW6+SCsV8kbegUXB7CI8PMCOoXUTR4Rzm2l9AKnWgSKG9k/M/ftza0iGauF8lfSJnu1F5Ig= 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=iVCpOeOJ; arc=none smtp.client-ip=209.85.221.43 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 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-33cd57b7eabso585120f8f.2; Tue, 13 Feb 2024 10:24:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707848680; x=1708453480; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=jGnOlkHlcmiaaGm8mpXRkLoxVLEhp4gbuwkrUsWlruk=; b=iVCpOeOJYnI/p7IFPzQsd5G3fJL4DyyAGTAamclqW1LinrpW3cSzjlpArQzni5vzS2 h4mqGalVGk1LoDvN64e4FzxWJkzutjZCRzqMN34vJDqvIGYCqTqtx7Gr3O8DYpaHLiq6 G/WOKsuVitfmzW7tGfnivMtlRh1p288hn1pyW6YurRe26pIiB49aB7m+Zv6jREOYrF3Z 0IkiW5mG+EqOBu1yDizgu0QrtCgVk6qpT29/84Lw2AYEmBMf3vu73O8JB3fL9xhg4X1X 2Zum84kn9G7eZC01BzeTOrtxZWyi4rM7j0MbxQrKs9RNHyW+LrSadPl1EL0J5yRlhCyb V4nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707848680; x=1708453480; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jGnOlkHlcmiaaGm8mpXRkLoxVLEhp4gbuwkrUsWlruk=; b=J8gAUG4sdrJsGZsSPNCTDzxf8piOnwV3LL/A/2hLNGEnCrkE8IB6lObt3LG53pu9Q5 +LvN0qgm0SSup+OQsiOJtAegiIWV+Cxndt3/Xw20tfd7ViHOPdwlqgR9i7SUI1zI0IHY KYF9jIW4cz1VoH2BCX4mqkBdmAMUKM1BQ0kIeP/gSkBniAiMh97iaLhql6z1ex1ACIp1 uUu836R+tmDnpEpyBOLHCkJzY92I3vZcFcGmknHJMu3NoYTETUMNp4xzHSdoPINEglRm VCReH7oYsAnU02H/t9XG76xPYK0XElmRZd5YkC4+/GB2y8rGT3XzXVlwPezVOJO4xJ2n GRjQ== X-Forwarded-Encrypted: i=1; AJvYcCV5e3PujxcMtsGBd/2fKzNUEYvUMuXCmASbpzgl/TOs+/hLFjsi++GNZdDpbP2fJZccxQNJR0aJ4jwQpIBgq0hV1j9n4ARgwRh2NwUo0Q4dudlozM6vl4uJ+57f306jVpmHqWDj X-Gm-Message-State: AOJu0Yxx/KmofxNKEKNSHfiFVRPvZCfZSke1wo/CBrG3X2W1b4fP8Fzy 0/nmXxAD+OTKPs4nf45fdQddNnVKPZqWndnA8hBULGO97rEO2tsl X-Received: by 2002:adf:f243:0:b0:33b:87a0:3af with SMTP id b3-20020adff243000000b0033b87a003afmr62711wrp.67.1707848679726; Tue, 13 Feb 2024 10:24:39 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU1xAdmbdWA6FIvaSei+6mwuYoMW2I5RHChPSEh5spao2QLXHAwer/qSSf0IIyzsAK9ySzRRrn33fogZLcxb6sULs1EVTvyvEd9YIvX4tvZh8gzTLx8KFccICeCLD4F37fz5+9UdGn1uEjjXUcCZWze13SbZGeYrCdlGKR6s3VXvi9w5hg/deNeYucSD7v7zUQ9+lgCDKa9HePMmpZUh/PveJgqPdrCb+Pookzq++VtsjeSFyOyO0Fmo1OAfoKLZDQUNWvvG2uVRnDIx2cPBHQSRFKrjwBeP84/GeU2fKgQ8O3e33xssNea4/Iwdg0S6TjLToolOaPf7NI05mHTyeJ9LQmlrgQTTjSYq5fE7mGAi5mG29WaqqAxfNEtCMS4XhhtEZydGn0= Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id bs25-20020a056000071900b0033b45bdb2a1sm10347974wrb.4.2024.02.13.10.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:24:39 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Marangi , Robert Marko , "Russell King (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next RFC PATCH 1/2] net: phy: aquantia: setup interface protocols for AQR112 Date: Tue, 13 Feb 2024 19:24:11 +0100 Message-ID: <20240213182415.17223-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213182415.17223-1-ansuelsmth@gmail.com> References: <20240213182415.17223-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790809226518409794 X-GMAIL-MSGID: 1790809226518409794 Aquantia Gen3 PHYs require additional regs to be set to correctly work and communicate with the MAC. For each rate, the startup rate needs to be set and the required global cfg needs to be set. The global cfg are per Rate and require different configuration based on the requested interface mode. Some FW might apply the correct values by default but some OEM might provide generic FW that require additional fixup at runtime as the FW doesn't correctly provison the PHY for the attached MAC interface mode. The default values are taken from various source and SDK and all use the same values for SGMII, 2500BASEX, 10GBASER and USXGMII. One common problem that this handle is case where the FW provision for 10BASER but USXGMII is actually requested, hance runtime fixup is required. Signed-off-by: Christian Marangi --- drivers/net/phy/aquantia/aquantia.h | 17 ++++ drivers/net/phy/aquantia/aquantia_main.c | 110 +++++++++++++++++++++++ 2 files changed, 127 insertions(+) diff --git a/drivers/net/phy/aquantia/aquantia.h b/drivers/net/phy/aquantia/aquantia.h index 1c19ae74ad2b..019528c536c7 100644 --- a/drivers/net/phy/aquantia/aquantia.h +++ b/drivers/net/phy/aquantia/aquantia.h @@ -39,6 +39,15 @@ #define VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA_MASK GENMASK(15, 0) #define VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA(x) FIELD_PREP(VEND1_GLOBAL_MAILBOX_INTERFACE6_LSW_DATA_MASK, (u16)(x)) +#define VEND1_GLOBAL_STARTUP_RATE 0x031a +#define VEND1_GLOBAL_STARTUP_RATE_MASK GENMASK(3, 0) +#define VEND1_GLOBAL_STARTUP_RATE_LOW_POWER 0 +#define VEND1_GLOBAL_STARTUP_RATE_100M 1 +#define VEND1_GLOBAL_STARTUP_RATE_1G 2 +#define VEND1_GLOBAL_STARTUP_RATE_10G 3 +#define VEND1_GLOBAL_STARTUP_RATE_2_5G 4 +#define VEND1_GLOBAL_STARTUP_RATE_5G 5 + /* The following registers all have similar layouts; first the registers... */ #define VEND1_GLOBAL_CFG_10M 0x0310 #define VEND1_GLOBAL_CFG_100M 0x031b @@ -52,6 +61,14 @@ #define VEND1_GLOBAL_CFG_SERDES_MODE_SGMII 3 #define VEND1_GLOBAL_CFG_SERDES_MODE_OCSGMII 4 #define VEND1_GLOBAL_CFG_SERDES_MODE_XFI5G 6 +/* Enable System Interface Autonegotiation */ +#define VEND1_GLOBAL_CFG_AUTONEG_EN BIT(3) +/* Enable System Interface Training */ +#define VEND1_GLOBAL_CFG_TRAINING_EN BIT(4) +/* Reset System Interface For Every Transition */ +#define VEND1_GLOBAL_CFG_RESET_ON_TRANSITION_EN BIT(5) +/* Keep SERDES Silent During Transition */ +#define VEND1_GLOBAL_CFG_SERDES_SILENCE_EN BIT(6) #define VEND1_GLOBAL_CFG_RATE_ADAPT GENMASK(8, 7) #define VEND1_GLOBAL_CFG_RATE_ADAPT_NONE 0 #define VEND1_GLOBAL_CFG_RATE_ADAPT_USX 1 diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c index 97a2fafa15ca..6ee1a134bc60 100644 --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -746,6 +746,114 @@ static int aqr107_probe(struct phy_device *phydev) return aqr_hwmon_probe(phydev); } +static int aqr112_setup_interface_protocols(struct phy_device *phydev) +{ + phy_interface_t iface = phydev->interface; + u16 startup_rate, global_cfg_val; + int i, ret; + + /* Default global cfg are taken from Aquantia UBoot Source and various + * source and all makes use of the following reference values. + */ + switch (iface) { + case PHY_INTERFACE_MODE_SGMII: + startup_rate = VEND1_GLOBAL_STARTUP_RATE_1G; + global_cfg_val = FIELD_PREP(VEND1_GLOBAL_CFG_SERDES_MODE, + VEND1_GLOBAL_CFG_SERDES_MODE_SGMII) | + VEND1_GLOBAL_CFG_AUTONEG_EN | + VEND1_GLOBAL_CFG_SERDES_SILENCE_EN; + break; + case PHY_INTERFACE_MODE_2500BASEX: + startup_rate = VEND1_GLOBAL_STARTUP_RATE_2_5G; + global_cfg_val = FIELD_PREP(VEND1_GLOBAL_CFG_SERDES_MODE, + VEND1_GLOBAL_CFG_SERDES_MODE_OCSGMII) | + VEND1_GLOBAL_CFG_SERDES_SILENCE_EN | + FIELD_PREP(VEND1_GLOBAL_CFG_RATE_ADAPT, + VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE); + break; + case PHY_INTERFACE_MODE_5GBASER: + startup_rate = VEND1_GLOBAL_STARTUP_RATE_5G; + global_cfg_val = FIELD_PREP(VEND1_GLOBAL_CFG_SERDES_MODE, + VEND1_GLOBAL_CFG_SERDES_MODE_XFI5G) | + FIELD_PREP(VEND1_GLOBAL_CFG_RATE_ADAPT, + VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE); + break; + case PHY_INTERFACE_MODE_10GBASER: + case PHY_INTERFACE_MODE_USXGMII: + startup_rate = VEND1_GLOBAL_STARTUP_RATE_10G; + global_cfg_val = FIELD_PREP(VEND1_GLOBAL_CFG_SERDES_MODE, + VEND1_GLOBAL_CFG_SERDES_MODE_XFI); + if (iface == PHY_INTERFACE_MODE_USXGMII) + global_cfg_val |= FIELD_PREP(VEND1_GLOBAL_CFG_RATE_ADAPT, + VEND1_GLOBAL_CFG_RATE_ADAPT_USX); + else + global_cfg_val |= FIELD_PREP(VEND1_GLOBAL_CFG_RATE_ADAPT, + VEND1_GLOBAL_CFG_RATE_ADAPT_PAUSE); + break; + default: + return -EINVAL; + } + + /* set PHY in low power mode so we can configure protocols */ + ret = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_SC, + VEND1_GLOBAL_SC_LOW_POWER); + if (ret) + return ret; + + /* Some dalay is needed to put the chip in low-power */ + mdelay(10); + + /* Setup the SERDES interface link startup rate */ + ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_STARTUP_RATE, + FIELD_PREP(VEND1_GLOBAL_STARTUP_RATE_MASK, startup_rate)); + if (ret) + return ret; + + /* Walk the media-speed configuration registers to setup host-side + * serdes modes that may be used by the PHY depending on the + * negotiated media speed. + */ + for (i = 0; i < ARRAY_SIZE(aqr_global_cfg_regs); i++) { + u16 reg = aqr_global_cfg_regs[i]; + int val; + + val = phy_read_mmd(phydev, MDIO_MMD_VEND1, reg); + if (val < 0) + return val; + + /* If global_cfg is 0, rate is not supported by FW */ + if (!val) + continue; + + ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, reg, + global_cfg_val); + if (ret) + return ret; + } + + /* set PHY out of low power mode */ + ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, VEND1_GLOBAL_SC, + VEND1_GLOBAL_SC_LOW_POWER); + if (ret) + return ret; + + /* Some dalay is needed to put the chip out of low-power */ + mdelay(10); + + return 0; +} + +static int aqr112_config_init(struct phy_device *phydev) +{ + int ret; + + ret = aqr112_setup_interface_protocols(phydev); + if (ret) + return ret; + + return aqr107_fill_interface_modes(phydev); +} + static struct phy_driver aqr_driver[] = { { PHY_ID_MATCH_MODEL(PHY_ID_AQ1202), @@ -831,6 +939,7 @@ static struct phy_driver aqr_driver[] = { PHY_ID_MATCH_MODEL(PHY_ID_AQR112), .name = "Aquantia AQR112", .probe = aqr107_probe, + .config_init = aqr112_config_init, .config_aneg = aqr_config_aneg, .config_intr = aqr_config_intr, .handle_interrupt = aqr_handle_interrupt, @@ -849,6 +958,7 @@ static struct phy_driver aqr_driver[] = { PHY_ID_MATCH_MODEL(PHY_ID_AQR412), .name = "Aquantia AQR412", .probe = aqr107_probe, + .config_init = aqr112_config_init, .config_aneg = aqr_config_aneg, .config_intr = aqr_config_intr, .handle_interrupt = aqr_handle_interrupt, From patchwork Tue Feb 13 18:24:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 200551 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp734061dyb; Tue, 13 Feb 2024 10:36:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVc+AOu22Gxuxeg6HkQV0V6n2Fn5b8P5YMakyadDRAxWn6dT5+skrAALCu+ypZLek05JfuR1w0wDcaXrffQGK2w60KUTg== X-Google-Smtp-Source: AGHT+IHBQmjFxpj4vsICElXwxzi6z4Ci7odRF9IAPo/ukHedUFArWcmi8eiBYBjaN/qOVg6qj/84 X-Received: by 2002:a17:902:e84f:b0:1d9:a15:615d with SMTP id t15-20020a170902e84f00b001d90a15615dmr386281plg.1.1707849405055; Tue, 13 Feb 2024 10:36:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707849405; cv=pass; d=google.com; s=arc-20160816; b=l5CkGWLYzDmd4KvPcFWiZESTVeP7cALOy+PZ6PytwArKNLJHvQFLnbbRtmaGxQUrOp 4MVzeHuN79vFXuiB+1PEV2fj0V67GY+2j/0Wkux2HKxDpX8b2UxF3MgUCX+ipTNCrfrm hZZXEt+a/mMr72tpjO/GlzzYKVSpomPp7ARs7X5I5dpfDfVI8SH0UhS4cwUCglMgz3BJ l4uxIX/dZGPJU8APdQtMkTc29xs+U5ncenz502m5W7CUAGKtCYDt8nKaVilmBnMRds11 WMJ+Kfx0uD6ZjMTDlgIVUIIeELCuZynNlIsXY/KsNQ30QgtjJ8e97xo93AFypWHn4wgb bCrg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=V4TjUgrrN8kUFZKa9YdsCe7iLr0TTloHFQfT8i4JwJA=; fh=2KOr5qL+DxspRvAarn3Fc31G3rQt//s3N/HWpulMa6o=; b=qa9IO6VqTf10TUsct+g+JTrdfyLfoiW/KQ2A+T6ttV/3bNCYyjmS+uN9ub3dDXUsC+ RL9+4/oUGbwMxUELkfC1/9bkUR+v+EVxDCKnGch1gk56888YjFXiqCYVwgrxskZLfI1b Bhc3LXXzx7Qf6PXKMQ+ojmFtLcsIQr789BuxMrSWLnMcsy4gh9JsdcsmuyKBNCSBeGBV feStJC/J2iQIgB5NKTeXtArRqvc3/Kw4weUNKaKu/wuYYXAddEwKwEI0aX9s3Z/RXg6/ WuM3nlRc1l5teL1n8NVJOJA5T449yIt6KkGUJ4icn46nyt6zooqkB0JwqRYPhUcjdhVq /qgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dxKpCBVI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-64075-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCXefuyXSlTNkzNl1sPcfhln+c46KTa8KDxbaZqreFuipIjGw6HqD6m26WKTQTGo0dCpf0V0vP1yp+92f0KvWVhYnkMtZA== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y15-20020a17090264cf00b001d9c3672033si1441573pli.597.2024.02.13.10.36.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:36:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-64075-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dxKpCBVI; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-64075-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-64075-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id CD12A28DA1B for ; Tue, 13 Feb 2024 18:26:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47FFB60BBA; Tue, 13 Feb 2024 18:24:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dxKpCBVI" Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 9702B605D7; Tue, 13 Feb 2024 18:24:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707848684; cv=none; b=VBaSb75ODnGuV6+0AzCjbbllJVOUGgzH4cGiyLPAM6SvQemjVv9KgoljLCHTXA/l/4xOV9/pM/02yCMjtqOixf9P90CquN9wMIKpT5xUColdjfMlNcbeJBZ3CG75mJTa2phBhdSrE3rTqWqyEF6WAjmMEeLjCmEAdmpO2D0Sw/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707848684; c=relaxed/simple; bh=fnTzBjLURMPPnnFwAqXvcee6LhO+VYPuwjsXSyZI66U=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vg240UNIot6h7gG+N2UM7NVBvcNBIUbjENz5IcDHZVFzP0tCQG1N2PKZApJW+bMU9Xr69rFM3/nwk3fKHQaxRXOqtTas0X/gmYqZorruGNFIVkfiPRlBvKoELE25nAWDHdUZ0p7IPcVSryJWHYNPy+L4N9rAMMV2HhcA+L+IrAw= 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=dxKpCBVI; arc=none smtp.client-ip=209.85.128.47 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 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-411c779ab2dso6087395e9.0; Tue, 13 Feb 2024 10:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707848681; x=1708453481; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=V4TjUgrrN8kUFZKa9YdsCe7iLr0TTloHFQfT8i4JwJA=; b=dxKpCBVILLPZF3axeAj6K3/2vK8s1rWELw2ufqXczKvCZuqlipSf1e4VO1mrcjnDmq Mqanw8o4c4+/gQnWDpqF7wvqYXzEnHL3PXsdE2yHeDt3eb8WMIc9Xy4RoB/+7WERYWwh wkk+28/oFO9B8zmaQDdxS8y0TEHcRAZz7vIdRsbFKbULHrEfqT7dCtg9uvTVrvlw6fk5 +OZt8AblKCQqfexOo1rHUnqIAKMwh3R0gnPpJkc/lfPXm/y+PvH1HZmDxg++UZftHhv7 dBtLDUoIEXYAaSPQavLr7KII810V0RmdebsIw7lNlKtaWHVwHy7pnIuCuKerqV07sAAt Hecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707848681; x=1708453481; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=V4TjUgrrN8kUFZKa9YdsCe7iLr0TTloHFQfT8i4JwJA=; b=UFVStLNGUma5+UrqSFgnKaKZMuU1/gzzf8W90zXsWDmBL5AFQnVJanmTAMw0EHaO4C oZrmdIt7rKKm4GLi9gdD3NUmeuZsQvmBjABuvRkCpwe5nFNpgsXsc24gbyAHF9Q+raGs iChuOBq53MXTqmXKRCZbnjNqF/gp95NJbPpnXy00bVa5xfsTfvbQXmr/Iuuir898I93C FDLZaqIXaJLaJTQaHO6QKmUnftk7Fs5b2Y0MJRYV9M8F57VfsyXxGx9rWlkowJ/MKqd3 AggSEtZEa551Hzo1q0LGIHDHnKDpEJo41768Aw5FwPiH0/YH0zazO9uIVJtiE3ecWxdo sekQ== X-Forwarded-Encrypted: i=1; AJvYcCVJWWkOCXVfyeU2ysxPiDx1RsweWWdF2bDnv+l3deHtWXR0XpQktKQg1du2BaRW+ORP+bHb0EbBxbgXWKNT/Td3Rfk/p/FX7PVL3pEqyF1lNfvGNZd9x14VJbFBGHplhiMrCADK X-Gm-Message-State: AOJu0YyD4wJrKA4lNRcgOW1e7iAyYyYpXj+/puuDMvlwX+uV0AW87RGt P7b/doQ7DfHwlskrScJUeC//PHB9SevndxNWI3qwiHU/et7+3ZDg X-Received: by 2002:a05:600c:4f95:b0:410:ee8e:d3b2 with SMTP id n21-20020a05600c4f9500b00410ee8ed3b2mr363617wmq.5.1707848680803; Tue, 13 Feb 2024 10:24:40 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVtATT/hqyfHbAajUMcA27FRnBa3cCMwhOv9kxStVv5Zs5DLAeHRjqnDmRRNojAlbXo1ATnBzbBjAAUKx9pbleJ8cusSKp7J+5LtAmxZa+z/s01Nu/Udet12S2tqkPV/vBl04HOf9ShkeIYCSzVcbzvklftTL1IypkEsUyr8RhE17IwLEqIgdUUHrVD5W3gYLPQhhrZerburEJyE9y+181RFZUzzHJNYOgMXhGjcpGitc/AdzcJPEa+4VvoNNPxJSWWD2/yok1JViHD8FOKjQ0lp8AF3M3XwvcEewtfgTTzmOZXOYqP91WFyss5FVtwcZN1Wl1iOhM8XDzlHzrvS4VQbGnXS/Ok7DXNGOMc+rpZdi0DxN7KAvTkDZTzTjXlwIsfeN0LifA= Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id bs25-20020a056000071900b0033b45bdb2a1sm10347974wrb.4.2024.02.13.10.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 10:24:40 -0800 (PST) From: Christian Marangi To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Christian Marangi , Robert Marko , "Russell King (Oracle)" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [net-next RFC PATCH 2/2] net: phy: aquantia: add AQR112C and AQR112R PHY ID Date: Tue, 13 Feb 2024 19:24:12 +0100 Message-ID: <20240213182415.17223-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213182415.17223-1-ansuelsmth@gmail.com> References: <20240213182415.17223-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790809897832196714 X-GMAIL-MSGID: 1790809897832196714 Add Aquantia AQR112C and AQR112R PHY ID. These additional PHY are just variant of the AQR112 with a different chip size or a different target market. The R variant is usually found on commercial product from PUZZEL OEM. Signed-off-by: Christian Marangi --- drivers/net/phy/aquantia/aquantia_main.c | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c index 6ee1a134bc60..fd7a79dbb4fb 100644 --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -23,6 +23,8 @@ #define PHY_ID_AQCS109 0x03a1b5c2 #define PHY_ID_AQR405 0x03a1b4b0 #define PHY_ID_AQR112 0x03a1b662 +#define PHY_ID_AQR112C 0x03a1b790 +#define PHY_ID_AQR112R 0x31c31d12 #define PHY_ID_AQR412 0x03a1b712 #define PHY_ID_AQR113C 0x31c31c12 @@ -954,6 +956,44 @@ static struct phy_driver aqr_driver[] = { .get_stats = aqr107_get_stats, .link_change_notify = aqr107_link_change_notify, }, +{ + PHY_ID_MATCH_MODEL(PHY_ID_AQR112C), + .name = "Aquantia AQR112C", + .probe = aqr107_probe, + .config_init = aqr112_config_init, + .config_aneg = aqr_config_aneg, + .config_intr = aqr_config_intr, + .handle_interrupt = aqr_handle_interrupt, + .get_tunable = aqr107_get_tunable, + .set_tunable = aqr107_set_tunable, + .suspend = aqr107_suspend, + .resume = aqr107_resume, + .read_status = aqr107_read_status, + .get_rate_matching = aqr107_get_rate_matching, + .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_AQR112R), + .name = "Aquantia AQR112R", + .probe = aqr107_probe, + .config_init = aqr112_config_init, + .config_aneg = aqr_config_aneg, + .config_intr = aqr_config_intr, + .handle_interrupt = aqr_handle_interrupt, + .get_tunable = aqr107_get_tunable, + .set_tunable = aqr107_set_tunable, + .suspend = aqr107_suspend, + .resume = aqr107_resume, + .read_status = aqr107_read_status, + .get_rate_matching = aqr107_get_rate_matching, + .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_AQR412), .name = "Aquantia AQR412", @@ -1005,6 +1045,8 @@ static struct mdio_device_id __maybe_unused aqr_tbl[] = { { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR112) }, + { PHY_ID_MATCH_MODEL(PHY_ID_AQR112C) }, + { PHY_ID_MATCH_MODEL(PHY_ID_AQR112R) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR412) }, { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) }, { }