From patchwork Wed Jun 19 18:45:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 805688 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 02E5C1586F2 for ; Wed, 19 Jun 2024 18:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822766; cv=none; b=YwB9A3+fi0Gebj0mh5NiSAnQpHXnYoXaWBR/58nknwWMw+X9vJOBZoGgZq9wyi3/WaohC3pOqkZsUR3KB0ZEE39lyK9FrSACtdDXFkjePJ2DxRB8SUPRMhqSxcFGFXRsAJddx4HjixKSkLPfnoh4A4QETocx9SQjL59/oROK9C0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822766; c=relaxed/simple; bh=xQZfBrjg8Y1IyEOd4VaZKMauy6Z5Ydh+j9RZPVg6KZk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nKLMFkZHuJVvQA0shj7/ku0tsPYZOXNIru2QWCuzfPZGMqpMNL8H7rUh/UAA8thwi3HmeF4r+vIw2tivANd6zoZmjAmmaYEJWKU9QygXmBq4maLDzj2wy/GvdgiBpPuO9af2JRRNh+Uzum8a+8I+5yh6Q0jpiNxyEeXk1a1zCgY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=gAL+o4vV; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="gAL+o4vV" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-42172ed3487so1050875e9.0 for ; Wed, 19 Jun 2024 11:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718822763; x=1719427563; 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; bh=Of1uWBxSEjvKTQJleea6ZxhN8mHuCcwxXxdGI9uF93A=; b=gAL+o4vVw3jcnhq4PUbRpC74aZANSxP2sHepAl477+dHyw3hIiYtKS9iQYOzNR/aZl 7jG7iLmV3Eq2lBLWWUnK6mwdZDiAlv/bi52N9kVh0HgIjWYLsLw9y/CplYlywGk3vr6y jbwWpbF3OYq7oBGO3aLvdLCbprYHWo+51G/sASidqzssMBKA+L8kkhB6GGuyGhS9xZVE JSaetH0dSnfHCJDTFQf5ZtPdDY0xzTK2pTGGYRjhj1zHxTUF4OPeFToRxOpMpNMHNNyK pOO33h0IRjazGywi2++BR6mrtBlZK+3jLdtOMH6cxOopJbiuilV4xGuNYqMzbTENJT2D 5ItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718822763; x=1719427563; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Of1uWBxSEjvKTQJleea6ZxhN8mHuCcwxXxdGI9uF93A=; b=AR2zP+BaKKcT4WfjSVxKLAZ3hnPuSj6fRfXjC62y/FJKZXbJ0CUzaGAZ1mD2pA4vKo gAgRrIh8cYteAcEYOPNgb3TkHEjXokZMn5ch5afJQ30mBLNYwoXc3oR3FImm5ym9+3AH dqTclRw+vCTnL1pJgBLNCxKVqbmhgbKHdDIswbrTJ6Qjj7py2iqH2ayoWtjvl0/xWcML vDFNrD67mTw6Jna7PRM9YQoAhzGDRylsgk+BzNNEz6cjjjOaFvYKuZo5Mf/13pgKMsiU R/7T8M34UFhIb6o8JMeZf6H5wYUYJ3+tUkEaPDfov4Lz52EXAWuHb8BqYd7ABLbRwElX WxnQ== X-Forwarded-Encrypted: i=1; AJvYcCUfnkIhHg4vC2h1/MtgBVD+cuVk5OC/M/yXGBTkenotNnmfIxn2VVq9vdnJVFZVt4hHViS6MVa1KUTknUQtMoDQQR4qIYXEDZJ8SvSYhA== X-Gm-Message-State: AOJu0Yxbmh6tx9gddUOfW9RQ5RrniPKc0AlMuTjXomlQKhFgGzd/IWtB CYzMxvLbyeuLBBhPoeMeoJdK1e+amW0xI1iPoXT9SLNbIiStj/Q3VgvhjPVMw8g= X-Google-Smtp-Source: AGHT+IG94KmlBI+1kAFW/XzI6UK2YpoCtdBNr/zZ39tySmt8Nx0B1Rz4PfJT6D+Bu6Uwl7ILTiqtkg== X-Received: by 2002:a7b:cc13:0:b0:424:784c:b13b with SMTP id 5b1f17b1804b1-424784cb209mr15137645e9.13.1718822763293; Wed, 19 Jun 2024 11:46:03 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:991f:deb8:4c5d:d73d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36098c8c596sm7594156f8f.14.2024.06.19.11.46.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 11:46:02 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net-next 1/8] net: phy: add support for overclocked SGMII Date: Wed, 19 Jun 2024 20:45:42 +0200 Message-ID: <20240619184550.34524-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619184550.34524-1-brgl@bgdev.pl> References: <20240619184550.34524-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski The Aquantia AQR115C PHY supports the Overlocked SGMII mode. In order to support it in the driver, extend the PHY core with the new mode bits and pieces. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/phy-core.c | 1 + drivers/net/phy/phylink.c | 13 ++++++++++++- include/linux/phy.h | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c index 15f349e5995a..7cf87cae11f0 100644 --- a/drivers/net/phy/phy-core.c +++ b/drivers/net/phy/phy-core.c @@ -138,6 +138,7 @@ int phy_interface_num_ports(phy_interface_t interface) case PHY_INTERFACE_MODE_RXAUI: case PHY_INTERFACE_MODE_XAUI: case PHY_INTERFACE_MODE_1000BASEKX: + case PHY_INTERFACE_MODE_OCSGMII: return 1; case PHY_INTERFACE_MODE_QSGMII: case PHY_INTERFACE_MODE_QUSGMII: diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 02427378acfd..ce07d41a233f 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -128,6 +128,7 @@ static const phy_interface_t phylink_sfp_interface_preference[] = { PHY_INTERFACE_MODE_5GBASER, PHY_INTERFACE_MODE_2500BASEX, PHY_INTERFACE_MODE_SGMII, + PHY_INTERFACE_MODE_OCSGMII, PHY_INTERFACE_MODE_1000BASEX, PHY_INTERFACE_MODE_100BASEX, }; @@ -180,6 +181,7 @@ static unsigned int phylink_interface_signal_rate(phy_interface_t interface) switch (interface) { case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_1000BASEX: /* 1.25Mbd */ + case PHY_INTERFACE_MODE_OCSGMII: return 1250; case PHY_INTERFACE_MODE_2500BASEX: /* 3.125Mbd */ return 3125; @@ -231,6 +233,7 @@ static int phylink_interface_max_speed(phy_interface_t interface) return SPEED_1000; case PHY_INTERFACE_MODE_2500BASEX: + case PHY_INTERFACE_MODE_OCSGMII: return SPEED_2500; case PHY_INTERFACE_MODE_5GBASER: @@ -515,6 +518,10 @@ static unsigned long phylink_get_capabilities(phy_interface_t interface, caps |= MAC_1000HD | MAC_1000FD; fallthrough; + case PHY_INTERFACE_MODE_OCSGMII: + caps |= MAC_2500FD; + fallthrough; + case PHY_INTERFACE_MODE_REVRMII: case PHY_INTERFACE_MODE_RMII: case PHY_INTERFACE_MODE_SMII: @@ -929,6 +936,7 @@ static int phylink_parse_mode(struct phylink *pl, case PHY_INTERFACE_MODE_10GKR: case PHY_INTERFACE_MODE_10GBASER: case PHY_INTERFACE_MODE_XLGMII: + case PHY_INTERFACE_MODE_OCSGMII: caps = ~(MAC_SYM_PAUSE | MAC_ASYM_PAUSE); caps = phylink_get_capabilities(pl->link_config.interface, caps, RATE_MATCH_NONE); @@ -1357,7 +1365,8 @@ static void phylink_mac_initial_config(struct phylink *pl, bool force_restart) case MLO_AN_INBAND: link_state = pl->link_config; - if (link_state.interface == PHY_INTERFACE_MODE_SGMII) + if (link_state.interface == PHY_INTERFACE_MODE_SGMII || + link_state.interface == PHY_INTERFACE_MODE_OCSGMII) link_state.pause = MLO_PAUSE_NONE; break; @@ -3640,6 +3649,7 @@ void phylink_mii_c22_pcs_decode_state(struct phylink_link_state *state, break; case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_OCSGMII: case PHY_INTERFACE_MODE_QSGMII: phylink_decode_sgmii_word(state, lpa); break; @@ -3715,6 +3725,7 @@ int phylink_mii_c22_pcs_encode_advertisement(phy_interface_t interface, adv |= ADVERTISE_1000XPSE_ASYM; return adv; case PHY_INTERFACE_MODE_SGMII: + case PHY_INTERFACE_MODE_OCSGMII: case PHY_INTERFACE_MODE_QSGMII: return 0x0001; default: diff --git a/include/linux/phy.h b/include/linux/phy.h index e6e83304558e..73da0983d631 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -128,6 +128,7 @@ extern const int phy_10gbit_features_array[1]; * @PHY_INTERFACE_MODE_10GKR: 10GBASE-KR - with Clause 73 AN * @PHY_INTERFACE_MODE_QUSGMII: Quad Universal SGMII * @PHY_INTERFACE_MODE_1000BASEKX: 1000Base-KX - with Clause 73 AN + * @PHY_INTERFACE_MODE_OCSGMII: Overclocked SGMII * @PHY_INTERFACE_MODE_MAX: Book keeping * * Describes the interface between the MAC and PHY. @@ -168,6 +169,7 @@ typedef enum { PHY_INTERFACE_MODE_10GKR, PHY_INTERFACE_MODE_QUSGMII, PHY_INTERFACE_MODE_1000BASEKX, + PHY_INTERFACE_MODE_OCSGMII, PHY_INTERFACE_MODE_MAX, } phy_interface_t; @@ -289,6 +291,8 @@ static inline const char *phy_modes(phy_interface_t interface) return "100base-x"; case PHY_INTERFACE_MODE_QUSGMII: return "qusgmii"; + case PHY_INTERFACE_MODE_OCSGMII: + return "ocsgmii"; default: return "unknown"; } From patchwork Wed Jun 19 18:45:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 805687 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (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 1630E158D98 for ; Wed, 19 Jun 2024 18:46:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822768; cv=none; b=aen9RtLzrDG7GMpqaEuOjqMhkltqDynSzlB/FV8684CcIF8Ws17ZzS8ywVDF0lm3cS5PGX7G0gHDpkv0dIY/6ge+MqB+OJwcmuCPfb66zp0GuLF0z2UXXY54SN8xHGOF6kV9TK7i2xJc/9zbYNJZ6fI5EjDhRRhZ878iHnzHjAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822768; c=relaxed/simple; bh=Gb2AtUPIZLOqvCXJxTsfKyEo0Y1lWpbQs78ViEnJLxs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CvF/B3XliPlwU6RjPXJSxJNoxrhDDYQbBd4iZJHc2Z9kWlEX2TzcXfPaQ422AzUcscPke15lpTkbnZ6lWYnv6sWy5kL1CtIuTSRgZQ3j6SYsEn3RGdCVS4XyALD67uxURtR2waMC9TxCZ+bIYgatCQv9gw9cEg8Cg9iAK9MnCko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=B7PTfcsD; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="B7PTfcsD" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-3636c572257so93281f8f.0 for ; Wed, 19 Jun 2024 11:46:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718822765; x=1719427565; 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; bh=i2ZaP1GIFake6LOudA2QCXAqpH6bV7MuTKm6aVLhChY=; b=B7PTfcsDSXbyDcRg9LalOo7qedZye4tGXhCXAUYV48UBq4EeFq3zXLSEFXIFH15DwS oUvk44dQT9R5xrlkPM3AKlXs9sB9kEJp0C18gHErO7vhZgQY2FW54XqJPWT7/sEZxPDk 84tI+EyOaLCtidTCer3PAnRXUD96FHMDoPjitlmfdVvdeveDCIzf7EFVVgxWut4H76Ml u3RROOmLoFmhvd3KiZGk74KGk4MDKHTwEcbjxOfD8L2MvCX1dhiaD5A5DpTHIy41YyRA oFhvWRb/VaA9lw+hYTCmWYtPUZ4987dm/73v5MXBsqPNMRANjE5dV5XIK7y64EP36h4Y UFrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718822765; x=1719427565; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i2ZaP1GIFake6LOudA2QCXAqpH6bV7MuTKm6aVLhChY=; b=IHfm+MGYdLWium73Ju41u3LmQ4/1Ekmss0+m6Jj8eSBcxN4K3tPLoJaIuqBccwM9Ln 8jYXzaU7+810Oca8HttiSidzbTSFw/aN22lTwdFA4GZlu0CMAwVl9kCP1VoJr18QhHfQ jUEZFqV+yqelKOw8jREXaVqxS9P1YFWBqOykqpEBXP6c61ASIlT3UXhpYHXRUVgpK10U jkYJTEHYsV4InJNRPINcfccPavGC/TlfP0OxJepY0IVaCC7qDbmYvvwwBHRZdD/MCW39 LTDBYKWRq0JtnA4mkYlD1FMyM3YiCbxSdJwnLhE5Rtw5g/bHMVHAJD3Vwcf1wzkuuBAT 35nw== X-Forwarded-Encrypted: i=1; AJvYcCXSHvKKjCeitvSpM728kA0eKpBJRn8zo1bQ35dNCwn6RlFkQ6sXkY+H6Xkz+0lsUE24lZ/SnBW5UhS1i29gknMQdmkmG+w1ysZZj/v1UA== X-Gm-Message-State: AOJu0YxmXUTp0Bo1xbYEiLpQOi4mHma2150OGuT6McddgBF1boL+qQxz /wuJyokK0EODdwTHufx0/p9h0LsyjFUo7qSDJJtX6sG8lCe36f9ibUrIt5BwlTQ= X-Google-Smtp-Source: AGHT+IFHpgEdcFxPeHRNEDbOoGGaHbIDTAIRX4vjn/KLZAdtQ8VVBfo3vmxuKjBv7nIHdarP5mwF1w== X-Received: by 2002:a5d:590c:0:b0:35f:1eba:cf66 with SMTP id ffacd0b85a97d-363199905dbmr3314238f8f.61.1718822765554; Wed, 19 Jun 2024 11:46:05 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:991f:deb8:4c5d:d73d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36098c8c596sm7594156f8f.14.2024.06.19.11.46.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 11:46:04 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net-next 3/8] net: phy: aquantia: add missing include guards Date: Wed, 19 Jun 2024 20:45:44 +0200 Message-ID: <20240619184550.34524-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619184550.34524-1-brgl@bgdev.pl> References: <20240619184550.34524-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski The header is missing the include guards so add them. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/aquantia/aquantia.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/phy/aquantia/aquantia.h b/drivers/net/phy/aquantia/aquantia.h index c0e1fd9d7152..b8502793962e 100644 --- a/drivers/net/phy/aquantia/aquantia.h +++ b/drivers/net/phy/aquantia/aquantia.h @@ -6,6 +6,9 @@ * Author: Heiner Kallweit */ +#ifndef AQUANTIA_H +#define AQUANTIA_H + #include #include @@ -198,3 +201,5 @@ int aqr_phy_led_hw_control_set(struct phy_device *phydev, u8 index, int aqr_phy_led_active_low_set(struct phy_device *phydev, int index, bool enable); int aqr_phy_led_polarity_set(struct phy_device *phydev, int index, unsigned long modes); + +#endif /* AQUANTIA_H */ From patchwork Wed Jun 19 18:45:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 805686 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 E56B0158DA1 for ; Wed, 19 Jun 2024 18:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822770; cv=none; b=XwWS4IvjA+mWix8H8hD8h6yhYSfC4TBLwt2xOew/BJmyzByeUwGQq+7KDNr0W313HEGWvZpDvWfgDAWviCVfcUet4oHS/gANR64ezEBNt7Y966pWTPGhLdRE6iITn4YLmnQ9UDvlx9MJTNzkxc2PmSE0cNlURgzbI9kBoyyIQyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822770; c=relaxed/simple; bh=Z42Tj4eFx4jXVdlHNjeT3uH2cP3RYjlyUFGU2X7iXHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fUDVquXG55qnjLKAQywKNeqwcrkCPX9uuVqWp2K+pp5COBSUG9LT2jK3n0hjqYMYMX+GiRg981OFn1BYkolR1WM1kxyRGcJgyUhzGjFKgOeEAIJQe6NYefkBv/UhM1iGBigBud3Mf6TP6JNmmvkDKRJiFqgBBePhJVJfL+ZdhFI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=H/4iIgVF; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="H/4iIgVF" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-35f2c9e23d3so828228f8f.0 for ; Wed, 19 Jun 2024 11:46:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718822767; x=1719427567; 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; bh=m8OMC48GmXgiPxob9K29Y+tXmIST97gKgb0MYszQ6f4=; b=H/4iIgVFdRaP2fd5+airGbRvBampN1nNczHbZFjCehyyn8XX9TmbKH0VEHflzh0NnR wqET2K+BeoftJXbc/U6L/7rgk+7KSYdwSqbGPJP2vU41qoGu4zFzPgh/QkJf5PP0bGZP LcbtsQ5ewIcYRnthGv06tRlTfKPEQFpHgWkqKkXhAr2onyRfMFT/cT0D5Q//Zg4cP3EM ey4W2ZQik/UcfNWJUn00+bAk9ska9rYrWkDMbi8ggTN/NCUmUYL+/8yX2R4kD4I/svZM WDk07/WtGsG2kIuLoQsO0UVjlN6EZu140k+Wy2GbO7LOiP+0hLsHa0hZ9EegmquYjbA+ jk/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718822767; x=1719427567; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m8OMC48GmXgiPxob9K29Y+tXmIST97gKgb0MYszQ6f4=; b=Dx7zhcwA8G2Il0qva37e0EB5wFCO0yW8bm0KfT8a0EHjtDwhOoUD1TxQaFfSsO30/W /73gqiHRlLUJsqwSLGHR8NMKUmB5NCYwysb0TwJvej+RCyLAFCUWpdRrtKdYeV8O8/AF /gNkCEKW4TM3GEh42jexyXXXliqp028EFywtoMI7uAEHXWlwpne077bMWvBoCYDCsl6L M2ZxrYvuXMtuEgMfk9w8nUDhHpCjWIWbgcNkBwMXBFjRB2CzyniCz8tzCScxLNdY/Wk7 cztfMSIYGXCnyv/Mry7xhvSiTRv9D+VOfiWpQKtYgZEsfTWdAel3v6Acjf9UK0fZJX0Y NK9Q== X-Forwarded-Encrypted: i=1; AJvYcCUwaXH8ZL0EODfquGuN2fceszeqcN27/fhT72zGD7fdVw/y3TC46/0tz3b1PXHV9bFiSoUtKoovJJJS7NGQB0dIeORXbMw2oIDDhEEcdQ== X-Gm-Message-State: AOJu0Yw4o+aBnG224PeastZeNIAcYA+hEeijJmqarogdiNTqfRajdkjI rIxlPY+FPFMli9m7bO6KullPs6fCpCfNduuve3gruioh3u+rjUWV58rc73AnvfY= X-Google-Smtp-Source: AGHT+IHPbftWUm712EVMDPWc9/FAfLxNDa5SAVUKIsk+n79gLzuNi7krxSeOn0v4Ewzob/JdZzx81g== X-Received: by 2002:a5d:6d4c:0:b0:360:7856:fa62 with SMTP id ffacd0b85a97d-3609ea6c58emr6800607f8f.15.1718822767356; Wed, 19 Jun 2024 11:46:07 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:991f:deb8:4c5d:d73d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36098c8c596sm7594156f8f.14.2024.06.19.11.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 11:46:07 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net-next 5/8] net: phy: aquantia: wait for FW reset before checking the vendor ID Date: Wed, 19 Jun 2024 20:45:46 +0200 Message-ID: <20240619184550.34524-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619184550.34524-1-brgl@bgdev.pl> References: <20240619184550.34524-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Checking the firmware register before it boots makes no sense, it will report 0 even if FW is loaded. Always wait for FW to boot before continuing. Signed-off-by: Bartosz Golaszewski --- drivers/net/phy/aquantia/aquantia.h | 1 + drivers/net/phy/aquantia/aquantia_firmware.c | 4 ++++ drivers/net/phy/aquantia/aquantia_main.c | 6 +++--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/aquantia/aquantia.h b/drivers/net/phy/aquantia/aquantia.h index b8502793962e..2465345081f8 100644 --- a/drivers/net/phy/aquantia/aquantia.h +++ b/drivers/net/phy/aquantia/aquantia.h @@ -201,5 +201,6 @@ int aqr_phy_led_hw_control_set(struct phy_device *phydev, u8 index, int aqr_phy_led_active_low_set(struct phy_device *phydev, int index, bool enable); int aqr_phy_led_polarity_set(struct phy_device *phydev, int index, unsigned long modes); +int aqr_wait_reset_complete(struct phy_device *phydev); #endif /* AQUANTIA_H */ diff --git a/drivers/net/phy/aquantia/aquantia_firmware.c b/drivers/net/phy/aquantia/aquantia_firmware.c index 0c9640ef153b..524627a36c6f 100644 --- a/drivers/net/phy/aquantia/aquantia_firmware.c +++ b/drivers/net/phy/aquantia/aquantia_firmware.c @@ -353,6 +353,10 @@ int aqr_firmware_load(struct phy_device *phydev) { int ret; + ret = aqr_wait_reset_complete(phydev); + if (ret) + return ret; + /* Check if the firmware is not already loaded by pooling * the current version returned by the PHY. If 0 is returned, * no firmware is loaded. diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c index 11da460698b0..eab779db225c 100644 --- a/drivers/net/phy/aquantia/aquantia_main.c +++ b/drivers/net/phy/aquantia/aquantia_main.c @@ -441,7 +441,7 @@ static int aqr107_set_tunable(struct phy_device *phydev, * The chip also provides a "reset completed" bit, but it's cleared after * read. Therefore function would time out if called again. */ -static int aqr107_wait_reset_complete(struct phy_device *phydev) +int aqr_wait_reset_complete(struct phy_device *phydev) { int val; @@ -494,7 +494,7 @@ static int aqr107_config_init(struct phy_device *phydev) WARN(phydev->interface == PHY_INTERFACE_MODE_XGMII, "Your devicetree is out of date, please update it. The AQR107 family doesn't support XGMII, maybe you mean USXGMII.\n"); - ret = aqr107_wait_reset_complete(phydev); + ret = aqr_wait_reset_complete(phydev); if (!ret) aqr107_chip_info(phydev); @@ -522,7 +522,7 @@ static int aqcs109_config_init(struct phy_device *phydev) phydev->interface != PHY_INTERFACE_MODE_2500BASEX) return -ENODEV; - ret = aqr107_wait_reset_complete(phydev); + ret = aqr_wait_reset_complete(phydev); if (!ret) aqr107_chip_info(phydev); From patchwork Wed Jun 19 18:45:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 805685 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 0B39F15B106 for ; Wed, 19 Jun 2024 18:46:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822772; cv=none; b=VjkhXOirFXg1wVnIk4gIAfzlH9pJ2jZR2ngha+ojpZmI/pdKiF9UnpJMXU8blH/invU9ugCu5Bjx78QKENzyGKpcvNXGEpNb1fF5ooDEnE48kk1TmCEkxdG3+lfzFky9q4V/vLUcHv+Da5rq3R5BVXdj7tfFQGgMQRU0/dNH9eU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718822772; c=relaxed/simple; bh=7OGbLgVO2+0kFwF5zKOoOkaXLuP+flIZCfQXgfpZrfU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u4xKYU/G0Qb67xUc8GsrJ8x/6HEJm2V61jLOyaJBumSoxq8xDNL7RZvMB5cYwy2xGXQRk3xsojpsjab/4/08TAEZ6XD5p/av4E3KiFXaOCXkMHyIHZVgOxQJsgMIom4PgBOwO4D+7k8jnOb9zcp3TgpgwZzpmIIyF8AR4qNVs+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=YmaJGgaG; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="YmaJGgaG" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-361b376236fso59335f8f.3 for ; Wed, 19 Jun 2024 11:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718822769; x=1719427569; 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; bh=DQB6Cx2g3Hd80tsoqIkz/xMhmvkJf1bvi8aoKUzsHuk=; b=YmaJGgaGxMj2rsPghWPabrVOBmPVBiskBEpcGL5OI6+7QU1PHRG/DeyjMvNSsJxA8o ebbU57Mk3t937Gh9AqMNnoe2w16WklHeToOUWheCZD2d6YO4/LhEafSaa4sOu011SeGO HXtRvId6js2V23RY4rFlLmVISKYI4JvM1eCSaTl6BVwfHe7lG+FgOnan1LIuQfuuCil3 rQdTj19QAieX3z0mjvwTy8isweC+11/s3Gq7PXw8IvNVRD/3tN5QEjc3H8+fclqoaMKt y81gOsdq4vGQNpNMMIYBAtLZQat27Ou0STQQcE0PMZrt28cBxAX9PW8bKFC29jKRn+tp YKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718822769; x=1719427569; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DQB6Cx2g3Hd80tsoqIkz/xMhmvkJf1bvi8aoKUzsHuk=; b=VA5ukvM0a6NCt2gtikjfJBwVgUrALrO8N3nIHAeXBJY1O46ETo+JtivCxTCRpYl1fg eXa8uMYflikfOZ7fawg0qHX2qpO9pnU7IMaJAZvZnU8h8NAZzcK6pV2WTLwQDSUJb6Rl TBkw3Mop9tI1ObliYIa8A2t+6VZE/1KGJUAk/REZGOhyds9vz8bP/gCeYKzTrx8Sg487 WCQV2VjyXsM1LPv872zCfL90i+nl3dUvfUl/J9EUTuVnUyLx1kvk+1q3OaEPML1Wn41S x3L3NFrqwnQETVZ9EvPNM25xJXNuWetijiVHFTtOtkfbnaNXm9O9BQIJ66C/88s7KPpp UlkQ== X-Forwarded-Encrypted: i=1; AJvYcCUjVTP1mkvpldVJamsuTCwkdS5owwLOhow42z68/R46Lwt5ggat8OlPArcyX3DLPZOSt5i3Z2un8n962Znc6zQCa7ckTJGbEoeY9b9W0g== X-Gm-Message-State: AOJu0YxruwpwVhKpsaQUoaZ9N9kdcP58csHrWkAsbXtatlB6A0y6HhQj pDzKi+8NlYlz+R4MWjZzT01zdwTTkM+j3K91dFbDeQ+qyA81g7gJzJGyUUckcDM= X-Google-Smtp-Source: AGHT+IFc10tmtmw3xb52p2cInNEHf/dEPq+PJZ9vw9EtMnLBEOS8Dh29bqwtYNyT87EfbHfTnNwe9A== X-Received: by 2002:a5d:4902:0:b0:35f:2002:3033 with SMTP id ffacd0b85a97d-36317d75626mr2704226f8f.37.1718822769540; Wed, 19 Jun 2024 11:46:09 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:991f:deb8:4c5d:d73d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36098c8c596sm7594156f8f.14.2024.06.19.11.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 11:46:09 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net-next 7/8] net: stmmac: provide the open() callback Date: Wed, 19 Jun 2024 20:45:48 +0200 Message-ID: <20240619184550.34524-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619184550.34524-1-brgl@bgdev.pl> References: <20240619184550.34524-1-brgl@bgdev.pl> Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Bartosz Golaszewski Provide drivers with means of injecting additional code into the stmmac_open() function. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ include/linux/stmmac.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 644bc8a24661..5f628176d994 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3953,6 +3953,9 @@ static int __stmmac_open(struct net_device *dev, if (ret < 0) return ret; + if (priv->plat->open) + priv->plat->open(dev, priv->plat->bsp_priv); + if ((!priv->hw->xpcs || xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) { ret = stmmac_init_phy(dev); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 9dc54d6d65ae..59991b38cadb 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -262,6 +262,7 @@ struct plat_stmmacenet_data { void (*serdes_powerdown)(struct net_device *ndev, void *priv); void (*speed_mode_2500)(struct net_device *ndev, void *priv); void (*ptp_clk_freq_config)(struct stmmac_priv *priv); + void (*open)(struct net_device *ndev, void *priv); int (*init)(struct platform_device *pdev, void *priv); void (*exit)(struct platform_device *pdev, void *priv); struct mac_device_info *(*setup)(void *priv);