From nobody Mon Feb 9 14:33:50 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 8EE9236CDF8 for ; Tue, 21 Oct 2025 16:33:26 +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=1761064409; cv=none; b=VO4hkkysklp4hz9XFDYGy4Ta0QmpqjsxSP/vd4KyJXtoPfWSOEcKN/lpVjSOii9CACbvOyVTYlQiNHoWb9XClTiyFxRE2Edj3VAvZlbqZyt7m/jG6eZzA8KsxXduCyYoSgNR9b7Lxrm0op4T1SeMaXuUluu5e1kavKosWDG+a7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064409; c=relaxed/simple; bh=YfW7eaofKeij3YIheqmN9e/fMEX8qvmArJW7hECgxE8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CmkOGizljurBB2PsPq4MdqOOxsXOvKxvrsPoSVI9pEgnx8BXWBHJSwfY3R2dkL/YLivzmPNHfrNOVXM9jSimEQxkuQJZx40a1l9fD5jHzqmozJaoZ4DxodHL46enKaOLo11BoKX1eVIeS5BFVNQLSRoAafuxQ6ivN/Bs4p7bWgY= 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=nE5siTkC; 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="nE5siTkC" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id E91201A1594; Tue, 21 Oct 2025 16:33:24 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BDE0360680; Tue, 21 Oct 2025 16:33:24 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7E0F3102F241E; Tue, 21 Oct 2025 18:33:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064403; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=55HIhuBijKuHS2lkpMwIPNwxEIwRl8+fBGb4Po3C0G0=; b=nE5siTkC0EXtHonMTAKegXtp0rapyGqObL9hyxCLDBIv7wPa2CKlXTv4oHAEJJ77fIxGkx dZdALa24VQWG/phbLuGKtH81f/7cHlieY1A9SbD8k7QQt9k1fMauwCmrVj2u7A2wmnxo2M D1bHrMn6bvBGPQFwarbUPc6zycfuPUVKGLEGWO1J/gc6gQuWSEO4wg6e0CVQVkmK1rEvxd GOATDQgpFOppTwSJK24AjsPGVwbN0yDw7lfAbmgggfjH8pIhymhKRHLeISvQJL13lb5/RP 8YYWk5v9avNfkKzeBcoWrSBQ1Kh7cxfLeVJaomPNHWDu/YIk40In178whortEg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:47 +0200 Subject: [PATCH net-next 06/12] 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: <20251021-macb-eyeq5-v1-6-3b0b5a9d2f85@bootlin.com> References: <20251021-macb-eyeq5-v1-0-3b0b5a9d2f85@bootlin.com> In-Reply-To: <20251021-macb-eyeq5-v1-0-3b0b5a9d2f85@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Vladimir Kondratiev , =?utf-8?q?Gr=C3=A9gory_Clement?= , Russell King , Vinod Koul , Kishon Vijay Abraham I , Michael Turquette , Stephen Boyd , Thomas Bogendoerfer , Philipp Zabel Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-phy@lists.infradead.org, linux-clk@vger.kernel.org, Tawfik Bayouk , Thomas Petazzoni , =?utf-8?q?Beno=C3=AEt_Monin?= , Maxime Chevallier , =?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 --- 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 e681d7f39dfe..6ea99c5fd95c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2964,6 +2964,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; @@ -5188,6 +5192,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, @@ -5342,6 +5368,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 | @@ -5373,6 +5410,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