From nobody Sun Feb 8 12:20:22 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 793EC34DB7C; Tue, 21 Oct 2025 16:33:12 +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=1761064394; cv=none; b=ZQuMhMFYjh78KnTvfZ08U60cMFAZjJQtkTJSXrR24j7XMRO+4md/ES5Bm9RL4XNBa2cFkdwFhgwXXV43POirZTURPJYgBuF/zamMvta4NSeXpq29jP0BtiyjHq06xx1la/iQdgOitLhJ+SqxfEonCjmFU88yGOT4egcvSpm7Fg8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064394; c=relaxed/simple; bh=k4MMwotRueKQ73IFVBunfx4WBg3XwCGO4UhdsRh7hww=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qn10JfWT+g7DjHQJTphwxwbXHK4UI8rkjOjikqxZzX448FUtrkGqe3us3QHevEcggkgLAZMmirRLFuDxOh4atUXhK4kATk8qkMP1t/D7BrerUfvWoufLO4rzz/RCv3UCdk/dO0PRXVpc7INeUGMLmIXfQWae+tBM9H+dAEKgYIA= 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=dd2WKl4r; 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="dd2WKl4r" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 9293F4E41242; Tue, 21 Oct 2025 16:33:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 66D0460680; Tue, 21 Oct 2025 16:33:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 3030F102F2405; Tue, 21 Oct 2025 18:33:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064388; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=L/XpHoQ2KPQc9riZ+r/LMfIVvh/XodPx0VGR9VmHzQ0=; b=dd2WKl4rlX7iuNhneCMwl8/nGilha0A6oGI+pLtSZKJzGZRFeYUyZnpqOB9uBhZ2Aegwee FYSAzU+yRZcfq/RU0ZriMlXqtD0aNxcf4erzxc0wrUnFnCcWXfwYF6Z7at63J+0UnFyzDw AEvdOE2zCuZEg+ZmUaAX/+/oaaL/XedOyMV1M2AIPDliW0HK+b2lRy6aDJNWOmWBVYJDm9 ZDa5cGU5rKh/T5heRPKK4ZGfLiTNTAhnbWNCDIVmL5FQj9n6IL4UVPlcQbwZaJufYUpSac J+zemdnErjqGuFG73uRCBlqLJlWyF+eO2ka4Ei9j11+TagCvmYxLXlo62RFyfQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:42 +0200 Subject: [PATCH net-next 01/12] dt-bindings: net: cdns,macb: add Mobileye EyeQ5 ethernet interface 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-1-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 "cdns,eyeq5-gem" as compatible for the integrated GEM block inside Mobileye EyeQ5 SoCs. It is different from other compatibles in two main ways: (1) it requires a generic PHY and (2) it is better to keep TCP Segmentation Offload (TSO) disabled. Signed-off-by: Th=C3=A9o Lebrun --- Documentation/devicetree/bindings/net/cdns,macb.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documen= tation/devicetree/bindings/net/cdns,macb.yaml index 02f14a0b72f9..ea8337846ab2 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -57,6 +57,7 @@ properties: - cdns,np4-macb # NP4 SoC devices - microchip,sama7g5-emac # Microchip SAMA7G5 ethernet interfa= ce - microchip,sama7g5-gem # Microchip SAMA7G5 gigabit ethernet= interface + - mobileye,eyeq5-gem # Mobileye EyeQ5 SoCs - raspberrypi,rp1-gem # Raspberry Pi RP1 gigabit ethernet = interface - sifive,fu540-c000-gem # SiFive FU540-C000 SoC =20 @@ -183,6 +184,15 @@ allOf: reg: maxItems: 1 =20 + - if: + properties: + compatible: + contains: + const: mobileye,eyeq5-gem + then: + required: + - phys + unevaluatedProperties: false =20 examples: --=20 2.51.1 From nobody Sun Feb 8 12:20:22 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 DBA7F34EEF0; Tue, 21 Oct 2025 16:33:14 +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=1761064397; cv=none; b=OaUgKDStEch3bM/vVfUpjE9WzahnjOF8lWwOZ17z1woLENhUU4e3DCKfGw9FY0gGQkCj8/RalMrZoOATMJfV5yB0jFQeM5Qn70fmiek1UummVUaNY63a+Y22RW2pEju8fnevmMQDKg1xyx8CXocVmqRDUVgdLYyTONqHQ4sEGO0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064397; c=relaxed/simple; bh=rZcNBy0W96w3tKwJAsBNWor77WT+oJZEXtI0CDHM2Yw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BbVPm79ZQSlff5Mhgo1fUMUbcHmskHbedsw3BeXVzGT/Ida1W+96clf+ULV7tbUAl7OsGXZpayqBZiOrK+sNf39i4TYb7f2o/kpY8YznsJN2+V7F4ffl48RhCPgz77q8AZjwpI/+Uj7CN8BBsdFf0Is4T8LFLcoiC6W9DFZVKN4= 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=YPQNlRFF; 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="YPQNlRFF" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 4A3911A1594; Tue, 21 Oct 2025 16:33:13 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 1E9F560680; Tue, 21 Oct 2025 16:33:13 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1D458102F241A; Tue, 21 Oct 2025 18:33:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064391; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=yPUyMjKAjZ0F5FN4IZiPv/08Pn+WpcjonUV7I71eTcw=; b=YPQNlRFFGaxd7DgH6344wSqBklEVwYtRxmrrNu8c+Jx1J8Q9y7ai+wKAGVd9JO7zN3LrTY S44S1/arFyXU+J8mePfOwyQa7Pmw21IzG3YiLu8WQHBEnwQvZtlznzrV0ue1yEAgXFxb9r r9gOR+HTk98SAsK1D75jX2CPWSEt1cwxh6GPepiqc4ELYq1oq5BHJ48yebCzvXIWKLZHN5 ItW3JwTD9V0rncRjpTGBwVaopxVeHo/NsEK3ukSor3HLrDTZLEb4mYpl/69kEWVWtzqbbK lk6WPGtMS3sZ4BRE3tgsJvOHUkOwC7KdQQiJI61/Bg9/k/MSV2v5zJIcYio4CA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:43 +0200 Subject: [PATCH net-next 02/12] 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: <20251021-macb-eyeq5-v1-2-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 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. 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 Sun Feb 8 12:20:22 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 C88B634FF4E for ; Tue, 21 Oct 2025 16:33:17 +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=1761064399; cv=none; b=ItAItiXJyz3f2T8gxKVUVEtgD5VbwGEJoujB+kyo2sWAGuEZLhXXxOAzHaqizfqkKXO5LKwbWwu/1X1ClOGFJab1CnfBgxUAU/njIJ/J0JB0UWkFLI0OAgL8084iCKBfPgcrPkfFFLIh4snuGSaR7tzPi+kZf5tIJ4oe6SLlMzI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064399; c=relaxed/simple; bh=0QkH3T2bEXT83CHCQSI6m5aj4GerMQ/hyyR5h0m9pvw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tkm2WUta8U/9yT9PY/AZrCzT5EtTi6IPVfuZ6LbM0B0ejMfHvLW8ga/tK2FOKuMU893Z6JZcd7nU68H+xYLU186eDoG/Xnnvyvp2kbQnfpXH/V8EIx+NgyQObB4+1kEmYEc0pRE4MYyfffjenwZx+hi+IQ+B3IKyBvkRfrNmmhs= 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=xOOXa3ih; 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="xOOXa3ih" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 193671A15A2; Tue, 21 Oct 2025 16:33:16 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E1D4F60680; Tue, 21 Oct 2025 16:33:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id E3E4B102F23EA; Tue, 21 Oct 2025 18:33:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064394; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=j8hzkMx0NGZAJQ/xFkuORjF0T7wqXOb0/2K4DFFgOl8=; b=xOOXa3ih9rTHX6pBNbuMIj9QgflJXrD8M2PwQra8Sou1iFuJH953sMTHOiFzgJIO3xgO4Q eo0jHAS0RuQIVRK2+L8Kpai4CLYbItShUEmDAhoXbqgB+M9BSSVuOE8I047yPRSj5SLS9B LkiII1STET/nKnamzD2u6Yt+vGaoSWcvBz7T0xE7PyU7lNWJQdESc6pF+y6Tw3id6vzsIV bF1xJKj6n/2k8Di9c3NzGmzhdHPbAvOa8yK0SMv26KfNobS2KgO5o0mQER3GwH4zPEc4xq c6JwVfHCWurZNuMG1DWPJ5ZmbvaQgDZJ4Jv0oOdu3V9GswCOUc5YfeWCyNPgCQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:44 +0200 Subject: [PATCH net-next 03/12] net: macb: match skb_reserve(skb, NET_IP_ALIGN) with HW alignment 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-3-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 If HW is RSC capable, it cannot add dummy bytes at the start of IP packets. Alignment (ie number of dummy bytes) is configured using the RBOF field inside the NCFGR register. On the software side, the skb_reserve(skb, NET_IP_ALIGN) call must only be done if those dummy bytes are added by the hardware; notice the skb_reserve() is done AFTER writing the address to the device. We cannot do the skb_reserve() call BEFORE writing the address because the address field ignores the low 2/3 bits. Conclusion: in some cases, we risk not being able to respect the NET_IP_ALIGN value (which is picked based on unaligned CPU access performance). Fixes: 4df95131ea80 ("net/macb: change RX path for GEM") Signed-off-by: Th=C3=A9o Lebrun --- drivers/net/ethernet/cadence/macb.h | 3 +++ drivers/net/ethernet/cadence/macb_main.c | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 5b7d4cdb204d..93e8dd092313 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -537,6 +537,8 @@ /* Bitfields in DCFG6. */ #define GEM_PBUF_LSO_OFFSET 27 #define GEM_PBUF_LSO_SIZE 1 +#define GEM_PBUF_RSC_OFFSET 26 +#define GEM_PBUF_RSC_SIZE 1 #define GEM_PBUF_CUTTHRU_OFFSET 25 #define GEM_PBUF_CUTTHRU_SIZE 1 #define GEM_DAW64_OFFSET 23 @@ -775,6 +777,7 @@ #define MACB_CAPS_MACB_IS_GEM BIT(20) #define MACB_CAPS_DMA_64B BIT(21) #define MACB_CAPS_DMA_PTP BIT(22) +#define MACB_CAPS_RSC BIT(23) =20 /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 214f543af3b8..8d951faf00c3 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -1301,8 +1301,19 @@ static void gem_rx_refill(struct macb_queue *queue) dma_wmb(); macb_set_addr(bp, desc, paddr); =20 - /* properly align Ethernet header */ - skb_reserve(skb, NET_IP_ALIGN); + /* Properly align Ethernet header. + * + * Hardware can add dummy bytes if asked using the RBOF + * field inside the NCFGR register. That feature isn't + * available if hardware is RSC capable. + * + * We cannot fallback to doing the 2-byte shift before + * DMA mapping because the address field does not allow + * setting the low 2/3 bits. + * It is 3 bits if HW_DMA_CAP_PTP, else 2 bits. + */ + if (!(bp->caps & MACB_CAPS_RSC)) + skb_reserve(skb, NET_IP_ALIGN); } else { desc->ctrl =3D 0; dma_wmb(); @@ -2774,7 +2785,9 @@ static void macb_init_hw(struct macb *bp) macb_set_hwaddr(bp); =20 config =3D macb_mdc_clk_div(bp); - config |=3D MACB_BF(RBOF, NET_IP_ALIGN); /* Make eth data aligned */ + /* Make eth data aligned. If RSC capable, that offset is ignored by HW. */ + if (!(bp->caps & MACB_CAPS_RSC)) + config |=3D MACB_BF(RBOF, NET_IP_ALIGN); config |=3D MACB_BIT(DRFCS); /* Discard Rx FCS */ if (bp->caps & MACB_CAPS_JUMBO) config |=3D MACB_BIT(JFRAME); /* Enable jumbo frames */ @@ -4322,6 +4335,8 @@ static void macb_configure_caps(struct macb *bp, dcfg =3D gem_readl(bp, DCFG2); if ((dcfg & (GEM_BIT(RX_PKT_BUFF) | GEM_BIT(TX_PKT_BUFF))) =3D=3D 0) bp->caps |=3D MACB_CAPS_FIFO_MODE; + if (GEM_BFEXT(PBUF_RSC, gem_readl(bp, DCFG6))) + bp->caps |=3D MACB_CAPS_RSC; if (gem_has_ptp(bp)) { if (!GEM_BFEXT(TSU, gem_readl(bp, DCFG5))) dev_err(&bp->pdev->dev, --=20 2.51.1 From nobody Sun Feb 8 12:20:22 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 4D3DB34FF6D; Tue, 21 Oct 2025 16:33:20 +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=1761064402; cv=none; b=qj7YunAWSFr4fxcTow9dlb37EouZX/Wyt8nYSORjFwhuQOjst/rzPC1RMjp0BpMB1iheV+sajRH2C1zkprNDOQGz2s579+WxCmdaFH0JAo+NDuyZfeiz6WZK4EpnrOBMbtCGvklw2IUuLdQF/hDBIf8AGCTz41fA54wxwFblIXE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064402; c=relaxed/simple; bh=Tc8l9ZFS/27xtiHKic+Nw9ObTz+Q5Z1+7UxI999xik8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=P3V2SFI6RbExSO/VqytLiBOsezwiMfuAv8HPwHf0R1+Hejcnm+J1LgCDkOnj+83gpIjN8O4uV4ZTtKe84rgB22qBGWK3LSijL0fG7+e6WdlMz/j3nZ2hPCu8N83cmHq46epn8wmvz/Pv+KZQpyEOOcyPwcIwtp9COEXClnJgULg= 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=B9BCn44P; 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="B9BCn44P" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 4664EC0B89B; Tue, 21 Oct 2025 16:32:59 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id D414960680; Tue, 21 Oct 2025 16:33:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A1457102F2405; Tue, 21 Oct 2025 18:33:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064397; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=9mdT22bW8hHz3UcIVW5ieLvCN8QVDlwvevK9AMuWtRA=; b=B9BCn44P1EQNhvnmT7q8H6NA7TPYf+yZ1iSyRr+1SrLAbt1TuWnwmShY4Q6KIpfIsw8VvO t4zMt3FIB3+nPHNhUkseiOirAi6UN1puhnpuKcGWzZdAP9Yaym3HG+N8DbUOpyH9B97r2P OOY1jeisVrox9fOjGc8IobkUePTFQyL03YDP0ytqGhTqWiaJ2bG1V7XGv90w85Pz+pyLIe ZiLDwwj3rWf506aDfuwK3GHxIP02fsYDfqyQiEaKpC44953PNfJaN3uh2FNvkT8pOGXW3i 3+Wgyim9kJqJA1IE8+0bF91dbXaTTbQQTg2NJ/F/HI+pukCAS5pYTlbrgsEaug== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:45 +0200 Subject: [PATCH net-next 04/12] net: macb: add no LSO capability (MACB_CAPS_NO_LSO) 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-4-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?= , Andrew Lunn X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 LSO is runtime-detected using the PBUF_LSO field inside register DCFG6. Allow disabling that feature if it is broken by using bp->caps coming from match data. Reviewed-by: Andrew Lunn Signed-off-by: Th=C3=A9o Lebrun --- drivers/net/ethernet/cadence/macb.h | 1 + drivers/net/ethernet/cadence/macb_main.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 93e8dd092313..05bfa9bd4782 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -778,6 +778,7 @@ #define MACB_CAPS_DMA_64B BIT(21) #define MACB_CAPS_DMA_PTP BIT(22) #define MACB_CAPS_RSC BIT(23) +#define MACB_CAPS_NO_LSO BIT(24) =20 /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 8d951faf00c3..2010f9290c5c 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4563,8 +4563,11 @@ static int macb_init(struct platform_device *pdev) /* Set features */ dev->hw_features =3D NETIF_F_SG; =20 - /* Check LSO capability */ - if (GEM_BFEXT(PBUF_LSO, gem_readl(bp, DCFG6))) + /* Check LSO capability; runtime detection can be overridden by a cap + * flag if the hardware is known to be buggy + */ + if (!(bp->caps & MACB_CAPS_NO_LSO) && + GEM_BFEXT(PBUF_LSO, gem_readl(bp, DCFG6))) dev->hw_features |=3D MACB_NETIF_LSO; =20 /* Checksum offload is only available on gem with packet buffer */ --=20 2.51.1 From nobody Sun Feb 8 12:20:22 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 13B5A3570CA; Tue, 21 Oct 2025 16:33:22 +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=1761064405; cv=none; b=YySGzBfUEk6RYQBXcVMCe8giVwvi5nWki3yo+NkUxWkELpgTp+pXlCq4ssP8f0gL3djRrVYlLq1qQGN74ECnT/YL/8IjVH9EBKY+E+3krUDVtP6iXQIspTLl83X8Ay9ZUdYZaipx/aYlEdFPz+OUrpCA/evueuJld8UC2pgoR7A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064405; c=relaxed/simple; bh=OVeojU0e6cZ4AISHl+17rLRwZGofP8ADuuiMAkxEK20=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rxYsP3/NbpJXwtdsRLjLuIQkMHBtZBXN6gnlT6bC7Cr2GbC9mx4yuHlr0G7mfdk41Q02Hq06VIVUp5q8RxKx2cV/XNteYQrWVbzySswMvvYfLewgjp5A4sIFngTb+BF386XETDKq3mIYXzqbzPoD6YPNUbURAECxEHqQVvzCyFw= 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=I0mLE1gh; 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="I0mLE1gh" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 06C70C0B898; Tue, 21 Oct 2025 16:33:02 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 95BB260680; Tue, 21 Oct 2025 16:33:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8D379102F241D; Tue, 21 Oct 2025 18:33:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064400; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=m5DMRTEOrzsIfvkRyqHc14yMBWIw4RysCufBCFCgiU0=; b=I0mLE1ghy/2tGEahiXxQjzMrqiyF6+bkbfsX8BGUvOGA7mJroxYSTybmcvWGoYdHau+645 HpoCpG9UK2l3PDu3MJdv0ZNM/hYjijZrkAFNF+pc2wU3eHW+PP9PaXQpo6bvAPV5U0NXTn d+GmA/0E5MvfliAu6ttCXb3EV47sRMFhH7ZhKO/17tLQvqTXlWF5fZgSAxJLuSnwiO5LjT crOkMmKuyXWB+fz/UOmc91qgf2QRfHkcw3Pk2Ysqtlxk7I8FVuhTM5KU4ch094Vg07/buW tlXvQx/p4bGTRjovtuyFRsSIjAKkvViAZXZ/1He07PBOTZFv2BmWMkFILxp0Fw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:46 +0200 Subject: [PATCH net-next 05/12] net: macb: rename bp->sgmii_phy field to bp->phy 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-5-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 The bp->sgmii_phy field is initialised at probe by init_reset_optional() if bp->phy_interface =3D=3D PHY_INTERFACE_MODE_SGMII. It gets used by: - zynqmp_config: "cdns,zynqmp-gem" or "xlnx,zynqmp-gem" compatibles. - mpfs_config: "microchip,mpfs-macb" compatible. - versal_config: "xlnx,versal-gem" compatible. Make name more generic as EyeQ5 requires the PHY in SGMII & RGMII cases. Drop "for ZynqMP SGMII mode" comment that is already a lie, as it gets used on Microchip platforms as well. And soon it won't be SGMII-only. Signed-off-by: Th=C3=A9o Lebrun --- drivers/net/ethernet/cadence/macb.h | 2 +- drivers/net/ethernet/cadence/macb_main.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cad= ence/macb.h index 05bfa9bd4782..87414a2ddf6e 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1341,7 +1341,7 @@ struct macb { =20 struct macb_ptp_info *ptp_info; /* macb-ptp interface */ =20 - struct phy *sgmii_phy; /* for ZynqMP SGMII mode */ + struct phy *phy; =20 spinlock_t tsu_clk_lock; /* gem tsu clock locking */ unsigned int tsu_rate; diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/etherne= t/cadence/macb_main.c index 2010f9290c5c..e681d7f39dfe 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -2964,7 +2964,7 @@ static int macb_open(struct net_device *dev) =20 macb_init_hw(bp); =20 - err =3D phy_power_on(bp->sgmii_phy); + err =3D phy_power_on(bp->phy); if (err) goto reset_hw; =20 @@ -2980,7 +2980,7 @@ static int macb_open(struct net_device *dev) return 0; =20 phy_off: - phy_power_off(bp->sgmii_phy); + phy_power_off(bp->phy); =20 reset_hw: macb_reset_hw(bp); @@ -3012,7 +3012,7 @@ static int macb_close(struct net_device *dev) phylink_stop(bp->phylink); phylink_disconnect_phy(bp->phylink); =20 - phy_power_off(bp->sgmii_phy); + phy_power_off(bp->phy); =20 spin_lock_irqsave(&bp->lock, flags); macb_reset_hw(bp); @@ -5140,13 +5140,13 @@ static int init_reset_optional(struct platform_devi= ce *pdev) =20 if (bp->phy_interface =3D=3D PHY_INTERFACE_MODE_SGMII) { /* Ensure PHY device used in SGMII mode is ready */ - bp->sgmii_phy =3D devm_phy_optional_get(&pdev->dev, NULL); + bp->phy =3D devm_phy_optional_get(&pdev->dev, NULL); =20 - if (IS_ERR(bp->sgmii_phy)) - return dev_err_probe(&pdev->dev, PTR_ERR(bp->sgmii_phy), + if (IS_ERR(bp->phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(bp->phy), "failed to get SGMII PHY\n"); =20 - ret =3D phy_init(bp->sgmii_phy); + ret =3D phy_init(bp->phy); if (ret) return dev_err_probe(&pdev->dev, ret, "failed to init SGMII PHY\n"); @@ -5175,7 +5175,7 @@ static int init_reset_optional(struct platform_device= *pdev) /* Fully reset controller at hardware level if mapped in device tree */ ret =3D device_reset_optional(&pdev->dev); if (ret) { - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); return dev_err_probe(&pdev->dev, ret, "failed to reset controller"); } =20 @@ -5183,7 +5183,7 @@ static int init_reset_optional(struct platform_device= *pdev) =20 err_out_phy_exit: if (ret) - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); =20 return ret; } @@ -5593,7 +5593,7 @@ static int macb_probe(struct platform_device *pdev) mdiobus_free(bp->mii_bus); =20 err_out_phy_exit: - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); =20 err_out_free_netdev: free_netdev(dev); @@ -5617,7 +5617,7 @@ static void macb_remove(struct platform_device *pdev) if (dev) { bp =3D netdev_priv(dev); unregister_netdev(dev); - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); mdiobus_unregister(bp->mii_bus); mdiobus_free(bp->mii_bus); =20 @@ -5644,7 +5644,7 @@ static int __maybe_unused macb_suspend(struct device = *dev) u32 tmp; =20 if (!device_may_wakeup(&bp->dev->dev)) - phy_exit(bp->sgmii_phy); + phy_exit(bp->phy); =20 if (!netif_running(netdev)) return 0; @@ -5773,7 +5773,7 @@ static int __maybe_unused macb_resume(struct device *= dev) int err; =20 if (!device_may_wakeup(&bp->dev->dev)) - phy_init(bp->sgmii_phy); + phy_init(bp->phy); =20 if (!netif_running(netdev)) return 0; --=20 2.51.1 From nobody Sun Feb 8 12:20:22 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 From nobody Sun Feb 8 12:20:22 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 7D012393DE6; Tue, 21 Oct 2025 16:33: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=1761064411; cv=none; b=lSZM37fkodeKZAVnl4y1lR2XBeHa+bXmNcPg+HW2vsedAyERsb3nO4R9viQr2//KdRVO0g3RIwpr2NSEuiDCUb6JqKycaayTz2PyK3iEYC6hELlJFZL81Hewp2DdfB73aWX/2qHhQXrwGrGrAYxRxhpxXtQm9OUwTxJA0Qg1Z/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064411; c=relaxed/simple; bh=xV60f3TtPvPBOIFwVX8eX6hNiPNHrPFaLwFfddy15oE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k52iQaSfLhJ+dlt9+f2Jyp8AtcsnoHrWV/FQ9rHxWUl27oi0XDwHUB/30HNWG9hF3Du3/X6lKWh72Ht2iIh7/GRB2SG1Cq7jdHJoSEL/ud8zWIqK28IA6GLolbG8Qhnw7zP3p9b0KD7W0yNxXVoRMfWDA6vxpLe0y7oCsV9W8M4= 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=aW7jfsdE; 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="aW7jfsdE" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id E67EA4E41244; Tue, 21 Oct 2025 16:33:27 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A7207606DC; Tue, 21 Oct 2025 16:33:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 969A9102F241B; Tue, 21 Oct 2025 18:33:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064406; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=UkWINqjsktsmgYG+Rct1tziwvmjmpVHnO11D//uy5lU=; b=aW7jfsdEfLiIZ1s1wMu/DjmPZCLQHbqRs17oyRXcxOEOuvvlWOliw7dinPqEsJXfxv7SXg yacBUF0hOfXhmwehBH1vJ/zWSYAXZ4zMRlOd5vxqt891vFc0uzKdfvqlq42cPzu2K1OF+A s4dGpmqZV5wurg+nz7AwIlULZiVyffIfMlMyzYu2xiuSN1Y+QFBc5WtcyWiA4T0zImZbNO PY7tctF10o4JoFnnHpC6ygTUnwF7pfR2U0akqSjYvA1SjT0KklKenNibiUp9mqwpoCG5jM Kn9kPdF5lTfc3Q/6fLX54iKWFRg214v9O8QJ0FS+r/IVcQTlo7Vc+kRDNAHqJg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:48 +0200 Subject: [PATCH net-next 07/12] 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: <20251021-macb-eyeq5-v1-7-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 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 4faa7719bf86..0ff4d9ce57e8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -17382,6 +17382,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..b65c3d733f6c --- /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%ld)\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%ld)\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%ld, 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%ld)\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%ld)\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 Sun Feb 8 12:20:22 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 1FC742FD66F; Tue, 21 Oct 2025 16:33:31 +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=1761064414; cv=none; b=jSB04AjxNybY34cMxt568Mi8miFhZqTOYrAYa3oGsAr32uJ7IIKty04cEsGtHjwIuCyO0R0wviOTNkQt/8fbUiTVFdOi6QswpjX9eHSgmUme6kjNupD9LsgesbBOYsoPoGVBkdOP8hyqIViVT9SUUzD5SAx7r+067a+JnydDtos= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064414; c=relaxed/simple; bh=sir3J4gSwhHTRdJ1BAz2vNiZTw6r2T/fSmbbEzzZvdM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AEib3EZnguKrv+G8xxBjbJxBR2KbxeigxyQK64Q/dkpkhHNYXQGoTSSUpKXS7ZYs/fzg6deI8T3zQf8ferYPJk6DBuX7UQe9J5MrPJ9ydYoytPiUOn3nv6QcusGR5o5QMhznCy50G9MK9jH9iDg67B4AjmvcDkW5MAOsZ3aibcU= 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=xX8WnMrx; 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="xX8WnMrx" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 14E95C0B896; Tue, 21 Oct 2025 16:33:11 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A25CE60680; Tue, 21 Oct 2025 16:33:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 6E84C102F241F; Tue, 21 Oct 2025 18:33:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064409; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=M7/ONsHb0ArB5bCF7FZGbfdHV5WjqY9DA/Z65CQxU0E=; b=xX8WnMrxi/X88u7Eg5zoCx9CHz5yL2wsY3l/KUe00x1hEU7zWZkmpabCMmV8Yxh3IM23Oi eGw5pf4isLqxz61epTfXCZ3AfuiPiFx1qz9RWgfyzi5ES3PqoJsX6K0LRNBnBgzGKCL04d c7eKbBQmgwH1iHUSY8J1nHKhNVZwAb5GOmH+2ZP7Jy+RpJVM8eAeSKs9YSrrCJBhBClaq6 n64tR7E6vUqVcEVzvhv5jDfNIG0pLejBn+MsUcadzor24P74zxio0nNPvu/RIM14+SWhR2 VHomIvVcLdGL9VRt5g7DmT+KGiRbOPM4TmFOsntz40A4ExclfTIcCVnSF50dOw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:49 +0200 Subject: [PATCH net-next 08/12] 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: <20251021-macb-eyeq5-v1-8-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?= , 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 Sun Feb 8 12:20:22 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 C6A582FD698; Tue, 21 Oct 2025 16:33:34 +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=1761064416; cv=none; b=SQINIMy47fXRNxnPSU9jZJ4H8wbTEVhyE01ER5zbX6cvj8vD14s0Y78cFkSvPSD0DZIR+IkG3nQjd6dr6hRfa9+OXFkg2ITy0JHUHnUfpvL83RgacCMHE1Zec2abL4LUuu3k+E0ac0tPA6GNlBqGI0CeE1pn5VtnR96t5/XhSqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064416; c=relaxed/simple; bh=NYG+ETPj2x0u/ibgpjtgBYkOFUnLc2KAk3q8zgMWzxY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tmW3kO/xs3/pq1Uf5Rv96OIm0XXkguvVz22a6nX0glxz2W8DjEv9+WRxxsGH21prxL/PLwPpqI7ou5cUmxcFBD2MsuDxK+Tzdso60xt7G8yGQlIidsc+eN9aCcOwmXUzJFd6tgE9WRZe0Oq+xmbnuW1ttCkMhiM4ZvF7rb+BWdI= 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=hThFaTb3; 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="hThFaTb3" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 714364E41242; Tue, 21 Oct 2025 16:33:33 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 459A960680; Tue, 21 Oct 2025 16:33:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 67E4F102F2420; Tue, 21 Oct 2025 18:33:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064412; 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=hThFaTb3NWJ1Rr18az1pUbD8tGPRjn9OEY0gD1T9HI+z0Betw9B4ykRFHjZLzIckB9t36D xorv3kPNkGBNMEzyQTc0Hhjv3IQov6rJNR75o67PREuFIjKMPiLd2aTOc9+qHfXj8O+cUf +5lkKLiXpnvi4dk7Q7PRMWStLt4R3vmnvcrRya1Bp4117dmxEdmNDMz8e9q5T1plVv3P3l 7NIsmJ3J5vsFD1o7oJC5agheNM672E18NXrUWBOYaifvpkylmsxG92fdGvoHYkMRaBBaOP x9fBM2ZBCvgIH2/fhJ4w9Smj2UI7oTD/5I+mGHFcwUhQqvXiIsRhhkwJX521bg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:50 +0200 Subject: [PATCH net-next 09/12] 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: <20251021-macb-eyeq5-v1-9-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 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 Sun Feb 8 12:20:22 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 05546347BD2; Tue, 21 Oct 2025 16:33:38 +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=1761064419; cv=none; b=TLQ2HZwQoj5LpmdT2K4KiqN6jtXE5CgVurVxoEO4joKdrXzEFGFTghZWEHrwZ0igxXjt0f/DGFICeh95yRm2xi+weALEc5lPUUqVIwjMb+yc8Lxw/pkoDuHlHG4k9QXN7jQzlul+1nz9qdFuiHjVKWZkauqhS5Rr5h7bXlNZIeM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064419; c=relaxed/simple; bh=rgtM81TJHrWSLfa7vgXN8x+VRWEr3crk3rI32ufCnI8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Z+Uka0wHiBILs9tMztvoOTbo+JjOGfq9/52/EVd9nweNjMkdRNVM7DBrnqAFQ7JHy4TAOt+oTLXNMv2Ggrpt4HH1Zh7/OkcqqlB88dAYdh7OuysMMvkzHIoGgpnklGjaFwrGD8/KcQ0sNbQTUd16pxBvS5HXDDQ34kjblnH3l9U= 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=sxsR+CaX; 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="sxsR+CaX" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 9B8111A15A2; Tue, 21 Oct 2025 16:33:36 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 7079B60680; Tue, 21 Oct 2025 16:33:36 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4D937102F23EA; Tue, 21 Oct 2025 18:33:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064414; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=rXG4FkA1j+W5VMPKCg2jc3dsIgNY9MiT6EY2h7XkH50=; b=sxsR+CaXLvjl/7psgeW+JC6y3nWIm9BpQITQMKDJrnVVNa7pB3ylvY1sZKwwqbc1zCxslu 7cIvkdwzUu56dN9CRvIDXNVy8QXbZo1Xkob8JMHKZPQuvzLFV3hfskv40TPFhmhYTH5qwM VvBqq2aERcu2tbzZoJXIfQ3NitdH9Tkd3GOhFTYtt+C7Moyd1V5U4bli7nrUHW1CLE3Icc WY/0etcxzgYyPhg49vaMm26cHfURIim3lf2ljH0d9BIWeRXMeGJ/WqUFux0srWNrCnBder jLqg3O43NcB0nCyMMnoi4yvSpdoWishz/J50IjrZ3tIvDU1v/J7eUThkjqlrtA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:51 +0200 Subject: [PATCH net-next 10/12] 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: <20251021-macb-eyeq5-v1-10-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?= , 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 --- 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 Sun Feb 8 12:20:22 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 E68D0348878; Tue, 21 Oct 2025 16:33:40 +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=1761064422; cv=none; b=rnApqe3aEoCAPOldJDBOYGOsmxwjeCc/Ld0lbdDgwZZctrCdyvrUvq5U8RMgmmJvuZahNLRiqvJ68eL/cjxX8GD92GMnYyD9cjhnWMWUDHhIVmNPAUsTdNyp1dMhX2JXZEY2ZiowmAtWSa3ncwq4Peic2NPX1ItPUt1VW5q5ivM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064422; c=relaxed/simple; bh=N06AAKkuTH8pzrgJlItLZ7aLwTleb9b/KCDA1r4DSQw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kTsAW4daUBkFMNK77pAR9jlHZpHGpawHyf3D1m/GTBkqkktrGbMz/Q0I8bHr+WPtkOgQiNqfGHPZt83HDKEcZpmzFF/n3SDHD6RdJC5RNbTMb+4iFmhDGTShP/CsnfFouJaxy1szbl12b3VDNuH35eLo5FQPknLHSGpzMZm5dTE= 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=jlm1/M/9; 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="jlm1/M/9" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A980EC0B898; Tue, 21 Oct 2025 16:33:19 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 467C860680; Tue, 21 Oct 2025 16:33:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 27174102F2405; Tue, 21 Oct 2025 18:33:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064417; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=2+gipFkg5zHDFYtzA9qPB7MSffN6uW2hxVVcE15j2wo=; b=jlm1/M/9qSo8FAEyrs/GytfhLY4ugSKojISm4eHOcvVACESxleysO5zIA4EMCsRJNE4Gad fUJEnBXfirps3A18tHcO6sYYJB/T7BRJeyJ7fNu874j6IqZ37Tylw0XJIiHKa5FluH9hov X7EAZpBQ/2PGn5bNnc2mtnCieGqEwQ+7TBgBwj1Mb0qieXgEVEL4+yEIk6L/1DqJc+0xrB 6AByMl/rOFH8p26X5HfpzVk0LySJXcOWHubW3Nx2aqlQouFFRaxJ6ZvcAv9MNXKJE1RNAq tEFQxIKwvtR5Ge4PKVNyPPv0D0V5DGfe35IbkeuLWJvwuEGj6Oqr7Hx/o4z54g== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:52 +0200 Subject: [PATCH net-next 11/12] 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: <20251021-macb-eyeq5-v1-11-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 both MACB/GEM instances found in the Mobileye EyeQ5 SoC. Signed-off-by: Th=C3=A9o Lebrun --- arch/mips/boot/dts/mobileye/eyeq5.dtsi | 47 ++++++++++++++++++++++++++++++= ++++ 1 file changed, 47 insertions(+) diff --git a/arch/mips/boot/dts/mobileye/eyeq5.dtsi b/arch/mips/boot/dts/mo= bileye/eyeq5.dtsi index 36a73e8a63a1..923e3f1f15e1 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,50 @@ 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"; + mobileye,olb =3D <&olb 0x128 0x134>; + phys =3D <&olb 0>; + }; + + macb1: ethernet@2b00000 { + compatible =3D "mobileye,eyeq5-gem"; + reg =3D <0x0 0x02b00000 0x0 0x4000>; + /* One interrupt per queue */ + interrupt-parent =3D <&gic>; + 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"; + mobileye,olb =3D <&olb 0x12c 0x138>; + phys =3D <&olb 1>; + }; + }; + }; }; =20 --=20 2.51.1 From nobody Sun Feb 8 12:20:22 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 78C40347BC0; Tue, 21 Oct 2025 16:33:43 +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=1761064425; cv=none; b=g0cBixZtdOsY379DozyTFdcNoZNfYh6lKf9eu5s3ntvvwadXoIdOVF10EJLp6qhz6/wy7utSWATjWU7dHFZGF5/fAj9xo4gFlFpS2wgoCFdn15p5akVXxKdvszHrVeN6sAmG7Z9XAPh9wgvfXGr7D4eIPTW7Jd6BSxXb9DCyFDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761064425; c=relaxed/simple; bh=nBWa0ag7woJY2vPCiQSnDe7vW7z+266sYVbZE0b/SD4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PSQ2BcL+9Aii69A/nzLcr9kpVO0nC+IEikIbOo/sdOnH2Z23JK5tHpW9Jzjo3iskRZ4Lx10E/vo3Rf3ST/8szwL4rdQ99HW+A6+0KHMJvI0QJaaA6R6B8GEMv48OwaHkp7sT0kh2g5Vkjg9ij/gzGs85C+OrWVAG+4M6c+CysZg= 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=gb8fpeWi; 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="gb8fpeWi" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 166741A15A2; Tue, 21 Oct 2025 16:33:42 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id DDE9E60680; Tue, 21 Oct 2025 16:33:41 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 184FE102F241C; Tue, 21 Oct 2025 18:33:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1761064420; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=iTiW6J9ezHzkr5T/PBNfpX9M9qHogdCahO4t6SNr+IY=; b=gb8fpeWij1R7TR5EcR9xOhp65un2u2vMHve52XCk+CehX/rN5+aYJSr+eMRz3+OvkDLRyh IUezuhhx2r/AsGirkrBvcBxXD4oku6EdoNgZkkyufPIJXarnFSCuJe6wFqIFcx6r5ftBaO ZOXmi+t5SkBCwJ8lJlGbWY1V98BgkmrsfRNj6jhsz1zUSdOA7+by2/t32456j/bttUccBY 0JbncKWdr7jfGXY2jheA2XhglDCJXoP1SB5Qoxqx1SnM+tcthz6CTEOHkj13G9wHf0ruwP cZnPE1kdUpwKCuSnl3vwuo/KoWF/wg8UsPUjGgQxGhJPnkRGNZT77PgnU47ZGQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Tue, 21 Oct 2025 18:32:53 +0200 Subject: [PATCH net-next 12/12] 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: <20251021-macb-eyeq5-v1-12-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?= , 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 --- 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