From nobody Fri Oct 3 23:13:19 2025 Received: from lelvem-ot01.ext.ti.com (lelvem-ot01.ext.ti.com [198.47.23.234]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B4A352F60B4; Sat, 23 Aug 2025 16:11:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.234 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755965509; cv=none; b=n6cOABKKsLKp/b25dI1dhzxNKwKi6n/Ug3rldg96MQVBLQVU2otVhf7XvSBbYdpewXGqSW/7H2HohNn3If6fepF8hYvwuwAGhK+2/L2RCU2sCOTa/+uJFNdWvub8R9vMzjn1pIZqeSlIcoZgY7qUOf8x3pJYArVQ2MUQKWesN50= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755965509; c=relaxed/simple; bh=lLpc1Skz/qzc80mu8DEeqtD1Bc8aHnPFiYQ2jzKIFPY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AiGitKkzBdRAMaC99Y6MwAFGzORF2PqL0bJs2sYhhh3qCncBDzXLgSBf+U1hObIcYtsn9aog1xUlBiWkTIQTBcsCJhONEkC+rYYqEbRHGulR3re5MmS7VXuW1m7+ia2ujJNPdo2PhWnLX4AQNZozwOHDsYAGqC6lJd15yZeh4d8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=LFePR+2F; arc=none smtp.client-ip=198.47.23.234 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="LFePR+2F" Received: from fllvem-sh03.itg.ti.com ([10.64.41.86]) by lelvem-ot01.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57NGBg1w468652; Sat, 23 Aug 2025 11:11:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1755965502; bh=kR/hoH64cH3MOD7K6qgvNDmIbIcrvHYcVdV4BgK66Jg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=LFePR+2F0fUFH6l2JF/n38nOA6bxW/9RThCJuObBvmeiivYJxPDdrDUBO0HnVB65g H7zr+zbpdHXMuSLynugwvvMduFV2e3BxNJ3KQiuJV/Z9XxCaoiyN85n9gWDilIkvVI YDH6n5oyRTArycfzw/PT3USDqpHrLEwo9fV30uLA= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57NGBf8f3736509 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Sat, 23 Aug 2025 11:11:42 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Sat, 23 Aug 2025 11:11:41 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Sat, 23 Aug 2025 11:11:41 -0500 Received: from uda0510294.dhcp.ti.com (uda0510294.dhcp.ti.com [172.24.234.212]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57NG9Exl1274978; Sat, 23 Aug 2025 11:11:37 -0500 From: Beleswar Padhi To: , , , , , CC: , , , , , , , Subject: [PATCH v2 31/33] arm64: dts: ti: k3-am62a-ti-ipc-firmware: Refactor IPC cfg into new dtsi Date: Sat, 23 Aug 2025 21:38:59 +0530 Message-ID: <20250823160901.2177841-32-b-padhi@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250823160901.2177841-1-b-padhi@ti.com> References: <20250823160901.2177841-1-b-padhi@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" The TI K3 AM62A SoCs have multiple programmable remote processors like R5F, C7x etc. The TI SDKs for AM62A SoCs offer sample firmwares which could be run on these cores to demonstrate an "echo" IPC test. Those firmware require certain memory carveouts to be reserved from system memory, timers to be reserved, and certain mailbox configurations for interrupt based messaging. These configurations could be different for a different firmware. While DT is not meant for system configurations, at least refactor these configurations from board level DTS into a dtsi for now. This dtsi for TI IPC firmware is board-independent and can be applied to all boards from the same SoC Family. This gets rid of code duplication and allows more freedom for users developing custom firmware (or no firmware) to utilize system resources better; easily by swapping out this dtsi. To maintain backward compatibility, the dtsi is included in all boards. Signed-off-by: Beleswar Padhi --- v2: Changelog: 1. Re-ordered patch from [PATCH 25/33] to [PATCH v2 31/33]. Link to v1: https://lore.kernel.org/all/20250814223839.3256046-26-b-padhi@ti.com/ .../boot/dts/ti/k3-am62a-phycore-som.dtsi | 90 +---------------- .../boot/dts/ti/k3-am62a-ti-ipc-firmware.dtsi | 98 +++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 92 +---------------- arch/arm64/boot/dts/ti/k3-am62d2-evm.dts | 76 +------------- 4 files changed, 102 insertions(+), 254 deletions(-) create mode 100644 arch/arm64/boot/dts/ti/k3-am62a-ti-ipc-firmware.dtsi diff --git a/arch/arm64/boot/dts/ti/k3-am62a-phycore-som.dtsi b/arch/arm64/= boot/dts/ti/k3-am62a-phycore-som.dtsi index 3108e9b0c804..44c73ed637da 100644 --- a/arch/arm64/boot/dts/ti/k3-am62a-phycore-som.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62a-phycore-som.dtsi @@ -59,30 +59,6 @@ linux,cma { linux,cma-default; }; =20 - c7x_0_dma_memory_region: c7x-dma-memory@99800000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x99800000 0x00 0x100000>; - no-map; - }; - - c7x_0_memory_region: c7x-memory@99900000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x99900000 0x00 0xf00000>; - no-map; - }; - - mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x9b800000 0x00 0x100000>; - no-map; - }; - - mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x9b900000 0x00 0xf00000>; - no-map; - }; - wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 { compatible =3D "shared-dma-pool"; reg =3D <0x00 0x9c800000 0x00 0x100000>; @@ -209,13 +185,6 @@ opp-1400000000 { }; }; =20 -&c7x_0 { - mboxes =3D <&mailbox0_cluster1 &mbox_c7x_0>; - memory-region =3D <&c7x_0_dma_memory_region>, - <&c7x_0_memory_region>; - status =3D "okay"; -}; - &cpsw3g { pinctrl-names =3D "default"; pinctrl-0 =3D <&main_rgmii1_pins_default>; @@ -246,33 +215,6 @@ &fss { status =3D "okay"; }; =20 -&mailbox0_cluster0 { - status =3D "okay"; - - mbox_r5_0: mbox-r5-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&mailbox0_cluster1 { - status =3D "okay"; - - mbox_c7x_0: mbox-c7x-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&mailbox0_cluster2 { - status =3D "okay"; - - mbox_mcu_r5_0: mbox-mcu-r5-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - &main_i2c0 { pinctrl-names =3D "default"; pinctrl-0 =3D <&main_i2c0_pins_default>; @@ -388,27 +330,6 @@ &main_pktdma { bootph-all; }; =20 -/* main_rti4 is used by C7x DSP */ -&main_rti4 { - status =3D "reserved"; -}; - -/* main_timer2 is used by C7x DSP */ -&main_timer2 { - status =3D "reserved"; -}; - -&mcu_r5fss0 { - status =3D "okay"; -}; - -&mcu_r5fss0_core0 { - mboxes =3D <&mailbox0_cluster2 &mbox_mcu_r5_0>; - memory-region =3D <&mcu_r5fss0_core0_dma_memory_region>, - <&mcu_r5fss0_core0_memory_region>; - status =3D "okay"; -}; - &ospi0 { pinctrl-names =3D "default"; pinctrl-0 =3D <&ospi0_pins_default>; @@ -437,13 +358,4 @@ &sdhci0 { status =3D "okay"; }; =20 -&wkup_r5fss0 { - status =3D "okay"; -}; - -&wkup_r5fss0_core0 { - mboxes =3D <&mailbox0_cluster0 &mbox_r5_0>; - memory-region =3D <&wkup_r5fss0_core0_dma_memory_region>, - <&wkup_r5fss0_core0_memory_region>; - status =3D "okay"; -}; +#include "k3-am62a-ti-ipc-firmware.dtsi" diff --git a/arch/arm64/boot/dts/ti/k3-am62a-ti-ipc-firmware.dtsi b/arch/ar= m64/boot/dts/ti/k3-am62a-ti-ipc-firmware.dtsi new file mode 100644 index 000000000000..91583cd23b12 --- /dev/null +++ b/arch/arm64/boot/dts/ti/k3-am62a-ti-ipc-firmware.dtsi @@ -0,0 +1,98 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/** + * Device Tree Source for enabling IPC using TI SDK firmware on AM62A SoCs + * + * Copyright (C) 2022-2025 Texas Instruments Incorporated - https://www.ti= .com/ + */ + +&reserved_memory { + c7x_0_dma_memory_region: c7x-dma-memory@99800000 { + compatible =3D "shared-dma-pool"; + reg =3D <0x00 0x99800000 0x00 0x100000>; + no-map; + }; + + c7x_0_memory_region: c7x-memory@99900000 { + compatible =3D "shared-dma-pool"; + reg =3D <0x00 0x99900000 0x00 0xf00000>; + no-map; + }; + + mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 { + compatible =3D "shared-dma-pool"; + reg =3D <0x00 0x9b800000 0x00 0x100000>; + no-map; + }; + + mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 { + compatible =3D "shared-dma-pool"; + reg =3D <0x00 0x9b900000 0x00 0xf00000>; + no-map; + }; +}; + +&mailbox0_cluster0 { + status =3D "okay"; + + mbox_r5_0: mbox-r5-0 { + ti,mbox-rx =3D <0 0 0>; + ti,mbox-tx =3D <1 0 0>; + }; +}; + +&mailbox0_cluster1 { + status =3D "okay"; + + mbox_c7x_0: mbox-c7x-0 { + ti,mbox-rx =3D <0 0 0>; + ti,mbox-tx =3D <1 0 0>; + }; +}; + +&mailbox0_cluster2 { + status =3D "okay"; + + mbox_mcu_r5_0: mbox-mcu-r5-0 { + ti,mbox-rx =3D <0 0 0>; + ti,mbox-tx =3D <1 0 0>; + }; +}; + +&wkup_r5fss0 { + status =3D "okay"; +}; + +&wkup_r5fss0_core0 { + mboxes =3D <&mailbox0_cluster0>, <&mbox_r5_0>; + memory-region =3D <&wkup_r5fss0_core0_dma_memory_region>, + <&wkup_r5fss0_core0_memory_region>; + status =3D "okay"; +}; + +&mcu_r5fss0 { + status =3D "okay"; +}; + +&mcu_r5fss0_core0 { + mboxes =3D <&mailbox0_cluster2>, <&mbox_mcu_r5_0>; + memory-region =3D <&mcu_r5fss0_core0_dma_memory_region>, + <&mcu_r5fss0_core0_memory_region>; + status =3D "okay"; +}; + +&c7x_0 { + mboxes =3D <&mailbox0_cluster1>, <&mbox_c7x_0>; + memory-region =3D <&c7x_0_dma_memory_region>, + <&c7x_0_memory_region>; + status =3D "okay"; +}; + +/* main_rti4 is used by C7x DSP */ +&main_rti4 { + status =3D "reserved"; +}; + +/* main_timer2 is used by C7x DSP */ +&main_timer2 { + status =3D "reserved"; +}; diff --git a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts b/arch/arm64/boot/dts/= ti/k3-am62a7-sk.dts index 7ebcfe8edfe1..ede03f449d65 100644 --- a/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am62a7-sk.dts @@ -53,30 +53,6 @@ linux,cma { linux,cma-default; }; =20 - c7x_0_dma_memory_region: c7x-dma-memory@99800000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x99800000 0x00 0x100000>; - no-map; - }; - - c7x_0_memory_region: c7x-memory@99900000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x99900000 0x00 0xf00000>; - no-map; - }; - - mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x9b800000 0x00 0x100000>; - no-map; - }; - - mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x9b900000 0x00 0xf00000>; - no-map; - }; - wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 { compatible =3D "shared-dma-pool"; reg =3D <0x00 0x9c800000 0x00 0x100000>; @@ -713,11 +689,6 @@ &main_uart1 { status =3D "reserved"; }; =20 -/* main_timer2 is used by C7x DSP */ -&main_timer2 { - status =3D "reserved"; -}; - &usbss0 { status =3D "okay"; ti,vbus-divider; @@ -835,67 +806,6 @@ &epwm1 { status =3D "okay"; }; =20 -&mailbox0_cluster0 { - status =3D "okay"; - - mbox_r5_0: mbox-r5-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&mailbox0_cluster1 { - status =3D "okay"; - - mbox_c7x_0: mbox-c7x-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&mailbox0_cluster2 { - status =3D "okay"; - - mbox_mcu_r5_0: mbox-mcu-r5-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&wkup_r5fss0 { - status =3D "okay"; -}; - -&wkup_r5fss0_core0 { - mboxes =3D <&mailbox0_cluster0>, <&mbox_r5_0>; - memory-region =3D <&wkup_r5fss0_core0_dma_memory_region>, - <&wkup_r5fss0_core0_memory_region>; - status =3D "okay"; -}; - -&mcu_r5fss0 { - status =3D "okay"; -}; - -&mcu_r5fss0_core0 { - mboxes =3D <&mailbox0_cluster2>, <&mbox_mcu_r5_0>; - memory-region =3D <&mcu_r5fss0_core0_dma_memory_region>, - <&mcu_r5fss0_core0_memory_region>; - status =3D "okay"; -}; - -&c7x_0 { - mboxes =3D <&mailbox0_cluster1>, <&mbox_c7x_0>; - memory-region =3D <&c7x_0_dma_memory_region>, - <&c7x_0_memory_region>; - status =3D "okay"; -}; - -/* main_rti4 is used by C7x DSP */ -&main_rti4 { - status =3D "reserved"; -}; - &fss { status =3D "okay"; }; @@ -937,3 +847,5 @@ AM62AX_IOPAD(0x008, PIN_INPUT, 0) /* (J24) OSPI0_DQS */ >; }; }; + +#include "k3-am62a-ti-ipc-firmware.dtsi" diff --git a/arch/arm64/boot/dts/ti/k3-am62d2-evm.dts b/arch/arm64/boot/dts= /ti/k3-am62d2-evm.dts index 41860ac42f3c..a57fc2362dfd 100644 --- a/arch/arm64/boot/dts/ti/k3-am62d2-evm.dts +++ b/arch/arm64/boot/dts/ti/k3-am62d2-evm.dts @@ -58,30 +58,6 @@ secure_tfa_ddr: tfa@80000000 { no-map; }; =20 - c7x_0_dma_memory_region: c7x-dma-memory@99800000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x99800000 0x00 0x100000>; - no-map; - }; - - c7x_0_memory_region: c7x-memory@99900000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x99900000 0x00 0xf00000>; - no-map; - }; - - mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x9b800000 0x00 0x100000>; - no-map; - }; - - mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 { - compatible =3D "shared-dma-pool"; - reg =3D <0x00 0x9b900000 0x00 0xf00000>; - no-map; - }; - wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 { compatible =3D "shared-dma-pool"; reg =3D <0x00 0x9c800000 0x00 0x100000>; @@ -551,66 +527,16 @@ cpsw3g_phy1: ethernet-phy@3 { }; }; =20 -&mailbox0_cluster0 { - status =3D "okay"; - - mbox_r5_0: mbox-r5-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&mailbox0_cluster1 { - status =3D "okay"; - - mbox_c7x_0: mbox-c7x-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&mailbox0_cluster2 { - status =3D "okay"; - - mbox_mcu_r5_0: mbox-mcu-r5-0 { - ti,mbox-rx =3D <0 0 0>; - ti,mbox-tx =3D <1 0 0>; - }; -}; - -&wkup_r5fss0 { - status =3D "okay"; -}; - &wkup_r5fss0_core0 { - mboxes =3D <&mailbox0_cluster0 &mbox_r5_0>; - memory-region =3D <&wkup_r5fss0_core0_dma_memory_region>, - <&wkup_r5fss0_core0_memory_region>; - status =3D "okay"; bootph-pre-ram; }; =20 -&mcu_r5fss0 { - status =3D "okay"; -}; - &mcu_r5fss0_core0 { - mboxes =3D <&mailbox0_cluster2 &mbox_mcu_r5_0>; - memory-region =3D <&mcu_r5fss0_core0_dma_memory_region>, - <&mcu_r5fss0_core0_memory_region>; firmware-name =3D "am62d-mcu-r5f0_0-fw"; - status =3D "okay"; }; =20 &c7x_0 { - mboxes =3D <&mailbox0_cluster1 &mbox_c7x_0>; - memory-region =3D <&c7x_0_dma_memory_region>, - <&c7x_0_memory_region>; firmware-name =3D "am62d-c71_0-fw"; - status =3D "okay"; }; =20 -/* main_rti4 is used by C7x DSP */ -&main_rti4 { - status =3D "reserved"; -}; +#include "k3-am62a-ti-ipc-firmware.dtsi" --=20 2.34.1