From nobody Mon Feb 9 13:57:28 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 6ECC22FD1BC for ; Wed, 22 Oct 2025 07:38:45 +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=1761118727; cv=none; b=sNkUFCE/Yfhpjn0yIrG0ufKboVQiX934lLRS1exw71vsUOOourUyDQmPYJ+0q3E+Z8al8esQBqPiyav99ZXVYhajshqIWleXv5bPDQpS0vUxuaH3yLaHk4hVKxprBqWBFDHx7EvKLzb/rgArVFqgFRM8E+PK8Agd9qA1HA4iDDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761118727; c=relaxed/simple; bh=1ZeIIsp8tJcHFQgz2Xfvqz7CZIB2p2BXgkSO/2IVTog=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ixkTR3sa7Dj5sWPZpVPu11O+zFuE3GHhfLrtNBj4Hw+ZS7tqBqpdy2MpPkSnO71gOgxV+rY5YYVv01yTYFdOwmtSjwI3MrQvm7jmUSRrCS23SPQg1nXunIl+tz/W2XqWa9chPljqBcUQ6jZsqbLQfvf68nGtQP/7Nd5zxX9H4/0= 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=M5W3DVxt; 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="M5W3DVxt" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id C830C4E41276; Wed, 22 Oct 2025 07:38:43 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9F65D606DC; Wed, 22 Oct 2025 07:38:43 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 2841E102F242A; Wed, 22 Oct 2025 09:38:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761118722; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ZZVaF5BoYgXRmfee23HnDH9NWUBGz7WnOPiHHT4qsbo=; b=M5W3DVxtTPW4ls9GZh6bRhB2ZbmMT71AAQO4/IdCCAKp6t+hq2RgM2GkQ1vYqFQSX7uxH5 Rg8WZoepgg1vQAWIaXMoeHeFkkRjcIk+EVUnlNyVhsY+4lUnnSsdBjLo17vXU6Rf4jJzZl t/oiIBtTEPx16xIo6pQwudCoYgEDeyz9ymdriOcXXQjx9MDqBWswcRH5/4ufnAMujXuI3S YLtdF5wSGf4GK6M5DbuzWc6CdwKESykkLre3ktSGgBhLpC/ktYr49aCVHHJt8lbPTWYZJX DOoygNMoAPyNBC4FTFryRBOcJBCBxD0XOuHrFPtgk+IEmymMupbxyqMT3n/IBQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 22 Oct 2025 09:38:14 +0200 Subject: [PATCH net-next v2 5/5] net: macb: Add "mobileye,eyeq5-gem" compatible 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: <20251022-macb-eyeq5-v2-5-7c140abb0581@bootlin.com> References: <20251022-macb-eyeq5-v2-0-7c140abb0581@bootlin.com> In-Reply-To: <20251022-macb-eyeq5-v2-0-7c140abb0581@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Russell King Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Beno=C3=AEt_Monin?= , =?utf-8?q?Gr=C3=A9gory_Clement?= , Maxime Chevallier , Tawfik Bayouk , Thomas Petazzoni , Vladimir Kondratiev , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 Add support for the two GEM instances inside Mobileye EyeQ5 SoCs, using compatible "mobileye,eyeq5-gem". With it, add a custom init sequence that must grab a generic PHY and initialise it. We use bp->phy in both RGMII and SGMII cases. Tell our mode by adding a phy_set_mode_ext() during macb_open(), before phy_power_on(). We are the first users of bp->phy that use it in non-SGMII cases. Signed-off-by: Th=C3=A9o Lebrun Reviewed-by: Maxime Chevallier --- drivers/net/ethernet/cadence/macb_main.c | 38 ++++++++++++++++++++++++++++= ++++ 1 file changed, 38 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 914677f30f2c..c45c6a7f42e6 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2963,6 +2963,10 @@ static int macb_open(struct net_device *dev) =20 macb_init_hw(bp); =20 + err =3D phy_set_mode_ext(bp->phy, PHY_MODE_ETHERNET, bp->phy_interface); + if (err) + goto reset_hw; + err =3D phy_power_on(bp->phy); if (err) goto reset_hw; @@ -5187,6 +5191,28 @@ static int init_reset_optional(struct platform_devic= e *pdev) return ret; } =20 +static int eyeq5_init(struct platform_device *pdev) +{ + struct net_device *netdev =3D platform_get_drvdata(pdev); + struct macb *bp =3D netdev_priv(netdev); + struct device *dev =3D &pdev->dev; + int ret; + + bp->phy =3D devm_phy_get(dev, NULL); + if (IS_ERR(bp->phy)) + return dev_err_probe(dev, PTR_ERR(bp->phy), + "failed to get PHY\n"); + + ret =3D phy_init(bp->phy); + if (ret) + return dev_err_probe(dev, ret, "failed to init PHY\n"); + + ret =3D macb_init(pdev); + if (ret) + phy_exit(bp->phy); + return ret; +} + static const struct macb_usrio_config sama7g5_usrio =3D { .mii =3D 0, .rmii =3D 1, @@ -5341,6 +5367,17 @@ static const struct macb_config versal_config =3D { .usrio =3D &macb_default_usrio, }; =20 +static const struct macb_config eyeq5_config =3D { + .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | + MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_QUEUE_DISABLE | + MACB_CAPS_NO_LSO, + .dma_burst_length =3D 16, + .clk_init =3D macb_clk_init, + .init =3D eyeq5_init, + .jumbo_max_len =3D 10240, + .usrio =3D &macb_default_usrio, +}; + static const struct macb_config raspberrypi_rp1_config =3D { .caps =3D MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | MACB_CAPS_JUMBO | @@ -5372,6 +5409,7 @@ static const struct of_device_id macb_dt_ids[] =3D { { .compatible =3D "microchip,mpfs-macb", .data =3D &mpfs_config }, { .compatible =3D "microchip,sama7g5-gem", .data =3D &sama7g5_gem_config = }, { .compatible =3D "microchip,sama7g5-emac", .data =3D &sama7g5_emac_confi= g }, + { .compatible =3D "mobileye,eyeq5-gem", .data =3D &eyeq5_config }, { .compatible =3D "raspberrypi,rp1-gem", .data =3D &raspberrypi_rp1_confi= g }, { .compatible =3D "xlnx,zynqmp-gem", .data =3D &zynqmp_config}, { .compatible =3D "xlnx,zynq-gem", .data =3D &zynq_config }, --=20 2.51.1