lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250515153128.147457-4-laurentiumihalcea111@gmail.com>
Date: Thu, 15 May 2025 11:31:28 -0400
From: Laurentiu Mihalcea <laurentiumihalcea111@...il.com>
To: Mark Brown <broonie@...nel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
	Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>,
	Liam Girdwood <lgirdwood@...il.com>
Cc: linux-kernel@...r.kernel.org,
	linux-sound@...r.kernel.org
Subject: [PATCH RFC 3/3] ASoC: generic: add more sample DTSIs for audio-graph-card2

From: Laurentiu Mihalcea <laurentiu.mihalcea@....com>

Add some more audio-graph-card2 sample DTSIs meant to aid in testing
the driver's capability to parse explicitly disabled links. To conclude
that the feature works correctly, all audio-graph-card2 samples need to
work as expected. This includes the custom ones:

	1) audio-graph-card2-custom-sample1.dtsi
	2) audio-graph-card2-custom-sample2.dtsi

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@....com>
---
 .../generic/audio-graph-card2-sample1.dtsi    | 278 ++++++
 .../generic/audio-graph-card2-sample2.dtsi    | 878 ++++++++++++++++++
 .../generic/audio-graph-card2-sample3.dtsi    | 486 ++++++++++
 3 files changed, 1642 insertions(+)
 create mode 100644 sound/soc/generic/audio-graph-card2-sample1.dtsi
 create mode 100644 sound/soc/generic/audio-graph-card2-sample2.dtsi
 create mode 100644 sound/soc/generic/audio-graph-card2-sample3.dtsi

diff --git a/sound/soc/generic/audio-graph-card2-sample1.dtsi b/sound/soc/generic/audio-graph-card2-sample1.dtsi
new file mode 100644
index 000000000000..ce0098a160a6
--- /dev/null
+++ b/sound/soc/generic/audio-graph-card2-sample1.dtsi
@@ -0,0 +1,278 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2025 NXP
+ *
+ * audio-graph-card2 simple link test scenarios
+ *
+ * IMPORTANT:
+ *
+ *	1) DO NOT use this alongside the other test scenarios as the
+ *	node names are not unique across test DTSIs.
+ */
+
+/ {
+	/*
+	 * Testcase 00
+	 *
+	 * DESCRIPTION: test simple CPU-CODEC with no routing specified. Each
+	 * endpoint device has only one available port.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	CPU0 <---@...-> CODEC0
+	 *	CPU1 <---@...-> CODEC1
+	 *	CPU2 <---@...-> CODEC2
+	 *
+	 *	CPU0 => ENABLED
+	 *	CPU1 => DISABLED
+	 *	CPU2 => ENABLED
+	 *	CODEC0 => ENABLED
+	 *	CODEC1 => ENABLED
+	 *	CODEC2 => DISABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 2 explicitly disabled links.
+	 */
+	test-case-00 {
+		compatible = "audio-graph-card2";
+		label = "test-case-00";
+		links = <&simple_cpu0_port>,
+			<&simple_cpu1_port>,
+			<&simple_cpu2_port>;
+	};
+
+	test-cpu0 {
+		compatible = "test-cpu";
+
+		simple_cpu0_port: port {
+			biclock-master;
+			frame-master;
+
+			test_cpu_0_ep: endpoint {
+				remote-endpoint = <&test_codec_0_ep>;
+			};
+		};
+	};
+
+	test-cpu1 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		simple_cpu1_port: port {
+			biclock-master;
+			frame-master;
+
+			test_cpu_1_ep: endpoint {
+				remote-endpoint = <&test_codec_1_ep>;
+			};
+		};
+	};
+
+	test-cpu2 {
+		compatible = "test-cpu";
+
+		simple_cpu2_port: port {
+			bitclock-master;
+			frame-master;
+
+			test_cpu_2_ep: endpoint {
+				remote-endpoint = <&test_codec_2_ep>;
+			};
+		};
+	};
+
+	test-codec0 {
+		compatible = "test-codec";
+
+		port {
+			test_codec_0_ep: endpoint {
+				remote-endpoint = <&test_cpu_0_ep>;
+			};
+		};
+	};
+
+	test-codec1 {
+		compatible = "test-codec";
+
+		port {
+			test_codec_1_ep: endpoint {
+				remote-endpoint = <&test_cpu_1_ep>;
+			};
+		};
+	};
+
+	test-codec2 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		port {
+			test_codec_2_ep: endpoint {
+				remote-endpoint = <&test_cpu_2_ep>;
+			};
+		};
+	};
+
+	/*
+	 * Testcase 01
+	 *
+	 * DESCRIPTION: test simple CPU-CODEC with no routing specified. Each
+	 * endpoint device has one or more available ports.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	CPU3/P0 <---@...-> CODEC3
+	 *	CPU3/P1 <---@...-> CODEC4
+	 *	CPU4    <---@...-> CODEC5/P0
+	 *	CPU3/P2 <---@...-> CODEC5/P1
+	 *
+	 *	CPU3 => ENABLED
+	 *	CPU4 => DISABLED
+	 *	CODEC3 => ENABLED
+	 *	CODEC4 => DISABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 2 explicitly disabled links
+	 */
+	test-case-01 {
+		compatible = "audio-graph-card2";
+		label = "test-case-01";
+		links = <&test_cpu3_port0>,
+			<&test_cpu3_port1>,
+			<&test_cpu4_port>,
+			<&test_cpu3_port2>;
+	};
+
+	test-cpu3 {
+		compatible = "test-cpu";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			test_cpu3_port0: port@0 {
+				reg = <0>;
+
+				test_cpu3_p0_ep: endpoint {
+					remote-endpoint = <&test_codec3_ep>;
+				};
+			};
+
+			test_cpu3_port1: port@1 {
+				reg = <1>;
+
+				test_cpu3_p1_ep: endpoint {
+					remote-endpoint = <&test_codec4_ep>;
+				};
+			};
+
+			test_cpu3_port2: port@2 {
+				reg = <2>;
+
+				test_cpu3_p2_ep: endpoint {
+					remote-endpoint = <&test_codec5_p1_ep>;
+				};
+			};
+		};
+	};
+
+	test-cpu4 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		test_cpu4_port: port {
+			test_cpu4_ep: endpoint {
+				remote-endpoint = <&test_codec5_p0_ep>;
+			};
+		};
+	};
+
+	test-codec3 {
+		compatible = "test-codec";
+
+		port {
+			test_codec3_ep: endpoint {
+				remote-endpoint = <&test_cpu3_p0_ep>;
+			};
+		};
+	};
+
+	test-codec4 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		port {
+			test_codec4_ep: endpoint {
+				remote-endpoint = <&test_cpu3_p1_ep>;
+			};
+		};
+	};
+
+	test-codec5 {
+		compatible = "test-codec";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			test_codec5_port0: port@0 {
+				reg = <0>;
+
+				test_codec5_p0_ep: endpoint {
+					remote-endpoint = <&test_cpu4_ep>;
+				};
+			};
+
+			test_codec5_port1: port@1 {
+				reg = <1>;
+
+				test_codec5_p1_ep: endpoint {
+					remote-endpoint = <&test_cpu3_p2_ep>;
+				};
+			};
+		};
+	};
+
+	/*
+	 * Testcase 02
+	 *
+	 * DESCRIPTION: test simple CPU-CODEC with no routing specified. The
+	 * CPU-CODEC link is disabled.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	CPU5 <---@...--> CODEC6
+	 *
+	 *	CPU5 => DISABLED
+	 *	CODEC6 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should fail since all of its links are
+	 *	explicitly disabled.
+	 */
+	test-case-02 {
+		compatible = "audio-graph-card2";
+		label = "test-case-02";
+		links = <&test_cpu5_port>;
+	};
+
+	test-cpu5 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		test_cpu5_port: port {
+			test_cpu5_port_ep: endpoint {
+				remote-endpoint = <&test_codec6_port_ep>;
+			};
+		};
+	};
+
+	test-codec6 {
+		compatible = "test-codec";
+
+		port {
+			test_codec6_port_ep: endpoint {
+				remote-endpoint = <&test_cpu5_port_ep>;
+			};
+		};
+	};
+};
diff --git a/sound/soc/generic/audio-graph-card2-sample2.dtsi b/sound/soc/generic/audio-graph-card2-sample2.dtsi
new file mode 100644
index 000000000000..0bcbf2a46b79
--- /dev/null
+++ b/sound/soc/generic/audio-graph-card2-sample2.dtsi
@@ -0,0 +1,878 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2025 NXP
+ *
+ * audio-graph-card2 multi link test scenarios
+ *
+ * IMPORTANT:
+ *
+ *	1) DO NOT use this alongside the other test scenarios as the
+ *	node names are not unique across test DTSIs.
+ *
+ *	2) The test topologies used here are adapted from
+ *	"audio-graph-card2-custom-sample1.dtsi".
+ */
+
+/ {
+	/*
+	 * Testcase 00
+	 *
+	 * DESCRIPTION: test disabled semi-multi link
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	                          +-+
+	 *      TEST_CPU0/P0 <-@...-----> | |-> TEST_CODEC0/P0
+	 *                                | |-> TEST_CODEC0/P1
+	 *                                +-+
+	 *
+	 *	TEST_CODEC0 => DISABLED
+	 *	TEST_CPU0 => ENABLED
+	 *
+	 *
+	 * RESULT:
+	 *	- sound card creation should fail as all of its links are
+	 *	explicitly disabled.
+	 */
+	test-case-00 {
+		compatible = "audio-graph-card2";
+		label = "test-case-00";
+		links = <&cpu0_port0>;
+
+		multi {
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				/* SM link port */
+				port@0 {
+					reg = <0>;
+
+					smcodec0_port0_ep: endpoint {
+						remote-endpoint = <&cpu0_port0_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					smcodec0_port1_ep: endpoint {
+						remote-endpoint = <&codec0_port0_ep>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+
+					smcodec0_port2_ep: endpoint {
+						remote-endpoint = <&codec0_port1_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu0 {
+		compatible = "test-cpu";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			cpu0_port0: port@0 {
+				reg = <0>;
+
+				cpu0_port0_ep: endpoint {
+					remote-endpoint = <&smcodec0_port0_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec0 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				codec0_port0_ep: endpoint {
+					remote-endpoint = <&smcodec0_port1_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				codec0_port1_ep: endpoint {
+					remote-endpoint = <&smcodec0_port2_ep>;
+				};
+			};
+		};
+	};
+
+	/*
+	 * Testcase 01
+	 *
+	 * DESCRIPTION: test semi-multi link with explicitly disabled CPU.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	                       +-+
+	 *      TEST_CPU1 <-@...-----> | |-> TEST_CODEC1/P0
+	 *                             | |-> TEST_CODEC1/P1
+	 *                             +-+
+	 *
+	 *      TEST_CPU2 <---@...-> TEST_CODEC2 (ACTIVE)
+	 *
+	 *
+	 *	TEST_CPU1 => DISABLED
+	 *	TEST_CPU2 => ENABLED
+	 *	TEST_CODEC1 => ENABLED
+	 *	TEST_CODEC2 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 1 explicitly disabled link.
+	 */
+	 test-case-01 {
+		compatible = "audio-graph-card2";
+		label = "test-case-01";
+		links = <&cpu1_port>, <&cpu2_port>;
+
+		multi {
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				/* SM link port */
+				port@0 {
+					reg = <0>;
+
+					smcodec1_port0_ep: endpoint {
+						remote-endpoint = <&cpu1_port_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					smcodec1_port1_ep: endpoint {
+						remote-endpoint = <&codec1_port0_ep>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+
+					smcodec1_port2_ep: endpoint {
+						remote-endpoint = <&codec1_port1_ep>;
+					};
+				};
+			};
+		};
+	 };
+
+	test-cpu1 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		cpu1_port: port {
+			cpu1_port_ep: endpoint {
+				remote-endpoint = <&smcodec1_port0_ep>;
+			};
+		};
+	};
+
+	test-cpu2 {
+		compatible = "test-cpu";
+
+		cpu2_port: port {
+			cpu2_port_ep: endpoint {
+				remote-endpoint = <&codec2_port_ep>;
+			};
+		};
+	};
+
+	test-codec1 {
+		compatible = "test-codec";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				codec1_port0_ep: endpoint {
+					remote-endpoint = <&smcodec1_port1_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				codec1_port1_ep: endpoint {
+					remote-endpoint = <&smcodec1_port2_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec2 {
+		compatible = "test-codec";
+
+		port {
+			codec2_port_ep: endpoint {
+				remote-endpoint = <&cpu2_port_ep>;
+			};
+		};
+	};
+
+	/*
+	 * Testcase 02
+	 *
+	 * DESCRIPTION: test semi-multi link with one explicitly disabled codec.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	                       +-+
+	 *      TEST_CPU3 <-@...-----> | |-> TEST_CODEC3 (ACTIVE)
+	 *       (ACTIVE)              | |-> TEST_CODEC4 (DISABLED)
+	 *                             +-+
+	 *
+	 *      TEST_CPU4 <---@...-> TEST_CODEC5 (ACTIVE)
+	 *       (ACTIVE)
+	 *
+	 *
+	 *	TEST_CPU3 => ENABLED
+	 *	TEST_CPU4 => ENABLED
+	 *	TEST_CODEC3 => ENABLED
+	 *	TEST_CODEC4 => DISABLED
+	 *	TEST_CODEC5 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 1 explicitly disabled link.
+	 */
+	 test-case-02 {
+		compatible = "audio-graph-card2";
+		label = "test-case-02";
+		links = <&cpu3_port>, <&cpu4_port>;
+
+		multi {
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				/* SM link port */
+				port@0 {
+					reg = <0>;
+
+					smcodec2_port0_ep: endpoint {
+						remote-endpoint = <&cpu3_port_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					smcodec2_port1_ep: endpoint {
+						remote-endpoint = <&codec3_port_ep>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+
+					smcodec2_port2_ep: endpoint {
+						remote-endpoint = <&codec4_port_ep>;
+					};
+				};
+			};
+		};
+	 };
+
+	test-cpu3 {
+		compatible = "test-cpu";
+
+		cpu3_port: port {
+			cpu3_port_ep: endpoint {
+				remote-endpoint = <&smcodec2_port0_ep>;
+			};
+		};
+	};
+
+	test-cpu4 {
+		compatible = "test-cpu";
+
+		cpu4_port: port {
+			cpu4_port_ep: endpoint {
+				remote-endpoint = <&codec5_port_ep>;
+			};
+		};
+	};
+
+	test-codec3 {
+		compatible = "test-codec";
+
+		port {
+			codec3_port_ep: endpoint {
+				remote-endpoint = <&smcodec2_port1_ep>;
+			};
+		};
+	};
+
+	test-codec4 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		port {
+			codec4_port_ep: endpoint {
+				remote-endpoint = <&smcodec2_port2_ep>;
+			};
+		};
+	};
+
+	test-codec5 {
+		compatible = "test-codec";
+
+		port {
+			codec5_port_ep: endpoint {
+				remote-endpoint = <&cpu4_port_ep>;
+			};
+		};
+	};
+
+	/*
+	 * Testcase 03
+	 *
+	 * DESCRIPTION: test disabled multi link.
+	 *
+	 * TOPOLOGY:
+	 *                      +---+            +---+
+	 *      TEST_CPU5/P0 <- |   | <---@...-> |   | -> TEST_CODEC6/P0
+	 *      TEST_CPU5/P1 <- |   |            |   | -> TEST_CODEC6/P1
+	 *                      +---+            +---+
+	 *
+	 *
+	 *	TEST_CPU5 => DISABLED
+	 *	TEST_CODEC6 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should fail since all of its links are
+	 *	explicitly disabled.
+	 */
+	test-case-03 {
+		compatible = "audio-graph-card2";
+		label = "test-case-03";
+		links = <&multi0_cpu_port0>;
+
+		multi {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				multi0_cpu_port0: port@0 {
+					reg = <0>;
+
+					multi0_cpu_port0_ep: endpoint {
+						remote-endpoint = <&multi0_codec_port0_ep>;
+					};
+				};
+
+				multi0_cpu_port1: port@1 {
+					reg = <1>;
+
+					multi0_cpu_port1_ep: endpoint {
+						remote-endpoint = <&cpu6_port0_ep>;
+					};
+				};
+
+				multi0_cpu_port2: port@2 {
+					reg = <2>;
+
+					multi0_cpu_port2_ep: endpoint {
+						remote-endpoint = <&cpu6_port1_ep>;
+					};
+				};
+			};
+
+			ports@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				multi0_codec_port0: port@0 {
+					reg = <0>;
+
+					multi0_codec_port0_ep: endpoint {
+						remote-endpoint = <&multi0_cpu_port0_ep>;
+					};
+				};
+
+				multi0_codec_port1: port@1 {
+					reg = <1>;
+
+					multi0_codec_port1_ep: endpoint {
+						remote-endpoint = <&codec6_port0_ep>;
+					};
+				};
+
+				multi0_codec_port2: port@2 {
+					reg = <2>;
+
+					multi0_codec_port2_ep: endpoint {
+						remote-endpoint = <&codec6_port1_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu5 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			cpu6_port0: port@0 {
+				reg = <0>;
+
+				cpu6_port0_ep: endpoint {
+					remote-endpoint = <&multi0_cpu_port1_ep>;
+				};
+			};
+
+			cpu6_port1: port@1 {
+				reg = <1>;
+
+				cpu6_port1_ep: endpoint {
+					remote-endpoint = <&multi0_cpu_port2_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec6 {
+		compatible = "test-codec";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			codec6_port0: port@0 {
+				reg = <0>;
+
+				codec6_port0_ep: endpoint {
+					remote-endpoint = <&multi0_codec_port1_ep>;
+				};
+			};
+
+			codec6_port1: port@1 {
+				reg = <1>;
+
+				codec6_port1_ep: endpoint {
+					remote-endpoint = <&multi0_codec_port2_ep>;
+				};
+			};
+		};
+	};
+
+	/*
+	 * Testcase 04
+	 *
+	 * DESCRIPTION: test multi link with disabled CPU.
+	 *
+	 * TOPOLOGY:
+	 *                      +---+            +---+
+	 *      TEST_CPU7/P0 <- |   | <---@...-> |   | -> TEST_CODEC8/P0
+	 *      TEST_CPU7/P1 <- |   |            |   | -> TEST_CODEC8/P1
+	 *                      +---+            +---+
+	 *
+	 *      TEST_CPU6 <---@...--> TEST_CODEC7
+	 *
+	 *
+	 *	TEST_CPU6 => ENABLED
+	 *	TEST_CPU7 => DISABLED
+	 *	TEST_CODEC7 => ENABLED
+	 *	TEST_CODEC8 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 1 explicitly disabled link.
+	 */
+	test-case-04 {
+		compatible = "audio-graph-card2";
+		label = "test-case-04";
+		links = <&cpu6_port>, <&multi1_cpu_port0>;
+
+		multi {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				multi1_cpu_port0: port@0 {
+					reg = <0>;
+
+					multi1_cpu_port0_ep: endpoint {
+						remote-endpoint = <&multi1_codec_port0_ep>;
+					};
+				};
+
+				multi1_cpu_port1: port@1 {
+					reg = <1>;
+
+					multi1_cpu_port1_ep: endpoint {
+						remote-endpoint = <&cpu7_port0_ep>;
+					};
+				};
+
+				multi1_cpu_port2: port@2 {
+					reg = <2>;
+
+					multi1_cpu_port2_ep: endpoint {
+						remote-endpoint = <&cpu7_port1_ep>;
+					};
+				};
+			};
+
+			ports@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				multi1_codec_port0: port@0 {
+					reg = <0>;
+
+					multi1_codec_port0_ep: endpoint {
+						remote-endpoint = <&multi1_cpu_port0_ep>;
+					};
+				};
+
+				multi1_codec_port1: port@1 {
+					reg = <1>;
+
+					multi1_codec_port1_ep: endpoint {
+						remote-endpoint = <&codec8_port0_ep>;
+					};
+				};
+
+				multi1_codec_port2: port@2 {
+					reg = <2>;
+
+					multi1_codec_port2_ep: endpoint {
+						remote-endpoint = <&codec8_port1_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu6 {
+		compatible = "test-cpu";
+
+		cpu6_port: port {
+			cpu6_port_ep: endpoint {
+				remote-endpoint = <&codec7_port_ep>;
+			};
+		};
+	};
+
+	test-cpu7 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			cpu7_port0: port@0 {
+				reg = <0>;
+
+				cpu7_port0_ep: endpoint {
+					remote-endpoint = <&multi1_cpu_port1_ep>;
+				};
+			};
+
+			cpu7_port1: port@1 {
+				reg = <1>;
+
+				cpu7_port1_ep: endpoint {
+					remote-endpoint = <&multi1_cpu_port2_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec7 {
+		compatible = "test-codec";
+
+		port {
+			codec7_port_ep: endpoint {
+				remote-endpoint = <&cpu6_port_ep>;
+			};
+		};
+	};
+
+	test-codec8 {
+		compatible = "test-codec";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			codec8_port0: port@0 {
+				reg = <0>;
+
+				codec8_port0_ep: endpoint {
+					remote-endpoint = <&multi1_codec_port1_ep>;
+				};
+			};
+
+			codec8_port1: port@1 {
+				reg = <1>;
+
+				codec8_port1_ep: endpoint {
+					remote-endpoint = <&multi1_codec_port2_ep>;
+				};
+			};
+		};
+	};
+
+	/*
+	 * Testcase 05
+	 *
+	 * DESCRIPTION: test N:M (CPUS:CODECS), N < M multi link with disabled codec.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *			+---+            +---+
+	 *                      |   | <---@...-> |   |
+	 *                      |   |            |   |
+	 *      TEST_CPU8/P0 <- |   | <--------> |   | -> TEST_CODEC9/P0
+	 *      TEST_CPU8/P1 <- |   | <---+----> |   | -> TEST_CODEC9/P1
+	 *                      |   |     \----> |   | -> TEST_CODEC9/P2
+	 *                      +---+            +---+
+	 *
+	 *
+	 *	TEST_CPU9 <---@...-> TEST_CODEC10
+	 *
+	 *      TEST_CPU8 => ENABLED
+	 *      TEST_CODEC9 => DISABLED
+	 *	TEST_CPU9 => ENABLED
+	 *	TEST_CODEC10 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 1 disabled link.
+	 */
+	test-case-05 {
+		compatible = "audio-graph-card2";
+		label = "test-case-05";
+		links = <&multi2_cpu_port0>, <&cpu9_port>;
+
+		multi {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				multi2_cpu_port0: port@0 {
+					reg = <0>;
+
+					multi2_cpu_port0_ep: endpoint {
+						remote-endpoint = <&multi2_codec_port0_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					multi2_cpu_port1_ep0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&cpu8_port0_ep>;
+					};
+
+					multi2_cpu_port1_ep1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&multi2_codec_port1_ep1>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					multi2_cpu_port2_ep0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&cpu8_port1_ep>;
+					};
+
+					multi2_cpu_port2_ep1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&multi2_codec_port2_ep1>;
+					};
+
+					multi2_cpu_port2_ep2: endpoint@2 {
+						reg = <2>;
+						remote-endpoint = <&multi2_codec_port3_ep1>;
+					};
+				};
+			};
+
+			ports@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					multi2_codec_port0_ep: endpoint {
+						remote-endpoint = <&multi2_cpu_port0_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					multi2_codec_port1_ep0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&codec9_port0_ep>;
+					};
+
+					multi2_codec_port1_ep1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&multi2_cpu_port1_ep1>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					multi2_codec_port2_ep0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&codec9_port1_ep>;
+					};
+
+					multi2_codec_port2_ep1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&multi2_cpu_port2_ep1>;
+					};
+				};
+
+				port@3 {
+					reg = <3>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					multi2_codec_port3_ep0: endpoint@0 {
+						reg = <0>;
+						remote-endpoint = <&codec9_port2_ep>;
+					};
+
+					multi2_codec_port3_ep1: endpoint@1 {
+						reg = <1>;
+						remote-endpoint = <&multi2_cpu_port2_ep2>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu8 {
+		compatible = "test-cpu";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				cpu8_port0_ep: endpoint {
+					remote-endpoint = <&multi2_cpu_port1_ep0>;
+				};
+			};
+
+			port@1 {
+				cpu8_port1_ep: endpoint {
+					remote-endpoint = <&multi2_cpu_port2_ep0>;
+				};
+			};
+		};
+	};
+
+	test-cpu9 {
+		compatible = "test-cpu";
+
+		cpu9_port: port {
+			cpu9_port_ep: endpoint {
+				remote-endpoint = <&codec10_port_ep>;
+			};
+		};
+	};
+
+	test-codec9 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				codec9_port0_ep: endpoint {
+					remote-endpoint = <&multi2_codec_port1_ep0>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				codec9_port1_ep: endpoint {
+					remote-endpoint = <&multi2_codec_port2_ep0>;
+				};
+			};
+
+			port@2 {
+				reg = <2>;
+
+				codec9_port2_ep: endpoint {
+					remote-endpoint = <&multi2_codec_port3_ep0>;
+				};
+			};
+		};
+	};
+
+	test-codec10 {
+		compatible = "test-codec";
+
+		port {
+			codec10_port_ep: endpoint {
+				remote-endpoint = <&cpu9_port_ep>;
+			};
+		};
+	};
+};
diff --git a/sound/soc/generic/audio-graph-card2-sample3.dtsi b/sound/soc/generic/audio-graph-card2-sample3.dtsi
new file mode 100644
index 000000000000..b96da5b5d6d3
--- /dev/null
+++ b/sound/soc/generic/audio-graph-card2-sample3.dtsi
@@ -0,0 +1,486 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright 2025 NXP
+ *
+ * audio-graph-card2 DPCM/C2C link test scenarios
+ *
+ * IMPORTANT:
+ *
+ *	1) DO NOT use this alongside the other test scenarios as the
+ *	node names are not unique across test DTSIs.
+ *
+ *	2) The test topologies used here are adapted from
+ *	"audio-graph-card2-custom-sample2.dtsi"
+ */
+
+/ {
+	/*
+	 * Testcase 00:
+	 *
+	 * DESCRIPTION: test DPCM links with CODEC disabled.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *			      ****
+	 *	TEST_CPU0/P0 <---@...-*  * ----@---> TEST_CODEC0
+	 *	TEST_CPU0/P1 <---@...-*  *
+	 *                            ****
+	 *
+	 *	TEST_CPU0 => ENABLED
+	 *	TEST_CODEC0 => DISABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with only the FEs being
+	 *	created. Attempting to play a song on any of the FEs should
+	 *	result in an error since there's no BE attached.
+	 */
+	test-case-00 {
+		compatible = "audio-graph-card2";
+		label = "test-case-00";
+		links = <&fe0_port0>, <&fe0_port1>, <&be0_port0>;
+		routing = "TC DAI0 Playback", "DAI0 Playback",
+			  "TC DAI0 Playback", "DAI1 Playback",
+			  "DAI0 Capture",     "TC DAI0 Capture",
+			  "DAI1 Capture",     "TC DAI0 Capture";
+
+		dpcm {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			/* FEs */
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				fe0_port0: port@0 {
+					reg = <0>;
+
+					fe0_port0_ep: endpoint {
+						remote-endpoint = <&cpu0_port0_ep>;
+					};
+				};
+
+				fe0_port1: port@1 {
+					reg = <1>;
+
+					fe0_port1_ep: endpoint {
+						remote-endpoint = <&cpu0_port1_ep>;
+					};
+				};
+			};
+
+			/* BEs */
+			ports@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				be0_port0: port@0 {
+					reg = <0>;
+
+					be0_port0_ep: endpoint {
+						remote-endpoint = <&codec0_port_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu0 {
+		compatible = "test-cpu";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				cpu0_port0_ep: endpoint {
+					remote-endpoint = <&fe0_port0_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				cpu0_port1_ep: endpoint {
+					remote-endpoint = <&fe0_port1_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec0 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		port {
+			prefix = "TC";
+
+			codec0_port_ep: endpoint {
+				remote-endpoint = <&be0_port0_ep>;
+			};
+		};
+	};
+
+	/*
+	 * Testcase 01:
+	 *
+	 * DESCRIPTION: test DPCM links with CPU disabled.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *			      ****
+	 *	TEST_CPU1/P0 <---@...-*  * ----@---> TEST_CODEC1
+	 *	TEST_CPU1/P1 <---@...-*  *
+	 *                            ****
+	 *
+	 *	TEST_CPU0 => DISABLED
+	 *	TEST_CODEC0 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with only the BE
+	 *	being created.
+	 */
+	test-case-01 {
+		compatible = "audio-graph-card2";
+		label = "test-case-01";
+		links = <&fe1_port0>, <&fe1_port1>, <&be1_port0>;
+		routing = "TC DAI0 Playback", "DAI0 Playback",
+			  "TC DAI0 Playback", "DAI1 Playback",
+			  "DAI0 Capture",     "TC DAI0 Capture",
+			  "DAI1 Capture",     "TC DAI0 Capture";
+
+		dpcm {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			/* FEs */
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				fe1_port0: port@0 {
+					reg = <0>;
+
+					fe1_port0_ep: endpoint {
+						remote-endpoint = <&cpu1_port0_ep>;
+					};
+				};
+
+				fe1_port1: port@1 {
+					reg = <1>;
+
+					fe1_port1_ep: endpoint {
+						remote-endpoint = <&cpu1_port1_ep>;
+					};
+				};
+			};
+
+			/* BEs */
+			ports@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				be1_port0: port@0 {
+					reg = <0>;
+
+					be1_port0_ep: endpoint {
+						remote-endpoint = <&codec1_port_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu1 {
+		compatible = "test-cpu";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				cpu1_port0_ep: endpoint {
+					remote-endpoint = <&fe1_port0_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				cpu1_port1_ep: endpoint {
+					remote-endpoint = <&fe1_port1_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec1 {
+		compatible = "test-codec";
+
+		port {
+			prefix = "TC";
+
+			codec1_port_ep: endpoint {
+				remote-endpoint = <&be1_port0_ep>;
+			};
+		};
+	};
+
+	/*
+	 * Testcase 02
+	 *
+	 * DESCRIPTION: test DPCM links with multi BE with CODEC disabled.
+	 *
+	 * TOPOLOGY:
+	 *
+	 *			      ****           +---+
+	 *	TEST_CPU2/P0 <---@...-*  * ----@---> |   | -> TEST_CODEC2/P0
+	 *	TEST_CPU2/P1 <---@...-*  *           |   | -> TEST_CODEC2/P1
+	 *                            ****           +---+
+	 *
+	 *	TEST_CPU2 => ENABLED
+	 *	TEST_CODEC2 => DISABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with only the FEs being
+	 *	created.
+	 */
+	test-case-02 {
+		compatible = "audio-graph-card2";
+		label = "test-case-02";
+		links = <&fe2_port0>, <&fe2_port1>, <&multi0_be_port0>;
+
+		dpcm {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			/* FEs */
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				fe2_port0: port@0 {
+					reg = <0>;
+
+					fe2_port0_ep: endpoint {
+						remote-endpoint = <&cpu2_port0_ep>;
+					};
+				};
+
+				fe2_port1: port@1 {
+					reg = <1>;
+
+					fe2_port1_ep: endpoint {
+						remote-endpoint = <&cpu2_port1_ep>;
+					};
+				};
+			};
+
+			/* BEs */
+			ports@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				multi0_be_port0: port@0 {
+					reg = <0>;
+
+					multi0_be_port0_ep: endpoint {
+						remote-endpoint = <&multi0_codec_port0_ep>;
+					};
+				};
+			};
+		};
+
+		multi {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port@0 {
+					reg = <0>;
+
+					multi0_codec_port0_ep: endpoint {
+						remote-endpoint = <&multi0_be_port0_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					multi0_codec_port1_ep: endpoint {
+						remote-endpoint = <&codec2_port0_ep>;
+					};
+				};
+
+				port@2 {
+					reg = <2>;
+
+					multi0_codec_port2_ep: endpoint {
+						remote-endpoint = <&codec2_port1_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu2 {
+		compatible = "test-cpu";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				cpu2_port0_ep: endpoint {
+					remote-endpoint = <&fe2_port0_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				cpu2_port1_ep: endpoint {
+					remote-endpoint = <&fe2_port1_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec2 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				codec2_port0_ep: endpoint {
+					remote-endpoint = <&multi0_codec_port1_ep>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				codec2_port1_ep: endpoint {
+					remote-endpoint = <&multi0_codec_port2_ep>;
+				};
+			};
+		};
+	};
+
+	/*
+	 * Testcase 03
+	 *
+	 * DESCRIPTION: test C2C links with codec disabled
+	 *
+	 * TOPOLOGY:
+	 *
+	 *	+---@...-> TEST_CODEC3/P0
+	 *	|
+	 *	+--------> TEST_CODEC3/P1
+	 *
+	 *	TEST_CPU3 <---@...-> TEST_CODEC4
+	 *
+	 *	TEST_CPU3 => ENABLED
+	 *	TEST_CODEC3 => DISABLED
+	 *	TEST_CODEC4 => ENABLED
+	 *
+	 * RESULT:
+	 *	- sound card creation should succeed with 1 disabled link.
+	 */
+	test-case-03 {
+		compatible = "audio-graph-card2";
+		label = "test-case-03";
+		links = <&c2c0_port0>, <&cpu3_port>;
+
+		codec2codec {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				c2c0_port0: port@0 {
+					reg = <0>;
+
+					c2c0_port0_ep: endpoint {
+						remote-endpoint = <&codec3_port0_ep>;
+					};
+				};
+
+				port@1 {
+					reg = <1>;
+
+					c2c0_port1_ep: endpoint {
+						remote-endpoint = <&codec3_port1_ep>;
+					};
+				};
+			};
+		};
+	};
+
+	test-cpu3 {
+		compatible = "test-cpu";
+
+		cpu3_port: port {
+			cpu3_port_ep: endpoint {
+				remote-endpoint = <&codec4_port_ep>;
+			};
+		};
+	};
+
+	test-codec3 {
+		compatible = "test-codec";
+		status = "disabled";
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				codec3_port0_ep: endpoint {
+					remote-endpoint = <&c2c0_port0_ep>;
+				};
+			};
+
+			port@1 {
+				codec3_port1_ep: endpoint {
+					remote-endpoint = <&c2c0_port1_ep>;
+				};
+			};
+		};
+	};
+
+	test-codec4 {
+		compatible = "test-codec";
+
+		port {
+			codec4_port_ep: endpoint {
+				remote-endpoint = <&cpu3_port_ep>;
+			};
+		};
+	};
+};
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ