xref: /linux/drivers/of/unittest-data/tests-interrupts.dtsi (revision a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0)
1b2441318SGreg Kroah-Hartman// SPDX-License-Identifier: GPL-2.0
219fd7487SGrant Likely
319fd7487SGrant Likely/ {
419fd7487SGrant Likely	testcase-data {
519fd7487SGrant Likely		interrupts {
619fd7487SGrant Likely			#address-cells = <1>;
719fd7487SGrant Likely			#size-cells = <1>;
8*517dba97SGeert Uytterhoeven
919fd7487SGrant Likely			test_intc0: intc0 {
1019fd7487SGrant Likely				interrupt-controller;
1119fd7487SGrant Likely				#interrupt-cells = <1>;
1219fd7487SGrant Likely			};
1319fd7487SGrant Likely
1419fd7487SGrant Likely			test_intc1: intc1 {
1519fd7487SGrant Likely				interrupt-controller;
1619fd7487SGrant Likely				#interrupt-cells = <3>;
1719fd7487SGrant Likely			};
1819fd7487SGrant Likely
1919fd7487SGrant Likely			test_intc2: intc2 {
2019fd7487SGrant Likely				interrupt-controller;
2119fd7487SGrant Likely				#interrupt-cells = <2>;
2219fd7487SGrant Likely			};
2319fd7487SGrant Likely
2419fd7487SGrant Likely			test_intmap0: intmap0 {
2519fd7487SGrant Likely				#interrupt-cells = <1>;
2619fd7487SGrant Likely				#address-cells = <0>;
2719fd7487SGrant Likely				interrupt-map = <1 &test_intc0 9>,
2819fd7487SGrant Likely						<2 &test_intc1 10 11 12>,
2919fd7487SGrant Likely						<3 &test_intc2 13 14>,
3019fd7487SGrant Likely						<4 &test_intc2 15 16>;
3119fd7487SGrant Likely			};
3219fd7487SGrant Likely
3319fd7487SGrant Likely			test_intmap1: intmap1 {
3419fd7487SGrant Likely				#interrupt-cells = <2>;
3595265655SFrank Rowand				/*
3695265655SFrank Rowand				 * #address-cells is required
3795265655SFrank Rowand				 *
3895265655SFrank Rowand				 * The property is not provided in this node to
3995265655SFrank Rowand				 * test that the code will properly handle
4095265655SFrank Rowand				 * this case for legacy .dts files.
4195265655SFrank Rowand				 *
4295265655SFrank Rowand				 * Not having #address-cells will result in a
4395265655SFrank Rowand				 * warning from dtc starting with
4495265655SFrank Rowand				 * version v1.6.1-19-g0a3a9d3449c8
4595265655SFrank Rowand				 * The warning is suppressed by adding
4695265655SFrank Rowand				 * -Wno-interrupt_map to the Makefile for all
4795265655SFrank Rowand				 * .dts files this include this .dtsi
4895265655SFrank Rowand				#address-cells = <1>;
4995265655SFrank Rowand				 */
5019fd7487SGrant Likely				interrupt-map = <0x5000 1 2 &test_intc0 15>;
5119fd7487SGrant Likely			};
5219fd7487SGrant Likely
5319fd7487SGrant Likely			interrupts0 {
5419fd7487SGrant Likely				interrupt-parent = <&test_intc0>;
5519fd7487SGrant Likely				interrupts = <1>, <2>, <3>, <4>;
5619fd7487SGrant Likely			};
5719fd7487SGrant Likely
5819fd7487SGrant Likely			interrupts1 {
5919fd7487SGrant Likely				interrupt-parent = <&test_intmap0>;
6019fd7487SGrant Likely				interrupts = <1>, <2>, <3>, <4>;
6119fd7487SGrant Likely			};
6219fd7487SGrant Likely
6319fd7487SGrant Likely			interrupts-extended0 {
6419fd7487SGrant Likely				reg = <0x5000 0x100>;
6595265655SFrank Rowand				/*
6695265655SFrank Rowand				 * Do not remove &test_intmap1 from this
6795265655SFrank Rowand				 * property - see comment in node intmap1
6895265655SFrank Rowand				 */
6919fd7487SGrant Likely				interrupts-extended = <&test_intc0 1>,
7019fd7487SGrant Likely						      <&test_intc1 2 3 4>,
7119fd7487SGrant Likely						      <&test_intc2 5 6>,
7219fd7487SGrant Likely						      <&test_intmap0 1>,
7319fd7487SGrant Likely						      <&test_intmap0 2>,
7419fd7487SGrant Likely						      <&test_intmap0 3>,
7519fd7487SGrant Likely						      <&test_intmap1 1 2>;
7619fd7487SGrant Likely			};
7719fd7487SGrant Likely		};
7819fd7487SGrant Likely
7919fd7487SGrant Likely		testcase-device1 {
8019fd7487SGrant Likely			compatible = "testcase-device";
8119fd7487SGrant Likely			interrupt-parent = <&test_intc0>;
8219fd7487SGrant Likely			interrupts = <1>;
8319fd7487SGrant Likely		};
8419fd7487SGrant Likely
85d92e2443SViresh Kumar		/*
86d92e2443SViresh Kumar		 * testcase data that intentionally results in an error is
87d92e2443SViresh Kumar		 * located in testcases.dts instead of in this file so that the
88d92e2443SViresh Kumar		 * static overlay apply tests will not include the error.
89d92e2443SViresh Kumar		 */
9019fd7487SGrant Likely	};
9119fd7487SGrant Likely};
92