From patchwork Thu Jun 20 12:01:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 13705298 X-Patchwork-Delegate: kuba@kernel.org Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 7F2B517BB05; Thu, 20 Jun 2024 12:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.240 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718884913; cv=none; b=hMB7s/IuB3BZhbpg0ALx328qK7QOGYXQ9/C7n2LgzUtuxMQ9lnu0WeoTd1EXFFtq79aIkYyCTpzDAAf6dE+/DIrVmiDKCES8PmhQ2qgAA8FeV/3F5/LlLzehHwwbBmCYePWQEvVuNRSRVyY79nQ0xWAkET6MbE7rcbgrwND5+6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718884913; c=relaxed/simple; bh=9PIhyYGNWcY7TPX0zsorCk5n9Xre78jAdyX8n6yC+Nc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FVx260qXna75pPkEjNOyRw+g6dXwkDHiXfRaww/v+Jy+WPTn1wowajrtKsFYeXZLD+Y25iDiG+zmSKpXJf6yBbXoSakA/3srHngVXZO/hNIWs2UeUnMdJ7ThUGtmskpko9PL/3BCivHixtE7fEStFDDkeW8LC/Zmlax7R9++T64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=W+02BoeC; arc=none smtp.client-ip=217.70.178.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="W+02BoeC" Received: from relay5-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::225]) by mslow1.mail.gandi.net (Postfix) with ESMTP id D6C6AC4D95; Thu, 20 Jun 2024 12:01:42 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPA id DCA641C0004; Thu, 20 Jun 2024 12:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718884895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r05TD/GVdIcSzqzhZMzXmTWGakGAMsrSYTyZGt7/JnE=; b=W+02BoeCD+aAjI4Cs9s8J3XbfwURr3cJ0KaW4bc3/GYF5Sqk85lX9AdL3JKvw/r1q58aKb idOOJcLBaeuGhyzHwspxvDrP7LI5aOdS5jU/zPHee3V1jyOLJ1bg2b+DWvdwtA0nofgX/l 34Q5wYQMgFewb49Hm3ym16zNJCdPb4v58XHUA8Mk6nQPKr7amZ3jFxazl/f1r/RX9QzLNy wumG07nndD1BwwMxCXX9rIAcoTp03sFf9z27WJhczS/jS4+3M6J+UdVjK5+SjVk1yv1SBx 79HN8QhU0tAox1nDGZwCyjkyvQ53/xQMkJDj5cx4m/UTgy+/UtTSao1aQyrQcg== From: Herve Codina To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , Heiner Kallweit , Russell King , Philipp Zabel , Alexandre Belloni Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Herve Codina , Krzysztof Kozlowski Subject: [PATCH net-next v3 1/2] dt-bindings: net: mscc-miim: Add resets property Date: Thu, 20 Jun 2024 14:01:24 +0200 Message-ID: <20240620120126.412323-2-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240620120126.412323-1-herve.codina@bootlin.com> References: <20240620120126.412323-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Patchwork-Delegate: kuba@kernel.org Add the (optional) resets property. The mscc-miim device is impacted by the switch reset especially when the mscc-miim device is used as part of the LAN966x PCI device. Signed-off-by: Herve Codina Reviewed-by: Andrew Lunn Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/net/mscc,miim.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/net/mscc,miim.yaml b/Documentation/devicetree/bindings/net/mscc,miim.yaml index 5b292e7c9e46..792f26b06b06 100644 --- a/Documentation/devicetree/bindings/net/mscc,miim.yaml +++ b/Documentation/devicetree/bindings/net/mscc,miim.yaml @@ -38,6 +38,16 @@ properties: clock-frequency: true + resets: + items: + - description: + Reset shared with all blocks attached to the Switch Core Register + Bus (CSR) including VRAP slave. + + reset-names: + items: + - const: switch + required: - compatible - reg From patchwork Thu Jun 20 12:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 13705299 X-Patchwork-Delegate: kuba@kernel.org Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) (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 6958C1AB34A; Thu, 20 Jun 2024 12:01:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.178.240 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718884914; cv=none; b=R9H+ECzciIzHcF5JR9m1GbRlmM6A/Nng/AcRA4qsjtZtor/OzRsNVfkzE20WSDvgQrFkYNI3dpmHLlOhpF7IreBb7TXyoKxb/vEQe0z6GbG0UZBiFGAYdMYpOiX7uFn37XcEYvpi83GJy5MUm+F91kMBhqdIpqZuI1SHJIIRDJQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718884914; c=relaxed/simple; bh=OIowDhxypt9LiGcjqB5Z6dc7u0vM3OGs3dWxFFkhkhw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rE91QUYNmWT2F4lEFMw2bwL8IS16fvIOVp1Ju5r8dVKzXM62DqL8dFdFSZtGDRiJaRSKgPTpxxPcAWonf1aZhiXnv8H3Nan02sboGzxjOqbC54k9Ej8pr6Q5dfNFENaLABVsCD8QOmvKchW1yQHcuhlACsrFMqt/2eyRxsidPPU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=NyLNy7mt; arc=none smtp.client-ip=217.70.178.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="NyLNy7mt" Received: from relay5-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::225]) by mslow1.mail.gandi.net (Postfix) with ESMTP id DB586C4F11; Thu, 20 Jun 2024 12:01:44 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPA id D38741C0002; Thu, 20 Jun 2024 12:01:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1718884896; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BYS+7QPQSgVSHOoyqLuN1/ixRCRmt3jQrcCLIrMclVw=; b=NyLNy7mtXCX9yHK25pv6QLDgok963iRfzUWLO8APoUkvhZTbIopCj5/LL0aawj58fhp6GP 1tUvmZiKIQQQxWThnlPyH9s+oo8VmMHdrN2HJaWQP7hExGxcNX+bjGRPBxlWKLBvM2xwKn pomhqxi8x8s+dk4wf4j7LKGXntoXXmwxUKZ6lJp6OBlNFcWoN5b8sKIww634IMi3PHophZ zwPnju3f1UvVza6o4I9T7+XfPXY/e8PR926CXIBN6ChZiFmmhJ+nlerERo4RSWU+2z4Z/9 7VkegLAkUBeJBfY80g8uQ5Jwg+9SOl4HaQmtarSoBCBJOhGzzjL8KzxcA0Wpmw== From: Herve Codina To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andrew Lunn , Heiner Kallweit , Russell King , Philipp Zabel , Alexandre Belloni Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Allan Nielsen , Horatiu Vultur , Steen Hegelund , Thomas Petazzoni , Herve Codina Subject: [PATCH net-next v3 2/2] net: mdio: mscc-miim: Handle the switch reset Date: Thu, 20 Jun 2024 14:01:25 +0200 Message-ID: <20240620120126.412323-3-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240620120126.412323-1-herve.codina@bootlin.com> References: <20240620120126.412323-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Patchwork-Delegate: kuba@kernel.org The mscc-miim device can be impacted by the switch reset, at least when this device is part of the LAN966x PCI device. Handle this newly added (optional) resets property. Signed-off-by: Herve Codina Reviewed-by: Andrew Lunn --- drivers/net/mdio/mdio-mscc-miim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index c29377c85307..62c47e0dd142 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -19,6 +19,7 @@ #include #include #include +#include #define MSCC_MIIM_REG_STATUS 0x0 #define MSCC_MIIM_STATUS_STAT_PENDING BIT(2) @@ -271,10 +272,17 @@ static int mscc_miim_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct regmap *mii_regmap, *phy_regmap; struct device *dev = &pdev->dev; + struct reset_control *reset; struct mscc_miim_dev *miim; struct mii_bus *bus; int ret; + reset = devm_reset_control_get_optional_shared(dev, "switch"); + if (IS_ERR(reset)) + return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n"); + + reset_control_reset(reset); + mii_regmap = ocelot_regmap_from_resource(pdev, 0, &mscc_miim_regmap_config); if (IS_ERR(mii_regmap))