public inbox for linux-mips@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device
@ 2026-02-25 16:55 Théo Lebrun
  2026-02-25 16:55 ` [PATCH v7 1/3] clk: eyeq: use the auxiliary device creation helper Théo Lebrun
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Théo Lebrun @ 2026-02-25 16:55 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Philipp Zabel
  Cc: linux-mips, linux-clk, linux-kernel, Vladimir Kondratiev,
	Gregory CLEMENT, Benoît Monin, Tawfik Bayouk,
	Thomas Petazzoni, Luca Ceresoli, Théo Lebrun, Jerome Brunet

EyeQ5 SoCs integrate two GEM instances. A system-controller register
region named "OLB" has some control over the Ethernet PHY integration.

Extend the current OLB ecosystem with a new generic PHY driver.
 - OLB is carried by one main platform driver: clk-eyeq.
 - It instantiates auxiliary devices: reset-eyeq & pinctrl-eyeq5.
 - We add a new one: phy-eyeq5-eth.

Mainly we spawn a new auxdev from clk-eyeq. But alongside we use the
newly introduced helper devm_auxiliary_device_create() that has the
implication of setting child dev->of_node from parent. That implies we
must drop the device_set_of_node_from_dev() at the same time.

Philipp Zabel gave his ACK [2] for the reset patch to go into linux-clk.

About related patches:

 - PHY patches are incoming to add the driver. Patches used to be [2] in
   the same series.

 - MIPS patches are incoming to add MACB/GEM instances in devicetree and
   their associated PHYs. They also update dt-bindings to reflect this
   new feature OLB provides. Patches used to be [2] in the same series.

Have a nice day,
Thanks!
Théo

[0]: https://lore.kernel.org/lkml/20250627-macb-v2-15-ff8207d0bb77@bootlin.com/
[1]: https://lore.kernel.org/lkml/20251022-macb-eyeq5-v2-0-7c140abb0581@bootlin.com/
[2]: https://lore.kernel.org/lkml/9506997c56808cc9fd58fe0d384976421d6c9bfc.camel@pengutronix.de/

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
Changes in v7:
- Separate PHY / clk / MIPS patches into three series.
- Rebase onto v7.0-rc1 and test on EyeQ5. Nothing to report.
- Link to v6: https://lore.kernel.org/r/20260127-macb-phy-v6-0-cdd840588188@bootlin.com

Changes in v6:
- Rebase upon v6.19-rc7; nothing to report.
- Add new patch "phy: sort Kconfig and Makefile".
- phy-eyeq5-eth: drop useless explicit __iomem cast to
  dev_get_platdata() return value.
- I did *not* drop the Kconfig `default MACH_EYEQ5` nor driver
  `dev_dbg()`. I think both are useful and should be kept. See
  last revision discussion here:
  https://lore.kernel.org/lkml/DFGSMN8268O0.33TYCQDBVHUHZ@bootlin.com/
- Link to v5: https://lore.kernel.org/r/20251215-macb-phy-v5-0-a9dfea39da34@bootlin.com

Changes in v5:
- phy-eyeq5-eth:
  - fix #includes: add delay, gfp_types, module and drop array_size,
    bug, cleanup, container_of, lockdep, mutex.
  - eq5_phy_xlate(): avoid magic value, use EQ5_PHY_COUNT.
  - use dev_err_probe() in error cases of devm_phy_create() and
    devm_of_phy_provider_register().
- 3x Reviewed-by: Luca Ceresoli.
- Add Neil Armstrong to Cc as new PHY subsystem reviewer.
- Rebase on v6.19-rc1, tested on hardware, no changes.
- Link to v4: https://lore.kernel.org/r/20251124-macb-phy-v4-0-955c625a81a7@bootlin.com

Changes in v4:
- Append my SoB to Jerome's patch:
  [PATCH v4 3/7] clk: eyeq: use the auxiliary device creation helper
- Rebase on net-next & linux-{clk,mips,phy}. Nothing to report.
- Link to v3: https://lore.kernel.org/r/20251119-macb-phy-v3-0-e9a7be186a33@bootlin.com

Changes in v3:
- Take Philipp Zabel's Reviewed-by & Acked-by trailers on reset patch.
- Take Thomas Bogendoerfer's two Acked-by trailers on DT patches.
- Rebase on net-next & test on target. Nothing to report.
- Link to v2: https://lore.kernel.org/r/20251101-macb-phy-v2-0-c1519eef16d3@bootlin.com

Changes in v2:
- Take Acked-by: Conor Dooley on dt-bindings-patch.
- s/%ld/%tu/ for printing ptrdiff_t; warnings on 32-bit archs.
  Reported by NIPA's netdev/build_32bit test.
  https://patchwork.kernel.org/project/netdevbpf/patch/20251021-macb-eyeq5-v1-7-3b0b5a9d2f85@bootlin.com/
  https://netdev.bots.linux.dev/static/nipa/1014126/14277857/build_32bit/stderr
- Link to v1: https://lore.kernel.org/r/20251022-macb-phy-v1-0-f29f28fae721@bootlin.com

Changes since MACB V1:
- Drop the old "mobileye,olb" properties from DT patches; found while
  running dtbs_check and dt_binding_check.
- Drop all patches targeting net-next. That is MACB dt-bindings patch
  and MACB driver code. See there here [1].
- Link to v1: https://lore.kernel.org/lkml/20251021-macb-eyeq5-v1-0-3b0b5a9d2f85@bootlin.com/

Past versions of MACB patches:
 - March 2025: [PATCH net-next 00/13] Support the Cadence MACB/GEM
   instances on Mobileye EyeQ5 SoCs
   https://lore.kernel.org/lkml/20250321-macb-v1-0-537b7e37971d@bootlin.com/
 - June 2025: [PATCH net-next v2 00/18] Support the Cadence MACB/GEM
   instances on Mobileye EyeQ5 SoCs
   https://lore.kernel.org/lkml/20250627-macb-v2-0-ff8207d0bb77@bootlin.com/
 - August 2025: [PATCH net v3 00/16] net: macb: various fixes & cleanup
   https://lore.kernel.org/lkml/20250808-macb-fixes-v3-0-08f1fcb5179f@bootlin.com/

---
Jerome Brunet (1):
      clk: eyeq: use the auxiliary device creation helper

Théo Lebrun (2):
      clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs
      reset: eyeq: drop device_set_of_node_from_dev() done by parent

 drivers/clk/clk-eyeq.c     | 60 ++++++++++++----------------------------------
 drivers/reset/reset-eyeq.c | 24 ++-----------------
 2 files changed, 17 insertions(+), 67 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20251022-macb-phy-21bc4e1dfbb7

Best regards,
-- 
Théo Lebrun <theo.lebrun@bootlin.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v7 1/3] clk: eyeq: use the auxiliary device creation helper
  2026-02-25 16:55 [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Théo Lebrun
@ 2026-02-25 16:55 ` Théo Lebrun
  2026-02-25 16:55 ` [PATCH v7 2/3] clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs Théo Lebrun
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Théo Lebrun @ 2026-02-25 16:55 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Philipp Zabel
  Cc: linux-mips, linux-clk, linux-kernel, Vladimir Kondratiev,
	Gregory CLEMENT, Benoît Monin, Tawfik Bayouk,
	Thomas Petazzoni, Luca Ceresoli, Théo Lebrun, Jerome Brunet

From: Jerome Brunet <jbrunet@baylibre.com>

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éo Lebrun <theo.lebrun@bootlin.com>  # On Mobileye EyeQ5
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
 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 81137269352d..b231d6deb209 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 device *dev,
 	}
 }
 
-static void eqc_auxdev_release(struct device *dev)
-{
-	struct auxiliary_device *adev = 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 *base,
+				       const char *name)
 {
 	struct auxiliary_device *adev;
-	int ret;
 
-	adev = kzalloc_obj(*adev);
-	if (!adev)
-		return -ENOMEM;
-
-	adev->name = name;
-	adev->dev.parent = dev;
-	adev->dev.platform_data = (void __force *)base;
-	adev->dev.release = eqc_auxdev_release;
-	adev->id = id;
-
-	ret = auxiliary_device_init(adev);
-	if (ret)
-		return ret;
-
-	ret = auxiliary_device_add(adev);
-	if (ret)
-		auxiliary_device_uninit(adev);
-
-	return ret;
+	if (name) {
+		adev = devm_auxiliary_device_create(dev, name,
+						    (void __force *)base);
+		if (!adev)
+			dev_warn(dev, "failed creating auxiliary device %s.%s\n",
+				 KBUILD_MODNAME, name);
+	}
 }
 
 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;
 
 	data = device_get_match_data(dev);
 	if (!data)
@@ -379,21 +358,9 @@ static int eqc_probe(struct platform_device *pdev)
 	if (!base)
 		return -ENOMEM;
 
-	/* Init optional reset auxiliary device. */
-	if (data->reset_auxdev_name) {
-		ret = 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 = 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);
 
 	if (data->pll_count + data->div_count + data->fixed_factor_count == 0)
 		return 0; /* Zero clocks, we are done. */

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v7 2/3] clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs
  2026-02-25 16:55 [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Théo Lebrun
  2026-02-25 16:55 ` [PATCH v7 1/3] clk: eyeq: use the auxiliary device creation helper Théo Lebrun
@ 2026-02-25 16:55 ` Théo Lebrun
  2026-02-25 16:55 ` [PATCH v7 3/3] reset: eyeq: drop device_set_of_node_from_dev() done by parent Théo Lebrun
  2026-04-20  8:51 ` [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Benoît Monin
  3 siblings, 0 replies; 5+ messages in thread
From: Théo Lebrun @ 2026-02-25 16:55 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Philipp Zabel
  Cc: linux-mips, linux-clk, linux-kernel, Vladimir Kondratiev,
	Gregory CLEMENT, Benoît Monin, Tawfik Bayouk,
	Thomas Petazzoni, Luca Ceresoli, Théo Lebrun

Grow our clk-eyeq family; it knows how to spawn reset provider and pin
controller children. Expand with a generic PHY driver on EyeQ5.

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
 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 b231d6deb209..b17f47fda1da 100644
--- a/drivers/clk/clk-eyeq.c
+++ b/drivers/clk/clk-eyeq.c
@@ -109,6 +109,7 @@ struct eqc_match_data {
 
 	const char		*reset_auxdev_name;
 	const char		*pinctrl_auxdev_name;
+	const char		*eth_phy_auxdev_name;
 
 	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);
 
 	if (data->pll_count + data->div_count + data->fixed_factor_count == 0)
 		return 0; /* Zero clocks, we are done. */
@@ -521,6 +523,7 @@ static const struct eqc_match_data eqc_eyeq5_match_data = {
 
 	.reset_auxdev_name = "reset",
 	.pinctrl_auxdev_name = "pinctrl",
+	.eth_phy_auxdev_name = "phy",
 
 	.early_clk_count = ARRAY_SIZE(eqc_eyeq5_early_plls) +
 			   ARRAY_SIZE(eqc_eyeq5_early_fixed_factors),

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v7 3/3] reset: eyeq: drop device_set_of_node_from_dev() done by parent
  2026-02-25 16:55 [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Théo Lebrun
  2026-02-25 16:55 ` [PATCH v7 1/3] clk: eyeq: use the auxiliary device creation helper Théo Lebrun
  2026-02-25 16:55 ` [PATCH v7 2/3] clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs Théo Lebrun
@ 2026-02-25 16:55 ` Théo Lebrun
  2026-04-20  8:51 ` [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Benoît Monin
  3 siblings, 0 replies; 5+ messages in thread
From: Théo Lebrun @ 2026-02-25 16:55 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Philipp Zabel
  Cc: linux-mips, linux-clk, linux-kernel, Vladimir Kondratiev,
	Gregory CLEMENT, Benoît Monin, Tawfik Bayouk,
	Thomas Petazzoni, Luca Ceresoli, Théo Lebrun, Jerome Brunet

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 <jbrunet@baylibre.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
---
 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_controller_dev *rcdev,
 	return eqr_of_xlate_internal(rcdev, reset_spec->args[0], reset_spec->args[1]);
 }
 
-static void eqr_of_node_put(void *_dev)
-{
-	struct device *dev = _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;
 
 	/*
-	 * 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 = 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 = of_match_node(dev->driver->of_match_table, dev->of_node);
 	if (!match || !match->data)

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device
  2026-02-25 16:55 [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Théo Lebrun
                   ` (2 preceding siblings ...)
  2026-02-25 16:55 ` [PATCH v7 3/3] reset: eyeq: drop device_set_of_node_from_dev() done by parent Théo Lebrun
@ 2026-04-20  8:51 ` Benoît Monin
  3 siblings, 0 replies; 5+ messages in thread
From: Benoît Monin @ 2026-04-20  8:51 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd
  Cc: Philipp Zabel, Théo Lebrun, linux-mips, linux-clk,
	linux-kernel, Vladimir Kondratiev, Gregory CLEMENT, Tawfik Bayouk,
	Thomas Petazzoni, Luca Ceresoli, Théo Lebrun, Jerome Brunet

Hello Michael, Stephen,

On Wednesday, 25 February 2026 at 17:55:04 CEST, Théo Lebrun wrote:
> EyeQ5 SoCs integrate two GEM instances. A system-controller register
> region named "OLB" has some control over the Ethernet PHY integration.
> 
> Extend the current OLB ecosystem with a new generic PHY driver.
>  - OLB is carried by one main platform driver: clk-eyeq.
>  - It instantiates auxiliary devices: reset-eyeq & pinctrl-eyeq5.
>  - We add a new one: phy-eyeq5-eth.
> 
> Mainly we spawn a new auxdev from clk-eyeq. But alongside we use the
> newly introduced helper devm_auxiliary_device_create() that has the
> implication of setting child dev->of_node from parent. That implies we
> must drop the device_set_of_node_from_dev() at the same time.
> 
> Philipp Zabel gave his ACK [2] for the reset patch to go into linux-clk.
> 
Is there any way to move forward with this series?

With the latest changes merged in Linus' tree the Mobileye EyeQ SoCs fail to
boot. This series is needed to resolve the boot failures.

Best regards,
-- 
Benoît Monin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-04-20  8:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 16:55 [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Théo Lebrun
2026-02-25 16:55 ` [PATCH v7 1/3] clk: eyeq: use the auxiliary device creation helper Théo Lebrun
2026-02-25 16:55 ` [PATCH v7 2/3] clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs Théo Lebrun
2026-02-25 16:55 ` [PATCH v7 3/3] reset: eyeq: drop device_set_of_node_from_dev() done by parent Théo Lebrun
2026-04-20  8:51 ` [PATCH v7 0/3] clk: eyeq: instantiate generic PHY children auxiliary device Benoît Monin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox