From patchwork Fri Mar 21 19:09:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6A781C36000 for ; Fri, 21 Mar 2025 19:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uVHG87ySuv/OAPePm8aknpRJX4HfO3j6LNz7sMYuKEg=; b=LDdR2QoJ7s7dfq QsfyxC9b72q0MaC4ikilFALDlCKPpah/yYlLq7W+vwDvYGtCU2kp4fXC/2I9H9UiDvA52b/EH/ctf R8gDWytDw5vtiecWJB21jT8nHjIxHamAcGDSzAlzwyyBiCFV88gBjEyknl98tgxuwm9kqrcoCjoSq VXA2pgAlOY09yG1K4zDKw5Ov1SO4d+caIvdjbGLCHR4Ix23w39kpP1XWsSkWNJiponhZTLPBNwKb3 7W78vh3C7FSqCkanO8rMMawRzJDHMM7DK5gvCM6kWR+NTICoOLiaFw30NNCzbGlBPvNbs2FH3H2ck BXy9ELDhiRGURhzgkIbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhp8-0000000FzRN-0xrY; Fri, 21 Mar 2025 19:14:30 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhoi-0000000FzKp-3T0j for linux-riscv@bombadil.infradead.org; Fri, 21 Mar 2025 19:14:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=IuZZ1c6pfeMUYzSCc2NncoPGK60qkvSILYq+w9aYkTE=; b=oGKPZE3oPQivFlViziVtUKCQ4G z/TKbiuIU+XIYNbYtJGRuIeIIQ+8tb8DJzdKO1FNkleSow0T2cmyeYJbgrQPmvoMurIyOaNaa8rBF TAK7TOPIU2ZYmr/QI0UmPvC/yOjGw0EMvDBWn5xZScDxCIUocw2ieqAkDt+lnV6i8DBHWhYENHeI0 IumHlNTl8Th6yL1RjEPZNJu3XpWgalmsiuzDZduCbdRCrWK7aOWOoxLbCdxbnMwT6BLFObg17YMpN CEnd/5OGwvC4j181HHpdPn4Av4HyABT6v80iq0aF3QG5c9IWDt1tIu/VlLdvjUaCLv9VYGQtV9i4r D5klA+PQ==; Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhof-00000004VmE-2ztO for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id D215344551; Fri, 21 Mar 2025 19:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IuZZ1c6pfeMUYzSCc2NncoPGK60qkvSILYq+w9aYkTE=; b=hwPN6zqjrifTQtFg0tzBTL/P6yepJ4OWg2zrll4M2vwWlDEyESdpFSwFJgNyB8IGmIRyTB 9dsSSrLg8UitTnXlV809wNVRtnYHhDV7nB1HgE9PceOBPsp43EZ+dr+ulQbbXiDOqiQHh9 J1flOeKER6aXXkzABmZC9FHtwuJqmamXLe4JOYT05OPl65tFMPZ/ey+c/KYDmrG5Xd/+Bo f9zS4HY74/h908abnI2bp1Kk4tnNLD4YIhHaOFJ9K/Dw5mRCMzMvclu+FyaOa7oiELUXqC vjWEzOOmMEOZ0m/axPJkvJr4XHGfFOzJsAgQDugvV85bOVeFXNr07BbAowqXNQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:32 +0100 Subject: [PATCH net-next 01/13] dt-bindings: net: cdns,macb: add Mobileye EyeQ5 ethernet interface MIME-Version: 1.0 Message-Id: <20250321-macb-v1-1-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_191401_892074_6F4F5AD4 X-CRM114-Status: UNSURE ( 7.55 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add cdns,eyeq5-gem as compatible for the integrated GEM block inside Mobileye EyeQ5 SoCs. Add a phandle (and two offset arguments) for accessing syscon registers. Signed-off-by: Théo Lebrun --- .../devicetree/bindings/net/cdns,macb.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index 3c30dd23cd4efa17e14b17bfb41c54de4ebadcaa..306d14958778df1a80a15e24d8ed5409704613be 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -51,6 +51,7 @@ properties: - atmel,sama5d2-gem # GEM IP (10/100) on Atmel sama5d2 SoCs - atmel,sama5d3-gem # Gigabit IP on Atmel sama5d3 SoCs - atmel,sama5d4-gem # GEM IP (10/100) on Atmel sama5d4 SoCs + - mobileye,eyeq5-gem # Mobileye EyeQ5 SoCs - cdns,np4-macb # NP4 SoC devices - microchip,sama7g5-emac # Microchip SAMA7G5 ethernet interface - microchip,sama7g5-gem # Microchip SAMA7G5 gigabit ethernet interface @@ -136,6 +137,14 @@ properties: Node containing PHY children. If this node is not present, then PHYs will be direct children. + mobileye,olb: + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to OLB node + - description: MAC General-Purpose register offset + - description: MAC SGMII register offset + patternProperties: "^ethernet-phy@[0-9a-f]$": type: object @@ -174,6 +183,18 @@ allOf: reg: maxItems: 1 + - if: + properties: + compatible: + contains: + const: mobileye,eyeq5-gem + then: + required: + - mobileye,olb + else: + properties: + mobileye,olb: false + unevaluatedProperties: false examples: From patchwork Fri Mar 21 19:09:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025951 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BC2FC36008 for ; Fri, 21 Mar 2025 19:14:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FXjhsVcEEQ9XwUvzPmHkbluIHv0BoGHk/ZTlbZvTl9s=; b=WFwDPqJuoNHoSk srniIstaxgqI9QUyxkfEzFc6EtYQSd3d0YWNWmzqazxDqswA0oW2vW3FKG/aji4q/ANNA/MWnSuBH ayA0ffgVQy/jZXVqornjsMWC+LmmhAZCkckm0dbQ0LPG4LINwyPZnDcF00nXnXfFVfMYWqvtu1YG6 fFauXczDR+QFBkttlsjJpbsKttuWl5E0uEQ33AGUW297o2Q4FpFneSikyfo7JozlhPKIAV80A41rN TRvs6yfSJ+pDjbN18L4VIpOYTX7LON5i3K1G9gRKW331TMAVkjq1QE1G2makTJCG3KgDhrkiFRy2t ENK8/9On4kS187AXOO1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhp7-0000000FzQx-0NNj; Fri, 21 Mar 2025 19:14:29 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhog-0000000FzJZ-04QS for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 638C344554; Fri, 21 Mar 2025 19:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NiE8yWDmE5ieiLpljw/I6k+OSUnyDXBb+4UjDl98ElI=; b=GS6MXkY6slLO1NYad/F3dRS5uGTcOWIsvM7KAeZGx2Q79KrquRP+h2Lf2mK+90f3m7E/tA LYHAqsmTiGKqFqdmGzeNEXvZEyKdCBSHGVeVVg8c+pQ9VAXPYGTb3J1aGKn+fotUkt9NZR 2JwLdJNVwnl/ql/PDAA2tzRoHtby9+hWs+SmQ7ObjTc1knwNrhIQscLT9kckSPX42vxo4V DPdvTwG0jc91E3MyW1ujDj5lmhTk/0M8f37rwF/gJH+dARqTLkp2tiixlIwRBvJEuWHul7 LlhQcWQa4ddw9e81Pbbz5RaGcqN+wogroUWcvoaLybeHVLqt8Bs/QXBP6ejI9w== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:33 +0100 Subject: [PATCH net-next 02/13] dt-bindings: net: cdns,macb: allow tsu_clk without tx_clk MIME-Version: 1.0 Message-Id: <20250321-macb-v1-2-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121402_181282_A432C58B X-CRM114-Status: UNSURE ( 7.69 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Allow providing tsu_clk without a tx_clk as both are optional. Signed-off-by: Théo Lebrun --- Documentation/devicetree/bindings/net/cdns,macb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index 306d14958778df1a80a15e24d8ed5409704613be..36fcae1b20d757b3ebe615a9fc66068000ded56d 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -85,7 +85,7 @@ properties: items: - enum: [ ether_clk, hclk, pclk ] - enum: [ hclk, pclk ] - - const: tx_clk + - enum: [ tx_clk, tsu_clk ] - enum: [ rx_clk, tsu_clk ] - const: tsu_clk From patchwork Fri Mar 21 19:09:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD7ACC36008 for ; Fri, 21 Mar 2025 19:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bD8kAJDSiul1slfcNQyDI7dfZrQHxZMwTgYElTqbMi8=; b=rHY/ftK0Jx063U XPMyHD8LFoRk4NDOcDAiIgjx5WVXAW9wepfv5U22wX8lsPEVQfjCRZd2NEJ+O4v2/uMJzLdLQotam vulNplUkycWjzVbmWs4O7xWMe6UanB79LJ6Whed3aG5o5gqdKdiPWQe3cFaeRZTt+Q9PkNlB5P66H QTD99bWBXCEW3xAjgRVtscaa+MZQ/oe1463VTFLsw0RSu95v7PaTi0B74IVRZ7tbMBVK3bgAfqYQs p8nW9iKIZYo2Nn5jxKnsMzf/qRs6NzRutlqFW0dRU7uKw3xjHpnwlINkiyoNRB/1c2jK4Vsw9H9ab m7CNaVo4mvXzq2WVPpQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhp7-0000000FzR5-2j5z; Fri, 21 Mar 2025 19:14:29 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhoi-0000000FzKo-3Wzk for linux-riscv@bombadil.infradead.org; Fri, 21 Mar 2025 19:14:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=ktKyFV+gs0s4MsPwBDTe634NAC9awOKfQNSVwrSckjY=; b=MEL94pGcjFun+SYsuQ433RIyjP OYrkP5E9jVGjKEwb4VmUPS7TKF2GpdMMFLa5JZTHAry4KCXM5DVSv09h0JEcQIzmLbfTd0yVa66jy 58cvkNwZLCJKPrx54+FjMaQyrRaarsN5w1T8o+aBTfdeEhl73CYWkkkfeuj+t4cRZDoErquAHcJNr BDT/DnV43rRrOfAUBd7thl1D9b34ZumFJmlF7/usUhoJqmdhDweZBR/leNsxcnovfJCu18ugJG44c 7xQTm8+w5hLEHKPRsoHHFdyUEPOYUIaocMgBtH71QraNSduKEKaDys8SgEDKYd5BYOLZXgnKOTfMX 6nB9fqvw==; Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhof-00000004VmU-33LB for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:03 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 1ED26443F3; Fri, 21 Mar 2025 19:13:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ktKyFV+gs0s4MsPwBDTe634NAC9awOKfQNSVwrSckjY=; b=UMTQ3MdaZEqfozKPADZrbFLqp74eVp69gDzMyuPYd08rFvuieh8CzxsL6RGU06X0I6xCVp S1A32Z+KK/3X6KGymT2yeUqr0quNUeWy35aMyvnm/96K1ywfcNUNHEnF5Za8mWrZTi+fSN gz6n4qeoe4MQ1CeJWowNxACa/oOc6H2JSjPdXrClLAdu7EesRYuMVZ6hahJlVHKI2AQZSV lsNtJI3OIDLl+QAFUnC0PCUvoAAQ+SmPBDp2lzoR4BaqFK2iconP7IF9lfa8SV/xT2Z9ga 2pC55bAMY1XjvmxaDUzOMk8fe3oZLnGQv/SxcuwP38jgJJvK1n/Wvl8IGk/vEQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:34 +0100 Subject: [PATCH net-next 03/13] dt-bindings: net: cdns,macb: allow dma-coherent MIME-Version: 1.0 Message-Id: <20250321-macb-v1-3-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_191401_899953_E738E6C1 X-CRM114-Status: UNSURE ( 6.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On EyeQ5, the GEM DMA controller is coherent with the CPU; allow specifying the information. Signed-off-by: Théo Lebrun Acked-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/net/cdns,macb.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index 36fcae1b20d757b3ebe615a9fc66068000ded56d..8a3f0807ffce89ab17bf561722833e355a4a0238 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -112,6 +112,8 @@ properties: iommus: maxItems: 1 + dma-coherent: true + power-domains: maxItems: 1 From patchwork Fri Mar 21 19:09:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F67CC36007 for ; Fri, 21 Mar 2025 19:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=gux99f/3EqA8MRob0B7z7uk8JBLIFqkIttGGWUwMvUQ=; b=p1QbjUJ5BjDaKG TwhGsOwE+xr6hyZt1k/bL6X5vxIQ2zrUm1TC1QlFK0twNXHMQs8fiw1gB/EFzNrNa03vfhONwOOnF lQBjT7RH9YWD9mNu3ngn0XfZ/UByvoD7up8Xlz/DEXMCJIkNJ0Y5IBNQNXjfVPExM0HRfx73ctQBv MATqjHmBaxv18M72yvbxJVEEUJhN7DMLYu+fQBAhv1MIQXOmLLM41XL8IOupAg35rCCPKOz4k6R4u X7mWT7iam58dW0V8pfD0NBq++CkTCxWR53lumIIWzgeUy4XgXKxYP0E3HXLKtqOGDPhpscu3By6n4 BZUiSgtgvasTdfBSWUQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhp9-0000000FzSW-1cV6; Fri, 21 Mar 2025 19:14:31 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhol-0000000FzLW-0Qio for linux-riscv@bombadil.infradead.org; Fri, 21 Mar 2025 19:14:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=iePdyYSf/+g+pm8h9F0nQI+y9CDPVqPcquQl0nemLzI=; b=lOM27e4Ve2/aF0Cp5NZzJRZFh0 0s/QUERpVgYHHbdHv5Rl6cv00Q2sHWjtsUnjtZLZxfRJCEjkAvAoVpS+Q4volpEyJiqFKf74ZxtBW 3njQ7BeOVRENwnLYBWacT+iwwpMF0tJOin4MgIEnlLv8Pvlmyhq47lmsWkk1JeRxaoYDYHPAuKdWp JMvKWW2RAsEwfTycWUZ+EpmgawU5u4L92QGxyQO+1dBHTD7Sga4V35XBVW7YIlESAFuIimWkfI/iI YmmgED9SuYQ3pobYbOt5mU/iUkcfWCMe9zs0wmyLd8cdMeC39RFUapBXCoEMWTpdNRIutjG90or3A pzk4mibw==; Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhoi-00000004Vmz-10qK for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:06 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id A850544557; Fri, 21 Mar 2025 19:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584442; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iePdyYSf/+g+pm8h9F0nQI+y9CDPVqPcquQl0nemLzI=; b=e3EejegiFRwW3JpWgNVSn8BAS55pjTPk5K/NuhH0F505gCF3tyQ4vgBJM8G+TirnkZXnLS +sO0Rc+MzLSXYJBRX7Ddq7XX3GqfURZ2r9bpAa7yfHNrYuU3/8iHsFhc8gk+BAwii0zGf7 DLRGTk83Xtd9CstN3mRY9rnjhadjSyF++IPd9NzgILHZUq145KFxU/SECWmIYYo/TyHgNj CErQGGLUpiiCBypZRlp9z+mO3yAsVhOouKSIqMGN5FLPWeUC8tsdLwS4Zwpdc/L9OGG2CN CnpQXxiHVfP9v9HwhSxxG5opOEnS1I3VxjkXdpCAnS0sfGPC3J8xu5RaA75Ijg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:35 +0100 Subject: [PATCH net-next 04/13] net: macb: use BIT() macro for capability definitions MIME-Version: 1.0 Message-Id: <20250321-macb-v1-4-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_191404_421749_775D5622 X-CRM114-Status: UNSURE ( 6.57 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Replace all capabilities values by calls to the BIT() macro. Signed-off-by: Théo Lebrun Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb.h | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index c9a5c8beb2fa8166195d1d83f187d2d0c62668a8..3b43cb9468e3618754ff2bc6c5f360447bdeeed0 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -727,26 +727,26 @@ #define MACB_MAN_C45_CODE 2 /* Capability mask bits */ -#define MACB_CAPS_ISR_CLEAR_ON_WRITE 0x00000001 -#define MACB_CAPS_USRIO_HAS_CLKEN 0x00000002 -#define MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII 0x00000004 -#define MACB_CAPS_NO_GIGABIT_HALF 0x00000008 -#define MACB_CAPS_USRIO_DISABLED 0x00000010 -#define MACB_CAPS_JUMBO 0x00000020 -#define MACB_CAPS_GEM_HAS_PTP 0x00000040 -#define MACB_CAPS_BD_RD_PREFETCH 0x00000080 -#define MACB_CAPS_NEEDS_RSTONUBR 0x00000100 -#define MACB_CAPS_MIIONRGMII 0x00000200 -#define MACB_CAPS_NEED_TSUCLK 0x00000400 -#define MACB_CAPS_QUEUE_DISABLE 0x00000800 -#define MACB_CAPS_PCS 0x01000000 -#define MACB_CAPS_HIGH_SPEED 0x02000000 -#define MACB_CAPS_CLK_HW_CHG 0x04000000 -#define MACB_CAPS_MACB_IS_EMAC 0x08000000 -#define MACB_CAPS_FIFO_MODE 0x10000000 -#define MACB_CAPS_GIGABIT_MODE_AVAILABLE 0x20000000 -#define MACB_CAPS_SG_DISABLED 0x40000000 -#define MACB_CAPS_MACB_IS_GEM 0x80000000 +#define MACB_CAPS_ISR_CLEAR_ON_WRITE BIT(0) +#define MACB_CAPS_USRIO_HAS_CLKEN BIT(1) +#define MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII BIT(2) +#define MACB_CAPS_NO_GIGABIT_HALF BIT(3) +#define MACB_CAPS_USRIO_DISABLED BIT(4) +#define MACB_CAPS_JUMBO BIT(5) +#define MACB_CAPS_GEM_HAS_PTP BIT(6) +#define MACB_CAPS_BD_RD_PREFETCH BIT(7) +#define MACB_CAPS_NEEDS_RSTONUBR BIT(8) +#define MACB_CAPS_MIIONRGMII BIT(9) +#define MACB_CAPS_NEED_TSUCLK BIT(10) +#define MACB_CAPS_QUEUE_DISABLE BIT(11) +#define MACB_CAPS_PCS BIT(24) +#define MACB_CAPS_HIGH_SPEED BIT(25) +#define MACB_CAPS_CLK_HW_CHG BIT(26) +#define MACB_CAPS_MACB_IS_EMAC BIT(27) +#define MACB_CAPS_FIFO_MODE BIT(28) +#define MACB_CAPS_GIGABIT_MODE_AVAILABLE BIT(29) +#define MACB_CAPS_SG_DISABLED BIT(30) +#define MACB_CAPS_MACB_IS_GEM BIT(31) /* LSO settings */ #define MACB_LSO_UFO_ENABLE 0x01 From patchwork Fri Mar 21 19:09:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01AB9C36000 for ; Fri, 21 Mar 2025 19:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1cu3TT+2mEmBeHQg5jfiZGi+DFLPhCOvhiD5R6OUas4=; b=Z4PbiH0enwiard Va+dGxCo3Vjo6vUOhiUJpYHxVzI+YOzEUq8R6F0lSguZvWnGVIprVYbKIV4rQ+mjSdF5/WyyeptEH J7/CP9ZSoGGVTe1kCMSzhOUHknbeGVb+vcLIAARlTprFTDS1A33XRJfPs8ae36teB1Yp4c2+as3UY l2mPPjP3pvGr9uf29ZRiLj3qmxoPVmMHCht1WTix94hNSFhZ05iYd+qtsqFswx662Vr1GZgky4q3d X813n9lPWVCfMZV+uUdqiGr7bGCI28HjutCXaHAxYPxIFwhRAVEfx9ptt+MtDgPhRKGkz+293iC8A Uvm/BDb85KARtXDDGzZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhp8-0000000FzRg-3MKz; Fri, 21 Mar 2025 19:14:30 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhoj-0000000FzKn-2l2W for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:06 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4B84A44558; Fri, 21 Mar 2025 19:14:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=J3cXgGc4bn0Gbvqr0NtDmMZgufHdfFhvshdl+bFHAKw=; b=WsPdoAHBBA4KnQD1BRUJF7V/Ssx0s2JVoZoFjRsTpnAdDSQgCw7J0lMugTITl/Wekvn11Z JIiB6GX+Xi1Nr68Gbr7VvnyU2XEb8/esxhvxIzvFVAzB8V6ugJCRJmwXLoOtnbo8OhWT2k D+A5lZs8Aeuf4TbWFZciYedp/vomad66JpXXnAp/AwVTO28o0BdCZ719fm6nl0PQvXw364 PlKJkHS3nCQUsn2iCfEGNN8IkIM5aTF4bzIn8vibU58XqJPlxpv/xlBcIuBSWylEfgkFB6 uBMTrPKKzIYSZB/RHyGzJH5sNy7+Fj08vMkXRgc+cSm84hMjaL2yoObGfj1bQg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:36 +0100 Subject: [PATCH net-next 05/13] net: macb: add no LSO capability (MACB_CAPS_NO_LSO) MIME-Version: 1.0 Message-Id: <20250321-macb-v1-5-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121405_846588_B7A7F81F X-CRM114-Status: GOOD ( 11.50 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org LSO is runtime-detected using the PBUF_LSO field inside register designcfg_debug6/GEM_DCFG6. Allow disabling that feature if it is broken by using struct macb_config->caps. Signed-off-by: Théo Lebrun Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb.h | 1 + drivers/net/ethernet/cadence/macb_main.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 3b43cb9468e3618754ff2bc6c5f360447bdeeed0..e9da6e3b869fc772613a0d6b86308917c9bff7fe 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -739,6 +739,7 @@ #define MACB_CAPS_MIIONRGMII BIT(9) #define MACB_CAPS_NEED_TSUCLK BIT(10) #define MACB_CAPS_QUEUE_DISABLE BIT(11) +#define MACB_CAPS_NO_LSO BIT(12) #define MACB_CAPS_PCS BIT(24) #define MACB_CAPS_HIGH_SPEED BIT(25) #define MACB_CAPS_CLK_HW_CHG BIT(26) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b5797c1ac0a41e9472883b013c1e44a01092f257..807f7abbd9941bf624f14a5ddead68dad1c8deb2 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4373,8 +4373,9 @@ static int macb_init(struct platform_device *pdev) /* Set features */ dev->hw_features = NETIF_F_SG; - /* Check LSO capability */ - if (GEM_BFEXT(PBUF_LSO, gem_readl(bp, DCFG6))) + /* Check LSO capability; capability is for buggy HW */ + if (!(bp->caps & MACB_CAPS_NO_LSO) && + GEM_BFEXT(PBUF_LSO, gem_readl(bp, DCFG6))) dev->hw_features |= MACB_NETIF_LSO; /* Checksum offload is only available on gem with packet buffer */ From patchwork Fri Mar 21 19:09:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 38D34C36002 for ; Fri, 21 Mar 2025 19:14:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RvdxTzHTWYvvF7scR+qFFVtJtXatqTRjEh3v9b5ZD80=; b=EjTqAZSs13TmUy StiRSWX939+VvDTTk2odmzJuY3IfxnkrHPrZy/6t/hKUu4lh2Y+LgeqOFTimbUc08UPYyMpCdkPa9 o7cI/M7LOjuHeVCztgbR6zTuY8JQxHD9I6W/XaowI5oGrdt+FYx/z45uh3CueyVPAbOyCTgl1hg7Y HHDuruBkRY4H7wbBJEf82sNjOeEFS2vz3h1LtGnmOmBUxv8RAmO9K8yLLztjWwuG8uKEyixD85L7M deMed+vGG1j4ZKgT9ynUcSvriVm/qyidcMlq/AjZNCd2dZDPU9+SbI5arCAXburgtj5JYEkNnQjkV y6PHehZ+RLusUW7tWNrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpA-0000000FzSx-05xS; Fri, 21 Mar 2025 19:14:32 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhok-0000000FzLB-2r5x for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:07 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id D230944555; Fri, 21 Mar 2025 19:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2bKDOW9BooVCSfDA1lWucvGSqOaPkqITYm2kwpCGtTo=; b=AXkW8KAh4StYRvomeZA29gu6cPVEPX2IMOetb/EoAtDdprsz2jvzfXu7aHkLHTEB8IWReD Dpe/CV7iFBz21/z+3/aZJ5vjC68Nemlv053zT4jYZ5BBwkDSAKBjMrq+M2AIX3gtOrHY/t /eYTVWox0baVqNw3eik8W7BZ/1qAJTfBc3/GfJjYTMH8exdgnbCvU9AWHcc6IvTAU28XTl /xQ0nTlVbY0Okm1tePXSNMf/SN2Dot8SYT5h9Vwv1wneN61j1k5KTtK9W/uMMmjSz1dSnu ya+ZgACyQxcrBr13WeYzfS7E/EEWZxUrmvynNc4lK7bb5TFmg58O5cEo+8O1Xw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:37 +0100 Subject: [PATCH net-next 06/13] net: macb: simplify macb_probe() code touching match data MIME-Version: 1.0 Message-Id: <20250321-macb-v1-6-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121406_847307_E5B5124E X-CRM114-Status: GOOD ( 12.05 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Remove local variables clk_init and init. Those function pointers are always equivalent to macb_config->clk_init and macb_config->init. Also remove NULL checks on macb_config as it is always valid: - either it is its default value &default_gem_config, - or it got overridden using match data. Signed-off-by: Théo Lebrun --- drivers/net/ethernet/cadence/macb_main.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 807f7abbd9941bf624f14a5ddead68dad1c8deb2..b206966178e3d49a084c754191f77205ff6dd466 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -5177,10 +5177,6 @@ static const struct macb_config default_gem_config = { static int macb_probe(struct platform_device *pdev) { const struct macb_config *macb_config = &default_gem_config; - int (*clk_init)(struct platform_device *, struct clk **, - struct clk **, struct clk **, struct clk **, - struct clk **) = macb_config->clk_init; - int (*init)(struct platform_device *) = macb_config->init; struct device_node *np = pdev->dev.of_node; struct clk *pclk, *hclk = NULL, *tx_clk = NULL, *rx_clk = NULL; struct clk *tsu_clk = NULL; @@ -5202,14 +5198,11 @@ static int macb_probe(struct platform_device *pdev) const struct of_device_id *match; match = of_match_node(macb_dt_ids, np); - if (match && match->data) { + if (match && match->data) macb_config = match->data; - clk_init = macb_config->clk_init; - init = macb_config->init; - } } - err = clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk); + err = macb_config->clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk); if (err) return err; @@ -5245,15 +5238,13 @@ static int macb_probe(struct platform_device *pdev) } bp->num_queues = num_queues; bp->queue_mask = queue_mask; - if (macb_config) - bp->dma_burst_length = macb_config->dma_burst_length; + bp->dma_burst_length = macb_config->dma_burst_length; bp->pclk = pclk; bp->hclk = hclk; bp->tx_clk = tx_clk; bp->rx_clk = rx_clk; bp->tsu_clk = tsu_clk; - if (macb_config) - bp->jumbo_max_len = macb_config->jumbo_max_len; + bp->jumbo_max_len = macb_config->jumbo_max_len; if (!hw_is_gem(bp->regs, bp->native_io)) bp->max_tx_length = MACB_MAX_TX_LEN; @@ -5343,7 +5334,7 @@ static int macb_probe(struct platform_device *pdev) bp->phy_interface = interface; /* IP specific init */ - err = init(pdev); + err = macb_config->init(pdev); if (err) goto err_out_free_netdev; From patchwork Fri Mar 21 19:09:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57F1BC3600C for ; Fri, 21 Mar 2025 19:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FkzHrSHMYSaR4bjY4C0AOoyEXBYk3eseSkvfXZZ43ns=; b=rfaJkN59hhu+UN KjFnk02vdijaEJqlH3sTD6i7mRJhTfDuqtLoo/sW2vvlDeq7me4r9gqOX+wTtidGMPIgzWAnNv9Yg Ie6jTgiBg4EIxqt1W8ThposRdijSpHvkQfBafjHWqbekYUwHXTq4jK/bAbdq+l6+rmk9fEC3UCkra /upusFSJlZQb1EaiMPNoLtUKaeJkmkAUqqRiA+p4ULmXoUH5nyYxWcN/scj0zKZceB8HM1SiHuHha UXBrde8waHVrQHUBfYv2gtMZbpWZ5hmQf4BEQfJRdhx4Ipbkd6STuonh2mlVXcqHnjwySiTSJDZSJ y/qbqahd6svVLwmn7ZVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpA-0000000FzTQ-2oNk; Fri, 21 Mar 2025 19:14:32 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhom-0000000FzMB-3DFo for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:10 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 6E6E444559; Fri, 21 Mar 2025 19:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584447; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xOdKX6boAEAH9arMzCvFQuOb94FnbdUL3B+JMds4yyA=; b=LbCk/wxO4ma+T4UTtCM4T6xDwpBCHadJD0SEHPCDbmJ4JndK5uoBcTOz2ws2lmX4eUPfmu BxYoTA5baNVbDgKUTz6ZckBiL1sD9vlMilEVdzwqbRBWKxPFXb1UdkyzSU8D7aSR2qnFfY b6BK6/c5OLJEwTMhKR0E5c0otmCSpEiww9KN0twICsPkuRuRT+ozI3laRrR6XppIgglqnk xhm1zQNacVOVqG3t9e1SiofzdsejNsLEKpCHnPblOwzr8xT+i09LDiZfEBWVmrnYUGv0pn th33vVZaPMZEmnoyXH73ffLWLImLN0KJ3Z64GMk1GbxwtMUb6nBQC+cv8uhELg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:38 +0100 Subject: [PATCH net-next 07/13] net: macb: move HW IP alignment value to macb_config MIME-Version: 1.0 Message-Id: <20250321-macb-v1-7-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121409_094639_AE3B7819 X-CRM114-Status: GOOD ( 16.88 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The controller does IP alignment (two bytes). However, we match that on the software side with: skb_reserve(skb, NET_IP_ALIGN); The NET_IP_ALIGN value is arch-dependent and picked based on unaligned CPU access performance. The hardware alignment value should be compatible-specific rather than arch-specific. Offer a path forward by adding a hw_ip_align field inside macb_config. Values for macb_config->hw_ip_align are picked based on upstream devicetrees: Compatible | DTS folders | hw_ip_align ------------------------|---------------------------|---------------- cdns,at91sam9260-macb | arch/arm/ | 2 cdns,macb | arch/{arm,riscv}/ | NET_IP_ALIGN cdns,np4-macb | NULL | NET_IP_ALIGN cdns,pc302-gem | NULL | NET_IP_ALIGN cdns,gem | arch/{arm,arm64}/ | NET_IP_ALIGN cdns,sam9x60-macb | arch/arm/ | 2 atmel,sama5d2-gem | arch/arm/ | 2 atmel,sama5d29-gem | arch/arm/ | 2 atmel,sama5d3-gem | arch/arm/ | 2 atmel,sama5d3-macb | arch/arm/ | 2 atmel,sama5d4-gem | arch/arm/ | 2 cdns,at91rm9200-emac | arch/arm/ | 2 cdns,emac | arch/arm/ | 2 cdns,zynqmp-gem | *same as xlnx,zynqmp-gem* | 0 cdns,zynq-gem | *same as xlnx,zynq-gem* | 2 sifive,fu540-c000-gem | arch/riscv/ | 2 microchip,mpfs-macb | arch/riscv/ | 2 microchip,sama7g5-gem | arch/arm/ | 2 microchip,sama7g5-emac | arch/arm/ | 2 xlnx,zynqmp-gem | arch/arm64/ | 0 xlnx,zynq-gem | arch/arm/ | 2 xlnx,versal-gem | NULL | NET_IP_ALIGN Considerations: - cdns,macb has no match data config. - cdns,np4-macb, cdns,pc302-gem and xlnx,versal-gem have no upstream devicetrees using them. - cdns,gem is used on both arm and arm64 platforms. Those do not have the same NET_IP_ALIGN value. Also, it uses the same config as cdns,pc302-gem. - The default config (default_gem_config) behavior isn't changed: it uses hw_ip_align == NET_IP_ALIGN. Signed-off-by: Théo Lebrun --- drivers/net/ethernet/cadence/macb.h | 2 ++ drivers/net/ethernet/cadence/macb_main.c | 40 ++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index e9da6e3b869fc772613a0d6b86308917c9bff7fe..5bf7e7ff70490cdb068bfdbe7cfd5bb8e1db7f86 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -1191,6 +1191,7 @@ struct macb_usrio_config { struct macb_config { u32 caps; + int hw_ip_align; unsigned int dma_burst_length; int (*clk_init)(struct platform_device *pdev, struct clk **pclk, struct clk **hclk, struct clk **tx_clk, @@ -1295,6 +1296,7 @@ struct macb { u32 caps; unsigned int dma_burst_length; + int hw_ip_align; phy_interface_t phy_interface; diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b206966178e3d49a084c754191f77205ff6dd466..b32363ba1ec3be0fc42866c8585f0b465d178220 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -1352,8 +1352,26 @@ static void gem_rx_refill(struct macb_queue *queue) dma_wmb(); macb_set_addr(bp, desc, paddr); - /* properly align Ethernet header */ - skb_reserve(skb, NET_IP_ALIGN); + /* Properly align Ethernet header. + * + * Here be (small-ish) dragons. 3 features intertwine: + * (1) Hardware adds two dummy bytes. Notice how + * skb_reserve() is done AFTER dma_map_single(). + * (2) The NET_IP_ALIGN value is arch dependent. + * (3) The low 2/3 bits cannot be picked. + * 3 bits if HW_DMA_CAP_PTP. + * + * Notice how (1) and (2) are unrelated (IP-specific + * versus arch-specific) but must agree for a working + * system. + * + * (3) implies we cannot align the IP header (ie respect + * NET_IP_ALIGN) if HW does not add two bytes. + * + * FIXME: migrate away from hw_ip_align == NET_IP_ALIGN + * for all compatibles. + */ + skb_reserve(skb, bp->hw_ip_align); } else { desc->ctrl = 0; dma_wmb(); @@ -4994,6 +5012,7 @@ static const struct macb_usrio_config sama7g5_usrio = { static const struct macb_config fu540_c000_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = fu540_c000_clk_init, .init = fu540_c000_init, @@ -5003,6 +5022,7 @@ static const struct macb_config fu540_c000_config = { static const struct macb_config at91sam9260_config = { .caps = MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, + .hw_ip_align = 2, .clk_init = macb_clk_init, .init = macb_init, .usrio = &macb_default_usrio, @@ -5011,6 +5031,7 @@ static const struct macb_config at91sam9260_config = { static const struct macb_config sama5d3macb_config = { .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, + .hw_ip_align = 2, .clk_init = macb_clk_init, .init = macb_init, .usrio = &macb_default_usrio, @@ -5018,6 +5039,7 @@ static const struct macb_config sama5d3macb_config = { static const struct macb_config pc302gem_config = { .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE, + .hw_ip_align = NET_IP_ALIGN, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5026,6 +5048,7 @@ static const struct macb_config pc302gem_config = { static const struct macb_config sama5d2_config = { .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5035,6 +5058,7 @@ static const struct macb_config sama5d2_config = { static const struct macb_config sama5d29_config = { .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_GEM_HAS_PTP, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5044,6 +5068,7 @@ static const struct macb_config sama5d29_config = { static const struct macb_config sama5d3_config = { .caps = MACB_CAPS_SG_DISABLED | MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_JUMBO, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5053,6 +5078,7 @@ static const struct macb_config sama5d3_config = { static const struct macb_config sama5d4_config = { .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII, + .hw_ip_align = 2, .dma_burst_length = 4, .clk_init = macb_clk_init, .init = macb_init, @@ -5061,6 +5087,7 @@ static const struct macb_config sama5d4_config = { static const struct macb_config emac_config = { .caps = MACB_CAPS_NEEDS_RSTONUBR | MACB_CAPS_MACB_IS_EMAC, + .hw_ip_align = 2, .clk_init = at91ether_clk_init, .init = at91ether_init, .usrio = &macb_default_usrio, @@ -5068,6 +5095,7 @@ static const struct macb_config emac_config = { static const struct macb_config np4_config = { .caps = MACB_CAPS_USRIO_DISABLED, + .hw_ip_align = NET_IP_ALIGN, .clk_init = macb_clk_init, .init = macb_init, .usrio = &macb_default_usrio, @@ -5077,6 +5105,7 @@ static const struct macb_config zynqmp_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH, + .hw_ip_align = 0, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = init_reset_optional, @@ -5087,6 +5116,7 @@ static const struct macb_config zynqmp_config = { static const struct macb_config zynq_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF | MACB_CAPS_NEEDS_RSTONUBR, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5097,6 +5127,7 @@ static const struct macb_config mpfs_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = init_reset_optional, @@ -5108,6 +5139,7 @@ static const struct macb_config mpfs_config = { static const struct macb_config sama7g5_gem_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_CLK_HW_CHG | MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5118,6 +5150,7 @@ static const struct macb_config sama7g5_emac_config = { .caps = MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_MIIONRGMII | MACB_CAPS_GEM_HAS_PTP, + .hw_ip_align = 2, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5128,6 +5161,7 @@ static const struct macb_config versal_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_BD_RD_PREFETCH | MACB_CAPS_NEED_TSUCLK | MACB_CAPS_QUEUE_DISABLE, + .hw_ip_align = NET_IP_ALIGN, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = init_reset_optional, @@ -5167,6 +5201,7 @@ static const struct macb_config default_gem_config = { .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | MACB_CAPS_GEM_HAS_PTP, + .hw_ip_align = NET_IP_ALIGN, .dma_burst_length = 16, .clk_init = macb_clk_init, .init = macb_init, @@ -5244,6 +5279,7 @@ static int macb_probe(struct platform_device *pdev) bp->tx_clk = tx_clk; bp->rx_clk = rx_clk; bp->tsu_clk = tsu_clk; + bp->hw_ip_align = macb_config->hw_ip_align; bp->jumbo_max_len = macb_config->jumbo_max_len; if (!hw_is_gem(bp->regs, bp->native_io)) From patchwork Fri Mar 21 19:09:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E992CC3600A for ; Fri, 21 Mar 2025 19:14:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GLmG6o7/+fYeEzfIjdmXbgUmK5y7/q7BNgCvsYSCZis=; b=O46jCwA7L4Jt/P xgyGK2US1zRYIwieQwhwGSrUccZczKJLBNE85MdPO+84xXj1PtitAtJFuTAa/Ux8QhZkkXwJa+cxc N2skBSPkdl9fzMlGxcylIpBGuMHyc3C2yS8QvKOAbRA3JvqlM8Z7f2HI3b0LV4i5t7b44vtDDT0+V cVOQn7BnJ4Y1YB1AbCsVauuUlauO41/2iFKoTi2Oji5rDTvkPpPgIiX1+XNqmNxUSYm6FIDswltSK 0jKQIy62lCGIXV6PomwqlwI7LntqwhmGVUB7mwxCJjh14qiuWNgKgfkvUl/WBKAmCdsUxfalmBVHz uwUi5DTFjgs0VBx2HBKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpB-0000000FzTi-17Pb; Fri, 21 Mar 2025 19:14:33 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhoo-0000000FzMP-0H1Z for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:11 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 20F254455A; Fri, 21 Mar 2025 19:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QZHLZtOsYa//BR6kSb6CcInPA+hroHJebOp/11hJvrE=; b=bLtTDgERwHLjpj9YZi0+M4BDAvJ9v3Xhoy987Ji2UtubP1RszK4xrA7AlG6Yq86t7sbcmb bd/797eQ//2zjyHp/45ndOnUPeF4KYcZklMbdujhQpf9YJSf9tBk3QzxGNJUIBa0TCTx3t ZptPH3Um/n3/tgO8NOzYRY4c7b4iQRSaZdpkzqOTagl8jBKpG8Xz6dS1ZMU78sJRgj6QyB GdtdqM26X2vhpLQ7EGISocjhXVv60q+AO4QbOcMvCOAwELcXIXOzeqTXnOTC9CYeO7VSfy X3Lg+xbj65tY0qZHCsd0PunqIDbWLMyESRYKeWo5OUpj2yyKdFmVSr2UVhE3Ng== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:39 +0100 Subject: [PATCH net-next 08/13] net: macb: introduce DMA descriptor helpers (is 64bit? is PTP?) MIME-Version: 1.0 Message-Id: <20250321-macb-v1-8-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepgeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121410_240784_E43D0D69 X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Introduce macb_dma_is_64b() and macb_dma_is_ptp() helper functions. Many codepaths are made simpler by dropping conditional compilation. This implies three changes: - Always compile related structure definitions inside . - Make the field hw_dma_cap in struct macb always present. - MACB_EXT_DESC can be dropped as it is useless now. The common case is: #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT struct macb_dma_desc_64 *desc_64; if (bp->hw_dma_cap & HW_DMA_CAP_64B) { desc_64 = macb_64b_desc(bp, desc); // ... } #endif And replaced by: struct macb_dma_desc_64 *desc_64; if (macb_dma_is_64b(bp)) { desc_64 = macb_64b_desc(bp, desc); // ... } Signed-off-by: Théo Lebrun --- drivers/net/ethernet/cadence/macb.h | 8 --- drivers/net/ethernet/cadence/macb_main.c | 110 +++++++++++-------------------- 2 files changed, 38 insertions(+), 80 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb.h b/drivers/net/ethernet/cadence/macb.h index 5bf7e7ff70490cdb068bfdbe7cfd5bb8e1db7f86..26e0af44a45926c782cf0f72184332ab3605a178 100644 --- a/drivers/net/ethernet/cadence/macb.h +++ b/drivers/net/ethernet/cadence/macb.h @@ -15,10 +15,6 @@ #include #include -#if defined(CONFIG_ARCH_DMA_ADDR_T_64BIT) || defined(CONFIG_MACB_USE_HWSTAMP) -#define MACB_EXT_DESC -#endif - #define MACB_GREGS_NBR 16 #define MACB_GREGS_VERSION 2 #define MACB_MAX_QUEUES 8 @@ -824,7 +820,6 @@ struct macb_dma_desc { u32 ctrl; }; -#ifdef MACB_EXT_DESC #define HW_DMA_CAP_32B 0 #define HW_DMA_CAP_64B (1 << 0) #define HW_DMA_CAP_PTP (1 << 1) @@ -839,7 +834,6 @@ struct macb_dma_desc_ptp { u32 ts_1; u32 ts_2; }; -#endif /* DMA descriptor bitfields */ #define MACB_RX_USED_OFFSET 0 @@ -1319,9 +1313,7 @@ struct macb { struct phy *sgmii_phy; /* for ZynqMP SGMII mode */ -#ifdef MACB_EXT_DESC uint8_t hw_dma_cap; -#endif spinlock_t tsu_clk_lock; /* gem tsu clock locking */ unsigned int tsu_rate; struct ptp_clock *ptp_clock; diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b32363ba1ec3be0fc42866c8585f0b465d178220..ad154cfe29106f642b32922fd4a03ca63112f4a7 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -98,6 +98,18 @@ struct sifive_fu540_macb_mgmt { #define MACB_MDIO_TIMEOUT 1000000 /* in usecs */ +static bool macb_dma_is_64b(struct macb *bp) +{ + return IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT) && + bp->hw_dma_cap & HW_DMA_CAP_64B; +} + +static bool macb_dma_is_ptp(struct macb *bp) +{ + return IS_ENABLED(CONFIG_MACB_USE_HWSTAMP) && + bp->hw_dma_cap & HW_DMA_CAP_PTP; +} + /* DMA buffer descriptor might be different size * depends on hardware configuration: * @@ -127,56 +139,31 @@ struct sifive_fu540_macb_mgmt { */ static unsigned int macb_dma_desc_get_size(struct macb *bp) { -#ifdef MACB_EXT_DESC - unsigned int desc_size; + unsigned int desc_size = sizeof(struct macb_dma_desc); + + if (macb_dma_is_64b(bp)) + desc_size += sizeof(struct macb_dma_desc_64); + if (macb_dma_is_ptp(bp)) + desc_size += sizeof(struct macb_dma_desc_ptp); - switch (bp->hw_dma_cap) { - case HW_DMA_CAP_64B: - desc_size = sizeof(struct macb_dma_desc) - + sizeof(struct macb_dma_desc_64); - break; - case HW_DMA_CAP_PTP: - desc_size = sizeof(struct macb_dma_desc) - + sizeof(struct macb_dma_desc_ptp); - break; - case HW_DMA_CAP_64B_PTP: - desc_size = sizeof(struct macb_dma_desc) - + sizeof(struct macb_dma_desc_64) - + sizeof(struct macb_dma_desc_ptp); - break; - default: - desc_size = sizeof(struct macb_dma_desc); - } return desc_size; -#endif - return sizeof(struct macb_dma_desc); } static unsigned int macb_adj_dma_desc_idx(struct macb *bp, unsigned int desc_idx) { -#ifdef MACB_EXT_DESC - switch (bp->hw_dma_cap) { - case HW_DMA_CAP_64B: - case HW_DMA_CAP_PTP: - desc_idx <<= 1; - break; - case HW_DMA_CAP_64B_PTP: - desc_idx *= 3; - break; - default: - break; - } -#endif - return desc_idx; + if (macb_dma_is_64b(bp) && macb_dma_is_ptp(bp)) + return desc_idx * 3; + else if (macb_dma_is_64b(bp) || macb_dma_is_ptp(bp)) + return desc_idx << 1; + else + return desc_idx; } -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT static struct macb_dma_desc_64 *macb_64b_desc(struct macb *bp, struct macb_dma_desc *desc) { return (struct macb_dma_desc_64 *)((void *)desc + sizeof(struct macb_dma_desc)); } -#endif /* Ring buffer accessors */ static unsigned int macb_tx_ring_wrap(struct macb *bp, unsigned int index) @@ -500,17 +487,13 @@ static void macb_init_buffers(struct macb *bp) for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) { queue_writel(queue, RBQP, lower_32_bits(queue->rx_ring_dma)); -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - if (bp->hw_dma_cap & HW_DMA_CAP_64B) + if (macb_dma_is_64b(bp)) queue_writel(queue, RBQPH, upper_32_bits(queue->rx_ring_dma)); -#endif queue_writel(queue, TBQP, lower_32_bits(queue->tx_ring_dma)); -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - if (bp->hw_dma_cap & HW_DMA_CAP_64B) + if (macb_dma_is_64b(bp)) queue_writel(queue, TBQPH, upper_32_bits(queue->tx_ring_dma)); -#endif } } @@ -1038,10 +1021,9 @@ static void macb_tx_unmap(struct macb *bp, struct macb_tx_skb *tx_skb, int budge static void macb_set_addr(struct macb *bp, struct macb_dma_desc *desc, dma_addr_t addr) { -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT struct macb_dma_desc_64 *desc_64; - if (bp->hw_dma_cap & HW_DMA_CAP_64B) { + if (macb_dma_is_64b(bp)) { desc_64 = macb_64b_desc(bp, desc); desc_64->addrh = upper_32_bits(addr); /* The low bits of RX address contain the RX_USED bit, clearing @@ -1050,26 +1032,22 @@ static void macb_set_addr(struct macb *bp, struct macb_dma_desc *desc, dma_addr_ */ dma_wmb(); } -#endif + desc->addr = lower_32_bits(addr); } static dma_addr_t macb_get_addr(struct macb *bp, struct macb_dma_desc *desc) { - dma_addr_t addr = 0; -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT struct macb_dma_desc_64 *desc_64; + dma_addr_t addr = 0; - if (bp->hw_dma_cap & HW_DMA_CAP_64B) { + if (macb_dma_is_64b(bp)) { desc_64 = macb_64b_desc(bp, desc); addr = ((u64)(desc_64->addrh) << 32); } -#endif addr |= MACB_BF(RX_WADDR, MACB_BFEXT(RX_WADDR, desc->addr)); -#ifdef CONFIG_MACB_USE_HWSTAMP - if (bp->hw_dma_cap & HW_DMA_CAP_PTP) + if (macb_dma_is_ptp(bp)) addr &= ~GEM_BIT(DMA_RXVALID); -#endif return addr; } @@ -1176,10 +1154,8 @@ static void macb_tx_error_task(struct work_struct *work) /* Reinitialize the TX desc queue */ queue_writel(queue, TBQP, lower_32_bits(queue->tx_ring_dma)); -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - if (bp->hw_dma_cap & HW_DMA_CAP_64B) + if (macb_dma_is_64b(bp)) queue_writel(queue, TBQPH, upper_32_bits(queue->tx_ring_dma)); -#endif /* Make TX ring reflect state of hardware */ queue->tx_head = 0; queue->tx_tail = 0; @@ -2349,11 +2325,9 @@ static netdev_tx_t macb_start_xmit(struct sk_buff *skb, struct net_device *dev) return ret; } -#ifdef CONFIG_MACB_USE_HWSTAMP - if ((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && - (bp->hw_dma_cap & HW_DMA_CAP_PTP)) + if (macb_dma_is_ptp(bp) && + (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS; -#endif is_lso = (skb_shinfo(skb)->gso_size != 0); @@ -2813,14 +2787,10 @@ static void macb_configure_dma(struct macb *bp) dmacfg &= ~GEM_BIT(TXCOEN); dmacfg &= ~GEM_BIT(ADDR64); -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - if (bp->hw_dma_cap & HW_DMA_CAP_64B) + if (macb_dma_is_64b(bp)) dmacfg |= GEM_BIT(ADDR64); -#endif -#ifdef CONFIG_MACB_USE_HWSTAMP - if (bp->hw_dma_cap & HW_DMA_CAP_PTP) + if (macb_dma_is_ptp(bp)) dmacfg |= GEM_BIT(RXEXT) | GEM_BIT(TXEXT); -#endif netdev_dbg(bp->dev, "Cadence configure DMA with 0x%08x\n", dmacfg); gem_writel(bp, DMACFG, dmacfg); @@ -4326,12 +4296,10 @@ static int macb_init(struct platform_device *pdev) queue->TBQP = GEM_TBQP(hw_q - 1); queue->RBQP = GEM_RBQP(hw_q - 1); queue->RBQS = GEM_RBQS(hw_q - 1); -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - if (bp->hw_dma_cap & HW_DMA_CAP_64B) { + if (macb_dma_is_64b(bp)) { queue->TBQPH = GEM_TBQPH(hw_q - 1); queue->RBQPH = GEM_RBQPH(hw_q - 1); } -#endif } else { /* queue0 uses legacy registers */ queue->ISR = MACB_ISR; @@ -4340,12 +4308,10 @@ static int macb_init(struct platform_device *pdev) queue->IMR = MACB_IMR; queue->TBQP = MACB_TBQP; queue->RBQP = MACB_RBQP; -#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT - if (bp->hw_dma_cap & HW_DMA_CAP_64B) { + if (macb_dma_is_64b(bp)) { queue->TBQPH = MACB_TBQPH; queue->RBQPH = MACB_RBQPH; } -#endif } /* get irq: here we use the linux queue index, not the hardware From patchwork Fri Mar 21 19:09:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61C65C3600B for ; Fri, 21 Mar 2025 19:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cnTgf1mF7rLjQ5AAvmeKJdEEJGFNb7ubrkfWQDSDqjU=; b=t5nC14oyb4uGud CeuOMXTz4u1bdiQ8IId1TVXAmtgRfqzJFVJYtDjhnC3sVseeqJo1Pbx2pCIphtsDottjTy6mVHqvq BwMqovkQU+kowbDiKlxoZBHMrpBrc0bUdk/ZKNp1SkRf+iTSYTylsiBR8CEe8lXajgZXZnxQnIwex iOvNmTHh0mPRLS62EnfgbQ/RbTtEqUs98dTeLKiAUfhWo+yRRJ21sWrvShw6E4csxJnTfS3aPbUJ1 zCBvYYlnnpKPJzfRfiCBgGG6X88Q/yN4R4qOKFh9mWTPyOLjql/HESwL/dajJBZ8ZNT0p7x/XM3MX M5rdku11OQZCMNr/kH7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpB-0000000FzUZ-41kO; Fri, 21 Mar 2025 19:14:33 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhop-0000000FzN4-2RaR for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:12 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id BEF8E4454F; Fri, 21 Mar 2025 19:14:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584450; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cj4PjePZ8L7ZRpmqoA742jyqYhMFuSfbXddrKwz88Xs=; b=g/jVBZv4Bcb9EF8GtX2PDQPtvxAp6N0dLKzZYBLMBhDQcpX9FeORODffuHbf9+TvFf5/Lw t4MiTUK7HLpotqowgZSrVqRSyLnaceic+J5hg+eqjL9kAG+OWoj6icCI9PmDjtL9uKUeIa UmiDlRqV/Esa8a+Z65bz4+RI8tmj3B0LnkLdyzmIHyrMZtyLZDuqg7UVQh8OdM+979w1tn gVxCVek+z4vauMGK8cxSpD0hpQD6rXh4PZFuorZsZNFdx/a8iQTKICizTsswfp0/n514Qf toR///MQZ42Bj8ZMOluyQ8Ijb00Y7vA+K85tcYT39L268B0+ufp1XoKD7TLPlA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:40 +0100 Subject: [PATCH net-next 09/13] net: macb: sort #includes MIME-Version: 1.0 Message-Id: <20250321-macb-v1-9-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepkeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121411_749449_1E864C6E X-CRM114-Status: UNSURE ( 6.64 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Sort #include preprocessor directives. Signed-off-by: Théo Lebrun Reviewed-by: Andrew Lunn --- drivers/net/ethernet/cadence/macb_main.c | 40 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index ad154cfe29106f642b32922fd4a03ca63112f4a7..79161d559166478f85a6f8294d488ed961d9be7f 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -6,39 +6,39 @@ */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include #include -#include -#include -#include -#include #include #include #include #include -#include -#include -#include -#include #include +#include +#include #include #include #include -#include -#include +#include +#include +#include +#include #include "macb.h" /* This structure is only used for MACB on SiFive FU540 devices */ From patchwork Fri Mar 21 19:09:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025948 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42123C3600E for ; Fri, 21 Mar 2025 19:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=g+R/fyzlD9tPBtzl4a+7E8YTa7F6jptANXU0B6U01oE=; b=R9beyHZAa1eCpm CQ4QrOdTRhvBUFKs6/MiTU9beZDDrT3LwDUIKX5GdAUtvylUDo0jlO8QgF4KjZVghnynrwZNsBvfU 6wDfAPCHc44GtK51Iz50Ma9wUA803yN7x2PmwVM02P5bDfJ0Mm2zr6Yjsz2AMr3HSuQF7na9kj0f6 K1Jy9+oqOp0qihoZUOcVEOUr429pHNlVCyyb5EHd2hXxfn9eSOWsFptUgocN4MobTd5Frkn2jN5FJ FDC1v1trM4jJ8jH16/TdfTJ+T4r09JPUWeod1i08rqnBKlOB+njMxhjb7/PMoqAbJySQXAFHdVFsl cHN+r6l3JAYv3JPTsnlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpD-0000000FzVL-1Vfo; Fri, 21 Mar 2025 19:14:35 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhou-0000000FzOB-2rB7 for linux-riscv@bombadil.infradead.org; Fri, 21 Mar 2025 19:14:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=e87+RGdSOMXNWau7DVuhIt+zOGbm1RxUIpw5rMrMWvc=; b=H5Zkh3GanM8a0se+cY4sDs291N CaR1aW/nJztEjCx9Y0J689ECov6Lhfa7cCqtI7qrNJOqzwRD3wkWKtmYFUTd/ek9tMfNCfaw09W8G lT0E7gmUhMH08xULK6a5xWbIis9+iEgJ4QDmengA/ZxekhZaSCdO9NiwVbB/xr5M4ppHkfNfAo+f+ eMZdMOe6Y14+3bJlilmt1QJa9ywpe+fs6odwn9w6RRP4Qy1OLYb56Sngex+0J+C97EM3Q4q3KzFJj CoUeZGUm0CQi6fXJZe+G6CjkGM4gcpae9JZTLK7qskg0QY10dMq9cEaCXnA/CgMF4bppxI7YSWaSn kFD5qtxg==; Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhor-00000004VnO-2k6W for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:15 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5213044557; Fri, 21 Mar 2025 19:14:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584451; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e87+RGdSOMXNWau7DVuhIt+zOGbm1RxUIpw5rMrMWvc=; b=eT4UXrfYvPWiZPi6pfaU4YnJdwis65lGwbBiCac2ZVwkmCObq6bnHXL5sjTzinqg2bFx9X OQkgqk2fV9+cRD1BMlSyodlgZG7l3r1kfxXtMLoP2F2SUplUQWcyZqLD/r5RNq0deV++JQ +bMGCXQKfZEP7EizxNFNUKQto46FnpXX9Il4z0L0JWujNiTMGSj/OuhAB6b+pBFPnBiFQd mN5H7GMTxFFQUuCzCPxSA2GGfPSY55SDty54IfSnftLCJILlpMJQ2lVXIaY23+CExx1hyv +uzPYvKHbNM35DK6Sa5/w53Oykt3t+5DfOEZ3vEEE/5uX5nLMUduCseRYdULcg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:41 +0100 Subject: [PATCH net-next 10/13] net: macb: Add "mobileye,eyeq5-gem" compatible MIME-Version: 1.0 Message-Id: <20250321-macb-v1-10-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepkeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_191413_965627_41AD0DC5 X-CRM114-Status: GOOD ( 14.67 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add support for the two GEM instances inside Mobileye EyeQ5 SoCs, using compatible "mobileye,eyeq5-gem". With it, add a custom init sequence that accesses two system-controller registers. Noteworthy: NET_IP_ALIGN=2 on MIPS but the hardware does not align and low bits aren't configurable, so we cannot respect the requested IP header alignment. Signed-off-by: Théo Lebrun --- drivers/net/ethernet/cadence/macb_main.c | 95 ++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 79161d559166478f85a6f8294d488ed961d9be7f..9f2a5bf9a5ebca5941229bd96091a0fb96f0607d 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -4967,6 +4969,86 @@ static int init_reset_optional(struct platform_device *pdev) return ret; } +#define EYEQ5_OLB_GP_TX_SWRST_DIS BIT(0) // Tx SW reset +#define EYEQ5_OLB_GP_TX_M_CLKE BIT(1) // Tx M clock enable +#define EYEQ5_OLB_GP_SYS_SWRST_DIS BIT(2) // Sys SW reset +#define EYEQ5_OLB_GP_SYS_M_CLKE BIT(3) // Sys clock enable +#define EYEQ5_OLB_GP_SGMII_MODE BIT(4) // SGMII mode +#define EYEQ5_OLB_GP_RGMII_DRV GENMASK(8, 5) // RGMII mode +#define EYEQ5_OLB_GP_SMA_DRV GENMASK(12, 9) +#define EYEQ5_OLB_GP_RGMII_PD BIT(13) // RGMII pull-down +#define EYEQ5_OLB_GP_MDIO_PU BIT(14) // RGMII pull-up +#define EYEQ5_OLB_GP_RGMII_RX_ST BIT(15) // Schmitt trigger on RGMII Rx +#define EYEQ5_OLB_GP_RGMII_TX_ST BIT(16) // Schmitt trigger on RGMII Tx +#define EYEQ5_OLB_GP_MDIO_ST BIT(17) +#define EYEQ5_OLB_GP_MDC_ST BIT(18) +#define EYEQ5_OLB_GP_MBIST_ENABLE BIT(19) + +#define EYEQ5_OLB_SGMII_PWR_EN BIT(0) +#define EYEQ5_OLB_SGMII_RST_DIS BIT(1) +#define EYEQ5_OLB_SGMII_PLL_EN BIT(2) +#define EYEQ5_OLB_SGMII_SIG_DET_SW BIT(3) +#define EYEQ5_OLB_SGMII_PWR_STATE_MASK GENMASK(8, 4) +#define EYEQ5_OLB_SGMII_PWR_STATE BIT(4) +#define EYEQ5_OLB_SGMII_TX_ELECT_IDLE BIT(9) // Tx elect idle +#define EYEQ5_OLB_SGMII_POWER_ACK BIT(16) +#define EYEQ5_OLB_SGMII_PLL_ACK BIT(18) +#define EYEQ5_OLB_SGMII_SIG_DET BIT(19) +#define EYEQ5_OLB_SGMII_PWR_STATE_ACK GENMASK(24, 20) + +static int eyeq5_init(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct net_device *netdev = platform_get_drvdata(pdev); + struct macb *bp = netdev_priv(netdev); + struct device_node *np = dev->of_node; + unsigned int gp, sgmii; + struct regmap *regmap; + unsigned int args[2]; + unsigned int reg; + int ret; + + regmap = syscon_regmap_lookup_by_phandle_args(np, "mobileye,olb", 2, args); + if (IS_ERR(regmap)) + return PTR_ERR(regmap); + + gp = args[0]; + sgmii = args[1]; + + /* Forced reset */ + regmap_write(regmap, gp, 0); + regmap_write(regmap, sgmii, 0); + usleep_range(5, 20); + + if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) { + regmap_write(regmap, gp, EYEQ5_OLB_GP_SGMII_MODE); + + reg = EYEQ5_OLB_SGMII_PWR_EN | EYEQ5_OLB_SGMII_RST_DIS | + EYEQ5_OLB_SGMII_PLL_EN; + regmap_write(regmap, sgmii, reg); + + ret = regmap_read_poll_timeout(regmap, sgmii, reg, + reg & EYEQ5_OLB_SGMII_PLL_ACK, + 1, 100); + if (ret) + return dev_err_probe(dev, ret, "PLL timeout"); + + regmap_read(regmap, sgmii, ®); + reg |= EYEQ5_OLB_SGMII_PWR_STATE | EYEQ5_OLB_SGMII_SIG_DET_SW; + regmap_write(regmap, sgmii, reg); + } + + regmap_read(regmap, gp, ®); + reg &= ~EYEQ5_OLB_GP_RGMII_DRV; + if (phy_interface_mode_is_rgmii(bp->phy_interface)) + reg |= FIELD_PREP(EYEQ5_OLB_GP_RGMII_DRV, 0x9); + reg |= EYEQ5_OLB_GP_TX_SWRST_DIS | EYEQ5_OLB_GP_TX_M_CLKE; + reg |= EYEQ5_OLB_GP_SYS_SWRST_DIS | EYEQ5_OLB_GP_SYS_M_CLKE; + regmap_write(regmap, gp, reg); + + return macb_init(pdev); +} + static const struct macb_usrio_config sama7g5_usrio = { .mii = 0, .rmii = 1, @@ -5135,6 +5217,18 @@ static const struct macb_config versal_config = { .usrio = &macb_default_usrio, }; +static const struct macb_config eyeq5_config = { + .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO | + MACB_CAPS_GEM_HAS_PTP | MACB_CAPS_QUEUE_DISABLE | + MACB_CAPS_NO_LSO, + .hw_ip_align = 0, + .dma_burst_length = 16, + .clk_init = macb_clk_init, + .init = eyeq5_init, + .jumbo_max_len = 10240, + .usrio = &macb_default_usrio, +}; + static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config }, { .compatible = "cdns,macb" }, @@ -5152,6 +5246,7 @@ static const struct of_device_id macb_dt_ids[] = { { .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config}, /* deprecated */ { .compatible = "cdns,zynq-gem", .data = &zynq_config }, /* deprecated */ { .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config }, + { .compatible = "mobileye,eyeq5-gem", .data = &eyeq5_config }, { .compatible = "microchip,mpfs-macb", .data = &mpfs_config }, { .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config }, { .compatible = "microchip,sama7g5-emac", .data = &sama7g5_emac_config }, From patchwork Fri Mar 21 19:09:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025947 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20977C36000 for ; Fri, 21 Mar 2025 19:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9DcIRgoMgfykUTine+K9KJLvPqRDRopD8Tbclq+UFLs=; b=rq4OcLmMre0bx+ kUJD+ADMqoKLZld46H1lQphTxLhf9K8oww5Zp+EogRD84ZZpVZrXsXbQjZvbchAHPycU1nCT2MIt7 kNgG8G9uaCcIRQVQaFnhFh6BOlya7QGPCXMNLb5iCcb5lAigqNeyrrmvz8TmAYLDMKrZALAgTUbOM WCaAn6WQm9wwP7Mh/Q3DZLs0yWAhq+zB/m6g26JJBVXZQr3dSxcI+dcozCBS7iOjzhmDUgqsTrxq5 aFkvaqwu6jPMru5BsDuXO+sTobOD6fVzNdzmGdp0jqhQ1fQ61cyjGW202fHAMSc8b64xELR6CaxqP WhQFMRZH8/jthXAP2qPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpC-0000000FzUu-2lWh; Fri, 21 Mar 2025 19:14:34 +0000 Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhos-0000000FzNf-3puN for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:16 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id EEF1144556; Fri, 21 Mar 2025 19:14:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZxMXQ8+TQxJ1/iSCHV+R2mBv/BVVSKHckDX7uY0hwe0=; b=lqKhGEh9fwsVTezNpVpcsMWOr21wObSDgaEKTxugDByXwco09sUs7wkuUf6snZJdNkWxoM Pp+hzcz6MZidPk3+0m7ar1Lnup98wk474Qn5o+ARpHXGOJXZfXAuihbCaMS2kjerdV8kUt x+ps3ofIyqPQT3bkXxhXJOJn4ngb1ZuCKYF7aT1qEvp6aMjOo3ggpHRPoNT7hhJpYCB9pQ 9+6PNXhtF4Pcr1P08M7wUDsZmfkaYyBIWK6Dsf5BMjueoQh/krNwKFvj0dZq8z1xiE3+MP aza7F0kT16z6fV+AweepQnOrc8VgUGdR046brxDMOTgAIhzs03nHYQb9uH7xPg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:42 +0100 Subject: [PATCH net-next 11/13] MIPS: mobileye: add EyeQ5 DMA IOCU support MIME-Version: 1.0 Message-Id: <20250321-macb-v1-11-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepkeenucfrrghrrghmpehinhgvthepjeejrddufeehrdekuddrieehpdhhvghloheplgduledvrdduieekrddurdeftdgnpdhmrghilhhfrhhomhepthhhvghordhlvggsrhhunhessghoohhtlhhinhdrtghomhdpnhgspghrtghpthhtohepvdekpdhrtghpthhtohepghhrvghgohhrhidrtghlvghmvghnthessghoohhtlhhinhdrtghomhdprhgtphhtthhopehlihhnuhigqdhrihhstghvsehlihhsthhsrdhinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepphgruhhlrdifrghlmhhslhgvhiesshhifhhivhgvrdgtohhmpdhrtghpthhtohepthhssghoghgvnhgusegrlhhphhgrrdhfrhgrnhhkvghnrdguvgdprhgtphhtthhopehkuhgsrgesk hgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhgvthguvghvsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepnhhitgholhgrshdrfhgvrhhrvgesmhhitghrohgthhhiphdrtghomhdprhgtphhtthhopehthhhomhgrshdrphgvthgriiiiohhnihessghoohhtlhhinhdrtghomh X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121415_214586_3F89B652 X-CRM114-Status: GOOD ( 17.58 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Both Cadence GEM Ethernet controllers on EyeQ5 are hardwired through CM3 IO Coherency Units (IOCU). For DMA coherent accesses, BIT(36) must be set in DMA addresses. Implement that in platform-specific dma_map_ops which get attached to both instances of `cdns,eyeq5-gem` through a notifier block. Signed-off-by: Théo Lebrun --- MAINTAINERS | 2 +- arch/mips/mobileye/Kconfig | 1 + arch/mips/mobileye/Makefile | 2 + arch/mips/mobileye/eyeq5-iocu-dma.c | 160 ++++++++++++++++++++++++++++++++++++ 4 files changed, 164 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 5959513a7359f46e10d91bafd5a736b8dceeb7c5..a943f88fc8d4ffe502479e3cd5de6d1a2b1e1fc0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15975,7 +15975,7 @@ F: Documentation/devicetree/bindings/mips/mobileye.yaml F: Documentation/devicetree/bindings/soc/mobileye/ F: arch/mips/boot/dts/mobileye/ F: arch/mips/configs/eyeq5_defconfig -F: arch/mips/mobileye/board-epm5.its.S +F: arch/mips/mobileye/ F: drivers/clk/clk-eyeq.c F: drivers/pinctrl/pinctrl-eyeq5.c F: drivers/reset/reset-eyeq.c diff --git a/arch/mips/mobileye/Kconfig b/arch/mips/mobileye/Kconfig index f9abb2d6e1787dbc5a173db48606ed5a02088e41..b9040f3a9b3ddc7f5addcd8e5f110cb9c775b6b1 100644 --- a/arch/mips/mobileye/Kconfig +++ b/arch/mips/mobileye/Kconfig @@ -9,6 +9,7 @@ choice config MACH_EYEQ5 bool "Mobileye EyeQ5 SoC" + select ARCH_HAS_DMA_OPS config MACH_EYEQ6H bool "Mobileye EyeQ6H SoC" diff --git a/arch/mips/mobileye/Makefile b/arch/mips/mobileye/Makefile index 315c06b689cfbb83f9f205d1140ecf5058e2aa02..50fc7d0ae167c3fb3dc8585bcd45583c6cc3f2d2 100644 --- a/arch/mips/mobileye/Makefile +++ b/arch/mips/mobileye/Makefile @@ -1 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-or-later + +obj-$(CONFIG_MACH_EYEQ5) += eyeq5-iocu-dma.o diff --git a/arch/mips/mobileye/eyeq5-iocu-dma.c b/arch/mips/mobileye/eyeq5-iocu-dma.c new file mode 100644 index 0000000000000000000000000000000000000000..71d1c35f911636db141c4467dccc405af69835ec --- /dev/null +++ b/arch/mips/mobileye/eyeq5-iocu-dma.c @@ -0,0 +1,160 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void *eyeq5_iocu_alloc(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t gfp, + unsigned long attrs) +{ + void *p = dma_direct_alloc(dev, size, dma_handle, gfp, attrs); + + *dma_handle |= BIT_ULL(36); + return p; +} + +static void eyeq5_iocu_free(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_handle, + unsigned long attrs) +{ + dma_handle &= ~BIT_ULL(36); + dma_direct_free(dev, size, vaddr, dma_handle, attrs); +} + +static int eyeq5_iocu_mmap(struct device *dev, struct vm_area_struct *vma, + void *cpu_addr, dma_addr_t dma_addr, size_t size, + unsigned long attrs) +{ + unsigned long pfn = PHYS_PFN(dma_to_phys(dev, dma_addr)); + unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT; + unsigned long user_count = vma_pages(vma); + int ret; + + vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, attrs); + + if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret)) + return ret; + + if (vma->vm_pgoff >= count || user_count > count - vma->vm_pgoff) + return -ENXIO; + + return remap_pfn_range(vma, vma->vm_start, pfn + vma->vm_pgoff, + user_count << PAGE_SHIFT, vma->vm_page_prot); +} + +static int eyeq5_iocu_get_sgtable(struct device *dev, struct sg_table *sgt, + void *cpu_addr, dma_addr_t dma_addr, size_t size, + unsigned long attrs) +{ + struct page *page = virt_to_page(cpu_addr); + int ret; + + ret = sg_alloc_table(sgt, 1, GFP_KERNEL); + if (!ret) + sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0); + return ret; +} + +static dma_addr_t eyeq5_iocu_map_page(struct device *dev, struct page *page, + unsigned long offset, size_t size, + enum dma_data_direction dir, + unsigned long attrs) +{ + phys_addr_t phys = page_to_phys(page) + offset; + + /* BIT(36) toggles routing through IOCU for DMA operations. */ + return phys_to_dma(dev, phys) | BIT_ULL(36); +} + +static void eyeq5_iocu_unmap_page(struct device *dev, dma_addr_t dma_handle, + size_t size, enum dma_data_direction dir, + unsigned long attrs) +{ +} + +static int eyeq5_iocu_map_sg(struct device *dev, struct scatterlist *sgl, + int nents, enum dma_data_direction dir, + unsigned long attrs) +{ + struct scatterlist *sg; + int i; + + for_each_sg(sgl, sg, nents, i) { + sg->dma_address = eyeq5_iocu_map_page(dev, sg_page(sg), + sg->offset, sg->length, + dir, attrs); + if (sg->dma_address == DMA_MAPPING_ERROR) + return 0; /* No cleanup because ->unmap_page() is a no-op. */ + sg_dma_len(sg) = sg->length; + } + + return nents; +} + +static void eyeq5_iocu_unmap_sg(struct device *dev, struct scatterlist *sgl, + int nents, enum dma_data_direction dir, + unsigned long attrs) +{ + /* We know page ->unmap_page() is a no-op. */ +} + +const struct dma_map_ops eyeq5_iocu_ops = { + .alloc = eyeq5_iocu_alloc, + .free = eyeq5_iocu_free, + .alloc_pages_op = dma_direct_alloc_pages, + .free_pages = dma_direct_free_pages, + .mmap = eyeq5_iocu_mmap, + .get_sgtable = eyeq5_iocu_get_sgtable, + .map_page = eyeq5_iocu_map_page, + .unmap_page = eyeq5_iocu_unmap_page, + .map_sg = eyeq5_iocu_map_sg, + .unmap_sg = eyeq5_iocu_unmap_sg, + .get_required_mask = dma_direct_get_required_mask, +}; +EXPORT_SYMBOL(eyeq5_iocu_ops); + +static int eyeq5_iocu_notifier(struct notifier_block *nb, + unsigned long event, + void *data) +{ + struct device *dev = data; + + /* + * IOCU routing is hardwired; we must use our above custom + * routines for cache-coherent DMA on ethernet interfaces. + */ + if (event == BUS_NOTIFY_ADD_DEVICE && + device_is_compatible(dev, "mobileye,eyeq5-gem")) { + set_dma_ops(dev, &eyeq5_iocu_ops); + return NOTIFY_OK; + } + + return NOTIFY_DONE; +} + +static struct notifier_block eyeq5_iocu_nb = { + .notifier_call = eyeq5_iocu_notifier, +}; + +static int __init eyeq5_iocu_init(void) +{ + return bus_register_notifier(&platform_bus_type, &eyeq5_iocu_nb); +} +postcore_initcall(eyeq5_iocu_init); From patchwork Fri Mar 21 19:09:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025949 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8EAF5C36010 for ; Fri, 21 Mar 2025 19:14:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eVCvCsdm2QzZiL+j0g/Djl/Di8nwXi2dwGkl8GiqOBI=; b=HsnRyAiAli2HcA Ky08feZfEMqyePllrpeTXzrM2NEpCya/LFwsmm+XElTaY6feVI7AVk5yVNfx6y2duZFEW77RkdE2e Eq4cWGSQGxtnO0g+oFT/Azlvls4YvmVFxvzibtvqxzA8+zWUEwIgsbhylmpjW6Fk3IR0xhSmp4vDP En2NkNUZKSPVnBLknhHXdN+CCluJuBXJ76hWUFDQH/rJ6qFnFslyuIQ7cjlEun7Qawj2eZSbjyzd9 J2g3L1cxXcudP/0YxjeuHUKxrl8bxDX2NSU28H+N1f4sAdTctciCrrZibsA5ZXQsdfs3Oam0+Ow7l 39EQ7dnTlVzwEbvwcCqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpD-0000000FzVw-4AHe; Fri, 21 Mar 2025 19:14:35 +0000 Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhou-0000000FzO9-347v for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:17 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id A4B7C44559; Fri, 21 Mar 2025 19:14:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584455; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4TDi+sQdkyFFFV9+gkQoSurbLJHpubG1wu6RejRj0Wc=; b=Rz5VjWfaclIqbA3odhQ6Q0lHzRF1fnnN/dczLLLrNnYkLXzupqfBP2Mu1kbJqwNwXUJq2Q B5FPvKSNXsYVCsdJst1vRo+fMLWyppbncolUAzSxSTXiqox77xR499d60WW0qWkgkhAYoR F82n0YEFzGDXBjqq1W9WbytbeMa5EIrar4umV36glLUb3cd4gttwV6Jp4qOjzBOd9d4no2 lJovYpKdIPPN/OcX1oUVON5H21wkO1/J81prkndIWE2fXCW2CDKMJOlykIO1k43S0ee2di CtwKLWn/dunLqCD07wCyKjkSgsiKki9GBourKW85xu/tpiDJA14uU2BumJK6wA== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:43 +0100 Subject: [PATCH net-next 12/13] MIPS: mobileye: eyeq5: add two Cadence GEM Ethernet controllers MIME-Version: 1.0 Message-Id: <20250321-macb-v1-12-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeejjedrudefhedrkedurdeihedphhgvlhhopegludelvddrudeikedruddrfedtngdpmhgrihhlfhhrohhmpehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvkedprhgtphhtthhopehgrhgvghhorhihrdgtlhgvmhgvnhhtsegsohhothhlihhnrdgtohhmpdhrtghpthhtoheplhhinhhugidqrhhishgtvheslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehprghulhdrfigrlhhmshhlvgihsehsihhfihhvvgdrtghomhdprhgtphhtthhopehtshgsohhgvghnugesrghlphhhrgdrfhhrrghnkhgvnhdruggvpdhrtghpthhtohepkhhusggrs ehkvghrnhgvlhdrohhrghdprhgtphhtthhopehnvghtuggvvhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehnihgtohhlrghsrdhfvghrrhgvsehmihgtrhhotghhihhprdgtohhmpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhm X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_121416_913210_5CE78328 X-CRM114-Status: UNSURE ( 7.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Add both MACB/GEM instances found in the Mobileye EyeQ5 SoC. Signed-off-by: Théo Lebrun --- arch/mips/boot/dts/mobileye/eyeq5.dtsi | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/mips/boot/dts/mobileye/eyeq5.dtsi b/arch/mips/boot/dts/mobileye/eyeq5.dtsi index a84e6e720619ef99e1405ae6296d8bad1aa3fa23..420cb27607bfdd8d5ea510fb668b0a1c85dd7d83 100644 --- a/arch/mips/boot/dts/mobileye/eyeq5.dtsi +++ b/arch/mips/boot/dts/mobileye/eyeq5.dtsi @@ -77,6 +77,8 @@ aliases { serial0 = &uart0; serial1 = &uart1; serial2 = &uart2; + ethernet0 = &macb0; + ethernet1 = &macb1; }; cpu_intc: interrupt-controller { @@ -178,6 +180,38 @@ timer { clocks = <&olb EQ5C_CPU_CORE0>; }; }; + + macb0: ethernet@2a00000 { + compatible = "mobileye,eyeq5-gem"; + reg = <0x0 0x02a00000 0x0 0x4000>; + interrupt-parent = <&gic>; + interrupts = , /* queue0 */ + , /* queue1 */ + , /* queue2 */ + ; /* queue3 */ + clock-names = "pclk", "hclk", "tsu_clk"; + clocks = <&pclk>, <&pclk>, <&tsu_clk>; + dma-coherent; + nvmem-cells = <ð0_mac>; + nvmem-cell-names = "mac-address"; + mobileye,olb = <&olb 0x128 0x134>; + }; + + macb1: ethernet@2b00000 { + compatible = "mobileye,eyeq5-gem"; + reg = <0x0 0x02b00000 0x0 0x4000>; + interrupt-parent = <&gic>; + interrupts = , /* queue0 */ + , /* queue1 */ + , /* queue2 */ + ; /* queue3 */ + clock-names = "pclk", "hclk", "tsu_clk"; + clocks = <&pclk>, <&pclk>, <&tsu_clk>; + dma-coherent; + nvmem-cells = <ð1_mac>; + nvmem-cell-names = "mac-address"; + mobileye,olb = <&olb 0x12c 0x138>; + }; }; }; From patchwork Fri Mar 21 19:09:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 14025950 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE86FC36007 for ; Fri, 21 Mar 2025 19:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Tmj9wxSHlYWZM1iPOtwh57xhlo9/n9Ju1FXDDJ7ioFA=; b=30hP392QmKDFNy N9R39Cbpo/k2znm/xQojA0uDZS3SN0ju8pFjNx1FSrVMWvJ0Xt/L8/m23dOuTvqF16u07VR0+6Nxg bW8Kqhd5BoWyQR0FhtlT016AtCD0VRXNgpELz27gxiNkcvRR37Auk1hVxb1we6u4kt+vgkR0wu2Mk IamvTrca8/HqrIGycY3ZKqX0QoKcBQDREwIrbBzyuzo27/JtwofTK2Vrl9RMik8wYo+KTA0/5B8jm SNqGBgB4rYq9ZM/6bGlPjtK+BTu75EfCvlNIoAeuuNGeBHSeJr63LMqEWnKpk0ZaD6nnVPfk4eaum Ulbi7uVx6cviTWEkmDWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tvhpE-0000000FzWT-2mCO; Fri, 21 Mar 2025 19:14:36 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhoy-0000000FzPH-3ONp for linux-riscv@bombadil.infradead.org; Fri, 21 Mar 2025 19:14:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=qV/BzZ4NMUb9fMiduuWLEtJE4+30wNUTrCBlJGz+oF0=; b=ismLQzruNa9WN/eXMnZalrYAZs TICcbPKHiOPV22obQun9PbsZ7IWRx/dWKOq5ly+pJXxOIhTGf29acu/jUpZMIrtB4qweHjgzMA8sD /P608ZaZZCyOspHcwE3qTueYtPzbdA7yhLz7X4hevo9HVw9meVdfANDQNDuqFhzR8MPpmhucL7m1m MjQMZtUX1QXFKfCFdwxka32qHh2jWsTS7qt8OEHk68PsAoGTjXcyuOW+aKe6ozBXltOgJZFKPCIDf d5LTObhDhmeRHqWEiKcYaGfp08c0LzoRqm93eRFY08wBmtO1BInrXZEZuAT3KkVMfF1CkH0NAj8GR q8sv/ybQ==; Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tvhov-00000004Vnx-3L1y for linux-riscv@lists.infradead.org; Fri, 21 Mar 2025 19:14:19 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4C67D443F3; Fri, 21 Mar 2025 19:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1742584456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qV/BzZ4NMUb9fMiduuWLEtJE4+30wNUTrCBlJGz+oF0=; b=WuxxUnICXSYDWDNEhubsFgp0e4HvOPccnGNoiLnGr9kRIoIxhvfPzMd6Azpwa6bktYkRzd 6eyoGfu7aSmQ5iBAGsbNacbfC4kaRlQ+0H1s6himQcuxwhh82b0VNA+UELdV54HFLpeRYa oO2BSLtDm9wy6ochWMu60mspuWef+eN4MDMNNYQLuGAs/NrJlfoluAW11IqYZLWUmkLYNH a7Oj+RDrg6VA/OPl1lyKijheOEhPA3J2m/ESfV5H1kbPlFHshcoN3X7qUshuiQfGHa4AtV 9Klm+Y1fzIvdZ4IjXSNnGwGnEYSRwOqGAdxXDECOQHz4cF5NH1pfwpKLaWsJhQ== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Fri, 21 Mar 2025 20:09:44 +0100 Subject: [PATCH net-next 13/13] MIPS: mobileye: eyeq5-epm: add two Cadence GEM Ethernet PHYs MIME-Version: 1.0 Message-Id: <20250321-macb-v1-13-537b7e37971d@bootlin.com> References: <20250321-macb-v1-0-537b7e37971d@bootlin.com> In-Reply-To: <20250321-macb-v1-0-537b7e37971d@bootlin.com> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nicolas Ferre , Claudiu Beznea , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Samuel Holland , Richard Cochran , Russell King , Thomas Bogendoerfer , Vladimir Kondratiev , Gregory CLEMENT Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-mips@vger.kernel.org, Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.14.2 X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduheduledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhfffugggtgffkfhgjvfevofesthekredtredtjeenucfhrhhomhepvfhhrohoucfnvggsrhhunhcuoehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmqeenucggtffrrghtthgvrhhnpeelvefhkeeufedvkefghefhgfdukeejlefgtdehtdeivddtteetgedvieelieeuhfenucfkphepjeejrddufeehrdekuddrieehnecuvehluhhsthgvrhfuihiivgepuddunecurfgrrhgrmhepihhnvghtpeejjedrudefhedrkedurdeihedphhgvlhhopegludelvddrudeikedruddrfedtngdpmhgrihhlfhhrohhmpehthhgvohdrlhgvsghruhhnsegsohhothhlihhnrdgtohhmpdhnsggprhgtphhtthhopedvkedprhgtphhtthhopehgrhgvghhorhihrdgtlhgvmhgvnhhtsegsohhothhlihhnrdgtohhmpdhrtghpthhtoheplhhinhhugidqrhhishgtvheslhhishhtshdrihhnfhhrrgguvggrugdrohhrghdprhgtphhtthhopehprghulhdrfigrlhhmshhlvgihsehsihhfihhvvgdrtghomhdprhgtphhtthhopehtshgsohhgvghnugesrghlphhhrgdrfhhrrghnkhgvnhdruggvpdhrtghpthhtohepkhhusggrs ehkvghrnhgvlhdrohhrghdprhgtphhtthhopehnvghtuggvvhesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehnihgtohhlrghsrdhfvghrrhgvsehmihgtrhhotghhihhprdgtohhmpdhrtghpthhtohepthhhohhmrghsrdhpvghtrgiiiihonhhisegsohhothhlihhnrdgtohhm X-GND-Sasl: theo.lebrun@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250321_191417_908459_4EDD67B0 X-CRM114-Status: UNSURE ( 6.41 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The Mobileye EyeQ5 eval board (EPM) embeds two MDIO PHYs. Signed-off-by: Théo Lebrun Reviewed-by: Andrew Lunn --- 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/dts/mobileye/eyeq5-epm5.dts index 6898b2d8267dfadeea511a84d1df3f70744f17bb..20dfc85681bb03330981ca0f11b2edfff3fa57bc 100644 --- a/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts +++ b/arch/mips/boot/dts/mobileye/eyeq5-epm5.dts @@ -21,3 +21,29 @@ memory@0 { <0x8 0x02000000 0x0 0x7E000000>; }; }; + +&macb0 { + phy-mode = "sgmii"; + phy-handle = <&macb0_phy>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + macb0_phy: ethernet-phy@e { + reg = <0xE>; + }; + }; +}; + +&macb1 { + phy-mode = "rgmii-id"; + phy-handle = <&macb1_phy>; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + macb1_phy: ethernet-phy@e { + reg = <0xE>; + }; + }; +};