From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 5A83B327BF7 for ; Wed, 19 Nov 2025 15:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567484; cv=none; b=SQkLoW/KXEY8f8LhSa3Ikne+gXHqYUAiMU+YQ8vsMO9TvFY88cOjFsJvndTZNOyRkuiyZ6KJ73LjwiMAcye0SHvfndwVIeXMwwx7I/HYeN1cOzsejDn1biMZb7D1dLgUadFYJlwLXs1hrwHE+gFnOStAWbLZvA6m0Q66upuGmME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567484; c=relaxed/simple; bh=KujnVZgBow0/v41euMWhP47+TSyeKV1IkfbMm9/3qlI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WvlE1tJreTETzzfLtf2Ye6r5mzcTZXaqjRjgSMlX7NBRW//OzeUBkT/cRskcrULiLQUIVmyJJ4b0m5vEtue22k163GktTWIyEmelZE7YXJBz9hI0gf5b/l+yNSyrMVvBZaLBj9G5nYj5C75ysXBFOHJHXDsvF/fd6T4e9fMXnxg= 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=Kqsyjzc4; arc=none smtp.client-ip=185.246.84.56 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="Kqsyjzc4" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 5EFDD1A1BE4; Wed, 19 Nov 2025 15:51:20 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 340BF60699; Wed, 19 Nov 2025 15:51:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AA07E103719E4; Wed, 19 Nov 2025 16:51:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567478; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=A3Y2QFwick/mq0Fb8RYvof1NO+9syfoT+7u3r4Z59us=; b=Kqsyjzc4D0StXXydmcxRImSymlSXO98aDt647vZzUuvCaX/uBXHmDwH0AclHJ9J6jE97gc g1mnXgaB1x9Q+vCvXSYFfhrPM4XVGTJQXDu4l2GbwXIPVhtcKyPkHziJOTZH6SagMx0vQa TinM6v6+h0DtLEw2bOpPplHTW0NVrliCrVcAMiorOHjJh3yrZuZGnf+jH6ihX7rk8R+ufr 6DGqhwgmCAMYhHXE7Aylm7GiUn9hW4tWNVufU39gsCVQJbjSztK/hnjq1W7nOdOYVV84kR 6x2tL7w2/cUy/mOFjY+6FMLmNrJfy2MiwjynV/bEhfw5GEsvTCgIIsW1EHLW5Q== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:09 +0100 Subject: [PATCH v3 1/7] dt-bindings: soc: mobileye: OLB is an Ethernet PHY provider on EyeQ5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-1-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= , Conor Dooley X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 OLB on EyeQ5 ("mobileye,eyeq5-olb" compatible) is now declared as a generic PHY provider. Under the hood, it provides Ethernet RGMII/SGMII PHY support for both MAC instances. Acked-by: Conor Dooley Signed-off-by: Th=C3=A9o Lebrun --- .../devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml | 7 +++= +++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-= olb.yaml b/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-ol= b.yaml index 6d11472ba5a7..56401d76a9b5 100644 --- a/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml +++ b/Documentation/devicetree/bindings/soc/mobileye/mobileye,eyeq5-olb.yaml @@ -51,6 +51,9 @@ properties: clock-names: const: ref =20 + '#phy-cells': + const: 1 + patternProperties: '-pins?$': type: object @@ -310,7 +313,7 @@ allOf: properties: '#reset-cells': false =20 - # Only EyeQ5 has pinctrl in OLB. + # Only EyeQ5 has pinctrl and PHY in OLB. - if: not: properties: @@ -320,6 +323,8 @@ allOf: then: patternProperties: '-pins?$': false + properties: + '#phy-cells': false =20 examples: - | --=20 2.51.2 From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 2D0D0366DA0 for ; Wed, 19 Nov 2025 15:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567486; cv=none; b=iaD5K/S+LCYXE/dmrTBKAJdERYfBvJsR9tJOnyOQ8R8WANLHxVTyBKD1P5SF6i+8B4rXJLR99WZ0b0cQXO62ljcW+8tSckLTTJHGGL/09C4VllQwVv2rgbnHuE65wFBkYmSJEM92QjNo0E0EhTOgmCInXWS3SBSHOnpZWruap1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567486; c=relaxed/simple; bh=S63TG8xNOcQZcLoO4dkYed9u/K6wYYzrizL3nYPKntg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=cdDaYs4abHBf7A9ZC+0u34caD5A6nG3vstsA4l+KzrrZsptW1xCNpLUmF+Ukl9kqOlNNDTEQxngxQFat51dW2pzMfoTZ36KiknOO10nlyNXm3khST5xGAgcBUYnZ5cHJmO0sspZgQ7deW3h+9lxaHbg0qZ0IGpBOCqBclNq3U7U= 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=ScKdkdOI; arc=none smtp.client-ip=185.246.85.4 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="ScKdkdOI" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 8490D4E417AE; Wed, 19 Nov 2025 15:51:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 5335A60699; Wed, 19 Nov 2025 15:51:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C5F1210371A75; Wed, 19 Nov 2025 16:51:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567480; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=/eLWDd5hWvYbPca/EklNrX1O6zckyQobOuG2mMOxQ0U=; b=ScKdkdOIpvpIFnjPt99/MDoXY2bppPwPz2Nfuap7hL9X5okWSKHpg9GTUShQA4arzNpf5z 4jSbLrdSOjvvC5Pu4yXM/1ppVB60cwEuGEX3L6HNTdykcO5oV+MiLC3JnkVGW2S1gl+1+1 dXrT/PpP3QoFcPD5Nqs40RVOGyFSNLzjhJVjg35LQ25QDKcVF7dlmVjoUprJY926DAVhV1 8ABMoqHakKyZ2nT7Q7AMVwRZBaH6id0vPlGCYGy1KUhebMH3qVydlq3L6c1eFoV1ifp23e Wa/NlFEwKgZ9xZdPW+HkcR0cmDmPzUYcYyvERgktu8376mNuo3btk8XMJ90UMA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:10 +0100 Subject: [PATCH v3 2/7] phy: Add driver for EyeQ5 Ethernet PHY wrapper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-2-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 EyeQ5 embeds a system-controller called OLB. It features many unrelated registers, and some of those are registers used to configure the integration of the RGMII/SGMII Cadence PHY used by MACB/GEM instances. Wrap in a neat generic PHY provider, exposing two PHYs with standard phy_init() / phy_set_mode() / phy_power_on() operations. Signed-off-by: Th=C3=A9o Lebrun --- MAINTAINERS | 1 + drivers/phy/Kconfig | 13 +++ drivers/phy/Makefile | 1 + drivers/phy/phy-eyeq5-eth.c | 254 ++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 269 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index b0223cfb2583..28c0b12dd125 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17403,6 +17403,7 @@ F: arch/mips/boot/dts/mobileye/ F: arch/mips/configs/eyeq5_defconfig F: arch/mips/mobileye/board-epm5.its.S F: drivers/clk/clk-eyeq.c +F: drivers/phy/phy-eyeq5-eth.c F: drivers/pinctrl/pinctrl-eyeq5.c F: drivers/reset/reset-eyeq.c F: include/dt-bindings/clock/mobileye,eyeq5-clk.h diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig index 678dd0452f0a..1aa6eff12dbc 100644 --- a/drivers/phy/Kconfig +++ b/drivers/phy/Kconfig @@ -101,6 +101,19 @@ config PHY_NXP_PTN3222 schemes. It supports all three USB 2.0 data rates: Low Speed, Full Speed and High Speed. =20 +config PHY_EYEQ5_ETH + tristate "Ethernet PHY Driver on EyeQ5" + depends on OF + depends on MACH_EYEQ5 || COMPILE_TEST + select AUXILIARY_BUS + select GENERIC_PHY + default MACH_EYEQ5 + help + Enable this to support the Ethernet PHY integrated on EyeQ5. + It supports both RGMII and SGMII. Registers are located in a + shared register region called OLB. If M is selected, the + module will be called phy-eyeq5-eth. + source "drivers/phy/allwinner/Kconfig" source "drivers/phy/amlogic/Kconfig" source "drivers/phy/broadcom/Kconfig" diff --git a/drivers/phy/Makefile b/drivers/phy/Makefile index bfb27fb5a494..8289497ece55 100644 --- a/drivers/phy/Makefile +++ b/drivers/phy/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_PHY_SNPS_EUSB2) +=3D phy-snps-eusb2.o obj-$(CONFIG_USB_LGM_PHY) +=3D phy-lgm-usb.o obj-$(CONFIG_PHY_AIROHA_PCIE) +=3D phy-airoha-pcie.o obj-$(CONFIG_PHY_NXP_PTN3222) +=3D phy-nxp-ptn3222.o +obj-$(CONFIG_PHY_EYEQ5_ETH) +=3D phy-eyeq5-eth.o obj-y +=3D allwinner/ \ amlogic/ \ broadcom/ \ diff --git a/drivers/phy/phy-eyeq5-eth.c b/drivers/phy/phy-eyeq5-eth.c new file mode 100644 index 000000000000..c901d1cce0c8 --- /dev/null +++ b/drivers/phy/phy-eyeq5-eth.c @@ -0,0 +1,254 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define EQ5_PHY_COUNT 2 + +#define EQ5_PHY0_GP 0x128 +#define EQ5_PHY1_GP 0x12c +#define EQ5_PHY0_SGMII 0x134 +#define EQ5_PHY1_SGMII 0x138 + +#define EQ5_GP_TX_SWRST_DIS BIT(0) // Tx SW reset +#define EQ5_GP_TX_M_CLKE BIT(1) // Tx M clock enable +#define EQ5_GP_SYS_SWRST_DIS BIT(2) // Sys SW reset +#define EQ5_GP_SYS_M_CLKE BIT(3) // Sys clock enable +#define EQ5_GP_SGMII_MODE BIT(4) // SGMII mode +#define EQ5_GP_RGMII_DRV GENMASK(8, 5) // RGMII drive strength + +#define EQ5_SGMII_PWR_EN BIT(0) +#define EQ5_SGMII_RST_DIS BIT(1) +#define EQ5_SGMII_PLL_EN BIT(2) +#define EQ5_SGMII_SIG_DET_SW BIT(3) +#define EQ5_SGMII_PWR_STATE BIT(4) +#define EQ5_SGMII_PLL_ACK BIT(18) +#define EQ5_SGMII_PWR_STATE_ACK GENMASK(24, 20) + +struct eq5_phy_inst { + struct eq5_phy_private *priv; + struct phy *phy; + void __iomem *gp, *sgmii; + phy_interface_t phy_interface; +}; + +struct eq5_phy_private { + struct device *dev; + struct eq5_phy_inst phys[EQ5_PHY_COUNT]; +}; + +static int eq5_phy_init(struct phy *phy) +{ + struct eq5_phy_inst *inst =3D phy_get_drvdata(phy); + struct eq5_phy_private *priv =3D inst->priv; + struct device *dev =3D priv->dev; + u32 reg; + + dev_dbg(dev, "phy_init(inst=3D%td)\n", inst - priv->phys); + + writel(0, inst->gp); + writel(0, inst->sgmii); + + udelay(5); + + reg =3D readl(inst->gp) | EQ5_GP_TX_SWRST_DIS | EQ5_GP_TX_M_CLKE | + EQ5_GP_SYS_SWRST_DIS | EQ5_GP_SYS_M_CLKE | + FIELD_PREP(EQ5_GP_RGMII_DRV, 0x9); + writel(reg, inst->gp); + + return 0; +} + +static int eq5_phy_exit(struct phy *phy) +{ + struct eq5_phy_inst *inst =3D phy_get_drvdata(phy); + struct eq5_phy_private *priv =3D inst->priv; + struct device *dev =3D priv->dev; + + dev_dbg(dev, "phy_exit(inst=3D%td)\n", inst - priv->phys); + + writel(0, inst->gp); + writel(0, inst->sgmii); + udelay(5); + + return 0; +} + +static int eq5_phy_set_mode(struct phy *phy, enum phy_mode mode, int submo= de) +{ + struct eq5_phy_inst *inst =3D phy_get_drvdata(phy); + struct eq5_phy_private *priv =3D inst->priv; + struct device *dev =3D priv->dev; + + dev_dbg(dev, "phy_set_mode(inst=3D%td, mode=3D%d, submode=3D%d)\n", + inst - priv->phys, mode, submode); + + if (mode !=3D PHY_MODE_ETHERNET) + return -EOPNOTSUPP; + + if (!phy_interface_mode_is_rgmii(submode) && + submode !=3D PHY_INTERFACE_MODE_SGMII) + return -EOPNOTSUPP; + + inst->phy_interface =3D submode; + return 0; +} + +static int eq5_phy_power_on(struct phy *phy) +{ + struct eq5_phy_inst *inst =3D phy_get_drvdata(phy); + struct eq5_phy_private *priv =3D inst->priv; + struct device *dev =3D priv->dev; + u32 reg; + + dev_dbg(dev, "phy_power_on(inst=3D%td)\n", inst - priv->phys); + + if (inst->phy_interface =3D=3D PHY_INTERFACE_MODE_SGMII) { + writel(readl(inst->gp) | EQ5_GP_SGMII_MODE, inst->gp); + + reg =3D EQ5_SGMII_PWR_EN | EQ5_SGMII_RST_DIS | EQ5_SGMII_PLL_EN; + writel(reg, inst->sgmii); + + if (readl_poll_timeout(inst->sgmii, reg, + reg & EQ5_SGMII_PLL_ACK, 1, 100)) { + dev_err(dev, "PLL timeout\n"); + return -ETIMEDOUT; + } + + reg =3D readl(inst->sgmii); + reg |=3D EQ5_SGMII_PWR_STATE | EQ5_SGMII_SIG_DET_SW; + writel(reg, inst->sgmii); + } else { + writel(readl(inst->gp) & ~EQ5_GP_SGMII_MODE, inst->gp); + writel(0, inst->sgmii); + } + + return 0; +} + +static int eq5_phy_power_off(struct phy *phy) +{ + struct eq5_phy_inst *inst =3D phy_get_drvdata(phy); + struct eq5_phy_private *priv =3D inst->priv; + struct device *dev =3D priv->dev; + + dev_dbg(dev, "phy_power_off(inst=3D%td)\n", inst - priv->phys); + + writel(readl(inst->gp) & ~EQ5_GP_SGMII_MODE, inst->gp); + writel(0, inst->sgmii); + + return 0; +} + +static const struct phy_ops eq5_phy_ops =3D { + .init =3D eq5_phy_init, + .exit =3D eq5_phy_exit, + .set_mode =3D eq5_phy_set_mode, + .power_on =3D eq5_phy_power_on, + .power_off =3D eq5_phy_power_off, +}; + +static struct phy *eq5_phy_xlate(struct device *dev, + const struct of_phandle_args *args) +{ + struct eq5_phy_private *priv =3D dev_get_drvdata(dev); + + if (args->args_count !=3D 1 || args->args[0] > 1) + return ERR_PTR(-EINVAL); + + return priv->phys[args->args[0]].phy; +} + +static int eq5_phy_probe_phy(struct eq5_phy_private *priv, unsigned int in= dex, + void __iomem *base, unsigned int gp, + unsigned int sgmii) +{ + struct eq5_phy_inst *inst =3D &priv->phys[index]; + struct device *dev =3D priv->dev; + struct phy *phy; + + phy =3D devm_phy_create(dev, dev->of_node, &eq5_phy_ops); + if (IS_ERR(phy)) { + dev_err(dev, "failed to create PHY %u\n", index); + return PTR_ERR(phy); + } + + inst->priv =3D priv; + inst->phy =3D phy; + inst->gp =3D base + gp; + inst->sgmii =3D base + sgmii; + inst->phy_interface =3D PHY_INTERFACE_MODE_NA; + phy_set_drvdata(phy, inst); + + return 0; +} + +static int eq5_phy_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct device *dev =3D &adev->dev; + struct phy_provider *provider; + struct eq5_phy_private *priv; + void __iomem *base; + int ret; + + priv =3D devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->dev =3D dev; + dev_set_drvdata(dev, priv); + + base =3D (void __iomem *)dev_get_platdata(dev); + + ret =3D eq5_phy_probe_phy(priv, 0, base, EQ5_PHY0_GP, EQ5_PHY0_SGMII); + if (ret) + return ret; + + ret =3D eq5_phy_probe_phy(priv, 1, base, EQ5_PHY1_GP, EQ5_PHY1_SGMII); + if (ret) + return ret; + + provider =3D devm_of_phy_provider_register(dev, eq5_phy_xlate); + if (IS_ERR(provider)) { + dev_err(dev, "registering provider failed\n"); + return PTR_ERR(provider); + } + + return 0; +} + +static const struct auxiliary_device_id eq5_phy_id_table[] =3D { + { .name =3D "clk_eyeq.phy" }, + {} +}; +MODULE_DEVICE_TABLE(auxiliary, eq5_phy_id_table); + +static struct auxiliary_driver eq5_phy_driver =3D { + .probe =3D eq5_phy_probe, + .id_table =3D eq5_phy_id_table, +}; +module_auxiliary_driver(eq5_phy_driver); + +MODULE_DESCRIPTION("EyeQ5 Ethernet PHY driver"); +MODULE_AUTHOR("Th=C3=A9o Lebrun "); +MODULE_LICENSE("GPL"); --=20 2.51.2 From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 85C5531B102 for ; Wed, 19 Nov 2025 15:51:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567489; cv=none; b=Y4qaG92k0P7DIR1zvK4W3GB9LroO+Arh/i3a0VVz6rCcPWWRt+9u2n82NzGfDBUV+K8x3tugAWUvR3ymqk2PJqFV9JOt9g0fVK6D8oZ5S7smLx2YoFAD8uklSZJQDLrah/CnD7tAW6zn7yPRE+5v4kw9aMPexSYOT5ZJuVvyYQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567489; c=relaxed/simple; bh=/1Z1uVLfR040ru5L1Jq9U+DJzEwXFdr4qQwG+4vJb2U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GBxuocVm922v3SQUwxsHh3MM2C7fl81gtSEdZ/DpXKEj3zqz7LaVCZN1p5IHef51DzL2/DMzwNCYKJzzJu5wiBS7V2xVJtuLe7kVFT0U/MZYH4TN0YZpobFXRYhe2vJYbPceb6n8fuji+h92DIfS0wF23PpdNw+vhWs/bDpQiNU= 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=ECR44XaM; arc=none smtp.client-ip=185.246.84.56 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="ECR44XaM" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id CCD151A1BEA; Wed, 19 Nov 2025 15:51:23 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A15E960699; Wed, 19 Nov 2025 15:51:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id AE93810371A8D; Wed, 19 Nov 2025 16:51:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567482; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=EMfe7NCrPEtDOh+KTdcg4+sRjMaKtllSEnW/4ZVnrtU=; b=ECR44XaMLSrtps1v4w2rohHUO3xsVYSdBXxXPbxpNtk1zjWDYLearCqoBE7gbFOki3ddsO U6htLAddNhtSMtBEf6IliuWmhG7XZPHGz5suL4b1HR3tyydfkzT94XOhP5jpsZRrimc9cD x+52w7xZxFRfF2ZGgfMYlYeYGvgyBkBazi54sqG51ORCBwMur+LUebNAVwKEgB6VZ4JOIB kc1svisj3wdnfuovRTBRkL88osZL+ORrSvMC1vmdl0zcebIZt8qel+tKCZarDJ3vxUx+L0 U7fCZSwpSnaBenuHPjXbOqPk4H8Ay86ob9YcMca1D5yKsGBxs5YERUnP/SwgSg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:11 +0100 Subject: [PATCH v3 3/7] clk: eyeq: use the auxiliary device creation helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-3-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= , Jerome Brunet X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 From: Jerome Brunet The auxiliary device creation of this driver is simple enough to use the available auxiliary device creation helper. Use it and remove some boilerplate code. Tested-by: Th=C3=A9o Lebrun # On Mobileye EyeQ5 Signed-off-by: Jerome Brunet --- drivers/clk/clk-eyeq.c | 57 +++++++++++-----------------------------------= ---- 1 file changed, 12 insertions(+), 45 deletions(-) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index ea1c3d78e7cd..664ce7d7868d 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -322,38 +322,18 @@ static void eqc_probe_init_fixed_factors(struct devic= e *dev, } } =20 -static void eqc_auxdev_release(struct device *dev) -{ - struct auxiliary_device *adev =3D to_auxiliary_dev(dev); - - kfree(adev); -} - -static int eqc_auxdev_create(struct device *dev, void __iomem *base, - const char *name, u32 id) +static void eqc_auxdev_create_optional(struct device *dev, void __iomem *b= ase, + const char *name) { struct auxiliary_device *adev; - int ret; =20 - adev =3D kzalloc(sizeof(*adev), GFP_KERNEL); - if (!adev) - return -ENOMEM; - - adev->name =3D name; - adev->dev.parent =3D dev; - adev->dev.platform_data =3D (void __force *)base; - adev->dev.release =3D eqc_auxdev_release; - adev->id =3D id; - - ret =3D auxiliary_device_init(adev); - if (ret) - return ret; - - ret =3D auxiliary_device_add(adev); - if (ret) - auxiliary_device_uninit(adev); - - return ret; + if (name) { + adev =3D devm_auxiliary_device_create(dev, name, + (void __force *)base); + if (!adev) + dev_warn(dev, "failed creating auxiliary device %s.%s\n", + KBUILD_MODNAME, name); + } } =20 static int eqc_probe(struct platform_device *pdev) @@ -365,7 +345,6 @@ static int eqc_probe(struct platform_device *pdev) unsigned int i, clk_count; struct resource *res; void __iomem *base; - int ret; =20 data =3D device_get_match_data(dev); if (!data) @@ -379,21 +358,9 @@ static int eqc_probe(struct platform_device *pdev) if (!base) return -ENOMEM; =20 - /* Init optional reset auxiliary device. */ - if (data->reset_auxdev_name) { - ret =3D eqc_auxdev_create(dev, base, data->reset_auxdev_name, 0); - if (ret) - dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n", - KBUILD_MODNAME, data->reset_auxdev_name, ret); - } - - /* Init optional pinctrl auxiliary device. */ - if (data->pinctrl_auxdev_name) { - ret =3D eqc_auxdev_create(dev, base, data->pinctrl_auxdev_name, 0); - if (ret) - dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n", - KBUILD_MODNAME, data->pinctrl_auxdev_name, ret); - } + /* Init optional auxiliary devices. */ + eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name); + eqc_auxdev_create_optional(dev, base, data->pinctrl_auxdev_name); =20 if (data->pll_count + data->div_count + data->fixed_factor_count =3D=3D 0) return 0; /* Zero clocks, we are done. */ --=20 2.51.2 From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 B56E73A9BED for ; Wed, 19 Nov 2025 15:51:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567490; cv=none; b=KoIz7QlgsHSGykj73g77rJM4Xf5J16542K2wP1DAiXCc/3sodSr7qCoriwPpy3LG1f8aAXwVU/sOpIMePiZD+Emap5Fjd2Iza3NU9oRBTj7MfiXZ7sdVw/05yXB5muhjYwmBczfbXg/YFp5Kt89cpdB6lKTOKr7lDcYOgP+ppIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567490; c=relaxed/simple; bh=PROiVMvBujcOrIuMnDqr5ZyfcjX6sk0nc9ttAN0xzAY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AT2xrMUCiJb3Wd1XngF0/pCbojqtdZnBTDnASpASjiAlH3PwMOID/2GomPxCNEC4odAbgOp3nIx3/8ynFh4ogJy1qn8vWultVbJIw2ybFCunPQq3p8HNqid923OaiW8yyoDL+OBKWLeZQyKmYbXSzUQfQj1h05sqkkpL/5he2ro= 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=DU5AmqSM; arc=none smtp.client-ip=185.246.85.4 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="DU5AmqSM" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 0FC1E4E417AC; Wed, 19 Nov 2025 15:51:26 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D9FEC60699; Wed, 19 Nov 2025 15:51:25 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E002A10371A75; Wed, 19 Nov 2025 16:51:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567484; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=o1ZneLkWDu4MdFISZHYho0TQB+cU4Mq99hP/Mw23jU0=; b=DU5AmqSMOS2Jvqh6emrRmqZLGQjXcsYhnwQZv3fHceCL/Dxm0eE7djFFAMJjX4pPj/GPSh MKxqidbkiEJpoa6uZH9aFv33cvQq8Ut7k1xgLl3G66FpTVBWadMogyfxzt7jM3TC9tGSFT CD/cEWknArSH/dMxmDEZdQif82/6JsXmB3Boh4qcAn2a+E2OfRqeTpI2Ix3zYM0CulEwYU 88tv80UtkPSY5vFK8RLKEJUHd7j74GLB+C1lypcIURgk+LLMvz+1muVJ0Z+OBTX5AfnXYg L+rU07wg2SKfhfuQNK/wIbwIOSeG9q0nbIX7AWeo//Fyie+RSN8lgjAYhIvUGQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:12 +0100 Subject: [PATCH v3 4/7] clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-4-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Grow our clk-eyeq family; it knows how to spawn reset provider and pin controller children. Expand with a generic PHY driver on EyeQ5. Signed-off-by: Th=C3=A9o Lebrun --- drivers/clk/clk-eyeq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/clk/clk-eyeq.c b/drivers/clk/clk-eyeq.c index 664ce7d7868d..a9de57315e48 100644 --- a/drivers/clk/clk-eyeq.c +++ b/drivers/clk/clk-eyeq.c @@ -109,6 +109,7 @@ struct eqc_match_data { =20 const char *reset_auxdev_name; const char *pinctrl_auxdev_name; + const char *eth_phy_auxdev_name; =20 unsigned int early_clk_count; }; @@ -361,6 +362,7 @@ static int eqc_probe(struct platform_device *pdev) /* Init optional auxiliary devices. */ eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name); eqc_auxdev_create_optional(dev, base, data->pinctrl_auxdev_name); + eqc_auxdev_create_optional(dev, base, data->eth_phy_auxdev_name); =20 if (data->pll_count + data->div_count + data->fixed_factor_count =3D=3D 0) return 0; /* Zero clocks, we are done. */ @@ -521,6 +523,7 @@ static const struct eqc_match_data eqc_eyeq5_match_data= =3D { =20 .reset_auxdev_name =3D "reset", .pinctrl_auxdev_name =3D "pinctrl", + .eth_phy_auxdev_name =3D "phy", =20 .early_clk_count =3D ARRAY_SIZE(eqc_eyeq5_early_plls) + ARRAY_SIZE(eqc_eyeq5_early_fixed_factors), --=20 2.51.2 From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 9C5973A9BEC; Wed, 19 Nov 2025 15:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567492; cv=none; b=KsEeBzitanGAcLALWU40Yo5MBIij7507ifPNtFT3FSAai6ILPnBe+ywbw17R7inQzcCwRvsInYexENhce1U8jySg3/C4NPwvjkkErl+eFzSaRDcrh35fN0O8Z3pWsgSkzJ1f4cSmlIydvvOTQm7croZQm10LZjn0qOiDSQVuFaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567492; c=relaxed/simple; bh=u7WHbCq+A9ZPz9uty8ilGxI8CD4zGA5iY19dCDG1ULY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Kc69SaIDuV6f9fYjzzqU4gdOSgaZ46VcTN/Fk/gFxyU2iuEpRU0UX0LSdYPnROHcjPyW76FCnoPHGnE2ivMxLtdXXUMeNqiLwEvMRRc33Fl+HGfUbG7+wN0i2RkSu2ceE7hFz0XhKFEl4lk2aWsaB1YfT0ynBPfRkPBimqhrh1Q= 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=QDljzvxt; arc=none smtp.client-ip=185.246.85.4 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="QDljzvxt" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 99F364E417AE; Wed, 19 Nov 2025 15:51:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6F96660699; Wed, 19 Nov 2025 15:51:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E398C103719E4; Wed, 19 Nov 2025 16:51:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567486; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=n9ugHQUamTXVnl8BX59S+YCRTdmSd34Rjsc+/50EYuQ=; b=QDljzvxtISH/CyfK+D2FJjGAx0+WCSkIp+Pi2ufPJzWX17iIABieopqX7GcjUlsSoRXmmn T1T33uCQ0qt1KuhyB3OurBXuxhPaLRDr5gOhrZfnsaUdclnosP8PfmFjOOAXPgz7Hlt/eJ DVJpIn8zQzd2ag2n0N3sGQlk8r7cyKTKCbbOS7Qxh4NoZ8JCQZcymV28bgg0CsYyX+vfZo 1x/Pj75KyET6zQ7pgSFK/pwo1BARwzOhugNFbHBJJCtPRG0qOEiT3pYGD4TpKOpNkBmq7H dMwxV7Ur1y0HbetHrqrT78B2rDOCq2tKYsuOB++zORHJ7OmwfluLhakRhALydw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:13 +0100 Subject: [PATCH v3 5/7] reset: eyeq: drop device_set_of_node_from_dev() done by parent Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-5-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= , Jerome Brunet X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Our parent driver (clk-eyeq) now does the device_set_of_node_from_dev(dev, dev->parent) call through the newly introduced devm_auxiliary_device_create() helper. Doing it again in the reset-eyeq probe would be redundant. Drop both the WARN_ON() and the device_set_of_node_from_dev() call. Also fix the following comment that talks about "our newfound OF node". Signed-off-by: Jerome Brunet Reviewed-by: Philipp Zabel Acked-by: Philipp Zabel Signed-off-by: Th=C3=A9o Lebrun --- drivers/reset/reset-eyeq.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/reset/reset-eyeq.c b/drivers/reset/reset-eyeq.c index 2d3998368a1c..8018fa895427 100644 --- a/drivers/reset/reset-eyeq.c +++ b/drivers/reset/reset-eyeq.c @@ -410,13 +410,6 @@ static int eqr_of_xlate_twocells(struct reset_controll= er_dev *rcdev, return eqr_of_xlate_internal(rcdev, reset_spec->args[0], reset_spec->args= [1]); } =20 -static void eqr_of_node_put(void *_dev) -{ - struct device *dev =3D _dev; - - of_node_put(dev->of_node); -} - static int eqr_probe(struct auxiliary_device *adev, const struct auxiliary_device_id *id) { @@ -427,21 +420,8 @@ static int eqr_probe(struct auxiliary_device *adev, int ret; =20 /* - * We are an auxiliary device of clk-eyeq. We do not have an OF node by - * default; let's reuse our parent's OF node. - */ - WARN_ON(dev->of_node); - device_set_of_node_from_dev(dev, dev->parent); - if (!dev->of_node) - return -ENODEV; - - ret =3D devm_add_action_or_reset(dev, eqr_of_node_put, dev); - if (ret) - return ret; - - /* - * Using our newfound OF node, we can get match data. We cannot use - * device_get_match_data() because it does not match reused OF nodes. + * Get match data. We cannot use device_get_match_data() because it does + * not accept reused OF nodes; see device_set_of_node_from_dev(). */ match =3D of_match_node(dev->driver->of_match_table, dev->of_node); if (!match || !match->data) --=20 2.51.2 From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (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 22B3B3A8D54; Wed, 19 Nov 2025 15:51:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567494; cv=none; b=cjmHMbnieUzMIorWz5qbMdjsNiMOOuxtwE7SePhgYwhSvYOV++HoMAf7Cbl4lHUAdvTuIl0wb5lMIW/G60ruF19QYvGXrcyEinMqNlmXOZ7avh0+ot8JKhTMYonHUE/afaVSeTAfdli/ofooe37TX7BQL0fps21qwpNZpdC/Asc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567494; c=relaxed/simple; bh=6Q+NmLl2C9ptZ9bkztHH+KYUMcsJXHivUSZ8co9WpOk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hVP6NKMdzIV67Y0NUBl7fOD7LHi0O6u1U4dK1egR3hdC7palTumSAl/HKmRb4GVFAzXq0AkVU44wnmh+9fgk46/VNTRsSLyCgGeFiDtGFLvOJ0MtzPl0T716eWWJijavVLzEt+FfX0BF19zSFRm8sN8ZxbuQZ182ZL0Gkmrs7hM= 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=ketn707h; arc=none smtp.client-ip=185.246.85.4 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="ketn707h" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id EBDBC4E417AD; Wed, 19 Nov 2025 15:51:29 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id C282760699; Wed, 19 Nov 2025 15:51:29 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id C085F10371A93; Wed, 19 Nov 2025 16:51:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567488; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=klQnWzZzV5kOkpTDc5MuQiqgbTxND08gty2EDxoTZ9U=; b=ketn707hCjGsmdmTvp/ruPSuUlkGYF6t5ikeQkJFEeJdqL0yYoDX2YN7iaHqtCZNsFmOj/ govOvqpgmF634FT0XdzubEPpviRS4zhJP0sUwznMLF3jDL0e+k2nKC9ZXwuh8qNhYWsWgD M0HLtlEHr/EZCDoFaWwn3RD2RS5Ru4KV+Dfl5KjrGRydlTv8WDgAe+P3D8fJmewjh1lbdu n1jocaA6pViuK63mvmZWjGeTG0hjnF5hm4JamqCpATqBwuBidfHvY23PDZLzx6G4M/NzRm PVZlT8k2UCeCnc/MY0ekWWguZ8ibnQ4dkILKbU1RJNwab6uCOV3Eq3CxEKBFrw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:14 +0100 Subject: [PATCH v3 6/7] MIPS: mobileye: eyeq5: add two Cadence GEM Ethernet controllers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-6-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add both MACB/GEM instances found in the Mobileye EyeQ5 SoC. Acked-by: Thomas Bogendoerfer Signed-off-by: Th=C3=A9o Lebrun --- arch/mips/boot/dts/mobileye/eyeq5.dtsi | 45 ++++++++++++++++++++++++++++++= ++++ 1 file changed, 45 insertions(+) diff --git a/arch/mips/boot/dts/mobileye/eyeq5.dtsi b/arch/mips/boot/dts/mo= bileye/eyeq5.dtsi index 36a73e8a63a1..cec5ad875228 100644 --- a/arch/mips/boot/dts/mobileye/eyeq5.dtsi +++ b/arch/mips/boot/dts/mobileye/eyeq5.dtsi @@ -77,6 +77,8 @@ aliases { serial0 =3D &uart0; serial1 =3D &uart1; serial2 =3D &uart2; + ethernet0 =3D &macb0; + ethernet1 =3D &macb1; }; =20 cpu_intc: interrupt-controller { @@ -231,6 +233,7 @@ olb: system-controller@e00000 { #clock-cells =3D <1>; clocks =3D <&xtal>; clock-names =3D "ref"; + #phy-cells =3D <1>; }; =20 gic: interrupt-controller@140000 { @@ -305,6 +308,48 @@ gpio1: gpio@1500000 { #interrupt-cells =3D <2>; resets =3D <&olb 0 26>; }; + + iocu-bus { + compatible =3D "simple-bus"; + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + dma-coherent; + dma-ranges =3D <0x10 0x00000000 0x0 0x0 0x10 0>; + + macb0: ethernet@2a00000 { + compatible =3D "mobileye,eyeq5-gem"; + reg =3D <0x0 0x02a00000 0x0 0x4000>; + interrupt-parent =3D <&gic>; + /* One interrupt per queue */ + interrupts =3D , + , + , + ; + clock-names =3D "pclk", "hclk", "tsu_clk"; + clocks =3D <&pclk>, <&pclk>, <&tsu_clk>; + nvmem-cells =3D <ð0_mac>; + nvmem-cell-names =3D "mac-address"; + phys =3D <&olb 0>; + }; + + macb1: ethernet@2b00000 { + compatible =3D "mobileye,eyeq5-gem"; + reg =3D <0x0 0x02b00000 0x0 0x4000>; + interrupt-parent =3D <&gic>; + /* One interrupt per queue */ + interrupts =3D , + , + , + ; + clock-names =3D "pclk", "hclk", "tsu_clk"; + clocks =3D <&pclk>, <&pclk>, <&tsu_clk>; + nvmem-cells =3D <ð1_mac>; + nvmem-cell-names =3D "mac-address"; + phys =3D <&olb 1>; + }; + }; + }; }; =20 --=20 2.51.2 From nobody Tue Dec 2 02:19:59 2025 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (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 43FDA366DA0; Wed, 19 Nov 2025 15:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567497; cv=none; b=PCgap+A8RhI/1QtwPa08bFa23VXKvRbpdt6U7TtqbiJIDLppwW3YNQcIOb1rYjALgHelMP0WQykTWxd45Ae8OyBTFvdFnrKT5y4rNJ4RLRgxvTQHXT5/bUnJhNAJUcOs7XzWG4ZBOJV27UR5ShhFYJneYnK4gzk5W92N8yY5EpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763567497; c=relaxed/simple; bh=IkKxjN3rMBFp73RgD9vwag8MPYIM7lEwj0F6o6x6bvo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DRztivpFxq0dcoDA1Hva0fzx25pNhDiKvvEfU/PIMw52WFy6TqdRg+5HkDhg0eBQJ9fDGFS2W21fH2NYwhhFaVJte9l60xCXgIBkMQFczSj52HwVeVqE6Fk3+0Q9FK2zM8WBOiNnvm9St+6UAbQ0gxRqVkLXCFII0A81zRiCoOM= 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=KZYHWNMK; arc=none smtp.client-ip=185.246.84.56 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="KZYHWNMK" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 722601A1BE8; Wed, 19 Nov 2025 15:51:31 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4974160699; Wed, 19 Nov 2025 15:51:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CFDBA10371A95; Wed, 19 Nov 2025 16:51:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763567490; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ve9CapSEWEKtu43skVGcR+S7+2vr8yoZ+6wP4hyPLao=; b=KZYHWNMKZs02aAYbdDy6PSrVBslaXNnb2wSlHo3Q2hOj7zt0GYNnZacXN9ukKQbvvvFTtc sGHHvoOsBpmpc1naSg2wGD4KnZ+S4kCMuuGc2gA0UDbJ6ShzzEa2nB4/0sap8MoFO/AKa/ F7I/h61BUCQfMkfrGtZyEzgrmC9H+bw262rgqPP0MGUwVL+ZZwiNCNUCHy2mmOqplke8HR u6Y5FJqbAzWLhx0WxHhayTKsDDmXF2fhNbw6/hEKnmEfXa7YqT2wDMxg5zQ512SHSsQmUD Hqm8RXVgKkH80MBePs1RjUYyrNXcxtZQFgrcFz1FubAXu3qUmOLSd/b44x8A8A== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 19 Nov 2025 16:51:15 +0100 Subject: [PATCH v3 7/7] MIPS: mobileye: eyeq5-epm: add two Cadence GEM Ethernet PHYs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251119-macb-phy-v3-7-e9a7be186a33@bootlin.com> References: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> In-Reply-To: <20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com> To: Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Philipp Zabel , Thomas Bogendoerfer Cc: linux-mips@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Th=C3=A9o_Lebrun?= , Andrew Lunn X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 The Mobileye EyeQ5 eval board (EPM) embeds two MDIO PHYs. Reviewed-by: Andrew Lunn Acked-by: Thomas Bogendoerfer Signed-off-by: Th=C3=A9o Lebrun --- arch/mips/boot/dts/mobileye/eyeq5-epm5.dts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts b/arch/mips/boot/dt= s/mobileye/eyeq5-epm5.dts index 9fc1a1b0a81b..babf52731ea6 100644 --- a/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts +++ b/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts @@ -29,3 +29,29 @@ temperature-sensor@48 { label =3D "U60"; }; }; + +&macb0 { + phy-mode =3D "sgmii"; + phy-handle =3D <&macb0_phy>; + + mdio { + #address-cells =3D <1>; + #size-cells =3D <0>; + macb0_phy: ethernet-phy@e { + reg =3D <0xe>; + }; + }; +}; + +&macb1 { + phy-mode =3D "rgmii-id"; + phy-handle =3D <&macb1_phy>; + + mdio { + #address-cells =3D <1>; + #size-cells =3D <0>; + macb1_phy: ethernet-phy@e { + reg =3D <0xe>; + }; + }; +}; --=20 2.51.2