From nobody Sat Feb 7 21:23:47 2026 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 534E72BCF7F; Sat, 1 Nov 2025 08:53:59 +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=1761987241; cv=none; b=MI+vekvkI4Eyjjg5zEcW+MhA8sDwV6124CXh3ESXH7KLNRfxdMvimN4cNbI2w9eCsWBjk6g+a8l7BBRuJ/dmrgmV2ugpoklflyRF0R+/CVaiORNVc7HljNHDGk8YN8224P1z4Iwq7YbfYo3Xr16Ybfhoqe9kAl44xPrUtEpxnzo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987241; c=relaxed/simple; bh=wu8G+IZgPrTONrj+B2Dn95z8cx1Ol1tERVibzQhVlnU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=n9JuGEQaYedcsk7uKRSM1E7oNkTHHKtDf1HT/kR4RcSxIVoMkv+5rGaSgof4Pd6KCf8ay7nZHCPN7aH1I5vUExbwDW8djjbVgK/0bNWob/UVtU1pyY/uB0ZffvxyYWkofU53qbswwQvoK34sZ2XlLKyeH8/ama+D7mtAgkJN268= 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=fecgiAoz; 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="fecgiAoz" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 36A394E4145F; Sat, 1 Nov 2025 08:53:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0C3316070B; Sat, 1 Nov 2025 08:53:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 92B0311819FA5; Sat, 1 Nov 2025 09:53:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987230; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=l1njwaNJfY/idU4bWOeSP7L5Sk9yZg7tVmJjcviOeuM=; b=fecgiAoz4IUW1RspPnzQy5eVeDGXcAD3MQojpgVo4RhHzrUFBh0i1l++QoJgT707t26PDF Q+ItXXIPHEkEgqUNlhCULKrKxoanTFhFQtILmS+Gr4JEtVghm4vr11h9S/pHG/bX6ySyaW lQAK+TP1WFHLwIIr8y8myx8Il6WYppjvT4qjtI9IYP0cqls3HEtVZhh+3Y9+NoClckgR6f E9vqY5ume3nxHDSWMLr9OoUbhKiWi9+uM6hQVNe67XGQ650nEuQBKZdicBa/brul6LFT/2 +xAr198Rje+joznAuqAEEkJUY56ztit3YkIUfFy3sOJdWPIRO1wGT3yK62eJeQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:29 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-1-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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.1 From nobody Sat Feb 7 21:23:47 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 D4791286415; Sat, 1 Nov 2025 08:53:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987237; cv=none; b=WgVuLfaTzFeRw0XUXBw8AGeYmqiQV5bVB08p81iTfw5aUpn6llSbcozFGgSXptqsqCFFTJytJiNjrpyXgEoE3YPoWlxQJ3Kko/ylZZ3NsriTPWGVXAMO2+4aHoxYftYkepTdCrHqNT4Ndq6s9zcfBJW8e3LgcvZre38PZ1ULtrw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987237; c=relaxed/simple; bh=dRU1DqBBv3lVC4hhsn8Hsiw2SuUwaDaOY34+bdd7mgs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=umFtGAqRFSE3H0fNPDSBLNCLgh0Yq3E81/t9ThbWCVgboQJ3a4hhztW5MqoxhTNDL6iRgiqZEoVfVodlNReLNyrb8Sp2kkh48k4YLkuM2I479mm3u5TxFKcLEXoFt5Eq2ix++Lk6W9k7ZmfTHykktcu8i8KG4q/kTHu2MDw7zsQ= 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=S4mC253j; arc=none smtp.client-ip=185.171.202.116 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="S4mC253j" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A7ACBC0E96F; Sat, 1 Nov 2025 08:53:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 42A416070B; Sat, 1 Nov 2025 08:53:54 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 483D311819FCF; Sat, 1 Nov 2025 09:53:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987233; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=jdfLL60RP7i0TVWp7rIzRBN4NqNUHywy1K7LchY5OmQ=; b=S4mC253j4Ha6vKQAz0rj5+tCmF5XhPSKg98wATu51dtVbq02DwD3BWOjfNxTyLJJrVMEj/ aeyAAS4/GK6/94SSyDHnd5cjKiGTKSTAAhyWe5NptdfDbWNYDNRUm/QwGwSDgsSMjpscN9 X99cznpJ2P15tVAM0wV1afh7G75Vi/8PXcwhL/OUVdnLjD46Ohpu/u5qnzUVTIZzmgRDM3 0JLxa/FtyXCJI93evn22wbaCvMzUpHyPVqWIzsB+WtpYjJMaE5GrxQKFW65TJRuodCz1Rw VIN60+7rzJmQm1Dm8aLrXtmU4NjSQkYXgATxqdWJlOC3yx71IoLfRklJ7KsQeg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:30 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-2-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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 1ab7e8746299..9e748955061b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17394,6 +17394,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.1 From nobody Sat Feb 7 21:23:47 2026 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 69E3229E112; Sat, 1 Nov 2025 08:53:58 +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=1761987240; cv=none; b=fazuLCJNiAforq/qJ7aww2t5bWHAZqXUZoxs9PNRYiFc27PzoHGd6ZGrQaic8p9ZXh7eWk5/haq4xYrkrN4hz446+83S/ltiA5yuV4Ask8zdzuSF55EnabsghW731VFQQ8LmUC9f7q9K7TLMwalVkQPqHQ2iniUzD8VOxhCwvEg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987240; c=relaxed/simple; bh=sir3J4gSwhHTRdJ1BAz2vNiZTw6r2T/fSmbbEzzZvdM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bwyQJbEYGzYk5xs8a5OA3CQQKYmnY1kZqEtysQac3kj8tK/z5oQu77cSST+i5gLXjS6TQrKyRMkvE7Cfmo+rsfNzd9kdQXPrSDd39Afc/vY/jt6AB+DcFtkHgl0Z/KY6F2sO5OamGPXQFTJ0FpyfbtKzH1FNSGlZLEXbp5y2SVE= 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=ur6+f2I6; 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="ur6+f2I6" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E4DF21A17DF; Sat, 1 Nov 2025 08:53:56 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BBA816070B; Sat, 1 Nov 2025 08:53:56 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 95DCC11818085; Sat, 1 Nov 2025 09:53:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987235; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=M7/ONsHb0ArB5bCF7FZGbfdHV5WjqY9DA/Z65CQxU0E=; b=ur6+f2I60wWilWKPzeIyRqKp36UB7FSXahjp7rZLLr4w5C6m4aTYRWab8UAlSBk4/avmwP GzTPS52IzkUIpWLm+LhOEqU57KiejmFAPJo26RhF6+sPZHLTIYDTthZ7DK122pW4JVTIzL ITMZMnwPYjJkQuEWrSI4gNhHyyGCP0rBFhSaYfhq9SiiXCjNyRMqpReDyQ3JI/8rOqXEDc kr6Pz2E1YZkj/c7JJm077PWKYaaJZJ9r9RBPyeQhVGCCznBLK4OcYo1Rmk+qPXhVVLslaW D/RVbCEqYx8r6HBgFCpQSwLO8ce1kehfz/oNvueuELjP2x5KGK1V3KE17P8MdQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:31 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-3-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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.1 From nobody Sat Feb 7 21:23:47 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 A3E1D2BDC1D; Sat, 1 Nov 2025 08:54:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987242; cv=none; b=C0uaTVJVsFNT5EKzUlBy9FDM0TbLQntjrDR6sefUqkvAoAMTZUw/ftziSr084jbVinr2WAJXPGovLsvAjxvHRWO+X6Mb49kqxqPz7xPHpHsdrWlEoPuwO+6pxSlXvjfh4lbXiygBZQR8EutiQOeozAgIR3yWoBVJAWfdu/m93s8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987242; c=relaxed/simple; bh=NYG+ETPj2x0u/ibgpjtgBYkOFUnLc2KAk3q8zgMWzxY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iCSUi/PRIQJGOXkjZnbVBCM32KY0164N1/mLGHvpNBO1Fvq9hOgKcEQ+4mPdUi6jbAELriEn+OQKSyvIVt/Shk1M4XVOCACv8JsRhk1sPzyVnXeo9kSVWbfgMAlVgdBSdkssjWnRT0BCyHun2tdmQeFI+LaQ7TgsgMMv4noz6cU= 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=qNAd3Gx1; arc=none smtp.client-ip=185.171.202.116 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="qNAd3Gx1" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id DAEDDC0E96E; Sat, 1 Nov 2025 08:53:38 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7960D6070B; Sat, 1 Nov 2025 08:53:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 144FF11819FA5; Sat, 1 Nov 2025 09:53:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987237; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=xGfi/wxxIWJSZ/P38qx/iDvGfCPuBRfGoA+hd2Uxo10=; b=qNAd3Gx1W2aWuBjGQrqgJRJBHhcwNPafbm7rBGugSQkYJXTrbincOX4X+g4J84X0gC3g17 2vu00AIZTYB1cIxFryvUcmTqTokf9BOh8EPkAlV/wwkoAVTiVRnUSqPdsN2SjWFoTTWn8l qJ6+QRtLiQShf+vcZjbClsdIICzbXClnsWvCSz0vmQS1VfMURLBHCPpgyqeywfdelx4Jho OZwBr60z6DJ1J/G+lJz9tRuIVqNx5uNR7Sp6BNSEY31eEY2F5Er5nTF1/00mH5eZcI84+E y0jt3trtC0bUQgs9i4/vDH5OLoYlpxa2Ti9crY9BqiW1uT92vYT6RO901GJcxw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:32 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-4-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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.1 From nobody Sat Feb 7 21:23:47 2026 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 A65252BDC1D; Sat, 1 Nov 2025 08:54:04 +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=1761987247; cv=none; b=UZsOLICw0gJTkffluvo9/ZNmWwxD20YUUnP7tB8c/qvIEEkdJ248VqO73NcO8u0Qq3qZaOFN7O20BIffbcT7wvCrEfG8aYRUVcvLAK2rYD6I1cLD8QU18ttBtPQm4I6YtFvZA+bYcg5mBnEYbUbJId6IkLVswWrd6fCQqwnxvAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987247; c=relaxed/simple; bh=rgtM81TJHrWSLfa7vgXN8x+VRWEr3crk3rI32ufCnI8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dVlaDK3dkWDqUkmRupOr8fWKzXJSHgQRKsFnB9Rj6XhonIEC4uUESGVtDlpFKAZzWcxZqtOJbtFZRxdDt/o6Yb90OCpfPU7ohNLGnYuT8Y19b3one4YISY1EQXZzV77NVySsa0xWx0+IEE8u8GCrwQmfkxC9evlsaDhENrL7tT4= 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=uKR9LFir; 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="uKR9LFir" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id E67F84E4145E; Sat, 1 Nov 2025 08:54:02 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BC9F76070B; Sat, 1 Nov 2025 08:54:02 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6E8E91181ABE2; Sat, 1 Nov 2025 09:53:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987241; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=rXG4FkA1j+W5VMPKCg2jc3dsIgNY9MiT6EY2h7XkH50=; b=uKR9LFirouVZ+/YEKLS5DrpGVjyj6wy3mG+sqpAwX/+fjT+bxJ9RrJYZ3EGR+CfVBRTTsK vmX5JNNlY51rlr9uuBcT+1WCyiBplJc5KBXeubdUnr0f/4a/sPDX5QlWCUhCojrU+SqWqH YUOLXRi8M4boVLeatWm2b3bbRwUxHTsg1OMK6kiROneZ8xUfmwEgYrOtSkUTDdKPEUqgGb Pkly8oBn/XYDBCDfktfSPJCnGZWPJTwxDnYB7Fib9aYL0IXAB2PdKJ9Ozg9ANNV9TU30W/ VL1NYoI56tP4aT0/dO20j/0jYI9WPtqJ7p971bbOgHl/OddoLLdZBovS387EDw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:33 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-5-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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: Th=C3=A9o Lebrun Signed-off-by: Jerome Brunet Acked-by: Philipp Zabel Reviewed-by: Philipp Zabel --- 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.1 From nobody Sat Feb 7 21:23:47 2026 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 76B5F2C08CB; Sat, 1 Nov 2025 08:54:07 +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=1761987251; cv=none; b=MZUdwgbCJ3GWRKaflpNIzLWlAT7gWeEB3qxDJFzIpdVn9s5PUIWCST96/KDzES0ztukLPI9QUqP3gtwVQmj2cDYMvDvOHk5IL9uAuVORDQBX1NRWb3NoXYYM871HL6FEHl79mQ8VH+7hMz0A8QEkkZcUIztSoUKR6bi3MmolmIs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987251; c=relaxed/simple; bh=ResRIcKzFjxpKsW/Yno1nuGatpU78DmUNiS6kkM8130=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uhR9Tsn4gOhSqsXLgqTlsPe2fG2uEVQjkdxeiNVpB5UiwIqau1PGlo8YUyprg2WoIbeRTKa/sm85dfXcdGsIkRpQ7TQMM55YzdpeEv/8ruA0UnbrSHrlnRamVNbkjaBZb4PQCZifLt8Ilv4O4oUCZrdAxGWTh96xvoAZKTOi3Co= 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=g5V50wtv; 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="g5V50wtv" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 029F94E4145F; Sat, 1 Nov 2025 08:54:06 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id CB43D6070B; Sat, 1 Nov 2025 08:54:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CF79B1181ABE5; Sat, 1 Nov 2025 09:54:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987244; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ruvqMdrCplni8HhZlBta1yqMIH8AkjPXDgnT9COO8UQ=; b=g5V50wtvw08Inzzz98zK3gmXL9bTUiRKpx+u4+JBpo6HvbROvr+1K0OodMXd0AGL9zPRCU 9GTt/0uozWzUgNj3c1fLqtyupWEHv+qJDSKcbwCtY7UNvBydYpR80cR2+/YO/S+2V+8i8N V5uoPV5BWGRtDHz2UIpYC6aZjBDk4wDXRoOkt8o/fWF+xhl0RjrOD09nyUERKpXfeV7REt 2JjL2IlMpbx8fDlzyOmIYf14gqWZZFvLzl8GYXcoSSfwqcC7eNXUhUd2MxoapB16DqH6d8 TpeFEPRhmoVw37X9qtGZJbShH1bMZhRsuNkorYozyWGYFOfvwWsNNxRX01Cz6Q== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:34 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-6-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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. Signed-off-by: Th=C3=A9o Lebrun Acked-by: Thomas Bogendoerfer --- 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.1 From nobody Sat Feb 7 21:23:47 2026 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 2B4CD2C0F7D for ; Sat, 1 Nov 2025 08:54:10 +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=1761987252; cv=none; b=jgcF2I3M+mlXGaFqgOCO7h7OkqKKGKbjib6M/xlGe3mKCZ8BIRHM5bxk9x3tXZEKBLt+JDG8JeGvruqVwZDn9IZ8RyeSk9DTm6TdOoq3zofGXVdKlqaPfYYDA0AXeOTEHmg3s89BAvB4/3QNAiulebYuuRU6zczDVS+wwK4OMig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761987252; c=relaxed/simple; bh=nBWa0ag7woJY2vPCiQSnDe7vW7z+266sYVbZE0b/SD4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ScdYTXQDpSvJDBeSjcEZcIvvYNsL7KV7USXiEL6Hgi5kK7bFzMIbzfUDf/ojtYKN8h+LPewoIsTXNZZKPhNnuRjQOKKWjih65Ve2t9xOmniZoCh1XBYaToUKrEs2Q1K2Cp90GRXbjorjeBGGbIhmAGEK5FK60JJA+R7drGFZmZU= 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=st74lANo; 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="st74lANo" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id D7F244E4145E; Sat, 1 Nov 2025 08:54:08 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A74576070B; Sat, 1 Nov 2025 08:54:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 462651181ABE8; Sat, 1 Nov 2025 09:54:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761987247; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=iTiW6J9ezHzkr5T/PBNfpX9M9qHogdCahO4t6SNr+IY=; b=st74lANo4OlJ/tptXaUC8c9aNVt7911cx5wVdtmRVe4lXOoONU4kYKOcMYktLWPc1FK8+9 v6pbAIFwfzzXvu0LqyHv6IY9Keyr9oioqKgKo8dcswjdx9tPBnlYx1tm2TvJ/JnJuXgeLo bnFwVUHhyZh2zdH99yRj3XgYAQPs5gj/U0XytcTUXATlLIyxcPL0zznH/Tmn2ChwncqrU8 PQIQVCMi1PzRiuydixHRZFdXde++eqQU3zAxXcchIVlCHTBCxZHx2TP6IwZmz8FsSVKjah IAY+XT+wbQHUoWwaQoHhZI87jb/ia6QgrtWL/bYWoaSN2X026ljm9SxdyAmOKA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Sat, 01 Nov 2025 09:53:35 +0100 Subject: [PATCH v2 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: <20251101-macb-phy-v2-7-c1519eef16d3@bootlin.com> References: <20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com> In-Reply-To: <20251101-macb-phy-v2-0-c1519eef16d3@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 Signed-off-by: Th=C3=A9o Lebrun Acked-by: Thomas Bogendoerfer --- 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.1