1/*
2 * Copyright (c) 2020, Linaro Ltd.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Application overlay for testing driver builds
7 *
8 * Names in this file should be chosen in a way that won't conflict
9 * with real-world devicetree nodes, to allow these tests to run on
10 * (and be extended to test) real hardware.
11 */
12
13/ {
14	test {
15		#address-cells = <1>;
16		#size-cells = <1>;
17
18		test_adc: adc@adc0adc0 {
19			compatible = "vnd,adc";
20			reg = <0xadc0adc0 0x1000>;
21			#io-channel-cells = <1>;
22			#address-cells = <1>;
23			#size-cells = <0>;
24			status = "okay";
25
26			channel@0 {
27				reg = <0>;
28				zephyr,gain = "ADC_GAIN_1";
29				zephyr,reference = "ADC_REF_VDD_1";
30				zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
31				zephyr,input-positive = <0>;
32				zephyr,resolution = <12>;
33			};
34
35			channel@1 {
36				reg = <1>;
37				zephyr,gain = "ADC_GAIN_1_6";
38				zephyr,reference = "ADC_REF_INTERNAL";
39				zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
40				zephyr,input-positive = <0>;
41				zephyr,resolution = <12>;
42			};
43
44			channel@2 {
45				reg = <2>;
46				zephyr,gain = "ADC_GAIN_1_6";
47				zephyr,reference = "ADC_REF_INTERNAL";
48				zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
49				zephyr,input-positive = <0>;
50				zephyr,resolution = <12>;
51			};
52
53			#include "adc.dtsi"
54		};
55
56		test_dac: dac@dac0dac0 {
57			compatible = "vnd,dac";
58			reg = <0xdac0dac0 0x1000>;
59			status = "okay";
60			#io-channel-cells = <1>;
61		};
62
63		test_gpio: gpio@deadbeef {
64			compatible = "vnd,gpio";
65			gpio-controller;
66			reg = <0xdeadbeef 0x1000>;
67			#gpio-cells = <0x2>;
68			status = "okay";
69
70			#include "gpio.dtsi"
71		};
72
73		test_i2c: i2c@11112222 {
74			#address-cells = <1>;
75			#size-cells = <0>;
76			compatible = "zephyr,i2c-emul-controller";
77			reg = <0x11112222 0x1000>;
78			status = "okay";
79			clock-frequency = <100000>;
80
81			#include "i2c.dtsi"
82		};
83
84		test_pwm: pwm@12341234 {
85			compatible = "vnd,pwm";
86			reg = <0x12341234 0x1000>;
87			#pwm-cells = <3>;
88			status = "okay";
89
90			#include "pwm.dtsi"
91		};
92
93		test_spi: spi@33334444 {
94			#address-cells = <1>;
95			#size-cells = <0>;
96			compatible = "zephyr,spi-emul-controller";
97			reg = <0x33334444 0x1000>;
98			status = "okay";
99			clock-frequency = <2000000>;
100
101			/* one entry for every devices at spi.dtsi */
102			cs-gpios = <&test_gpio 0 0>,	/* 0x00 */
103				   <&test_gpio 0 0>,
104				   <&test_gpio 0 0>,
105				   <&test_gpio 0 0>,
106				   <&test_gpio 0 0>,
107				   <&test_gpio 0 0>,
108				   <&test_gpio 0 0>,
109				   <&test_gpio 0 0>,
110				   <&test_gpio 0 0>,
111				   <&test_gpio 0 0>,
112				   <&test_gpio 0 0>,
113				   <&test_gpio 0 0>,
114				   <&test_gpio 0 0>,
115				   <&test_gpio 0 0>,
116				   <&test_gpio 0 0>,
117				   <&test_gpio 0 0>,
118				   <&test_gpio 0 0>,	/* 0x10 */
119				   <&test_gpio 0 0>,
120				   <&test_gpio 0 0>,
121				   <&test_gpio 0 0>,
122				   <&test_gpio 0 0>,
123				   <&test_gpio 0 0>,
124				   <&test_gpio 0 0>,
125				   <&test_gpio 0 0>,
126				   <&test_gpio 0 0>,
127				   <&test_gpio 0 0>,
128				   <&test_gpio 0 0>,
129				   <&test_gpio 0 0>,
130				   <&test_gpio 0 0>,
131				   <&test_gpio 0 0>,
132				   <&test_gpio 0 0>,
133				   <&test_gpio 0 0>,
134				   <&test_gpio 0 0>,	/* 0x20 */
135				   <&test_gpio 0 0>,
136				   <&test_gpio 0 0>,
137				   <&test_gpio 0 0>,
138				   <&test_gpio 0 0>,
139				   <&test_gpio 0 0>,
140				   <&test_gpio 0 0>,
141				   <&test_gpio 0 0>,
142				   <&test_gpio 0 0>,
143				   <&test_gpio 0 0>,
144				   <&test_gpio 0 0>,
145				   <&test_gpio 0 0>,
146				   <&test_gpio 0 0>,
147				   <&test_gpio 0 0>,
148				   <&test_gpio 0 0>,
149				   <&test_gpio 0 0>,
150				   <&test_gpio 0 0>;	/* 0x30 */
151
152			#include "spi.dtsi"
153		};
154
155		test_uart: uart@55556666 {
156			compatible = "vnd,serial";
157			reg = <0x55556666 0x1000>;
158			status = "okay";
159
160			#include "uart.dtsi"
161		};
162
163		test_w1: w1@66660000 {
164			compatible = "vnd,w1";
165			reg = <0x66660000 0x1000>;
166			#address-cells = <1>;
167			#size-cells = <0>;
168			status = "okay";
169
170			#include "w1.dtsi"
171		};
172
173		test_i3c: i3c@f0cacc1a {
174			#address-cells = <3>;
175			#size-cells = <0>;
176			compatible = "vnd,i3c";
177			reg = <0xf0cacc1a 0x1000>;
178			status = "okay";
179
180			#include "i3c.dtsi"
181		};
182
183	};
184};
185
186/* Put device specific modifications to properties or disabling of devices
187 * here to keep the bus specific dtsi files (i2c.dtsi, spi.dtsi, etc..)
188 * pristine
189 */
190
191/* disable device to conflict with i2c version */
192&test_i2c_ism330dhcx {
193	status = "disabled";
194};
195
196/* disable device to conflict with i2c version */
197&test_spi_bme280 {
198	status = "disabled";
199};
200
201/* disable device to conflict with i2c version */
202&test_spi_iis2dh {
203	status = "disabled";
204};
205