From patchwork Wed Jun 19 11:24:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 13703685 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 082F3C27C53 for ; Wed, 19 Jun 2024 11:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=xZufrVenZZNOki6ThkT5V784LHMR0r2wNvufJAnx7Y8=; b=n7OJOwcb0ZsnIHAxP5ovnnw71z y77Qzo+Uoes8SsdWsq5bKuBk6uyUYME/h2KtVYaIweMOZ3NjdjuWQ2yFxKNkgM8X6gMJzFrodJZyi /hK5yxDVVuTmG9dKTvIjnLqKDpOJF4USgo4TaE6SLV8XsjSK4qhvi4NfuPixA5qH+8fAZMtRS9QfW goSUh0MWFwY7dO7aSQ46yvFJ66mCde6UQTV5cTScOHpECu2PtWQlCo049idxvMazURSLAYGemVLcp Mxrp3IOLFxFiSginuJsNZMq4JYkkLDKBVbX7iZjxOzm8w0So0zV/25waN3VFPwYTqDbJIJXFD3UXJ oKLdRLCQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtR2-00000000xTD-0NT6; Wed, 19 Jun 2024 11:25:04 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtQV-00000000x8g-3Tih for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 11:24:34 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1718796271; x=1750332271; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=xZufrVenZZNOki6ThkT5V784LHMR0r2wNvufJAnx7Y8=; b=Wq7EsMFHIcSt9xCzzyCSaGm463Ov5yPtY8pyjLgiYrjKhDDuA2saS6PG NBhKkyx2tw1uyEdgjdfjjPnYktAhnBrQ6M3zooC80wEu+G8F1QSO6P+6N tbQe9wsREZdDKfJlQ2wu+5ZVPzpsnpH1l1jlwnZsrwrMqJtUUUPgWxoiN BsktTDFnnE6Ifpkiq/FHsc+mhW4xdWJa186s8PmG/4VpeGqV1Hxop1HBb y5M/o6kO4x+JdQP6MMflbXM8FLPYVn4sTphx62jMzOucu2C5c9j6vxu/N B3kSWyPw6Mt3DFiSugnB3YZa99HBeNY3xSc3pbaV3acDYdeb6pGwwPPB6 A==; X-CSE-ConnectionGUID: KtG8NCUNS6OqyLTOH1tEbw== X-CSE-MsgGUID: TnTC/eVQQlSgSps1kOY4xA== X-IronPort-AV: E=Sophos;i="6.08,250,1712613600"; d="scan'208";a="37474780" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 19 Jun 2024 13:24:29 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 00F14165949; Wed, 19 Jun 2024 13:24:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1718796265; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding; bh=xZufrVenZZNOki6ThkT5V784LHMR0r2wNvufJAnx7Y8=; b=YoBm1bkm65S2SF3FEZHDxxzFsGx6IuEcYgJl3WLnSg1dVr4Xgfzze1KcgAtq5O5xPYZp37 zLaYKOTD34GxPwkf1Dw67kHtdDhnzXx1eTQuTJqnGqv8NLqYrXlN64HeC1BfpM615LMki9 OjPHwJe8bq2OGs8+wZ41qBQlFX3hJg3FhTW4AHZrLMihFjrKYibvLmyLcrehel3WWMgYxB TnhPg4C3ml35HPj31Klr2SatE93oIB059w1ZDQpoT9Q0dBI6ncrZENq2ZTSpeyYcOHX7EK reHfywshrEjGOLSMuGxVrWLs5KjxK1XPImZjFt3clW0+iWMA9DQ2r5bcJohCUA== From: Matthias Schiffer To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Suman Anna Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH 1/2] dt-bindings: soc: ti: pruss: allow ethernet controller in ICSSG node Date: Wed, 19 Jun 2024 13:24:05 +0200 Message-ID: <20240619112406.106223-1-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_042432_539676_EE8D541F X-CRM114-Status: GOOD ( 13.28 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org While the current Device Trees for TI EVMs configure the PRUSS Ethernet controller as a toplevel node with names like "icssg1-eth", allowing to make it a subnode of the ICSSG has a number of advantages: - It makes sense semantically - the Ethernet controller is running on the ICSSG/PRUSS - Disabling or deleting the ICSSG node implicitly removes the Ethernet controller node when it is a child node. This can be relevant on SoCs like the AM64x which come in variants with and without ICSSG; e.g., on the TQMa64xxL the ICSSG node will be disabled on variants without as a bootloader fixup. On Linux, this avoids leaving the Ethernet controller in deferred state forever while waiting for the ICSSG to become available (resulting in a warning on newer kernels) The node name "ethernet" is chosen as it nicely matches the regular "ethernet@" format of many Ethernet controller nodes, and is also what the prueth binding example (/schemas/net/ti,icssg-prueth.yaml) uses. Signed-off-by: Matthias Schiffer --- Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml index c402cb2928e89..89dfcf5ce8434 100644 --- a/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml +++ b/Documentation/devicetree/bindings/soc/ti/ti,pruss.yaml @@ -92,6 +92,13 @@ properties: description: | This property is as per sci-pm-domain.txt. + ethernet: + description: | + ICSSG PRUSS Ethernet. Configuration for an Ethernet controller running + on the PRU-ICSS. + $ref: /schemas/net/ti,icssg-prueth.yaml# + type: object + patternProperties: memories@[a-f0-9]+$: From patchwork Wed Jun 19 11:24:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 13703686 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 75425C2BA15 for ; Wed, 19 Jun 2024 11:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=iNCg5Yfxo+yi57fLJRdraGxrmBw0QNUTJqDZy4I2bmg=; b=5DCyM90MeDErfRAccKaGd3I+HF Gez2i8XJF5NGjVBwFovNcKytG1f5kl0b1SVPYh2yYoyMZo7jcbSnLOk9HSnRQ38zBZRZ0KaoYZP4/ W/CXvy6YeNkFpKgQQvxM9ZDkT3ffl4/ar8mXU/IPtFzugxK3CJU5XLz8cJSMwLVjUJC4Dan+Uscnk SxzzwDsjHRNxC8ZEXsZ9MBiSf/cxz6udsDGEOMiNYUhihPtvGkWQ9TR7pSeuykhHx7ZKHhwBvE6z1 KTM6hgWJEJ1RHER99R6SyRCTXTePN7zBK1eiH4MUL1XISv8s5LNVUf529AZI+zPILzo08hfKfNRGo C3hg5nIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtR5-00000000xVZ-0lOL; Wed, 19 Jun 2024 11:25:07 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJtQZ-00000000x8g-0t2N for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 11:24:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1718796275; x=1750332275; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=iNCg5Yfxo+yi57fLJRdraGxrmBw0QNUTJqDZy4I2bmg=; b=kpefWvpGygZwRuvDB/ZN3WkknIY3MwF+TZMlgIdY4I3B9QFbJp/KCIOW pQu/MmiF7JX3Q9jnlBPuXg5HgzncHX5Vrdkl6c6Fa0agDmgfSejK0KOFi yCxBJlDjDuSIVEHvfJOqxrrHWQ+bO1hxhCF5WBwAmx5jzHKcB/LaEQSFt PpWSkVwaRL3skPs6xqUBdADl/IbzVHlYRieLRNubcLEMynqk8XgYA4+st ibE78i0aFvAIoDYa/afdmkBXl3w49fkLDSgrzcZ/U0aswLO/N/yZxkrGr vlZ15xko++YiT78/06g+CVvuXShS8rvYNlUqWH2P2WPCcUi34CCtvh5xi A==; X-CSE-ConnectionGUID: G/Nx2jDdTlGM5EJYS6yGFA== X-CSE-MsgGUID: 7EkOx4TqS6+QGeHHKVgvtw== X-IronPort-AV: E=Sophos;i="6.08,250,1712613600"; d="scan'208";a="37474781" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 19 Jun 2024 13:24:34 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 465E616697D; Wed, 19 Jun 2024 13:24:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1718796269; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=iNCg5Yfxo+yi57fLJRdraGxrmBw0QNUTJqDZy4I2bmg=; b=ZmoiVL+SI3BIRs898kH6F5sdnh1MGcHHcnf2GJs1NCkLtlEIJli+2tdp+o//xXhJWUS2Ht qlN4wJjyLr88d1IoX5r4ySsk1e3qMTGsxYl14nvc6Fttj1ac6BgsVw62JTJOajnnm3rBcp unVFTk986HB1hl3UPAGWwTuPF1lRUQY9ViRhyL766+lpPxfS1G+XA8/tTiLdAS+/27B8Kk IRmFYrboYXu7tfNLyqW9PCOxUUSOqZZT1kE9bDhU3jQJfqy0vSF8uBefVEIyo9xf2ahsAI QB9TaRJ7IJ+TtDbApB0E90RJ+sj8gLqQ+pWj015TP1gPzVRALnVhP0gjMK5VsQ== From: Matthias Schiffer To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Suman Anna Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH 2/2] arm64: dts: ti: k3-am642-tqma64xxl-mbax4xxl: add PRU Ethernet support Date: Wed, 19 Jun 2024 13:24:06 +0200 Message-ID: <20240619112406.106223-2-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619112406.106223-1-matthias.schiffer@ew.tq-group.com> References: <20240619112406.106223-1-matthias.schiffer@ew.tq-group.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_042435_683231_3AC1E3FF X-CRM114-Status: GOOD ( 16.49 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add PRU Ethernet controller and PHY nodes, as it was previously done for the AM64x EVM Device Trees. Differing from the EVM, we add the virtual ethernet controller device below &icssg1 instead of the top level. Besides being slighly more accurate, this has the advantage that the node is implicitly disabled when &icssg1 has status = "disabled" (which the TQMa64xxL bootloader adds as a fixup when running on an AM64x variant without ICSSG support), thus avoiding leaving the ethernet device in EPROBE_DEFER limbo forever. Signed-off-by: Matthias Schiffer --- k3-am642-evm.dts uses "ti-pruss/am64x-sr2-*" filenames instead of "ti-pruss/am65x-sr2-*", however it is not clear to me where these would come from - I'm not aware of any firmwares named like that. So far, these firmwares are not in mainline linux-firmware; TI's reference BSPs include firmware from ti-linux-firmware [1], and the same "am65x-sr2" firmwares are used on AM65x and AM64x SoCs. [1] https://git.ti.com/gitweb?p=processor-firmware/ti-linux-firmware.git;a=tree;f=ti-pruss;h=a220bdc6dce5e11845b5c6337ff9b2d329aee196;hb=refs/heads/ti-linux-firmware .../dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts b/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts index 1f4dc5ad1696a..0eff392a29b00 100644 --- a/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts +++ b/arch/arm64/boot/dts/ti/k3-am642-tqma64xxl-mbax4xxl.dts @@ -24,6 +24,8 @@ / { aliases { ethernet0 = &cpsw_port1; + ethernet1 = &icssg1_emac0; + ethernet2 = &icssg1_emac1; i2c1 = &mcu_i2c0; mmc1 = &sdhci1; serial0 = &mcu_uart0; @@ -154,6 +156,104 @@ &epwm5 { status = "okay"; }; +&icssg1 { + icssg1_eth: ethernet { + compatible = "ti,am642-icssg-prueth"; + pinctrl-names = "default"; + pinctrl-0 = <&pru_icssg1_rgmii1_pins>, <&pru_icssg1_rgmii2_pins>; + interrupt-parent = <&icssg1_intc>; + interrupts = <24 0 2>, <25 1 3>; + interrupt-names = "tx_ts0", "tx_ts1"; + dmas = <&main_pktdma 0xc200 15>, /* egress slice 0 */ + <&main_pktdma 0xc201 15>, /* egress slice 0 */ + <&main_pktdma 0xc202 15>, /* egress slice 0 */ + <&main_pktdma 0xc203 15>, /* egress slice 0 */ + <&main_pktdma 0xc204 15>, /* egress slice 1 */ + <&main_pktdma 0xc205 15>, /* egress slice 1 */ + <&main_pktdma 0xc206 15>, /* egress slice 1 */ + <&main_pktdma 0xc207 15>, /* egress slice 1 */ + <&main_pktdma 0x4200 15>, /* ingress slice 0 */ + <&main_pktdma 0x4201 15>; /* ingress slice 1 */ + dma-names = "tx0-0", "tx0-1", "tx0-2", "tx0-3", + "tx1-0", "tx1-1", "tx1-2", "tx1-3", + "rx0", "rx1"; + sram = <&oc_sram>; + firmware-name = "ti-pruss/am65x-sr2-pru0-prueth-fw.elf", + "ti-pruss/am65x-sr2-rtu0-prueth-fw.elf", + "ti-pruss/am65x-sr2-txpru0-prueth-fw.elf", + "ti-pruss/am65x-sr2-pru1-prueth-fw.elf", + "ti-pruss/am65x-sr2-rtu1-prueth-fw.elf", + "ti-pruss/am65x-sr2-txpru1-prueth-fw.elf"; + ti,prus = <&pru1_0>, <&rtu1_0>, <&tx_pru1_0>, <&pru1_1>, <&rtu1_1>, <&tx_pru1_1>; + ti,pruss-gp-mux-sel = <2>, /* MII mode */ + <2>, + <2>, + <2>, /* MII mode */ + <2>, + <2>; + ti,mii-g-rt = <&icssg1_mii_g_rt>; + ti,mii-rt = <&icssg1_mii_rt>; + ti,iep = <&icssg1_iep0>, <&icssg1_iep1>; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + icssg1_emac0: port@0 { + reg = <0>; + phy-handle = <&icssg1_phy0c>; + phy-mode = "rgmii-id"; + /* Filled in by bootloader */ + local-mac-address = [00 00 00 00 00 00]; + }; + + icssg1_emac1: port@1 { + reg = <1>; + phy-handle = <&icssg1_phy03>; + phy-mode = "rgmii-id"; + /* Filled in by bootloader */ + local-mac-address = [00 00 00 00 00 00]; + }; + }; + }; +}; + +&icssg1_mdio { + pinctrl-names = "default"; + pinctrl-0 = <&pru_icssg1_mdio_pins>; + status = "okay"; + + /* phy-mode is fixed up to rgmii-rxid by prueth driver to account for + * the SoC integration, so the only rx-internal-delay and no + * tx-internal-delay is set for the PHYs. + */ + + icssg1_phy03: ethernet-phy@3 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x3>; + reset-gpios = <&main_gpio1 47 GPIO_ACTIVE_LOW>; + reset-assert-us = <1000>; + reset-deassert-us = <1000>; + ti,rx-fifo-depth = ; + ti,tx-fifo-depth = ; + ti,rx-internal-delay = ; + ti,clk-output-sel = ; + }; + + icssg1_phy0c: ethernet-phy@c { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0xc>; + reset-gpios = <&main_gpio1 51 GPIO_ACTIVE_LOW>; + reset-assert-us = <1000>; + reset-deassert-us = <1000>; + ti,rx-fifo-depth = ; + ti,tx-fifo-depth = ; + ti,rx-internal-delay = ; + ti,clk-output-sel = ; + }; +}; + + &main_gpio0 { pinctrl-names = "default"; pinctrl-0 = <&main_gpio0_digital_pins>,